Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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 "basic_platform.h"
24 
25 #include <boost/program_options/options_description.hpp>
26 #include <memory>
27 
28 namespace mir
29 {
30 namespace frontend
31 {
32 class Surface;
33 }
34 namespace options
35 {
36 class Option;
37 }
38 
41 namespace graphics
42 {
43 class BufferIPCPacker;
44 class Buffer;
45 class Display;
46 struct PlatformIPCPackage;
47 class BufferInitializer;
48 class InternalClient;
49 class DisplayReport;
50 class DisplayConfigurationPolicy;
51 class GraphicBufferAllocator;
52 class GLConfig;
53 
64 class Platform : public BasicPlatform
65 {
66 public:
67  Platform() = default;
68  Platform(const Platform& p) = delete;
69  Platform& operator=(const Platform& p) = delete;
70 
71  virtual ~Platform() { /* TODO: make nothrow */ }
72 
79  virtual std::shared_ptr<GraphicBufferAllocator> create_buffer_allocator(
80  std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
81 
85  virtual std::shared_ptr<Display> create_display(
86  std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
87  std::shared_ptr<GLConfig> const& gl_config) = 0;
88 
94  virtual std::shared_ptr<PlatformIPCPackage> get_ipc_package() = 0;
95 
105  virtual void fill_ipc_package(BufferIPCPacker* packer, Buffer const* buffer) const = 0;
106 
110  virtual std::shared_ptr<InternalClient> create_internal_client() = 0;
111 };
112 
123 extern "C" typedef std::shared_ptr<Platform>(*CreatePlatform)(std::shared_ptr<options::Option> const& options, std::shared_ptr<DisplayReport> const& report);
124 extern "C" std::shared_ptr<Platform> create_platform (std::shared_ptr<options::Option> const& options, std::shared_ptr<DisplayReport> const& report);
125 extern "C" typedef void(*AddPlatformOptions)(
126  boost::program_options::options_description& config);
127 extern "C" void add_platform_options(
128  boost::program_options::options_description& config);
129 }
130 }
131 
132 #endif // MIR_GRAPHICS_PLATFORM_H_
void add_platform_options(boost::program_options::options_description &config)
Definition: android_platform.cpp:149
Platform & operator=(const Platform &p)=delete
Definition: basic_platform.h:29
void(* AddPlatformOptions)(boost::program_options::options_description &config)
Definition: platform.h:125
virtual std::shared_ptr< InternalClient > create_internal_client()=0
Creates the in-process client support object.
virtual std::shared_ptr< Display > create_display(std::shared_ptr< DisplayConfigurationPolicy > const &initial_conf_policy, std::shared_ptr< GLConfig > const &gl_config)=0
Creates the display subsystem.
Interface to platform specific support for graphics operations.
Definition: platform.h:64
virtual void fill_ipc_package(BufferIPCPacker *packer, Buffer const *buffer) const =0
Fills the IPC package for a buffer.
input_rectangles report(report)
virtual ~Platform()
Definition: platform.h:71
virtual std::shared_ptr< PlatformIPCPackage > get_ipc_package()=0
Gets the IPC package for the platform.
virtual std::shared_ptr< GraphicBufferAllocator > create_buffer_allocator(std::shared_ptr< BufferInitializer > const &buffer_initializer)=0
Creates the buffer allocator subsystem.
Definition: buffer_ipc_packer.h:30
Definition: buffer.h:34
std::shared_ptr< Platform > create_platform(std::shared_ptr< options::Option > const &options, std::shared_ptr< DisplayReport > const &report)

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014