Source code of Windows XP (NT5)
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.

88 lines
2.4 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. static void _Initialize( void );
  15. static void _Cleanup( void );
  16. virtual IShellFolder * GetSF() PURE;
  17. virtual HWND GetHWND() PURE;
  18. inline HIMAGELIST GetLogoHIML( void );
  19. // intialisation functions
  20. HRESULT InitLogoView( void );
  21. HRESULT ExitLogoView( void );
  22. int GetLogoIndex( DWORD dwItem, LPCITEMIDLIST pidl, IRunnableTask **ppTask, DWORD * pdwPriority, DWORD * pdwFlags );
  23. int GetDefaultLogo( LPCITEMIDLIST pidl, BOOL fQuick );
  24. HRESULT AddTaskToQueue( IRunnableTask *pTask, DWORD dwPriority, DWORD lParam );
  25. // create the default logo for an item....
  26. HRESULT CreateDefaultLogo(int iIcon, int cxLogo, int cyLogo, LPCTSTR pszText, HBITMAP * phBmpLogo);
  27. HRESULT FlushLogoCache( void );
  28. HRESULT AddRefLogoCache( void );
  29. HRESULT ReleaseLogoCache( void );
  30. // get the task ID used with the task scheduler
  31. virtual REFTASKOWNERID GetTOID( void ) PURE;
  32. virtual HRESULT UpdateLogoCallback( DWORD dwItem, int iIcon, HBITMAP hImage, LPCWSTR pszCache, BOOL fCache ) PURE;
  33. HRESULT DitherBitmap( HBITMAP hBmp, HBITMAP * phBmpNew );
  34. int AddIndicesToLogoList( int iIcon, UINT uIndex );
  35. int FindLogoFromIcon( int iIcon, int * piLastLogo );
  36. protected:
  37. int GetCachedLogoIndex(DWORD dwItem, LPCITEMIDLIST pidl, IRunnableTask **ppTask, DWORD * pdwPriority, DWORD * pdwFlags );
  38. IImageCache * _pLogoCache; // My be NULL in low memory conditions.
  39. IShellTaskScheduler * _pTaskScheduler;
  40. HIMAGELIST _himlLogos;
  41. SIZEL _rgLogoSize;
  42. DWORD _dwClrDepth;
  43. HDSA _hdsaLogoIndices;
  44. static CRITICAL_SECTION s_csSharedLogos;
  45. static long s_lSharedWideLogosRef;
  46. static IImageCache * s_pSharedWideLogoCache;
  47. static HDSA s_hdsaWideLogoIndices;
  48. HPALETTE _hpalHalftone;
  49. BOOL _fWide;
  50. };
  51. inline HIMAGELIST CLogoBase::GetLogoHIML( )
  52. {
  53. return _himlLogos;
  54. }
  55. struct LogoIndex
  56. {
  57. int iIcon;
  58. int iLogo;
  59. };
  60. #endif