Mir
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_INPUT_SEAT_H_
21 #define MIR_INPUT_SEAT_H_
22 
23 #include "mir/geometry/rectangle.h"
25 #include "mir_toolkit/event.h"
26 
27 #include <memory>
28 #include <vector>
29 
30 namespace mir
31 {
32 using EventUPtr = std::unique_ptr<MirEvent, void(*)(MirEvent*)>;
33 namespace input
34 {
35 class Device;
36 class Seat
37 {
38 public:
39  Seat()=default;
40  virtual ~Seat() = default;
41  virtual void add_device(Device const& device) = 0;
42  virtual void remove_device(Device const& device) = 0;
43  virtual void dispatch_event(MirEvent& event) = 0;
44  virtual geometry::Rectangle get_rectangle_for(Device const& dev) = 0;
45  virtual EventUPtr create_device_state() = 0;
46 
47  virtual void set_key_state(Device const& dev, std::vector<uint32_t> const& scan_codes) = 0;
48  virtual void set_pointer_state(Device const& dev, MirPointerButtons buttons) = 0;
49  virtual void set_cursor_position(float cursor_x, float cursor_y) = 0;
50  virtual void set_confinement_regions(geometry::Rectangles const& regions) = 0;
51  virtual void reset_confinement_regions() = 0;
52 private:
53  Seat(Seat const&) = delete;
54  Seat& operator=(Seat const&) = delete;
55 };
56 
57 }
58 }
59 
60 #endif
All things Mir.
Definition: atomic_callback.h:25
A collection of rectangles (with possible duplicates).
Definition: rectangles.h:34
virtual void reset_confinement_regions()=0
Definition: seat.h:36
virtual void set_pointer_state(Device const &dev, MirPointerButtons buttons)=0
virtual EventUPtr create_device_state()=0
std::unique_ptr< MirEvent, void(*)(MirEvent *)> EventUPtr
Definition: seat.h:32
unsigned int MirPointerButtons
Definition: pointer_event.h:85
virtual void set_cursor_position(float cursor_x, float cursor_y)=0
virtual void dispatch_event(MirEvent &event)=0
virtual geometry::Rectangle get_rectangle_for(Device const &dev)=0
Definition: rectangle.h:33
virtual void set_key_state(Device const &dev, std::vector< uint32_t > const &scan_codes)=0
virtual void add_device(Device const &device)=0
virtual ~Seat()=default
Definition: device.h:38
virtual void set_confinement_regions(geometry::Rectangles const &regions)=0
Definition: event.h:30
virtual void remove_device(Device const &device)=0

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