diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-11-19 02:41:36 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-11-19 03:19:13 +0100 |
commit | 2d777dd67e9be3c5bfd36660ade94710de0f4a0d (patch) | |
tree | 046b13365164eb2ac437804a6eca90131183380b /termo.h | |
parent | 5a80bceec9c3fcc304d8dde1c10f16a9adde8598 (diff) | |
download | termo-2d777dd67e9be3c5bfd36660ade94710de0f4a0d.tar.gz termo-2d777dd67e9be3c5bfd36660ade94710de0f4a0d.tar.xz termo-2d777dd67e9be3c5bfd36660ade94710de0f4a0d.zip |
Rewrite the mouse API
I wasn't aware of the fact that 1000, 1002 and 1003 are mutually
exclusive and turn each other off.
Also now it's not needed to set the protocol, it gets set by default.
Diffstat (limited to 'termo.h')
-rw-r--r-- | termo.h | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -124,21 +124,23 @@ enum termo_mouse_event // You will want to handle GPM (incompatible license) and FreeBSD's sysmouse // yourself. http://www.monkey.org/openbsd/archive/tech/0009/msg00018.html -enum +typedef enum termo_mouse_proto termo_mouse_proto_t; +enum termo_mouse_proto { - TERMO_MOUSE_PROTO_NONE = 0, - TERMO_MOUSE_PROTO_VT200 = 1 << 0, - TERMO_MOUSE_PROTO_UTF8 = 1 << 1 | TERMO_MOUSE_PROTO_VT200, - TERMO_MOUSE_PROTO_SGR = 1 << 2 | TERMO_MOUSE_PROTO_VT200, - TERMO_MOUSE_PROTO_RXVT = 1 << 3 | TERMO_MOUSE_PROTO_VT200 + TERMO_MOUSE_PROTO_NONE, + TERMO_MOUSE_PROTO_XTERM, + TERMO_MOUSE_PROTO_UTF8, + TERMO_MOUSE_PROTO_SGR, + TERMO_MOUSE_PROTO_RXVT }; typedef enum termo_mouse_tracking termo_mouse_tracking_t; enum termo_mouse_tracking { - TERMO_MOUSE_TRACKING_NORMAL, + TERMO_MOUSE_TRACKING_OFF, + TERMO_MOUSE_TRACKING_CLICK, TERMO_MOUSE_TRACKING_DRAG, - TERMO_MOUSE_TRACKING_ANY + TERMO_MOUSE_TRACKING_MOVE }; enum @@ -229,9 +231,9 @@ size_t termo_get_buffer_remaining (termo_t *tk); void termo_canonicalise (termo_t *tk, termo_key_t *key); -int termo_get_mouse_proto (termo_t *tk); -int termo_set_mouse_proto (termo_t *tk, int proto); -int termo_guess_mouse_proto (termo_t *tk); +termo_mouse_proto_t termo_get_mouse_proto (termo_t *tk); +int termo_set_mouse_proto (termo_t *tk, termo_mouse_proto_t proto); +termo_mouse_proto_t termo_guess_mouse_proto (termo_t *tk); termo_mouse_tracking_t termo_get_mouse_tracking_mode (termo_t *tk); int termo_set_mouse_tracking_mode (termo_t *tk, termo_mouse_tracking_t mode); |