From 3319741e6f9fc3232eb40462a261271b9af2dcb2 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 20 May 2010 07:07:37 +0000 Subject: xserver git update 20/5/2010 --- xorg-server/hw/xwin/winconfig.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'xorg-server/hw/xwin/winconfig.c') diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c index c972bbcad..d09173197 100644 --- a/xorg-server/hw/xwin/winconfig.c +++ b/xorg-server/hw/xwin/winconfig.c @@ -673,6 +673,18 @@ winSetRealOption (pointer optlist, const char *name, double deflt) deflt = o.value.realnum; return deflt; } + +double +winSetPercentOption (pointer optlist, const char *name, double deflt) +{ + OptionInfoRec o; + + o.name = name; + o.type = OPTV_PERCENT; + if (ParseOptionValue (-1, optlist, &o)) + deflt = o.value.realnum; + return deflt; +} #endif @@ -851,6 +863,31 @@ ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p) p->found = FALSE; } break; + case OPTV_PERCENT: + if (*s == '\0') + { + winDrvMsg (scrnIndex, X_WARNING, + "Option \"%s\" requires a percent value\n", + p->name); + p->found = FALSE; + } + else + { + double percent = strtod (s, &end); + + if (end != s && winNameCompare (end, "%")) + { + p->found = TRUE; + p->value.realnum = percent; + } + else + { + winDrvMsg (scrnIndex, X_WARNING, + "Option \"%s\" requires a frequency value\n", + p->name); + p->found = FALSE; + } + } case OPTV_FREQ: if (*s == '\0') { -- cgit v1.2.3