Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voss <thomas.voss@canonical.com>
17  */
18 
19 #ifndef MIR_TOOLKIT_EVENT_H_
20 #define MIR_TOOLKIT_EVENT_H_
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 #include "mir_toolkit/common.h"
25 
26 #ifdef __cplusplus
27 
31 extern "C" {
32 #endif
33 /* TODO: To the moon. */
34 #define MIR_INPUT_EVENT_MAX_POINTER_COUNT 16
35 
36 typedef int64_t nsecs_t;
37 
38 typedef enum
39 {
44 } MirEventType;
45 
46 typedef enum {
50 } MirKeyAction;
51 
52 typedef enum {
64 } MirKeyFlag;
65 
66 typedef enum {
86 
87 typedef enum {
100 
101 typedef enum {
103 } MirMotionFlag;
104 
105 typedef enum {
112 
113 typedef enum {
120 
121 typedef struct
122 {
124 
125  int32_t device_id;
126  int32_t source_id;
129  unsigned int modifiers;
130 
131  int32_t key_code;
132  int32_t scan_code;
133  int32_t repeat_count;
134  nsecs_t down_time;
135  nsecs_t event_time;
137 } MirKeyEvent;
138 
139 typedef struct
140 {
142 
143  int32_t device_id;
144  int32_t source_id;
145  /*
146  * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
147  * encodes some non enumerable values in it. It's convenient to keep things
148  * this way for now until we can drop SF/Hybris support in QtUbuntu.
149  */
150  int action;
152  unsigned int modifiers;
153 
154  int32_t edge_flags;
156  float x_offset;
157  float y_offset;
158  float x_precision;
159  float y_precision;
160  nsecs_t down_time;
161  nsecs_t event_time;
162 
164  struct
165  {
166  int id;
167  float x, raw_x;
168  float y, raw_y;
169  float touch_major;
170  float touch_minor;
171  float size;
172  float pressure;
173  float orientation;
174  float vscroll;
175  float hscroll;
177 
178  int unused1;
179  int unused2;
180  int unused3;
181  } pointer_coordinates[MIR_INPUT_EVENT_MAX_POINTER_COUNT];
182 
183  int unused0;
184  int unused1;
185  int unused2;
186  int unused3;
188 
189 typedef struct
190 {
192 
193  int id;
195  int value;
197 
198 typedef struct
199 {
201 
203  int width;
204  int height;
206 
207 typedef union
208 {
214 } MirEvent;
215 
216 #ifdef __cplusplus
217 }
219 #endif
220 
221 #endif /* MIR_TOOLKIT_EVENT_H_ */
nsecs_t down_time
Definition: event.h:160
Definition: event.h:43
Definition: event.h:55
Definition: event.h:98
Definition: event.h:57
int id
Definition: event.h:166
Definition: event.h:94
size_t pointer_count
Definition: event.h:163
Definition: event.h:47
MirEventType type
Definition: event.h:141
float size
Definition: event.h:171
MirMotionFlag
Definition: event.h:101
Definition: event.h:40
Definition: event.h:41
#define MIR_INPUT_EVENT_MAX_POINTER_COUNT
Definition: event.h:34
Definition: event.h:118
Definition: event.h:189
int32_t edge_flags
Definition: event.h:154
Definition: event.h:61
int unused1
Definition: event.h:178
Definition: event.h:53
MirMotionEvent motion
Definition: event.h:211
Definition: event.h:74
MirMotionAction
Definition: event.h:87
float x_offset
Definition: event.h:156
float hscroll
Definition: event.h:175
Definition: event.h:88
Definition: event.h:81
nsecs_t event_time
Definition: event.h:135
Definition: event.h:91
Definition: event.h:97
Definition: event.h:108
Definition: event.h:92
int32_t source_id
Definition: event.h:144
int32_t key_code
Definition: event.h:131
Definition: event.h:60
float vscroll
Definition: event.h:174
MirMotionToolType tool_type
Definition: event.h:176
Definition: event.h:48
int32_t scan_code
Definition: event.h:132
Definition: event.h:71
int32_t device_id
Definition: event.h:143
Definition: event.h:75
MirMotionFlag flags
Definition: event.h:151
float pressure
Definition: event.h:172
Definition: event.h:59
nsecs_t event_time
Definition: event.h:161
int32_t source_id
Definition: event.h:126
MirSurfaceEvent surface
Definition: event.h:212
int value
Definition: event.h:195
float y_offset
Definition: event.h:157
MirKeyFlag flags
Definition: event.h:128
Definition: event.h:79
Definition: event.h:82
float y
Definition: event.h:168
Definition: event.h:121
Definition: event.h:84
int unused0
Definition: event.h:183
int64_t nsecs_t
Definition: event.h:36
MirKeyAction
Definition: event.h:46
int unused3
Definition: event.h:180
Definition: event.h:109
Definition: event.h:56
int height
Definition: event.h:204
MirMotionToolType
Definition: event.h:113
Definition: event.h:70
Definition: event.h:93
int surface_id
Definition: event.h:202
Definition: event.h:58
Definition: event.h:67
Definition: event.h:78
MirKeyFlag
Definition: event.h:52
MirEventType type
Definition: event.h:209
Definition: event.h:49
float y_precision
Definition: event.h:159
MirEventType
Definition: event.h:38
float touch_major
Definition: event.h:169
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
MirResizeEvent resize
Definition: event.h:213
int is_system_key
Definition: event.h:136
Definition: event.h:117
Definition: event.h:76
Definition: event.h:42
float touch_minor
Definition: event.h:170
float x
Definition: event.h:167
Definition: event.h:198
MirEventType type
Definition: event.h:200
Definition: event.h:102
MirEventType type
Definition: event.h:191
Definition: event.h:73
MirSurfaceAttrib attrib
Definition: event.h:194
Definition: event.h:77
MirEventType type
Definition: event.h:123
unsigned int modifiers
Definition: event.h:129
Definition: event.h:114
MirKeyAction action
Definition: event.h:127
MirMotionButton button_state
Definition: event.h:155
Definition: event.h:63
Definition: event.h:69
Definition: event.h:83
int width
Definition: event.h:203
Definition: event.h:68
Definition: event.h:116
int32_t repeat_count
Definition: event.h:133
Definition: event.h:207
int unused2
Definition: event.h:179
Definition: event.h:96
Definition: event.h:110
nsecs_t down_time
Definition: event.h:134
MirMotionButton
Definition: event.h:105
MirKeyModifier
Definition: event.h:66
Definition: event.h:90
Definition: event.h:107
Definition: event.h:95
int id
Definition: event.h:193
Definition: event.h:139
float orientation
Definition: event.h:173
MirKeyEvent key
Definition: event.h:210
unsigned int modifiers
Definition: event.h:152
Definition: event.h:62
Definition: event.h:54
int action
Definition: event.h:150
Definition: event.h:89
Definition: event.h:80
int32_t device_id
Definition: event.h:125
Definition: event.h:115
float x_precision
Definition: event.h:158
Definition: event.h:72
Definition: event.h:106

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014