diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-11-17 14:03:31 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-11-17 14:03:31 +0000 |
commit | 7caad0c878e11d22a63377319dd317e2bab30280 (patch) | |
tree | 7cdce74ab195c7ee89d64d8e6f1853526749baf0 /hw/xwin/winprefsyacc.y | |
parent | 7e5c9bdf73e4185ac4cf7f044da0793a5cc3e62c (diff) | |
parent | 3876fa25317449e95c8b44b0abfda72e91828a7d (diff) |
Merge branch 'cygwin-patches-for-1.19' into cygwin-release-1.19xserver-cygwin-1.19.0-1
Diffstat (limited to 'hw/xwin/winprefsyacc.y')
-rw-r--r-- | hw/xwin/winprefsyacc.y | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index 9bb28ae92..e4e305a0f 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -39,6 +39,8 @@ #include <stdlib.h> #define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */ #include <string.h> +#include "globals.h" +#include "winconfig.h" #include "winprefs.h" /* The following give better error messages in bison at the cost of a few KB */ @@ -57,6 +59,13 @@ static MENUPARSED menu; /* Functions for parsing the tokens into out structure */ /* Defined at the end section of this file */ +static void SetDPI (char *dpi); +static void SetXKBLayout (char *layout); +static void SetXKBModel (char *model); +static void SetXKBOptions (char *options); +static void SetXKBRules (char *rules); +static void SetXKBVariant (char *variant); + static void SetIconDirectory (char *path); static void SetDefaultIcon (char *fname); static void SetRootMenu (char *menu); @@ -108,6 +117,7 @@ extern int yylex(void); %token NOTITLE %token OUTLINE %token NOFRAME +%token SKIPTASKBAR %token DEFAULTSYSMENU %token SYSMENU %token ROOTMENU @@ -121,10 +131,17 @@ extern int yylex(void); %token TRAYICON %token FORCEEXIT %token SILENTEXIT +%token DPI +%token XKBLAYOUT +%token XKBMODEL +%token XKBOPTIONS +%token XKBRULES +%token XKBVARIANT %token <sVal> STRING %type <uVal> group1 %type <uVal> group2 +%type <uVal> group3 %type <uVal> stylecombo %type <iVal> atspot @@ -155,6 +172,30 @@ command: defaulticon | trayicon | forceexit | silentexit + | dpi + | xkblayout + | xkbmodel + | xkboptions + | xkbrules + | xkbvariant + ; + +dpi: DPI STRING NEWLINE { SetDPI($2); free($2); } + ; + +xkblayout: XKBLAYOUT STRING NEWLINE { SetXKBLayout($2); } + ; + +xkbmodel: XKBMODEL STRING NEWLINE { SetXKBModel($2); } + ; + +xkboptions: XKBOPTIONS STRING NEWLINE { SetXKBOptions($2); } + ; + +xkbrules: XKBRULES STRING NEWLINE { SetXKBRules($2); } + ; + +xkbvariant: XKBVARIANT STRING NEWLINE { SetXKBVariant($2); } ; trayicon: TRAYICON STRING NEWLINE { SetTrayIcon($2); free($2); } @@ -207,10 +248,24 @@ group2: NOTITLE { $$=STYLE_NOTITLE; } | NOFRAME { $$=STYLE_NOFRAME; } ; +group3: SKIPTASKBAR { $$=STYLE_SKIPTASKBAR; } + ; + stylecombo: group1 { $$=$1; } | group2 { $$=$1; } + | group3 { $$=$1; } | group1 group2 { $$=$1|$2; } + | group1 group3 { $$=$1|$2; } | group2 group1 { $$=$1|$2; } + | group2 group3 { $$=$1|$2; } + | group3 group1 { $$=$1|$2; } + | group3 group2 { $$=$1|$2; } + | group1 group2 group3 { $$=$1|$2|$3; } + | group1 group3 group2 { $$=$1|$2|$3; } + | group2 group1 group3 { $$=$1|$2|$3; } + | group2 group3 group1 { $$=$1|$2|$3; } + | group3 group1 group2 { $$=$1|$2|$3; } + | group3 group2 group1 { $$=$1|$2|$3; } ; styleline: STRING stylecombo NEWLINE newline_or_nada { AddStyleLine($1, $2); free($1); } @@ -259,6 +314,58 @@ yyerror (const char *s) return 1; } +static void +SetDPI (char *dpi) +{ + if (!g_cmdline.customDPI) + monitorResolution = atoi (dpi); +} + +static void +SetXKBLayout (char *layout) +{ + if (!g_cmdline.xkbLayout) + g_cmdline.xkbLayout = layout; + else + free (layout); +} + +static void +SetXKBModel (char *model) +{ + if (!g_cmdline.xkbModel) + g_cmdline.xkbModel = model; + else + free (model); +} + +static void +SetXKBOptions (char *options) +{ + if (!g_cmdline.xkbOptions) + g_cmdline.xkbOptions = options; + else + free (options); +} + +static void +SetXKBRules (char *rules) +{ + if (!g_cmdline.xkbRules) + g_cmdline.xkbRules = rules; + else + free (rules); +} + +static void +SetXKBVariant (char *variant) +{ + if (!g_cmdline.xkbVariant) + g_cmdline.xkbVariant = variant; + else + free (variant); +} + /* Miscellaneous functions to store TOKENs into the structure */ static void SetIconDirectory (char *path) |