diff options
author | Anton Kling <anton@kling.gg> | 2023-10-23 20:10:01 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-23 20:10:01 +0200 |
commit | 3f44d16f5297a0f7d63f98e48eba46c1e2538a3e (patch) | |
tree | 91ab1f4b0e3eca45d3f6bc125379e3c1ae290a1f /userland/libgui/libgui.h | |
parent | 6382172ac01ef17913c54177e556706d6ae2ec7f (diff) |
WindowServer/LibGUI: Add a eventloop
This can be used by any program does nothing until it gets user input.
Diffstat (limited to 'userland/libgui/libgui.h')
-rw-r--r-- | userland/libgui/libgui.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/userland/libgui/libgui.h b/userland/libgui/libgui.h index d58c23c..07fd3db 100644 --- a/userland/libgui/libgui.h +++ b/userland/libgui/libgui.h @@ -3,6 +3,9 @@ #include <stddef.h> #include <stdint.h> +#define WINDOWSERVER_EVENT_KEYPRESS 0 +#define WINDOWSERVER_EVENT_WINDOW_EXIT 1 + typedef struct { int ws_socket; int bitmap_fd; @@ -31,4 +34,5 @@ void GUI_UpdateWindow(GUI_Window *w); void GUI_OverwriteFont(GUI_Window *w, uint32_t px, uint32_t py, const uint32_t color); void GUI_ClearScreen(GUI_Window *w, uint32_t color); +void GUI_EventLoop(GUI_Window *w, void (*event_handler)(WS_EVENT ev)); #endif |