]> git.tdb.fi Git - libs/gui.git/blobdiff - source/display.h
Redesign and refactor
[libs/gui.git] / source / display.h
diff --git a/source/display.h b/source/display.h
new file mode 100644 (file)
index 0000000..0433eab
--- /dev/null
@@ -0,0 +1,54 @@
+/* $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 <string>
+#include "types.h"
+
+namespace Msp {
+namespace Graphics {
+
+class Window;
+
+struct VideoMode
+{
+       unsigned width;
+       unsigned height;
+       unsigned rate;
+};
+
+class Display
+{
+private:
+       ::Display *display;
+       std::list<VideoMode> modes;
+       std::map<WindowHandle, Window *> windows;
+
+public:
+       Display(const std::string &disp_name=std::string());
+       ~Display();
+
+       ::Display *get_display() const { return display; }
+
+       void add_window(Window *);
+       void remove_window(Window *);
+
+       const std::list<VideoMode> &get_modes() const { return modes; }
+       void set_mode(const VideoMode &);
+
+       void tick();
+       void check_error();
+};
+
+} // namespace Graphics
+} // namespace Msp
+
+#endif