summaryrefslogtreecommitdiff
path: root/src/user/raleigh/window.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-04 19:11:42 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-04 19:11:42 -0500
commit406af09ade55553e2b064506c3ba3c89bd965d73 (patch)
treedd6da93bc329d6b1097aa1afcde2af19491dfc8e /src/user/raleigh/window.cpp
parent86af7f631080bc4b45846bd7f382c4cedcbec2b4 (diff)
downloadportland-os-406af09ade55553e2b064506c3ba3c89bd965d73.tar.gz
start of a c++ widget toolkit, c++ runtime
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