Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 {
43 } MirEventType;
44 
45 typedef enum {
49 } MirKeyAction;
50 
51 typedef enum {
63 } MirKeyFlag;
64 
65 typedef enum {
85 
86 typedef enum {
99 
100 typedef enum {
102 } MirMotionFlag;
103 
104 typedef enum {
111 
112 typedef struct
113 {
115 
116  int32_t device_id;
117  int32_t source_id;
120  unsigned int modifiers;
121 
122  int32_t key_code;
123  int32_t scan_code;
124  int32_t repeat_count;
125  nsecs_t down_time;
126  nsecs_t event_time;
128 } MirKeyEvent;
129 
130 typedef struct
131 {
133 
134  int32_t device_id;
135  int32_t source_id;
136  /*
137  * TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
138  * encodes some non enumerable values in it. It's convenient to keep things
139  * this way for now until we can drop SF/Hybris support in QtUbuntu.
140  */
141  int action;
143  unsigned int modifiers;
144 
145  int32_t edge_flags;
147  float x_offset;
148  float y_offset;
149  float x_precision;
150  float y_precision;
151  nsecs_t down_time;
152  nsecs_t event_time;
153 
155  struct
156  {
157  int id;
158  float x, raw_x;
159  float y, raw_y;
160  float touch_major;
161  float touch_minor;
162  float size;
163  float pressure;
164  float orientation;
165  } pointer_coordinates[MIR_INPUT_EVENT_MAX_POINTER_COUNT];
167 
168 typedef struct
169 {
171 
172  int id;
174  int value;
176 
177 typedef union
178 {
183 } MirEvent;
184 
185 #ifdef __cplusplus
186 }
188 #endif
189 
190 #endif /* MIR_TOOLKIT_EVENT_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013