2 *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
4 *Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 *"Software"), to deal in the Software without restriction, including
7 *without limitation the rights to use, copy, modify, merge, publish,
8 *distribute, sublicense, and/or sell copies of the Software, and to
9 *permit persons to whom the Software is furnished to do so, subject to
10 *the following conditions:
12 *The above copyright notice and this permission notice shall be
13 *included in all copies or substantial portions of the Software.
15 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
19 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *Except as contained in this notice, the name of the XFree86 Project
24 *shall not be used in advertising or otherwise to promote the sale, use
25 *or other dealings in this Software without prior written authorization
26 *from the XFree86 Project.
28 * Authors: Alexander Gottwald
31 #ifdef HAVE_XWIN_CONFIG_H
32 #include <xwin-config.h>
35 #include "winconfig.h"
46 #ifdef XWIN_XF86CONFIG
48 #define CONFIGPATH "%A," "%R," \
49 "/etc/X11/%R," "%P/etc/X11/%R," \
51 "/etc/X11/%F," "%P/etc/X11/%F," \
53 "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
54 "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
56 "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
60 XF86ConfigPtr g_xf86configptr
= NULL
;
63 WinCmdlineRec g_cmdline
= {
64 #ifdef XWIN_XF86CONFIG
65 NULL
, /* configFile */
69 #ifdef XWIN_XF86CONFIG
73 FALSE
, /* noXkbExtension */
78 NULL
, /* xkbVariant */
79 NULL
, /* xkbOptions */
81 NULL
, /* screenname */
83 FALSE
, /* emulate3Buttons */
84 0 /* emulate3Timeout */
87 winInfoRec g_winInfo
= {
102 NULL
, /* initialMap */
117 #define NULL_IF_EMPTY(x) (winNameCompare(x,"")?x:NULL)
119 #ifdef XWIN_XF86CONFIG
120 serverLayoutRec g_winConfigLayout
;
122 static Bool
ParseOptionValue (int scrnIndex
, pointer options
,
124 static Bool
configLayout (serverLayoutPtr
, XF86ConfLayoutPtr
, char *);
125 static Bool
configImpliedLayout (serverLayoutPtr
, XF86ConfScreenPtr
);
126 static Bool
GetBoolValue (OptionInfoPtr p
, const char *s
);
133 const char *filename
;
134 MessageType from
= X_DEFAULT
;
135 char *xf86ConfigFile
= NULL
;
137 if (g_cmdline
.configFile
)
140 xf86ConfigFile
= g_cmdline
.configFile
;
143 /* Parse config file into data structure */
145 filename
= xf86openConfigFile (CONFIGPATH
, xf86ConfigFile
, PROJECTROOT
);
147 /* Hack for backward compatibility */
148 if (!filename
&& from
== X_DEFAULT
)
149 filename
= xf86openConfigFile (CONFIGPATH
, "XF86Config", PROJECTROOT
);
153 winMsg (from
, "Using config file: \"%s\"\n", filename
);
157 winMsg (X_ERROR
, "Unable to locate/open config file");
159 ErrorF (": \"%s\"", xf86ConfigFile
);
163 if ((g_xf86configptr
= xf86readConfigFile ()) == NULL
)
165 winMsg (X_ERROR
, "Problem parsing the config file\n");
168 xf86closeConfigFile ();
172 /* set options from data structure */
174 if (g_xf86configptr
->conf_layout_lst
== NULL
|| g_cmdline
.screenname
!= NULL
)
176 if (g_cmdline
.screenname
== NULL
)
179 "No Layout section. Using the first Screen section.\n");
181 if (!configImpliedLayout (&g_winConfigLayout
,
182 g_xf86configptr
->conf_screen_lst
))
184 winMsg (X_ERROR
, "Unable to determine the screen layout\n");
190 /* Check if layout is given in the config file */
191 if (g_xf86configptr
->conf_flags
!= NULL
)
193 char *dfltlayout
= NULL
;
194 pointer optlist
= g_xf86configptr
->conf_flags
->flg_option_lst
;
196 if (optlist
&& winFindOption (optlist
, "defaultserverlayout"))
198 winSetStrOption (optlist
, "defaultserverlayout", NULL
);
200 if (!configLayout (&g_winConfigLayout
,
201 g_xf86configptr
->conf_layout_lst
,
204 winMsg (X_ERROR
, "Unable to determine the screen layout\n");
210 if (!configLayout (&g_winConfigLayout
,
211 g_xf86configptr
->conf_layout_lst
,
214 winMsg (X_ERROR
, "Unable to determine the screen layout\n");
220 /* setup special config files */
226 /* load layout definitions */
227 #include "winlayouts.h"
229 /* Set the keyboard configuration */
231 winConfigKeyboard (DeviceIntPtr pDevice
)
234 char layoutName
[KL_NAMELENGTH
];
235 static unsigned int layoutNum
= 0;
238 #ifdef XWIN_XF86CONFIG
239 XF86ConfInputPtr kbd
= NULL
;
240 XF86ConfInputPtr input_list
= NULL
;
241 MessageType kbdfrom
= X_CONFIG
;
243 MessageType from
= X_DEFAULT
;
248 g_winInfo
.xkb
.disable
= FALSE
;
249 # ifdef PC98 /* japanese */ /* not implemented */
250 g_winInfo
.xkb
.rules
= "xfree98";
251 g_winInfo
.xkb
.model
= "pc98";
252 g_winInfo
.xkb
.layout
= "nex/jp";
253 g_winInfo
.xkb
.variant
= NULL
;
254 g_winInfo
.xkb
.options
= NULL
;
256 g_winInfo
.xkb
.rules
= "xorg";
257 g_winInfo
.xkb
.model
= "pc101";
258 g_winInfo
.xkb
.layout
= "us";
259 g_winInfo
.xkb
.variant
= NULL
;
260 g_winInfo
.xkb
.options
= NULL
;
264 * Query the windows autorepeat settings and change the xserver defaults.
265 * If XKB is disabled then windows handles the autorepeat and the special
266 * treatment is not needed
271 if (SystemParametersInfo(SPI_GETKEYBOARDDELAY
, 0, &kbd_delay
, 0) &&
272 SystemParametersInfo(SPI_GETKEYBOARDSPEED
, 0, &kbd_speed
, 0))
276 case 0: g_winInfo
.keyboard
.delay
= 250; break;
277 case 1: g_winInfo
.keyboard
.delay
= 500; break;
278 case 2: g_winInfo
.keyboard
.delay
= 750; break;
280 case 3: g_winInfo
.keyboard
.delay
= 1000; break;
282 g_winInfo
.keyboard
.rate
= (kbd_speed
>0)?kbd_speed
:1;
283 winMsgVerb(X_PROBED
, 1, "Setting autorepeat to delay=%d, rate=%d\n",
284 g_winInfo
.keyboard
.delay
, g_winInfo
.keyboard
.rate
);
289 keyboardType
= GetKeyboardType (0);
290 if (keyboardType
> 0 && GetKeyboardLayoutName (layoutName
))
292 WinKBLayoutPtr pLayout
;
296 layoutNum
= strtoul (layoutName
, (char **)NULL
, 16);
297 if ((layoutNum
& 0xffff) == 0x411) {
298 /* The japanese layouts know a lot of different IMEs which all have
299 different layout numbers set. Map them to a single entry.
300 Same might apply for chinese, korean and other symbol languages
302 layoutNum
= (layoutNum
& 0xffff);
303 if (keyboardType
== 7)
305 /* Japanese layouts have problems with key event messages
306 such as the lack of WM_KEYUP for Caps Lock key.
307 Loading US layout fixes this problem. */
308 if (LoadKeyboardLayout("00000409", KLF_ACTIVATE
) != NULL
)
309 winMsg (X_INFO
, "Loading US keyboard layout.\n");
311 winMsg (X_ERROR
, "LoadKeyboardLaout failed.\n");
314 winMsg (X_PROBED
, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
315 layoutName
, layoutNum
);
317 for (pLayout
= winKBLayouts
; pLayout
->winlayout
!= -1; pLayout
++)
319 if (pLayout
->winlayout
!= layoutNum
)
321 if (pLayout
->winkbtype
> 0 && pLayout
->winkbtype
!= keyboardType
)
326 "Using preset keyboard for \"%s\" (%x), type \"%d\"\n",
327 pLayout
->layoutname
, pLayout
->winlayout
, keyboardType
);
329 g_winInfo
.xkb
.model
= pLayout
->xkbmodel
;
330 g_winInfo
.xkb
.layout
= pLayout
->xkblayout
;
331 g_winInfo
.xkb
.variant
= pLayout
->xkbvariant
;
332 g_winInfo
.xkb
.options
= pLayout
->xkboptions
;
339 const char regtempl
[] =
340 "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
343 DWORD namesize
= sizeof(lname
);
345 regpath
= malloc(sizeof(regtempl
) + KL_NAMELENGTH
+ 1);
346 strcpy(regpath
, regtempl
);
347 strcat(regpath
, layoutName
);
349 if (!RegOpenKey(HKEY_LOCAL_MACHINE
, regpath
, ®key
) &&
350 !RegQueryValueEx(regkey
, "Layout Text", 0, NULL
, lname
, &namesize
))
353 "Keyboardlayout \"%s\" (%s) is unknown\n", lname
, layoutName
);
356 /* Close registry key */
358 RegCloseKey (regkey
);
363 g_winInfo
.xkb
.initialMap
= NULL
;
364 g_winInfo
.xkb
.keymap
= NULL
;
365 g_winInfo
.xkb
.types
= NULL
;
366 g_winInfo
.xkb
.compat
= NULL
;
367 g_winInfo
.xkb
.keycodes
= NULL
;
368 g_winInfo
.xkb
.symbols
= NULL
;
369 g_winInfo
.xkb
.geometry
= NULL
;
372 /* parse the configuration */
373 #ifdef XWIN_XF86CONFIG
374 if (g_cmdline
.keyboard
)
378 * Until the layout code is finished, I search for the keyboard
379 * device and configure the server with it.
382 if (g_xf86configptr
!= NULL
)
383 input_list
= g_xf86configptr
->conf_input_lst
;
385 while (input_list
!= NULL
)
387 if (winNameCompare (input_list
->inp_driver
, "keyboard") == 0)
389 /* Check if device name matches requested name */
390 if (g_cmdline
.keyboard
&& winNameCompare (input_list
->inp_identifier
,
395 input_list
= input_list
->list
.next
;
401 if (kbd
->inp_identifier
)
402 winMsg (kbdfrom
, "Using keyboard \"%s\" as primary keyboard\n",
403 kbd
->inp_identifier
);
405 if ((s
= winSetStrOption(kbd
->inp_option_lst
, "AutoRepeat", NULL
)))
407 if ((sscanf(s
, "%ld %ld", &g_winInfo
.keyboard
.delay
,
408 &g_winInfo
.keyboard
.rate
) != 2) ||
409 (g_winInfo
.keyboard
.delay
< 1) ||
410 (g_winInfo
.keyboard
.rate
== 0) ||
411 (1000 / g_winInfo
.keyboard
.rate
) < 1)
413 winErrorFVerb (2, "\"%s\" is not a valid AutoRepeat value", s
);
418 winMsg (X_CONFIG
, "AutoRepeat: %ld %ld\n",
419 g_winInfo
.keyboard
.delay
, g_winInfo
.keyboard
.rate
);
425 if (g_cmdline
.noXkbExtension
)
428 g_winInfo
.xkb
.disable
= TRUE
;
430 #ifdef XWIN_XF86CONFIG
431 else if (kbd
->inp_option_lst
)
433 int b
= winSetBoolOption (kbd
->inp_option_lst
, "XkbDisable", FALSE
);
437 g_winInfo
.xkb
.disable
= TRUE
;
441 if (g_winInfo
.xkb
.disable
)
443 winMsg (from
, "XkbExtension disabled\n");
448 if (g_cmdline
.xkbRules
)
450 s
= g_cmdline
.xkbRules
;
453 #ifdef XWIN_XF86CONFIG
456 s
= winSetStrOption (kbd
->inp_option_lst
, "XkbRules", NULL
);
462 g_winInfo
.xkb
.rules
= NULL_IF_EMPTY (s
);
463 winMsg (from
, "XKB: rules: \"%s\"\n", s
);
467 if (g_cmdline
.xkbModel
)
469 s
= g_cmdline
.xkbModel
;
472 #ifdef XWIN_XF86CONFIG
475 s
= winSetStrOption (kbd
->inp_option_lst
, "XkbModel", NULL
);
481 g_winInfo
.xkb
.model
= NULL_IF_EMPTY (s
);
482 winMsg (from
, "XKB: model: \"%s\"\n", s
);
486 if (g_cmdline
.xkbLayout
)
488 s
= g_cmdline
.xkbLayout
;
491 #ifdef XWIN_XF86CONFIG
494 s
= winSetStrOption (kbd
->inp_option_lst
, "XkbLayout", NULL
);
500 g_winInfo
.xkb
.layout
= NULL_IF_EMPTY (s
);
501 winMsg (from
, "XKB: layout: \"%s\"\n", s
);
505 if (g_cmdline
.xkbVariant
)
507 s
= g_cmdline
.xkbVariant
;
510 #ifdef XWIN_XF86CONFIG
513 s
= winSetStrOption (kbd
->inp_option_lst
, "XkbVariant", NULL
);
519 g_winInfo
.xkb
.variant
= NULL_IF_EMPTY (s
);
520 winMsg (from
, "XKB: variant: \"%s\"\n", s
);
524 if (g_cmdline
.xkbOptions
)
526 s
= g_cmdline
.xkbOptions
;
529 #ifdef XWIN_XF86CONFIG
532 s
= winSetStrOption (kbd
->inp_option_lst
, "XkbOptions", NULL
);
538 g_winInfo
.xkb
.options
= NULL_IF_EMPTY (s
);
539 winMsg (from
, "XKB: options: \"%s\"\n", s
);
542 #ifdef XWIN_XF86CONFIG
545 if ((s
= winSetStrOption (kbd
->inp_option_lst
, "XkbKeymap", NULL
)))
547 g_winInfo
.xkb
.keymap
= NULL_IF_EMPTY (s
);
548 winMsg (X_CONFIG
, "XKB: keymap: \"%s\" "
549 " (overrides other XKB settings)\n", s
);
552 if ((s
= winSetStrOption (kbd
->inp_option_lst
, "XkbCompat", NULL
)))
554 g_winInfo
.xkb
.compat
= NULL_IF_EMPTY (s
);
555 winMsg (X_CONFIG
, "XKB: compat: \"%s\"\n", s
);
558 if ((s
= winSetStrOption (kbd
->inp_option_lst
, "XkbTypes", NULL
)))
560 g_winInfo
.xkb
.types
= NULL_IF_EMPTY (s
);
561 winMsg (X_CONFIG
, "XKB: types: \"%s\"\n", s
);
565 winSetStrOption (kbd
->inp_option_lst
, "XkbKeycodes", NULL
)))
567 g_winInfo
.xkb
.keycodes
= NULL_IF_EMPTY (s
);
568 winMsg (X_CONFIG
, "XKB: keycodes: \"%s\"\n", s
);
572 winSetStrOption (kbd
->inp_option_lst
, "XkbGeometry", NULL
)))
574 g_winInfo
.xkb
.geometry
= NULL_IF_EMPTY (s
);
575 winMsg (X_CONFIG
, "XKB: geometry: \"%s\"\n", s
);
578 if ((s
= winSetStrOption (kbd
->inp_option_lst
, "XkbSymbols", NULL
)))
580 g_winInfo
.xkb
.symbols
= NULL_IF_EMPTY (s
);
581 winMsg (X_CONFIG
, "XKB: symbols: \"%s\"\n", s
);
586 #ifdef XWIN_XF86CONFIG
594 #ifdef XWIN_XF86CONFIG
596 winConfigMouse (DeviceIntPtr pDevice
)
598 MessageType mousefrom
= X_CONFIG
;
600 XF86ConfInputPtr mouse
= NULL
;
601 XF86ConfInputPtr input_list
= NULL
;
604 mousefrom
= X_CMDLINE
;
606 if (g_xf86configptr
!= NULL
)
607 input_list
= g_xf86configptr
->conf_input_lst
;
609 while (input_list
!= NULL
)
611 if (winNameCompare (input_list
->inp_driver
, "mouse") == 0)
613 /* Check if device name matches requested name */
614 if (g_cmdline
.mouse
&& winNameCompare (input_list
->inp_identifier
,
619 input_list
= input_list
->list
.next
;
624 if (mouse
->inp_identifier
)
625 winMsg (mousefrom
, "Using pointer \"%s\" as primary pointer\n",
626 mouse
->inp_identifier
);
628 g_winInfo
.pointer
.emulate3Buttons
=
629 winSetBoolOption (mouse
->inp_option_lst
, "Emulate3Buttons", FALSE
);
630 if (g_cmdline
.emulate3buttons
)
631 g_winInfo
.pointer
.emulate3Buttons
= g_cmdline
.emulate3buttons
;
633 g_winInfo
.pointer
.emulate3Timeout
=
634 winSetIntOption (mouse
->inp_option_lst
, "Emulate3Timeout", 50);
635 if (g_cmdline
.emulate3timeout
)
636 g_winInfo
.pointer
.emulate3Timeout
= g_cmdline
.emulate3timeout
;
640 winMsg (X_ERROR
, "No primary pointer configured\n");
641 winMsg (X_DEFAULT
, "Using compiletime defaults for pointer\n");
652 XF86ConfFilesPtr filesptr
= NULL
;
654 /* set some shortcuts */
655 if (g_xf86configptr
!= NULL
)
657 filesptr
= g_xf86configptr
->conf_files
;
664 if (g_cmdline
.fontPath
)
667 defaultFontPath
= g_cmdline
.fontPath
;
669 else if (filesptr
!= NULL
&& filesptr
->file_fontpath
)
672 defaultFontPath
= xstrdup (filesptr
->file_fontpath
);
674 winMsg (from
, "FontPath set to \"%s\"\n", defaultFontPath
);
678 if (g_cmdline
.rgbPath
)
681 rgbPath
= g_cmdline
.rgbPath
;
683 else if (filesptr
!= NULL
&& filesptr
->file_rgbpath
)
686 rgbPath
= xstrdup (filesptr
->file_rgbpath
);
688 winMsg (from
, "RgbPath set to \"%s\"\n", rgbPath
);
699 if (g_cmdline
.fontPath
)
701 defaultFontPath
= g_cmdline
.fontPath
;
702 winMsg (X_CMDLINE
, "FontPath set to \"%s\"\n", defaultFontPath
);
706 if (g_cmdline
.rgbPath
)
709 rgbPath
= g_cmdline
.rgbPath
;
710 winMsg (X_CMDLINE
, "RgbPath set to \"%s\"\n", rgbPath
);
732 #ifdef XWIN_XF86CONFIG
734 winSetStrOption (pointer optlist
, const char *name
, char *deflt
)
739 o
.type
= OPTV_STRING
;
740 if (ParseOptionValue (-1, optlist
, &o
))
743 return xstrdup (deflt
);
750 winSetBoolOption (pointer optlist
, const char *name
, int deflt
)
755 o
.type
= OPTV_BOOLEAN
;
756 if (ParseOptionValue (-1, optlist
, &o
))
757 deflt
= o
.value
.bool;
763 winSetIntOption (pointer optlist
, const char *name
, int deflt
)
768 o
.type
= OPTV_INTEGER
;
769 if (ParseOptionValue (-1, optlist
, &o
))
776 winSetRealOption (pointer optlist
, const char *name
, double deflt
)
782 if (ParseOptionValue (-1, optlist
, &o
))
783 deflt
= o
.value
.realnum
;
790 * Compare two strings for equality. This is caseinsensitive and
791 * The characters '_', ' ' (space) and '\t' (tab) are treated as
796 winNameCompare (const char *s1
, const char *s2
)
808 while (*s1
== '_' || *s1
== ' ' || *s1
== '\t')
810 while (*s2
== '_' || *s2
== ' ' || *s2
== '\t')
813 c1
= (isupper (*s1
) ? tolower (*s1
) : *s1
);
814 c2
= (isupper (*s2
) ? tolower (*s2
) : *s2
);
823 while (*s1
== '_' || *s1
== ' ' || *s1
== '\t')
825 while (*s2
== '_' || *s2
== ' ' || *s2
== '\t')
828 c1
= (isupper (*s1
) ? tolower (*s1
) : *s1
);
829 c2
= (isupper (*s2
) ? tolower (*s2
) : *s2
);
835 #ifdef XWIN_XF86CONFIG
837 * Find the named option in the list.
838 * @return the pointer to the option record, or NULL if not found.
842 winFindOption (XF86OptionPtr list
, const char *name
)
846 if (winNameCompare (list
->opt_name
, name
) == 0)
848 list
= list
->list
.next
;
855 * Find the Value of an named option.
856 * @return The option value or NULL if not found.
860 winFindOptionValue (XF86OptionPtr list
, const char *name
)
862 list
= winFindOption (list
, name
);
866 return (list
->opt_val
);
879 ParseOptionValue (int scrnIndex
, pointer options
, OptionInfoPtr p
)
883 if ((s
= winFindOptionValue (options
, p
->name
)) != NULL
)
890 winDrvMsg (scrnIndex
, X_WARNING
,
891 "Option \"%s\" requires an integer value\n",
897 p
->value
.num
= strtoul (s
, &end
, 0);
904 winDrvMsg (scrnIndex
, X_WARNING
,
905 "Option \"%s\" requires an integer value\n",
914 winDrvMsg (scrnIndex
, X_WARNING
,
915 "Option \"%s\" requires an string value\n", p
->name
);
931 winDrvMsg (scrnIndex
, X_WARNING
,
932 "Option \"%s\" requires a floating point value\n",
938 p
->value
.realnum
= strtod (s
, &end
);
945 winDrvMsg (scrnIndex
, X_WARNING
,
946 "Option \"%s\" requires a floating point value\n",
953 if (GetBoolValue (p
, s
))
959 winDrvMsg (scrnIndex
, X_WARNING
,
960 "Option \"%s\" requires a boolean value\n", p
->name
);
967 winDrvMsg (scrnIndex
, X_WARNING
,
968 "Option \"%s\" requires a frequency value\n",
974 double freq
= strtod (s
, &end
);
980 if (!winNameCompare (end
, "Hz"))
982 else if (!winNameCompare (end
, "kHz") ||
983 !winNameCompare (end
, "k"))
985 else if (!winNameCompare (end
, "MHz") ||
986 !winNameCompare (end
, "M"))
990 winDrvMsg (scrnIndex
, X_WARNING
,
991 "Option \"%s\" requires a frequency value\n",
996 freq
*= (double) units
;
1000 winDrvMsg (scrnIndex
, X_WARNING
,
1001 "Option \"%s\" requires a frequency value\n",
1007 p
->value
.freq
.freq
= freq
;
1008 p
->value
.freq
.units
= units
;
1013 /* Should never get here */
1019 winDrvMsgVerb (scrnIndex
, X_CONFIG
, 2, "Option \"%s\"", p
->name
);
1020 if (!(p
->type
== OPTV_BOOLEAN
&& *s
== 0))
1022 winErrorFVerb (2, " \"%s\"", s
);
1024 winErrorFVerb (2, "\n");
1027 else if (p
->type
== OPTV_BOOLEAN
)
1029 /* Look for matches with options with or without a "No" prefix. */
1033 n
= winNormalizeName (p
->name
);
1039 if (strncmp (n
, "no", 2) == 0)
1046 n
= malloc (strlen (p
->name
) + 2 + 1);
1053 strcat (n
, p
->name
);
1056 if ((s
= winFindOptionValue (options
, newn
)) != NULL
)
1058 if (GetBoolValue (&opt
, s
))
1060 p
->value
.bool = !opt
.value
.bool;
1065 winDrvMsg (scrnIndex
, X_WARNING
,
1066 "Option \"%s\" requires a boolean value\n", newn
);
1076 winDrvMsgVerb (scrnIndex
, X_CONFIG
, 2, "Option \"%s\"", newn
);
1079 winErrorFVerb (2, " \"%s\"", s
);
1081 winErrorFVerb (2, "\n");
1094 configLayout (serverLayoutPtr servlayoutp
, XF86ConfLayoutPtr conf_layout
,
1095 char *default_layout
)
1098 #pragma warn UNIMPLEMENTED
1105 configImpliedLayout (serverLayoutPtr servlayoutp
,
1106 XF86ConfScreenPtr conf_screen
)
1109 #pragma warn UNIMPLEMENTED
1116 GetBoolValue (OptionInfoPtr p
, const char *s
)
1120 p
->value
.bool = TRUE
;
1124 if (winNameCompare (s
, "1") == 0)
1125 p
->value
.bool = TRUE
;
1126 else if (winNameCompare (s
, "on") == 0)
1127 p
->value
.bool = TRUE
;
1128 else if (winNameCompare (s
, "true") == 0)
1129 p
->value
.bool = TRUE
;
1130 else if (winNameCompare (s
, "yes") == 0)
1131 p
->value
.bool = TRUE
;
1132 else if (winNameCompare (s
, "0") == 0)
1133 p
->value
.bool = FALSE
;
1134 else if (winNameCompare (s
, "off") == 0)
1135 p
->value
.bool = FALSE
;
1136 else if (winNameCompare (s
, "false") == 0)
1137 p
->value
.bool = FALSE
;
1138 else if (winNameCompare (s
, "no") == 0)
1139 p
->value
.bool = FALSE
;
1147 winNormalizeName (const char *s
)
1155 ret
= malloc (strlen (s
) + 1);
1156 for (p
= s
, q
= ret
; *p
!= 0; p
++)
1166 *q
++ = tolower (*p
);