From 696b137d5855cdcd0e6b95e16ce2dad00510a41d Mon Sep 17 00:00:00 2001 From: Alexander Gottwald Date: Wed, 15 Sep 2004 16:34:16 +0000 Subject: Pull XORG-6_8_0 to CYGWIN branch --- hw/xfree86/common/xf86Config.c | 65 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) (limited to 'hw/xfree86/common/xf86Config.c') diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 66a6268ab..54c92ff8f 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 1.1.4.4.2.3 2004/03/04 20:16:17 kaleb Exp $ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 1.5 2004/08/16 20:17:51 kem Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */ @@ -128,6 +128,7 @@ static Bool addDefaultModes(MonPtr monitorp); #ifdef XF86DRI static Bool configDRI(XF86ConfDRIPtr drip); #endif +static Bool configExtensions(XF86ConfExtensionsPtr conf_ext); /* * xf86GetPathElem -- @@ -373,13 +374,14 @@ xf86DriverlistFromConfig() Bool xf86BuiltinInputDriver(const char *name) { +#ifdef USE_DEPRECATED_KEYBOARD_DRIVER if (xf86NameCmp(name, "keyboard") == 0) return TRUE; else +#endif return FALSE; } - char ** xf86InputDriverlistFromConfig() { @@ -2395,6 +2397,62 @@ configDRI(XF86ConfDRIPtr drip) } #endif +static Bool +configExtensions(XF86ConfExtensionsPtr conf_ext) +{ + XF86OptionPtr o; + + /* Extension enable/disable in miinitext.c */ + extern Bool EnableDisableExtension(char *name, Bool enable); + + if (conf_ext && conf_ext->ext_option_lst) { + for (o = conf_ext->ext_option_lst; o; o = xf86NextOption(o)) { + char *name = xf86OptionName(o); + char *val = xf86OptionValue(o); + char *n; + Bool enable = TRUE; + + /* Handle "No" */ + n = xf86NormalizeName(name); + if (strncmp(n, "no", 2) == 0) { + name += 2; + enable = FALSE; + } + + if (!val || + xf86NameCmp(val, "enable") == 0 || + xf86NameCmp(val, "on") == 0 || + xf86NameCmp(val, "1") == 0 || + xf86NameCmp(val, "yes") == 0 || + xf86NameCmp(val, "true") == 0) { + /* NOTHING NEEDED -- enabling is handled below */ + } else if (xf86NameCmp(val, "disable") == 0 || + xf86NameCmp(val, "off") == 0 || + xf86NameCmp(val, "0") == 0 || + xf86NameCmp(val, "no") == 0 || + xf86NameCmp(val, "false") == 0) { + enable = !enable; + } else { + xf86Msg(X_ERROR, + "%s is not a valid value for the Extension option\n", + val); + return FALSE; + } + + if (EnableDisableExtension(name, enable)) { + xf86Msg(X_CONFIG, "Extension \"%s\" is %s\n", + name, enable ? "enabled" : "disabled"); + } else { + xf86Msg(X_ERROR, + "Extension \"%s\" is unrecognized\n", name); + return FALSE; + } + } + } + + return TRUE; +} + static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from) { @@ -2551,7 +2609,8 @@ xf86HandleConfigFile(Bool autoconfig) if (!configFiles(xf86configptr->conf_files) || !configServerFlags(xf86configptr->conf_flags, - xf86ConfigLayout.options) + xf86ConfigLayout.options) || + !configExtensions(xf86configptr->conf_extensions) #ifdef XF86DRI || !configDRI(xf86configptr->conf_dri) #endif -- cgit v1.2.3