src/proto2/Dimension.hh
changeset 5 617813994ab1
parent 4 e28b28b8817c
child 6 faa4e777cc6e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/proto2/Dimension.hh	Mon Nov 03 22:59:50 2008 +0000
@@ -0,0 +1,43 @@
+#ifndef DIMENSION_HH
+#define DIMENSION_HH
+
+class Dimension {
+	public:
+		uint32_t width;
+		uint32_t height;
+
+		Dimension (uint32_t width, uint32_t height) : width(width), height(height) { }
+};
+
+class Coordinate {
+	public:
+		uint32_t x;
+		uint32_t y;
+
+		Coordinate (uint32_t x, uint32_t y) : x(x), y(y) { }
+
+		Coordinate &operator+= (const PositionDelta &d) {
+			this->x += d.dx;
+			this->y += d.dy;
+		}
+
+		uint32_t scaledX() {
+			// Scale the coordinate so that it 
+			// matches the pixel resolution
+			return this->x/1;
+		}
+
+		uint32_t scaledY() {
+			return this->y/1;
+		}
+};
+
+class PositionDelta {
+	public:
+		uint32_t dx;
+		uint32_t dy;
+
+		PositionDelta (uint32_t dx, uint32_t dy) : dx(dx), dy(dy) { }
+};
+
+#endif