Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
2 files changed, 43 insertions, 0 deletions
-rw-r--r--src/Screen.cpp17
-rw-r--r--src/Screen.h26
diff --git a/src/Screen.cpp b/src/Screen.cpp
new file mode 100644
index 0000000..3ff3183
--- /dev/null
+++ b/src/Screen.cpp
@@ -0,0 +1,17 @@
+#include "Screen.h"
+
+Screen::Screen(mm width, mm height) : width(width), height(height) { }
+
+Screen::~Screen() { }
+
+mm Screen::getHeight() const {
+ return this->height;
+}
+
+mm Screen::getWidth() const {
+ return this->width;
+}
+
+std::ostream& operator<<(std::ostream& ostr, const Screen& screen) {
+ return ostr << "Screen: " << screen.width << "x" << screen.height;
+}
diff --git a/src/Screen.h b/src/Screen.h
new file mode 100644
index 0000000..950aab4
--- /dev/null
+++ b/src/Screen.h
@@ -0,0 +1,26 @@
+#ifndef SG_SCREEN
+#define SG_SCREEN
+
+#include <ostream>
+
+typedef unsigned int mm;
+
+class Screen {
+public:
+ virtual ~Screen();
+
+ mm getHeight() const;
+ mm getWidth() const;
+
+ friend std::ostream& operator<<(std::ostream& ostr, const Screen& screen);
+
+protected:
+ mm width;
+ mm height;
+
+ Screen(mm width, mm height);
+};
+
+std::ostream& operator<<(std::ostream& ostr, const Screen& screen);
+
+#endif /* SG_SCREEN */