1 | #ifndef NVIM_MOUSE_H |
2 | #define NVIM_MOUSE_H |
3 | |
4 | #include <stdbool.h> |
5 | |
6 | #include "nvim/vim.h" |
7 | #include "nvim/buffer_defs.h" |
8 | |
9 | // jump_to_mouse() returns one of first four these values, possibly with |
10 | // some of the other three added. |
11 | #define IN_UNKNOWN 0 |
12 | #define IN_BUFFER 1 |
13 | #define IN_STATUS_LINE 2 // on status or command line |
14 | #define IN_SEP_LINE 4 // on vertical separator line |
15 | #define IN_OTHER_WIN 8 // in other window but can't go there |
16 | #define CURSOR_MOVED 0x100 |
17 | #define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column |
18 | #define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column |
19 | |
20 | // flags for jump_to_mouse() |
21 | #define MOUSE_FOCUS 0x01 // need to stay in this window |
22 | #define MOUSE_MAY_VIS 0x02 // may start Visual mode |
23 | #define MOUSE_DID_MOVE 0x04 // only act when mouse has moved |
24 | #define MOUSE_SETPOS 0x08 // only set current mouse position |
25 | #define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode |
26 | #define MOUSE_RELEASED 0x20 // button was released |
27 | |
28 | // Codes for mouse button events in lower three bits: |
29 | #define MOUSE_LEFT 0x00 |
30 | #define MOUSE_MIDDLE 0x01 |
31 | #define MOUSE_RIGHT 0x02 |
32 | #define MOUSE_RELEASE 0x03 |
33 | |
34 | #define MOUSE_X1 0x300 // Mouse-button X1 (6th) |
35 | #define MOUSE_X2 0x400 // Mouse-button X2 |
36 | |
37 | // Direction for nv_mousescroll() and ins_mousescroll() |
38 | #define MSCR_DOWN 0 // DOWN must be FALSE |
39 | #define MSCR_UP 1 |
40 | #define MSCR_LEFT -1 |
41 | #define MSCR_RIGHT -2 |
42 | |
43 | |
44 | #ifdef INCLUDE_GENERATED_DECLARATIONS |
45 | # include "mouse.h.generated.h" |
46 | #endif |
47 | |
48 | #endif // NVIM_MOUSE_H |
49 | |