Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups 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 GLContext;
36 
37 typedef std::function<bool()> DisplayPauseHandler;
38 typedef std::function<bool()> DisplayResumeHandler;
39 typedef std::function<void()> DisplayConfigurationChangeHandler;
40 
44 class Display
45 {
46 public:
50  virtual void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f) = 0;
51 
55  virtual std::shared_ptr<DisplayConfiguration> configuration() = 0;
56 
60  virtual void configure(DisplayConfiguration const& conf) = 0;
61 
72  EventHandlerRegister& handlers,
73  DisplayConfigurationChangeHandler const& conf_change_handler) = 0;
74 
81  virtual void register_pause_resume_handlers(
82  EventHandlerRegister& handlers,
83  DisplayPauseHandler const& pause_handler,
84  DisplayResumeHandler const& resume_handler) = 0;
85 
92  virtual void pause() = 0;
93 
97  virtual void resume() = 0;
98 
102  virtual std::weak_ptr<Cursor> the_cursor() = 0;
103 
110  virtual std::unique_ptr<GLContext> create_gl_context() = 0;
111 
112 protected:
113  Display() = default;
114  virtual ~Display() {/* TODO: make nothrow */}
115 private:
116  Display(Display const&) = delete;
117  Display& operator=(Display const&) = delete;
118 };
119 }
120 }
121 
122 #endif /* MIR_GRAPHICS_DISPLAY_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013