icolorman.h

Go to the documentation of this file.
00001  /**********************************************************************
00002  *<
00003     FILE: iColorMan.h
00004 
00005     DESCRIPTION: Color Manager
00006 
00007     CREATED BY: Scott Morrison
00008 
00009     HISTORY: Created 19 April, 2000,
00010 
00011  *> Copyright (c) 2000, All Rights Reserved.
00012  **********************************************************************/
00013 #pragma once
00014 
00015 #ifdef CUSTDLG_IMP
00016 #define CustDlgExport __declspec(dllexport)
00017 #else
00018 #define CustDlgExport __declspec(dllimport)
00019 #endif
00020 
00021 #include "iFnPub.h"
00022 
00023 typedef DWORD ColorId;
00024 
00030 const ColorId kBackground    = 0;  
00031 const ColorId kText          = 1;  
00032 const ColorId kActiveCommand = 4;  
00033 const ColorId kHilight       = 5;  
00034 const ColorId kShadow        = 6;  
00035 const ColorId kWindow        = 7;  
00036 const ColorId kActiveCaption = 8;  
00037 const ColorId kToolTipBackground = 9; 
00038 const ColorId kToolTipText   = 10; 
00039 const ColorId kHilightText   = 11; 
00040 const ColorId kWindowText    = 12; 
00041 const ColorId kItemHilight   = 13; 
00042 const ColorId kSubObjectColor= 14; 
00043 const ColorId k3dDarkShadow  = 15; 
00044 const ColorId k3dLight       = 16; 
00045 const ColorId kAppWorkspace  = 17; 
00046 const ColorId kTrackbarBg    = 18; 
00047 const ColorId kTrackbarBgSel = 19; 
00048 const ColorId kTrackbarText  = 20; 
00049 const ColorId kTrackbarTicks = 21; 
00050 const ColorId kTrackbarKeys  = 22; 
00051 const ColorId kTrackbarSelKeys = 23; 
00052 const ColorId kTrackbarCursor  = 24; 
00053 const ColorId kPressedButton   = 25; 
00054 const ColorId kTimeSliderBg    = 26; 
00055 const ColorId kViewportBorder  = 27; 
00056 const ColorId kActiveViewportBorder = 28; 
00057 const ColorId kRollupTitleFace      = 29; 
00058 const ColorId kRollupTitleText      = 30; 
00059 const ColorId kRollupTitleHilight   = 31; 
00060 const ColorId kRollupTitleShadow    = 32; 
00061 const ColorId kSelectionRubberBand  = 33; 
00062 const ColorId kStackViewSelection = 34; 
00063 const ColorId kImageViewerBackground = 35; 
00064 const ColorId kIRenderProgressHoriz = 36; 
00065 const ColorId kIRenderProgressVert  = 37; 
00066 const ColorId kPressedHierarchyButton  = 38; 
00067 const ColorId kTrackViewBackground  = 39; 
00068 const ColorId kTrackViewInactiveBackground  = 40; 
00069 const ColorId kManipulatorsActive  = 41; 
00070 const ColorId kManipulatorsSelected  = 42; 
00071 const ColorId kManipulatorsInactive  = 43; 
00072 const ColorId kFunctionCurveX = 44; 
00073 const ColorId kFunctionCurveY = 45; 
00074 const ColorId kFunctionCurveZ = 46; 
00075 const ColorId kFunctionCurveW = 47;  
00076 const ColorId kFunctionCurveFloat = 48;  
00077 const ColorId kFunctionCurveSelected = 49;  
00078 const ColorId kTrackViewTrackText = 50; 
00079 const ColorId kTrackViewSelInstantTime = 51; 
00080 const ColorId kTrackViewKeyCursor = 52; 
00081 const ColorId kTrackViewSelectedBackground = 53; 
00082 const ColorId kTrackViewDisabledTrack1 = 54; 
00083 const ColorId kTrackViewDisabledTrack2 = 55; 
00084 const ColorId kTrackViewEnabledTrack1 = 56; 
00085 const ColorId kTrackViewEnabledTrack2 = 57; 
00086 const ColorId kTrackViewTimeCursor = 58; 
00087 const ColorId kTrackViewGrid = 59; 
00088 const ColorId kTrackViewUnSelectedKeys = 60; 
00089 const ColorId kTrackViewSelectedKeys = 61; 
00090 const ColorId kTrackViewKeyOutline = 62; 
00091 const ColorId kTrackViewKeyOutlineOnTop = 63; 
00092 const ColorId kViewportShowDependencies = 64; 
00093 const ColorId kTrackViewSoundTrackRight = 65; 
00094 const ColorId kTrackViewSoundTrackLeft = 66; 
00095 const ColorId kAssemblyOutline  = 67; 
00096 const ColorId kTrackViewKeyPosition = 68; 
00097 const ColorId kTrackViewKeyRotation = 69; 
00098 const ColorId kTrackViewKeyScale = 70; 
00099 const ColorId kTrackViewKeyTransform = 71; 
00100 const ColorId kTrackViewKeyObject = 72; 
00101 const ColorId kTrackViewKeyMaterial = 73; 
00102 const ColorId kTrackViewTangentHandle = 74; 
00103 const ColorId kTrackViewAutoTangentHandle = 75; 
00104 const ColorId kTrackViewKeyMixed = 76; 
00105 const ColorId kTrackViewKeyFake = 77; 
00106 
00107 const ColorId kTrackbarKeyPosition  = 79; 
00108 const ColorId kTrackbarKeyRotation  = 80; 
00109 const ColorId kTrackbarKeyScale = 81; 
00110 const ColorId kTrackbarKeyTransform = 82; 
00111 const ColorId kTrackbarKeyObject = 83; 
00112 const ColorId kTrackbarKeyMaterial = 84; 
00113 const ColorId kTrackbarKeyMixed = 85; 
00114 const ColorId kTrackViewScaleOriginLine = 86; 
00115 const ColorId kTrackViewKeyFCurveSelected = 87; 
00116 const ColorId kTrackViewKeyFCurveUnSelected = 88; 
00117 
00118 const ColorId kOutOfRangeLow = 89; 
00119 const ColorId kOutOfRangeHigh = 90; 
00120 
00121 const ColorId kTrackViewRangeIgnored = 91; 
00122 const ColorId kTrackViewRangeIgnoredSel = 92; 
00123 
00124 const ColorId kAdaptiveDegActive = 93; 
00125 
00126 const ColorId kTrackViewControllerWindowToggle  = 94; 
00127 const ColorId kTrackViewRegionSelectBorder  = 95; 
00128 const ColorId kTrackViewRegionSelectGrip  = 96; 
00129 const ColorId kTrackViewRegionSelectRegion = 97; 
00130 const ColorId kTrackViewRegionSelectOuterRegion = 98; 
00131 
00133 
00134 #define COLOR_MGR_INTERFACE  Interface_ID(0x1bf46c90, 0x18bf6199)
00135 
00158 class IColorManager: public FPStaticInterface {
00159 
00160 public:
00161 
00162     enum ColorSchemeType
00163     {
00165         CST_CUSTOM = 0,
00167         CST_STANDARDWINDOWS,
00169         CST_WINDOWSTHEME
00170     };
00171 
00172     enum AppFrameColorTheme {
00174         kDarkTheme  = 0,
00176         kLightTheme = 1
00177     };
00178 
00183     virtual ColorSchemeType GetColorSchemeType() = 0;
00184 
00192     virtual void SetColorSchemeType(ColorSchemeType type) = 0;
00193 
00194     // Register a new color with the system.
00195     // Return false if the color is already registered.
00218     virtual bool RegisterColor(ColorId id, const MCHAR* pName, const MCHAR* pCategory, COLORREF defaultValue) = 0;
00219 
00226     virtual BOOL LoadColorFile(const MCHAR* pFileName) = 0;
00233     virtual BOOL SaveColorFile(const MCHAR* pFileName) = 0;
00236     virtual const MCHAR* GetColorFile() = 0;
00237 
00238     // Access to the customized colors
00248     virtual bool     SetColor(ColorId id, COLORREF color) = 0;
00255     virtual COLORREF GetColor(ColorId id) = 0;
00261     virtual Point3   GetColorAsPoint3(ColorId id) = 0;
00269     virtual HBRUSH   GetBrush(ColorId id) = 0;
00274     virtual const MCHAR*   GetName(ColorId id) = 0;
00279     virtual const MCHAR*   GetCategory(ColorId id) = 0;
00280 
00281 
00295     virtual COLORREF CustSysColor(int which) = 0;
00308     virtual HBRUSH   CustSysColorBrush(int which) = 0;
00309 
00310     // Interface for old "GetUIColor" call from gfx.
00311     // The colors are defined in gfx.h
00318     virtual Point3 GetOldUIColor(int which) = 0;
00326     virtual void   SetOldUIColor(int which, Point3 *clr) = 0;
00334     virtual Point3 GetOldDefaultUIColor(int which) = 0;
00335 
00336     // Icon Image processing
00337     // The following values are used to do image processing on the icons
00338     // at start-up time.
00339     enum IconType {
00340         kDisabledIcon,
00341         kEnabledIcon
00342     };
00343 
00344     enum IconColorScale {
00345         kSaturationScale,
00346         kValueScale,
00347         kAlphaScale,
00348         kContrastScale,
00349         kGradientMapScale
00350     };
00351 
00374     virtual float GetIconColorScale(IconType type, IconColorScale which) = 0;
00396     virtual void  SetIconColorScale(IconType type, IconColorScale which, float value) = 0;
00397 
00407     virtual bool GetIconColorInvert(IconType type) = 0;
00419     virtual void SetIconColorInvert(IconType type, bool value) = 0;
00420 
00423     virtual AppFrameColorTheme GetAppFrameColorTheme() const = 0;
00429     virtual void SetAppFrameColorTheme(AppFrameColorTheme value) = 0;
00430 
00432     virtual const MCHAR* GetFileName() = 0;
00433 
00442     virtual COLORREF GetDefaultColor(ColorId id) = 0;
00443 
00444     // Get an old UI color as a COLORREF
00455     virtual COLORREF GetOldUIColorCOLORREF(int which) = 0;
00456 
00457     enum RepaintType {
00458         kRepaintAll,
00459         kRepaintTrackBar,
00460         kRepaintTimeBar,
00461     };
00462 
00469     virtual void RepaintUI(RepaintType type) = 0;
00470 
00471     // Set the folder that is searched for UI icon files.
00472     // This must be a folder that lives under the "UI" folder.
00483     virtual BOOL SetIconFolder(const MCHAR* pFolder) = 0;
00484 
00485     // returns the full path to the icon folder.
00486     virtual const MCHAR* GetIconFolder() = 0;
00487 
00488     // reinitializes the display icons using the UI icon files.
00489     virtual void ReInitIcons() = 0;
00490 
00491     // given an icon file name (no path), locate the icon file in the various
00492     // icon folders and return the fully resolved file name with path. If file
00493     // is found return TRUE and fill in path, otherwise return FALSE;
00494     virtual BOOL ResolveIconFolder(const MCHAR* pFilename, MSTR &path) = 0;
00495 
00496 #ifdef USE_NEW_CUI_IO_METHODS // russom - 02/16/02
00497     // save and load icon folder file
00498     virtual BOOL SaveIconFile( const MCHAR *szFilename, const MCHAR *szIconPath ) = 0;
00499     virtual BOOL LoadIconFile( const MCHAR *szFilename ) = 0;
00500     virtual const MCHAR* ReadIconFile() = 0;
00501 #endif
00502 
00503     //Function-published interface
00504     enum {
00505 #ifndef NO_CUI  // russom - 02/12/02
00506         registerColor,
00507         loadColorFile,
00508         saveColorFile,
00509         getColorFile,
00510         setColor,
00511 #endif // NO_CUI
00512         getColor,
00513         getName,
00514         getCategory,
00515         getIconColorScale,
00516 #ifndef NO_CUI  // russom - 02/20/02
00517         setIconColorScale,
00518 #endif
00519         getIconColorInvert,
00520 #ifndef NO_CUI  // russom - 02/20/02
00521         setIconColorInvert,
00522 #endif
00523         getFileName,
00524         getDefaultColor,
00525         getOldUIColorCOLORREF,
00526         repaintUI,
00527 #ifndef NO_CUI  // russom - 02/20/02
00528         setIconFolder,
00529         reInitIcons,
00530 #endif
00531         getIconFolder,
00532 #ifdef USE_NEW_CUI_IO_METHODS
00533         saveIconFile,
00534  #ifndef NO_CUI // russom - 02/25/02
00535         loadIconFile,
00536         readIconFile,
00537  #endif // NO_CUI
00538 #endif // USE_NEW_CUI_IO_METHODS
00539         resolveIconFolder,
00540         getColorSchemeType,
00541         setColorSchemeType
00542     };
00543 
00544     // Function-published enums
00545     enum {
00546         iconType,
00547         iconColorScale,
00548         repaintType,
00549         colorSchemeType,
00550     };
00551 };
00552 
00553 // defined in CustomizationDialgos/CustColorDlg.cpp
00554 CustDlgExport void SaveColors();
00555 
00556 #ifdef CoreExport
00557 CoreExport void DeleteColorManager(IColorManager* pColorMan);
00558 
00565 CoreExport IColorManager* GetColorManager();
00566 #endif
00567 
00568 // Easy access macros for the system's color manager
00569 #define ColorMan() (GetColorManager())
00570 #define GetCustSysColor(which) (ColorMan()->CustSysColor(which))
00571 #define GetCustSysColorBrush(which) (ColorMan()->CustSysColorBrush(which))
00572 
00573 
00574