Mir
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 
24 
25 #include <memory>
26 #include <vector>
27 #include <functional>
28 
29 #include <EGL/egl.h>
30 
31 struct gbm_device;
32 
33 namespace mir
34 {
35 namespace graphics
36 {
37 namespace nested
38 {
39 
41 {
42 public:
43  virtual ~HostSurface() = default;
44 
45  virtual EGLNativeWindowType egl_native_window() = 0;
46  virtual void set_event_handler(MirEventDelegate const* handler) = 0;
47 
48 protected:
49  HostSurface() = default;
50  HostSurface(HostSurface const&) = delete;
51  HostSurface& operator=(HostSurface const&) = delete;
52 };
53 
55 {
56 public:
57  virtual ~HostConnection() = default;
58 
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 protected:
66  HostConnection() = default;
67  HostConnection(HostConnection const&) = delete;
68  HostConnection& operator=(HostConnection const&) = delete;
69 };
70 
71 }
72 }
73 }
74 #endif // MIR_GRAPHICS_NESTED_HOST_CONNECTION_H_
virtual void set_display_config_change_callback(std::function< void()> const &cb)=0
All things Mir.
Definition: buffer_stream.h:37
Definition: client_types.h:270
Definition: nested_context.h:32
Definition: host_connection.h:40
virtual std::shared_ptr< MirDisplayConfiguration > create_display_config()=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
Definition: host_connection.h:54
HostSurface & operator=(HostSurface const &)=delete
virtual EGLNativeWindowType egl_native_window()=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:282
HostConnection & operator=(HostConnection const &)=delete
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:138

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015