diff options
Diffstat (limited to 'src/nvim/ui.h')
-rw-r--r-- | src/nvim/ui.h | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 5934d2fee9..16237214cb 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -5,44 +5,58 @@ #include <stdbool.h> #include <stdint.h> -typedef struct { - bool bold, underline, undercurl, italic, reverse; - int foreground, background, special; -} HlAttrs; +#include "nvim/globals.h" +#include "nvim/api/private/defs.h" +#include "nvim/highlight_defs.h" + +typedef enum { + kUICmdline = 0, + kUIPopupmenu, + kUITabline, + kUIWildmenu, +#define kUIGlobalCount (kUIWildmenu+1) + kUILinegrid, + kUIMultigrid, + kUIHlState, + kUIExtCount, +} UIExtension; + +EXTERN const char *ui_ext_names[] INIT(= { + "ext_cmdline", + "ext_popupmenu", + "ext_tabline", + "ext_wildmenu", + "ext_linegrid", + "ext_multigrid", + "ext_hlstate", +}); + typedef struct ui_t UI; struct ui_t { bool rgb; + bool ui_ext[kUIExtCount]; ///< Externalized widgets int width, height; void *data; - void (*resize)(UI *ui, int rows, int columns); - void (*clear)(UI *ui); - void (*eol_clear)(UI *ui); - void (*cursor_goto)(UI *ui, int row, int col); - void (*update_menu)(UI *ui); - void (*busy_start)(UI *ui); - void (*busy_stop)(UI *ui); - void (*mouse_on)(UI *ui); - void (*mouse_off)(UI *ui); - void (*mode_change)(UI *ui, int mode); - void (*set_scroll_region)(UI *ui, int top, int bot, int left, int right); - void (*scroll)(UI *ui, int count); - void (*highlight_set)(UI *ui, HlAttrs attrs); - void (*put)(UI *ui, uint8_t *str, size_t len); - void (*bell)(UI *ui); - void (*visual_bell)(UI *ui); - void (*flush)(UI *ui); - void (*update_fg)(UI *ui, int fg); - void (*update_bg)(UI *ui, int bg); - void (*update_sp)(UI *ui, int sp); - void (*suspend)(UI *ui); - void (*set_title)(UI *ui, char *title); - void (*set_icon)(UI *ui, char *icon); + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "ui_events.generated.h" +#endif + + // For perfomance and simplicity, we use the dense screen representation + // in the bridge and the TUI. The remote_ui module will translate this + // in to the public grid_line format. + 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); + void (*event)(UI *ui, char *name, Array args, bool *args_consumed); void (*stop)(UI *ui); + void (*inspect)(UI *ui, Dictionary *info); }; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui.h.generated.h" +# include "ui_events_call.h.generated.h" #endif #endif // NVIM_UI_H |