openbox/otk/point.hh

42 lines
890 B
C++
Raw Normal View History

2002-11-10 10:46:28 +00:00
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __point_hh
#define __point_hh
/*! @file point.hh
2002-11-10 10:52:56 +00:00
@brief The Point class contains an x/y pair
2002-11-10 10:46:28 +00:00
*/
namespace otk {
2002-11-10 10:52:56 +00:00
//! The Point class is an x/y coordinate or size pair
2002-11-10 10:46:28 +00:00
class Point {
private:
2002-11-10 10:52:56 +00:00
//! The x value
int _x;
//! The y value
2002-11-10 12:15:03 +00:00
int _y;
2002-11-10 10:46:28 +00:00
public:
2002-11-10 10:52:56 +00:00
//! Constructs a new Point with 0,0 values
2002-11-10 10:46:28 +00:00
Point() : _x(0), _y(0) {}
2002-11-10 10:52:56 +00:00
//! Constructs a new Point with given values
2002-11-10 10:46:28 +00:00
Point(int x, int y) : _x(x), _y(y) {}
2002-11-10 10:52:56 +00:00
//! Changes the x value to the new value specified
2002-11-10 10:46:28 +00:00
void setX(int x) { _x = x; }
2002-11-10 10:52:56 +00:00
//! Returns the x value
2002-11-10 12:15:03 +00:00
int x() const { return _x; }
2002-11-10 10:46:28 +00:00
2002-11-10 10:52:56 +00:00
//! Changes the y value to the new value specified
2002-11-17 16:00:12 +00:00
void setY(int y) { _y = y; }
2002-11-10 10:52:56 +00:00
//! Returns the y value
2002-11-17 16:00:12 +00:00
int y() const { return _y; }
//! Changes the x and y values
void setPoint(int x, int y) { _x = x; _y = y; }
2002-11-10 10:46:28 +00:00
};
}
#endif /* __point_hh */