home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WPOINT.INL < prev    next >
Text File  |  1996-06-06  |  3KB  |  84 lines

  1. //
  2. // wpoint.inl -- Inline definitions for WPoint
  3. //
  4.  
  5. #ifdef WCMINLINE
  6.  
  7. WCMINLINE WPoint::WPoint( const POINT & o )
  8. /*****************************************/
  9. { x = o.x; y = o.y; }
  10.  
  11. WCMINLINE WPoint::WPoint( const POINTL & o )
  12. /******************************************/
  13. { x = (WInt)o.x; y = (WInt)o.y; }
  14.  
  15. WCMINLINE WPoint::WPoint( const POINTS & o )
  16. /******************************************/
  17. { x = o.x; y = o.y; }
  18.  
  19. WCMINLINE POINTL WPoint::GetPOINTL() const 
  20. /*****************************************/
  21. { POINTL p; p.x = x; p.y = y; return p; }
  22.  
  23. WCMINLINE void WPoint::SetPOINTL( const POINTL & p ) 
  24. /****************************************************/
  25. { x = (WInt)p.x; y = (WInt)p.y; }
  26.  
  27. WCMINLINE void WPoint::Create( const POINT & o ) 
  28. /***********************************************/
  29. { x = o.x; y = o.y; }
  30.  
  31. WCMINLINE void WPoint::Create( const POINTL & o ) 
  32. /************************************************/
  33. { x = (WInt)o.x; y = (WInt)o.y; }
  34.  
  35. WCMINLINE void WPoint::Create( const POINTS & o ) 
  36. /************************************************/
  37. { x = o.x; y = o.y; }
  38.  
  39. void WPoint::Offset( WInt nx, WInt ny ) 
  40. /*************************************/
  41. { x += nx; y += ny; }
  42.  
  43. void WPoint::Offset( const WPoint & pt ) 
  44. /***************************************/
  45. { x += pt.x; y += pt.y; }
  46.  
  47. WPoint WPoint::operator+( const WPoint & o )
  48. /******************************************/
  49. { WPoint pt( *this ); pt.x += o.x; pt.y += o.y; return pt; }
  50.  
  51. WPoint WPoint::operator-( const WPoint & o )
  52. /******************************************/
  53. { WPoint pt( *this ); pt.x -= o.x; pt.y -= o.y; return pt; }
  54.  
  55. WPoint & WPoint::operator+=( const WPoint & o )
  56. /*********************************************/
  57. { x += o.x; y += o.y; return *this; }
  58.  
  59. WPoint & WPoint::operator-=( const WPoint & o )
  60. /*********************************************/
  61. { x -= o.x; y -= o.y; return *this; }
  62.     
  63. WPoint & WPoint::operator=( const POINT & o )
  64. /*******************************************/
  65. { x = o.x; y = o.y; return *this; }
  66.  
  67. WPoint & WPoint::operator=( const POINTL & o )
  68. /********************************************/
  69. { x = (WInt)o.x; y = (WInt)o.y; return *this; }
  70.  
  71. WPoint & WPoint::operator=( const POINTS & o )
  72. /********************************************/
  73. { x = o.x; y = o.y; return *this; }
  74.             
  75. int WPoint::operator==( const WPoint & o ) const
  76. /**********************************************/
  77. { return ( x == o.x && y == o.y ); }
  78.  
  79. int WPoint::operator!=( const WPoint & o ) const
  80. { return ( x != o.x || y != o.y ); }
  81.  
  82. #endif
  83.  
  84.