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