aboutsummaryrefslogtreecommitdiff
path: root/src/event.h
blob: ad635f5f481e45e8d6d80be9424854ee89f3c4ab (plain)
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
/* See LICENSE file for copyright and license details. */

#ifndef __CHERRY_EVENT_H__
#define __CHERRY_EVENT_H__

#include <X11/Xlib.h>

enum Events {
	WINDOW_DELETED,
	WINDOW_EXPOSED,
	MOUSE_BUTTON_PRESSED,
	KEY_PRESSED
};

typedef struct CherryEventMouse {
	int x;
	int y;
} CherryEventMouse;

typedef struct CherryEventKey {
	XKeyEvent xkey;
} CherryEventKey;

typedef struct CherryEvent {
	Display *display;
	Window   window;
	int      event_id;
	CherryEventKey   key;
	CherryEventMouse mouse;
} CherryEvent;

CherryEvent cherry_event_create(Display *, Window, int);
CherryEvent cherry_event_mouse_create(Display *, Window, int, int x, int y);
CherryEvent cherry_event_key_create(int, XKeyEvent);
int         cherry_event_id(CherryEvent);

#endif /* __CHERRY_EVENT_H__ */