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 #include "mir/geometry/rectangle.h"
25 
26 #include <memory>
27 #include <vector>
28 #include <functional>
29 
30 #include <EGL/egl.h>
31 
32 namespace mir
33 {
34 namespace graphics
35 {
36 class CursorImage;
37 
38 namespace nested
39 {
40 using UniqueInputConfig = std::unique_ptr<MirInputConfig, void(*)(MirInputConfig const*)>;
41 
42 class HostSurface;
44 {
45 public:
46  virtual ~HostConnection() = default;
47 
48  virtual EGLNativeDisplayType egl_native_display() = 0;
49  virtual std::shared_ptr<MirDisplayConfiguration> create_display_config() = 0;
50  virtual void set_display_config_change_callback(std::function<void()> const& cb) = 0;
52  virtual std::shared_ptr<HostSurface> create_surface(
53  int width, int height, MirPixelFormat pf, char const* name,
54  MirBufferUsage usage, uint32_t output_id) = 0;
55 
56  virtual void set_cursor_image(CursorImage const& image) = 0;
57  virtual void hide_cursor() = 0;
58  virtual auto graphics_platform_library() -> std::string = 0;
59 
61  virtual void set_input_device_change_callback(std::function<void(UniqueInputConfig)> const& cb) = 0;
62  virtual void set_input_event_callback(std::function<void(MirEvent const&, mir::geometry::Rectangle const&)> const& cb) = 0;
63  virtual void emit_input_event(MirEvent const& event, mir::geometry::Rectangle const& source_frame) = 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: atomic_callback.h:25
Definition: client_types.h:353
Definition: nested_context.h:32
Definition: host_surface.h:34
virtual std::shared_ptr< MirDisplayConfiguration > create_display_config()=0
virtual void apply_display_config(MirDisplayConfiguration &)=0
Definition: host_connection.h:43
virtual void emit_input_event(MirEvent const &event, mir::geometry::Rectangle const &source_frame)=0
virtual UniqueInputConfig create_input_device_config()=0
virtual void set_input_event_callback(std::function< void(MirEvent const &, mir::geometry::Rectangle const &)> const &cb)=0
Definition: cursor_image.h:30
virtual EGLNativeDisplayType egl_native_display()=0
std::unique_ptr< MirInputConfig, void(*)(MirInputConfig const *)> UniqueInputConfig
Definition: host_connection.h:40
virtual void set_cursor_image(CursorImage const &image)=0
unsigned int width
Definition: touchspot_image.c:4
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:159
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
virtual auto graphics_platform_library() -> std::string=0
virtual void set_input_device_change_callback(std::function< void(UniqueInputConfig)> const &cb)=0
virtual std::shared_ptr< HostSurface > create_surface(int width, int height, MirPixelFormat pf, char const *name, MirBufferUsage usage, uint32_t output_id)=0
HostConnection & operator=(HostConnection const &)=delete
Definition: rectangle.h:33
unsigned int height
Definition: touchspot_image.c:5
Definition: event.h:30

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016