home *** CD-ROM | disk | FTP | other *** search
- //
- // wrect.inl -- Inline definitions for WRect
- //
-
- #ifdef WCMINLINE
-
- WCMINLINE WRect::WRect( const RECT & o )
- /***************************************/
- {
- x = o.left;
- y = o.top;
- w = o.right - o.left;
- h = o.bottom - o.top;
- }
-
- WCMINLINE WRect::WRect( const RECTL & o )
- /****************************************/
- {
- x = (WInt)o.left;
- y = (WInt)o.top;
- w = (WInt)o.right - (WInt)o.left;
- h = (WInt)o.bottom - (WInt)o.top;
- }
-
- WCMINLINE WBool WRect::Contains( const WPoint & point ) const
- /***********************************************************/
- {
- return( ( point.x >= x && point.x <= x + w &&
- point.y >= y && point.y <= y + h ) );
- }
-
- WCMINLINE WBool WRect::Inflate( const WSize & s )
- /***********************************************/
- {
- w += s.w; h += s.h;
- return TRUE;
- }
-
- WCMINLINE RECTL WRect::GetRECTL() const
- /**************************************/
- {
- RECTL r; r.left = x; r.top = y;
- r.right = x + w; r.bottom = y + h; return r;
- }
-
- WCMINLINE void WRect::SetRECTL( const RECTL & r )
- /*************************************************/
- {
- x = (WInt)r.left; y = (WInt)r.top;
- w = (WInt)r.right - (WInt)r.left;
- h = (WInt)r.bottom - (WInt)r.top;
- }
-
- WCMINLINE void WRect::Create( const RECT & o )
- /*********************************************/
- { x = o.left; y = o.top; w = o.right - o.left;
- h = o.bottom - o.top; }
-
- WCMINLINE void WRect::Create( const RECTL & o )
- /**********************************************/
- { x = (WInt)o.left; y = (WInt)o.top; w = (WInt)o.right - (WInt)o.left;
- h = (WInt)o.bottom - (WInt)o.top; }
-
- WCMINLINE void WRect::Translate( const WPoint & pt )
- /**************************************************/
- { x += pt.x; y += pt.y; }
-
- WCMINLINE int WRect::operator==( const WRect & o ) const
- /******************************************************/
- { return ( x == o.x && y == o.y && w == o.w && h == o.h ); }
-
- WCMINLINE int WRect::operator!=( const WRect & o ) const
- /******************************************************/
- { return ( x != o.x || y != o.y || w != o.w || h != o.h ); }
-
- WCMINLINE WRect & WRect::operator=( const RECT & o )
- /**************************************************/
- { x = o.left; y = o.top; w = o.right - o.left;
- h = o.bottom - o.top; return *this; }
-
- WCMINLINE WRect & WRect::operator=( const RECTL & o )
- /***************************************************/
- { x = (WInt)o.left; y = (WInt)o.top; w = (WInt)o.right - (WInt)o.left;
- h = (WInt)o.bottom - (WInt)o.top; return *this; }
-
- #endif
-