ui.h
Go to the documentation of this file.
1 #ifndef NVIM_UI_H
2 #define NVIM_UI_H
3 
4 #include <stddef.h>
5 #include <stdbool.h>
6 #include <stdint.h>
7 
8 #include "nvim/globals.h"
10 #include "nvim/highlight_defs.h"
11 
12 typedef enum {
17 #define kUIGlobalCount (kUIWildmenu+1)
22 } UIExtension;
23 
24 EXTERN const char *ui_ext_names[] INIT(= {
25  "ext_cmdline",
26  "ext_popupmenu",
27  "ext_tabline",
28  "ext_wildmenu",
29  "ext_linegrid",
30  "ext_multigrid",
31  "ext_hlstate",
32 });
33 
34 
35 typedef struct ui_t UI;
36 
37 struct ui_t {
38  bool rgb;
40  int width, height;
41  void *data;
42 
43 #ifdef INCLUDE_GENERATED_DECLARATIONS
44 # include "ui_events.generated.h"
45 #endif
46 
47  // For perfomance and simplicity, we use the dense screen representation
48  // in the bridge and the TUI. The remote_ui module will translate this
49  // in to the public grid_line format.
50  void (*raw_line)(UI *ui, Integer grid, Integer row, Integer startcol,
51  Integer endcol, Integer clearcol, Integer clearattr,
52  Boolean wrap, const schar_T *chunk, const sattr_T *attrs);
53  void (*event)(UI *ui, char *name, Array args, bool *args_consumed);
54  void (*stop)(UI *ui);
55  void (*inspect)(UI *ui, Dictionary *info);
56 };
57 
58 #ifdef INCLUDE_GENERATED_DECLARATIONS
59 # include "ui.h.generated.h"
60 # include "ui_events_call.h.generated.h"
61 #endif
62 #endif // NVIM_UI_H
int16_t sattr_T
Definition: grid_defs.h:12
Definition: ui.h:14
void(* raw_line)(UI *ui, Integer grid, Integer row, Integer startcol, Integer endcol, Integer clearcol, Integer clearattr, Boolean wrap, const schar_T *chunk, const sattr_T *attrs)
Definition: ui.h:50
char_u schar_T[(MAX_MCO+1)*4+1]
Definition: grid_defs.h:11
Definition: ui.h:18
void * data
Definition: ui.h:41
bool rgb
Definition: ui.h:38
Definition: ui.h:37
bool Boolean
Definition: defs.h:67
int height
Definition: ui.h:40
void(* stop)(UI *ui)
Definition: ui.h:54
#define EXTERN
Definition: macros.h:7
EXTERN const char *ui_ext_names[] INIT(={"ext_cmdline","ext_popupmenu","ext_tabline","ext_wildmenu","ext_linegrid","ext_multigrid","ext_hlstate",})
Definition: ui.h:13
va_list args
Definition: log.c:126
Definition: defs.h:88
Definition: ui.h:15
Definition: ui.h:20
int64_t Integer
Definition: defs.h:68
void(* inspect)(UI *ui, Dictionary *info)
Definition: ui.h:55
Definition: ui.h:19
Definition: ui.h:21
char * name
Definition: eval.c:1850
Definition: defs.h:95
bool ui_ext[kUIExtCount]
Externalized widgets.
Definition: ui.h:39
UIExtension
Definition: ui.h:12
int width
Definition: ui.h:40
void(* event)(UI *ui, char *name, Array args, bool *args_consumed)
Definition: ui.h:53
Definition: ui.h:16