aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winprefsyacc.y
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winprefsyacc.y')
-rw-r--r--xorg-server/hw/xwin/winprefsyacc.y76
1 files changed, 72 insertions, 4 deletions
diff --git a/xorg-server/hw/xwin/winprefsyacc.y b/xorg-server/hw/xwin/winprefsyacc.y
index 683fc44ca..8dae912d5 100644
--- a/xorg-server/hw/xwin/winprefsyacc.y
+++ b/xorg-server/hw/xwin/winprefsyacc.y
@@ -40,6 +40,7 @@
#define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */
#include <string.h>
#include "winprefs.h"
+#include "winmsg.h"
/* The following give better error messages in bison at the cost of a few KB */
#define YYERROR_VERBOSE 1
@@ -75,6 +76,12 @@ static void OpenStyles(void);
static void AddStyleLine(char *matchstr, unsigned long style);
static void CloseStyles(void);
+static void SetNoTrayIcon(void);
+
+static void OpenTaskbar(void);
+static void AddTaskbarLine(char *matchstr, unsigned long type);
+static void CloseTaskbar(void);
+
static void OpenSysMenu(void);
static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
static void CloseSysMenu(void);
@@ -84,6 +91,9 @@ static int yyerror (char *s);
extern char *yytext;
extern int yylex(void);
+#define YYMALLOC malloc
+#define YYFREE free
+
%}
%union {
@@ -107,6 +117,9 @@ extern int yylex(void);
%token NOTITLE
%token OUTLINE
%token NOFRAME
+%token TASKBAR
+%token NOTAB
+%token NEWTAB
%token DEFAULTSYSMENU
%token SYSMENU
%token ROOTMENU
@@ -125,6 +138,7 @@ extern int yylex(void);
%type <uVal> group1
%type <uVal> group2
%type <uVal> stylecombo
+%type <uVal> group3
%type <iVal> atspot
%%
@@ -147,6 +161,7 @@ command: defaulticon
| menu
| icons
| styles
+ | taskbar
| sysmenu
| rootmenu
| defaultsysmenu
@@ -222,6 +237,20 @@ stylelist: styleline
styles: STYLES LB {OpenStyles();} newline_or_nada stylelist RB {CloseStyles();}
;
+group3: NOTAB { $$=TASKBAR_NOTAB; }
+ | NEWTAB { $$=TASKBAR_NEWTAB; }
+ ;
+
+taskbarline: STRING group3 NEWLINE newline_or_nada { AddTaskbarLine($1, $2); free($1); }
+ ;
+
+taskbarlist: taskbarline
+ | taskbarline taskbarlist
+ ;
+
+taskbar: TASKBAR LB {OpenTaskbar();} newline_or_nada taskbarlist RB {CloseTaskbar();}
+ ;
+
atspot: { $$=AT_END; }
| ATSTART { $$=AT_START; }
| ATEND { $$=AT_END; }
@@ -243,7 +272,7 @@ forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; }
silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; }
;
-debug: DEBUGOUTPUT STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); }
+debug: DEBUGOUTPUT STRING NEWLINE { winDebug("LoadPreferences: %s\n", $2); free($2); }
;
@@ -352,7 +381,7 @@ static void
OpenIcons (void)
{
if (pref.icon != NULL) {
- ErrorF("LoadPreferences: Redefining icon mappings\n");
+ winDebug("LoadPreferences: Redefining icon mappings\n");
free(pref.icon);
pref.icon = NULL;
}
@@ -387,7 +416,7 @@ static void
OpenStyles (void)
{
if (pref.style != NULL) {
- ErrorF("LoadPreferences: Redefining window style\n");
+ winDebug("LoadPreferences: Redefining window style\n");
free(pref.style);
pref.style = NULL;
}
@@ -416,10 +445,49 @@ CloseStyles (void)
}
static void
+SetNoTrayIcon (void)
+{
+ pref.fNoTrayIcon=TRUE;
+}
+
+
+static void
+OpenTaskbar (void)
+{
+ if (pref.taskbar != NULL) {
+ ErrorF("LoadPreferences - Redefining taskbar property\n");
+ free(pref.taskbar);
+ pref.taskbar = NULL;
+ }
+ pref.taskbarItems = 0;
+}
+
+static void
+AddTaskbarLine (char *matchstr, unsigned long type)
+{
+ if (pref.taskbar==NULL)
+ pref.taskbar = malloc(sizeof(TASKBARITEM));
+ else
+ pref.taskbar = realloc(pref.taskbar, sizeof(TASKBARITEM)*(pref.taskbarItems+1));
+
+ strncpy(pref.taskbar[pref.taskbarItems].match, matchstr, MENU_MAX);
+ pref.taskbar[pref.taskbarItems].match[MENU_MAX] = 0;
+
+ pref.taskbar[pref.taskbarItems].type = type;
+
+ pref.taskbarItems++;
+}
+
+static void
+CloseTaskbar (void)
+{
+}
+
+static void
OpenSysMenu (void)
{
if (pref.sysMenu != NULL) {
- ErrorF("LoadPreferences: Redefining system menu\n");
+ winDebug("LoadPreferences: Redefining system menu\n");
free(pref.sysMenu);
pref.sysMenu = NULL;
}