Mir
event_private.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 // ==================================
20 //
21 // Direct access to MirEvent deprecated. Prefer mir_event_* family of functions.
22 //
23 // ==================================
24 
25 #ifndef MIR_COMMON_EVENT_PRIVATE_H_
26 #define MIR_COMMON_EVENT_PRIVATE_H_
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 #include "mir_toolkit/event.h"
31 #include "mir_toolkit/common.h"
32 
33 #include <xkbcommon/xkbcommon.h>
34 #include <chrono>
35 
36 #include <chrono>
37 
38 #ifdef __cplusplus
39 
43 extern "C" {
44 #endif
45 /* TODO: To the moon. */
46 #define MIR_INPUT_EVENT_MAX_POINTER_COUNT 16
47 
48 // PRIVATE
49 // Direct access to MirKeyEvent is deprecated. Please use mir_event_get_input_event
50 // and the mir_input_event* family of functions.
51 typedef struct
52 {
54 
55  int32_t device_id;
56  int32_t source_id;
59 
60  int32_t key_code;
61  int32_t scan_code;
62 
63  std::chrono::nanoseconds event_time;
64  uint64_t mac;
65 } MirKeyEvent;
66 
67 typedef struct
68 {
69  int id;
70  float x;
71  float y;
72  float dx;
73  float dy;
74  float touch_major;
75  float touch_minor;
76  float size;
77  float pressure;
78  float orientation;
79  float vscroll;
80  float hscroll;
82 
83  // TODO: We would like to store this as a MirTouchAction but we still encode pointer actions
84  // here as well.
85  int action;
87 
88 // PRIVATE
89 // Direct access to MirMotionEvent is deprecated. Please use mir_event_get_input_event
90 // and the mir_input_event* family of functions.
91 typedef struct
92 {
94 
95  int32_t device_id;
96  int32_t source_id;
97 
99 
101  std::chrono::nanoseconds event_time;
102  uint64_t mac;
103 
106  /* "_coordinates" is a misnomer here because there's plenty more info than
107  just coordinates, but renaming it accurately would be an API break */
109 
111 {
113 
115  std::chrono::nanoseconds when;
117 };
118 
120 {
122 
123  int id;
125  int value;
126 };
127 
129 {
131 
133  int width;
134  int height;
135 };
136 
138 {
140 
142 };
143 
145 {
147 
150 };
151 
153 {
155 
157 };
158 
160 {
162 
164  struct xkb_rule_names rules;
165 };
166 
168 {
170 
172  int dpi;
173  float scale;
175 };
176 
177 // Access to MirEvent is deprecated
178 union MirEvent
179 {
191 };
192 
193 #ifdef __cplusplus
194 }
196 #endif
197 
198 #endif /* MIR_COMMON_EVENT_PRIVATE_H_ */
MirEventType type
Definition: event_private.h:169
int dpi
Definition: event_private.h:172
int surface_id
Definition: event_private.h:156
size_t pointer_count
Definition: event_private.h:104
MirEventType type
Definition: event_private.h:93
float hscroll
Definition: event_private.h:80
#define MIR_INPUT_EVENT_MAX_POINTER_COUNT
Definition: event_private.h:46
MirCloseSurfaceEvent close_surface
Definition: event_private.h:187
Definition: event_private.h:159
MirInputConfigurationAction action
Definition: event_private.h:114
Definition: event_private.h:119
MirInputEventModifiers modifiers
Definition: event_private.h:98
MirPromptSessionState
Definition: common.h:109
float touch_major
Definition: event_private.h:74
MirMotionEvent motion
Definition: event_private.h:182
MirKeymapEvent keymap
Definition: event_private.h:188
MirSurfaceOutputEvent surface_output
Definition: event_private.h:190
int32_t source_id
Definition: event_private.h:96
int32_t key_code
Definition: event_private.h:60
MirOrientation direction
Definition: event_private.h:149
std::chrono::nanoseconds event_time
Definition: event_private.h:101
MirInputConfigurationEvent input_configuration
Definition: event_private.h:189
std::chrono::nanoseconds when
Definition: event_private.h:115
float touch_minor
Definition: event_private.h:75
int32_t scan_code
Definition: event_private.h:61
MirEventType type
Definition: event_private.h:112
float size
Definition: event_private.h:76
float pressure
Definition: event_private.h:77
int32_t device_id
Definition: event_private.h:95
Definition: event_private.h:137
MirFormFactor form_factor
Definition: event_private.h:174
int surface_id
Definition: event_private.h:148
int32_t source_id
Definition: event_private.h:56
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
MirSurfaceEvent surface
Definition: event_private.h:183
int value
Definition: event_private.h:125
MirKeyboardAction
Possible actions for changing key state.
Definition: keyboard_event.h:49
unsigned int MirInputEventModifiers
Definition: input_event.h:65
Definition: event_private.h:51
MirEventType type
Definition: event_private.h:154
Definition: event_private.h:67
uint64_t mac
Definition: event_private.h:102
float dy
Definition: event_private.h:73
std::chrono::nanoseconds event_time
Definition: event_private.h:63
MirPointerButtons buttons
Definition: event_private.h:100
int height
Definition: event_private.h:134
Definition: event_private.h:167
float x
Definition: event_private.h:70
uint64_t mac
Definition: event_private.h:64
int64_t MirInputDeviceId
Definition: input_event.h:34
int surface_id
Definition: event_private.h:132
MirKeyboardAction action
Definition: event_private.h:57
MirEventType type
Definition: event_private.h:180
MirOrientationEvent orientation
Definition: event_private.h:186
MirEventType
Definition: event.h:34
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_private.h:184
MirPromptSessionState new_state
Definition: event_private.h:141
MirEventType type
Definition: event_private.h:139
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_event.h:78
MirFormFactor
Form factor associated with a physical output.
Definition: common.h:197
unsigned int MirPointerButtons
Definition: pointer_event.h:82
float orientation
Definition: event_private.h:78
MirEventType type
Definition: event_private.h:161
float scale
Definition: event_private.h:173
Definition: event_private.h:128
MirEventType type
Definition: event_private.h:130
MirEventType type
Definition: event_private.h:121
MirInputConfigurationAction
MirInputConfigurationEvent indicates a configuration change in the input device subsystem. Eventually it's usage will be required to properly interpret MirInputEvent, for example: If we receive a button down, and then a device reset, we should not expect to receive the button up.
Definition: input_configuration_event.h:43
Definition: event_private.h:152
MirSurfaceAttrib attrib
Definition: event_private.h:124
MirEventType type
Definition: event_private.h:53
MirTouchTooltype tool_type
Definition: event_private.h:81
float y
Definition: event_private.h:71
MirInputDeviceId id
Definition: event_private.h:116
int id
Definition: event_private.h:69
MirEventType type
Definition: event_private.h:146
int width
Definition: event_private.h:133
int surface_id
Definition: event_private.h:163
MirPromptSessionEvent prompt_session
Definition: event_private.h:185
Definition: event_private.h:178
struct xkb_rule_names rules
Definition: event_private.h:164
int surface_id
Definition: event_private.h:171
int action
Definition: event_private.h:85
Definition: event_private.h:110
int id
Definition: event_private.h:123
Definition: event_private.h:91
float vscroll
Definition: event_private.h:79
MirKeyEvent key
Definition: event_private.h:181
MirInputEventModifiers modifiers
Definition: event_private.h:58
int32_t device_id
Definition: event_private.h:55
float dx
Definition: event_private.h:72
Definition: event_private.h:144

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015