aboutsummaryrefslogtreecommitdiff
path: root/libgui/inc/msg.h
blob: db00460eaede1f3854a779e2141c76a83ff8e2d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// MIT License, Copyright (c) 2021 Marvin Borner

#ifndef MSG_H
#define MSG_H

#include <def.h>

#define MSG_MAGIC 0x42042069
#define MSG_SUCCESS (1 << 29)
#define MSG_FAILURE (1 << 30)

struct message {
	u32 magic;
	int src;
	int type;
	void *data;
};

enum message_type {
	// GFX // TODO: Remove
	GFX_NEW_CONTEXT,
	GFX_REDRAW,
	GFX_REDRAW_FOCUSED,

	// GUI
	GUI_NEW_WINDOW,
	GUI_REDRAW_WINDOW,
	GUI_KILL,
	GUI_KEYBOARD,
	GUI_MOUSE,
	GUI_RESIZE,
	GUI_MAX
};

int msg_send(u32 pid, enum message_type, void *data);
int msg_receive(struct message *msg);

#endif