Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
platform.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 Lesser 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Thomas Guest <thomas.guest@canonical.com>
18  */
19 
20 #ifndef MIR_GRAPHICS_PLATFORM_H_
21 #define MIR_GRAPHICS_PLATFORM_H_
22 
23 #include <memory>
24 
25 namespace mir
26 {
27 namespace frontend
28 {
29 class Surface;
30 }
31 namespace options
32 {
33 class Option;
34 }
35 
38 namespace graphics
39 {
40 class BufferIPCPacker;
41 class Buffer;
42 class Display;
43 struct PlatformIPCPackage;
44 class BufferInitializer;
45 class InternalClient;
46 class DisplayReport;
47 class DisplayConfigurationPolicy;
48 class GraphicBufferAllocator;
49 
60 class Platform
61 {
62 public:
63  Platform() = default;
64  Platform(const Platform& p) = delete;
65  Platform& operator=(const Platform& p) = delete;
66 
67  virtual ~Platform() { /* TODO: make nothrow */ }
68 
75  virtual std::shared_ptr<GraphicBufferAllocator> create_buffer_allocator(
76  std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
77 
81  virtual std::shared_ptr<Display> create_display(
82  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy) = 0;
83 
89  virtual std::shared_ptr<PlatformIPCPackage> get_ipc_package() = 0;
90 
100  virtual void fill_ipc_package(std::shared_ptr<BufferIPCPacker> const& packer,
101  std::shared_ptr<graphics::Buffer> const& buffer) const = 0;
102 
106  virtual std::shared_ptr<InternalClient> create_internal_client() = 0;
107 };
108 
119 extern "C" typedef std::shared_ptr<Platform>(*CreatePlatform)(std::shared_ptr<options::Option> const& options, std::shared_ptr<DisplayReport> const& report);
120 extern "C" std::shared_ptr<Platform> create_platform (std::shared_ptr<options::Option> const& options, std::shared_ptr<DisplayReport> const& report);
121 }
122 }
123 
124 #endif // MIR_GRAPHICS_PLATFORM_H_

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