]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/display.h
8d2f61873495bb4056dd276c25f4f6e65e5fa37c
[libs/gui.git] / source / graphics / display.h
1 #ifndef MSP_GRAPHICS_DISPLAY_H_
2 #define MSP_GRAPHICS_DISPLAY_H_
3
4 #include <list>
5 #include <stdexcept>
6 #include <string>
7 #include "monitor.h"
8 #include "videomode.h"
9
10 namespace Msp {
11 namespace Graphics {
12
13 class Window;
14
15 class Display
16 {
17 public:
18         struct Private;
19
20 private:
21         std::list<Monitor> monitors;
22         Monitor *primary_monitor;
23         std::list<VideoMode> modes;
24         Private *priv;
25
26 public:
27         Display(const std::string &disp_name = std::string());
28         ~Display();
29
30         const Private &get_private() const { return *priv; }
31
32         void add_window(Window &);
33         void remove_window(Window &);
34
35         const std::list<Monitor> &get_monitors() const { return monitors; }
36         const std::list<VideoMode> &get_modes() const { return modes; }
37         const VideoMode &get_desktop_mode() const;
38         void set_mode(const VideoMode &, bool = false);
39         void restore_mode();
40 private:
41         const VideoMode *find_matching_mode(const VideoMode &) const;
42
43 public:
44         void tick();
45 private:
46         bool process_events();
47 public:
48         void check_error();
49 };
50
51 } // namespace Graphics
52 } // namespace Msp
53
54 #endif