1 #ifndef NVIM_UI_H
2 #define NVIM_UI_H
3 
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include <stdint.h>
7 
8 #include "nvim/api/private/defs.h"
9 #include "nvim/globals.h"
10 #include "nvim/highlight_defs.h"
11 
12 typedef enum {
13   kUICmdline = 0,
14   kUIPopupmenu,
15   kUITabline,
16   kUIWildmenu,
17   kUIMessages,
18 #define kUIGlobalCount kUILinegrid
19   kUILinegrid,
20   kUIMultigrid,
21   kUIHlState,
22   kUITermColors,
23   kUIFloatDebug,
24   kUIExtCount,
25 } UIExtension;
26 
27 EXTERN const char *ui_ext_names[] INIT(= {
28   "ext_cmdline",
29   "ext_popupmenu",
30   "ext_tabline",
31   "ext_wildmenu",
32   "ext_messages",
33   "ext_linegrid",
34   "ext_multigrid",
35   "ext_hlstate",
36   "ext_termcolors",
37   "_debug_float",
38 });
39 
40 typedef struct ui_t UI;
41 
42 enum {
43   kLineFlagWrap = 1,
44   kLineFlagInvalid = 2,
45 };
46 
47 typedef int LineFlags;
48 
49 struct ui_t {
50   bool rgb;
51   bool override;  ///< Force highest-requested UI capabilities.
52   bool composed;
53   bool ui_ext[kUIExtCount];  ///< Externalized UI capabilities.
54   int width;
55   int height;
56   int pum_nlines;  /// actual nr. lines shown in PUM
57   bool pum_pos;  /// UI reports back pum position?
58   double pum_row;
59   double pum_col;
60   double pum_height;
61   double pum_width;
62   void *data;
63 
64 #ifdef INCLUDE_GENERATED_DECLARATIONS
65 # include "ui_events.generated.h"
66 #endif
67 
68   void (*inspect)(UI *ui, Dictionary *info);
69 };
70 
71 #ifdef INCLUDE_GENERATED_DECLARATIONS
72 # include "ui.h.generated.h"
73 
74 # include "ui_events_call.h.generated.h"
75 #endif
76 
77 
78 EXTERN MultiQueue *resize_events;
79 #endif  // NVIM_UI_H
80