Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Nov 9, 2024
1 parent 3eb3c85 commit 60d3b4c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
8 changes: 7 additions & 1 deletion fvwm/fvwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
16 changes: 10 additions & 6 deletions fvwm/style.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------- */

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion fvwm/style.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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 */

0 comments on commit 60d3b4c

Please sign in to comment.