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.

79 lines
2.2 KiB

  1. #ifndef _LOGO_H
  2. #define _LOGO_H
  3. typedef HRESULT (* LPUPDATEFN)( void *pData, DWORD dwItem, HBITMAP hImage, LPCWSTR pszCache, BOOL fCache );
  4. #define LOGO_HEIGHT 32
  5. #define LOGO_WIDE_WIDTH 194
  6. #define LOGO_WIDTH 80
  7. class CLogoBase
  8. {
  9. public:
  10. CLogoBase( BOOL fWide = FALSE );
  11. ~CLogoBase();
  12. virtual STDMETHODIMP_(ULONG) AddRef(void) PURE;
  13. virtual STDMETHODIMP_(ULONG) Release(void) PURE;
  14. virtual IShellFolder * GetSF() PURE;
  15. virtual HWND GetHWND() PURE;
  16. inline HIMAGELIST GetLogoHIML( void );
  17. // intialisation functions
  18. HRESULT InitLogoView( void );
  19. HRESULT ExitLogoView( void );
  20. int GetLogoIndex( DWORD dwItem, LPCITEMIDLIST pidl, IRunnableTask **ppTask, DWORD * pdwPriority, DWORD * pdwFlags );
  21. int GetDefaultLogo( LPCITEMIDLIST pidl, BOOL fQuick );
  22. HRESULT AddTaskToQueue( IRunnableTask *pTask, DWORD dwPriority, DWORD lParam );
  23. // create the default logo for an item....
  24. HRESULT CreateDefaultLogo(int iIcon, int cxLogo, int cyLogo, LPCTSTR pszText, HBITMAP * phBmpLogo);
  25. HRESULT AddRefLogoCache( void );
  26. HRESULT ReleaseLogoCache( void );
  27. // get the task ID used with the task scheduler
  28. virtual REFTASKOWNERID GetTOID( void ) PURE;
  29. virtual HRESULT UpdateLogoCallback( DWORD dwItem, int iIcon, HBITMAP hImage, LPCWSTR pszCache, BOOL fCache ) PURE;
  30. int AddIndicesToLogoList( int iIcon, UINT uIndex );
  31. protected:
  32. int GetCachedLogoIndex(DWORD dwItem, LPCITEMIDLIST pidl, IRunnableTask **ppTask, DWORD * pdwPriority, DWORD * pdwFlags );
  33. IImageCache * _pLogoCache; // My be NULL in low memory conditions.
  34. IShellTaskScheduler * _pTaskScheduler;
  35. HIMAGELIST _himlLogos;
  36. SIZEL _rgLogoSize;
  37. DWORD _dwClrDepth;
  38. HDSA _hdsaLogoIndices;
  39. static CRITICAL_SECTION s_csSharedLogos;
  40. static long s_lSharedWideLogosRef;
  41. static IImageCache * s_pSharedWideLogoCache;
  42. static HDSA s_hdsaWideLogoIndices;
  43. HPALETTE _hpalHalftone;
  44. BOOL _fWide;
  45. };
  46. inline HIMAGELIST CLogoBase::GetLogoHIML( )
  47. {
  48. return _himlLogos;
  49. }
  50. struct LogoIndex
  51. {
  52. int iIcon;
  53. int iLogo;
  54. };
  55. #endif