Mir
input_sink.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014-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  * Authored by:
17  * Andreas Pokorny <andreas.pokorny@canonical.com>
18  */
19 
20 #ifndef MIR_INPUT_INPUT_SINK_H_
21 #define MIR_INPUT_INPUT_SINK_H_
22 
23 #include "mir_toolkit/event.h"
24 #include "mir/geometry/rectangle.h"
26 
27 #include <vector>
28 
29 namespace mir
30 {
31 namespace input
32 {
33 class InputSink
34 {
35 public:
36  InputSink() = default;
37  virtual ~InputSink() = default;
38  virtual void handle_input(MirEvent& event) = 0;
42  virtual mir::geometry::Rectangle bounding_rectangle() const = 0;
43 
55  virtual void key_state(std::vector<uint32_t> const& scan_codes) = 0;
60  virtual void pointer_state(MirPointerButtons buttons) = 0;
64 private:
65  InputSink(InputSink const&) = delete;
66  InputSink& operator=(InputSink const&) = delete;
67 };
68 }
69 }
70 
71 #endif
Definition: as_render_target.h:27
virtual ~InputSink()=default
virtual void pointer_state(MirPointerButtons buttons)=0
Set button state of a pointing device.
virtual void handle_input(MirEvent &event)=0
virtual mir::geometry::Rectangle bounding_rectangle() const =0
! Obtain the bounding rectangle of the destination area for this input sink
struct MirEvent MirEvent
Definition: event.h:84
unsigned int MirPointerButtons
Definition: pointer_event.h:88
Definition: rectangle.h:33
virtual void key_state(std::vector< uint32_t > const &scan_codes)=0
Set all pressed scan codes.
Definition: input_sink.h:33

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed May 10 10:41:27 UTC 2017