Icons.pas 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062
  1. {
  2. File: Icons.p
  3. Contains: Icon Utilities and Icon Services Interfaces.
  4. Version: Technology: Mac OS 9.x
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1990-2002 by Apple Computer, Inc. All rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. { Pascal Translation Updated: Gale R Paeper, <[email protected]>, 2006 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 200
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$mode macpas}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$CALLING MWPASCAL}
  22. unit Icons;
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  25. {$setc GAP_INTERFACES_VERSION := $0200}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __i386__ and defined CPUI386}
  41. {$setc __i386__ := 1}
  42. {$elsec}
  43. {$setc __i386__ := 0}
  44. {$endc}
  45. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  46. {$error Conflicting definitions for __ppc__ and __i386__}
  47. {$endc}
  48. {$ifc defined __ppc__ and __ppc__}
  49. {$setc TARGET_CPU_PPC := TRUE}
  50. {$setc TARGET_CPU_X86 := FALSE}
  51. {$elifc defined __i386__ and __i386__}
  52. {$setc TARGET_CPU_PPC := FALSE}
  53. {$setc TARGET_CPU_X86 := TRUE}
  54. {$elsec}
  55. {$error Neither __ppc__ nor __i386__ is defined.}
  56. {$endc}
  57. {$setc TARGET_CPU_PPC_64 := FALSE}
  58. {$ifc defined FPC_BIG_ENDIAN}
  59. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  60. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  61. {$elifc defined FPC_LITTLE_ENDIAN}
  62. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  63. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  64. {$elsec}
  65. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  66. {$endc}
  67. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  68. {$setc CALL_NOT_IN_CARBON := FALSE}
  69. {$setc OLDROUTINENAMES := FALSE}
  70. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  71. {$setc OPAQUE_UPP_TYPES := TRUE}
  72. {$setc OTCARBONAPPLICATION := TRUE}
  73. {$setc OTKERNEL := FALSE}
  74. {$setc PM_USE_SESSION_APIS := TRUE}
  75. {$setc TARGET_API_MAC_CARBON := TRUE}
  76. {$setc TARGET_API_MAC_OS8 := FALSE}
  77. {$setc TARGET_API_MAC_OSX := TRUE}
  78. {$setc TARGET_CARBON := TRUE}
  79. {$setc TARGET_CPU_68K := FALSE}
  80. {$setc TARGET_CPU_MIPS := FALSE}
  81. {$setc TARGET_CPU_SPARC := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_UNIX := FALSE}
  84. {$setc TARGET_OS_WIN32 := FALSE}
  85. {$setc TARGET_RT_MAC_68881 := FALSE}
  86. {$setc TARGET_RT_MAC_CFM := FALSE}
  87. {$setc TARGET_RT_MAC_MACHO := TRUE}
  88. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  89. {$setc TYPE_BOOL := FALSE}
  90. {$setc TYPE_EXTENDED := FALSE}
  91. {$setc TYPE_LONGLONG := TRUE}
  92. uses MacTypes,CFBase,CGGeometry,Quickdraw,Files,CodeFragments,CGContext;
  93. {$ALIGN MAC68K}
  94. { The following are icons for which there are both icon suites and SICNs. }
  95. { Avoid using icon resources if possible. Use IconServices instead. }
  96. const
  97. kGenericDocumentIconResource = -4000;
  98. kGenericStationeryIconResource = -3985;
  99. kGenericEditionFileIconResource = -3989;
  100. kGenericApplicationIconResource = -3996;
  101. kGenericDeskAccessoryIconResource = -3991;
  102. kGenericFolderIconResource = -3999;
  103. kPrivateFolderIconResource = -3994;
  104. kFloppyIconResource = -3998;
  105. kTrashIconResource = -3993;
  106. kGenericRAMDiskIconResource = -3988;
  107. kGenericCDROMIconResource = -3987;
  108. { The following are icons for which there are SICNs only. }
  109. { Avoid using icon resources if possible. Use IconServices instead. }
  110. kDesktopIconResource = -3992;
  111. kOpenFolderIconResource = -3997;
  112. kGenericHardDiskIconResource = -3995;
  113. kGenericFileServerIconResource = -3972;
  114. kGenericSuitcaseIconResource = -3970;
  115. kGenericMoverObjectIconResource = -3969;
  116. { The following are icons for which there are icon suites only. }
  117. { Avoid using icon resources if possible. Use IconServices instead. }
  118. kGenericPreferencesIconResource = -3971;
  119. kGenericQueryDocumentIconResource = -16506;
  120. kGenericExtensionIconResource = -16415;
  121. kSystemFolderIconResource = -3983;
  122. kHelpIconResource = -20271;
  123. kAppleMenuFolderIconResource = -3982;
  124. { Obsolete. Use named constants defined above. }
  125. genericDocumentIconResource = -4000;
  126. genericStationeryIconResource = -3985;
  127. genericEditionFileIconResource = -3989;
  128. genericApplicationIconResource = -3996;
  129. genericDeskAccessoryIconResource = -3991;
  130. genericFolderIconResource = -3999;
  131. privateFolderIconResource = -3994;
  132. floppyIconResource = -3998;
  133. trashIconResource = -3993;
  134. genericRAMDiskIconResource = -3988;
  135. genericCDROMIconResource = -3987;
  136. desktopIconResource = -3992;
  137. openFolderIconResource = -3997;
  138. genericHardDiskIconResource = -3995;
  139. genericFileServerIconResource = -3972;
  140. genericSuitcaseIconResource = -3970;
  141. genericMoverObjectIconResource = -3969;
  142. genericPreferencesIconResource = -3971;
  143. genericQueryDocumentIconResource = -16506;
  144. genericExtensionIconResource = -16415;
  145. systemFolderIconResource = -3983;
  146. appleMenuFolderIconResource = -3982;
  147. { Avoid using icon resources if possible. Use IconServices instead. }
  148. kStartupFolderIconResource = -3981;
  149. kOwnedFolderIconResource = -3980;
  150. kDropFolderIconResource = -3979;
  151. kSharedFolderIconResource = -3978;
  152. kMountedFolderIconResource = -3977;
  153. kControlPanelFolderIconResource = -3976;
  154. kPrintMonitorFolderIconResource = -3975;
  155. kPreferencesFolderIconResource = -3974;
  156. kExtensionsFolderIconResource = -3973;
  157. kFontsFolderIconResource = -3968;
  158. kFullTrashIconResource = -3984;
  159. { Obsolete. Use named constants defined above. }
  160. startupFolderIconResource = -3981;
  161. ownedFolderIconResource = -3980;
  162. dropFolderIconResource = -3979;
  163. sharedFolderIconResource = -3978;
  164. mountedFolderIconResource = -3977;
  165. controlPanelFolderIconResource = -3976;
  166. printMonitorFolderIconResource = -3975;
  167. preferencesFolderIconResource = -3974;
  168. extensionsFolderIconResource = -3973;
  169. fontsFolderIconResource = -3968;
  170. fullTrashIconResource = -3984;
  171. { The following icon types can only be used as an icon element }
  172. { inside a 'icns' icon family }
  173. kIconServices256PixelDataARGB = $69633038 (* 'ic08' *);
  174. kThumbnail32BitData = $69743332 (* 'it32' *);
  175. kThumbnail8BitMask = $74386D6B (* 't8mk' *);
  176. kHuge1BitMask = $69636823 (* 'ich#' *);
  177. kHuge4BitData = $69636834 (* 'ich4' *);
  178. kHuge8BitData = $69636838 (* 'ich8' *);
  179. kHuge32BitData = $69683332 (* 'ih32' *);
  180. kHuge8BitMask = $68386D6B (* 'h8mk' *);
  181. { The following icon types can be used as a resource type }
  182. { or as an icon element type inside a 'icns' icon family }
  183. kLarge1BitMask = $49434E23 (* 'ICN#' *);
  184. kLarge4BitData = $69636C34 (* 'icl4' *);
  185. kLarge8BitData = $69636C38 (* 'icl8' *);
  186. kLarge32BitData = $696C3332 (* 'il32' *);
  187. kLarge8BitMask = $6C386D6B (* 'l8mk' *);
  188. kSmall1BitMask = $69637323 (* 'ics#' *);
  189. kSmall4BitData = $69637334 (* 'ics4' *);
  190. kSmall8BitData = $69637338 (* 'ics8' *);
  191. kSmall32BitData = $69733332 (* 'is32' *);
  192. kSmall8BitMask = $73386D6B (* 's8mk' *);
  193. kMini1BitMask = $69636D23 (* 'icm#' *);
  194. kMini4BitData = $69636D34 (* 'icm4' *);
  195. kMini8BitData = $69636D38 (* 'icm8' *);
  196. { Icon Variants }
  197. { These can be used as an element of an 'icns' icon family }
  198. { or as a parameter to GetIconRefVariant }
  199. kTileIconVariant = $74696C65 (* 'tile' *);
  200. kRolloverIconVariant = $6F766572 (* 'over' *);
  201. kDropIconVariant = $64726F70 (* 'drop' *);
  202. kOpenIconVariant = $6F70656E (* 'open' *);
  203. kOpenDropIconVariant = $6F647270 (* 'odrp' *);
  204. { Obsolete. Use names defined above. }
  205. large1BitMask = $49434E23 (* 'ICN#' *);
  206. large4BitData = $69636C34 (* 'icl4' *);
  207. large8BitData = $69636C38 (* 'icl8' *);
  208. small1BitMask = $69637323 (* 'ics#' *);
  209. small4BitData = $69637334 (* 'ics4' *);
  210. small8BitData = $69637338 (* 'ics8' *);
  211. mini1BitMask = $69636D23 (* 'icm#' *);
  212. mini4BitData = $69636D34 (* 'icm4' *);
  213. mini8BitData = $69636D38 (* 'icm8' *);
  214. { Alignment type values. }
  215. kAlignNone = $00;
  216. kAlignVerticalCenter = $01;
  217. kAlignTop = $02;
  218. kAlignBottom = $03;
  219. kAlignHorizontalCenter = $04;
  220. kAlignAbsoluteCenter = $05;
  221. kAlignCenterTop = $06;
  222. kAlignCenterBottom = $07;
  223. kAlignLeft = $08;
  224. kAlignCenterLeft = $09;
  225. kAlignTopLeft = $0A;
  226. kAlignBottomLeft = $0B;
  227. kAlignRight = $0C;
  228. kAlignCenterRight = $0D;
  229. kAlignTopRight = $0E;
  230. kAlignBottomRight = $0F;
  231. { Obsolete. Use names defined above. }
  232. atNone = $00;
  233. atVerticalCenter = $01;
  234. atTop = $02;
  235. atBottom = $03;
  236. atHorizontalCenter = $04;
  237. atAbsoluteCenter = $05;
  238. atCenterTop = $06;
  239. atCenterBottom = $07;
  240. atLeft = $08;
  241. atCenterLeft = $09;
  242. atTopLeft = $0A;
  243. atBottomLeft = $0B;
  244. atRight = $0C;
  245. atCenterRight = $0D;
  246. atTopRight = $0E;
  247. atBottomRight = $0F;
  248. type
  249. IconAlignmentType = SInt16;
  250. { Transform type values. }
  251. const
  252. kTransformNone = $00;
  253. kTransformDisabled = $01;
  254. kTransformOffline = $02;
  255. kTransformOpen = $03;
  256. kTransformLabel1 = $0100;
  257. kTransformLabel2 = $0200;
  258. kTransformLabel3 = $0300;
  259. kTransformLabel4 = $0400;
  260. kTransformLabel5 = $0500;
  261. kTransformLabel6 = $0600;
  262. kTransformLabel7 = $0700;
  263. kTransformSelected = $4000;
  264. kTransformSelectedDisabled = $4001;
  265. kTransformSelectedOffline = $4002;
  266. kTransformSelectedOpen = $4003;
  267. { Obsolete. Use names defined above. }
  268. ttNone = $00;
  269. ttDisabled = $01;
  270. ttOffline = $02;
  271. ttOpen = $03;
  272. ttLabel1 = $0100;
  273. ttLabel2 = $0200;
  274. ttLabel3 = $0300;
  275. ttLabel4 = $0400;
  276. ttLabel5 = $0500;
  277. ttLabel6 = $0600;
  278. ttLabel7 = $0700;
  279. ttSelected = $4000;
  280. ttSelectedDisabled = $4001;
  281. ttSelectedOffline = $4002;
  282. ttSelectedOpen = $4003;
  283. type
  284. IconTransformType = SInt16;
  285. { Selector mask values. }
  286. const
  287. kSelectorLarge1Bit = $00000001;
  288. kSelectorLarge4Bit = $00000002;
  289. kSelectorLarge8Bit = $00000004;
  290. kSelectorLarge32Bit = $00000008;
  291. kSelectorLarge8BitMask = $00000010;
  292. kSelectorSmall1Bit = $00000100;
  293. kSelectorSmall4Bit = $00000200;
  294. kSelectorSmall8Bit = $00000400;
  295. kSelectorSmall32Bit = $00000800;
  296. kSelectorSmall8BitMask = $00001000;
  297. kSelectorMini1Bit = $00010000;
  298. kSelectorMini4Bit = $00020000;
  299. kSelectorMini8Bit = $00040000;
  300. kSelectorHuge1Bit = $01000000;
  301. kSelectorHuge4Bit = $02000000;
  302. kSelectorHuge8Bit = $04000000;
  303. kSelectorHuge32Bit = $08000000;
  304. kSelectorHuge8BitMask = $10000000;
  305. kSelectorAllLargeData = $000000FF;
  306. kSelectorAllSmallData = $0000FF00;
  307. kSelectorAllMiniData = $00FF0000;
  308. kSelectorAllHugeData = $FF000000;
  309. kSelectorAll1BitData = $01010101;
  310. kSelectorAll4BitData = $02020202;
  311. kSelectorAll8BitData = $04040404;
  312. kSelectorAll32BitData = $08000808;
  313. kSelectorAllAvailableData = $FFFFFFFF;
  314. { Obsolete. Use names defined above. }
  315. svLarge1Bit = $00000001;
  316. svLarge4Bit = $00000002;
  317. svLarge8Bit = $00000004;
  318. svSmall1Bit = $00000100;
  319. svSmall4Bit = $00000200;
  320. svSmall8Bit = $00000400;
  321. svMini1Bit = $00010000;
  322. svMini4Bit = $00020000;
  323. svMini8Bit = $00040000;
  324. svAllLargeData = $000000FF;
  325. svAllSmallData = $0000FF00;
  326. svAllMiniData = $00FF0000;
  327. svAll1BitData = $01010101;
  328. svAll4BitData = $02020202;
  329. svAll8BitData = $04040404;
  330. svAllAvailableData = $FFFFFFFF;
  331. type
  332. IconSelectorValue = UInt32;
  333. {$ifc TYPED_FUNCTION_POINTERS}
  334. IconActionProcPtr = function(theType: ResType; var theIcon: Handle; yourDataPtr: UnivPtr): OSErr;
  335. {$elsec}
  336. IconActionProcPtr = ProcPtr;
  337. {$endc}
  338. {$ifc TYPED_FUNCTION_POINTERS}
  339. IconGetterProcPtr = function(theType: ResType; yourDataPtr: UnivPtr): Handle;
  340. {$elsec}
  341. IconGetterProcPtr = ProcPtr;
  342. {$endc}
  343. {$ifc OPAQUE_UPP_TYPES}
  344. IconActionUPP = ^SInt32; { an opaque UPP }
  345. {$elsec}
  346. IconActionUPP = UniversalProcPtr;
  347. {$endc}
  348. {$ifc OPAQUE_UPP_TYPES}
  349. IconGetterUPP = ^SInt32; { an opaque UPP }
  350. {$elsec}
  351. IconGetterUPP = UniversalProcPtr;
  352. {$endc}
  353. const
  354. uppIconActionProcInfo = $00000FE0;
  355. uppIconGetterProcInfo = $000003F0;
  356. {
  357. * NewIconActionUPP()
  358. *
  359. * Availability:
  360. * Non-Carbon CFM: available as macro/inline
  361. * CarbonLib: in CarbonLib 1.0 and later
  362. * Mac OS X: in version 10.0 and later
  363. }
  364. function NewIconActionUPP(userRoutine: IconActionProcPtr): IconActionUPP; external name '_NewIconActionUPP'; { old name was NewIconActionProc }
  365. {
  366. * NewIconGetterUPP()
  367. *
  368. * Availability:
  369. * Non-Carbon CFM: available as macro/inline
  370. * CarbonLib: in CarbonLib 1.0 and later
  371. * Mac OS X: in version 10.0 and later
  372. }
  373. function NewIconGetterUPP(userRoutine: IconGetterProcPtr): IconGetterUPP; external name '_NewIconGetterUPP'; { old name was NewIconGetterProc }
  374. {
  375. * DisposeIconActionUPP()
  376. *
  377. * Availability:
  378. * Non-Carbon CFM: available as macro/inline
  379. * CarbonLib: in CarbonLib 1.0 and later
  380. * Mac OS X: in version 10.0 and later
  381. }
  382. procedure DisposeIconActionUPP(userUPP: IconActionUPP); external name '_DisposeIconActionUPP';
  383. {
  384. * DisposeIconGetterUPP()
  385. *
  386. * Availability:
  387. * Non-Carbon CFM: available as macro/inline
  388. * CarbonLib: in CarbonLib 1.0 and later
  389. * Mac OS X: in version 10.0 and later
  390. }
  391. procedure DisposeIconGetterUPP(userUPP: IconGetterUPP); external name '_DisposeIconGetterUPP';
  392. {
  393. * InvokeIconActionUPP()
  394. *
  395. * Availability:
  396. * Non-Carbon CFM: available as macro/inline
  397. * CarbonLib: in CarbonLib 1.0 and later
  398. * Mac OS X: in version 10.0 and later
  399. }
  400. function InvokeIconActionUPP(theType: ResType; var theIcon: Handle; yourDataPtr: UnivPtr; userRoutine: IconActionUPP): OSErr; external name '_InvokeIconActionUPP'; { old name was CallIconActionProc }
  401. {
  402. * InvokeIconGetterUPP()
  403. *
  404. * Availability:
  405. * Non-Carbon CFM: available as macro/inline
  406. * CarbonLib: in CarbonLib 1.0 and later
  407. * Mac OS X: in version 10.0 and later
  408. }
  409. function InvokeIconGetterUPP(theType: ResType; yourDataPtr: UnivPtr; userRoutine: IconGetterUPP): Handle; external name '_InvokeIconGetterUPP'; { old name was CallIconGetterProc }
  410. type
  411. IconGetter = IconGetterProcPtr;
  412. IconAction = IconActionProcPtr;
  413. { CIconHandle, GetCIcon(), PlotCIcon(), and DisposeCIcon() moved here from Quickdraw.h }
  414. CIconPtr = ^CIcon;
  415. CIcon = record
  416. iconPMap: PixMap; { the icon's pixMap }
  417. iconMask: BitMap; { the icon's mask }
  418. iconBMap: BitMap; { the icon's bitMap }
  419. iconData: Handle; { the icon's data }
  420. iconMaskData: array [0..0] of SInt16; { icon's mask and BitMap data }
  421. end;
  422. CIconHandle = ^CIconPtr;
  423. {
  424. * GetCIcon()
  425. *
  426. * Availability:
  427. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  428. * CarbonLib: in CarbonLib 1.0 and later
  429. * Mac OS X: in version 10.0 and later
  430. }
  431. function GetCIcon(iconID: SInt16): CIconHandle; external name '_GetCIcon';
  432. {
  433. * PlotCIcon()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  437. * CarbonLib: in CarbonLib 1.0 and later
  438. * Mac OS X: in version 10.0 and later
  439. }
  440. procedure PlotCIcon(const (*var*) theRect: Rect; theIcon: CIconHandle); external name '_PlotCIcon';
  441. {
  442. * DisposeCIcon()
  443. *
  444. * Availability:
  445. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  446. * CarbonLib: in CarbonLib 1.0 and later
  447. * Mac OS X: in version 10.0 and later
  448. }
  449. procedure DisposeCIcon(theIcon: CIconHandle); external name '_DisposeCIcon';
  450. { GetIcon and PlotIcon moved here from ToolUtils }
  451. {
  452. * GetIcon()
  453. *
  454. * Availability:
  455. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  456. * CarbonLib: in CarbonLib 1.0 and later
  457. * Mac OS X: in version 10.0 and later
  458. }
  459. function GetIcon(iconID: SInt16): Handle; external name '_GetIcon';
  460. {
  461. * PlotIcon()
  462. *
  463. * Availability:
  464. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  465. * CarbonLib: in CarbonLib 1.0 and later
  466. * Mac OS X: in version 10.0 and later
  467. }
  468. procedure PlotIcon(const (*var*) theRect: Rect; theIcon: Handle); external name '_PlotIcon';
  469. {
  470. Note: IconSuiteRef and IconCacheRef should be an abstract types,
  471. but too much source code already relies on them being of type Handle.
  472. }
  473. type
  474. IconSuiteRef = Handle;
  475. IconCacheRef = Handle;
  476. { IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid. }
  477. IconRef = ^SInt32; { an opaque 32-bit type }
  478. IconRefPtr = ^IconRef; { when a var xx:IconRef parameter can be nil, it is changed to xx: IconRefPtr }
  479. {
  480. * PlotIconID()
  481. *
  482. * Availability:
  483. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  484. * CarbonLib: in CarbonLib 1.0 and later
  485. * Mac OS X: in version 10.0 and later
  486. }
  487. function PlotIconID(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theResID: SInt16): OSErr; external name '_PlotIconID';
  488. {
  489. * NewIconSuite()
  490. *
  491. * Availability:
  492. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  493. * CarbonLib: in CarbonLib 1.0 and later
  494. * Mac OS X: in version 10.0 and later
  495. }
  496. function NewIconSuite(var theIconSuite: IconSuiteRef): OSErr; external name '_NewIconSuite';
  497. {
  498. * AddIconToSuite()
  499. *
  500. * Availability:
  501. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  502. * CarbonLib: in CarbonLib 1.0 and later
  503. * Mac OS X: in version 10.0 and later
  504. }
  505. function AddIconToSuite(theIconData: Handle; theSuite: IconSuiteRef; theType: ResType): OSErr; external name '_AddIconToSuite';
  506. {
  507. * GetIconFromSuite()
  508. *
  509. * Availability:
  510. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  511. * CarbonLib: in CarbonLib 1.0 and later
  512. * Mac OS X: in version 10.0 and later
  513. }
  514. function GetIconFromSuite(var theIconData: Handle; theSuite: IconSuiteRef; theType: ResType): OSErr; external name '_GetIconFromSuite';
  515. {
  516. * ForEachIconDo()
  517. *
  518. * Availability:
  519. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  520. * CarbonLib: in CarbonLib 1.0 and later
  521. * Mac OS X: in version 10.0 and later
  522. }
  523. function ForEachIconDo(theSuite: IconSuiteRef; selector: IconSelectorValue; action: IconActionUPP; yourDataPtr: UnivPtr): OSErr; external name '_ForEachIconDo';
  524. {
  525. * GetIconSuite()
  526. *
  527. * Availability:
  528. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  529. * CarbonLib: in CarbonLib 1.0 and later
  530. * Mac OS X: in version 10.0 and later
  531. }
  532. function GetIconSuite(var theIconSuite: IconSuiteRef; theResID: SInt16; selector: IconSelectorValue): OSErr; external name '_GetIconSuite';
  533. {
  534. * DisposeIconSuite()
  535. *
  536. * Availability:
  537. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  538. * CarbonLib: in CarbonLib 1.0 and later
  539. * Mac OS X: in version 10.0 and later
  540. }
  541. function DisposeIconSuite(theIconSuite: IconSuiteRef; disposeData: boolean): OSErr; external name '_DisposeIconSuite';
  542. {
  543. * PlotIconSuite()
  544. *
  545. * Availability:
  546. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  547. * CarbonLib: in CarbonLib 1.0 and later
  548. * Mac OS X: in version 10.0 and later
  549. }
  550. function PlotIconSuite(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theIconSuite: IconSuiteRef): OSErr; external name '_PlotIconSuite';
  551. {
  552. * MakeIconCache()
  553. *
  554. * Availability:
  555. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  556. * CarbonLib: in CarbonLib 1.0 and later
  557. * Mac OS X: in version 10.0 and later
  558. }
  559. function MakeIconCache(var theCache: IconCacheRef; makeIcon: IconGetterUPP; yourDataPtr: UnivPtr): OSErr; external name '_MakeIconCache';
  560. {
  561. * LoadIconCache()
  562. *
  563. * Availability:
  564. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  565. * CarbonLib: in CarbonLib 1.0 and later
  566. * Mac OS X: in version 10.0 and later
  567. }
  568. function LoadIconCache(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theIconCache: IconCacheRef): OSErr; external name '_LoadIconCache';
  569. {
  570. * PlotIconMethod()
  571. *
  572. * Availability:
  573. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  574. * CarbonLib: in CarbonLib 1.0 and later
  575. * Mac OS X: in version 10.0 and later
  576. }
  577. function PlotIconMethod(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theMethod: IconGetterUPP; yourDataPtr: UnivPtr): OSErr; external name '_PlotIconMethod';
  578. {
  579. * GetLabel()
  580. *
  581. * Availability:
  582. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  583. * CarbonLib: in CarbonLib 1.0 and later
  584. * Mac OS X: in version 10.0 and later
  585. }
  586. function GetLabel(labelNumber: SInt16; var labelColor: RGBColor; var labelString: Str255): OSErr; external name '_GetLabel';
  587. {
  588. * PtInIconID()
  589. *
  590. * Availability:
  591. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  592. * CarbonLib: in CarbonLib 1.0 and later
  593. * Mac OS X: in version 10.0 and later
  594. }
  595. function PtInIconID(testPt: Point; const (*var*) iconRect: Rect; align: IconAlignmentType; iconID: SInt16): boolean; external name '_PtInIconID';
  596. {
  597. * PtInIconSuite()
  598. *
  599. * Availability:
  600. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  601. * CarbonLib: in CarbonLib 1.0 and later
  602. * Mac OS X: in version 10.0 and later
  603. }
  604. function PtInIconSuite(testPt: Point; const (*var*) iconRect: Rect; align: IconAlignmentType; theIconSuite: IconSuiteRef): boolean; external name '_PtInIconSuite';
  605. {
  606. * PtInIconMethod()
  607. *
  608. * Availability:
  609. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  610. * CarbonLib: in CarbonLib 1.0 and later
  611. * Mac OS X: in version 10.0 and later
  612. }
  613. function PtInIconMethod(testPt: Point; const (*var*) iconRect: Rect; align: IconAlignmentType; theMethod: IconGetterUPP; yourDataPtr: UnivPtr): boolean; external name '_PtInIconMethod';
  614. {
  615. * RectInIconID()
  616. *
  617. * Availability:
  618. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  619. * CarbonLib: in CarbonLib 1.0 and later
  620. * Mac OS X: in version 10.0 and later
  621. }
  622. function RectInIconID(const (*var*) testRect: Rect; const (*var*) iconRect: Rect; align: IconAlignmentType; iconID: SInt16): boolean; external name '_RectInIconID';
  623. {
  624. * RectInIconSuite()
  625. *
  626. * Availability:
  627. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  628. * CarbonLib: in CarbonLib 1.0 and later
  629. * Mac OS X: in version 10.0 and later
  630. }
  631. function RectInIconSuite(const (*var*) testRect: Rect; const (*var*) iconRect: Rect; align: IconAlignmentType; theIconSuite: IconSuiteRef): boolean; external name '_RectInIconSuite';
  632. {
  633. * RectInIconMethod()
  634. *
  635. * Availability:
  636. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  637. * CarbonLib: in CarbonLib 1.0 and later
  638. * Mac OS X: in version 10.0 and later
  639. }
  640. function RectInIconMethod(const (*var*) testRect: Rect; const (*var*) iconRect: Rect; align: IconAlignmentType; theMethod: IconGetterUPP; yourDataPtr: UnivPtr): boolean; external name '_RectInIconMethod';
  641. {
  642. * IconIDToRgn()
  643. *
  644. * Availability:
  645. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  646. * CarbonLib: in CarbonLib 1.0 and later
  647. * Mac OS X: in version 10.0 and later
  648. }
  649. function IconIDToRgn(theRgn: RgnHandle; const (*var*) iconRect: Rect; align: IconAlignmentType; iconID: SInt16): OSErr; external name '_IconIDToRgn';
  650. {
  651. * IconSuiteToRgn()
  652. *
  653. * Availability:
  654. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Mac OS X: in version 10.0 and later
  657. }
  658. function IconSuiteToRgn(theRgn: RgnHandle; const (*var*) iconRect: Rect; align: IconAlignmentType; theIconSuite: IconSuiteRef): OSErr; external name '_IconSuiteToRgn';
  659. {
  660. * IconMethodToRgn()
  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. function IconMethodToRgn(theRgn: RgnHandle; const (*var*) iconRect: Rect; align: IconAlignmentType; theMethod: IconGetterUPP; yourDataPtr: UnivPtr): OSErr; external name '_IconMethodToRgn';
  668. {
  669. * SetSuiteLabel()
  670. *
  671. * Availability:
  672. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  673. * CarbonLib: in CarbonLib 1.0 and later
  674. * Mac OS X: in version 10.0 and later
  675. }
  676. function SetSuiteLabel(theSuite: IconSuiteRef; theLabel: SInt16): OSErr; external name '_SetSuiteLabel';
  677. {
  678. * GetSuiteLabel()
  679. *
  680. * Availability:
  681. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  682. * CarbonLib: in CarbonLib 1.0 and later
  683. * Mac OS X: in version 10.0 and later
  684. }
  685. function GetSuiteLabel(theSuite: IconSuiteRef): SInt16; external name '_GetSuiteLabel';
  686. {
  687. * GetIconCacheData()
  688. *
  689. * Availability:
  690. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  691. * CarbonLib: in CarbonLib 1.0 and later
  692. * Mac OS X: in version 10.0 and later
  693. }
  694. function GetIconCacheData(theCache: IconCacheRef; var theData: UnivPtr): OSErr; external name '_GetIconCacheData';
  695. {
  696. * SetIconCacheData()
  697. *
  698. * Availability:
  699. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  700. * CarbonLib: in CarbonLib 1.0 and later
  701. * Mac OS X: in version 10.0 and later
  702. }
  703. function SetIconCacheData(theCache: IconCacheRef; theData: UnivPtr): OSErr; external name '_SetIconCacheData';
  704. {
  705. * GetIconCacheProc()
  706. *
  707. * Availability:
  708. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  709. * CarbonLib: in CarbonLib 1.0 and later
  710. * Mac OS X: in version 10.0 and later
  711. }
  712. function GetIconCacheProc(theCache: IconCacheRef; var theProc: IconGetterUPP): OSErr; external name '_GetIconCacheProc';
  713. {
  714. * SetIconCacheProc()
  715. *
  716. * Availability:
  717. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  718. * CarbonLib: in CarbonLib 1.0 and later
  719. * Mac OS X: in version 10.0 and later
  720. }
  721. function SetIconCacheProc(theCache: IconCacheRef; theProc: IconGetterUPP): OSErr; external name '_SetIconCacheProc';
  722. {
  723. * PlotIconHandle()
  724. *
  725. * Availability:
  726. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  727. * CarbonLib: in CarbonLib 1.0 and later
  728. * Mac OS X: in version 10.0 and later
  729. }
  730. function PlotIconHandle(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theIcon: Handle): OSErr; external name '_PlotIconHandle';
  731. {
  732. * PlotSICNHandle()
  733. *
  734. * Availability:
  735. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  736. * CarbonLib: in CarbonLib 1.0 and later
  737. * Mac OS X: in version 10.0 and later
  738. }
  739. function PlotSICNHandle(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theSICN: Handle): OSErr; external name '_PlotSICNHandle';
  740. {
  741. * PlotCIconHandle()
  742. *
  743. * Availability:
  744. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  745. * CarbonLib: in CarbonLib 1.0 and later
  746. * Mac OS X: in version 10.0 and later
  747. }
  748. function PlotCIconHandle(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theCIcon: CIconHandle): OSErr; external name '_PlotCIconHandle';
  749. {
  750. IconServices is an efficient mechanism to share icon data amongst multiple
  751. clients. It avoids duplication of data; it provides efficient caching,
  752. releasing memory when the icon data is no longer needed; it can provide
  753. the appropriate icon for any filesystem object; it can provide commonly
  754. used icons (caution, note, help...); it is Appearance-savvy: the icons
  755. are switched when appropriate.
  756. IconServices refer to cached icon data using IconRef, a 32-bit opaque
  757. value. IconRefs are reference counted. When there are no more "owners"
  758. of an IconRef, the memory used by the icon bitmap is disposed of.
  759. Two files of same type and creator with no custom icon will have the same IconRef.
  760. Files with custom icons will have their own IconRef.
  761. }
  762. {
  763. Use the special creator kSystemIconsCreator to get "standard" icons
  764. that are not associated with a file, such as the help icon.
  765. Note that all lowercase creators are reserved by Apple.
  766. }
  767. const
  768. kSystemIconsCreator = $6D616373 (* 'macs' *);
  769. {
  770. Type of the predefined/generic icons. For example, the call:
  771. err = GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
  772. will retun in iconRef the IconRef for the standard help icon.
  773. }
  774. { Generic Finder icons }
  775. kClipboardIcon = $434C4950 (* 'CLIP' *);
  776. kClippingUnknownTypeIcon = $636C7075 (* 'clpu' *);
  777. kClippingPictureTypeIcon = $636C7070 (* 'clpp' *);
  778. kClippingTextTypeIcon = $636C7074 (* 'clpt' *);
  779. kClippingSoundTypeIcon = $636C7073 (* 'clps' *);
  780. kDesktopIcon = $6465736B (* 'desk' *);
  781. kFinderIcon = $464E4452 (* 'FNDR' *);
  782. kComputerIcon = $726F6F74 (* 'root' *);
  783. kFontSuitcaseIcon = $4646494C (* 'FFIL' *);
  784. kFullTrashIcon = $66747268 (* 'ftrh' *);
  785. kGenericApplicationIcon = $4150504C (* 'APPL' *);
  786. kGenericCDROMIcon = $63646472 (* 'cddr' *);
  787. kGenericControlPanelIcon = $41505043 (* 'APPC' *);
  788. kGenericControlStripModuleIcon = $73646576 (* 'sdev' *);
  789. kGenericComponentIcon = $74686E67 (* 'thng' *);
  790. kGenericDeskAccessoryIcon = $41505044 (* 'APPD' *);
  791. kGenericDocumentIcon = $646F6375 (* 'docu' *);
  792. kGenericEditionFileIcon = $65647466 (* 'edtf' *);
  793. kGenericExtensionIcon = $494E4954 (* 'INIT' *);
  794. kGenericFileServerIcon = $73727672 (* 'srvr' *);
  795. kGenericFontIcon = $6666696C (* 'ffil' *);
  796. kGenericFontScalerIcon = $73636C72 (* 'sclr' *);
  797. kGenericFloppyIcon = $666C7079 (* 'flpy' *);
  798. kGenericHardDiskIcon = $6864736B (* 'hdsk' *);
  799. kGenericIDiskIcon = $6964736B (* 'idsk' *);
  800. kGenericRemovableMediaIcon = $726D6F76 (* 'rmov' *);
  801. kGenericMoverObjectIcon = $6D6F7672 (* 'movr' *);
  802. kGenericPCCardIcon = $70636D63 (* 'pcmc' *);
  803. kGenericPreferencesIcon = $70726566 (* 'pref' *);
  804. kGenericQueryDocumentIcon = $71657279 (* 'qery' *);
  805. kGenericRAMDiskIcon = $72616D64 (* 'ramd' *);
  806. kGenericSharedLibaryIcon = $73686C62 (* 'shlb' *);
  807. kGenericStationeryIcon = $73646F63 (* 'sdoc' *);
  808. kGenericSuitcaseIcon = $73756974 (* 'suit' *);
  809. kGenericURLIcon = $6775726C (* 'gurl' *);
  810. kGenericWORMIcon = $776F726D (* 'worm' *);
  811. kInternationalResourcesIcon = $6966696C (* 'ifil' *);
  812. kKeyboardLayoutIcon = $6B66696C (* 'kfil' *);
  813. kSoundFileIcon = $7366696C (* 'sfil' *);
  814. kSystemSuitcaseIcon = $7A737973 (* 'zsys' *);
  815. kTrashIcon = $74727368 (* 'trsh' *);
  816. kTrueTypeFontIcon = $7466696C (* 'tfil' *);
  817. kTrueTypeFlatFontIcon = $73666E74 (* 'sfnt' *);
  818. kTrueTypeMultiFlatFontIcon = $74746366 (* 'ttcf' *);
  819. kUserIDiskIcon = $7564736B (* 'udsk' *);
  820. kUnknownFSObjectIcon = $756E6673 (* 'unfs' *);
  821. kInternationResourcesIcon = $6966696C (* 'ifil' *); { old misspelling }
  822. { Internet locations }
  823. kInternetLocationHTTPIcon = $696C6874 (* 'ilht' *);
  824. kInternetLocationFTPIcon = $696C6674 (* 'ilft' *);
  825. kInternetLocationAppleShareIcon = $696C6166 (* 'ilaf' *);
  826. kInternetLocationAppleTalkZoneIcon = $696C6174 (* 'ilat' *);
  827. kInternetLocationFileIcon = $696C6669 (* 'ilfi' *);
  828. kInternetLocationMailIcon = $696C6D61 (* 'ilma' *);
  829. kInternetLocationNewsIcon = $696C6E77 (* 'ilnw' *);
  830. kInternetLocationNSLNeighborhoodIcon = $696C6E73 (* 'ilns' *);
  831. kInternetLocationGenericIcon = $696C6765 (* 'ilge' *);
  832. { Folders }
  833. kGenericFolderIcon = $666C6472 (* 'fldr' *);
  834. kDropFolderIcon = $64626F78 (* 'dbox' *);
  835. kMountedFolderIcon = $6D6E7464 (* 'mntd' *);
  836. kOpenFolderIcon = $6F666C64 (* 'ofld' *);
  837. kOwnedFolderIcon = $6F776E64 (* 'ownd' *);
  838. kPrivateFolderIcon = $70727666 (* 'prvf' *);
  839. kSharedFolderIcon = $7368666C (* 'shfl' *);
  840. { Sharing Privileges icons }
  841. kSharingPrivsNotApplicableIcon = $73686E61 (* 'shna' *);
  842. kSharingPrivsReadOnlyIcon = $7368726F (* 'shro' *);
  843. kSharingPrivsReadWriteIcon = $73687277 (* 'shrw' *);
  844. kSharingPrivsUnknownIcon = $7368756B (* 'shuk' *);
  845. kSharingPrivsWritableIcon = $77726974 (* 'writ' *);
  846. { Users and Groups icons }
  847. kUserFolderIcon = $75666C64 (* 'ufld' *);
  848. kWorkgroupFolderIcon = $77666C64 (* 'wfld' *);
  849. kGuestUserIcon = $67757372 (* 'gusr' *);
  850. kUserIcon = $75736572 (* 'user' *);
  851. kOwnerIcon = $73757372 (* 'susr' *);
  852. kGroupIcon = $67727570 (* 'grup' *);
  853. { Special folders }
  854. kAppearanceFolderIcon = $61707072 (* 'appr' *);
  855. kAppleExtrasFolderIcon = $616578C6 (* 'aexÄ' *);
  856. kAppleMenuFolderIcon = $616D6E75 (* 'amnu' *);
  857. kApplicationsFolderIcon = $61707073 (* 'apps' *);
  858. kApplicationSupportFolderIcon = $61737570 (* 'asup' *);
  859. kAssistantsFolderIcon = $617374C6 (* 'astÄ' *);
  860. kColorSyncFolderIcon = $70726F66 (* 'prof' *);
  861. kContextualMenuItemsFolderIcon = $636D6E75 (* 'cmnu' *);
  862. kControlPanelDisabledFolderIcon = $63747244 (* 'ctrD' *);
  863. kControlPanelFolderIcon = $6374726C (* 'ctrl' *);
  864. kControlStripModulesFolderIcon = $736476C6 (* 'sdvÄ' *);
  865. kDocumentsFolderIcon = $646F6373 (* 'docs' *);
  866. kExtensionsDisabledFolderIcon = $65787444 (* 'extD' *);
  867. kExtensionsFolderIcon = $6578746E (* 'extn' *);
  868. kFavoritesFolderIcon = $66617673 (* 'favs' *);
  869. kFontsFolderIcon = $666F6E74 (* 'font' *);
  870. kHelpFolderIcon = $C692686C (* 'Ählp' *);
  871. kInternetFolderIcon = $696E74C6 (* 'intÄ' *);
  872. kInternetPlugInFolderIcon = $C6926E65 (* 'Änet' *);
  873. kInternetSearchSitesFolderIcon = $69737366 (* 'issf' *);
  874. kLocalesFolderIcon = $C6926C6F (* 'Äloc' *);
  875. kMacOSReadMeFolderIcon = $6D6F72C6 (* 'morÄ' *);
  876. kPublicFolderIcon = $70756266 (* 'pubf' *);
  877. kPreferencesFolderIcon = $707266C6 (* 'prfÄ' *);
  878. kPrinterDescriptionFolderIcon = $70706466 (* 'ppdf' *);
  879. kPrinterDriverFolderIcon = $C6927072 (* 'Äprd' *);
  880. kPrintMonitorFolderIcon = $70726E74 (* 'prnt' *);
  881. kRecentApplicationsFolderIcon = $72617070 (* 'rapp' *);
  882. kRecentDocumentsFolderIcon = $72646F63 (* 'rdoc' *);
  883. kRecentServersFolderIcon = $72737276 (* 'rsrv' *);
  884. kScriptingAdditionsFolderIcon = $C6927363 (* 'Äscr' *);
  885. kSharedLibrariesFolderIcon = $C6926C69 (* 'Älib' *);
  886. kScriptsFolderIcon = $736372C6 (* 'scrÄ' *);
  887. kShutdownItemsDisabledFolderIcon = $73686444 (* 'shdD' *);
  888. kShutdownItemsFolderIcon = $73686466 (* 'shdf' *);
  889. kSpeakableItemsFolder = $73706B69 (* 'spki' *);
  890. kStartupItemsDisabledFolderIcon = $73747244 (* 'strD' *);
  891. kStartupItemsFolderIcon = $73747274 (* 'strt' *);
  892. kSystemExtensionDisabledFolderIcon = $6D616344 (* 'macD' *);
  893. kSystemFolderIcon = $6D616373 (* 'macs' *);
  894. kTextEncodingsFolderIcon = $C6927465 (* 'Ätex' *);
  895. kUsersFolderIcon = $757372C6 (* 'usrÄ' *);
  896. kUtilitiesFolderIcon = $757469C6 (* 'utiÄ' *);
  897. kVoicesFolderIcon = $66766F63 (* 'fvoc' *);
  898. kSystemFolderXIcon = $6D616378 (* 'macx' *);
  899. { Badges }
  900. kAppleScriptBadgeIcon = $73637270 (* 'scrp' *);
  901. kLockedBadgeIcon = $6C626467 (* 'lbdg' *);
  902. kMountedBadgeIcon = $6D626467 (* 'mbdg' *);
  903. kSharedBadgeIcon = $73626467 (* 'sbdg' *);
  904. kAliasBadgeIcon = $61626467 (* 'abdg' *);
  905. kAlertCautionBadgeIcon = $63626467 (* 'cbdg' *);
  906. { Alert icons }
  907. kAlertNoteIcon = $6E6F7465 (* 'note' *);
  908. kAlertCautionIcon = $63617574 (* 'caut' *);
  909. kAlertStopIcon = $73746F70 (* 'stop' *);
  910. { Networking icons }
  911. kAppleTalkIcon = $61746C6B (* 'atlk' *);
  912. kAppleTalkZoneIcon = $61747A6E (* 'atzn' *);
  913. kAFPServerIcon = $61667073 (* 'afps' *);
  914. kFTPServerIcon = $66747073 (* 'ftps' *);
  915. kHTTPServerIcon = $68747073 (* 'htps' *);
  916. kGenericNetworkIcon = $676E6574 (* 'gnet' *);
  917. kIPFileServerIcon = $69737276 (* 'isrv' *);
  918. { Toolbar icons }
  919. kToolbarCustomizeIcon = $74637573 (* 'tcus' *);
  920. kToolbarDeleteIcon = $7464656C (* 'tdel' *);
  921. kToolbarFavoritesIcon = $74666176 (* 'tfav' *);
  922. kToolbarHomeIcon = $74686F6D (* 'thom' *);
  923. { Other icons }
  924. kAppleLogoIcon = $6361706C (* 'capl' *);
  925. kAppleMenuIcon = $7361706C (* 'sapl' *);
  926. kBackwardArrowIcon = $6261726F (* 'baro' *);
  927. kFavoriteItemsIcon = $66617672 (* 'favr' *);
  928. kForwardArrowIcon = $6661726F (* 'faro' *);
  929. kGridIcon = $67726964 (* 'grid' *);
  930. kHelpIcon = $68656C70 (* 'help' *);
  931. kKeepArrangedIcon = $61726E67 (* 'arng' *);
  932. kLockedIcon = $6C6F636B (* 'lock' *);
  933. kNoFilesIcon = $6E66696C (* 'nfil' *);
  934. kNoFolderIcon = $6E666C64 (* 'nfld' *);
  935. kNoWriteIcon = $6E777274 (* 'nwrt' *);
  936. kProtectedApplicationFolderIcon = $70617070 (* 'papp' *);
  937. kProtectedSystemFolderIcon = $70737973 (* 'psys' *);
  938. kRecentItemsIcon = $72636E74 (* 'rcnt' *);
  939. kShortcutIcon = $73687274 (* 'shrt' *);
  940. kSortAscendingIcon = $61736E64 (* 'asnd' *);
  941. kSortDescendingIcon = $64736E64 (* 'dsnd' *);
  942. kUnlockedIcon = $756C636B (* 'ulck' *);
  943. kConnectToIcon = $636E6374 (* 'cnct' *);
  944. kGenericWindowIcon = $6777696E (* 'gwin' *);
  945. kQuestionMarkIcon = $71756573 (* 'ques' *);
  946. kDeleteAliasIcon = $64616C69 (* 'dali' *);
  947. kEjectMediaIcon = $656A6563 (* 'ejec' *);
  948. kBurningIcon = $6275726E (* 'burn' *);
  949. kRightContainerArrowIcon = $72636172 (* 'rcar' *);
  950. { IconServicesUsageFlags }
  951. type
  952. IconServicesUsageFlags = UInt32;
  953. const
  954. kIconServicesNormalUsageFlag = $00000000;
  955. kIconServicesNoBadgeFlag = $00000001; // available on Panther and later
  956. kIconServicesUpdateIfNeededFlag = $00000002; // available on Panther and later
  957. {
  958. kIconServicesCatalogInfoMask - Minimal bitmask for use with
  959. GetIconRefFromFileInfo(). Use this mask with FSGetCatalogInfo
  960. before calling GetIconRefFromFileInfo().
  961. }
  962. kIconServicesCatalogInfoMask = $0008181E;
  963. {
  964. * PlotIconRefFlags
  965. *
  966. * Discussion:
  967. * Flags that can be passed to the PlotIconRefInContext routine.
  968. }
  969. type
  970. PlotIconRefFlags = UInt32;
  971. const
  972. kPlotIconRefNormalFlags = 0;
  973. kPlotIconRefNoImage = $02;
  974. kPlotIconRefNoMask = $04;
  975. {
  976. IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).
  977. For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
  978. the classic custom icons (individual 'ics#, ICN#, etc) are fetched. If the fetch of the icns resource
  979. succeeds then the icns is looked at exclusively for the icon data.
  980. For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
  981. This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
  982. MacOS Finder.
  983. DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
  984. driver icon for a particular device. The result of the kdgMediaIconSuite call to DriverGestalt should
  985. be a pointer an an IconFamily. In this manner driver vendors can provide rich, detailed drive icons
  986. instead of the 1-bit variety previously supported.
  987. }
  988. kIconFamilyType = $69636E73 (* 'icns' *);
  989. type
  990. IconFamilyElementPtr = ^IconFamilyElement;
  991. IconFamilyElement = record
  992. elementType: OSType; { 'ICN#', 'icl8', etc... }
  993. elementSize: Size; { Size of this element }
  994. elementData: SInt8;
  995. end;
  996. IconFamilyResourcePtr = ^IconFamilyResource;
  997. IconFamilyResource = record
  998. resourceType: OSType; { Always 'icns' }
  999. resourceSize: Size; { Total size of this resource }
  1000. elements: array [0..0] of IconFamilyElement;
  1001. end;
  1002. IconFamilyPtr = ^IconFamilyResource;
  1003. IconFamilyHandle = ^IconFamilyPtr;
  1004. {
  1005. ==============================================================================
  1006. Initialization and Termination
  1007. ==============================================================================
  1008. }
  1009. {
  1010. IconServicesInit
  1011. Call this routine once per classic 68K application initialization.
  1012. This routine does not need to be called at boot time.
  1013. }
  1014. {$ifc CALL_NOT_IN_CARBON}
  1015. {
  1016. * IconServicesInit()
  1017. *
  1018. * Availability:
  1019. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1020. * CarbonLib: not available
  1021. * Mac OS X: not available
  1022. }
  1023. function IconServicesInit(initBlockPtr: CFragInitBlockPtr): OSErr; external name '_IconServicesInit';
  1024. {
  1025. IconServicesTerminate:
  1026. Call this routine once from the termination of a classic 68K application.
  1027. This routine does not need to be called at boot time.
  1028. }
  1029. {
  1030. * IconServicesTerminate()
  1031. *
  1032. * Availability:
  1033. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1034. * CarbonLib: not available
  1035. * Mac OS X: not available
  1036. }
  1037. procedure IconServicesTerminate; external name '_IconServicesTerminate';
  1038. {$endc} {CALL_NOT_IN_CARBON}
  1039. {
  1040. ==============================================================================
  1041. Converting data structures
  1042. ==============================================================================
  1043. }
  1044. {
  1045. IconRefToIconFamily
  1046. This routines returns a new IconFamily that contains the data corresponding
  1047. to the specified IconRef.
  1048. }
  1049. {
  1050. * IconRefToIconFamily()
  1051. *
  1052. * Availability:
  1053. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1054. * CarbonLib: in CarbonLib 1.0 and later
  1055. * Mac OS X: in version 10.0 and later
  1056. }
  1057. function IconRefToIconFamily(theIconRef: IconRef; whichIcons: IconSelectorValue; var iconFamily: IconFamilyHandle): OSErr; external name '_IconRefToIconFamily';
  1058. {
  1059. IconFamilyToIconSuite
  1060. This routine transfers the data from an icon family handle into an icon suite.
  1061. }
  1062. {
  1063. * IconFamilyToIconSuite()
  1064. *
  1065. * Availability:
  1066. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1067. * CarbonLib: in CarbonLib 1.0 and later
  1068. * Mac OS X: in version 10.0 and later
  1069. }
  1070. function IconFamilyToIconSuite(iconFamily: IconFamilyHandle; whichIcons: IconSelectorValue; var iconSuite: IconSuiteRef): OSErr; external name '_IconFamilyToIconSuite';
  1071. {
  1072. IconSuiteToIconFamily
  1073. This routine transfers the data in an icon suite into an icon family.
  1074. }
  1075. {
  1076. * IconSuiteToIconFamily()
  1077. *
  1078. * Availability:
  1079. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1080. * CarbonLib: in CarbonLib 1.0 and later
  1081. * Mac OS X: in version 10.0 and later
  1082. }
  1083. function IconSuiteToIconFamily(iconSuite: IconSuiteRef; whichIcons: IconSelectorValue; var iconFamily: IconFamilyHandle): OSErr; external name '_IconSuiteToIconFamily';
  1084. {
  1085. SetIconFamilyData
  1086. Change the data of an icon family. The data is copied.
  1087. The type can be one of the icon type, or 'PICT'.
  1088. The data will be compressed if needed.
  1089. }
  1090. {
  1091. * SetIconFamilyData()
  1092. *
  1093. * Availability:
  1094. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1095. * CarbonLib: in CarbonLib 1.0 and later
  1096. * Mac OS X: in version 10.0 and later
  1097. }
  1098. function SetIconFamilyData(iconFamily: IconFamilyHandle; iconType: OSType; h: Handle): OSErr; external name '_SetIconFamilyData';
  1099. {
  1100. GetIconFamilyData
  1101. Return a copy of the data in the icon family.
  1102. The type can be one of the icon type, or 'PICT'
  1103. The data will be returned uncompressed.
  1104. The handle (h) will be resized as appropriate. If no data of the
  1105. requested type is present, the handle size will be set to 0.
  1106. }
  1107. {
  1108. * GetIconFamilyData()
  1109. *
  1110. * Availability:
  1111. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1112. * CarbonLib: in CarbonLib 1.0 and later
  1113. * Mac OS X: in version 10.0 and later
  1114. }
  1115. function GetIconFamilyData(iconFamily: IconFamilyHandle; iconType: OSType; h: Handle): OSErr; external name '_GetIconFamilyData';
  1116. {
  1117. ==============================================================================
  1118. Reference counting
  1119. ==============================================================================
  1120. }
  1121. {
  1122. GetIconRefOwners
  1123. This routine returns the reference count for the IconRef, or number of owners.
  1124. A valid IconRef always has at least one owner.
  1125. }
  1126. {
  1127. * GetIconRefOwners()
  1128. *
  1129. * Availability:
  1130. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1131. * CarbonLib: in CarbonLib 1.0 and later
  1132. * Mac OS X: in version 10.0 and later
  1133. }
  1134. function GetIconRefOwners(theIconRef: IconRef; var owners: UInt16): OSErr; external name '_GetIconRefOwners';
  1135. {
  1136. AcquireIconRef
  1137. This routine increments the reference count for the IconRef
  1138. }
  1139. {
  1140. * AcquireIconRef()
  1141. *
  1142. * Availability:
  1143. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1144. * CarbonLib: in CarbonLib 1.0 and later
  1145. * Mac OS X: in version 10.0 and later
  1146. }
  1147. function AcquireIconRef(theIconRef: IconRef): OSErr; external name '_AcquireIconRef';
  1148. {
  1149. ReleaseIconRef
  1150. This routine decrements the reference count for the IconRef.
  1151. When the reference count reaches 0, all memory allocated for the icon
  1152. is disposed. Any subsequent use of the IconRef is invalid.
  1153. }
  1154. {
  1155. * ReleaseIconRef()
  1156. *
  1157. * Availability:
  1158. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1159. * CarbonLib: in CarbonLib 1.0 and later
  1160. * Mac OS X: in version 10.0 and later
  1161. }
  1162. function ReleaseIconRef(theIconRef: IconRef): OSErr; external name '_ReleaseIconRef';
  1163. {
  1164. ==============================================================================
  1165. Getting an IconRef
  1166. ==============================================================================
  1167. }
  1168. {
  1169. GetIconRefFromFile
  1170. This routine returns an icon ref for the specified file, folder or volume.
  1171. The label information is provided separately, since two files with the same icon
  1172. but a different label would share the same iconRef. The label can be used in
  1173. PlotIconRef() for example.
  1174. Use this routine if you have no information about the file system object. If
  1175. you have already done a GetCatInfo on the file and want to save some I/O,
  1176. call GetIconRefFromFolder() if you know it's a folder with no custom icon or
  1177. call GetIconRef() if it's a file with no custom icon.
  1178. This routine increments the reference count of the returned IconRef. Call
  1179. ReleaseIconRef() when you're done with it.
  1180. }
  1181. {
  1182. * GetIconRefFromFile()
  1183. *
  1184. * Availability:
  1185. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1186. * CarbonLib: in CarbonLib 1.0 and later
  1187. * Mac OS X: in version 10.0 and later
  1188. }
  1189. function GetIconRefFromFile(const (*var*) theFile: FSSpec; var theIconRef: IconRef; var theLabel: SInt16): OSErr; external name '_GetIconRefFromFile';
  1190. {
  1191. GetIconRef
  1192. This routine returns an icon ref for an icon in the desktop database or
  1193. for a registered icon.
  1194. The system registers a set of icon such as the help icon with the creator
  1195. code kSystemIconsCreator. See above for a list of the registered system types.
  1196. The vRefNum is used as a hint on where to look for the icon first. Use
  1197. kOnSystemDisk if you don't know what to pass.
  1198. This routine increments the reference count of the returned IconRef. Call
  1199. ReleaseIconRef() when you're done with it.
  1200. }
  1201. {
  1202. * GetIconRef()
  1203. *
  1204. * Availability:
  1205. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1206. * CarbonLib: in CarbonLib 1.0 and later
  1207. * Mac OS X: in version 10.0 and later
  1208. }
  1209. function GetIconRef(vRefNum: SInt16; creator: OSType; iconType: OSType; var theIconRef: IconRef): OSErr; external name '_GetIconRef';
  1210. {
  1211. GetIconRefFromFolder
  1212. This routine returns an icon ref for a folder with no custom icon.
  1213. Use the more generic, but slightly slower, GetIconRefFromFile() if
  1214. you don't already have the necessary info about the file.
  1215. Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
  1216. Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
  1217. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1218. when you're done with it.
  1219. }
  1220. {
  1221. * GetIconRefFromFolder()
  1222. *
  1223. * Availability:
  1224. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1225. * CarbonLib: in CarbonLib 1.0 and later
  1226. * Mac OS X: in version 10.0 and later
  1227. }
  1228. function GetIconRefFromFolder(vRefNum: SInt16; parentFolderID: SInt32; folderID: SInt32; attributes: SInt8; accessPrivileges: SInt8; var theIconRef: IconRef): OSErr; external name '_GetIconRefFromFolder';
  1229. { GetIconRefFromFileInfo }
  1230. {
  1231. * GetIconRefFromFileInfo()
  1232. *
  1233. * Summary:
  1234. * This routine returns an IconRef for a file with minimal file I/O.
  1235. *
  1236. * Discussion:
  1237. * To minimize file operations, FSGetCatalogInfo should be called
  1238. * prior to calling this routine. The FSCatalogInfo should
  1239. * correspond to kIconServicesCatalogInfoMask The name should be
  1240. * fetched and passed in. If either the name or the correct catalog
  1241. * info is not passed in, this routine will do file operations for
  1242. * this information instead.
  1243. *
  1244. * Parameters:
  1245. *
  1246. * inRef:
  1247. * An FSRef for the target file
  1248. *
  1249. * inFileNameLength:
  1250. * The length of the name of the target file
  1251. *
  1252. * inFileName:
  1253. * The name of the target file
  1254. *
  1255. * inWhichInfo:
  1256. * The mask of file info already acquired.
  1257. *
  1258. * inCatalogInfo:
  1259. * The catalog info already acquired.
  1260. *
  1261. * inUsageFlags:
  1262. * The usage flags for this call (use
  1263. * kIconServicesNormalUsageFlag).
  1264. *
  1265. * outIconRef:
  1266. * The output IconRef for the routine.
  1267. *
  1268. * outLabel:
  1269. * The output label for the icon/file.
  1270. *
  1271. * Availability:
  1272. * Non-Carbon CFM: not available
  1273. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1274. * Mac OS X: in version 10.1 and later
  1275. }
  1276. function GetIconRefFromFileInfo(const (*var*) inRef: FSRef; inFileNameLength: UniCharCount; inFileName: UniCharPtr; inWhichInfo: FSCatalogInfoBitmap; inCatalogInfo: {Const}FSCatalogInfoPtr; inUsageFlags: IconServicesUsageFlags; var outIconRef: IconRef; var outLabel: SInt16): OSStatus; external name '_GetIconRefFromFileInfo';
  1277. { GetIconRefFromTypeInfo}
  1278. {
  1279. * GetIconRefFromTypeInfo()
  1280. *
  1281. * Summary:
  1282. * Create an IconRef for a type information.
  1283. *
  1284. * Discussion:
  1285. * Creates IconRef based on provided type info. Any of the input
  1286. * parameters can be zero (meaning it is unknown). Returns generic
  1287. * document icon in case if all parameters are zeroes. Calling the
  1288. * routine with non zero inCreator and inType and zero inExtension
  1289. * and inMIMEType is equivalent to GetIconRef(kOnSystemDisk,
  1290. * inCreator, inType).
  1291. *
  1292. * Mac OS X threading:
  1293. * Not thread safe
  1294. *
  1295. * Parameters:
  1296. *
  1297. * inCreator:
  1298. * The creator.
  1299. *
  1300. * inType:
  1301. * The type.
  1302. *
  1303. * inExtension:
  1304. * The extension.
  1305. *
  1306. * inMIMEType:
  1307. * The MIME type.
  1308. *
  1309. * inUsageFlags:
  1310. * The usage flags for this call (use
  1311. * kIconServicesNormalUsageFlag).
  1312. *
  1313. * outIconRef:
  1314. * The output IconRef for the routine.
  1315. *
  1316. * Availability:
  1317. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1318. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1319. * Non-Carbon CFM: not available
  1320. }
  1321. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  1322. function GetIconRefFromTypeInfo( inCreator: OSType; inType: OSType; inExtension: CFStringRef; inMIMEType: CFStringRef; inUsageFlags: IconServicesUsageFlags; var outIconRef: IconRef ): OSErr; external name '_GetIconRefFromTypeInfo';
  1323. { GetIconRefFromIconFamilyPtr}
  1324. {
  1325. * GetIconRefFromIconFamilyPtr()
  1326. *
  1327. * Summary:
  1328. * Create an IconRef for the IconFamilyPtr.
  1329. *
  1330. * Discussion:
  1331. * This routine creates IconRef for the IconFamilyPtr.
  1332. *
  1333. * Mac OS X threading:
  1334. * Not thread safe
  1335. *
  1336. * Parameters:
  1337. *
  1338. * inIconFamilyPtr:
  1339. * The icon data
  1340. *
  1341. * inSize:
  1342. * The icon data size
  1343. *
  1344. * outIconRef:
  1345. * The output IconRef for the routine.
  1346. *
  1347. * Availability:
  1348. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1349. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1350. * Non-Carbon CFM: not available
  1351. }
  1352. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  1353. function GetIconRefFromIconFamilyPtr( const (*var*) inIconFamilyPtr: IconFamilyResource; inSize: Size; var outIconRef: IconRef ): OSStatus; external name '_GetIconRefFromIconFamilyPtr';
  1354. {
  1355. ==============================================================================
  1356. Adding and modifying IconRef
  1357. ==============================================================================
  1358. }
  1359. {
  1360. RegisterIconRefFromIconFamily
  1361. This routine adds a new entry to the IconRef registry. Other clients will be
  1362. able to access it using the (creator, iconType) pair specified here.
  1363. Lower-case creators are reserved for the system.
  1364. Consider using RegisterIconRefFromResource() if possible, since the data
  1365. registered using RegisterIconRefFromFamily() cannot be purged.
  1366. The iconFamily data is copied and the caller is reponsible for disposing of it.
  1367. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1368. when you're done with it.
  1369. }
  1370. {
  1371. * RegisterIconRefFromIconFamily()
  1372. *
  1373. * Availability:
  1374. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1375. * CarbonLib: in CarbonLib 1.0 and later
  1376. * Mac OS X: in version 10.0 and later
  1377. }
  1378. function RegisterIconRefFromIconFamily(creator: OSType; iconType: OSType; iconFamily: IconFamilyHandle; var theIconRef: IconRef): OSErr; external name '_RegisterIconRefFromIconFamily';
  1379. {
  1380. RegisterIconRefFromResource
  1381. Registers an IconRef from a resouce file.
  1382. Lower-case creators are reserved for the system.
  1383. The icon data to be fetched is either classic icon data or an icon family.
  1384. The 'icns' icon family is searched for before the classic icon data.
  1385. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1386. when you're done with it.
  1387. }
  1388. {
  1389. * RegisterIconRefFromResource()
  1390. *
  1391. * Availability:
  1392. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1393. * CarbonLib: in CarbonLib 1.0 and later
  1394. * Mac OS X: in version 10.0 and later
  1395. }
  1396. function RegisterIconRefFromResource(creator: OSType; iconType: OSType; const (*var*) resourceFile: FSSpec; resourceID: SInt16; var theIconRef: IconRef): OSErr; external name '_RegisterIconRefFromResource';
  1397. { RegisterIconRefFromFSRef }
  1398. {
  1399. * RegisterIconRefFromFSRef()
  1400. *
  1401. * Discussion:
  1402. * This routine registers an IconRef from a ".icns" file and
  1403. * associates it with a creator/type pair.
  1404. *
  1405. * Parameters:
  1406. *
  1407. * creator:
  1408. * The creator code for the icns file.
  1409. *
  1410. * iconType:
  1411. * The type code for the icns file
  1412. *
  1413. * iconFile:
  1414. * The FSRef of the icns file.
  1415. *
  1416. * theIconRef:
  1417. * The output IconRef for the routine.
  1418. *
  1419. * Availability:
  1420. * Non-Carbon CFM: not available
  1421. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1422. * Mac OS X: in version 10.1 and later
  1423. }
  1424. function RegisterIconRefFromFSRef(creator: OSType; iconType: OSType; const (*var*) iconFile: FSRef; var theIconRef: IconRef): OSStatus; external name '_RegisterIconRefFromFSRef';
  1425. {
  1426. UnregisterIconRef
  1427. Removes the specified icon from the icon cache (if there are no users of it).
  1428. If some clients are using this iconRef, then the IconRef will be removed when the
  1429. last user calls ReleaseIconRef.
  1430. }
  1431. {
  1432. * UnregisterIconRef()
  1433. *
  1434. * Availability:
  1435. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1436. * CarbonLib: in CarbonLib 1.0 and later
  1437. * Mac OS X: in version 10.0 and later
  1438. }
  1439. function UnregisterIconRef(creator: OSType; iconType: OSType): OSErr; external name '_UnregisterIconRef';
  1440. {
  1441. UpdateIconRef
  1442. Call this routine to force an update of the data for iconRef.
  1443. For example after changing an icon in the desktop database or changing the custom
  1444. icon of a file. Note that after _adding_ a custom icon to file or folder, you
  1445. need to call GetIconRefFromFile() to get a new IconRef specific to this file.
  1446. This routine does nothing if the IconRef is a registered icon.
  1447. }
  1448. {
  1449. * UpdateIconRef()
  1450. *
  1451. * Availability:
  1452. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1453. * CarbonLib: in CarbonLib 1.0 and later
  1454. * Mac OS X: in version 10.0 and later
  1455. }
  1456. function UpdateIconRef(theIconRef: IconRef): OSErr; external name '_UpdateIconRef';
  1457. {
  1458. OverrideIconRefFromResource
  1459. This routines replaces the bitmaps of the specified IconRef with the ones
  1460. in the specified resource file.
  1461. }
  1462. {
  1463. * OverrideIconRefFromResource()
  1464. *
  1465. * Availability:
  1466. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1467. * CarbonLib: in CarbonLib 1.0 and later
  1468. * Mac OS X: in version 10.0 and later
  1469. }
  1470. function OverrideIconRefFromResource(theIconRef: IconRef; const (*var*) resourceFile: FSSpec; resourceID: SInt16): OSErr; external name '_OverrideIconRefFromResource';
  1471. {
  1472. OverrideIconRef
  1473. This routines replaces the bitmaps of the specified IconRef with the ones
  1474. from the new IconRef.
  1475. }
  1476. {
  1477. * OverrideIconRef()
  1478. *
  1479. * Availability:
  1480. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1481. * CarbonLib: in CarbonLib 1.0 and later
  1482. * Mac OS X: in version 10.0 and later
  1483. }
  1484. function OverrideIconRef(oldIconRef: IconRef; newIconRef: IconRef): OSErr; external name '_OverrideIconRef';
  1485. {
  1486. RemoveIconRefOverride
  1487. This routine remove an override if one was applied to the icon and
  1488. reverts back to the original bitmap data.
  1489. }
  1490. {
  1491. * RemoveIconRefOverride()
  1492. *
  1493. * Availability:
  1494. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1495. * CarbonLib: in CarbonLib 1.0 and later
  1496. * Mac OS X: in version 10.0 and later
  1497. }
  1498. function RemoveIconRefOverride(theIconRef: IconRef): OSErr; external name '_RemoveIconRefOverride';
  1499. {
  1500. ==============================================================================
  1501. Creating composite IconRef
  1502. ==============================================================================
  1503. }
  1504. {
  1505. CompositeIconRef
  1506. Superimposes an IconRef on top of another one
  1507. }
  1508. {
  1509. * CompositeIconRef()
  1510. *
  1511. * Availability:
  1512. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1513. * CarbonLib: in CarbonLib 1.0 and later
  1514. * Mac OS X: in version 10.0 and later
  1515. }
  1516. function CompositeIconRef(backgroundIconRef: IconRef; foregroundIconRef: IconRef; var compositeIconRef: IconRef): OSErr; external name '_CompositeIconRef';
  1517. {
  1518. IsIconRefComposite
  1519. Indicates if a given icon ref is a composite of two other icon refs (and which ones)
  1520. If it isn't a composite, backgroundIconRef and foreGroundIconRef will be 0.
  1521. }
  1522. {
  1523. * IsIconRefComposite()
  1524. *
  1525. * Availability:
  1526. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1527. * CarbonLib: in CarbonLib 1.0 and later
  1528. * Mac OS X: in version 10.0 and later
  1529. }
  1530. function IsIconRefComposite(compositeIconRef: IconRef; var backgroundIconRef: IconRef; var foregroundIconRef: IconRef): OSErr; external name '_IsIconRefComposite';
  1531. {
  1532. ==============================================================================
  1533. Using IconRef
  1534. ==============================================================================
  1535. }
  1536. {
  1537. IsValidIconRef
  1538. Return true if the iconRef passed in is a valid icon ref
  1539. }
  1540. {
  1541. * IsValidIconRef()
  1542. *
  1543. * Availability:
  1544. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1545. * CarbonLib: in CarbonLib 1.0 and later
  1546. * Mac OS X: in version 10.0 and later
  1547. }
  1548. function IsValidIconRef(theIconRef: IconRef): boolean; external name '_IsValidIconRef';
  1549. {
  1550. PlotIconRef
  1551. This routine plots the IconRef. It mostly takes the same parameters as
  1552. PlotIconSuite. Pass kIconServicesNormalUsageFlag as a default value for
  1553. IconServicesUsageFlags.
  1554. }
  1555. {
  1556. * PlotIconRef()
  1557. *
  1558. * Availability:
  1559. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1560. * CarbonLib: in CarbonLib 1.0 and later
  1561. * Mac OS X: in version 10.0 and later
  1562. }
  1563. function PlotIconRef(const (*var*) theRect: Rect; align: IconAlignmentType; transform: IconTransformType; theIconServicesUsageFlags: IconServicesUsageFlags; theIconRef: IconRef): OSErr; external name '_PlotIconRef';
  1564. { PlotIconRefInContext }
  1565. {
  1566. * PlotIconRefInContext()
  1567. *
  1568. * Discussion:
  1569. * This routines plots an IconRef using Quartz/CoreGraphics.
  1570. *
  1571. * Parameters:
  1572. *
  1573. * inContext:
  1574. * The graphics context to use.
  1575. *
  1576. * inRect:
  1577. * The rect to plot the icon in.
  1578. *
  1579. * inAlign:
  1580. * The icon alignment.
  1581. *
  1582. * inTransform:
  1583. * The icon transform.
  1584. *
  1585. * inLabelColor:
  1586. * The icon label color.
  1587. *
  1588. * inFlags:
  1589. * The drawing flags to use (usually kPlotIconRefNormalFlags).
  1590. *
  1591. * inIconRef:
  1592. * The IconRef to plot.
  1593. *
  1594. * Availability:
  1595. * Non-Carbon CFM: not available
  1596. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1597. * Mac OS X: in version 10.1 and later
  1598. }
  1599. function PlotIconRefInContext(inContext: CGContextRef; const (*var*) inRect: CGRect; inAlign: IconAlignmentType; inTransform: IconTransformType; inLabelColor: RGBColorPtr; inFlags: PlotIconRefFlags; inIconRef: IconRef): OSStatus; external name '_PlotIconRefInContext';
  1600. {
  1601. PtInIconRef
  1602. This routine indicates if testPt would hit the icon designated by iconRef.
  1603. It mostly takes the same parameters as PtInIconSuite.
  1604. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1605. }
  1606. {
  1607. * PtInIconRef()
  1608. *
  1609. * Availability:
  1610. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1611. * CarbonLib: in CarbonLib 1.0 and later
  1612. * Mac OS X: in version 10.0 and later
  1613. }
  1614. function PtInIconRef(const (*var*) testPt: Point; const (*var*) iconRect: Rect; align: IconAlignmentType; theIconServicesUsageFlags: IconServicesUsageFlags; theIconRef: IconRef): boolean; external name '_PtInIconRef';
  1615. {
  1616. RectInIconRef
  1617. This routine indicates if testRect would intersect the icon designated by iconRef.
  1618. It mostly takes the same parameters as RectInIconSuite.
  1619. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1620. }
  1621. {
  1622. * RectInIconRef()
  1623. *
  1624. * Availability:
  1625. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1626. * CarbonLib: in CarbonLib 1.0 and later
  1627. * Mac OS X: in version 10.0 and later
  1628. }
  1629. function RectInIconRef(const (*var*) testRect: Rect; const (*var*) iconRect: Rect; align: IconAlignmentType; iconServicesUsageFlags_: IconServicesUsageFlags; theIconRef: IconRef): boolean; external name '_RectInIconRef';
  1630. {
  1631. IconRefToRgn
  1632. This routine returns a region for the icon.
  1633. It mostly takes the same parameters as IconSuiteToRgn.
  1634. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1635. }
  1636. {
  1637. * IconRefToRgn()
  1638. *
  1639. * Availability:
  1640. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1641. * CarbonLib: in CarbonLib 1.0 and later
  1642. * Mac OS X: in version 10.0 and later
  1643. }
  1644. function IconRefToRgn(theRgn: RgnHandle; const (*var*) iconRect: Rect; align: IconAlignmentType; iconServicesUsageFlags_: IconServicesUsageFlags; theIconRef: IconRef): OSErr; external name '_IconRefToRgn';
  1645. {
  1646. GetIconSizesFromIconRef
  1647. This routine returns an IconSelectorValue indicating the depths and sizes of
  1648. icon data which are actually available. It takes an IconSelectorValue
  1649. indicating which sizes/depths the caller is interested and returns an
  1650. IconSelectorValue indicating which sizes/depths exist.
  1651. Caution:
  1652. This is potentially an extremely expensive call as IconServices may be forced
  1653. to attempt fetching the data for the IconRef's sizes/depths which may result
  1654. in hitting the local disk or even the network to obtain the data to determine
  1655. which sizes/depths actually exist.
  1656. Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1657. This call is deprecated. Please use IsDataAvailableInIconRef() instead.
  1658. }
  1659. {
  1660. * GetIconSizesFromIconRef() *** DEPRECATED ***
  1661. *
  1662. * Mac OS X threading:
  1663. * Not thread safe
  1664. *
  1665. * Availability:
  1666. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1667. * CarbonLib: in CarbonLib 1.0 and later
  1668. * Mac OS X: in version 10.0 and later
  1669. }
  1670. function GetIconSizesFromIconRef(iconSelectorInput: IconSelectorValue; var iconSelectorOutputPtr: IconSelectorValue; iconServicesUsageFlags_: IconServicesUsageFlags; theIconRef: IconRef): OSErr; external name '_GetIconSizesFromIconRef';
  1671. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
  1672. { IsDataAvailableInIconRef}
  1673. {
  1674. * IsDataAvailableInIconRef()
  1675. *
  1676. * Summary:
  1677. * Check if IconRef has specific data.
  1678. *
  1679. * Discussion:
  1680. * This routine returns true if inIconKind icon data is availabe or
  1681. * can be created.
  1682. *
  1683. * Mac OS X threading:
  1684. * Not thread safe
  1685. *
  1686. * Parameters:
  1687. *
  1688. * inIconKind:
  1689. * The icon data kind
  1690. *
  1691. * inIconRef:
  1692. * The IconRef to test.
  1693. *
  1694. * Availability:
  1695. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1696. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1697. * Non-Carbon CFM: not available
  1698. }
  1699. function IsDataAvailableInIconRef( inIconKind: OSType; inIconRef: IconRef ): Boolean; external name '_IsDataAvailableInIconRef';
  1700. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1701. {
  1702. ==============================================================================
  1703. Flushing IconRef data
  1704. ==============================================================================
  1705. }
  1706. {
  1707. FlushIconRefs
  1708. Making this call will dispose of all the data for the specified icons if
  1709. the data can be reacquired, for example if the data is provided from a resource.
  1710. '****' is a wildcard for all types or all creators.
  1711. }
  1712. {
  1713. * FlushIconRefs() *** DEPRECATED ***
  1714. *
  1715. * Mac OS X threading:
  1716. * Thread safe since version 10.2
  1717. *
  1718. * Availability:
  1719. * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.3
  1720. * CarbonLib: in CarbonLib 1.0 and later
  1721. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1722. }
  1723. function FlushIconRefs(creator: OSType; iconType: OSType): OSErr; external name '_FlushIconRefs';
  1724. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
  1725. {
  1726. FlushIconRefsByVolume
  1727. This routine disposes of the data for the icons related to the indicated volume
  1728. if this data can be reacquired, for example if the data is provided from a
  1729. resource.
  1730. }
  1731. {
  1732. * FlushIconRefsByVolume() *** DEPRECATED ***
  1733. *
  1734. * Mac OS X threading:
  1735. * Thread safe since version 10.2
  1736. *
  1737. * Availability:
  1738. * Mac OS X: in version 10.0 and later in ApplicationServices.framework but deprecated in 10.3
  1739. * CarbonLib: in CarbonLib 1.0 and later
  1740. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1741. }
  1742. function FlushIconRefsByVolume(vRefNum: SInt16): OSErr; external name '_FlushIconRefsByVolume';
  1743. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
  1744. {
  1745. ==============================================================================
  1746. Controling custom icons
  1747. ==============================================================================
  1748. }
  1749. {
  1750. SetCustomIconsEnabled
  1751. Enable or disable custom icons on the specified volume.
  1752. }
  1753. {
  1754. * SetCustomIconsEnabled()
  1755. *
  1756. * Availability:
  1757. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1758. * CarbonLib: in CarbonLib 1.0 and later
  1759. * Mac OS X: in version 10.0 and later
  1760. }
  1761. function SetCustomIconsEnabled(vRefNum: SInt16; enableCustomIcons: boolean): OSErr; external name '_SetCustomIconsEnabled';
  1762. {
  1763. GetCustomIconsEnabled
  1764. Return true if custom icons are enabled on the specified volume, false otherwise.
  1765. }
  1766. {
  1767. * GetCustomIconsEnabled()
  1768. *
  1769. * Availability:
  1770. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1771. * CarbonLib: in CarbonLib 1.0 and later
  1772. * Mac OS X: in version 10.0 and later
  1773. }
  1774. function GetCustomIconsEnabled(vRefNum: SInt16; var customIconsEnabled: boolean): OSErr; external name '_GetCustomIconsEnabled';
  1775. {
  1776. IsIconRefMaskEmpty
  1777. Returns true if the mask for this icon is blank
  1778. }
  1779. {
  1780. * IsIconRefMaskEmpty()
  1781. *
  1782. * Availability:
  1783. * Non-Carbon CFM: in IconServicesLib 8.5 and later
  1784. * CarbonLib: in CarbonLib 1.0 and later
  1785. * Mac OS X: in version 10.0 and later
  1786. }
  1787. function IsIconRefMaskEmpty(iconRef_: IconRef): boolean; external name '_IsIconRefMaskEmpty';
  1788. {
  1789. GetIconRefVariant
  1790. Icon variants allows different images to be used with different icon state.
  1791. For example, the 'open' variant for a folder could be represented with
  1792. an open folder.
  1793. Given an icon ref and a desired variant, this routine returns an icon
  1794. ref (which may be the same as the input icon ref) and a transformation
  1795. which should be used with PlotIconRef() to render the icon appropriately.
  1796. The returned icon ref should be used to do hit-testing.
  1797. }
  1798. {
  1799. * GetIconRefVariant()
  1800. *
  1801. * Availability:
  1802. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1803. * CarbonLib: in CarbonLib 1.0 and later
  1804. * Mac OS X: in version 10.0 and later
  1805. }
  1806. function GetIconRefVariant(inIconRef: IconRef; inVariant: OSType; var outTransform: IconTransformType): IconRef; external name '_GetIconRefVariant';
  1807. {
  1808. ==============================================================================
  1809. Icon files (.icns files)
  1810. ==============================================================================
  1811. }
  1812. {
  1813. RegisterIconRefFromIconFile
  1814. This routine adds a new entry to the IconRef registry. Other clients will be
  1815. able to access it using the (creator, iconType) pair specified here.
  1816. Lower-case creators are reserved for the system.
  1817. If the creator is kSystemIconsCreator and the iconType is 0, a new IconRef
  1818. is always returned. Otherwise, if the creator and type have already been
  1819. registered, the previously registered IconRef is returned.
  1820. This routine increments the reference count of the IconRef. Call ReleaseIconRef()
  1821. when you're done with it.
  1822. }
  1823. {
  1824. * RegisterIconRefFromIconFile()
  1825. *
  1826. * Availability:
  1827. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1828. * CarbonLib: in CarbonLib 1.0 and later
  1829. * Mac OS X: in version 10.0 and later
  1830. }
  1831. function RegisterIconRefFromIconFile(creator: OSType; iconType: OSType; const (*var*) iconFile: FSSpec; var theIconRef: IconRef): OSErr; external name '_RegisterIconRefFromIconFile';
  1832. {
  1833. ReadIconFile
  1834. Read the specified icon file into the icon family handle.
  1835. The caller is responsible for disposing the iconFamily
  1836. }
  1837. {
  1838. * ReadIconFile()
  1839. *
  1840. * Availability:
  1841. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1842. * CarbonLib: in CarbonLib 1.0 and later
  1843. * Mac OS X: in version 10.0 and later
  1844. }
  1845. function ReadIconFile(const (*var*) iconFile: FSSpec; var iconFamily: IconFamilyHandle): OSErr; external name '_ReadIconFile';
  1846. { ReadIconFromFSRef }
  1847. {
  1848. * ReadIconFromFSRef()
  1849. *
  1850. * Discussion:
  1851. * This routine reads an icon (icns) file into memory.
  1852. *
  1853. * Parameters:
  1854. *
  1855. * ref:
  1856. * The FSRef for the icon file.
  1857. *
  1858. * iconFamily:
  1859. * The handle for the icon family.
  1860. *
  1861. * Availability:
  1862. * Non-Carbon CFM: not available
  1863. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1864. * Mac OS X: in version 10.1 and later
  1865. }
  1866. function ReadIconFromFSRef(const (*var*) ref: FSRef; var iconFamily: IconFamilyHandle): OSStatus; external name '_ReadIconFromFSRef';
  1867. {
  1868. WriteIconFile
  1869. Write the iconFamily handle to the specified file
  1870. }
  1871. {
  1872. * WriteIconFile()
  1873. *
  1874. * Availability:
  1875. * Non-Carbon CFM: in IconServicesLib 9.0 and later
  1876. * CarbonLib: in CarbonLib 1.0 and later
  1877. * Mac OS X: in version 10.0 and later
  1878. }
  1879. function WriteIconFile(iconFamily: IconFamilyHandle; const (*var*) iconFile: FSSpec): OSErr; external name '_WriteIconFile';
  1880. {$ALIGN MAC68K}
  1881. end.