From a123725a12e948d78badb2cb686d38548f1c633b Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 6 Apr 2023 23:23:46 +0200 Subject: Implement window handling Also implement searching. fix undo boundaries when it checked for other save point, it used && instead of == which caused it to overwrite other types. Fix bytes vs chars bug in text_get_region --- src/dged/window.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/dged/window.h (limited to 'src/dged/window.h') diff --git a/src/dged/window.h b/src/dged/window.h new file mode 100644 index 0000000..b3284e9 --- /dev/null +++ b/src/dged/window.h @@ -0,0 +1,48 @@ +#include +#include + +#include "btree.h" + +struct command_list; +struct display; +struct keymap; +struct commands; +struct buffer; + +struct window; +struct windows; + +void windows_init(uint32_t height, uint32_t width, + struct buffer *initial_buffer, struct buffer *minibuffer); + +void windows_destroy(); +void windows_resize(uint32_t height, uint32_t width); +void windows_update(void *(*frame_alloc)(size_t), uint64_t frame_time); +void windows_render(struct display *display); + +struct window *root_window(); +struct window *minibuffer_window(); + +void windows_set_active(struct window *window); +struct window *windows_focus(uint32_t id); +struct window *windows_get_active(); +struct window *windows_focus_next(); + +void window_set_buffer(struct window *window, struct buffer *buffer); +struct buffer *window_buffer(struct window *window); +struct buffer_view *window_buffer_view(struct window *window); +struct buffer *window_prev_buffer(struct window *window); +bool window_has_prev_buffer(struct window *window); +struct buffer_location window_cursor_location(struct window *window); +struct buffer_location window_absolute_cursor_location(struct window *window); +uint32_t window_width(struct window *window); +uint32_t window_height(struct window *window); + +void window_close(struct window *window); +void window_close_others(struct window *window); +void window_split(struct window *window, struct window **new_window_a, + struct window **new_window_b); +void window_hsplit(struct window *window, struct window **new_window_a, + struct window **new_window_b); +void window_vsplit(struct window *window, struct window **new_window_a, + struct window **new_window_b); -- cgit v1.2.3