Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
display.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIR_GRAPHICS_DISPLAY_H_
20 #define MIR_GRAPHICS_DISPLAY_H_
21 
22 #include <memory>
23 #include <functional>
24 
25 namespace mir
26 {
27 
28 namespace graphics
29 {
30 
31 class DisplayBuffer;
32 class DisplayConfiguration;
33 class Cursor;
34 class CursorImage;
35 class GLContext;
37 
38 typedef std::function<bool()> DisplayPauseHandler;
39 typedef std::function<bool()> DisplayResumeHandler;
40 typedef std::function<void()> DisplayConfigurationChangeHandler;
41 
45 class Display
46 {
47 public:
51  virtual void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f) = 0;
52 
56  virtual std::unique_ptr<DisplayConfiguration> configuration() const = 0;
57 
61  virtual void configure(DisplayConfiguration const& conf) = 0;
62 
73  EventHandlerRegister& handlers,
74  DisplayConfigurationChangeHandler const& conf_change_handler) = 0;
75 
82  virtual void register_pause_resume_handlers(
83  EventHandlerRegister& handlers,
84  DisplayPauseHandler const& pause_handler,
85  DisplayResumeHandler const& resume_handler) = 0;
86 
93  virtual void pause() = 0;
94 
98  virtual void resume() = 0;
99 
103  virtual std::shared_ptr<Cursor> create_hardware_cursor(std::shared_ptr<CursorImage> const& initial_image) = 0;
104 
111  virtual std::unique_ptr<GLContext> create_gl_context() = 0;
112 
113 protected:
114  Display() = default;
115  virtual ~Display() {/* TODO: make nothrow */}
116 private:
117  Display(Display const&) = delete;
118  Display& operator=(Display const&) = delete;
119 };
120 }
121 }
122 
123 #endif /* MIR_GRAPHICS_DISPLAY_H_ */
virtual void for_each_display_buffer(std::function< void(DisplayBuffer &)> const &f)=0
Executes a functor for each output framebuffer.
virtual void pause()=0
Pauses the display.
All things Mir.
Definition: aging_buffer.h:24
virtual void resume()=0
Resumes the display.
virtual ~Display()
Definition: display.h:115
Interface to an output framebuffer.
Definition: display_buffer.h:38
virtual void register_configuration_change_handler(EventHandlerRegister &handlers, DisplayConfigurationChangeHandler const &conf_change_handler)=0
Registers a handler for display configuration changes.
virtual std::unique_ptr< DisplayConfiguration > configuration() const =0
Gets a copy of the current output configuration.
virtual void configure(DisplayConfiguration const &conf)=0
Sets a new output configuration.
std::function< bool()> DisplayResumeHandler
Definition: display.h:39
virtual void register_pause_resume_handlers(EventHandlerRegister &handlers, DisplayPauseHandler const &pause_handler, DisplayResumeHandler const &resume_handler)=0
Registers handlers for pausing and resuming the display subsystem.
std::function< bool()> DisplayPauseHandler
Definition: display.h:36
virtual std::shared_ptr< Cursor > create_hardware_cursor(std::shared_ptr< CursorImage > const &initial_image)=0
Create a hardware cursor object.
Interface to the display subsystem.
Definition: display.h:45
std::function< void()> DisplayConfigurationChangeHandler
Definition: display.h:40
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:159
virtual std::unique_ptr< GLContext > create_gl_context()=0
Creates a GLContext object that shares resources with the Display's GL context.
Definition: event_handler_register.h:31

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