]>
Dogcows Code - chaz/openbox/blob - otk/rect.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
14 Rect() : _p(), _s() {}
15 Rect(const Point
&p
, const Size
&s
) : _p(p
), _s(s
) {}
16 Rect(const Rect
&r
) : _p(r
._p
), _s(r
._s
) {}
17 Rect(int x
, int y
, unsigned int w
, unsigned int h
)
18 : _p(x
, y
), _s(w
, h
) {}
20 inline int x() const { return _p
.x(); }
21 inline int y() const { return _p
.y(); }
22 inline unsigned int width() const { return _s
.width(); }
23 inline unsigned int height() const { return _s
.height(); }
25 inline int left() const { return _p
.x(); }
26 inline int top() const { return _p
.y(); }
27 inline int right() const { return _p
.x() + _s
.width() - 1; }
28 inline int bottom() const { return _p
.y() + _s
.height() - 1; }
30 inline const Point
& position() const { return _p
; }
31 inline const Size
& size() const { return _s
; }
33 bool operator==(const Rect
&o
) const { return _p
== o
._p
&& _s
== o
._s
; }
34 bool operator!=(const Rect
&o
) const { return _p
!= o
._p
|| _s
!= o
._s
; }
This page took 0.032855 seconds and 4 git commands to generate.