aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winconfig.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-20 07:07:37 +0000
committermarha <marha@users.sourceforge.net>2010-05-20 07:07:37 +0000
commit3319741e6f9fc3232eb40462a261271b9af2dcb2 (patch)
treeffe7fbae59390aafa850dcdbd3ea48d2cb59bda0 /xorg-server/hw/xwin/winconfig.c
parent153f5cafa19da4e4c0cf21e9c909958359ed8ebd (diff)
downloadvcxsrv-3319741e6f9fc3232eb40462a261271b9af2dcb2.tar.gz
vcxsrv-3319741e6f9fc3232eb40462a261271b9af2dcb2.tar.bz2
vcxsrv-3319741e6f9fc3232eb40462a261271b9af2dcb2.zip
xserver git update 20/5/2010
Diffstat (limited to 'xorg-server/hw/xwin/winconfig.c')
-rw-r--r--xorg-server/hw/xwin/winconfig.c37
1 files changed, 37 insertions, 0 deletions
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')
{