diff options
Diffstat (limited to 'usr.bin/tmux/window-choose.c')
-rw-r--r-- | usr.bin/tmux/window-choose.c | 95 |
1 files changed, 51 insertions, 44 deletions
diff --git a/usr.bin/tmux/window-choose.c b/usr.bin/tmux/window-choose.c index eb32bf56788..9ea4d8bdf98 100644 --- a/usr.bin/tmux/window-choose.c +++ b/usr.bin/tmux/window-choose.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-choose.c,v 1.78 2016/10/11 07:23:34 nicm Exp $ */ +/* $OpenBSD: window-choose.c,v 1.79 2016/10/11 13:21:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -24,27 +24,32 @@ #include "tmux.h" -struct screen *window_choose_init(struct window_pane *); -void window_choose_free(struct window_pane *); -void window_choose_resize(struct window_pane *, u_int, u_int); -void window_choose_key(struct window_pane *, struct client *, - struct session *, key_code, struct mouse_event *); +static struct screen *window_choose_init(struct window_pane *); +static void window_choose_free(struct window_pane *); +static void window_choose_resize(struct window_pane *, u_int, u_int); +static void window_choose_key(struct window_pane *, struct client *, + struct session *, key_code, struct mouse_event *); -void window_choose_default_callback(struct window_choose_data *); -struct window_choose_mode_item *window_choose_get_item(struct window_pane *, - key_code, struct mouse_event *); +static void window_choose_default_callback(struct window_choose_data *); +static struct window_choose_mode_item *window_choose_get_item( + struct window_pane *, key_code, struct mouse_event *); -void window_choose_fire_callback(struct window_pane *, - struct window_choose_data *); -void window_choose_redraw_screen(struct window_pane *); -void window_choose_write_line(struct window_pane *, - struct screen_write_ctx *, u_int); +static void window_choose_fire_callback(struct window_pane *, + struct window_choose_data *); +static void window_choose_redraw_screen(struct window_pane *); +static void window_choose_write_line(struct window_pane *, + struct screen_write_ctx *, u_int); -void window_choose_scroll_up(struct window_pane *); -void window_choose_scroll_down(struct window_pane *); +static void window_choose_scroll_up(struct window_pane *); +static void window_choose_scroll_down(struct window_pane *); -void window_choose_collapse(struct window_pane *, struct session *, u_int); -void window_choose_expand(struct window_pane *, struct session *, u_int); +static void window_choose_collapse(struct window_pane *, struct session *, + u_int); +static void window_choose_expand(struct window_pane *, struct session *, + u_int); +static void window_choose_collapse_all(struct window_pane *); + +static void window_choose_data_free(struct window_choose_data *); enum window_choose_input_type { WINDOW_CHOOSE_NORMAL = -1, @@ -86,12 +91,14 @@ struct window_choose_mode_data { void (*callbackfn)(struct window_choose_data *); }; -void window_choose_free1(struct window_choose_mode_data *); -int window_choose_key_index(struct window_choose_mode_data *, u_int); -int window_choose_index_key(struct window_choose_mode_data *, key_code); -void window_choose_prompt_input(enum window_choose_input_type, - const char *, struct window_pane *, key_code); -void window_choose_reset_top(struct window_pane *, u_int); +static void window_choose_free1(struct window_choose_mode_data *); +static int window_choose_key_index(struct window_choose_mode_data *, + u_int); +static int window_choose_index_key(struct window_choose_mode_data *, + key_code); +static void window_choose_prompt_input(enum window_choose_input_type, + const char *, struct window_pane *, key_code); +static void window_choose_reset_top(struct window_pane *, u_int); void window_choose_add(struct window_pane *wp, struct window_choose_data *wcd) @@ -122,7 +129,7 @@ window_choose_set_current(struct window_pane *wp, u_int cur) window_choose_reset_top(wp, screen_size_y(s)); } -void +static void window_choose_reset_top(struct window_pane *wp, u_int sy) { struct window_choose_mode_data *data = wp->modedata; @@ -156,7 +163,7 @@ window_choose_ready(struct window_pane *wp, u_int cur, window_choose_collapse_all(wp); } -struct screen * +static struct screen * window_choose_init(struct window_pane *wp) { struct window_choose_mode_data *data; @@ -218,7 +225,7 @@ window_choose_data_create(int type, struct client *c, struct session *s) return (wcd); } -void +static void window_choose_data_free(struct window_choose_data *wcd) { server_client_unref(wcd->start_client); @@ -260,7 +267,7 @@ window_choose_data_run(struct window_choose_data *cdata) cmd_list_free(cmdlist); } -void +static void window_choose_default_callback(struct window_choose_data *wcd) { if (wcd == NULL) @@ -271,14 +278,14 @@ window_choose_default_callback(struct window_choose_data *wcd) window_choose_data_run(wcd); } -void +static void window_choose_free(struct window_pane *wp) { if (wp->modedata != NULL) window_choose_free1(wp->modedata); } -void +static void window_choose_free1(struct window_choose_mode_data *data) { struct window_choose_mode_item *item; @@ -301,7 +308,7 @@ window_choose_free1(struct window_choose_mode_data *data) free(data); } -void +static void window_choose_resize(struct window_pane *wp, u_int sx, u_int sy) { struct window_choose_mode_data *data = wp->modedata; @@ -312,7 +319,7 @@ window_choose_resize(struct window_pane *wp, u_int sx, u_int sy) window_choose_redraw_screen(wp); } -void +static void window_choose_fire_callback(struct window_pane *wp, struct window_choose_data *wcd) { @@ -326,7 +333,7 @@ window_choose_fire_callback(struct window_pane *wp, window_choose_free1(data); } -void +static void window_choose_prompt_input(enum window_choose_input_type input_type, const char *prompt, struct window_pane *wp, key_code key) { @@ -344,7 +351,7 @@ window_choose_prompt_input(enum window_choose_input_type input_type, window_choose_redraw_screen(wp); } -void +static void window_choose_collapse(struct window_pane *wp, struct session *s, u_int pos) { struct window_choose_mode_data *data = wp->modedata; @@ -395,7 +402,7 @@ window_choose_collapse(struct window_pane *wp, struct session *s, u_int pos) } } -void +static void window_choose_collapse_all(struct window_pane *wp) { struct window_choose_mode_data *data = wp->modedata; @@ -446,7 +453,7 @@ window_choose_expand_all(struct window_pane *wp) window_choose_reset_top(wp, screen_size_y(scr)); } -void +static void window_choose_expand(struct window_pane *wp, struct session *s, u_int pos) { struct window_choose_mode_data *data = wp->modedata; @@ -518,7 +525,7 @@ window_choose_expand(struct window_pane *wp, struct session *s, u_int pos) } } -struct window_choose_mode_item * +static struct window_choose_mode_item * window_choose_get_item(struct window_pane *wp, key_code key, struct mouse_event *m) { @@ -537,7 +544,7 @@ window_choose_get_item(struct window_pane *wp, key_code key, return (&data->list[idx]); } -void +static void window_choose_key(struct window_pane *wp, __unused struct client *c, __unused struct session *sess, key_code key, struct mouse_event *m) { @@ -769,7 +776,7 @@ window_choose_key(struct window_pane *wp, __unused struct client *c, } } -void +static void window_choose_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, u_int py) { @@ -827,7 +834,7 @@ window_choose_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, } -int +static int window_choose_key_index(struct window_choose_mode_data *data, u_int idx) { static const char keys[] = "0123456789" @@ -846,7 +853,7 @@ window_choose_key_index(struct window_choose_mode_data *data, u_int idx) return (-1); } -int +static int window_choose_index_key(struct window_choose_mode_data *data, key_code key) { static const char keys[] = "0123456789" @@ -867,7 +874,7 @@ window_choose_index_key(struct window_choose_mode_data *data, key_code key) return (-1); } -void +static void window_choose_redraw_screen(struct window_pane *wp) { struct window_choose_mode_data *data = wp->modedata; @@ -881,7 +888,7 @@ window_choose_redraw_screen(struct window_pane *wp) screen_write_stop(&ctx); } -void +static void window_choose_scroll_up(struct window_pane *wp) { struct window_choose_mode_data *data = wp->modedata; @@ -900,7 +907,7 @@ window_choose_scroll_up(struct window_pane *wp) screen_write_stop(&ctx); } -void +static void window_choose_scroll_down(struct window_pane *wp) { struct window_choose_mode_data *data = wp->modedata; |