diff --git a/fvwm/fvwm.h b/fvwm/fvwm.h index 4663858ca..740dc7623 100644 --- a/fvwm/fvwm.h +++ b/fvwm/fvwm.h @@ -572,12 +572,18 @@ typedef struct style_flags typedef struct style_id_t { - char *name; XID window_id; + char *name; + char *class; + char *resource; + char *icon; struct { unsigned has_name:1; unsigned has_window_id:1; + unsigned has_class:1; + unsigned has_resource:1; + unsigned has_icon:1; } flags; } style_id_t; diff --git a/fvwm/style.c b/fvwm/style.c index 0b78913e1..0982d9b64 100644 --- a/fvwm/style.c +++ b/fvwm/style.c @@ -54,6 +54,7 @@ /* ---------------------------- forward declarations ----------------------- */ static int style_set_border_colorset(window_style *, char *, int); +static char *parse_v3_style_id(char *, style_id_t *); /* ---------------------------- local variables ---------------------------- */ @@ -4524,15 +4525,13 @@ static void _style_command(F_CMD_ARGS, char *prefix, Bool is_window_style) if (!is_window_style) { - /* parse style name */ - action = GetNextToken(action, &SGET_NAME(*ps)); - /* in case there was no argument! */ - if (SGET_NAME(*ps) == NULL) - { + /* FIXME: capability check. */ + action = parse_v3_style_id(action, &SGET_ID(*ps)); + if (action == NULL) { free(ps); return; } - SSET_ID_HAS_NAME(*ps, True); + } else { @@ -4583,6 +4582,11 @@ static void _style_command(F_CMD_ARGS, char *prefix, Bool is_window_style) return; } +static char *parse_v3_style_id(char *action, style_id_t *r) +{ + return action; +} + /* ---------------------------- interface functions ------------------------ */ /* Compare two flag structures passed as byte arrays. Only compare bits set in diff --git a/fvwm/style.h b/fvwm/style.h index 3db1a934c..8993ffdad 100644 --- a/fvwm/style.h +++ b/fvwm/style.h @@ -384,6 +384,18 @@ ((id).flags.has_window_id = !!(x)) #define SID_GET_HAS_WINDOW_ID(id) \ ((id).flags.has_window_id) +#define SID_GET_HAS_RESOURCE(id) \ + ((id).flags.has_resource) +#define SID_SET_HAS_RESOURCE(id,x) \ + ((id).flags.has_resource = (x)) +#define SID_GET_HAS_CLASS(id) \ + ((id).flags.has_class) +#define SID_SET_HAS_CLASS(id,x) \ + ((id).flags.has_class = (x)) +#define SID_GET_HAS_ICON(id) \ + ((id).flags.has_icon) +#define SID_SET_HAS_ICON(id,x) \ + ((id).flags.has_icon = (x)) /* access to other parts of a style (call with the style itself) */ #define SGET_NEXT_STYLE(s) \ @@ -679,4 +691,4 @@ void free_icon_boxes(icon_boxes *ib); void style_destroy_style(style_id_t s_id); void print_styles(int verbose); -#endif /* FVWM_STYLE_H */ +#endif /* FVWM_STYLE_H */ \ No newline at end of file