From 3f44d16f5297a0f7d63f98e48eba46c1e2538a3e Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 23 Oct 2023 20:10:01 +0200 Subject: WindowServer/LibGUI: Add a eventloop This can be used by any program does nothing until it gets user input. --- userland/libgui/libgui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'userland/libgui/libgui.h') 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 #include +#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 -- cgit v1.2.3