summaryrefslogtreecommitdiff
path: root/src/dged/window.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-07-12 16:20:50 +0200
committerAlbert Cervin <albert@acervin.com>2023-10-19 22:41:33 +0200
commit54c9b4b533210b77be998f458ff96bdc54272f64 (patch)
treeeb434343bb1083172af50b7372d1e2745af00f8f /src/dged/window.h
parent3a8ae83aa13636679c151027cace905fa87ebd8e (diff)
downloaddged-54c9b4b533210b77be998f458ff96bdc54272f64.tar.gz
dged-54c9b4b533210b77be998f458ff96bdc54272f64.tar.xz
dged-54c9b4b533210b77be998f458ff96bdc54272f64.zip
big buffer/buffer_view rework
A buffer is only the text and the corresponding operation. A buffer view holds information about scroll, dot and mark positions. One way to think about it is that a buffer is stateless whereas a buffer view is stateful.
Diffstat (limited to 'src/dged/window.h')
-rw-r--r--src/dged/window.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/dged/window.h b/src/dged/window.h
index 30c1061..e9f90aa 100644
--- a/src/dged/window.h
+++ b/src/dged/window.h
@@ -1,3 +1,6 @@
+#ifndef _WINDOW_H
+#define _WINDOW_H
+
#include <stdbool.h>
#include <stdint.h>
@@ -12,6 +15,11 @@ struct buffer;
struct window;
struct windows;
+struct window_position {
+ uint32_t x;
+ uint32_t y;
+};
+
void windows_init(uint32_t height, uint32_t width,
struct buffer *initial_buffer, struct buffer *minibuffer);
@@ -38,10 +46,9 @@ 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);
+uint32_t window_width(const struct window *window);
+uint32_t window_height(const struct window *window);
+struct window_position window_position(const struct window *window);
void window_close(struct window *window);
void window_close_others(struct window *window);
@@ -55,3 +62,5 @@ void window_vsplit(struct window *window, struct window **new_window_a,
void windows_show_popup(uint32_t row, uint32_t col, uint32_t width,
uint32_t height);
void windows_close_popup();
+
+#endif