Mir
surface.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_INPUT_SURFACE_H_
20 #define MIR_INPUT_SURFACE_H_
21 
22 #include "mir/geometry/point.h"
23 #include "mir/geometry/rectangle.h"
25 
26 #include "mir_toolkit/event.h"
27 
28 #include <string>
29 #include <memory>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 class CursorImage;
36 }
37 
38 namespace scene
39 {
40 class SurfaceObserver;
41 }
42 
43 namespace input
44 {
45 class InputChannel;
46 
47 class Surface
48 {
49 public:
50  virtual std::string name() const = 0;
51  virtual geometry::Rectangle input_bounds() const = 0;
52  virtual bool input_area_contains(geometry::Point const& point) const = 0;
53  virtual std::shared_ptr<input::InputChannel> input_channel() const = 0;
54  virtual std::shared_ptr<graphics::CursorImage> cursor_image() const = 0;
55  virtual InputReceptionMode reception_mode() const = 0;
56  virtual void consume(MirEvent const* event) = 0;
57 
58 protected:
59  Surface() = default;
60  virtual ~Surface() = default;
61  Surface(const Surface&) = delete;
62  Surface& operator=(const Surface& ) = delete;
63 };
64 
65 }
66 }
67 #endif /* MIR_INPUT_SURFACE_H_ */
Definition: as_render_target.h:27
Definition: point.h:30
Definition: surface.h:47
struct MirEvent MirEvent
Definition: event.h:84
Definition: rectangle.h:33
char const * name
Definition: client_types.h:170
InputReceptionMode
Definition: input_reception_mode.h:27

Copyright © 2012-2016 Canonical Ltd.
Generated on Fri Dec 20 06:52:43 UTC 2019