1 | #ifndef NVIM_CURSOR_SHAPE_H |
2 | #define NVIM_CURSOR_SHAPE_H |
3 | |
4 | #include "nvim/types.h" |
5 | #include "nvim/api/private/defs.h" |
6 | |
7 | /// struct to store values from 'guicursor' and 'mouseshape' |
8 | /// Indexes in shape_table[] |
9 | typedef enum { |
10 | SHAPE_IDX_N = 0, ///< Normal mode |
11 | SHAPE_IDX_V = 1, ///< Visual mode |
12 | SHAPE_IDX_I = 2, ///< Insert mode |
13 | SHAPE_IDX_R = 3, ///< Replace mode |
14 | SHAPE_IDX_C = 4, ///< Command line Normal mode |
15 | SHAPE_IDX_CI = 5, ///< Command line Insert mode |
16 | SHAPE_IDX_CR = 6, ///< Command line Replace mode |
17 | SHAPE_IDX_O = 7, ///< Operator-pending mode |
18 | SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive |
19 | SHAPE_IDX_CLINE = 9, ///< On command line |
20 | SHAPE_IDX_STATUS = 10, ///< On status line |
21 | SHAPE_IDX_SDRAG = 11, ///< dragging a status line |
22 | SHAPE_IDX_VSEP = 12, ///< On vertical separator line |
23 | SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line |
24 | SHAPE_IDX_MORE = 14, ///< Hit-return or More |
25 | SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line |
26 | SHAPE_IDX_SM = 16, ///< showing matching paren |
27 | SHAPE_IDX_COUNT = 17 |
28 | } ModeShape; |
29 | |
30 | typedef enum { |
31 | SHAPE_BLOCK = 0, ///< block cursor |
32 | SHAPE_HOR = 1, ///< horizontal bar cursor |
33 | SHAPE_VER = 2 ///< vertical bar cursor |
34 | } CursorShape; |
35 | |
36 | #define MSHAPE_NUMBERED 1000 /* offset for shapes identified by number */ |
37 | #define MSHAPE_HIDE 1 /* hide mouse pointer */ |
38 | |
39 | #define SHAPE_MOUSE 1 /* used for mouse pointer shape */ |
40 | #define SHAPE_CURSOR 2 /* used for text cursor shape */ |
41 | |
42 | typedef struct cursor_entry { |
43 | char *full_name; ///< mode description |
44 | CursorShape shape; ///< cursor shape: one of the SHAPE_ defines |
45 | int mshape; ///< mouse shape: one of the MSHAPE defines |
46 | int percentage; ///< percentage of cell for bar |
47 | long blinkwait; ///< blinking, wait time before blinking starts |
48 | long blinkon; ///< blinking, on time |
49 | long blinkoff; ///< blinking, off time |
50 | int id; ///< highlight group ID |
51 | int id_lm; ///< highlight group ID for :lmap mode |
52 | char *name; ///< mode short name |
53 | char used_for; ///< SHAPE_MOUSE and/or SHAPE_CURSOR |
54 | } cursorentry_T; |
55 | |
56 | extern cursorentry_T shape_table[SHAPE_IDX_COUNT]; |
57 | |
58 | #ifdef INCLUDE_GENERATED_DECLARATIONS |
59 | # include "cursor_shape.h.generated.h" |
60 | #endif |
61 | #endif // NVIM_CURSOR_SHAPE_H |
62 | |