Mir
default_event_builder.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 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Andreas Pokorny <andreas.pokorny@canonical.com>
18  */
19 
20 #ifndef MIR_INPUT_DEFAULT_EVENT_BUILDER_H_
21 #define MIR_INPUT_DEFAULT_EVENT_BUILDER_H_
22 
24 #include <memory>
25 
26 namespace mir
27 {
28 namespace cookie
29 {
30 class Authority;
31 }
32 namespace input
33 {
35 {
36 public:
37  explicit DefaultEventBuilder(MirInputDeviceId device_id,
38  std::shared_ptr<cookie::Authority> const& cookie_authority);
39 
40  EventUPtr key_event(Timestamp timestamp, MirKeyboardAction action, xkb_keysym_t key_code, int scan_code) override;
41 
42  EventUPtr touch_event(Timestamp timestamp) override;
43  void add_touch(MirEvent& event, MirTouchId touch_id, MirTouchAction action, MirTouchTooltype tooltype,
44  float x_axis_value, float y_axis_value, float pressure_value, float touch_major_value,
45  float touch_minor_value, float size_value) override;
46 
47  EventUPtr pointer_event(Timestamp timestamp, MirPointerAction action, MirPointerButtons buttons_pressed,
48  float hscroll_value, float vscroll_value, float relative_x_value,
49  float relative_y_value) override;
50 
51  EventUPtr configuration_event(Timestamp timestamp, MirInputConfigurationAction action) override;
52 
53 private:
54  MirInputDeviceId const device_id;
55  std::shared_ptr<cookie::Authority> const cookie_authority;
56 };
57 }
58 }
59 
60 #endif
All things Mir.
Definition: atomic_callback.h:25
void add_touch(MirEvent &event, MirTouchId touch_id, MirTouchAction action, MirTouchTooltype 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:269
int32_t MirTouchId
An identifier for a touch-point.
Definition: touch_event.h:40
MirPointerAction
Possible pointer actions.
Definition: pointer_event.h:40
Definition: default_event_builder.h:34
MirKeyboardAction
Possible actions for changing key state.
Definition: keyboard_event.h:46
int64_t MirInputDeviceId
Definition: input_event.h:35
std::unique_ptr< MirEvent, void(*)(MirEvent *)> EventUPtr
Definition: event_builders.h:35
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_event.h:78
unsigned int MirPointerButtons
Definition: pointer_event.h:85
MirInputConfigurationAction
MirInputConfigurationEvent indicates a configuration change in the input device subsystem. Eventually it&#39;s usage will be required to properly interpret MirInputEvent, for example: If we receive a button down, and then a device reset, we should not expect to receive the button up.
Definition: input_configuration_event.h:43
Definition: event_private.h:181
MirTouchAction
Possible per touch actions for state changing.
Definition: touch_event.h:45
std::chrono::nanoseconds Timestamp
Definition: event_builder.h:39
touch_event
Definition: input_receiver_report_tp.h:47
Definition: event_builder.h:34

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016