aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2012-11-22 16:48:50 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2012-11-22 16:48:50 +0000
commit63f451965cf26bf6baadc374bd0dcadc8ca66308 (patch)
treeac3b5f838273eed3271e04b4132fb22807705c42 /tmux.h
parent60808bbdede5c489a1faa6671999a92a67b28024 (diff)
parentc04aa9020782fe0a944db2adf5a03e9f52618bea (diff)
downloadrtmux-63f451965cf26bf6baadc374bd0dcadc8ca66308.tar.gz
rtmux-63f451965cf26bf6baadc374bd0dcadc8ca66308.tar.bz2
rtmux-63f451965cf26bf6baadc374bd0dcadc8ca66308.zip
Merge branch 'master' of ssh://tmux.git.sourceforge.net/gitroot/tmux/tmux
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h76
1 files changed, 47 insertions, 29 deletions
diff --git a/tmux.h b/tmux.h
index 3751b672..aca96613 100644
--- a/tmux.h
+++ b/tmux.h
@@ -96,7 +96,8 @@ extern char **environ;
#define CHOOSE_CLIENT_TEMPLATE \
"#{client_tty}: #{session_name} " \
"[#{client_width}x#{client_height} #{client_termname}]" \
- "#{?client_utf8, (utf8),} #{?client_readonly, (ro),}"
+ "#{?client_utf8, (utf8),}#{?client_readonly, (ro),} " \
+ "(last used #{client_activity_string})"
/* Default templates for choose-tree. */
#define CHOOSE_TREE_SESSION_TEMPLATE \
@@ -1115,29 +1116,6 @@ struct session {
RB_HEAD(sessions, session);
ARRAY_DECL(sessionslist, struct session *);
-/*
- * Mouse input. xterm mouse mode is fairly silly. Buttons are in the bottom two
- * bits: 0 = button 1; 1 = button 2; 2 = button 3; 3 = buttons released. Bits
- * 3, 4 and 5 are for keys. Bit 6 is set for dragging and 7 for mouse buttons 4
- * and 5.
- */
-struct mouse_event {
- u_int b;
-#define MOUSE_1 0
-#define MOUSE_2 1
-#define MOUSE_3 2
-#define MOUSE_UP 3
-#define MOUSE_BUTTON 3
-#define MOUSE_SHIFT 4
-#define MOUSE_ESCAPE 8
-#define MOUSE_CTRL 16
-#define MOUSE_DRAG 32
-#define MOUSE_45 64
-#define MOUSE_RESIZE_PANE 128 /* marker for resizing */
- u_int x;
- u_int y;
-};
-
/* TTY information. */
struct tty_key {
char ch;
@@ -1166,6 +1144,47 @@ struct tty_term {
};
LIST_HEAD(tty_terms, tty_term);
+/* Mouse wheel states. */
+#define MOUSE_WHEEL_UP 0
+#define MOUSE_WHEEL_DOWN 1
+
+/* Mouse events. */
+#define MOUSE_EVENT_DOWN (1 << 0)
+#define MOUSE_EVENT_DRAG (1 << 1)
+#define MOUSE_EVENT_UP (1 << 2)
+#define MOUSE_EVENT_CLICK (1 << 3)
+#define MOUSE_EVENT_WHEEL (1 << 4)
+
+/* Mouse flags. */
+#define MOUSE_RESIZE_PANE (1 << 0)
+
+/*
+ * Mouse input. When sent by xterm:
+ *
+ * - buttons are in the bottom two bits: 0 = b1; 1 = b2; 2 = b3; 3 = released
+ * - bits 3, 4 and 5 are for keys
+ * - bit 6 is set for dragging
+ * - bit 7 for buttons 4 and 5
+ */
+struct mouse_event {
+ u_int xb;
+
+ u_int x;
+ u_int lx;
+ u_int sx;
+
+ u_int y;
+ u_int ly;
+ u_int sy;
+
+ u_int button;
+ u_int clicks;
+
+ int wheel;
+ int event;
+ int flags;
+};
+
struct tty {
struct client *client;
@@ -1326,8 +1345,6 @@ struct client {
struct session *session;
struct session *last_session;
- struct mouse_event last_mouse;
-
int wlmouse;
int references;
@@ -1499,6 +1516,7 @@ extern int cfg_finished;
extern struct causelist cfg_causes;
void printflike2 cfg_add_cause(struct causelist *, const char *, ...);
int load_cfg(const char *, struct cmd_ctx *, struct causelist *);
+void show_cfg_causes(struct session *);
/* format.c */
int format_cmp(struct format_entry *, struct format_entry *);
@@ -1922,7 +1940,8 @@ void input_parse(struct window_pane *);
/* input-key.c */
void input_key(struct window_pane *, int);
-void input_mouse(struct window_pane *, struct mouse_event *);
+void input_mouse(struct window_pane *, struct session *,
+ struct mouse_event *);
/* xterm-keys.c */
char *xterm_keys_lookup(int);
@@ -2166,8 +2185,7 @@ void layout_free(struct window *);
void layout_resize(struct window *, u_int, u_int);
void layout_resize_pane(
struct window_pane *, enum layout_type, int);
-void layout_resize_pane_mouse(
- struct client *c, struct mouse_event *mouse);
+void layout_resize_pane_mouse(struct client *c);
void layout_assign_pane(struct layout_cell *, struct window_pane *);
struct layout_cell *layout_split_pane(
struct window_pane *, enum layout_type, int, int);