Mir
surface_stack.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-15 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 
20 #ifndef MIR_SHELL_SURFACE_COORDINATOR_H_
21 #define MIR_SHELL_SURFACE_COORDINATOR_H_
22 
23 #include <memory>
24 #include <set>
25 
26 namespace mir
27 {
28 namespace geometry { class Point; }
29 namespace input { enum class InputReceptionMode; }
30 namespace scene
31 {
32 class Surface;
33 struct SurfaceCreationParameters;
34 class SurfaceObserver;
35 class Session;
36 }
37 
38 namespace shell
39 {
41 {
42 public:
43  using SurfaceSet = std::set<std::weak_ptr<scene::Surface>, std::owner_less<std::weak_ptr<scene::Surface>>>;
44 
45  virtual void add_surface(
46  std::shared_ptr<scene::Surface> const&,
47  input::InputReceptionMode new_mode) = 0;
48 
49  virtual void raise(std::weak_ptr<scene::Surface> const& surface) = 0;
50 
51  virtual void raise(SurfaceSet const& surfaces) = 0;
52 
53  virtual void remove_surface(std::weak_ptr<scene::Surface> const& surface) = 0;
54 
55  virtual auto surface_at(geometry::Point) const -> std::shared_ptr<scene::Surface> = 0;
56 
57 protected:
58  SurfaceStack() = default;
59  virtual ~SurfaceStack() = default;
60  SurfaceStack(SurfaceStack const&) = delete;
61  SurfaceStack& operator=(SurfaceStack const&) = delete;
62 };
63 }
64 }
65 
66 
67 #endif /* MIR_SHELL_SURFACE_COORDINATOR_H_ */
Definition: as_render_target.h:27
Definition: point.h:30
STL namespace.
Definition: surface_stack.h:40
std::set< std::weak_ptr< scene::Surface >, std::owner_less< std::weak_ptr< scene::Surface >>> SurfaceSet
Definition: surface_stack.h:43
InputReceptionMode
Definition: input_reception_mode.h:27

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 13:49:26 UTC 2017