Git init
authorKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 15:49:49 +0000 (00:49 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 15:49:49 +0000 (00:49 +0900)
46 files changed:
COPYING [new file with mode: 0755]
ChangeLog [new file with mode: 0755]
Makefile.am [new file with mode: 0755]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0644]
configure.ac [new file with mode: 0755]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0755]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0755]
debian/copyright [new file with mode: 0644]
debian/libxxf86vm-dev.install [new file with mode: 0755]
debian/libxxf86vm1.install [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/watch [new file with mode: 0644]
debian/xsfbs/repack.sh [new file with mode: 0644]
debian/xsfbs/xsfbs.mk [new file with mode: 0644]
debian/xsfbs/xsfbs.sh [new file with mode: 0644]
include/X11/extensions/xf86vmode.h [new file with mode: 0644]
man/Makefile.am [new file with mode: 0755]
man/XF86VM.man [new file with mode: 0755]
man/XF86VidModeDeleteModeLine.man [new file with mode: 0755]
man/XF86VidModeGetAllModeLines.man [new file with mode: 0755]
man/XF86VidModeGetDotClocks.man [new file with mode: 0755]
man/XF86VidModeGetGamma.man [new file with mode: 0755]
man/XF86VidModeGetGammaRamp.man [new file with mode: 0755]
man/XF86VidModeGetGammaRampSize.man [new file with mode: 0755]
man/XF86VidModeGetModeLine.man [new file with mode: 0755]
man/XF86VidModeGetMonitor.man [new file with mode: 0755]
man/XF86VidModeGetPermissions.man [new file with mode: 0755]
man/XF86VidModeGetViewPort.man [new file with mode: 0755]
man/XF86VidModeLockModeSwitch.man [new file with mode: 0755]
man/XF86VidModeModModeLine.man [new file with mode: 0755]
man/XF86VidModeQueryExtension.man [new file with mode: 0755]
man/XF86VidModeQueryVersion.man [new file with mode: 0755]
man/XF86VidModeSetClientVersion.man [new file with mode: 0755]
man/XF86VidModeSetGamma.man [new file with mode: 0755]
man/XF86VidModeSetGammaRamp.man [new file with mode: 0755]
man/XF86VidModeSetViewPort.man [new file with mode: 0755]
man/XF86VidModeSwitchMode.man [new file with mode: 0755]
man/XF86VidModeSwitchToMode.man [new file with mode: 0755]
man/XF86VidModeValidateModeLine.man [new file with mode: 0755]
packaging/libXxf86vm.spec [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/XF86VMode.c [new file with mode: 0755]
xxf86vm.pc.in [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100755 (executable)
index 0000000..ef81e65
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,25 @@
+Copyright (c) 1995  Kaleb S. KEITHLEY
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY 
+shall not be used in advertising or otherwise to promote the sale, use 
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY.
diff --git a/ChangeLog b/ChangeLog
new file mode 100755 (executable)
index 0000000..b0cbc19
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,457 @@
+commit 6f22da39b65983a582d2055e9e43f5dbc0412f1f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Oct 29 18:04:50 2010 -0700
+
+    libXxf86vm 1.1.1
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit fe0659724002e65af6a68be53f57bb8ba85324fe
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Oct 29 18:03:51 2010 -0700
+
+    Sun's copyrights now belong to Oracle
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 84c7286a799d2368ce868afb31b373f8486724c2
+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 b6d645596f284550350d8c690cfcce89d019ab60
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Aug 17 19:53:37 2010 -0400
+
+    man: store shadow man pages in git rather than generating them
+    
+    Simplify the build process and the makefile.
+    
+    Local fix in CVS for bug 5628 is not required
+    as the problem has been fixed in
+    util-macros d9062e4077ebfd0985baf8418f3d0f111b9ddbba
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 01df17daf923b7eeeb3476149d189c5dc8da3bf8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Jul 8 15:50:02 2010 -0700
+
+    Use make rules instead of shell for loops to generate shadow man pages
+    
+    Allows parallel make and simpler build logs/error reporting
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a3603591f3086f7aeb92b193b2736733b4e79047
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Jul 8 15:37:15 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 6be94fa76ef3e2c41c7cb8487e639f0312d3b369
+Author: Fernando Carrijo <fcarrijo@yahoo.com.br>
+Date:   Thu Jul 1 07:10:51 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 15319d63a389bd9af1819f53a2d021edcd6180f2
+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 a3ed63ba72d767371174d1442c810144b0d2f8b7
+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 02155a7f70ad94026a7c138081c4249cffbc25a7
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Jan 14 10:15:23 2010 -0500
+
+    COPYING: fix copyright notice incorrect format
+    
+    Refer to: XF86VMode.c
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit eba6628379b65326453ea12ddd8cb33b144f3049
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Jan 14 20:55:56 2010 -0800
+
+    Update Sun license notices to current X.Org standard form
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 0d976427d1229b65baa489275c62e47762b2803e
+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 e9fd67ec28d4402a498af78f34815cc9d22d6c73
+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 d7cc1a08bfc5c780d0a4f3e0193ff91d0076713c
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Oct 27 15:07:26 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 2bb8c8fcabebf00fdc12b2649459b920e816f382
+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 9888ab7cf91cc4c7bf2a545ebc3b8bf0a002aa39
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:19 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit b4d998a026f03aa2fea74a909f3edea4e4aed5a1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Oct 2 09:43:30 2009 +1000
+
+    libXxf86vm 1.1.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8f518e80716915cfb8234a18836ad95121a7d6db
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Oct 2 08:58:19 2009 +1000
+
+    Require macros 1.3 for XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3951e96ddfefa5f3007895002528e713618a60ab
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 27 11:18:38 2009 +1000
+
+    libXxf86vm 1.0.99.1
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7c7ab2076420a883e827509da0e8a0989a786000
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 27 11:17:45 2009 +1000
+
+    Include xf86vmproto instead of xf86vmstr.h
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b49fcb355eb1469352eb25ba3dbcf2863cfe5642
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Aug 26 16:09:15 2009 +1000
+
+    Move the xf86vmode.h header from the proto package to here.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f2a1073b3027c508e01beca9ca34bbc6c90f5e6b
+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 e316211692ab7c882be6e89f5c6311160882375f
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Feb 2 14:43:19 2009 -0200
+
+    Janitor: ansification, make distcheck, compiler warnings, .gitignore.
+
+commit 2cba02334e948e215ab32635763e739c8c4a2f56
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Jul 2 15:37:20 2008 -0400
+
+    libXxf86vm 1.0.2
+
+commit 31cb01986bc3527152d0e3501b38d1b5cfad3155
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Jun 13 13:07:49 2008 -0400
+
+    Don't terminate zero-length strings.
+    
+    Just leave vendor and model NULL if the response didn't include them.
+
+commit 0aa2ae83518b14e927fb5b8ced182a4f25cecc76
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Mar 24 15:13:14 2008 -0400
+
+    Bug #10846: Fix XF86VidModeGetMonitor when vendor or model are null.
+
+commit 230197a970aec8d5550c2697249ba2e351b2de0b
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Mar 9 08:50:55 2008 +0100
+
+    nuke RCS Ids
+
+commit a3bf552ea28f6275f604f114190b0c69d9bf4ef8
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:38:47 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 89dd6f2e9f0322001bcc9f5b42705e150414c37d
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:53:52 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 52a0ff653601e603faa9c994a240814f9ddc277c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Jul 13 14:59:14 2006 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit 3e980bb302befb4c463fa861ab08034c83208622
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu Apr 27 00:26:53 2006 +0000
+
+    Bump to 1.0.1
+
+commit 227f7dc999517fc477b63327372fc846e5f44b7d
+Author: Jeremy C. Reed <reed@reedmedia.net>
+Date:   Thu Apr 20 23:44:33 2006 +0000
+
+    Fixed typo. Library was spell wrong.
+
+commit 789ff24df047508e04a40fd4b9605e6f40f86638
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun Feb 12 18:19:23 2006 +0000
+
+    Bug #5628 <https://bugs.freedesktop.org/show_bug.cgi?id=5628> Shadow pages
+        not created correctly when MANDIR & MANSUFFIX don't match.
+
+commit 6455000546cf8fd14f165a4f13590f94fc9948dc
+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 22c88452663d7c0b4f854f056968527298b412d2
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:45 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 5898da0a5deed350973064bf446c97831e42d575
+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 914624d1fb3924c76e5dc358bb43b4dff800280c
+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 0f0572fd4b9de8747741ff81d668edfe23db0e15
+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 3d042fdd3fb1d2d30ede743741698589e868701b
+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 eb9d4a646a4dfc30fde31deb926a954c2c41ec98
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:48:12 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit b46825c7ec5c50be0309b52759a2fba05fd2f350
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:00:09 2005 +0000
+
+    Use @LIB_MAN_SUFFIX@ instead of $(LIB_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 736aad1287fa65e82cbcb12073ba99ca8d63c0db
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 21:13:23 2005 +0000
+
+    Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a
+        suffix rule (reported by Matthieu Herrb)
+
+commit 5735da3f59d36568cfe198eeb1579e51b105491d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 13 04:25:46 2005 +0000
+
+    Add generated man pages to .cvsignores
+
+commit d0f4698f0cf843f6dfdba11eae687ada11e3d4f0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 13 01:20:52 2005 +0000
+
+    [lib/Xxf86vm manpage cleanup]
+    Use sed to fill in variables in man page Add shadow man pages for man pages
+        that document multiple functions.
+
+commit 72995528798d388422e6e09ee26a0edaffadb779
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Sep 26 20:55:17 2005 +0000
+
+    Simple whitespace change to change ownership of ,v file on server. Required
+        so that I can change permissions of file.
+
+commit 8f19f14ada44daf9d85f4d65f0bc130ae5b2f4bf
+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 417a69a7e9ad4df9b3a7f03b09e4694ad5c2bcbc
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Jul 9 21:10:32 2005 +0000
+
+    Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory
+
+commit 4b8ad01b53792d4220579a259290e6bf59eb3d8b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Jul 1 16:16:15 2005 +0000
+
+    spell freedesktop.org correctly
+
+commit a26154988a9367521a15e0876939d8ff7810cd81
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jun 10 22:38:47 2005 +0000
+
+    Apply patch from Jeff Smith (whydoubt@yahoo.com):
+    - Add file linking for Xxf86misc, Xxf86dga, and Xxf86vm.
+    - Check in build system for Xxf86misc, Xxf86dga, and Xxf86vm.
+
+commit c421f84a2d14fbf2995cba23d2ea614b59eadfd5
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:23:08 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 045fa2a95d6eac5db1c6d8781ef48f86d00b655f
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:33:12 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit d8913570296903c3686969f8c6dbeaf70064f23e
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:14 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 2e3edee344aee8f8cebe139541ebecccec570d8b
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:35:46 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 44926b9d3066d939b66aef57d091b8a878591e1e
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:14 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 56ddf834f4d3cca8afd7d36a63d7b825d1d7ffc0
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Thu Dec 4 22:03:15 2003 +0000
+
+    XFree86 4.3.99.901 (RC 1)
+
+commit db365c73e467868938ad5b15343c3b79b87994d5
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:28:33 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit ed50d6847a012bef0bf7274626bb0ed8018d5e23
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:54 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 252d1a944ccf5ebfc2c7e0c349254be055402c17
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:49 2003 +0000
+
+    Initial revision
+
+commit 83bc8003b46b0602c36a84ee5b44665887400305
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:49 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/Makefile.am b/Makefile.am
new file mode 100755 (executable)
index 0000000..82d138d
--- /dev/null
@@ -0,0 +1,16 @@
+SUBDIRS = src man
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xxf86vm.pc
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..a8cfc17
--- /dev/null
+++ b/README
@@ -0,0 +1,25 @@
+libXxf86vm - Extension library for the XFree86-VidMode X extension
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/lib/libXxf86vm
+
+        http://cgit.freedesktop.org/xorg/lib/libXxf86vm
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100644 (file)
index 0000000..e81f989
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
+
diff --git a/configure.ac b/configure.ac
new file mode 100755 (executable)
index 0000000..f84ec81
--- /dev/null
@@ -0,0 +1,28 @@
+AC_PREREQ([2.60])
+
+AC_INIT([libXxf86vm], [1.1.1],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+        [libXxf86vm])
+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(src/config.h)
+
+# Check for progs
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XXF86VM, xproto x11 xextproto xext [xf86vidmodeproto >= 2.2.99.1])
+
+XORG_CHECK_MALLOC_ZERO
+
+AC_OUTPUT([Makefile
+          src/Makefile
+          man/Makefile
+          xxf86vm.pc])
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..34ab4bf
--- /dev/null
@@ -0,0 +1,73 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+  git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
new file mode 100755 (executable)
index 0000000..a5878f4
--- /dev/null
@@ -0,0 +1,157 @@
+libxxf86vm (1:1.1.1-1slp2) unstable; urgency=low
+
+  * [X11R7.6] upgrade package 
+  * Git: 165.213.180.234:slp/pkgs/xorg/lib/libxxf86vm
+  * Tag: libxxf86vm_1.1.1-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Thu, 06 Jan 2011 12:05:29 +0900
+
+ibxxf86vm (1:1.1.0-6slp2) unstable; urgency=low
+
+  * Add --as-needed 
+  * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libxxf86vm
+  * Tag: libxxf86vm_1.1.0-6slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Sat, 20 Nov 2010 16:33:02 +0900
+
+libxxf86vm (1:1.1.0-5slp2) unstable; urgency=low
+
+  * Update maintainer
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+  * Tag: libxxf86vm_1.1.0-5slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 21 Apr 2010 14:28:36 +0900
+
+libxxf86vm (1:1.1.0-4slp2) unstable; urgency=low
+
+  * modify the package name
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Thu, 25 Mar 2010 18:07:38 +0900
+
+libxxf86vm (1:1.1.0-3) unstable; urgency=low
+
+  * Update version and change distribution from experimental to unstable
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 08 Dec 2009 19:46:18 +0900
+
+libxxf86vm (1:1.1.0-2) experimental; urgency=low
+
+  * Import debian package
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 08 Dec 2009 15:16:28 +0900
+
+libxxf86vm (1:1.1.0-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 06 Jan 2010 13:02:53 +0000
+
+libxxf86vm (1:1.1.0-1) experimental; urgency=low
+
+  [ Timo Aaltonen ]
+  * New upstream release.
+  * Run autoreconf on build. Add build-deps on automake, libtool and
+    xutils-dev.
+  * Parse space-separated DEB_BUILD_OPTIONS, and handle parallel=N.
+  * Bump Standards-Version to 3.8.3.
+  * Drop pre-dependency on x11-common from libxx86vm-dev.  This was needed
+    for upgrades from sarge.
+  * Add includes in -dev, bump {Build-,}Depends, add Replaces on
+    x11proto-xf86vidmode-dev.
+  * Move -dbg package to section debug.
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 02 Dec 2009 16:29:01 +0100
+
+libxxf86vm (1:1.0.2-1) unstable; urgency=low
+
+  [ Brice Goglin ]
+  * Add a link to www.X.org and a reference to the upstream module
+    in the long description.
+  * Add upstream URL to debian/copyright.
+  * Install the upstream ChangeLog.
+
+  [ Julien Cristau ]
+  * New upstream release.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 08 Jul 2008 23:45:15 +0200
+
+libxxf86vm (1:1.0.1-3) unstable; urgency=low
+
+  * Remove Fabio and Branden from Uploaders with their permission.
+  * Don't build-depend on packages with a -1 debian revision.
+  * Bump Standards-Version to 3.7.3.
+  * Add Vcs-* control fields.
+  * Don't make libxxf86vm1{,-dbg} depend on x11-common.
+  * Drop obsolete CVS information from the package descriptions.
+  * Use ${binary:Version} instead of the deprecated ${Source-Version}
+  * Add correct Section control fields for all packages.
+  * Add myself to Uploaders.
+  * autoreconf with current autools to get updated config.{guess,sub}.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 11 May 2008 17:41:49 +0200
+
+libxxf86vm (1:1.0.1-2) unstable; urgency=low
+
+  [ Andres Salomon ]
+  * Autoreconf w/ an updated xutils-dev so that manpages have the 'x'
+    extension dropped.
+
+  [ Drew Parsons ]
+  * dbg package has priority extra.
+
+ -- David Nusinow <dnusinow@debian.org>  Mon, 18 Sep 2006 22:26:21 -0400
+
+libxxf86vm (1:1.0.1-1) experimental; urgency=low
+
+  * New upstream release.
+  * Drop patches/01_manpage_location.diff; merged upstream.
+  * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+    idempotency fix.
+  * Run dh_install w/ --list-missing.
+  * Drop duplicate x11-common dep in -dev package.
+  * Bump standards version to 3.7.2.0.
+  * Version x11-common pre-dep in -dev package to 1:7.0.0 to match
+    the rest of Debian.
+  * Bump debhelper compat to 5.
+  * Fix dh_strip call to skip the -dbg package.
+  * Don't attempt to install (non-existent) usr/include/X11/* stuff.
+
+ -- Andres Salomon <dilinger@debian.org>  Sun, 23 Jul 2006 04:35:51 -0400
+
+libxxf86vm (1:1.0.0-4) unstable; urgency=low
+
+  * Reorder makeshlib command in rules file so that ldconfig is run
+    properly. Thanks Drew Parsons and Steve Langasek.
+  * Add quilt to build-depends
+
+ -- David Nusinow <dnusinow@debian.org>  Wed, 19 Apr 2006 02:47:28 -0400
+
+libxxf86vm (1:1.0.0-3) unstable; urgency=low
+
+  * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 23 Mar 2006 22:46:36 -0500
+
+libxxf86vm (1:1.0.0-2) experimental; urgency=low
+
+  * Backport manpage location fix
+
+ -- David Nusinow <dnusinow@debian.org>  Thu,  9 Mar 2006 23:38:46 -0500
+
+libxxf86vm (1:1.0.0-1) experimental; urgency=low
+
+  * First modular upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 29 Dec 2005 20:57:15 -0500
+
+libxxf86vm (7.0.0-2) breezy; urgency=low
+
+  * Bump libxext-dev build-dep to rid us of the dreaded _XOPEN_SOURCE.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Sun, 24 Jul 2005 12:04:32 +0000
+
+libxxf86vm (7.0.0-1) breezy; urgency=low
+
+  * First libxxf86vm release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 16 May 2005 22:10:17 +1000
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100755 (executable)
index 0000000..92068ad
--- /dev/null
@@ -0,0 +1,71 @@
+Source: libxxf86vm
+Section: x11
+Priority: optional
+Maintainer: Sung-Jin Park <sj76.park@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, David Nusinow <dnusinow@debian.org>, Andres Salomon <dilinger@debian.org>, Julien Cristau <jcristau@debian.org>
+Build-Depends: debhelper (>= 5.0.0), libx11-dev (>= 1:0.99.2), x11proto-xf86vidmode-dev (>= 2.2.99.1), libxext-dev (>= 1:0.99.1), pkg-config, quilt, automake, libtool, xutils-dev (>= 1:7.5-1slp2)
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libxxf86vm
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libxxf86vm.git
+
+Package: libxxf86vm1
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: X11 XFree86 video mode extension library
+ libXxf86vm provides an interface to the XFree86-VidModeExtension
+ extension, which allows client applications to get and set video mode
+ timings in extensive detail.  It is used by the xvidtune program in
+ particular.
+ .
+ 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/libXxf86vm
+
+Package: libxxf86vm1-dbg
+Section: debug
+Architecture: any
+Priority: extra
+Depends: ${shlibs:Depends}, ${misc:Depends}, libxxf86vm1 (= ${binary:Version})
+Description: X11 XFree86 video mode extension library (debug package)
+ libXxf86vm provides an interface to the XFree86-VidModeExtension
+ extension, which allows client applications to get and set video mode
+ timings in extensive detail.  It is used by the xvidtune program in
+ particular.
+ .
+ This package contains the debug versions of the library found in libxxf86vm1.
+ 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/libXxf86vm
+
+Package: libxxf86vm-dev
+Section: libdevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libxxf86vm1 (= ${binary:Version}), libx11-dev, x11proto-xf86vidmode-dev (>= 2.2.99.1)
+Replaces: x11proto-xf86vidmode-dev (<< 2.2.99.1)
+Description: X11 XFree86 video mode extension library (development headers)
+ libXxf86vm provides an interface to the XFree86-VidModeExtension
+ extension, which allows client applications to get and set video mode
+ timings in extensive detail.  It is used by the xvidtune program in
+ particular.
+ .
+ This package contains the development headers for the library found in
+ libxxf86vm1.  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/libXxf86vm
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..8b922bb
--- /dev/null
@@ -0,0 +1,13 @@
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/lib/
+
+Copyright (c) 1995  Kaleb S. Keithley
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL KALEB S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. Keithley shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Kaleb S. Keithley.
diff --git a/debian/libxxf86vm-dev.install b/debian/libxxf86vm-dev.install
new file mode 100755 (executable)
index 0000000..9f89073
--- /dev/null
@@ -0,0 +1,6 @@
+usr/share/man/*
+usr/lib/libXxf86vm.a
+usr/lib/libXxf86vm.la
+usr/lib/libXxf86vm.so
+usr/lib/pkgconfig/xxf86vm.pc
+usr/include/X11/extensions/
diff --git a/debian/libxxf86vm1.install b/debian/libxxf86vm1.install
new file mode 100644 (file)
index 0000000..a2d91f1
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/libXxf86vm.so.1*
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..0f03f8a
--- /dev/null
@@ -0,0 +1,100 @@
+#!/usr/bin/make -f
+# debian/rules for the Debian libxxf86vm 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 = libxxf86vm1
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+LDFLAGS +=  -Wl,--hash-style=both -Wl,--as-needed
+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_HOST_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+       confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+       confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+
+build: patch 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)" \
+                    LDFLAGS="$(LDFLAGS)" 
+       cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+       >$@
+
+clean: xsfclean
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+
+       rm -f config.cache config.log config.status
+       rm -f */config.cache */config.log */config.status
+       rm -f conftest* */conftest*
+       rm -rf autom4te.cache */autom4te.cache
+       rm -rf obj-*
+       rm -f aclocal.m4 config.guess config.h.in config.sub configure
+       rm -f depcomp install-sh ltmain.sh missing mkinstalldirs
+       find -name Makefile.in -exec rm -f {} \;
+       #find -name Makefile.in -delete
+       rm -f src/config.h.in
+
+       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 ChangeLog
+       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
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..f3ef78b
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/lib/ libXxf86vm-(.*)\.tar\.gz
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
new file mode 100644 (file)
index 0000000..5935cc9
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+       exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+       exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+       exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
new file mode 100644 (file)
index 0000000..5e16b10
--- /dev/null
@@ -0,0 +1,276 @@
+#!/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:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
new file mode 100644 (file)
index 0000000..813fd8d
--- /dev/null
@@ -0,0 +1,622 @@
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts.  It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions.  By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+  RECONFIGURE="true"
+else
+  RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+  FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+  UPGRADE="yes"
+fi
+
+trap "message;\
+      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+      message;\
+      exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+  # syntax: reject_nondigits [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters other than decimal digits and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain anything but digits?
+    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+      # can't use die(), because it wraps message() which wraps this function
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+           "possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+reject_unlikely_path_chars () {
+  # syntax: reject_unlikely_path_chars [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters unlikely to be seen in a path and which the shell might
+  # interpret and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain any funny characters?
+    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+      # can't use die(), because I want to avoid forward references
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+           "encountered possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user.  This is used only as a fallback in the
+# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+  DEFCOLUMNS=80
+fi
+
+message () {
+  # pretty-print messages of arbitrary length
+  reject_nondigits "$COLUMNS"
+  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+  # syntax: observe message ...
+  #
+  # issue observational message suitable for logging someday when support for
+  # it exists in dpkg
+  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+  fi
+}
+
+warn () {
+  # syntax: warn message ...
+  #
+  # issue warning message suitable for logging someday when support for
+  # it exists in dpkg; also send to standard error
+  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+  # syntax: die message ...
+  #
+  # exit script with error message
+  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+  exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+  message "internal error: $*"
+  if [ -n "$OFFICIAL_BUILD" ]; then
+    message "Please report a bug in the $THIS_SCRIPT script of the" \
+            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+            "Tracking System.  Include all messages above that mention the" \
+            "$THIS_PACKAGE package.  Visit " \
+            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+            "instructions, read the file" \
+            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+            "package, or install the reportbug package and use the command of" \
+            "the same name to file a report."
+  fi
+  exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+  message "usage error: $*"
+  message "Please report a bug in the $THIS_SCRIPT script of the" \
+          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+          "Tracking System.  Include all messages above that mention the" \
+          "$THIS_PACKAGE package.  Visit " \
+          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+          "instructions, read the file" \
+          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+          "package, or install the reportbug package and use the command of" \
+          "the same name to file a report."
+  exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+  # run $UPDATECMDS in $FONTDIRS
+
+  local dir cmd shortcmd x_font_dir_prefix
+
+  x_font_dir_prefix="/usr/share/fonts/X11"
+
+  if [ -z "$UPDATECMDS" ]; then
+    usage_error "font_update() called but \$UPDATECMDS not set"
+  fi
+  if [ -z "$FONTDIRS" ]; then
+    usage_error "font_update() called but \$FONTDIRS not set"
+  fi
+
+  reject_unlikely_path_chars "$UPDATECMDS"
+  reject_unlikely_path_chars "$FONTDIRS"
+
+  for dir in $FONTDIRS; do
+    if [ -d "$x_font_dir_prefix/$dir" ]; then
+      for cmd in $UPDATECMDS; do
+        if which "$cmd" > /dev/null 2>&1; then
+          shortcmd=${cmd##*/}
+          observe "running $shortcmd in $dir font directory"
+         cmd_opts=
+          if [ "$shortcmd" = "update-fonts-alias" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-dir" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-scale" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+                              "failed; font directory data may not" \
+                              "be up to date"
+        else
+          warn "$cmd not found; not updating corresponding $dir font" \
+               "directory data"
+        fi
+      done
+    else
+      warn "$dir is not a directory; not updating font directory data"
+    fi
+  done
+}
+
+remove_conffile_prepare () {
+  # syntax: remove_conffile_prepare filename official_md5sum ...
+  #
+  # Check a conffile "filename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 2 ]; then
+    usage_error "remove_conffile_prepare() called with wrong number of" \
+                "arguments; expected at least 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+  shift
+
+  # does the conffile even exist?
+  if [ -e "$conffile" ]; then
+    # calculate its checksum
+    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+    # compare it to each supplied checksum
+    while [ -n "$1" ]; do
+      if [ "$current_checksum" = "$1" ]; then
+        # we found a match; move the confffile and stop looking
+        observe "preparing obsolete conffile $conffile for removal"
+        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+        break
+      fi
+      shift
+    done
+  fi
+}
+
+remove_conffile_lookup () {
+  # syntax: remove_conffile_lookup package filename
+  #
+  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+  # if it matches the actual file's md5sum.
+  #
+  # Call this function when you would call remove_conffile_prepare but only
+  # want to check against dpkg's status database instead of known checksums.
+
+  local package conffile old_md5sum
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "remove_conffile_lookup() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  package="$1"
+  conffile="$2"
+
+  if ! [ -e "$conffile" ]; then
+    return
+  fi
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+  if [ -n "$old_md5sum" ]; then
+    remove_conffile_prepare "$conffile" "$old_md5sum"
+  fi
+}
+
+remove_conffile_commit () {
+  # syntax: remove_conffile_commit filename
+  #
+  # Complete the removal of a conffile "filename" that has become obsolete.
+  #
+  # Call this function from a postinst script after having used
+  # remove_conffile_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_commit() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, remove it
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "committing removal of obsolete conffile $conffile"
+    rm "$conffile.$THIS_PACKAGE-tmp"
+  fi
+}
+
+remove_conffile_rollback () {
+  # syntax: remove_conffile_rollback filename
+  #
+  # Roll back the removal of a conffile "filename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" is  after having used remove_conffile_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_rollback() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, move it
+  # back
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "rolling back removal of obsolete conffile $conffile"
+    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+  fi
+}
+
+replace_conffile_with_symlink_prepare () {
+  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+  # official_md5sum ...
+  #
+  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails. Otherwise copy it
+  # to newfilename and let dpkg handle it through conffiles mechanism.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 3 ]; then
+    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+                " number of arguments; expected at least 3, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  shift
+  newconffile="$1"
+  shift
+
+  remove_conffile_prepare "$_oldconffile" "$@"
+  # If $oldconffile still exists, then md5sums didn't match.
+  # Copy it to new one.
+  if [ -f "$oldconffile" ]; then
+    cp "$oldconffile" "$newconffile"
+  fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+  # syntax: replace_conffile_with_symlink_commit oldfilename
+  #
+  # Complete the removal of a conffile "oldfilename" that has been
+  # replaced by a symlink.
+  #
+  # Call this function from a postinst script after having used
+  # replace_conffile_with_symlink_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+                "number of arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+  #
+  # Roll back the replacing of a conffile "oldfilename" with symlink to
+  # "newfilename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" and verify $2 to ensure the package failed to upgrade
+  # from a version (or install over a version removed-but-not-purged) prior
+  # to the one in which the conffile was obsoleted.
+  # You should have  used replace_conffile_with_symlink_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+                "number of arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  newconffile="$2"
+
+  remove_conffile_rollback "$_oldconffile"
+  if [ -f "$newconffile" ]; then
+    rm "$newconffile"
+  fi
+}
+
+run () {
+  # syntax: run command [ argument ... ]
+  #
+  # Run specified command with optional arguments and report its exit status.
+  # Useful for commands whose exit status may be nonzero, but still acceptable,
+  # or commands whose failure is not fatal to us.
+  #
+  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+  # those cases the return value of the debconf command *must* be checked
+  # before the string returned by debconf is used for anything.
+
+  local retval
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "run() called with wrong number of arguments; expected at" \
+                "least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  "$@" || retval=$?
+
+  if [ ${retval:-0} -ne 0 ]; then
+    observe "command \"$*\" exited with status $retval"
+  fi
+}
+
+make_symlink_sane () {
+  # syntax: make_symlink_sane symlink target
+  #
+  # Ensure that the symbolic link symlink exists, and points to target.
+  #
+  # If symlink does not exist, create it and point it at target.
+  #
+  # If symlink exists but is not a symbolic link, back it up.
+  #
+  # If symlink exists, is a symbolic link, but points to the wrong location, fix
+  # it.
+  #
+  # If symlink exists, is a symbolic link, and already points to target, do
+  # nothing.
+  #
+  # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "make_symlink_sane() called with wrong number of arguments;" \
+      "expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local symlink target
+
+  symlink="$1"
+  target="$2"
+
+  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+      observe "link from $symlink to $target already exists"
+  else
+    observe "creating symbolic link from $symlink to $target"
+    mkdir -p "${target%/*}" "${symlink%/*}"
+    ln -s -b -S ".dpkg-old" "$target" "$symlink"
+  fi
+}
+
+migrate_dir_to_symlink () {
+  # syntax: migrate_dir_to_symlink old_location new_location
+  #
+  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+  # symbolic link to a directory or vice versa; instead, the existing state
+  # (symlink or not) will be left alone and dpkg will follow the symlink if
+  # there is one."
+  #
+  # We have to do it ourselves.
+  #
+  # This function moves the contents of old_location, a directory, into
+  # new_location, a directory, then makes old_location a symbolic link to
+  # new_location.
+  #
+  # old_location need not exist, but if it does, it must be a directory (or a
+  # symlink to a directory).  If it is not, it is backed up.  If new_location
+  # exists already and is not a directory, it is backed up.
+  #
+  # This function should be called from a package's preinst so that other
+  # packages unpacked after this one --- but before this package's postinst runs
+  # --- are unpacked into new_location even if their payloads contain
+  # old_location filespecs.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "migrate_dir_to_symlink() called with wrong number of"
+                "arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local new old
+
+  old="$1"
+  new="$2"
+
+  # Is old location a symlink?
+  if [ -L "$old" ]; then
+    # Does it already point to new location?
+    if [ "$(readlink "$old")" = "$new" ]; then
+      # Nothing to do; migration has already been done.
+      observe "migration of $old to $new already done"
+      return 0
+    else
+      # Back it up.
+      warn "backing up symbolic link $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+    fi
+  fi
+
+  # Does old location exist, but is not a directory?
+  if [ -e "$old" ] && ! [ -d "$old" ]; then
+      # Back it up.
+      warn "backing up non-directory $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+  fi
+
+  observe "migrating $old to $new"
+
+  # Is new location a symlink?
+  if [ -L "$new" ]; then
+    # Does it point the wrong way, i.e., back to where we're migrating from?
+    if [ "$(readlink "$new")" = "$old" ]; then
+      # Get rid of it.
+      observe "removing symbolic link $new which points to $old"
+      rm "$new"
+    else
+      # Back it up.
+      warn "backing up symbolic link $new as $new.dpkg-old"
+      mv -b "$new" "$new.dpkg-old"
+    fi
+  fi
+
+  # Does new location exist, but is not a directory?
+  if [ -e "$new" ] && ! [ -d "$new" ]; then
+    warn "backing up non-directory $new as $new.dpkg-old"
+    mv -b "$new" "$new.dpkg-old"
+  fi
+
+  # Create new directory if it does not yet exist.
+  if ! [ -e "$new" ]; then
+    observe "creating $new"
+    mkdir -p "$new"
+  fi
+
+  # Copy files in old location to new location.  Back up any filenames that
+  # already exist in the new location with the extension ".dpkg-old".
+  observe "copying files from $old to $new"
+  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+    die "error(s) encountered while copying files from $old to $new"
+  fi
+
+  # Remove files at old location.
+  observe "removing $old"
+  rm -r "$old"
+
+  # Create symlink from old location to new location.
+  make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
diff --git a/include/X11/extensions/xf86vmode.h b/include/X11/extensions/xf86vmode.h
new file mode 100644 (file)
index 0000000..136ce9c
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+
+Copyright 1995  Kaleb S. KEITHLEY
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY 
+shall not be used in advertising or otherwise to promote the sale, use 
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _XF86VIDMODE_H_
+#define _XF86VIDMODE_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+#include <X11/extensions/xf86vm.h>
+
+#define CLKFLAG_PROGRAMABLE            1
+
+#ifdef XF86VIDMODE_EVENTS
+#define XF86VidModeNotify              0
+#define XF86VidModeNumberEvents                (XF86VidModeNotify + 1)
+
+#define XF86VidModeNotifyMask          0x00000001
+
+#define XF86VidModeNonEvent            0
+#define XF86VidModeModeChange          1
+#else
+#define XF86VidModeNumberEvents                0
+#endif
+
+#define XF86VidModeBadClock            0
+#define XF86VidModeBadHTimings         1
+#define XF86VidModeBadVTimings         2
+#define XF86VidModeModeUnsuitable      3
+#define XF86VidModeExtensionDisabled   4
+#define XF86VidModeClientNotLocal      5
+#define XF86VidModeZoomLocked          6
+#define XF86VidModeNumberErrors                (XF86VidModeZoomLocked + 1)
+
+#define XF86VM_READ_PERMISSION 1
+#define XF86VM_WRITE_PERMISSION        2
+
+#ifndef _XF86VIDMODE_SERVER_
+
+typedef struct {
+    unsigned short     hdisplay;
+    unsigned short     hsyncstart;
+    unsigned short     hsyncend;
+    unsigned short     htotal;
+    unsigned short     hskew;
+    unsigned short     vdisplay;
+    unsigned short     vsyncstart;
+    unsigned short     vsyncend;
+    unsigned short     vtotal;
+    unsigned int       flags;
+    int                        privsize;
+#if defined(__cplusplus) || defined(c_plusplus)
+    /* private is a C++ reserved word */
+    INT32              *c_private;
+#else
+    INT32              *private;
+#endif
+} XF86VidModeModeLine;
+
+typedef struct {
+    unsigned int       dotclock;
+    unsigned short     hdisplay;
+    unsigned short     hsyncstart;
+    unsigned short     hsyncend;
+    unsigned short     htotal;
+    unsigned short     hskew;
+    unsigned short     vdisplay;
+    unsigned short     vsyncstart;
+    unsigned short     vsyncend;
+    unsigned short     vtotal;
+    unsigned int       flags;
+    int                        privsize;
+#if defined(__cplusplus) || defined(c_plusplus)
+    /* private is a C++ reserved word */
+    INT32              *c_private;
+#else
+    INT32              *private;
+#endif
+} XF86VidModeModeInfo;
+
+typedef struct {
+    float              hi;
+    float              lo;
+} XF86VidModeSyncRange;
+
+typedef struct {
+    char*                      vendor;
+    char*                      model;
+    float                      EMPTY;
+    unsigned char              nhsync;
+    XF86VidModeSyncRange*      hsync;
+    unsigned char              nvsync;
+    XF86VidModeSyncRange*      vsync;
+} XF86VidModeMonitor;
+    
+typedef struct {
+    int type;                  /* of event */
+    unsigned long serial;      /* # of last request processed by server */
+    Bool send_event;           /* true if this came from a SendEvent req */
+    Display *display;          /* Display the event was read from */
+    Window root;               /* root window of event screen */
+    int state;                 /* What happened */
+    int kind;                  /* What happened */
+    Bool forced;               /* extents of new region */
+    Time time;                 /* event timestamp */
+} XF86VidModeNotifyEvent;
+
+typedef struct {
+    float red;                 /* Red Gamma value */
+    float green;               /* Green Gamma value */
+    float blue;                        /* Blue Gamma value */
+} XF86VidModeGamma;
+
+
+#define XF86VidModeSelectNextMode(disp, scr) \
+       XF86VidModeSwitchMode(disp, scr, 1)
+#define XF86VidModeSelectPrevMode(disp, scr) \
+       XF86VidModeSwitchMode(disp, scr, -1)
+
+_XFUNCPROTOBEGIN
+
+Bool XF86VidModeQueryVersion(
+    Display*           /* dpy */,
+    int*               /* majorVersion */,
+    int*               /* minorVersion */
+);
+
+Bool XF86VidModeQueryExtension(
+    Display*           /* dpy */,
+    int*               /* event_base */,
+    int*               /* error_base */
+);
+
+Bool XF86VidModeSetClientVersion(
+    Display*           /* dpy */
+);
+
+Bool XF86VidModeGetModeLine(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    int*                       /* dotclock */,
+    XF86VidModeModeLine*       /* modeline */
+);
+
+Bool XF86VidModeGetAllModeLines(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    int*                       /* modecount */,
+    XF86VidModeModeInfo***     /* modelinesPtr */
+);
+
+Bool XF86VidModeAddModeLine(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeModeInfo*       /* new modeline */,
+    XF86VidModeModeInfo*       /* after modeline */
+);
+
+Bool XF86VidModeDeleteModeLine(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeModeInfo*       /* modeline */
+);
+
+Bool XF86VidModeModModeLine(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeModeLine*       /* modeline */
+);
+
+Status XF86VidModeValidateModeLine(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeModeInfo*       /* modeline */
+);
+
+Bool XF86VidModeSwitchMode(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    int                        /* zoom */
+);
+
+Bool XF86VidModeSwitchToMode(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeModeInfo*       /* modeline */
+);
+
+Bool XF86VidModeLockModeSwitch(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    int                        /* lock */
+);
+
+Bool XF86VidModeGetMonitor(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    XF86VidModeMonitor*        /* monitor */
+);
+
+Bool XF86VidModeGetViewPort(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    int*               /* x return */,
+    int*               /* y return */
+);
+
+Bool XF86VidModeSetViewPort(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    int                        /* x */,
+    int                        /* y */
+);
+
+Bool XF86VidModeGetDotClocks(
+    Display*           /* dpy */,
+    int                        /* screen */,
+    int*               /* flags return */,
+    int*               /* number of clocks return */,
+    int*               /* max dot clock return */,
+    int**              /* clocks return */
+);
+
+Bool XF86VidModeGetGamma(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeGamma*          /* Gamma */
+);
+
+Bool XF86VidModeSetGamma(
+    Display*                   /* dpy */,
+    int                                /* screen */,
+    XF86VidModeGamma*          /* Gamma */
+);
+
+Bool XF86VidModeSetGammaRamp(
+    Display*                    /* dpy */,
+    int                         /* screen */,
+    int                                /* size */, 
+    unsigned short*             /* red array */,
+    unsigned short*             /* green array */,
+    unsigned short*             /* blue array */
+);
+
+Bool XF86VidModeGetGammaRamp(
+    Display*                    /* dpy */,
+    int                         /* screen */,
+    int                         /* size */,
+    unsigned short*             /* red array */,
+    unsigned short*             /* green array */,
+    unsigned short*             /* blue array */
+);
+
+Bool XF86VidModeGetGammaRampSize(
+    Display*                    /* dpy */,
+    int                         /* screen */,
+    int*                        /* size */
+);
+
+Bool XF86VidModeGetPermissions(
+    Display*                    /* dpy */,
+    int                         /* screen */,
+    int*                       /* permissions */
+);
+
+_XFUNCPROTOEND
+
+#endif
+
+#endif
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100755 (executable)
index 0000000..89d3172
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+libmandir = $(LIB_MAN_DIR)
+
+libman_PRE =                           \
+       XF86VM.man                      \
+       $(XF86VM_shadows:=.man)
+
+XF86VM_shadows =                       \
+       XF86VidModeQueryExtension       \
+       XF86VidModeQueryVersion         \
+       XF86VidModeGetModeLine          \
+       XF86VidModeGetAllModeLines      \
+       XF86VidModeDeleteModeLine       \
+       XF86VidModeModModeLine          \
+       XF86VidModeSwitchMode           \
+       XF86VidModeSwitchToMode         \
+       XF86VidModeLockModeSwitch       \
+       XF86VidModeGetMonitor           \
+       XF86VidModeGetViewPort          \
+       XF86VidModeSetViewPort          \
+       XF86VidModeValidateModeLine     \
+       XF86VidModeSetClientVersion     \
+       XF86VidModeGetDotClocks         \
+       XF86VidModeGetGamma             \
+       XF86VidModeSetGamma             \
+       XF86VidModeSetGammaRamp         \
+       XF86VidModeGetGammaRamp         \
+       XF86VidModeGetGammaRampSize     \
+       XF86VidModeGetPermissions
+
+EXTRA_DIST = $(libman_PRE)
+CLEANFILES = $(libman_DATA)
+
+libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+.man.$(LIB_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
diff --git a/man/XF86VM.man b/man/XF86VM.man
new file mode 100755 (executable)
index 0000000..63fb76c
--- /dev/null
@@ -0,0 +1,419 @@
+.\"
+.\" Copyright (c) 1996  Joe Moss, The XFree86 Project
+.\" 
+.de ZN
+.ie t \fB\^\\$1\^\fR\\$2
+.el \fI\^\\$1\^\fP\\$2
+..
+.TH XF86VIDMODE __libmansuffix__ __vendorversion__
+.SH NAME
+XF86VidModeQueryExtension, XF86VidModeQueryVersion, XF86VidModeSetClientVersion, XF86VidModeGetModeLine, XF86VidModeGetAllModeLines, XF86VidModeDeleteModeLine, XF86VidModeModModeLine, XF86VidModeValidateModeLine, XF86VidModeSwitchMode, XF86VidModeSwitchToMode, XF86VidModeLockModeSwitch, XF86VidModeGetMonitor, XF86VidModeGetViewPort, XF86VidModeSetViewPort, XF86VidModeGetDotClocks, XF86VidModeGetGamma, XF86VidModeSetGamma, XF86VidModeGetGammaRamp, XF86VidModeSetGammaRamp, XF86VidModeGetGammaRampSize, XF86VidModeGetPermissions \- Extension library for the XFree86-VidMode X extension
+.SH SYNTAX
+.nf
+.LP
+\&#include <X11/extensions/xf86vmode.h>
+.LP
+Bool XF86VidModeQueryExtension(
+    Display *\fIdisplay\fP\^,
+    int *\fIevent_base_return\fP\^,
+    int *\fIerror_base_return\fP\^);
+.LP
+Bool XF86VidModeQueryVersion(
+    Display *\fIdisplay\fP\^,
+    int *\fImajor_version_return\fP\^,
+    int *\fIminor_version_return\fP\^);
+.LP
+Bool XF86VidModeSetClientVersion(
+    Display *\fIdisplay\fP\^);
+.LP
+Bool XF86VidModeGetModeLine(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int *\fIdotclock_return\fP\^,
+    XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeGetAllModeLines(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int *\fImodecount_return\fP\^,
+    XF86VidModeModeInfo ***\fImodesinfo\fP\^);
+.ig
+.LP
+Bool XF86VidModeAddModeLine(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeModeInfo *\fImodeline\fP\,
+    XF86VidModeModeInfo *\fIaftermode\fP\^);
+..
+.LP
+Bool XF86VidModeDeleteModeLine(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeModeInfo *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeModModeLine(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Status XF86VidModeValidateModeLine(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeSwitchMode(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int \fIzoom\fP\^);
+.LP
+Bool XF86VidModeSwitchToMode(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeModeInfo *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeLockModeSwitch(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int \fIlock\fP\^);
+.LP
+Bool XF86VidModeGetMonitor(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeMonitor *\fImonitor\fP\^);
+.LP
+Bool XF86VidModeGetViewPort(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int *\fIx_return\fP\^,
+    int *\fIy_return\fP\^);
+.LP
+Bool XF86VidModeSetViewPort(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int \fIx\fP\^,
+    int \fIy\fP\^);
+.LP
+XF86VidModeGetDotClocks(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int *\fIflags return\fP\^,
+    int *\fInumber of clocks return\fP\^,
+    int *\fImax dot clock return\fP\^,
+    int **\fIclocks return\fP\^);
+.LP
+XF86VidModeGetGamma(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeGamma *\fIGamma\fP\^);
+.LP
+XF86VidModeSetGamma(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    XF86VidModeGamma *\fIGamma\fP\^);
+.LP
+XF86VidModeGetGammaRamp(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int \fIsize\fP\^,
+    unsigned short *\fIred array\fP\^,
+    unsigned short *\fIgreen array\fP\^,
+    unsigned short *\fIblue array\fP\^);
+.LP
+XF86VidModeSetGammaRamp(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int \fIsize\fP\^,
+    unsigned short *\fIred array\fP\^,
+    unsigned short *\fIgreen array\fP\^,
+    unsigned short *\fIblue array\fP\^);
+.LP
+XF86VidModeGetGammaRampSize(
+    Display *\fIdisplay\fP\^,
+    int \fIscreen\fP\^,
+    int *\fIsize\fP\^);
+.fi
+.SH ARGUMENTS
+.IP \fIdisplay\fP 2i
+Specifies the connection to the X server.
+.IP \fIscreen\fP 2i
+Specifies which screen number the setting apply to.
+.IP \fIevent_base_return\fP 2i
+Returns the base event number for the extension.
+.IP \fIerror_base_return\fP 2i
+Returns the base error number for the extension.
+.IP \fImajor_version_return\fP 2i
+Returns the major version number of the extension.
+.IP \fIminor_version_return\fP 2i
+Returns the minor version number of the extension.
+.IP \fIdotclock_return\fP 2i
+Returns the clock for the mode line.
+.IP \fImodecount_return\fP 2i
+Returns the number of video modes available in the server.
+.IP \fIzoom\fP 2i
+If greater than zero, indicates that the server should switch to
+the next mode, otherwise switch to the previous mode.
+.IP \fIlock\fP 2i
+Indicates that mode switching should be locked, if non-zero.
+.IP \fImodeline\fP 2i
+Specifies or returns the timing values for a video mode.
+.ig
+.IP \fIaftermode\fP 2i
+Specifies the timing values for the video mode after which the
+new mode will added.
+..
+.IP \fImodesinfo\fP 2i
+Returns the timing values and dotclocks for all of the available
+video modes.
+.IP \fImonitor\fP 2i
+Returns information about the monitor.
+.IP \fIx\fP 2i
+Specifies the desired X location for the viewport.
+.IP \fIx_return\fP 2i
+Returns the current X location of the viewport.
+.IP \fIy\fP 2i
+Specifies the desired Y location for the viewport.
+.IP \fIy_return\fP 2i
+Returns the current Y location of the viewport.
+.SH STRUCTURES
+.nf
+.ta 2.25i 3.5i
+\fIVideo Mode Settings:\fP
+typedef struct {
+    unsigned short     hdisplay;       /\(** Number of display pixels horizontally */
+    unsigned short     hsyncstart;     /\(** Horizontal sync start */
+    unsigned short     hsyncend;       /\(** Horizontal sync end */
+    unsigned short     htotal; /\(** Total horizontal pixels */
+    unsigned short     vdisplay;       /\(** Number of display pixels vertically */
+    unsigned short     vsyncstart;     /\(** Vertical sync start */
+    unsigned short     vsyncend;       /\(** Vertical sync start */
+    unsigned short     vtotal; /\(** Total vertical pixels */
+    unsigned int       flags;  /\(** Mode flags */
+    int        privsize;       /\(** Size of private */
+    INT32      *private;       /\(** Server privates */
+} XF86VidModeModeLine;
+.sp
+typedef struct {
+    unsigned int       dotclock;       /\(** Pixel clock */
+    unsigned short     hdisplay;       /\(** Number of display pixels horizontally */
+    unsigned short     hsyncstart;     /\(** Horizontal sync start */
+    unsigned short     hsyncend;       /\(** Horizontal sync end */
+    unsigned short     htotal; /\(** Total horizontal pixels */
+    unsigned short     vdisplay;       /\(** Number of display pixels vertically */
+    unsigned short     vsyncstart;     /\(** Vertical sync start */
+    unsigned short     vsyncend;       /\(** Vertical sync start */
+    unsigned short     vtotal; /\(** Total vertical pixels */
+    unsigned int       flags;  /\(** Mode flags */
+    int        privsize;       /\(** Size of private */
+    INT32      *private;       /\(** Server privates */
+} XF86VidModeModeInfo;
+.LP
+\fIMonitor information:\fP
+typedef struct {
+    char*      vendor; /\(** Name of manufacturer */
+    char*      model;  /\(** Model name */
+    float      EMPTY;  /\(** unused, for backward compatibility */
+    unsigned char      nhsync; /\(** Number of horiz sync ranges */
+    XF86VidModeSyncRange*      hsync;  /\(** Horizontal sync ranges */
+    unsigned char      nvsync; /\(** Number of vert sync ranges */
+    XF86VidModeSyncRange*      vsync;  /\(** Vertical sync ranges */
+} XF86VidModeMonitor;
+.sp
+typedef struct {
+    float      hi;     /\(** Top of range */
+    float      lo;     /\(** Bottom of range */
+} XF86VidModeSyncRange;
+.LP
+typedef struct {
+    int type;                  /\(** of event */
+    unsigned long serial;      /\(** # of last request processed by server */
+    Bool send_event;           /\(** true if this came from a SendEvent req */
+    Display *display;          /\(** Display the event was read from */
+    Window root;               /\(** root window of event screen */
+    int state;                 /\(** What happened */
+    int kind;                  /\(** What happened */
+    Bool forced;               /\(** extents of new region */
+    Time time;                 /\(** event timestamp */
+} XF86VidModeNotifyEvent;
+.LP
+typedef struct {
+    float red;                 /\(** Red Gamma value */
+    float green;               /\(** Green Gamma value */
+    float blue;                        /\(** Blue Gamma value */
+} XF86VidModeGamma;
+.fi
+.SH DESCRIPTION
+These functions provide an interface to the server extension
+\fIXFree86-VidModeExtension\fP
+which allows the video modes to be
+queried and adjusted dynamically and mode switching to be controlled.
+Applications that use these functions must be linked with
+.ZN -lXxf86vm
+.SS "MODELINE FUNCTIONS"
+The
+.ZN XF86VidModeGetModeLine
+function is used to query the settings for the currently selected
+video mode.  The calling program should pass a pointer to a 
+.ZN XF86VidModeModeLine
+structure that it has already allocated.  The function fills in
+the fields of the structure.
+.PP
+If there are any server private values (currently only applicable to
+the S3 server) the function will allocate storage for them.
+Therefore, if the
+.ZN privsize
+field is non-zero, the calling program should call
+.ZN Xfree(private)
+to free the storage.
+.PP
+.ZN XF86VidModeGetAllModeLines
+returns the settings for all video modes.
+The calling program supplies the address of a pointer which will be
+set by the function to point to an array of
+.ZN XF86VidModeModeInfo
+structures.  The memory occupied by the array is dynamically allocated
+by the
+.ZN XF86VidModeGetAllModeLines
+function and should be freed by the caller.
+The first element of the array corresponds to the current video mode.
+.PP
+The
+.ZN XF86VidModeModModeLine
+function can be used to change the settings of the current video mode
+provided the requested settings are valid (e.g. they don't exceed the
+capabilities of the monitor).
+.PP
+.ig
+To add a mode to the list of available modes, the
+.ZN XF86VidModeAddModeLine
+function can be used.
+Assuming the settings are valid, the video mode will be added after
+the existing mode which matches the timings specified by the
+.ZN aftermode
+parameter.
+To be considered a match, all of the fields of the given
+.ZN XF86VidModeModeInfo
+structure must match, except the
+.ZN privsize
+and
+.ZN private
+fields.
+If the
+.ZN aftermode
+parameter is zero, the mode will be added
+after the current mode.
+.PP
+..
+Modes can be deleted with the
+.ZN XF86VidModeDeleteModeLine
+function.  The specified mode must match an existing mode.
+To be considered a match, all of the fields of the given
+.ZN XF86VidModeModeInfo
+structure must match, except the
+.ZN privsize
+and
+.ZN private
+fields.
+If the mode to be deleted is the current mode, a mode switch
+to the next mode will occur first.  The last remaining mode can not
+be deleted.
+.PP
+The validity of a mode can be checked with the
+.ZN XF86VidModeValidateModeLine
+function.
+If the specified mode can be used by the server (i.e. meets all the
+constraints placed upon a mode by the combination of the server, card,
+and monitor) the function returns
+.ZN MODE_OK ,
+otherwise it returns a value indicating the reason why the mode is
+invalid (as defined in \fIxf86.h\fP)
+.SS "MODE SWITCH FUNCTIONS"
+When the function
+.ZN XF86VidModeSwitchMode
+is called, the server will change the video mode to next (or previous)
+video mode. The
+.ZN XF86VidModeSwitchToMode
+function can be used to switch directly to the specified mode.
+Matching is as specified in the description of the
+.ZN XF86VidModeAddModeLine
+function above.
+The
+.ZN XF86VidModeLockModeSwitch
+function can be used to allow or disallow mode switching whether
+the request to switch modes comes from a call to the
+.ZN XF86VidModeSwitchMode
+or
+.ZN XF86VidModeSwitchToMode
+functions or from one of the mode switch key sequences.
+.PP
+.RB Note:
+Because of the asynchronous nature of the X protocol, a call to 
+.ZN XFlush
+is needed if the application wants to see the mode change immediately.
+To be informed of the execution status of the request, a
+custom error handler should be installed using
+.ZN XSetErrorHandler
+before calling the mode switching function. 
+.SS "MONITOR FUNCTIONS"
+Information known to the server about the monitor is returned by the
+.ZN XF86VidModeGetMonitor
+function.  The
+.ZN hsync
+and
+.ZN vsync
+fields each point to an array of
+.ZN XF86VidModeSyncRange
+structures.  The arrays contain
+.ZN nhsync
+and
+.ZN nvsync
+elements, respectively.
+The
+.ZN hi
+and
+.ZN low
+values will be equal if a discreate value was given in the
+.ZN XF86Config
+file.
+.PP
+The
+.ZN vendor ,
+.ZN model ,
+.ZN hsync ,
+and
+.ZN vsync
+fields point to dynamically allocated storage that should be freed
+by the caller.
+.SS "VIEWPORT FUNCTIONS"
+The
+.ZN XF86VidModeGetViewPort
+and
+.ZN XF86VidModeSetViewPort
+functions can be used to, respectively, query and change the location
+of the upper left corner of the viewport into the virtual screen.
+.SS "OTHER FUNCTIONS"
+The
+.ZN XF86VidModeQueryVersion
+function can be used to determine the version of the extension
+built into the server.
+.PP
+The function
+.ZN XF86VidModeQueryExtension
+returns the lowest numbered error and event values
+assigned to the extension.
+.SH BUGS
+The
+XF86VidModeSetClientVersion,
+XF86VidModeGetDotClocks,
+XF86VidModeGetGamma,
+XF86VidModeSetGamma,
+XF86VidModeSetGammaRamp,
+XF86VidModeGetGammaRamp,
+XF86VidModeGetGammaRampSize,
+and
+XF86VidModeGetPermissions
+functions need to be documented.  In the meantime, check the source
+code for information about how to use them.
+.SH SEE ALSO
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), XFlush(__libmansuffix__), XSetErrorHandler(__libmansuffix__), xvidtune(__appmansuffix__)
+.SH AUTHORS
+Kaleb Keithley, Jon Tombs, David Dawes, and Joe Moss
diff --git a/man/XF86VidModeDeleteModeLine.man b/man/XF86VidModeDeleteModeLine.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetAllModeLines.man b/man/XF86VidModeGetAllModeLines.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetDotClocks.man b/man/XF86VidModeGetDotClocks.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetGamma.man b/man/XF86VidModeGetGamma.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetGammaRamp.man b/man/XF86VidModeGetGammaRamp.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetGammaRampSize.man b/man/XF86VidModeGetGammaRampSize.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetModeLine.man b/man/XF86VidModeGetModeLine.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetMonitor.man b/man/XF86VidModeGetMonitor.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetPermissions.man b/man/XF86VidModeGetPermissions.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeGetViewPort.man b/man/XF86VidModeGetViewPort.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeLockModeSwitch.man b/man/XF86VidModeLockModeSwitch.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeModModeLine.man b/man/XF86VidModeModModeLine.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeQueryExtension.man b/man/XF86VidModeQueryExtension.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeQueryVersion.man b/man/XF86VidModeQueryVersion.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSetClientVersion.man b/man/XF86VidModeSetClientVersion.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSetGamma.man b/man/XF86VidModeSetGamma.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSetGammaRamp.man b/man/XF86VidModeSetGammaRamp.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSetViewPort.man b/man/XF86VidModeSetViewPort.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSwitchMode.man b/man/XF86VidModeSwitchMode.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeSwitchToMode.man b/man/XF86VidModeSwitchToMode.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/man/XF86VidModeValidateModeLine.man b/man/XF86VidModeValidateModeLine.man
new file mode 100755 (executable)
index 0000000..cf4cb48
--- /dev/null
@@ -0,0 +1 @@
+.so man__libmansuffix__/XF86VM.__libmansuffix__
diff --git a/packaging/libXxf86vm.spec b/packaging/libXxf86vm.spec
new file mode 100644 (file)
index 0000000..a025911
--- /dev/null
@@ -0,0 +1,74 @@
+
+Name:       libXxf86vm
+Summary:    X.Org X11 libXxf86vm runtime library
+Version:    1.1.1
+Release:    1
+Group:      System/Libraries
+License:    MIT
+URL:        http://www.x.org
+Source0:    http://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(xext)
+BuildRequires:  pkgconfig(xproto)
+BuildRequires:  pkgconfig(xextproto)
+BuildRequires:  pkgconfig(xf86vidmodeproto) >= 2.2.99.1
+BuildRequires:  pkgconfig(xorg-macros)
+
+
+%description
+Extension library for the XFree86-VidMode X extension.
+
+
+
+%package devel
+Summary:    X.Org X11 libXxf86vm development package
+Group:      System/Libraries
+Requires:   %{name} = %{version}-%{release}
+Requires:   xorg-x11-filesystem
+
+%description devel
+Extension development library for the XFree86-VidMode X extension
+
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+
+%reconfigure --disable-static
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+# FIXME: missing some of these files %doc AUTHORS COPYING README INSTALL ChangeLog
+%doc COPYING ChangeLog
+%{_libdir}/libXxf86vm.so.1
+%{_libdir}/libXxf86vm.so.1.0.0
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libXxf86vm.so
+%{_libdir}/pkgconfig/xxf86vm.pc
+%{_includedir}/X11/extensions/xf86vmode.h
+%doc %{_mandir}/man3/*.3*
+
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..8ae10ae
--- /dev/null
@@ -0,0 +1,12 @@
+lib_LTLIBRARIES = libXxf86vm.la
+
+libXxf86vm_la_SOURCES = XF86VMode.c
+
+AM_CFLAGS = $(XXF86VM_CFLAGS) $(MALLOC_ZERO_CFLAGS)
+libXxf86vm_la_LIBADD = $(XXF86VM_LIBS)
+libXxf86vm_la_LDFLAGS = -version-number 1:0:0
+
+INCLUDES = -I$(top_srcdir)/include
+
+libXxf86vmincludedir = $(includedir)/X11/extensions
+libXxf86vminclude_HEADERS = $(top_srcdir)/include/X11/extensions/xf86vmode.h
diff --git a/src/XF86VMode.c b/src/XF86VMode.c
new file mode 100755 (executable)
index 0000000..d924e2a
--- /dev/null
@@ -0,0 +1,1184 @@
+/*
+
+Copyright (c) 1995  Kaleb S. KEITHLEY
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES 
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY 
+shall not be used in advertising or otherwise to promote the sale, use 
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY.
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/xf86vmproto.h>
+#include <X11/extensions/xf86vmode.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifndef MODE_BAD
+#define MODE_BAD 255
+#endif
+
+static XExtensionInfo _xf86vidmode_info_data;
+static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data;
+static char *xf86vidmode_extension_name = XF86VIDMODENAME;
+
+#define XF86VidModeCheckExtension(dpy,i,val) \
+  XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
+
+/*****************************************************************************
+ *                                                                           *
+ *                        private utility routines                          *
+ *                                                                           *
+ *****************************************************************************/
+
+static XEXT_CLOSE_DISPLAY_PROTO(close_display);
+static /* const */ XExtensionHooks xf86vidmode_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, xf86vidmode_info, 
+                                  xf86vidmode_extension_name, 
+                                  &xf86vidmode_extension_hooks, 
+                                  0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86vidmode_info)
+
+
+/*****************************************************************************
+ *                                                                           *
+ *                 public XFree86-VidMode Extension routines                *
+ *                                                                           *
+ *****************************************************************************/
+
+Bool
+XF86VidModeQueryExtension(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;
+    }
+}
+
+Bool
+XF86VidModeQueryVersion(Display* dpy, int* majorVersion, int* minorVersion)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeQueryVersionReply rep;
+    xXF86VidModeQueryVersionReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeQueryVersion, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
+    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+       UnlockDisplay(dpy);
+       SyncHandle();
+       return False;
+    }
+    *majorVersion = rep.majorVersion;
+    *minorVersion = rep.minorVersion;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    if (*majorVersion >= 2)
+       XF86VidModeSetClientVersion(dpy);
+    return True;
+}
+
+Bool
+XF86VidModeSetClientVersion(Display *dpy)
+{
+    XExtDisplayInfo *info = find_display(dpy);
+    xXF86VidModeSetClientVersionReq *req;
+
+    XF86VidModeCheckExtension(dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeSetClientVersion, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion;
+    req->major = XF86VIDMODE_MAJOR_VERSION;
+    req->minor = XF86VIDMODE_MINOR_VERSION;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeSetGamma(Display *dpy, int screen, XF86VidModeGamma *Gamma)
+{
+    XExtDisplayInfo *info = find_display(dpy);
+    xXF86VidModeSetGammaReq *req;
+
+    XF86VidModeCheckExtension(dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeSetGamma, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeSetGamma;
+    req->screen = screen;
+    req->red = (CARD32)(Gamma->red * 10000.);
+    req->green = (CARD32)(Gamma->green * 10000.);
+    req->blue = (CARD32)(Gamma->blue * 10000.);
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeGetGamma(Display *dpy, int screen, XF86VidModeGamma *Gamma)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetGammaReply rep;
+    xXF86VidModeGetGammaReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetGamma, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
+    req->screen = screen;
+    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+       UnlockDisplay(dpy);
+       SyncHandle();
+       return False;
+    }
+    Gamma->red = ((float)rep.red) / 10000.;
+    Gamma->green = ((float)rep.green) / 10000.;
+    Gamma->blue = ((float)rep.blue) / 10000.;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeGetModeLine(Display* dpy, int screen, int* dotclock,
+                      XF86VidModeModeLine* modeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetModeLineReply rep;
+    xXF86OldVidModeGetModeLineReply oldrep;
+    xXF86VidModeGetModeLineReq *req;
+    int majorVersion, minorVersion;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetModeLine, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
+    req->screen = screen;
+    
+    if (majorVersion < 2) {
+       if (!_XReply(dpy, (xReply *)&oldrep, 
+            (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+           UnlockDisplay(dpy);
+           SyncHandle();
+           return False;
+       }
+       *dotclock = oldrep.dotclock;
+       modeline->hdisplay   = oldrep.hdisplay;
+       modeline->hsyncstart = oldrep.hsyncstart;
+       modeline->hsyncend   = oldrep.hsyncend;
+       modeline->htotal     = oldrep.htotal;
+       modeline->hskew      = 0;
+       modeline->vdisplay   = oldrep.vdisplay;
+       modeline->vsyncstart = oldrep.vsyncstart;
+       modeline->vsyncend   = oldrep.vsyncend;
+       modeline->vtotal     = oldrep.vtotal;
+       modeline->flags      = oldrep.flags;
+       modeline->privsize   = oldrep.privsize;
+    } else {
+       if (!_XReply(dpy, (xReply *)&rep, 
+            (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+           UnlockDisplay(dpy);
+           SyncHandle();
+           return False;
+       }
+       *dotclock = rep.dotclock;
+       modeline->hdisplay   = rep.hdisplay;
+       modeline->hsyncstart = rep.hsyncstart;
+       modeline->hsyncend   = rep.hsyncend;
+       modeline->htotal     = rep.htotal;
+       modeline->hskew      = rep.hskew;
+       modeline->vdisplay   = rep.vdisplay;
+       modeline->vsyncstart = rep.vsyncstart;
+       modeline->vsyncend   = rep.vsyncend;
+       modeline->vtotal     = rep.vtotal;
+       modeline->flags      = rep.flags;
+       modeline->privsize   = rep.privsize;
+    }
+    
+    if (modeline->privsize > 0) {
+       if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
+           _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
+           Xfree(modeline->private);
+           return False;
+       }
+       _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
+    } else {
+       modeline->private = NULL;
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
+                          XF86VidModeModeInfo ***modelinesPtr)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetAllModeLinesReply rep;
+    xXF86VidModeGetAllModeLinesReq *req;
+    XF86VidModeModeInfo *mdinfptr, **modelines;
+    xXF86VidModeModeInfo xmdline;
+    xXF86OldVidModeModeInfo oldxmdline;
+    int i;
+    int majorVersion, minorVersion;
+    Bool protocolBug = False;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    /*
+     * Note: There was a bug in the protocol implementation in versions
+     * 0.x with x < 8 (the .private field wasn't being passed over the wire).
+     * Check the server's version, and accept the old format if appropriate.
+     */
+
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+    if (majorVersion == 0 && minorVersion < 8) {
+       protocolBug = True;
+#ifdef DEBUG
+       fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is"
+               "running an old version (%d.%d)\n", majorVersion,
+               minorVersion);
+#endif
+    }
+    
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetAllModeLines, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
+    req->screen = screen;
+    if (!_XReply(dpy, (xReply *)&rep, 
+        (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+        UnlockDisplay(dpy);
+       SyncHandle();
+       return False;
+    }
+
+    *modecount = rep.modecount;
+
+    if (!(modelines = (XF86VidModeModeInfo **) Xcalloc(rep.modecount,
+                                          sizeof(XF86VidModeModeInfo *)
+                                          +sizeof(XF86VidModeModeInfo)))) {
+       if (majorVersion < 2)
+            _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
+       else
+            _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
+        Xfree(modelines);
+        return False;
+    }
+    mdinfptr = (XF86VidModeModeInfo *) (
+                           (char *) modelines
+                           + rep.modecount*sizeof(XF86VidModeModeInfo *)
+                   );
+
+    for (i = 0; i < rep.modecount; i++) {
+        modelines[i] = mdinfptr++;
+       if (majorVersion < 2) {
+            _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
+           modelines[i]->dotclock   = oldxmdline.dotclock;
+           modelines[i]->hdisplay   = oldxmdline.hdisplay;
+           modelines[i]->hsyncstart = oldxmdline.hsyncstart;
+           modelines[i]->hsyncend   = oldxmdline.hsyncend;
+           modelines[i]->htotal     = oldxmdline.htotal;
+           modelines[i]->hskew      = 0;
+           modelines[i]->vdisplay   = oldxmdline.vdisplay;
+           modelines[i]->vsyncstart = oldxmdline.vsyncstart;
+           modelines[i]->vsyncend   = oldxmdline.vsyncend;
+           modelines[i]->vtotal     = oldxmdline.vtotal;
+           modelines[i]->flags      = oldxmdline.flags;
+           if (protocolBug) {
+               modelines[i]->privsize = 0;
+               modelines[i]->private = NULL;
+           } else {
+               modelines[i]->privsize   = oldxmdline.privsize;
+               if (oldxmdline.privsize > 0) {
+                   if (!(modelines[i]->private =
+                           Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
+                       _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
+                       Xfree(modelines[i]->private);
+                   } else {
+                       _XRead(dpy, (char*)modelines[i]->private,
+                            oldxmdline.privsize * sizeof(INT32));
+                   }
+               } else {
+                 modelines[i]->private = NULL;
+               }
+           }
+       } else {
+            _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
+           modelines[i]->dotclock   = xmdline.dotclock;
+           modelines[i]->hdisplay   = xmdline.hdisplay;
+           modelines[i]->hsyncstart = xmdline.hsyncstart;
+           modelines[i]->hsyncend   = xmdline.hsyncend;
+           modelines[i]->htotal     = xmdline.htotal;
+           modelines[i]->hskew      = xmdline.hskew;
+           modelines[i]->vdisplay   = xmdline.vdisplay;
+           modelines[i]->vsyncstart = xmdline.vsyncstart;
+           modelines[i]->vsyncend   = xmdline.vsyncend;
+           modelines[i]->vtotal     = xmdline.vtotal;
+           modelines[i]->flags      = xmdline.flags;
+           if (protocolBug) {
+               modelines[i]->privsize = 0;
+               modelines[i]->private = NULL;
+           } else {
+               modelines[i]->privsize   = xmdline.privsize;
+               if (xmdline.privsize > 0) {
+                   if (!(modelines[i]->private =
+                           Xcalloc(xmdline.privsize, sizeof(INT32)))) {
+                       _XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
+                       Xfree(modelines[i]->private);
+                   } else {
+                       _XRead(dpy, (char*)modelines[i]->private,
+                            xmdline.privsize * sizeof(INT32));
+                   }
+               } else {
+                   modelines[i]->private = NULL;
+               }
+           }
+       }
+    }
+    *modelinesPtr = modelines;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+/*
+ * GetReq replacement for use with VidMode protocols earlier than 2.0
+ */
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetOldReq(name, oldname, req) \
+        WORD64ALIGN\
+       if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
+               _XFlush(dpy);\
+       req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
+       req->reqType = X_##name;\
+       req->length = (SIZEOF(x##oldname##Req))>>2;\
+       dpy->bufptr += SIZEOF(x##oldname##Req);\
+       dpy->request++
+
+#else  /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define GetOldReq(name, oldname, req) \
+        WORD64ALIGN\
+       if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
+               _XFlush(dpy);\
+       req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
+       req->reqType = X_/**/name;\
+       req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
+       dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\
+       dpy->request++
+#endif
+
+Bool
+XF86VidModeAddModeLine(Display *dpy, int screen,
+                      XF86VidModeModeInfo* newmodeline,
+                      XF86VidModeModeInfo* aftermodeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeAddModeLineReq *req;
+    xXF86OldVidModeAddModeLineReq *oldreq;
+    int majorVersion, minorVersion;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+    LockDisplay(dpy);
+    if (majorVersion < 2) {
+       GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
+       oldreq->reqType = info->codes->major_opcode;
+       oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+       oldreq->screen = screen;
+       oldreq->dotclock =      newmodeline->dotclock;
+       oldreq->hdisplay =      newmodeline->hdisplay;
+       oldreq->hsyncstart =    newmodeline->hsyncstart;
+       oldreq->hsyncend =      newmodeline->hsyncend;
+       oldreq->htotal =        newmodeline->htotal;
+       oldreq->vdisplay =      newmodeline->vdisplay;
+       oldreq->vsyncstart =    newmodeline->vsyncstart;
+       oldreq->vsyncend =      newmodeline->vsyncend;
+       oldreq->vtotal =        newmodeline->vtotal;
+       oldreq->flags =         newmodeline->flags;
+       oldreq->privsize =      newmodeline->privsize;
+       if (aftermodeline != NULL) {
+           oldreq->after_dotclock =    aftermodeline->dotclock;
+           oldreq->after_hdisplay =    aftermodeline->hdisplay;
+           oldreq->after_hsyncstart =  aftermodeline->hsyncstart;
+           oldreq->after_hsyncend =    aftermodeline->hsyncend;
+           oldreq->after_htotal =      aftermodeline->htotal;
+           oldreq->after_vdisplay =    aftermodeline->vdisplay;
+           oldreq->after_vsyncstart =  aftermodeline->vsyncstart;
+           oldreq->after_vsyncend =    aftermodeline->vsyncend;
+           oldreq->after_vtotal =      aftermodeline->vtotal;
+           oldreq->after_flags =       aftermodeline->flags;
+       } else {
+           oldreq->after_dotclock =    0;
+           oldreq->after_hdisplay =    0;
+           oldreq->after_hsyncstart =  0;
+           oldreq->after_hsyncend =    0;
+           oldreq->after_htotal =      0;
+           oldreq->after_vdisplay =    0;
+           oldreq->after_vsyncstart =  0;
+           oldreq->after_vsyncend =    0;
+           oldreq->after_vtotal =      0;
+           oldreq->after_flags =       0;
+       }
+       if (newmodeline->privsize) {
+           oldreq->length += newmodeline->privsize;
+           Data32(dpy, (long *) newmodeline->private,
+              newmodeline->privsize * sizeof(INT32));
+       }
+    } else {
+       GetReq(XF86VidModeAddModeLine, req);
+       req->reqType = info->codes->major_opcode;
+       req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+       req->screen = screen;
+       req->dotclock =         newmodeline->dotclock;
+       req->hdisplay =         newmodeline->hdisplay;
+       req->hsyncstart =       newmodeline->hsyncstart;
+       req->hsyncend =         newmodeline->hsyncend;
+       req->htotal =           newmodeline->htotal;
+       req->hskew =            newmodeline->hskew;
+       req->vdisplay =         newmodeline->vdisplay;
+       req->vsyncstart =       newmodeline->vsyncstart;
+       req->vsyncend =         newmodeline->vsyncend;
+       req->vtotal =           newmodeline->vtotal;
+       req->flags =            newmodeline->flags;
+       req->privsize =         newmodeline->privsize;
+       if (aftermodeline != NULL) {
+           req->after_dotclock =       aftermodeline->dotclock;
+           req->after_hdisplay =       aftermodeline->hdisplay;
+           req->after_hsyncstart =     aftermodeline->hsyncstart;
+           req->after_hsyncend =       aftermodeline->hsyncend;
+           req->after_htotal =         aftermodeline->htotal;
+           req->after_hskew =          aftermodeline->hskew;
+           req->after_vdisplay =       aftermodeline->vdisplay;
+           req->after_vsyncstart =     aftermodeline->vsyncstart;
+           req->after_vsyncend =       aftermodeline->vsyncend;
+           req->after_vtotal =         aftermodeline->vtotal;
+           req->after_flags =          aftermodeline->flags;
+       } else {
+           req->after_dotclock =       0;
+           req->after_hdisplay =       0;
+           req->after_hsyncstart =     0;
+           req->after_hsyncend =       0;
+           req->after_htotal =         0;
+           req->after_hskew =          0;
+           req->after_vdisplay =       0;
+           req->after_vsyncstart =     0;
+           req->after_vsyncend =       0;
+           req->after_vtotal =         0;
+           req->after_flags =          0;
+       }
+       if (newmodeline->privsize) {
+           req->length += newmodeline->privsize;
+           Data32(dpy, (long *) newmodeline->private,
+              newmodeline->privsize * sizeof(INT32));
+       }
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeDeleteModeLine(Display *dpy, int screen,
+                         XF86VidModeModeInfo* modeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeDeleteModeLineReq *req;
+    xXF86OldVidModeDeleteModeLineReq *oldreq;
+    int majorVersion, minorVersion;
+
+    XF86VidModeCheckExtension (dpy, info, 0);
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+    LockDisplay(dpy);
+    if (majorVersion < 2) {
+       GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
+       oldreq->reqType = info->codes->major_opcode;
+       oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+       oldreq->screen = screen;
+       oldreq->dotclock =      modeline->dotclock;
+       oldreq->hdisplay =      modeline->hdisplay;
+       oldreq->hsyncstart =    modeline->hsyncstart;
+       oldreq->hsyncend =      modeline->hsyncend;
+       oldreq->htotal =        modeline->htotal;
+       oldreq->vdisplay =      modeline->vdisplay;
+       oldreq->vsyncstart =    modeline->vsyncstart;
+       oldreq->vsyncend =      modeline->vsyncend;
+       oldreq->vtotal =        modeline->vtotal;
+       oldreq->flags =         modeline->flags;
+       oldreq->privsize =      modeline->privsize;
+       if (modeline->privsize) {
+           oldreq->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    } else {
+       GetReq(XF86VidModeDeleteModeLine, req);
+       req->reqType = info->codes->major_opcode;
+       req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+       req->screen = screen;
+       req->dotclock =         modeline->dotclock;
+       req->hdisplay =         modeline->hdisplay;
+       req->hsyncstart =       modeline->hsyncstart;
+       req->hsyncend =         modeline->hsyncend;
+       req->htotal =           modeline->htotal;
+       req->hskew =            modeline->hskew;
+       req->vdisplay =         modeline->vdisplay;
+       req->vsyncstart =       modeline->vsyncstart;
+       req->vsyncend =         modeline->vsyncend;
+       req->vtotal =           modeline->vtotal;
+       req->flags =            modeline->flags;
+       req->privsize =         modeline->privsize;
+       if (modeline->privsize) {
+           req->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine* modeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeModModeLineReq *req;
+    xXF86OldVidModeModModeLineReq *oldreq;
+    int majorVersion, minorVersion;
+
+    XF86VidModeCheckExtension (dpy, info, 0);
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+    LockDisplay(dpy);
+    if (majorVersion < 2) {
+       GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
+       oldreq->reqType = info->codes->major_opcode;
+       oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+       oldreq->screen = screen;
+       oldreq->hdisplay =      modeline->hdisplay;
+       oldreq->hsyncstart =    modeline->hsyncstart;
+       oldreq->hsyncend =      modeline->hsyncend;
+       oldreq->htotal =        modeline->htotal;
+       oldreq->vdisplay =      modeline->vdisplay;
+       oldreq->vsyncstart =    modeline->vsyncstart;
+       oldreq->vsyncend =      modeline->vsyncend;
+       oldreq->vtotal =        modeline->vtotal;
+       oldreq->flags =         modeline->flags;
+       oldreq->privsize =      modeline->privsize;
+       if (modeline->privsize) {
+           oldreq->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    } else {
+       GetReq(XF86VidModeModModeLine, req);
+       req->reqType = info->codes->major_opcode;
+       req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+       req->screen = screen;
+       req->hdisplay =         modeline->hdisplay;
+       req->hsyncstart =       modeline->hsyncstart;
+       req->hsyncend =         modeline->hsyncend;
+       req->htotal =           modeline->htotal;
+       req->hskew =            modeline->hskew;
+       req->vdisplay =         modeline->vdisplay;
+       req->vsyncstart =       modeline->vsyncstart;
+       req->vsyncend =         modeline->vsyncend;
+       req->vtotal =           modeline->vtotal;
+       req->flags =            modeline->flags;
+       req->privsize =         modeline->privsize;
+       if (modeline->privsize) {
+           req->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Status
+XF86VidModeValidateModeLine(Display *dpy, int screen,
+                           XF86VidModeModeInfo* modeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeValidateModeLineReq *req;
+    xXF86OldVidModeValidateModeLineReq *oldreq;
+    xXF86VidModeValidateModeLineReply rep;
+    int majorVersion, minorVersion;
+
+    XF86VidModeCheckExtension (dpy, info, 0);
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+    LockDisplay(dpy);
+
+    if (majorVersion < 2) {
+       GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
+       oldreq->reqType = info->codes->major_opcode;
+       oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+       oldreq->screen = screen;
+       oldreq->dotclock =      modeline->dotclock;
+       oldreq->hdisplay =      modeline->hdisplay;
+       oldreq->hsyncstart =    modeline->hsyncstart;
+       oldreq->hsyncend =      modeline->hsyncend;
+       oldreq->htotal =        modeline->htotal;
+       oldreq->vdisplay =      modeline->vdisplay;
+       oldreq->vsyncstart =    modeline->vsyncstart;
+       oldreq->vsyncend =      modeline->vsyncend;
+       oldreq->vtotal =        modeline->vtotal;
+       oldreq->flags =         modeline->flags;
+       oldreq->privsize =      modeline->privsize;
+       if (modeline->privsize) {
+           oldreq->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    } else {
+       GetReq(XF86VidModeValidateModeLine, req);
+       req->reqType = info->codes->major_opcode;
+       req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+       req->screen = screen;
+       req->dotclock =         modeline->dotclock;
+       req->hdisplay =         modeline->hdisplay;
+       req->hsyncstart =       modeline->hsyncstart;
+       req->hsyncend =         modeline->hsyncend;
+       req->htotal =           modeline->htotal;
+       req->hskew =            modeline->hskew;
+       req->vdisplay =         modeline->vdisplay;
+       req->vsyncstart =       modeline->vsyncstart;
+       req->vsyncend =         modeline->vsyncend;
+       req->vtotal =           modeline->vtotal;
+       req->flags =            modeline->flags;
+       req->privsize =         modeline->privsize;
+       if (modeline->privsize) {
+           req->length += modeline->privsize;
+           Data32(dpy, (long *) modeline->private,
+              modeline->privsize * sizeof(INT32));
+       }
+    }
+    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+       UnlockDisplay(dpy);
+       SyncHandle();
+       return MODE_BAD;
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return rep.status;
+}
+
+Bool
+XF86VidModeSwitchMode(Display* dpy, int screen, int zoom)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeSwitchModeReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeSwitchMode, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeSwitchMode;
+    req->screen = screen;
+    req->zoom = zoom;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+    
+Bool
+XF86VidModeSwitchToMode(Display* dpy, int screen, XF86VidModeModeInfo* modeline)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeSwitchToModeReq *req;
+    xXF86OldVidModeSwitchToModeReq *oldreq;
+    int majorVersion, minorVersion;
+    Bool protocolBug = False;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    /*
+     * Note: There was a bug in the protocol implementation in versions
+     * 0.x with x < 8 (the .private field wasn't expected to be sent over
+     * the wire).  Check the server's version, and accept the old format
+     * if appropriate.
+     */
+
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+    if (majorVersion == 0 && minorVersion < 8) {
+       protocolBug = True;
+#ifdef DEBUG
+       fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
+               "running an old version (%d.%d)\n", majorVersion,
+               minorVersion);
+#endif
+    }
+    
+    LockDisplay(dpy);
+    if (majorVersion < 2) {
+       GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq);
+       oldreq->reqType = info->codes->major_opcode;
+       oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+       oldreq->screen = screen;
+       oldreq->dotclock =      modeline->dotclock;
+       oldreq->hdisplay =      modeline->hdisplay;
+       oldreq->hsyncstart =    modeline->hsyncstart;
+       oldreq->hsyncend =      modeline->hsyncend;
+       oldreq->htotal =        modeline->htotal;
+       oldreq->vdisplay =      modeline->vdisplay;
+       oldreq->vsyncstart =    modeline->vsyncstart;
+       oldreq->vsyncend =      modeline->vsyncend;
+       oldreq->vtotal =        modeline->vtotal;
+       oldreq->flags = modeline->flags;
+       if (protocolBug) {
+           oldreq->privsize = 0;
+       } else {
+           oldreq->privsize =  modeline->privsize;
+           if (modeline->privsize) {
+               oldreq->length += modeline->privsize;
+               Data32(dpy, (long *) modeline->private,
+                  modeline->privsize * sizeof(INT32));
+           }
+       }
+    } else {
+       GetReq(XF86VidModeSwitchToMode, req);
+       req->reqType = info->codes->major_opcode;
+       req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+       req->screen = screen;
+       req->dotclock = modeline->dotclock;
+       req->hdisplay = modeline->hdisplay;
+       req->hsyncstart =       modeline->hsyncstart;
+       req->hsyncend = modeline->hsyncend;
+       req->htotal =   modeline->htotal;
+       req->hskew =    modeline->hskew;
+       req->vdisplay = modeline->vdisplay;
+       req->vsyncstart =       modeline->vsyncstart;
+       req->vsyncend = modeline->vsyncend;
+       req->vtotal =   modeline->vtotal;
+       req->flags =    modeline->flags;
+       if (protocolBug) {
+           req->privsize = 0;
+       } else {
+           req->privsize =     modeline->privsize;
+           if (modeline->privsize) {
+               req->length += modeline->privsize;
+               Data32(dpy, (long *) modeline->private,
+                  modeline->privsize * sizeof(INT32));
+           }
+       }
+    }
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+    
+Bool
+XF86VidModeLockModeSwitch(Display* dpy, int screen, int lock)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeLockModeSwitchReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeLockModeSwitch, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch;
+    req->screen = screen;
+    req->lock = lock;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+    
+Bool
+XF86VidModeGetMonitor(Display* dpy, int screen, XF86VidModeMonitor* monitor)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetMonitorReply rep;
+    xXF86VidModeGetMonitorReq *req;
+    CARD32 syncrange;
+    int i;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetMonitor, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
+    req->screen = screen;
+    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+       UnlockDisplay(dpy);
+       SyncHandle();
+       return False;
+    }
+    monitor->nhsync = rep.nhsync;
+    monitor->nvsync = rep.nvsync;
+#if 0
+    monitor->bandwidth = (float)rep.bandwidth / 1e6;
+#endif
+    if (rep.vendorLength) {
+       if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
+           _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+                     ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+           return False;
+       }
+    } else {
+       monitor->vendor = NULL;
+    }
+    if (rep.modelLength) {
+       if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
+           _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+                     ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+           if (monitor->vendor)
+               Xfree(monitor->vendor);
+           return False;
+       }
+    } else {
+       monitor->model = NULL;
+    }
+    if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(XF86VidModeSyncRange)))) {
+       _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+                 ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+       
+       if (monitor->vendor)
+           Xfree(monitor->vendor);
+       if (monitor->model)
+           Xfree(monitor->model);
+       return False;
+    }
+    if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(XF86VidModeSyncRange)))) {
+       _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+                 ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+       if (monitor->vendor)
+           Xfree(monitor->vendor);
+       if (monitor->model)
+           Xfree(monitor->model);
+       Xfree(monitor->hsync);
+       return False;
+    }
+    for (i = 0; i < rep.nhsync; i++) {
+       _XRead(dpy, (char *)&syncrange, 4);
+       monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+       monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0;
+    }
+    for (i = 0; i < rep.nvsync; i++) {
+       _XRead(dpy, (char *)&syncrange, 4);
+       monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+       monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0;
+    }
+    if (rep.vendorLength)
+       _XReadPad(dpy, monitor->vendor, rep.vendorLength);
+    if (rep.modelLength)
+       _XReadPad(dpy, monitor->model, rep.modelLength);
+       
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeGetViewPort(Display* dpy, int screen, int *x, int *y)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetViewPortReply rep;
+    xXF86VidModeGetViewPortReq *req;
+    int majorVersion, minorVersion;
+    Bool protocolBug = False;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    /*
+     * Note: There was a bug in the protocol implementation in versions
+     * 0.x with x < 8 (no reply was sent, so the client would hang)
+     * Check the server's version, and don't wait for a reply with older
+     * versions.
+     */
+
+    XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+    if (majorVersion == 0 && minorVersion < 8) {
+       protocolBug = True;
+#ifdef DEBUG
+       fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is"
+               "running an old version (%d.%d)\n", majorVersion,
+               minorVersion);
+#endif
+    }
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetViewPort, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetViewPort;
+    req->screen = screen;
+    if (protocolBug) {
+       *x = 0;
+       *y = 0;
+    } else {
+       if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+           UnlockDisplay(dpy);
+           SyncHandle();
+           return False;
+       }
+       *x = rep.x;
+       *y = rep.y;
+    }
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeSetViewPort(Display* dpy, int screen, int x, int y)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeSetViewPortReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeSetViewPort, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeSetViewPort;
+    req->screen = screen;
+    req->x = x;
+    req->y = y;
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeGetDotClocks(Display* dpy, int screen, int *flagsPtr,
+                       int *numclocksPtr, int *maxclocksPtr, int *clocksPtr[])
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetDotClocksReply rep;
+    xXF86VidModeGetDotClocksReq *req;
+    int i, *dotclocks;
+    CARD32 dotclk;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetDotClocks, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
+    req->screen = screen;
+    if (!_XReply(dpy, (xReply *)&rep, 
+        (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse))
+    {
+        UnlockDisplay(dpy);
+        SyncHandle();
+        return False;
+    }
+    *numclocksPtr = rep.clocks;
+    *maxclocksPtr = rep.maxclocks;
+    *flagsPtr     = rep.flags;
+
+    if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
+        _XEatData(dpy, (rep.clocks) * 4);
+        Xfree(dotclocks);
+        return False;
+    }
+
+    for (i = 0; i < rep.clocks; i++) {
+        _XRead(dpy, (char*)&dotclk, 4);
+       dotclocks[i] = dotclk;
+    }
+    *clocksPtr = dotclocks;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool
+XF86VidModeSetGammaRamp (
+    Display *dpy,
+    int screen,
+    int size,
+    unsigned short *red,
+    unsigned short *green,
+    unsigned short *blue
+)
+{
+    int length = (size + 1) & ~1;
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeSetGammaRampReq *req;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+    LockDisplay(dpy);
+    GetReq(XF86VidModeSetGammaRamp, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp;
+    req->screen = screen;
+    req->length += (length >> 1) * 3;
+    req->size = size;
+    _XSend(dpy, (char*)red, size * 2);
+    _XSend(dpy, (char*)green, size * 2);
+    _XSend(dpy, (char*)blue, size * 2);
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+
+Bool
+XF86VidModeGetGammaRamp (
+    Display *dpy,
+    int screen,
+    int size,
+    unsigned short *red,
+    unsigned short *green,
+    unsigned short *blue
+)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetGammaRampReq *req;
+    xXF86VidModeGetGammaRampReply rep;
+  
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetGammaRamp, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
+    req->screen = screen;
+    req->size = size;
+    if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+        UnlockDisplay (dpy);
+        SyncHandle ();
+        return False;
+    }
+    if(rep.size) {
+       _XRead(dpy, (char*)red, rep.size << 1);
+       _XRead(dpy, (char*)green, rep.size << 1);
+       _XRead(dpy, (char*)blue, rep.size << 1);
+    }
+
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool XF86VidModeGetGammaRampSize(
+    Display *dpy,
+    int screen,
+    int *size
+)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetGammaRampSizeReq *req;
+    xXF86VidModeGetGammaRampSizeReply rep;
+  
+    *size = 0;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetGammaRampSize, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
+    req->screen = screen;
+    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+        UnlockDisplay (dpy);
+        SyncHandle ();
+        return False; 
+    }
+    *size = rep.size;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
+Bool XF86VidModeGetPermissions(
+    Display *dpy,
+    int screen,
+    int *permissions
+)
+{
+    XExtDisplayInfo *info = find_display (dpy);
+    xXF86VidModeGetPermissionsReq *req;
+    xXF86VidModeGetPermissionsReply rep;
+  
+    *permissions = 0;
+
+    XF86VidModeCheckExtension (dpy, info, False);
+
+    LockDisplay(dpy);
+    GetReq(XF86VidModeGetPermissions, req);
+    req->reqType = info->codes->major_opcode;
+    req->xf86vidmodeReqType = X_XF86VidModeGetPermissions;
+    req->screen = screen;
+    if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+        UnlockDisplay (dpy);
+        SyncHandle ();
+        return False; 
+    }
+    *permissions = rep.permissions;
+    UnlockDisplay(dpy);
+    SyncHandle();
+    return True;
+}
+
diff --git a/xxf86vm.pc.in b/xxf86vm.pc.in
new file mode 100644 (file)
index 0000000..c53dec6
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Xxf86vm
+Description: XFree86 Video Mode Extension Library
+Version: @VERSION@
+Requires: xf86vidmodeproto
+Requires.private: x11 xext
+Cflags: -I${includedir}
+Libs: -L${libdir} -lXxf86vm