cursor_shape.h (2497B)
1 #pragma once 2 3 #include "nvim/api/private/defs.h" // IWYU pragma: keep 4 #include "nvim/memory_defs.h" // IWYU pragma: keep 5 6 /// struct to store values from 'guicursor' and 'mouseshape' 7 /// Indexes in shape_table[] 8 typedef enum { 9 SHAPE_IDX_N = 0, ///< Normal mode 10 SHAPE_IDX_V = 1, ///< Visual mode 11 SHAPE_IDX_I = 2, ///< Insert mode 12 SHAPE_IDX_R = 3, ///< Replace mode 13 SHAPE_IDX_C = 4, ///< Command line Normal mode 14 SHAPE_IDX_CI = 5, ///< Command line Insert mode 15 SHAPE_IDX_CR = 6, ///< Command line Replace mode 16 SHAPE_IDX_O = 7, ///< Operator-pending mode 17 SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive 18 SHAPE_IDX_CLINE = 9, ///< On command line 19 SHAPE_IDX_STATUS = 10, ///< On status line 20 SHAPE_IDX_SDRAG = 11, ///< dragging a status line 21 SHAPE_IDX_VSEP = 12, ///< On vertical separator line 22 SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line 23 SHAPE_IDX_MORE = 14, ///< Hit-return or More 24 SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line 25 SHAPE_IDX_SM = 16, ///< showing matching paren 26 SHAPE_IDX_TERM = 17, ///< Terminal mode 27 SHAPE_IDX_COUNT = 18, 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 { 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 int blinkwait; ///< blinking, wait time before blinking starts 48 int blinkon; ///< blinking, on time 49 int 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 #include "cursor_shape.h.generated.h"