Mir
event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014-2017 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 #pragma GCC diagnostic push
35 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
36 typedef enum
37 {
40  MIR_DEPRECATED_ENUM(mir_event_type_surface, "mir_event_type_window"),
41  mir_event_type_window = mir_event_type_surface,
45  MIR_DEPRECATED_ENUM(mir_event_type_close_surface, "mir_event_type_close_window"),
46  mir_event_type_close_window = mir_event_type_close_surface,
47  /* Type for new style input event will be returned from mir_event_get_type
48  when old style event type was mir_event_type_key or mir_event_type_motion */
51  MIR_DEPRECATED_ENUM(mir_event_type_input_configuration, "mir_connection_set_input_config_change_callback and mir_event_type_input_device_state"),
52  MIR_DEPRECATED_ENUM(mir_event_type_surface_output, "mir_event_type_window_output"),
53  mir_event_type_window_output = mir_event_type_surface_output,
55  MIR_DEPRECATED_ENUM(mir_event_type_surface_placement, "mir_event_type_window_placement"),
56  mir_event_type_window_placement = mir_event_type_surface_placement,
57 } MirEventType;
58 #pragma GCC diagnostic pop
59 
60 typedef struct MirSurfaceEvent MirSurfaceEvent
61  __attribute__ ((deprecated("use MirWindowEvent instead")));
62 typedef struct MirSurfaceEvent MirWindowEvent;
66 typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent
67  __attribute__ ((deprecated("use MirCloseWindowEvent instead")));
68 typedef struct MirCloseSurfaceEvent MirCloseWindowEvent;
71 typedef struct MirInputConfigurationEvent MirInputConfigurationEvent
72  __attribute__ ((deprecated("Use MirInputDeviceStateEvent and the MirInputConfig callback instead")));
73 typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent
74  __attribute__ ((deprecated("use MirWindowOutputEvent instead")));
75 typedef struct MirSurfaceOutputEvent MirWindowOutputEvent;
78  __attribute__ ((deprecated("use MirWindowPlacementEvent instead")));
80 
81 typedef struct MirCookie MirCookie;
82 
83 typedef struct MirEvent MirEvent;
84 
85 #ifdef __cplusplus
86 }
88 #endif
89 
101 
102 #ifdef __cplusplus
103 
107 extern "C" {
108 #endif
109 
119 
129 
138 MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event)
139 __attribute__ ((deprecated("use mir_event_get_window_event instead")));
140 
150 
160 
170 
180 
181 // Ignore use of deprecate MirCloseSurfaceEvent typedef in deprecated function (for now)
182 #pragma GCC diagnostic push
183 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
184 
197 __attribute__ ((deprecated))
200 MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* event);
201 #pragma GCC diagnostic pop
202 
212 
213 #pragma GCC diagnostic push
214 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
215 
225 __attribute__((deprecated))
228 MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* event);
229 #pragma GCC diagnostic pop
230 
244 MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event)
245 __attribute__((deprecated("use mir_event_get_window_output_event")));
246 
261 
272 
282 __attribute__((deprecated("use mir_event_get_window_placement_event")));
283 
293 
294 /*
295  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
296  * _________________________
297  *< Don't use mir_event_ref >
298  * -------------------------
299  * \ ^__^
300  * \ (oo)\_______
301  * (__)\ )\/\
302  * ||----w |
303  * || ||
304  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
305  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy
306  * until such time that direct MirEvent access is deprecated. This means you
307  * must use the return value as your new reference.
308  */
309 
317 MirEvent const* mir_event_ref(MirEvent const* event) __attribute__((warn_unused_result));
318 
324 void mir_event_unref(MirEvent const* event);
325 
326 #ifdef __cplusplus
327 }
329 #endif
330 
331 #endif /* MIR_TOOLKIT_EVENT_H_ */
Definition: event.h:42
Definition: event.h:38
Definition: event.h:39
Definition: event.h:56
MirEventType mir_event_get_type(MirEvent const *event)
Retrieves the type of a MirEvent.
struct MirInputDeviceStateEvent MirInputDeviceStateEvent
Definition: event.h:76
MirSurfaceEvent const * mir_event_get_surface_event(MirEvent const *event) __attribute__((deprecated("use mir_event_get_window_event instead")))
Retrieve the MirSurfaceEvent associated with a MirEvent of type mir_event_type_surface.
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_...
Definition: event.h:46
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:44
struct MirSurfacePlacementEvent MirWindowPlacementEvent
Definition: event.h:79
MirWindowOutputEvent const * mir_event_get_window_output_event(MirEvent const *event)
Retrieve the MirWindowOutputEvent associated with a MirEvent of type mir_event_type_window_output.
struct MirSurfacePlacementEvent MirSurfacePlacementEvent
Definition: surface_placement.h:32
Definition: event.h:54
MirInputConfigurationEvent const * mir_event_get_input_configuration_event(MirEvent const *event)
Retrieve the MirInputConfig associated with a MirEvent of type mir_event_type_input_configuration.
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...
MirWindowPlacementEvent const * mir_event_get_window_placement_event(MirEvent const *event)
Retrieve the MirWindowPlacementEvent associated with a MirEvent of type mir_event_type_window_placeme...
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.
struct MirSurfaceEvent MirSurfaceEvent __attribute__((deprecated("use MirWindowEvent instead")))
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:49
struct MirCloseSurfaceEvent MirCloseWindowEvent
Definition: event.h:68
MirEventType
Definition: event.h:36
struct MirOrientationEvent MirOrientationEvent
Definition: event.h:65
struct MirEvent MirEvent
Definition: event.h:83
struct MirCookie MirCookie
Definition: event.h:81
struct MirResizeEvent MirResizeEvent
Definition: event.h:63
void mir_event_unref(MirEvent const *event)
Release a reference to a MirEvent.
Definition: event.h:50
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:70
MirWindowEvent const * mir_event_get_window_event(MirEvent const *event)
Retrieve the MirWindowEvent associated with a MirEvent of type mir_event_type_window.
MirSurfacePlacementEvent const * mir_event_get_surface_placement_event(MirEvent const *event) __attribute__((deprecated("use mir_event_get_window_placement_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) __attribute__((deprecated("use mir_event_get_window_output_event")))
Retrieve the MirSurfaceOutputEvent associated with a MirEvent of type mir_event_type_surface_output.
Definition: event.h:40
struct MirPromptSessionEvent MirPromptSessionEvent
Definition: event.h:64
struct MirSurfaceOutputEvent MirWindowOutputEvent
Definition: event.h:75
struct MirInputEvent MirInputEvent
Definition: event.h:69
Definition: event.h:41
Definition: mir_input_config.h:77
struct MirSurfaceEvent MirWindowEvent
Definition: event.h:62
Definition: event.h:53
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 Mon Mar 27 12:06:55 UTC 2017