/** Parse window style. */ void ParseWindowStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_BORDER, np->value); break; case TOK_WIDTH: settings.borderWidth = ParseUnsigned(np, np->value); break; case TOK_HEIGHT: settings.titleHeight = ParseUnsigned(np, np->value); break; case TOK_ACTIVE: ParseActiveWindowStyle(np); break; case TOK_INACTIVE: ParseInactiveWindowStyle(np); break; default: InvalidTag(np, TOK_WINDOWSTYLE); break; } } }
/** Parse window style. */ void ParseWindowStyle(const TokenNode *tp) { const TokenNode *np; const char *decorations; decorations = FindAttribute(tp->attributes, "decorations"); if(decorations) { if(!strcmp(decorations, "motif")) { settings.handles = 1; } else if(!strcmp(decorations, "flat")) { settings.handles = 0; } else { ParseError(tp, "invalid WindowStyle decorations: %s\n", decorations); } } else { settings.handles = 0; } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_BORDER, np->value); break; case TOK_WIDTH: settings.borderWidth = ParseUnsigned(np, np->value); break; case TOK_HEIGHT: settings.titleHeight = ParseUnsigned(np, np->value); break; case TOK_CORNER: settings.cornerRadius = ParseUnsigned(np, np->value); break; case TOK_ACTIVE: ParseActiveWindowStyle(np); break; case TOK_FOREGROUND: SetColor(COLOR_TITLE_FG, np->value); break; case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TITLE_BG1, COLOR_TITLE_BG2); break; case TOK_OUTLINE: SetColor(COLOR_BORDER_LINE, np->value); break; case TOK_OPACITY: settings.inactiveClientOpacity = ParseOpacity(tp, np->value); break; default: InvalidTag(np, TOK_WINDOWSTYLE); break; } } }
/** Parse window style. */ void ParseWindowStyle(const TokenNode *tp) { const TokenNode *np; settings.windowDecorations = ParseDecorations(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_BORDER, np->value); break; case TOK_WIDTH: settings.borderWidth = ParseUnsigned(np, np->value); break; case TOK_HEIGHT: settings.titleHeight = ParseUnsigned(np, np->value); break; case TOK_CORNER: settings.cornerRadius = ParseUnsigned(np, np->value); break; case TOK_ACTIVE: ParseActiveWindowStyle(np); break; case TOK_FOREGROUND: SetColor(COLOR_TITLE_FG, np->value); break; case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TITLE_BG1, COLOR_TITLE_BG2); break; case TOK_OUTLINE: ParseGradient(np->value, COLOR_TITLE_DOWN, COLOR_TITLE_UP); break; case TOK_OPACITY: settings.inactiveClientOpacity = ParseOpacity(tp, np->value); break; default: InvalidTag(np, TOK_WINDOWSTYLE); break; } } }