Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
native_platform.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 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: Eleni Maria Stea <elenimaria.stea@canonical.com>
17  */
18 #ifndef MIR_GRAPHICS_NATIVE_PLATFORM_H_
19 #define MIR_GRAPHICS_NATIVE_PLATFORM_H_
20 
21 #include <memory>
22 #include <functional>
23 
24 namespace mir
25 {
26 namespace options
27 {
28 class Option;
29 }
30 namespace graphics
31 {
32 class GraphicBufferAllocator;
33 class BufferInitializer;
34 class PlatformIPCPackage;
35 class InternalClient;
36 class BufferIPCPacker;
37 class Buffer;
38 class DisplayReport;
39 
41 {
42 public:
44 
45  virtual void initialize(std::function<void(int)> const& auth_magic, int data_items, int const* data, int fd_items, int const* fd) = 0;
46 
47  virtual std::shared_ptr<GraphicBufferAllocator> create_buffer_allocator(
48  std::shared_ptr<BufferInitializer> const& buffer_initializer) = 0;
49 
50  virtual std::shared_ptr<PlatformIPCPackage> get_ipc_package() = 0;
51 
52  virtual std::shared_ptr<InternalClient> create_internal_client() = 0;
53 
54  virtual void fill_ipc_package(std::shared_ptr<BufferIPCPacker> const& packer, std::shared_ptr<Buffer> const& buffer) const = 0;
55 
56  virtual ~NativePlatform() = default;
57  NativePlatform(NativePlatform const&) = delete;
58  NativePlatform& operator=(NativePlatform const&) = delete;
59 };
60 
61 extern "C" typedef std::shared_ptr<NativePlatform>(*CreateNativePlatform)(std::shared_ptr<DisplayReport> const& report);
62 extern "C" std::shared_ptr<NativePlatform> create_native_platform(std::shared_ptr<DisplayReport> const& report);
63 }
64 }
65 
66 #endif // MIR_GRAPHICS_NATIVE_PLATFORM_H_

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