diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-11 07:01:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-11 07:01:11 +0000 |
commit | 3349c90a7d8ef703d35563da2596b500032a7d54 (patch) | |
tree | d3671d845adabdb4e4e28603b88c09eecd974f98 /usr.bin/tmux/tmux.h | |
parent | 0ac4ee24fd18d5a19768920e53edc59ed16988ee (diff) |
Clean up by introducing a wrapper struct for mouse clicks rather than passing
three u_chars around.
As a side-effect this fixes incorrectly rejecting high cursor positions
(because it was comparing them as signed char), reported by Tom Doherty.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r-- | usr.bin/tmux/tmux.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 72cfed5dfb2..f3518de76eb 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.128 2009/10/10 18:42:14 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.129 2009/10/11 07:01:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -674,13 +674,14 @@ struct input_ctx { */ struct client; struct window; +struct mouse_event; struct window_mode { struct screen *(*init)(struct window_pane *); void (*free)(struct window_pane *); void (*resize)(struct window_pane *, u_int, u_int); void (*key)(struct window_pane *, struct client *, int); void (*mouse)(struct window_pane *, - struct client *, u_char, u_char, u_char); + struct client *, struct mouse_event *); void (*timer)(struct window_pane *); }; @@ -951,6 +952,13 @@ struct tty_ctx { u_int orlower; }; +/* Mouse input. */ +struct mouse_event { + u_char b; + u_char x; + u_char y; +}; + /* Client connection. */ struct client { struct imsgbuf ibuf; @@ -1285,7 +1293,7 @@ int tty_keys_cmp(struct tty_key *, struct tty_key *); RB_PROTOTYPE(tty_keys, tty_key, entry, tty_keys_cmp); void tty_keys_init(struct tty *); void tty_keys_free(struct tty *); -int tty_keys_next(struct tty *, int *, u_char *); +int tty_keys_next(struct tty *, int *, struct mouse_event *); /* options-cmd.c */ const char *set_option_print( @@ -1542,7 +1550,7 @@ void input_parse(struct window_pane *); /* input-key.c */ void input_key(struct window_pane *, int); -void input_mouse(struct window_pane *, u_char, u_char, u_char); +void input_mouse(struct window_pane *, struct mouse_event *); /* colour.c */ void colour_set_fg(struct grid_cell *, int); @@ -1705,7 +1713,7 @@ void window_pane_reset_mode(struct window_pane *); void window_pane_parse(struct window_pane *); void window_pane_key(struct window_pane *, struct client *, int); void window_pane_mouse(struct window_pane *, - struct client *, u_char, u_char, u_char); + struct client *, struct mouse_event *); int window_pane_visible(struct window_pane *); char *window_pane_search( struct window_pane *, const char *, u_int *); |