Mir
surface_stack_model.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012-2014 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: Thomas Voss <thomas.voss@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_SURFACE_STACK_MODEL_H_
20 #define MIR_SCENE_SURFACE_STACK_MODEL_H_
21 
23 #include "mir/scene/depth_id.h"
25 
26 #include <memory>
27 #include <set>
28 
29 namespace mir
30 {
31 namespace geometry { class Point; }
32 
33 namespace scene
34 {
35 class Surface;
36 
38 {
39 public:
40  using SurfaceSet = std::set<std::weak_ptr<Surface>, std::owner_less<std::weak_ptr<Surface>>>;
41 
42  virtual ~SurfaceStackModel() = default;
43 
44  virtual void add_surface(
45  std::shared_ptr<Surface> const& surface,
46  DepthId depth,
47  input::InputReceptionMode input_mode) = 0;
48 
49  virtual void remove_surface(std::weak_ptr<Surface> const& surface) = 0;
50 
51  virtual void raise(std::weak_ptr<Surface> const& surface) = 0;
52 
53  virtual void raise(SurfaceSet const& surfaces) = 0;
54 
55  virtual auto surface_at(geometry::Point) const -> std::shared_ptr<Surface> = 0;
56 
57 protected:
58  SurfaceStackModel() = default;
59  SurfaceStackModel(const SurfaceStackModel&) = delete;
60  SurfaceStackModel& operator=(const SurfaceStackModel&) = delete;
61 };
62 
63 }
64 }
65 
66 #endif // MIR_SCENE_SURFACE_STACK_MODEL_H_
All things Mir.
Definition: atomic_callback.h:25
Definition: surface_stack_model.h:37
Definition: point.h:30
STL namespace.
virtual void add_surface(std::shared_ptr< Surface > const &surface, DepthId depth, input::InputReceptionMode input_mode)=0
std::set< std::weak_ptr< Surface >, std::owner_less< std::weak_ptr< Surface >>> SurfaceSet
Definition: surface_stack_model.h:40
virtual auto surface_at(geometry::Point) const -> std::shared_ptr< Surface >=0
virtual void remove_surface(std::weak_ptr< Surface > const &surface)=0
virtual ~SurfaceStackModel()=default
InputReceptionMode
Definition: input_reception_mode.h:27
Definition: surface.h:47

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015