diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-12-30 21:35:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-12-30 21:35:17 +0000 |
commit | 2231e72968629d67575b18979fed13b4f5ad730b (patch) | |
tree | 1271c5ef9fc8239ad20bc16303aa6cf7bbd435e8 /window.c | |
parent | f7c42c21bacf84af52079b239a18294851fbdb3a (diff) | |
download | rtmux-2231e72968629d67575b18979fed13b4f5ad730b.tar.gz rtmux-2231e72968629d67575b18979fed13b4f5ad730b.tar.bz2 rtmux-2231e72968629d67575b18979fed13b4f5ad730b.zip |
Add a function to create window flags rather than doing the same thing
in two places. From Thomas Adam.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -463,6 +463,32 @@ window_destroy_panes(struct window *w) } } +/* Return list of printable window flag symbols. No flags is just a space. */ +char * +window_printable_flags(struct session *s, struct winlink *wl) +{ + char flags[BUFSIZ]; + int pos; + + pos = 0; + if (wl->flags & WINLINK_ACTIVITY) + flags[pos++] = '#'; + if (wl->flags & WINLINK_BELL) + flags[pos++] = '!'; + if (wl->flags & WINLINK_CONTENT) + flags[pos++] = '+'; + if (wl->flags & WINLINK_SILENCE) + flags[pos++] = '~'; + if (wl == s->curw) + flags[pos++] = '*'; + if (wl == TAILQ_FIRST(&s->lastw)) + flags[pos++] = '-'; + if (pos == 0) + flags[pos++] = ' '; + flags[pos] = '\0'; + return (xstrdup(flags)); +} + struct window_pane * window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit) { |