]> git.tdb.fi Git - libs/gui.git/commitdiff
Move struct VideoMode to its own header
authorMikko Rasa <tdb@tdb.fi>
Tue, 24 Sep 2013 15:56:24 +0000 (18:56 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 24 Sep 2013 15:56:24 +0000 (18:56 +0300)
source/graphics/display.cpp
source/graphics/display.h
source/graphics/videomode.cpp [new file with mode: 0644]
source/graphics/videomode.h [new file with mode: 0644]

index 42b0e8bb773404c892b01896d8ca13a589fa6f73..deaa5b560e7819db973b1f6a9fc2d94068bdf65e 100644 (file)
@@ -1,4 +1,3 @@
-#include <msp/strings/format.h>
 #include "display.h"
 #include "display_private.h"
 #include "window.h"
@@ -8,11 +7,6 @@ using namespace std;
 namespace Msp {
 namespace Graphics {
 
-unsupported_video_mode::unsupported_video_mode(const VideoMode &mode):
-       runtime_error(format("%dx%d", mode.width, mode.height))
-{ }
-
-
 void Display::add_window(Window &wnd)
 {
        priv->windows[wnd.get_private().window] = &wnd;
index d311ba73c75f36ded3fe02e0401518638e88d2e2..370bf0dea81013c03d2212ae77e2cfabd9cb7981 100644 (file)
@@ -4,31 +4,13 @@
 #include <list>
 #include <stdexcept>
 #include <string>
+#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:
diff --git a/source/graphics/videomode.cpp b/source/graphics/videomode.cpp
new file mode 100644 (file)
index 0000000..a07112a
--- /dev/null
@@ -0,0 +1,12 @@
+#include <msp/strings/format.h>
+#include "videomode.h"
+
+namespace Msp {
+namespace Graphics {
+
+unsupported_video_mode::unsupported_video_mode(const VideoMode &mode):
+       runtime_error(format("%dx%d", mode.width, mode.height))
+{ }
+
+} // namespace Graphics
+} // namespace Msp
diff --git a/source/graphics/videomode.h b/source/graphics/videomode.h
new file mode 100644 (file)
index 0000000..d883d17
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef MSP_GRAPHICS_VIDEOMODE_H_
+#define MSP_GRAPHICS_VIDEOMODE_H_
+
+namespace Msp {
+namespace Graphics {
+
+struct VideoMode;
+
+class unsupported_video_mode: public std::runtime_error
+{
+public:
+       unsupported_video_mode(const VideoMode &);
+       virtual ~unsupported_video_mode() throw () { }
+};
+
+
+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) { }
+};
+
+} // namespace Graphics
+} // namespace Msp
+
+#endif