From 61c387397d03c479ca110a02bfa78cd39fa82656 Mon Sep 17 00:00:00 2001 From: cflip Date: Wed, 11 Jan 2023 11:18:24 -0700 Subject: Get editor size from the window instead of the terminal Previously the editor would resize itself upon startup by finding the size of the current terminal window, but now that it is running in an actual window it should get the number of rows and columns from there. This also adds parameters for the window size in rows and columns to the window_init() function. --- window.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'window.h') diff --git a/window.h b/window.h index 1c2e019..a414f6f 100644 --- a/window.h +++ b/window.h @@ -3,9 +3,10 @@ struct editor_state; -void window_init(); +void window_init(const char *title, int rows, int cols); int window_handle_event(struct editor_state *editor); void window_redraw(struct editor_state *editor); +void window_get_size(int *rows, int *cols); void window_destroy(); #endif -- cgit v1.2.3