blob: b2118153b79c9226af363fb2f31c18e3c2aee245 (
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
38
39
40
41
42
43
44
45
46
47
48
|
/* See LICENSE file for copyright and license details. */
#include "window.h"
CherryEvent
cherry_event_create(Display *display, Window wnd, int event_id)
{
CherryEvent evt;
evt.display = display;
evt.window = wnd;
evt.event_id = event_id;
return evt;
}
CherryEvent
cherry_event_mouse_create(Display *display, Window wnd, int event_id, int x, int y)
{
CherryEvent evt;
CherryEventMouse mouse;
evt = cherry_event_create(display, wnd, event_id);
mouse.x = x;
mouse.y = y;
evt.mouse = mouse;
return evt;
}
CherryEvent
cherry_event_key_create(int event_id, XKeyEvent xkey)
{
CherryEvent evt;
CherryEventKey key;
evt.event_id = event_id;
key.xkey = xkey;
evt.key = key;
return evt;
}
int
cherry_event_id(CherryEvent evt)
{
return evt.event_id;
}
|