aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-10-09 10:31:25 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-10-14 10:33:26 +0200
commit9e391f5e3b2baaee0bf73e5273daf84be8a76ce2 (patch)
treee15479ec06d6b8c2eb83a2cd8fd1dd0125eabb00 /ui.h
parentd05b8805325c2d1836c1a60280bb097340bbd03f (diff)
downloadvis-9e391f5e3b2baaee0bf73e5273daf84be8a76ce2.tar.gz
vis-9e391f5e3b2baaee0bf73e5273daf84be8a76ce2.tar.xz
ui: refactor syntax style definitions
Styles can now be specified as strings which will make them easier to specify from outside the editor. The following style attributes can be given in a comma separated list: bold italics underlined fore:color back:color where color is either a hex value of the form #aabbcc or one of the predefined colors: black red green yellow blue magenta cyan white
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui.h b/ui.h
index 797b73a..06738cf 100644
--- a/ui.h
+++ b/ui.h
@@ -1,6 +1,10 @@
#ifndef UI_H
#define UI_H
+#include <stdbool.h>
+#include <stdarg.h>
+#include <termkey.h>
+
typedef struct Ui Ui;
typedef struct UiWin UiWin;
@@ -15,9 +19,8 @@ enum UiOption {
UI_OPTION_LINE_NUMBERS_RELATIVE = 1 << 1,
};
-#include <stdbool.h>
-#include <stdarg.h>
-#include <termkey.h>
+#define UI_STYLES_MAX 64
+
#include "text.h"
#include "view.h"
#include "editor.h"
@@ -53,6 +56,7 @@ struct UiWin {
void (*draw_status)(UiWin*);
void (*reload)(UiWin*, File*);
void (*options)(UiWin*, enum UiOption);
+ bool (*syntax_style)(UiWin*, int id, const char *style);
};
#endif