aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-21 10:23:25 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commit7e85064ac77ea43e84d88eb910b0adb6f07d5d12 (patch)
tree60087cfc22d2e8c67b2d83a7202a8bbb2a5c1c1e /ui.h
parent486e8631ce9269d34c00c07038e04013640f8825 (diff)
downloadvis-7e85064ac77ea43e84d88eb910b0adb6f07d5d12.tar.gz
vis-7e85064ac77ea43e84d88eb910b0adb6f07d5d12.tar.xz
remove some ui pointer chasing
There only exists a single Ui so there is no need to force a pointer redirection for accessing it. The Ui member was moved down in vis-core.h to punt around an issue with the way lua checks for existing objects. It may show up again as I flatten more structs.
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui.h b/ui.h
index 806b9ce..c03a709 100644
--- a/ui.h
+++ b/ui.h
@@ -107,6 +107,7 @@ typedef struct Ui {
size_t cells_size; /* #bytes allocated for 2D grid (grows only) */
Cell *cells; /* 2D grid of cells, at least as large as current terminal size */
bool doupdate; /* Whether to update the screen after refreshing contents */
+ void *ctx; /* Any additional data needed by the backend */
} Ui;
#include "view.h"
@@ -115,7 +116,7 @@ typedef struct Ui {
#define UI_OPTIONS_GET(ui) ((ui) ? (ui)->options : 0)
-Ui *ui_terminal_new(void);
+bool ui_terminal_init(Ui*);
int ui_terminal_colors(void);
void ui_terminal_free(Ui*);
void ui_terminal_restore(Ui*);