w_grid_alloc: baseline impl

This commit is contained in:
Björn Linse
2021-02-22 15:03:46 +01:00
parent 070e084a64
commit 08ca5207cd
11 changed files with 87 additions and 71 deletions

View File

@@ -35,7 +35,8 @@ typedef int sattr_T;
/// line_wraps[] is an array of boolean flags indicating if the screen line
/// wraps to the next line. It can only be true if a window occupies the entire
/// screen width.
typedef struct {
typedef struct ScreenGrid ScreenGrid;
struct ScreenGrid {
handle_T handle;
schar_T *chars;
@@ -58,10 +59,13 @@ typedef struct {
// external UI.
bool throttled;
// offsets for the grid relative to the global screen. Used by screen.c
// for windows that don't have w_grid->chars etc allocated
// TODO(bfredl): maybe physical grids and "views" (i e drawing
// specifications) should be two separate types?
// offsets for the grid relative to another grid. Used for grids
// that are views into another, actually allocated grid 'target'
int row_offset;
int col_offset;
ScreenGrid *target;
// whether the compositor should blend the grid with the background grid
bool blending;
@@ -89,9 +93,10 @@ typedef struct {
// compositor should momentarily ignore the grid. Used internally when
// moving around grids etc.
bool comp_disabled;
} ScreenGrid;
};
#define SCREEN_GRID_INIT { 0, NULL, NULL, NULL, NULL, NULL, 0, 0, false, \
false, 0, 0, false, true, 0, 0, 0, 0, 0, false }
false, 0, 0, NULL, false, true, \
0, 0, 0, 0, 0, false }
#endif // NVIM_GRID_DEFS_H