Data Structures | Macros | Typedefs | Enumerations
grid_defs.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "nvim/types.h"

Go to the source code of this file.

Data Structures

struct  ScreenGrid


#define MAX_MCO   6


typedef char_u schar_T[(MAX_MCO+1) *4+1]
typedef int sattr_T
typedef struct ScreenGrid ScreenGrid


enum  {
  kZIndexDefaultGrid = 0, kZIndexFloatDefault = 50, kZIndexPopupMenu = 100, kZIndexMessages = 200,
  kZIndexCmdlinePopupMenu = 250

Macro Definition Documentation


#define MAX_MCO   6


{ 0, NULL, NULL, NULL, NULL, NULL, 0, 0, false, \
false, 0, 0, NULL, false, true, 0, \
0, 0, 0, 0, 0, false }

Typedef Documentation

◆ sattr_T

typedef int sattr_T

◆ schar_T

typedef char_u schar_T[(MAX_MCO+1) *4+1]

◆ ScreenGrid

typedef struct ScreenGrid ScreenGrid

ScreenGrid represents a resizable rectuangular grid displayed by UI clients.

chars[] contains the UTF-8 text that is currently displayed on the grid. It is stored as a single block of cells. When redrawing a part of the grid, the new state can be compared with the existing state of the grid. This way we can avoid sending bigger updates than necessary to the Ul layer.

Screen cells are stored as NUL-terminated UTF-8 strings, and a cell can contain up to MAX_MCO composing characters after the base character. The composing characters are to be drawn on top of the original character. The content after the NUL is not defined (so comparison must be done a single cell at a time). Double-width characters are stored in the left cell, and the right cell should only contain the empty string. When a part of the screen is cleared, the cells should be filled with a single whitespace char.

attrs[] contains the highlighting attribute for each cell. line_offset[n] is the offset from chars[] and attrs[] for the start of line 'n'. These offsets are in general not linear, as full screen scrolling is implemented by rotating the offsets in the line_offset array. 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.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
return NULL
Definition: eval.c:10355