view: do not highlight matching symbols if selection is active
[vis.git] / ui.h
blob51f5ec38a6745cb40749c728d347fd420103b574
1 #ifndef UI_H
2 #define UI_H
4 #include <stdbool.h>
5 #include <stdarg.h>
6 #include <termkey.h>
8 typedef struct Ui Ui;
9 typedef struct UiWin UiWin;
11 enum UiLayout {
12 UI_LAYOUT_HORIZONTAL,
13 UI_LAYOUT_VERTICAL,
16 enum UiOption {
17 UI_OPTION_LINE_NUMBERS_ABSOLUTE = 1 << 0,
18 UI_OPTION_LINE_NUMBERS_RELATIVE = 1 << 1,
19 UI_OPTION_SYMBOL_SPACE = 1 << 2,
20 UI_OPTION_SYMBOL_TAB = 1 << 3,
21 UI_OPTION_SYMBOL_TAB_FILL = 1 << 4,
22 UI_OPTION_SYMBOL_EOL = 1 << 5,
23 UI_OPTION_SYMBOL_EOF = 1 << 6,
24 UI_OPTION_CURSOR_LINE = 1 << 7,
27 enum UiStyles {
28 UI_STYLE_LEXER_MAX = 64,
29 UI_STYLE_DEFAULT,
30 UI_STYLE_CURSOR,
31 UI_STYLE_CURSOR_LINE,
32 UI_STYLE_SELECTION,
33 UI_STYLE_LINENUMBER,
34 UI_STYLE_COLOR_COLUMN,
35 UI_STYLE_MAX,
38 #include "text.h"
39 #include "view.h"
40 #include "vis.h"
42 struct Ui {
43 bool (*init)(Ui*, Vis*);
44 void (*free)(Ui*);
45 void (*resize)(Ui*);
46 UiWin* (*window_new)(Ui*, View*, File*);
47 void (*window_free)(UiWin*);
48 void (*window_focus)(UiWin*);
49 UiWin* (*prompt_new)(Ui*, View*, File*);
50 void (*prompt)(Ui*, const char *title, const char *value);
51 char* (*prompt_input)(Ui*);
52 void (*prompt_hide)(Ui*);
53 void (*die)(Ui*, const char *msg, va_list ap);
54 void (*info)(Ui*, const char *msg, va_list ap);
55 void (*info_hide)(Ui*);
56 void (*arrange)(Ui*, enum UiLayout);
57 void (*draw)(Ui*);
58 void (*update)(Ui*);
59 void (*suspend)(Ui*);
60 const char* (*getkey)(Ui*);
61 bool (*haskey)(Ui*);
62 void (*terminal_save)(Ui*);
63 void (*terminal_restore)(Ui*);
64 TermKey* (*termkey_get)(Ui*);
67 struct UiWin {
68 void (*draw)(UiWin*);
69 void (*draw_status)(UiWin*);
70 void (*reload)(UiWin*, File*);
71 void (*options_set)(UiWin*, enum UiOption);
72 enum UiOption (*options_get)(UiWin*);
73 bool (*syntax_style)(UiWin*, int id, const char *style);
76 #endif