diff options
-rw-r--r-- | calmwm.h | 5 | ||||
-rw-r--r-- | conf.c | 35 | ||||
-rw-r--r-- | group.c | 23 | ||||
-rw-r--r-- | parse.y | 11 |
4 files changed, 41 insertions, 33 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.188 2013/04/14 16:13:17 okan Exp $ + * $OpenBSD: calmwm.h,v 1.189 2013/04/17 13:30:38 okan Exp $ */ #ifndef _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 *); @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.121 2013/01/08 15:16:05 okan Exp $ + * $OpenBSD: conf.c,v 1.122 2013/04/17 13:30:38 okan Exp $ */ #include <sys/param.h> @@ -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; @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.73 2013/04/08 13:05:27 okan Exp $ + * $OpenBSD: group.c,v 1.74 2013/04/17 13:30:38 okan Exp $ */ #include <sys/param.h> @@ -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) { @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.39 2013/01/04 16:27:58 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.40 2013/04/17 13:30:38 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -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 { |