]> Dogcows Code - chaz/openbox/commitdiff
add the new size class' header
authorDana Jansens <danakj@orodu.net>
Sat, 8 Feb 2003 07:34:06 +0000 (07:34 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 8 Feb 2003 07:34:06 +0000 (07:34 +0000)
otk/size.hh [new file with mode: 0644]

diff --git a/otk/size.hh b/otk/size.hh
new file mode 100644 (file)
index 0000000..9153961
--- /dev/null
@@ -0,0 +1,23 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+#ifndef __size_hh
+#define __size_hh
+
+namespace otk {
+
+class Size {
+  unsigned int _w, _h;
+public:
+  Size() : _w(1), _h(1) {}
+  Size(unsigned int w, unsigned int h) : _w(w), _h(h) {}
+  Size(const Size &s) : _w(s._w), _h(s._h) {}
+
+  inline unsigned int width() const { return _w; }
+  inline unsigned int height() const { return _h; }
+
+  bool operator==(const Size &o) const { return _w == o._w && _h == o._h; }
+  bool operator!=(const Size &o) const { return _w != o._w || _h != o._h; }
+};
+
+}
+
+#endif // __size_hh
This page took 0.025619 seconds and 4 git commands to generate.