Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
host_connection.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 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: Eleni Maria Stea <elenimaria.stea@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_NESTED_HOST_CONNECTION_H_
20 #define MIR_GRAPHICS_NESTED_HOST_CONNECTION_H_
21 
23 
24 #include <memory>
25 #include <vector>
26 #include <functional>
27 
28 #include <EGL/egl.h>
29 
30 struct gbm_device;
31 
32 namespace mir
33 {
34 namespace graphics
35 {
36 namespace nested
37 {
38 
40 {
41 public:
42  virtual ~HostSurface() = default;
43 
44  virtual EGLNativeWindowType egl_native_window() = 0;
45  virtual void set_event_handler(MirEventDelegate const* handler) = 0;
46 
47 protected:
48  HostSurface() = default;
49  HostSurface(HostSurface const&) = delete;
50  HostSurface& operator=(HostSurface const&) = delete;
51 };
52 
54 {
55 public:
56  virtual ~HostConnection() = default;
57 
58  virtual std::vector<int> platform_fd_items() = 0;
59  virtual EGLNativeDisplayType egl_native_display() = 0;
60  virtual std::shared_ptr<MirDisplayConfiguration> create_display_config() = 0;
61  virtual void set_display_config_change_callback(std::function<void()> const& cb) = 0;
63  virtual std::shared_ptr<HostSurface> create_surface(MirSurfaceParameters const&) = 0;
64 
65  virtual void drm_auth_magic(int magic) = 0;
66  virtual void drm_set_gbm_device(struct gbm_device* dev) = 0;
67 
68 protected:
69  HostConnection() = default;
70  HostConnection(HostConnection const&) = delete;
71  HostConnection& operator=(HostConnection const&) = delete;
72 };
73 
74 }
75 }
76 }
77 #endif // MIR_GRAPHICS_NESTED_HOST_CONNECTION_H_
virtual void set_display_config_change_callback(std::function< void()> const &cb)=0
All things Mir.
Definition: aging_buffer.h:24
Definition: client_types.h:266
Definition: host_connection.h:39
virtual std::shared_ptr< MirDisplayConfiguration > create_display_config()=0
virtual void drm_set_gbm_device(struct gbm_device *dev)=0
virtual void set_event_handler(MirEventDelegate const *handler)=0
virtual std::shared_ptr< HostSurface > create_surface(MirSurfaceParameters const &)=0
virtual void apply_display_config(MirDisplayConfiguration &)=0
virtual void drm_auth_magic(int magic)=0
Definition: host_connection.h:53
HostSurface & operator=(HostSurface const &)=delete
virtual EGLNativeWindowType egl_native_window()=0
virtual std::vector< int > platform_fd_items()=0
virtual EGLNativeDisplayType egl_native_display()=0
MirEventDelegate may be used to specify (at surface creation time) callbacks for handling of events...
Definition: client_types.h:278
HostConnection & operator=(HostConnection const &)=delete
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:135

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