Mir
mir_client_host_connection.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_NESTED_MIR_CLIENT_HOST_CONNECTION_H_
20 #define MIR_GRAPHICS_NESTED_MIR_CLIENT_HOST_CONNECTION_H_
21 
22 #include "host_connection.h"
24 
25 #include <string>
26 #include <mutex>
27 
28 struct MirConnection;
29 
30 namespace msh = mir::shell;
31 
32 namespace mir
33 {
34 namespace graphics
35 {
36 namespace nested
37 {
38 
40 {
41 public:
42  MirClientHostConnection(std::string const& host_socket, std::string const& name, std::shared_ptr<msh::HostLifecycleEventListener> const& host_lifecycle_event_listener);
44 
45  std::vector<int> platform_fd_items() override;
46  EGLNativeDisplayType egl_native_display() override;
47  std::shared_ptr<MirDisplayConfiguration> create_display_config() override;
48  std::shared_ptr<HostSurface> create_surface(
49  int width, int height, MirPixelFormat pf, char const* name,
50  MirBufferUsage usage, uint32_t output_id) override;
51  void set_display_config_change_callback(std::function<void()> const& cb) override;
53 
54  void set_cursor_image(CursorImage const& image) override;
55  void hide_cursor() override;
56 
58  unsigned int op, PlatformOperationMessage const& request) override;
59 
60 private:
61  std::mutex surfaces_mutex;
62 
63  MirConnection* const mir_connection;
64  std::function<void()> conf_change_callback;
65  std::shared_ptr<msh::HostLifecycleEventListener> const host_lifecycle_event_listener;
66 
67  std::vector<HostSurface*> surfaces;
68 };
69 
70 }
71 }
72 }
73 
74 #endif /* MIR_GRAPHICS_NESTED_MIR_CLIENT_HOST_CONNECTION_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: client_types.h:289
Definition: default_server_configuration.h:79
virtual PlatformOperationMessage platform_operation(unsigned int op, PlatformOperationMessage const &request) override
Definition: mir_client_host_connection.h:39
std::shared_ptr< MirDisplayConfiguration > create_display_config() override
std::shared_ptr< HostSurface > create_surface(int width, int height, MirPixelFormat pf, char const *name, MirBufferUsage usage, uint32_t output_id) override
Definition: host_connection.h:40
EGLNativeDisplayType egl_native_display() override
Definition: cursor_image.h:30
unsigned int width
Definition: black_arrow.c:4
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:147
void apply_display_config(MirDisplayConfiguration &) override
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
void set_display_config_change_callback(std::function< void()> const &cb) override
unsigned int height
Definition: black_arrow.c:5
MirClientHostConnection(std::string const &host_socket, std::string const &name, std::shared_ptr< msh::HostLifecycleEventListener > const &host_lifecycle_event_listener)
Definition: mir_connection.h:88
void set_cursor_image(CursorImage const &image) override
Definition: platform_operation_message.h:30
std::vector< int > platform_fd_items() override

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015