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.

87 lines
2.9 KiB

  1. #ifndef _FILETBL_H
  2. #define _FILETBL_H
  3. #define SHIL_COUNT (SHIL_LAST + 1)
  4. // fileicon.c
  5. STDAPI_(int) SHAddIconsToCache(HICON rghicon[SHIL_COUNT], LPCTSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  6. STDAPI AddToIconTable(LPCTSTR szFile, int iIconIndex, UINT uFlags, int iIndex);
  7. STDAPI_(void) RemoveFromIconTable(LPCTSTR szFile);
  8. STDAPI_(void) FlushIconCache(void);
  9. STDAPI_(int) GetFreeImageIndex(void);
  10. STDAPI_(void) IconCacheFlush(BOOL fForce);
  11. STDAPI_(BOOL) IconCacheSave(void);
  12. STDAPI_(BOOL) IconCacheRestore(SIZE rgsize[SHIL_COUNT], UINT flags);
  13. STDAPI_(void) _IconCacheDump(void); // DEBUG ONLY
  14. STDAPI_(int) LookupIconIndex(LPCTSTR pszFile, int iIconIndex, UINT uFlags);
  15. STDAPI_(DWORD) LookupFileClass(LPCTSTR szClass);
  16. STDAPI_(void) AddFileClass(LPCTSTR szClass, DWORD dw);
  17. STDAPI_(void) FlushFileClass(void);
  18. STDAPI_(BOOL) IconIndexInFileClassTable(int iIndex);
  19. STDAPI_(LPCTSTR) LookupFileClassName(LPCTSTR szClass);
  20. STDAPI_(LPCTSTR) AddFileClassName(LPCTSTR szClass, LPCTSTR szClassName);
  21. STDAPI_(UINT) LookupFileSCIDs(LPCTSTR pszClass, SHCOLUMNID *pascidOut[]);
  22. STDAPI_(void) AddFileSCIDs(LPCTSTR pszClass, SHCOLUMNID ascidIn[], UINT cProps);
  23. // OpenAsTypes
  24. typedef enum {
  25. GEN_CUSTOM = -3,
  26. GEN_UNSPECIFIED = -2,
  27. GEN_FOLDER = -1,
  28. GEN_UNKNOWN = 0,
  29. GEN_TEXT,
  30. GEN_IMAGE,
  31. GEN_AUDIO,
  32. GEN_VIDEO,
  33. GEN_COMPRESSED,
  34. } PERCEIVED;
  35. STDAPI_(PERCEIVED) LookupFilePerceivedType(LPCTSTR pszClass);
  36. STDAPI_(void) AddFilePerceivedType(LPCTSTR pszClass, PERCEIVED gen);
  37. PERCEIVED GetPerceivedType(IShellFolder *psf, LPCITEMIDLIST pidl);
  38. // g_MaxIcons is limit on the number of icons in the cache
  39. // when we reach this limit we will start to throw icons away.
  40. //
  41. extern int g_MaxIcons; // panic limit for cache size
  42. #ifdef DEBUG
  43. #define DEF_MAX_ICONS 200 // to test the flush code more offten
  44. #else
  45. #define DEF_MAX_ICONS 500 // normal end user number
  46. #endif
  47. // refreshes g_MaxIcons from registry. returns TRUE if value changed.
  48. BOOL QueryNewMaxIcons(void);
  49. // g_iLastSysIcon is an indicator that is used to help determine which icons
  50. // should be flushed and which icons shouldn't. In the EXPLORER.EXE process,
  51. // the first 40 or so icons should be saved. On all other processes, only
  52. // the icon overlay's should be saved.
  53. extern UINT g_iLastSysIcon;
  54. typedef struct
  55. {
  56. SIZE size; // icon size
  57. HIMAGELIST himl;
  58. } SHIMAGELIST;
  59. EXTERN_C SHIMAGELIST g_rgshil[SHIL_COUNT];
  60. BOOL _IsSHILInited();
  61. int _GetSHILImageCount();
  62. void _DestroyIcons(HICON *phicons, int cIcons);
  63. // NOTE these are the size of the icons in our ImageList, not the system
  64. // icon size.
  65. #define g_cxIcon ((int)g_rgshil[SHIL_LARGE].size.cx)
  66. #define g_cyIcon ((int)g_rgshil[SHIL_LARGE].size.cy)
  67. #define g_cxSmIcon ((int)g_rgshil[SHIL_SMALL].size.cx)
  68. #define g_cySmIcon ((int)g_rgshil[SHIL_SMALL].size.cy)
  69. #endif // _FILETBL_H