summaryrefslogtreecommitdiff
path: root/src/user/raleigh/runtime.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/runtime.cpp
parent86af7f631080bc4b45846bd7f382c4cedcbec2b4 (diff)
downloadportland-os-406af09ade55553e2b064506c3ba3c89bd965d73.tar.gz
start of a c++ widget toolkit, c++ runtime
Diffstat (limited to 'src/user/raleigh/runtime.cpp')
-rw-r--r--src/user/raleigh/runtime.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/user/raleigh/runtime.cpp b/src/user/raleigh/runtime.cpp
new file mode 100644
index 0000000..1152575
--- /dev/null
+++ b/src/user/raleigh/runtime.cpp
@@ -0,0 +1,21 @@
+#include <raleigh/runtime.h>
+#include <raleigh/window.h>
+#include <pland/pcrt.h>
+
+namespace raleigh {
+ dllist<window &> open_windows;
+
+ __attribute__ ((noreturn))
+ void start_runtime() {
+ while (1) {
+ if (!open_windows.first)
+ __pcrt_quit();
+ for (dllist<window &>::node *w = open_windows.first; w; w = w->next)
+ if (w->d.try_actions() == window::DELETE)
+ if (!(w = open_windows.remove_in_place(w)))
+ break;
+ _wait_for_action();
+ _yield_task();
+ }
+ }
+} \ No newline at end of file