neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

grid.h (1515B)


      1 #pragma once
      2 
      3 #include <stdbool.h>
      4 #include <stddef.h>  // IWYU pragma: keep
      5 
      6 #include "nvim/buffer_defs.h"  // IWYU pragma: keep
      7 #include "nvim/grid_defs.h"  // IWYU pragma: keep
      8 #include "nvim/macros_defs.h"
      9 #include "nvim/pos_defs.h"
     10 #include "nvim/types_defs.h"
     11 
     12 /// By default, all windows are drawn on a single rectangular grid, represented by
     13 /// this ScreenGrid instance. In multigrid mode each window will have its own
     14 /// grid, then this is only used for global screen elements that hasn't been
     15 /// externalized.
     16 ///
     17 /// Note: before the screen is initialized and when out of memory these can be
     18 /// NULL.
     19 EXTERN ScreenGrid default_grid INIT( = SCREEN_GRID_INIT);
     20 EXTERN GridView default_gridview INIT( = { .target = &default_grid });
     21 
     22 #define DEFAULT_GRID_HANDLE 1  // handle for the default_grid
     23 
     24 /// While resizing the screen this flag is set.
     25 EXTERN bool resizing_screen INIT( = 0);
     26 
     27 EXTERN schar_T *linebuf_char INIT( = NULL);
     28 EXTERN sattr_T *linebuf_attr INIT( = NULL);
     29 EXTERN colnr_T *linebuf_vcol INIT( = NULL);
     30 EXTERN char *linebuf_scratch INIT( = NULL);
     31 
     32 /// flags for grid_put_linebuf()
     33 enum {
     34  SLF_RIGHTLEFT = 1,
     35  SLF_WRAP      = 2,
     36  SLF_INC_VCOL  = 4,
     37 };
     38 
     39 /// Put a ASCII character in a screen cell.
     40 ///
     41 /// If `x` is a compile time constant, schar_from_ascii(x) will also be.
     42 /// But the specific value varies per platform.
     43 #ifdef ORDER_BIG_ENDIAN
     44 # define schar_from_ascii(x) ((schar_T)((x) << 24))
     45 #else
     46 # define schar_from_ascii(x) ((schar_T)(x))
     47 #endif
     48 
     49 #include "grid.h.generated.h"