OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WAYLAND_EVENT_H_ | |
6 #define WAYLAND_EVENT_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 typedef enum { | |
11 WAYLAND_BUTTON, | |
12 WAYLAND_KEY, | |
13 WAYLAND_MOTION, | |
14 WAYLAND_POINTER_FOCUS, | |
15 WAYLAND_KEYBOARD_FOCUS, | |
16 WAYLAND_GEOMETRY_CHANGE, | |
17 } WaylandEventType; | |
18 | |
19 enum WaylandEventButtonType { | |
20 LEFT_BUTTON = 272, | |
21 MIDDLE_BUTTON = 273, | |
22 RIGHT_BUTTON = 274, | |
23 SCROLL_UP = 275, | |
24 SCROLL_DOWN = 276, | |
Evan Martin
2011/07/21 16:37:57
Is this not in some wayland header somewhere?
| |
25 }; | |
26 | |
27 struct WaylandEventButton { | |
28 WaylandEventType type; | |
29 uint32_t time; | |
30 uint32_t button; | |
31 uint32_t state; | |
32 uint32_t modifiers; | |
33 int32_t x; | |
34 int32_t y; | |
35 }; | |
36 | |
37 struct WaylandEventKey { | |
38 WaylandEventType type; | |
39 uint32_t time; | |
40 uint32_t key; | |
41 uint32_t sym; | |
42 uint32_t state; | |
43 uint32_t modifiers; | |
44 }; | |
45 | |
46 | |
47 struct WaylandEventMotion { | |
48 WaylandEventType type; | |
49 uint32_t time; | |
50 uint32_t modifiers; | |
51 int32_t x; | |
52 int32_t y; | |
53 }; | |
54 | |
55 struct WaylandEventPointerFocus { | |
56 WaylandEventType type; | |
57 uint32_t time; | |
58 uint32_t state; | |
59 int32_t x; | |
60 int32_t y; | |
61 }; | |
62 | |
63 struct WaylandEventKeyboardFocus { | |
64 WaylandEventType type; | |
65 uint32_t time; | |
66 uint32_t state; | |
67 uint32_t modifiers; | |
68 }; | |
69 | |
70 struct WaylandEventGeometryChange { | |
71 WaylandEventType type; | |
72 uint32_t time; | |
73 int32_t x; | |
74 int32_t y; | |
75 int32_t width; | |
76 int32_t height; | |
77 }; | |
78 | |
79 union _WaylandEvent { | |
80 WaylandEventType type; | |
81 WaylandEventButton button; | |
82 WaylandEventKey key; | |
83 WaylandEventMotion motion; | |
84 WaylandEventPointerFocus pointer_focus; | |
85 WaylandEventKeyboardFocus keyboard_focus; | |
86 WaylandEventGeometryChange geometry_change; | |
87 }; | |
88 | |
89 typedef _WaylandEvent WaylandEvent; | |
90 | |
91 #endif | |
OLD | NEW |