grid_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_GRID_DEFS_H
2 #define NVIM_GRID_DEFS_H
3 
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include <stdint.h>
7 
8 #include "nvim/types.h"
9 
10 #define MAX_MCO 6 // maximum value for 'maxcombine'
11 
12 // The characters and attributes drawn on grids.
13 typedef char_u schar_T[(MAX_MCO+1) * 4 + 1];
14 typedef int16_t sattr_T;
15 
38 typedef struct {
40 
43  unsigned *line_offset;
45 
46  // last column that was drawn (not cleared with the default background).
47  // only used when "throttled" is set. Not allocated by grid_alloc!
48  int *dirty_col;
49 
50  // the size of the allocated grid.
51  int Rows;
52  int Columns;
53 
54  // The state of the grid is valid. Otherwise it needs to be redrawn.
55  bool valid;
56 
57  // only draw internally and don't send updates yet to the compositor or
58  // external UI.
59  bool throttled;
60 
61  // offsets for the grid relative to the global screen. Used by screen.c
62  // for windows that don't have w_grid->chars etc allocated
65 
66  // whether the compositor should blend the grid with the background grid
67  bool blending;
68 
69  // whether the grid can be focused with mouse clicks.
70  bool focusable;
71 
72  // Below is state owned by the compositor. Should generally not be set/read
73  // outside this module, except for specific compatibilty hacks
74 
75  // position of the grid on the composed screen.
76  int comp_row;
77  int comp_col;
78 
79  // z-index of the grid. Grids with higher index is draw on top.
80  // default_grid.comp_index is always zero.
81  size_t comp_index;
82 
83  // compositor should momentarily ignore the grid. Used internally when
84  // moving around grids etc.
86 } ScreenGrid;
87 
88 #define SCREEN_GRID_INIT { 0, NULL, NULL, NULL, NULL, NULL, 0, 0, false, \
89  false, 0, 0, false, true, 0, 0, 0, false }
90 
91 #endif // NVIM_GRID_DEFS_H
int16_t sattr_T
Definition: grid_defs.h:14
sattr_T * attrs
Definition: grid_defs.h:42
int col_offset
Definition: grid_defs.h:64
size_t comp_index
Definition: grid_defs.h:81
char_u schar_T[(MAX_MCO+1)*4+1]
Definition: grid_defs.h:13
bool blending
Definition: grid_defs.h:67
int * dirty_col
Definition: grid_defs.h:48
char_u * line_wraps
Definition: grid_defs.h:44
handle_T handle
Definition: grid_defs.h:39
bool comp_disabled
Definition: grid_defs.h:85
schar_T * chars
Definition: grid_defs.h:41
bool throttled
Definition: grid_defs.h:59
#define MAX_MCO
Definition: grid_defs.h:10
int comp_col
Definition: grid_defs.h:77
bool focusable
Definition: grid_defs.h:70
int row_offset
Definition: grid_defs.h:63
int Rows
Definition: grid_defs.h:51
int comp_row
Definition: grid_defs.h:76
int handle_T
Definition: types.h:17
unsigned char char_u
Definition: types.h:11
Definition: grid_defs.h:38
unsigned * line_offset
Definition: grid_defs.h:43
bool valid
Definition: grid_defs.h:55
int Columns
Definition: grid_defs.h:52