Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 {
46 } MirEventType;
47 
48 typedef enum {
52 } MirKeyAction;
53 
54 typedef enum {
66 } MirKeyFlag;
67 
68 typedef enum {
88 
89 typedef enum {
102 
103 typedef enum {
105 } MirMotionFlag;
106 
107 typedef enum {
114 
115 typedef enum {
122 
123 typedef struct
124 {
126 
127  int32_t device_id;
128  int32_t source_id;
131  unsigned int modifiers;
132 
133  int32_t key_code;
134  int32_t scan_code;
135  int32_t repeat_count;
136  nsecs_t down_time;
137  nsecs_t event_time;
139 } MirKeyEvent;
140 
141 typedef struct
142 {
143  int id;
144  float x, raw_x;
145  float y, raw_y;
146  float touch_major;
147  float touch_minor;
148  float size;
149  float pressure;
150  float orientation;
151  float vscroll;
152  float hscroll;
154  int unused1;
155  int unused2;
156  int unused3;
158 
159 typedef struct
160 {
162 
163  int32_t device_id;
164  int32_t source_id;
165  /*
166  * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
167  * encodes some non enumerable values in it. It's convenient to keep things
168  * this way for now until we can drop SF/Hybris support in QtUbuntu.
169  */
170  int action;
172  unsigned int modifiers;
173 
174  int32_t edge_flags;
176  float x_offset;
177  float y_offset;
178  float x_precision;
179  float y_precision;
180  nsecs_t down_time;
181  nsecs_t event_time;
182 
185  /* "_coordinates" is a misnomer here because there's plenty more info than
186  just coordinates, but renaming it accurately would be an API break */
187 
188  int unused0;
189  int unused1;
190  int unused2;
191  int unused3;
193 
194 typedef struct
195 {
197 
198  int id;
200  int value;
202 
203 typedef struct
204 {
206 
208  int width;
209  int height;
211 
212 typedef struct
213 {
215 
218 
219 typedef struct MirOrientationEvent
220 {
222 
226 
227 typedef union
228 {
236 } MirEvent;
237 
238 #ifdef __cplusplus
239 }
241 #endif
242 
243 #endif /* MIR_TOOLKIT_EVENT_H_ */
nsecs_t down_time
Definition: event.h:180
Definition: event.h:43
Definition: event.h:57
Definition: event.h:100
Definition: event.h:59
Definition: event.h:96
size_t pointer_count
Definition: event.h:183
Definition: event.h:49
MirMotionToolType tool_type
Definition: event.h:153
MirEventType type
Definition: event.h:161
MirMotionFlag
Definition: event.h:103
float hscroll
Definition: event.h:152
Definition: event.h:40
Definition: event.h:41
#define MIR_INPUT_EVENT_MAX_POINTER_COUNT
Definition: event.h:34
Definition: event.h:120
Definition: event.h:194
int32_t edge_flags
Definition: event.h:174
Definition: event.h:63
int unused1
Definition: event.h:189
MirPromptSessionState
Definition: common.h:104
float touch_major
Definition: event.h:146
Definition: event.h:55
MirMotionEvent motion
Definition: event.h:231
Definition: event.h:76
MirMotionAction
Definition: event.h:89
float x_offset
Definition: event.h:176
Definition: event.h:90
Definition: event.h:83
nsecs_t event_time
Definition: event.h:137
struct MirOrientationEvent MirOrientationEvent
Definition: event.h:93
Definition: event.h:99
Definition: event.h:110
Definition: event.h:94
int32_t source_id
Definition: event.h:164
int32_t key_code
Definition: event.h:133
MirOrientation direction
Definition: event.h:224
Definition: event.h:62
float touch_minor
Definition: event.h:147
Definition: event.h:50
int32_t scan_code
Definition: event.h:134
Definition: event.h:73
float size
Definition: event.h:148
float pressure
Definition: event.h:149
Definition: event.h:45
int32_t device_id
Definition: event.h:163
Definition: event.h:212
Definition: event.h:77
MirMotionFlag flags
Definition: event.h:171
Definition: event.h:61
int surface_id
Definition: event.h:223
nsecs_t event_time
Definition: event.h:181
int32_t source_id
Definition: event.h:128
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:134
MirSurfaceEvent surface
Definition: event.h:232
int value
Definition: event.h:200
float y_offset
Definition: event.h:177
MirKeyFlag flags
Definition: event.h:130
Definition: event.h:81
Definition: event.h:84
Definition: event.h:123
Definition: event.h:141
Definition: event.h:86
int unused0
Definition: event.h:188
int64_t nsecs_t
Definition: event.h:36
MirKeyAction
Definition: event.h:48
int unused3
Definition: event.h:191
int unused2
Definition: event.h:155
Definition: event.h:111
Definition: event.h:58
int height
Definition: event.h:209
MirMotionToolType
Definition: event.h:115
Definition: event.h:72
Definition: event.h:95
float x
Definition: event.h:144
int surface_id
Definition: event.h:207
Definition: event.h:60
Definition: event.h:69
Definition: event.h:80
MirKeyFlag
Definition: event.h:54
MirEventType type
Definition: event.h:229
MirOrientationEvent orientation
Definition: event.h:235
Definition: event.h:51
float y_precision
Definition: event.h:179
MirEventType
Definition: event.h:38
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:36
MirResizeEvent resize
Definition: event.h:233
MirPromptSessionState new_state
Definition: event.h:216
MirEventType type
Definition: event.h:214
int is_system_key
Definition: event.h:138
Definition: event.h:119
Definition: event.h:78
float orientation
Definition: event.h:150
int unused1
Definition: event.h:154
Definition: event.h:42
Definition: event.h:203
MirEventType type
Definition: event.h:205
Definition: event.h:104
MirEventType type
Definition: event.h:196
Definition: event.h:75
MirSurfaceAttrib attrib
Definition: event.h:199
Definition: event.h:79
MirEventType type
Definition: event.h:125
unsigned int modifiers
Definition: event.h:131
Definition: event.h:116
float y
Definition: event.h:145
MirKeyAction action
Definition: event.h:129
MirMotionButton button_state
Definition: event.h:175
Definition: event.h:65
int id
Definition: event.h:143
Definition: event.h:71
MirEventType type
Definition: event.h:221
Definition: event.h:85
int width
Definition: event.h:208
Definition: event.h:70
Definition: event.h:118
int32_t repeat_count
Definition: event.h:135
MirPromptSessionEvent prompt_session
Definition: event.h:234
Definition: event.h:227
int unused2
Definition: event.h:190
Definition: event.h:98
Definition: event.h:112
nsecs_t down_time
Definition: event.h:136
int unused3
Definition: event.h:156
MirMotionButton
Definition: event.h:107
MirKeyModifier
Definition: event.h:68
Definition: event.h:92
Definition: event.h:109
Definition: event.h:97
int id
Definition: event.h:198
Definition: event.h:159
float vscroll
Definition: event.h:151
MirKeyEvent key
Definition: event.h:230
unsigned int modifiers
Definition: event.h:172
Definition: event.h:64
Definition: event.h:56
int action
Definition: event.h:170
Definition: event.h:91
Definition: event.h:82
int32_t device_id
Definition: event.h:127
Definition: event.h:117
float x_precision
Definition: event.h:178
Definition: event.h:74
Definition: event.h:108
Definition: event.h:219

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014