diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-19 10:21:36 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-19 10:21:36 +0000 |
commit | de24fbb35ce763c5e905c726733a561f5fa34724 (patch) | |
tree | 543ef7b0b3226b235334b5689b9ce91cef97d756 /server-fn.c | |
parent | 94f003bbec843d08205e9e8dff7819e1d5364138 (diff) |
Add a bell-action option.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/server-fn.c b/server-fn.c index 58a35b15..65a4ab99 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.20 2007-10-12 11:24:15 nicm Exp $ */ +/* $Id: server-fn.c,v 1.21 2007-10-19 10:21:35 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -105,7 +105,7 @@ server_write_session( } void -server_write_window( +server_write_window_cur( struct window *w, enum hdrtype type, const void *buf, size_t len) { struct client *c; @@ -123,6 +123,25 @@ server_write_window( } void +server_write_window_all( + struct window *w, enum hdrtype type, const void *buf, size_t len) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session == NULL) + continue; + if (session_has(c->session, w)) { + if (c->flags & CLIENT_HOLD) /* XXX OUTPUT only */ + continue; + server_write_client(c, type, buf, len); + } + } +} + +void server_status_client(struct client *c) { struct hdr hdr; @@ -222,7 +241,7 @@ server_status_session(struct session *s) } void -server_clear_window(struct window *w) +server_clear_window_cur(struct window *w) { struct client *c; u_int i; @@ -235,7 +254,22 @@ server_clear_window(struct window *w) } void -server_redraw_window(struct window *w) +server_clear_window_all(struct window *w) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session == NULL) + continue; + if (session_has(c->session, w)) + server_redraw_client(c); + } +} + +void +server_redraw_window_cur(struct window *w) { struct client *c; u_int i; @@ -248,7 +282,35 @@ server_redraw_window(struct window *w) } void -server_status_window(struct window *w) +server_redraw_window_all(struct window *w) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c == NULL || c->session == NULL) + continue; + if (session_has(c->session, w)) + server_redraw_client(c); + } +} + +void +server_status_window_cur(struct window *w) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c != NULL && c->session != NULL && c->session->window == w) + server_status_client(c); + } +} + +void +server_status_window_all(struct window *w) { struct client *c; u_int i; |