diff options
author | Anton Kling <anton@kling.gg> | 2023-10-22 19:50:38 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-22 19:50:38 +0200 |
commit | 4e09bca9e34c226b6d7e34b4fa11248405fd988e (patch) | |
tree | 80f156b7940d9d19971395f335530170c69516c7 /userland/libgui/libgui.h |
Move everything into a new repo.
Diffstat (limited to 'userland/libgui/libgui.h')
-rw-r--r-- | userland/libgui/libgui.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/userland/libgui/libgui.h b/userland/libgui/libgui.h new file mode 100644 index 0000000..d58c23c --- /dev/null +++ b/userland/libgui/libgui.h @@ -0,0 +1,34 @@ +#ifndef LIBGUI_H +#define LIBGUI_H +#include <stddef.h> +#include <stdint.h> + +typedef struct { + int ws_socket; + int bitmap_fd; + uint32_t *bitmap_ptr; + int x; + int y; + int sx; + int sy; +} GUI_Window; + +// Taken from drivers/keyboard.c +struct KEY_EVENT { + char c; + uint8_t mode; // (shift (0 bit)) (alt (1 bit)) + uint8_t release; // 0 pressed, 1 released +}; + +typedef struct { + int type; + struct KEY_EVENT ev; +} WS_EVENT; + +GUI_Window *GUI_CreateWindow(uint32_t x, uint32_t y, uint32_t sx, uint32_t sy); +void GUI_DrawFont(GUI_Window *w, uint32_t px, uint32_t py, const uint32_t c); +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); +#endif |