X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fsize.hh;h=57447d5dc45b8200e1c586b6f8233c373d5cab34;hb=3dfe9f4ebeb7abd8446c52db0232b9f610a78846;hp=915396142bd19a5c42e2694dbf8820c3f3bfd269;hpb=f9659acd11bf73c117674a179e9c834bd22889d2;p=chaz%2Fopenbox diff --git a/otk/size.hh b/otk/size.hh index 91539614..57447d5d 100644 --- a/otk/size.hh +++ b/otk/size.hh @@ -2,17 +2,19 @@ #ifndef __size_hh #define __size_hh +#include + namespace otk { class Size { - unsigned int _w, _h; + 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) {} + Size(int w, int h) : _w(w), _h(h) { assert(_w >= 0 && _h >= 0); } + Size(const Size &s) : _w(s._w), _h(s._h) { assert(_w >= 0 && _h >= 0); } - inline unsigned int width() const { return _w; } - inline unsigned int height() const { return _h; } + inline int width() const { return _w; } + inline 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; }