summaryrefslogtreecommitdiff
path: root/src/user/raleigh/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/raleigh/window.cpp')
-rw-r--r--src/user/raleigh/window.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/user/raleigh/window.cpp b/src/user/raleigh/window.cpp
new file mode 100644
index 0000000..4373b06
--- /dev/null
+++ b/src/user/raleigh/window.cpp
@@ -0,0 +1,35 @@
+#include <raleigh/runtime.h>
+#include <raleigh/window.h>
+#include <knob/heap.h>
+
+namespace raleigh {
+ window::window(widget &root)
+ : size(root.size), root(root) {
+ root.w = this;
+ root.window_offset = coord(0, 0);
+ root.notify_window_change();
+
+ pixbuf = (_pixel_t *)get_block(size.x * size.y * sizeof(_pixel_t));
+
+ root.paint(pixbuf, size.x);
+ handle = _new_window(size.x, size.y, pixbuf);
+
+ open_windows.add_front(*this);
+ }
+
+ window::try_actions_return_t window::try_actions() {
+ struct window_action wa;
+ window::try_actions_return_t got = NONE;
+ while (1) {
+ _get_win_action(handle, &wa);
+ if (!wa.action_type)
+ return got;
+ if ((wa.action_type == wa.KEY_DOWN) &&
+ (wa.as_key.modifiers & wa.as_key.ALTS) &&
+ (wa.as_key.key_id == wa.as_key.KEY_F4))
+ return DELETE;
+ got = GOOD;
+ //TODO
+ }
+ }
+} \ No newline at end of file