diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 16:28:35 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-05 16:28:35 +0000 |
commit | dda10c9066a660b647384179f82e1da8e063264f (patch) | |
tree | 41997074f5d7636a49467e25ba5b844cac7af26e | |
parent | 5e363500c86042c394595e1a6633581eb8fcd1bb (diff) |
Remove all traces of external RGB database (and Speedo)
Remove all references to an external RGB database (which hasn't been enabled
for a very long time). Also get rid of some references to Speedo fonts.
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | dix/globals.c | 1 | ||||
-rw-r--r-- | hw/xfree86/Makefile.am | 1 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 15 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Configure.c | 2 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 15 | ||||
-rw-r--r-- | hw/xfree86/parser/Files.c | 9 | ||||
-rw-r--r-- | hw/xfree86/parser/xf86Parser.h | 1 | ||||
-rw-r--r-- | hw/xfree86/parser/xf86tokens.h | 1 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgcfg/expert.c | 18 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgcfg/interface.c | 6 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgcfg/startx.c | 3 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgcfg/xorgcfg.man.pre | 4 | ||||
-rw-r--r-- | hw/xfree86/utils/xorgconfig/xorgconfig.c | 13 | ||||
-rw-r--r-- | hw/xfree86/xorgconf.cpp | 6 | ||||
-rw-r--r-- | hw/xwin/InitOutput.c | 18 | ||||
-rw-r--r-- | hw/xwin/winconfig.c | 23 | ||||
-rw-r--r-- | hw/xwin/winconfig.h | 1 | ||||
-rwxr-xr-x | hw/xwin/winprocarg.c | 10 | ||||
-rw-r--r-- | include/dix-config.h.in | 9 | ||||
-rw-r--r-- | include/globals.h | 1 | ||||
-rw-r--r-- | include/site.h | 3 | ||||
-rw-r--r-- | include/xorg-server.h.in | 6 | ||||
-rw-r--r-- | os/oscolor.c | 169 | ||||
-rw-r--r-- | os/utils.c | 8 |
25 files changed, 12 insertions, 341 deletions
diff --git a/configure.ac b/configure.ac index 57132b090..10f580f47 100644 --- a/configure.ac +++ b/configure.ac @@ -454,9 +454,6 @@ AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XK AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), [ XKBOUTPUT="$withval" ], [ XKBOUTPUT="compiled" ]) -AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]), - [ RGBPATH="$withval" ], - [ RGBPATH="${datadir}/X11/rgb" ]) AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]), [ SERVERCONFIG="$withval" ], [ SERVERCONFIG="${libdir}/xserver" ]) @@ -1000,13 +997,7 @@ if test "x$XDMAUTH" = xyes; then fi fi -AM_CONDITIONAL(USE_RGB_BUILTIN, [test "x$USE_RGB_BUILTIN" = xyes]) -if test "x$USE_RGB_BUILTIN" = xyes; then - AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database]) -fi - AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) -AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path]) AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) @@ -1042,7 +1033,6 @@ else fi AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) -AC_DEFINE(USE_RGB_TXT, 1, [Use rgb.txt directly]) AC_DEFINE(MITMISC, 1, [Support MIT Misc extension]) AC_DEFINE(XTEST, 1, [Support XTest extension]) AC_DEFINE(XSYNC, 1, [Support XSync extension]) diff --git a/dix/globals.c b/dix/globals.c index f86c6026d..d76b604da 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -136,7 +136,6 @@ Bool screenSaverSuspended = FALSE; char *defaultFontPath = COMPILEDDEFAULTFONTPATH; char *defaultTextFont = COMPILEDDEFAULTFONT; char *defaultCursorFont = COMPILEDCURSORFONT; -char *rgbPath = RGB_DB; char *defaultDisplayClass = COMPILEDDISPLAYCLASS; FontPtr defaultFont; /* not declared in dix.h to avoid including font.h in every compilation of dix code */ diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 627703338..4afc3a4e5 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -100,7 +100,6 @@ optionsdir = $(libdir)/X11 dist_options_DATA = Options CPP_FILES_FLAGS = \ - -DRGBPATH=\"$(RGB_DB)\" \ -DLOCALFONTPATH="\"$(BASE_FONT_PATH)/local\"" \ -DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \ -DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \ diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index b8929c3dd..638027432 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -699,21 +699,6 @@ configFiles(XF86ConfFilesPtr fileconf) } - /* RgbPath */ - - pathFrom = X_DEFAULT; - - if (xf86coFlag) - pathFrom = X_CMDLINE; - else if (fileconf) { - if (fileconf->file_rgbpath) { - rgbPath = fileconf->file_rgbpath; - pathFrom = X_CONFIG; - } - } - - xf86Msg(pathFrom, "RgbPath set to \"%s\"\n", rgbPath); - if (fileconf && fileconf->file_inputdevs) { xf86InputDeviceList = fileconf->file_inputdevs; xf86Msg(X_CONFIG, "Input device list set to \"%s\"\n", diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index f896c29aa..0cf445cdb 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -605,8 +605,6 @@ configureFilesSection (void) ptr->file_modulepath = strdup(xf86ModulePath); if (defaultFontPath) ptr->file_fontpath = strdup(defaultFontPath); - if (rgbPath) - ptr->file_rgbpath = strdup(rgbPath); return ptr; } diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 4064ef6d8..3c657d0f0 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -373,7 +373,6 @@ The recommended font path contains the following font path elements: .I __projectroot__/lib/X11/fonts/75dpi/:unscaled .I __projectroot__/lib/X11/fonts/100dpi/:unscaled .I __projectroot__/lib/X11/fonts/Type1/ -.I __projectroot__/lib/X11/fonts/Speedo/ .I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/100dpi/ .fi @@ -383,20 +382,6 @@ Font path elements that are found to be invalid are removed from the font path when the server starts up. .RE .TP 7 -.BI "RGBPath \*q" path \*q -sets the path name for the RGB color database. -When this entry is not specified in the config file, the server falls back -to the compiled\-in default RGB path, which is: -.PP -.RS 11 -.I __projectroot__/share/X11/rgb -.RE -.PP -Note that an implicit -.I .txt -is added to this path if the server was compiled to use text rather than -binary format RGB color databases. -.TP 7 .BI "ModulePath \*q" path \*q sets the search path for loadable __xservername__ server modules. This path is a comma separated list of directories which the __xservername__ server diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c index 8cec2a91a..3777432b1 100644 --- a/hw/xfree86/parser/Files.c +++ b/hw/xfree86/parser/Files.c @@ -69,7 +69,6 @@ static xf86ConfigSymTabRec FilesTab[] = { {ENDSECTION, "endsection"}, {FONTPATH, "fontpath"}, - {RGBPATH, "rgbpath"}, {MODULEPATH, "modulepath"}, {INPUTDEVICES, "inputdevices"}, {LOGFILEPATH, "logfile"}, @@ -122,11 +121,6 @@ xf86parseFilesSection (void) strcat (ptr->file_fontpath, str); xf86conffree (val.str); break; - case RGBPATH: - if (xf86getSubToken (&(ptr->file_comment)) != STRING) - Error (QUOTE_MSG, "RGBPath"); - ptr->file_rgbpath = val.str; - break; case MODULEPATH: if (xf86getSubToken (&(ptr->file_comment)) != STRING) Error (QUOTE_MSG, "ModulePath"); @@ -216,8 +210,6 @@ xf86printFileSection (FILE * cf, XF86ConfFilesPtr ptr) fprintf (cf, "%s", ptr->file_comment); if (ptr->file_logfile) fprintf (cf, "\tLogFile \"%s\"\n", ptr->file_logfile); - if (ptr->file_rgbpath) - fprintf (cf, "\tRgbPath \"%s\"\n", ptr->file_rgbpath); if (ptr->file_modulepath) { s = ptr->file_modulepath; @@ -272,7 +264,6 @@ xf86freeFiles (XF86ConfFilesPtr p) return; TestFree (p->file_logfile); - TestFree (p->file_rgbpath); TestFree (p->file_modulepath); TestFree (p->file_inputdevs); TestFree (p->file_fontpath); diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index dc30823cc..a078361d3 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -71,7 +71,6 @@ typedef struct { char *file_logfile; - char *file_rgbpath; char *file_modulepath; char *file_inputdevs; char *file_fontpath; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index 822bbb9b7..786dac145 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -97,7 +97,6 @@ typedef enum { /* File tokens */ FONTPATH, - RGBPATH, MODULEPATH, INPUTDEVICES, LOGFILEPATH, diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c index 5c22a6e70..bb6960ce7 100644 --- a/hw/xfree86/utils/xorgcfg/expert.c +++ b/hw/xfree86/utils/xorgcfg/expert.c @@ -472,15 +472,6 @@ CreateFiles(TreeNode *files) files->child = node; files->update = UpdateFiles; - if (XF86RGB_path) - value = XF86RGB_path; - else - value = file->file_rgbpath ? file->file_rgbpath : ""; - node->next = NewNode(files, NULL, NULL, files->node, - (TreeData*)XtCalloc(1, sizeof(TreeData))); - node = node->next; - CreateFilesField(node, "RgbPath", value); - w = XtVaCreateManagedWidget("ModulePath", toggleWidgetClass, tree, XtNtreeParent, files->node, NULL); node->next = modulepath = NewNode(files, w, w, files->node, NULL); @@ -523,15 +514,6 @@ UpdateFiles(TreeNode *files) XF86Config->conf_files->file_logfile = XtNewString(str); else XF86Config->conf_files->file_logfile = NULL; - - /* LogFile */ - files = files->next; - XtVaGetValues(files->data->files.text, XtNstring, &str, NULL); - XtFree(XF86Config->conf_files->file_rgbpath); - if (*str) - XF86Config->conf_files->file_rgbpath = XtNewString(str); - else - XF86Config->conf_files->file_rgbpath = NULL; } /* FontPath */ diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c index 9b22dc7cb..cb39624ca 100644 --- a/hw/xfree86/utils/xorgcfg/interface.c +++ b/hw/xfree86/utils/xorgcfg/interface.c @@ -213,7 +213,6 @@ Usage(void) " -modulepath <module-path> "__XSERVERNAME__" modules location.\n" " -serverpath <server-path> X server to start (if $DISPLAY is not defined).\n" " -fontpath <font-path> Font path for fonts.\n" -" -rgbpath <rgb-path> Where the rgb.txt file is located.\n" #ifdef HAS_NCURSES " -textmode Use this option for the text only interface.\n" #endif @@ -270,10 +269,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[i], "-fontpath") == 0) { if (i + 1 < argc) XF86Font_path = argv[++i]; - } else if (strcmp(argv[i], "-rgbpath") == 0) { - if (i + 1 < argc) - XF86RGB_path = argv[++i]; - } + } #ifdef HAS_NCURSES else if (strcmp(argv[i], "-textmode") == 0) textmode = True; diff --git a/hw/xfree86/utils/xorgcfg/startx.c b/hw/xfree86/utils/xorgcfg/startx.c index 7b730c9aa..507afbf15 100644 --- a/hw/xfree86/utils/xorgcfg/startx.c +++ b/hw/xfree86/utils/xorgcfg/startx.c @@ -73,9 +73,6 @@ startx(void) if (XF86Font_path && ((len = sizeof(commandline) - c_pos) > 0)) c_pos += XmuSnprintf(commandline + c_pos,len, " -fontpath %s",XF86Font_path); - if (XF86RGB_path && ((len = sizeof(commandline) - c_pos) > 0)) - c_pos += XmuSnprintf(commandline + c_pos,len, - " -rgbpath %s",XF86RGB_path); if (system(commandline) != 0) { fprintf(stderr, "Failed to run \"X -configure\".\n"); diff --git a/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre b/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre index 45fbb4969..71e75e2d8 100644 --- a/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre +++ b/hw/xfree86/utils/xorgcfg/xorgcfg.man.pre @@ -84,10 +84,6 @@ __xservername__ binary. Specifies the path to the fonts that should be used by the server started by xorgcfg. .TP 8 -.I -rgbpath -Specifies the path to the rgb.txt file that should be used by the server -started by xorgcfg, if any. -.TP 8 .I -textmode If xorgcfg was compiled with support for ncurses, this option makes xorgcfg enter a text mode interface. diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c index f50b4e225..efabc9d1f 100644 --- a/hw/xfree86/utils/xorgconfig/xorgconfig.c +++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c @@ -1898,22 +1898,10 @@ static char *XF86Config_firstchunk_text = "\n" "Section \"Files\"\n" "\n" -"# The location of the RGB database. Note, this is the name of the\n" -"# file minus the extension (like \".txt\" or \".db\"). There is normally\n" -"# no need to change the default.\n" -"\n" -"# RgbPath \"" TREEROOTSHARE "/rgb\"\n" -"\n" "# Multiple FontPath entries are allowed (which are concatenated together),\n" "# as well as specifying multiple comma-separated entries in one FontPath\n" "# command (or a combination of both methods)\n" "# \n" -#if 0 -"# If you don't have a floating point coprocessor and emacs, Mosaic or other\n" -"# programs take long to start up, try moving the Type1 directory\n" -"# to the end of this list (or comment it out).\n" -#endif -"# \n" "\n"; static char *XF86Config_fontpaths[] = @@ -1923,7 +1911,6 @@ static char *XF86Config_fontpaths[] = "/misc/", "/75dpi/:unscaled", "/100dpi/:unscaled", - "/Speedo/", "/Type1/", "/TrueType/", "/freefont/", diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp index 1995045b8..acf90f13f 100644 --- a/hw/xfree86/xorgconf.cpp +++ b/hw/xfree86/xorgconf.cpp @@ -42,12 +42,6 @@ XCOMM ********************************************************************** Section "Files" -XCOMM The location of the RGB database. Note, this is the name of the -XCOMM file minus the extension (like ".txt" or ".db"). There is normally -XCOMM no need to change the default. - - RgbPath RGBPATH - XCOMM Multiple FontPath entries are allowed (which are concatenated together), XCOMM as well as specifying multiple comma-separated entries in one FontPath XCOMM command (or a combination of both methods) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index f966d4026..d2159813c 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -600,24 +600,6 @@ winFixupPaths (void) winMsg (font_from, "FontPath set to \"%s\"\n", defaultFontPath); #ifdef RELOCATE_PROJECTROOT - if (1) { - const char *libx11dir = "/usr/X11R6/lib/X11"; - size_t libx11dir_len = strlen(libx11dir); - - if (strncmp(libx11dir, rgbPath, libx11dir_len) == 0) - { - size_t newsize = strlen(rgbPath) - libx11dir_len + basedirlen; - char *compose = malloc(newsize + 1); - strcpy(compose, basedir); - strcat(compose, rgbPath + libx11dir_len); - compose[newsize] = 0; - rgbPath = xstrdup (compose); - free (compose); - - winMsg (X_DEFAULT, "RgbPath set to \"%s\"\n", rgbPath); - } - } - if (getenv("XKEYSYMDB") == NULL) { char buffer[MAX_PATH]; diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index 2c1877172..a68ead266 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -65,7 +65,6 @@ WinCmdlineRec g_cmdline = { NULL, /* configFile */ #endif NULL, /* fontPath */ - NULL, /* rgbPath */ #ifdef XWIN_XF86CONFIG NULL, /* keyboard */ #endif @@ -673,20 +672,6 @@ winConfigFiles () } winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath); - /* RGBPath */ - from = X_DEFAULT; - if (g_cmdline.rgbPath) - { - from = X_CMDLINE; - rgbPath = g_cmdline.rgbPath; - } - else if (filesptr != NULL && filesptr->file_rgbpath) - { - from = X_CONFIG; - rgbPath = xstrdup (filesptr->file_rgbpath); - } - winMsg (from, "RgbPath set to \"%s\"\n", rgbPath); - return TRUE; } #else @@ -702,14 +687,6 @@ winConfigFiles () winMsg (X_CMDLINE, "FontPath set to \"%s\"\n", defaultFontPath); } - /* RGBPath */ - if (g_cmdline.rgbPath) - { - from = X_CMDLINE; - rgbPath = g_cmdline.rgbPath; - winMsg (X_CMDLINE, "RgbPath set to \"%s\"\n", rgbPath); - } - return TRUE; } #endif diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h index 8fd9841d7..4b56d639c 100644 --- a/hw/xwin/winconfig.h +++ b/hw/xwin/winconfig.h @@ -190,7 +190,6 @@ typedef struct char *configFile; #endif char *fontPath; - char *rgbPath; /* input devices - keyboard */ #ifdef XWIN_XF86CONFIG char *keyboard; diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index bd0b99977..7139cbaab 100755 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -1278,16 +1278,6 @@ ddxProcessArgument (int argc, char *argv[], int i) } /* - * Look for the '-co' argument - */ - if (IS_OPTION ("-co")) - { - CHECK_ARGS (1); - g_cmdline.rgbPath = argv[++i]; - return 0; /* Let DIX parse this again */ - } - - /* * Look for the '-query' argument */ if (IS_OPTION ("-query")) diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 5635d64ae..d105e511c 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -326,12 +326,6 @@ /* Support UNIX socket connections */ #undef UNIXCONN -/* Use builtin rgb color database */ -#undef USE_RGB_BUILTIN - -/* Use rgb.txt directly */ -#undef USE_RGB_TXT - /* Define to use byteswap macros from <sys/endian.h> */ #undef USE_SYS_ENDIAN_H @@ -464,9 +458,6 @@ /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 -/* Define to location of RGB database */ -#undef RGB_DB - /* System is BSD-like */ #undef CSRG_BASED diff --git a/include/globals.h b/include/globals.h index e23ce7798..b230dfc37 100644 --- a/include/globals.h +++ b/include/globals.h @@ -16,7 +16,6 @@ extern Bool screenSaverSuspended; #endif extern char *defaultFontPath; -extern char *rgbPath; extern int monitorResolution; extern Bool loadableFonts; extern int defaultColorVisualClass; diff --git a/include/site.h b/include/site.h index 5b9f25815..279cf2d70 100644 --- a/include/site.h +++ b/include/site.h @@ -75,9 +75,6 @@ SOFTWARE. #ifndef COMPILEDDEFAULTFONTPATH #define COMPILEDDEFAULTFONTPATH "/usr/lib/X11/fonts/misc/" #endif -#ifndef RGB_DB -#define RGB_DB "/usr/lib/X11/rgb" -#endif /* * The following constants contain default values for all of the variables diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index c117dfa33..2a0a5f5e2 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -109,12 +109,6 @@ /* Support UNIX socket connections */ #undef UNIXCONN -/* Use builtin rgb color database */ -#undef USE_RGB_BUILTIN - -/* Use rgb.txt directly */ -#undef USE_RGB_TXT - /* unaligned word accesses behave as expected */ #undef WORKING_UNALIGNED_INT diff --git a/os/oscolor.c b/os/oscolor.c index 6f3a7fa4a..f3ff9beac 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -49,13 +49,20 @@ SOFTWARE. #include <dix-config.h> #endif -#define USE_RGB_BUILTIN 1 - -#if USE_RGB_BUILTIN - #include <X11/keysym.h> #include "os.h" +typedef struct _builtinColor { + unsigned char red; + unsigned char green; + unsigned char blue; + 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) { @@ -90,17 +97,6 @@ OsStrCaseCmp (const unsigned char *s1, const unsigned char *s2, int l2) return c2 - c1; } -typedef struct _builtinColor { - unsigned char red; - unsigned char green; - unsigned char blue; - unsigned short name; -} BuiltinColor; - -#include "oscolor.h" - -#define NUM_BUILTIN_COLORS (sizeof (BuiltinColors) / sizeof (BuiltinColors[0])) - Bool OsInitColors(void) { @@ -141,146 +137,3 @@ OsLookupColor(int screen, } return FALSE; } - -#else - -/* - * This file builds the server's internal database mapping color names to - * RGB tuples by reading in an rgb.txt file. This is still slightly foolish, - * rgb.txt hasn't changed in years, we should really include a precompiled - * version into the server. - */ - -#include <stdio.h> -#include "os.h" -#include "opaque.h" - -#define HASHSIZE 63 - -typedef struct _dbEntry * dbEntryPtr; -typedef struct _dbEntry { - dbEntryPtr link; - unsigned short red; - unsigned short green; - unsigned short blue; - char name[1]; /* some compilers complain if [0] */ -} dbEntry; - -extern void CopyISOLatin1Lowered( - unsigned char * /*dest*/, - unsigned char * /*source*/, - int /*length*/); - -static dbEntryPtr hashTab[HASHSIZE]; - -static dbEntryPtr -lookup(char *name, int len, Bool create) -{ - unsigned int h = 0, g; - dbEntryPtr entry, *prev = NULL; - char *str = name; - - if (!(name = (char*)xalloc(len +1))) return NULL; - CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); - name[len] = '\0'; - - for(str = name; *str; str++) { - h = (h << 4) + *str; - if ((g = h) & 0xf0000000) h ^= (g >> 24); - h &= g; - } - h %= HASHSIZE; - - if ( (entry = hashTab[h]) ) - { - for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) - if (! strcmp(name, entry->name) ) break; - } - else - prev = &(hashTab[h]); - - if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) - { - *prev = entry; - entry->link = NULL; - strcpy( entry->name, name ); - } - - xfree(name); - - return entry; -} - -Bool -OsInitColors(void) -{ - FILE *rgb; - char *path; - char line[BUFSIZ]; - char name[BUFSIZ]; - int red, green, blue, lineno = 0; - dbEntryPtr entry; - - static Bool was_here = FALSE; - - if (!was_here) - { - path = (char*)xalloc(strlen(rgbPath) +5); - strcpy(path, rgbPath); - strcat(path, ".txt"); - if (!(rgb = fopen(path, "r"))) - { - ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); - xfree(path); - return FALSE; - } - - while(fgets(line, sizeof(line), rgb)) - { - lineno++; - if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) - { - if (red >= 0 && red <= 0xff && - green >= 0 && green <= 0xff && - blue >= 0 && blue <= 0xff) - { - if ((entry = lookup(name, strlen(name), TRUE))) - { - entry->red = (red * 65535) / 255; - entry->green = (green * 65535) / 255; - entry->blue = (blue * 65535) / 255; - } - } - else - ErrorF("Value out of range: %s:%d\n", path, lineno); - } - else if (*line && *line != '#' && *line != '!') - ErrorF("Syntax Error: %s:%d\n", path, lineno); - } - - fclose(rgb); - xfree(path); - - was_here = TRUE; - } - return TRUE; -} - -Bool -OsLookupColor(int screen, char *name, unsigned int len, - unsigned short *pred, unsigned short *pgreen, unsigned short *pblue) -{ - dbEntryPtr entry; - - if ((entry = lookup(name, len, FALSE))) - { - *pred = entry->red; - *pgreen = entry->green; - *pblue = entry->blue; - return TRUE; - } - - return FALSE; -} - -#endif /* USE_RGB_BUILTIN */ diff --git a/os/utils.c b/os/utils.c index 6fc1f7d43..322814669 100644 --- a/os/utils.c +++ b/os/utils.c @@ -577,7 +577,6 @@ void UseMsg(void) ErrorF("-c turns off key-click\n"); ErrorF("c # key-click volume (0-100)\n"); ErrorF("-cc int default color visual class\n"); - ErrorF("-co file color database file\n"); #ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS ErrorF("-config file read options from file\n"); #endif @@ -783,13 +782,6 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } - else if ( strcmp( argv[i], "-co") == 0) - { - if(++i < argc) - rgbPath = argv[i]; - else - UseMsg(); - } else if ( strcmp( argv[i], "-core") == 0) { CoreDump = TRUE; |