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.

2412 lines
73 KiB

  1. /*
  2. File: Icons.h
  3. Contains: Icon Utilities and Icon Services Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1990-2001 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 __ICONS__
  11. #define __ICONS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18. #ifndef __CODEFRAGMENTS__
  19. #include <CodeFragments.h>
  20. #endif
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24. #ifndef __CGCONTEXT__
  25. #include <CGContext.h>
  26. #endif
  27. #ifndef __ICONSTORAGE__
  28. #include <IconStorage.h>
  29. #endif
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39. #if PRAGMA_STRUCT_ALIGN
  40. #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42. #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44. #pragma pack(2)
  45. #endif
  46. /* The following are icons for which there are both icon suites and SICNs. */
  47. /* Avoid using icon resources if possible. Use IconServices instead. */
  48. enum {
  49. kGenericDocumentIconResource = -4000,
  50. kGenericStationeryIconResource = -3985,
  51. kGenericEditionFileIconResource = -3989,
  52. kGenericApplicationIconResource = -3996,
  53. kGenericDeskAccessoryIconResource = -3991,
  54. kGenericFolderIconResource = -3999,
  55. kPrivateFolderIconResource = -3994,
  56. kFloppyIconResource = -3998,
  57. kTrashIconResource = -3993,
  58. kGenericRAMDiskIconResource = -3988,
  59. kGenericCDROMIconResource = -3987
  60. };
  61. /* The following are icons for which there are SICNs only. */
  62. /* Avoid using icon resources if possible. Use IconServices instead. */
  63. enum {
  64. kDesktopIconResource = -3992,
  65. kOpenFolderIconResource = -3997,
  66. kGenericHardDiskIconResource = -3995,
  67. kGenericFileServerIconResource = -3972,
  68. kGenericSuitcaseIconResource = -3970,
  69. kGenericMoverObjectIconResource = -3969
  70. };
  71. /* The following are icons for which there are icon suites only. */
  72. /* Avoid using icon resources if possible. Use IconServices instead. */
  73. enum {
  74. kGenericPreferencesIconResource = -3971,
  75. kGenericQueryDocumentIconResource = -16506,
  76. kGenericExtensionIconResource = -16415,
  77. kSystemFolderIconResource = -3983,
  78. kHelpIconResource = -20271,
  79. kAppleMenuFolderIconResource = -3982
  80. };
  81. /* Obsolete. Use named constants defined above. */
  82. enum {
  83. genericDocumentIconResource = kGenericDocumentIconResource,
  84. genericStationeryIconResource = kGenericStationeryIconResource,
  85. genericEditionFileIconResource = kGenericEditionFileIconResource,
  86. genericApplicationIconResource = kGenericApplicationIconResource,
  87. genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource,
  88. genericFolderIconResource = kGenericFolderIconResource,
  89. privateFolderIconResource = kPrivateFolderIconResource,
  90. floppyIconResource = kFloppyIconResource,
  91. trashIconResource = kTrashIconResource,
  92. genericRAMDiskIconResource = kGenericRAMDiskIconResource,
  93. genericCDROMIconResource = kGenericCDROMIconResource,
  94. desktopIconResource = kDesktopIconResource,
  95. openFolderIconResource = kOpenFolderIconResource,
  96. genericHardDiskIconResource = kGenericHardDiskIconResource,
  97. genericFileServerIconResource = kGenericFileServerIconResource,
  98. genericSuitcaseIconResource = kGenericSuitcaseIconResource,
  99. genericMoverObjectIconResource = kGenericMoverObjectIconResource,
  100. genericPreferencesIconResource = kGenericPreferencesIconResource,
  101. genericQueryDocumentIconResource = kGenericQueryDocumentIconResource,
  102. genericExtensionIconResource = kGenericExtensionIconResource,
  103. systemFolderIconResource = kSystemFolderIconResource,
  104. appleMenuFolderIconResource = kAppleMenuFolderIconResource
  105. };
  106. /* Avoid using icon resources if possible. Use IconServices instead. */
  107. enum {
  108. kStartupFolderIconResource = -3981,
  109. kOwnedFolderIconResource = -3980,
  110. kDropFolderIconResource = -3979,
  111. kSharedFolderIconResource = -3978,
  112. kMountedFolderIconResource = -3977,
  113. kControlPanelFolderIconResource = -3976,
  114. kPrintMonitorFolderIconResource = -3975,
  115. kPreferencesFolderIconResource = -3974,
  116. kExtensionsFolderIconResource = -3973,
  117. kFontsFolderIconResource = -3968,
  118. kFullTrashIconResource = -3984
  119. };
  120. /* Obsolete. Use named constants defined above. */
  121. enum {
  122. startupFolderIconResource = kStartupFolderIconResource,
  123. ownedFolderIconResource = kOwnedFolderIconResource,
  124. dropFolderIconResource = kDropFolderIconResource,
  125. sharedFolderIconResource = kSharedFolderIconResource,
  126. mountedFolderIconResource = kMountedFolderIconResource,
  127. controlPanelFolderIconResource = kControlPanelFolderIconResource,
  128. printMonitorFolderIconResource = kPrintMonitorFolderIconResource,
  129. preferencesFolderIconResource = kPreferencesFolderIconResource,
  130. extensionsFolderIconResource = kExtensionsFolderIconResource,
  131. fontsFolderIconResource = kFontsFolderIconResource,
  132. fullTrashIconResource = kFullTrashIconResource
  133. };
  134. /* Alignment type values. */
  135. enum {
  136. kAlignNone = 0x00,
  137. kAlignVerticalCenter = 0x01,
  138. kAlignTop = 0x02,
  139. kAlignBottom = 0x03,
  140. kAlignHorizontalCenter = 0x04,
  141. kAlignAbsoluteCenter = kAlignVerticalCenter | kAlignHorizontalCenter,
  142. kAlignCenterTop = kAlignTop | kAlignHorizontalCenter,
  143. kAlignCenterBottom = kAlignBottom | kAlignHorizontalCenter,
  144. kAlignLeft = 0x08,
  145. kAlignCenterLeft = kAlignVerticalCenter | kAlignLeft,
  146. kAlignTopLeft = kAlignTop | kAlignLeft,
  147. kAlignBottomLeft = kAlignBottom | kAlignLeft,
  148. kAlignRight = 0x0C,
  149. kAlignCenterRight = kAlignVerticalCenter | kAlignRight,
  150. kAlignTopRight = kAlignTop | kAlignRight,
  151. kAlignBottomRight = kAlignBottom | kAlignRight
  152. };
  153. /* Obsolete. Use names defined above. */
  154. enum {
  155. atNone = kAlignNone,
  156. atVerticalCenter = kAlignVerticalCenter,
  157. atTop = kAlignTop,
  158. atBottom = kAlignBottom,
  159. atHorizontalCenter = kAlignHorizontalCenter,
  160. atAbsoluteCenter = kAlignAbsoluteCenter,
  161. atCenterTop = kAlignCenterTop,
  162. atCenterBottom = kAlignCenterBottom,
  163. atLeft = kAlignLeft,
  164. atCenterLeft = kAlignCenterLeft,
  165. atTopLeft = kAlignTopLeft,
  166. atBottomLeft = kAlignBottomLeft,
  167. atRight = kAlignRight,
  168. atCenterRight = kAlignCenterRight,
  169. atTopRight = kAlignTopRight,
  170. atBottomRight = kAlignBottomRight
  171. };
  172. typedef SInt16 IconAlignmentType;
  173. /* Transform type values. */
  174. enum {
  175. kTransformNone = 0x00,
  176. kTransformDisabled = 0x01,
  177. kTransformOffline = 0x02,
  178. kTransformOpen = 0x03,
  179. kTransformLabel1 = 0x0100,
  180. kTransformLabel2 = 0x0200,
  181. kTransformLabel3 = 0x0300,
  182. kTransformLabel4 = 0x0400,
  183. kTransformLabel5 = 0x0500,
  184. kTransformLabel6 = 0x0600,
  185. kTransformLabel7 = 0x0700,
  186. kTransformSelected = 0x4000,
  187. kTransformSelectedDisabled = kTransformSelected | kTransformDisabled,
  188. kTransformSelectedOffline = kTransformSelected | kTransformOffline,
  189. kTransformSelectedOpen = kTransformSelected | kTransformOpen
  190. };
  191. /* Obsolete. Use names defined above. */
  192. enum {
  193. ttNone = kTransformNone,
  194. ttDisabled = kTransformDisabled,
  195. ttOffline = kTransformOffline,
  196. ttOpen = kTransformOpen,
  197. ttLabel1 = kTransformLabel1,
  198. ttLabel2 = kTransformLabel2,
  199. ttLabel3 = kTransformLabel3,
  200. ttLabel4 = kTransformLabel4,
  201. ttLabel5 = kTransformLabel5,
  202. ttLabel6 = kTransformLabel6,
  203. ttLabel7 = kTransformLabel7,
  204. ttSelected = kTransformSelected,
  205. ttSelectedDisabled = kTransformSelectedDisabled,
  206. ttSelectedOffline = kTransformSelectedOffline,
  207. ttSelectedOpen = kTransformSelectedOpen
  208. };
  209. typedef SInt16 IconTransformType;
  210. /* Selector mask values. */
  211. enum {
  212. kSelectorLarge1Bit = 0x00000001,
  213. kSelectorLarge4Bit = 0x00000002,
  214. kSelectorLarge8Bit = 0x00000004,
  215. kSelectorLarge32Bit = 0x00000008,
  216. kSelectorLarge8BitMask = 0x00000010,
  217. kSelectorSmall1Bit = 0x00000100,
  218. kSelectorSmall4Bit = 0x00000200,
  219. kSelectorSmall8Bit = 0x00000400,
  220. kSelectorSmall32Bit = 0x00000800,
  221. kSelectorSmall8BitMask = 0x00001000,
  222. kSelectorMini1Bit = 0x00010000,
  223. kSelectorMini4Bit = 0x00020000,
  224. kSelectorMini8Bit = 0x00040000,
  225. kSelectorHuge1Bit = 0x01000000,
  226. kSelectorHuge4Bit = 0x02000000,
  227. kSelectorHuge8Bit = 0x04000000,
  228. kSelectorHuge32Bit = 0x08000000,
  229. kSelectorHuge8BitMask = 0x10000000,
  230. kSelectorAllLargeData = 0x000000FF,
  231. kSelectorAllSmallData = 0x0000FF00,
  232. kSelectorAllMiniData = 0x00FF0000,
  233. kSelectorAllHugeData = (long)0xFF000000,
  234. kSelectorAll1BitData = kSelectorLarge1Bit | kSelectorSmall1Bit | kSelectorMini1Bit | kSelectorHuge1Bit,
  235. kSelectorAll4BitData = kSelectorLarge4Bit | kSelectorSmall4Bit | kSelectorMini4Bit | kSelectorHuge4Bit,
  236. kSelectorAll8BitData = kSelectorLarge8Bit | kSelectorSmall8Bit | kSelectorMini8Bit | kSelectorHuge8Bit,
  237. kSelectorAll32BitData = kSelectorLarge32Bit | kSelectorSmall32Bit | kSelectorHuge32Bit,
  238. kSelectorAllAvailableData = (long)0xFFFFFFFF
  239. };
  240. /* Obsolete. Use names defined above. */
  241. enum {
  242. svLarge1Bit = kSelectorLarge1Bit,
  243. svLarge4Bit = kSelectorLarge4Bit,
  244. svLarge8Bit = kSelectorLarge8Bit,
  245. svSmall1Bit = kSelectorSmall1Bit,
  246. svSmall4Bit = kSelectorSmall4Bit,
  247. svSmall8Bit = kSelectorSmall8Bit,
  248. svMini1Bit = kSelectorMini1Bit,
  249. svMini4Bit = kSelectorMini4Bit,
  250. svMini8Bit = kSelectorMini8Bit,
  251. svAllLargeData = kSelectorAllLargeData,
  252. svAllSmallData = kSelectorAllSmallData,
  253. svAllMiniData = kSelectorAllMiniData,
  254. svAll1BitData = kSelectorAll1BitData,
  255. svAll4BitData = kSelectorAll4BitData,
  256. svAll8BitData = kSelectorAll8BitData,
  257. svAllAvailableData = kSelectorAllAvailableData
  258. };
  259. typedef UInt32 IconSelectorValue;
  260. typedef CALLBACK_API( OSErr , IconActionProcPtr )(ResType theType, Handle *theIcon, void *yourDataPtr);
  261. typedef CALLBACK_API( Handle , IconGetterProcPtr )(ResType theType, void *yourDataPtr);
  262. typedef STACK_UPP_TYPE(IconActionProcPtr) IconActionUPP;
  263. typedef STACK_UPP_TYPE(IconGetterProcPtr) IconGetterUPP;
  264. /*
  265. * NewIconActionUPP()
  266. *
  267. * Availability:
  268. * Non-Carbon CFM: available as macro/inline
  269. * CarbonLib: in CarbonLib 1.0 and later
  270. * Mac OS X: in version 10.0 and later
  271. */
  272. EXTERN_API_C( IconActionUPP )
  273. NewIconActionUPP(IconActionProcPtr userRoutine);
  274. #if !OPAQUE_UPP_TYPES
  275. enum { uppIconActionProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  276. #ifdef __cplusplus
  277. inline DEFINE_API_C(IconActionUPP) NewIconActionUPP(IconActionProcPtr userRoutine) { return (IconActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconActionProcInfo, GetCurrentArchitecture()); }
  278. #else
  279. #define NewIconActionUPP(userRoutine) (IconActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconActionProcInfo, GetCurrentArchitecture())
  280. #endif
  281. #endif
  282. /*
  283. * NewIconGetterUPP()
  284. *
  285. * Availability:
  286. * Non-Carbon CFM: available as macro/inline
  287. * CarbonLib: in CarbonLib 1.0 and later
  288. * Mac OS X: in version 10.0 and later
  289. */
  290. EXTERN_API_C( IconGetterUPP )
  291. NewIconGetterUPP(IconGetterProcPtr userRoutine);
  292. #if !OPAQUE_UPP_TYPES
  293. enum { uppIconGetterProcInfo = 0x000003F0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  294. #ifdef __cplusplus
  295. inline DEFINE_API_C(IconGetterUPP) NewIconGetterUPP(IconGetterProcPtr userRoutine) { return (IconGetterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconGetterProcInfo, GetCurrentArchitecture()); }
  296. #else
  297. #define NewIconGetterUPP(userRoutine) (IconGetterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconGetterProcInfo, GetCurrentArchitecture())
  298. #endif
  299. #endif
  300. /*
  301. * DisposeIconActionUPP()
  302. *
  303. * Availability:
  304. * Non-Carbon CFM: available as macro/inline
  305. * CarbonLib: in CarbonLib 1.0 and later
  306. * Mac OS X: in version 10.0 and later
  307. */
  308. EXTERN_API_C( void )
  309. DisposeIconActionUPP(IconActionUPP userUPP);
  310. #if !OPAQUE_UPP_TYPES
  311. #ifdef __cplusplus
  312. inline DEFINE_API_C(void) DisposeIconActionUPP(IconActionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  313. #else
  314. #define DisposeIconActionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  315. #endif
  316. #endif
  317. /*
  318. * DisposeIconGetterUPP()
  319. *
  320. * Availability:
  321. * Non-Carbon CFM: available as macro/inline
  322. * CarbonLib: in CarbonLib 1.0 and later
  323. * Mac OS X: in version 10.0 and later
  324. */
  325. EXTERN_API_C( void )
  326. DisposeIconGetterUPP(IconGetterUPP userUPP);
  327. #if !OPAQUE_UPP_TYPES
  328. #ifdef __cplusplus
  329. inline DEFINE_API_C(void) DisposeIconGetterUPP(IconGetterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  330. #else
  331. #define DisposeIconGetterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  332. #endif
  333. #endif
  334. /*
  335. * InvokeIconActionUPP()
  336. *
  337. * Availability:
  338. * Non-Carbon CFM: available as macro/inline
  339. * CarbonLib: in CarbonLib 1.0 and later
  340. * Mac OS X: in version 10.0 and later
  341. */
  342. EXTERN_API_C( OSErr )
  343. InvokeIconActionUPP(
  344. ResType theType,
  345. Handle * theIcon,
  346. void * yourDataPtr,
  347. IconActionUPP userUPP);
  348. #if !OPAQUE_UPP_TYPES
  349. #ifdef __cplusplus
  350. inline DEFINE_API_C(OSErr) InvokeIconActionUPP(ResType theType, Handle * theIcon, void * yourDataPtr, IconActionUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppIconActionProcInfo, theType, theIcon, yourDataPtr); }
  351. #else
  352. #define InvokeIconActionUPP(theType, theIcon, yourDataPtr, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppIconActionProcInfo, (theType), (theIcon), (yourDataPtr))
  353. #endif
  354. #endif
  355. /*
  356. * InvokeIconGetterUPP()
  357. *
  358. * Availability:
  359. * Non-Carbon CFM: available as macro/inline
  360. * CarbonLib: in CarbonLib 1.0 and later
  361. * Mac OS X: in version 10.0 and later
  362. */
  363. EXTERN_API_C( Handle )
  364. InvokeIconGetterUPP(
  365. ResType theType,
  366. void * yourDataPtr,
  367. IconGetterUPP userUPP);
  368. #if !OPAQUE_UPP_TYPES
  369. #ifdef __cplusplus
  370. inline DEFINE_API_C(Handle) InvokeIconGetterUPP(ResType theType, void * yourDataPtr, IconGetterUPP userUPP) { return (Handle)CALL_TWO_PARAMETER_UPP(userUPP, uppIconGetterProcInfo, theType, yourDataPtr); }
  371. #else
  372. #define InvokeIconGetterUPP(theType, yourDataPtr, userUPP) (Handle)CALL_TWO_PARAMETER_UPP((userUPP), uppIconGetterProcInfo, (theType), (yourDataPtr))
  373. #endif
  374. #endif
  375. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  376. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  377. #define NewIconActionProc(userRoutine) NewIconActionUPP(userRoutine)
  378. #define NewIconGetterProc(userRoutine) NewIconGetterUPP(userRoutine)
  379. #define CallIconActionProc(userRoutine, theType, theIcon, yourDataPtr) InvokeIconActionUPP(theType, theIcon, yourDataPtr, userRoutine)
  380. #define CallIconGetterProc(userRoutine, theType, yourDataPtr) InvokeIconGetterUPP(theType, yourDataPtr, userRoutine)
  381. #endif /* CALL_NOT_IN_CARBON */
  382. typedef IconGetterProcPtr IconGetter;
  383. typedef IconActionProcPtr IconAction;
  384. /* CIconHandle, GetCIcon(), PlotCIcon(), and DisposeCIcon() moved here from Quickdraw.h*/
  385. struct CIcon {
  386. PixMap iconPMap; /*the icon's pixMap*/
  387. BitMap iconMask; /*the icon's mask*/
  388. BitMap iconBMap; /*the icon's bitMap*/
  389. Handle iconData; /*the icon's data*/
  390. SInt16 iconMaskData[1]; /*icon's mask and BitMap data*/
  391. };
  392. typedef struct CIcon CIcon;
  393. typedef CIcon * CIconPtr;
  394. typedef CIconPtr * CIconHandle;
  395. /*
  396. * GetCIcon()
  397. *
  398. * Availability:
  399. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  400. * CarbonLib: in CarbonLib 1.0 and later
  401. * Mac OS X: in version 10.0 and later
  402. */
  403. EXTERN_API( CIconHandle )
  404. GetCIcon(SInt16 iconID) ONEWORDINLINE(0xAA1E);
  405. /*
  406. * PlotCIcon()
  407. *
  408. * Availability:
  409. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  410. * CarbonLib: in CarbonLib 1.0 and later
  411. * Mac OS X: in version 10.0 and later
  412. */
  413. EXTERN_API( void )
  414. PlotCIcon(
  415. const Rect * theRect,
  416. CIconHandle theIcon) ONEWORDINLINE(0xAA1F);
  417. /*
  418. * DisposeCIcon()
  419. *
  420. * Availability:
  421. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  422. * CarbonLib: in CarbonLib 1.0 and later
  423. * Mac OS X: in version 10.0 and later
  424. */
  425. EXTERN_API( void )
  426. DisposeCIcon(CIconHandle theIcon) ONEWORDINLINE(0xAA25);
  427. /* GetIcon and PlotIcon moved here from ToolUtils*/
  428. /*
  429. * GetIcon()
  430. *
  431. * Availability:
  432. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  433. * CarbonLib: in CarbonLib 1.0 and later
  434. * Mac OS X: in version 10.0 and later
  435. */
  436. EXTERN_API( Handle )
  437. GetIcon(SInt16 iconID) ONEWORDINLINE(0xA9BB);
  438. /*
  439. * PlotIcon()
  440. *
  441. * Availability:
  442. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  443. * CarbonLib: in CarbonLib 1.0 and later
  444. * Mac OS X: in version 10.0 and later
  445. */
  446. EXTERN_API( void )
  447. PlotIcon(
  448. const Rect * theRect,
  449. Handle theIcon) ONEWORDINLINE(0xA94B);
  450. /*
  451. Note: IconSuiteRef and IconCacheRef should be an abstract types,
  452. but too much source code already relies on them being of type Handle.
  453. */
  454. typedef Handle IconSuiteRef;
  455. typedef Handle IconCacheRef;
  456. /* IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.*/
  457. typedef struct OpaqueIconRef* IconRef;
  458. /*
  459. * PlotIconID()
  460. *
  461. * Availability:
  462. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  463. * CarbonLib: in CarbonLib 1.0 and later
  464. * Mac OS X: in version 10.0 and later
  465. */
  466. EXTERN_API( OSErr )
  467. PlotIconID(
  468. const Rect * theRect,
  469. IconAlignmentType align,
  470. IconTransformType transform,
  471. SInt16 theResID) THREEWORDINLINE(0x303C, 0x0500, 0xABC9);
  472. /*
  473. * NewIconSuite()
  474. *
  475. * Availability:
  476. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  477. * CarbonLib: in CarbonLib 1.0 and later
  478. * Mac OS X: in version 10.0 and later
  479. */
  480. EXTERN_API( OSErr )
  481. NewIconSuite(IconSuiteRef * theIconSuite) THREEWORDINLINE(0x303C, 0x0207, 0xABC9);
  482. /*
  483. * AddIconToSuite()
  484. *
  485. * Availability:
  486. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  487. * CarbonLib: in CarbonLib 1.0 and later
  488. * Mac OS X: in version 10.0 and later
  489. */
  490. EXTERN_API( OSErr )
  491. AddIconToSuite(
  492. Handle theIconData,
  493. IconSuiteRef theSuite,
  494. ResType theType) THREEWORDINLINE(0x303C, 0x0608, 0xABC9);
  495. /*
  496. * GetIconFromSuite()
  497. *
  498. * Availability:
  499. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  500. * CarbonLib: in CarbonLib 1.0 and later
  501. * Mac OS X: in version 10.0 and later
  502. */
  503. EXTERN_API( OSErr )
  504. GetIconFromSuite(
  505. Handle * theIconData,
  506. IconSuiteRef theSuite,
  507. ResType theType) THREEWORDINLINE(0x303C, 0x0609, 0xABC9);
  508. /*
  509. * ForEachIconDo()
  510. *
  511. * Availability:
  512. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  513. * CarbonLib: in CarbonLib 1.0 and later
  514. * Mac OS X: in version 10.0 and later
  515. */
  516. EXTERN_API( OSErr )
  517. ForEachIconDo(
  518. IconSuiteRef theSuite,
  519. IconSelectorValue selector,
  520. IconActionUPP action,
  521. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x080A, 0xABC9);
  522. /*
  523. * GetIconSuite()
  524. *
  525. * Availability:
  526. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  527. * CarbonLib: in CarbonLib 1.0 and later
  528. * Mac OS X: in version 10.0 and later
  529. */
  530. EXTERN_API( OSErr )
  531. GetIconSuite(
  532. IconSuiteRef * theIconSuite,
  533. SInt16 theResID,
  534. IconSelectorValue selector) THREEWORDINLINE(0x303C, 0x0501, 0xABC9);
  535. /*
  536. * DisposeIconSuite()
  537. *
  538. * Availability:
  539. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  540. * CarbonLib: in CarbonLib 1.0 and later
  541. * Mac OS X: in version 10.0 and later
  542. */
  543. EXTERN_API( OSErr )
  544. DisposeIconSuite(
  545. IconSuiteRef theIconSuite,
  546. Boolean disposeData) THREEWORDINLINE(0x303C, 0x0302, 0xABC9);
  547. /*
  548. * PlotIconSuite()
  549. *
  550. * Availability:
  551. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  552. * CarbonLib: in CarbonLib 1.0 and later
  553. * Mac OS X: in version 10.0 and later
  554. */
  555. EXTERN_API( OSErr )
  556. PlotIconSuite(
  557. const Rect * theRect,
  558. IconAlignmentType align,
  559. IconTransformType transform,
  560. IconSuiteRef theIconSuite) THREEWORDINLINE(0x303C, 0x0603, 0xABC9);
  561. /*
  562. * MakeIconCache()
  563. *
  564. * Availability:
  565. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  566. * CarbonLib: in CarbonLib 1.0 and later
  567. * Mac OS X: in version 10.0 and later
  568. */
  569. EXTERN_API( OSErr )
  570. MakeIconCache(
  571. IconCacheRef * theCache,
  572. IconGetterUPP makeIcon,
  573. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x0604, 0xABC9);
  574. /*
  575. * LoadIconCache()
  576. *
  577. * Availability:
  578. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Mac OS X: in version 10.0 and later
  581. */
  582. EXTERN_API( OSErr )
  583. LoadIconCache(
  584. const Rect * theRect,
  585. IconAlignmentType align,
  586. IconTransformType transform,
  587. IconCacheRef theIconCache) THREEWORDINLINE(0x303C, 0x0606, 0xABC9);
  588. /*
  589. * PlotIconMethod()
  590. *
  591. * Availability:
  592. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  593. * CarbonLib: in CarbonLib 1.0 and later
  594. * Mac OS X: in version 10.0 and later
  595. */
  596. EXTERN_API( OSErr )
  597. PlotIconMethod(
  598. const Rect * theRect,
  599. IconAlignmentType align,
  600. IconTransformType transform,
  601. IconGetterUPP theMethod,
  602. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x0805, 0xABC9);
  603. /*
  604. * GetLabel()
  605. *
  606. * Availability:
  607. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  608. * CarbonLib: in CarbonLib 1.0 and later
  609. * Mac OS X: in version 10.0 and later
  610. */
  611. EXTERN_API( OSErr )
  612. GetLabel(
  613. SInt16 labelNumber,
  614. RGBColor * labelColor,
  615. Str255 labelString) THREEWORDINLINE(0x303C, 0x050B, 0xABC9);
  616. /*
  617. * PtInIconID()
  618. *
  619. * Availability:
  620. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  621. * CarbonLib: in CarbonLib 1.0 and later
  622. * Mac OS X: in version 10.0 and later
  623. */
  624. EXTERN_API( Boolean )
  625. PtInIconID(
  626. Point testPt,
  627. const Rect * iconRect,
  628. IconAlignmentType align,
  629. SInt16 iconID) THREEWORDINLINE(0x303C, 0x060D, 0xABC9);
  630. /*
  631. * PtInIconSuite()
  632. *
  633. * Availability:
  634. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Mac OS X: in version 10.0 and later
  637. */
  638. EXTERN_API( Boolean )
  639. PtInIconSuite(
  640. Point testPt,
  641. const Rect * iconRect,
  642. IconAlignmentType align,
  643. IconSuiteRef theIconSuite) THREEWORDINLINE(0x303C, 0x070E, 0xABC9);
  644. /*
  645. * PtInIconMethod()
  646. *
  647. * Availability:
  648. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  649. * CarbonLib: in CarbonLib 1.0 and later
  650. * Mac OS X: in version 10.0 and later
  651. */
  652. EXTERN_API( Boolean )
  653. PtInIconMethod(
  654. Point testPt,
  655. const Rect * iconRect,
  656. IconAlignmentType align,
  657. IconGetterUPP theMethod,
  658. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x090F, 0xABC9);
  659. /*
  660. * RectInIconID()
  661. *
  662. * Availability:
  663. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  664. * CarbonLib: in CarbonLib 1.0 and later
  665. * Mac OS X: in version 10.0 and later
  666. */
  667. EXTERN_API( Boolean )
  668. RectInIconID(
  669. const Rect * testRect,
  670. const Rect * iconRect,
  671. IconAlignmentType align,
  672. SInt16 iconID) THREEWORDINLINE(0x303C, 0x0610, 0xABC9);
  673. /*
  674. * RectInIconSuite()
  675. *
  676. * Availability:
  677. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  678. * CarbonLib: in CarbonLib 1.0 and later
  679. * Mac OS X: in version 10.0 and later
  680. */
  681. EXTERN_API( Boolean )
  682. RectInIconSuite(
  683. const Rect * testRect,
  684. const Rect * iconRect,
  685. IconAlignmentType align,
  686. IconSuiteRef theIconSuite) THREEWORDINLINE(0x303C, 0x0711, 0xABC9);
  687. /*
  688. * RectInIconMethod()
  689. *
  690. * Availability:
  691. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  692. * CarbonLib: in CarbonLib 1.0 and later
  693. * Mac OS X: in version 10.0 and later
  694. */
  695. EXTERN_API( Boolean )
  696. RectInIconMethod(
  697. const Rect * testRect,
  698. const Rect * iconRect,
  699. IconAlignmentType align,
  700. IconGetterUPP theMethod,
  701. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x0912, 0xABC9);
  702. /*
  703. * IconIDToRgn()
  704. *
  705. * Availability:
  706. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  707. * CarbonLib: in CarbonLib 1.0 and later
  708. * Mac OS X: in version 10.0 and later
  709. */
  710. EXTERN_API( OSErr )
  711. IconIDToRgn(
  712. RgnHandle theRgn,
  713. const Rect * iconRect,
  714. IconAlignmentType align,
  715. SInt16 iconID) THREEWORDINLINE(0x303C, 0x0613, 0xABC9);
  716. /*
  717. * IconSuiteToRgn()
  718. *
  719. * Availability:
  720. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  721. * CarbonLib: in CarbonLib 1.0 and later
  722. * Mac OS X: in version 10.0 and later
  723. */
  724. EXTERN_API( OSErr )
  725. IconSuiteToRgn(
  726. RgnHandle theRgn,
  727. const Rect * iconRect,
  728. IconAlignmentType align,
  729. IconSuiteRef theIconSuite) THREEWORDINLINE(0x303C, 0x0714, 0xABC9);
  730. /*
  731. * IconMethodToRgn()
  732. *
  733. * Availability:
  734. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  735. * CarbonLib: in CarbonLib 1.0 and later
  736. * Mac OS X: in version 10.0 and later
  737. */
  738. EXTERN_API( OSErr )
  739. IconMethodToRgn(
  740. RgnHandle theRgn,
  741. const Rect * iconRect,
  742. IconAlignmentType align,
  743. IconGetterUPP theMethod,
  744. void * yourDataPtr) THREEWORDINLINE(0x303C, 0x0915, 0xABC9);
  745. /*
  746. * SetSuiteLabel()
  747. *
  748. * Availability:
  749. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  750. * CarbonLib: in CarbonLib 1.0 and later
  751. * Mac OS X: in version 10.0 and later
  752. */
  753. EXTERN_API( OSErr )
  754. SetSuiteLabel(
  755. IconSuiteRef theSuite,
  756. SInt16 theLabel) THREEWORDINLINE(0x303C, 0x0316, 0xABC9);
  757. /*
  758. * GetSuiteLabel()
  759. *
  760. * Availability:
  761. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  762. * CarbonLib: in CarbonLib 1.0 and later
  763. * Mac OS X: in version 10.0 and later
  764. */
  765. EXTERN_API( SInt16 )
  766. GetSuiteLabel(IconSuiteRef theSuite) THREEWORDINLINE(0x303C, 0x0217, 0xABC9);
  767. /*
  768. * GetIconCacheData()
  769. *
  770. * Availability:
  771. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  772. * CarbonLib: in CarbonLib 1.0 and later
  773. * Mac OS X: in version 10.0 and later
  774. */
  775. EXTERN_API( OSErr )
  776. GetIconCacheData(
  777. IconCacheRef theCache,
  778. void ** theData) THREEWORDINLINE(0x303C, 0x0419, 0xABC9);
  779. /*
  780. * SetIconCacheData()
  781. *
  782. * Availability:
  783. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  784. * CarbonLib: in CarbonLib 1.0 and later
  785. * Mac OS X: in version 10.0 and later
  786. */
  787. EXTERN_API( OSErr )
  788. SetIconCacheData(
  789. IconCacheRef theCache,
  790. void * theData) THREEWORDINLINE(0x303C, 0x041A, 0xABC9);
  791. /*
  792. * GetIconCacheProc()
  793. *
  794. * Availability:
  795. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  796. * CarbonLib: in CarbonLib 1.0 and later
  797. * Mac OS X: in version 10.0 and later
  798. */
  799. EXTERN_API( OSErr )
  800. GetIconCacheProc(
  801. IconCacheRef theCache,
  802. IconGetterUPP * theProc) THREEWORDINLINE(0x303C, 0x041B, 0xABC9);
  803. /*
  804. * SetIconCacheProc()
  805. *
  806. * Availability:
  807. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  808. * CarbonLib: in CarbonLib 1.0 and later
  809. * Mac OS X: in version 10.0 and later
  810. */
  811. EXTERN_API( OSErr )
  812. SetIconCacheProc(
  813. IconCacheRef theCache,
  814. IconGetterUPP theProc) THREEWORDINLINE(0x303C, 0x041C, 0xABC9);
  815. /*
  816. * PlotIconHandle()
  817. *
  818. * Availability:
  819. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  820. * CarbonLib: in CarbonLib 1.0 and later
  821. * Mac OS X: in version 10.0 and later
  822. */
  823. EXTERN_API( OSErr )
  824. PlotIconHandle(
  825. const Rect * theRect,
  826. IconAlignmentType align,
  827. IconTransformType transform,
  828. Handle theIcon) THREEWORDINLINE(0x303C, 0x061D, 0xABC9);
  829. /*
  830. * PlotSICNHandle()
  831. *
  832. * Availability:
  833. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  834. * CarbonLib: in CarbonLib 1.0 and later
  835. * Mac OS X: in version 10.0 and later
  836. */
  837. EXTERN_API( OSErr )
  838. PlotSICNHandle(
  839. const Rect * theRect,
  840. IconAlignmentType align,
  841. IconTransformType transform,
  842. Handle theSICN) THREEWORDINLINE(0x303C, 0x061E, 0xABC9);
  843. /*
  844. * PlotCIconHandle()
  845. *
  846. * Availability:
  847. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  848. * CarbonLib: in CarbonLib 1.0 and later
  849. * Mac OS X: in version 10.0 and later
  850. */
  851. EXTERN_API( OSErr )
  852. PlotCIconHandle(
  853. const Rect * theRect,
  854. IconAlignmentType align,
  855. IconTransformType transform,
  856. CIconHandle theCIcon) THREEWORDINLINE(0x303C, 0x061F, 0xABC9);
  857. /*
  858. IconServices is an efficient mechanism to share icon data amongst multiple
  859. clients. It avoids duplication of data; it provides efficient caching,
  860. releasing memory when the icon data is no longer needed; it can provide
  861. the appropriate icon for any filesystem object; it can provide commonly
  862. used icons (caution, note, help...); it is Appearance-savvy: the icons
  863. are switched when appropriate.
  864. IconServices refer to cached icon data using IconRef, a 32-bit opaque
  865. value. IconRefs are reference counted. When there are no more "owners"
  866. of an IconRef, the memory used by the icon bitmap is disposed of.
  867. Two files of same type and creator with no custom icon will have the same IconRef.
  868. Files with custom icons will have their own IconRef.
  869. */
  870. /*
  871. Use the special creator kSystemIconsCreator to get "standard" icons
  872. that are not associated with a file, such as the help icon.
  873. Note that all lowercase creators are reserved by Apple.
  874. */
  875. enum {
  876. kSystemIconsCreator = FOUR_CHAR_CODE('macs')
  877. };
  878. /*
  879. Type of the predefined/generic icons. For example, the call:
  880. err = GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
  881. will retun in iconRef the IconRef for the standard help icon.
  882. */
  883. /* Generic Finder icons */
  884. enum {
  885. kClipboardIcon = FOUR_CHAR_CODE('CLIP'),
  886. kClippingUnknownTypeIcon = FOUR_CHAR_CODE('clpu'),
  887. kClippingPictureTypeIcon = FOUR_CHAR_CODE('clpp'),
  888. kClippingTextTypeIcon = FOUR_CHAR_CODE('clpt'),
  889. kClippingSoundTypeIcon = FOUR_CHAR_CODE('clps'),
  890. kDesktopIcon = FOUR_CHAR_CODE('desk'),
  891. kFinderIcon = FOUR_CHAR_CODE('FNDR'),
  892. kFontSuitcaseIcon = FOUR_CHAR_CODE('FFIL'),
  893. kFullTrashIcon = FOUR_CHAR_CODE('ftrh'),
  894. kGenericApplicationIcon = FOUR_CHAR_CODE('APPL'),
  895. kGenericCDROMIcon = FOUR_CHAR_CODE('cddr'),
  896. kGenericControlPanelIcon = FOUR_CHAR_CODE('APPC'),
  897. kGenericControlStripModuleIcon = FOUR_CHAR_CODE('sdev'),
  898. kGenericComponentIcon = FOUR_CHAR_CODE('thng'),
  899. kGenericDeskAccessoryIcon = FOUR_CHAR_CODE('APPD'),
  900. kGenericDocumentIcon = FOUR_CHAR_CODE('docu'),
  901. kGenericEditionFileIcon = FOUR_CHAR_CODE('edtf'),
  902. kGenericExtensionIcon = FOUR_CHAR_CODE('INIT'),
  903. kGenericFileServerIcon = FOUR_CHAR_CODE('srvr'),
  904. kGenericFontIcon = FOUR_CHAR_CODE('ffil'),
  905. kGenericFontScalerIcon = FOUR_CHAR_CODE('sclr'),
  906. kGenericFloppyIcon = FOUR_CHAR_CODE('flpy'),
  907. kGenericHardDiskIcon = FOUR_CHAR_CODE('hdsk'),
  908. kGenericIDiskIcon = FOUR_CHAR_CODE('idsk'),
  909. kGenericRemovableMediaIcon = FOUR_CHAR_CODE('rmov'),
  910. kGenericMoverObjectIcon = FOUR_CHAR_CODE('movr'),
  911. kGenericPCCardIcon = FOUR_CHAR_CODE('pcmc'),
  912. kGenericPreferencesIcon = FOUR_CHAR_CODE('pref'),
  913. kGenericQueryDocumentIcon = FOUR_CHAR_CODE('qery'),
  914. kGenericRAMDiskIcon = FOUR_CHAR_CODE('ramd'),
  915. kGenericSharedLibaryIcon = FOUR_CHAR_CODE('shlb'),
  916. kGenericStationeryIcon = FOUR_CHAR_CODE('sdoc'),
  917. kGenericSuitcaseIcon = FOUR_CHAR_CODE('suit'),
  918. kGenericURLIcon = FOUR_CHAR_CODE('gurl'),
  919. kGenericWORMIcon = FOUR_CHAR_CODE('worm'),
  920. kInternationalResourcesIcon = FOUR_CHAR_CODE('ifil'),
  921. kKeyboardLayoutIcon = FOUR_CHAR_CODE('kfil'),
  922. kSoundFileIcon = FOUR_CHAR_CODE('sfil'),
  923. kSystemSuitcaseIcon = FOUR_CHAR_CODE('zsys'),
  924. kTrashIcon = FOUR_CHAR_CODE('trsh'),
  925. kTrueTypeFontIcon = FOUR_CHAR_CODE('tfil'),
  926. kTrueTypeFlatFontIcon = FOUR_CHAR_CODE('sfnt'),
  927. kTrueTypeMultiFlatFontIcon = FOUR_CHAR_CODE('ttcf'),
  928. kUserIDiskIcon = FOUR_CHAR_CODE('udsk'),
  929. kUnknownFSObjectIcon = FOUR_CHAR_CODE('unfs'),
  930. kInternationResourcesIcon = kInternationalResourcesIcon /* old name*/
  931. };
  932. /* Internet locations */
  933. enum {
  934. kInternetLocationHTTPIcon = FOUR_CHAR_CODE('ilht'),
  935. kInternetLocationFTPIcon = FOUR_CHAR_CODE('ilft'),
  936. kInternetLocationAppleShareIcon = FOUR_CHAR_CODE('ilaf'),
  937. kInternetLocationAppleTalkZoneIcon = FOUR_CHAR_CODE('ilat'),
  938. kInternetLocationFileIcon = FOUR_CHAR_CODE('ilfi'),
  939. kInternetLocationMailIcon = FOUR_CHAR_CODE('ilma'),
  940. kInternetLocationNewsIcon = FOUR_CHAR_CODE('ilnw'),
  941. kInternetLocationNSLNeighborhoodIcon = FOUR_CHAR_CODE('ilns'),
  942. kInternetLocationGenericIcon = FOUR_CHAR_CODE('ilge')
  943. };
  944. /* Folders */
  945. enum {
  946. kGenericFolderIcon = FOUR_CHAR_CODE('fldr'),
  947. kDropFolderIcon = FOUR_CHAR_CODE('dbox'),
  948. kMountedFolderIcon = FOUR_CHAR_CODE('mntd'),
  949. kOpenFolderIcon = FOUR_CHAR_CODE('ofld'),
  950. kOwnedFolderIcon = FOUR_CHAR_CODE('ownd'),
  951. kPrivateFolderIcon = FOUR_CHAR_CODE('prvf'),
  952. kSharedFolderIcon = FOUR_CHAR_CODE('shfl')
  953. };
  954. /* Sharing Privileges icons */
  955. enum {
  956. kSharingPrivsNotApplicableIcon = FOUR_CHAR_CODE('shna'),
  957. kSharingPrivsReadOnlyIcon = FOUR_CHAR_CODE('shro'),
  958. kSharingPrivsReadWriteIcon = FOUR_CHAR_CODE('shrw'),
  959. kSharingPrivsUnknownIcon = FOUR_CHAR_CODE('shuk'),
  960. kSharingPrivsWritableIcon = FOUR_CHAR_CODE('writ')
  961. };
  962. /* Users and Groups icons */
  963. enum {
  964. kUserFolderIcon = FOUR_CHAR_CODE('ufld'),
  965. kWorkgroupFolderIcon = FOUR_CHAR_CODE('wfld'),
  966. kGuestUserIcon = FOUR_CHAR_CODE('gusr'),
  967. kUserIcon = FOUR_CHAR_CODE('user'),
  968. kOwnerIcon = FOUR_CHAR_CODE('susr'),
  969. kGroupIcon = FOUR_CHAR_CODE('grup')
  970. };
  971. /* Special folders */
  972. enum {
  973. kAppearanceFolderIcon = FOUR_CHAR_CODE('appr'),
  974. kAppleExtrasFolderIcon = 0x616578C4,
  975. kAppleMenuFolderIcon = FOUR_CHAR_CODE('amnu'),
  976. kApplicationsFolderIcon = FOUR_CHAR_CODE('apps'),
  977. kApplicationSupportFolderIcon = FOUR_CHAR_CODE('asup'),
  978. kAssistantsFolderIcon = 0x617374C4,
  979. kColorSyncFolderIcon = FOUR_CHAR_CODE('prof'),
  980. kContextualMenuItemsFolderIcon = FOUR_CHAR_CODE('cmnu'),
  981. kControlPanelDisabledFolderIcon = FOUR_CHAR_CODE('ctrD'),
  982. kControlPanelFolderIcon = FOUR_CHAR_CODE('ctrl'),
  983. kControlStripModulesFolderIcon = 0x736476C4,
  984. kDocumentsFolderIcon = FOUR_CHAR_CODE('docs'),
  985. kExtensionsDisabledFolderIcon = FOUR_CHAR_CODE('extD'),
  986. kExtensionsFolderIcon = FOUR_CHAR_CODE('extn'),
  987. kFavoritesFolderIcon = FOUR_CHAR_CODE('favs'),
  988. kFontsFolderIcon = FOUR_CHAR_CODE('font'),
  989. kHelpFolderIcon = 0xC4686C70,
  990. kInternetFolderIcon = 0x696E74C4,
  991. kInternetPlugInFolderIcon = 0xC46E6574,
  992. kInternetSearchSitesFolderIcon = FOUR_CHAR_CODE('issf'),
  993. kLocalesFolderIcon = 0xC46C6F63,
  994. kMacOSReadMeFolderIcon = 0x6D6F72C4,
  995. kPublicFolderIcon = FOUR_CHAR_CODE('pubf'),
  996. kPreferencesFolderIcon = 0x707266C4,
  997. kPrinterDescriptionFolderIcon = FOUR_CHAR_CODE('ppdf'),
  998. kPrinterDriverFolderIcon = 0xC4707264,
  999. kPrintMonitorFolderIcon = FOUR_CHAR_CODE('prnt'),
  1000. kRecentApplicationsFolderIcon = FOUR_CHAR_CODE('rapp'),
  1001. kRecentDocumentsFolderIcon = FOUR_CHAR_CODE('rdoc'),
  1002. kRecentServersFolderIcon = FOUR_CHAR_CODE('rsrv'),
  1003. kScriptingAdditionsFolderIcon = 0xC4736372,
  1004. kSharedLibrariesFolderIcon = 0xC46C6962,
  1005. kScriptsFolderIcon = 0x736372C4,
  1006. kShutdownItemsDisabledFolderIcon = FOUR_CHAR_CODE('shdD'),
  1007. kShutdownItemsFolderIcon = FOUR_CHAR_CODE('shdf'),
  1008. kSpeakableItemsFolder = FOUR_CHAR_CODE('spki'),
  1009. kStartupItemsDisabledFolderIcon = FOUR_CHAR_CODE('strD'),
  1010. kStartupItemsFolderIcon = FOUR_CHAR_CODE('strt'),
  1011. kSystemExtensionDisabledFolderIcon = FOUR_CHAR_CODE('macD'),
  1012. kSystemFolderIcon = FOUR_CHAR_CODE('macs'),
  1013. kTextEncodingsFolderIcon = 0xC4746578,
  1014. kUsersFolderIcon = 0x757372C4,
  1015. kUtilitiesFolderIcon = 0x757469C4,
  1016. kVoicesFolderIcon = FOUR_CHAR_CODE('fvoc')
  1017. };
  1018. /* Badges */
  1019. enum {
  1020. kAppleScriptBadgeIcon = FOUR_CHAR_CODE('scrp'),
  1021. kLockedBadgeIcon = FOUR_CHAR_CODE('lbdg'),
  1022. kMountedBadgeIcon = FOUR_CHAR_CODE('mbdg'),
  1023. kSharedBadgeIcon = FOUR_CHAR_CODE('sbdg'),
  1024. kAliasBadgeIcon = FOUR_CHAR_CODE('abdg'),
  1025. kAlertCautionBadgeIcon = FOUR_CHAR_CODE('cbdg')
  1026. };
  1027. /* Alert icons */
  1028. enum {
  1029. kAlertNoteIcon = FOUR_CHAR_CODE('note'),
  1030. kAlertCautionIcon = FOUR_CHAR_CODE('caut'),
  1031. kAlertStopIcon = FOUR_CHAR_CODE('stop')
  1032. };
  1033. /* Networking icons */
  1034. enum {
  1035. kAppleTalkIcon = FOUR_CHAR_CODE('atlk'),
  1036. kAppleTalkZoneIcon = FOUR_CHAR_CODE('atzn'),
  1037. kAFPServerIcon = FOUR_CHAR_CODE('afps'),
  1038. kFTPServerIcon = FOUR_CHAR_CODE('ftps'),
  1039. kHTTPServerIcon = FOUR_CHAR_CODE('htps'),
  1040. kGenericNetworkIcon = FOUR_CHAR_CODE('gnet'),
  1041. kIPFileServerIcon = FOUR_CHAR_CODE('isrv')
  1042. };
  1043. /* Toolbar icons */
  1044. enum {
  1045. kToolbarCustomizeIcon = FOUR_CHAR_CODE('tcus'),
  1046. kToolbarDeleteIcon = FOUR_CHAR_CODE('tdel'),
  1047. kToolbarFavoritesIcon = FOUR_CHAR_CODE('tfav'),
  1048. kToolbarHomeIcon = FOUR_CHAR_CODE('thom')
  1049. };
  1050. /* Other icons */
  1051. enum {
  1052. kAppleLogoIcon = FOUR_CHAR_CODE('capl'),
  1053. kAppleMenuIcon = FOUR_CHAR_CODE('sapl'),
  1054. kBackwardArrowIcon = FOUR_CHAR_CODE('baro'),
  1055. kFavoriteItemsIcon = FOUR_CHAR_CODE('favr'),
  1056. kForwardArrowIcon = FOUR_CHAR_CODE('faro'),
  1057. kGridIcon = FOUR_CHAR_CODE('grid'),
  1058. kHelpIcon = FOUR_CHAR_CODE('help'),
  1059. kKeepArrangedIcon = FOUR_CHAR_CODE('arng'),
  1060. kLockedIcon = FOUR_CHAR_CODE('lock'),
  1061. kNoFilesIcon = FOUR_CHAR_CODE('nfil'),
  1062. kNoFolderIcon = FOUR_CHAR_CODE('nfld'),
  1063. kNoWriteIcon = FOUR_CHAR_CODE('nwrt'),
  1064. kProtectedApplicationFolderIcon = FOUR_CHAR_CODE('papp'),
  1065. kProtectedSystemFolderIcon = FOUR_CHAR_CODE('psys'),
  1066. kRecentItemsIcon = FOUR_CHAR_CODE('rcnt'),
  1067. kShortcutIcon = FOUR_CHAR_CODE('shrt'),
  1068. kSortAscendingIcon = FOUR_CHAR_CODE('asnd'),
  1069. kSortDescendingIcon = FOUR_CHAR_CODE('dsnd'),
  1070. kUnlockedIcon = FOUR_CHAR_CODE('ulck'),
  1071. kConnectToIcon = FOUR_CHAR_CODE('cnct'),
  1072. kGenericWindowIcon = FOUR_CHAR_CODE('gwin'),
  1073. kQuestionMarkIcon = FOUR_CHAR_CODE('ques'),
  1074. kDeleteAliasIcon = FOUR_CHAR_CODE('dali'),
  1075. kEjectMediaIcon = FOUR_CHAR_CODE('ejec'),
  1076. kBurningIcon = FOUR_CHAR_CODE('burn'),
  1077. kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar')
  1078. };
  1079. /* IconServicesUsageFlags */
  1080. typedef UInt32 IconServicesUsageFlags;
  1081. enum {
  1082. kIconServicesNormalUsageFlag = 0
  1083. };
  1084. /*
  1085. kIconServicesCatalogInfoMask - Minimal bitmask for use with
  1086. GetIconRefFromFileInfo(). Use this mask with FSGetCatalogInfo
  1087. before calling GetIconRefFromFileInfo().
  1088. */
  1089. enum {
  1090. kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
  1091. };
  1092. /*
  1093. * PlotIconRefFlags
  1094. *
  1095. * Discussion:
  1096. * Flags that can be passed to the PlotIconRefInContext routine.
  1097. */
  1098. typedef UInt32 PlotIconRefFlags;
  1099. enum {
  1100. /*
  1101. * Draw the icon image and alpha channel.
  1102. */
  1103. kPlotIconRefNormalFlags = 0L,
  1104. /*
  1105. * Only draw the alpha channel.
  1106. */
  1107. kPlotIconRefNoImage = (1 << 1),
  1108. /*
  1109. * Only draw the image.
  1110. */
  1111. kPlotIconRefNoMask = (1 << 2)
  1112. };
  1113. /*
  1114. ==============================================================================
  1115. Initialization and Termination
  1116. ==============================================================================
  1117. */
  1118. /*
  1119. IconServicesInit
  1120. Call this routine once per classic 68K application initialization.
  1121. This routine does not need to be called at boot time.
  1122. */
  1123. #if CALL_NOT_IN_CARBON
  1124. /*
  1125. * IconServicesInit()
  1126. *
  1127. * Availability:
  1128. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1129. * CarbonLib: not available
  1130. * Mac OS X: not available
  1131. */
  1132. EXTERN_API( OSErr )
  1133. IconServicesInit(CFragInitBlockPtr initBlockPtr) TWOWORDINLINE(0x7015, 0xAA75);
  1134. /*
  1135. IconServicesTerminate:
  1136. Call this routine once from the termination of a classic 68K application.
  1137. This routine does not need to be called at boot time.
  1138. */
  1139. /*
  1140. * IconServicesTerminate()
  1141. *
  1142. * Availability:
  1143. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1144. * CarbonLib: not available
  1145. * Mac OS X: not available
  1146. */
  1147. EXTERN_API( void )
  1148. IconServicesTerminate(void) TWOWORDINLINE(0x7016, 0xAA75);
  1149. #endif /* CALL_NOT_IN_CARBON */
  1150. /*
  1151. ==============================================================================
  1152. Converting data structures
  1153. ==============================================================================
  1154. */
  1155. /*
  1156. IconRefToIconFamily
  1157. This routines returns a new IconFamily that contains the data corresponding
  1158. to the specified IconRef.
  1159. */
  1160. /*
  1161. * IconRefToIconFamily()
  1162. *
  1163. * Availability:
  1164. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1165. * CarbonLib: in CarbonLib 1.0 and later
  1166. * Mac OS X: in version 10.0 and later
  1167. */
  1168. EXTERN_API( OSErr )
  1169. IconRefToIconFamily(
  1170. IconRef theIconRef,
  1171. IconSelectorValue whichIcons,
  1172. IconFamilyHandle * iconFamily) TWOWORDINLINE(0x7024, 0xAA75);
  1173. /*
  1174. IconFamilyToIconSuite
  1175. This routine transfers the data from an icon family handle into an icon suite.
  1176. */
  1177. /*
  1178. * IconFamilyToIconSuite()
  1179. *
  1180. * Availability:
  1181. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1182. * CarbonLib: in CarbonLib 1.0 and later
  1183. * Mac OS X: in version 10.0 and later
  1184. */
  1185. EXTERN_API( OSErr )
  1186. IconFamilyToIconSuite(
  1187. IconFamilyHandle iconFamily,
  1188. IconSelectorValue whichIcons,
  1189. IconSuiteRef * iconSuite) TWOWORDINLINE(0x7025, 0xAA75);
  1190. /*
  1191. IconSuiteToIconFamily
  1192. This routine transfers the data in an icon suite into an icon family.
  1193. */
  1194. /*
  1195. * IconSuiteToIconFamily()
  1196. *
  1197. * Availability:
  1198. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1199. * CarbonLib: in CarbonLib 1.0 and later
  1200. * Mac OS X: in version 10.0 and later
  1201. */
  1202. EXTERN_API( OSErr )
  1203. IconSuiteToIconFamily(
  1204. IconSuiteRef iconSuite,
  1205. IconSelectorValue whichIcons,
  1206. IconFamilyHandle * iconFamily) TWOWORDINLINE(0x7026, 0xAA75);
  1207. /*
  1208. SetIconFamilyData
  1209. Change the data of an icon family. The data is copied.
  1210. The type can be one of the icon type, or 'PICT'.
  1211. The data will be compressed if needed.
  1212. */
  1213. /*
  1214. * SetIconFamilyData()
  1215. *
  1216. * Availability:
  1217. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1218. * CarbonLib: in CarbonLib 1.0 and later
  1219. * Mac OS X: in version 10.0 and later
  1220. */
  1221. EXTERN_API( OSErr )
  1222. SetIconFamilyData(
  1223. IconFamilyHandle iconFamily,
  1224. OSType iconType,
  1225. Handle h) TWOWORDINLINE(0x7030, 0xAA75);
  1226. /*
  1227. GetIconFamilyData
  1228. Return a copy of the data in the icon family.
  1229. The type can be one of the icon type, or 'PICT'
  1230. The data will be returned uncompressed.
  1231. The handle (h) will be resized as appropriate. If no data of the
  1232. requested type is present, the handle size will be set to 0.
  1233. */
  1234. /*
  1235. * GetIconFamilyData()
  1236. *
  1237. * Availability:
  1238. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1239. * CarbonLib: in CarbonLib 1.0 and later
  1240. * Mac OS X: in version 10.0 and later
  1241. */
  1242. EXTERN_API( OSErr )
  1243. GetIconFamilyData(
  1244. IconFamilyHandle iconFamily,
  1245. OSType iconType,
  1246. Handle h) TWOWORDINLINE(0x7031, 0xAA75);
  1247. /*
  1248. ==============================================================================
  1249. Reference counting
  1250. ==============================================================================
  1251. */
  1252. /*
  1253. GetIconRefOwners
  1254. This routine returns the reference count for the IconRef, or number of owners.
  1255. A valid IconRef always has at least one owner.
  1256. */
  1257. /*
  1258. * GetIconRefOwners()
  1259. *
  1260. * Availability:
  1261. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1262. * CarbonLib: in CarbonLib 1.0 and later
  1263. * Mac OS X: in version 10.0 and later
  1264. */
  1265. EXTERN_API( OSErr )
  1266. GetIconRefOwners(
  1267. IconRef theIconRef,
  1268. UInt16 * owners) TWOWORDINLINE(0x700B, 0xAA75);
  1269. /*
  1270. AcquireIconRef
  1271. This routine increments the reference count for the IconRef
  1272. */
  1273. /*
  1274. * AcquireIconRef()
  1275. *
  1276. * Availability:
  1277. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1278. * CarbonLib: in CarbonLib 1.0 and later
  1279. * Mac OS X: in version 10.0 and later
  1280. */
  1281. EXTERN_API( OSErr )
  1282. AcquireIconRef(IconRef theIconRef) TWOWORDINLINE(0x7027, 0xAA75);
  1283. /*
  1284. ReleaseIconRef
  1285. This routine decrements the reference count for the IconRef.
  1286. When the reference count reaches 0, all memory allocated for the icon
  1287. is disposed. Any subsequent use of the IconRef is invalid.
  1288. */
  1289. /*
  1290. * ReleaseIconRef()
  1291. *
  1292. * Availability:
  1293. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1294. * CarbonLib: in CarbonLib 1.0 and later
  1295. * Mac OS X: in version 10.0 and later
  1296. */
  1297. EXTERN_API( OSErr )
  1298. ReleaseIconRef(IconRef theIconRef) TWOWORDINLINE(0x7028, 0xAA75);
  1299. /*
  1300. ==============================================================================
  1301. Getting an IconRef
  1302. ==============================================================================
  1303. */
  1304. /*
  1305. GetIconRefFromFile
  1306. This routine returns an icon ref for the specified file, folder or volume.
  1307. The label information is provided separately, since two files with the same icon
  1308. but a different label would share the same iconRef. The label can be used in
  1309. PlotIconRef() for example.
  1310. Use this routine if you have no information about the file system object. If
  1311. you have already done a GetCatInfo on the file and want to save some I/O,
  1312. call GetIconRefFromFolder() if you know it's a folder with no custom icon or
  1313. call GetIconRef() if it's a file with no custom icon.
  1314. This routine increments the reference count of the returned IconRef. Call
  1315. ReleaseIconRef() when you're done with it.
  1316. */
  1317. /*
  1318. * GetIconRefFromFile()
  1319. *
  1320. * Availability:
  1321. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1322. * CarbonLib: in CarbonLib 1.0 and later
  1323. * Mac OS X: in version 10.0 and later
  1324. */
  1325. EXTERN_API( OSErr )
  1326. GetIconRefFromFile(
  1327. const FSSpec * theFile,
  1328. IconRef * theIconRef,
  1329. SInt16 * theLabel) TWOWORDINLINE(0x7002, 0xAA75);
  1330. /*
  1331. GetIconRef
  1332. This routine returns an icon ref for an icon in the desktop database or
  1333. for a registered icon.
  1334. The system registers a set of icon such as the help icon with the creator
  1335. code kSystemIconsCreator. See above for a list of the registered system types.
  1336. The vRefNum is used as a hint on where to look for the icon first. Use
  1337. kOnSystemDisk if you don't know what to pass.
  1338. This routine increments the reference count of the returned IconRef. Call
  1339. ReleaseIconRef() when you're done with it.
  1340. */
  1341. /*
  1342. * GetIconRef()
  1343. *
  1344. * Availability:
  1345. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1346. * CarbonLib: in CarbonLib 1.0 and later
  1347. * Mac OS X: in version 10.0 and later
  1348. */
  1349. EXTERN_API( OSErr )
  1350. GetIconRef(
  1351. SInt16 vRefNum,
  1352. OSType creator,
  1353. OSType iconType,
  1354. IconRef * theIconRef) TWOWORDINLINE(0x7021, 0xAA75);
  1355. /*
  1356. GetIconRefFromFolder
  1357. This routine returns an icon ref for a folder with no custom icon.
  1358. Use the more generic, but slightly slower, GetIconRefFromFile() if
  1359. you don't already have the necessary info about the file.
  1360. Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
  1361. Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
  1362. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1363. when you're done with it.
  1364. */
  1365. /*
  1366. * GetIconRefFromFolder()
  1367. *
  1368. * Availability:
  1369. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1370. * CarbonLib: in CarbonLib 1.0 and later
  1371. * Mac OS X: in version 10.0 and later
  1372. */
  1373. EXTERN_API( OSErr )
  1374. GetIconRefFromFolder(
  1375. SInt16 vRefNum,
  1376. SInt32 parentFolderID,
  1377. SInt32 folderID,
  1378. SInt8 attributes,
  1379. SInt8 accessPrivileges,
  1380. IconRef * theIconRef) TWOWORDINLINE(0x7022, 0xAA75);
  1381. /* GetIconRefFromFileInfo*/
  1382. /*
  1383. * GetIconRefFromFileInfo()
  1384. *
  1385. * Summary:
  1386. * This routine returns an IconRef for a file with minimal file I/O.
  1387. *
  1388. * Discussion:
  1389. * To minimize file operations, FSGetCatalogInfo should be called
  1390. * prior to calling this routine. The FSCatalogInfo should
  1391. * correspond to kIconServicesCatalogInfoMask The name should be
  1392. * fetched and passed in. If either the name or the correct catalog
  1393. * info is not passed in, this routine will do file operations for
  1394. * this information instead.
  1395. *
  1396. * Parameters:
  1397. *
  1398. * inRef:
  1399. * An FSRef for the target file
  1400. *
  1401. * inFileNameLength:
  1402. * The length of the name of the target file
  1403. *
  1404. * inFileName:
  1405. * The name of the target file
  1406. *
  1407. * inWhichInfo:
  1408. * The mask of file info already acquired.
  1409. *
  1410. * inCatalogInfo:
  1411. * The catalog info already acquired.
  1412. *
  1413. * inUsageFlags:
  1414. * The usage flags for this call (use
  1415. * kIconServicesNormalUsageFlag).
  1416. *
  1417. * outIconRef:
  1418. * The output IconRef for the routine.
  1419. *
  1420. * outLabel:
  1421. * The output label for the icon/file.
  1422. *
  1423. * Availability:
  1424. * Non-Carbon CFM: not available
  1425. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1426. * Mac OS X: in version 10.1 and later
  1427. */
  1428. EXTERN_API( OSStatus )
  1429. GetIconRefFromFileInfo(
  1430. const FSRef * inRef,
  1431. UniCharCount inFileNameLength,
  1432. const UniChar * inFileName, /* can be NULL */
  1433. FSCatalogInfoBitmap inWhichInfo,
  1434. const FSCatalogInfo * inCatalogInfo, /* can be NULL */
  1435. IconServicesUsageFlags inUsageFlags,
  1436. IconRef * outIconRef,
  1437. SInt16 * outLabel);
  1438. /*
  1439. ==============================================================================
  1440. Adding and modifying IconRef
  1441. ==============================================================================
  1442. */
  1443. /*
  1444. RegisterIconRefFromIconFamily
  1445. This routine adds a new entry to the IconRef registry. Other clients will be
  1446. able to access it using the (creator, iconType) pair specified here.
  1447. Lower-case creators are reserved for the system.
  1448. Consider using RegisterIconRefFromResource() if possible, since the data
  1449. registered using RegisterIconRefFromFamily() cannot be purged.
  1450. The iconFamily data is copied and the caller is reponsible for disposing of it.
  1451. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1452. when you're done with it.
  1453. */
  1454. /*
  1455. * RegisterIconRefFromIconFamily()
  1456. *
  1457. * Availability:
  1458. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1459. * CarbonLib: in CarbonLib 1.0 and later
  1460. * Mac OS X: in version 10.0 and later
  1461. */
  1462. EXTERN_API( OSErr )
  1463. RegisterIconRefFromIconFamily(
  1464. OSType creator,
  1465. OSType iconType,
  1466. IconFamilyHandle iconFamily,
  1467. IconRef * theIconRef) TWOWORDINLINE(0x701C, 0xAA75);
  1468. /*
  1469. RegisterIconRefFromResource
  1470. Registers an IconRef from a resouce file.
  1471. Lower-case creators are reserved for the system.
  1472. The icon data to be fetched is either classic icon data or an icon family.
  1473. The 'icns' icon family is searched for before the classic icon data.
  1474. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1475. when you're done with it.
  1476. */
  1477. /*
  1478. * RegisterIconRefFromResource()
  1479. *
  1480. * Availability:
  1481. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1482. * CarbonLib: in CarbonLib 1.0 and later
  1483. * Mac OS X: in version 10.0 and later
  1484. */
  1485. EXTERN_API( OSErr )
  1486. RegisterIconRefFromResource(
  1487. OSType creator,
  1488. OSType iconType,
  1489. const FSSpec * resourceFile,
  1490. SInt16 resourceID,
  1491. IconRef * theIconRef) TWOWORDINLINE(0x7023, 0xAA75);
  1492. /* RegisterIconRefFromFSRef*/
  1493. /*
  1494. * RegisterIconRefFromFSRef()
  1495. *
  1496. * Discussion:
  1497. * This routine registers an IconRef from a ".icns" file and
  1498. * associates it with a creator/type pair.
  1499. *
  1500. * Parameters:
  1501. *
  1502. * creator:
  1503. * The creator code for the icns file.
  1504. *
  1505. * iconType:
  1506. * The type code for the icns file
  1507. *
  1508. * iconFile:
  1509. * The FSRef of the icns file.
  1510. *
  1511. * theIconRef:
  1512. * The output IconRef for the routine.
  1513. *
  1514. * Availability:
  1515. * Non-Carbon CFM: not available
  1516. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1517. * Mac OS X: in version 10.1 and later
  1518. */
  1519. EXTERN_API( OSStatus )
  1520. RegisterIconRefFromFSRef(
  1521. OSType creator,
  1522. OSType iconType,
  1523. const FSRef * iconFile,
  1524. IconRef * theIconRef);
  1525. /*
  1526. UnregisterIconRef
  1527. Removes the specified icon from the icon cache (if there are no users of it).
  1528. If some clients are using this iconRef, then the IconRef will be removed when the
  1529. last user calls ReleaseIconRef.
  1530. */
  1531. /*
  1532. * UnregisterIconRef()
  1533. *
  1534. * Availability:
  1535. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1536. * CarbonLib: in CarbonLib 1.0 and later
  1537. * Mac OS X: in version 10.0 and later
  1538. */
  1539. EXTERN_API( OSErr )
  1540. UnregisterIconRef(
  1541. OSType creator,
  1542. OSType iconType) TWOWORDINLINE(0x7008, 0xAA75);
  1543. /*
  1544. UpdateIconRef
  1545. Call this routine to force an update of the data for iconRef.
  1546. For example after changing an icon in the desktop database or changing the custom
  1547. icon of a file. Note that after _adding_ a custom icon to file or folder, you
  1548. need to call GetIconRefFromFile() to get a new IconRef specific to this file.
  1549. This routine does nothing if the IconRef is a registered icon.
  1550. */
  1551. /*
  1552. * UpdateIconRef()
  1553. *
  1554. * Availability:
  1555. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1556. * CarbonLib: in CarbonLib 1.0 and later
  1557. * Mac OS X: in version 10.0 and later
  1558. */
  1559. EXTERN_API( OSErr )
  1560. UpdateIconRef(IconRef theIconRef) TWOWORDINLINE(0x7009, 0xAA75);
  1561. /*
  1562. OverrideIconRefFromResource
  1563. This routines replaces the bitmaps of the specified IconRef with the ones
  1564. in the specified resource file.
  1565. */
  1566. /*
  1567. * OverrideIconRefFromResource()
  1568. *
  1569. * Availability:
  1570. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1571. * CarbonLib: in CarbonLib 1.0 and later
  1572. * Mac OS X: in version 10.0 and later
  1573. */
  1574. EXTERN_API( OSErr )
  1575. OverrideIconRefFromResource(
  1576. IconRef theIconRef,
  1577. const FSSpec * resourceFile,
  1578. SInt16 resourceID) TWOWORDINLINE(0x702A, 0xAA75);
  1579. /*
  1580. OverrideIconRef
  1581. This routines replaces the bitmaps of the specified IconRef with the ones
  1582. from the new IconRef.
  1583. */
  1584. /*
  1585. * OverrideIconRef()
  1586. *
  1587. * Availability:
  1588. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1589. * CarbonLib: in CarbonLib 1.0 and later
  1590. * Mac OS X: in version 10.0 and later
  1591. */
  1592. EXTERN_API( OSErr )
  1593. OverrideIconRef(
  1594. IconRef oldIconRef,
  1595. IconRef newIconRef) TWOWORDINLINE(0x702B, 0xAA75);
  1596. /*
  1597. RemoveIconRefOverride
  1598. This routine remove an override if one was applied to the icon and
  1599. reverts back to the original bitmap data.
  1600. */
  1601. /*
  1602. * RemoveIconRefOverride()
  1603. *
  1604. * Availability:
  1605. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1606. * CarbonLib: in CarbonLib 1.0 and later
  1607. * Mac OS X: in version 10.0 and later
  1608. */
  1609. EXTERN_API( OSErr )
  1610. RemoveIconRefOverride(IconRef theIconRef) TWOWORDINLINE(0x701E, 0xAA75);
  1611. /*
  1612. ==============================================================================
  1613. Creating composite IconRef
  1614. ==============================================================================
  1615. */
  1616. /*
  1617. CompositeIconRef
  1618. Superimposes an IconRef on top of another one
  1619. */
  1620. /*
  1621. * CompositeIconRef()
  1622. *
  1623. * Availability:
  1624. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1625. * CarbonLib: in CarbonLib 1.0 and later
  1626. * Mac OS X: in version 10.0 and later
  1627. */
  1628. EXTERN_API( OSErr )
  1629. CompositeIconRef(
  1630. IconRef backgroundIconRef,
  1631. IconRef foregroundIconRef,
  1632. IconRef * compositeIconRef) TWOWORDINLINE(0x7014, 0xAA75);
  1633. /*
  1634. IsIconRefComposite
  1635. Indicates if a given icon ref is a composite of two other icon refs (and which ones)
  1636. If it isn't a composite, backgroundIconRef and foreGroundIconRef will be 0.
  1637. */
  1638. /*
  1639. * IsIconRefComposite()
  1640. *
  1641. * Availability:
  1642. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1643. * CarbonLib: in CarbonLib 1.0 and later
  1644. * Mac OS X: in version 10.0 and later
  1645. */
  1646. EXTERN_API( OSErr )
  1647. IsIconRefComposite(
  1648. IconRef compositeIconRef,
  1649. IconRef * backgroundIconRef,
  1650. IconRef * foregroundIconRef) TWOWORDINLINE(0x701A, 0xAA75);
  1651. /*
  1652. ==============================================================================
  1653. Using IconRef
  1654. ==============================================================================
  1655. */
  1656. /*
  1657. IsValidIconRef
  1658. Return true if the iconRef passed in is a valid icon ref
  1659. */
  1660. /*
  1661. * IsValidIconRef()
  1662. *
  1663. * Availability:
  1664. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1665. * CarbonLib: in CarbonLib 1.0 and later
  1666. * Mac OS X: in version 10.0 and later
  1667. */
  1668. EXTERN_API( Boolean )
  1669. IsValidIconRef(IconRef theIconRef) TWOWORDINLINE(0x7032, 0xAA75);
  1670. /*
  1671. PlotIconRef
  1672. This routine plots the IconRef. It mostly takes the same parameters as
  1673. PlotIconSuite. Pass kIconServicesNormalUsageFlag as a default value for
  1674. IconServicesUsageFlags.
  1675. */
  1676. /*
  1677. * PlotIconRef()
  1678. *
  1679. * Availability:
  1680. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1681. * CarbonLib: in CarbonLib 1.0 and later
  1682. * Mac OS X: in version 10.0 and later
  1683. */
  1684. EXTERN_API( OSErr )
  1685. PlotIconRef(
  1686. const Rect * theRect,
  1687. IconAlignmentType align,
  1688. IconTransformType transform,
  1689. IconServicesUsageFlags theIconServicesUsageFlags,
  1690. IconRef theIconRef) TWOWORDINLINE(0x700E, 0xAA75);
  1691. /* PlotIconRefInContext*/
  1692. /*
  1693. * PlotIconRefInContext()
  1694. *
  1695. * Discussion:
  1696. * This routines plots an IconRef using Quartz/CoreGraphics.
  1697. *
  1698. * Parameters:
  1699. *
  1700. * inContext:
  1701. * The graphics context to use.
  1702. *
  1703. * inRect:
  1704. * The rect to plot the icon in.
  1705. *
  1706. * inAlign:
  1707. * The icon alignment.
  1708. *
  1709. * inTransform:
  1710. * The icon transform.
  1711. *
  1712. * inLabelColor:
  1713. * The icon label color.
  1714. *
  1715. * inFlags:
  1716. * The drawing flags to use (usually kPlotIconRefNormalFlags).
  1717. *
  1718. * inIconRef:
  1719. * The IconRef to plot.
  1720. *
  1721. * Availability:
  1722. * Non-Carbon CFM: not available
  1723. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1724. * Mac OS X: in version 10.1 and later
  1725. */
  1726. EXTERN_API( OSStatus )
  1727. PlotIconRefInContext(
  1728. CGContextRef inContext,
  1729. const CGRect * inRect,
  1730. IconAlignmentType inAlign,
  1731. IconTransformType inTransform,
  1732. const RGBColor * inLabelColor,
  1733. PlotIconRefFlags inFlags,
  1734. IconRef inIconRef);
  1735. /*
  1736. PtInIconRef
  1737. This routine indicates if testPt would hit the icon designated by iconRef.
  1738. It mostly takes the same parameters as PtInIconSuite.
  1739. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1740. */
  1741. /*
  1742. * PtInIconRef()
  1743. *
  1744. * Availability:
  1745. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1746. * CarbonLib: in CarbonLib 1.0 and later
  1747. * Mac OS X: in version 10.0 and later
  1748. */
  1749. EXTERN_API( Boolean )
  1750. PtInIconRef(
  1751. const Point * testPt,
  1752. const Rect * iconRect,
  1753. IconAlignmentType align,
  1754. IconServicesUsageFlags theIconServicesUsageFlags,
  1755. IconRef theIconRef) TWOWORDINLINE(0x700F, 0xAA75);
  1756. /*
  1757. RectInIconRef
  1758. This routine indicates if testRect would intersect the icon designated by iconRef.
  1759. It mostly takes the same parameters as RectInIconSuite.
  1760. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1761. */
  1762. /*
  1763. * RectInIconRef()
  1764. *
  1765. * Availability:
  1766. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1767. * CarbonLib: in CarbonLib 1.0 and later
  1768. * Mac OS X: in version 10.0 and later
  1769. */
  1770. EXTERN_API( Boolean )
  1771. RectInIconRef(
  1772. const Rect * testRect,
  1773. const Rect * iconRect,
  1774. IconAlignmentType align,
  1775. IconServicesUsageFlags iconServicesUsageFlags,
  1776. IconRef theIconRef) TWOWORDINLINE(0x7010, 0xAA75);
  1777. /*
  1778. IconRefToRgn
  1779. This routine returns a region for the icon.
  1780. It mostly takes the same parameters as IconSuiteToRgn.
  1781. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1782. */
  1783. /*
  1784. * IconRefToRgn()
  1785. *
  1786. * Availability:
  1787. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1788. * CarbonLib: in CarbonLib 1.0 and later
  1789. * Mac OS X: in version 10.0 and later
  1790. */
  1791. EXTERN_API( OSErr )
  1792. IconRefToRgn(
  1793. RgnHandle theRgn,
  1794. const Rect * iconRect,
  1795. IconAlignmentType align,
  1796. IconServicesUsageFlags iconServicesUsageFlags,
  1797. IconRef theIconRef) TWOWORDINLINE(0x7011, 0xAA75);
  1798. /*
  1799. GetIconSizesFromIconRef
  1800. This routine returns an IconSelectorValue indicating the depths and sizes of
  1801. icon data which are actually available. It takes an IconSelectorValue
  1802. indicating which sizes/depths the caller is interested and returns an
  1803. IconSelectorValue indicating which sizes/depths exist.
  1804. Caution:
  1805. This is potentially an extremely expensive call as IconServices may be forced
  1806. to attempt fetching the data for the IconRef's sizes/depths which may result
  1807. in hitting the local disk or even the network to obtain the data to determine
  1808. which sizes/depths actually exist.
  1809. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1810. */
  1811. /*
  1812. * GetIconSizesFromIconRef()
  1813. *
  1814. * Availability:
  1815. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1816. * CarbonLib: in CarbonLib 1.0 and later
  1817. * Mac OS X: in version 10.0 and later
  1818. */
  1819. EXTERN_API( OSErr )
  1820. GetIconSizesFromIconRef(
  1821. IconSelectorValue iconSelectorInput,
  1822. IconSelectorValue * iconSelectorOutputPtr,
  1823. IconServicesUsageFlags iconServicesUsageFlags,
  1824. IconRef theIconRef) TWOWORDINLINE(0x7012, 0xAA75);
  1825. /*
  1826. ==============================================================================
  1827. Flushing IconRef data
  1828. ==============================================================================
  1829. */
  1830. /*
  1831. FlushIconRefs
  1832. Making this call will dispose of all the data for the specified icons if
  1833. the data can be reacquired, for example if the data is provided from a resource.
  1834. '****' is a wildcard for all types or all creators.
  1835. */
  1836. /*
  1837. * FlushIconRefs()
  1838. *
  1839. * Availability:
  1840. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1841. * CarbonLib: in CarbonLib 1.0 and later
  1842. * Mac OS X: in version 10.0 and later
  1843. */
  1844. EXTERN_API( OSErr )
  1845. FlushIconRefs(
  1846. OSType creator,
  1847. OSType iconType) TWOWORDINLINE(0x7029, 0xAA75);
  1848. /*
  1849. FlushIconRefsByVolume
  1850. This routine disposes of the data for the icons related to the indicated volume
  1851. if this data can be reacquired, for example if the data is provided from a
  1852. resource.
  1853. */
  1854. /*
  1855. * FlushIconRefsByVolume()
  1856. *
  1857. * Availability:
  1858. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1859. * CarbonLib: in CarbonLib 1.0 and later
  1860. * Mac OS X: in version 10.0 and later
  1861. */
  1862. EXTERN_API( OSErr )
  1863. FlushIconRefsByVolume(SInt16 vRefNum) TWOWORDINLINE(0x7018, 0xAA75);
  1864. /*
  1865. ==============================================================================
  1866. Controling custom icons
  1867. ==============================================================================
  1868. */
  1869. /*
  1870. SetCustomIconsEnabled
  1871. Enable or disable custom icons on the specified volume.
  1872. */
  1873. /*
  1874. * SetCustomIconsEnabled()
  1875. *
  1876. * Availability:
  1877. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1878. * CarbonLib: in CarbonLib 1.0 and later
  1879. * Mac OS X: in version 10.0 and later
  1880. */
  1881. EXTERN_API( OSErr )
  1882. SetCustomIconsEnabled(
  1883. SInt16 vRefNum,
  1884. Boolean enableCustomIcons) TWOWORDINLINE(0x701F, 0xAA75);
  1885. /*
  1886. GetCustomIconsEnabled
  1887. Return true if custom icons are enabled on the specified volume, false otherwise.
  1888. */
  1889. /*
  1890. * GetCustomIconsEnabled()
  1891. *
  1892. * Availability:
  1893. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1894. * CarbonLib: in CarbonLib 1.0 and later
  1895. * Mac OS X: in version 10.0 and later
  1896. */
  1897. EXTERN_API( OSErr )
  1898. GetCustomIconsEnabled(
  1899. SInt16 vRefNum,
  1900. Boolean * customIconsEnabled) TWOWORDINLINE(0x7020, 0xAA75);
  1901. /*
  1902. IsIconRefMaskEmpty
  1903. Returns true if the mask for this icon is blank
  1904. */
  1905. /*
  1906. * IsIconRefMaskEmpty()
  1907. *
  1908. * Availability:
  1909. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1910. * CarbonLib: in CarbonLib 1.0 and later
  1911. * Mac OS X: in version 10.0 and later
  1912. */
  1913. EXTERN_API( Boolean )
  1914. IsIconRefMaskEmpty(IconRef iconRef) TWOWORDINLINE(0x7033, 0xAA75);
  1915. /*
  1916. GetIconRefVariant
  1917. Icon variants allows different images to be used with different icon state.
  1918. For example, the 'open' variant for a folder could be represented with
  1919. an open folder.
  1920. Given an icon ref and a desired variant, this routine returns an icon
  1921. ref (which may be the same as the input icon ref) and a transformation
  1922. which should be used with PlotIconRef() to render the icon appropriately.
  1923. The returned icon ref should be used to do hit-testing.
  1924. */
  1925. /*
  1926. * GetIconRefVariant()
  1927. *
  1928. * Availability:
  1929. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1930. * CarbonLib: in CarbonLib 1.0 and later
  1931. * Mac OS X: in version 10.0 and later
  1932. */
  1933. EXTERN_API( IconRef )
  1934. GetIconRefVariant(
  1935. IconRef inIconRef,
  1936. OSType inVariant,
  1937. IconTransformType * outTransform) TWOWORDINLINE(0x7034, 0xAA75);
  1938. /*
  1939. ==============================================================================
  1940. Icon files (.icns files)
  1941. ==============================================================================
  1942. */
  1943. /*
  1944. RegisterIconRefFromIconFile
  1945. This routine adds a new entry to the IconRef registry. Other clients will be
  1946. able to access it using the (creator, iconType) pair specified here.
  1947. Lower-case creators are reserved for the system.
  1948. If the creator is kSystemIconsCreator and the iconType is 0, a new IconRef
  1949. is always returned. Otherwise, if the creator and type have already been
  1950. registered, the previously registered IconRef is returned.
  1951. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1952. when you're done with it.
  1953. */
  1954. /*
  1955. * RegisterIconRefFromIconFile()
  1956. *
  1957. * Availability:
  1958. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1959. * CarbonLib: in CarbonLib 1.0 and later
  1960. * Mac OS X: in version 10.0 and later
  1961. */
  1962. EXTERN_API( OSErr )
  1963. RegisterIconRefFromIconFile(
  1964. OSType creator,
  1965. OSType iconType,
  1966. const FSSpec * iconFile,
  1967. IconRef * theIconRef) TWOWORDINLINE(0x7035, 0xAA75);
  1968. /*
  1969. ReadIconFile
  1970. Read the specified icon file into the icon family handle.
  1971. The caller is responsible for disposing the iconFamily
  1972. */
  1973. /*
  1974. * ReadIconFile()
  1975. *
  1976. * Availability:
  1977. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1978. * CarbonLib: in CarbonLib 1.0 and later
  1979. * Mac OS X: in version 10.0 and later
  1980. */
  1981. EXTERN_API( OSErr )
  1982. ReadIconFile(
  1983. const FSSpec * iconFile,
  1984. IconFamilyHandle * iconFamily) TWOWORDINLINE(0x7036, 0xAA75);
  1985. /* ReadIconFromFSRef*/
  1986. /*
  1987. * ReadIconFromFSRef()
  1988. *
  1989. * Discussion:
  1990. * This routine reads an icon (icns) file into memory.
  1991. *
  1992. * Parameters:
  1993. *
  1994. * ref:
  1995. * The FSRef for the icon file.
  1996. *
  1997. * iconFamily:
  1998. * The handle for the icon family.
  1999. *
  2000. * Availability:
  2001. * Non-Carbon CFM: not available
  2002. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  2003. * Mac OS X: in version 10.1 and later
  2004. */
  2005. EXTERN_API( OSStatus )
  2006. ReadIconFromFSRef(
  2007. const FSRef * ref,
  2008. IconFamilyHandle * iconFamily);
  2009. /*
  2010. WriteIconFile
  2011. Write the iconFamily handle to the specified file
  2012. */
  2013. /*
  2014. * WriteIconFile()
  2015. *
  2016. * Availability:
  2017. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  2018. * CarbonLib: in CarbonLib 1.0 and later
  2019. * Mac OS X: in version 10.0 and later
  2020. */
  2021. EXTERN_API( OSErr )
  2022. WriteIconFile(
  2023. IconFamilyHandle iconFamily,
  2024. const FSSpec * iconFile) TWOWORDINLINE(0x7037, 0xAA75);
  2025. #if PRAGMA_STRUCT_ALIGN
  2026. #pragma options align=reset
  2027. #elif PRAGMA_STRUCT_PACKPUSH
  2028. #pragma pack(pop)
  2029. #elif PRAGMA_STRUCT_PACK
  2030. #pragma pack()
  2031. #endif
  2032. #ifdef PRAGMA_IMPORT_OFF
  2033. #pragma import off
  2034. #elif PRAGMA_IMPORT
  2035. #pragma import reset
  2036. #endif
  2037. #ifdef __cplusplus
  2038. }
  2039. #endif
  2040. #endif /* __ICONS__ */