aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-14 16:53:53 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-14 19:04:21 +0100
commit9bcf2667e7e239873597b7ec2172206a9af18071 (patch)
tree7e9ccb42fa665ba01be65b93fc995fa76719aaf7 /main.c
parentbed289a96e1ed17e4b9fa4f9e22227fcf13cc818 (diff)
downloadvis-9bcf2667e7e239873597b7ec2172206a9af18071.tar.gz
vis-9bcf2667e7e239873597b7ec2172206a9af18071.tar.xz
Restructure display code
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 6751fa1..db6b994 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,7 @@
#include <signal.h>
#include <limits.h>
#include <string.h>
+#include <stdio.h>
#include <wchar.h>
#include <ctype.h>
#include <errno.h>
@@ -8,7 +9,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "ui-curses.h"
+#include "ui-terminal.h"
#include "vis.h"
#include "vis-lua.h"
#include "text-util.h"
@@ -2001,7 +2002,7 @@ int main(int argc, char *argv[]) {
.win_status = vis_lua_win_status,
};
- vis = vis_new(ui_curses_new(), &event);
+ vis = vis_new(ui_term_new(), &event);
if (!vis)
return EXIT_FAILURE;