diff options
-rw-r--r-- | calmwm.h | 3 | ||||
-rw-r--r-- | conf.c | 33 | ||||
-rw-r--r-- | group.c | 21 | ||||
-rw-r--r-- | parse.y | 9 |
4 files changed, 37 insertions, 29 deletions
diff --git a/calmwm.h b/calmwm.h index 6f39aeb..5166984 100644 --- a/calmwm.h +++ b/calmwm.h @@ -352,7 +352,6 @@ void group_client_delete(struct client_ctx *); void group_cycle(struct screen_ctx *, int); void group_hidetoggle(struct screen_ctx *, int); void group_init(struct screen_ctx *); -void group_make_autogroup(struct conf *, char *, int); void group_menu(XButtonEvent *); void group_movetogroup(struct client_ctx *, int); void group_only(struct screen_ctx *, int); @@ -436,6 +435,7 @@ void menuq_clear(struct menu_q *); int parse_config(const char *, struct conf *); +void conf_autogroup(struct conf *, int, char *); void conf_bindname(struct conf *, char *, char *); void conf_clear(struct conf *); void conf_client(struct client_ctx *); @@ -446,6 +446,7 @@ void conf_gap(struct conf *, struct screen_ctx *); void conf_grab(struct conf *, struct keybinding *); void conf_grab_mouse(struct client_ctx *); void conf_init(struct conf *); +void conf_ignore(struct conf *, char *); void conf_mousebind(struct conf *, char *, char *); void conf_ungrab(struct conf *, struct keybinding *); diff --git a/conf.c b/conf.c index 67f58a6..7303768 100644 --- a/conf.c +++ b/conf.c @@ -53,6 +53,39 @@ conf_cmd_add(struct conf *c, char *image, char *label) } void +conf_autogroup(struct conf *c, int no, char *val) +{ + struct autogroupwin *aw; + char *p; + + aw = xcalloc(1, sizeof(*aw)); + + if ((p = strchr(val, ',')) == NULL) { + aw->name = NULL; + aw->class = xstrdup(val); + } else { + *(p++) = '\0'; + aw->name = xstrdup(val); + aw->class = xstrdup(p); + } + aw->num = no; + + TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry); +} + +void +conf_ignore(struct conf *c, char *val) +{ + struct winmatch *wm; + + wm = xcalloc(1, sizeof(*wm)); + + (void)strlcpy(wm->title, val, sizeof(wm->title)); + + TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry); +} + +void conf_gap(struct conf *c, struct screen_ctx *sc) { sc->gap = c->gap; diff --git a/group.c b/group.c index cda8d0a..336400c 100644 --- a/group.c +++ b/group.c @@ -163,27 +163,6 @@ group_init(struct screen_ctx *sc) group_setactive(sc, 1); } -void -group_make_autogroup(struct conf *conf, char *val, int no) -{ - struct autogroupwin *aw; - char *p; - - aw = xcalloc(1, sizeof(*aw)); - - if ((p = strchr(val, ',')) == NULL) { - aw->name = NULL; - aw->class = xstrdup(val); - } else { - *(p++) = '\0'; - aw->name = xstrdup(val); - aw->class = xstrdup(p); - } - aw->num = no; - - TAILQ_INSERT_TAIL(&conf->autogroupq, aw, entry); -} - static void group_setactive(struct screen_ctx *sc, long idx) { diff --git a/parse.y b/parse.y index 8173fe0..2708948 100644 --- a/parse.y +++ b/parse.y @@ -137,16 +137,11 @@ main : FONTNAME STRING { YYERROR; } - group_make_autogroup(conf, $3, $2); + conf_autogroup(conf, $2, $3); free($3); } | IGNORE STRING { - struct winmatch *wm; - - wm = xcalloc(1, sizeof(*wm)); - (void)strlcpy(wm->title, $2, sizeof(wm->title)); - TAILQ_INSERT_TAIL(&conf->ignoreq, wm, entry); - + conf_ignore(conf, $2); free($2); } | BIND STRING string { |