Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
4.9 KiB

  1. /*****************************************************************************\
  2. FILE: PreviewTh.h
  3. DESCRIPTION:
  4. This code will display a preview of the currently selected
  5. visual styles.
  6. BryanSt 5/5/2000
  7. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  8. \*****************************************************************************/
  9. #ifndef _PREVIEWTHEME_H
  10. #define _PREVIEWTHEME_H
  11. #include <cowsite.h>
  12. #include "classfactory.h"
  13. #define MAX_PREVIEW_ICONS 4
  14. class CPreviewTheme : public CObjectWithSite
  15. , public IThemePreview
  16. {
  17. public:
  18. //////////////////////////////////////////////////////
  19. // Public Interfaces
  20. //////////////////////////////////////////////////////
  21. // *** IUnknown ***
  22. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  23. virtual STDMETHODIMP_(ULONG) AddRef(void);
  24. virtual STDMETHODIMP_(ULONG) Release(void);
  25. // *** IThemePreview ***
  26. virtual STDMETHODIMP UpdatePreview(IN IPropertyBag * pPropertyBag);
  27. virtual STDMETHODIMP CreatePreview(IN HWND hwndParent, IN DWORD dwFlags, IN DWORD dwStyle, IN DWORD dwExStyle, IN int x, IN int y, IN int nWidth, IN int nHeight, IN IPropertyBag * pPropertyBag, IN DWORD dwCtrlID);
  28. STDMETHODIMP _Init(void);
  29. CPreviewTheme();
  30. protected:
  31. private:
  32. virtual ~CPreviewTheme(void);
  33. // Private Member Variables
  34. long m_cRef;
  35. ITheme * m_pTheme;
  36. IThemeScheme * m_pScheme;
  37. IThemeStyle * m_pStyle;
  38. IThemeSize * m_pSize;
  39. HWND _hwndPrev;
  40. TCHAR _szNone[CCH_NONE]; // this is the '(None)' string
  41. RECT _rcOuter; // Size of double buffer bitmap
  42. RECT _rcInner; // Size of region within the "monitor"
  43. // Double buffering globals
  44. HDC _hdcMem; // memory DC
  45. HPALETTE _hpalMem; // palette that goes with hbmBack bitmap
  46. BOOL _fMemIsDirty; // Dirty flag for image cache
  47. BOOL _fRTL;
  48. // Monitor globals
  49. BOOL _fShowMon;
  50. int _cxMon;
  51. int _cyMon;
  52. HBITMAP _hbmMon;
  53. // Background globals
  54. WCHAR _szBackgroundPath[MAX_PATH];
  55. BOOL _fShowBack;
  56. int _iTileMode;
  57. BOOL _fHTMLBitmap;
  58. int _iNewTileMode; // This is the new value to be used when the images is recieved
  59. DWORD _dwWallpaperID;
  60. HBITMAP _hbmBack; // bitmap image of wallpaper
  61. HBRUSH _hbrBack; // brush for the desktop background
  62. IThumbnail* _pThumb;
  63. IActiveDesktop * _pActiveDesk;
  64. // Visual Style globals
  65. WCHAR _szVSPath[MAX_PATH];
  66. WCHAR _szVSColor[MAX_PATH];
  67. WCHAR _szVSSize[MAX_PATH];
  68. SYSTEMMETRICSALL _systemMetricsAll;
  69. BOOL _fShowVS;
  70. HBITMAP _hbmVS; // bitmp for Visual Style
  71. BOOL _fOnlyActiveWindow;
  72. // Icon globals
  73. BOOL _fShowIcons;
  74. typedef struct ICONLISTtag {
  75. HICON hicon;
  76. WCHAR szName[MAX_PATH];
  77. } ICONLIST;
  78. ICONLIST _iconList[MAX_PREVIEW_ICONS];
  79. // Taskbar globals
  80. BOOL _fShowTaskbar;
  81. BOOL _fAutoHide;
  82. BOOL _fShowClock;
  83. BOOL _fGlomming;
  84. HWND _hwndTaskbar;
  85. // Private Member Functions
  86. BOOL _RegisterThemePreviewClass(HINSTANCE hInst);
  87. static LRESULT ThemePreviewWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  88. LRESULT _ThemePreviewWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  89. STDMETHODIMP _putBackground(IN BSTR bstrWallpaper, IN BOOL fPattern, IN int iTileMode);
  90. STDMETHODIMP _putVisualStyle(LPCWSTR pszVSPath, LPCWSTR pszVSColor, LPCWSTR pszVSSize, SYSTEMMETRICSALL* psysMet);
  91. STDMETHODIMP _putIcons(IPropertyBag* pPropertyBag);
  92. STDMETHODIMP _ReadPattern(LPTSTR lpStr, WORD FAR *patbits);
  93. STDMETHODIMP _PaletteFromDS(HDC hdc, HPALETTE* phPalette);
  94. STDMETHODIMP _DrawMonitor(HDC hdc);
  95. STDMETHODIMP _DrawBackground(HDC hdc);
  96. STDMETHODIMP _DrawVisualStyle(HDC hdc);
  97. STDMETHODIMP _DrawIcons(HDC hdc);
  98. STDMETHODIMP _DrawTaskbar(HDC hdc);
  99. STDMETHODIMP _Paint(HDC hdc);
  100. STDMETHODIMP _putBackgroundBitmap(HBITMAP hbm);
  101. BOOL _IsNormalWallpaper(LPCWSTR pszFileName);
  102. BOOL _IsWallpaperPicture(LPCWSTR pszWallpaper);
  103. STDMETHODIMP _LoadWallpaperAsync(LPCWSTR pszFile, DWORD dwID, BOOL bHTML);
  104. STDMETHODIMP _GetWallpaperAsync(LPWSTR pszWallpaper);
  105. STDMETHODIMP _GetActiveDesktop(IActiveDesktop ** ppActiveDesktop);
  106. };
  107. #endif // _PREVIEWTHEME_H