diff options
| author | Albert Cervin <albert@acervin.com> | 2023-04-06 23:23:46 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-05-01 22:19:14 +0200 |
| commit | a123725a12e948d78badb2cb686d38548f1c633b (patch) | |
| tree | c92c46134ef5536fbbf3bf08983c4f0dea1aaf58 /src/dged/window.h | |
| parent | b5ed4cf757afc50afb6ac499eee7b87a2648fa4c (diff) | |
| download | dged-a123725a12e948d78badb2cb686d38548f1c633b.tar.gz dged-a123725a12e948d78badb2cb686d38548f1c633b.tar.xz dged-a123725a12e948d78badb2cb686d38548f1c633b.zip | |
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
Diffstat (limited to 'src/dged/window.h')
| -rw-r--r-- | src/dged/window.h | 48 |
1 files changed, 48 insertions, 0 deletions
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 <stdbool.h> +#include <stdint.h> + +#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); |
