diff options
Diffstat (limited to 'libgui/inc/msg.h')
-rw-r--r-- | libgui/inc/msg.h | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/libgui/inc/msg.h b/libgui/inc/msg.h index 150c42d..0e85d5a 100644 --- a/libgui/inc/msg.h +++ b/libgui/inc/msg.h @@ -6,15 +6,28 @@ #include <def.h> #include <gfx.h> +#define MSG_PING_SEND 0x07734 +#define MSG_PING_RECV 0x7474 + #define MSG_MAGIC 0x42042069 #define MSG_SUCCESS (1 << 29) #define MSG_FAILURE (1 << 30) +enum message_state { + MSG_GO_ON, + MSG_NEED_ANSWER, +}; + struct message_header { u32 magic; u32 src; u32 type; - u32 size; + enum message_state state; +}; + +struct message_ping { + struct message_header header; + u32 ping; }; struct message_new_window { @@ -29,23 +42,30 @@ struct message_redraw_window { u32 id; }; -enum message_type { - // GFX // TODO: Remove - GFX_NEW_CONTEXT, - GFX_REDRAW, - GFX_REDRAW_FOCUSED, +struct message_destroy_window { + struct message_header header; + u32 id; +}; + +struct message_mouse { + struct message_header header; + vec2 pos; + struct { + u8 click : 1; + } bits; +}; - // GUI +enum message_type { + GUI_PING, GUI_NEW_WINDOW, GUI_REDRAW_WINDOW, - GUI_KILL, - GUI_KEYBOARD, + GUI_DESTROY_WINDOW, + GUI_MOUSE, - GUI_RESIZE, - GUI_MAX + GUI_KEYBOARD, }; -int msg_send(u32 pid, enum message_type type, void *data, u32 size); -int msg_receive(void *buf, u32 size); +res msg_send(u32 pid, enum message_type type, void *data, u32 size); +res msg_receive(void *buf, u32 size); #endif |