Mir
event_builders.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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  * Author: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
20 
21 #ifndef MIR_EVENT_BUILDERS_H_
22 #define MIR_EVENT_BUILDERS_H_
23 
24 #include "mir_toolkit/event.h"
25 
26 #include "mir/geometry/size.h"
28 
29 #include <memory>
30 #include <vector>
31 #include <functional>
32 
33 namespace mir
34 {
35  typedef std::unique_ptr<MirEvent, void(*)(MirEvent*)> EventUPtr;
36 
37 namespace events
38 {
39 // Surface orientation change event
40 EventUPtr make_event(frontend::SurfaceId const& surface_id, MirOrientation orientation);
41 // Prompt session state change event
42 EventUPtr make_event(MirPromptSessionState state);
43 // Surface resize event
44 EventUPtr make_event(frontend::SurfaceId const& surface_id, geometry::Size const& size);
45 // Surface configure event
46 EventUPtr make_event(frontend::SurfaceId const& surface_id, MirSurfaceAttrib attribute, int value);
47 // Close surface event
48 EventUPtr make_event(frontend::SurfaceId const& surface_id);
49 
50 // Key event
51 EventUPtr make_event(MirInputDeviceId device_id, int64_t timestamp,
52  MirKeyInputEventAction action, xkb_keysym_t key_code,
53  int scan_code, MirInputEventModifiers modifiers);
54 
55 // Touch event
56 EventUPtr make_event(MirInputDeviceId device_id, int64_t timestamp,
57  MirInputEventModifiers modifiers);
59  MirTouchInputEventTouchTooltype tooltype, float x_axis_value, float y_axis_value,
60  float pressure_value, float touch_major_value, float touch_minor_value, float size_value);
61 
62 // Pointer event
63 EventUPtr make_event(MirInputDeviceId device_id, int64_t timestamp,
65  std::vector<MirPointerInputEventButton> const& buttons_pressed,
66  float x_axis_value, float y_axis_value,
67  float hscroll_value, float vscroll_value);
68 }
69 }
70 
71 #endif // MIR_EVENT_BUILDERS_H_
Definition: size.h:30
All things Mir.
Definition: buffer_stream.h:37
MirKeyInputEventAction
Possible actions for changing key state.
Definition: key_input_event.h:40
std::unique_ptr< MirEvent, void(*)(MirEvent *)> EventUPtr
Definition: event_builders.h:35
void add_touch(MirEvent &event, MirTouchInputEventTouchId touch_id, MirTouchInputEventTouchAction action, MirTouchInputEventTouchTooltype tooltype, float x_axis_value, float y_axis_value, float pressure_value, float touch_major_value, float touch_minor_value, float size_value)
Definition: event_builders.cpp:265
MirPromptSessionState
Definition: common.h:111
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:142
unsigned int MirInputEventModifiers
Definition: input_event.h:65
int64_t MirInputDeviceId
Definition: input_event.h:34
EventUPtr make_event(frontend::SurfaceId const &surface_id, MirOrientation orientation)
Definition: event_builders.cpp:41
MirTouchInputEventTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_input_event.h:78
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:36
int32_t MirTouchInputEventTouchId
An identifier for a touch-point.
Definition: touch_input_event.h:40
Definition: int_wrapper.h:27
Definition: event_deprecated.h:237
MirPointerInputEventAction
Possible pointer actions.
Definition: pointer_input_event.h:40
int const size
Definition: make_socket_rpc_channel.cpp:51
MirTouchInputEventTouchAction
Possible per touch actions for state changing.
Definition: touch_input_event.h:45

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015