aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-01-07 16:55:40 +0000
committerTiago Cunha <tcunha@gmx.com>2011-01-07 16:55:40 +0000
commit30f6d9b167907783122869100046954e52c07694 (patch)
tree16dfc3e30982c4155458349b9b6fb3e5bf8da5b0 /window.c
parent1cb579d0fdf5eab42866c3d2d01ab6f2f87b3cbb (diff)
downloadrtmux-30f6d9b167907783122869100046954e52c07694.tar.gz
rtmux-30f6d9b167907783122869100046954e52c07694.tar.bz2
rtmux-30f6d9b167907783122869100046954e52c07694.zip
Sync OpenBSD patchset 813:
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.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/window.c b/window.c
index 1942e040..0fdc1171 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.142 2010-12-06 22:52:21 nicm Exp $ */
+/* $Id: window.c,v 1.143 2011-01-07 16:55:40 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -460,6 +460,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)
{