From 962a54447d47ef79165bd45c9a1288fa9b3a636e Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Sat, 3 Jan 2015 02:47:07 +0000 Subject: Kill setmousefunc, replace with much nicer setmousemode --- include/vterm.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/vterm.h b/include/vterm.h index a543039..4dd221f 100644 --- a/include/vterm.h +++ b/include/vterm.h @@ -98,8 +98,6 @@ enum { VTERM_PROP_CURSORSHAPE_BAR_LEFT, }; -typedef void (*VTermMouseFunc)(int col, int row, int button, int pressed, int modifiers, void *data); - typedef struct { const uint32_t *chars; int width; @@ -144,6 +142,13 @@ void vterm_keyboard_push_key(VTerm *vt, VTermModifier state, VTermKey key); void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod); void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod); +typedef enum { + VTERM_MOUSE_NONE = 0, + VTERM_MOUSE_CLICK = 1, + VTERM_MOUSE_DRAG = 2, + VTERM_MOUSE_MOVE = 3, +} VTermMouseMode; + // ------------ // Parser layer // ------------ @@ -195,7 +200,7 @@ typedef struct { int (*initpen)(void *user); int (*setpenattr)(VTermAttr attr, VTermValue *val, void *user); int (*settermprop)(VTermProp prop, VTermValue *val, void *user); - int (*setmousefunc)(VTermMouseFunc func, void *data, void *user); + int (*setmousemode)(VTermMouseMode mode, void *user); int (*bell)(void *user); int (*resize)(int rows, int cols, VTermPos *delta, void *user); int (*setlineinfo)(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user); @@ -244,7 +249,7 @@ typedef struct { int (*moverect)(VTermRect dest, VTermRect src, void *user); int (*movecursor)(VTermPos pos, VTermPos oldpos, int visible, void *user); int (*settermprop)(VTermProp prop, VTermValue *val, void *user); - int (*setmousefunc)(VTermMouseFunc func, void *data, void *user); + int (*setmousemode)(VTermMouseMode mode, void *user); int (*bell)(void *user); int (*resize)(int rows, int cols, void *user); int (*sb_pushline)(int cols, const VTermScreenCell *cells, void *user); -- cgit v1.2.3