all repos — openbox @ d2df40965bbf042e062b65d6adc12bc158d503eb

openbox fork - make it a bit more like ryudo

otk/point.hh (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#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;

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) {}

  //! 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; }

  //! Changes the x and y values
  void setPoint(int x, int y) { _x = x; _y = y; }
};

}

#endif /* __point_hh */