1#ifndef NVIM_SCREEN_H
2#define NVIM_SCREEN_H
3
4#include <stdbool.h>
5
6#include "nvim/types.h"
7#include "nvim/buffer_defs.h"
8#include "nvim/grid_defs.h"
9#include "nvim/pos.h"
10
11/*
12 * flags for update_screen()
13 * The higher the value, the higher the priority
14 */
15#define VALID 10 /* buffer not changed, or changes marked
16 with b_mod_* */
17#define INVERTED 20 /* redisplay inverted part that changed */
18#define INVERTED_ALL 25 /* redisplay whole inverted part */
19#define REDRAW_TOP 30 /* display first w_upd_rows screen lines */
20#define SOME_VALID 35 /* like NOT_VALID but may scroll */
21#define NOT_VALID 40 /* buffer needs complete redraw */
22#define CLEAR 50 /* screen messed up, clear it */
23
24/// By default, all widows are draw on a single rectangular grid, represented by
25/// this ScreenGrid instance. In multigrid mode each window will have its own
26/// grid, then this is only used for global screen elements that hasn't been
27/// externalized.
28///
29/// Note: before the screen is initialized and when out of memory these can be
30/// NULL.
31EXTERN ScreenGrid default_grid INIT(= SCREEN_GRID_INIT);
32
33#define DEFAULT_GRID_HANDLE 1 // handle for the default_grid
34
35/// Status line click definition
36typedef struct {
37 enum {
38 kStlClickDisabled = 0, ///< Clicks to this area are ignored.
39 kStlClickTabSwitch, ///< Switch to the given tab.
40 kStlClickTabClose, ///< Close given tab.
41 kStlClickFuncRun, ///< Run user function.
42 } type; ///< Type of the click.
43 int tabnr; ///< Tab page number.
44 char *func; ///< Function to run.
45} StlClickDefinition;
46
47/// Used for tabline clicks
48typedef struct {
49 StlClickDefinition def; ///< Click definition.
50 const char *start; ///< Location where region starts.
51} StlClickRecord;
52
53/// Array defining what should be done when tabline is clicked
54extern StlClickDefinition *tab_page_click_defs;
55
56/// Size of the tab_page_click_defs array
57extern long tab_page_click_defs_size;
58
59#ifdef INCLUDE_GENERATED_DECLARATIONS
60# include "screen.h.generated.h"
61#endif
62#endif // NVIM_SCREEN_H
63