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
32extern "C" {
33#endif
34
35#pragma GCC diagnostic push
36#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
37typedef 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,
59#pragma GCC diagnostic pop
60
61typedef struct MirSurfaceEvent MirSurfaceEvent
63typedef struct MirSurfaceEvent MirWindowEvent;
67typedef struct MirCloseSurfaceEvent MirCloseSurfaceEvent
69typedef struct MirCloseSurfaceEvent MirCloseWindowEvent;
72typedef struct MirInputConfigurationEvent MirInputConfigurationEvent
74typedef struct MirSurfaceOutputEvent MirSurfaceOutputEvent
76typedef struct MirSurfaceOutputEvent MirWindowOutputEvent;
81
82typedef struct MirCookie MirCookie;
83
84typedef struct MirEvent MirEvent;
85
86#ifdef __cplusplus
87}
89#endif
90
102
103#ifdef __cplusplus
108extern "C" {
109#endif
110
120
130
139MirSurfaceEvent const* mir_event_get_surface_event(MirEvent const* event)
140MIR_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"
199MIR_FOR_REMOVAL_IN_VERSION_1("Use of this function is pointless as there is no way to use the return value")
201MirCloseSurfaceEvent 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"
227MIR_FOR_REMOVAL_IN_VERSION_1("Input devices and changes to the input devices are indicated via the MirInputConfigCallback")
229MirInputConfigurationEvent const* mir_event_get_input_configuration_event(MirEvent const* event);
230#pragma GCC diagnostic pop
231
245MirSurfaceOutputEvent const* mir_event_get_surface_output_event(MirEvent const* event)
246MIR_FOR_REMOVAL_IN_VERSION_1("use mir_event_get_window_output_event");
247
262
273
283MIR_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
318MirEvent const* mir_event_ref(MirEvent const* event) __attribute__((warn_unused_result));
319
325void mir_event_unref(MirEvent const* event);
326
327#ifdef __cplusplus
328}
330#endif
331
332#endif /* MIR_TOOLKIT_EVENT_H_ */
struct MirKeymapEvent MirKeymapEvent
Definition: event.h:71
struct MirSurfacePlacementEvent MirSurfacePlacementEvent
Definition: surface_placement.h:33
struct MirSurfaceOutputEvent MirWindowOutputEvent
Definition: event.h:76
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...
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...
MirEvent const * mir_event_ref(MirEvent const *event) __attribute__((warn_unused_result))
Reference this MirEvent and return a pointer to the newly referenced instance.
MirEventType mir_event_get_type(MirEvent const *event)
Retrieves the type of a MirEvent.
MirInputEvent const * mir_event_get_input_event(MirEvent const *event)
Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.
struct MirOrientationEvent MirOrientationEvent
Definition: event.h:66
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 MirCloseSurfaceEvent MirCloseWindowEvent
Definition: event.h:69
struct MirCookie MirCookie
Definition: event.h:82
struct MirPromptSessionEvent MirPromptSessionEvent
Definition: event.h:65
MirResizeEvent const * mir_event_get_resize_event(MirEvent const *event)
Retrieve the MirResizeEvent associated with a MirEvent of type mir_event_type_resize.
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 MirInputDeviceStateEvent MirInputDeviceStateEvent
Definition: event.h:77
MirWindowEvent const * mir_event_get_window_event(MirEvent const *event)
Retrieve the MirWindowEvent associated with a MirEvent of type mir_event_type_window.
MirEventType
Definition: event.h:38
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.
MirKeymapEvent const * mir_event_get_keymap_event(MirEvent const *event)
Retrieve the MirKeymapEvent associated with a MirEvent of type mir_event_type_keymap.
struct MirSurfacePlacementEvent MirWindowPlacementEvent
Definition: event.h:80
void mir_event_unref(MirEvent const *event)
Release a reference to a MirEvent.
struct MirResizeEvent MirResizeEvent
Definition: event.h:64
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 MirSurfaceEvent MirWindowEvent
Definition: event.h:63
struct MirInputEvent MirInputEvent
Definition: event.h:70
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.
struct MirEvent MirEvent
Definition: event.h:84
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.
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.
struct MirInputConfig MirInputConfig
Definition: client_types.h:406
struct MirSurfaceEvent MirSurfaceEvent MIR_FOR_REMOVAL_IN_VERSION_1("use MirWindowEvent instead")
@ mir_event_type_close_window
Definition: event.h:47
@ mir_event_type_orientation
Definition: event.h:45
@ mir_event_type_prompt_session_state_change
Definition: event.h:44
@ mir_event_type_keymap
Definition: event.h:51
@ MIR_DEPRECATED_ENUM
Definition: event.h:39
@ mir_event_type_window_placement
Definition: event.h:57
@ mir_event_type_window_output
Definition: event.h:54
@ mir_event_type_input_device_state
Definition: event.h:55
@ mir_event_type_input
Definition: event.h:50
@ mir_event_type_resize
Definition: event.h:43
@ mir_event_type_window
Definition: event.h:42

Copyright © 2012-2022 Canonical Ltd.
Generated on Sun Oct 9 06:13:38 UTC 2022
This documentation is licensed under the GPL version 2 or 3.