From 7e85064ac77ea43e84d88eb910b0adb6f07d5d12 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Tue, 21 May 2024 10:23:25 -0600 Subject: 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. --- ui.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui.h') 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*); -- cgit v1.2.3