--- /dev/null
+Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation on the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
--- /dev/null
+commit 09d2ddd805a00568e4b7f668b0f500a63c350940
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Oct 28 16:56:29 2010 -0700
+
+ libdmx 1.1.1
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 83fa1d94d11f368824bea6ba64e9575b57f87769
+Author: Jesse Adkins <jesserayadkins@gmail.com>
+Date: Tue Sep 28 13:30:04 2010 -0700
+
+ Purge cvs tags.
+
+ Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit db8beb3d19f152a87249fa91c957e4782f47df77
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed Jul 7 15:10:34 2010 -0700
+
+ config: upgrade to util-macros 1.8 for additional man page support
+
+ Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+ The value of MAN_SUBST is the same for all X.Org packages.
+
+ Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+ The existing statement can now be removed from the configuration file.
+
+ Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED)
+ Enables silent rule and use platform appropriate version of sed.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 309745fc0095cccc575ead3446480060091161f1
+Author: Fernando Carrijo <fcarrijo@yahoo.com.br>
+Date: Thu Jul 1 06:48:47 2010 -0300
+
+ Purge macros NEED_EVENTS and NEED_REPLIES
+
+ Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
+ Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 6d9de78c3cde1e7963cafc6e8155b3e2ea5819c1
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Mar 29 16:50:34 2010 -0400
+
+ config: update AC_PREREQ statement to 2.60
+
+ Unrelated to the previous patches, the new value simply reflects
+ the reality that the minimum level for autoconf to configure
+ all x.org modules is 2.60 dated June 2006.
+
+ ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 6163288513cc166c5e8b9488b08a2d07e7100755
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Mar 29 14:53:49 2010 -0400
+
+ config: remove the pkgconfig pc.in file from EXTRA_DIST
+
+ Automake always includes it in the tarball.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit a8b1449bca44bfddd2e7228bb7d514512e4ef30c
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Feb 16 10:37:21 2010 -0500
+
+ config: move CWARNFLAGS from configure.ac to Makefile.am
+
+ Compiler warning flags should be explicitly set in the makefile
+ rather than being merged with other packages compiler flags.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 442b50b94eaae9202e76c170738fcc049dcc453d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Jan 13 16:04:33 2010 -0500
+
+ COPYING: replace stub with actual copyright notices
+
+ Refer to dmx.c
+ Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit c34b17f997f63842649b93e1575cd2bc322e8f4e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Nov 27 20:56:05 2009 -0500
+
+ Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+
+ Now that the INSTALL file is generated.
+ Allows running make maintainer-clean.
+
+commit fdf48235bc529bbda112a70dbd6e9ff560ca6a04
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Oct 28 14:09:10 2009 -0400
+
+ INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+
+ Add missing INSTALL file. Use standard GNU file on building tarball
+ README may have been updated
+ Remove AUTHORS file as it is empty and no content available yet.
+ Remove NEWS file as it is empty and no content available yet.
+
+commit fa6e6e76d9a58d021473369e4a9ff287e7e42e15
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Oct 27 15:07:25 2009 -0400
+
+ Deploy the new XORG_DEFAULT_OPTIONS #24242
+
+ This macro aggregate a number of existing macros that sets commmon
+ X.Org components configuration options. It shields the configuration file from
+ future changes.
+
+commit 4a78271ada80b64eeb5f6563fd9d1a161abc7afe
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Oct 26 22:08:43 2009 -0400
+
+ Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+
+ ChangeLog filename is known to Automake and requires no further
+ coding in the makefile.
+
+commit 4fd8605292125d95d1eb58fec1b7daff2f35ec26
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Oct 22 13:11:11 2009 -0400
+
+ .gitignore: use common defaults with custom section # 24239
+
+ Using common defaults will reduce errors and maintenance.
+ Only the very small or inexistent custom section need periodic maintenance
+ when the structure of the component changes. Do not edit defaults.
+
+commit fad53bf1e485036146570d9ead901f23bf4c323f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Oct 22 12:34:20 2009 -0400
+
+ .gitignore: use common defaults with custom section # 24239
+
+ Using common defaults will reduce errors and maintenance.
+ Only the very small or inexistent custom section need periodic maintenance
+ when the structure of the component changes. Do not edit defaults.
+
+commit c43a769428a03c0de58545c611e75243a8d8f2ea
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date: Wed Oct 21 12:47:27 2009 -0700
+
+ This is not a GNU project, so declare it foreign.
+
+ On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+ > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+ > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+ > > was quite annoying to work around since 'autoreconf -fvi' replaces
+ > > it and git wants to commit it. Should these files even be in git?
+ > > Can I nuke them for the betterment of humanity and since they get
+ > > created by autoreconf anyways?
+ >
+ > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+
+ As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+ AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+ of the INSTALL file. It is also part of the 24206 solution.
+
+ Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit a3ff756a3a478162a6f96b9fbf54c9f1a487af38
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Oct 5 11:54:43 2009 +1000
+
+ libdmx 1.1.0
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9d7cb1321dd44081f52a80419c32bbbbb155757f
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Oct 5 11:54:09 2009 +1000
+
+ Require macros 1.3 for XORG_DEFAULT_OPTIONS
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1cb350964c416963523aca0234dc24563ef29d1b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Aug 28 10:07:10 2009 +1000
+
+ libdmx 1.0.99.1
+
+commit 72929c5cb3b78d3b83a2f40e3662104194b70cd6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Aug 25 16:07:54 2009 +1000
+
+ Move dmxext.h from dmxproto to here.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c46bf972f2f0658e0fe473e978c1a7153b68d0e9
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Mon Feb 2 20:34:37 2009 -0800
+
+ Add README with pointers to mailing list, bugzilla & git repos
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit ca08b93d5829a03e464fb27d96292c37825aa5ea
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Wed Jan 28 16:11:37 2009 -0200
+
+ Janitor: correct make distcheck.
+
+commit 628281b17467fc8237d9d9e2443cb9e88d8e07c5
+Author: Julien Cristau <jcristau@debian.org>
+Date: Sun May 11 14:18:34 2008 +0200
+
+ Use __libmansuffix__ instead of hardcoding 3X in the dmx manpages
+
+commit cfd82b1ff1033dbb3d83fd71e8b1af5535108245
+Author: James Cloos <cloos@jhcloos.com>
+Date: Thu Dec 6 16:38:48 2007 -0500
+
+ Replace static ChangeLog with dist-hook to generate from git log
+
+commit a49ce3a7f23e0bfab84661afea15602403445c5a
+Author: James Cloos <cloos@jhcloos.com>
+Date: Mon Sep 3 05:53:54 2007 -0400
+
+ Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 88286ad8dee07f4a06c8cfc032606ad26972fd3f
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jul 13 14:59:15 2006 -0700
+
+ renamed: .cvsignore -> .gitignore
+
+commit fe6012c309b7465a81535a5b18f70cac44fb33fb
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Wed Apr 26 23:51:19 2006 +0000
+
+ Bump to 1.0.2
+
+commit 44c22b0f24d2cc835d088b9da65cf5ade41a2854
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Fri Apr 7 00:31:17 2006 +0000
+
+ Coverity #928: Don't dereference screen if it's null.
+
+commit 3aec4c999217de52ee28beb5dc429e84f25a4cee
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Dec 21 02:30:06 2005 +0000
+
+ Update package version for X11R7 release.
+
+commit 61ba01b94fda571fc02287cfb321e7ace5f4e344
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Mon Dec 19 16:28:28 2005 +0000
+
+ Stub COPYING files
+
+commit 1594c277fed66ac77eff2687cfa586a82c649594
+Author: Kevin E Martin <kem@kem.org>
+Date: Thu Dec 15 00:24:35 2005 +0000
+
+ Update package version number for final X11R7 release candidate.
+
+commit e608c6a473d3ff6abd7290301d10929e37a2de9d
+Author: Kevin E Martin <kem@kem.org>
+Date: Tue Dec 6 22:48:46 2005 +0000
+
+ Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 7f82999694f562b664190cd2d0041ac3dc8b7e0e
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 05:49:46 2005 +0000
+
+ Update package version number for X11R7 RC3 release.
+
+commit 074fde5f1862e7ca6e18ac198baf7ec3359a2fa5
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 04:41:52 2005 +0000
+
+ Add check and cflags for malloc(0) returning NULL.
+
+commit 2f295bd0ca857cc50b98170a91a98d94c6c1fab7
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Nov 28 22:03:07 2005 +0000
+
+ Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
+ update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
+
+commit a064437898064f0906e1676caa5823c8334e77c7
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Nov 19 07:15:44 2005 +0000
+
+ Update pkgconfig files to separate library build-time dependencies from
+ application build-time dependencies, and update package deps to work
+ with separate build roots.
+
+commit 6424ff482a845160bc1146bb8a17fa2bde976685
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Sun Nov 13 18:14:22 2005 +0000
+
+ Use $(LIB_MAN_SUFFIX) instead of forcing man pages into section 3. Use sed
+ to substitute variables in man pages.
+
+commit 68ee705e1066d5092bc266c9d47d6c1022be2f1c
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Oct 19 02:48:12 2005 +0000
+
+ Update package version number for RC1 release.
+
+commit c0414eb4d8c710fac94ea32bc47031e1855c6fdb
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Wed Aug 3 03:28:03 2005 +0000
+
+ Do PKG_CHECK_MODULES on a unique token instead of on "DEP", so builds with
+ a global configure cache don't get confused.
+
+commit e51544b67812183184becaf6cd2ba907483bcea7
+Author: Kevin E Martin <kem@kem.org>
+Date: Fri Jul 29 21:22:53 2005 +0000
+
+ Various changes preparing packages for RC0:
+ - Verify and update package version numbers as needed
+ - Implement versioning scheme
+ - Change bug address to point to bugzilla bug entry form
+ - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+ reenable it)
+ - Fix makedepend to use pkgconfig and pass distcheck
+ - Update build script to build macros first
+ - Update modular Xorg version
+
+commit 0e287fb569607a88500fc8ead709113da7d62a76
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Wed Jul 20 12:10:12 2005 +0000
+
+ Set soversion to 1.0.0 with -version-number.
+
+commit 1665593dffc0a2a15b4c2dbd50e0f4ef655c7d49
+Author: Daniel Stone <daniel@fooishbar.org>
+Date: Sat Jul 16 07:49:42 2005 +0000
+
+ Set soversion to 1.0 using -version-number.
+
+commit b5b357df37d6adb66daedf8a9950bf653bf4c54d
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Jul 9 21:11:25 2005 +0000
+
+ Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory
+
+commit 63d3d3060793b834a6f55a1788ed74dd91ff1635
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Wed Jun 22 22:46:39 2005 +0000
+
+ Apply these patches from Theo van Klaveren:
+ lib-dmx.patch lib-FS.patch lib-X11.patch lib-XRes.patch
+ lib-XScrnSaver.patch lib-xtrans.patch
+ to make the libraries distcheck.
+
+commit 414f10d9cd304ad410eaab1faeb9bec6db99a254
+Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
+Date: Tue Jun 21 15:41:37 2005 +0000
+
+ lib/XScrnSaver/configure.ac
+ lib/XScrnSaver/src/Makefile.am
+ lib/Xfontcache/configure.ac
+ lib/Xfontcache/src/Makefile.am
+ lib/Xinerama/configure.ac
+ lib/Xinerama/src/Makefile.am
+ lib/Xtst/configure.ac
+ lib/Xv/configure.ac
+ lib/XvMC/configure.ac
+ lib/dmx/configure.ac Add missing xext.pc and xextproto.pc Add DEP_CFLAGS to
+ src/Makefile.am
+
+commit 110b58cc4b1fe556937d0cc10c21e8d378bf557f
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon Jun 13 22:41:49 2005 +0000
+
+ Dummy change
+
+commit 87e6dd4a3b2911df52c748cbaf25d9f2f1e39267
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon Jun 13 22:41:28 2005 +0000
+
+ Dummy change to make CVS see this file.
+
+commit 731efd283366cdef8f55a5c0e533603eae2dc9cd
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon Jun 13 22:40:55 2005 +0000
+
+ *** empty log message ***
+
+commit b15aee70c23e46cc06023c42359ae831b4aa97e5
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon Jun 13 21:18:09 2005 +0000
+
+ Really add the dmx build system.
+ Also, in some ways CVS is not an optimal version control system.
+
+commit 48338cc9c422ff0ac4b9c532088649f2f3c4e2bb
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Mon Jun 13 21:11:44 2005 +0000
+
+ - Add dmx build system
+ - Rename man pages: man -> 3
+ - dmx.c: include <X11/extensions/blah.h> instead of "blah.h"
+
+commit 9569816261fed00b3f0991abb676d60ba904c0f6
+Author: Kevin E Martin <kem@kem.org>
+Date: Mon Dec 6 20:04:04 2004 +0000
+
+ Fix overwrite in DMX library calls (Bug #1989, Mark McLoughlin).
+
+commit 90b1782cf132d4d3a753e4643fe8c398cecbb07b
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Jun 30 20:06:53 2004 +0000
+
+ Add Distributed Multihead X (DMX) support
--- /dev/null
+#
+# 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 = src man
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dmx.pc
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
--- /dev/null
+libdmx - X Window System DMX (Distributed Multihead X) extension library
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/xorg/lib/libdmx
+
+ http://cgit.freedesktop.org/xorg/lib/libdmx
+
+For patch submission instructions, see:
+
+ http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
--- /dev/null
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
--- /dev/null
+
+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.
+
+AC_PREREQ([2.60])
+
+AC_INIT([libdmx], [1.1.1],
+ [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libdmx])
+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
+AM_CONFIG_HEADER(config.h)
+
+# Check for progs
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+# Check for dependencies
+PKG_CHECK_MODULES(DMX, x11 xext xextproto [dmxproto >= 2.2.99.1])
+
+XORG_CHECK_MALLOC_ZERO
+
+AC_OUTPUT([Makefile
+ src/Makefile
+ man/Makefile
+ dmx.pc])
--- /dev/null
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit"
+ (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+ may be git'cherry-picked into the Debian repository. In this
+ case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+ with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+ git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
--- /dev/null
+libdmx (1:1.1.1-1slp2) unstable; urgency=low
+
+ * [X11R7.6] upgrade package
+ * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdmx
+ * Tag: libdmx_1.1.1-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Mon, 03 Jan 2011 21:45:36 +0900
+
+libdmx (1:1.1.0-3slp2) unstable; urgency=low
+
+ * Modify the changelog
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libdmx
+ * Tag: libdmx_1.1.0-3slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Fri, 26 Nov 2010 15:42:45 +0900
+
+libdmx (1:1.1.0-2) unstable; urgency=low
+
+ * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 06 Jan 2010 13:02:42 +0000
+
+libdmx (1:1.1.0-1) experimental; urgency=low
+
+ [ Timo Aaltonen ]
+ * New upstream release.
+ * Bump the build-dep on xutils-dev (>= 1:7.5~1).
+
+ -- Julien Cristau <jcristau@debian.org> Sat, 28 Nov 2009 16:07:39 +0100
+
+libdmx (1:1.0.99.1-1) experimental; urgency=low
+
+ [ Brice Goglin ]
+ * Add upstream URL to debian/copyright.
+ * Add a link to www.X.org and a reference to the upstream module
+ in the long description.
+
+ [ Julien Cristau ]
+ * New upstream release candidate.
+ * dmxext.h has moved here from dmxproto; add build-dep on new proto, add
+ Replaces to libdmx-dev.
+ * Run autoreconf at build time.
+ * Parse space-separated DEB_BUILD_OPTIONS, handle parallel=N.
+ * Move libdmx1-dbg to new 'debug' section.
+ * Drop Pre-Depends on x11-common which was necessary for upgrades from
+ sarge.
+ * Bump Standards-Version to 3.8.3.
+
+ -- Julien Cristau <jcristau@debian.org> Sat, 05 Sep 2009 17:21:33 +0200
+
+libdmx (1:1.0.2-3) unstable; urgency=low
+
+ * Remove outdated cvs information from the package descriptions, and add
+ Vcs-* headers.
+ * Drop pre-dependency on x11-common from libdmx1, it's not needed.
+ * Remove Branden and Fabio from Uploaders with their permission.
+ * Don't build-depend on packages with a -1 debian revision.
+ * Bump Standards-Version to 3.7.3.
+ * Use ${binary:Version} instead of ${Source-Version} in dependencies.
+ * Add correct Section control fields for binary packages.
+ * libdmx1-dbg doesn't need a dependency on x11-common.
+ * Add myself to Uploaders.
+ * autoreconf with recent autotools to get updated config.{guess,sub}.
+
+ -- Julien Cristau <jcristau@debian.org> Sun, 11 May 2008 14:06:24 +0200
+
+libdmx (1:1.0.2-2) unstable; urgency=low
+
+ [ Andres Salomon ]
+ * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+ idempotency fix.
+
+ [ Drew Parsons ]
+ * dbg package has priority extra.
+
+ -- David Nusinow <dnusinow@debian.org> Tue, 29 Aug 2006 20:23:24 +0000
+
+libdmx (1:1.0.2-1) experimental; urgency=low
+
+ * New upstream release
+ * Bump debhelper compat to 5
+ * Remove extra dependency on x11-common in -dev package
+ * Bump standards version to 3.7.2.0
+ * Run dh_install with --list-missing
+ * Don't try and install header files for -dev package anymore, they're not
+ there
+
+ -- David Nusinow <dnusinow@debian.org> Mon, 3 Jul 2006 16:08:36 -0400
+
+libdmx (1:1.0.1-3) unstable; urgency=low
+
+ * Version pre-depends on x11-common properly. Thanks Josh Triplett.
+ (closes: #362877)
+ * Reorder makeshlib command in rules file so that ldconfig is run
+ properly. Thanks Drew Parsons and Steve Langasek.
+
+ -- David Nusinow <dnusinow@debian.org> Tue, 18 Apr 2006 21:54:54 -0400
+
+libdmx (1:1.0.1-2) unstable; urgency=low
+
+ * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 23 Mar 2006 22:44:19 -0500
+
+libdmx (1:1.0.1-1) experimental; urgency=low
+
+ * First upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 29 Dec 2005 20:46:13 -0500
+
+libdmx (7.0.0-2) breezy; urgency=low
+
+ * Bump libx11-dev and libxext-dev Build-Depends to avoid _XOPEN_SOURCE.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Sat, 23 Jul 2005 00:27:06 +1000
+
+libdmx (7.0.0-1) breezy; urgency=low
+
+ * First libdmx release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Mon, 16 May 2005 22:10:17 +1000
--- /dev/null
+Source: libdmx
+Section: x11
+Priority: optional
+Maintainer: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, David Nusinow <dnusinow@debian.org>, Julien Cristau <jcristau@debian.org>
+Build-Depends: debhelper (>= 5.0.0), libx11-dev (>= 1:0.99.2), x11proto-dmx-dev (>= 1:2.2.99.1), libxext-dev (>= 1:0.99.1), automake, libtool, xutils-dev (>= 1:7.5~1), pkg-config
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libdmx
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libdmx.git
+
+Package: libdmx1
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: X11 Distributed Multihead extension library
+ libdmx is an interface to the DMX extension for X, which allows a single
+ server to be set up as a proxy spanning multiple servers -- not unlike
+ Xinerama across discrete physical machines. It can be reconfigured
+ on the fly to change the layout, and it is presented as a single logical
+ display to clients.
+ .
+ libdmx allows clients to configure the layout of DMX servers by adding
+ and removing screens, input devices, et al.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libdmx
+
+Package: libdmx1-dbg
+Section: debug
+Architecture: any
+Priority: extra
+Depends: ${shlibs:Depends}, ${misc:Depends}, libdmx1 (= ${binary:Version})
+Description: X11 Distributed Multihead library (debug package)
+ libdmx is an interface to the DMX extension for X, which allows a single
+ server to be set up as a proxy spanning multiple servers -- not unlike
+ Xinerama across discrete physical machines. It can be reconfigured
+ on the fly to change the layout, and it is presented as a single logical
+ display to clients.
+ .
+ libdmx allows clients to configure the layout of DMX servers by adding
+ and removing screens, input devices, et al.
+ .
+ This package contains the debug versions of the library found in libdmx1.
+ Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libdmx
+
+Package: libdmx-dev
+Section: libdevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libdmx1 (= ${binary:Version}), libx11-dev, x11proto-dmx-dev
+Replaces: x11proto-dmx-dev (<< 1:2.2.99.1)
+Description: X11 Distributed Multihead extension library (development headers)
+ libdmx is an interface to the DMX extension for X, which allows a single
+ server to be set up as a proxy spanning multiple servers -- not unlike
+ Xinerama across discrete physical machines. It can be reconfigured
+ on the fly to change the layout, and it is presented as a single logical
+ display to clients.
+ .
+ libdmx allows clients to configure the layout of DMX servers by adding
+ and removing screens, input devices, et al.
+ .
+ This package contains the development headers for the library found in
+ libdmx1. Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libdmx
--- /dev/null
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/lib/
+
+Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation on the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
--- /dev/null
+usr/share/man/*
+usr/lib/libdmx.a
+usr/lib/libdmx.la
+usr/lib/libdmx.so
+usr/lib/pkgconfig/dmx.pc
+usr/include
--- /dev/null
+usr/lib/libdmx.so.1*
--- /dev/null
+#!/usr/bin/make -f
+# debian/rules for the Debian libdmx package.
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright © 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# set this to the name of the main shlib's binary package
+PACKAGE = libdmx1
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+ confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+# confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+
+build: build-stamp
+build-stamp:
+ dh_testdir
+ autoreconf -vfi
+ mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
+ cd obj-$(DEB_BUILD_GNU_TYPE) && \
+ ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
+ --infodir=\$${prefix}/share/info $(confflags) \
+ CFLAGS="$(CFLAGS)"
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ rm -f config.cache config.log config.status config.guess config.sub
+ rm -f */config.cache */config.log */config.status */config.guess */config.sub
+ rm -f conftest* */conftest*
+ rm -rf autom4te.cache */autom4te.cache
+ rm -rf obj-*
+ rm -f INSTALL aclocal.m4 config.h.in configure
+ rm -f depcomp install-sh ltmain.sh missing mkinstalldirs
+ find -name Makefile.in -exec rm -f {} \;
+ #find -name Makefile.in -delete
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+
+# dh_installdocs
+ dh_install --sourcedir=debian/tmp --list-missing
+# dh_installchangelogs
+ dh_link
+ dh_strip --dbg-package=$(PACKAGE)-dbg
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs
+ dh_shlibdeps
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture-independent files here.
+binary-indep: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- /dev/null
+version=3
+http://xorg.freedesktop.org/releases/individual/lib/ libdmx-(.*)\.tar\.gz
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+ exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+ exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+ exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
--- /dev/null
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number. Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+ ARCH:=$(ARCH)
+ else
+ ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+# 1) A target name that is invoked by a package-building tool or the user.
+# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+# 2) A line delcaring 1) as a phony target (".PHONY:").
+# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+# depend on other targets.
+# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+# "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir". Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again. Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+ mkdir $(STAMP_DIR)
+ >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+ >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+ mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+ if ! [ `which quilt` ]; then \
+ echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+ exit 1; \
+ fi; \
+ if $(QUILT) next >/dev/null 2>&1; then \
+ echo -n "Applying patches..."; \
+ if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "No patches to apply"; \
+ fi; \
+ >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+ rm -f $(STAMP_DIR)/patch
+ @echo -n "Unapplying patches..."; \
+ if $(QUILT) applied >/dev/null 2>/dev/null; then \
+ if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "nothing to do."; \
+ fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+ rm -f $(STAMP_DIR)/genscripts
+ rm -f debian/*.config \
+ debian/*.postinst \
+ debian/*.postrm \
+ debian/*.preinst \
+ debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+ dh_testdir
+ rm -rf .pc
+ rm -rf $(STAMP_DIR)
+ dh_clean
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems. It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+ # Ensure we're in the correct directory.
+ dh_testdir
+ grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+ @echo -n "Auditing patches..."; \
+ >$(STAMP_DIR)/log/patch; \
+ FUZZY=; \
+ while [ -n "$$($(QUILT) next)" ]; do \
+ RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+ case "$$RESULT" in \
+ succeeded) \
+ echo "fuzzy patch: $$($(QUILT) top)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+ FUZZY=yes; \
+ ;; \
+ FAILED) \
+ echo "broken patch: $$($(QUILT) next)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+ exit 1; \
+ ;; \
+ esac; \
+ done; \
+ if [ -n "$$FUZZY" ]; then \
+ echo "there were fuzzy patches; please fix."; \
+ exit 1; \
+ else \
+ echo "done."; \
+ fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+ for FILE in debian/*.config.in \
+ debian/*.postinst.in \
+ debian/*.postrm.in \
+ debian/*.preinst.in \
+ debian/*.prerm.in; do \
+ if [ -e "$$FILE" ]; then \
+ MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+ sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+ cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+ sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+ sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+ -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+ <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+ rm $$MAINTSCRIPT.tmp; \
+ fi; \
+ done
+ # Validate syntax of generated shell scripts.
+ #sh debian/scripts/validate-posix-sh debian/*.config \
+ # debian/*.postinst \
+ # debian/*.postrm \
+ # debian/*.preinst \
+ # debian/*.prerm
+ >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+ @echo error: xserver-xorg-dev needs to be installed
+ @exit 1
+else
+ echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+ echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+ echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
--- /dev/null
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts. It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions. By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+ DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+ DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+ RECONFIGURE="true"
+else
+ RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+ FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+ UPGRADE="yes"
+fi
+
+trap "message;\
+ message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+ message;\
+ exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+ # syntax: reject_nondigits [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters other than decimal digits and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain anything but digits?
+ if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ # can't use die(), because it wraps message() which wraps this function
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+ "possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+reject_unlikely_path_chars () {
+ # syntax: reject_unlikely_path_chars [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters unlikely to be seen in a path and which the shell might
+ # interpret and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain any funny characters?
+ if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+ # can't use die(), because I want to avoid forward references
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+ "encountered possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user. This is used only as a fallback in the
+# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ DEFCOLUMNS=80
+fi
+
+message () {
+ # pretty-print messages of arbitrary length
+ reject_nondigits "$COLUMNS"
+ echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+ # syntax: observe message ...
+ #
+ # issue observational message suitable for logging someday when support for
+ # it exists in dpkg
+ if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+ message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+ fi
+}
+
+warn () {
+ # syntax: warn message ...
+ #
+ # issue warning message suitable for logging someday when support for
+ # it exists in dpkg; also send to standard error
+ message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+ # syntax: die message ...
+ #
+ # exit script with error message
+ message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+ exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+ # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+ message "internal error: $*"
+ if [ -n "$OFFICIAL_BUILD" ]; then
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ fi
+ exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+ message "usage error: $*"
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+ # run $UPDATECMDS in $FONTDIRS
+
+ local dir cmd shortcmd x_font_dir_prefix
+
+ x_font_dir_prefix="/usr/share/fonts/X11"
+
+ if [ -z "$UPDATECMDS" ]; then
+ usage_error "font_update() called but \$UPDATECMDS not set"
+ fi
+ if [ -z "$FONTDIRS" ]; then
+ usage_error "font_update() called but \$FONTDIRS not set"
+ fi
+
+ reject_unlikely_path_chars "$UPDATECMDS"
+ reject_unlikely_path_chars "$FONTDIRS"
+
+ for dir in $FONTDIRS; do
+ if [ -d "$x_font_dir_prefix/$dir" ]; then
+ for cmd in $UPDATECMDS; do
+ if which "$cmd" > /dev/null 2>&1; then
+ shortcmd=${cmd##*/}
+ observe "running $shortcmd in $dir font directory"
+ cmd_opts=
+ if [ "$shortcmd" = "update-fonts-alias" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-dir" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-scale" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+ "failed; font directory data may not" \
+ "be up to date"
+ else
+ warn "$cmd not found; not updating corresponding $dir font" \
+ "directory data"
+ fi
+ done
+ else
+ warn "$dir is not a directory; not updating font directory data"
+ fi
+ done
+}
+
+remove_conffile_prepare () {
+ # syntax: remove_conffile_prepare filename official_md5sum ...
+ #
+ # Check a conffile "filename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 2 ]; then
+ usage_error "remove_conffile_prepare() called with wrong number of" \
+ "arguments; expected at least 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+ shift
+
+ # does the conffile even exist?
+ if [ -e "$conffile" ]; then
+ # calculate its checksum
+ current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+ # compare it to each supplied checksum
+ while [ -n "$1" ]; do
+ if [ "$current_checksum" = "$1" ]; then
+ # we found a match; move the confffile and stop looking
+ observe "preparing obsolete conffile $conffile for removal"
+ mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+ break
+ fi
+ shift
+ done
+ fi
+}
+
+remove_conffile_lookup () {
+ # syntax: remove_conffile_lookup package filename
+ #
+ # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+ # if it matches the actual file's md5sum.
+ #
+ # Call this function when you would call remove_conffile_prepare but only
+ # want to check against dpkg's status database instead of known checksums.
+
+ local package conffile old_md5sum
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "remove_conffile_lookup() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ package="$1"
+ conffile="$2"
+
+ if ! [ -e "$conffile" ]; then
+ return
+ fi
+ old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+ awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+ if [ -n "$old_md5sum" ]; then
+ remove_conffile_prepare "$conffile" "$old_md5sum"
+ fi
+}
+
+remove_conffile_commit () {
+ # syntax: remove_conffile_commit filename
+ #
+ # Complete the removal of a conffile "filename" that has become obsolete.
+ #
+ # Call this function from a postinst script after having used
+ # remove_conffile_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_commit() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, remove it
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "committing removal of obsolete conffile $conffile"
+ rm "$conffile.$THIS_PACKAGE-tmp"
+ fi
+}
+
+remove_conffile_rollback () {
+ # syntax: remove_conffile_rollback filename
+ #
+ # Roll back the removal of a conffile "filename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" is after having used remove_conffile_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_rollback() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, move it
+ # back
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "rolling back removal of obsolete conffile $conffile"
+ mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+ fi
+}
+
+replace_conffile_with_symlink_prepare () {
+ # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+ # official_md5sum ...
+ #
+ # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails. Otherwise copy it
+ # to newfilename and let dpkg handle it through conffiles mechanism.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 3 ]; then
+ usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+ " number of arguments; expected at least 3, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ shift
+ newconffile="$1"
+ shift
+
+ remove_conffile_prepare "$_oldconffile" "$@"
+ # If $oldconffile still exists, then md5sums didn't match.
+ # Copy it to new one.
+ if [ -f "$oldconffile" ]; then
+ cp "$oldconffile" "$newconffile"
+ fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+ # syntax: replace_conffile_with_symlink_commit oldfilename
+ #
+ # Complete the removal of a conffile "oldfilename" that has been
+ # replaced by a symlink.
+ #
+ # Call this function from a postinst script after having used
+ # replace_conffile_with_symlink_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+ "number of arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+ # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+ #
+ # Roll back the replacing of a conffile "oldfilename" with symlink to
+ # "newfilename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" and verify $2 to ensure the package failed to upgrade
+ # from a version (or install over a version removed-but-not-purged) prior
+ # to the one in which the conffile was obsoleted.
+ # You should have used replace_conffile_with_symlink_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+ "number of arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ newconffile="$2"
+
+ remove_conffile_rollback "$_oldconffile"
+ if [ -f "$newconffile" ]; then
+ rm "$newconffile"
+ fi
+}
+
+run () {
+ # syntax: run command [ argument ... ]
+ #
+ # Run specified command with optional arguments and report its exit status.
+ # Useful for commands whose exit status may be nonzero, but still acceptable,
+ # or commands whose failure is not fatal to us.
+ #
+ # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+ # those cases the return value of the debconf command *must* be checked
+ # before the string returned by debconf is used for anything.
+
+ local retval
+
+ # validate arguments
+ if [ $# -lt 1 ]; then
+ usage_error "run() called with wrong number of arguments; expected at" \
+ "least 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ "$@" || retval=$?
+
+ if [ ${retval:-0} -ne 0 ]; then
+ observe "command \"$*\" exited with status $retval"
+ fi
+}
+
+make_symlink_sane () {
+ # syntax: make_symlink_sane symlink target
+ #
+ # Ensure that the symbolic link symlink exists, and points to target.
+ #
+ # If symlink does not exist, create it and point it at target.
+ #
+ # If symlink exists but is not a symbolic link, back it up.
+ #
+ # If symlink exists, is a symbolic link, but points to the wrong location, fix
+ # it.
+ #
+ # If symlink exists, is a symbolic link, and already points to target, do
+ # nothing.
+ #
+ # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "make_symlink_sane() called with wrong number of arguments;" \
+ "expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local symlink target
+
+ symlink="$1"
+ target="$2"
+
+ if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+ observe "link from $symlink to $target already exists"
+ else
+ observe "creating symbolic link from $symlink to $target"
+ mkdir -p "${target%/*}" "${symlink%/*}"
+ ln -s -b -S ".dpkg-old" "$target" "$symlink"
+ fi
+}
+
+migrate_dir_to_symlink () {
+ # syntax: migrate_dir_to_symlink old_location new_location
+ #
+ # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+ # symbolic link to a directory or vice versa; instead, the existing state
+ # (symlink or not) will be left alone and dpkg will follow the symlink if
+ # there is one."
+ #
+ # We have to do it ourselves.
+ #
+ # This function moves the contents of old_location, a directory, into
+ # new_location, a directory, then makes old_location a symbolic link to
+ # new_location.
+ #
+ # old_location need not exist, but if it does, it must be a directory (or a
+ # symlink to a directory). If it is not, it is backed up. If new_location
+ # exists already and is not a directory, it is backed up.
+ #
+ # This function should be called from a package's preinst so that other
+ # packages unpacked after this one --- but before this package's postinst runs
+ # --- are unpacked into new_location even if their payloads contain
+ # old_location filespecs.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "migrate_dir_to_symlink() called with wrong number of"
+ "arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local new old
+
+ old="$1"
+ new="$2"
+
+ # Is old location a symlink?
+ if [ -L "$old" ]; then
+ # Does it already point to new location?
+ if [ "$(readlink "$old")" = "$new" ]; then
+ # Nothing to do; migration has already been done.
+ observe "migration of $old to $new already done"
+ return 0
+ else
+ # Back it up.
+ warn "backing up symbolic link $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+ fi
+
+ # Does old location exist, but is not a directory?
+ if [ -e "$old" ] && ! [ -d "$old" ]; then
+ # Back it up.
+ warn "backing up non-directory $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+
+ observe "migrating $old to $new"
+
+ # Is new location a symlink?
+ if [ -L "$new" ]; then
+ # Does it point the wrong way, i.e., back to where we're migrating from?
+ if [ "$(readlink "$new")" = "$old" ]; then
+ # Get rid of it.
+ observe "removing symbolic link $new which points to $old"
+ rm "$new"
+ else
+ # Back it up.
+ warn "backing up symbolic link $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+ fi
+
+ # Does new location exist, but is not a directory?
+ if [ -e "$new" ] && ! [ -d "$new" ]; then
+ warn "backing up non-directory $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+
+ # Create new directory if it does not yet exist.
+ if ! [ -e "$new" ]; then
+ observe "creating $new"
+ mkdir -p "$new"
+ fi
+
+ # Copy files in old location to new location. Back up any filenames that
+ # already exist in the new location with the extension ".dpkg-old".
+ observe "copying files from $old to $new"
+ if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+ die "error(s) encountered while copying files from $old to $new"
+ fi
+
+ # Remove files at old location.
+ observe "removing $old"
+ rm -r "$old"
+
+ # Create symlink from old location to new location.
+ make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: dmx
+Description: The dmx Library
+Version: @PACKAGE_VERSION@
+Requires: dmxproto
+Requires.private: x11 xext
+Cflags: -I${includedir}
+Libs: -L${libdir} -ldmx
--- /dev/null
+/*
+ * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * This file describes the interface to the client-side libdmx.a
+ * library. All DMX-aware client-side applications should include this
+ * file. */
+
+#ifndef _DMXEXT_H_
+#define _DMXEXT_H_
+
+#include <X11/extensions/dmx.h>
+
+/** Client-library screen information structure, returned by
+ * #DMXGetScreenAttributes. */
+typedef struct {
+ char *displayName;
+ int logicalScreen;
+
+ unsigned int screenWindowWidth; /* displayName's coordinate system */
+ unsigned int screenWindowHeight; /* displayName's coordinate system */
+ int screenWindowXoffset; /* displayName's coordinate system */
+ int screenWindowYoffset; /* displayName's coordinate system */
+
+ unsigned int rootWindowWidth; /* screenWindow's coordinate system */
+ unsigned int rootWindowHeight; /* screenWindow's coordinate system */
+ int rootWindowXoffset; /* screenWindow's coordinate system */
+ int rootWindowYoffset; /* screenWindow's coordinate system */
+
+ int rootWindowXorigin; /* global coordinate system */
+ int rootWindowYorigin; /* global coordinate system */
+} DMXScreenAttributes;
+
+/** Client-library window information structure, returned by
+ * #DMXGetWindowAttributes. */
+typedef struct {
+ int screen;
+ Window window;
+ XRectangle pos, vis;
+} DMXWindowAttributes;
+
+/** Client-library desktop information structure, returned by
+ * #DMXGetDesktopAttributes. */
+typedef struct {
+ unsigned int width; /* global coordinate system */
+ unsigned int height; /* global coordinate system */
+ int shiftX; /* global coordinate system */
+ int shiftY; /* global coordinate system */
+} DMXDesktopAttributes;
+
+/** Enumeration for the #inputType field in the #DMXInputAttributes
+ * structure. */
+typedef enum {
+ DMXLocalInputType,
+ DMXConsoleInputType,
+ DMXBackendInputType
+} DMXInputEnum;
+
+/** Client-library input information structure, returned by
+ * #DMXGetInputAttributes. */
+typedef struct {
+ DMXInputEnum inputType;
+ int physicalScreen;
+ int physicalId;
+ Bool isCore;
+ Bool sendsCore;
+ const char *name;
+ Bool detached;
+} DMXInputAttributes;
+
+_XFUNCPROTOBEGIN
+
+extern Bool DMXQueryExtension(Display *dpy,
+ int *event_basep, int *error_basep);
+extern Bool DMXQueryVersion(Display *dpy, int *major_version,
+ int *minor_version, int *patch_version);
+extern Bool DMXSync(Display *dpy);
+extern Bool DMXForceWindowCreation(Display *dpy, Window window);
+
+
+extern Bool DMXGetScreenCount(Display *dpy, int *screen_count);
+extern Bool DMXGetScreenAttributes(Display *dpy,
+ int screen,
+ DMXScreenAttributes *attr);
+extern int DMXChangeScreensAttributes(Display *dpy,
+ int screen_count,
+ int *screens,
+ int mask_count,
+ unsigned int *masks,
+ DMXScreenAttributes *attr, /* vector */
+ int *error_screen);
+
+extern Bool DMXAddScreen(Display *dpy,
+ const char *displayName,
+ unsigned int mask,
+ DMXScreenAttributes *attr,
+ int *screen);
+extern Bool DMXRemoveScreen(Display *dpy, int screen);
+
+/* Call DMXGetScreenWindowCount and allocate info to that size. Pass
+ * the size in available_count. This call can generate a large amount
+ * of wire traffic and should not be used called with available_count=0
+ * just to determine the screen_count value -- use DMXGetScreenCount
+ * instead. NOTE: Also see DMX protocol specification (DMXSpec.txt) for
+ * usage of DMXSync to flush pending commands. */
+extern Bool DMXGetWindowAttributes(Display *dpy, Window window,
+ int *screen_count, int available_count,
+ DMXWindowAttributes *attr);
+
+extern Bool DMXGetDesktopAttributes(Display *dpy, DMXDesktopAttributes *attr);
+extern int DMXChangeDesktopAttributes(Display *dpy,
+ unsigned int mask,
+ DMXDesktopAttributes *attr);
+
+extern Bool DMXGetInputCount(Display *dpy, int *input_count);
+extern Bool DMXGetInputAttributes(Display *dpy, int id,
+ DMXInputAttributes *attr);
+
+extern Bool DMXAddInput(Display *dpy,
+ unsigned int mask,
+ DMXInputAttributes *attr,
+ int *id);
+extern Bool DMXRemoveInput(Display *dpy, int id);
+
+/* These are helper functions that call DMXAddInput. */
+extern Bool DMXAddBackendInput(Display *dpy, int screen, int sendsCore,
+ int *newId);
+extern Bool DMXAddConsoleInput(Display *dpy, const char *name, int sendsCore,
+ int *newId);
+
+_XFUNCPROTOEND
+#endif
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMX __libmansuffix__ __vendorversion__
+.SH NAME
+DMX \- X Window System DMX (Distributed Multihead X) extension
+.SH DESCRIPTION
+The DMX extension provides support for communication with and control of
+.BR Xdmx (1)
+server. Attributes of the
+.BR Xdmx (1)
+server and of the back-end screens attached to the server can be queried
+and modified via this protocol.
+.SH "SUMMARY OF LIBRARY FUNCTIONS"
+The following is a summary of DMX library functions:
+.sp
+DMXQueryExtension(__libmansuffix__) \- determine if DMX is available
+.sp
+DMXQueryVersion(__libmansuffix__) \- determine DMX extension version
+.sp
+DMXSync(__libmansuffix__) \- flush protocol requests between
+.BR Xdmx (1)
+and back-end X servers
+.sp
+DMXForceWindowCreation(__libmansuffix__) \- force immediate back-end window creation
+.sp
+DMXGetScreenCount(__libmansuffix__) \- determine number of back-end screens
+.sp
+DMXGetScreenAttributes(__libmansuffix__) \- determine back-end screen attributes
+.sp
+DMXChangeScreensAttributes(__libmansuffix__) \- change back-end screen attributes
+.sp
+DMXAddScreen(__libmansuffix__) \- attach a new back-end screen
+.sp
+DMXRemoveScreen(__libmansuffix__) \- detach a back-end screen
+.sp
+DMXGetWindowAttributes(__libmansuffix__) \- determine back-end window attributes
+.sp
+DMXGetDesktopAttributes(__libmansuffix__) \- determine global bounding box
+.sp
+DMXChangeDesktopAttributes(__libmansuffix__) \- change global bounding box
+.sp
+DMXGetInputCount(__libmansuffix__) \- determine number of input devices
+.sp
+DMXGetInputAttributes(__libmansuffix__) \- determine input device attributes
+.sp
+DMXAddInput(__libmansuffix__) \- attach a new backend or console input
+.sp
+DMXRemoveInput(__libmansuffix__) \- detach an input
+.sp
+DMXAddBackendInput(__libmansuffix__) \- attach a new back-end input
+.sp
+DMXAddConsoleInput(__libmansuffix__) \- attach a new console input
+.PP
+Each of these functions is described in its own man page.
+.SH "SEE ALSO"
+.BR Xdmx "(1), " xdmxconfig "(1), " vdltodmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXAddInput __libmansuffix__ __vendorversion__
+.SH NAME
+DMXAddInput, DMXAddBackendInput, DMXAddConsoleInput \- attach a new input
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXAddInput(Display " *dpy ,
+.BI " unsigned int " mask ,
+.BI " DMXInputAttributes " *attr ,
+.BI " int " *id );
+.br
+.BI "Bool DMXAddBackendInput(Display " *dpy ,
+.BI " int " screen ,
+.BI " int " sendsCore ,
+.BI " int " *newId );
+.br
+.BI "Bool DMXAddConsoleInput(Display " *dpy ,
+.BI " const char " *name ,
+.BI " int " sendsCore ,
+.BI " int " *newId );
+.fi
+.SH DESCRIPTION
+.B DMXAddInput()
+is used to attach a new input (or a previously detached input) to the
+.BR Xdmx (1)
+server.
+.I mask
+specifies the fields in
+.I attr
+that are active, and
+.I id
+returns the device if of the first device in the series that is added.
+.PP
+The value of
+.I mask
+is computed from the following values:
+.sp
+.nf
+DMXInputType
+DMXInputPhysicalScreen
+DMXInputSendsCore
+.fi
+.PP
+The
+.B DMXInputAttributes
+structure is:
+.sp
+.nf
+typedef struct {
+ DMXInputEnum inputType;
+ int physicalScreen;
+ int physicalId;
+ Bool isCore;
+ Bool sendsCore;
+ const char *name;
+ Bool detached;
+} DMXInputAttributes;
+.fi
+.PP
+.I inputType
+may bave the value
+.B DmxConsoleInputType " or " DmxBackendInputType .
+.PP
+For console devices,
+.I name
+will specify the display to be used.
+.PP
+For back-end devices,
+.I physicalScreen
+will specify the
+.BR Xdmx (1)
+screen number.
+.PP
+If
+.I sendsCore
+is
+.BR True ,
+the new device will be added as a true core device.
+.PP
+If a device was removed with
+.BR DMXRemoveInput (__libmansuffix__)
+an attempt will be made to reconnect the previous devices
+.RI ( sendsCore
+is ignored in this case).
+.PP
+.B DMXAddBackendInput()
+is a helper function that is used to add input from a back-end server.
+With this function,
+.I screen
+refers to the back-end screen,
+.I sendsCore
+is
+.B True
+if the new input should send core events (and it ignored if the input
+has been detached), and
+.I newId
+will hold the device id of the first device in the series added.
+.PP
+.B DMXAddConsoleInput()
+is a helper function that is used to add input from a console. With
+this function,
+.I name
+is the name of the console display,
+.I sendsCore
+is
+.B True
+if the new input should send core events (and it ignored if the input
+has been detached), and
+.I newId
+will hold the device id of the first device in the series added.
+.SH "RETURN VALUE"
+.B DMXAddInput()
+returns
+.B True
+on success and
+.B False
+otherwise.
+.PP
+.B DMXAddInput()
+can generate
+.B BadValue
+(if
+.I inputType
+is invalid or
+.I physicalScreen
+is out of range),
+.B BadAccess
+(if the input has already been attached or if the backend screen is
+currently detached).
+.SH NOTES
+Local devices cannot be attached or detached.
+.PP
+Attributes that are not specified will default to 0. This may lead to
+unintended results.
+.SH "SEE ALSO"
+.BR DMXRemoveInput "(__libmansuffix__), " DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXAddScreen __libmansuffix__ __vendorversion__
+.SH NAME
+DMXAddScreen \- attach a new back-end screen
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXAddScreen(Display " *dpy ,
+.BI " const char " *displayName ,
+.BI " unsigned int " mask ,
+.BI " DMXScreenAttributes " *attr ,
+.BI " int " *screen );
+.fi
+.SH DESCRIPTION
+.B DMXAddScreen()
+attaches a back-end screen to the
+.BR Xdmx (1)
+server, in place of the previously detached back-end server specified by
+.IR screen .
+.PP
+.I displayName
+is the name of the new back-end display,
+.I mask
+specifies the field in
+.I attr
+that are active, and
+.I screen
+returns the new
+.BR Xdmx (1)
+screen number for the attached screen.
+.PP
+The information stored in
+.I mask " and " attr
+is identical to that used by the
+.BR DMXChangeScreenAttributes (__libmansuffix__)
+and
+.BR DMXGetScreenAttribues (__libmansuffix__)
+functions.
+.SH "RETURN VALUE"
+.B DMXAddScreen()
+will return
+.B True
+if the screen was successfully attached, and
+.B False
+otherwise.
+.B False
+will be returned if the
+.I \-addremovescreens
+command line option was not specified on the
+.BR Xdmx (1)
+command line, the input value of
+.I screen
+is out of range,
+.I screen
+is not currently detached,
+.I displayName
+cannot be opened, has unexpected visuals, or has characteristics that do
+not match the previously detached screen.
+.PP
+.B DMXAddScreen()
+can generate
+.BR BadLength ,
+.BR BadAlloc ,
+and
+.B BadValue
+errors.
+.SH NOTES
+Attributes that are not specified will default to 0. This may lead to
+unintended results.
+.PP
+Unlike other functions in the
+.BR DMX (__libmansuffix__)
+API, this function uses
+.I screen
+for both input and output.
+.SH "SEE ALSO"
+.BR DMXRemoveScreen "(__libmansuffix__), "
+.BR DMXChangeScreenAttributes "(__libmansuffix__), " DMXGetScreenAttributes "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXChangeDesktopAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXChangeDesktopAttributes \- change global bounding box
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "int DMXChangeDesktopAttributes(Display " *dpy ,
+.BI " unsigned int " mask ,
+.BI " DMXDesktopAttributes " *attr );
+.fi
+.SH DESCRIPTION
+.B DMXChangeDesktopAttributes()
+resizes the bounding box of the whole screen when using the Xinerama
+extension. Otherwise, it has no effect on the screen layout.
+An attribute mask is placed in
+.I mask
+and the attributes to change are placed in
+.IR attr .
+.PP
+The values that are used to compute
+.I mask
+are as follows:
+.sp
+.nf
+DMXDesktopWidth
+DMXDesktopHeight
+DMXDesktopShiftX
+DMXDesktopShiftY
+.fi
+.PP
+The
+.B DMXDesktopAttributes
+structure is:
+.sp
+.nf
+typedef struct {
+ unsigned int width;
+ unsigned int height;
+ int shiftX;
+ int shiftY;
+} DMXDesktopAttributes;
+.fi
+.PP
+.I width " and " height
+specify the new width and height for the bounding box.
+.I shiftX " and " shiftY
+specify where the Xinerama origin will be placed with respect to the
+origin of the new bounding box. This allows the left and upper edges of
+the bounding box to be changed without changing the visual position of
+the windows on the desktop. If
+.I width " or " height
+is not specified, the current values will be used. If
+.I shiftX " or " shiftY
+is not specified, 0 will be used.
+.PP
+All coordinants are in the global DMX coordinant system. If Xinerama is
+not active, an error will be generated.
+.SH "RETURN VALUE"
+.B DMXChangeDesktopAttributes()
+will return 0 on success,
+.B DmxBadXinerama
+if Xinerama is not active,
+.B DmxBadValue
+if the size of the bounding box is too large, and
+.B DmxBadReply
+if there was a protocol error.
+.PP
+.B DMXChangeDesktopAttributes()
+can generate
+.B BadLength
+(if the request is malformed, which should never happen when using this
+library interface), and
+.B BadValue
+(if any values are out of range).
+.SH "SEE ALSO"
+.BR DMXGetDesktopAttributes "(__libmansuffix__), " DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXChangeScreensAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXChangeScreensAttributes \- change back-end screen attributes
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "int DMXChangeScreensAttributes(Display " *dpy ,
+.BI " int " screen_count ,
+.BI " int " *screens ,
+.BI " int " mask_count ,
+.BI " unsigned int " *masks ,
+.BI " DMXScreenAttributes " *attr ,
+.BI " int *" error_screen );
+.fi
+.SH DESCRIPTION
+.B DMXChangeScreensAttributes()
+changes the geometries and positions of the DMX screen and DMX root
+windows on the back-end X servers.
+.I screen_count
+specifies the number of screens to be changed. For each screen, the
+screen number is placed in
+.IR screens ,
+an attribute mask is placed in
+.IR masks ,
+and a
+.I DMXScreenAttributes
+structure is included in
+.IR attr .
+.PP
+An explanation of the
+.I DMXScreenAttributes
+structure is given in
+.BR DMXGetScreenAttributes (__libmansuffix__).
+.PP
+The values that are used to compute each value in
+.I masks
+are as follows
+.sp
+.nf
+DMXScreenWindowWidth
+DMXScreenWindowHeight
+DMXScreenWindowXoffset
+DMXScreenWindowYoffset
+DMXRootWindowWidth
+DMXRootWindowHeight
+DMXRootWindowXoffset
+DMXRootWindowYoffset
+DMXRootWindowXorigin
+DMXRootWindowYorigin
+.fi
+.PP
+In general,
+.I mask_count
+should be equal to
+.IR screen_count .
+However, as a convenience,
+.I mask_count
+may be less than
+.IR screen_count ,
+and the last entry in
+.I masks
+will then be used for all of the remaining screens. For example, this
+allows identical changes to be made to several screens using only one
+mask.
+.SH "RETURN VALUE"
+On success, 0 is returned. Otherwise,
+.I error_screen
+is set to the value of the first screen in the list that caused the
+error and a non-zero value is returned. If
+.I screen_count
+or
+.I mask_count
+is less than 1, or if any of the attribute values are not within the
+appropriate bounding boxes,
+.B DmxBadValue
+is returned. If a protocol error occurs,
+.B DmxBadReply
+is returned.
+.PP
+.B DMXChangeScreensAttributes()
+can generate
+.B BadLength
+(if the data provided does not match the data implicitly required by the
+.I screen_count
+and
+.I mask_count
+values),
+.B BadValue
+(if the values in
+.I screens
+are not valid), and
+.B BadAlloc
+errors.
+.SH "SEE ALSO"
+.BR DMXGetScreenCount "(__libmansuffix__), "
+.BR DMXGetScreenAttributes "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXForceWindowCreation __libmansuffix__ __vendorversion__
+.SH NAME
+DMXForceWindowCreation \- force immediate back-end window creation
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXForceWindowCreation(Display " *dpy ,
+.BI " Window " window );
+.fi
+.SH DESCRIPTION
+When using the lazy window creation optimization, windows are not
+created on the back-end X servers until they are required.
+.B DMXForceWindowCreation()
+forces the immediate creation of the window requested.
+.SH "RETURN VALUE"
+.B DMXForceWindowCreation()
+returns
+.B True
+unless there is a protocol error.
+.B DMXForceWindwoCreation()
+can generate
+.B BadWindow
+errors.
+.SH "SEE ALSO"
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXDesktopAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetDesktopAttributes \- determine global bounding box
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetDesktopAttributes(Display " *dpy ,
+.BI " DMXDesktopAttributes " *attr );
+.fi
+.SH DESCRIPTION
+.B DMXGetDesktopAttributes()
+returns information about the desktop in
+.BR DMXDesktopAttributes :
+.sp
+.nf
+typedef struct {
+ unsigned int width;
+ unsigned int height;
+ int shiftX;
+ int shiftY;
+} DMXDesktopAttributes;
+.fi
+.PP
+The size of the global bounding box is given in
+.IR width ", and " height .
+The
+.IR shiftX " and " shiftY
+values will always be 0. The global bounding box is computed whether or
+not Xinerama is active, but it is only useful when using Xinerama.
+.PP
+The global bounding box used by
+.BR Xdmx (1)
+may be larger than the Xinerama screen size because of information in
+the configuration file.
+.SH "RETURN VALUE"
+.B DMXGetDesktopAttributes()
+returns
+.B True
+unless there is a protocol error.
+.SH "SEE ALSO"
+.BR DMXChangeDesktopAttributes "(__libmansuffix__), " DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXGetInputAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetInputAttributes \- determine input device attributes
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetInputAttributes(Display " *dpy ,
+.BI " int " id ,
+.BI " DMXInputAttributes " *attr );
+.fi
+.SH DESCRIPTION
+.B DMXGetInputAttributes()
+returns information about the input device specified with
+.IR id .
+This information cannot be
+obtained from the
+.BR XListInputDeivices (__libmansuffix__)
+call.
+.I id
+is the same as that used by the
+.BR XListInputDevices (__libmansuffix__)
+call, and must be in
+the range 0 to one less than the value returned by
+.BR DMXGetInputCount(__libmansuffix__) ,
+inclusive.
+.PP
+The
+.B DMXInputAttributes
+structure is:
+.sp
+.nf
+typedef struct {
+ DMXInputEnum inputType;
+ int physicalScreen;
+ int physicalId;
+ Bool isCore;
+ Bool sendsCore;
+ const char *name;
+ Bool detached;
+} DMXInputAttributes;
+.fi
+.PP
+The value of
+.I inputType
+will always be valid, and will have one of the following values,
+depending on the type of input:
+.B DMXLocalInputType ", " DMXConsoleInputType ", or" DMXBackendInputType .
+.PP
+For local devices, all other fields returned, except
+.I isCore " and " sendsCore ,
+are invalid.
+.PP
+For console devices,
+.I physicalScreen " and " physicalID
+will be invalid, and
+.I name
+will return the name of the X server on which the console window is
+displayed.
+.PP
+For back-end devices,
+.I physicalScreen
+will identify the back-end display and can be used as an argument to
+.BR DMXGetScreenAttributes (__libmansuffix__)
+to obtain more information;
+.I physicalId
+will be the XInput device id on the back-end X server; and
+.I name
+will be invalid (since it does not provide any additional information
+that cannot be obtained with
+.BR DMXGetScreenAttributes (__libmansuffix__)).
+.PP
+If
+.I isCore
+is
+.BR True ,
+then this device is active as a true core input device and will send
+core events. If
+.B sendsCore
+is True, then this device is an XInput extension device, but sends core
+events
+.I instead
+of extension events. This behavior is different from that of XFree86 or
+Xorg, where XInput extension devices may send
+.I both
+extension events and core events.
+.PP
+If
+.I detached
+is True, then this device has been detached and is no longer producing
+input events. The device may be reattached using
+.BR DMXAddInput (__libmansuffix__).
+.SH "RETURN VALUE"
+.B DMXGetInputAttributes()
+returns
+.B True
+unless there is a protocol error.
+.PP
+.B DMXGetInputAttributes()
+can generate
+.B BadValue
+(if the value of
+.I id
+is out of range).
+.SH "SEE ALSO"
+.BR DMXGetInputCount "(__libmansuffix__), "
+.BR XListInputDevices "(__libmansuffix__), "
+.BR DMXGetScreenAttributes "(__libmansuffix__), "
+.BR DMXAddInput "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXGetInputCount __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetInputCount \- determine number of input devices
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetInputCount(Display " *dpy ,
+.BI " int " *input_count );
+.fi
+.SH DESCRIPTION
+.B DMXGetInputCount()
+returns the number of input devices connected to the
+.BR Xdmx (1)
+server in
+.IR input_count .
+This number is the same as that returned by
+.BR XListInputDevices (__libmansuffix__),
+but is available even when the XInput extension is not supported.
+.SH "RETURN VALUE"
+.B DMXGetInputCount()
+returns
+.B True
+unless there is a protocol error.
+.SH "SEE ALSO"
+.BR DMXGetInputAttributes "(__libmansuffix__), "
+.BR XListInputDevices "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXGetScreenAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetScreenAttributes \- determine back-end screen attributes
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetScreenAttributes(Display " *dpy ,
+.BI " int " screen ,
+.BI " DMXScreenAttributes " *attr );
+.fi
+.SH DESCRIPTION
+.B DMXGetScreenAttributes()
+returns the attributes for the single DMX screen specified in
+.IR screen .
+.PP
+The
+.I DMXScreenAttributes
+structure is:
+.sp
+.nf
+typedef struct {
+ char *displayName;
+ int logicalScreen;
+
+ unsigned int screenWindowWidth;
+ unsigned int screenWindowHeight;
+ int screenWindowXoffset;
+ int screenWindowYoffset;
+
+ unsigned int rootWindowWidth;
+ unsigned int rootWindowHeight;
+ int rootWindowXoffset;
+ int rootWindowYoffset;
+
+ int rootWindowXorigin;
+ int rootWindowYorigin;
+} DMXScreenAttributes;
+.fi
+.PP
+.I displayName
+is the name used to open the display, either from the
+.BR Xdmx (1)
+command-line or from the configuration file.
+.PP
+.I logicalScreen
+is the value of the screen that that
+.BR Xdmx (1)
+server exports to clients. When Xinerama is in use, this value is
+typically 0 for all values of physicalScreen. If Xinerama is in
+use,
+.I rootWindowXorigin
+and
+.I rootWindowYorigin
+specify where the physical screen is positioned in the global Xinerama
+coordinate system. Otherwise, these values are set to 0.
+.PP
+.IR screenWindowWidth ", " screenWindowHeight ", "
+.IR screenWindowXoffset ", and " screenWindowYoffset
+are a geometry specification (see
+.BR X (7x))
+for the location of the DMX screen on the back-end screen. The
+coordinant system of the back-end display is used for these values.
+.PP
+.IR rootWindowWidth ", " rootWindowHeight ", "
+.IR rootWindowXoffset ", and " rootWindowYoffset
+are a geometry specification (see
+.BR X (7x))
+for the location of the root window on the screen window. The
+coordinant system of the screen window is used. In most cases, the root
+window will have the same geometry as the DMX screen window, and will
+occupy the same area of the back-end display. (This would not be the
+case, for example, if automatic projector alignment is used.)
+.SH "RETURN VALUE"
+.B DMXGetScreenAttributes()
+returns
+.B True
+unless there is a protocol error.
+.PP
+.B DMXGetScreenAttributes()
+can generate
+.B BadValue
+errors.
+.SH "SEE ALSO"
+.BR DMXGetScreenCount "(__libmansuffix__), "
+.BR DMXChangeScreenAttributes "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXGetScreenCount __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetScreenCount \- determine number of back-end screens
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetScreenCount(Display " *dpy ,
+.BI " int " *screen_count );
+.fi
+.SH DESCRIPTION
+.B DMXGetScreenCount()
+returns the number of back-end screens that a
+.BR Xdmx (1)
+server controls. Since a DMX screen usually fills all of the available
+area on a back-end server, there is usually a one-to-one correspondence
+between DMX screens and backend servers. However, it is also possible
+for a DMX screen to cover only part of the available area on a back-end
+server, and for more than one DMX screens to occupy different parts of
+the visible area on the same back-end server.
+.PP
+A DMX screen may be managed as a regular X screen in the
+.BR Xdmx (1)
+server or may be joined with other DMX screens using Xinerama.
+.SH "RETURN VALUE"
+.B DMXGetScreenCount()
+sets
+.I screen_count
+and returns
+.B True
+unless there is a protocol error.
+.SH NOTES
+If Xinerama is active, only one logical screen will be available to
+clients of the
+.BR Xdmx (1)
+server. However, this call will accurately reflect the number of
+composite back-end screens that the
+.BR Xdmx (1)
+server is using.
+.SH "SEE ALSO"
+.BR DMXGetScreenAttribtues "(__libmansuffix__), "
+.BR DMXChangeScreenAttributes "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXGetWindowAttributes __libmansuffix__ __vendorversion__
+.SH NAME
+DMXGetWindowAttributes \- determine back-end window attributes
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXGetWindowAttributes(Display " *dpy ,
+.BI " Window " window ,
+.BI " int " *screen_count ,
+.BI " int " available_count ,
+.BI " DMXWindowAttributes " *attr );
+.fi
+.SH DESCRIPTION
+When calling
+.BR DMXGetWindowAttributes() ,
+.I window
+specifies the window ID of a window on the
+.BR Xdmx (1)
+server and
+.I available_count
+specifies the length of
+.I attr.
+.PP
+The number of screens for which information is available will be
+returned in
+.I screen_count
+and information about those screen will be returned in
+.IR attr .
+If
+.I screen_count
+is less than
+.IR available_count ,
+then information for all of the screens will be returned. Otherwise,
+information for the first
+.I available_count
+screens will be returned.
+.PP
+The
+.I DMXWindowAttributes
+structure is:
+.sp
+.nf
+typedef struct {
+ int screen;
+ Window window;
+ XRectangle pos, vis;
+} DMXWindowAttributes;
+.fi
+.PP
+For each back-end X server that displays a portion of
+.IR window ,
+this structure contains the physical
+.I screen
+containing that portion, the
+.I window
+ID on the back-end X server of the window containing that portion, the
+position and dimensions of the window on the back-end
+.RI ( pos ,
+in screen coordinates), and the visible area of the window on the
+back-end
+.RI ( vis ,
+in window-relative coordinates -- all zeros if the window is not visible
+on the backend).
+.PP
+To obtain more information about the physical screen use the
+.BR DMXGetScreenAttributes (__libmansuffix__)
+call.
+.PP
+Note that DMX allows multiple back-end windows to overlap in their
+view of the DMX logical window. Further, a logical window does not
+have to be completely covered by back-end windows -- there may be
+gaps.
+.PP
+As an example, consider a 500x500 window that spans the top two
+1024x768 back-end displays (A and B) of a 2048x1536 DMX display
+composed of 4 1024x768 back-end displays arranged in a cube:
+.sp
+.nf
+ A B
+ C D
+.fi
+.sp
+In this case, the DMXGetWindowAttributes call would return the
+following information for the 500x500 window:
+.sp
+.nf
+display A: 500x500 window at 1024-250,0 (relative to back end)
+ with 250x500 visible at 0,0 (relative to window origin)
+
+display B: 500x500 window at -250,0 (relative to back end)
+ with 250x500 visible at 250,0 (relative to window origin)
+
+display C: 500x500 window at 1024-250,-768 with 0x0 visible at 0,0
+
+display D: 500x500 window at -250,-768 with 0x0 visible at 0,0
+.fi
+.SH "RETURN VALUE"
+.B DMXGetWindowAttributes()
+returns
+.B True
+unless there is a protocol error.
+.PP
+.B DMXGetWindowAttributes()
+can generate
+.B BadWindow
+and
+.B BadAlloc
+errors.
+.SH NOTES
+Because this call transports a great deal of information over the wire,
+please call
+.BR DMXGetScreenCount (__libmansuffix__)
+first, and make sure
+.I attr
+is sufficiently large.
+.PP
+On a particular back-end server, it is possible that the associated
+window has not yet been mapped because the
+.BR XMapWindow (__libmansuffix__)
+call that will eventually map the window had been buffered by Xlib's
+normal buffering system. To avoid this race condition, please call
+.BR DMXSync (__libmansuffix__)
+before communicating directly with the back-end X server.
+.SH "SEE ALSO"
+.BR DMXGetScreenCount "(__libmansuffix__), "
+.BR DMXSync "(__libmansuffix__), "
+.BR DMXGetScreenAttributes "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXQueryExtension __libmansuffix__ __vendorversion__
+.SH NAME
+DMXQueryExtension \- determine if DMX is available
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXQueryExtension(Display " *dpy ,
+.BI " int " *event_basep ,
+.BI " int " *error_basep );
+.fi
+.SH DESCRIPTION
+.B DMXQueryExtension()
+determines if the DMX protocol extension is available. It will be
+available if the server is an
+.BR Xdmx (1)
+server.
+.SH "RETURN VALUE"
+If the DMX protocol extension is available,
+.I event_basep
+and
+.I error_basep
+will be set to the event and error bases, respectively, and
+.B True
+will be returned. Otherwise,
+.B False
+will be returned.
+.SH "SEE ALSO"
+.BR DMXQueryVersion "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXQueryVersion __libmansuffix__ __vendorversion__
+.SH NAME
+DMXQueryVersion \- determine DMX extension version
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXQueryVersion(Display " *dpy ,
+.BI " int " *major_version ,
+.BI " int " *minor_version ,
+.BI " int " *patch_version );
+.fi
+.SH DESCRIPTION
+.B DMXQueryVersion()
+returns version information about the DMX protocol extension.
+.PP
+Any incompatible changes to the protocol will be indicated by
+a change in
+.IR major_version .
+Small, upward-compatible changes will be indicated by a change in
+.IR minor_version .
+In general,
+.I patch_version
+is for informational purposes and will encode the date of the last
+protocol revision (e.g., 20040604).
+.SH "RETURN VALUE"
+If the DMX protocol extension is available,
+.IR major_version ,
+.IR minor_version ,
+and
+.I patch_version
+will be set, and
+.B True
+will be returned. Otherwise,
+.B False
+will be returned.
+.SH NOTES
+At the time of this writing, the DMX protocol is at version 2.2.
+.PP
+Version 2.2 was the final development version, and code supporting this
+version was submitted to upstream X server repositories in the summer of
+2004.
+.PP
+Version 1.5 was the last of the 1.x series, which was used for
+development before screen and input addition and removal were supported.
+Version 2.0 and 2.1 were development versions that partially supported
+screen and input addition and removal.
+.PP
+Since we do not expect development versions to be widely used, we
+recommend that any software that uses the DMX protocol extension to
+support only versions 2.2 and above (although they should detect earlier
+versions and either reduce functionality or fail gracefully).
+.SH "SEE ALSO"
+.BR DMXQueryExtension "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXRemoveInput __libmansuffix__ __vendorversion__
+.SH NAME
+DMXRemoveInput \- detach an input
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXRemoveInput(Display " *dpy ,
+.BI " int " id );
+.fi
+.SH DESCRIPTION
+.B DMXRemoveInput()
+detaches the input device with
+.IR id ,
+and all associated inputs (e.g., if the
+.I id
+is a backend mouse, and a keyboard is also attached to the backend, then
+both devices will be detached).
+.SH "RETURN VALUE"
+.B DMXRemoveInput()
+returns
+.B True
+unless there is a protocol error.
+.PP
+.B DMXRemoveInput()
+can generate
+.B BadValue
+(if the
+.I id
+is not valid) and
+.B BadAccess
+(if the input has already been detached).
+.SH "SEE ALSO"
+.BR DMXAddInput "(__libmansuffix__), " DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXRemoveScreen __libmansuffix__ __vendorversion__
+.SH NAME
+DMXRemoveScreen \- detach a back-end screen
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXRemoveScreen(Display " *dpy ,
+.BI " int " screen );
+.fi
+.SH DESCRIPTION
+.B DMXRemoveScreen()
+detaches the back-end
+.I screen
+from the
+.BR Xdmx (1)
+server.
+.SH "RETURN VALUE"
+.B DMXRemoveScreen()
+returns
+.B True
+on success, and
+.B False
+if there were protocol errors, if the
+.I \-addremovescreens
+command-line option was not specified on the
+.BR Xdmx (1)
+command line, if the value of
+.I screen
+is out of range, or if the back-end screen specified by
+.I screen
+has already been detached.
+.SH "SEE ALSO"
+.BR DMXAddScreen "(__libmansuffix__), "
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+.\" Copyright 2004 Red Hat Inc., Durham, North Carolina.
+.\" All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining
+.\" a copy of this software and associated documentation files (the
+.\" "Software"), to deal in the Software without restriction, including
+.\" without limitation on the rights to use, copy, modify, merge,
+.\" publish, distribute, sublicense, and/or sell copies of the Software,
+.\" and to permit persons to whom the Software is furnished to do so,
+.\" subject to the following conditions:
+.\"
+.\" he above copyright notice and this permission notice (including the
+.\" next paragraph) shall be included in all copies or substantial
+.\" portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+.\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+.\" NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+.\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+.\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+.\" SOFTWARE.
+.TH DMXSync __libmansuffix__ __vendorversion__
+.SH NAME
+DMXSync \- flush protocol requests between Xdmx and back-end X servers
+.SH SYNOPSIS
+.B #include <X11/extensions/dmxext.h>
+.sp
+.nf
+.BI "Bool DMXSync(Display " *dpy );
+.fi
+.SH DESCRIPTION
+.B DMXSync()
+flushes all pending protocol requests between the
+.BR Xdmx (1)
+server and each back-end X server. It is used by clients that talk
+directly to back-end X servers to ensure that all pending
+.BR Xdmx (1)
+requests have reached all back-end servers and have been processed by
+those servers.
+.SH "RETURN VALUE"
+.B DMXSync()
+returns
+.BR True
+unless there is a protocol error.
+.SH "SEE ALSO"
+.BR DMX "(__libmansuffix__), " Xdmx (1)
--- /dev/null
+# 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.
+#
+
+libmandir = $(LIB_MAN_DIR)
+
+libman_PRE = \
+ DMX.man \
+ DMXAddInput.man \
+ DMXAddScreen.man \
+ DMXChangeDesktopAttributes.man \
+ DMXChangeScreensAttributes.man \
+ DMXForceWindowCreation.man \
+ DMXGetDesktopAttributes.man \
+ DMXGetInputAttributes.man \
+ DMXGetInputCount.man \
+ DMXGetScreenAttributes.man \
+ DMXGetScreenCount.man \
+ DMXGetWindowAttributes.man \
+ DMXQueryExtension.man \
+ DMXQueryVersion.man \
+ DMXRemoveInput.man \
+ DMXRemoveScreen.man \
+ DMXSync.man
+
+libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
+
+EXTRA_DIST = $(libman_PRE)
+
+CLEANFILES = $(libman_DATA)
+
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+.man.$(LIB_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
--- /dev/null
+
+Name: libdmx
+Summary: X.Org X11 libdmx runtime library
+Version: 1.1.1
+Release: 1
+Group: System/Libraries
+License: MIT/X11
+URL: http://www.x.org
+Source0: ftp://ftp.x.org/pub/individual/lib/%{name}-%{version}.tar.bz2
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(xproto)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xau)
+BuildRequires: pkgconfig(xextproto)
+BuildRequires: pkgconfig(dmxproto)
+BuildRequires: pkgconfig
+
+
+%description
+libdmx runtime library
+
+
+%package devel
+Summary: X.Org X11 libdmx development package
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+libdmx development package
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+
+%configure --disable-static
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING README ChangeLog
+%{_libdir}/libdmx.so.1
+%{_libdir}/libdmx.so.1.0.0
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libdmx.so
+%{_libdir}/pkgconfig/dmx.pc
+%{_mandir}/man3/*.3*
+%{_includedir}/X11/extensions/dmxext.h
+
--- /dev/null
+lib_LTLIBRARIES = libdmx.la
+
+libdmx_la_SOURCES = \
+ dmx.c
+
+libdmx_la_LIBADD = $(DMX_LIBS)
+
+libdmx_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+
+AM_CFLAGS = -I$(top_srcdir)/include \
+ -I$(top_srcdir)/include/X11 \
+ -I$(top_srcdir)/include/X11/extensions \
+ $(DMX_CFLAGS) \
+ $(MALLOC_ZERO_CFLAGS) \
+ $(CWARNFLAGS)
+
+libdmxincludedir = $(includedir)/X11/extensions
+libdmxinclude_HEADERS = $(top_srcdir)/include/X11/extensions/dmxext.h
+
--- /dev/null
+/*
+ * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+/** \file
+ * This file implements the client-side part of the DMX protocol. It
+ * can be included in client applications by linking with the libdmx.a
+ * library. */
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/Xext.h>
+#define EXTENSION_PROC_ARGS void *
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/dmxproto.h>
+#include <X11/extensions/dmxext.h>
+
+static XExtensionInfo dmx_extension_info_data;
+static XExtensionInfo *dmx_extension_info = &dmx_extension_info_data;
+static const char *dmx_extension_name = DMX_EXTENSION_NAME;
+
+#define DMXCheckExtension(dpy,i,val) \
+ XextCheckExtension(dpy, i, dmx_extension_name, val)
+#define DMXSimpleCheckExtension(dpy,i) \
+ XextSimpleCheckExtension(dpy, i, dmx_extension_name)
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+static int close_display(Display *dpy, XExtCodes *extCodes);
+static /* const */ XExtensionHooks dmx_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY(find_display, dmx_extension_info,
+ (char *)dmx_extension_name,
+ &dmx_extension_hooks,
+ 0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY(close_display, dmx_extension_info)
+
+
+/*****************************************************************************
+ * *
+ * public DMX Extension routines *
+ * *
+ *****************************************************************************/
+
+/** If the server has the DMX extension, the event and error bases will
+ * be placed in \a event_basep and \a error_basep, and True will be
+ * returned. Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 1.0 */
+Bool DMXQueryExtension(Display *dpy, int *event_basep, int *error_basep)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+/** If the DMXQueryVersion protocol request returns version information
+ * from the server, \a majorVersion, \a minorVersion, and \a
+ * patchVersion are filled in with the appropriate information and True
+ * is returned. Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 1.0 */
+Bool DMXQueryVersion(Display *dpy,
+ int *majorVersion, int *minorVersion, int *patchVersion)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXQueryVersionReply rep;
+ xDMXQueryVersionReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXQueryVersion;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *majorVersion = rep.majorVersion;
+ *minorVersion = rep.minorVersion;
+ *patchVersion = rep.patchVersion;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/** Flush all pending dmxSync requests in DMX server.
+ *
+ * Available in DMX Protocol Version 1.5 */
+Bool DMXSync(Display *dpy)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXSyncReply rep;
+ xDMXSyncReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXSync, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXSync;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}
+
+/** The creation of the specified \a window will be forced.
+ *
+ * Available in DMX Protocol Version 1.2
+ * Reply added in DMX Protocol Version 2.0 */
+Bool DMXForceWindowCreation(Display *dpy, Window window)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXForceWindowCreationReq *req;
+ xDMXForceWindowCreationReply rep;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXForceWindowCreation, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXForceWindowCreation;
+ req->window = window;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}
+
+/** If the DMXGetScreenCount protocol request returns the screen count,
+ * the value will be placed in \a screen_count, and True will be
+ * returned. Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 1.0 */
+Bool DMXGetScreenCount(Display *dpy, int *screen_count)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetScreenCountReply rep;
+ xDMXGetScreenCountReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetScreenCount, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetScreenCount;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *screen_count = rep.screenCount;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/** If the DMXGetScreenAttributes protocol request returns information
+ * for the specified \a physical_screen, information about the screen
+ * will be placed in \a attr, and True will be returned. Otherwise,
+ * False will be returned.
+ *
+ * Available in DMX Protocol Version 1.0; Modified in Version 2.0 */
+Bool DMXGetScreenAttributes(Display *dpy, int physical_screen,
+ DMXScreenAttributes *attr)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetScreenAttributesReply rep;
+ xDMXGetScreenAttributesReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetScreenAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetScreenAttributes;
+ req->physicalScreen = physical_screen;
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xDMXGetScreenAttributesReply) - 32) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ attr->displayName = Xmalloc(rep.displayNameLength + 1 + 4 /* for pad */);
+ _XReadPad(dpy, attr->displayName, rep.displayNameLength);
+ attr->displayName[rep.displayNameLength] = '\0';
+ attr->logicalScreen = rep.logicalScreen;
+
+ attr->screenWindowWidth = rep.screenWindowWidth;
+ attr->screenWindowHeight = rep.screenWindowHeight;
+ attr->screenWindowXoffset = rep.screenWindowXoffset;
+ attr->screenWindowYoffset = rep.screenWindowYoffset;
+
+ attr->rootWindowWidth = rep.rootWindowWidth;
+ attr->rootWindowHeight = rep.rootWindowHeight;
+ attr->rootWindowXoffset = rep.rootWindowXoffset;
+ attr->rootWindowYoffset = rep.rootWindowYoffset;
+ attr->rootWindowXorigin = rep.rootWindowXorigin;
+ attr->rootWindowYorigin = rep.rootWindowYorigin;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+static CARD32 _DMXGetScreenAttribute(int bit, DMXScreenAttributes *attr)
+{
+ switch (1 << bit) {
+ case DMXScreenWindowWidth: return attr->screenWindowWidth;
+ case DMXScreenWindowHeight: return attr->screenWindowHeight;
+ case DMXScreenWindowXoffset: return attr->screenWindowXoffset;
+ case DMXScreenWindowYoffset: return attr->screenWindowYoffset;
+ case DMXRootWindowWidth: return attr->rootWindowWidth;
+ case DMXRootWindowHeight: return attr->rootWindowHeight;
+ case DMXRootWindowXoffset: return attr->rootWindowXoffset;
+ case DMXRootWindowYoffset: return attr->rootWindowYoffset;
+ case DMXRootWindowXorigin: return attr->rootWindowXorigin;
+ case DMXRootWindowYorigin: return attr->rootWindowYorigin;
+ default: return 0;
+ }
+}
+
+static int _DMXDumpScreenAttributes(Display *dpy,
+ unsigned long mask,
+ DMXScreenAttributes *attr)
+{
+ int i;
+ unsigned long value_list[32];
+ unsigned long *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ *value++ = _DMXGetScreenAttribute(i, attr);
+ ++count;
+ }
+ }
+ Data32(dpy, value_list, count * sizeof(CARD32));
+ return count;
+}
+
+static CARD32 _DMXGetInputAttribute(int bit, DMXInputAttributes *attr)
+{
+ switch (1 << bit) {
+ case DMXInputType:
+ switch (attr->inputType) {
+ case DMXLocalInputType: return 0;
+ case DMXConsoleInputType: return 1;
+ case DMXBackendInputType: return 2;
+ }
+ return attr->inputType;
+ case DMXInputPhysicalScreen: return attr->physicalScreen;
+ case DMXInputSendsCore: return attr->sendsCore;
+ default: return 0;
+ }
+}
+
+static int _DMXDumpInputAttributes(Display *dpy,
+ unsigned long mask,
+ DMXInputAttributes *attr)
+{
+ int i;
+ unsigned long value_list[32];
+ unsigned long *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ *value++ = _DMXGetInputAttribute(i, attr);
+ ++count;
+ }
+ }
+ Data32(dpy, value_list, count * sizeof(CARD32));
+ return count;
+}
+
+/** Change geometries and positions of the DMX screen and root windows
+ * on the back-end X server. */
+int DMXChangeScreensAttributes(Display *dpy,
+ int screen_count,
+ int *screens,
+ int mask_count,
+ unsigned int *masks,
+ DMXScreenAttributes *attrs, /* vector */
+ int *error_screen)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXChangeScreensAttributesReply rep;
+ xDMXChangeScreensAttributesReq *req;
+ int i;
+ unsigned int mask = 0;
+ CARD32 *screen_list;
+ CARD32 *mask_list;
+
+ DMXCheckExtension(dpy, info, False);
+
+ if (screen_count < 1 || mask_count < 1) return DmxBadValue;
+
+ LockDisplay(dpy);
+ GetReq(DMXChangeScreensAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXChangeScreensAttributes;
+ req->screenCount = screen_count;
+ req->maskCount = mask_count;
+ req->length += screen_count + mask_count;
+
+ screen_list = (CARD32 *)Xmalloc(sizeof(*screen_list) * screen_count);
+ for (i = 0; i < screen_count; i++) screen_list[i] = screens[i];
+ Data32(dpy, screen_list, screen_count * sizeof(CARD32));
+ Xfree(screen_list);
+
+ mask_list = (CARD32 *)Xmalloc(sizeof(*mask_list) * mask_count);
+ for (i = 0; i < mask_count; i++) mask_list[i] = masks[i];
+ Data32(dpy, mask_list, mask_count * sizeof(CARD32));
+ Xfree(mask_list);
+
+ for (i = 0; i < screen_count; i++) {
+ if (i < mask_count) mask = masks[i];
+ req->length += _DMXDumpScreenAttributes(dpy, mask, attrs + i);
+ }
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return DmxBadReply;
+ }
+ if (error_screen) *error_screen = rep.errorScreen;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status;
+}
+
+/** Add a screen. */
+Bool DMXAddScreen(Display *dpy, const char *displayName, unsigned int mask,
+ DMXScreenAttributes *attr, int *screen)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXAddScreenReply rep;
+ xDMXAddScreenReq *req;
+ int length;
+ int paddedLength;
+
+ if (!screen)
+ return False;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXAddScreen, req);
+ length = displayName ? strlen(displayName) : 0;
+ paddedLength = (length + 3) & ~3;
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXAddScreen;
+ req->displayNameLength = length;
+ req->physicalScreen = *screen;
+ req->valueMask = mask;
+ req->length += paddedLength/4;
+ req->length += _DMXDumpScreenAttributes(dpy, mask, attr);
+
+ if (length) {
+ char *buffer = Xmalloc(paddedLength);
+ memset(buffer, 0, paddedLength);
+ memcpy(buffer, displayName, length);
+ Data32(dpy, buffer, paddedLength);
+ Xfree(buffer);
+ }
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ if (screen) *screen = rep.physicalScreen;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}
+
+/** Remove a screen. */
+Bool DMXRemoveScreen(Display *dpy, int screen)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXRemoveScreenReply rep;
+ xDMXRemoveScreenReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXRemoveScreen, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXRemoveScreen;
+ req->physicalScreen = screen;
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}
+
+/** If the DMXGetWindowAttributes protocol request returns information
+ * about the specified \a window, the number of screens for which
+ * information is available will be returned in \a screen_count and
+ * information about the first \a available_count of those screens will
+ * be placed in \a inf. Because this call transports a great deal of
+ * information over the wire, please call #DMXGetScreenCount first, and
+ * make sure \a inf is that large.
+ *
+ * Note that if the specified \a window has not yet been mapped when
+ * #DMXGetWindowAttributes is called, then a subsequent XMapWindow call
+ * might be buffered in xlib while requests directly to the back-end X
+ * servers are processed. This race condition can be solved by calling
+ * #DMXSync before talking directly to the back-end X servers.
+ *
+ * Available in DMX Protocol Version 1.0, but not working correctly
+ * until DMX Protocol Version 1.4 */
+Bool DMXGetWindowAttributes(Display *dpy, Window window,
+ int *screen_count, int available_count,
+ DMXWindowAttributes *inf)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetWindowAttributesReply rep;
+ xDMXGetWindowAttributesReq *req;
+ unsigned long current;
+ CARD32 *screens; /* Must match protocol size */
+ CARD32 *windows; /* Must match protocol size */
+ XRectangle *pos; /* Must match protocol size */
+ XRectangle *vis; /* Must match protocol size */
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetWindowAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetWindowAttributes;
+ req->window = window;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ /* FIXME: check for NULL? */
+ screens = Xmalloc(rep.screenCount * sizeof(*screens));
+ windows = Xmalloc(rep.screenCount * sizeof(*windows));
+ pos = Xmalloc(rep.screenCount * sizeof(*pos));
+ vis = Xmalloc(rep.screenCount * sizeof(*vis));
+
+ _XRead(dpy, (char *)screens, rep.screenCount * sizeof(*screens));
+ _XRead(dpy, (char *)windows, rep.screenCount * sizeof(*windows));
+ _XRead(dpy, (char *)pos, rep.screenCount * sizeof(*pos));
+ _XRead(dpy, (char *)vis, rep.screenCount * sizeof(*vis));
+
+ *screen_count = rep.screenCount;
+ for (current = 0;
+ current < rep.screenCount && current < (unsigned)available_count;
+ current++, inf++) {
+ inf->screen = screens[current];
+ inf->window = windows[current];
+ inf->pos = pos[current];
+ inf->vis = vis[current];
+ }
+
+ Xfree(vis);
+ Xfree(pos);
+ Xfree(windows);
+ Xfree(screens);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/** If the DMXGetDesktopAttributes protocol request returns information
+ * correctly, the information will be placed in \a attr, and True will
+ * be returned. Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 2.0 */
+Bool DMXGetDesktopAttributes(Display *dpy, DMXDesktopAttributes *attr)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetDesktopAttributesReply rep;
+ xDMXGetDesktopAttributesReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetDesktopAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetDesktopAttributes;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ attr->width = rep.width;
+ attr->height = rep.height;
+ attr->shiftX = rep.shiftX;
+ attr->shiftY = rep.shiftY;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+static CARD32 _DMXGetDesktopAttribute(int bit, DMXDesktopAttributes *attr)
+{
+ switch (1 << bit) {
+ case DMXDesktopWidth: return attr->width;
+ case DMXDesktopHeight: return attr->height;
+ case DMXDesktopShiftX: return attr->shiftX;
+ case DMXDesktopShiftY: return attr->shiftY;
+ default: return 0;
+ }
+}
+
+static int _DMXDumpDesktopAttributes(Display *dpy,
+ unsigned long mask,
+ DMXDesktopAttributes *attr)
+{
+ int i;
+ unsigned long value_list[32];
+ unsigned long *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ *value++ = _DMXGetDesktopAttribute(i, attr);
+ ++count;
+ }
+ }
+ Data32(dpy, value_list, count * sizeof(CARD32));
+ return count;
+}
+
+/** Change the global bounding box and origin offset.
+ *
+ * Available in DMX Protocol Version 2.0 */
+int DMXChangeDesktopAttributes(Display *dpy,
+ unsigned int mask,
+ DMXDesktopAttributes *attr)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXChangeDesktopAttributesReply rep;
+ xDMXChangeDesktopAttributesReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXChangeDesktopAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXChangeDesktopAttributes;
+ req->valueMask = mask;
+ req->length +=_DMXDumpDesktopAttributes(dpy, mask, attr);
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return DmxBadReply;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status;
+}
+
+/** If the DMXGetInputCount protocol request returns the input count,
+ * the value will be placed in \a input_count, and True will be
+ * returned. Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 1.1 */
+Bool DMXGetInputCount(Display *dpy, int *input_count)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetInputCountReply rep;
+ xDMXGetInputCountReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetInputCount, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetInputCount;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *input_count = rep.inputCount;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/** If the DMXGetInputAttributes protocol request returns information
+ * about the input device with the specified \a id, information about
+ * the input device will be placed in \a inf, and True will be returned.
+ * Otherwise, False will be returned.
+ *
+ * Available in DMX Protocol Version 1.1 */
+Bool DMXGetInputAttributes(Display *dpy, int id, DMXInputAttributes *inf)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXGetInputAttributesReply rep;
+ xDMXGetInputAttributesReq *req;
+ char *buffer;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXGetInputAttributes, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXGetInputAttributes;
+ req->deviceId = id;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ switch (rep.inputType) {
+ case 0: inf->inputType = DMXLocalInputType; break;
+ case 1: inf->inputType = DMXConsoleInputType; break;
+ case 2: inf->inputType = DMXBackendInputType; break;
+ }
+
+ inf->physicalScreen = rep.physicalScreen;
+ inf->physicalId = rep.physicalId;
+ inf->isCore = rep.isCore;
+ inf->sendsCore = rep.sendsCore;
+ inf->detached = rep.detached;
+ buffer = Xmalloc(rep.nameLength + 1 + 4 /* for pad */);
+ _XReadPad(dpy, buffer, rep.nameLength);
+ buffer[rep.nameLength] = '\0';
+ inf->name = buffer;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/** Add input. */
+Bool DMXAddInput(Display *dpy, unsigned int mask, DMXInputAttributes *attr,
+ int *id)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXAddInputReply rep;
+ xDMXAddInputReq *req;
+ int length;
+ int paddedLength;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXAddInput, req);
+ length = attr->name ? strlen(attr->name) : 0;
+ paddedLength = (length + 3) & ~3;
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXAddInput;
+ req->displayNameLength = length;
+ req->valueMask = mask;
+ req->length += paddedLength/4;
+ req->length += _DMXDumpInputAttributes(dpy, mask, attr);
+
+ if (length) {
+ char *buffer = Xmalloc(paddedLength);
+ memset(buffer, 0, paddedLength);
+ memcpy(buffer, attr->name, paddedLength);
+ Data32(dpy, buffer, paddedLength);
+ Xfree(buffer);
+ }
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ if (id) *id = rep.physicalId;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}
+
+/** Add backend input (a helper function that calls #DMXAddInput). */
+Bool DMXAddBackendInput(Display *dpy, int screen, int sendsCore, int *newId)
+{
+ DMXInputAttributes attr;
+ unsigned int mask = (DMXInputType
+ | DMXInputPhysicalScreen
+ | DMXInputSendsCore);
+
+ attr.inputType = DMXBackendInputType;
+ attr.physicalScreen = screen;
+ attr.sendsCore = sendsCore;
+ attr.name = NULL;
+ return DMXAddInput(dpy, mask, &attr, newId);
+}
+
+/** Add console input (a helper function that calls #DMXAddInput). */
+Bool DMXAddConsoleInput(Display *dpy, const char *name, int sendsCore,
+ int *newId)
+{
+ DMXInputAttributes attr;
+ unsigned int mask = (DMXInputType
+ | DMXInputSendsCore);
+
+ attr.inputType = DMXConsoleInputType;
+ attr.physicalScreen = 0;
+ attr.sendsCore = sendsCore;
+ attr.name = name;
+ return DMXAddInput(dpy, mask, &attr, newId);
+}
+
+/** Remove an input. */
+Bool DMXRemoveInput(Display *dpy, int id)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xDMXRemoveInputReply rep;
+ xDMXRemoveInputReq *req;
+
+ DMXCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(DMXRemoveInput, req);
+ req->reqType = info->codes->major_opcode;
+ req->dmxReqType = X_DMXRemoveInput;
+ req->physicalId = id;
+
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status == Success ? True : False;
+}