Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
scene.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_COMPOSITOR_SCENE_H_
20 #define MIR_COMPOSITOR_SCENE_H_
21 
22 #include "compositor_id.h"
23 
24 #include <memory>
25 #include <vector>
26 
27 namespace mir
28 {
29 namespace scene
30 {
31 class Observer;
32 }
33 
34 namespace compositor
35 {
36 
37 class SceneElement;
38 using SceneElementSequence = std::vector<std::shared_ptr<SceneElement>>;
39 
40 class Scene
41 {
42 public:
43  virtual ~Scene() {}
44 
57 
58  virtual void register_compositor(CompositorID id) = 0;
59  virtual void unregister_compositor(CompositorID id) = 0;
60 
61  virtual void add_observer(std::shared_ptr<scene::Observer> const& observer) = 0;
62  virtual void remove_observer(std::weak_ptr<scene::Observer> const& observer) = 0;
63 
64 protected:
65  Scene() = default;
66 
67 private:
68  Scene(Scene const&) = delete;
69  Scene& operator=(Scene const&) = delete;
70 };
71 
72 }
73 }
74 
75 #endif /* MIR_COMPOSITOR_SCENE_H_ */
All things Mir.
Definition: aging_buffer.h:24
virtual SceneElementSequence scene_elements_for(CompositorID id)=0
Generate a valid sequence of scene elements based on the current state of the Scene.
virtual void remove_observer(std::weak_ptr< scene::Observer > const &observer)=0
virtual void register_compositor(CompositorID id)=0
virtual void unregister_compositor(CompositorID id)=0
std::vector< std::shared_ptr< SceneElement >> SceneElementSequence
Definition: scene.h:38
Definition: scene.h:40
virtual ~Scene()
Definition: scene.h:43
void const * CompositorID
Definition: compositor_id.h:27
virtual void add_observer(std::shared_ptr< scene::Observer > const &observer)=0

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Oct 10 14:07:14 UTC 2014