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

  1. #ifndef _ICOLOR_INL_
  2. #define _ICOLOR_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: icolor.inl                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   classes declared in icolor.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 _ICOLOR_
  19.   #undef  _ICOLOR_INL_
  20.   #define _ICOLOR_INL_ 1
  21.   #include <icolor.hpp>
  22. #endif
  23.  
  24. #if _ICOLOR_INL_
  25.   #define inline
  26. #endif
  27.  
  28. inline unsigned char IColor::redMix ( ) const
  29. {
  30.   ((IColor*)this)->checkSysRGBValue();
  31.   return ucClRed;
  32. }
  33.  
  34. inline unsigned char IColor::blueMix ( ) const
  35. {
  36.   ((IColor*)this)->checkSysRGBValue();
  37.   return ucClBlue;
  38. }
  39.  
  40. inline unsigned char IColor::greenMix ( ) const
  41. {
  42.   ((IColor*)this)->checkSysRGBValue();
  43.   return ucClGreen;
  44. }
  45.  
  46. inline IBase::Boolean IColor::operator== ( const IColor& color ) const
  47. {
  48.   ((IColor*)this)->checkSysRGBValue();
  49.   if ((ucClRed   == color.ucClRed  ) &&
  50.       (ucClGreen == color.ucClGreen) &&
  51.       (ucClBlue  == color.ucClBlue ))
  52.      return true;
  53.   else
  54.      return false;
  55. }
  56.  
  57. inline IBase::Boolean IColor::operator != ( const IColor& color ) const
  58. {
  59.   return !(*this == color);
  60. }
  61.  
  62. inline IColor& IColor::setRed ( unsigned char redMix )
  63. {
  64.   ucClRed = redMix;
  65.   bClColor = false;
  66.   return *this;
  67. }
  68.  
  69. inline IColor& IColor::setGreen ( unsigned char greenMix )
  70. {
  71.   ucClGreen = greenMix;
  72.   bClColor = false;
  73.   return *this;
  74. }
  75.  
  76. inline IColor& IColor::setBlue ( unsigned char blueMix )
  77. {
  78.   ucClBlue = blueMix;
  79.   bClColor = false;
  80.   return *this;
  81. }
  82.  
  83. inline IDeviceColor::DeviceColor IDeviceColor::deviceColor ( ) const
  84. {
  85.   return dcClDeviceColor;
  86. }
  87.  
  88. inline IColor::SystemColor IGUIColor::systemColor ( ) const
  89. {
  90.   return Inherited::systemColor();
  91. }
  92.  
  93. #endif // _ICOLOR_INL_
  94.