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 */
50 } MirEventType;
51 
62 
63 typedef struct MirCookie MirCookie;
64 
65 typedef struct MirEvent MirEvent;
66 
67 #ifdef __cplusplus
68 }
70 #endif
71 
81 
82 #ifdef __cplusplus
83 
87 extern "C" {
88 #endif
89 
99 
109 
119 
129 
139 
149 
163 __attribute__ ((deprecated))
165 
175 
185 
200 
211 
212 /*
213  *
214  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
215  * _________________________
216  *< Don't use mir_event_ref >
217  *-------------------------
218  * \ ^__^
219  * \ (oo)\_______
220 * (__)\ )\/\
221  * ||----w |
222  * || ||
223  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
224  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy until
225  * such point whereas direct MirEvent access as deprecated. This means you must
226  * use the return value as your new reference
227  *
228  */
229 
237 MirEvent const* mir_event_ref(MirEvent const* ev) __attribute__((warn_unused_result));
238 
244 void mir_event_unref(MirEvent const* ev);
245 
246 #ifdef __cplusplus
247 }
249 #endif
250 
251 #endif /* MIR_TOOLKIT_EVENT_H_ */
Definition: event.h:39
MirCloseSurfaceEvent const * mir_event_get_close_surface_event(MirEvent const *ev)
Definition: event.cpp:141
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:162
Definition: event.h:36
Definition: event.h:37
Definition: keymap_event.h:27
Definition: surface_event.h:24
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:134
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:155
Definition: event.h:41
Definition: prompt_session_event.h:24
Definition: input_device_state_event.h:27
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:148
Definition: event.h:49
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:113
Definition: surface_output_event.h:27
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:127
__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:101
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:345
Definition: event.h:38
Definition: resize_event.h:24
Definition: close_surface_event.h:24
MirInputDeviceStateEvent const * mir_event_get_input_device_state_event(MirEvent const *ev)
Retrieve the MirInputDeviceStateEvent associated with a MirEvent of type mir_event_type_input_device_...
Definition: event.cpp:169
Definition: input_event.h:24
Definition: event.h:48
void mir_event_unref(MirEvent const *ev)
Release a reference to a MirEvent.
Definition: event.cpp:350
MirEventType mir_event_get_type(MirEvent const *ev)
Retrieves the type of a MirEvent.
Definition: event.cpp:89
Definition: input_configuration_event.h:27
Definition: event.h:30
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:120
Definition: orientation_event.h:24

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016