From 11490a493511c4f760af74c12cb7da15b2b404a2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 16 Sep 2020 21:38:19 +0200 Subject: Added *very* basic keymap parsing --- libgui/inc/gui.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libgui/inc/gui.h') diff --git a/libgui/inc/gui.h b/libgui/inc/gui.h index 5087fbf..da548fc 100644 --- a/libgui/inc/gui.h +++ b/libgui/inc/gui.h @@ -37,6 +37,8 @@ #define WF_NO_DRAG (1 << 1) #define WF_NO_RESIZE (1 << 2) +enum message_type { WM_NEW_WINDOW = EVENT_MAX + 1, WM_REDRAW, WM_KEYBOARD }; + // Generalized font struct struct font { char *chars; @@ -46,6 +48,7 @@ struct font { }; struct window { + u32 pid; int x; int y; u32 width; @@ -56,6 +59,12 @@ struct window { int flags; }; +struct msg_keyboard { + char ch; + int press; + int scancode; +}; + void gui_write_char(struct window *win, int x, int y, u32 c, char ch); void gui_write(struct window *win, int x, int y, u32 c, char *text); void gui_load_image(struct window *win, char *path, int x, int y); @@ -72,6 +81,6 @@ void gui_init(char *font_path); */ #define gui_new_window(flags) \ - (msg_send(2, MSG_NEW_WINDOW, flags), (struct window *)msg_receive_loop()->data) -#define gui_redraw() (msg_send(2, MSG_REDRAW, NULL)) // TODO: Partial redraw (optimization) + (msg_send(2, WM_NEW_WINDOW, flags), (struct window *)msg_receive_loop()->data) +#define gui_redraw() (msg_send(2, WM_REDRAW, NULL)) // TODO: Partial redraw (optimization) #endif -- cgit v1.2.3