xserver: Branch 'master' - 15 commits

Daniel Stone daniels at kemper.freedesktop.org
Tue Jul 15 17:07:37 PDT 2008


 config/Makefile.am                        |    2 
 config/config-backends.h                  |    2 
 config/hal.c                              |   13 
 configure.ac                              |   40 
 dix/Makefile.am                           |    3 
 dix/strcasecmp.c                          |   74 -
 dix/strcasestr.c                          |   64 +
 hw/kdrive/src/kcolor.c                    |  881 ----------------
 hw/xfree86/common/Makefile.am             |   14 
 hw/xfree86/common/xf86.h                  |   22 
 hw/xfree86/common/xf86Debug.c             |   77 -
 hw/xfree86/common/xf86Init.c              |  416 +++-----
 hw/xfree86/common/xf86MiscExt.c           |   24 
 hw/xfree86/common/xf86Priv.h              |   10 
 hw/xfree86/common/xf86Versions.c          |   77 -
 hw/xfree86/common/xf86XKB.c               |   80 -
 hw/xfree86/common/xf86str.h               |   39 
 hw/xfree86/doc/devel/DebuggingHints       |  192 ---
 hw/xfree86/loader/xf86sym.c               |   14 
 hw/xfree86/os-support/Makefile.am         |    3 
 hw/xfree86/os-support/README.OS-lib       |  222 ----
 hw/xfree86/os-support/bsd/bsd_mouse.c     |  791 ---------------
 hw/xfree86/os-support/hurd/hurd_mouse.c   |  242 ----
 hw/xfree86/os-support/linux/Makefile.am   |    2 
 hw/xfree86/os-support/linux/lnx_mouse.c   |  221 ----
 hw/xfree86/os-support/lynxos/lynx_mouse.c |   33 
 hw/xfree86/os-support/sco/sco_mouse.c     |  258 ----
 hw/xfree86/os-support/solaris/sun_mouse.c |  717 -------------
 hw/xfree86/os-support/sysv/sysv_mouse.c   |   60 -
 hw/xfree86/os-support/usl/usl_mouse.c     |  177 ---
 hw/xfree86/os-support/xf86OSmouse.h       |  294 -----
 hw/xfree86/os-support/xf86_OSlib.h        |   12 
 include/dix-config.h.in                   |   15 
 include/dix.h                             |   12 
 include/os.h                              |    3 
 os/Makefile.am                            |    1 
 os/oscolor.c                              | 1556 +++++++++++++++++++++++++++++-
 os/oscolor.h                              | 1508 -----------------------------
 os/osinit.c                               |    3 
 39 files changed, 1866 insertions(+), 6308 deletions(-)

New commits:
commit b8dd07f855c555af56cbf0f69df799f424da2cca
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 03:00:25 2008 +0300

    HAL: Remove grotesque open-coded strcasestr
    
    Not only was this pretty ugly, but it didn't even work on systems
    without strcasestr anyway, due to the define not being in dix-config.h.
    Lack of strcasestr is handled transparently with the version from
    FreeBSD now anyway, so, huzzah.

diff --git a/config/hal.c b/config/hal.c
index f4eb438..b6d7402 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -262,17 +262,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                      * Since we can't predict the order in which the keys
                      * arrive, we need to store them.
                      */
-#ifndef HAVE_STRCASESTR
-                    int psi_key_len = strlen(psi_key);
-                    char *lower_psi_key = xalloc(psi_key_len + 1);
-
-                    CopyISOLatin1Lowered((unsigned char *) lower_psi_key,
-                                         (unsigned char *) psi_key,
-                                         psi_key_len);
-                    if ((tmp = strstr(lower_psi_key, "xkb")))
-#else
                     if ((tmp = strcasestr(psi_key, "xkb")))
-#endif
                     {
                         if (!strcasecmp(&tmp[3], "layout"))
                         {
@@ -301,9 +291,6 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                         add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
                         xfree(tmp_val);
                     }
-#ifndef HAVE_STRCASESTR
-                    xfree(lower_psi_key);
-#endif
                 }
             } else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
 
commit ad87c72edcc0d1f56658e0c4e73af335c8d5a516
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 02:59:51 2008 +0300

    DIX: Add strcasestr from FreeBSD
    
    Add strcasestr for use on systems which don't have it.

diff --git a/configure.ac b/configure.ac
index 18d8ab5..8f2a966 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1006,6 +1006,8 @@ AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
                                         [Do not have 'strcasecmp'.]))
 AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1,
                                         [Do not have 'strncasecmp'.]))
+AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1,
+                                       [Do not have 'strcasestr'.]))
 
 if test "x$NULL_ROOT_CURSOR" = xyes; then
         AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor])
diff --git a/dix/Makefile.am b/dix/Makefile.am
index c8718e4..45da45f 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -36,7 +36,8 @@ libdix_la_SOURCES = 	\
 	swapreq.c	\
 	tables.c	\
 	window.c	\
-	strcasecmp.c
+	strcasecmp.c	\
+	strcasestr.c
 
 EXTRA_DIST = buildatoms BuiltInAtoms CHANGES Xserver.d Xserver-dtrace.h.in
 
diff --git a/dix/strcasestr.c b/dix/strcasestr.c
new file mode 100644
index 0000000..b3d4549
--- /dev/null
+++ b/dix/strcasestr.c
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 1990, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <ctype.h>
+#include <string.h>
+#include "dix.h"
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+#ifdef NEED_STRCASESTR
+char *
+xstrcasestr(const char *s, const char *find)
+{
+        char c, sc;
+        size_t len;
+
+        if ((c = *find++) != 0) {
+                c = tolower((unsigned char)c);
+                len = strlen(find);
+                do {
+                        do {
+                                if ((sc = *s++) == 0)
+                                        return (NULL);
+                        } while ((char)tolower((unsigned char)sc) != c);
+                } while (strncasecmp(s, find, len) != 0);
+                s--;
+        }
+        return ((char *)s);
+}
+#endif
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index ed664a9..0654918 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -501,4 +501,7 @@
 /* Need the strncasecmp function. */
 #undef NEED_STRNCASECMP
 
+/* Need the strcasestr function. */
+#undef NEED_STRCASESTR
+
 #endif /* _DIX_CONFIG_H_ */
diff --git a/include/dix.h b/include/dix.h
index a8c2b3b..ac03ce0 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -609,6 +609,11 @@ extern int xstrcasecmp(const char *s1, const char *s2);
 extern int xstrncasecmp(const char *s1, const char *s2, size_t n);
 #endif
 
+#if NEED_STRCASESTR
+#define strcasestr xstrcasestr
+extern int xstrcasestr(const char *s, const char *find);
+#endif
+
 extern int XItoCoreType(int xi_type);
 extern Bool DevHasCursor(DeviceIntPtr pDev);
 extern Bool IsPointerDevice( DeviceIntPtr dev);
commit c3c901cf44cf16bb33c4176494361b429099a372
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 02:54:41 2008 +0300

    configure.ac: Fix SHA1 handling
    
    Fix and marginally simplify the SHA1 handling.  First, we allow people
    to override it.  Secondly, we try for libmd.  Then, we try for OpenSSL
    with pkg-config.  In a last, desperate move, we try libcrypto on its
    own.  This allows the server to, y'know, _link_ when using OpenSSL,
    instead of failing because we only have -lcrypto, and not -lssl.

diff --git a/configure.ac b/configure.ac
index 9daa13c..18d8ab5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1101,26 +1101,30 @@ MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
 MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
 CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
 
-PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
-PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
-
 # OpenSSL used for SHA1 hashing in render/glyph.c, but we don't need all of
 # the OpenSSL libraries, just libcrypto
 # Some systems have matching functionality in the smaller/simpler libmd
 # Builders who want to force a choice can set SHA1_LIB and SHA1_CFLAGS
 if test "x$SHA1_LIB" = "x" ; then
- AC_CHECK_LIB([md], [SHA1Init], [SHA1_LIB="-lmd"
-	AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
-	   [Define to use libmd SHA1 functions instead of OpenSSL libcrypto])])
+  AC_CHECK_LIB([md], [SHA1Init], [SHA1_LIB="-lmd"
+            AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
+            [Use libmd SHA1 functions instead of OpenSSL libcrypto])])
 fi
+
 if test "x$SHA1_LIB" = "x" ; then
- AC_CHECK_LIB([crypto], [SHA1_Init], [],
-  [PKG_CHECK_MODULES([OPENSSL], [openssl],
-   [OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])])
- SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto"
- SHA1_CFLAGS="$OPENSSL_CFLAGS"
+  PKG_CHECK_EXISTS([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
+                    [HAVE_OPENSSL_PKC=no])
+  if test "x$HAVE_OPENSSL_PKC" = xyes; then
+    REQUIRED_LIBS="$REQUIRED_LIBS openssl"
+  else
+    AC_CHECK_LIB([crypto], [SHA1_Init], [SHA1_LIB="-lcrypto"],
+                 [AC_MSG_ERROR([OpenSSL must be installed in order to build the X server.])])
+  fi
 fi
 
+PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
+PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
+
 # Autotools has some unfortunate issues with library handling.  In order to
 # get a server to rebuild when a dependency in the tree is changed, it must
 # be listed in SERVERNAME_DEPENDENCIES.  However, no system libraries may be
commit 69b57dc651e12a0d9a5a4295b185c62d5c0df63f
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 02:03:36 2008 +0300

    dix: Actually build str(n)casecmp if we don't have it
    
    Remember to add stuff to dix-config.h when you add new AC_DEFINES,
    people ...

diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index e853aa9..ed664a9 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -202,9 +202,6 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
-/* Define to 1 if you have the `strcasestr' function. */
-#undef HAVE_STRCASESTR
-
 /* Define to 1 if you have the `strchr' function. */
 #undef HAVE_STRCHR
 
@@ -498,4 +495,10 @@
 /* Define to 64-bit byteswap macro */
 #undef bswap_64
 
+/* Need the strcasecmp function. */
+#undef NEED_STRCASECMP
+
+/* Need the strncasecmp function. */
+#undef NEED_STRNCASECMP
+
 #endif /* _DIX_CONFIG_H_ */
commit dcf6293030126509d7d6c61d131222037d5ed7db
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 01:57:00 2008 +0300

    strcasecmp: Actually use the right license
    
    Forgot to update the license when I committed the FreeBSD version, so it
    still had an old SGI license.  Sorry.  Sorry.

diff --git a/dix/strcasecmp.c b/dix/strcasecmp.c
index 8f7c5c4..ca1051d 100644
--- a/dix/strcasecmp.c
+++ b/dix/strcasecmp.c
@@ -1,28 +1,31 @@
-/************************************************************
- Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc.
-
- Permission to use, copy, modify, and distribute this
- software and its documentation for any purpose and without
- fee is hereby granted, provided that the above copyright
- notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
- of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
- of this software for any purpose. It is provided "as is"
- without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ********************************************************/
+/*
+ * Copyright (c) 1987, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
commit 441f084bfe87a6ea1c94ec63f82888b8b3d81d89
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 2 19:52:58 2008 +0300

    config: Don't attempt to use D-Bus when not strictly necessary
    
    If we have D-Bus but have explicitly disabled it, don't build it.

diff --git a/config/Makefile.am b/config/Makefile.am
index 056f30e..1e7c501 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -3,7 +3,7 @@ AM_CFLAGS = @DIX_CFLAGS@
 noinst_LIBRARIES = libconfig.a
 libconfig_a_SOURCES = config.c config-backends.h
 
-if HAVE_DBUS
+if CONFIG_NEED_DBUS
 AM_CFLAGS += @DBUS_CFLAGS@
 libconfig_a_SOURCES += dbus-core.c
 endif
diff --git a/config/config-backends.h b/config/config-backends.h
index ce0e5e4..907e86b 100644
--- a/config/config-backends.h
+++ b/config/config-backends.h
@@ -27,7 +27,7 @@
 #include <dix-config.h>
 #endif
 
-#ifdef HAVE_DBUS
+#ifdef CONFIG_NEED_DBUS
 #include <dbus/dbus.h>
 
 typedef void (*config_dbus_core_connect_hook)(DBusConnection *connection,
diff --git a/configure.ac b/configure.ac
index 7852a4d..9daa13c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -706,7 +706,7 @@ if test "x$CONFIG_DBUS_API" = xyes; then
 	fi
 
 	AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
-	NEED_DBUS="yes"
+	CONFIG_NEED_DBUS="yes"
 fi
 AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
 
@@ -721,13 +721,15 @@ if test "x$CONFIG_HAL" = xyes; then
 
 	AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
         REQUIRED_LIBS="$REQUIRED_LIBS hal"
-	NEED_DBUS="yes"
+	CONFIG_NEED_DBUS="yes"
 fi
 AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
 
-if test "x$NEED_DBUS" = xyes; then
+if test "x$CONFIG_NEED_DBUS" = xyes; then
 	REQUIRED_LIBS="$REQUIRED_LIBS dbus-1"
+        AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug])
 fi
+AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
 CONFIG_LIB='$(top_builddir)/config/libconfig.a'
 
 AC_MSG_CHECKING([for glibc...])
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index b088ef8..e853aa9 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -468,6 +468,9 @@
 /* Support D-Bus */
 #undef HAVE_DBUS
 
+/* Use D-Bus for input hotplug */
+#undef CONFIG_NEED_DBUS
+
 /* Support the D-Bus hotplug API */
 #undef CONFIG_DBUS_API
 
commit 35c89f3f5b8fa222e37b799d5bb01595e8f30d0c
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jul 16 01:43:58 2008 +0300

    XFree86: Remove mysticism from Makefile.am
    
    The variables were always the same, so just shove them in with the rest
    of the plebs.

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 59e985b..faa6b37 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -31,9 +31,9 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86Globals.c xf86AutoConfig.c \
                       xf86MiscExt.c xf86Option.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
-                      xf86Helper.c xf86PM.c xf86RAC.c \
+                      xf86Helper.c xf86PM.c xf86RAC.c xf86Xinput.c xisb.c \
                       xf86Mode.c xf86Build.h xorgHelper.c \
-                      $(XVSOURCES) $(BUSSOURCES) $(XISOURCES) $(RANDRSOURCES)
+                      $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
 nodist_libcommon_la_SOURCES = xf86DefModeSet.c
 libinit_a_SOURCES = xf86Build.h xf86Init.c
 
@@ -44,7 +44,7 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
 
 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
               xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \
-              xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h $(XISDKINCS) \
+              xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h xf86Xinput.h xisb.h \
               $(XVSDKINCS) atKeynames.h xf86Version.h xorgVersion.h \
               xf86sbusBus.h xf86xv.h xf86xvmc.h xf86xvpriv.h
 
commit b89a59248a4a0ff06b9a0ddee45881efc6063063
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Jun 27 12:20:56 2008 +0300

    XFree86: Delete OSMouse code
    
    This should be moved into the mouse driver, if anything.

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index e2e62cd..59e985b 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -32,7 +32,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86MiscExt.c xf86Option.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
                       xf86Helper.c xf86PM.c xf86RAC.c \
-                      xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c \
+                      xf86Mode.c xf86Build.h xorgHelper.c \
                       $(XVSOURCES) $(BUSSOURCES) $(XISOURCES) $(RANDRSOURCES)
 nodist_libcommon_la_SOURCES = xf86DefModeSet.c
 libinit_a_SOURCES = xf86Build.h xf86Init.c
@@ -44,7 +44,7 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
 
 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
               xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86Resources.h \
-              xf86cmap.h xf86fbman.h xf86str.h $(XISDKINCS) xf86RAC.h \
+              xf86cmap.h xf86fbman.h xf86str.h xf86RAC.h $(XISDKINCS) \
               $(XVSDKINCS) atKeynames.h xf86Version.h xorgVersion.h \
               xf86sbusBus.h xf86xv.h xf86xvmc.h xf86xvpriv.h
 
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 5d4ea9a..166f801 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -401,12 +401,6 @@ Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
 
 Bool VidModeExtensionInit(ScreenPtr pScreen);
 
-/* xf86Versions.c */
-CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
-Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
-					 CARD32 version, int flags);
-
-
 #endif /* _NO_XF86_PROTOTYPES */
 
 #endif /* _XF86_H */
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
index 8817b79..9c81a6f 100644
--- a/hw/xfree86/common/xf86MiscExt.c
+++ b/hw/xfree86/common/xf86MiscExt.c
@@ -52,8 +52,6 @@
 #include <X11/extensions/XIproto.h>
 #include "xf86Xinput.h"
 
-#include "xf86OSmouse.h"
-
 #ifdef DEBUG
 # define DEBUG_P(x) ErrorF(x"\n");
 #else
@@ -404,17 +402,8 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
 	    = LoaderSymbol("xf86MouseProtocolIDToName");
 	if (!xf86MouseProtocolIDToName)
 	    return MISC_RET_NOMODULE;
-	if (mse->type < MTYPE_MICROSOFT
-		|| (mse->type > MTYPE_EXPPS2
-		    && (mse->type != MTYPE_OSMOUSE)))
-	    return MISC_RET_BADMSEPROTO;
-#ifdef OSMOUSE_ONLY
-	if (mse->type != MTYPE_OSMOUSE)
-	    return MISC_RET_BADMSEPROTO;
-#else
-	if (mse->type == MTYPE_OSMOUSE)
+	if (mse->type < MTYPE_MICROSOFT || mse->type > MTYPE_EXPPS2)
 	    return MISC_RET_BADMSEPROTO;
-#endif /* OSMOUSE_ONLY */
 
 	if (mse->em3timeout < 0)
 	    return MISC_RET_BADVAL;
@@ -431,8 +420,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
 	    reopen = TRUE;
 	    mse->flags &= ~MF_REOPEN;
 	}
-	if (mse->type != MTYPE_OSMOUSE
-		&& mse->type != MTYPE_PS_2
+	if (mse->type != MTYPE_PS_2
 		&& mse->type != MTYPE_BUSMOUSE
 		&& mse->type != MTYPE_IMPS2
 		&& mse->type != MTYPE_THINKINGPS2
@@ -451,12 +439,8 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
 		&& (mse->type != MTYPE_MOUSESYS))
 	    return MISC_RET_BADFLAGS;
 
-	if (mse->type != MTYPE_OSMOUSE
-		&& mse->type != MTYPE_BUSMOUSE)
-	{
-	    if (mse->samplerate < 0)
-		return MISC_RET_BADVAL;
-	}
+	if (mse->type != MTYPE_BUSMOUSE && mse->samplerate < 0)
+	    return MISC_RET_BADVAL;
 
 	if (mse->resolution < 0)
 	    return MISC_RET_BADVAL;
diff --git a/hw/xfree86/common/xf86Versions.c b/hw/xfree86/common/xf86Versions.c
deleted file mode 100644
index 97a3559..0000000
--- a/hw/xfree86/common/xf86Versions.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86.h"
-#include "xf86OSmouse.h"
-
-static CARD32 registeredVersions[NUM_BUILTIN_IFS];
-
-_X_EXPORT CARD32
-xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flags)
-{
-    if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
-	xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: Unexpected interface"
-		"query: %d\n", iface);
-	return 0;
-    }
-
-    if (registeredVersions[iface])
-	return registeredVersions[iface];
-
-    /* Most built-in interfaces are handled this way. */
-    switch (iface) {
-    case BUILTIN_IF_OSMOUSE:
-	return OS_MOUSE_VERSION_CURRENT;
-    default:
-	xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: internal error: "
-		"interface %d not handled\n", iface);
-	return 0;
-    }
-}
-
-_X_EXPORT Bool
-xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, CARD32 version,
-				    int flags)
-{
-    if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
-	xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
-		"unexpected interface number: %d\n", iface);
-	return FALSE;
-    }
-    if (version == 0) {
-	xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
-		"versions must be greater than zero\n");
-	return FALSE;
-    }
-    registeredVersions[iface] = version;
-    return TRUE;
-}
-
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 8cd7c54..5e4171a 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -1103,13 +1103,6 @@ typedef void (*InputHandlerProc)(int fd, pointer data);
 #define OVERLAY_8_16_DUALFB	0x00000004
 #define OVERLAY_8_32_PLANAR	0x00000008
 
-#if 0
-#define LD_RESOLV_IFDONE		0	/* only check if no more
-						   delays pending */
-#define LD_RESOLV_NOW			1	/* finish one delay step */
-#define LD_RESOLV_FORCE			2	/* force checking... */
-#endif
-
 /* Values of xf86Info.mouseFlags */
 #define MF_CLEAR_DTR       1
 #define MF_CLEAR_RTS       2
@@ -1127,28 +1120,4 @@ typedef enum {
     ACTION_MESSAGE		= 9999  /* Generic message passing */
 } ActionEvent;
 
-/* xf86Versions.c */
-/*
- * Never change existing values, and always assign values explicitly.
- * NUM_BUILTIN_IFS must always be the last entry.
- */
-typedef enum {
-    BUILTIN_IF_OSMOUSE = 0,
-    BUILTIN_IF_OSKBD = 1,
-    NUM_BUILTIN_IFS
-} BuiltinInterface;
-
-/*
- * These are intentionally the same as the module version macros.
- * It is possible to register a module as providing a specific interface,
- * in which case the module's version is used.  This feature isn't
- * really ready for use yet though.
- */
-
-#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
-	((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
-#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers)	(((vers) >> 24) & 0xFF)
-#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers)	(((vers) >> 16) & 0xFF)
-#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers)	((vers) & 0xFFFF)
-
 #endif /* _XF86STR_H */
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 3085996..e537306 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -65,7 +65,6 @@
 #include "xf86Parser.h"
 #include "xf86Config.h"
 # include "xf86Xinput.h"
-#include "xf86OSmouse.h"
 #ifdef XV
 #include "xf86xv.h"
 #include "xf86xvmc.h"
@@ -278,7 +277,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86SerialModemSetBits)
     SYMFUNC(xf86SerialModemClearBits)
     SYMFUNC(xf86LoadKernelModule)
-    SYMFUNC(xf86OSMouseInit)
     SYMFUNC(xf86AgpGARTSupported)
     SYMFUNC(xf86GetAGPInfo)
     SYMFUNC(xf86AcquireGART)
@@ -644,10 +642,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(VidModeGetGammaRampSize)
 #endif
 
-    /* xf86Versions.c */
-    SYMFUNC(xf86GetBuiltinInterfaceVersion)
-    SYMFUNC(xf86RegisterBuiltinInterfaceVersion)
-
     /* xf86MiscExt.c */
 #ifdef XF86MISC
     SYMFUNC(MiscExtGetMouseSettings)
diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am
index f9a82c6..515523e 100644
--- a/hw/xfree86/os-support/Makefile.am
+++ b/hw/xfree86/os-support/Makefile.am
@@ -1,8 +1,7 @@
 SUBDIRS = bus @XORG_OS_SUBDIR@ misc $(DRI_SUBDIRS)
 DIST_SUBDIRS = bsd bus misc linux lynxos solaris sysv sco usl hurd
 
-sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h \
-              assyntax.h xf86OSmouse.h
+sdk_HEADERS = xf86_OSproc.h xf86_OSlib.h assyntax.h
 
 EXTRA_DIST = int10Defines.h xf86OSpriv.h README.OS-lib
 
diff --git a/hw/xfree86/os-support/README.OS-lib b/hw/xfree86/os-support/README.OS-lib
deleted file mode 100644
index 308d762..0000000
--- a/hw/xfree86/os-support/README.OS-lib
+++ /dev/null
@@ -1,222 +0,0 @@
-
-			README for XFree86 OS-support Layer
-			-----------------------------------
-
-Contents
---------
-    1) Overview
-    2) Directory Layout
-    3) Adding a new OS
-    4) OS Support API
-
-1 - Overview
-------------
-  This directory contains the OS support layer functions for the XFree86
-servers.  In addition, some miscellaneous server support functions (not
-OS-dependent) are included here, to take advantage of the fact that this
-library comes last in the linking order.
-
-Most of the functionality required to support a new OS is encapsulated in
-this library.  It is hoped that all OS-specific details can be encapsulated,
-but that is not likely ever to be completely possible.  Hence some minor
-changes will wind up being made in other parts of the server.  The major
-design principles for this library are maintainability, readability, and
-portability.  Sometimes these goals conflict; some somewhat arbitrary choices
-have been made in implementation.
-
-2 - Directory Layout
---------------------
-	os-support/	Contains headers and documentation; no code
-		misc/	Non-OS-specific miscellaneous functions that
-			fit best into the link architecture this way.
-		shared/	Contains files with functions used by more than one
-			OS.  These are symlinked into the OS subdirectories
-			at build time via Imakefile rules.  This is alway
-			preferable to reproducing functions in more than one
-			OS library.
-		bsd/	OS support for the NetBSD/FreeBSD/OpenBSD operating 
-			systems.
-		linux/	OS support for the Linux operating system.
-		sco/	OS support for the SCO SVR3.x operating system.
-		solaris/ OS support for the Solaris operating system.
-		sysv/	OS support for all SVR4.0 and SVR4.2, and for
-			ISC and AT&T SVR3.2 operating systems.
-
-3 - Adding A New OS
--------------------
-  Adding a support for a new operating system entails implementing all of
-the functions described in the API below.  Many of these functions are no-ops
-for many operating systems, and appropriate files with dummy declarations are
-available in the 'shared' subdirectory.
-
-If your OS is sufficiently similar to an existing OS, you can make use of
-the existing subdirectory.  One of the reasons for implementing this OS
-library was the unmaintainability of the spagetti-#ifdef code that existed
-before.  You should try to avoid cluttering the code with #ifdef's.  If
-you find that the subdirectory is getting cluttered, split off into a
-seperate subdirectory (e.g. as was done for SCO, rather than cluttering
-the 'sysv' subdirectory).  You can split functions out of an existing
-subdirectory into the 'shared' subdirectory, if that is appropriate.  Just
-remember to update the Imakefile for the old subdirectory.
-
-You will still likely have to make some small changes to other parts of
-the server.  You should not put OS-specific #define's or #include's anywhere
-else in the server.  These should all go in the "xf86_OSlib.h" header file
-in this directory.
-
-4 - OS Support API
------------------
-void xf86OpenConsole(void)
-{
-	/*
-	 * Open console device, activate VTs, etc, etc.  Fill in requisite
-	 * pieces of xf86Info.  Most of this code comes from xf86Init.c
-	 */
-}
-
-void xf86CloseConsole(void)
-{
-	/*
-	 * Close console at server exit.
-	 */
-}
-
-Bool xf86VTSwitchPending(void)
-{
-	 /*
-	  * Returns TRUE iff there is a VT switch operation pending for
-	  * the server.  In the USL VT model, this is indicated via a
-	  * signal handler.  Should return FALSE always for OSs without
-	  * VTs.
-	  */
-}
-
-Bool xf86VTSwitchAway(void)
-{
-	/*
-	 * Handles the OS-specific action for switching away from the active
-	 * VT.  Returns FALSE if the switch away fails.  Should return
-	 * FALSE always for OSs without VTs (then again, this function
-	 * should never be called in that case).
-	 */
-}
-
-Bool xf86VTSwitchTo(void)
-{
-	/*
-	 * Handles the OS-specific action for switching to the active VT.
-	 * Returns FALSE if the switch to fails.  Should return TRUE
-	 * always for OSs without VTs (then again, this function should
-	 * never be called in that case).
-	 */
-}
-
-Bool xf86LinearVidMem(void)
-{
-	/*
-	 * Returns TRUE if the OS supports mapping linear frame buffers
-	 * (ie memory at addresses above physical memory).
-	 */
-}
-
-pointer xf86MapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	/*
-	 * Handle mapping the video memory.  Returns (pointer *)0 for
-	 * failure; causes server exit.  It is allowable to call FatalError()
-	 * from inside this function and exit directly.
-	 */
-}
-
-void xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
-	/*
-	 * Handle unmapping the video memory.  This should undo what
-	 * xf86MapVidMem() does.  Base is a pointer obtained from
-	 * a previous call to xf86MapVidMem().
-	 */
-}
-
-void xf86MapDisplay(int ScreenNum, int Region)
-{
-	/*
-	 * For OSs that require the screen be mapped when entering a VT.
-	 * A dummy function will be defined for OSs that don't require
-	 * this (or don't have VTs at all).
-	 */
-}
-
-void xf86UnMapDisplay(int ScreenNum, int Region)
-{
-	/*
-	 * For Os that require that the screen be unmapped when leaving a
-	 * VT.  A dummy function will be defined for OSs that don't require
-	 * this (or don't have VTs at all).
-	 */
-}
-
-int xf86ReadBIOS(unsigned long Base, unsigned long Offset, 
-		  unsigned char *Buf, int Len)
-{
-	/*
-	 * Read Len bytes from the BIOS at address Base, offset Offset,
-	 * into buffer Buf.  Returns -1 for failure or if the OS does 
-	 * not support reading the BIOS.  This causes a driver probe 
-	 * to fail, but does not cause the server to abort.
-	 */
-}
-
-
-void xf86EnableIOPorts(int ScreenNum)
-{
-        /*
-	 * Enables I/O permissions.  The OS layer should 
-	 * enable all I/O port access.
-	 */
-}
-
-void xf86DisableIOPorts(int ScreenNum)
-{
-        /*
-	 * Disables I/O permissions. 
-	 */
-}
-
-Bool xf86DisableInterrupts(void)
-{
-	/*
-	 * Disable interrupts if allowed for this OS.  Returns FALSE if
-	 * this is not allowed or if the attempt fails for some reason.
-	 */
-}
-
-void xf86EnableInterrupts(void)
-{
-	/*
-	 * Reenable interrupts
-	 */
-}
-
-int xf86ProcessArgument(int argc, char *argv[], int i)
-{
-	/*
-	 * Process OS-specific command-line arguments.  See 
-	 * ddxProcessArgument() for more info.
-	 */
-}
-
-void xf86UseMsg(void)
-{
-	/*
-	 * Print list of OS-specific command-line arguments.  See 
-	 * ddxUseMsg() for more info.
-	 */
-}
-
-$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $
-
-
-
-
-
-$XConsortium: README.OS-lib /main/5 1996/02/21 17:50:28 kaleb $
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
deleted file mode 100644
index ca2c1bb..0000000
--- a/hw/xfree86/os-support/bsd/bsd_mouse.c
+++ /dev/null
@@ -1,791 +0,0 @@
-
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xisb.h"
-#include "mipointer.h"
-#ifdef WSCONS_SUPPORT
-#include <dev/wscons/wsconsio.h>
-#endif
-#ifdef USBMOUSE_SUPPORT
-#ifdef HAS_LIB_USB_HID
-#include <usbhid.h>
-#else
-#include "usb.h"
-#endif
-
-#include <dev/usb/usb.h>
-#ifdef USB_GET_REPORT_ID
-#define USB_NEW_HID
-#endif
-
-#define HUP_GENERIC_DESKTOP     0x0001
-#define HUP_BUTTON              0x0009
-
-#define HUG_X                   0x0030
-#define HUG_Y                   0x0031
-#define HUG_Z                   0x0032
-#define HUG_WHEEL               0x0038
-
-#define HID_USAGE2(p,u) (((p) << 16) | u)
-
-/* The UMS mices have middle button as number 3 */
-#define UMS_BUT(i) ((i) == 0 ? 2 : (i) == 1 ? 0 : (i) == 2 ? 1 : (i))
-#endif /* USBMOUSE_SUPPORT */
-
-#ifdef USBMOUSE_SUPPORT
-static void usbSigioReadInput (int fd, void *closure);
-#endif
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-/* These are for FreeBSD and DragonFly */
-#define DEFAULT_MOUSE_DEV		"/dev/mouse"
-#define DEFAULT_SYSMOUSE_DEV		"/dev/sysmouse"
-#define DEFAULT_PS2_DEV			"/dev/psm0"
-
-static const char *mouseDevs[] = {
-	DEFAULT_MOUSE_DEV,
-	DEFAULT_SYSMOUSE_DEV,
-	DEFAULT_PS2_DEV,
-	NULL
-};
-#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-/* Only wsmouse mices are autoconfigured for now on OpenBSD */
-#define DEFAULT_WSMOUSE_DEV		"/dev/wsmouse"
-#define DEFAULT_WSMOUSE0_DEV		"/dev/wsmouse0"
-
-static const char *mouseDevs[] = {
-	DEFAULT_WSMOUSE_DEV,
-	DEFAULT_WSMOUSE0_DEV,
-	NULL
-};
-#endif
-
-static int
-SupportedInterfaces(void)
-{
-#if defined(__NetBSD__)
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
-#else
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
-#endif
-}
-
-/* Names of protocols that are handled internally here. */
-static const char *internalNames[] = {
-#if defined(WSCONS_SUPPORT)
-	"WSMouse",
-#endif
-#if defined(USBMOUSE_SUPPORT)
-	"usb",
-#endif
-	NULL
-};
-
-/*
- * Names of MSC_MISC protocols that the OS supports.  These are decoded by
- * main "mouse" driver.
- */
-static const char *miscNames[] = {
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-	"SysMouse",
-#endif
-	NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
-    return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
-    int i;
-
-    for (i = 0; internalNames[i]; i++)
-	if (xf86NameCmp(protocol, internalNames[i]) == 0)
-	    return TRUE;
-    for (i = 0; miscNames[i]; i++)
-	if (xf86NameCmp(protocol, miscNames[i]) == 0)
-	    return TRUE;
-    return FALSE;
-}
-
-static const char *
-DefaultProtocol(void)
-{
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-    return "Auto";
-#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-    return "WSMouse";
-#else
-    return NULL;
-#endif
-}
-
-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
-static struct {
-	int dproto;
-	const char *name;
-} devproto[] = {
-	{ MOUSE_PROTO_MS,		"Microsoft" },
-	{ MOUSE_PROTO_MSC,		"MouseSystems" },
-	{ MOUSE_PROTO_LOGI,		"Logitech" },
-	{ MOUSE_PROTO_MM,		"MMSeries" },
-	{ MOUSE_PROTO_LOGIMOUSEMAN,	"MouseMan" },
-	{ MOUSE_PROTO_BUS,		"BusMouse" },
-	{ MOUSE_PROTO_INPORT,		"BusMouse" },
-	{ MOUSE_PROTO_PS2,		"PS/2" },
-	{ MOUSE_PROTO_HITTAB,		"MMHitTab" },
-	{ MOUSE_PROTO_GLIDEPOINT,	"GlidePoint" },
-	{ MOUSE_PROTO_INTELLI,		"Intellimouse" },
-	{ MOUSE_PROTO_THINK,		"ThinkingMouse" },
-	{ MOUSE_PROTO_SYSMOUSE,		"SysMouse" }
-};
-	
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
-    int i;
-    mousehw_t hw;
-    mousemode_t mode;
-
-    if (pInfo->fd == -1)
-	return NULL;
-
-    /* set the driver operation level, if applicable */
-    i = 1;
-    ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
-    
-    /* interrogate the driver and get some intelligence on the device. */
-    hw.iftype = MOUSE_IF_UNKNOWN;
-    hw.model = MOUSE_MODEL_GENERIC;
-    ioctl(pInfo->fd, MOUSE_GETHWINFO, &hw);
-    xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: hw.iftype is %d, hw.model is %d\n",
-		pInfo->name, hw.iftype, hw.model);
-    if (ioctl(pInfo->fd, MOUSE_GETMODE, &mode) == 0) {
-	for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); ++i) {
-	    if (mode.protocol == devproto[i].dproto) {
-		/* override some parameters */
-		if (protoPara) {
-		    protoPara[4] = mode.packetsize;
-		    protoPara[0] = mode.syncmask[0];
-		    protoPara[1] = mode.syncmask[1];
-		}
-		xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
-			    pInfo->name, devproto[i].name);
-		return devproto[i].name;
-	    }
-	}
-    }
-    return NULL;
-}
-
-static void
-SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
-{
-    mousemode_t mode;
-    MouseDevPtr pMse;
-
-    pMse = pInfo->private;
-
-    mode.rate = rate > 0 ? rate : -1;
-    mode.resolution = res > 0 ? res : -1;
-    mode.accelfactor = -1;
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-    if (pMse->autoProbe ||
-	(protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
-	/*
-	 * As the FreeBSD sysmouse driver defaults to protocol level 0
-	 * everytime it is opened we enforce protocol level 1 again at
-	 * this point.
-	 */
-	mode.level = 1;
-    } else
-	mode.level = -1;
-#else
-    mode.level = -1;
-#endif
-    ioctl(pInfo->fd, MOUSE_SETMODE, &mode);
-}
-#endif
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-
-#define MOUSED_PID_FILE "/var/run/moused.pid"
-
-/*
- * Try to check if moused is running.  DEFAULT_SYSMOUSE_DEV is useless without
- * it.  There doesn't seem to be a better way of checking.
- */
-static Bool
-MousedRunning(void)
-{
-    FILE *f = NULL;
-    unsigned int pid;
-
-    if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
-	if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
-	    if (kill(pid, 0) == 0) {
-		fclose(f);
-		return TRUE;
-	    }
-	}
-	fclose(f);
-    }
-    return FALSE;
-}
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    int fd = -1;
-    const char **pdev, *dev = NULL;
-    Bool devMouse = FALSE;
-    struct stat devMouseStat;
-    struct stat sb;
-
-    for (pdev = mouseDevs; *pdev; pdev++) {
-	SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
-	if (fd == -1) {
-#ifdef DEBUG
-	    ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
-#endif
-	} else {
-	    /*
-	     * /dev/mouse is held until checks for matches with other devices
-	     * are done.  This is so that when it points to /dev/sysmouse,
-	     * the test for whether /dev/sysmouse is usable can be made.
-	     */
-	    if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
-		if (fstat(fd, &devMouseStat) == 0)
-		    devMouse = TRUE;
-		close(fd);
-		continue;
-	    } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
-		/* Check if /dev/mouse is the same as /dev/sysmouse. */
-		if (devMouse && fstat(fd, &sb) == 0 && 
-		    devMouseStat.st_dev == sb.st_dev &&
-		    devMouseStat.st_ino == sb.st_ino) {
-		    /* If the same, use /dev/sysmouse. */
-		    devMouse = FALSE;
-		}
-		close(fd);
-		if (MousedRunning())
-		    break;
-		else {
-#ifdef DEBUG
-	    	    ErrorF("moused isn't running\n");
-#endif
-		}
-	    } else {
-		close(fd);
-		break;
-	    }
-	}
-    }
-
-    if (*pdev)
-	dev = *pdev;
-    else if (devMouse)
-	dev = DEFAULT_MOUSE_DEV;
-
-    if (dev) {
-	/* Set the Device option. */
-	pInfo->conf_idev->commonOptions =
-	    xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", dev);
-	xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
-		pInfo->name, dev);
-    }
-
-    return *pdev;
-}
-#endif
-
-#if (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-
-/* Only support wsmouse configuration for now */
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
-
-    xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
-		pInfo->name, "wsmouse");
-    return "wsmouse";
-}
-
-static void
-SetMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
-{
-
-    xf86MsgVerb(X_INFO, 3, "%s: SetMouseRes: protocol %s rate %d res %d\n",
-	    pInfo->name, protocol, rate, res);
-}
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    int fd = -1;
-    const char **pdev;
-
-    for (pdev = mouseDevs; *pdev; pdev++) {
-	SYSCALL(fd = open(*pdev, O_RDWR | O_NONBLOCK));
-	if (fd != -1) {
-	    /* Set the Device option. */
-	    pInfo->conf_idev->commonOptions =
-		xf86AddNewOption(pInfo->conf_idev->commonOptions, 
-				 "Device", *pdev);
-	    xf86Msg(X_INFO, "%s: found Device \"%s\"\n",
-		    pInfo->name, *pdev);
-	    close(fd);
-	    break;
-	}
-    }
-    return *pdev;
-}
-#endif /* __OpenBSD__ || __NetBSD__ && WSCONS_SUPPORT */
-
-#ifdef WSCONS_SUPPORT
-#define NUMEVENTS 64
-
-static void
-wsconsReadInput(InputInfoPtr pInfo)
-{
-    MouseDevPtr pMse;
-    static struct wscons_event eventList[NUMEVENTS];
-    int n, c; 
-    struct wscons_event *event = eventList;
-    unsigned char *pBuf;
-
-    pMse = pInfo->private;
-
-    XisbBlockDuration(pMse->buffer, -1);
-    pBuf = (unsigned char *)eventList;
-    n = 0;
-    while (n < sizeof(eventList) && (c = XisbRead(pMse->buffer)) >= 0) {
-	pBuf[n++] = (unsigned char)c;
-    }
-
-    if (n == 0)
-	return;
-
-    n /= sizeof(struct wscons_event);
-    while( n-- ) {
-	int buttons = pMse->lastButtons;
-	int dx = 0, dy = 0, dz = 0, dw = 0;
-	switch (event->type) {
-	case WSCONS_EVENT_MOUSE_UP:
-#define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value))
-	    buttons &= ~BUTBIT;
-	    break;
-	case WSCONS_EVENT_MOUSE_DOWN:
-	    buttons |= BUTBIT;
-	    break;
-	case WSCONS_EVENT_MOUSE_DELTA_X:
-	    dx = event->value;
-	    break;
-	case WSCONS_EVENT_MOUSE_DELTA_Y:
-	    dy = -event->value;
-	    break;
-#ifdef WSCONS_EVENT_MOUSE_DELTA_Z
-	case WSCONS_EVENT_MOUSE_DELTA_Z:
-	    dz = event->value;
-	    break;
-#endif
-	default:
-	    xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
-		    event->type);
-	    ++event;
-	    continue;
-	}
-
-	pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
-	++event;
-    }
-    return;
-}
-
-
-/* This function is called when the protocol is "wsmouse". */
-static Bool
-wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    MouseDevPtr pMse = pInfo->private;
-
-    pMse->protocol = protocol;
-    xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-    /* Collect the options, and process the common options. */
-    xf86CollectInputOptions(pInfo, NULL, NULL);
-    xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-    /* Check if the device can be opened. */
-    pInfo->fd = xf86OpenSerial(pInfo->options);
-    if (pInfo->fd == -1) {
-	if (xf86GetAllowMouseOpenFail())
-	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-	else {
-	    xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
-	    xfree(pMse);
-	    return FALSE;
-	}
-    }
-    xf86CloseSerial(pInfo->fd);
-    pInfo->fd = -1;
-
-    /* Process common mouse options (like Emulate3Buttons, etc). */
-    pMse->CommonOptions(pInfo);
-
-    /* Setup the local input proc. */
-    pInfo->read_input = wsconsReadInput;
-    pMse->xisbscale = sizeof(struct wscons_event);
-
-    pInfo->flags |= XI86_CONFIGURED;
-    return TRUE;
-}
-#endif
-
-#if defined(USBMOUSE_SUPPORT)
-
-typedef struct _UsbMseRec {
-    int packetSize;
-    int iid;
-    hid_item_t loc_x;		/* x locator item */
-    hid_item_t loc_y;		/* y locator item */
-    hid_item_t loc_z;		/* z (wheel) locator item */
-    hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
-   unsigned char *buffer;
-} UsbMseRec, *UsbMsePtr;
-
-static int
-usbMouseProc(DeviceIntPtr pPointer, int what)
-{
-    InputInfoPtr pInfo;
-    MouseDevPtr pMse;
-    UsbMsePtr pUsbMse;
-    unsigned char map[MSE_MAXBUTTONS + 1];
-    int nbuttons;
-
-    pInfo = pPointer->public.devicePrivate;
-    pMse = pInfo->private;
-    pMse->device = pPointer;
-    pUsbMse = pMse->mousePriv;
-
-    switch (what) {
-    case DEVICE_INIT: 
-	pPointer->public.on = FALSE;
-
-	for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
-	    map[nbuttons + 1] = nbuttons + 1;
-
-	InitPointerDeviceStruct((DevicePtr)pPointer, 
-				map, 
-				min(pMse->buttons, MSE_MAXBUTTONS),
-				miPointerGetMotionEvents, 
-				pMse->Ctrl,
-				miPointerGetMotionBufferSize());
-
-	/* X valuator */
-	xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
-	xf86InitValuatorDefaults(pPointer, 0);
-	/* Y valuator */
-	xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
-	xf86InitValuatorDefaults(pPointer, 1);
-	xf86MotionHistoryAllocate(pInfo);
-	break;
-
-    case DEVICE_ON:
-	pInfo->fd = xf86OpenSerial(pInfo->options);
-	if (pInfo->fd == -1)
-	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-	else {
-	    pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
-	    if (!pMse->buffer) {
-		xfree(pMse);
-		xf86CloseSerial(pInfo->fd);
-		pInfo->fd = -1;
-	    } else {
-		xf86FlushInput(pInfo->fd);
-		if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput, 
-					      pInfo))
-		    AddEnabledDevice(pInfo->fd);
-	    }
-	}
-	pMse->lastButtons = 0;
-	pMse->lastMappedButtons = 0;
-	pMse->emulateState = 0;
-	pPointer->public.on = TRUE;
-	break;
-
-    case DEVICE_OFF:
-    case DEVICE_CLOSE:
-	if (pInfo->fd != -1) {
-	    RemoveEnabledDevice(pInfo->fd);
-	    if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
-		xfree(pUsbMse->buffer);
-	    }
-	    if (pMse->buffer) {
-		XisbFree(pMse->buffer);
-		pMse->buffer = NULL;
-	    }
-	    xf86CloseSerial(pInfo->fd);
-	    pInfo->fd = -1;
-	}
-	pPointer->public.on = FALSE;
-	usleep(300000);
-	break;
-    }
-    return Success;
-}
-
-static void
-usbReadInput(InputInfoPtr pInfo)
-{
-    MouseDevPtr pMse;
-    UsbMsePtr pUsbMse;
-    int buttons = pMse->lastButtons;
-    int dx = 0, dy = 0, dz = 0, dw = 0;
-    int n, c; 
-    unsigned char *pBuf;
-
-    pMse = pInfo->private;
-    pUsbMse = pMse->mousePriv;
-
-    XisbBlockDuration(pMse->buffer, -1);
-    pBuf = pUsbMse->buffer;
-    n = 0;
-    while ((c = XisbRead(pMse->buffer)) >= 0 && n < pUsbMse->packetSize) {
-	pBuf[n++] = (unsigned char)c;
-    }
-    if (n == 0)
-	return;
-    if (n != pUsbMse->packetSize) {
-	xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n", pInfo->name,
-		n);
-    }
-    /* discard packets with an id that don't match the mouse */
-    /* XXX this is probably not the right thing */
-    if (pUsbMse->iid != 0) {
-	if (*pBuf++ != pUsbMse->iid) 
-	    return;
-    }
-    dx = hid_get_data(pBuf, &pUsbMse->loc_x);
-    dy = hid_get_data(pBuf, &pUsbMse->loc_y);
-    dz = hid_get_data(pBuf, &pUsbMse->loc_z);
-
-    buttons = 0;
-    for (n = 0; n < pMse->buttons; n++) {
-	if (hid_get_data(pBuf, &pUsbMse->loc_btn[n])) 
-	    buttons |= (1 << UMS_BUT(n));
-    }
-    pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
-    return;
-}
-
-static void
-usbSigioReadInput (int fd, void *closure)
-{
-    usbReadInput ((InputInfoPtr) closure);
-}
-
-/* This function is called when the protocol is "usb". */
-static Bool
-usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    MouseDevPtr pMse = pInfo->private;
-    UsbMsePtr pUsbMse;
-    report_desc_t reportDesc;
-    int i;
-
-    pUsbMse = xalloc(sizeof(UsbMseRec));
-    if (pUsbMse == NULL) {
-	xf86Msg(X_ERROR, "%s: cannot allocate UsbMouseRec\n", pInfo->name);
-	xfree(pMse);
-	return FALSE;
-    }
-
-    pMse->protocol = protocol;
-    xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-    /* Collect the options, and process the common options. */
-    xf86CollectInputOptions(pInfo, NULL, NULL);
-    xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-    /* Check if the device can be opened. */
-    pInfo->fd = xf86OpenSerial(pInfo->options);
-    if (pInfo->fd == -1) {
-	if (xf86GetAllowMouseOpenFail())
-	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-	else {
-	    xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
-	    xfree(pUsbMse);
-	    xfree(pMse);
-	    return FALSE;
-	}
-    }
-    /* Get USB informations */
-    reportDesc = hid_get_report_desc(pInfo->fd);
-    /* Get packet size & iid */
-#ifdef USB_NEW_HID
-    if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
-	    xf86Msg(X_ERROR, "Error ioctl USB_GET_REPORT_ID on %s : %s\n",
-		    pInfo->name, strerror(errno));
-	    return FALSE;
-    }
-    pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
-					      pUsbMse->iid);
-#else
-    pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
-					      &pUsbMse->iid);
-#endif
-    /* Allocate buffer */
-    if (pUsbMse->packetSize <= 8) {
-	pUsbMse->buffer = pMse->protoBuf;
-    } else {
-	pUsbMse->buffer = xalloc(pUsbMse->packetSize);
-    }
-    if (pUsbMse->buffer == NULL) {
-	xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
-	xfree(pUsbMse);
-	xfree(pMse);
-	xf86CloseSerial(pInfo->fd);
-	return FALSE;
-    }
-#ifdef USB_NEW_HID
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
-		   hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
-	xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
-    }
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
-		   hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) {
-	xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
-    }
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
-		   hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
-    }
-#else
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
-		   hid_input, &pUsbMse->loc_x) < 0) {
-	xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
-    }
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
-		   hid_input, &pUsbMse->loc_y) < 0) {
-	xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
-    }
-    if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
-		   hid_input, &pUsbMse->loc_z) < 0) {
-    }
-#endif
-    /* Probe for number of buttons */
-    for (i = 1; i <= MSE_MAXBUTTONS; i++) {
-	if (!hid_locate(reportDesc, HID_USAGE2(HUP_BUTTON, i),
-			hid_input, &pUsbMse->loc_btn[i-1]
-#ifdef USB_NEW_HID
-			, pUsbMse->iid
-#endif
-			))
-	    break;
-    }
-    pMse->buttons = i-1;
-
-    xf86CloseSerial(pInfo->fd);
-    pInfo->fd = -1;
-
-    /* Private structure */
-    pMse->mousePriv = pUsbMse;
-
-    /* Process common mouse options (like Emulate3Buttons, etc). */
-    pMse->CommonOptions(pInfo);
-
-    /* Setup the local procs. */
-    pInfo->device_control = usbMouseProc;
-    pInfo->read_input = usbReadInput;
-
-    pInfo->flags |= XI86_CONFIGURED;
-    return TRUE;
-}
-#endif /* USBMOUSE */
-
-static Bool
-bsdMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    /* The protocol is guaranteed to be one of the internalNames[] */
-#ifdef WSCONS_SUPPORT
-    if (xf86NameCmp(protocol, "WSMouse") == 0) {
-	return wsconsPreInit(pInfo, protocol, flags);
-    }
-#endif
-#ifdef USBMOUSE_SUPPORT
-    if (xf86NameCmp(protocol, "usb") == 0) {
-	return usbPreInit(pInfo, protocol, flags);
-    }
-#endif
-    return TRUE;
-}    
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-    p->BuiltinNames = BuiltinNames;
-    p->DefaultProtocol = DefaultProtocol;
-    p->CheckProtocol = CheckProtocol;
-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
-    p->SetupAuto = SetupAuto;
-    p->SetPS2Res = SetSysMouseRes;
-    p->SetBMRes = SetSysMouseRes;
-    p->SetMiscRes = SetSysMouseRes;
-#endif
-#if (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-    p->SetupAuto = SetupAuto;
-    p->SetMiscRes = SetMouseRes;
-#endif
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
-    p->FindDevice = FindDevice;
-#endif
-    p->PreInit = bsdMousePreInit;
-    return p;
-}
diff --git a/hw/xfree86/os-support/hurd/hurd_mouse.c b/hw/xfree86/os-support/hurd/hurd_mouse.c
deleted file mode 100644
index 089cba3..0000000
--- a/hw/xfree86/os-support/hurd/hurd_mouse.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright 1997,1998 by UCHIYAMA Yasushi
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of UCHIYAMA Yasushi not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  UCHIYAMA Yasushi makes no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL UCHIYAMA YASUSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#define NEED_EVENTS
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "mipointer.h"
-
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xf86_OSlib.h"
-#include "xisb.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#include <assert.h>
-#include <mach.h>
-#include <sys/ioctl.h>
-
-#define DEFAULT_MOUSE_DEV	"/dev/mouse"
-
-typedef unsigned short kev_type;		/* kd event type */
-typedef unsigned char Scancode;
-
-struct mouse_motion {		
-    short mm_deltaX;		/* units? */
-    short mm_deltaY;
-};
-
-typedef struct {
-    kev_type type;			/* see below */
-    struct timeval time;		/* timestamp */
-    union {				/* value associated with event */
-	boolean_t up;		/* MOUSE_LEFT .. MOUSE_RIGHT */
-	Scancode sc;		/* KEYBD_EVENT */
-	struct mouse_motion mmotion;	/* MOUSE_MOTION */
-    } value;
-} kd_event;
-
-/* 
- * kd_event ID's.
- */
-#define MOUSE_LEFT	1		/* mouse left button up/down */
-#define MOUSE_MIDDLE	2
-#define MOUSE_RIGHT	3
-#define MOUSE_MOTION	4		/* mouse motion */
-#define KEYBD_EVENT	5		/* key up/down */
-
-#define NUMEVENTS	64
-
-/*
- * OsMouseReadInput --
- *      Get some events from our queue.  Process all outstanding events now.
- */
-static void
-OsMouseReadInput(InputInfoPtr pInfo)
-{
-    MouseDevPtr pMse;
-    static kd_event eventList[NUMEVENTS];
-    int n, c; 
-    kd_event *event = eventList;
-    unsigned char *pBuf;
-
-    pMse = pInfo->private;
-
-    XisbBlockDuration(pMse->buffer, -1);
-    pBuf = (unsigned char *)eventList;
-    n = 0;
-    while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList))
-	pBuf[n++] = (unsigned char)c;
-
-    if (n == 0)
-	return;
-
-    n /= sizeof(kd_event);
-    while( n-- ) {
-	int buttons = pMse->lastButtons;
-	int dx = 0, dy = 0;
-	switch (event->type) {
-	case MOUSE_RIGHT:
-	    buttons  = buttons & 6 |(event->value.up ? 0 : 1);
-	    break;
-	case MOUSE_MIDDLE:
-	    buttons  = buttons & 5 |(event->value.up ? 0 : 2);
-	    break;
-	case MOUSE_LEFT:
-	    buttons  = buttons & 3 |(event->value.up ? 0 : 4) ;
-	    break;
-	case MOUSE_MOTION:
-	    dx = event->value.mmotion.mm_deltaX;
-	    dy = - event->value.mmotion.mm_deltaY;
-	    break;
-	default:
-	    ErrorF("Bad mouse event (%d)\n",event->type);
-	    continue;
-	}
-	pMse->PostEvent(pInfo, buttons, dx, dy, 0, 0);
-	++event;
-    }
-    return;
-}
-
-static Bool
-OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    MouseDevPtr pMse;
-
-    /* This is called when the protocol is "OSMouse". */
-
-    pMse = pInfo->private;
-    pMse->protocol = protocol;
-    xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-    /* Collect the options, and process the common options. */
-    xf86CollectInputOptions(pInfo, NULL, NULL);
-    xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-    /* Check if the device can be opened. */
-    pInfo->fd = xf86OpenSerial(pInfo->options); 
-    if (pInfo->fd == -1) {
-	if (xf86GetAllowMouseOpenFail())
-	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-	else {
-	    xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
-	    xfree(pMse);
-	    return FALSE;
-	}
-    }
-    xf86CloseSerial(pInfo->fd);
-    pInfo->fd = -1;
-
-    /* Process common mouse options (like Emulate3Buttons, etc). */
-    pMse->CommonOptions(pInfo);
-
-    /* Setup the local procs. */
-    pInfo->read_input = OsMouseReadInput;
-    
-    pInfo->flags |= XI86_CONFIGURED;
-    return TRUE;
-}
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    const char path[] = DEFAULT_MOUSE_DEV;
-    int fd;
-
-    SYSCALL (fd = open(path, O_RDWR | O_NONBLOCK | O_EXCL));
-
-    if (fd == -1)
-	return NULL;
-
-    close(fd);
-    pInfo->conf_idev->commonOptions =
-	xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", path);
-    xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", pInfo->name,
-	    path);
-
-    return path;
-}
-
-static int
-SupportedInterfaces(void)
-{
-    /* XXX Need to check this. */
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
-}
-
-static const char *internalNames[] = {
-	"OSMouse",
-	NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
-    return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
-    int i;
-
-    for (i = 0; internalNames[i]; i++)
-	if (xf86NameCmp(protocol, internalNames[i]) == 0)
-	    return TRUE;
-    return FALSE;
-}
-
-static const char *
-DefaultProtocol(void)
-{
-    return "OSMouse";
-}
-
-OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-    p->BuiltinNames = BuiltinNames;
-    p->FindDevice = FindDevice;
-    p->DefaultProtocol = DefaultProtocol;
-    p->CheckProtocol = CheckProtocol;
-    p->PreInit = OsMousePreInit;
-    return p;
-}
-
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 93f09c1..f736095 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -26,7 +26,7 @@ APM_SRCS = lnx_apm.c
 XORG_CFLAGS += -DHAVE_APM
 endif
 
-liblinux_la_SOURCES = lnx_init.c lnx_video.c lnx_mouse.c \
+liblinux_la_SOURCES = lnx_init.c lnx_video.c \
                      lnx_pci.c lnx_agp.c lnx_kmod.c lnx_bell.c \
                      $(srcdir)/../shared/bios_mmap.c \
 		     $(srcdir)/../shared/VTsw_usl.c \
diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c
deleted file mode 100644
index d282215..0000000
--- a/hw/xfree86/os-support/linux/lnx_mouse.c
+++ /dev/null
@@ -1,221 +0,0 @@
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xf86_OSlib.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-static int
-SupportedInterfaces(void)
-{
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
-}
-
-static const char *
-DefaultProtocol(void)
-{
-    return "Auto";
-}
-
-#define DEFAULT_MOUSE_DEV		"/dev/input/mice"
-#define DEFAULT_PS2_DEV			"/dev/psaux"
-#define DEFAULT_GPM_DATA_DEV		"/dev/gpmdata"
-#define DEFAULT_GPM_CTL_DEV		"/dev/gpmdata"
-
-static const char *mouseDevs[] = {
-	DEFAULT_MOUSE_DEV,
-	DEFAULT_PS2_DEV,
-	DEFAULT_GPM_DATA_DEV,
-	NULL
-};
-
-typedef enum {
-	MOUSE_PROTO_UNKNOWN = 0,
-	MOUSE_PROTO_SERIAL,
-	MOUSE_PROTO_PS2,
-	MOUSE_PROTO_MSC,
-	MOUSE_PROTO_GPM,
-	MOUSE_PROTO_EXPPS2,
-} protocolTypes;
-
-static struct {
-	protocolTypes proto;
-	const char *name;
-} devproto[] = {
-	{ MOUSE_PROTO_UNKNOWN,	NULL },
-	{ MOUSE_PROTO_PS2,	"PS/2" },
-	{ MOUSE_PROTO_MSC,	"MouseSystems" },
-	{ MOUSE_PROTO_GPM,	"GPM" },
-	{ MOUSE_PROTO_EXPPS2,   "ExplorerPS/2" },
-};
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    int fd = -1;
-    const char **pdev;
-
-    for (pdev = mouseDevs; *pdev; pdev++) {
-	SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK | O_EXCL));
-	if (fd == -1) {
-#ifdef DEBUG
-	    ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
-#endif
-	} else
-	    break;
-    }
-
-    if (*pdev) {
-	close(fd);
-	/* Set the Device option. */
-	pInfo->conf_idev->commonOptions =
-	    xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", *pdev);
-	xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
-		pInfo->name, *pdev);
-    }
-
-    return *pdev;
-}
-
-static const char *
-lnxMouseMagic(InputInfoPtr pInfo)
-{
-    int fd = -1;
-    const char *dev;
-    char *realdev;
-    struct stat sbuf;
-    int i;
-    int proto = MOUSE_PROTO_UNKNOWN;
-
-    dev = xf86SetStrOption(pInfo->conf_idev->commonOptions, "Device", NULL);
-    if (!dev) {
-#ifdef DEBUG
-	ErrorF("xf86SetStrOption failed to return the device name\n");
-#endif
-	return NULL;
-    }
-    /* Look at the device name to guess the protocol. */
-    realdev = NULL;
-    if (strcmp(dev, DEFAULT_MOUSE_DEV) == 0) {
-	if (lstat(dev, &sbuf) != 0) {
-#ifdef DEBUG
-	    ErrorF("lstat failed for %s (%s)\n", dev, strerror(errno));
-#endif
-	    return NULL;
-	}
-	if (S_ISLNK(sbuf.st_mode)) {
-	    realdev = xnfalloc(PATH_MAX + 1);
-	    i = readlink(dev, realdev, PATH_MAX);
-	    if (i <= 0) {
-#ifdef DEBUG
-		ErrorF("readlink failed for %s (%s)\n", dev, strerror(errno));
-#endif
-		xfree(realdev);
-		return NULL;
-	    }
-	    realdev[i] = '\0';
-	}
-    }
-    if (!realdev)
-	realdev = xnfstrdup(dev);
-    else {
-	/* If realdev doesn't contain a '/' then prepend "/dev/" */
-	if (!strchr(realdev, '/')) {
-	    char *tmp = xnfalloc(strlen(realdev) + 5 + 1);
-	    sprintf(tmp, "/dev/%s", realdev);
-	    xfree(realdev);
-	    realdev = tmp;
-	}
-    }
-
-    if (strcmp(realdev, DEFAULT_MOUSE_DEV) == 0)
-	proto = MOUSE_PROTO_EXPPS2;
-    else if (strcmp(realdev, DEFAULT_PS2_DEV) == 0)
-	proto = MOUSE_PROTO_EXPPS2;
-    else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0)
-	proto = MOUSE_PROTO_MSC;
-    else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0)
-	proto = MOUSE_PROTO_GPM;
-    xfree(realdev);
-    /*
-     * If the protocol can't be guessed from the device name,
-     * try to characterise it.
-     */
-    if (proto == MOUSE_PROTO_UNKNOWN) {
-	SYSCALL (fd = open(dev, O_RDWR | O_NONBLOCK | O_EXCL));
-	if (isatty(fd)) {
-	    /* Serial PnP has already failed, so give up. */
-	} else {
-	    if (fstat(fd, &sbuf) != 0) {
-#ifdef DEBUG
-		ErrorF("fstat failed for %s (%s)\n", dev, strerror(errno));
-#endif
-		close(fd);
-		return NULL;
-	    }
-	    if (S_ISFIFO(sbuf.st_mode)) {
-		/* Assume GPM data in MSC format. */
-		proto = MOUSE_PROTO_MSC;
-	    } else {
-		/* Default to PS/2 */
-		proto = MOUSE_PROTO_PS2;
-	    }
-	}
-	close(fd);
-    }
-    if (proto == MOUSE_PROTO_UNKNOWN) {
-	xf86Msg(X_ERROR, "%s: Cannot find mouse protocol.\n",
-		pInfo->name);
-	return NULL;
-    } else {
-	for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) {
-	    if (devproto[i].proto == proto) {
-		xf86Msg(X_INFO,
-			"%s: Setting mouse protocol to \"%s\"\n",
-			pInfo->name, devproto[i].name);
-		return devproto[i].name;
-	    }
-	}
-    }
-    return NULL;
-}
-
-static const char *
-GuessProtocol(InputInfoPtr pInfo, int flags)
-{
-    return lnxMouseMagic(pInfo);
-}
-
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
-    return lnxMouseMagic(pInfo);
-}
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-    p->DefaultProtocol = DefaultProtocol;
-    p->FindDevice = FindDevice;
-    p->GuessProtocol = GuessProtocol;
-    p->SetupAuto = SetupAuto;
-    return p;
-}
-
diff --git a/hw/xfree86/os-support/lynxos/lynx_mouse.c b/hw/xfree86/os-support/lynxos/lynx_mouse.c
deleted file mode 100644
index b482029..0000000
--- a/hw/xfree86/os-support/lynxos/lynx_mouse.c
+++ /dev/null
@@ -1,33 +0,0 @@
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-
-static int
-SupportedInterfaces(void)
-{
-    /* XXX Need to check this. */
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
-}
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-    return p;
-}
-
diff --git a/hw/xfree86/os-support/sco/sco_mouse.c b/hw/xfree86/os-support/sco/sco_mouse.c
deleted file mode 100644
index af57cde..0000000
--- a/hw/xfree86/os-support/sco/sco_mouse.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright 2001 by J. Kean Johnston <jkj at sco.com>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name J. Kean Johnston not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  J. Kean Johnston makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "mipointer.h"
-#include <sys/event.h>
-#include <mouse.h>
-
-static int
-SupportedInterfaces (void)
-{
-  return MSE_MISC;
-}
-
-static const char *internalNames[] = {
-  "OSMouse",
-  NULL
-};
-
-static const char **
-BuiltinNames (void)
-{
-  return internalNames;
-}
-
-static Bool
-CheckProtocol (const char *protocol)
-{
-  int i;
-
-  for (i = 0; internalNames[i]; i++) {
-    if (xf86NameCmp (protocol, internalNames[i]) == 0)
-      return TRUE;
-  }
-
-  return FALSE;
-}
-
-static const char *
-DefaultProtocol (void)
-{
-  return "OSMouse";
-}
-
-static const char *
-evtErrStr (int evterr)
-{
-  switch (evterr) {
-  case -1: return "error in config files";
-  case -2: return "no mouse devices to attach";
-  case -3: return "unable to open device";
-  case -4: return "unable to open event queue";
-  case -999: return "unable to initialize event driver";
-  default: return "unknown event driver error";
-  }
-}
-
-static int
-OsMouseProc (DeviceIntPtr pPointer, int what)
-{
-  InputInfoPtr pInfo;
-  MouseDevPtr pMse;
-  unsigned char map[9];
-  dmask_t dmask;
-  MessageType from = X_CONFIG;
-  int evi;
-
-  pInfo = pPointer->public.devicePrivate;
-  pMse = pInfo->private;
-  pMse->device = pPointer;
-
-  switch (what) {
-  case DEVICE_INIT: 
-    pPointer->public.on = FALSE;
-
-    dmask = D_ABS | D_REL | D_BUTTON;
-    if ((evi = ev_initf(xf86Info.consoleFd)) < 0) {
-      FatalError ("OsMouseProc: Event driver initialization failed (%s)\n",
-          evtErrStr(evi));
-    }
-    pInfo->fd = ev_open (&dmask);
-    if (pInfo->fd < 0) {
-      FatalError ("OsMouseProc: DEVICE_INIT failed (%s)\n", evtErrStr(pInfo->fd));
-    }
-
-    pMse->buttons = xf86SetIntOption (pInfo->options, "Buttons", 0);
-    if (pMse->buttons == 0) {
-      pMse->buttons = 8;
-      from = X_DEFAULT;
-    }
-    xf86Msg (from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
-
-    for (evi = 0; evi <= 8; evi++)
-      map[evi] = evi;
-
-    InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
-        miPointerGetMotionEvents, pMse->Ctrl,
-        miPointerGetMotionBufferSize());
-
-    /* X valuator */
-    xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
-    xf86InitValuatorDefaults(pPointer, 0);
-
-    /* Y valuator */
-    xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
-    xf86InitValuatorDefaults(pPointer, 1);
-
-    xf86MotionHistoryAllocate(pInfo);
-
-    ev_flush();
-    ev_suspend();
-    break;
-
-  case DEVICE_ON:
-    pMse->lastButtons = 0;
-    pMse->lastMappedButtons = 0;
-    pMse->emulateState = 0;
-    pPointer->public.on = TRUE;
-    ev_resume();
-    AddEnabledDevice (pInfo->fd);
-    break;
-
-  case DEVICE_OFF:
-  case DEVICE_CLOSE:
-    pPointer->public.on = FALSE;
-    RemoveEnabledDevice (pInfo->fd);
-    if (what == DEVICE_CLOSE) {
-      ev_close();
-      pInfo->fd = -1;
-    } else {
-      ev_suspend();
-    }
-    break;
-  }
-
-  return Success;
-}
-
-static void
-OsMouseReadInput (InputInfoPtr pInfo)
-{
-  MouseDevPtr pMse;
-  EVENT *evp;
-
-  pMse = pInfo->private;
-
-  while ((evp = ev_read()) != (EVENT *)0) {
-    int buttons = EV_BUTTONS(*evp);
-    int dx = EV_DX(*evp), dy = -(EV_DY(*evp)), dz = 0;
-
-    if (buttons & WHEEL_FWD)
-      dz = -1;
-    else if (buttons & WHEEL_BACK)
-      dz = 1;
-
-    buttons &= ~(WHEEL_FWD | WHEEL_BACK);
-
-    pMse->PostEvent (pInfo, buttons, dx, dy, dz, 0);
-    ev_pop();
-  }
-}
-
-static Bool
-OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-  MouseDevPtr pMse;
-
-  /* This is called when the protocol is "OSMouse". */
-
-  pMse = pInfo->private;
-  pMse->protocol = protocol;
-  xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-  /* Collect the options, and process the common options. */
-  xf86CollectInputOptions(pInfo, NULL, NULL);
-  xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-  /* Check if the device can be opened. */
-  pInfo->fd = ev_initf(xf86Info.consoleFd);
-  if (pInfo->fd != -1) {
-    dmask_t dmask = (D_ABS | D_REL | D_BUTTON);
-    pInfo->fd = ev_open(&dmask);
-  } else {
-    pInfo->fd = -999;
-  }
-
-  if (pInfo->fd < 0) {
-    if (xf86GetAllowMouseOpenFail())
-      xf86Msg(X_WARNING, "%s: cannot open event manager (%s)\n",
-          pInfo->name, evtErrStr(pInfo->fd));
-    else {
-      xf86Msg(X_ERROR, "%s: cannot open event manager (%s)\n",
-          pInfo->name, evtErrStr(pInfo->fd));
-      xfree(pMse);
-      return FALSE;
-    }
-  }
-  ev_close();
-  pInfo->fd = -1;
-
-  /* Process common mouse options (like Emulate3Buttons, etc). */
-  pMse->CommonOptions(pInfo);
-
-  /* Setup the local procs. */
-  pInfo->device_control = OsMouseProc;
-  pInfo->read_input = OsMouseReadInput;
-    
-  pInfo->flags |= XI86_CONFIGURED;
-  return TRUE;
-}
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit (int flags)
-{
-  OSMouseInfoPtr p;
-
-  p = xcalloc(sizeof(OSMouseInfoRec), 1);
-  if (!p)
-    return NULL;
-
-  p->SupportedInterfaces        = SupportedInterfaces;
-  p->BuiltinNames               = BuiltinNames;
-  p->DefaultProtocol            = DefaultProtocol;
-  p->CheckProtocol              = CheckProtocol;
-  p->PreInit                    = OsMousePreInit;
-
-  return p;
-}
diff --git a/hw/xfree86/os-support/solaris/sun_mouse.c b/hw/xfree86/os-support/solaris/sun_mouse.c
deleted file mode 100644
index a5955ef..0000000
--- a/hw/xfree86/os-support/solaris/sun_mouse.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright 1999-2001 The XFree86 Project, Inc.  All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice 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
- * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the XFree86 Project shall
- * not be used in advertising or otherwise to promote the sale, use or other
- * dealings in this Software without prior written authorization from the
- * XFree86 Project.
- */
-/* Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86.h"
-#include "xf86_OSlib.h"
-#include "xf86OSmouse.h"
-
-#if defined(__SOL8__) || !defined(__i386)
-
-#include "xisb.h"
-#include "mipointer.h"
-#include <sys/stropts.h>
-#include <sys/vuid_event.h>
-#include <sys/msio.h>
-
-/* Wheel mouse support in VUID drivers in Solaris 9 updates & Solaris 10 */
-#ifdef WHEEL_DEVID /* Defined in vuid_event.h if VUID wheel support present */
-# define HAVE_VUID_WHEEL
-#endif
-#ifdef HAVE_VUID_WHEEL
-# include <sys/vuid_wheel.h>
-#endif
-
-/* Support for scaling absolute coordinates to screen size in 
- * Solaris 10 updates and beyond */
-#if !defined(HAVE_ABSOLUTE_MOUSE_SCALING)
-# ifdef MSIOSRESOLUTION /* Defined in msio.h if scaling support present */
-#  define HAVE_ABSOLUTE_MOUSE_SCALING
-# endif
-#endif
-
-/* Names of protocols that are handled internally here. */
-
-static const char *internalNames[] = {
-	"VUID",
-	NULL
-};
-
-static const char *solarisMouseDevs[] = {
-    /* Device file:	Protocol: 			*/
-    "/dev/mouse",	"VUID",		/* USB or SPARC */
-#if defined(__i386) || defined(__x86)
-    "/dev/kdmouse",	"PS/2",		/* PS/2 */
-#endif
-    NULL
-};
-
-typedef struct _VuidMseRec {
-    struct _VuidMseRec *next;    
-    InputInfoPtr	pInfo;
-    Firm_event 		event;
-    unsigned char *	buffer;
-    char *		strmod;
-    Bool(*wrapped_device_control)(DeviceIntPtr device, int what);
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
-    Ms_screen_resolution	 absres;
-#endif
-} VuidMseRec, *VuidMsePtr;
-
-static VuidMsePtr	vuidMouseList = NULL;
-
-static int  vuidMouseProc(DeviceIntPtr pPointer, int what);
-static void vuidReadInput(InputInfoPtr pInfo);
-
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
-static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse);
-static void vuidMouseAdjustFrame(int index, int x, int y, int flags);
-
-static int vuidMouseGeneration = 0;
-static DevPrivateKey vuidMouseScreenKey = &vuidMouseScreenKey;
-#define vuidMouseGetScreenPrivate(s) ( \
-    dixLookupPrivate(&(s)->devPrivates, vuidMouseScreenKey))
-#define vuidMouseSetScreenPrivate(s,p) \
-    dixSetPrivate(&(s)->devPrivates, vuidMouseScreenKey, (void *) p)
-#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
-
-static inline
-VuidMsePtr getVuidMsePriv(InputInfoPtr pInfo)
-{
-    VuidMsePtr m = vuidMouseList;
-
-    while ((m != NULL) && (m->pInfo != pInfo)) {
-	m = m->next;
-    }
-
-    return m;
-}
-
-
-/*
- * Initialize and enable the mouse wheel, if present.
- *
- * Returns 1 if mouse wheel was successfully enabled.
- * Returns 0 if an error occurred or if there is no mouse wheel.
- */
-static int
-vuidMouseWheelInit(InputInfoPtr pInfo)
-{
-#ifdef HAVE_VUID_WHEEL
-    wheel_state wstate;
-    int nwheel = -1;
-    int i;
-
-    wstate.vers = VUID_WHEEL_STATE_VERS;
-    wstate.id = 0;
-    wstate.stateflags = -1;
-
-    SYSCALL(i = ioctl(pInfo->fd, VUIDGWHEELCOUNT, &nwheel));
-    if (i != 0)
-	return (0);
-
-    SYSCALL(i = ioctl(pInfo->fd, VUIDGWHEELSTATE, &wstate));
-    if (i != 0) {
-	xf86Msg(X_WARNING, "%s: couldn't get wheel state\n", pInfo->name);
-	return (0);
-    }
-
-    wstate.stateflags |= VUID_WHEEL_STATE_ENABLED;
-
-    SYSCALL(i = ioctl(pInfo->fd, VUIDSWHEELSTATE, &wstate));
-    if (i != 0) {
-	xf86Msg(X_WARNING, "%s: couldn't enable wheel\n", pInfo->name);
-	return (0);
-    }
-
-    return (1);
-#else
-    return (0);
-#endif
-}
-
-
-/* This function is called when the protocol is "VUID". */
-static Bool
-vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    MouseDevPtr pMse = pInfo->private;
-    VuidMsePtr pVuidMse;
-    int buttons, i;
-
-    pVuidMse = xcalloc(sizeof(VuidMseRec), 1);
-    if (pVuidMse == NULL) {
-	xf86Msg(X_ERROR, "%s: cannot allocate VuidMouseRec\n", pInfo->name);
-	xfree(pMse);
-	return FALSE;
-    }
-
-    pMse->protocol = protocol;
-    xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-    /* Collect the options, and process the common options. */
-    xf86CollectInputOptions(pInfo, NULL, NULL);
-    xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-    /* Check if the device can be opened. */
-    pInfo->fd = xf86OpenSerial(pInfo->options);
-    if (pInfo->fd == -1) {
-	if (xf86GetAllowMouseOpenFail())
-	    xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
-	else {
-	    xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
-	    xfree(pVuidMse);
-	    xfree(pMse);
-	    return FALSE;
-	}
-    }
-
-    pVuidMse->buffer = (unsigned char *)&pVuidMse->event;
-
-    pVuidMse->strmod = xf86SetStrOption(pInfo->options, "StreamsModule", NULL);
-    if (pVuidMse->strmod) {
-	SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod));
- 	if (i < 0) {
-	    xf86Msg(X_ERROR,
-		    "%s: cannot push module '%s' onto mouse device: %s\n",
-		    pInfo->name, pVuidMse->strmod, strerror(errno));
-	    xf86CloseSerial(pInfo->fd);
-	    pInfo->fd = -1;
-	    xfree(pVuidMse->strmod);
-	    xfree(pVuidMse);
-	    xfree(pMse);
-	    return FALSE;
-	}
-    }
-
-    buttons = xf86SetIntOption(pInfo->options, "Buttons", 0);
-    if (buttons == 0) {
-	SYSCALL(i = ioctl(pInfo->fd, MSIOBUTTONS, &buttons));
-	if (i == 0) {
-	    pInfo->conf_idev->commonOptions =
-		xf86ReplaceIntOption(pInfo->conf_idev->commonOptions, 
-				     "Buttons", buttons);
-	    xf86Msg(X_INFO, "%s: Setting Buttons option to \"%d\"\n",
-		    pInfo->name, buttons);
-	}
-    }
-
-    if (pVuidMse->strmod) { 
-	SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod));
-	if (i == -1) {
-	    xf86Msg(X_WARNING,
-		    "%s: cannot pop module '%s' off mouse device: %s\n",
-		    pInfo->name, pVuidMse->strmod, strerror(errno));
-	}
-    }
-
-    xf86CloseSerial(pInfo->fd);
-    pInfo->fd = -1;
-
-    /* Process common mouse options (like Emulate3Buttons, etc). */
-    pMse->CommonOptions(pInfo);
-
-    /* Setup the local procs. */
-    pVuidMse->wrapped_device_control = pInfo->device_control;
-    pInfo->device_control = vuidMouseProc;
-    pInfo->read_input = vuidReadInput;
-
-    pMse->xisbscale = sizeof(Firm_event);
-
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING    
-    pVuidMse->absres.height = pVuidMse->absres.width = 0;
-#endif
-    pVuidMse->pInfo = pInfo;
-    pVuidMse->next = vuidMouseList; 
-    vuidMouseList = pVuidMse;
-
-    pInfo->flags |= XI86_CONFIGURED;
-    return TRUE;
-}
-
-static void
-vuidFlushAbsEvents(InputInfoPtr pInfo, int absX, int absY, 
-		   Bool *absXset, Bool *absYset)
-{
-#ifdef DEBUG
-    ErrorF("vuidFlushAbsEvents: %d,%d (set: %d, %d)\n", absX, absY, 
-	   *absXset, *absYset);
-#endif
-    if ((*absXset) && (*absYset)) {
-	xf86PostMotionEvent(pInfo->dev, 
-			    /* is_absolute: */    TRUE,
-			    /* first_valuator: */ 0,
-			    /* num_valuators: */  2,
-			    absX, absY);
-    } else if (*absXset) {
-	xf86PostMotionEvent(pInfo->dev, 
-			    /* is_absolute: */    TRUE,
-			    /* first_valuator: */ 0,
-			    /* num_valuators: */  1,
-			    absX);
-    } else if (*absYset) {
-	xf86PostMotionEvent(pInfo->dev, 
-			    /* is_absolute: */    TRUE,
-			    /* first_valuator: */ 1,
-			    /* num_valuators: */  1,
-			    absY);
-    }
-
-    *absXset = FALSE;
-    *absYset = FALSE;
-}
-
-static void
-vuidReadInput(InputInfoPtr pInfo)
-{
-    MouseDevPtr pMse;
-    VuidMsePtr pVuidMse;
-    int buttons;
-    int dx = 0, dy = 0, dz = 0, dw = 0;
-    unsigned int n;
-    int c; 
-    unsigned char *pBuf;
-    int wmask;
-    int absX, absY;
-    Bool absXset = FALSE, absYset = FALSE;
-
-    pMse = pInfo->private;
-    pVuidMse = getVuidMsePriv(pInfo);
-    buttons = pMse->lastButtons;
-    XisbBlockDuration(pMse->buffer, -1);
-    pBuf = pVuidMse->buffer;
-    n = 0;
-
-    do {
-	while (n < sizeof(Firm_event) && (c = XisbRead(pMse->buffer)) >= 0) {
-	    pBuf[n++] = (unsigned char)c;
-	}
-
-	if (n == 0)
-	    return;
-
-	if (n != sizeof(Firm_event)) {
-	    xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n",
-			pInfo->name, n);
-	}
-
-#ifdef DEBUG
-	ErrorF("vuidReadInput: event type: %3d value: %5d\n",
-	       pVuidMse->event.id, pVuidMse->event.value);
-#endif
-
-	if (pVuidMse->event.id >= BUT_FIRST && pVuidMse->event.id <= BUT_LAST) {
-	    /* button */
-	    int butnum = pVuidMse->event.id - BUT_FIRST;
-
-	    if (butnum < 3)
-		butnum = 2 - butnum;
-	    if (!pVuidMse->event.value)
-		buttons &= ~(1 << butnum);
-	    else
-		buttons |= (1 << butnum);
-	} else if (pVuidMse->event.id >= VLOC_FIRST &&
-		   pVuidMse->event.id <= VLOC_LAST) {
-	    /* axis */
-	    int delta = pVuidMse->event.value;
-	    switch(pVuidMse->event.id) {
-	    case LOC_X_DELTA:
-		dx += delta;
-		break;
-	    case LOC_Y_DELTA:
-		dy -= delta;
-		break;
-	    case LOC_X_ABSOLUTE:
-		if (absXset) {
-		    vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
-		}
-		absX = delta;
-		absXset = TRUE;
-		break;
-	    case LOC_Y_ABSOLUTE:
-		if (absYset) {
-		    vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
-		}
-		absY = delta;
-		absYset = TRUE;
-		break;
-	    }
-	} 
-#ifdef HAVE_VUID_WHEEL
-	else if (vuid_in_range(VUID_WHEEL, pVuidMse->event.id)) {
-	    if (vuid_id_offset(pVuidMse->event.id) == 0)
-		dz -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
-	    else
-		dw -= VUID_WHEEL_GETDELTA(pVuidMse->event.value);
-	}
-#endif
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
-	else if (pVuidMse->event.id == MOUSE_TYPE_ABSOLUTE) {
-	    /* force sending absolute resolution scaling ioctl */
-	    pVuidMse->absres.height = pVuidMse->absres.width = 0;
-	    vuidMouseSendScreenSize(miPointerCurrentScreen(), pVuidMse);
-	}
-#endif
-
-	n = 0;
-	if ((c = XisbRead(pMse->buffer)) >= 0) {
-	    /* Another packet.  Handle it right away. */
-	    pBuf[n++] = c;
-	}
-    } while (n != 0);
-
-    if (absXset || absYset) {
-	vuidFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset);
-    }
-
-    pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
-    return;
-}
-
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
-static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse)
-{
-    InputInfoPtr pInfo = pVuidMse->pInfo;
-    ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
-    int result;
-
-    if ((pVuidMse->absres.width != pScr->currentMode->HDisplay) || 
-	(pVuidMse->absres.height != pScr->currentMode->VDisplay))
-    {
-	pVuidMse->absres.width = pScr->currentMode->HDisplay;
-	pVuidMse->absres.height = pScr->currentMode->VDisplay;
-
-	do {
-	    result = ioctl(pInfo->fd, MSIOSRESOLUTION, &(pVuidMse->absres));
-	} while ( (result != 0) && (errno == EINTR) );
-
-	if (result != 0) {
-	    xf86Msg(X_WARNING, 
-		    "%s: couldn't set absolute mouse scaling resolution: %s\n",
-		    pInfo->name, strerror(errno));
-#ifdef DEBUG
-	} else {
-	    xf86Msg(X_INFO, 
-		    "%s: absolute mouse scaling resolution set to %d x %d\n", 
-		    pInfo->name, 
-		    pVuidMse->absres.width, pVuidMse->absres.height);
-#endif
-	}
-    }
-}
-
-static void vuidMouseAdjustFrame(int index, int x, int y, int flags)
-{
-      ScrnInfoPtr	pScrn = xf86Screens[index];
-      ScreenPtr		pScreen = pScrn->pScreen;
-      xf86AdjustFrameProc *wrappedAdjustFrame 
-	  = (xf86AdjustFrameProc *) vuidMouseGetScreenPrivate(pScreen);
-      VuidMsePtr	m;
-
-      if(wrappedAdjustFrame) {
-        pScrn->AdjustFrame = wrappedAdjustFrame;
-        (*pScrn->AdjustFrame)(index, x, y, flags);
-        pScrn->AdjustFrame = vuidMouseAdjustFrame;
-      }
-
-      if (miPointerCurrentScreen() == pScreen) {
-	  for (m = vuidMouseList; m != NULL ; m = m->next) {
-	      vuidMouseSendScreenSize(pScreen, m);
-	  }
-      }
-}
-#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
-
-
-static int
-vuidMouseProc(DeviceIntPtr pPointer, int what)
-{
-    InputInfoPtr pInfo;
-    MouseDevPtr pMse;
-    VuidMsePtr pVuidMse;
-    int ret = Success;
-    int i;
-
-    pInfo = pPointer->public.devicePrivate;
-    pMse = pInfo->private;
-    pMse->device = pPointer;
-
-    pVuidMse = getVuidMsePriv(pInfo);
-    if (pVuidMse == NULL) {
-	return BadImplementation;
-    }
-    
-    switch (what) {
-
-    case DEVICE_INIT:
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING
-	if (vuidMouseGeneration != serverGeneration) {
-		for (i = 0; i < screenInfo.numScreens; i++) {
-		    ScreenPtr pScreen = screenInfo.screens[i];
-		    ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
-		    vuidMouseSetScreenPrivate(pScreen, pScrn->AdjustFrame);
-		    pScrn->AdjustFrame = vuidMouseAdjustFrame;
-		}
-	    vuidMouseGeneration = serverGeneration;
-	}
-#endif    	
-	ret = pVuidMse->wrapped_device_control(pPointer, what);
-	break;
-	
-    case DEVICE_ON:
-	ret = pVuidMse->wrapped_device_control(pPointer, DEVICE_ON);
-
-	if ((ret == Success) && (pInfo->fd != -1)) {
-	    int fmt = VUID_FIRM_EVENT;
-	    
-	    if (pVuidMse->strmod) {
-		SYSCALL(i = ioctl(pInfo->fd, I_PUSH, pVuidMse->strmod));
-		if (i < 0) {
-		    xf86Msg(X_WARNING,
-			"%s: cannot push module '%s' onto mouse device: %s\n",
-			pInfo->name, pVuidMse->strmod, strerror(errno));
-		    xfree(pVuidMse->strmod);
-		    pVuidMse->strmod = NULL;
-		}
-	    }
-	    SYSCALL(i = ioctl(pInfo->fd, VUIDSFORMAT, &fmt));
-	    if (i < 0) {
-		xf86Msg(X_WARNING,
-			"%s: cannot set mouse device to VUID mode: %s\n",
-			pInfo->name, strerror(errno));
-	    }
-	    vuidMouseWheelInit(pInfo);
-#ifdef HAVE_ABSOLUTE_MOUSE_SCALING	    
-	    vuidMouseSendScreenSize(screenInfo.screens[0], pVuidMse);
-#endif	    
-	    xf86FlushInput(pInfo->fd);
-	}
-	break;
-
-    case DEVICE_OFF:
-    case DEVICE_CLOSE:
-	if (pInfo->fd != -1) {
-	    if (pVuidMse->strmod) {
-		SYSCALL(i = ioctl(pInfo->fd, I_POP, pVuidMse->strmod));
-		if (i == -1) {
-		    xf86Msg(X_WARNING,
-		      "%s: cannot pop module '%s' off mouse device: %s\n",
-		      pInfo->name, pVuidMse->strmod, strerror(errno));
-		}
-	    }
-	}
-	ret = pVuidMse->wrapped_device_control(pPointer, what);
-	break;
-
-    default: /* Should never be called, but just in case */
-	ret = pVuidMse->wrapped_device_control(pPointer, what);
-	break;
-    }
-    return ret;
-}
-
-static Bool
-sunMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    /* The protocol is guaranteed to be one of the internalNames[] */
-    if (xf86NameCmp(protocol, "VUID") == 0) {
-	return vuidPreInit(pInfo, protocol, flags);
-    }
-    return TRUE;
-}    
-
-static const char **
-BuiltinNames(void)
-{
-    return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
-    int i;
-
-    for (i = 0; internalNames[i]; i++)
-	if (xf86NameCmp(protocol, internalNames[i]) == 0)
-	    return TRUE;
-
-    return FALSE;
-}
-
-static const char *
-DefaultProtocol(void)
-{
-    return "Auto";
-}
-
-static Bool
-solarisMouseAutoProbe(InputInfoPtr pInfo, const char **protocol, 
-	const char **device)
-{
-    const char **pdev, **pproto, *dev = NULL;
-    int fd = -1;
-    Bool found;
-
-    for (pdev = solarisMouseDevs; *pdev; pdev += 2) {
-	pproto = pdev + 1;
-	if ((*protocol != NULL) && (strcmp(*protocol, "Auto") != 0) &&
-	  (*pproto != NULL) && (strcmp(*pproto, *protocol) != 0)) {
-	    continue;
-	}
-	if ((*device != NULL) && (strcmp(*device, *pdev) != 0)) {
-	    continue;
-	}
-        SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
-	if (fd == -1) {
-#ifdef DEBUG
-	    ErrorF("Cannot open %s (%s)\n", pdev, strerror(errno));
-#endif
-	} else {
-	    found = TRUE;
-	    if ((*pproto != NULL) && (strcmp(*pproto, "VUID") == 0)) {
-		int i, r;
-		SYSCALL(r = ioctl(fd, VUIDGFORMAT, &i));
-    		if (r < 0) {
-		    found = FALSE;
-		}
-	    }
-	    close(fd);
-	    if (found == TRUE) {
-		if (*pproto != NULL) {
-		    *protocol = *pproto;
-		}
-		*device = *pdev;
-		return TRUE;
-	    }
-	}
-    }
-    return FALSE;
-}
-
-static const char *
-SetupAuto(InputInfoPtr pInfo, int *protoPara)
-{
-    const char *pdev = NULL;
-    const char *pproto = NULL;
-    MouseDevPtr pMse = pInfo->private;
-
-    if (pInfo->fd == -1) {
-	/* probe to find device/protocol to use */
-	if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
-	    /* Set the Device option. */
-	    pInfo->conf_idev->commonOptions =
-	     xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
-	    xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
-	      pInfo->name, pdev);
-	}
-    } else if (pMse->protocolID == PROT_AUTO) {
-	pdev = xf86CheckStrOption(pInfo->conf_idev->commonOptions, 
-		"Device", NULL);
-	solarisMouseAutoProbe(pInfo, &pproto, &pdev);
-    }
-    return pproto;
-}
-
-static const char *
-FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-    const char *pdev = NULL;
-    const char *pproto = protocol;
-
-    if (solarisMouseAutoProbe(pInfo, &pproto, &pdev) != FALSE) {
-	/* Set the Device option. */
-	pInfo->conf_idev->commonOptions =
-	  xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", pdev);
-	xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
-	  pInfo->name, pdev);
-    }
-    return pdev;
-}
-
-#else /* __SOL8__ || !__i386 */
-
-#undef MSE_MISC
-#define MSE_MISC 0
-
-#endif /* !__SOL8__ && __i386 */
-
-static int
-SupportedInterfaces(void)
-{
-    /* XXX This needs to be checked. */
-    return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_XPS2 | MSE_MISC;
-}
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-#if defined(__SOL8__) || !defined(__i386)
-    p->BuiltinNames = BuiltinNames;
-    p->CheckProtocol = CheckProtocol;
-    p->PreInit = sunMousePreInit;
-    p->DefaultProtocol = DefaultProtocol;
-    p->SetupAuto = SetupAuto;
-    p->FindDevice = FindDevice;
-#endif
-    return p;
-}
-
diff --git a/hw/xfree86/os-support/sysv/sysv_mouse.c b/hw/xfree86/os-support/sysv/sysv_mouse.c
deleted file mode 100644
index e620105..0000000
--- a/hw/xfree86/os-support/sysv/sysv_mouse.c
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/*
- * Copyright 1999 by The XFree86 Project, Inc.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-
-static int
-SupportedInterfaces(void)
-{
-    /* XXX Need to check this. */
-    return MSE_SERIAL | MSE_AUTO;
-}
-
-#ifndef ISC
-static const char *internalNames[] = {
-	NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
-    return internalNames;
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
-    int i;
-
-    for (i = 0; internalNames[i]; i++)
-	if (xf86NameCmp(protocol, internalNames[i]) == 0)
-	    return TRUE;
-    return FALSE;
-}
-#endif
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-    OSMouseInfoPtr p;
-
-    p = xcalloc(sizeof(OSMouseInfoRec), 1);
-    if (!p)
-	return NULL;
-    p->SupportedInterfaces = SupportedInterfaces;
-#ifndef ISC
-    p->BuiltinNames = BuiltinNames;
-    p->CheckProtocol = CheckProtocol;
-#endif
-    return p;
-}
-
diff --git a/hw/xfree86/os-support/usl/usl_mouse.c b/hw/xfree86/os-support/usl/usl_mouse.c
deleted file mode 100644
index aa4600f..0000000
--- a/hw/xfree86/os-support/usl/usl_mouse.c
+++ /dev/null
@@ -1,177 +0,0 @@
-
-/*
- * Copyright 2005 Kean Johnston
- * Copyright 1999 by The XFree86 Project, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of The XFree86 Project, Inc
- * and Kean Johnston not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * The XFree86 Project, Inc and Kean Johnston make no representations
- * about the suitability of this software for any purpose.  It is provided
- * "as is" without express or implied warranty.
- *
- * THE XFREE86 PROJECT, INC AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT
- * OR KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- *
- */
-
-#include "X.h"
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Xinput.h"
-#include "xf86OSmouse.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "mipointer.h"
-
-static int
-SupportedInterfaces(void)
-{
-  return MSE_MISC;
-}
-
-static const char *internalNames[] = {
-  NULL
-};
-
-static const char **
-BuiltinNames(void)
-{
-  return internalNames;
-}
-
-static const char *
-DefaultProtocol (void)
-{
-  return "OSMouse";
-}
-
-static Bool
-CheckProtocol(const char *protocol)
-{
-  int i;
-
-  for (i = 0; internalNames[i]; i++)
-    if (xf86NameCmp(protocol, internalNames[i]) == 0)
-      return TRUE;
-  return FALSE;
-}
-
-static int
-OsMouseProc(DeviceIntPtr pPointer, int what)
-{
-  InputInfoPtr pInfo;
-  MouseDevPtr pMse;
-  unsigned char map[9];
-  int ret;
- 
-  pInfo = pPointer->public.devicePrivate;
-  pMse = pInfo->private;
-  pMse->device = pPointer;
-
-  switch (what) {
-    case DEVICE_INIT: 
-      pPointer->public.on = FALSE;
-
-      for (ret = 0; ret <= 8; ret++)
-	map[ret] = ret;
-
-      InitPointerDeviceStruct((DevicePtr)pPointer, map, 8, 
-			      miPointerGetMotionEvents, pMse->Ctrl,
-			      miPointerGetMotionBufferSize());
-      /* X valuator */
-      xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
-      xf86InitValuatorDefaults(pPointer, 0);
-
-      /* Y valuator */
-      xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
-      xf86InitValuatorDefaults(pPointer, 1);
-
-      xf86MotionHistoryAllocate(pInfo);
-      break;
-
-    case DEVICE_ON:
-      pMse->lastButtons = 0;
-      pMse->emulateState = 0;
-      pPointer->public.on = TRUE;
-      XqMseOnOff (pInfo, 1);
-      break;
-      
-    case DEVICE_CLOSE:
-    case DEVICE_OFF:
-	pPointer->public.on = FALSE;
-	XqMseOnOff (pInfo, 0);
-	break;
-    }
-    return Success;
-}
-
-static Bool
-OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
-{
-  MouseDevPtr pMse;
-
-  pMse = pInfo->private;
-  pMse->protocol = protocol;
-  xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
-
-  /* Collect the options, and process the common options. */
-  xf86CollectInputOptions(pInfo, NULL, NULL);
-  xf86ProcessCommonOptions(pInfo, pInfo->options);
-
-  pInfo->fd = -1;
-#if 0
-  /* Make sure we can open the mouse */
-  pInfo->fd = open ("/dev/mouse", O_RDONLY | O_NONBLOCK);
-
-  if (pInfo->fd < 0) {
-    if (xf86GetAllowMouseOpenFail()) {
-      xf86Msg(X_WARNING, "%s: cannot open /dev/mouse (%s)\n",
-          pInfo->name, strerror(errno));
-    } else {
-      xf86Msg(X_ERROR, "%s: cannot open /dev/mouse (%s)\n",
-          pInfo->name, strerror(errno));
-      xfree(pMse);
-      return FALSE;
-    }
-  }
-#endif
-
-  /* Process common mouse options (like Emulate3Buttons, etc). */
-  pMse->CommonOptions(pInfo);
-
-  /* Setup the local procs. */
-  pInfo->device_control = OsMouseProc;
-  pInfo->read_input     = NULL;
-
-  pInfo->flags |= XI86_CONFIGURED;
-  return TRUE;
-}
-
-_X_EXPORT OSMouseInfoPtr
-xf86OSMouseInit(int flags)
-{
-  OSMouseInfoPtr p;
-
-  p = xcalloc(sizeof(OSMouseInfoRec), 1);
-  if (!p)
-    return NULL;
-
-  p->SupportedInterfaces = SupportedInterfaces;
-  p->BuiltinNames        = BuiltinNames;
-  p->DefaultProtocol     = DefaultProtocol;
-  p->CheckProtocol       = CheckProtocol;
-  p->PreInit             = OsMousePreInit;
-  return p;
-}
-
diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h
deleted file mode 100644
index 6006838..0000000
--- a/hw/xfree86/os-support/xf86OSmouse.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/* Public interface to OS-specific mouse support. */
-
-#ifndef _XF86OSMOUSE_H_
-#define _XF86OSMOUSE_H_
-
-#include "xf86Xinput.h"
-
-/* Mouse interface classes */
-#define MSE_NONE	0x00
-#define MSE_SERIAL	0x01		/* serial port */
-#define MSE_BUS		0x02		/* old bus mouse */
-#define MSE_PS2		0x04		/* standard read-only PS/2 */
-#define MSE_XPS2	0x08		/* extended PS/2 */
-#define MSE_AUTO	0x10		/* auto-detect (PnP) */
-#define MSE_MISC	0x20		/* The OS layer will identify the
-					 * specific protocol names that are
-					 * supported for this class. */
-
-/* Mouse Protocol IDs. */
-typedef enum {
-    PROT_UNKNOWN = -2,
-    PROT_UNSUP = -1,		/* protocol is not supported */
-    PROT_MS = 0,
-    PROT_MSC,
-    PROT_MM,
-    PROT_LOGI,
-    PROT_LOGIMAN,
-    PROT_MMHIT,
-    PROT_GLIDE,
-    PROT_IMSERIAL,
-    PROT_THINKING,
-    PROT_ACECAD,
-    PROT_VALUMOUSESCROLL,
-    PROT_PS2,
-    PROT_GENPS2,
-    PROT_IMPS2,
-    PROT_EXPPS2,
-    PROT_THINKPS2,
-    PROT_MMPS2,
-    PROT_GLIDEPS2,
-    PROT_NETPS2,
-    PROT_NETSCPS2,
-    PROT_BM,
-    PROT_AUTO,
-    PROT_SYSMOUSE,
-    PROT_NUMPROTOS	/* This must always be last. */
-} MouseProtocolID;
-
-struct _MouseDevRec;
-
-typedef int (*GetInterfaceTypesProc)(void);
-typedef const char **(*BuiltinNamesProc)(void);
-typedef Bool (*CheckProtocolProc)(const char *protocol);
-typedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
-				   int flags);
-typedef const char *(*DefaultProtocolProc)(void);
-typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
-typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
-			   int res);
-typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
-				      int flags);
-typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
-
-/*
- * OSMouseInfoRec is used to pass information from the OSMouse layer to the
- * OS-independent mouse driver.
- */
-typedef struct {
-	GetInterfaceTypesProc	SupportedInterfaces;
-	BuiltinNamesProc	BuiltinNames;
-	CheckProtocolProc	CheckProtocol;
-	BuiltinPreInitProc	PreInit;
-	DefaultProtocolProc	DefaultProtocol;
-	SetupAutoProc		SetupAuto;
-	SetResProc		SetPS2Res;
-	SetResProc		SetBMRes;
-	SetResProc		SetMiscRes;
-	FindDeviceProc		FindDevice;
-	GuessProtocolProc	GuessProtocol;
-} OSMouseInfoRec, *OSMouseInfoPtr;
-
-/*
- * SupportedInterfaces: Returns the mouse interface types that the OS support.
- *		If MSE_MISC is returned, then the BuiltinNames and
- *		CheckProtocol should be set.
- *
- * BuiltinNames: Returns the names of the protocols that are fully handled
- *		in the OS-specific code.  These are names that don't appear
- *		directly in the main "mouse" driver.
- *
- * CheckProtocol: Checks if the protocol name given is supported by the
- *		OS.  It should return TRUE for both "builtin" protocols and
- *		protocols of type MSE_MISC that are supported by the OS.
- *
- * PreInit:	The PreInit function for protocols that are builtin.  This
- *		function is passed the protocol name.
- *
- * DefaultProtocol: Returns the name of a default protocol that should be used
- *		for the OS when none has been supplied in the config file.
- *		This should only be set when there is a reasonable default.
- *
- * SetupAuto:	This function can be used to do OS-specific protocol
- *		auto-detection.  It returns the name of the detected protocol,
- *		or NULL when detection fails.  It may also adjust one or more
- *		of the "protoPara" values for the detected protocol by setting
- *		then to something other than -1.  SetupAuto gets called in two
- *		ways.  The first is before any devices have been opened.  This
- *		can be used when the protocol "Auto" always maps to a single
- *		protocol type.  The second is with the device open, allowing
- *		OS-specific probing to be done.
- *
- * SetPS2Res:	Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
- *		protocol types.
- *
- * SetBMRes:	Set the resolution and sample rate for MSE_BM protocol types.
- *
- * SetMiscRes:	Set the resolution and sample rate for MSE_MISC protocol types.
- *
- * FindDevice:	This function gets called when no Device has been specified
- *		in the config file.  OS-specific methods may be used to guess
- * 		which input device to use.  This function is called after the
- *		pre-open attempts at protocol discovery are done, but before
- * 		the device is open.  I.e., after the first SetupAuto() call,
- *		after the DefaultProtocol() call, but before the PreInit()
- *		call.  Available protocol information may be used in locating
- *		the default input device.
- *
- * GuessProtocol: A last resort attempt at guessing the mouse protocol by
- *		whatever OS-specific means might be available.  OS-independent
- *		things should be in the mouse driver.  This function gets
- *		called after the mouse driver's OS-independent methods have
- *		failed.
- */
-
-extern OSMouseInfoPtr xf86OSMouseInit(int flags);
-
-/* Adjust this when the mouse interface changes. */
-
-/*
- * History:
- *
- *  1.0.0 - Everything up to when versioning was started.
- *  1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
- *  1.2.0 - xisbscale added to MouseDevRec
- *
- */
-
-#define OS_MOUSE_VERSION_MAJOR 1
-#define OS_MOUSE_VERSION_MINOR 2
-#define OS_MOUSE_VERSION_PATCH 0
-
-#define OS_MOUSE_VERSION_CURRENT					\
-	BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR,	\
-					  OS_MOUSE_VERSION_MINOR,	\
-					  OS_MOUSE_VERSION_PATCH)
-
-#define HAVE_GUESS_PROTOCOL \
-	(xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
-                BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
-
-#define HAVE_FIND_DEVICE \
-	(xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
-                BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
-
-/* Z axis mapping */
-#define MSE_NOZMAP	0
-#define MSE_MAPTOX	-1
-#define MSE_MAPTOY	-2
-#define MSE_MAPTOZ	-3
-#define MSE_MAPTOW	-4
-
-/* Generalize for other axes. */
-#define MSE_NOAXISMAP	MSE_NOZMAP
-
-#define MSE_MAXBUTTONS	24
-#define MSE_DFLTBUTTONS	 3
-
-/*
- * Mouse device record.  This is shared by the mouse driver and the OSMouse
- * layer.
- */
-
-typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
-typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
-typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
-typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
-
-typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
-			      int dx, int dy, int dz, int dw);
-typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
-
-typedef struct _MouseDevRec {
-    PtrCtrlProcPtr	Ctrl;
-    PostMseEventProc	PostEvent;
-    MouseCommonOptProc	CommonOptions;
-    DeviceIntPtr	device;
-    const char *	mseDevice;
-    const char *	protocol;
-    MouseProtocolID	protocolID;
-    MouseProtocolID	oldProtocolID; /* hack */
-    int			class;
-    int			mseModel;
-    int			baudRate;
-    int			oldBaudRate;
-    int			sampleRate;
-    int			lastButtons;
-    int			threshold;	/* acceleration */
-    int			num;
-    int			den;
-    int			buttons;	/* # of buttons */
-    int			emulateState;	/* automata state for 2 button mode */
-    Bool		emulate3Buttons;
-    Bool		emulate3ButtonsSoft;
-    int			emulate3Timeout;/* Timeout for 3 button emulation */
-    Bool		chordMiddle;
-    Bool                flipXY;
-    int                 invX;
-    int                 invY;
-    int			mouseFlags;	/* Flags to Clear after opening
-					 * mouse dev */
-    int			truebuttons;	/* (not used)
-					 * Arg to maintain before
-					 * emulate3buttons timer callback */
-    int			resolution;
-    int			negativeZ;	/* button mask */
-    int			positiveZ;	/* button mask */
-    int			negativeW;	/* button mask */
-    int			positiveW;	/* button mask */
-    pointer		buffer;		/* usually an XISBuffer* */
-    int			protoBufTail;
-    unsigned char	protoBuf[8];
-    unsigned char	protoPara[8];
-    unsigned char	inSync;		/* driver in sync with datastream */
-    pointer		mousePriv;	/* private area */
-    InputInfoPtr	pInfo;
-    int			origProtocolID;
-    const char *	origProtocol;
-    Bool		emulate3Pending;/* timer waiting */
-    CARD32		emulate3Expires;/* time to fire emulation code */
-    Bool		emulateWheel;
-    int			wheelInertia;
-    int			wheelButton;
-    int			negativeX;	/* Button values.  Unlike the Z and */
-    int			positiveX;	/* W equivalents, these are button  */
-    int			negativeY;	/* values rather than button masks. */
-    int			positiveY;
-    int			wheelYDistance;
-    int			wheelXDistance;
-    Bool		autoProbe;
-    checkMovementsProc  checkMovements;
-    autoProbeProc	autoProbeMouse;
-    collectDataProc	collectData;
-    dataGoodProc	dataGood;
-    int			angleOffset;
-    pointer		pDragLock;	/* drag lock area */
-    int			xisbscale;	/* buffer size for 1 event */
-    int			wheelButtonTimeout;/* Timeout for the wheel button emulation */
-    CARD32		wheelButtonExpires;
-    int			doubleClickSourceButtonMask;
-    int			doubleClickTargetButton;
-    int			doubleClickTargetButtonMask;
-    int			doubleClickOldSourceState;
-    int			lastMappedButtons;
-    int			buttonMap[MSE_MAXBUTTONS];
-} MouseDevRec, *MouseDevPtr;
-
-#endif /* _XF86OSMOUSE_H_ */
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index aba4758..5a0a128 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -299,10 +299,6 @@
 # include <sys/types.h>
 # include <assert.h>
 
-#ifdef __GNU__ /* GNU/Hurd */
-# define USE_OSMOUSE
-#endif
-
 # ifdef __linux__
 #  include <termio.h>
 # else /* __GLIBC__ */
@@ -553,8 +549,6 @@ extern int errno;
 #  define LED_SCR 0x01
 
 # define POSIX_TTY
-# define OSMOUSE_ONLY
-# define MOUSE_PROTOCOL_IN_KERNEL
 
 #define TIOCM_DTR       0x0001            /* data terminal ready */
 #define TIOCM_RTS       0x0002            /* request to send */
@@ -665,12 +659,6 @@ double RInt(
 #define VT_SYSREQ_DEFAULT FALSE
 #endif
 
-#ifdef OSMOUSE_ONLY
-# ifndef MOUSE_PROTOCOL_IN_KERNEL
-#  define MOUSE_PROTOCOL_IN_KERNEL
-# endif
-#endif
-
 #define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
 
 #define XF86_OS_PRIVS
commit d0de5ea96d084fc5da87d8f323ddfc08fe9c03ba
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jun 25 17:56:28 2008 +0300

    XFree86: Remove useless debugging code
    
    Also remove documentation which told you how to use a non-module-aware
    GDB, albeit only with old, non-shared, modules.

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 7c78129..e2e62cd 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -5,10 +5,6 @@ if XORG_BUS_SPARC
 SBUS_SOURCES = xf86sbusBus.c
 endif
 
-if DEBUG
-DEBUGSOURCES = xf86Debug.c
-endif
-
 if XV
 XVSOURCES = xf86xv.c xf86xvmc.c
 XVSDKINCS = xf86xv.h xf86xvmc.h
@@ -37,8 +33,7 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
                       xf86Helper.c xf86PM.c xf86RAC.c \
                       xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c \
-                      $(XVSOURCES) $(BUSSOURCES) $(DEBUGSOURCES) \
-		      $(XISOURCES) $(RANDRSOURCES)
+                      $(XVSOURCES) $(BUSSOURCES) $(XISOURCES) $(RANDRSOURCES)
 nodist_libcommon_la_SOURCES = xf86DefModeSet.c
 libinit_a_SOURCES = xf86Build.h xf86Init.c
 
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 70b32b9..5d4ea9a 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -341,22 +341,6 @@ Bool xf86IsUnblank(int mode);
 _X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module);
 _X_DEPRECATED void xf86DeleteModuleInfo(int idx);
 
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
-CARD8  xf86PeekFb8(CARD8  *p);
-CARD16 xf86PeekFb16(CARD16 *p);
-CARD32 xf86PeekFb32(CARD32 *p);
-void xf86PokeFb8(CARD8  *p, CARD8  v);
-void xf86PokeFb16(CARD16 *p, CARD16 v);
-void xf86PokeFb32(CARD16 *p, CARD32 v);
-CARD8  xf86PeekMmio8(pointer Base, unsigned long Offset);
-CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
-CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
-void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8  v);
-void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
-void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
-#endif
-
 /* xf86Init.c */
 
 PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c
deleted file mode 100644
index 5b60965..0000000
--- a/hw/xfree86/common/xf86Debug.c
+++ /dev/null
@@ -1,77 +0,0 @@
-
-/*
- * Copyright (c) 2000-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <sys/time.h>
-#include <unistd.h> 
-#include <X11/X.h>
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "compiler.h"
-
-CARD8  xf86PeekFb8(CARD8  *p) { return *p; }
-CARD16 xf86PeekFb16(CARD16 *p) { return *p; }
-CARD32 xf86PeekFb32(CARD32 *p) { return *p; }
-void xf86PokeFb8(CARD8  *p, CARD8  v) { *p = v; }
-void xf86PokeFb16(CARD16 *p, CARD16 v) { *p = v; }
-void xf86PokeFb32(CARD16 *p, CARD32 v) { *p = v; }
-
-CARD8  xf86PeekMmio8(pointer Base, unsigned long Offset)
-{
-    return MMIO_IN8(Base,Offset);
-}
-
-CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset)
-{
-    return MMIO_IN16(Base,Offset);
-}
-
-CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset)
-{
-    return MMIO_IN32(Base,Offset);
-}
-
-void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8  v)
-{
-    MMIO_OUT8(Base,Offset,v);
-}
-
-void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v)
-{
-    MMIO_OUT16(Base,Offset,v);
-}
-
-void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v)
-{
-    MMIO_OUT32(Base,Offset,v);
-}
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index fc94284..8cd7c54 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -1090,14 +1090,6 @@ typedef void (*InputHandlerProc)(int fd, pointer data);
 #define CLK_REG_SAVE		-1
 #define CLK_REG_RESTORE		-2
 
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
-typedef struct {
-    long sec;
-    long usec;
-} xf86TsRec, *xf86TsPtr;
-#endif
-
 /*
  * misc constants
  */
diff --git a/hw/xfree86/doc/devel/DebuggingHints b/hw/xfree86/doc/devel/DebuggingHints
deleted file mode 100644
index 300fe48..0000000
--- a/hw/xfree86/doc/devel/DebuggingHints
+++ /dev/null
@@ -1,192 +0,0 @@
-
-                        Xserver Debugging
-                        =================
-
-This file is  intended to collect helpful hints  on Xserver debugging.
-I merely outline my experiences  here. Somebody else might have better
-methods on  doing it. This person  is therefore invited  to share this
-experience with the rest of the world by adding it here.
-
-Paul Flinders has made some patches to gdb to add support for loadable
-modules.  This version  of gdb  is currently  available as  binary for
-Linux/x86 on Paul's web site:
-
-         www.dawa.demon.co.uk/xfree-gdb
-
-This web-site also contains the patches to gdb 4.18 so you may port it
-to other platforms.
-
-It  loads  the module  symbols  and  supports  all gdb  features  like
-breakpointing, disassembling  and single  stepping. It also  shows the
-exact location of a signal 11. Paul  has fixed the code so that all of
-this is  working even  if using modules  compiled without -g.  You can
-find his latest version on his web site.
-
-If no module aware gdb is available the following hints might help:
-
-1. Use remote  login. This  can be done  thru a network  connection or
-   simply by  connecting a serial  console. This enables you  to watch
-   the  Xservers output while  running set  breakpoints with  gdb etc.
-   Don't even try  to run the Xserver from  a system console. Whenever
-   something  happens gdb  waits for  input. However  the  Xserver has
-   locked the system console  including the keyboard, therefore you'll
-   never  be able  to send  any  input to  gdb. Even  if your  process
-   doesn't crash or you haven't set any breakpoints a vt switch can be
-   hazardous: When doing vt switching a signal is sent; unless you did
-         
-   gdb> handle SIGUSR1 nostop
-
-   gdb waits  for you to continue  the program which  cannot happen as
-   you don't have access to gdb's console.
-
-2. You can  compile any source  file with debugging symbols  to obtain
-   more information  about where an  error occurred. Simply go  to the
-   directory which holds the corresponding object file and do:
-            
-   # rm <file>.o
-   # xc/config/util/makeg.sh <file>.o
-
-   After  relinking the server  or module  gdb is  able to  obtain the
-   necessary debugging information and will show the exact line in the
-   source  where the error ccurred. See also:
-   xc/config/util/makeg.man.
-
-3. In some cases it might be  useful to have the assembler output of a
-   compiled source file. This can be obtained by doing:
-    
-   # make <file>.s
-   
-   or 
- 
-   # xc/config/util/makeg.sh <file>.s
-
-   Make will use exactly the same rules it uses for building *.o files.
-
-4. In some cases it might be useful to set breakpoints in modules.  If
-   no module  aware gdb is available you  should add a call  to one of
-   the three dummy breakpoint functions
-
-   xf86Break1(), xf86Break2() and xf86Break3()
-
-   to the source  file and recompile the module. You  now just have to
-   set  a  breakpoint  onto  the appropriate  dummy  functions.  These
-   functions are located in the  core part of the server and therefore
-   will be available any time.
-
-5. Without module support gdb is  not able to print the function where
-   an error occurred in a module.
-
-     If you get a line like:
-
-   (gdb) bt
-   #0  0x823b4f5 in ?? ()
-   ....
-
-   You may obtain the function the address belongs to by calling 
-   LoaderPrintSymbol():
-
-   (gdb) call LoaderPrintSymbol(0x823b4f5)
-
-   The symbol  returned might not always  be the name  of the function
-   which contains the address. In  case of static functions the symbol
-   is not known to  the loader. However LoaderPrintSymbol() will print
-   the nearest known  function and the offset from  its start. You may
-   easily find the exact location of the address if you do:
-
-   # objdump --disassemble <file>.o
-
-   <file>.o is the name of the object file containing the symbol printed.
-
-6. Locating static  symbols in modules is  simpler if the  module is a
-   single object  file instead  of a library.  Such a object  file can
-   easily  be build  from  a  library: #  mkdir  tmp #  cd  tmp; ar  x
-   module-path/<libname>.a # ld -r *.o -o module-path/<name>.o
-   
-   When calling  LoaderPrintSymbol() the closes public  symbol will be
-   printed together with  the offset from the symbol's  address.  If a
-   static symbol comes before the  first public symbol in a module The
-   following trick may help:
-
-   create a file 1-<name>.c in tmp/
-   containing:
-   void Dummy-<name>() {}
-    
-   Compile it:
-
-   # gcc -c 1-<name>.c
-
-   and do the link step above.
-
-   This way  Dummy-<name>() will be  the first public function  in the
-   module.   All  addresses in  static  function  can  now be  printed
-   relatively to this address if no other public function comes before
-   this static one.
-
-7. In some situations it is  quite helpful to add debugging symbols to
-   the binary.  This can  be done per  object file. Simply  remove the
-   object file and do
-
-   # makeg
-
-   When looking  for a bug  in a module  these debugging infos  can be
-   very helpful:  Calling LoaderPrintSymbol() as  described above will
-   return a  function and an offset  giving the exact  location of the
-   address  with   respect  to   this  function  entry   point.   When
-   disassembling an  object file with debugging symbols:  # objdump -d
-   -l <file>.o one will  receive a disassembled output containing line
-   number  information. Thus  one can  locate the  exact line  of code
-   where the error occurred.
-
-8. To quickly trace the value of a variable declared in a module three
-   dummy variables have been added to the core part:
-
-   CARD32 xf86DummyVar1;
-   CARD32 xf86DummyVar2;
-   CARD32 xf86DummyVar3;
-
-   The variable can  be assigned to one of them. One  can then use gdb
-   to return the value of this variable:
-
-   gdb> p /x xf86DummyVar1
-
-9. Sometimes it might be useful to check how the preprocessor replaced
-   symbols. One can  obtain a preprocessed version of  the source file
-   by doing:
-
-   make <filename>.i
-
-   This will generate a preprocessed source in <filename>.i.
-
-10. xfree() can catch  if one tries to free a  memory range twice. You
-    will get the message:
-
-       Xalloc error: range already freed in Xrealloc() :-(
-
-  To  find  the  location  from  which  xfree()  was  called  one  can
-  breakpoint on XfreeTrap(). The backtrace should show the origin of the
-  call this call. 
-
-11. To access mapped physical  memory the following functions might be
-    useful.  
-
-    These may be used to  access physical memory that was mapped using
-    the flags VIDMEM_FRAMEBUFFER or VIDMEM_MMIO32:
-
-      CARD8  xf86PeekFb8(CARD8  *p);
-      CARD16 xf86PeekFb16(CARD16 *p);
-      CARD32 xf86PeekFb32(CARD32 *p);
-      void xf86PokeFb8(CARD8  *p, CARD8  v);
-      void xf86PokeFb16(CARD16 *p, CARD16 v);
-      void xf86PokeFb32(CARD16 *p, CARD32 v);
-
-    Physical memory which was  mapped by setting VIDMEM_MMIO should be
-    accessed using the following.  Here  the base address to which the
-    memory is mapped and the offset are required separately.
-
-      CARD8  xf86PeekMmio8(pointer Base, unsigned long Offset);
-      CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
-      CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
-      void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8  v);
-      void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
-      void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
-
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index e78ba33..3085996 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -684,14 +684,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(DPMSSet)
     SYMFUNC(DPMSSupported)
 #endif
-/* xf86Debug.c */
-#ifdef BUILDDEBUG
-    SYMFUNC(xf86Break1)
-    SYMFUNC(xf86Break2)
-    SYMFUNC(xf86Break3)
-    SYMFUNC(xf86SPTimestamp)
-    SYMFUNC(xf86STimestamp)
-#endif
 
     SYMFUNC(pciTag)
     SYMFUNC(pciBusAddrToHostAddr)
commit 4b1273c9c2da113f634be80caa28e81df3beae98
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jun 25 17:51:12 2008 +0300

    XFree86: Delete empty file & function
    
    xf86InitXkb() has been empty for as long as I can remember.

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am
index 82c51b4..7c78129 100644
--- a/hw/xfree86/common/Makefile.am
+++ b/hw/xfree86/common/Makefile.am
@@ -14,7 +14,6 @@ XVSOURCES = xf86xv.c xf86xvmc.c
 XVSDKINCS = xf86xv.h xf86xvmc.h
 endif
 
-XKBSOURCES = xf86XKB.c
 XISOURCES = xf86Xinput.c xisb.c
 XISDKINCS = xf86Xinput.h xisb.h
 RANDRSOURCES = xf86RandR.c
@@ -38,8 +37,8 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \
                       xf86VidMode.c xf86fbman.c xf86cmap.c \
                       xf86Helper.c xf86PM.c xf86RAC.c \
                       xf86Mode.c xf86Build.h xorgHelper.c xf86Versions.c \
-                      $(XVSOURCES) $(BUSSOURCES) $(XKBSOURCES) \
-                      $(DEBUGSOURCES) $(XISOURCES) $(RANDRSOURCES)
+                      $(XVSOURCES) $(BUSSOURCES) $(DEBUGSOURCES) \
+		      $(XISOURCES) $(RANDRSOURCES)
 nodist_libcommon_la_SOURCES = xf86DefModeSet.c
 libinit_a_SOURCES = xf86Build.h xf86Init.c
 
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index b954c77..5cd5248 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1047,9 +1047,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	}
     }
 
-#ifdef XKB
-    xf86InitXkb();
-#endif
     /* set up the proper access funcs */
     xf86PostPreInit();
 
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 60d0bf3..8c64a54 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -180,10 +180,6 @@ int xf86SetVerbosity(int verb);
 int xf86SetLogVerbosity(int verb);
 Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only );
 
-/* xf86XKB.c */
-
-void xf86InitXkb(void);
-
 /* xf86Xinput.c */
 extern EventList *xf86Events;
 
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
deleted file mode 100644
index 1169454..0000000
--- a/hw/xfree86/common/xf86XKB.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/************************************************************
-Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
-
-Permission to use, copy, modify, and distribute this
-software and its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright
-notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be 
-used in advertising or publicity pertaining to distribution 
-of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability 
-of this software for any purpose. It is provided "as is"
-without any express or implied warranty.
-
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
-AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-/*
- * Copyright (c) 1994-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdio.h>
-#define	NEED_EVENTS 1
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/keysym.h>
-#include "inputstr.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include <X11/extensions/XI.h>
-
-#include "compiler.h"
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#define XF86_OS_PRIVS
-#include "xf86_OSlib.h"
-
-#include <xkbsrv.h>
-
-void
-xf86InitXkb(void)
-{
-}
commit 3a54f3f48fa1c0d60604c3ee767c569b5ec23430
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Thu Jun 12 01:05:04 2008 +0300

    XFree86: Clean up init a tiny bit (no code changes)
    
    Reshuffle and delete.

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 8839adb..b954c77 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -93,12 +93,6 @@
 #include "xf86Bus.h"
 
 /* forward declarations */
-
-static void xf86PrintBanner(void);
-static void xf86PrintMarkers(void);
-static void xf86PrintDefaultModulePath(void);
-static void xf86PrintDefaultLibraryPath(void);
-
 static Bool probe_devices_from_device_sections(DriverPtr drvp);
 static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
 static Bool check_for_matching_devices(DriverPtr drvp);
@@ -127,6 +121,130 @@ static int numFormats = 6;
 #endif
 static Bool formatsDone = FALSE;
 
+#ifndef OSNAME
+#define OSNAME " unknown"
+#endif
+#ifndef OSVENDOR
+#define OSVENDOR ""
+#endif
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XORG_VERSION_SNAP
+#endif
+
+static void
+xf86PrintBanner()
+{
+#if PRE_RELEASE
+  ErrorF("\n"
+    "This is a pre-release version of the X server from " XVENDORNAME ".\n"
+    "It is not supported in any way.\n"
+    "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
+    "Select the \"xorg\" product for bugs you find in this release.\n"
+    "Before reporting bugs in pre-release versions please check the\n"
+    "latest version in the X.Org Foundation git repository.\n"
+    "See http://wiki.x.org/wiki/GitPage for git access instructions.\n");
+#endif
+  ErrorF("\nX.Org X Server %d.%d.%d",
+	 XORG_VERSION_MAJOR,
+	 XORG_VERSION_MINOR,
+	 XORG_VERSION_PATCH);
+#if XORG_VERSION_SNAP > 0
+  ErrorF(".%d", XORG_VERSION_SNAP);
+#endif
+
+#if XORG_VERSION_SNAP >= 900
+  /* When the minor number is 99, that signifies that the we are making
+   * a release candidate for a major version.  (X.0.0)
+   * When the patch number is 99, that signifies that the we are making
+   * a release candidate for a minor version.  (X.Y.0)
+   * When the patch number is < 99, then we are making a release
+   * candidate for the next point release.  (X.Y.Z)
+   */
+#if XORG_VERSION_MINOR >= 99
+  ErrorF(" (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, XORG_VERSION_SNAP - 900);
+#elif XORG_VERSION_PATCH == 99
+  ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1,
+				XORG_VERSION_SNAP - 900);
+#else
+  ErrorF(" (%d.%d.%d RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR,
+ 			 XORG_VERSION_PATCH + 1, XORG_VERSION_SNAP - 900);
+#endif
+#endif
+
+#ifdef XORG_CUSTOM_VERSION
+  ErrorF(" (%s)", XORG_CUSTOM_VERSION);
+#endif
+#ifndef XORG_DATE
+#define XORG_DATE XF86_DATE
+#endif
+  ErrorF("\nRelease Date: %s\n", XORG_DATE);
+  ErrorF("X Protocol Version %d, Revision %d\n",
+         X_PROTOCOL, X_PROTOCOL_REVISION);
+  ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
+#ifdef HAS_UTSNAME
+  {
+    struct utsname name;
+
+    /* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX,
+       and Irix) and Single Unix Spec 3 just say that non-negative is success.
+       All agree that failure is represented by a negative number.
+     */
+    if (uname(&name) >= 0) {
+      ErrorF("Current Operating System: %s %s %s %s %s\n",
+	name.sysname, name.nodename, name.release, name.version, name.machine);
+    }
+  }
+#endif
+#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
+  {
+    struct tm t;
+    char buf[100];
+
+    bzero(&t, sizeof(t));
+    bzero(buf, sizeof(buf));
+    t.tm_mday = BUILD_DATE % 100;
+    t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
+    t.tm_year = BUILD_DATE / 10000 - 1900;
+#if defined(BUILD_TIME)
+    t.tm_sec = BUILD_TIME % 100;
+    t.tm_min = (BUILD_TIME / 100) % 100;
+    t.tm_hour = (BUILD_TIME / 10000) % 100;
+    if (strftime(buf, sizeof(buf), "%d %B %Y  %I:%M:%S%p", &t))
+       ErrorF("Build Date: %s\n", buf);
+#else
+    if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
+       ErrorF("Build Date: %s\n", buf);
+#endif
+  }
+#endif
+#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
+  {
+    struct tm t;
+    char buf[100];
+
+    bzero(&t, sizeof(t));
+    bzero(buf, sizeof(buf));
+    t.tm_mday = CLOG_DATE % 100;
+    t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
+    t.tm_year = CLOG_DATE / 10000 - 1900;
+    if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
+       ErrorF("Changelog Date: %s\n", buf);
+  }
+#endif
+#if defined(BUILDERSTRING)
+  ErrorF("%s \n",BUILDERSTRING);
+#endif
+  ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n"
+	 "\tto make sure that you have the latest version.\n");
+  ErrorF("Module Loader present\n");
+}
+
+static void
+xf86PrintMarkers()
+{
+  LogPrintMarkers();
+}
+
 static Bool
 xf86CreateRootWindow(WindowPtr pWin)
 {
@@ -448,6 +566,7 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
     return foundScreen;
 }
 
+
 /*
  * InitOutput --
  *	Initialize screenInfo for all actually accessible framebuffers.
@@ -959,34 +1078,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	xf86EnableIO();
   }
 
-#if 0
-  /*
-   * Install signal handler for unexpected signals
-   */
-  xf86Info.caughtSignal=FALSE;
-  if (!xf86Info.notrapSignals)
-  {
-     signal(SIGSEGV,xf86SigHandler);
-     signal(SIGILL,xf86SigHandler);
-#ifdef SIGEMT
-     signal(SIGEMT,xf86SigHandler);
-#endif
-     signal(SIGFPE,xf86SigHandler);
-#ifdef SIGBUS
-     signal(SIGBUS,xf86SigHandler);
-#endif
-#ifdef SIGSYS
-     signal(SIGSYS,xf86SigHandler);
-#endif
-#ifdef SIGXCPU
-     signal(SIGXCPU,xf86SigHandler);
-#endif
-#ifdef SIGXFSZ
-     signal(SIGXFSZ,xf86SigHandler);
-#endif
-  }
-#endif
-
   /*
    * Use the previously collected parts to setup pScreenInfo
    */
@@ -1028,7 +1119,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 #endif /* SCO325 */
 
   for (i = 0; i < xf86NumScreens; i++) {
-   	xf86EnableAccess(xf86Screens[i]);
+	xf86EnableAccess(xf86Screens[i]);
 	/*
 	 * Almost everything uses these defaults, and many of those that
 	 * don't, will wrap them.
@@ -1105,8 +1196,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 
 void
 InitInput(argc, argv)
-     int     	  argc;
-     char    	  **argv;
+     int	  argc;
+     char	  **argv;
 {
     IDevPtr* pDev;
     InputDriverPtr pDrv;
@@ -1156,10 +1247,6 @@ InitInput(argc, argv)
     mieqInit();
 }
 
-#ifndef SET_STDERR_NONBLOCKING
-#define SET_STDERR_NONBLOCKING 1
-#endif
-
 /*
  * OsVendorInit --
  *      OS/Vendor-specific initialisations.  Called from OsInit(), which
@@ -1178,7 +1265,6 @@ OsVendorInit()
   if (!beenHere)
     xf86LogInit();
 
-#if SET_STDERR_NONBLOCKING
         /* Set stderr to non-blocking. */
 #ifndef O_NONBLOCK
 #if defined(FNDELAY)
@@ -1186,7 +1272,6 @@ OsVendorInit()
 #elif defined(O_NDELAY)
 #define O_NONBLOCK O_NDELAY
 #endif
-#endif
 
 #ifdef O_NONBLOCK
   if (!beenHere) {
@@ -1236,9 +1321,6 @@ ddxGiveUp()
 	xf86Screens[i]->busAccess = NULL;
     }
 
-#ifdef USE_XF86_SERVERLOCK
-    xf86UnlockServer();
-#endif
 #ifdef XFreeXDGA
     DGAShutdown();
 #endif
@@ -1333,6 +1415,18 @@ xf86SetLogVerbosity(int verb)
     return save;
 }
 
+static void
+xf86PrintDefaultModulePath(void)
+{
+  ErrorF("%s\n", DEFAULT_MODULE_PATH);
+}
+
+static void
+xf86PrintDefaultLibraryPath(void)
+{
+  ErrorF("%s\n", DEFAULT_LIBRARY_PATH);
+}
+
 /*
  * ddxProcessArgument --
  *	Process device-dependent command line args. Returns 0 if argument is
@@ -1341,8 +1435,6 @@ xf86SetLogVerbosity(int verb)
  *
  */
 
-
-
 /* ARGSUSED */
 int
 ddxProcessArgument(int argc, char **argv, int i)
@@ -1747,142 +1839,6 @@ ddxUseMsg()
 }
 
 
-#ifndef OSNAME
-#define OSNAME " unknown"
-#endif
-#ifndef OSVENDOR
-#define OSVENDOR ""
-#endif
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XORG_VERSION_SNAP
-#endif
-
-static void
-xf86PrintBanner()
-{
-#if PRE_RELEASE
-  ErrorF("\n"
-    "This is a pre-release version of the X server from " XVENDORNAME ".\n"
-    "It is not supported in any way.\n"
-    "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n"
-    "Select the \"xorg\" product for bugs you find in this release.\n"
-    "Before reporting bugs in pre-release versions please check the\n"
-    "latest version in the X.Org Foundation git repository.\n"
-    "See http://wiki.x.org/wiki/GitPage for git access instructions.\n");
-#endif
-  ErrorF("\nX.Org X Server %d.%d.%d",
-	 XORG_VERSION_MAJOR,
-	 XORG_VERSION_MINOR,
-	 XORG_VERSION_PATCH);
-#if XORG_VERSION_SNAP > 0
-  ErrorF(".%d", XORG_VERSION_SNAP);
-#endif
-
-#if XORG_VERSION_SNAP >= 900
-  /* When the minor number is 99, that signifies that the we are making
-   * a release candidate for a major version.  (X.0.0)
-   * When the patch number is 99, that signifies that the we are making
-   * a release candidate for a minor version.  (X.Y.0)
-   * When the patch number is < 99, then we are making a release
-   * candidate for the next point release.  (X.Y.Z)
-   */
-#if XORG_VERSION_MINOR >= 99
-  ErrorF(" (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, XORG_VERSION_SNAP - 900);
-#elif XORG_VERSION_PATCH == 99
-  ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1,
-				XORG_VERSION_SNAP - 900);
-#else
-  ErrorF(" (%d.%d.%d RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR,
- 			 XORG_VERSION_PATCH + 1, XORG_VERSION_SNAP - 900);
-#endif
-#endif
-
-#ifdef XORG_CUSTOM_VERSION
-  ErrorF(" (%s)", XORG_CUSTOM_VERSION);
-#endif
-#ifndef XORG_DATE
-#define XORG_DATE XF86_DATE
-#endif
-  ErrorF("\nRelease Date: %s\n", XORG_DATE);
-  ErrorF("X Protocol Version %d, Revision %d\n",
-         X_PROTOCOL, X_PROTOCOL_REVISION);
-  ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR);
-#ifdef HAS_UTSNAME
-  {
-    struct utsname name;
-
-    /* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX,
-       and Irix) and Single Unix Spec 3 just say that non-negative is success.
-       All agree that failure is represented by a negative number.
-     */
-    if (uname(&name) >= 0) {
-      ErrorF("Current Operating System: %s %s %s %s %s\n",
-	name.sysname, name.nodename, name.release, name.version, name.machine);
-    }
-  }
-#endif
-#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
-  {
-    struct tm t;
-    char buf[100];
-
-    bzero(&t, sizeof(t));
-    bzero(buf, sizeof(buf));
-    t.tm_mday = BUILD_DATE % 100;
-    t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
-    t.tm_year = BUILD_DATE / 10000 - 1900;
-#if defined(BUILD_TIME)
-    t.tm_sec = BUILD_TIME % 100;
-    t.tm_min = (BUILD_TIME / 100) % 100;
-    t.tm_hour = (BUILD_TIME / 10000) % 100;
-    if (strftime(buf, sizeof(buf), "%d %B %Y  %I:%M:%S%p", &t))
-       ErrorF("Build Date: %s\n", buf);
-#else
-    if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
-       ErrorF("Build Date: %s\n", buf);
-#endif
-  }
-#endif
-#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
-  {
-    struct tm t;
-    char buf[100];
-
-    bzero(&t, sizeof(t));
-    bzero(buf, sizeof(buf));
-    t.tm_mday = CLOG_DATE % 100;
-    t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
-    t.tm_year = CLOG_DATE / 10000 - 1900;
-    if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
-       ErrorF("Changelog Date: %s\n", buf);
-  }
-#endif
-#if defined(BUILDERSTRING)
-  ErrorF("%s \n",BUILDERSTRING);
-#endif
-  ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n"
-	 "\tto make sure that you have the latest version.\n");
-  ErrorF("Module Loader present\n");
-}
-
-static void
-xf86PrintMarkers()
-{
-  LogPrintMarkers();
-}
-
-static void
-xf86PrintDefaultModulePath(void)
-{
-  ErrorF("%s\n", DEFAULT_MODULE_PATH);
-}
-
-static void
-xf86PrintDefaultLibraryPath(void)
-{
-  ErrorF("%s\n", DEFAULT_LIBRARY_PATH);
-}
-
 /*
  * xf86LoadModules iterates over a list that is being passed in.
  */
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index a29f22c..60d0bf3 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -180,12 +180,6 @@ int xf86SetVerbosity(int verb);
 int xf86SetLogVerbosity(int verb);
 Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only );
 
-/* xf86Lock.c */
-
-#ifdef USE_XF86_SERVERLOCK
-void xf86UnlockServer(void);
-#endif
-
 /* xf86XKB.c */
 
 void xf86InitXkb(void);
commit ddcefb50dda9e398647d1c84c7153127ed26a4d2
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jun 11 15:14:26 2008 +0300

    XFree86: Remove trailing whitespace

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 38248f6..8839adb 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -174,10 +174,10 @@ xf86CreateRootWindow(WindowPtr pWin)
 					pProp->size, pProp->data,
 					FALSE);
 	}
-      
+
       /* Look at err */
       ret &= (err==Success);
-      
+
     } else {
       xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with "
 	      "non-root window %p (parent %p)\n",
@@ -247,7 +247,7 @@ probe_devices_from_device_sections(DriverPtr drvp)
 	iter = pci_id_match_iterator_create(NULL);
 	while ((pPci = pci_device_next(iter)) != NULL) {
 	    if (devList[i]->busID && *devList[i]->busID) {
-		if (xf86ComparePciBusString(devList[i]->busID, 
+		if (xf86ComparePciBusString(devList[i]->busID,
 					    ((pPci->domain << 8)
 					     | pPci->bus),
 					    pPci->dev,
@@ -294,7 +294,7 @@ probe_devices_from_device_sections(DriverPtr drvp)
 		ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
 		       drvp->driverName, pPci->bus, pPci->dev, pPci->func);
 #endif
-	
+
 		/* Allocate an entry in the lists to be returned */
 		entry = xf86ClaimPciSlot(pPci, drvp, device_id,
 					  devList[i], devList[i]->active);
@@ -314,7 +314,7 @@ probe_devices_from_device_sections(DriverPtr drvp)
 			}
 		    }
 		}
-		
+
 		if (entry != -1) {
 		    if ((*drvp->PciProbe)(drvp, entry, pPci,
 					  devices[j].match_data)) {
@@ -327,7 +327,7 @@ probe_devices_from_device_sections(DriverPtr drvp)
 	}
     }
 
-	
+
     return foundScreen;
 }
 
@@ -353,7 +353,7 @@ add_matching_devices_to_configure_list(DriverPtr drvp)
 		 && ((devices[j].device_class_mask & pPci->device_class)
 		     == devices[j].device_class) ) {
 		if (xf86CheckPciSlot(pPci)) {
-		    GDevPtr pGDev = 
+		    GDevPtr pGDev =
 		      xf86AddDeviceToConfigure(drvp->driverName, pPci, -1);
 		    if (pGDev != NULL) {
 			/* After configure pass 1, chipID and chipRev are
@@ -388,11 +388,11 @@ check_for_matching_devices(DriverPtr drvp)
     for (j = 0; ! END_OF_MATCHES(devices[j]); j++) {
 	struct pci_device_iterator *iter;
 	struct pci_device *dev;
-	
+
 	iter = pci_id_match_iterator_create(& devices[j]);
 	dev = pci_device_next(iter);
 	pci_iterator_destroy(iter);
-	
+
 	if (dev != NULL) {
 	    return TRUE;
 	}
@@ -411,9 +411,9 @@ check_for_matching_devices(DriverPtr drvp)
  * is found, it is called.  If \c DriverRec::PciProbe or no devices can be
  * successfully probed with it (e.g., only non-PCI devices are available),
  * the driver's \c DriverRec::Probe function is called.
- * 
+ *
  * \param drv   Driver to probe
- * 
+ *
  * \return
  * If a device can be successfully probed by the driver, \c TRUE is
  * returned.  Otherwise, \c FALSE is returned.
@@ -441,7 +441,7 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
     if ( ! foundScreen && (drv->Probe != NULL) ) {
 	xf86Msg( X_WARNING, "Falling back to old probe method for %s\n",
 		 drv->driverName );
-	foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT 
+	foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT
 				     : PROBE_DEFAULT );
     }
 
@@ -466,7 +466,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
   Bool			 pix24Fail = FALSE;
   Bool			 autoconfig = FALSE;
   GDevPtr		 configured_device;
-  
+
   xf86Initialising = TRUE;
 
   if (serverGeneration == 1) {
@@ -641,7 +641,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 		|| !xf86DriverList[i]->driverFunc(NULL,
 						 GET_REQUIRED_HW_INTERFACES,
 						  &flags)
-		|| NEED_IO_ENABLED(flags)) 
+		|| NEED_IO_ENABLED(flags))
 		continue;
 	}
 
@@ -677,7 +677,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	   layout++) {
 	  Bool found = FALSE;
 	  for (j = 0; j < xf86Screens[i]->numEntities; j++) {
-	
+
 	      GDevPtr dev =
 		xf86GetDevFromEntity(xf86Screens[i]->entityList[j],
 				     xf86Screens[i]->entityInstanceList[j]);
@@ -735,7 +735,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
      * Call the driver's PreInit()'s to complete initialisation for the first
      * generation.
      */
-    
+
     for (i = 0; i < xf86NumScreens; i++) {
 	xf86EnableAccess(xf86Screens[i]);
 	if (xf86Screens[i]->PreInit &&
@@ -745,7 +745,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     for (i = 0; i < xf86NumScreens; i++)
 	if (!xf86Screens[i]->configured)
 	    xf86DeleteScreen(i--, 0);
-    
+
     /*
      * If no screens left, return now.
      */
@@ -906,12 +906,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	FatalError("Unable to make VT property - out of memory. Exiting...\n");
       }
       *VT = xf86Info.vtno;
-    
+
       VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE);
 
       for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) {
 	ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex,
-					     VTAtom, XA_INTEGER, 32, 
+					     VTAtom, XA_INTEGER, 32,
 					     1, VT );
 	if (ret != Success)
 	  xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING,
@@ -935,7 +935,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     xf86PostPreInit();
 
     AddCallback(&ServerGrabCallback, xf86GrabServerCallback, NULL);
-    
+
   } else {
     /*
      * serverGeneration != 1; some OSs have to do things here, too.
@@ -1000,7 +1000,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     pScreenInfo->formats[i] = formats[i];
 
   /* Make sure the server's VT is active */
-    
+
   if (serverGeneration != 1) {
     xf86Resetting = TRUE;
     /* All screens are in the same state, so just check the first */
@@ -1010,7 +1010,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 #endif
       xf86AccessEnter();
       xf86EnterServerState(SETUP);
-    } 
+    }
   }
 #ifdef SCO325
   else {
@@ -1027,7 +1027,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
   }
 #endif /* SCO325 */
 
-  for (i = 0; i < xf86NumScreens; i++) {    
+  for (i = 0; i < xf86NumScreens; i++) {
    	xf86EnableAccess(xf86Screens[i]);
 	/*
 	 * Almost everything uses these defaults, and many of those that
@@ -1036,7 +1036,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
 	xf86Screens[i]->SetDGAMode = xf86SetDGAMode;
 	xf86Screens[i]->DPMSSet = NULL;
-	xf86Screens[i]->LoadPalette = NULL; 
+	xf86Screens[i]->LoadPalette = NULL;
 	xf86Screens[i]->SetOverscan = NULL;
 	xf86Screens[i]->DriverFunc = NULL;
 	xf86Screens[i]->pScreen = NULL;
@@ -1071,7 +1071,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 #ifdef RENDER
     if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown)
     {
-	xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); 
+	xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC);
 	PictureSetSubpixelOrder (xf86Screens[i]->pScreen,
 				 DDC ?
 				 (DDC->features.input_type ?
@@ -1287,9 +1287,9 @@ AbortDDX()
 	      (xf86Screens[i]->LeaveVT)(i, 0);
 	  }
   }
-  
+
   xf86AccessLeave();
-  
+
   /*
    * This is needed for an abnormal server exit, since the normal exit stuff
    * MUST also be performed (i.e. the vt must be left in a defined state)
@@ -1358,7 +1358,7 @@ ddxProcessArgument(int argc, char **argv, int i)
       UseMsg(); 							\
       FatalError("Required argument to %s not specified\n", argv[i]);	\
     }
-  
+
   /* First the options that are only allowed for root */
   if (getuid() == 0 || geteuid() != 0)
   {
@@ -1595,11 +1595,11 @@ ddxProcessArgument(int argc, char **argv, int i)
       return 0;
     }
   }
-  if (!strcmp(argv[i], "-gamma")  || !strcmp(argv[i], "-rgamma") || 
+  if (!strcmp(argv[i], "-gamma")  || !strcmp(argv[i], "-rgamma") ||
       !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma"))
   {
     double gamma;
-    CHECK_FOR_REQUIRED_ARGUMENT();    
+    CHECK_FOR_REQUIRED_ARGUMENT();
     if (sscanf(argv[++i], "%lf", &gamma) == 1) {
        if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) {
 	  ErrorF("gamma out of range, only  %.2f <= gamma_value <= %.1f"
@@ -1634,7 +1634,7 @@ ddxProcessArgument(int argc, char **argv, int i)
   }
   if (!strcmp(argv[i], "-keyboard"))
   {
-    CHECK_FOR_REQUIRED_ARGUMENT();    
+    CHECK_FOR_REQUIRED_ARGUMENT();
     xf86KeyboardName = argv[++i];
     return 2;
   }
@@ -1885,7 +1885,7 @@ xf86PrintDefaultLibraryPath(void)
 
 /*
  * xf86LoadModules iterates over a list that is being passed in.
- */             
+ */
 Bool
 xf86LoadModules(char **list, pointer *optlist)
 {
@@ -1956,7 +1956,7 @@ xf86GetPixFormat(ScrnInfoPtr pScrn, int depth)
 	    return &format;
 	}
     }
-	
+
     for (i = 0; i < numFormats; i++)
 	if (formats[i].depth == depth)
 	   break;
@@ -1978,11 +1978,10 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth)
 {
     PixmapFormatPtr format;
 
-   
+
     format = xf86GetPixFormat(pScrn, depth);
     if (format)
 	return format->bitsPerPixel;
     else
 	return 0;
 }
-
commit e6f35f28fb3526b911101bde4aa761de8b055aef
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jun 11 15:13:21 2008 +0300

    OS/KDrive/XFree86: Sanitise colour initialisation
    
    OsInitColors always just returned TRUE, so just remove calls to it and
    insane special-case logic.  Remove unused kcolor.c implementation, and
    merge oscolor.h into oscolor.c since it was the only user.  Remove
    open-coded strncasecmp in oscolor.c.
    
    Since we no longer need to call OsInitColors after reading the config
    file, just call PostConfigInit() from one place, and move PM handling to
    one place so we can install the signal handlers earlier.

diff --git a/hw/kdrive/src/kcolor.c b/hw/kdrive/src/kcolor.c
deleted file mode 100644
index 31af5c3..0000000
--- a/hw/kdrive/src/kcolor.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission.  Keith Packard makes no
- * representations about the suitability of this software for any purpose.  It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <kdrive-config.h>
-#endif
-#include "kdrive.h"
-#include <stdio.h>
-#include "os.h"
-#include "opaque.h"
-#include <X11/keysym.h>
-
-unsigned char
-KdToLower (unsigned char a)
-{
-    if ((a >= XK_A) && (a <= XK_Z))
-	return a + (XK_a - XK_A);
-    else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis))
-	return a + (XK_agrave - XK_Agrave);
-    else if ((a >= XK_Ooblique) && (a <= XK_Thorn))
-	return a + (XK_oslash - XK_Ooblique);
-    else
-	return a;
-}
-
-int
-KdStrCaseCmp (const unsigned char *s1, const unsigned char *s2, int l2)
-{
-    unsigned char   c1, c2;
-
-    for (;;)
-    {
-	c1 = KdToLower (*s1++);
-	if (l2 == 0)
-	    c2 = '\0';
-	else
-	    c2 = KdToLower (*s2++);
-	if (!c1 || !c2)
-	    break;
-	if (c1 != c2)
-	    break;
-	l2--;
-    }
-    return c2 - c1;
-}
-
-typedef struct _kdNamedColor {
-    unsigned short	red;
-    unsigned short	green;
-    unsigned short	blue;
-    const unsigned char	*name;
-} KdNamedColor;
-
-#define C   0x101
-
-const KdNamedColor KdColors[] = {
-  { 240*C, 248*C, 255*C, "alice blue" },
-  { 240*C, 248*C, 255*C, "AliceBlue" },
-  { 250*C, 235*C, 215*C, "antique white" },
-  { 250*C, 235*C, 215*C, "AntiqueWhite" },
-  { 255*C, 239*C, 219*C, "AntiqueWhite1" },
-  { 238*C, 223*C, 204*C, "AntiqueWhite2" },
-  { 205*C, 192*C, 176*C, "AntiqueWhite3" },
-  { 139*C, 131*C, 120*C, "AntiqueWhite4" },
-  { 127*C, 255*C, 212*C, "aquamarine" },
-  { 127*C, 255*C, 212*C, "aquamarine1" },
-  { 118*C, 238*C, 198*C, "aquamarine2" },
-  { 102*C, 205*C, 170*C, "aquamarine3" },
-  {  69*C, 139*C, 116*C, "aquamarine4" },
-  { 240*C, 255*C, 255*C, "azure" },
-  { 240*C, 255*C, 255*C, "azure1" },
-  { 224*C, 238*C, 238*C, "azure2" },
-  { 193*C, 205*C, 205*C, "azure3" },
-  { 131*C, 139*C, 139*C, "azure4" },
-  { 245*C, 245*C, 220*C, "beige" },
-  { 255*C, 228*C, 196*C, "bisque" },
-  { 255*C, 228*C, 196*C, "bisque1" },
-  { 238*C, 213*C, 183*C, "bisque2" },
-  { 205*C, 183*C, 158*C, "bisque3" },
-  { 139*C, 125*C, 107*C, "bisque4" },
-  {   0*C,   0*C,   0*C, "black" },
-  { 255*C, 235*C, 205*C, "blanched almond" },
-  { 255*C, 235*C, 205*C, "BlanchedAlmond" },
-  {   0*C,   0*C, 255*C, "blue" },
-  { 138*C,  43*C, 226*C, "blue violet" },
-  {   0*C,   0*C, 255*C, "blue1" },
-  {   0*C,   0*C, 238*C, "blue2" },
-  {   0*C,   0*C, 205*C, "blue3" },
-  {   0*C,   0*C, 139*C, "blue4" },
-  { 138*C,  43*C, 226*C, "BlueViolet" },
-  { 165*C,  42*C,  42*C, "brown" },
-  { 255*C, 64*C, 64*C, "brown1" },
-  { 238*C, 59*C, 59*C, "brown2" },
-  { 205*C, 51*C, 51*C, "brown3" },
-  { 139*C, 35*C, 35*C, "brown4" },
-  { 222*C, 184*C, 135*C, "burlywood" },
-  { 255*C, 211*C, 155*C, "burlywood1" },
-  { 238*C, 197*C, 145*C, "burlywood2" },
-  { 205*C, 170*C, 125*C, "burlywood3" },
-  { 139*C, 115*C, 85*C, "burlywood4" },
-  {  95*C, 158*C, 160*C, "cadet blue" },
-  {  95*C, 158*C, 160*C, "CadetBlue" },
-  { 152*C, 245*C, 255*C, "CadetBlue1" },
-  { 142*C, 229*C, 238*C, "CadetBlue2" },
-  { 122*C, 197*C, 205*C, "CadetBlue3" },
-  {  83*C, 134*C, 139*C, "CadetBlue4" },
-  { 127*C, 255*C,   0*C, "chartreuse" },
-  { 127*C, 255*C, 0*C, "chartreuse1" },
-  { 118*C, 238*C, 0*C, "chartreuse2" },
-  { 102*C, 205*C, 0*C, "chartreuse3" },
-  { 69*C, 139*C, 0*C, "chartreuse4" },
-  { 210*C, 105*C,  30*C, "chocolate" },
-  { 255*C, 127*C, 36*C, "chocolate1" },
-  { 238*C, 118*C, 33*C, "chocolate2" },
-  { 205*C, 102*C, 29*C, "chocolate3" },
-  { 139*C, 69*C, 19*C, "chocolate4" },
-  { 255*C, 127*C,  80*C, "coral" },
-  { 255*C, 114*C, 86*C, "coral1" },
-  { 238*C, 106*C, 80*C, "coral2" },
-  { 205*C, 91*C, 69*C, "coral3" },
-  { 139*C, 62*C, 47*C, "coral4" },
-  { 100*C, 149*C, 237*C, "cornflower blue" },
-  { 100*C, 149*C, 237*C, "CornflowerBlue" },
-  { 255*C, 248*C, 220*C, "cornsilk" },
-  { 255*C, 248*C, 220*C, "cornsilk1" },
-  { 238*C, 232*C, 205*C, "cornsilk2" },
-  { 205*C, 200*C, 177*C, "cornsilk3" },
-  { 139*C, 136*C, 120*C, "cornsilk4" },
-  {   0*C, 255*C, 255*C, "cyan" },
-  {   0*C, 255*C, 255*C, "cyan1" },
-  {   0*C, 238*C, 238*C, "cyan2" },
-  {   0*C, 205*C, 205*C, "cyan3" },
-  {   0*C, 139*C, 139*C, "cyan4" },
-  { 0*C,   0*C, 139*C, "dark blue" },
-  { 0*C, 139*C, 139*C, "dark cyan" },
-  { 184*C, 134*C,  11*C, "dark goldenrod" },
-  { 169*C, 169*C, 169*C, "dark gray" },
-  {   0*C, 100*C,   0*C, "dark green" },
-  { 169*C, 169*C, 169*C, "dark grey" },
-  { 189*C, 183*C, 107*C, "dark khaki" },
-  { 139*C,   0*C, 139*C, "dark magenta" },
-  {  85*C, 107*C,  47*C, "dark olive green" },
-  { 255*C, 140*C,   0*C, "dark orange" },
-  { 153*C,  50*C, 204*C, "dark orchid" },
-  { 139*C,   0*C,   0*C, "dark red" },
-  { 233*C, 150*C, 122*C, "dark salmon" },
-  { 143*C, 188*C, 143*C, "dark sea green" },
-  {  72*C,  61*C, 139*C, "dark slate blue" },
-  {  47*C,  79*C,  79*C, "dark slate gray" },
-  {  47*C,  79*C,  79*C, "dark slate grey" },
-  {   0*C, 206*C, 209*C, "dark turquoise" },
-  { 148*C,   0*C, 211*C, "dark violet" },
-  { 0*C,   0*C, 139*C, "DarkBlue" },
-  { 0*C, 139*C, 139*C, "DarkCyan" },
-  { 184*C, 134*C,  11*C, "DarkGoldenrod" },
-  { 255*C, 185*C, 15*C, "DarkGoldenrod1" },
-  { 238*C, 173*C, 14*C, "DarkGoldenrod2" },
-  { 205*C, 149*C, 12*C, "DarkGoldenrod3" },
-  { 139*C, 101*C, 8*C, "DarkGoldenrod4" },
-  { 169*C, 169*C, 169*C, "DarkGray" },
-  {   0*C, 100*C,   0*C, "DarkGreen" },
-  { 169*C, 169*C, 169*C, "DarkGrey" },
-  { 189*C, 183*C, 107*C, "DarkKhaki" },
-  { 139*C,   0*C, 139*C, "DarkMagenta" },
-  {  85*C, 107*C,  47*C, "DarkOliveGreen" },
-  { 202*C, 255*C, 112*C, "DarkOliveGreen1" },
-  { 188*C, 238*C, 104*C, "DarkOliveGreen2" },
-  { 162*C, 205*C, 90*C, "DarkOliveGreen3" },
-  { 110*C, 139*C, 61*C, "DarkOliveGreen4" },
-  { 255*C, 140*C,   0*C, "DarkOrange" },
-  { 255*C, 127*C, 0*C, "DarkOrange1" },
-  { 238*C, 118*C, 0*C, "DarkOrange2" },
-  { 205*C, 102*C, 0*C, "DarkOrange3" },
-  { 139*C, 69*C,  0*C, "DarkOrange4" },
-  { 153*C,  50*C, 204*C, "DarkOrchid" },
-  { 191*C,  62*C, 255*C, "DarkOrchid1" },
-  { 178*C,  58*C, 238*C, "DarkOrchid2" },
-  { 154*C,  50*C, 205*C, "DarkOrchid3" },
-  { 104*C,  34*C, 139*C, "DarkOrchid4" },
-  { 139*C,   0*C,   0*C, "DarkRed" },
-  { 233*C, 150*C, 122*C, "DarkSalmon" },
-  { 143*C, 188*C, 143*C, "DarkSeaGreen" },
-  { 193*C, 255*C, 193*C, "DarkSeaGreen1" },
-  { 180*C, 238*C, 180*C, "DarkSeaGreen2" },
-  { 155*C, 205*C, 155*C, "DarkSeaGreen3" },
-  { 105*C, 139*C, 105*C, "DarkSeaGreen4" },
-  {  72*C,  61*C, 139*C, "DarkSlateBlue" },
-  {  47*C,  79*C,  79*C, "DarkSlateGray" },
-  { 151*C, 255*C, 255*C, "DarkSlateGray1" },
-  { 141*C, 238*C, 238*C, "DarkSlateGray2" },
-  { 121*C, 205*C, 205*C, "DarkSlateGray3" },
-  {  82*C, 139*C, 139*C, "DarkSlateGray4" },
-  {  47*C,  79*C,  79*C, "DarkSlateGrey" },
-  {   0*C, 206*C, 209*C, "DarkTurquoise" },
-  { 148*C,   0*C, 211*C, "DarkViolet" },
-  { 255*C,  20*C, 147*C, "deep pink" },
-  {   0*C, 191*C, 255*C, "deep sky blue" },
-  { 255*C,  20*C, 147*C, "DeepPink" },
-  { 255*C,  20*C, 147*C, "DeepPink1" },
-  { 238*C,  18*C, 137*C, "DeepPink2" },
-  { 205*C,  16*C, 118*C, "DeepPink3" },
-  { 139*C, 10*C, 80*C, "DeepPink4" },
-  {   0*C, 191*C, 255*C, "DeepSkyBlue" },
-  {   0*C, 191*C, 255*C, "DeepSkyBlue1" },
-  {   0*C, 178*C, 238*C, "DeepSkyBlue2" },
-  {   0*C, 154*C, 205*C, "DeepSkyBlue3" },
-  {   0*C, 104*C, 139*C, "DeepSkyBlue4" },
-  { 105*C, 105*C, 105*C, "dim gray" },
-  { 105*C, 105*C, 105*C, "dim grey" },
-  { 105*C, 105*C, 105*C, "DimGray" },
-  { 105*C, 105*C, 105*C, "DimGrey" },
-  {  30*C, 144*C, 255*C, "dodger blue" },
-  {  30*C, 144*C, 255*C, "DodgerBlue" },
-  {  30*C, 144*C, 255*C, "DodgerBlue1" },
-  {  28*C, 134*C, 238*C, "DodgerBlue2" },
-  {  24*C, 116*C, 205*C, "DodgerBlue3" },
-  {  16*C,  78*C, 139*C, "DodgerBlue4" },
-  { 178*C,  34*C,  34*C, "firebrick" },
-  { 255*C, 48*C, 48*C, "firebrick1" },
-  { 238*C, 44*C, 44*C, "firebrick2" },
-  { 205*C, 38*C, 38*C, "firebrick3" },
-  { 139*C, 26*C, 26*C, "firebrick4" },
-  { 255*C, 250*C, 240*C, "floral white" },
-  { 255*C, 250*C, 240*C, "FloralWhite" },
-  {  34*C, 139*C,  34*C, "forest green" },
-  {  34*C, 139*C,  34*C, "ForestGreen" },
-  { 220*C, 220*C, 220*C, "gainsboro" },
-  { 248*C, 248*C, 255*C, "ghost white" },
-  { 248*C, 248*C, 255*C, "GhostWhite" },
-  { 255*C, 215*C,   0*C, "gold" },
-  { 255*C, 215*C, 0*C, "gold1" },
-  { 238*C, 201*C, 0*C, "gold2" },
-  { 205*C, 173*C, 0*C, "gold3" },
-  { 139*C, 117*C, 0*C, "gold4" },
-  { 218*C, 165*C,  32*C, "goldenrod" },
-  { 255*C, 193*C, 37*C, "goldenrod1" },
-  { 238*C, 180*C, 34*C, "goldenrod2" },
-  { 205*C, 155*C, 29*C, "goldenrod3" },
-  { 139*C, 105*C, 20*C, "goldenrod4" },
-  { 190*C, 190*C, 190*C, "gray" },
-  {   0*C,   0*C,   0*C, "gray0" },
-  {   3*C,   3*C,   3*C, "gray1" },
-  {  26*C,  26*C,  26*C, "gray10" },
-  { 255*C, 255*C, 255*C, "gray100" },
-  {  28*C,  28*C,  28*C, "gray11" },
-  {  31*C,  31*C,  31*C, "gray12" },
-  {  33*C,  33*C,  33*C, "gray13" },
-  {  36*C,  36*C,  36*C, "gray14" },
-  {  38*C,  38*C,  38*C, "gray15" },
-  {  41*C,  41*C,  41*C, "gray16" },
-  {  43*C,  43*C,  43*C, "gray17" },
-  {  46*C,  46*C,  46*C, "gray18" },
-  {  48*C,  48*C,  48*C, "gray19" },
-  {   5*C,   5*C,   5*C, "gray2" },
-  {  51*C,  51*C,  51*C, "gray20" },
-  {  54*C,  54*C,  54*C, "gray21" },
-  {  56*C,  56*C,  56*C, "gray22" },
-  {  59*C,  59*C,  59*C, "gray23" },
-  {  61*C,  61*C,  61*C, "gray24" },
-  {  64*C,  64*C,  64*C, "gray25" },
-  {  66*C,  66*C,  66*C, "gray26" },
-  {  69*C,  69*C,  69*C, "gray27" },
-  {  71*C,  71*C,  71*C, "gray28" },
-  {  74*C,  74*C,  74*C, "gray29" },
-  {   8*C,   8*C,   8*C, "gray3" },
-  {  77*C,  77*C,  77*C, "gray30" },
-  {  79*C,  79*C,  79*C, "gray31" },
-  {  82*C,  82*C,  82*C, "gray32" },
-  {  84*C,  84*C,  84*C, "gray33" },
-  {  87*C,  87*C,  87*C, "gray34" },
-  {  89*C,  89*C,  89*C, "gray35" },
-  {  92*C,  92*C,  92*C, "gray36" },
-  {  94*C,  94*C,  94*C, "gray37" },
-  {  97*C,  97*C,  97*C, "gray38" },
-  {  99*C,  99*C,  99*C, "gray39" },
-  {  10*C,  10*C,  10*C, "gray4" },
-  { 102*C, 102*C, 102*C, "gray40" },
-  { 105*C, 105*C, 105*C, "gray41" },
-  { 107*C, 107*C, 107*C, "gray42" },
-  { 110*C, 110*C, 110*C, "gray43" },
-  { 112*C, 112*C, 112*C, "gray44" },
-  { 115*C, 115*C, 115*C, "gray45" },
-  { 117*C, 117*C, 117*C, "gray46" },
-  { 120*C, 120*C, 120*C, "gray47" },
-  { 122*C, 122*C, 122*C, "gray48" },
-  { 125*C, 125*C, 125*C, "gray49" },
-  {  13*C,  13*C,  13*C, "gray5" },
-  { 127*C, 127*C, 127*C, "gray50" },
-  { 130*C, 130*C, 130*C, "gray51" },
-  { 133*C, 133*C, 133*C, "gray52" },
-  { 135*C, 135*C, 135*C, "gray53" },
-  { 138*C, 138*C, 138*C, "gray54" },
-  { 140*C, 140*C, 140*C, "gray55" },
-  { 143*C, 143*C, 143*C, "gray56" },
-  { 145*C, 145*C, 145*C, "gray57" },
-  { 148*C, 148*C, 148*C, "gray58" },
-  { 150*C, 150*C, 150*C, "gray59" },
-  {  15*C,  15*C,  15*C, "gray6" },
-  { 153*C, 153*C, 153*C, "gray60" },
-  { 156*C, 156*C, 156*C, "gray61" },
-  { 158*C, 158*C, 158*C, "gray62" },
-  { 161*C, 161*C, 161*C, "gray63" },
-  { 163*C, 163*C, 163*C, "gray64" },
-  { 166*C, 166*C, 166*C, "gray65" },
-  { 168*C, 168*C, 168*C, "gray66" },
-  { 171*C, 171*C, 171*C, "gray67" },
-  { 173*C, 173*C, 173*C, "gray68" },
-  { 176*C, 176*C, 176*C, "gray69" },
-  {  18*C,  18*C,  18*C, "gray7" },
-  { 179*C, 179*C, 179*C, "gray70" },
-  { 181*C, 181*C, 181*C, "gray71" },
-  { 184*C, 184*C, 184*C, "gray72" },
-  { 186*C, 186*C, 186*C, "gray73" },
-  { 189*C, 189*C, 189*C, "gray74" },
-  { 191*C, 191*C, 191*C, "gray75" },
-  { 194*C, 194*C, 194*C, "gray76" },
-  { 196*C, 196*C, 196*C, "gray77" },
-  { 199*C, 199*C, 199*C, "gray78" },
-  { 201*C, 201*C, 201*C, "gray79" },
-  {  20*C,  20*C,  20*C, "gray8" },
-  { 204*C, 204*C, 204*C, "gray80" },
-  { 207*C, 207*C, 207*C, "gray81" },
-  { 209*C, 209*C, 209*C, "gray82" },
-  { 212*C, 212*C, 212*C, "gray83" },
-  { 214*C, 214*C, 214*C, "gray84" },
-  { 217*C, 217*C, 217*C, "gray85" },
-  { 219*C, 219*C, 219*C, "gray86" },
-  { 222*C, 222*C, 222*C, "gray87" },
-  { 224*C, 224*C, 224*C, "gray88" },
-  { 227*C, 227*C, 227*C, "gray89" },
-  {  23*C,  23*C,  23*C, "gray9" },
-  { 229*C, 229*C, 229*C, "gray90" },
-  { 232*C, 232*C, 232*C, "gray91" },
-  { 235*C, 235*C, 235*C, "gray92" },
-  { 237*C, 237*C, 237*C, "gray93" },
-  { 240*C, 240*C, 240*C, "gray94" },
-  { 242*C, 242*C, 242*C, "gray95" },
-  { 245*C, 245*C, 245*C, "gray96" },
-  { 247*C, 247*C, 247*C, "gray97" },
-  { 250*C, 250*C, 250*C, "gray98" },
-  { 252*C, 252*C, 252*C, "gray99" },
-  {   0*C, 255*C,   0*C, "green" },
-  { 173*C, 255*C,  47*C, "green yellow" },
-  { 0*C, 255*C, 0*C, "green1" },
-  { 0*C, 238*C, 0*C, "green2" },
-  { 0*C, 205*C, 0*C, "green3" },
-  { 0*C, 139*C, 0*C, "green4" },
-  { 173*C, 255*C,  47*C, "GreenYellow" },
-  { 190*C, 190*C, 190*C, "grey" },
-  {   0*C,   0*C,   0*C, "grey0" },
-  {   3*C,   3*C,   3*C, "grey1" },
-  {  26*C,  26*C,  26*C, "grey10" },
-  { 255*C, 255*C, 255*C, "grey100" },
-  {  28*C,  28*C,  28*C, "grey11" },
-  {  31*C,  31*C,  31*C, "grey12" },
-  {  33*C,  33*C,  33*C, "grey13" },
-  {  36*C,  36*C,  36*C, "grey14" },
-  {  38*C,  38*C,  38*C, "grey15" },
-  {  41*C,  41*C,  41*C, "grey16" },
-  {  43*C,  43*C,  43*C, "grey17" },
-  {  46*C,  46*C,  46*C, "grey18" },
-  {  48*C,  48*C,  48*C, "grey19" },
-  {   5*C,   5*C,   5*C, "grey2" },
-  {  51*C,  51*C,  51*C, "grey20" },
-  {  54*C,  54*C,  54*C, "grey21" },
-  {  56*C,  56*C,  56*C, "grey22" },
-  {  59*C,  59*C,  59*C, "grey23" },
-  {  61*C,  61*C,  61*C, "grey24" },
-  {  64*C,  64*C,  64*C, "grey25" },
-  {  66*C,  66*C,  66*C, "grey26" },
-  {  69*C,  69*C,  69*C, "grey27" },
-  {  71*C,  71*C,  71*C, "grey28" },
-  {  74*C,  74*C,  74*C, "grey29" },
-  {   8*C,   8*C,   8*C, "grey3" },
-  {  77*C,  77*C,  77*C, "grey30" },
-  {  79*C,  79*C,  79*C, "grey31" },
-  {  82*C,  82*C,  82*C, "grey32" },
-  {  84*C,  84*C,  84*C, "grey33" },
-  {  87*C,  87*C,  87*C, "grey34" },
-  {  89*C,  89*C,  89*C, "grey35" },
-  {  92*C,  92*C,  92*C, "grey36" },
-  {  94*C,  94*C,  94*C, "grey37" },
-  {  97*C,  97*C,  97*C, "grey38" },
-  {  99*C,  99*C,  99*C, "grey39" },
-  {  10*C,  10*C,  10*C, "grey4" },
-  { 102*C, 102*C, 102*C, "grey40" },
-  { 105*C, 105*C, 105*C, "grey41" },
-  { 107*C, 107*C, 107*C, "grey42" },
-  { 110*C, 110*C, 110*C, "grey43" },
-  { 112*C, 112*C, 112*C, "grey44" },
-  { 115*C, 115*C, 115*C, "grey45" },
-  { 117*C, 117*C, 117*C, "grey46" },
-  { 120*C, 120*C, 120*C, "grey47" },
-  { 122*C, 122*C, 122*C, "grey48" },
-  { 125*C, 125*C, 125*C, "grey49" },
-  {  13*C,  13*C,  13*C, "grey5" },
-  { 127*C, 127*C, 127*C, "grey50" },
-  { 130*C, 130*C, 130*C, "grey51" },
-  { 133*C, 133*C, 133*C, "grey52" },
-  { 135*C, 135*C, 135*C, "grey53" },
-  { 138*C, 138*C, 138*C, "grey54" },
-  { 140*C, 140*C, 140*C, "grey55" },
-  { 143*C, 143*C, 143*C, "grey56" },
-  { 145*C, 145*C, 145*C, "grey57" },
-  { 148*C, 148*C, 148*C, "grey58" },
-  { 150*C, 150*C, 150*C, "grey59" },
-  {  15*C,  15*C,  15*C, "grey6" },
-  { 153*C, 153*C, 153*C, "grey60" },
-  { 156*C, 156*C, 156*C, "grey61" },
-  { 158*C, 158*C, 158*C, "grey62" },
-  { 161*C, 161*C, 161*C, "grey63" },
-  { 163*C, 163*C, 163*C, "grey64" },
-  { 166*C, 166*C, 166*C, "grey65" },
-  { 168*C, 168*C, 168*C, "grey66" },
-  { 171*C, 171*C, 171*C, "grey67" },
-  { 173*C, 173*C, 173*C, "grey68" },
-  { 176*C, 176*C, 176*C, "grey69" },
-  {  18*C,  18*C,  18*C, "grey7" },
-  { 179*C, 179*C, 179*C, "grey70" },
-  { 181*C, 181*C, 181*C, "grey71" },
-  { 184*C, 184*C, 184*C, "grey72" },
-  { 186*C, 186*C, 186*C, "grey73" },
-  { 189*C, 189*C, 189*C, "grey74" },
-  { 191*C, 191*C, 191*C, "grey75" },
-  { 194*C, 194*C, 194*C, "grey76" },
-  { 196*C, 196*C, 196*C, "grey77" },
-  { 199*C, 199*C, 199*C, "grey78" },
-  { 201*C, 201*C, 201*C, "grey79" },
-  {  20*C,  20*C,  20*C, "grey8" },
-  { 204*C, 204*C, 204*C, "grey80" },
-  { 207*C, 207*C, 207*C, "grey81" },
-  { 209*C, 209*C, 209*C, "grey82" },
-  { 212*C, 212*C, 212*C, "grey83" },
-  { 214*C, 214*C, 214*C, "grey84" },
-  { 217*C, 217*C, 217*C, "grey85" },
-  { 219*C, 219*C, 219*C, "grey86" },
-  { 222*C, 222*C, 222*C, "grey87" },
-  { 224*C, 224*C, 224*C, "grey88" },
-  { 227*C, 227*C, 227*C, "grey89" },
-  {  23*C,  23*C,  23*C, "grey9" },
-  { 229*C, 229*C, 229*C, "grey90" },
-  { 232*C, 232*C, 232*C, "grey91" },
-  { 235*C, 235*C, 235*C, "grey92" },
-  { 237*C, 237*C, 237*C, "grey93" },
-  { 240*C, 240*C, 240*C, "grey94" },
-  { 242*C, 242*C, 242*C, "grey95" },
-  { 245*C, 245*C, 245*C, "grey96" },
-  { 247*C, 247*C, 247*C, "grey97" },
-  { 250*C, 250*C, 250*C, "grey98" },
-  { 252*C, 252*C, 252*C, "grey99" },
-  { 240*C, 255*C, 240*C, "honeydew" },
-  { 240*C, 255*C, 240*C, "honeydew1" },
-  { 224*C, 238*C, 224*C, "honeydew2" },
-  { 193*C, 205*C, 193*C, "honeydew3" },
-  { 131*C, 139*C, 131*C, "honeydew4" },
-  { 255*C, 105*C, 180*C, "hot pink" },
-  { 255*C, 105*C, 180*C, "HotPink" },
-  { 255*C, 110*C, 180*C, "HotPink1" },
-  { 238*C, 106*C, 167*C, "HotPink2" },
-  { 205*C,  96*C, 144*C, "HotPink3" },
-  { 139*C,  58*C,  98*C, "HotPink4" },
-  { 205*C,  92*C,  92*C, "indian red" },
-  { 205*C,  92*C,  92*C, "IndianRed" },
-  { 255*C, 106*C, 106*C, "IndianRed1" },
-  { 238*C, 99*C, 99*C, "IndianRed2" },
-  { 205*C, 85*C, 85*C, "IndianRed3" },
-  { 139*C, 58*C, 58*C, "IndianRed4" },
-  { 255*C, 255*C, 240*C, "ivory" },
-  { 255*C, 255*C, 240*C, "ivory1" },
-  { 238*C, 238*C, 224*C, "ivory2" },
-  { 205*C, 205*C, 193*C, "ivory3" },
-  { 139*C, 139*C, 131*C, "ivory4" },
-  { 240*C, 230*C, 140*C, "khaki" },
-  { 255*C, 246*C, 143*C, "khaki1" },
-  { 238*C, 230*C, 133*C, "khaki2" },
-  { 205*C, 198*C, 115*C, "khaki3" },
-  { 139*C, 134*C, 78*C, "khaki4" },
-  { 230*C, 230*C, 250*C, "lavender" },
-  { 255*C, 240*C, 245*C, "lavender blush" },
-  { 255*C, 240*C, 245*C, "LavenderBlush" },
-  { 255*C, 240*C, 245*C, "LavenderBlush1" },
-  { 238*C, 224*C, 229*C, "LavenderBlush2" },
-  { 205*C, 193*C, 197*C, "LavenderBlush3" },
-  { 139*C, 131*C, 134*C, "LavenderBlush4" },
-  { 124*C, 252*C,   0*C, "lawn green" },
-  { 124*C, 252*C,   0*C, "LawnGreen" },
-  { 255*C, 250*C, 205*C, "lemon chiffon" },
-  { 255*C, 250*C, 205*C, "LemonChiffon" },
-  { 255*C, 250*C, 205*C, "LemonChiffon1" },
-  { 238*C, 233*C, 191*C, "LemonChiffon2" },
-  { 205*C, 201*C, 165*C, "LemonChiffon3" },
-  { 139*C, 137*C, 112*C, "LemonChiffon4" },
-  { 173*C, 216*C, 230*C, "light blue" },
-  { 240*C, 128*C, 128*C, "light coral" },
-  { 224*C, 255*C, 255*C, "light cyan" },
-  { 238*C, 221*C, 130*C, "light goldenrod" },
-  { 250*C, 250*C, 210*C, "light goldenrod yellow" },
-  { 211*C, 211*C, 211*C, "light gray" },
-  { 144*C, 238*C, 144*C, "light green" },
-  { 211*C, 211*C, 211*C, "light grey" },
-  { 255*C, 182*C, 193*C, "light pink" },
-  { 255*C, 160*C, 122*C, "light salmon" },
-  {  32*C, 178*C, 170*C, "light sea green" },
-  { 135*C, 206*C, 250*C, "light sky blue" },
-  { 132*C, 112*C, 255*C, "light slate blue" },
-  { 119*C, 136*C, 153*C, "light slate gray" },
-  { 119*C, 136*C, 153*C, "light slate grey" },
-  { 176*C, 196*C, 222*C, "light steel blue" },
-  { 255*C, 255*C, 224*C, "light yellow" },
-  { 173*C, 216*C, 230*C, "LightBlue" },
-  { 191*C, 239*C, 255*C, "LightBlue1" },
-  { 178*C, 223*C, 238*C, "LightBlue2" },
-  { 154*C, 192*C, 205*C, "LightBlue3" },
-  { 104*C, 131*C, 139*C, "LightBlue4" },
-  { 240*C, 128*C, 128*C, "LightCoral" },
-  { 224*C, 255*C, 255*C, "LightCyan" },
-  { 224*C, 255*C, 255*C, "LightCyan1" },
-  { 209*C, 238*C, 238*C, "LightCyan2" },
-  { 180*C, 205*C, 205*C, "LightCyan3" },
-  { 122*C, 139*C, 139*C, "LightCyan4" },
-  { 238*C, 221*C, 130*C, "LightGoldenrod" },
-  { 255*C, 236*C, 139*C, "LightGoldenrod1" },
-  { 238*C, 220*C, 130*C, "LightGoldenrod2" },
-  { 205*C, 190*C, 112*C, "LightGoldenrod3" },
-  { 139*C, 129*C, 76*C, "LightGoldenrod4" },
-  { 250*C, 250*C, 210*C, "LightGoldenrodYellow" },
-  { 211*C, 211*C, 211*C, "LightGray" },
-  { 144*C, 238*C, 144*C, "LightGreen" },
-  { 211*C, 211*C, 211*C, "LightGrey" },
-  { 255*C, 182*C, 193*C, "LightPink" },
-  { 255*C, 174*C, 185*C, "LightPink1" },
-  { 238*C, 162*C, 173*C, "LightPink2" },
-  { 205*C, 140*C, 149*C, "LightPink3" },
-  { 139*C,  95*C, 101*C, "LightPink4" },
-  { 255*C, 160*C, 122*C, "LightSalmon" },
-  { 255*C, 160*C, 122*C, "LightSalmon1" },
-  { 238*C, 149*C, 114*C, "LightSalmon2" },
-  { 205*C, 129*C, 98*C, "LightSalmon3" },
-  { 139*C, 87*C, 66*C, "LightSalmon4" },
-  {  32*C, 178*C, 170*C, "LightSeaGreen" },
-  { 135*C, 206*C, 250*C, "LightSkyBlue" },
-  { 176*C, 226*C, 255*C, "LightSkyBlue1" },
-  { 164*C, 211*C, 238*C, "LightSkyBlue2" },
-  { 141*C, 182*C, 205*C, "LightSkyBlue3" },
-  {  96*C, 123*C, 139*C, "LightSkyBlue4" },
-  { 132*C, 112*C, 255*C, "LightSlateBlue" },
-  { 119*C, 136*C, 153*C, "LightSlateGray" },
-  { 119*C, 136*C, 153*C, "LightSlateGrey" },
-  { 176*C, 196*C, 222*C, "LightSteelBlue" },
-  { 202*C, 225*C, 255*C, "LightSteelBlue1" },
-  { 188*C, 210*C, 238*C, "LightSteelBlue2" },
-  { 162*C, 181*C, 205*C, "LightSteelBlue3" },
-  { 110*C, 123*C, 139*C, "LightSteelBlue4" },
-  { 255*C, 255*C, 224*C, "LightYellow" },
-  { 255*C, 255*C, 224*C, "LightYellow1" },
-  { 238*C, 238*C, 209*C, "LightYellow2" },
-  { 205*C, 205*C, 180*C, "LightYellow3" },
-  { 139*C, 139*C, 122*C, "LightYellow4" },
-  {  50*C, 205*C,  50*C, "lime green" },
-  {  50*C, 205*C,  50*C, "LimeGreen" },
-  { 250*C, 240*C, 230*C, "linen" },
-  { 255*C,   0*C, 255*C, "magenta" },
-  { 255*C,   0*C, 255*C, "magenta1" },
-  { 238*C,   0*C, 238*C, "magenta2" },
-  { 205*C,   0*C, 205*C, "magenta3" },
-  { 139*C,   0*C, 139*C, "magenta4" },
-  { 176*C,  48*C,  96*C, "maroon" },
-  { 255*C,  52*C, 179*C, "maroon1" },
-  { 238*C,  48*C, 167*C, "maroon2" },
-  { 205*C,  41*C, 144*C, "maroon3" },
-  { 139*C, 28*C, 98*C, "maroon4" },
-  { 102*C, 205*C, 170*C, "medium aquamarine" },
-  {   0*C,   0*C, 205*C, "medium blue" },
-  { 186*C,  85*C, 211*C, "medium orchid" },
-  { 147*C, 112*C, 219*C, "medium purple" },
-  {  60*C, 179*C, 113*C, "medium sea green" },
-  { 123*C, 104*C, 238*C, "medium slate blue" },
-  {   0*C, 250*C, 154*C, "medium spring green" },
-  {  72*C, 209*C, 204*C, "medium turquoise" },
-  { 199*C,  21*C, 133*C, "medium violet red" },
-  { 102*C, 205*C, 170*C, "MediumAquamarine" },
-  {   0*C,   0*C, 205*C, "MediumBlue" },
-  { 186*C,  85*C, 211*C, "MediumOrchid" },
-  { 224*C, 102*C, 255*C, "MediumOrchid1" },
-  { 209*C,  95*C, 238*C, "MediumOrchid2" },
-  { 180*C,  82*C, 205*C, "MediumOrchid3" },
-  { 122*C,  55*C, 139*C, "MediumOrchid4" },
-  { 147*C, 112*C, 219*C, "MediumPurple" },
-  { 171*C, 130*C, 255*C, "MediumPurple1" },
-  { 159*C, 121*C, 238*C, "MediumPurple2" },
-  { 137*C, 104*C, 205*C, "MediumPurple3" },
-  {  93*C,  71*C, 139*C, "MediumPurple4" },
-  {  60*C, 179*C, 113*C, "MediumSeaGreen" },
-  { 123*C, 104*C, 238*C, "MediumSlateBlue" },
-  {   0*C, 250*C, 154*C, "MediumSpringGreen" },
-  {  72*C, 209*C, 204*C, "MediumTurquoise" },
-  { 199*C,  21*C, 133*C, "MediumVioletRed" },
-  {  25*C,  25*C, 112*C, "midnight blue" },
-  {  25*C,  25*C, 112*C, "MidnightBlue" },
-  { 245*C, 255*C, 250*C, "mint cream" },
-  { 245*C, 255*C, 250*C, "MintCream" },
-  { 255*C, 228*C, 225*C, "misty rose" },
-  { 255*C, 228*C, 225*C, "MistyRose" },
-  { 255*C, 228*C, 225*C, "MistyRose1" },
-  { 238*C, 213*C, 210*C, "MistyRose2" },
-  { 205*C, 183*C, 181*C, "MistyRose3" },
-  { 139*C, 125*C, 123*C, "MistyRose4" },
-  { 255*C, 228*C, 181*C, "moccasin" },
-  { 255*C, 222*C, 173*C, "navajo white" },
-  { 255*C, 222*C, 173*C, "NavajoWhite" },
-  { 255*C, 222*C, 173*C, "NavajoWhite1" },
-  { 238*C, 207*C, 161*C, "NavajoWhite2" },
-  { 205*C, 179*C, 139*C, "NavajoWhite3" },
-  { 139*C, 121*C, 94*C, "NavajoWhite4" },
-  {   0*C,   0*C, 128*C, "navy" },
-  {   0*C,   0*C, 128*C, "navy blue" },
-  {   0*C,   0*C, 128*C, "NavyBlue" },
-  { 253*C, 245*C, 230*C, "old lace" },
-  { 253*C, 245*C, 230*C, "OldLace" },
-  { 107*C, 142*C,  35*C, "olive drab" },
-  { 107*C, 142*C,  35*C, "OliveDrab" },
-  { 192*C, 255*C, 62*C, "OliveDrab1" },
-  { 179*C, 238*C, 58*C, "OliveDrab2" },
-  { 154*C, 205*C, 50*C, "OliveDrab3" },
-  { 105*C, 139*C, 34*C, "OliveDrab4" },
-  { 255*C, 165*C,   0*C, "orange" },
-  { 255*C,  69*C,   0*C, "orange red" },
-  { 255*C, 165*C, 0*C, "orange1" },
-  { 238*C, 154*C, 0*C, "orange2" },
-  { 205*C, 133*C, 0*C, "orange3" },
-  { 139*C, 90*C,  0*C, "orange4" },
-  { 255*C,  69*C,   0*C, "OrangeRed" },
-  { 255*C, 69*C,  0*C, "OrangeRed1" },
-  { 238*C, 64*C,  0*C, "OrangeRed2" },
-  { 205*C, 55*C,  0*C, "OrangeRed3" },
-  { 139*C, 37*C,  0*C, "OrangeRed4" },
-  { 218*C, 112*C, 214*C, "orchid" },
-  { 255*C, 131*C, 250*C, "orchid1" },
-  { 238*C, 122*C, 233*C, "orchid2" },
-  { 205*C, 105*C, 201*C, "orchid3" },
-  { 139*C,  71*C, 137*C, "orchid4" },
-  { 238*C, 232*C, 170*C, "pale goldenrod" },
-  { 152*C, 251*C, 152*C, "pale green" },
-  { 175*C, 238*C, 238*C, "pale turquoise" },
-  { 219*C, 112*C, 147*C, "pale violet red" },
-  { 238*C, 232*C, 170*C, "PaleGoldenrod" },
-  { 152*C, 251*C, 152*C, "PaleGreen" },
-  { 154*C, 255*C, 154*C, "PaleGreen1" },
-  { 144*C, 238*C, 144*C, "PaleGreen2" },
-  { 124*C, 205*C, 124*C, "PaleGreen3" },
-  { 84*C, 139*C, 84*C, "PaleGreen4" },
-  { 175*C, 238*C, 238*C, "PaleTurquoise" },
-  { 187*C, 255*C, 255*C, "PaleTurquoise1" },
-  { 174*C, 238*C, 238*C, "PaleTurquoise2" },
-  { 150*C, 205*C, 205*C, "PaleTurquoise3" },
-  { 102*C, 139*C, 139*C, "PaleTurquoise4" },
-  { 219*C, 112*C, 147*C, "PaleVioletRed" },
-  { 255*C, 130*C, 171*C, "PaleVioletRed1" },
-  { 238*C, 121*C, 159*C, "PaleVioletRed2" },
-  { 205*C, 104*C, 137*C, "PaleVioletRed3" },
-  { 139*C, 71*C, 93*C, "PaleVioletRed4" },
-  { 255*C, 239*C, 213*C, "papaya whip" },
-  { 255*C, 239*C, 213*C, "PapayaWhip" },
-  { 255*C, 218*C, 185*C, "peach puff" },
-  { 255*C, 218*C, 185*C, "PeachPuff" },
-  { 255*C, 218*C, 185*C, "PeachPuff1" },
-  { 238*C, 203*C, 173*C, "PeachPuff2" },
-  { 205*C, 175*C, 149*C, "PeachPuff3" },
-  { 139*C, 119*C, 101*C, "PeachPuff4" },
-  { 205*C, 133*C,  63*C, "peru" },
-  { 255*C, 192*C, 203*C, "pink" },
-  { 255*C, 181*C, 197*C, "pink1" },
-  { 238*C, 169*C, 184*C, "pink2" },
-  { 205*C, 145*C, 158*C, "pink3" },
-  { 139*C,  99*C, 108*C, "pink4" },
-  { 221*C, 160*C, 221*C, "plum" },
-  { 255*C, 187*C, 255*C, "plum1" },
-  { 238*C, 174*C, 238*C, "plum2" },
-  { 205*C, 150*C, 205*C, "plum3" },
-  { 139*C, 102*C, 139*C, "plum4" },
-  { 176*C, 224*C, 230*C, "powder blue" },
-  { 176*C, 224*C, 230*C, "PowderBlue" },
-  { 160*C,  32*C, 240*C, "purple" },
-  { 155*C,  48*C, 255*C, "purple1" },
-  { 145*C,  44*C, 238*C, "purple2" },
-  { 125*C,  38*C, 205*C, "purple3" },
-  {  85*C,  26*C, 139*C, "purple4" },
-  { 255*C,   0*C,   0*C, "red" },
-  { 255*C,  0*C,  0*C, "red1" },
-  { 238*C,  0*C,  0*C, "red2" },
-  { 205*C,  0*C,  0*C, "red3" },
-  { 139*C,  0*C,  0*C, "red4" },
-  { 188*C, 143*C, 143*C, "rosy brown" },
-  { 188*C, 143*C, 143*C, "RosyBrown" },
-  { 255*C, 193*C, 193*C, "RosyBrown1" },
-  { 238*C, 180*C, 180*C, "RosyBrown2" },
-  { 205*C, 155*C, 155*C, "RosyBrown3" },
-  { 139*C, 105*C, 105*C, "RosyBrown4" },
-  {  65*C, 105*C, 225*C, "royal blue" },
-  {  65*C, 105*C, 225*C, "RoyalBlue" },
-  {  72*C, 118*C, 255*C, "RoyalBlue1" },
-  {  67*C, 110*C, 238*C, "RoyalBlue2" },
-  {  58*C,  95*C, 205*C, "RoyalBlue3" },
-  {  39*C,  64*C, 139*C, "RoyalBlue4" },
-  { 139*C,  69*C,  19*C, "saddle brown" },
-  { 139*C,  69*C,  19*C, "SaddleBrown" },
-  { 250*C, 128*C, 114*C, "salmon" },
-  { 255*C, 140*C, 105*C, "salmon1" },
-  { 238*C, 130*C, 98*C, "salmon2" },
-  { 205*C, 112*C, 84*C, "salmon3" },
-  { 139*C, 76*C, 57*C, "salmon4" },
-  { 244*C, 164*C,  96*C, "sandy brown" },
-  { 244*C, 164*C,  96*C, "SandyBrown" },
-  {  46*C, 139*C,  87*C, "sea green" },
-  {  46*C, 139*C,  87*C, "SeaGreen" },
-  {  84*C, 255*C, 159*C, "SeaGreen1" },
-  {  78*C, 238*C, 148*C, "SeaGreen2" },
-  {  67*C, 205*C, 128*C, "SeaGreen3" },
-  { 46*C, 139*C, 87*C, "SeaGreen4" },
-  { 255*C, 245*C, 238*C, "seashell" },
-  { 255*C, 245*C, 238*C, "seashell1" },
-  { 238*C, 229*C, 222*C, "seashell2" },
-  { 205*C, 197*C, 191*C, "seashell3" },
-  { 139*C, 134*C, 130*C, "seashell4" },
-  { 160*C,  82*C,  45*C, "sienna" },
-  { 255*C, 130*C, 71*C, "sienna1" },
-  { 238*C, 121*C, 66*C, "sienna2" },
-  { 205*C, 104*C, 57*C, "sienna3" },
-  { 139*C, 71*C, 38*C, "sienna4" },
-  { 135*C, 206*C, 235*C, "sky blue" },
-  { 135*C, 206*C, 235*C, "SkyBlue" },
-  { 135*C, 206*C, 255*C, "SkyBlue1" },
-  { 126*C, 192*C, 238*C, "SkyBlue2" },
-  { 108*C, 166*C, 205*C, "SkyBlue3" },
-  {  74*C, 112*C, 139*C, "SkyBlue4" },
-  { 106*C,  90*C, 205*C, "slate blue" },
-  { 112*C, 128*C, 144*C, "slate gray" },
-  { 112*C, 128*C, 144*C, "slate grey" },
-  { 106*C,  90*C, 205*C, "SlateBlue" },
-  { 131*C, 111*C, 255*C, "SlateBlue1" },
-  { 122*C, 103*C, 238*C, "SlateBlue2" },
-  { 105*C,  89*C, 205*C, "SlateBlue3" },
-  {  71*C,  60*C, 139*C, "SlateBlue4" },
-  { 112*C, 128*C, 144*C, "SlateGray" },
-  { 198*C, 226*C, 255*C, "SlateGray1" },
-  { 185*C, 211*C, 238*C, "SlateGray2" },
-  { 159*C, 182*C, 205*C, "SlateGray3" },
-  { 108*C, 123*C, 139*C, "SlateGray4" },
-  { 112*C, 128*C, 144*C, "SlateGrey" },
-  { 255*C, 250*C, 250*C, "snow" },
-  { 255*C, 250*C, 250*C, "snow1" },
-  { 238*C, 233*C, 233*C, "snow2" },
-  { 205*C, 201*C, 201*C, "snow3" },
-  { 139*C, 137*C, 137*C, "snow4" },
-  {   0*C, 255*C, 127*C, "spring green" },
-  {   0*C, 255*C, 127*C, "SpringGreen" },
-  {   0*C, 255*C, 127*C, "SpringGreen1" },
-  {   0*C, 238*C, 118*C, "SpringGreen2" },
-  {   0*C, 205*C, 102*C, "SpringGreen3" },
-  { 0*C, 139*C, 69*C, "SpringGreen4" },
-  {  70*C, 130*C, 180*C, "steel blue" },
-  {  70*C, 130*C, 180*C, "SteelBlue" },
-  {  99*C, 184*C, 255*C, "SteelBlue1" },
-  {  92*C, 172*C, 238*C, "SteelBlue2" },
-  {  79*C, 148*C, 205*C, "SteelBlue3" },
-  {  54*C, 100*C, 139*C, "SteelBlue4" },
-  { 210*C, 180*C, 140*C, "tan" },
-  { 255*C, 165*C, 79*C, "tan1" },
-  { 238*C, 154*C, 73*C, "tan2" },
-  { 205*C, 133*C, 63*C, "tan3" },
-  { 139*C, 90*C, 43*C, "tan4" },
-  { 216*C, 191*C, 216*C, "thistle" },
-  { 255*C, 225*C, 255*C, "thistle1" },
-  { 238*C, 210*C, 238*C, "thistle2" },
-  { 205*C, 181*C, 205*C, "thistle3" },
-  { 139*C, 123*C, 139*C, "thistle4" },
-  { 255*C,  99*C,  71*C, "tomato" },
-  { 255*C, 99*C, 71*C, "tomato1" },
-  { 238*C, 92*C, 66*C, "tomato2" },
-  { 205*C, 79*C, 57*C, "tomato3" },
-  { 139*C, 54*C, 38*C, "tomato4" },
-  {  64*C, 224*C, 208*C, "turquoise" },
-  {   0*C, 245*C, 255*C, "turquoise1" },
-  {   0*C, 229*C, 238*C, "turquoise2" },
-  {   0*C, 197*C, 205*C, "turquoise3" },
-  {   0*C, 134*C, 139*C, "turquoise4" },
-  { 238*C, 130*C, 238*C, "violet" },
-  { 208*C,  32*C, 144*C, "violet red" },
-  { 208*C,  32*C, 144*C, "VioletRed" },
-  { 255*C,  62*C, 150*C, "VioletRed1" },
-  { 238*C,  58*C, 140*C, "VioletRed2" },
-  { 205*C,  50*C, 120*C, "VioletRed3" },
-  { 139*C, 34*C, 82*C, "VioletRed4" },
-  { 245*C, 222*C, 179*C, "wheat" },
-  { 255*C, 231*C, 186*C, "wheat1" },
-  { 238*C, 216*C, 174*C, "wheat2" },
-  { 205*C, 186*C, 150*C, "wheat3" },
-  { 139*C, 126*C, 102*C, "wheat4" },
-  { 255*C, 255*C, 255*C, "white" },
-  { 245*C, 245*C, 245*C, "white smoke" },
-  { 245*C, 245*C, 245*C, "WhiteSmoke" },
-  { 255*C, 255*C,   0*C, "yellow" },
-  { 154*C, 205*C,  50*C, "yellow green" },
-  { 255*C, 255*C, 0*C, "yellow1" },
-  { 238*C, 238*C, 0*C, "yellow2" },
-  { 205*C, 205*C, 0*C, "yellow3" },
-  { 139*C, 139*C, 0*C, "yellow4" },
-  { 154*C, 205*C,  50*C, "YellowGreen" }
-};
-
-#undef C
-
-#define NUM_KD_COLORS	(sizeof (KdColors) / sizeof (KdColors[0]))
-
-Bool
-OsInitColors()
-{
-    return TRUE;
-}
-
-Bool
-OsLookupColor(int		screen, 
-	      char		*s_name,
-	      unsigned int	len, 
-	      unsigned short	*pred,
-	      unsigned short	*pgreen,
-	      unsigned short	*pblue)
-{
-    const KdNamedColor	*c;
-    unsigned char	*name = (unsigned char *) s_name;
-    int			low, mid, high;
-    int			r;
-
-    low = 0;
-    high = NUM_KD_COLORS;
-    while (high - low > 0)
-    {
-	mid = (low + high) / 2;
-	c = &KdColors[mid];
-	r = KdStrCaseCmp (c->name, name, len);
-	if (r == 0)
-	{
-	    *pred = c->red;
-	    *pgreen = c->green;
-	    *pblue = c->blue;
-	    return TRUE;
-	}
-	if (r < 0)
-	{
-	    if (high == mid)
-		break;
-	    high = mid;
-	}
-	else
-	{
-	    if (low == mid)
-		break;
-	    low = mid;
-	}
-    }
-    return FALSE;
-}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 5418ca0..38248f6 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -194,7 +194,7 @@ xf86CreateRootWindow(WindowPtr pWin)
 
 
 static void
-PostConfigInit(void)
+InstallSignalHandlers(void)
 {
     /*
      * Install signal handler for unexpected signals
@@ -220,13 +220,6 @@ PostConfigInit(void)
        signal(SIGXFSZ,xf86SigHandler);
 #endif
     }
-
-#ifdef XF86PM
-    xf86OSPMClose = xf86OSPMOpen();
-#endif
-    
-    /* Do this after XF86Config is read (it's normally in OsInit()) */
-    OsInitColors();
 }
 
 
@@ -510,8 +503,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
       }
     }
 
-    if (!autoconfig)
-	PostConfigInit();
+    InstallSignalHandlers();
 
     /* Initialise the loader */
     LoaderInit();
@@ -539,9 +531,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	    xf86Msg(X_ERROR, "Auto configuration failed\n");
 	    return;
 	}
-	PostConfigInit();
     }
 
+#ifdef XF86PM
+    xf86OSPMClose = xf86OSPMOpen();
+#endif
+
     /* Initialise the resource broker */
     xf86ResourceBrokerInit();
 
@@ -1170,7 +1165,7 @@ InitInput(argc, argv)
  *      OS/Vendor-specific initialisations.  Called from OsInit(), which
  *      is called by dix before establishing the well known sockets.
  */
- 
+
 void
 OsVendorInit()
 {
@@ -1179,7 +1174,6 @@ OsVendorInit()
 #ifdef SIGCHLD
   signal(SIGCHLD, SIG_DFL);	/* Need to wait for child processes */
 #endif
-  OsDelayInitColors = TRUE;
 
   if (!beenHere)
     xf86LogInit();
diff --git a/include/os.h b/include/os.h
index 89c624c..b585fd7 100644
--- a/include/os.h
+++ b/include/os.h
@@ -93,7 +93,6 @@ typedef struct _NewClientRec *NewClientPtr;
 #define SIGVAL void
 #endif
 
-extern Bool OsDelayInitColors;
 extern void (*OsVendorVErrorFProc)(const char *, va_list args);
 
 extern int WaitForSomething(
@@ -267,8 +266,6 @@ extern void OsVendorFatalError(void);
 
 extern void OsVendorInit(void);
 
-extern int OsInitColors(void);
-
 void OsBlockSignals (void);
 
 void OsReleaseSignals (void);
diff --git a/os/Makefile.am b/os/Makefile.am
index ce60585..16e4bfa 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -15,7 +15,6 @@ libos_la_SOURCES = 	\
 	io.c		\
 	mitauth.c	\
 	oscolor.c	\
-	oscolor.h	\
 	osdep.h		\
 	osinit.c	\
 	utils.c		\
diff --git a/os/oscolor.c b/os/oscolor.c
index f3ff9be..10dc2ba 100644
--- a/os/oscolor.c
+++ b/os/oscolor.c
@@ -59,54 +59,1522 @@ typedef struct _builtinColor {
     unsigned short	name;
 } BuiltinColor;
 
-/* These have to come after the struct definition because despair. */
-#include "oscolor.h"
-#define NUM_BUILTIN_COLORS  (sizeof (BuiltinColors) / sizeof (BuiltinColors[0]))
-
-static unsigned char
-OsToLower (unsigned char a)
-{
-    if ((a >= XK_A) && (a <= XK_Z))
-	return a + (XK_a - XK_A);
-    else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis))
-	return a + (XK_agrave - XK_Agrave);
-    else if ((a >= XK_Ooblique) && (a <= XK_Thorn))
-	return a + (XK_oslash - XK_Ooblique);
-    else
-	return a;
-}
+static const unsigned char BuiltinColorNames[] = {
+    "alice blue\0"
+    "AliceBlue\0"
+    "antique white\0"
+    "AntiqueWhite\0"
+    "AntiqueWhite1\0"
+    "AntiqueWhite2\0"
+    "AntiqueWhite3\0"
+    "AntiqueWhite4\0"
+    "aquamarine\0"
+    "aquamarine1\0"
+    "aquamarine2\0"
+    "aquamarine3\0"
+    "aquamarine4\0"
+    "azure\0"
+    "azure1\0"
+    "azure2\0"
+    "azure3\0"
+    "azure4\0"
+    "beige\0"
+    "bisque\0"
+    "bisque1\0"
+    "bisque2\0"
+    "bisque3\0"
+    "bisque4\0"
+    "black\0"
+    "blanched almond\0"
+    "BlanchedAlmond\0"
+    "blue\0"
+    "blue violet\0"
+    "blue1\0"
+    "blue2\0"
+    "blue3\0"
+    "blue4\0"
+    "BlueViolet\0"
+    "brown\0"
+    "brown1\0"
+    "brown2\0"
+    "brown3\0"
+    "brown4\0"
+    "burlywood\0"
+    "burlywood1\0"
+    "burlywood2\0"
+    "burlywood3\0"
+    "burlywood4\0"
+    "cadet blue\0"
+    "CadetBlue\0"
+    "CadetBlue1\0"
+    "CadetBlue2\0"
+    "CadetBlue3\0"
+    "CadetBlue4\0"
+    "chartreuse\0"
+    "chartreuse1\0"
+    "chartreuse2\0"
+    "chartreuse3\0"
+    "chartreuse4\0"
+    "chocolate\0"
+    "chocolate1\0"
+    "chocolate2\0"
+    "chocolate3\0"
+    "chocolate4\0"
+    "coral\0"
+    "coral1\0"
+    "coral2\0"
+    "coral3\0"
+    "coral4\0"
+    "cornflower blue\0"
+    "CornflowerBlue\0"
+    "cornsilk\0"
+    "cornsilk1\0"
+    "cornsilk2\0"
+    "cornsilk3\0"
+    "cornsilk4\0"
+    "cyan\0"
+    "cyan1\0"
+    "cyan2\0"
+    "cyan3\0"
+    "cyan4\0"
+    "dark blue\0"
+    "dark cyan\0"
+    "dark goldenrod\0"
+    "dark gray\0"
+    "dark green\0"
+    "dark grey\0"
+    "dark khaki\0"
+    "dark magenta\0"
+    "dark olive green\0"
+    "dark orange\0"
+    "dark orchid\0"
+    "dark red\0"
+    "dark salmon\0"
+    "dark sea green\0"
+    "dark slate blue\0"
+    "dark slate gray\0"
+    "dark slate grey\0"
+    "dark turquoise\0"
+    "dark violet\0"
+    "DarkBlue\0"
+    "DarkCyan\0"
+    "DarkGoldenrod\0"
+    "DarkGoldenrod1\0"
+    "DarkGoldenrod2\0"
+    "DarkGoldenrod3\0"
+    "DarkGoldenrod4\0"
+    "DarkGray\0"
+    "DarkGreen\0"
+    "DarkGrey\0"
+    "DarkKhaki\0"
+    "DarkMagenta\0"
+    "DarkOliveGreen\0"
+    "DarkOliveGreen1\0"
+    "DarkOliveGreen2\0"
+    "DarkOliveGreen3\0"
+    "DarkOliveGreen4\0"
+    "DarkOrange\0"
+    "DarkOrange1\0"
+    "DarkOrange2\0"
+    "DarkOrange3\0"
+    "DarkOrange4\0"
+    "DarkOrchid\0"
+    "DarkOrchid1\0"
+    "DarkOrchid2\0"
+    "DarkOrchid3\0"
+    "DarkOrchid4\0"
+    "DarkRed\0"
+    "DarkSalmon\0"
+    "DarkSeaGreen\0"
+    "DarkSeaGreen1\0"
+    "DarkSeaGreen2\0"
+    "DarkSeaGreen3\0"
+    "DarkSeaGreen4\0"
+    "DarkSlateBlue\0"
+    "DarkSlateGray\0"
+    "DarkSlateGray1\0"
+    "DarkSlateGray2\0"
+    "DarkSlateGray3\0"
+    "DarkSlateGray4\0"
+    "DarkSlateGrey\0"
+    "DarkTurquoise\0"
+    "DarkViolet\0"
+    "deep pink\0"
+    "deep sky blue\0"
+    "DeepPink\0"
+    "DeepPink1\0"
+    "DeepPink2\0"
+    "DeepPink3\0"
+    "DeepPink4\0"
+    "DeepSkyBlue\0"
+    "DeepSkyBlue1\0"
+    "DeepSkyBlue2\0"
+    "DeepSkyBlue3\0"
+    "DeepSkyBlue4\0"
+    "dim gray\0"
+    "dim grey\0"
+    "DimGray\0"
+    "DimGrey\0"
+    "dodger blue\0"
+    "DodgerBlue\0"
+    "DodgerBlue1\0"
+    "DodgerBlue2\0"
+    "DodgerBlue3\0"
+    "DodgerBlue4\0"
+    "firebrick\0"
+    "firebrick1\0"
+    "firebrick2\0"
+    "firebrick3\0"
+    "firebrick4\0"
+    "floral white\0"
+    "FloralWhite\0"
+    "forest green\0"
+    "ForestGreen\0"
+    "gainsboro\0"
+    "ghost white\0"
+    "GhostWhite\0"
+    "gold\0"
+    "gold1\0"
+    "gold2\0"
+    "gold3\0"
+    "gold4\0"
+    "goldenrod\0"
+    "goldenrod1\0"
+    "goldenrod2\0"
+    "goldenrod3\0"
+    "goldenrod4\0"
+    "gray\0"
+    "gray0\0"
+    "gray1\0"
+    "gray10\0"
+    "gray100\0"
+    "gray11\0"
+    "gray12\0"
+    "gray13\0"
+    "gray14\0"
+    "gray15\0"
+    "gray16\0"
+    "gray17\0"
+    "gray18\0"
+    "gray19\0"
+    "gray2\0"
+    "gray20\0"
+    "gray21\0"
+    "gray22\0"
+    "gray23\0"
+    "gray24\0"
+    "gray25\0"
+    "gray26\0"
+    "gray27\0"
+    "gray28\0"
+    "gray29\0"
+    "gray3\0"
+    "gray30\0"
+    "gray31\0"
+    "gray32\0"
+    "gray33\0"
+    "gray34\0"
+    "gray35\0"
+    "gray36\0"
+    "gray37\0"
+    "gray38\0"
+    "gray39\0"
+    "gray4\0"
+    "gray40\0"
+    "gray41\0"
+    "gray42\0"
+    "gray43\0"
+    "gray44\0"
+    "gray45\0"
+    "gray46\0"
+    "gray47\0"
+    "gray48\0"
+    "gray49\0"
+    "gray5\0"
+    "gray50\0"
+    "gray51\0"
+    "gray52\0"
+    "gray53\0"
+    "gray54\0"
+    "gray55\0"
+    "gray56\0"
+    "gray57\0"
+    "gray58\0"
+    "gray59\0"
+    "gray6\0"
+    "gray60\0"
+    "gray61\0"
+    "gray62\0"
+    "gray63\0"
+    "gray64\0"
+    "gray65\0"
+    "gray66\0"
+    "gray67\0"
+    "gray68\0"
+    "gray69\0"
+    "gray7\0"
+    "gray70\0"
+    "gray71\0"
+    "gray72\0"
+    "gray73\0"
+    "gray74\0"
+    "gray75\0"
+    "gray76\0"
+    "gray77\0"
+    "gray78\0"
+    "gray79\0"
+    "gray8\0"
+    "gray80\0"
+    "gray81\0"
+    "gray82\0"
+    "gray83\0"
+    "gray84\0"
+    "gray85\0"
+    "gray86\0"
+    "gray87\0"
+    "gray88\0"
+    "gray89\0"
+    "gray9\0"
+    "gray90\0"
+    "gray91\0"
+    "gray92\0"
+    "gray93\0"
+    "gray94\0"
+    "gray95\0"
+    "gray96\0"
+    "gray97\0"
+    "gray98\0"
+    "gray99\0"
+    "green\0"
+    "green yellow\0"
+    "green1\0"
+    "green2\0"
+    "green3\0"
+    "green4\0"
+    "GreenYellow\0"
+    "grey\0"
+    "grey0\0"
+    "grey1\0"
+    "grey10\0"
+    "grey100\0"
+    "grey11\0"
+    "grey12\0"
+    "grey13\0"
+    "grey14\0"
+    "grey15\0"
+    "grey16\0"
+    "grey17\0"
+    "grey18\0"
+    "grey19\0"
+    "grey2\0"
+    "grey20\0"
+    "grey21\0"
+    "grey22\0"
+    "grey23\0"
+    "grey24\0"
+    "grey25\0"
+    "grey26\0"
+    "grey27\0"
+    "grey28\0"
+    "grey29\0"
+    "grey3\0"
+    "grey30\0"
+    "grey31\0"
+    "grey32\0"
+    "grey33\0"
+    "grey34\0"
+    "grey35\0"
+    "grey36\0"
+    "grey37\0"
+    "grey38\0"
+    "grey39\0"
+    "grey4\0"
+    "grey40\0"
+    "grey41\0"
+    "grey42\0"
+    "grey43\0"
+    "grey44\0"
+    "grey45\0"
+    "grey46\0"
+    "grey47\0"
+    "grey48\0"
+    "grey49\0"
+    "grey5\0"
+    "grey50\0"
+    "grey51\0"
+    "grey52\0"
+    "grey53\0"
+    "grey54\0"
+    "grey55\0"
+    "grey56\0"
+    "grey57\0"
+    "grey58\0"
+    "grey59\0"
+    "grey6\0"
+    "grey60\0"
+    "grey61\0"
+    "grey62\0"
+    "grey63\0"
+    "grey64\0"
+    "grey65\0"
+    "grey66\0"
+    "grey67\0"
+    "grey68\0"
+    "grey69\0"
+    "grey7\0"
+    "grey70\0"
+    "grey71\0"
+    "grey72\0"
+    "grey73\0"
+    "grey74\0"
+    "grey75\0"
+    "grey76\0"
+    "grey77\0"
+    "grey78\0"
+    "grey79\0"
+    "grey8\0"
+    "grey80\0"
+    "grey81\0"
+    "grey82\0"
+    "grey83\0"
+    "grey84\0"
+    "grey85\0"
+    "grey86\0"
+    "grey87\0"
+    "grey88\0"
+    "grey89\0"
+    "grey9\0"
+    "grey90\0"
+    "grey91\0"
+    "grey92\0"
+    "grey93\0"
+    "grey94\0"
+    "grey95\0"
+    "grey96\0"
+    "grey97\0"
+    "grey98\0"
+    "grey99\0"
+    "honeydew\0"
+    "honeydew1\0"
+    "honeydew2\0"
+    "honeydew3\0"
+    "honeydew4\0"
+    "hot pink\0"
+    "HotPink\0"
+    "HotPink1\0"
+    "HotPink2\0"
+    "HotPink3\0"
+    "HotPink4\0"
+    "indian red\0"
+    "IndianRed\0"
+    "IndianRed1\0"
+    "IndianRed2\0"
+    "IndianRed3\0"
+    "IndianRed4\0"
+    "ivory\0"
+    "ivory1\0"
+    "ivory2\0"
+    "ivory3\0"
+    "ivory4\0"
+    "khaki\0"
+    "khaki1\0"
+    "khaki2\0"
+    "khaki3\0"
+    "khaki4\0"
+    "lavender\0"
+    "lavender blush\0"
+    "LavenderBlush\0"
+    "LavenderBlush1\0"
+    "LavenderBlush2\0"
+    "LavenderBlush3\0"
+    "LavenderBlush4\0"
+    "lawn green\0"
+    "LawnGreen\0"
+    "lemon chiffon\0"
+    "LemonChiffon\0"
+    "LemonChiffon1\0"
+    "LemonChiffon2\0"
+    "LemonChiffon3\0"
+    "LemonChiffon4\0"
+    "light blue\0"
+    "light coral\0"
+    "light cyan\0"
+    "light goldenrod\0"
+    "light goldenrod yellow\0"
+    "light gray\0"
+    "light green\0"
+    "light grey\0"
+    "light pink\0"
+    "light salmon\0"
+    "light sea green\0"
+    "light sky blue\0"
+    "light slate blue\0"
+    "light slate gray\0"
+    "light slate grey\0"
+    "light steel blue\0"
+    "light yellow\0"
+    "LightBlue\0"
+    "LightBlue1\0"
+    "LightBlue2\0"
+    "LightBlue3\0"
+    "LightBlue4\0"
+    "LightCoral\0"
+    "LightCyan\0"
+    "LightCyan1\0"
+    "LightCyan2\0"
+    "LightCyan3\0"
+    "LightCyan4\0"
+    "LightGoldenrod\0"
+    "LightGoldenrod1\0"
+    "LightGoldenrod2\0"
+    "LightGoldenrod3\0"
+    "LightGoldenrod4\0"
+    "LightGoldenrodYellow\0"
+    "LightGray\0"
+    "LightGreen\0"
+    "LightGrey\0"
+    "LightPink\0"
+    "LightPink1\0"
+    "LightPink2\0"
+    "LightPink3\0"
+    "LightPink4\0"
+    "LightSalmon\0"
+    "LightSalmon1\0"
+    "LightSalmon2\0"
+    "LightSalmon3\0"
+    "LightSalmon4\0"
+    "LightSeaGreen\0"
+    "LightSkyBlue\0"
+    "LightSkyBlue1\0"
+    "LightSkyBlue2\0"
+    "LightSkyBlue3\0"
+    "LightSkyBlue4\0"
+    "LightSlateBlue\0"
+    "LightSlateGray\0"
+    "LightSlateGrey\0"
+    "LightSteelBlue\0"
+    "LightSteelBlue1\0"
+    "LightSteelBlue2\0"
+    "LightSteelBlue3\0"
+    "LightSteelBlue4\0"
+    "LightYellow\0"
+    "LightYellow1\0"
+    "LightYellow2\0"
+    "LightYellow3\0"
+    "LightYellow4\0"
+    "lime green\0"
+    "LimeGreen\0"
+    "linen\0"
+    "magenta\0"
+    "magenta1\0"
+    "magenta2\0"
+    "magenta3\0"
+    "magenta4\0"
+    "maroon\0"
+    "maroon1\0"
+    "maroon2\0"
+    "maroon3\0"
+    "maroon4\0"
+    "medium aquamarine\0"
+    "medium blue\0"
+    "medium orchid\0"
+    "medium purple\0"
+    "medium sea green\0"
+    "medium slate blue\0"
+    "medium spring green\0"
+    "medium turquoise\0"
+    "medium violet red\0"
+    "MediumAquamarine\0"
+    "MediumBlue\0"
+    "MediumOrchid\0"
+    "MediumOrchid1\0"
+    "MediumOrchid2\0"
+    "MediumOrchid3\0"
+    "MediumOrchid4\0"
+    "MediumPurple\0"
+    "MediumPurple1\0"
+    "MediumPurple2\0"
+    "MediumPurple3\0"
+    "MediumPurple4\0"
+    "MediumSeaGreen\0"
+    "MediumSlateBlue\0"
+    "MediumSpringGreen\0"
+    "MediumTurquoise\0"
+    "MediumVioletRed\0"
+    "midnight blue\0"
+    "MidnightBlue\0"
+    "mint cream\0"
+    "MintCream\0"
+    "misty rose\0"
+    "MistyRose\0"
+    "MistyRose1\0"
+    "MistyRose2\0"
+    "MistyRose3\0"
+    "MistyRose4\0"
+    "moccasin\0"
+    "navajo white\0"
+    "NavajoWhite\0"
+    "NavajoWhite1\0"
+    "NavajoWhite2\0"
+    "NavajoWhite3\0"
+    "NavajoWhite4\0"
+    "navy\0"
+    "navy blue\0"
+    "NavyBlue\0"
+    "old lace\0"
+    "OldLace\0"
+    "olive drab\0"
+    "OliveDrab\0"
+    "OliveDrab1\0"
+    "OliveDrab2\0"
+    "OliveDrab3\0"
+    "OliveDrab4\0"
+    "orange\0"
+    "orange red\0"
+    "orange1\0"
+    "orange2\0"
+    "orange3\0"
+    "orange4\0"
+    "OrangeRed\0"
+    "OrangeRed1\0"
+    "OrangeRed2\0"
+    "OrangeRed3\0"
+    "OrangeRed4\0"
+    "orchid\0"
+    "orchid1\0"
+    "orchid2\0"
+    "orchid3\0"
+    "orchid4\0"
+    "pale goldenrod\0"
+    "pale green\0"
+    "pale turquoise\0"
+    "pale violet red\0"
+    "PaleGoldenrod\0"
+    "PaleGreen\0"
+    "PaleGreen1\0"
+    "PaleGreen2\0"
+    "PaleGreen3\0"
+    "PaleGreen4\0"
+    "PaleTurquoise\0"
+    "PaleTurquoise1\0"
+    "PaleTurquoise2\0"
+    "PaleTurquoise3\0"
+    "PaleTurquoise4\0"
+    "PaleVioletRed\0"
+    "PaleVioletRed1\0"
+    "PaleVioletRed2\0"
+    "PaleVioletRed3\0"
+    "PaleVioletRed4\0"
+    "papaya whip\0"
+    "PapayaWhip\0"
+    "peach puff\0"
+    "PeachPuff\0"
+    "PeachPuff1\0"
+    "PeachPuff2\0"
+    "PeachPuff3\0"
+    "PeachPuff4\0"
+    "peru\0"
+    "pink\0"
+    "pink1\0"
+    "pink2\0"
+    "pink3\0"
+    "pink4\0"
+    "plum\0"
+    "plum1\0"
+    "plum2\0"
+    "plum3\0"
+    "plum4\0"
+    "powder blue\0"
+    "PowderBlue\0"
+    "purple\0"
+    "purple1\0"
+    "purple2\0"
+    "purple3\0"
+    "purple4\0"
+    "red\0"
+    "red1\0"
+    "red2\0"
+    "red3\0"
+    "red4\0"
+    "rosy brown\0"
+    "RosyBrown\0"
+    "RosyBrown1\0"
+    "RosyBrown2\0"
+    "RosyBrown3\0"
+    "RosyBrown4\0"
+    "royal blue\0"
+    "RoyalBlue\0"
+    "RoyalBlue1\0"
+    "RoyalBlue2\0"
+    "RoyalBlue3\0"
+    "RoyalBlue4\0"
+    "saddle brown\0"
+    "SaddleBrown\0"
+    "salmon\0"
+    "salmon1\0"
+    "salmon2\0"
+    "salmon3\0"
+    "salmon4\0"
+    "sandy brown\0"
+    "SandyBrown\0"
+    "sea green\0"
+    "SeaGreen\0"
+    "SeaGreen1\0"
+    "SeaGreen2\0"
+    "SeaGreen3\0"
+    "SeaGreen4\0"
+    "seashell\0"
+    "seashell1\0"
+    "seashell2\0"
+    "seashell3\0"
+    "seashell4\0"
+    "sienna\0"
+    "sienna1\0"
+    "sienna2\0"
+    "sienna3\0"
+    "sienna4\0"
+    "sky blue\0"
+    "SkyBlue\0"
+    "SkyBlue1\0"
+    "SkyBlue2\0"
+    "SkyBlue3\0"
+    "SkyBlue4\0"
+    "slate blue\0"
+    "slate gray\0"
+    "slate grey\0"
+    "SlateBlue\0"
+    "SlateBlue1\0"
+    "SlateBlue2\0"
+    "SlateBlue3\0"
+    "SlateBlue4\0"
+    "SlateGray\0"
+    "SlateGray1\0"
+    "SlateGray2\0"
+    "SlateGray3\0"
+    "SlateGray4\0"
+    "SlateGrey\0"
+    "snow\0"
+    "snow1\0"
+    "snow2\0"
+    "snow3\0"
+    "snow4\0"
+    "spring green\0"
+    "SpringGreen\0"
+    "SpringGreen1\0"
+    "SpringGreen2\0"
+    "SpringGreen3\0"
+    "SpringGreen4\0"
+    "steel blue\0"
+    "SteelBlue\0"
+    "SteelBlue1\0"
+    "SteelBlue2\0"
+    "SteelBlue3\0"
+    "SteelBlue4\0"
+    "tan\0"
+    "tan1\0"
+    "tan2\0"
+    "tan3\0"
+    "tan4\0"
+    "thistle\0"
+    "thistle1\0"
+    "thistle2\0"
+    "thistle3\0"
+    "thistle4\0"
+    "tomato\0"
+    "tomato1\0"
+    "tomato2\0"
+    "tomato3\0"
+    "tomato4\0"
+    "turquoise\0"
+    "turquoise1\0"
+    "turquoise2\0"
+    "turquoise3\0"
+    "turquoise4\0"
+    "violet\0"
+    "violet red\0"
+    "VioletRed\0"
+    "VioletRed1\0"
+    "VioletRed2\0"
+    "VioletRed3\0"
+    "VioletRed4\0"
+    "wheat\0"
+    "wheat1\0"
+    "wheat2\0"
+    "wheat3\0"
+    "wheat4\0"
+    "white\0"
+    "white smoke\0"
+    "WhiteSmoke\0"
+    "yellow\0"
+    "yellow green\0"
+    "yellow1\0"
+    "yellow2\0"
+    "yellow3\0"
+    "yellow4\0"
+    "YellowGreen\0"
+};
 
-static int
-OsStrCaseCmp (const unsigned char *s1, const unsigned char *s2, int l2)
-{
-    unsigned char   c1, c2;
-
-    for (;;)
-    {
-	c1 = OsToLower (*s1++);
-	if (l2 == 0)
-	    c2 = '\0';
-	else
-	    c2 = OsToLower (*s2++);
-	if (!c1 || !c2)
-	    break;
-	if (c1 != c2)
-	    break;
-	l2--;
-    }
-    return c2 - c1;
-}
+static const BuiltinColor BuiltinColors[] = {
+    { 240, 248, 255,      0 }, /* alice blue */
+    { 240, 248, 255,     11 }, /* AliceBlue */
+    { 250, 235, 215,     21 }, /* antique white */
+    { 250, 235, 215,     35 }, /* AntiqueWhite */
+    { 255, 239, 219,     48 }, /* AntiqueWhite1 */
+    { 238, 223, 204,     62 }, /* AntiqueWhite2 */
+    { 205, 192, 176,     76 }, /* AntiqueWhite3 */
+    { 139, 131, 120,     90 }, /* AntiqueWhite4 */
+    { 127, 255, 212,    104 }, /* aquamarine */
+    { 127, 255, 212,    115 }, /* aquamarine1 */
+    { 118, 238, 198,    127 }, /* aquamarine2 */
+    { 102, 205, 170,    139 }, /* aquamarine3 */
+    {  69, 139, 116,    151 }, /* aquamarine4 */
+    { 240, 255, 255,    163 }, /* azure */
+    { 240, 255, 255,    169 }, /* azure1 */
+    { 224, 238, 238,    176 }, /* azure2 */
+    { 193, 205, 205,    183 }, /* azure3 */
+    { 131, 139, 139,    190 }, /* azure4 */
+    { 245, 245, 220,    197 }, /* beige */
+    { 255, 228, 196,    203 }, /* bisque */
+    { 255, 228, 196,    210 }, /* bisque1 */
+    { 238, 213, 183,    218 }, /* bisque2 */
+    { 205, 183, 158,    226 }, /* bisque3 */
+    { 139, 125, 107,    234 }, /* bisque4 */
+    {   0,   0,   0,    242 }, /* black */
+    { 255, 235, 205,    248 }, /* blanched almond */
+    { 255, 235, 205,    264 }, /* BlanchedAlmond */
+    {   0,   0, 255,    279 }, /* blue */
+    { 138,  43, 226,    284 }, /* blue violet */
+    {   0,   0, 255,    296 }, /* blue1 */
+    {   0,   0, 238,    302 }, /* blue2 */
+    {   0,   0, 205,    308 }, /* blue3 */
+    {   0,   0, 139,    314 }, /* blue4 */
+    { 138,  43, 226,    320 }, /* BlueViolet */
+    { 165,  42,  42,    331 }, /* brown */
+    { 255,  64,  64,    337 }, /* brown1 */
+    { 238,  59,  59,    344 }, /* brown2 */
+    { 205,  51,  51,    351 }, /* brown3 */
+    { 139,  35,  35,    358 }, /* brown4 */
+    { 222, 184, 135,    365 }, /* burlywood */
+    { 255, 211, 155,    375 }, /* burlywood1 */
+    { 238, 197, 145,    386 }, /* burlywood2 */
+    { 205, 170, 125,    397 }, /* burlywood3 */
+    { 139, 115,  85,    408 }, /* burlywood4 */
+    {  95, 158, 160,    419 }, /* cadet blue */
+    {  95, 158, 160,    430 }, /* CadetBlue */
+    { 152, 245, 255,    440 }, /* CadetBlue1 */
+    { 142, 229, 238,    451 }, /* CadetBlue2 */
+    { 122, 197, 205,    462 }, /* CadetBlue3 */
+    {  83, 134, 139,    473 }, /* CadetBlue4 */
+    { 127, 255,   0,    484 }, /* chartreuse */
+    { 127, 255,   0,    495 }, /* chartreuse1 */
+    { 118, 238,   0,    507 }, /* chartreuse2 */
+    { 102, 205,   0,    519 }, /* chartreuse3 */
+    {  69, 139,   0,    531 }, /* chartreuse4 */
+    { 210, 105,  30,    543 }, /* chocolate */
+    { 255, 127,  36,    553 }, /* chocolate1 */
+    { 238, 118,  33,    564 }, /* chocolate2 */
+    { 205, 102,  29,    575 }, /* chocolate3 */
+    { 139,  69,  19,    586 }, /* chocolate4 */
+    { 255, 127,  80,    597 }, /* coral */
+    { 255, 114,  86,    603 }, /* coral1 */
+    { 238, 106,  80,    610 }, /* coral2 */
+    { 205,  91,  69,    617 }, /* coral3 */
+    { 139,  62,  47,    624 }, /* coral4 */
+    { 100, 149, 237,    631 }, /* cornflower blue */
+    { 100, 149, 237,    647 }, /* CornflowerBlue */
+    { 255, 248, 220,    662 }, /* cornsilk */
+    { 255, 248, 220,    671 }, /* cornsilk1 */
+    { 238, 232, 205,    681 }, /* cornsilk2 */
+    { 205, 200, 177,    691 }, /* cornsilk3 */
+    { 139, 136, 120,    701 }, /* cornsilk4 */
+    {   0, 255, 255,    711 }, /* cyan */
+    {   0, 255, 255,    716 }, /* cyan1 */
+    {   0, 238, 238,    722 }, /* cyan2 */
+    {   0, 205, 205,    728 }, /* cyan3 */
+    {   0, 139, 139,    734 }, /* cyan4 */
+    {   0,   0, 139,    740 }, /* dark blue */
+    {   0, 139, 139,    750 }, /* dark cyan */
+    { 184, 134,  11,    760 }, /* dark goldenrod */
+    { 169, 169, 169,    775 }, /* dark gray */
+    {   0, 100,   0,    785 }, /* dark green */
+    { 169, 169, 169,    796 }, /* dark grey */
+    { 189, 183, 107,    806 }, /* dark khaki */
+    { 139,   0, 139,    817 }, /* dark magenta */
+    {  85, 107,  47,    830 }, /* dark olive green */
+    { 255, 140,   0,    847 }, /* dark orange */
+    { 153,  50, 204,    859 }, /* dark orchid */
+    { 139,   0,   0,    871 }, /* dark red */
+    { 233, 150, 122,    880 }, /* dark salmon */
+    { 143, 188, 143,    892 }, /* dark sea green */
+    {  72,  61, 139,    907 }, /* dark slate blue */
+    {  47,  79,  79,    923 }, /* dark slate gray */
+    {  47,  79,  79,    939 }, /* dark slate grey */
+    {   0, 206, 209,    955 }, /* dark turquoise */
+    { 148,   0, 211,    970 }, /* dark violet */
+    {   0,   0, 139,    982 }, /* DarkBlue */
+    {   0, 139, 139,    991 }, /* DarkCyan */
+    { 184, 134,  11,   1000 }, /* DarkGoldenrod */
+    { 255, 185,  15,   1014 }, /* DarkGoldenrod1 */
+    { 238, 173,  14,   1029 }, /* DarkGoldenrod2 */
+    { 205, 149,  12,   1044 }, /* DarkGoldenrod3 */
+    { 139, 101,   8,   1059 }, /* DarkGoldenrod4 */
+    { 169, 169, 169,   1074 }, /* DarkGray */
+    {   0, 100,   0,   1083 }, /* DarkGreen */
+    { 169, 169, 169,   1093 }, /* DarkGrey */
+    { 189, 183, 107,   1102 }, /* DarkKhaki */
+    { 139,   0, 139,   1112 }, /* DarkMagenta */
+    {  85, 107,  47,   1124 }, /* DarkOliveGreen */
+    { 202, 255, 112,   1139 }, /* DarkOliveGreen1 */
+    { 188, 238, 104,   1155 }, /* DarkOliveGreen2 */
+    { 162, 205,  90,   1171 }, /* DarkOliveGreen3 */
+    { 110, 139,  61,   1187 }, /* DarkOliveGreen4 */
+    { 255, 140,   0,   1203 }, /* DarkOrange */
+    { 255, 127,   0,   1214 }, /* DarkOrange1 */
+    { 238, 118,   0,   1226 }, /* DarkOrange2 */
+    { 205, 102,   0,   1238 }, /* DarkOrange3 */
+    { 139,  69,   0,   1250 }, /* DarkOrange4 */
+    { 153,  50, 204,   1262 }, /* DarkOrchid */
+    { 191,  62, 255,   1273 }, /* DarkOrchid1 */
+    { 178,  58, 238,   1285 }, /* DarkOrchid2 */
+    { 154,  50, 205,   1297 }, /* DarkOrchid3 */
+    { 104,  34, 139,   1309 }, /* DarkOrchid4 */
+    { 139,   0,   0,   1321 }, /* DarkRed */
+    { 233, 150, 122,   1329 }, /* DarkSalmon */
+    { 143, 188, 143,   1340 }, /* DarkSeaGreen */
+    { 193, 255, 193,   1353 }, /* DarkSeaGreen1 */
+    { 180, 238, 180,   1367 }, /* DarkSeaGreen2 */
+    { 155, 205, 155,   1381 }, /* DarkSeaGreen3 */
+    { 105, 139, 105,   1395 }, /* DarkSeaGreen4 */
+    {  72,  61, 139,   1409 }, /* DarkSlateBlue */
+    {  47,  79,  79,   1423 }, /* DarkSlateGray */
+    { 151, 255, 255,   1437 }, /* DarkSlateGray1 */
+    { 141, 238, 238,   1452 }, /* DarkSlateGray2 */
+    { 121, 205, 205,   1467 }, /* DarkSlateGray3 */
+    {  82, 139, 139,   1482 }, /* DarkSlateGray4 */
+    {  47,  79,  79,   1497 }, /* DarkSlateGrey */
+    {   0, 206, 209,   1511 }, /* DarkTurquoise */
+    { 148,   0, 211,   1525 }, /* DarkViolet */
+    { 255,  20, 147,   1536 }, /* deep pink */
+    {   0, 191, 255,   1546 }, /* deep sky blue */
+    { 255,  20, 147,   1560 }, /* DeepPink */
+    { 255,  20, 147,   1569 }, /* DeepPink1 */
+    { 238,  18, 137,   1579 }, /* DeepPink2 */
+    { 205,  16, 118,   1589 }, /* DeepPink3 */
+    { 139,  10,  80,   1599 }, /* DeepPink4 */
+    {   0, 191, 255,   1609 }, /* DeepSkyBlue */
+    {   0, 191, 255,   1621 }, /* DeepSkyBlue1 */
+    {   0, 178, 238,   1634 }, /* DeepSkyBlue2 */
+    {   0, 154, 205,   1647 }, /* DeepSkyBlue3 */
+    {   0, 104, 139,   1660 }, /* DeepSkyBlue4 */
+    { 105, 105, 105,   1673 }, /* dim gray */
+    { 105, 105, 105,   1682 }, /* dim grey */
+    { 105, 105, 105,   1691 }, /* DimGray */
+    { 105, 105, 105,   1699 }, /* DimGrey */
+    {  30, 144, 255,   1707 }, /* dodger blue */
+    {  30, 144, 255,   1719 }, /* DodgerBlue */
+    {  30, 144, 255,   1730 }, /* DodgerBlue1 */
+    {  28, 134, 238,   1742 }, /* DodgerBlue2 */
+    {  24, 116, 205,   1754 }, /* DodgerBlue3 */
+    {  16,  78, 139,   1766 }, /* DodgerBlue4 */
+    { 178,  34,  34,   1778 }, /* firebrick */
+    { 255,  48,  48,   1788 }, /* firebrick1 */
+    { 238,  44,  44,   1799 }, /* firebrick2 */
+    { 205,  38,  38,   1810 }, /* firebrick3 */
+    { 139,  26,  26,   1821 }, /* firebrick4 */
+    { 255, 250, 240,   1832 }, /* floral white */
+    { 255, 250, 240,   1845 }, /* FloralWhite */
+    {  34, 139,  34,   1857 }, /* forest green */
+    {  34, 139,  34,   1870 }, /* ForestGreen */
+    { 220, 220, 220,   1882 }, /* gainsboro */
+    { 248, 248, 255,   1892 }, /* ghost white */
+    { 248, 248, 255,   1904 }, /* GhostWhite */
+    { 255, 215,   0,   1915 }, /* gold */
+    { 255, 215,   0,   1920 }, /* gold1 */
+    { 238, 201,   0,   1926 }, /* gold2 */
+    { 205, 173,   0,   1932 }, /* gold3 */
+    { 139, 117,   0,   1938 }, /* gold4 */
+    { 218, 165,  32,   1944 }, /* goldenrod */
+    { 255, 193,  37,   1954 }, /* goldenrod1 */
+    { 238, 180,  34,   1965 }, /* goldenrod2 */
+    { 205, 155,  29,   1976 }, /* goldenrod3 */
+    { 139, 105,  20,   1987 }, /* goldenrod4 */
+    { 190, 190, 190,   1998 }, /* gray */
+    {   0,   0,   0,   2003 }, /* gray0 */
+    {   3,   3,   3,   2009 }, /* gray1 */
+    {  26,  26,  26,   2015 }, /* gray10 */
+    { 255, 255, 255,   2022 }, /* gray100 */
+    {  28,  28,  28,   2030 }, /* gray11 */
+    {  31,  31,  31,   2037 }, /* gray12 */
+    {  33,  33,  33,   2044 }, /* gray13 */
+    {  36,  36,  36,   2051 }, /* gray14 */
+    {  38,  38,  38,   2058 }, /* gray15 */
+    {  41,  41,  41,   2065 }, /* gray16 */
+    {  43,  43,  43,   2072 }, /* gray17 */
+    {  46,  46,  46,   2079 }, /* gray18 */
+    {  48,  48,  48,   2086 }, /* gray19 */
+    {   5,   5,   5,   2093 }, /* gray2 */
+    {  51,  51,  51,   2099 }, /* gray20 */
+    {  54,  54,  54,   2106 }, /* gray21 */
+    {  56,  56,  56,   2113 }, /* gray22 */
+    {  59,  59,  59,   2120 }, /* gray23 */
+    {  61,  61,  61,   2127 }, /* gray24 */
+    {  64,  64,  64,   2134 }, /* gray25 */
+    {  66,  66,  66,   2141 }, /* gray26 */
+    {  69,  69,  69,   2148 }, /* gray27 */
+    {  71,  71,  71,   2155 }, /* gray28 */
+    {  74,  74,  74,   2162 }, /* gray29 */
+    {   8,   8,   8,   2169 }, /* gray3 */
+    {  77,  77,  77,   2175 }, /* gray30 */
+    {  79,  79,  79,   2182 }, /* gray31 */
+    {  82,  82,  82,   2189 }, /* gray32 */
+    {  84,  84,  84,   2196 }, /* gray33 */
+    {  87,  87,  87,   2203 }, /* gray34 */
+    {  89,  89,  89,   2210 }, /* gray35 */
+    {  92,  92,  92,   2217 }, /* gray36 */
+    {  94,  94,  94,   2224 }, /* gray37 */
+    {  97,  97,  97,   2231 }, /* gray38 */
+    {  99,  99,  99,   2238 }, /* gray39 */
+    {  10,  10,  10,   2245 }, /* gray4 */
+    { 102, 102, 102,   2251 }, /* gray40 */
+    { 105, 105, 105,   2258 }, /* gray41 */
+    { 107, 107, 107,   2265 }, /* gray42 */
+    { 110, 110, 110,   2272 }, /* gray43 */
+    { 112, 112, 112,   2279 }, /* gray44 */
+    { 115, 115, 115,   2286 }, /* gray45 */
+    { 117, 117, 117,   2293 }, /* gray46 */
+    { 120, 120, 120,   2300 }, /* gray47 */
+    { 122, 122, 122,   2307 }, /* gray48 */
+    { 125, 125, 125,   2314 }, /* gray49 */
+    {  13,  13,  13,   2321 }, /* gray5 */
+    { 127, 127, 127,   2327 }, /* gray50 */
+    { 130, 130, 130,   2334 }, /* gray51 */
+    { 133, 133, 133,   2341 }, /* gray52 */
+    { 135, 135, 135,   2348 }, /* gray53 */
+    { 138, 138, 138,   2355 }, /* gray54 */
+    { 140, 140, 140,   2362 }, /* gray55 */
+    { 143, 143, 143,   2369 }, /* gray56 */
+    { 145, 145, 145,   2376 }, /* gray57 */
+    { 148, 148, 148,   2383 }, /* gray58 */
+    { 150, 150, 150,   2390 }, /* gray59 */
+    {  15,  15,  15,   2397 }, /* gray6 */
+    { 153, 153, 153,   2403 }, /* gray60 */
+    { 156, 156, 156,   2410 }, /* gray61 */
+    { 158, 158, 158,   2417 }, /* gray62 */
+    { 161, 161, 161,   2424 }, /* gray63 */
+    { 163, 163, 163,   2431 }, /* gray64 */
+    { 166, 166, 166,   2438 }, /* gray65 */
+    { 168, 168, 168,   2445 }, /* gray66 */
+    { 171, 171, 171,   2452 }, /* gray67 */
+    { 173, 173, 173,   2459 }, /* gray68 */
+    { 176, 176, 176,   2466 }, /* gray69 */
+    {  18,  18,  18,   2473 }, /* gray7 */
+    { 179, 179, 179,   2479 }, /* gray70 */
+    { 181, 181, 181,   2486 }, /* gray71 */
+    { 184, 184, 184,   2493 }, /* gray72 */
+    { 186, 186, 186,   2500 }, /* gray73 */
+    { 189, 189, 189,   2507 }, /* gray74 */
+    { 191, 191, 191,   2514 }, /* gray75 */
+    { 194, 194, 194,   2521 }, /* gray76 */
+    { 196, 196, 196,   2528 }, /* gray77 */
+    { 199, 199, 199,   2535 }, /* gray78 */
+    { 201, 201, 201,   2542 }, /* gray79 */
+    {  20,  20,  20,   2549 }, /* gray8 */
+    { 204, 204, 204,   2555 }, /* gray80 */
+    { 207, 207, 207,   2562 }, /* gray81 */
+    { 209, 209, 209,   2569 }, /* gray82 */
+    { 212, 212, 212,   2576 }, /* gray83 */
+    { 214, 214, 214,   2583 }, /* gray84 */
+    { 217, 217, 217,   2590 }, /* gray85 */
+    { 219, 219, 219,   2597 }, /* gray86 */
+    { 222, 222, 222,   2604 }, /* gray87 */
+    { 224, 224, 224,   2611 }, /* gray88 */
+    { 227, 227, 227,   2618 }, /* gray89 */
+    {  23,  23,  23,   2625 }, /* gray9 */
+    { 229, 229, 229,   2631 }, /* gray90 */
+    { 232, 232, 232,   2638 }, /* gray91 */
+    { 235, 235, 235,   2645 }, /* gray92 */
+    { 237, 237, 237,   2652 }, /* gray93 */
+    { 240, 240, 240,   2659 }, /* gray94 */
+    { 242, 242, 242,   2666 }, /* gray95 */
+    { 245, 245, 245,   2673 }, /* gray96 */
+    { 247, 247, 247,   2680 }, /* gray97 */
+    { 250, 250, 250,   2687 }, /* gray98 */
+    { 252, 252, 252,   2694 }, /* gray99 */
+    {   0, 255,   0,   2701 }, /* green */
+    { 173, 255,  47,   2707 }, /* green yellow */
+    {   0, 255,   0,   2720 }, /* green1 */
+    {   0, 238,   0,   2727 }, /* green2 */
+    {   0, 205,   0,   2734 }, /* green3 */
+    {   0, 139,   0,   2741 }, /* green4 */
+    { 173, 255,  47,   2748 }, /* GreenYellow */
+    { 190, 190, 190,   2760 }, /* grey */
+    {   0,   0,   0,   2765 }, /* grey0 */
+    {   3,   3,   3,   2771 }, /* grey1 */
+    {  26,  26,  26,   2777 }, /* grey10 */
+    { 255, 255, 255,   2784 }, /* grey100 */
+    {  28,  28,  28,   2792 }, /* grey11 */
+    {  31,  31,  31,   2799 }, /* grey12 */
+    {  33,  33,  33,   2806 }, /* grey13 */
+    {  36,  36,  36,   2813 }, /* grey14 */
+    {  38,  38,  38,   2820 }, /* grey15 */
+    {  41,  41,  41,   2827 }, /* grey16 */
+    {  43,  43,  43,   2834 }, /* grey17 */
+    {  46,  46,  46,   2841 }, /* grey18 */
+    {  48,  48,  48,   2848 }, /* grey19 */
+    {   5,   5,   5,   2855 }, /* grey2 */
+    {  51,  51,  51,   2861 }, /* grey20 */
+    {  54,  54,  54,   2868 }, /* grey21 */
+    {  56,  56,  56,   2875 }, /* grey22 */
+    {  59,  59,  59,   2882 }, /* grey23 */
+    {  61,  61,  61,   2889 }, /* grey24 */
+    {  64,  64,  64,   2896 }, /* grey25 */
+    {  66,  66,  66,   2903 }, /* grey26 */
+    {  69,  69,  69,   2910 }, /* grey27 */
+    {  71,  71,  71,   2917 }, /* grey28 */
+    {  74,  74,  74,   2924 }, /* grey29 */
+    {   8,   8,   8,   2931 }, /* grey3 */
+    {  77,  77,  77,   2937 }, /* grey30 */
+    {  79,  79,  79,   2944 }, /* grey31 */
+    {  82,  82,  82,   2951 }, /* grey32 */
+    {  84,  84,  84,   2958 }, /* grey33 */
+    {  87,  87,  87,   2965 }, /* grey34 */
+    {  89,  89,  89,   2972 }, /* grey35 */
+    {  92,  92,  92,   2979 }, /* grey36 */
+    {  94,  94,  94,   2986 }, /* grey37 */
+    {  97,  97,  97,   2993 }, /* grey38 */
+    {  99,  99,  99,   3000 }, /* grey39 */
+    {  10,  10,  10,   3007 }, /* grey4 */
+    { 102, 102, 102,   3013 }, /* grey40 */
+    { 105, 105, 105,   3020 }, /* grey41 */
+    { 107, 107, 107,   3027 }, /* grey42 */
+    { 110, 110, 110,   3034 }, /* grey43 */
+    { 112, 112, 112,   3041 }, /* grey44 */
+    { 115, 115, 115,   3048 }, /* grey45 */
+    { 117, 117, 117,   3055 }, /* grey46 */
+    { 120, 120, 120,   3062 }, /* grey47 */
+    { 122, 122, 122,   3069 }, /* grey48 */
+    { 125, 125, 125,   3076 }, /* grey49 */
+    {  13,  13,  13,   3083 }, /* grey5 */
+    { 127, 127, 127,   3089 }, /* grey50 */
+    { 130, 130, 130,   3096 }, /* grey51 */
+    { 133, 133, 133,   3103 }, /* grey52 */
+    { 135, 135, 135,   3110 }, /* grey53 */
+    { 138, 138, 138,   3117 }, /* grey54 */
+    { 140, 140, 140,   3124 }, /* grey55 */
+    { 143, 143, 143,   3131 }, /* grey56 */
+    { 145, 145, 145,   3138 }, /* grey57 */
+    { 148, 148, 148,   3145 }, /* grey58 */
+    { 150, 150, 150,   3152 }, /* grey59 */
+    {  15,  15,  15,   3159 }, /* grey6 */
+    { 153, 153, 153,   3165 }, /* grey60 */
+    { 156, 156, 156,   3172 }, /* grey61 */
+    { 158, 158, 158,   3179 }, /* grey62 */
+    { 161, 161, 161,   3186 }, /* grey63 */
+    { 163, 163, 163,   3193 }, /* grey64 */
+    { 166, 166, 166,   3200 }, /* grey65 */
+    { 168, 168, 168,   3207 }, /* grey66 */
+    { 171, 171, 171,   3214 }, /* grey67 */
+    { 173, 173, 173,   3221 }, /* grey68 */
+    { 176, 176, 176,   3228 }, /* grey69 */
+    {  18,  18,  18,   3235 }, /* grey7 */
+    { 179, 179, 179,   3241 }, /* grey70 */
+    { 181, 181, 181,   3248 }, /* grey71 */
+    { 184, 184, 184,   3255 }, /* grey72 */
+    { 186, 186, 186,   3262 }, /* grey73 */
+    { 189, 189, 189,   3269 }, /* grey74 */
+    { 191, 191, 191,   3276 }, /* grey75 */
+    { 194, 194, 194,   3283 }, /* grey76 */
+    { 196, 196, 196,   3290 }, /* grey77 */
+    { 199, 199, 199,   3297 }, /* grey78 */
+    { 201, 201, 201,   3304 }, /* grey79 */
+    {  20,  20,  20,   3311 }, /* grey8 */
+    { 204, 204, 204,   3317 }, /* grey80 */
+    { 207, 207, 207,   3324 }, /* grey81 */
+    { 209, 209, 209,   3331 }, /* grey82 */
+    { 212, 212, 212,   3338 }, /* grey83 */
+    { 214, 214, 214,   3345 }, /* grey84 */
+    { 217, 217, 217,   3352 }, /* grey85 */
+    { 219, 219, 219,   3359 }, /* grey86 */
+    { 222, 222, 222,   3366 }, /* grey87 */
+    { 224, 224, 224,   3373 }, /* grey88 */
+    { 227, 227, 227,   3380 }, /* grey89 */
+    {  23,  23,  23,   3387 }, /* grey9 */
+    { 229, 229, 229,   3393 }, /* grey90 */
+    { 232, 232, 232,   3400 }, /* grey91 */
+    { 235, 235, 235,   3407 }, /* grey92 */
+    { 237, 237, 237,   3414 }, /* grey93 */
+    { 240, 240, 240,   3421 }, /* grey94 */
+    { 242, 242, 242,   3428 }, /* grey95 */
+    { 245, 245, 245,   3435 }, /* grey96 */
+    { 247, 247, 247,   3442 }, /* grey97 */
+    { 250, 250, 250,   3449 }, /* grey98 */
+    { 252, 252, 252,   3456 }, /* grey99 */
+    { 240, 255, 240,   3463 }, /* honeydew */
+    { 240, 255, 240,   3472 }, /* honeydew1 */
+    { 224, 238, 224,   3482 }, /* honeydew2 */
+    { 193, 205, 193,   3492 }, /* honeydew3 */
+    { 131, 139, 131,   3502 }, /* honeydew4 */
+    { 255, 105, 180,   3512 }, /* hot pink */
+    { 255, 105, 180,   3521 }, /* HotPink */
+    { 255, 110, 180,   3529 }, /* HotPink1 */
+    { 238, 106, 167,   3538 }, /* HotPink2 */
+    { 205,  96, 144,   3547 }, /* HotPink3 */
+    { 139,  58,  98,   3556 }, /* HotPink4 */
+    { 205,  92,  92,   3565 }, /* indian red */
+    { 205,  92,  92,   3576 }, /* IndianRed */
+    { 255, 106, 106,   3586 }, /* IndianRed1 */
+    { 238,  99,  99,   3597 }, /* IndianRed2 */
+    { 205,  85,  85,   3608 }, /* IndianRed3 */
+    { 139,  58,  58,   3619 }, /* IndianRed4 */
+    { 255, 255, 240,   3630 }, /* ivory */
+    { 255, 255, 240,   3636 }, /* ivory1 */
+    { 238, 238, 224,   3643 }, /* ivory2 */
+    { 205, 205, 193,   3650 }, /* ivory3 */
+    { 139, 139, 131,   3657 }, /* ivory4 */
+    { 240, 230, 140,   3664 }, /* khaki */
+    { 255, 246, 143,   3670 }, /* khaki1 */
+    { 238, 230, 133,   3677 }, /* khaki2 */
+    { 205, 198, 115,   3684 }, /* khaki3 */
+    { 139, 134,  78,   3691 }, /* khaki4 */
+    { 230, 230, 250,   3698 }, /* lavender */
+    { 255, 240, 245,   3707 }, /* lavender blush */
+    { 255, 240, 245,   3722 }, /* LavenderBlush */
+    { 255, 240, 245,   3736 }, /* LavenderBlush1 */
+    { 238, 224, 229,   3751 }, /* LavenderBlush2 */
+    { 205, 193, 197,   3766 }, /* LavenderBlush3 */
+    { 139, 131, 134,   3781 }, /* LavenderBlush4 */
+    { 124, 252,   0,   3796 }, /* lawn green */
+    { 124, 252,   0,   3807 }, /* LawnGreen */
+    { 255, 250, 205,   3817 }, /* lemon chiffon */
+    { 255, 250, 205,   3831 }, /* LemonChiffon */
+    { 255, 250, 205,   3844 }, /* LemonChiffon1 */
+    { 238, 233, 191,   3858 }, /* LemonChiffon2 */
+    { 205, 201, 165,   3872 }, /* LemonChiffon3 */
+    { 139, 137, 112,   3886 }, /* LemonChiffon4 */
+    { 173, 216, 230,   3900 }, /* light blue */
+    { 240, 128, 128,   3911 }, /* light coral */
+    { 224, 255, 255,   3923 }, /* light cyan */
+    { 238, 221, 130,   3934 }, /* light goldenrod */
+    { 250, 250, 210,   3950 }, /* light goldenrod yellow */
+    { 211, 211, 211,   3973 }, /* light gray */
+    { 144, 238, 144,   3984 }, /* light green */
+    { 211, 211, 211,   3996 }, /* light grey */
+    { 255, 182, 193,   4007 }, /* light pink */
+    { 255, 160, 122,   4018 }, /* light salmon */
+    {  32, 178, 170,   4031 }, /* light sea green */
+    { 135, 206, 250,   4047 }, /* light sky blue */
+    { 132, 112, 255,   4062 }, /* light slate blue */
+    { 119, 136, 153,   4079 }, /* light slate gray */
+    { 119, 136, 153,   4096 }, /* light slate grey */
+    { 176, 196, 222,   4113 }, /* light steel blue */
+    { 255, 255, 224,   4130 }, /* light yellow */
+    { 173, 216, 230,   4143 }, /* LightBlue */
+    { 191, 239, 255,   4153 }, /* LightBlue1 */
+    { 178, 223, 238,   4164 }, /* LightBlue2 */
+    { 154, 192, 205,   4175 }, /* LightBlue3 */
+    { 104, 131, 139,   4186 }, /* LightBlue4 */
+    { 240, 128, 128,   4197 }, /* LightCoral */
+    { 224, 255, 255,   4208 }, /* LightCyan */
+    { 224, 255, 255,   4218 }, /* LightCyan1 */
+    { 209, 238, 238,   4229 }, /* LightCyan2 */
+    { 180, 205, 205,   4240 }, /* LightCyan3 */
+    { 122, 139, 139,   4251 }, /* LightCyan4 */
+    { 238, 221, 130,   4262 }, /* LightGoldenrod */
+    { 255, 236, 139,   4277 }, /* LightGoldenrod1 */
+    { 238, 220, 130,   4293 }, /* LightGoldenrod2 */
+    { 205, 190, 112,   4309 }, /* LightGoldenrod3 */
+    { 139, 129,  76,   4325 }, /* LightGoldenrod4 */
+    { 250, 250, 210,   4341 }, /* LightGoldenrodYellow */
+    { 211, 211, 211,   4362 }, /* LightGray */
+    { 144, 238, 144,   4372 }, /* LightGreen */
+    { 211, 211, 211,   4383 }, /* LightGrey */
+    { 255, 182, 193,   4393 }, /* LightPink */
+    { 255, 174, 185,   4403 }, /* LightPink1 */
+    { 238, 162, 173,   4414 }, /* LightPink2 */
+    { 205, 140, 149,   4425 }, /* LightPink3 */
+    { 139,  95, 101,   4436 }, /* LightPink4 */
+    { 255, 160, 122,   4447 }, /* LightSalmon */
+    { 255, 160, 122,   4459 }, /* LightSalmon1 */
+    { 238, 149, 114,   4472 }, /* LightSalmon2 */
+    { 205, 129,  98,   4485 }, /* LightSalmon3 */
+    { 139,  87,  66,   4498 }, /* LightSalmon4 */
+    {  32, 178, 170,   4511 }, /* LightSeaGreen */
+    { 135, 206, 250,   4525 }, /* LightSkyBlue */
+    { 176, 226, 255,   4538 }, /* LightSkyBlue1 */
+    { 164, 211, 238,   4552 }, /* LightSkyBlue2 */
+    { 141, 182, 205,   4566 }, /* LightSkyBlue3 */
+    {  96, 123, 139,   4580 }, /* LightSkyBlue4 */
+    { 132, 112, 255,   4594 }, /* LightSlateBlue */
+    { 119, 136, 153,   4609 }, /* LightSlateGray */
+    { 119, 136, 153,   4624 }, /* LightSlateGrey */
+    { 176, 196, 222,   4639 }, /* LightSteelBlue */
+    { 202, 225, 255,   4654 }, /* LightSteelBlue1 */
+    { 188, 210, 238,   4670 }, /* LightSteelBlue2 */
+    { 162, 181, 205,   4686 }, /* LightSteelBlue3 */
+    { 110, 123, 139,   4702 }, /* LightSteelBlue4 */
+    { 255, 255, 224,   4718 }, /* LightYellow */
+    { 255, 255, 224,   4730 }, /* LightYellow1 */
+    { 238, 238, 209,   4743 }, /* LightYellow2 */
+    { 205, 205, 180,   4756 }, /* LightYellow3 */
+    { 139, 139, 122,   4769 }, /* LightYellow4 */
+    {  50, 205,  50,   4782 }, /* lime green */
+    {  50, 205,  50,   4793 }, /* LimeGreen */
+    { 250, 240, 230,   4803 }, /* linen */
+    { 255,   0, 255,   4809 }, /* magenta */
+    { 255,   0, 255,   4817 }, /* magenta1 */
+    { 238,   0, 238,   4826 }, /* magenta2 */
+    { 205,   0, 205,   4835 }, /* magenta3 */
+    { 139,   0, 139,   4844 }, /* magenta4 */
+    { 176,  48,  96,   4853 }, /* maroon */
+    { 255,  52, 179,   4860 }, /* maroon1 */
+    { 238,  48, 167,   4868 }, /* maroon2 */
+    { 205,  41, 144,   4876 }, /* maroon3 */
+    { 139,  28,  98,   4884 }, /* maroon4 */
+    { 102, 205, 170,   4892 }, /* medium aquamarine */
+    {   0,   0, 205,   4910 }, /* medium blue */
+    { 186,  85, 211,   4922 }, /* medium orchid */
+    { 147, 112, 219,   4936 }, /* medium purple */
+    {  60, 179, 113,   4950 }, /* medium sea green */
+    { 123, 104, 238,   4967 }, /* medium slate blue */
+    {   0, 250, 154,   4985 }, /* medium spring green */
+    {  72, 209, 204,   5005 }, /* medium turquoise */
+    { 199,  21, 133,   5022 }, /* medium violet red */
+    { 102, 205, 170,   5040 }, /* MediumAquamarine */
+    {   0,   0, 205,   5057 }, /* MediumBlue */
+    { 186,  85, 211,   5068 }, /* MediumOrchid */
+    { 224, 102, 255,   5081 }, /* MediumOrchid1 */
+    { 209,  95, 238,   5095 }, /* MediumOrchid2 */
+    { 180,  82, 205,   5109 }, /* MediumOrchid3 */
+    { 122,  55, 139,   5123 }, /* MediumOrchid4 */
+    { 147, 112, 219,   5137 }, /* MediumPurple */
+    { 171, 130, 255,   5150 }, /* MediumPurple1 */
+    { 159, 121, 238,   5164 }, /* MediumPurple2 */
+    { 137, 104, 205,   5178 }, /* MediumPurple3 */
+    {  93,  71, 139,   5192 }, /* MediumPurple4 */
+    {  60, 179, 113,   5206 }, /* MediumSeaGreen */
+    { 123, 104, 238,   5221 }, /* MediumSlateBlue */
+    {   0, 250, 154,   5237 }, /* MediumSpringGreen */
+    {  72, 209, 204,   5255 }, /* MediumTurquoise */
+    { 199,  21, 133,   5271 }, /* MediumVioletRed */
+    {  25,  25, 112,   5287 }, /* midnight blue */
+    {  25,  25, 112,   5301 }, /* MidnightBlue */
+    { 245, 255, 250,   5314 }, /* mint cream */
+    { 245, 255, 250,   5325 }, /* MintCream */
+    { 255, 228, 225,   5335 }, /* misty rose */
+    { 255, 228, 225,   5346 }, /* MistyRose */
+    { 255, 228, 225,   5356 }, /* MistyRose1 */
+    { 238, 213, 210,   5367 }, /* MistyRose2 */
+    { 205, 183, 181,   5378 }, /* MistyRose3 */
+    { 139, 125, 123,   5389 }, /* MistyRose4 */
+    { 255, 228, 181,   5400 }, /* moccasin */
+    { 255, 222, 173,   5409 }, /* navajo white */
+    { 255, 222, 173,   5422 }, /* NavajoWhite */
+    { 255, 222, 173,   5434 }, /* NavajoWhite1 */
+    { 238, 207, 161,   5447 }, /* NavajoWhite2 */
+    { 205, 179, 139,   5460 }, /* NavajoWhite3 */
+    { 139, 121,  94,   5473 }, /* NavajoWhite4 */
+    {   0,   0, 128,   5486 }, /* navy */
+    {   0,   0, 128,   5491 }, /* navy blue */
+    {   0,   0, 128,   5501 }, /* NavyBlue */
+    { 253, 245, 230,   5510 }, /* old lace */
+    { 253, 245, 230,   5519 }, /* OldLace */
+    { 107, 142,  35,   5527 }, /* olive drab */
+    { 107, 142,  35,   5538 }, /* OliveDrab */
+    { 192, 255,  62,   5548 }, /* OliveDrab1 */
+    { 179, 238,  58,   5559 }, /* OliveDrab2 */
+    { 154, 205,  50,   5570 }, /* OliveDrab3 */
+    { 105, 139,  34,   5581 }, /* OliveDrab4 */
+    { 255, 165,   0,   5592 }, /* orange */
+    { 255,  69,   0,   5599 }, /* orange red */
+    { 255, 165,   0,   5610 }, /* orange1 */
+    { 238, 154,   0,   5618 }, /* orange2 */
+    { 205, 133,   0,   5626 }, /* orange3 */
+    { 139,  90,   0,   5634 }, /* orange4 */
+    { 255,  69,   0,   5642 }, /* OrangeRed */
+    { 255,  69,   0,   5652 }, /* OrangeRed1 */
+    { 238,  64,   0,   5663 }, /* OrangeRed2 */
+    { 205,  55,   0,   5674 }, /* OrangeRed3 */
+    { 139,  37,   0,   5685 }, /* OrangeRed4 */
+    { 218, 112, 214,   5696 }, /* orchid */
+    { 255, 131, 250,   5703 }, /* orchid1 */
+    { 238, 122, 233,   5711 }, /* orchid2 */
+    { 205, 105, 201,   5719 }, /* orchid3 */
+    { 139,  71, 137,   5727 }, /* orchid4 */
+    { 238, 232, 170,   5735 }, /* pale goldenrod */
+    { 152, 251, 152,   5750 }, /* pale green */
+    { 175, 238, 238,   5761 }, /* pale turquoise */
+    { 219, 112, 147,   5776 }, /* pale violet red */
+    { 238, 232, 170,   5792 }, /* PaleGoldenrod */
+    { 152, 251, 152,   5806 }, /* PaleGreen */
+    { 154, 255, 154,   5816 }, /* PaleGreen1 */
+    { 144, 238, 144,   5827 }, /* PaleGreen2 */
+    { 124, 205, 124,   5838 }, /* PaleGreen3 */
+    {  84, 139,  84,   5849 }, /* PaleGreen4 */
+    { 175, 238, 238,   5860 }, /* PaleTurquoise */
+    { 187, 255, 255,   5874 }, /* PaleTurquoise1 */
+    { 174, 238, 238,   5889 }, /* PaleTurquoise2 */
+    { 150, 205, 205,   5904 }, /* PaleTurquoise3 */
+    { 102, 139, 139,   5919 }, /* PaleTurquoise4 */
+    { 219, 112, 147,   5934 }, /* PaleVioletRed */
+    { 255, 130, 171,   5948 }, /* PaleVioletRed1 */
+    { 238, 121, 159,   5963 }, /* PaleVioletRed2 */
+    { 205, 104, 137,   5978 }, /* PaleVioletRed3 */
+    { 139,  71,  93,   5993 }, /* PaleVioletRed4 */
+    { 255, 239, 213,   6008 }, /* papaya whip */
+    { 255, 239, 213,   6020 }, /* PapayaWhip */
+    { 255, 218, 185,   6031 }, /* peach puff */
+    { 255, 218, 185,   6042 }, /* PeachPuff */
+    { 255, 218, 185,   6052 }, /* PeachPuff1 */
+    { 238, 203, 173,   6063 }, /* PeachPuff2 */
+    { 205, 175, 149,   6074 }, /* PeachPuff3 */
+    { 139, 119, 101,   6085 }, /* PeachPuff4 */
+    { 205, 133,  63,   6096 }, /* peru */
+    { 255, 192, 203,   6101 }, /* pink */
+    { 255, 181, 197,   6106 }, /* pink1 */
+    { 238, 169, 184,   6112 }, /* pink2 */
+    { 205, 145, 158,   6118 }, /* pink3 */
+    { 139,  99, 108,   6124 }, /* pink4 */
+    { 221, 160, 221,   6130 }, /* plum */
+    { 255, 187, 255,   6135 }, /* plum1 */
+    { 238, 174, 238,   6141 }, /* plum2 */
+    { 205, 150, 205,   6147 }, /* plum3 */
+    { 139, 102, 139,   6153 }, /* plum4 */
+    { 176, 224, 230,   6159 }, /* powder blue */
+    { 176, 224, 230,   6171 }, /* PowderBlue */
+    { 160,  32, 240,   6182 }, /* purple */
+    { 155,  48, 255,   6189 }, /* purple1 */
+    { 145,  44, 238,   6197 }, /* purple2 */
+    { 125,  38, 205,   6205 }, /* purple3 */
+    {  85,  26, 139,   6213 }, /* purple4 */
+    { 255,   0,   0,   6221 }, /* red */
+    { 255,   0,   0,   6225 }, /* red1 */
+    { 238,   0,   0,   6230 }, /* red2 */
+    { 205,   0,   0,   6235 }, /* red3 */
+    { 139,   0,   0,   6240 }, /* red4 */
+    { 188, 143, 143,   6245 }, /* rosy brown */
+    { 188, 143, 143,   6256 }, /* RosyBrown */
+    { 255, 193, 193,   6266 }, /* RosyBrown1 */
+    { 238, 180, 180,   6277 }, /* RosyBrown2 */
+    { 205, 155, 155,   6288 }, /* RosyBrown3 */
+    { 139, 105, 105,   6299 }, /* RosyBrown4 */
+    {  65, 105, 225,   6310 }, /* royal blue */
+    {  65, 105, 225,   6321 }, /* RoyalBlue */
+    {  72, 118, 255,   6331 }, /* RoyalBlue1 */
+    {  67, 110, 238,   6342 }, /* RoyalBlue2 */
+    {  58,  95, 205,   6353 }, /* RoyalBlue3 */
+    {  39,  64, 139,   6364 }, /* RoyalBlue4 */
+    { 139,  69,  19,   6375 }, /* saddle brown */
+    { 139,  69,  19,   6388 }, /* SaddleBrown */
+    { 250, 128, 114,   6400 }, /* salmon */
+    { 255, 140, 105,   6407 }, /* salmon1 */
+    { 238, 130,  98,   6415 }, /* salmon2 */
+    { 205, 112,  84,   6423 }, /* salmon3 */
+    { 139,  76,  57,   6431 }, /* salmon4 */
+    { 244, 164,  96,   6439 }, /* sandy brown */
+    { 244, 164,  96,   6451 }, /* SandyBrown */
+    {  46, 139,  87,   6462 }, /* sea green */
+    {  46, 139,  87,   6472 }, /* SeaGreen */
+    {  84, 255, 159,   6481 }, /* SeaGreen1 */
+    {  78, 238, 148,   6491 }, /* SeaGreen2 */
+    {  67, 205, 128,   6501 }, /* SeaGreen3 */
+    {  46, 139,  87,   6511 }, /* SeaGreen4 */
+    { 255, 245, 238,   6521 }, /* seashell */
+    { 255, 245, 238,   6530 }, /* seashell1 */
+    { 238, 229, 222,   6540 }, /* seashell2 */
+    { 205, 197, 191,   6550 }, /* seashell3 */
+    { 139, 134, 130,   6560 }, /* seashell4 */
+    { 160,  82,  45,   6570 }, /* sienna */
+    { 255, 130,  71,   6577 }, /* sienna1 */
+    { 238, 121,  66,   6585 }, /* sienna2 */
+    { 205, 104,  57,   6593 }, /* sienna3 */
+    { 139,  71,  38,   6601 }, /* sienna4 */
+    { 135, 206, 235,   6609 }, /* sky blue */
+    { 135, 206, 235,   6618 }, /* SkyBlue */
+    { 135, 206, 255,   6626 }, /* SkyBlue1 */
+    { 126, 192, 238,   6635 }, /* SkyBlue2 */
+    { 108, 166, 205,   6644 }, /* SkyBlue3 */
+    {  74, 112, 139,   6653 }, /* SkyBlue4 */
+    { 106,  90, 205,   6662 }, /* slate blue */
+    { 112, 128, 144,   6673 }, /* slate gray */
+    { 112, 128, 144,   6684 }, /* slate grey */
+    { 106,  90, 205,   6695 }, /* SlateBlue */
+    { 131, 111, 255,   6705 }, /* SlateBlue1 */
+    { 122, 103, 238,   6716 }, /* SlateBlue2 */
+    { 105,  89, 205,   6727 }, /* SlateBlue3 */
+    {  71,  60, 139,   6738 }, /* SlateBlue4 */
+    { 112, 128, 144,   6749 }, /* SlateGray */
+    { 198, 226, 255,   6759 }, /* SlateGray1 */
+    { 185, 211, 238,   6770 }, /* SlateGray2 */
+    { 159, 182, 205,   6781 }, /* SlateGray3 */
+    { 108, 123, 139,   6792 }, /* SlateGray4 */
+    { 112, 128, 144,   6803 }, /* SlateGrey */
+    { 255, 250, 250,   6813 }, /* snow */
+    { 255, 250, 250,   6818 }, /* snow1 */
+    { 238, 233, 233,   6824 }, /* snow2 */
+    { 205, 201, 201,   6830 }, /* snow3 */
+    { 139, 137, 137,   6836 }, /* snow4 */
+    {   0, 255, 127,   6842 }, /* spring green */
+    {   0, 255, 127,   6855 }, /* SpringGreen */
+    {   0, 255, 127,   6867 }, /* SpringGreen1 */
+    {   0, 238, 118,   6880 }, /* SpringGreen2 */
+    {   0, 205, 102,   6893 }, /* SpringGreen3 */
+    {   0, 139,  69,   6906 }, /* SpringGreen4 */
+    {  70, 130, 180,   6919 }, /* steel blue */
+    {  70, 130, 180,   6930 }, /* SteelBlue */
+    {  99, 184, 255,   6940 }, /* SteelBlue1 */
+    {  92, 172, 238,   6951 }, /* SteelBlue2 */
+    {  79, 148, 205,   6962 }, /* SteelBlue3 */
+    {  54, 100, 139,   6973 }, /* SteelBlue4 */
+    { 210, 180, 140,   6984 }, /* tan */
+    { 255, 165,  79,   6988 }, /* tan1 */
+    { 238, 154,  73,   6993 }, /* tan2 */
+    { 205, 133,  63,   6998 }, /* tan3 */
+    { 139,  90,  43,   7003 }, /* tan4 */
+    { 216, 191, 216,   7008 }, /* thistle */
+    { 255, 225, 255,   7016 }, /* thistle1 */
+    { 238, 210, 238,   7025 }, /* thistle2 */
+    { 205, 181, 205,   7034 }, /* thistle3 */
+    { 139, 123, 139,   7043 }, /* thistle4 */
+    { 255,  99,  71,   7052 }, /* tomato */
+    { 255,  99,  71,   7059 }, /* tomato1 */
+    { 238,  92,  66,   7067 }, /* tomato2 */
+    { 205,  79,  57,   7075 }, /* tomato3 */
+    { 139,  54,  38,   7083 }, /* tomato4 */
+    {  64, 224, 208,   7091 }, /* turquoise */
+    {   0, 245, 255,   7101 }, /* turquoise1 */
+    {   0, 229, 238,   7112 }, /* turquoise2 */
+    {   0, 197, 205,   7123 }, /* turquoise3 */
+    {   0, 134, 139,   7134 }, /* turquoise4 */
+    { 238, 130, 238,   7145 }, /* violet */
+    { 208,  32, 144,   7152 }, /* violet red */
+    { 208,  32, 144,   7163 }, /* VioletRed */
+    { 255,  62, 150,   7173 }, /* VioletRed1 */
+    { 238,  58, 140,   7184 }, /* VioletRed2 */
+    { 205,  50, 120,   7195 }, /* VioletRed3 */
+    { 139,  34,  82,   7206 }, /* VioletRed4 */
+    { 245, 222, 179,   7217 }, /* wheat */
+    { 255, 231, 186,   7223 }, /* wheat1 */
+    { 238, 216, 174,   7230 }, /* wheat2 */
+    { 205, 186, 150,   7237 }, /* wheat3 */
+    { 139, 126, 102,   7244 }, /* wheat4 */
+    { 255, 255, 255,   7251 }, /* white */
+    { 245, 245, 245,   7257 }, /* white smoke */
+    { 245, 245, 245,   7269 }, /* WhiteSmoke */
+    { 255, 255,   0,   7280 }, /* yellow */
+    { 154, 205,  50,   7287 }, /* yellow green */
+    { 255, 255,   0,   7300 }, /* yellow1 */
+    { 238, 238,   0,   7308 }, /* yellow2 */
+    { 205, 205,   0,   7316 }, /* yellow3 */
+    { 139, 139,   0,   7324 }, /* yellow4 */
+    { 154, 205,  50,   7332 }, /* YellowGreen */
+};
 
-Bool
-OsInitColors(void)
-{
-    return TRUE;
-}
+#define NUM_BUILTIN_COLORS  (sizeof (BuiltinColors) / sizeof (BuiltinColors[0]))
 
 Bool
-OsLookupColor(int		screen, 
+OsLookupColor(int		screen,
 	      char		*s_name,
-	      unsigned int	len, 
+	      unsigned int	len,
 	      unsigned short	*pred,
 	      unsigned short	*pgreen,
 	      unsigned short	*pblue)
@@ -122,7 +1590,7 @@ OsLookupColor(int		screen,
     {
 	mid = (low + high) / 2;
 	c = &BuiltinColors[mid];
-	r = OsStrCaseCmp (&BuiltinColorNames[c->name], name, len);
+	r = strncasecmp (&BuiltinColorNames[c->name], name, len);
 	if (r == 0)
 	{
 	    *pred = c->red * 0x101;
diff --git a/os/oscolor.h b/os/oscolor.h
deleted file mode 100644
index 3d0a762..0000000
--- a/os/oscolor.h
+++ /dev/null
@@ -1,1508 +0,0 @@
-static const unsigned char BuiltinColorNames[] = {
-    "alice blue\0"
-    "AliceBlue\0"
-    "antique white\0"
-    "AntiqueWhite\0"
-    "AntiqueWhite1\0"
-    "AntiqueWhite2\0"
-    "AntiqueWhite3\0"
-    "AntiqueWhite4\0"
-    "aquamarine\0"
-    "aquamarine1\0"
-    "aquamarine2\0"
-    "aquamarine3\0"
-    "aquamarine4\0"
-    "azure\0"
-    "azure1\0"
-    "azure2\0"
-    "azure3\0"
-    "azure4\0"
-    "beige\0"
-    "bisque\0"
-    "bisque1\0"
-    "bisque2\0"
-    "bisque3\0"
-    "bisque4\0"
-    "black\0"
-    "blanched almond\0"
-    "BlanchedAlmond\0"
-    "blue\0"
-    "blue violet\0"
-    "blue1\0"
-    "blue2\0"
-    "blue3\0"
-    "blue4\0"
-    "BlueViolet\0"
-    "brown\0"
-    "brown1\0"
-    "brown2\0"
-    "brown3\0"
-    "brown4\0"
-    "burlywood\0"
-    "burlywood1\0"
-    "burlywood2\0"
-    "burlywood3\0"
-    "burlywood4\0"
-    "cadet blue\0"
-    "CadetBlue\0"
-    "CadetBlue1\0"
-    "CadetBlue2\0"
-    "CadetBlue3\0"
-    "CadetBlue4\0"
-    "chartreuse\0"
-    "chartreuse1\0"
-    "chartreuse2\0"
-    "chartreuse3\0"
-    "chartreuse4\0"
-    "chocolate\0"
-    "chocolate1\0"
-    "chocolate2\0"
-    "chocolate3\0"
-    "chocolate4\0"
-    "coral\0"
-    "coral1\0"
-    "coral2\0"
-    "coral3\0"
-    "coral4\0"
-    "cornflower blue\0"
-    "CornflowerBlue\0"
-    "cornsilk\0"
-    "cornsilk1\0"
-    "cornsilk2\0"
-    "cornsilk3\0"
-    "cornsilk4\0"
-    "cyan\0"
-    "cyan1\0"
-    "cyan2\0"
-    "cyan3\0"
-    "cyan4\0"
-    "dark blue\0"
-    "dark cyan\0"
-    "dark goldenrod\0"
-    "dark gray\0"
-    "dark green\0"
-    "dark grey\0"
-    "dark khaki\0"
-    "dark magenta\0"
-    "dark olive green\0"
-    "dark orange\0"
-    "dark orchid\0"
-    "dark red\0"
-    "dark salmon\0"
-    "dark sea green\0"
-    "dark slate blue\0"
-    "dark slate gray\0"
-    "dark slate grey\0"
-    "dark turquoise\0"
-    "dark violet\0"
-    "DarkBlue\0"
-    "DarkCyan\0"
-    "DarkGoldenrod\0"
-    "DarkGoldenrod1\0"
-    "DarkGoldenrod2\0"
-    "DarkGoldenrod3\0"
-    "DarkGoldenrod4\0"
-    "DarkGray\0"
-    "DarkGreen\0"
-    "DarkGrey\0"
-    "DarkKhaki\0"
-    "DarkMagenta\0"
-    "DarkOliveGreen\0"
-    "DarkOliveGreen1\0"
-    "DarkOliveGreen2\0"
-    "DarkOliveGreen3\0"
-    "DarkOliveGreen4\0"
-    "DarkOrange\0"
-    "DarkOrange1\0"
-    "DarkOrange2\0"
-    "DarkOrange3\0"
-    "DarkOrange4\0"
-    "DarkOrchid\0"
-    "DarkOrchid1\0"
-    "DarkOrchid2\0"
-    "DarkOrchid3\0"
-    "DarkOrchid4\0"
-    "DarkRed\0"
-    "DarkSalmon\0"
-    "DarkSeaGreen\0"
-    "DarkSeaGreen1\0"
-    "DarkSeaGreen2\0"
-    "DarkSeaGreen3\0"
-    "DarkSeaGreen4\0"
-    "DarkSlateBlue\0"
-    "DarkSlateGray\0"
-    "DarkSlateGray1\0"
-    "DarkSlateGray2\0"
-    "DarkSlateGray3\0"
-    "DarkSlateGray4\0"
-    "DarkSlateGrey\0"
-    "DarkTurquoise\0"
-    "DarkViolet\0"
-    "deep pink\0"
-    "deep sky blue\0"
-    "DeepPink\0"
-    "DeepPink1\0"
-    "DeepPink2\0"
-    "DeepPink3\0"
-    "DeepPink4\0"
-    "DeepSkyBlue\0"
-    "DeepSkyBlue1\0"
-    "DeepSkyBlue2\0"
-    "DeepSkyBlue3\0"
-    "DeepSkyBlue4\0"
-    "dim gray\0"
-    "dim grey\0"
-    "DimGray\0"
-    "DimGrey\0"
-    "dodger blue\0"
-    "DodgerBlue\0"
-    "DodgerBlue1\0"
-    "DodgerBlue2\0"
-    "DodgerBlue3\0"
-    "DodgerBlue4\0"
-    "firebrick\0"
-    "firebrick1\0"
-    "firebrick2\0"
-    "firebrick3\0"
-    "firebrick4\0"
-    "floral white\0"
-    "FloralWhite\0"
-    "forest green\0"
-    "ForestGreen\0"
-    "gainsboro\0"
-    "ghost white\0"
-    "GhostWhite\0"
-    "gold\0"
-    "gold1\0"
-    "gold2\0"
-    "gold3\0"
-    "gold4\0"
-    "goldenrod\0"
-    "goldenrod1\0"
-    "goldenrod2\0"
-    "goldenrod3\0"
-    "goldenrod4\0"
-    "gray\0"
-    "gray0\0"
-    "gray1\0"
-    "gray10\0"
-    "gray100\0"
-    "gray11\0"
-    "gray12\0"
-    "gray13\0"
-    "gray14\0"
-    "gray15\0"
-    "gray16\0"
-    "gray17\0"
-    "gray18\0"
-    "gray19\0"
-    "gray2\0"
-    "gray20\0"
-    "gray21\0"
-    "gray22\0"
-    "gray23\0"
-    "gray24\0"
-    "gray25\0"
-    "gray26\0"
-    "gray27\0"
-    "gray28\0"
-    "gray29\0"
-    "gray3\0"
-    "gray30\0"
-    "gray31\0"
-    "gray32\0"
-    "gray33\0"
-    "gray34\0"
-    "gray35\0"
-    "gray36\0"
-    "gray37\0"
-    "gray38\0"
-    "gray39\0"
-    "gray4\0"
-    "gray40\0"
-    "gray41\0"
-    "gray42\0"
-    "gray43\0"
-    "gray44\0"
-    "gray45\0"
-    "gray46\0"
-    "gray47\0"
-    "gray48\0"
-    "gray49\0"
-    "gray5\0"
-    "gray50\0"
-    "gray51\0"
-    "gray52\0"
-    "gray53\0"
-    "gray54\0"
-    "gray55\0"
-    "gray56\0"
-    "gray57\0"
-    "gray58\0"
-    "gray59\0"
-    "gray6\0"
-    "gray60\0"
-    "gray61\0"
-    "gray62\0"
-    "gray63\0"
-    "gray64\0"
-    "gray65\0"
-    "gray66\0"
-    "gray67\0"
-    "gray68\0"
-    "gray69\0"
-    "gray7\0"
-    "gray70\0"
-    "gray71\0"
-    "gray72\0"
-    "gray73\0"
-    "gray74\0"
-    "gray75\0"
-    "gray76\0"
-    "gray77\0"
-    "gray78\0"
-    "gray79\0"
-    "gray8\0"
-    "gray80\0"
-    "gray81\0"
-    "gray82\0"
-    "gray83\0"
-    "gray84\0"
-    "gray85\0"
-    "gray86\0"
-    "gray87\0"
-    "gray88\0"
-    "gray89\0"
-    "gray9\0"
-    "gray90\0"
-    "gray91\0"
-    "gray92\0"
-    "gray93\0"
-    "gray94\0"
-    "gray95\0"
-    "gray96\0"
-    "gray97\0"
-    "gray98\0"
-    "gray99\0"
-    "green\0"
-    "green yellow\0"
-    "green1\0"
-    "green2\0"
-    "green3\0"
-    "green4\0"
-    "GreenYellow\0"
-    "grey\0"
-    "grey0\0"
-    "grey1\0"
-    "grey10\0"
-    "grey100\0"
-    "grey11\0"
-    "grey12\0"
-    "grey13\0"
-    "grey14\0"
-    "grey15\0"
-    "grey16\0"
-    "grey17\0"
-    "grey18\0"
-    "grey19\0"
-    "grey2\0"
-    "grey20\0"
-    "grey21\0"
-    "grey22\0"
-    "grey23\0"
-    "grey24\0"
-    "grey25\0"
-    "grey26\0"
-    "grey27\0"
-    "grey28\0"
-    "grey29\0"
-    "grey3\0"
-    "grey30\0"
-    "grey31\0"
-    "grey32\0"
-    "grey33\0"
-    "grey34\0"
-    "grey35\0"
-    "grey36\0"
-    "grey37\0"
-    "grey38\0"
-    "grey39\0"
-    "grey4\0"
-    "grey40\0"
-    "grey41\0"
-    "grey42\0"
-    "grey43\0"
-    "grey44\0"
-    "grey45\0"
-    "grey46\0"
-    "grey47\0"
-    "grey48\0"
-    "grey49\0"
-    "grey5\0"
-    "grey50\0"
-    "grey51\0"
-    "grey52\0"
-    "grey53\0"
-    "grey54\0"
-    "grey55\0"
-    "grey56\0"
-    "grey57\0"
-    "grey58\0"
-    "grey59\0"
-    "grey6\0"
-    "grey60\0"
-    "grey61\0"
-    "grey62\0"
-    "grey63\0"
-    "grey64\0"
-    "grey65\0"
-    "grey66\0"
-    "grey67\0"
-    "grey68\0"
-    "grey69\0"
-    "grey7\0"
-    "grey70\0"
-    "grey71\0"
-    "grey72\0"
-    "grey73\0"
-    "grey74\0"
-    "grey75\0"
-    "grey76\0"
-    "grey77\0"
-    "grey78\0"
-    "grey79\0"
-    "grey8\0"
-    "grey80\0"
-    "grey81\0"
-    "grey82\0"
-    "grey83\0"
-    "grey84\0"
-    "grey85\0"
-    "grey86\0"
-    "grey87\0"
-    "grey88\0"
-    "grey89\0"
-    "grey9\0"
-    "grey90\0"
-    "grey91\0"
-    "grey92\0"
-    "grey93\0"
-    "grey94\0"
-    "grey95\0"
-    "grey96\0"
-    "grey97\0"
-    "grey98\0"
-    "grey99\0"
-    "honeydew\0"
-    "honeydew1\0"
-    "honeydew2\0"
-    "honeydew3\0"
-    "honeydew4\0"
-    "hot pink\0"
-    "HotPink\0"
-    "HotPink1\0"
-    "HotPink2\0"
-    "HotPink3\0"
-    "HotPink4\0"
-    "indian red\0"
-    "IndianRed\0"
-    "IndianRed1\0"
-    "IndianRed2\0"
-    "IndianRed3\0"
-    "IndianRed4\0"
-    "ivory\0"
-    "ivory1\0"
-    "ivory2\0"
-    "ivory3\0"
-    "ivory4\0"
-    "khaki\0"
-    "khaki1\0"
-    "khaki2\0"
-    "khaki3\0"
-    "khaki4\0"
-    "lavender\0"
-    "lavender blush\0"
-    "LavenderBlush\0"
-    "LavenderBlush1\0"
-    "LavenderBlush2\0"
-    "LavenderBlush3\0"
-    "LavenderBlush4\0"
-    "lawn green\0"
-    "LawnGreen\0"
-    "lemon chiffon\0"
-    "LemonChiffon\0"
-    "LemonChiffon1\0"
-    "LemonChiffon2\0"
-    "LemonChiffon3\0"
-    "LemonChiffon4\0"
-    "light blue\0"
-    "light coral\0"
-    "light cyan\0"
-    "light goldenrod\0"
-    "light goldenrod yellow\0"
-    "light gray\0"
-    "light green\0"
-    "light grey\0"
-    "light pink\0"
-    "light salmon\0"
-    "light sea green\0"
-    "light sky blue\0"
-    "light slate blue\0"
-    "light slate gray\0"
-    "light slate grey\0"
-    "light steel blue\0"
-    "light yellow\0"
-    "LightBlue\0"
-    "LightBlue1\0"
-    "LightBlue2\0"
-    "LightBlue3\0"
-    "LightBlue4\0"
-    "LightCoral\0"
-    "LightCyan\0"
-    "LightCyan1\0"
-    "LightCyan2\0"
-    "LightCyan3\0"
-    "LightCyan4\0"
-    "LightGoldenrod\0"
-    "LightGoldenrod1\0"
-    "LightGoldenrod2\0"
-    "LightGoldenrod3\0"
-    "LightGoldenrod4\0"
-    "LightGoldenrodYellow\0"
-    "LightGray\0"
-    "LightGreen\0"
-    "LightGrey\0"
-    "LightPink\0"
-    "LightPink1\0"
-    "LightPink2\0"
-    "LightPink3\0"
-    "LightPink4\0"
-    "LightSalmon\0"
-    "LightSalmon1\0"
-    "LightSalmon2\0"
-    "LightSalmon3\0"
-    "LightSalmon4\0"
-    "LightSeaGreen\0"
-    "LightSkyBlue\0"
-    "LightSkyBlue1\0"
-    "LightSkyBlue2\0"
-    "LightSkyBlue3\0"
-    "LightSkyBlue4\0"
-    "LightSlateBlue\0"
-    "LightSlateGray\0"
-    "LightSlateGrey\0"
-    "LightSteelBlue\0"
-    "LightSteelBlue1\0"
-    "LightSteelBlue2\0"
-    "LightSteelBlue3\0"
-    "LightSteelBlue4\0"
-    "LightYellow\0"
-    "LightYellow1\0"
-    "LightYellow2\0"
-    "LightYellow3\0"
-    "LightYellow4\0"
-    "lime green\0"
-    "LimeGreen\0"
-    "linen\0"
-    "magenta\0"
-    "magenta1\0"
-    "magenta2\0"
-    "magenta3\0"
-    "magenta4\0"
-    "maroon\0"
-    "maroon1\0"
-    "maroon2\0"
-    "maroon3\0"
-    "maroon4\0"
-    "medium aquamarine\0"
-    "medium blue\0"
-    "medium orchid\0"
-    "medium purple\0"
-    "medium sea green\0"
-    "medium slate blue\0"
-    "medium spring green\0"
-    "medium turquoise\0"
-    "medium violet red\0"
-    "MediumAquamarine\0"
-    "MediumBlue\0"
-    "MediumOrchid\0"
-    "MediumOrchid1\0"
-    "MediumOrchid2\0"
-    "MediumOrchid3\0"
-    "MediumOrchid4\0"
-    "MediumPurple\0"
-    "MediumPurple1\0"
-    "MediumPurple2\0"
-    "MediumPurple3\0"
-    "MediumPurple4\0"
-    "MediumSeaGreen\0"
-    "MediumSlateBlue\0"
-    "MediumSpringGreen\0"
-    "MediumTurquoise\0"
-    "MediumVioletRed\0"
-    "midnight blue\0"
-    "MidnightBlue\0"
-    "mint cream\0"
-    "MintCream\0"
-    "misty rose\0"
-    "MistyRose\0"
-    "MistyRose1\0"
-    "MistyRose2\0"
-    "MistyRose3\0"
-    "MistyRose4\0"
-    "moccasin\0"
-    "navajo white\0"
-    "NavajoWhite\0"
-    "NavajoWhite1\0"
-    "NavajoWhite2\0"
-    "NavajoWhite3\0"
-    "NavajoWhite4\0"
-    "navy\0"
-    "navy blue\0"
-    "NavyBlue\0"
-    "old lace\0"
-    "OldLace\0"
-    "olive drab\0"
-    "OliveDrab\0"
-    "OliveDrab1\0"
-    "OliveDrab2\0"
-    "OliveDrab3\0"
-    "OliveDrab4\0"
-    "orange\0"
-    "orange red\0"
-    "orange1\0"
-    "orange2\0"
-    "orange3\0"
-    "orange4\0"
-    "OrangeRed\0"
-    "OrangeRed1\0"
-    "OrangeRed2\0"
-    "OrangeRed3\0"
-    "OrangeRed4\0"
-    "orchid\0"
-    "orchid1\0"
-    "orchid2\0"
-    "orchid3\0"
-    "orchid4\0"
-    "pale goldenrod\0"
-    "pale green\0"
-    "pale turquoise\0"
-    "pale violet red\0"
-    "PaleGoldenrod\0"
-    "PaleGreen\0"
-    "PaleGreen1\0"
-    "PaleGreen2\0"
-    "PaleGreen3\0"
-    "PaleGreen4\0"
-    "PaleTurquoise\0"
-    "PaleTurquoise1\0"
-    "PaleTurquoise2\0"
-    "PaleTurquoise3\0"
-    "PaleTurquoise4\0"
-    "PaleVioletRed\0"
-    "PaleVioletRed1\0"
-    "PaleVioletRed2\0"
-    "PaleVioletRed3\0"
-    "PaleVioletRed4\0"
-    "papaya whip\0"
-    "PapayaWhip\0"
-    "peach puff\0"
-    "PeachPuff\0"
-    "PeachPuff1\0"
-    "PeachPuff2\0"
-    "PeachPuff3\0"
-    "PeachPuff4\0"
-    "peru\0"
-    "pink\0"
-    "pink1\0"
-    "pink2\0"
-    "pink3\0"
-    "pink4\0"
-    "plum\0"
-    "plum1\0"
-    "plum2\0"
-    "plum3\0"
-    "plum4\0"
-    "powder blue\0"
-    "PowderBlue\0"
-    "purple\0"
-    "purple1\0"
-    "purple2\0"
-    "purple3\0"
-    "purple4\0"
-    "red\0"
-    "red1\0"
-    "red2\0"
-    "red3\0"
-    "red4\0"
-    "rosy brown\0"
-    "RosyBrown\0"
-    "RosyBrown1\0"
-    "RosyBrown2\0"
-    "RosyBrown3\0"
-    "RosyBrown4\0"
-    "royal blue\0"
-    "RoyalBlue\0"
-    "RoyalBlue1\0"
-    "RoyalBlue2\0"
-    "RoyalBlue3\0"
-    "RoyalBlue4\0"
-    "saddle brown\0"
-    "SaddleBrown\0"
-    "salmon\0"
-    "salmon1\0"
-    "salmon2\0"
-    "salmon3\0"
-    "salmon4\0"
-    "sandy brown\0"
-    "SandyBrown\0"
-    "sea green\0"
-    "SeaGreen\0"
-    "SeaGreen1\0"
-    "SeaGreen2\0"
-    "SeaGreen3\0"
-    "SeaGreen4\0"
-    "seashell\0"
-    "seashell1\0"
-    "seashell2\0"
-    "seashell3\0"
-    "seashell4\0"
-    "sienna\0"
-    "sienna1\0"
-    "sienna2\0"
-    "sienna3\0"
-    "sienna4\0"
-    "sky blue\0"
-    "SkyBlue\0"
-    "SkyBlue1\0"
-    "SkyBlue2\0"
-    "SkyBlue3\0"
-    "SkyBlue4\0"
-    "slate blue\0"
-    "slate gray\0"
-    "slate grey\0"
-    "SlateBlue\0"
-    "SlateBlue1\0"
-    "SlateBlue2\0"
-    "SlateBlue3\0"
-    "SlateBlue4\0"
-    "SlateGray\0"
-    "SlateGray1\0"
-    "SlateGray2\0"
-    "SlateGray3\0"
-    "SlateGray4\0"
-    "SlateGrey\0"
-    "snow\0"
-    "snow1\0"
-    "snow2\0"
-    "snow3\0"
-    "snow4\0"
-    "spring green\0"
-    "SpringGreen\0"
-    "SpringGreen1\0"
-    "SpringGreen2\0"
-    "SpringGreen3\0"
-    "SpringGreen4\0"
-    "steel blue\0"
-    "SteelBlue\0"
-    "SteelBlue1\0"
-    "SteelBlue2\0"
-    "SteelBlue3\0"
-    "SteelBlue4\0"
-    "tan\0"
-    "tan1\0"
-    "tan2\0"
-    "tan3\0"
-    "tan4\0"
-    "thistle\0"
-    "thistle1\0"
-    "thistle2\0"
-    "thistle3\0"
-    "thistle4\0"
-    "tomato\0"
-    "tomato1\0"
-    "tomato2\0"
-    "tomato3\0"
-    "tomato4\0"
-    "turquoise\0"
-    "turquoise1\0"
-    "turquoise2\0"
-    "turquoise3\0"
-    "turquoise4\0"
-    "violet\0"
-    "violet red\0"
-    "VioletRed\0"
-    "VioletRed1\0"
-    "VioletRed2\0"
-    "VioletRed3\0"
-    "VioletRed4\0"
-    "wheat\0"
-    "wheat1\0"
-    "wheat2\0"
-    "wheat3\0"
-    "wheat4\0"
-    "white\0"
-    "white smoke\0"
-    "WhiteSmoke\0"
-    "yellow\0"
-    "yellow green\0"
-    "yellow1\0"
-    "yellow2\0"
-    "yellow3\0"
-    "yellow4\0"
-    "YellowGreen\0"
-};
-static const BuiltinColor BuiltinColors[] = {
-    { 240, 248, 255,      0 }, /* alice blue */
-    { 240, 248, 255,     11 }, /* AliceBlue */
-    { 250, 235, 215,     21 }, /* antique white */
-    { 250, 235, 215,     35 }, /* AntiqueWhite */
-    { 255, 239, 219,     48 }, /* AntiqueWhite1 */
-    { 238, 223, 204,     62 }, /* AntiqueWhite2 */
-    { 205, 192, 176,     76 }, /* AntiqueWhite3 */
-    { 139, 131, 120,     90 }, /* AntiqueWhite4 */
-    { 127, 255, 212,    104 }, /* aquamarine */
-    { 127, 255, 212,    115 }, /* aquamarine1 */
-    { 118, 238, 198,    127 }, /* aquamarine2 */
-    { 102, 205, 170,    139 }, /* aquamarine3 */
-    {  69, 139, 116,    151 }, /* aquamarine4 */
-    { 240, 255, 255,    163 }, /* azure */
-    { 240, 255, 255,    169 }, /* azure1 */
-    { 224, 238, 238,    176 }, /* azure2 */
-    { 193, 205, 205,    183 }, /* azure3 */
-    { 131, 139, 139,    190 }, /* azure4 */
-    { 245, 245, 220,    197 }, /* beige */
-    { 255, 228, 196,    203 }, /* bisque */
-    { 255, 228, 196,    210 }, /* bisque1 */
-    { 238, 213, 183,    218 }, /* bisque2 */
-    { 205, 183, 158,    226 }, /* bisque3 */
-    { 139, 125, 107,    234 }, /* bisque4 */
-    {   0,   0,   0,    242 }, /* black */
-    { 255, 235, 205,    248 }, /* blanched almond */
-    { 255, 235, 205,    264 }, /* BlanchedAlmond */
-    {   0,   0, 255,    279 }, /* blue */
-    { 138,  43, 226,    284 }, /* blue violet */
-    {   0,   0, 255,    296 }, /* blue1 */
-    {   0,   0, 238,    302 }, /* blue2 */
-    {   0,   0, 205,    308 }, /* blue3 */
-    {   0,   0, 139,    314 }, /* blue4 */
-    { 138,  43, 226,    320 }, /* BlueViolet */
-    { 165,  42,  42,    331 }, /* brown */
-    { 255,  64,  64,    337 }, /* brown1 */
-    { 238,  59,  59,    344 }, /* brown2 */
-    { 205,  51,  51,    351 }, /* brown3 */
-    { 139,  35,  35,    358 }, /* brown4 */
-    { 222, 184, 135,    365 }, /* burlywood */
-    { 255, 211, 155,    375 }, /* burlywood1 */
-    { 238, 197, 145,    386 }, /* burlywood2 */
-    { 205, 170, 125,    397 }, /* burlywood3 */
-    { 139, 115,  85,    408 }, /* burlywood4 */
-    {  95, 158, 160,    419 }, /* cadet blue */
-    {  95, 158, 160,    430 }, /* CadetBlue */
-    { 152, 245, 255,    440 }, /* CadetBlue1 */
-    { 142, 229, 238,    451 }, /* CadetBlue2 */
-    { 122, 197, 205,    462 }, /* CadetBlue3 */
-    {  83, 134, 139,    473 }, /* CadetBlue4 */
-    { 127, 255,   0,    484 }, /* chartreuse */
-    { 127, 255,   0,    495 }, /* chartreuse1 */
-    { 118, 238,   0,    507 }, /* chartreuse2 */
-    { 102, 205,   0,    519 }, /* chartreuse3 */
-    {  69, 139,   0,    531 }, /* chartreuse4 */
-    { 210, 105,  30,    543 }, /* chocolate */
-    { 255, 127,  36,    553 }, /* chocolate1 */
-    { 238, 118,  33,    564 }, /* chocolate2 */
-    { 205, 102,  29,    575 }, /* chocolate3 */
-    { 139,  69,  19,    586 }, /* chocolate4 */
-    { 255, 127,  80,    597 }, /* coral */
-    { 255, 114,  86,    603 }, /* coral1 */
-    { 238, 106,  80,    610 }, /* coral2 */
-    { 205,  91,  69,    617 }, /* coral3 */
-    { 139,  62,  47,    624 }, /* coral4 */
-    { 100, 149, 237,    631 }, /* cornflower blue */
-    { 100, 149, 237,    647 }, /* CornflowerBlue */
-    { 255, 248, 220,    662 }, /* cornsilk */
-    { 255, 248, 220,    671 }, /* cornsilk1 */
-    { 238, 232, 205,    681 }, /* cornsilk2 */
-    { 205, 200, 177,    691 }, /* cornsilk3 */
-    { 139, 136, 120,    701 }, /* cornsilk4 */
-    {   0, 255, 255,    711 }, /* cyan */
-    {   0, 255, 255,    716 }, /* cyan1 */
-    {   0, 238, 238,    722 }, /* cyan2 */
-    {   0, 205, 205,    728 }, /* cyan3 */
-    {   0, 139, 139,    734 }, /* cyan4 */
-    {   0,   0, 139,    740 }, /* dark blue */
-    {   0, 139, 139,    750 }, /* dark cyan */
-    { 184, 134,  11,    760 }, /* dark goldenrod */
-    { 169, 169, 169,    775 }, /* dark gray */
-    {   0, 100,   0,    785 }, /* dark green */
-    { 169, 169, 169,    796 }, /* dark grey */
-    { 189, 183, 107,    806 }, /* dark khaki */
-    { 139,   0, 139,    817 }, /* dark magenta */
-    {  85, 107,  47,    830 }, /* dark olive green */
-    { 255, 140,   0,    847 }, /* dark orange */
-    { 153,  50, 204,    859 }, /* dark orchid */
-    { 139,   0,   0,    871 }, /* dark red */
-    { 233, 150, 122,    880 }, /* dark salmon */
-    { 143, 188, 143,    892 }, /* dark sea green */
-    {  72,  61, 139,    907 }, /* dark slate blue */
-    {  47,  79,  79,    923 }, /* dark slate gray */
-    {  47,  79,  79,    939 }, /* dark slate grey */
-    {   0, 206, 209,    955 }, /* dark turquoise */
-    { 148,   0, 211,    970 }, /* dark violet */
-    {   0,   0, 139,    982 }, /* DarkBlue */
-    {   0, 139, 139,    991 }, /* DarkCyan */
-    { 184, 134,  11,   1000 }, /* DarkGoldenrod */
-    { 255, 185,  15,   1014 }, /* DarkGoldenrod1 */
-    { 238, 173,  14,   1029 }, /* DarkGoldenrod2 */
-    { 205, 149,  12,   1044 }, /* DarkGoldenrod3 */
-    { 139, 101,   8,   1059 }, /* DarkGoldenrod4 */
-    { 169, 169, 169,   1074 }, /* DarkGray */
-    {   0, 100,   0,   1083 }, /* DarkGreen */
-    { 169, 169, 169,   1093 }, /* DarkGrey */
-    { 189, 183, 107,   1102 }, /* DarkKhaki */
-    { 139,   0, 139,   1112 }, /* DarkMagenta */
-    {  85, 107,  47,   1124 }, /* DarkOliveGreen */
-    { 202, 255, 112,   1139 }, /* DarkOliveGreen1 */
-    { 188, 238, 104,   1155 }, /* DarkOliveGreen2 */
-    { 162, 205,  90,   1171 }, /* DarkOliveGreen3 */
-    { 110, 139,  61,   1187 }, /* DarkOliveGreen4 */
-    { 255, 140,   0,   1203 }, /* DarkOrange */
-    { 255, 127,   0,   1214 }, /* DarkOrange1 */
-    { 238, 118,   0,   1226 }, /* DarkOrange2 */
-    { 205, 102,   0,   1238 }, /* DarkOrange3 */
-    { 139,  69,   0,   1250 }, /* DarkOrange4 */
-    { 153,  50, 204,   1262 }, /* DarkOrchid */
-    { 191,  62, 255,   1273 }, /* DarkOrchid1 */
-    { 178,  58, 238,   1285 }, /* DarkOrchid2 */
-    { 154,  50, 205,   1297 }, /* DarkOrchid3 */
-    { 104,  34, 139,   1309 }, /* DarkOrchid4 */
-    { 139,   0,   0,   1321 }, /* DarkRed */
-    { 233, 150, 122,   1329 }, /* DarkSalmon */
-    { 143, 188, 143,   1340 }, /* DarkSeaGreen */
-    { 193, 255, 193,   1353 }, /* DarkSeaGreen1 */
-    { 180, 238, 180,   1367 }, /* DarkSeaGreen2 */
-    { 155, 205, 155,   1381 }, /* DarkSeaGreen3 */
-    { 105, 139, 105,   1395 }, /* DarkSeaGreen4 */
-    {  72,  61, 139,   1409 }, /* DarkSlateBlue */
-    {  47,  79,  79,   1423 }, /* DarkSlateGray */
-    { 151, 255, 255,   1437 }, /* DarkSlateGray1 */
-    { 141, 238, 238,   1452 }, /* DarkSlateGray2 */
-    { 121, 205, 205,   1467 }, /* DarkSlateGray3 */
-    {  82, 139, 139,   1482 }, /* DarkSlateGray4 */
-    {  47,  79,  79,   1497 }, /* DarkSlateGrey */
-    {   0, 206, 209,   1511 }, /* DarkTurquoise */
-    { 148,   0, 211,   1525 }, /* DarkViolet */
-    { 255,  20, 147,   1536 }, /* deep pink */
-    {   0, 191, 255,   1546 }, /* deep sky blue */
-    { 255,  20, 147,   1560 }, /* DeepPink */
-    { 255,  20, 147,   1569 }, /* DeepPink1 */
-    { 238,  18, 137,   1579 }, /* DeepPink2 */
-    { 205,  16, 118,   1589 }, /* DeepPink3 */
-    { 139,  10,  80,   1599 }, /* DeepPink4 */
-    {   0, 191, 255,   1609 }, /* DeepSkyBlue */
-    {   0, 191, 255,   1621 }, /* DeepSkyBlue1 */
-    {   0, 178, 238,   1634 }, /* DeepSkyBlue2 */
-    {   0, 154, 205,   1647 }, /* DeepSkyBlue3 */
-    {   0, 104, 139,   1660 }, /* DeepSkyBlue4 */
-    { 105, 105, 105,   1673 }, /* dim gray */
-    { 105, 105, 105,   1682 }, /* dim grey */
-    { 105, 105, 105,   1691 }, /* DimGray */
-    { 105, 105, 105,   1699 }, /* DimGrey */
-    {  30, 144, 255,   1707 }, /* dodger blue */
-    {  30, 144, 255,   1719 }, /* DodgerBlue */
-    {  30, 144, 255,   1730 }, /* DodgerBlue1 */
-    {  28, 134, 238,   1742 }, /* DodgerBlue2 */
-    {  24, 116, 205,   1754 }, /* DodgerBlue3 */
-    {  16,  78, 139,   1766 }, /* DodgerBlue4 */
-    { 178,  34,  34,   1778 }, /* firebrick */
-    { 255,  48,  48,   1788 }, /* firebrick1 */
-    { 238,  44,  44,   1799 }, /* firebrick2 */
-    { 205,  38,  38,   1810 }, /* firebrick3 */
-    { 139,  26,  26,   1821 }, /* firebrick4 */
-    { 255, 250, 240,   1832 }, /* floral white */
-    { 255, 250, 240,   1845 }, /* FloralWhite */
-    {  34, 139,  34,   1857 }, /* forest green */
-    {  34, 139,  34,   1870 }, /* ForestGreen */
-    { 220, 220, 220,   1882 }, /* gainsboro */
-    { 248, 248, 255,   1892 }, /* ghost white */
-    { 248, 248, 255,   1904 }, /* GhostWhite */
-    { 255, 215,   0,   1915 }, /* gold */
-    { 255, 215,   0,   1920 }, /* gold1 */
-    { 238, 201,   0,   1926 }, /* gold2 */
-    { 205, 173,   0,   1932 }, /* gold3 */
-    { 139, 117,   0,   1938 }, /* gold4 */
-    { 218, 165,  32,   1944 }, /* goldenrod */
-    { 255, 193,  37,   1954 }, /* goldenrod1 */
-    { 238, 180,  34,   1965 }, /* goldenrod2 */
-    { 205, 155,  29,   1976 }, /* goldenrod3 */
-    { 139, 105,  20,   1987 }, /* goldenrod4 */
-    { 190, 190, 190,   1998 }, /* gray */
-    {   0,   0,   0,   2003 }, /* gray0 */
-    {   3,   3,   3,   2009 }, /* gray1 */
-    {  26,  26,  26,   2015 }, /* gray10 */
-    { 255, 255, 255,   2022 }, /* gray100 */
-    {  28,  28,  28,   2030 }, /* gray11 */
-    {  31,  31,  31,   2037 }, /* gray12 */
-    {  33,  33,  33,   2044 }, /* gray13 */
-    {  36,  36,  36,   2051 }, /* gray14 */
-    {  38,  38,  38,   2058 }, /* gray15 */
-    {  41,  41,  41,   2065 }, /* gray16 */
-    {  43,  43,  43,   2072 }, /* gray17 */
-    {  46,  46,  46,   2079 }, /* gray18 */
-    {  48,  48,  48,   2086 }, /* gray19 */
-    {   5,   5,   5,   2093 }, /* gray2 */
-    {  51,  51,  51,   2099 }, /* gray20 */
-    {  54,  54,  54,   2106 }, /* gray21 */
-    {  56,  56,  56,   2113 }, /* gray22 */
-    {  59,  59,  59,   2120 }, /* gray23 */
-    {  61,  61,  61,   2127 }, /* gray24 */
-    {  64,  64,  64,   2134 }, /* gray25 */
-    {  66,  66,  66,   2141 }, /* gray26 */
-    {  69,  69,  69,   2148 }, /* gray27 */
-    {  71,  71,  71,   2155 }, /* gray28 */
-    {  74,  74,  74,   2162 }, /* gray29 */
-    {   8,   8,   8,   2169 }, /* gray3 */
-    {  77,  77,  77,   2175 }, /* gray30 */
-    {  79,  79,  79,   2182 }, /* gray31 */
-    {  82,  82,  82,   2189 }, /* gray32 */
-    {  84,  84,  84,   2196 }, /* gray33 */
-    {  87,  87,  87,   2203 }, /* gray34 */
-    {  89,  89,  89,   2210 }, /* gray35 */
-    {  92,  92,  92,   2217 }, /* gray36 */
-    {  94,  94,  94,   2224 }, /* gray37 */
-    {  97,  97,  97,   2231 }, /* gray38 */
-    {  99,  99,  99,   2238 }, /* gray39 */
-    {  10,  10,  10,   2245 }, /* gray4 */
-    { 102, 102, 102,   2251 }, /* gray40 */
-    { 105, 105, 105,   2258 }, /* gray41 */
-    { 107, 107, 107,   2265 }, /* gray42 */
-    { 110, 110, 110,   2272 }, /* gray43 */
-    { 112, 112, 112,   2279 }, /* gray44 */
-    { 115, 115, 115,   2286 }, /* gray45 */
-    { 117, 117, 117,   2293 }, /* gray46 */
-    { 120, 120, 120,   2300 }, /* gray47 */
-    { 122, 122, 122,   2307 }, /* gray48 */
-    { 125, 125, 125,   2314 }, /* gray49 */
-    {  13,  13,  13,   2321 }, /* gray5 */
-    { 127, 127, 127,   2327 }, /* gray50 */
-    { 130, 130, 130,   2334 }, /* gray51 */
-    { 133, 133, 133,   2341 }, /* gray52 */
-    { 135, 135, 135,   2348 }, /* gray53 */
-    { 138, 138, 138,   2355 }, /* gray54 */
-    { 140, 140, 140,   2362 }, /* gray55 */
-    { 143, 143, 143,   2369 }, /* gray56 */
-    { 145, 145, 145,   2376 }, /* gray57 */
-    { 148, 148, 148,   2383 }, /* gray58 */
-    { 150, 150, 150,   2390 }, /* gray59 */
-    {  15,  15,  15,   2397 }, /* gray6 */
-    { 153, 153, 153,   2403 }, /* gray60 */
-    { 156, 156, 156,   2410 }, /* gray61 */
-    { 158, 158, 158,   2417 }, /* gray62 */
-    { 161, 161, 161,   2424 }, /* gray63 */
-    { 163, 163, 163,   2431 }, /* gray64 */
-    { 166, 166, 166,   2438 }, /* gray65 */
-    { 168, 168, 168,   2445 }, /* gray66 */
-    { 171, 171, 171,   2452 }, /* gray67 */
-    { 173, 173, 173,   2459 }, /* gray68 */
-    { 176, 176, 176,   2466 }, /* gray69 */
-    {  18,  18,  18,   2473 }, /* gray7 */
-    { 179, 179, 179,   2479 }, /* gray70 */
-    { 181, 181, 181,   2486 }, /* gray71 */
-    { 184, 184, 184,   2493 }, /* gray72 */
-    { 186, 186, 186,   2500 }, /* gray73 */
-    { 189, 189, 189,   2507 }, /* gray74 */
-    { 191, 191, 191,   2514 }, /* gray75 */
-    { 194, 194, 194,   2521 }, /* gray76 */
-    { 196, 196, 196,   2528 }, /* gray77 */
-    { 199, 199, 199,   2535 }, /* gray78 */
-    { 201, 201, 201,   2542 }, /* gray79 */
-    {  20,  20,  20,   2549 }, /* gray8 */
-    { 204, 204, 204,   2555 }, /* gray80 */
-    { 207, 207, 207,   2562 }, /* gray81 */
-    { 209, 209, 209,   2569 }, /* gray82 */
-    { 212, 212, 212,   2576 }, /* gray83 */
-    { 214, 214, 214,   2583 }, /* gray84 */
-    { 217, 217, 217,   2590 }, /* gray85 */
-    { 219, 219, 219,   2597 }, /* gray86 */
-    { 222, 222, 222,   2604 }, /* gray87 */
-    { 224, 224, 224,   2611 }, /* gray88 */
-    { 227, 227, 227,   2618 }, /* gray89 */
-    {  23,  23,  23,   2625 }, /* gray9 */
-    { 229, 229, 229,   2631 }, /* gray90 */
-    { 232, 232, 232,   2638 }, /* gray91 */
-    { 235, 235, 235,   2645 }, /* gray92 */
-    { 237, 237, 237,   2652 }, /* gray93 */
-    { 240, 240, 240,   2659 }, /* gray94 */
-    { 242, 242, 242,   2666 }, /* gray95 */
-    { 245, 245, 245,   2673 }, /* gray96 */
-    { 247, 247, 247,   2680 }, /* gray97 */
-    { 250, 250, 250,   2687 }, /* gray98 */
-    { 252, 252, 252,   2694 }, /* gray99 */
-    {   0, 255,   0,   2701 }, /* green */
-    { 173, 255,  47,   2707 }, /* green yellow */
-    {   0, 255,   0,   2720 }, /* green1 */
-    {   0, 238,   0,   2727 }, /* green2 */
-    {   0, 205,   0,   2734 }, /* green3 */
-    {   0, 139,   0,   2741 }, /* green4 */
-    { 173, 255,  47,   2748 }, /* GreenYellow */
-    { 190, 190, 190,   2760 }, /* grey */
-    {   0,   0,   0,   2765 }, /* grey0 */
-    {   3,   3,   3,   2771 }, /* grey1 */
-    {  26,  26,  26,   2777 }, /* grey10 */
-    { 255, 255, 255,   2784 }, /* grey100 */
-    {  28,  28,  28,   2792 }, /* grey11 */
-    {  31,  31,  31,   2799 }, /* grey12 */
-    {  33,  33,  33,   2806 }, /* grey13 */
-    {  36,  36,  36,   2813 }, /* grey14 */
-    {  38,  38,  38,   2820 }, /* grey15 */
-    {  41,  41,  41,   2827 }, /* grey16 */
-    {  43,  43,  43,   2834 }, /* grey17 */
-    {  46,  46,  46,   2841 }, /* grey18 */
-    {  48,  48,  48,   2848 }, /* grey19 */
-    {   5,   5,   5,   2855 }, /* grey2 */
-    {  51,  51,  51,   2861 }, /* grey20 */
-    {  54,  54,  54,   2868 }, /* grey21 */
-    {  56,  56,  56,   2875 }, /* grey22 */
-    {  59,  59,  59,   2882 }, /* grey23 */
-    {  61,  61,  61,   2889 }, /* grey24 */
-    {  64,  64,  64,   2896 }, /* grey25 */
-    {  66,  66,  66,   2903 }, /* grey26 */
-    {  69,  69,  69,   2910 }, /* grey27 */
-    {  71,  71,  71,   2917 }, /* grey28 */
-    {  74,  74,  74,   2924 }, /* grey29 */
-    {   8,   8,   8,   2931 }, /* grey3 */
-    {  77,  77,  77,   2937 }, /* grey30 */
-    {  79,  79,  79,   2944 }, /* grey31 */
-    {  82,  82,  82,   2951 }, /* grey32 */
-    {  84,  84,  84,   2958 }, /* grey33 */
-    {  87,  87,  87,   2965 }, /* grey34 */
-    {  89,  89,  89,   2972 }, /* grey35 */
-    {  92,  92,  92,   2979 }, /* grey36 */
-    {  94,  94,  94,   2986 }, /* grey37 */
-    {  97,  97,  97,   2993 }, /* grey38 */
-    {  99,  99,  99,   3000 }, /* grey39 */
-    {  10,  10,  10,   3007 }, /* grey4 */
-    { 102, 102, 102,   3013 }, /* grey40 */
-    { 105, 105, 105,   3020 }, /* grey41 */
-    { 107, 107, 107,   3027 }, /* grey42 */
-    { 110, 110, 110,   3034 }, /* grey43 */
-    { 112, 112, 112,   3041 }, /* grey44 */
-    { 115, 115, 115,   3048 }, /* grey45 */
-    { 117, 117, 117,   3055 }, /* grey46 */
-    { 120, 120, 120,   3062 }, /* grey47 */
-    { 122, 122, 122,   3069 }, /* grey48 */
-    { 125, 125, 125,   3076 }, /* grey49 */
-    {  13,  13,  13,   3083 }, /* grey5 */
-    { 127, 127, 127,   3089 }, /* grey50 */
-    { 130, 130, 130,   3096 }, /* grey51 */
-    { 133, 133, 133,   3103 }, /* grey52 */
-    { 135, 135, 135,   3110 }, /* grey53 */
-    { 138, 138, 138,   3117 }, /* grey54 */
-    { 140, 140, 140,   3124 }, /* grey55 */
-    { 143, 143, 143,   3131 }, /* grey56 */
-    { 145, 145, 145,   3138 }, /* grey57 */
-    { 148, 148, 148,   3145 }, /* grey58 */
-    { 150, 150, 150,   3152 }, /* grey59 */
-    {  15,  15,  15,   3159 }, /* grey6 */
-    { 153, 153, 153,   3165 }, /* grey60 */
-    { 156, 156, 156,   3172 }, /* grey61 */
-    { 158, 158, 158,   3179 }, /* grey62 */
-    { 161, 161, 161,   3186 }, /* grey63 */
-    { 163, 163, 163,   3193 }, /* grey64 */
-    { 166, 166, 166,   3200 }, /* grey65 */
-    { 168, 168, 168,   3207 }, /* grey66 */
-    { 171, 171, 171,   3214 }, /* grey67 */
-    { 173, 173, 173,   3221 }, /* grey68 */
-    { 176, 176, 176,   3228 }, /* grey69 */
-    {  18,  18,  18,   3235 }, /* grey7 */
-    { 179, 179, 179,   3241 }, /* grey70 */
-    { 181, 181, 181,   3248 }, /* grey71 */
-    { 184, 184, 184,   3255 }, /* grey72 */
-    { 186, 186, 186,   3262 }, /* grey73 */
-    { 189, 189, 189,   3269 }, /* grey74 */
-    { 191, 191, 191,   3276 }, /* grey75 */
-    { 194, 194, 194,   3283 }, /* grey76 */
-    { 196, 196, 196,   3290 }, /* grey77 */
-    { 199, 199, 199,   3297 }, /* grey78 */
-    { 201, 201, 201,   3304 }, /* grey79 */
-    {  20,  20,  20,   3311 }, /* grey8 */
-    { 204, 204, 204,   3317 }, /* grey80 */
-    { 207, 207, 207,   3324 }, /* grey81 */
-    { 209, 209, 209,   3331 }, /* grey82 */
-    { 212, 212, 212,   3338 }, /* grey83 */
-    { 214, 214, 214,   3345 }, /* grey84 */
-    { 217, 217, 217,   3352 }, /* grey85 */
-    { 219, 219, 219,   3359 }, /* grey86 */
-    { 222, 222, 222,   3366 }, /* grey87 */
-    { 224, 224, 224,   3373 }, /* grey88 */
-    { 227, 227, 227,   3380 }, /* grey89 */
-    {  23,  23,  23,   3387 }, /* grey9 */
-    { 229, 229, 229,   3393 }, /* grey90 */
-    { 232, 232, 232,   3400 }, /* grey91 */
-    { 235, 235, 235,   3407 }, /* grey92 */
-    { 237, 237, 237,   3414 }, /* grey93 */
-    { 240, 240, 240,   3421 }, /* grey94 */
-    { 242, 242, 242,   3428 }, /* grey95 */
-    { 245, 245, 245,   3435 }, /* grey96 */
-    { 247, 247, 247,   3442 }, /* grey97 */
-    { 250, 250, 250,   3449 }, /* grey98 */
-    { 252, 252, 252,   3456 }, /* grey99 */
-    { 240, 255, 240,   3463 }, /* honeydew */
-    { 240, 255, 240,   3472 }, /* honeydew1 */
-    { 224, 238, 224,   3482 }, /* honeydew2 */
-    { 193, 205, 193,   3492 }, /* honeydew3 */
-    { 131, 139, 131,   3502 }, /* honeydew4 */
-    { 255, 105, 180,   3512 }, /* hot pink */
-    { 255, 105, 180,   3521 }, /* HotPink */
-    { 255, 110, 180,   3529 }, /* HotPink1 */
-    { 238, 106, 167,   3538 }, /* HotPink2 */
-    { 205,  96, 144,   3547 }, /* HotPink3 */
-    { 139,  58,  98,   3556 }, /* HotPink4 */
-    { 205,  92,  92,   3565 }, /* indian red */
-    { 205,  92,  92,   3576 }, /* IndianRed */
-    { 255, 106, 106,   3586 }, /* IndianRed1 */
-    { 238,  99,  99,   3597 }, /* IndianRed2 */
-    { 205,  85,  85,   3608 }, /* IndianRed3 */
-    { 139,  58,  58,   3619 }, /* IndianRed4 */
-    { 255, 255, 240,   3630 }, /* ivory */
-    { 255, 255, 240,   3636 }, /* ivory1 */
-    { 238, 238, 224,   3643 }, /* ivory2 */
-    { 205, 205, 193,   3650 }, /* ivory3 */
-    { 139, 139, 131,   3657 }, /* ivory4 */
-    { 240, 230, 140,   3664 }, /* khaki */
-    { 255, 246, 143,   3670 }, /* khaki1 */
-    { 238, 230, 133,   3677 }, /* khaki2 */
-    { 205, 198, 115,   3684 }, /* khaki3 */
-    { 139, 134,  78,   3691 }, /* khaki4 */
-    { 230, 230, 250,   3698 }, /* lavender */
-    { 255, 240, 245,   3707 }, /* lavender blush */
-    { 255, 240, 245,   3722 }, /* LavenderBlush */
-    { 255, 240, 245,   3736 }, /* LavenderBlush1 */
-    { 238, 224, 229,   3751 }, /* LavenderBlush2 */
-    { 205, 193, 197,   3766 }, /* LavenderBlush3 */
-    { 139, 131, 134,   3781 }, /* LavenderBlush4 */
-    { 124, 252,   0,   3796 }, /* lawn green */
-    { 124, 252,   0,   3807 }, /* LawnGreen */
-    { 255, 250, 205,   3817 }, /* lemon chiffon */
-    { 255, 250, 205,   3831 }, /* LemonChiffon */
-    { 255, 250, 205,   3844 }, /* LemonChiffon1 */
-    { 238, 233, 191,   3858 }, /* LemonChiffon2 */
-    { 205, 201, 165,   3872 }, /* LemonChiffon3 */
-    { 139, 137, 112,   3886 }, /* LemonChiffon4 */
-    { 173, 216, 230,   3900 }, /* light blue */
-    { 240, 128, 128,   3911 }, /* light coral */
-    { 224, 255, 255,   3923 }, /* light cyan */
-    { 238, 221, 130,   3934 }, /* light goldenrod */
-    { 250, 250, 210,   3950 }, /* light goldenrod yellow */
-    { 211, 211, 211,   3973 }, /* light gray */
-    { 144, 238, 144,   3984 }, /* light green */
-    { 211, 211, 211,   3996 }, /* light grey */
-    { 255, 182, 193,   4007 }, /* light pink */
-    { 255, 160, 122,   4018 }, /* light salmon */
-    {  32, 178, 170,   4031 }, /* light sea green */
-    { 135, 206, 250,   4047 }, /* light sky blue */
-    { 132, 112, 255,   4062 }, /* light slate blue */
-    { 119, 136, 153,   4079 }, /* light slate gray */
-    { 119, 136, 153,   4096 }, /* light slate grey */
-    { 176, 196, 222,   4113 }, /* light steel blue */
-    { 255, 255, 224,   4130 }, /* light yellow */
-    { 173, 216, 230,   4143 }, /* LightBlue */
-    { 191, 239, 255,   4153 }, /* LightBlue1 */
-    { 178, 223, 238,   4164 }, /* LightBlue2 */
-    { 154, 192, 205,   4175 }, /* LightBlue3 */
-    { 104, 131, 139,   4186 }, /* LightBlue4 */
-    { 240, 128, 128,   4197 }, /* LightCoral */
-    { 224, 255, 255,   4208 }, /* LightCyan */
-    { 224, 255, 255,   4218 }, /* LightCyan1 */
-    { 209, 238, 238,   4229 }, /* LightCyan2 */
-    { 180, 205, 205,   4240 }, /* LightCyan3 */
-    { 122, 139, 139,   4251 }, /* LightCyan4 */
-    { 238, 221, 130,   4262 }, /* LightGoldenrod */
-    { 255, 236, 139,   4277 }, /* LightGoldenrod1 */
-    { 238, 220, 130,   4293 }, /* LightGoldenrod2 */
-    { 205, 190, 112,   4309 }, /* LightGoldenrod3 */
-    { 139, 129,  76,   4325 }, /* LightGoldenrod4 */
-    { 250, 250, 210,   4341 }, /* LightGoldenrodYellow */
-    { 211, 211, 211,   4362 }, /* LightGray */
-    { 144, 238, 144,   4372 }, /* LightGreen */
-    { 211, 211, 211,   4383 }, /* LightGrey */
-    { 255, 182, 193,   4393 }, /* LightPink */
-    { 255, 174, 185,   4403 }, /* LightPink1 */
-    { 238, 162, 173,   4414 }, /* LightPink2 */
-    { 205, 140, 149,   4425 }, /* LightPink3 */
-    { 139,  95, 101,   4436 }, /* LightPink4 */
-    { 255, 160, 122,   4447 }, /* LightSalmon */
-    { 255, 160, 122,   4459 }, /* LightSalmon1 */
-    { 238, 149, 114,   4472 }, /* LightSalmon2 */
-    { 205, 129,  98,   4485 }, /* LightSalmon3 */
-    { 139,  87,  66,   4498 }, /* LightSalmon4 */
-    {  32, 178, 170,   4511 }, /* LightSeaGreen */
-    { 135, 206, 250,   4525 }, /* LightSkyBlue */
-    { 176, 226, 255,   4538 }, /* LightSkyBlue1 */
-    { 164, 211, 238,   4552 }, /* LightSkyBlue2 */
-    { 141, 182, 205,   4566 }, /* LightSkyBlue3 */
-    {  96, 123, 139,   4580 }, /* LightSkyBlue4 */
-    { 132, 112, 255,   4594 }, /* LightSlateBlue */
-    { 119, 136, 153,   4609 }, /* LightSlateGray */
-    { 119, 136, 153,   4624 }, /* LightSlateGrey */
-    { 176, 196, 222,   4639 }, /* LightSteelBlue */
-    { 202, 225, 255,   4654 }, /* LightSteelBlue1 */
-    { 188, 210, 238,   4670 }, /* LightSteelBlue2 */
-    { 162, 181, 205,   4686 }, /* LightSteelBlue3 */
-    { 110, 123, 139,   4702 }, /* LightSteelBlue4 */
-    { 255, 255, 224,   4718 }, /* LightYellow */
-    { 255, 255, 224,   4730 }, /* LightYellow1 */
-    { 238, 238, 209,   4743 }, /* LightYellow2 */
-    { 205, 205, 180,   4756 }, /* LightYellow3 */
-    { 139, 139, 122,   4769 }, /* LightYellow4 */
-    {  50, 205,  50,   4782 }, /* lime green */
-    {  50, 205,  50,   4793 }, /* LimeGreen */
-    { 250, 240, 230,   4803 }, /* linen */
-    { 255,   0, 255,   4809 }, /* magenta */
-    { 255,   0, 255,   4817 }, /* magenta1 */
-    { 238,   0, 238,   4826 }, /* magenta2 */
-    { 205,   0, 205,   4835 }, /* magenta3 */
-    { 139,   0, 139,   4844 }, /* magenta4 */
-    { 176,  48,  96,   4853 }, /* maroon */
-    { 255,  52, 179,   4860 }, /* maroon1 */
-    { 238,  48, 167,   4868 }, /* maroon2 */
-    { 205,  41, 144,   4876 }, /* maroon3 */
-    { 139,  28,  98,   4884 }, /* maroon4 */
-    { 102, 205, 170,   4892 }, /* medium aquamarine */
-    {   0,   0, 205,   4910 }, /* medium blue */
-    { 186,  85, 211,   4922 }, /* medium orchid */
-    { 147, 112, 219,   4936 }, /* medium purple */
-    {  60, 179, 113,   4950 }, /* medium sea green */
-    { 123, 104, 238,   4967 }, /* medium slate blue */
-    {   0, 250, 154,   4985 }, /* medium spring green */
-    {  72, 209, 204,   5005 }, /* medium turquoise */
-    { 199,  21, 133,   5022 }, /* medium violet red */
-    { 102, 205, 170,   5040 }, /* MediumAquamarine */
-    {   0,   0, 205,   5057 }, /* MediumBlue */
-    { 186,  85, 211,   5068 }, /* MediumOrchid */
-    { 224, 102, 255,   5081 }, /* MediumOrchid1 */
-    { 209,  95, 238,   5095 }, /* MediumOrchid2 */
-    { 180,  82, 205,   5109 }, /* MediumOrchid3 */
-    { 122,  55, 139,   5123 }, /* MediumOrchid4 */
-    { 147, 112, 219,   5137 }, /* MediumPurple */
-    { 171, 130, 255,   5150 }, /* MediumPurple1 */
-    { 159, 121, 238,   5164 }, /* MediumPurple2 */
-    { 137, 104, 205,   5178 }, /* MediumPurple3 */
-    {  93,  71, 139,   5192 }, /* MediumPurple4 */
-    {  60, 179, 113,   5206 }, /* MediumSeaGreen */
-    { 123, 104, 238,   5221 }, /* MediumSlateBlue */
-    {   0, 250, 154,   5237 }, /* MediumSpringGreen */
-    {  72, 209, 204,   5255 }, /* MediumTurquoise */
-    { 199,  21, 133,   5271 }, /* MediumVioletRed */
-    {  25,  25, 112,   5287 }, /* midnight blue */
-    {  25,  25, 112,   5301 }, /* MidnightBlue */
-    { 245, 255, 250,   5314 }, /* mint cream */
-    { 245, 255, 250,   5325 }, /* MintCream */
-    { 255, 228, 225,   5335 }, /* misty rose */
-    { 255, 228, 225,   5346 }, /* MistyRose */
-    { 255, 228, 225,   5356 }, /* MistyRose1 */
-    { 238, 213, 210,   5367 }, /* MistyRose2 */
-    { 205, 183, 181,   5378 }, /* MistyRose3 */
-    { 139, 125, 123,   5389 }, /* MistyRose4 */
-    { 255, 228, 181,   5400 }, /* moccasin */
-    { 255, 222, 173,   5409 }, /* navajo white */
-    { 255, 222, 173,   5422 }, /* NavajoWhite */
-    { 255, 222, 173,   5434 }, /* NavajoWhite1 */
-    { 238, 207, 161,   5447 }, /* NavajoWhite2 */
-    { 205, 179, 139,   5460 }, /* NavajoWhite3 */
-    { 139, 121,  94,   5473 }, /* NavajoWhite4 */
-    {   0,   0, 128,   5486 }, /* navy */
-    {   0,   0, 128,   5491 }, /* navy blue */
-    {   0,   0, 128,   5501 }, /* NavyBlue */
-    { 253, 245, 230,   5510 }, /* old lace */
-    { 253, 245, 230,   5519 }, /* OldLace */
-    { 107, 142,  35,   5527 }, /* olive drab */
-    { 107, 142,  35,   5538 }, /* OliveDrab */
-    { 192, 255,  62,   5548 }, /* OliveDrab1 */
-    { 179, 238,  58,   5559 }, /* OliveDrab2 */
-    { 154, 205,  50,   5570 }, /* OliveDrab3 */
-    { 105, 139,  34,   5581 }, /* OliveDrab4 */
-    { 255, 165,   0,   5592 }, /* orange */
-    { 255,  69,   0,   5599 }, /* orange red */
-    { 255, 165,   0,   5610 }, /* orange1 */
-    { 238, 154,   0,   5618 }, /* orange2 */
-    { 205, 133,   0,   5626 }, /* orange3 */
-    { 139,  90,   0,   5634 }, /* orange4 */
-    { 255,  69,   0,   5642 }, /* OrangeRed */
-    { 255,  69,   0,   5652 }, /* OrangeRed1 */
-    { 238,  64,   0,   5663 }, /* OrangeRed2 */
-    { 205,  55,   0,   5674 }, /* OrangeRed3 */
-    { 139,  37,   0,   5685 }, /* OrangeRed4 */
-    { 218, 112, 214,   5696 }, /* orchid */
-    { 255, 131, 250,   5703 }, /* orchid1 */
-    { 238, 122, 233,   5711 }, /* orchid2 */
-    { 205, 105, 201,   5719 }, /* orchid3 */
-    { 139,  71, 137,   5727 }, /* orchid4 */
-    { 238, 232, 170,   5735 }, /* pale goldenrod */
-    { 152, 251, 152,   5750 }, /* pale green */
-    { 175, 238, 238,   5761 }, /* pale turquoise */
-    { 219, 112, 147,   5776 }, /* pale violet red */
-    { 238, 232, 170,   5792 }, /* PaleGoldenrod */
-    { 152, 251, 152,   5806 }, /* PaleGreen */
-    { 154, 255, 154,   5816 }, /* PaleGreen1 */
-    { 144, 238, 144,   5827 }, /* PaleGreen2 */
-    { 124, 205, 124,   5838 }, /* PaleGreen3 */
-    {  84, 139,  84,   5849 }, /* PaleGreen4 */
-    { 175, 238, 238,   5860 }, /* PaleTurquoise */
-    { 187, 255, 255,   5874 }, /* PaleTurquoise1 */
-    { 174, 238, 238,   5889 }, /* PaleTurquoise2 */
-    { 150, 205, 205,   5904 }, /* PaleTurquoise3 */
-    { 102, 139, 139,   5919 }, /* PaleTurquoise4 */
-    { 219, 112, 147,   5934 }, /* PaleVioletRed */
-    { 255, 130, 171,   5948 }, /* PaleVioletRed1 */
-    { 238, 121, 159,   5963 }, /* PaleVioletRed2 */
-    { 205, 104, 137,   5978 }, /* PaleVioletRed3 */
-    { 139,  71,  93,   5993 }, /* PaleVioletRed4 */
-    { 255, 239, 213,   6008 }, /* papaya whip */
-    { 255, 239, 213,   6020 }, /* PapayaWhip */
-    { 255, 218, 185,   6031 }, /* peach puff */
-    { 255, 218, 185,   6042 }, /* PeachPuff */
-    { 255, 218, 185,   6052 }, /* PeachPuff1 */
-    { 238, 203, 173,   6063 }, /* PeachPuff2 */
-    { 205, 175, 149,   6074 }, /* PeachPuff3 */
-    { 139, 119, 101,   6085 }, /* PeachPuff4 */
-    { 205, 133,  63,   6096 }, /* peru */
-    { 255, 192, 203,   6101 }, /* pink */
-    { 255, 181, 197,   6106 }, /* pink1 */
-    { 238, 169, 184,   6112 }, /* pink2 */
-    { 205, 145, 158,   6118 }, /* pink3 */
-    { 139,  99, 108,   6124 }, /* pink4 */
-    { 221, 160, 221,   6130 }, /* plum */
-    { 255, 187, 255,   6135 }, /* plum1 */
-    { 238, 174, 238,   6141 }, /* plum2 */
-    { 205, 150, 205,   6147 }, /* plum3 */
-    { 139, 102, 139,   6153 }, /* plum4 */
-    { 176, 224, 230,   6159 }, /* powder blue */
-    { 176, 224, 230,   6171 }, /* PowderBlue */
-    { 160,  32, 240,   6182 }, /* purple */
-    { 155,  48, 255,   6189 }, /* purple1 */
-    { 145,  44, 238,   6197 }, /* purple2 */
-    { 125,  38, 205,   6205 }, /* purple3 */
-    {  85,  26, 139,   6213 }, /* purple4 */
-    { 255,   0,   0,   6221 }, /* red */
-    { 255,   0,   0,   6225 }, /* red1 */
-    { 238,   0,   0,   6230 }, /* red2 */
-    { 205,   0,   0,   6235 }, /* red3 */
-    { 139,   0,   0,   6240 }, /* red4 */
-    { 188, 143, 143,   6245 }, /* rosy brown */
-    { 188, 143, 143,   6256 }, /* RosyBrown */
-    { 255, 193, 193,   6266 }, /* RosyBrown1 */
-    { 238, 180, 180,   6277 }, /* RosyBrown2 */
-    { 205, 155, 155,   6288 }, /* RosyBrown3 */
-    { 139, 105, 105,   6299 }, /* RosyBrown4 */
-    {  65, 105, 225,   6310 }, /* royal blue */
-    {  65, 105, 225,   6321 }, /* RoyalBlue */
-    {  72, 118, 255,   6331 }, /* RoyalBlue1 */
-    {  67, 110, 238,   6342 }, /* RoyalBlue2 */
-    {  58,  95, 205,   6353 }, /* RoyalBlue3 */
-    {  39,  64, 139,   6364 }, /* RoyalBlue4 */
-    { 139,  69,  19,   6375 }, /* saddle brown */
-    { 139,  69,  19,   6388 }, /* SaddleBrown */
-    { 250, 128, 114,   6400 }, /* salmon */
-    { 255, 140, 105,   6407 }, /* salmon1 */
-    { 238, 130,  98,   6415 }, /* salmon2 */
-    { 205, 112,  84,   6423 }, /* salmon3 */
-    { 139,  76,  57,   6431 }, /* salmon4 */
-    { 244, 164,  96,   6439 }, /* sandy brown */
-    { 244, 164,  96,   6451 }, /* SandyBrown */
-    {  46, 139,  87,   6462 }, /* sea green */
-    {  46, 139,  87,   6472 }, /* SeaGreen */
-    {  84, 255, 159,   6481 }, /* SeaGreen1 */
-    {  78, 238, 148,   6491 }, /* SeaGreen2 */
-    {  67, 205, 128,   6501 }, /* SeaGreen3 */
-    {  46, 139,  87,   6511 }, /* SeaGreen4 */
-    { 255, 245, 238,   6521 }, /* seashell */
-    { 255, 245, 238,   6530 }, /* seashell1 */
-    { 238, 229, 222,   6540 }, /* seashell2 */
-    { 205, 197, 191,   6550 }, /* seashell3 */
-    { 139, 134, 130,   6560 }, /* seashell4 */
-    { 160,  82,  45,   6570 }, /* sienna */
-    { 255, 130,  71,   6577 }, /* sienna1 */
-    { 238, 121,  66,   6585 }, /* sienna2 */
-    { 205, 104,  57,   6593 }, /* sienna3 */
-    { 139,  71,  38,   6601 }, /* sienna4 */
-    { 135, 206, 235,   6609 }, /* sky blue */
-    { 135, 206, 235,   6618 }, /* SkyBlue */
-    { 135, 206, 255,   6626 }, /* SkyBlue1 */
-    { 126, 192, 238,   6635 }, /* SkyBlue2 */
-    { 108, 166, 205,   6644 }, /* SkyBlue3 */
-    {  74, 112, 139,   6653 }, /* SkyBlue4 */
-    { 106,  90, 205,   6662 }, /* slate blue */
-    { 112, 128, 144,   6673 }, /* slate gray */
-    { 112, 128, 144,   6684 }, /* slate grey */
-    { 106,  90, 205,   6695 }, /* SlateBlue */
-    { 131, 111, 255,   6705 }, /* SlateBlue1 */
-    { 122, 103, 238,   6716 }, /* SlateBlue2 */
-    { 105,  89, 205,   6727 }, /* SlateBlue3 */
-    {  71,  60, 139,   6738 }, /* SlateBlue4 */
-    { 112, 128, 144,   6749 }, /* SlateGray */
-    { 198, 226, 255,   6759 }, /* SlateGray1 */
-    { 185, 211, 238,   6770 }, /* SlateGray2 */
-    { 159, 182, 205,   6781 }, /* SlateGray3 */
-    { 108, 123, 139,   6792 }, /* SlateGray4 */
-    { 112, 128, 144,   6803 }, /* SlateGrey */
-    { 255, 250, 250,   6813 }, /* snow */
-    { 255, 250, 250,   6818 }, /* snow1 */
-    { 238, 233, 233,   6824 }, /* snow2 */
-    { 205, 201, 201,   6830 }, /* snow3 */
-    { 139, 137, 137,   6836 }, /* snow4 */
-    {   0, 255, 127,   6842 }, /* spring green */
-    {   0, 255, 127,   6855 }, /* SpringGreen */
-    {   0, 255, 127,   6867 }, /* SpringGreen1 */
-    {   0, 238, 118,   6880 }, /* SpringGreen2 */
-    {   0, 205, 102,   6893 }, /* SpringGreen3 */
-    {   0, 139,  69,   6906 }, /* SpringGreen4 */
-    {  70, 130, 180,   6919 }, /* steel blue */
-    {  70, 130, 180,   6930 }, /* SteelBlue */
-    {  99, 184, 255,   6940 }, /* SteelBlue1 */
-    {  92, 172, 238,   6951 }, /* SteelBlue2 */
-    {  79, 148, 205,   6962 }, /* SteelBlue3 */
-    {  54, 100, 139,   6973 }, /* SteelBlue4 */
-    { 210, 180, 140,   6984 }, /* tan */
-    { 255, 165,  79,   6988 }, /* tan1 */
-    { 238, 154,  73,   6993 }, /* tan2 */
-    { 205, 133,  63,   6998 }, /* tan3 */
-    { 139,  90,  43,   7003 }, /* tan4 */
-    { 216, 191, 216,   7008 }, /* thistle */
-    { 255, 225, 255,   7016 }, /* thistle1 */
-    { 238, 210, 238,   7025 }, /* thistle2 */
-    { 205, 181, 205,   7034 }, /* thistle3 */
-    { 139, 123, 139,   7043 }, /* thistle4 */
-    { 255,  99,  71,   7052 }, /* tomato */
-    { 255,  99,  71,   7059 }, /* tomato1 */
-    { 238,  92,  66,   7067 }, /* tomato2 */
-    { 205,  79,  57,   7075 }, /* tomato3 */
-    { 139,  54,  38,   7083 }, /* tomato4 */
-    {  64, 224, 208,   7091 }, /* turquoise */
-    {   0, 245, 255,   7101 }, /* turquoise1 */
-    {   0, 229, 238,   7112 }, /* turquoise2 */
-    {   0, 197, 205,   7123 }, /* turquoise3 */
-    {   0, 134, 139,   7134 }, /* turquoise4 */
-    { 238, 130, 238,   7145 }, /* violet */
-    { 208,  32, 144,   7152 }, /* violet red */
-    { 208,  32, 144,   7163 }, /* VioletRed */
-    { 255,  62, 150,   7173 }, /* VioletRed1 */
-    { 238,  58, 140,   7184 }, /* VioletRed2 */
-    { 205,  50, 120,   7195 }, /* VioletRed3 */
-    { 139,  34,  82,   7206 }, /* VioletRed4 */
-    { 245, 222, 179,   7217 }, /* wheat */
-    { 255, 231, 186,   7223 }, /* wheat1 */
-    { 238, 216, 174,   7230 }, /* wheat2 */
-    { 205, 186, 150,   7237 }, /* wheat3 */
-    { 139, 126, 102,   7244 }, /* wheat4 */
-    { 255, 255, 255,   7251 }, /* white */
-    { 245, 245, 245,   7257 }, /* white smoke */
-    { 245, 245, 245,   7269 }, /* WhiteSmoke */
-    { 255, 255,   0,   7280 }, /* yellow */
-    { 154, 205,  50,   7287 }, /* yellow green */
-    { 255, 255,   0,   7300 }, /* yellow1 */
-    { 238, 238,   0,   7308 }, /* yellow2 */
-    { 205, 205,   0,   7316 }, /* yellow3 */
-    { 139, 139,   0,   7324 }, /* yellow4 */
-    { 154, 205,  50,   7332 }, /* YellowGreen */
-};
diff --git a/os/osinit.c b/os/osinit.c
index 1bc8624..16a45ca 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -90,8 +90,6 @@ int limitStackSpace = -1;
 int limitNoFile = -1;
 #endif
 
-Bool OsDelayInitColors = FALSE;
-
 void
 OsInit(void)
 {
@@ -218,7 +216,6 @@ OsInit(void)
 	    SmartScheduleDisable = TRUE;
 #endif
     OsInitAllocator();
-    if (!OsDelayInitColors) OsInitColors();
 }
 
 void
commit 11f9e3520249a603b95e64503ee759998ff17feb
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed Jun 11 15:09:46 2008 +0300

    DIX: Add strncasecmp from FreeBSD, make strcasecmp args const
    
    Add strncasecmp (as we're now using it) in case someone doesn't have it,
    and also change strncasecmp args to be const, in accordance with
    everything else.

diff --git a/dix/strcasecmp.c b/dix/strcasecmp.c
index 58f0961..8f7c5c4 100644
--- a/dix/strcasecmp.c
+++ b/dix/strcasecmp.c
@@ -33,7 +33,7 @@
 
 #ifdef NEED_STRCASECMP
 int
-xstrcasecmp(char *str1,char *str2)
+xstrcasecmp(const char *str1, const char *str2)
 {
     const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
 
@@ -46,3 +46,22 @@ xstrcasecmp(char *str1,char *str2)
     return (tolower(*us1) - tolower(*us2));
 }
 #endif
+
+#ifdef NEED_STRNCASECMP
+int
+xstrncasecmp(const char *s1, const char *s2, size_t n)
+{
+    if (n != 0) {
+        const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
+
+        do {
+            if (tolower(*us1) != tolower(*us2++))
+                return (tolower(*us1) - tolower(*--us2));
+            if (*us1++ == '\0')
+                break;
+        } while (--n != 0);
+    }
+
+    return 0;
+}
+#endif
diff --git a/include/dix.h b/include/dix.h
index 300718d..a8c2b3b 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -601,7 +601,12 @@ typedef struct {
 /* strcasecmp.c */
 #if NEED_STRCASECMP
 #define strcasecmp xstrcasecmp
-extern int xstrcasecmp(char *s1, char *s2);
+extern int xstrcasecmp(const char *s1, const char *s2);
+#endif
+
+#if NEED_STRNCASECMP
+#define strncasecmp xstrncasecmp
+extern int xstrncasecmp(const char *s1, const char *s2, size_t n);
 #endif
 
 extern int XItoCoreType(int xi_type);
commit ae38151ddda9984effca5bb7c582540061201dce
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Mon May 19 08:35:05 2008 +0300

    configure.ac: Add GLX_SYS_LIBS for Xvfb and Xnest
    
    This fixes the linking for these two when using DRI2, which requires
    DLOPEN_LIBS.

diff --git a/configure.ac b/configure.ac
index ec2b062..7852a4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1204,7 +1204,7 @@ AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
 
 if test "x$XVFB" = xyes; then
 	XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
-	XVFB_SYS_LIBS="$XVFBMODULES_LIBS"
+	XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
 	AC_SUBST([XVFB_LIBS])
 	AC_SUBST([XVFB_SYS_LIBS])
 fi
@@ -1222,7 +1222,7 @@ AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
 
 if test "x$XNEST" = xyes; then
 	XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB"
-	XNEST_SYS_LIBS="$XNESTMODULES_LIBS"
+	XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
 	AC_SUBST([XNEST_LIBS])
 	AC_SUBST([XNEST_SYS_LIBS])
 fi


More information about the xorg-commit mailing list