Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 "basic_platform.h"
24 
25 #include <boost/program_options/options_description.hpp>
26 #include <memory>
27 
28 namespace mir
29 {
30 class EmergencyCleanupRegistry;
31 
32 namespace frontend
33 {
34 class Surface;
35 }
36 namespace options
37 {
38 class Option;
39 }
40 
43 namespace graphics
44 {
45 class Buffer;
46 class Display;
47 class BufferInitializer;
48 class InternalClient;
49 class DisplayReport;
50 class DisplayConfigurationPolicy;
51 class GraphicBufferAllocator;
52 class GLConfig;
53 class GLProgramFactory;
54 class PlatformIpcOperations;
55 class BufferWriter;
56 
67 class Platform : public BasicPlatform
68 {
69 public:
70  Platform() = default;
71  Platform(const Platform& p) = delete;
72  Platform& operator=(const Platform& p) = delete;
73 
74  virtual ~Platform() { /* TODO: make nothrow */ }
75 
82  virtual std::shared_ptr<GraphicBufferAllocator> create_buffer_allocator(
83  std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
84 
85  virtual std::shared_ptr<BufferWriter> make_buffer_writer() = 0;
86 
90  virtual std::shared_ptr<Display> create_display(
91  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
92  std::shared_ptr<GLProgramFactory> const& gl_program_factory,
93  std::shared_ptr<GLConfig> const& gl_config) = 0;
94 
99  virtual std::shared_ptr<PlatformIpcOperations> make_ipc_operations() const = 0;
100 
104  virtual std::shared_ptr<InternalClient> create_internal_client() = 0;
105 };
106 
118 extern "C" typedef std::shared_ptr<Platform>(*CreatePlatform)(
119  std::shared_ptr<options::Option> const& options,
120  std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry,
121  std::shared_ptr<DisplayReport> const& report);
122 extern "C" std::shared_ptr<Platform> create_platform(
123  std::shared_ptr<options::Option> const& options,
124  std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry,
125  std::shared_ptr<DisplayReport> const& report);
126 extern "C" typedef void(*AddPlatformOptions)(
127  boost::program_options::options_description& config);
128 extern "C" void add_platform_options(
129  boost::program_options::options_description& config);
130 }
131 }
132 
133 #endif // MIR_GRAPHICS_PLATFORM_H_
void add_platform_options(boost::program_options::options_description &config)
Definition: platform.cpp:185
All things Mir.
Definition: aging_buffer.h:24
Platform & operator=(const Platform &p)=delete
Definition: basic_platform.h:29
virtual std::shared_ptr< BufferWriter > make_buffer_writer()=0
void(* AddPlatformOptions)(boost::program_options::options_description &config)
Definition: platform.h:126
virtual std::shared_ptr< InternalClient > create_internal_client()=0
Creates the in-process client support object.
Interface to platform specific support for graphics operations.
Definition: platform.h:67
virtual std::shared_ptr< Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLProgramFactory > const &gl_program_factory, std::shared_ptr< GLConfig > const &gl_config)=0
Creates the display subsystem.
virtual std::shared_ptr< PlatformIpcOperations > make_ipc_operations() const =0
Creates an object capable of doing platform specific processing of buffers before they are sent or af...
virtual ~Platform()
Definition: platform.h:74
virtual std::shared_ptr< GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer)=0
Creates the buffer allocator subsystem.
std::shared_ptr< Platform > create_platform(std::shared_ptr< options::Option > const &options, std::shared_ptr< EmergencyCleanupRegistry > const &emergency_cleanup_registry, std::shared_ptr< DisplayReport > const &report)

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