ReactOS  0.4.14-dev-41-g31d7680
CRect Class Reference

#include <atltypes.h>

Inheritance diagram for CRect:
Collaboration diagram for CRect:

Public Member Functions

 CRect () throw ()
 
 CRect (int l, int t, int r, int b) throw ()
 
 CRect (const RECT &srcRect) throw ()
 
 CRect (LPCRECT lpSrcRect) throw ()
 
 CRect (POINT point, SIZE size) throw ()
 
 CRect (POINT topLeft, POINT bottomRight) throw ()
 
CPointBottomRight () throw ()
 
const CPointBottomRight () const throw ()
 
CPoint CenterPoint () const throw ()
 
void CopyRect (LPCRECT lpSrcRect) throw ()
 
void DeflateRect (int x, int y) throw ()
 
void DeflateRect (SIZE size) throw ()
 
void DeflateRect (LPCRECT lpRect) throw ()
 
void DeflateRect (int l, int t, int r, int b) throw ()
 
BOOL EqualRect (LPCRECT lpRect) const throw ()
 
int Height () const throw ()
 
void InflateRect (int x, int y) throw ()
 
void InflateRect (SIZE size) throw ()
 
void InflateRect (LPCRECT lpRect) throw ()
 
void InflateRect (int l, int t, int r, int b) throw ()
 
BOOL IntersectRect (LPCRECT lpRect1, LPCRECT lpRect2) throw ()
 
BOOL IsRectEmpty () const throw ()
 
BOOL IsRectNull () const throw ()
 
void OffsetRect (int x, int y) throw ()
 
void OffsetRect (POINT point) throw ()
 
void OffsetRect (SIZE size) throw ()
 
BOOL PtInRect (POINT point) const throw ()
 
CPointTopLeft () throw ()
 
const CPointTopLeft () const throw ()
 
BOOL UnionRect (LPCRECT lpRect1, LPCRECT lpRect2) throw ()
 
int Width () const throw ()
 
BOOL operator== (const RECT &rect) const throw ()
 
BOOL operator!= (const RECT &rect) const throw ()
 
void operator= (const RECT &srcRect) throw ()
 
void operator+= (POINT point) throw ()
 
void operator+= (SIZE size) throw ()
 
void operator+= (LPCRECT lpRect) throw ()
 
void operator-= (POINT point) throw ()
 
void operator-= (SIZE size) throw ()
 
void operator-= (LPCRECT lpRect) throw ()
 
CRect operator+ (POINT point) const throw ()
 
CRect operator+ (LPCRECT lpRect) const throw ()
 
CRect operator+ (SIZE size) const throw ()
 
CRect operator- (POINT point) const throw ()
 
CRect operator- (SIZE size) const throw ()
 
CRect operator- (LPCRECT lpRect) const throw ()
 
void operator&= (const RECT &rect) throw ()
 
CRect operator & (const RECT &rect2) const throw ()
 
void operator|= (const RECT &rect) throw ()
 
CRect operator| (const RECT &rect2) const throw ()
 
 operator LPRECT () throw ()
 
 operator LPCRECT () const throw ()
 

Additional Inherited Members

- Public Attributes inherited from tagRECT
LONG left
 
LONG top
 
LONG right
 
LONG bottom
 

Detailed Description

Definition at line 221 of file atltypes.h.

Constructor & Destructor Documentation

◆ CRect() [1/6]

CRect::CRect ( )
throw (
)
inline

Definition at line 224 of file atltypes.h.

225  {
226  left = top = right = bottom = 0;
227  }
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CRect() [2/6]

CRect::CRect ( int  l,
int  t,
int  r,
int  b 
)
throw (
)
inline

Definition at line 229 of file atltypes.h.

230  {
231  left = l;
232  top = t;
233  right = r;
234  bottom = b;
235  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLint GLint bottom
Definition: glext.h:7726
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CRect() [3/6]

CRect::CRect ( const RECT srcRect)
throw (
)
inline

Definition at line 237 of file atltypes.h.

238  {
239  left = srcRect.left;
240  top = srcRect.top;
241  right = srcRect.right;
242  bottom = srcRect.bottom;
243  }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
LONG bottom
Definition: windef.h:294
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CRect() [4/6]

CRect::CRect ( LPCRECT  lpSrcRect)
throw (
)
inline

Definition at line 245 of file atltypes.h.

246  {
247  left = lpSrcRect->left;
248  top = lpSrcRect->top;
249  right = lpSrcRect->right;
250  bottom = lpSrcRect->bottom;
251  }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
LONG bottom
Definition: windef.h:294
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CRect() [5/6]

CRect::CRect ( POINT  point,
SIZE  size 
)
throw (
)
inline

Definition at line 253 of file atltypes.h.

254  {
255  left = point.x;
256  top = point.y;
257  right = point.x + size.cx;
258  bottom = point.y + size.cy;
259  }
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:315
GLint GLint bottom
Definition: glext.h:7726
GLsizeiptr size
Definition: glext.h:5919
GLint left
Definition: glext.h:7726
LONG x
Definition: windef.h:314
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CRect() [6/6]

CRect::CRect ( POINT  topLeft,
POINT  bottomRight 
)
throw (
)
inline

Definition at line 261 of file atltypes.h.

262  {
263  left = topLeft.x;
264  top = topLeft.y;
265  right = bottomRight.x;
266  bottom = bottomRight.y;
267  }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

Member Function Documentation

◆ BottomRight() [1/2]

CPoint& CRect::BottomRight ( )
throw (
)
inline

Definition at line 269 of file atltypes.h.

270  {
271  return ((CPoint*)this)[1];
272  }

◆ BottomRight() [2/2]

const CPoint& CRect::BottomRight ( ) const
throw (
)
inline

Definition at line 274 of file atltypes.h.

275  {
276  return ((const CPoint*)this)[1];
277  }

◆ CenterPoint()

CPoint CRect::CenterPoint ( ) const
throw (
)
inline

Definition at line 279 of file atltypes.h.

280  {
281  return CPoint(left + (Width() >> 1), top + (Height() >> 1));
282  }
int Width() const
Definition: atltypes.h:407
int Height() const
Definition: atltypes.h:318
GLint left
Definition: glext.h:7726
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ CopyRect()

void CRect::CopyRect ( LPCRECT  lpSrcRect)
throw (
)
inline

Definition at line 284 of file atltypes.h.

285  {
286  ::CopyRect(this, lpSrcRect);
287  }
void CopyRect(LPCRECT lpSrcRect)
Definition: atltypes.h:284

Referenced by test_CRect().

◆ DeflateRect() [1/4]

void CRect::DeflateRect ( int  x,
int  y 
)
throw (
)
inline

Definition at line 289 of file atltypes.h.

290  {
291  ::InflateRect(this, -x, -y);
292  }
void InflateRect(int x, int y)
Definition: atltypes.h:323
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by DeflateRect(), and operator-=().

◆ DeflateRect() [2/4]

void CRect::DeflateRect ( SIZE  size)
throw (
)
inline

Definition at line 294 of file atltypes.h.

295  {
296  ::InflateRect(this, -size.cx, -size.cy);
297  }
void InflateRect(int x, int y)
Definition: atltypes.h:323
GLsizeiptr size
Definition: glext.h:5919

◆ DeflateRect() [3/4]

void CRect::DeflateRect ( LPCRECT  lpRect)
throw (
)
inline

Definition at line 299 of file atltypes.h.

300  {
301  DeflateRect(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
302  }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
void DeflateRect(int x, int y)
Definition: atltypes.h:289
LONG bottom
Definition: windef.h:294

◆ DeflateRect() [4/4]

void CRect::DeflateRect ( int  l,
int  t,
int  r,
int  b 
)
throw (
)
inline

Definition at line 304 of file atltypes.h.

305  {
306  left += l;
307  top += t;
308  right -= r;
309  bottom -= b;
310  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLint GLint bottom
Definition: glext.h:7726
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ EqualRect()

BOOL CRect::EqualRect ( LPCRECT  lpRect) const
throw (
)
inline

Definition at line 312 of file atltypes.h.

313  {
314  return ::EqualRect(this, lpRect);
315  }
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by test_CRect().

◆ Height()

int CRect::Height ( ) const
throw (
)
inline

Definition at line 318 of file atltypes.h.

319  {
320  return bottom - top;
321  }
LONG top
Definition: windef.h:292
GLint GLint bottom
Definition: glext.h:7726

Referenced by CenterPoint(), and UpdateScrollbox().

◆ InflateRect() [1/4]

void CRect::InflateRect ( int  x,
int  y 
)
throw (
)
inline

Definition at line 323 of file atltypes.h.

324  {
325  ::InflateRect(this, x, y);
326  }
void InflateRect(int x, int y)
Definition: atltypes.h:323
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by DeflateRect(), InflateRect(), and operator+=().

◆ InflateRect() [2/4]

void CRect::InflateRect ( SIZE  size)
throw (
)
inline

Definition at line 328 of file atltypes.h.

329  {
330  ::InflateRect(this, size.cx, size.cy);
331  }
void InflateRect(int x, int y)
Definition: atltypes.h:323
GLsizeiptr size
Definition: glext.h:5919

◆ InflateRect() [3/4]

void CRect::InflateRect ( LPCRECT  lpRect)
throw (
)
inline

Definition at line 333 of file atltypes.h.

334  {
335  InflateRect(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
336  }
void InflateRect(int x, int y)
Definition: atltypes.h:323
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
LONG bottom
Definition: windef.h:294

◆ InflateRect() [4/4]

void CRect::InflateRect ( int  l,
int  t,
int  r,
int  b 
)
throw (
)
inline

Definition at line 338 of file atltypes.h.

339  {
340  left -= l;
341  top -= t;
342  right += r;
343  bottom += b;
344  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLint GLint bottom
Definition: glext.h:7726
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ IntersectRect()

BOOL CRect::IntersectRect ( LPCRECT  lpRect1,
LPCRECT  lpRect2 
)
throw (
)
inline

Definition at line 346 of file atltypes.h.

347  {
348  return ::IntersectRect(this, lpRect1, lpRect2);
349  }
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by operator&=(), and test_CRect().

◆ IsRectEmpty()

BOOL CRect::IsRectEmpty ( ) const
throw (
)
inline

Definition at line 351 of file atltypes.h.

352  {
353  return ::IsRectEmpty(this);
354  }
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)

Referenced by test_CRect().

◆ IsRectNull()

BOOL CRect::IsRectNull ( ) const
throw (
)
inline

Definition at line 356 of file atltypes.h.

357  {
358  return (left == 0 && right == 0 &&
359  top == 0 && bottom == 0);
360  }
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

Referenced by test_CRect().

◆ OffsetRect() [1/3]

void CRect::OffsetRect ( int  x,
int  y 
)
throw (
)
inline

Definition at line 368 of file atltypes.h.

369  {
370  ::OffsetRect(this, x, y);
371  }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void OffsetRect(int x, int y)
Definition: atltypes.h:368
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by OffsetRect(), operator+=(), and operator-=().

◆ OffsetRect() [2/3]

void CRect::OffsetRect ( POINT  point)
throw (
)
inline

Definition at line 373 of file atltypes.h.

374  {
375  ::OffsetRect(this, point.x, point.y);
376  }
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:315
LONG x
Definition: windef.h:314
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ OffsetRect() [3/3]

void CRect::OffsetRect ( SIZE  size)
throw (
)
inline

Definition at line 378 of file atltypes.h.

379  {
380  ::OffsetRect(this, size.cx, size.cy);
381  }
GLsizeiptr size
Definition: glext.h:5919
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ operator &()

CRect CRect::operator & ( const RECT rect2) const
throw (
)
inline

Definition at line 512 of file atltypes.h.

513  {
514  CRect r;
515  r.IntersectRect(this, &rect2);
516  return r;
517  }
RECT rect2
Definition: edittest.c:51
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator LPCRECT()

CRect::operator LPCRECT ( ) const
throw (
)
inline

Definition at line 536 of file atltypes.h.

537  {
538  return this;
539  }

◆ operator LPRECT()

CRect::operator LPRECT ( )
throw (
)
inline

Definition at line 531 of file atltypes.h.

532  {
533  return this;
534  }

◆ operator!=()

BOOL CRect::operator!= ( const RECT rect) const
throw (
)
inline

Definition at line 421 of file atltypes.h.

422  {
423  return !(*this == rect);
424  }
& rect
Definition: startmenu.cpp:1413

◆ operator&=()

void CRect::operator&= ( const RECT rect)
throw (
)
inline

Definition at line 507 of file atltypes.h.

508  {
509  IntersectRect(this, &rect);
510  }
& rect
Definition: startmenu.cpp:1413
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2)
Definition: atltypes.h:346

◆ operator+() [1/3]

CRect CRect::operator+ ( POINT  point) const
throw (
)
inline

Definition at line 465 of file atltypes.h.

466  {
467  CRect r(this);
468  r.OffsetRect(point);
469  return r;
470  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
POINTL point
Definition: edittest.c:50

◆ operator+() [2/3]

CRect CRect::operator+ ( LPCRECT  lpRect) const
throw (
)
inline

Definition at line 472 of file atltypes.h.

473  {
474  CRect r(this);
475  r.InflateRect(lpRect);
476  return r;
477  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator+() [3/3]

CRect CRect::operator+ ( SIZE  size) const
throw (
)
inline

Definition at line 479 of file atltypes.h.

480  {
481  CRect r(this);
482  r.OffsetRect(size);
483  return r;
484  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919

◆ operator+=() [1/3]

void CRect::operator+= ( POINT  point)
throw (
)
inline

Definition at line 434 of file atltypes.h.

435  {
436  OffsetRect(point);
437  }
POINTL point
Definition: edittest.c:50
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ operator+=() [2/3]

void CRect::operator+= ( SIZE  size)
throw (
)
inline

Definition at line 439 of file atltypes.h.

440  {
441  OffsetRect(size);
442  }
GLsizeiptr size
Definition: glext.h:5919
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ operator+=() [3/3]

void CRect::operator+= ( LPCRECT  lpRect)
throw (
)
inline

Definition at line 444 of file atltypes.h.

445  {
446  InflateRect(lpRect);
447  }
void InflateRect(int x, int y)
Definition: atltypes.h:323

◆ operator-() [1/3]

CRect CRect::operator- ( POINT  point) const
throw (
)
inline

Definition at line 486 of file atltypes.h.

487  {
488  CRect r(this);
489  r.OffsetRect(-point.x, -point.y);
490  return r;
491  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:315
LONG x
Definition: windef.h:314

◆ operator-() [2/3]

CRect CRect::operator- ( SIZE  size) const
throw (
)
inline

Definition at line 493 of file atltypes.h.

494  {
495  CRect r(this);
496  r.OffsetRect(-size.cx, -size.cy);
497  return r;
498  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919

◆ operator-() [3/3]

CRect CRect::operator- ( LPCRECT  lpRect) const
throw (
)
inline

Definition at line 500 of file atltypes.h.

501  {
502  CRect r(this);
503  r.DeflateRect(lpRect);
504  return r;
505  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator-=() [1/3]

void CRect::operator-= ( POINT  point)
throw (
)
inline

Definition at line 449 of file atltypes.h.

450  {
451  OffsetRect(-point.x, -point.y);
452  }
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:315
LONG x
Definition: windef.h:314
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ operator-=() [2/3]

void CRect::operator-= ( SIZE  size)
throw (
)
inline

Definition at line 454 of file atltypes.h.

455  {
456  OffsetRect(-size.cx, -size.cy);
457  }
GLsizeiptr size
Definition: glext.h:5919
void OffsetRect(int x, int y)
Definition: atltypes.h:368

◆ operator-=() [3/3]

void CRect::operator-= ( LPCRECT  lpRect)
throw (
)
inline

Definition at line 459 of file atltypes.h.

460  {
461  DeflateRect(lpRect);
462  }
void DeflateRect(int x, int y)
Definition: atltypes.h:289

◆ operator=()

void CRect::operator= ( const RECT srcRect)
throw (
)
inline

Definition at line 426 of file atltypes.h.

427  {
428  left = srcRect.left;
429  top = srcRect.top;
430  right = srcRect.right;
431  bottom = srcRect.bottom;
432  }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
LONG bottom
Definition: windef.h:294
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ operator==()

BOOL CRect::operator== ( const RECT rect) const
throw (
)
inline

Definition at line 413 of file atltypes.h.

414  {
415  return (left == rect.left &&
416  top == rect.top &&
417  right == rect.right &&
418  bottom == rect.bottom);
419  }
& rect
Definition: startmenu.cpp:1413
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

◆ operator|()

CRect CRect::operator| ( const RECT rect2) const
throw (
)
inline

Definition at line 524 of file atltypes.h.

525  {
526  CRect r;
527  r.UnionRect(this, &rect2);
528  return r;
529  }
RECT rect2
Definition: edittest.c:51
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator|=()

void CRect::operator|= ( const RECT rect)
throw (
)
inline

Definition at line 519 of file atltypes.h.

520  {
521  UnionRect(this, &rect);
522  }
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2)
Definition: atltypes.h:402
& rect
Definition: startmenu.cpp:1413

◆ PtInRect()

BOOL CRect::PtInRect ( POINT  point) const
throw (
)
inline

Definition at line 383 of file atltypes.h.

384  {
385  return ::PtInRect(this, point);
386  }
POINTL point
Definition: edittest.c:50
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)

◆ TopLeft() [1/2]

CPoint& CRect::TopLeft ( )
throw (
)
inline

Definition at line 392 of file atltypes.h.

393  {
394  return ((CPoint*)this)[0];
395  }

◆ TopLeft() [2/2]

const CPoint& CRect::TopLeft ( ) const
throw (
)
inline

Definition at line 397 of file atltypes.h.

398  {
399  return ((const CPoint*)this)[0];
400  }

◆ UnionRect()

BOOL CRect::UnionRect ( LPCRECT  lpRect1,
LPCRECT  lpRect2 
)
throw (
)
inline

Definition at line 402 of file atltypes.h.

403  {
404  return ::UnionRect(this, lpRect1, lpRect2);
405  }
BOOL WINAPI UnionRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by operator|=().

◆ Width()

int CRect::Width ( ) const
throw (
)
inline

Definition at line 407 of file atltypes.h.

408  {
409  return right - left;
410  }
LONG left
Definition: windef.h:291
GLdouble GLdouble right
Definition: glext.h:10859

Referenced by CenterPoint(), and UpdateScrollbox().


The documentation for this class was generated from the following file: