00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_COOLINTERFACE_H__B7C102E2_0267_4F3B_B9C2_BA1031758891__INCLUDED_)
00023 #define AFX_COOLINTERFACE_H__B7C102E2_0267_4F3B_B9C2_BA1031758891__INCLUDED_
00024
00025 #pragma once
00026
00027
00028 class CCoolInterface
00029 {
00030
00031 public:
00032 CCoolInterface();
00033 virtual ~CCoolInterface();
00034
00035
00036 public:
00037 CMapStringToPtr m_pNameMap;
00038 CMapPtrToPtr m_pImageMap;
00039 CImageList m_pImages;
00040 public:
00041 CFont m_fntNormal;
00042 CFont m_fntBold;
00043 CFont m_fntUnder;
00044 CFont m_fntCaption;
00045 CFont m_fntItalic;
00046 CFont m_fntBoldItalic;
00047 public:
00048 BOOL m_bCustom;
00049 COLORREF m_crWindow;
00050 COLORREF m_crMidtone;
00051 COLORREF m_crHighlight;
00052 COLORREF m_crText;
00053 COLORREF m_crHiText;
00054 COLORREF m_crBackNormal;
00055 COLORREF m_crBackSel;
00056 COLORREF m_crBackCheck;
00057 COLORREF m_crBackCheckSel;
00058 COLORREF m_crMargin;
00059 COLORREF m_crBorder;
00060 COLORREF m_crShadow;
00061 COLORREF m_crCmdText;
00062 COLORREF m_crCmdTextSel;
00063 COLORREF m_crDisabled;
00064 COLORREF m_crTipBack;
00065 COLORREF m_crTipText;
00066 COLORREF m_crTipBorder;
00067 COLORREF m_crTipWarnings;
00068 COLORREF m_crTaskPanelBack;
00069 COLORREF m_crTaskBoxCaptionBack;
00070 COLORREF m_crTaskBoxPrimaryBack;
00071 COLORREF m_crTaskBoxCaptionText;
00072 COLORREF m_crTaskBoxPrimaryText;
00073 COLORREF m_crTaskBoxCaptionHover;
00074 COLORREF m_crTaskBoxClient;
00075 protected:
00076 CSize m_czBuffer;
00077 CDC m_dcBuffer;
00078 CBitmap m_bmBuffer;
00079 HBITMAP m_bmOldBuffer;
00080
00081
00082 public:
00083 void Clear();
00084 public:
00085 void NameCommand(UINT nID, LPCTSTR pszName);
00086 UINT NameToID(LPCTSTR pszName);
00087 public:
00088 int ImageForID(UINT nID);
00089 void AddIcon(UINT nID, HICON hIcon);
00090 void CopyIcon(UINT nFromID, UINT nToID);
00091 HICON ExtractIcon(UINT nID);
00092 BOOL AddImagesFromToolbar(UINT nIDToolBar, COLORREF crBack = RGB(0,255,0));
00093 BOOL ConfirmImageList();
00094 public:
00095 CDC* GetBuffer(CDC& dcScreen, CSize& szItem);
00096 BOOL DrawWatermark(CDC* pDC, CRect* pRect, CBitmap* pMark, int nOffX = 0, int nOffY = 0);
00097 public:
00098 void CreateFonts(LPCTSTR pszFace = NULL, int nSize = 0);
00099 void CalculateColours(BOOL bCustom = FALSE);
00100 void OnSysColourChange();
00101 public:
00102 static COLORREF CalculateColour(COLORREF crFore, COLORREF crBack, int nAlpha);
00103 static COLORREF GetDialogBkColor();
00104 static BOOL IsNewWindows();
00105 static BOOL EnableTheme(CWnd* pWnd, BOOL bEnable = TRUE);
00106
00107 };
00108
00109 extern CCoolInterface CoolInterface;
00110
00111 typedef struct
00112 {
00113 WORD wVersion;
00114 WORD wWidth;
00115 WORD wHeight;
00116 WORD wItemCount;
00117 WORD* items() { return (WORD*)(this+1); }
00118 } TOOLBAR_RES;
00119
00120 #endif // !defined(AFX_COOLINTERFACE_H__B7C102E2_0267_4F3B_B9C2_BA1031758891__INCLUDED_)