Mir
event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014-2016 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 */
51 } MirEventType;
52 
64 
65 typedef struct MirCookie MirCookie;
66 
67 typedef struct MirEvent MirEvent;
68 
69 #ifdef __cplusplus
70 }
72 #endif
73 
83 
84 #ifdef __cplusplus
85 
89 extern "C" {
90 #endif
91 
101 
111 
121 
131 
141 
151 
165 __attribute__ ((deprecated))
169 
179 
190 __attribute__((deprecated))
194 
209 
220 
230 
231 /*
232  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
233  * _________________________
234  *< Don't use mir_event_ref >
235  * -------------------------
236  * \ ^__^
237  * \ (oo)\_______
238  * (__)\ )\/\
239  * ||----w |
240  * || ||
241  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
242  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy
243  * until such time that direct MirEvent access is deprecated. This means you
244  * must use the return value as your new reference.
245  */
246 
254 MirEvent const* mir_event_ref(MirEvent const* event) __attribute__((warn_unused_result));
255 
261 void mir_event_unref(MirEvent const* event);
262 
263 #ifdef __cplusplus
264 }
266 #endif
267 
268 #endif /* MIR_TOOLKIT_EVENT_H_ */
Definition: event.h:39
Definition: event.h:36
Definition: event.h:37
MirSurfaceEvent const * mir_event_get_surface_event(MirEvent const *event)
Retrieve the MirSurfaceEvent associated with a MirEvent of type mir_event_type_surface.
MirEventType mir_event_get_type(MirEvent const *event)
Retrieves the type of a MirEvent.
struct MirInputDeviceStateEvent MirInputDeviceStateEvent
Definition: event.h:62
MirInputDeviceStateEvent const * mir_event_get_input_device_state_event(MirEvent const *event)
Retrieve the MirInputDeviceStateEvent associated with a MirEvent of type mir_event_type_input_device_...
MirOrientationEvent const * mir_event_get_orientation_event(MirEvent const *event)
Retrieve the MirOrientationEvent associated with a MirEvent of type mir_event_type_orientation.
Definition: event.h:41
struct MirSurfacePlacementEvent MirSurfacePlacementEvent
Definition: event.h:63
Definition: event.h:49
struct MirInputConfigurationEvent MirInputConfigurationEvent
Definition: event.h:60
MirInputConfigurationEvent const * mir_event_get_input_configuration_event(MirEvent const *event)
Retrieve the MirInputConfiguration associated with a MirEvent of type mir_event_type_input_configurat...
MirPromptSessionEvent const * mir_event_get_prompt_session_event(MirEvent const *event)
Retrieve the MirPromptSessionEvent associated with a MirEvent of type mir_event_type_prompt_session_s...
struct MirSurfaceOutputEvent MirSurfaceOutputEvent
Definition: event.h:61
Definition: event.h:50
MirCloseSurfaceEvent const * mir_event_get_close_surface_event(MirEvent const *event)
Retrieve the MirCloseSurfaceEvent associated with a MirEvent of type mir_event_type_close_surface.
MirKeymapEvent const * mir_event_get_keymap_event(MirEvent const *event)
Retrieve the MirKeymapEvent associated with a MirEvent of type mir_event_type_keymap.
Definition: event.h:45
MirEventType
Definition: event.h:34
struct MirOrientationEvent MirOrientationEvent
Definition: event.h:56
struct MirEvent MirEvent
Definition: event.h:67
struct MirCookie MirCookie
Definition: event.h:65
struct MirResizeEvent MirResizeEvent
Definition: event.h:54
void mir_event_unref(MirEvent const *event)
Release a reference to a MirEvent.
Definition: event.h:46
struct MirCloseSurfaceEvent MirCloseSurfaceEvent
Definition: event.h:57
MirInputEvent const * mir_event_get_input_event(MirEvent const *event)
Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.
MirEvent const * mir_event_ref(MirEvent const *event) __attribute__((warn_unused_result))
Reference this MirEvent and return a pointer to the newly referenced instance.
struct MirKeymapEvent MirKeymapEvent
Definition: event.h:59
Definition: event.h:38
MirSurfacePlacementEvent const * mir_event_get_surface_placement_event(MirEvent const *event)
Retrieve the MirSurfacePlacementEvent associated with a MirEvent of type mir_event_type_surface_place...
MirSurfaceOutputEvent const * mir_event_get_surface_output_event(MirEvent const *event)
Retrieve the MirSurfaceOutputEvent associated with a MirEvent of type mir_event_type_surface_output.
struct MirPromptSessionEvent MirPromptSessionEvent
Definition: event.h:55
struct MirInputEvent MirInputEvent
Definition: event.h:58
Definition: event.h:48
struct MirSurfaceEvent MirSurfaceEvent
Definition: event.h:53
Definition: event.h:42
MirResizeEvent const * mir_event_get_resize_event(MirEvent const *event)
Retrieve the MirResizeEvent associated with a MirEvent of type mir_event_type_resize.

Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016