ReactOS  0.4.13-dev-464-g6b95727
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 ()
 
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:404
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 509 of file atltypes.h.

510  {
511  CRect r;
512  r.IntersectRect(this, &rect2);
513  return r;
514  }
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 533 of file atltypes.h.

534  {
535  return this;
536  }

◆ operator LPRECT()

CRect::operator LPRECT ( )
throw (
)
inline

Definition at line 528 of file atltypes.h.

529  {
530  return this;
531  }

◆ operator!=()

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

Definition at line 418 of file atltypes.h.

419  {
420  return !(*this == rect);
421  }
& rect
Definition: startmenu.cpp:1413

◆ operator&=()

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

Definition at line 504 of file atltypes.h.

505  {
506  IntersectRect(this, &rect);
507  }
& 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 462 of file atltypes.h.

463  {
464  CRect r(this);
465  r.OffsetRect(point);
466  return r;
467  }
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 469 of file atltypes.h.

470  {
471  CRect r(this);
472  r.InflateRect(lpRect);
473  return r;
474  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator+() [3/3]

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

Definition at line 476 of file atltypes.h.

477  {
478  CRect r(this);
479  r.OffsetRect(size);
480  return r;
481  }
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 431 of file atltypes.h.

432  {
433  OffsetRect(point);
434  }
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 436 of file atltypes.h.

437  {
438  OffsetRect(size);
439  }
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 441 of file atltypes.h.

442  {
443  InflateRect(lpRect);
444  }
void InflateRect(int x, int y)
Definition: atltypes.h:323

◆ operator-() [1/3]

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

Definition at line 483 of file atltypes.h.

484  {
485  CRect r(this);
486  r.OffsetRect(-point.x, -point.y);
487  return r;
488  }
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 490 of file atltypes.h.

491  {
492  CRect r(this);
493  r.OffsetRect(-size.cx, -size.cy);
494  return r;
495  }
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 497 of file atltypes.h.

498  {
499  CRect r(this);
500  r.DeflateRect(lpRect);
501  return r;
502  }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ operator-=() [1/3]

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

Definition at line 446 of file atltypes.h.

447  {
448  OffsetRect(-point.x, -point.y);
449  }
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 451 of file atltypes.h.

452  {
453  OffsetRect(-size.cx, -size.cy);
454  }
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 456 of file atltypes.h.

457  {
458  DeflateRect(lpRect);
459  }
void DeflateRect(int x, int y)
Definition: atltypes.h:289

◆ operator=()

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

Definition at line 423 of file atltypes.h.

424  {
425  left = srcRect.left;
426  top = srcRect.top;
427  right = srcRect.right;
428  bottom = srcRect.bottom;
429  }
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 410 of file atltypes.h.

411  {
412  return (left == rect.left &&
413  top == rect.top &&
414  right == rect.right &&
415  bottom == rect.bottom);
416  }
& 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 521 of file atltypes.h.

522  {
523  CRect r;
524  r.UnionRect(this, &rect2);
525  return r;
526  }
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 516 of file atltypes.h.

517  {
518  UnionRect(this, &rect);
519  }
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2)
Definition: atltypes.h:399
& rect
Definition: startmenu.cpp:1413

◆ TopLeft() [1/2]

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

Definition at line 389 of file atltypes.h.

390  {
391  return ((CPoint*)this)[0];
392  }

◆ TopLeft() [2/2]

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

Definition at line 394 of file atltypes.h.

395  {
396  return ((const CPoint*)this)[0];
397  }

◆ UnionRect()

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

Definition at line 399 of file atltypes.h.

400  {
401  return ::UnionRect(this, lpRect1, lpRect2);
402  }
BOOL WINAPI UnionRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by operator|=().

◆ Width()

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

Definition at line 404 of file atltypes.h.

405  {
406  return right - left;
407  }
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: