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[]
9typedef enum {
10SHAPE_IDX_N = 0, ///< Normal mode
11SHAPE_IDX_V = 1, ///< Visual mode
12SHAPE_IDX_I = 2, ///< Insert mode
13SHAPE_IDX_R = 3, ///< Replace mode
14SHAPE_IDX_C = 4, ///< Command line Normal mode
15SHAPE_IDX_CI = 5, ///< Command line Insert mode
16SHAPE_IDX_CR = 6, ///< Command line Replace mode
17SHAPE_IDX_O = 7, ///< Operator-pending mode
18SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive
19SHAPE_IDX_CLINE = 9, ///< On command line
20SHAPE_IDX_STATUS = 10, ///< On status line
21SHAPE_IDX_SDRAG = 11, ///< dragging a status line
22SHAPE_IDX_VSEP = 12, ///< On vertical separator line
23SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line
24SHAPE_IDX_MORE = 14, ///< Hit-return or More
25SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line
26SHAPE_IDX_SM = 16, ///< showing matching paren
27SHAPE_IDX_COUNT = 17
28} ModeShape;
29
30typedef enum {
31SHAPE_BLOCK = 0, ///< block cursor
32SHAPE_HOR = 1, ///< horizontal bar cursor
33SHAPE_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
42typedef 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
56extern 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