summaryrefslogtreecommitdiff
path: root/applications/goldman/source/renderer.hpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-07-29 23:03:57 -0400
committerBenji Dial <benji@benjidial.net>2024-07-29 23:03:57 -0400
commit6cf7cd267b50fa68d7531655911620f17dde4a63 (patch)
treee936ab19c3176d1c5eced6e17847550ed1f420e3 /applications/goldman/source/renderer.hpp
parentc34b9191f258ddc15c5b45c000cd0266aed9dead (diff)
downloadhilbert-os-6cf7cd267b50fa68d7531655911620f17dde4a63.tar.gz
window moving and focusing
Diffstat (limited to 'applications/goldman/source/renderer.hpp')
-rw-r--r--applications/goldman/source/renderer.hpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/applications/goldman/source/renderer.hpp b/applications/goldman/source/renderer.hpp
index 91afe88..c2e82b2 100644
--- a/applications/goldman/source/renderer.hpp
+++ b/applications/goldman/source/renderer.hpp
@@ -17,9 +17,6 @@ class renderer {
int cursor_x;
int cursor_y;
- //bottom to top
- std::list<window *> windows;
-
std::mutex mut;
euler::syscall::stream_handle
@@ -28,6 +25,12 @@ class renderer {
void do_render();
public:
+ //all of the shown windows, sorted from furthest back to furthest front.
+ //while the renderer is not locked, the contents of this can change and
+ //iterators can be invalided. this should not be reordered, added to, or
+ //have elements removed from outside the renderer.
+ std::list<window *> windows;
+
renderer(
daguerre::image<daguerre::hilbert_color> &&framebuffer,
daguerre::image<daguerre::hilbert_color> &&background,
@@ -53,8 +56,19 @@ public:
euler::syscall::write_to_stream(dispatcher_handle_1, 1, &byte);
}
+ //gets the current position of the cursor. this should
+ //only be called while the renderer is locked.
+ void get_cursor(int &x_out, int &y_out);
+
+ //this adds x_offset and y_offset to the current cursor position, and then
+ //clamps the cursor position to have its top-left pixel inside the frame.
+ //this should only be called while the renderer is locked.
void bump_cursor(int x_offset, int y_offset);
+ //moves the pointed to window to the front of the window stack.
+ //this should only be called while the renderer is locked.
+ void move_window_to_front(std::list<window *>::iterator w);
+
void add_window(window *w);
void remove_window(window *w);