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 {
34 class Seat;
35 
37 {
38 public:
39  explicit DefaultEventBuilder(MirInputDeviceId device_id,
40  std::shared_ptr<cookie::Authority> const& cookie_authority,
41  std::shared_ptr<Seat> const& seat);
42 
43  EventUPtr key_event(Timestamp timestamp, MirKeyboardAction action, xkb_keysym_t key_code, int scan_code) override;
44 
45  EventUPtr touch_event(Timestamp timestamp) override;
46  void add_touch(MirEvent& event, MirTouchId touch_id, MirTouchAction action, MirTouchTooltype tooltype,
47  float x_axis_value, float y_axis_value, float pressure_value, float touch_major_value,
48  float touch_minor_value, float size_value) override;
49 
50  EventUPtr pointer_event(Timestamp timestamp, MirPointerAction action, MirPointerButtons buttons_pressed,
51  float hscroll_value, float vscroll_value, float relative_x_value,
52  float relative_y_value) override;
53 
54  EventUPtr configuration_event(Timestamp timestamp, MirInputConfigurationAction action) override;
55 
56  EventUPtr device_state_event(float cursor_x, float cursor_y) override;
57 private:
58  MirInputDeviceId const device_id;
59  std::shared_ptr<cookie::Authority> const cookie_authority;
60  std::shared_ptr<Seat> const seat;
61 };
62 }
63 }
64 
65 #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:278
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:36
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: seat.h:32
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
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
Definition: event.h:30

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016