diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:34:06 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:34:06 +0000 |
| commit | f9659acd11bf73c117674a179e9c834bd22889d2 (patch) | |
| tree | fbcf215456f54a2f7182087d77da8f9523f01759 | |
| parent | 99cd843fc6dc7a7f55b6c90fd1162f233853aad2 (diff) | |
add the new size class' header
| -rw-r--r-- | otk/size.hh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/otk/size.hh b/otk/size.hh new file mode 100644 index 00000000..91539614 --- /dev/null +++ b/otk/size.hh @@ -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 |
