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 struct MirCookie MirCookie;
62 
63 typedef union MirEvent MirEvent;
64 
65 #ifdef __cplusplus
66 }
68 #endif
69 
78 
79 #ifdef __cplusplus
80 
84 extern "C" {
85 #endif
86 
96 
106 
116 
126 
136 
146 
160 __attribute__ ((deprecated))
162 
172 
182 
197 
198 /*
199  *
200  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
201  * _________________________
202  *< Don't use mir_event_ref >
203  *-------------------------
204  * \ ^__^
205  * \ (oo)\_______
206 * (__)\ )\/\
207  * ||----w |
208  * || ||
209  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
210  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy until
211  * such point whereas direct MirEvent access as deprecated. This means you must
212  * use the return value as your new reference
213  *
214  */
215 
223 MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result));
224 
230 void mir_event_unref(MirEvent const* ev);
231 
232 #ifdef __cplusplus
233 }
235 #endif
236 
237 #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
Definition: event_private.h:119
MirOrientationEvent const * mir_event_get_orientation_event(MirEvent const *ev)
Retrieve the MirOrientationEvent associated with a MirEvent of type mir_event_type_orientation.
Definition: event.cpp:122
MirInputConfigurationEvent const * mir_event_get_input_configuration_event(MirEvent const *ev)
Retrieve the MirInputConfiguration associated with a MirEvent of type mir_event_type_input_configurat...
Definition: event.cpp:143
Definition: event.h:41
Definition: event_private.h:137
MirKeymapEvent const * mir_event_get_keymap_event(MirEvent const *ev)
Retrieve the MirKeymapEvent associated with a MirEvent of type mir_event_type_keymap.
Definition: event.cpp:136
MirSurfaceEvent const * mir_event_get_surface_event(MirEvent const *ev)
Retrieve the MirSurfaceEvent associated with a MirEvent of type mir_event_type_surface.
Definition: event.cpp:101
Definition: event_private.h:169
MirPromptSessionEvent const * mir_event_get_prompt_session_event(MirEvent const *ev)
Retrieve the MirPromptSessionEvent associated with a MirEvent of type mir_event_type_prompt_session_s...
Definition: event.cpp:115
__attribute__((deprecated)) MirCloseSurfaceEvent const *mir_event_get_close_surface_event(MirEvent const *ev)
Retrieve the MirCloseSurfaceEvent associated with a MirEvent of type mir_event_type_close_surface.
Definition: event.h:45
MirEventType
Definition: event.h:34
Definition: event.h:46
MirInputEvent const * mir_event_get_input_event(MirEvent const *ev)
Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.
Definition: event.cpp:89
MirEvent const * mir_event_ref(MirEvent const *ev) __attribute__((warn_unused_result))
Reference this MirEvent and return a pointer to the newly referenced instance.
Definition: event.cpp:268
Definition: event.h:38
Definition: event_private.h:128
Definition: event_private.h:152
MirCloseSurfaceEvent const * mir_event_get_close_surface_event(MirEvent const *ev)
Definition: event.cpp:129
struct MirInputEvent MirInputEvent
Definition: event.h:56
Definition: event.h:48
void mir_event_unref(MirEvent const *ev)
Release a reference to a MirEvent.
Definition: event.cpp:283
MirEventType mir_event_get_type(MirEvent const *ev)
Retrieves the type of a MirEvent.
Definition: event.cpp:77
Definition: event_private.h:181
Definition: event_private.h:110
Definition: event.h:42
MirResizeEvent const * mir_event_get_resize_event(MirEvent const *ev)
Retrieve the MirResizeEvent associated with a MirEvent of type mir_event_type_resize.
Definition: event.cpp:108
Definition: event_private.h:144

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016