]> Dogcows Code - chaz/openbox/blob - otk/point.hh
blef
[chaz/openbox] / otk / point.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __point_hh
3 #define __point_hh
4
5 /*! @file point.hh
6 @brief The Point class contains an x/y pair
7 */
8
9 namespace otk {
10
11 //! The Point class is an x/y coordinate or size pair
12 class Point {
13 private:
14 //! The x value
15 int _x;
16 //! The y value
17 int _y;
18
19 public:
20 //! Constructs a new Point with 0,0 values
21 Point() : _x(0), _y(0) {}
22 //! Constructs a new Point with given values
23 Point(int x, int y) : _x(x), _y(y) {}
24
25 //! Changes the x value to the new value specified
26 void setX(int x) { _x = x; }
27 //! Returns the x value
28 int x() const { return _x; }
29
30 //! Changes the y value to the new value specified
31 void setY(int y) { _y = y; }
32 //! Returns the y value
33 int y() const { return _y; }
34
35 //! Changes the x and y values
36 void setPoint(int x, int y) { _x = x; _y = y; }
37 };
38
39 }
40
41 #endif /* __point_hh */
This page took 0.039928 seconds and 4 git commands to generate.