diff options
author | Marvin Borner | 2021-03-14 16:06:57 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-14 16:06:57 +0100 |
commit | 6dec7db5158447b66f31a3f786ce2916cab83cec (patch) | |
tree | 2dbc3e52d90dab4aae8021773f09b6b72a74b8cb /libgui/inc | |
parent | 2f8328f2a41b77eea297ee7fc28818331d4e6c54 (diff) |
Maaany fixes :)
I don't have the motivation to write better commit messages...
Diffstat (limited to 'libgui/inc')
-rw-r--r-- | libgui/inc/gfx.h | 7 | ||||
-rw-r--r-- | libgui/inc/gui.h | 3 | ||||
-rw-r--r-- | libgui/inc/msg.h | 24 |
3 files changed, 22 insertions, 12 deletions
diff --git a/libgui/inc/gfx.h b/libgui/inc/gfx.h index 4a358ca..f3555a4 100644 --- a/libgui/inc/gfx.h +++ b/libgui/inc/gfx.h @@ -5,7 +5,6 @@ #define GFX_H #include <def.h> -#include <msg.h> #include <sys.h> #include <vec.h> #include <vesa.h> @@ -82,8 +81,8 @@ int gfx_font_width(enum font_type); * Wrappers */ -#define gfx_redraw() \ - (msg_send(pidof(WM_PATH), GFX_REDRAW, NULL)) // TODO: Partial redraw (optimization) -#define gfx_redraw_focused() (msg_send(pidof(WM_PATH), GFX_REDRAW_FOCUSED, NULL)) +/* #define gfx_redraw() \ */ +/* (msg_send(pidof(WM_PATH), GFX_REDRAW, NULL)) // TODO: Partial redraw (optimization) */ +/* #define gfx_redraw_focused() (msg_send(pidof(WM_PATH), GFX_REDRAW_FOCUSED, NULL)) */ #endif diff --git a/libgui/inc/gui.h b/libgui/inc/gui.h index 460bf88..d160333 100644 --- a/libgui/inc/gui.h +++ b/libgui/inc/gui.h @@ -8,8 +8,7 @@ struct gui_window { u32 id; - struct context *ctx; - vec2 *pos; + struct context ctx; }; s32 gui_new_window(struct gui_window *win); diff --git a/libgui/inc/msg.h b/libgui/inc/msg.h index db00460..7cbfa2c 100644 --- a/libgui/inc/msg.h +++ b/libgui/inc/msg.h @@ -4,16 +4,28 @@ #define MSG_H #include <def.h> +#include <gfx.h> #define MSG_MAGIC 0x42042069 #define MSG_SUCCESS (1 << 29) #define MSG_FAILURE (1 << 30) -struct message { +struct message_header { u32 magic; - int src; - int type; - void *data; + u32 src; + u32 type; + u32 size; +}; + +struct message_new_window { + struct message_header header; + u32 id; + struct context ctx; +}; + +struct message_redraw_window { + struct message_header header; + u32 id; }; enum message_type { @@ -32,7 +44,7 @@ enum message_type { GUI_MAX }; -int msg_send(u32 pid, enum message_type, void *data); -int msg_receive(struct message *msg); +int msg_send(u32 pid, enum message_type type, void *data, u32 size); +int msg_receive(void *buf, u32 size); #endif |