home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ICOLOR_
- #define _ICOLOR_
- /*******************************************************************************
- * FILE NAME: icolor.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IColor - color class *
- * IDeviceColor - color class *
- * IGUIColor - color class *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/ICOLOR.HPV $ *
- //
- // Rev 1.3 25 Oct 1992 17:59:42 nunn
- // Brad Broyles changes for external beta
-
- Rev 1.1 05 Sep 1992 12:00:00 KKL
- Move from IWindow; support device and GUI system color
- Rev 1.2 22 Oct 1992 12:00:00 WBB
- Amend to match skeleton.hpp
- *******************************************************************************/
- #ifndef _IBASE_
- #include <ibase.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IColor;
- class IColorIndex;
- class IGUIColor;
-
- class IColor : public IBase {
- /*******************************************************************************
- * The IColor class deals with red, green, and blue standard color indices. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 2 ways to construct instances of this class: |
- | 1. default (protected) |
- | red, green, and blue components are all set to zero |
- | 2. from a Color value |
- | a specified Color-type value is used to set the RGB components |
- | 3. from separate red, green, and blue values |
- | the separate component values are stored |
- ------------------------------------------------------------------------------*/
- enum Color {white, black, blue, red, pink, green,
- cyan, yellow, darkGray, darkBlue,
- darkRed, darkPink, darkGreen, darkCyan,
- brown, paleGray };
- IColor(Color value);
- IColor(unsigned char red, unsigned char green,
- unsigned char blue);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | redMix - return the value of the red component |
- | greenMix - return the value of the green component |
- | blueMix - return the value of the blue component |
- | asRGBLong - return the RGB color value as a long |
- | index - return the color index of the device color closest to the RGB |
- | color representation |
- | value - determine the Color-type value given a color index |
- ------------------------------------------------------------------------------*/
- unsigned char
- redMix() const,
- greenMix() const,
- blueMix() const;
- long
- asRGBLong() const;
- virtual long
- index() const;
- IColor::Color
- value() const;
-
- protected:
- /*----------------------------- IMPLEMENTATION ---------------------------------
- | IColor - protected default constructor |
- | ucClRed - red component of IColor |
- | ucClGreen - green component of IColor |
- | ucClBlue - blue component of IColor |
- ------------------------------------------------------------------------------*/
- IColor();
- unsigned char
- ucClRed,
- ucClGreen,
- ucClBlue;
- }; // IColor
-
- class IDeviceColor : public IColor {
- /*******************************************************************************
- * The IDeviceColor class deals with device-independent color indices. *
- *******************************************************************************/
- typedef IColor inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from a DeviceColor value |
- | the internal device color is set from the DeviceColor provided |
- ------------------------------------------------------------------------------*/
- enum DeviceColor { defaultColor, background, neutral };
- IDeviceColor(DeviceColor);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | index - return the index value of DeviceColor |
- ------------------------------------------------------------------------------*/
- virtual long
- index() const;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- long
- lClDeviceColor;
- }; // IDeviceColor
-
- class IGUIColor : public IColor {
- /*******************************************************************************
- * The IGUIColor class with SYSCLR_* values *
- *******************************************************************************/
- typedef IColor inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from a SysColor value |
- | the internal system color value is set from the SysColor provided |
- ------------------------------------------------------------------------------*/
- enum SysColor {shadowIconHiliteBgnd, shadowIconHiliteFgnd,
- shadowIconText,
- entryFieldBgnd, listBoxBgnd,
- disableMenuText, menuHiliteText,
- menuHiliteBgnd, notebookPageBgnd,
- inactiveScrollBar, defaultControl,
- buttonLight, buttonMiddle,
- buttonDark, defaultButton,
- titleLine,
- menuShadow, dialogShadow,
- iconText,
- dialogBgnd, hiliteFgnd,
- hiliteBgnd, inactiveTitleTextBgnd,
- activeTitleTextBgnd, inactiveTitleText,
- activeTitleText, outputText, windowStaticText,
- scrollBar, desktopBgnd, activeTitleBgnd,
- inactiveTitleBgnd, menuBgnd, windowBgnd,
- frameBorder, menuText, windowText,
- titleText, sizeBar, scrollArrow,
- activeFrameBorder, inactiveFrameBorder,
- mainWindowBgnd, helpWindowBgnd,
- helpText, helpHiliteText };
- IGUIColor(SysColor value);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | setColor - change a system color (will not reset to default) |
- | index - return the sysColor long value |
- ------------------------------------------------------------------------------*/
- void
- setColor(const IColor& newColor);
- virtual long
- index() const;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- static long
- index(IGUIColor::SysColor cValue);
- long
- lClSysColor;
- }; // IGUIColor
-
- /*--------------------------------- INLINES ----------------------------------*/
- #ifndef I_NO_INLINES
- #include <icolor.inl>
- #endif
-
- #endif /* _ICOLOR_ */