Mir
event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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: Robert Carr <robert.carr@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 
34 typedef enum
35 {
43  /* Type for new style input event will be returned from mir_event_get_type
44  when old style event type was mir_event_type_key or mir_event_type_motion */
49 } MirEventType;
50 
60 
61 typedef union MirEvent MirEvent;
62 
63 #ifdef __cplusplus
64 }
66 #endif
67 
76 
77 #ifdef __cplusplus
78 
82 extern "C" {
83 #endif
84 
85 /*
86  * Retrieves the type of a MirEvent. Now preferred over direct access to ev->type.
87  * In particular ev->type will never be mir_event_type_input and mir_event_get_type
88  * is the only way to ensure mir_event_get_input_event will succeed.
89  *
90  * \param [in] event The event
91  * \return The event type
92  */
94 
95 /*
96  * Retrieve the MirInputEvent associated with a MirEvent of
97  * type mir_event_type_input. See <mir_toolkit/events/input/input_event.h>
98  * for accessors.
99  *
100  * \param [in] event The event
101  * \return The associated MirInputEvent
102  */
104 
105 /*
106  * Retrieve the MirSurfaceEvent associated with a MirEvent of
107  * type mir_event_type_surface. See <mir_toolkit/events/surface_event.h>
108  * for accessors.
109  *
110  * \param [in] event The event
111  * \return The associated MirSurfaceEvent
112  */
114 
115 /*
116  * Retrieve the MirResizeEvent associated with a MirEvent of
117  * type mir_event_type_resize. See <mir_toolkits/events/resize_event.h>
118  * for accessors.
119  *
120  * \param [in] event The event
121  * \return The associated MirResizeEvent
122  */
124 
125 /*
126  * Retrieve the MirPromptSessionEvent associated with a MirEvent of
127  * type mir_event_type_prompt_session_state_change. See <mir_toolkits/events/prompt_session_event.h>
128  * for accessors.
129  *
130  * \param [in] event The event
131  * \return The associated MirPromptSessionEvent
132  */
134 
135 /*
136  * Retrieve the MirOrientationEvent associated with a MirEvent of
137  * type mir_event_type_orientation. See <mir_toolkit/events/orientation_event.h>
138  * for accessors.
139  *
140  * \param [in] event The event
141  * \return The associated MirOrientationEvent
142  */
144 
145 /*
146  * Retrieve the MirCloseSurfaceEvent associated with a MirEvent of
147  * type mir_event_type_close_surface. The event is a request to close
148  * the surface it is delivered to and has no accessors.
149  *
150  * \param [in] event The event
151  * \return The associated MirCloseSurfaceEvent
152  */
154 
155 /*
156  * Retrieve the MirKeymapEvent associated with a MirEvent of
157  * type mir_event_type_keymap. The event signifies that the keymap
158  * applied for the relevant surface has changed.
159  *
160  * \param [in] event The event
161  * \return The associated MirKeymapEvent
162  */
164 
165 /*
166  * Retrieve the MirInputConfiguration associated with a MirEvent of
167  * type mir_event_type_input_configuration. The event signifies that the
168  * input device configuration has changed.
169  *
170  * \param [in] event The event
171  * \return The associated MirInputConfigurationEvent
172  */
174 
189 
190 /*
191  *
192  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
193  * _________________________
194  *< Don't use mir_event_ref >
195  *-------------------------
196  * \ ^__^
197  * \ (oo)\_______
198 * (__)\ )\/\
199  * ||----w |
200  * || ||
201  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
202  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy until
203  * such point whereas direct MirEvent access as deprecated. This means you must
204  * use the return value as your new reference
205  *
206  */
207 
208 /*
209  * Reference this MirEvent and return a pointer to the
210  * newly referenced instance
211  *
212  * \param[in] The event to reference
213  * \return The event pointer to now use
214  */
215 MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result));
216 
217 /*
218  * Release a reference to a MirEvent.
219  *
220  * \param[in] The event to un-reference
221  */
222 void mir_event_unref(MirEvent const* ev);
223 
224 #ifdef __cplusplus
225 }
227 #endif
228 
229 #endif /* MIR_TOOLKIT_EVENT_H_ */
Definition: event.h:39
MirSurfaceOutputEvent const * mir_event_get_surface_output_event(MirEvent const *ev)
Retrieve the MirSurfaceOutputEvent associated with a MirEvent of type mir_event_type_surface_output.
Definition: event.cpp:150
Definition: event.h:36
Definition: event.h:37
Definition: event_private.h:159
MirCloseSurfaceEvent const * mir_event_get_close_surface_event(MirEvent const *ev)
Definition: event.cpp:129
Definition: event_private.h:119
MirOrientationEvent const * mir_event_get_orientation_event(MirEvent const *ev)
Definition: event.cpp:122
int __attribute__((constructor)) init_google_protobuf()
Definition: google_protobuf_guard.cpp:21
MirInputConfigurationEvent const * mir_event_get_input_configuration_event(MirEvent const *ev)
Definition: event.cpp:143
Definition: event.h:41
Definition: event_private.h:137
MirKeymapEvent const * mir_event_get_keymap_event(MirEvent const *ev)
Definition: event.cpp:136
MirSurfaceEvent const * mir_event_get_surface_event(MirEvent const *ev)
Definition: event.cpp:101
Definition: event_private.h:167
MirPromptSessionEvent const * mir_event_get_prompt_session_event(MirEvent const *ev)
Definition: event.cpp:115
Definition: event.h:45
MirEventType
Definition: event.h:34
Definition: event.h:46
MirInputEvent const * mir_event_get_input_event(MirEvent const *ev)
Definition: event.cpp:89
MirEvent const * mir_event_ref(MirEvent const *ev) __attribute__((warn_unused_result))
Definition: event.cpp:253
Definition: event.h:38
Definition: event_private.h:128
Definition: event_private.h:152
struct MirInputEvent MirInputEvent
Definition: event.h:56
Definition: event.h:48
void mir_event_unref(MirEvent const *ev)
Definition: event.cpp:260
MirEventType mir_event_get_type(MirEvent const *ev)
Definition: event.cpp:77
Definition: event_private.h:178
Definition: event_private.h:110
Definition: event.h:42
MirResizeEvent const * mir_event_get_resize_event(MirEvent const *ev)
Definition: event.cpp:108
Definition: event_private.h:144

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