Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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 "mir/geometry/forward.h"
23 
24 #include <memory>
25 #include <functional>
26 
27 namespace mir
28 {
29 namespace surfaces
30 {
31 class BufferStream;
32 }
33 namespace compositor
34 {
35 class CompositingCriteria;
36 
38 {
39 public:
40  virtual ~FilterForScene() {}
41 
42  virtual bool operator()(CompositingCriteria const&) = 0;
43 
44 protected:
45  FilterForScene() = default;
46  FilterForScene(const FilterForScene&) = delete;
47  FilterForScene& operator=(const FilterForScene&) = delete;
48 };
49 
51 {
52 public:
53  virtual ~OperatorForScene() {}
54 
55  virtual void operator()(CompositingCriteria const&, surfaces::BufferStream&) = 0;
56 
57 protected:
58  OperatorForScene() = default;
59  OperatorForScene(const OperatorForScene&) = delete;
61 
62 };
63 
64 class Scene
65 {
66 public:
67  virtual ~Scene() {}
68 
69  virtual void for_each_if(FilterForScene& filter, OperatorForScene& op) = 0;
70 
79  virtual void set_change_callback(std::function<void()> const& f) = 0;
80 
81  // Implement BasicLockable, to temporarily lock scene state:
82  virtual void lock() = 0;
83  virtual void unlock() = 0;
84 
85 protected:
86  Scene() = default;
87 
88 private:
89  Scene(Scene const&) = delete;
90  Scene& operator=(Scene const&) = delete;
91 };
92 
93 }
94 }
95 
96 #endif /* MIR_COMPOSITOR_SCENE_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013