home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iswp.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  4.2 KB  |  131 lines

  1. #ifndef _ISWP_INL_
  2. #define _ISWP_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: iswp.inl                                                          *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   classes declared in iswp.hpp.                                              *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #ifndef _ISWP_
  19.   #undef  _ISWP_INL_
  20.   #define _ISWP_INL_ 1
  21.   #include <iswp.hpp>
  22. #endif
  23.  
  24. #include <ipoint.hpp>
  25.  
  26. #if _ISWP_INL_
  27.   #define inline
  28. #endif
  29.  
  30. /*------------------------------------------------------------------------------
  31. | ISWP::ISWP                                                                   |
  32. ------------------------------------------------------------------------------*/
  33. inline ISWP::ISWP ( )
  34.   : fl          ( 0 ),
  35.     cy          ( 0 ),
  36.     cx          ( 0 ),
  37.     y           ( 0 ),
  38.     x           ( 0 ),
  39.     behind      ( 0 ),
  40.     hwnd        ( 0 )
  41. { }
  42.  
  43. /*------------------------------------------------------------------------------
  44. | ISWP::ISWP                                                                   |
  45. ------------------------------------------------------------------------------*/
  46. inline ISWP::ISWP ( const ISWP& original )
  47.   : fl          ( original.fl     ),
  48.     cy          ( original.cy     ),
  49.     cx          ( original.cx     ),
  50.     y           ( original.y      ),
  51.     x           ( original.x      ),
  52.     behind      ( original.behind ),
  53.     hwnd        ( original.hwnd   )
  54. { }
  55.  
  56. /*------------------------------------------------------------------------------
  57. | ISWP::~ISWP                                                                  |
  58. ------------------------------------------------------------------------------*/
  59. inline ISWP::~ISWP ( )
  60. { }
  61.  
  62. /*------------------------------------------------------------------------------
  63. | ISWP::operator=                                                              |
  64. ------------------------------------------------------------------------------*/
  65. inline ISWP& ISWP::operator= ( const ISWP& original )
  66. {
  67.    if (this != &original)
  68.       {
  69.       fl          = original.fl     ;
  70.       cy          = original.cy     ;
  71.       cx          = original.cx     ;
  72.       y           = original.y      ;
  73.       x           = original.x      ;
  74.       behind      = original.behind ;
  75.       hwnd        = original.hwnd   ;
  76.       }
  77.    return *this;
  78. }
  79.  
  80. inline IWindowHandle ISWP::windowHandle ( ) const
  81.   {
  82.   return this->hwnd;
  83.   }
  84.  
  85. inline IPoint ISWP::position ( ) const
  86.   {
  87.   return IPoint( this->x, this->y );
  88.   }
  89.  
  90. inline ISWP& ISWP::setPosition ( const IPoint& point )
  91.   {
  92.   this->x = point.x();
  93.   this->y = point.y();
  94.   return *this;
  95.   }
  96.  
  97. inline ISize ISWP::size ( ) const
  98.   {
  99.   return ISize( this->cx, this->cy );
  100.   }
  101.  
  102. inline ISWP& ISWP::setSize ( const ISize& size )
  103.   {
  104.   this->cx = size.width();
  105.   this->cy = size.height();
  106.   return *this;
  107.   }
  108.  
  109. inline ISWPArray::ISWPArray ( ISWP* array, unsigned dimension )
  110.   : p( array ),
  111.     dim( dimension )
  112.   {
  113.   }
  114.  
  115. inline unsigned long& ISWP::flags ( )
  116.   {
  117.   return this->fl;
  118.   }
  119.  
  120. inline unsigned ISWPArray::size ( ) const
  121.   {
  122.   return this->dim;
  123.   }
  124.  
  125. inline ISWP& ISWPArray::operator [] ( unsigned index )
  126.   {
  127.   return p[index];
  128.   }
  129.  
  130. #endif // _ISWP_INL_
  131.