]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/display.h
Exception changes
[libs/gui.git] / source / gbase / display.h
index 70efd20627426bed067dbd988b8cac1e1c811c4b..662e73fa67e6dc8742a49fec2994dbdb7caf89b0 100644 (file)
@@ -1,17 +1,10 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GBASE_DISPLAY_H_
 #define MSP_GBASE_DISPLAY_H_
 
 #include <list>
 #include <map>
+#include <stdexcept>
 #include <string>
-#include "types.h"
 
 namespace Msp {
 namespace Graphics {
@@ -28,26 +21,33 @@ struct VideoMode
        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:
-#ifndef WIN32
-       ::Display *display;
-#endif
        std::list<VideoMode> modes;
        VideoMode orig_mode;
-       std::map<WindowHandle, Window *> windows;
+       Private *priv;
 
 public:
-       Display(const std::string &disp_name=std::string());
+       Display(const std::string &disp_name = std::string());
        ~Display();
 
-#ifndef WIN32
-       ::Display *get_display() const { return display; }
-#endif
+       const Private &get_private() const { return *priv; }
 
-       void add_window(Window *);
-       void remove_window(Window *);
+       void add_window(Window &);
+       void remove_window(Window &);
 
        const std::list<VideoMode> &get_modes() const { return modes; }
        void set_mode(const VideoMode &);