HaikuDepot: notify work status from main window
[haiku.git] / src / apps / terminal / TermPos.h
blobe2bc18c6edf5762d1c6f601d958169ab7022f7da
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef TERM_POS_H
6 #define TERM_POS_H
8 #include <SupportDefs.h>
11 class TermPos {
12 public:
13 int32 x;
14 int32 y;
16 inline TermPos() : x(0), y(0) { }
17 inline TermPos(int32 x, int32 y) : x(x), y(y) { }
18 inline TermPos(const TermPos& other) : x(other.x), y(other.y) { }
20 inline void SetTo(int32 x, int32 y)
22 this->x = x;
23 this->y = y;
26 inline bool operator==(const TermPos& other) const
28 return x == other.x && y == other.y;
31 inline bool operator!=(const TermPos& other) const
33 return x != other.x || y != other.y;
36 inline bool operator<=(const TermPos& other) const
38 return y < other.y || (y == other.y && x <= other.x);
41 inline bool operator>=(const TermPos& other) const
43 return other <= *this;
46 inline bool operator<(const TermPos& other) const
48 return !(*this >= other);
51 inline bool operator>(const TermPos& other) const
53 return !(*this <= other);
56 inline TermPos& operator=(const TermPos& other)
58 x = other.x;
59 y = other.y;
60 return *this;
65 #endif // TERM_POS_H