X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fdisplay.h;h=03912de864dbdc95d7d3181406554853316fad0c;hb=eb81125a81735eceef4a8be54a0bafcae6901e18;hp=d311ba73c75f36ded3fe02e0401518638e88d2e2;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/display.h b/source/graphics/display.h index d311ba7..03912de 100644 --- a/source/graphics/display.h +++ b/source/graphics/display.h @@ -4,40 +4,26 @@ #include #include #include +#include "errordialog.h" +#include "monitor.h" +#include "videomode.h" namespace Msp { namespace Graphics { class Window; -struct VideoMode -{ - unsigned width; - unsigned height; - unsigned rate; - - VideoMode(): width(0), height(0), rate(0) { } - VideoMode(unsigned w, unsigned h): width(w), height(h), rate(0) { } -}; - - -class unsupported_video_mode: public std::runtime_error -{ -public: - unsupported_video_mode(const VideoMode &); - virtual ~unsupported_video_mode() throw () { } -}; - - class Display { public: struct Private; private: + std::list monitors; + Monitor *primary_monitor; std::list modes; - VideoMode orig_mode; Private *priv; + ErrorDialog *err_dialog; public: Display(const std::string &disp_name = std::string()); @@ -48,10 +34,13 @@ public: void add_window(Window &); void remove_window(Window &); + const std::list &get_monitors() const { return monitors; } const std::list &get_modes() const { return modes; } - const VideoMode &get_desktop_mode() const { return orig_mode; } - void set_mode(const VideoMode &); - void restore_mode() { set_mode(orig_mode); } + const VideoMode &get_desktop_mode() const; + void set_mode(const VideoMode &, bool = false); + void restore_mode(); + const VideoMode *find_mode(const VideoMode &) const; + const VideoMode *find_mode(unsigned, unsigned) const; void tick(); private: