12 Point(LONG px = 0, LONG py = 0)
18 Point(
const POINT& other)
24 void operator=(
const POINT& other)
30 bool operator==(
const POINT& other)
const
32 return x == other.x && y == other.y;
35 Point& ClientToScreen(HWND window)
37 ::ClientToScreen(window,
this);
41 Point& ScreenToClient(HWND window)
43 ::ScreenToClient(window,
this);
50 return Point(x + other.x, y + other.y);
56 return Point(x - other.x, y - other.y);
81 Size(LONG width = 0, LONG height = 0)
87 Size(
const SIZE& other)
93 void operator=(
const SIZE& other)
99 bool operator==(
const SIZE& other)
const
101 return cx == other.cx && cy == other.cy;
112 left = top = right = bottom = 0;
115 Rect(LONG x, LONG y, LONG width, LONG height)
119 right = left + width;
120 bottom = top + height;
123 Rect(
const POINT& topleft,
const SIZE& size)
128 Rect(
const POINT& topleft,
const POINT& bottomright)
130 Set(topleft, bottomright);
133 Rect(
const RECT& other)
138 bottom = other.bottom;
141 void operator=(
const RECT& other)
146 bottom = other.bottom;
149 void Set(
const POINT& topleft,
const SIZE& size)
153 right = left + size.cx;
154 bottom = top + size.cy;
157 void Set(
const POINT& topleft,
const POINT& bottomright)
161 right = bottomright.x;
162 bottom = bottomright.y;
165 bool operator==(
const RECT& other)
const
167 return EqualRect(
this, &other) != FALSE;
170 Point TopLeft()
const
172 return Point(left, top);
187 return Size(Width(), Height());
192 return IsRectEmpty(
this) != FALSE;
195 bool PtInRect(
const POINT& p)
const
197 return ::PtInRect(
this, p) != FALSE;
200 Rect& Offset(
int dx,
int dy)
202 OffsetRect(
this, dx, dy);
206 Rect& Inflate(
int dx,
int dy)
208 InflateRect(
this, dx, dy);
212 bool Intersect(
const RECT& r1,
const RECT& r2)
214 return IntersectRect(
this, &r1, &r2) != FALSE;
217 Rect Intersect(
const RECT& other)
const
220 IntersectRect(&r,
this, &other);
224 bool Union(
const RECT& r1,
const RECT& r2)
226 return UnionRect(
this, &r1, &r2) != FALSE;
229 Rect Union(
const RECT& other)
const
232 UnionRect(&r,
this, &other);
236 Rect& ClientToScreen(HWND window)
238 Set(
Point(left, top).ClientToScreen(window), GetSize());
242 Rect& ScreenToClient(HWND window)
244 Set(
Point(left, top).ScreenToClient(window), GetSize());
252 GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_XVIRTUALSCREEN),
253 GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
Windows POINT structure with constructor.
Definition: Rect.h:10
Point operator+(const POINT &other)
Definition: Rect.h:48
Point & operator-=(const POINT &other)
Definition: Rect.h:68
Point & operator+=(const POINT &other)
Definition: Rect.h:60
Windows SIZE structure with constructor.
Definition: Rect.h:79
static Rect DesktopRect()
Definition: Rect.h:249
Windows RECT structure with constructor.
Definition: Rect.h:108
Point operator-(const POINT &other)
Definition: Rect.h:54