diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
| commit | 99cd843fc6dc7a7f55b6c90fd1162f233853aad2 (patch) | |
| tree | 42b25c02cbf984fe29b378e9d0dbfbca1436c87b /otk/point.hh | |
| parent | d2df40965bbf042e062b65d6adc12bc158d503eb (diff) | |
Brand spankin new widgets for otk (Label and Button).
Add a new Size class.
Rect, Point, and Size are immutable classes.
Size uses *UNSIGNED* ints. This is causing me headaches * a bajillion right now, so we'll see about that.
Diffstat (limited to 'otk/point.hh')
| -rw-r--r-- | otk/point.hh | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/otk/point.hh b/otk/point.hh index 66c3b14d..f438b347 100644 --- a/otk/point.hh +++ b/otk/point.hh @@ -2,40 +2,22 @@ #ifndef __point_hh #define __point_hh -/*! @file point.hh - @brief The Point class contains an x/y pair -*/ - namespace otk { -//! The Point class is an x/y coordinate or size pair class Point { -private: - //! The x value - int _x; - //! The y value - int _y; - + int _x, _y; public: - //! Constructs a new Point with 0,0 values Point() : _x(0), _y(0) {} - //! Constructs a new Point with given values Point(int x, int y) : _x(x), _y(y) {} + Point(const Point &p) : _x(p._x), _y(p._y) {} - //! Changes the x value to the new value specified - void setX(int x) { _x = x; } - //! Returns the x value - int x() const { return _x; } - - //! Changes the y value to the new value specified - void setY(int y) { _y = y; } - //! Returns the y value - int y() const { return _y; } + inline int x() const { return _x; } + inline int y() const { return _y; } - //! Changes the x and y values - void setPoint(int x, int y) { _x = x; _y = y; } + bool operator==(const Point &o) const { return _x == o._x && _y == o._y; } + bool operator!=(const Point &o) const { return _x != o._x || _y != o._y; } }; } -#endif /* __point_hh */ +#endif // __point_hh |
