Mir
basic_seat.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015-2016 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_BASIC_SEAT_H_
21 #define MIR_BASIC_SEAT_H_
22 
23 #include "mir/input/seat.h"
26 
27 #include <mutex>
28 
29 namespace mir
30 {
31 namespace time
32 {
33 class Clock;
34 }
35 namespace input
36 {
37 class TouchVisualizer;
38 class CursorListener;
39 class InputRegion;
40 class InputDispatcher;
41 class KeyMapper;
42 
43 class BasicSeat : public Seat
44 {
45 public:
46  BasicSeat(std::shared_ptr<InputDispatcher> const& dispatcher,
47  std::shared_ptr<TouchVisualizer> const& touch_visualizer,
48  std::shared_ptr<CursorListener> const& cursor_listener,
49  std::shared_ptr<InputRegion> const& input_region,
50  std::shared_ptr<KeyMapper> const& key_mapper,
51  std::shared_ptr<time::Clock> const& clock);
52  // Seat methods:
53  void add_device(Device const& device) override;
54  void remove_device(Device const& device) override;
55  void dispatch_event(MirEvent& event) override;
56  geometry::Rectangle get_rectangle_for(Device const& dev) override;
57  virtual EventUPtr create_device_state() override;
58  virtual void set_confinement_regions(geometry::Rectangles const& regions) override;
59  virtual void reset_confinement_regions() override;
60 
61  void set_key_state(Device const& dev, std::vector<uint32_t> const& scan_codes) override;
62  void set_pointer_state(Device const& dev, MirPointerButtons buttons) override;
63  void set_cursor_position(float cursor_x, float cursor_y) override;
64 private:
65  SeatInputDeviceTracker input_state_tracker;
66  std::shared_ptr<InputRegion> const input_region;
67 };
68 }
69 }
70 
71 #endif
All things Mir.
Definition: atomic_callback.h:25
A collection of rectangles (with possible duplicates).
Definition: rectangles.h:34
Definition: seat.h:36
void set_cursor_position(MirEvent &event, mir::geometry::Point const &pos)
Definition: event_builders.cpp:213
Definition: seat_input_device_tracker.h:51
std::unique_ptr< MirEvent, void(*)(MirEvent *)> EventUPtr
Definition: seat.h:32
unsigned int MirPointerButtons
Definition: pointer_event.h:85
Definition: rectangle.h:33
Definition: basic_seat.h:43
Definition: device.h:38
Definition: event.h:30

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