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 2 or 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"
26 
27 #ifdef __cplusplus
28 
32 extern "C" {
33 #endif
34 
35 #pragma GCC diagnostic push
36 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
37 typedef enum
38 {
39  MIR_DEPRECATED_ENUM(mir_event_type_key, "mir_event_type_input"), // UNUSED since Mir 0.26
40  MIR_DEPRECATED_ENUM(mir_event_type_motion, "mir_event_type_input"), // UNUSED since Mir 0.26
41  MIR_DEPRECATED_ENUM(mir_event_type_surface, "mir_event_type_window"),
42  mir_event_type_window = mir_event_type_surface,
46  MIR_DEPRECATED_ENUM(mir_event_type_close_surface, "mir_event_type_close_window"),
47  mir_event_type_close_window = mir_event_type_close_surface,
48  /* Type for new style input event will be returned from mir_event_get_type
49  when old style event type was mir_event_type_key or mir_event_type_motion */
52  MIR_DEPRECATED_ENUM(mir_event_type_input_configuration, "mir_connection_set_input_config_change_callback and mir_event_type_input_device_state"),
53  MIR_DEPRECATED_ENUM(mir_event_type_surface_output, "mir_event_type_window_output"),
54  mir_event_type_window_output = mir_event_type_surface_output,
56  MIR_DEPRECATED_ENUM(mir_event_type_surface_placement, "mir_event_type_window_placement"),
57  mir_event_type_window_placement = mir_event_type_surface_placement,
58 } MirEventType;
59 #pragma GCC diagnostic pop
60 
61 typedef struct MirSurfaceEvent MirSurfaceEvent
63 typedef struct MirSurfaceEvent MirWindowEvent;
67 typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent
69 typedef struct MirCloseSurfaceEvent MirCloseWindowEvent;
72 typedef struct MirInputConfigurationEvent MirInputConfigurationEvent
74 typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent
76 typedef struct MirSurfaceOutputEvent MirWindowOutputEvent;
81 
82 typedef struct MirCookie MirCookie;
83 
84 typedef struct MirEvent MirEvent;
85 
86 #ifdef __cplusplus
87 }
89 #endif
90 
102 
103 #ifdef __cplusplus
104 
108 extern "C" {
109 #endif
110 
120 
130 
139 MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event)
140 MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_event instead");
141 
151 
161 
171 
181 
182 // Ignore use of deprecate MirCloseSurfaceEvent typedef in deprecated function (for now)
183 #pragma GCC diagnostic push
184 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
185 
198 MIR_FOR_REMOVAL_IN_VERSION_1("Use of this function is pointless as there is no way to use the return value")
201 MirCloseSurfaceEvent const* mir_event_get_close_surface_event(MirEvent const* event);
202 #pragma GCC diagnostic pop
203 
213 
214 #pragma GCC diagnostic push
215 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
216 
226 MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback")
229 MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* event);
230 #pragma GCC diagnostic pop
231 
245 MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event)
246 MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_output_event");
247 
262 
273 
283 MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_placement_event");
284 
294 
295 /*
296  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
297  * _________________________
298  *< Don't use mir_event_ref >
299  * -------------------------
300  * \ ^__^
301  * \ (oo)\_______
302  * (__)\ )\/\
303  * ||----w |
304  * || ||
305  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
306  * NOTICE: mir_event_ref and mir_event_unref are implemented in terms of copy
307  * until such time that direct MirEvent access is deprecated. This means you
308  * must use the return value as your new reference.
309  */
310 
318 MirEvent const* mir_event_ref(MirEvent const* event) __attribute__((warn_unused_result));
319 
325 void mir_event_unref(MirEvent const* event);
326 
327 #ifdef __cplusplus
328 }
330 #endif
331 
332 #endif /* MIR_TOOLKIT_EVENT_H_ */
Definition: event.h:43
MirSurfaceEvent const * mir_event_get_surface_event(MirEvent const *event) MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_event instead")
Retrieve the MirSurfaceEvent associated with a MirEvent of type mir_event_type_surface.
Definition: event.h:39
Definition: event.h:57
MirEventType mir_event_get_type(MirEvent const *event)
Retrieves the type of a MirEvent.
struct MirSurfaceEvent MirSurfaceEvent MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowEvent instead")
struct MirInputDeviceStateEvent MirInputDeviceStateEvent
Definition: event.h:77
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:47
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:45
struct MirSurfacePlacementEvent MirWindowPlacementEvent
Definition: event.h:80
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:33
Definition: event.h:55
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.
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:50
struct MirCloseSurfaceEvent MirCloseWindowEvent
Definition: event.h:69
MirEventType
Definition: event.h:37
struct MirOrientationEvent MirOrientationEvent
Definition: event.h:66
struct MirEvent MirEvent
Definition: event.h:84
struct MirCookie MirCookie
Definition: event.h:82
struct MirResizeEvent MirResizeEvent
Definition: event.h:64
void mir_event_unref(MirEvent const *event)
Release a reference to a MirEvent.
Definition: event.h:51
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:71
MirWindowEvent const * mir_event_get_window_event(MirEvent const *event)
Retrieve the MirWindowEvent associated with a MirEvent of type mir_event_type_window.
struct MirPromptSessionEvent MirPromptSessionEvent
Definition: event.h:65
struct MirSurfaceOutputEvent MirWindowOutputEvent
Definition: event.h:76
struct MirInputEvent MirInputEvent
Definition: event.h:70
MirSurfacePlacementEvent const * mir_event_get_surface_placement_event(MirEvent const *event) MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_placement_event")
Retrieve the MirSurfacePlacementEvent associated with a MirEvent of type mir_event_type_surface_place...
Definition: event.h:42
struct MirInputConfig MirInputConfig
Definition: client_types.h:406
MirSurfaceOutputEvent const * mir_event_get_surface_output_event(MirEvent const *event) MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_output_event")
Retrieve the MirSurfaceOutputEvent associated with a MirEvent of type mir_event_type_surface_output.
struct MirSurfaceEvent MirWindowEvent
Definition: event.h:63
Definition: event.h:54
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-2018 Canonical Ltd.
Generated on Sat Sep 1 14:12:02 UTC 2018