Team Fortress 2 Source Code as on 22/4/2020
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.

149 lines
4.9 KiB

  1. /*
  2. File: IconStorage.h
  3. Contains: Services to load and share icon family data.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 2000-2002 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __ICONSTORAGE__
  11. #define __ICONSTORAGE__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #if PRAGMA_ONCE
  16. #pragma once
  17. #endif
  18. #if PRAGMA_IMPORT
  19. #pragma import on
  20. #endif
  21. #if PRAGMA_STRUCT_ALIGN
  22. #pragma options align=mac68k
  23. #elif PRAGMA_STRUCT_PACKPUSH
  24. #pragma pack(push, 2)
  25. #elif PRAGMA_STRUCT_PACK
  26. #pragma pack(2)
  27. #endif
  28. /* The following icon types can only be used as an icon element */
  29. /* inside a 'icns' icon family */
  30. enum {
  31. kThumbnail32BitData = FOUR_CHAR_CODE('it32'),
  32. kThumbnail8BitMask = FOUR_CHAR_CODE('t8mk')
  33. };
  34. enum {
  35. kHuge1BitMask = FOUR_CHAR_CODE('ich#'),
  36. kHuge4BitData = FOUR_CHAR_CODE('ich4'),
  37. kHuge8BitData = FOUR_CHAR_CODE('ich8'),
  38. kHuge32BitData = FOUR_CHAR_CODE('ih32'),
  39. kHuge8BitMask = FOUR_CHAR_CODE('h8mk')
  40. };
  41. /* The following icon types can be used as a resource type */
  42. /* or as an icon element type inside a 'icns' icon family */
  43. enum {
  44. kLarge1BitMask = FOUR_CHAR_CODE('ICN#'),
  45. kLarge4BitData = FOUR_CHAR_CODE('icl4'),
  46. kLarge8BitData = FOUR_CHAR_CODE('icl8'),
  47. kLarge32BitData = FOUR_CHAR_CODE('il32'),
  48. kLarge8BitMask = FOUR_CHAR_CODE('l8mk'),
  49. kSmall1BitMask = FOUR_CHAR_CODE('ics#'),
  50. kSmall4BitData = FOUR_CHAR_CODE('ics4'),
  51. kSmall8BitData = FOUR_CHAR_CODE('ics8'),
  52. kSmall32BitData = FOUR_CHAR_CODE('is32'),
  53. kSmall8BitMask = FOUR_CHAR_CODE('s8mk'),
  54. kMini1BitMask = FOUR_CHAR_CODE('icm#'),
  55. kMini4BitData = FOUR_CHAR_CODE('icm4'),
  56. kMini8BitData = FOUR_CHAR_CODE('icm8')
  57. };
  58. /* Obsolete. Use names defined above. */
  59. enum {
  60. large1BitMask = kLarge1BitMask,
  61. large4BitData = kLarge4BitData,
  62. large8BitData = kLarge8BitData,
  63. small1BitMask = kSmall1BitMask,
  64. small4BitData = kSmall4BitData,
  65. small8BitData = kSmall8BitData,
  66. mini1BitMask = kMini1BitMask,
  67. mini4BitData = kMini4BitData,
  68. mini8BitData = kMini8BitData
  69. };
  70. /*
  71. IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).
  72. For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
  73. the classic custom icons (individual 'ics#, ICN#, etc) are fetched. If the fetch of the icns resource
  74. succeeds then the icns is looked at exclusively for the icon data.
  75. For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
  76. This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
  77. MacOS Finder.
  78. DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
  79. driver icon for a particular device. The result of the kdgMediaIconSuite call to DriverGestalt should
  80. be a pointer an an IconFamily. In this manner driver vendors can provide rich, detailed drive icons
  81. instead of the 1-bit variety previously supported.
  82. */
  83. enum {
  84. kIconFamilyType = FOUR_CHAR_CODE('icns')
  85. };
  86. struct IconFamilyElement {
  87. OSType elementType; /* 'ICN#', 'icl8', etc...*/
  88. Size elementSize; /* Size of this element*/
  89. unsigned char elementData[1];
  90. };
  91. typedef struct IconFamilyElement IconFamilyElement;
  92. struct IconFamilyResource {
  93. OSType resourceType; /* Always 'icns'*/
  94. Size resourceSize; /* Total size of this resource*/
  95. IconFamilyElement elements[1];
  96. };
  97. typedef struct IconFamilyResource IconFamilyResource;
  98. typedef IconFamilyResource * IconFamilyPtr;
  99. typedef IconFamilyPtr * IconFamilyHandle;
  100. /* Icon Variants */
  101. /* These can be used as an element of an 'icns' icon family */
  102. /* or as a parameter to GetIconRefVariant */
  103. enum {
  104. kTileIconVariant = FOUR_CHAR_CODE('tile'),
  105. kRolloverIconVariant = FOUR_CHAR_CODE('over'),
  106. kDropIconVariant = FOUR_CHAR_CODE('drop'),
  107. kOpenIconVariant = FOUR_CHAR_CODE('open'),
  108. kOpenDropIconVariant = FOUR_CHAR_CODE('odrp')
  109. };
  110. #if PRAGMA_STRUCT_ALIGN
  111. #pragma options align=reset
  112. #elif PRAGMA_STRUCT_PACKPUSH
  113. #pragma pack(pop)
  114. #elif PRAGMA_STRUCT_PACK
  115. #pragma pack()
  116. #endif
  117. #ifdef PRAGMA_IMPORT_OFF
  118. #pragma import off
  119. #elif PRAGMA_IMPORT
  120. #pragma import reset
  121. #endif
  122. #endif /* __ICONSTORAGE__ */