summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-01-11 11:18:24 -0700
committercflip <cflip@cflip.net>2023-01-11 11:18:24 -0700
commit61c387397d03c479ca110a02bfa78cd39fa82656 (patch)
treec0c4a538867eef968e9c977053470999e89400bd /window.h
parent9e6f24187ebe2577fde7c7a971a8cc408f4aeaac (diff)
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.
Diffstat (limited to 'window.h')
-rw-r--r--window.h3
1 files changed, 2 insertions, 1 deletions
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