X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fpoint.hh;h=f438b34710a1f14a744c9ddc51757df079487ba1;hb=b6ad10764e75923ecb55d3dce96415eb991c64ec;hp=edccbe1a7f44fd7d82398da3dcfb41dfffee608e;hpb=0da967a8313bad4a9dbcca9b5c760bda32b7981f;p=chaz%2Fopenbox diff --git a/otk/point.hh b/otk/point.hh index edccbe1a..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 x) { _x = x; } - //! Returns the y value - int y() const { return _x; } + 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