Collections.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. {
  2. File: Collections.p
  3. Contains: Collection Manager Interfaces
  4. Version: Technology: Carbon
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1989-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. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit Collections;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MixedMode;
  92. {$ALIGN MAC68K}
  93. {***********}
  94. { Constants }
  95. {***********}
  96. { Convenience constants for functions which optionally return values }
  97. const
  98. kCollectionDontWantTag = 0;
  99. kCollectionDontWantId = 0;
  100. kCollectionDontWantSize = 0;
  101. kCollectionDontWantAttributes = 0;
  102. kCollectionDontWantIndex = 0;
  103. kCollectionDontWantData = 0;
  104. { attributes bits }
  105. kCollectionNoAttributes = $00000000; { no attributes bits set }
  106. kCollectionAllAttributes = $FFFFFFFF; { all attributes bits set }
  107. kCollectionUserAttributes = $0000FFFF; { user attributes bits }
  108. kCollectionDefaultAttributes = $40000000; { default attributes - unlocked, persistent }
  109. {
  110. Attribute bits 0 through 15 (entire low word) are reserved for use by the application.
  111. Attribute bits 16 through 31 (entire high word) are reserved for use by the Collection Manager.
  112. Only bits 31 (kCollectionLockBit) and 30 (kCollectionPersistenceBit) currently have meaning.
  113. }
  114. kCollectionUser0Bit = 0;
  115. kCollectionUser1Bit = 1;
  116. kCollectionUser2Bit = 2;
  117. kCollectionUser3Bit = 3;
  118. kCollectionUser4Bit = 4;
  119. kCollectionUser5Bit = 5;
  120. kCollectionUser6Bit = 6;
  121. kCollectionUser7Bit = 7;
  122. kCollectionUser8Bit = 8;
  123. kCollectionUser9Bit = 9;
  124. kCollectionUser10Bit = 10;
  125. kCollectionUser11Bit = 11;
  126. kCollectionUser12Bit = 12;
  127. kCollectionUser13Bit = 13;
  128. kCollectionUser14Bit = 14;
  129. kCollectionUser15Bit = 15;
  130. kCollectionReserved0Bit = 16;
  131. kCollectionReserved1Bit = 17;
  132. kCollectionReserved2Bit = 18;
  133. kCollectionReserved3Bit = 19;
  134. kCollectionReserved4Bit = 20;
  135. kCollectionReserved5Bit = 21;
  136. kCollectionReserved6Bit = 22;
  137. kCollectionReserved7Bit = 23;
  138. kCollectionReserved8Bit = 24;
  139. kCollectionReserved9Bit = 25;
  140. kCollectionReserved10Bit = 26;
  141. kCollectionReserved11Bit = 27;
  142. kCollectionReserved12Bit = 28;
  143. kCollectionReserved13Bit = 29;
  144. kCollectionPersistenceBit = 30;
  145. kCollectionLockBit = 31;
  146. { attribute masks }
  147. kCollectionUser0Mask = $00000001;
  148. kCollectionUser1Mask = $00000002;
  149. kCollectionUser2Mask = $00000004;
  150. kCollectionUser3Mask = $00000008;
  151. kCollectionUser4Mask = $00000010;
  152. kCollectionUser5Mask = $00000020;
  153. kCollectionUser6Mask = $00000040;
  154. kCollectionUser7Mask = $00000080;
  155. kCollectionUser8Mask = $00000100;
  156. kCollectionUser9Mask = $00000200;
  157. kCollectionUser10Mask = $00000400;
  158. kCollectionUser11Mask = $00000800;
  159. kCollectionUser12Mask = $00001000;
  160. kCollectionUser13Mask = $00002000;
  161. kCollectionUser14Mask = $00004000;
  162. kCollectionUser15Mask = $00008000;
  163. kCollectionReserved0Mask = $00010000;
  164. kCollectionReserved1Mask = $00020000;
  165. kCollectionReserved2Mask = $00040000;
  166. kCollectionReserved3Mask = $00080000;
  167. kCollectionReserved4Mask = $00100000;
  168. kCollectionReserved5Mask = $00200000;
  169. kCollectionReserved6Mask = $00400000;
  170. kCollectionReserved7Mask = $00800000;
  171. kCollectionReserved8Mask = $01000000;
  172. kCollectionReserved9Mask = $02000000;
  173. kCollectionReserved10Mask = $04000000;
  174. kCollectionReserved11Mask = $08000000;
  175. kCollectionReserved12Mask = $10000000;
  176. kCollectionReserved13Mask = $20000000;
  177. kCollectionPersistenceMask = $40000000;
  178. kCollectionLockMask = $80000000;
  179. { ********* }
  180. { Types }
  181. { ********* }
  182. { abstract data type for a collection }
  183. type
  184. Collection = ^SInt32; { an opaque 32-bit type }
  185. CollectionPtr = ^Collection; { when a var xx:Collection parameter can be nil, it is changed to xx: CollectionPtr }
  186. { collection member 4 byte tag }
  187. CollectionTag = FourCharCode;
  188. {$ifc TYPED_FUNCTION_POINTERS}
  189. CollectionFlattenProcPtr = function(size: SInt32; data: UnivPtr; refCon: UnivPtr): OSErr;
  190. {$elsec}
  191. CollectionFlattenProcPtr = ProcPtr;
  192. {$endc}
  193. {$ifc TYPED_FUNCTION_POINTERS}
  194. CollectionExceptionProcPtr = function(c: Collection; status: OSErr): OSErr;
  195. {$elsec}
  196. CollectionExceptionProcPtr = ProcPtr;
  197. {$endc}
  198. {$ifc OPAQUE_UPP_TYPES}
  199. CollectionFlattenUPP = ^SInt32; { an opaque UPP }
  200. {$elsec}
  201. CollectionFlattenUPP = UniversalProcPtr;
  202. {$endc}
  203. {$ifc OPAQUE_UPP_TYPES}
  204. CollectionExceptionUPP = ^SInt32; { an opaque UPP }
  205. {$elsec}
  206. CollectionExceptionUPP = UniversalProcPtr;
  207. {$endc}
  208. const
  209. uppCollectionFlattenProcInfo = $00000FE0;
  210. uppCollectionExceptionProcInfo = $000002E0;
  211. {
  212. * NewCollectionFlattenUPP()
  213. *
  214. * Availability:
  215. * Non-Carbon CFM: available as macro/inline
  216. * CarbonLib: in CarbonLib 1.0 and later
  217. * Mac OS X: in version 10.0 and later
  218. }
  219. function NewCollectionFlattenUPP(userRoutine: CollectionFlattenProcPtr): CollectionFlattenUPP; external name '_NewCollectionFlattenUPP'; { old name was NewCollectionFlattenProc }
  220. {
  221. * NewCollectionExceptionUPP()
  222. *
  223. * Availability:
  224. * Non-Carbon CFM: available as macro/inline
  225. * CarbonLib: in CarbonLib 1.0 and later
  226. * Mac OS X: in version 10.0 and later
  227. }
  228. function NewCollectionExceptionUPP(userRoutine: CollectionExceptionProcPtr): CollectionExceptionUPP; external name '_NewCollectionExceptionUPP'; { old name was NewCollectionExceptionProc }
  229. {
  230. * DisposeCollectionFlattenUPP()
  231. *
  232. * Availability:
  233. * Non-Carbon CFM: available as macro/inline
  234. * CarbonLib: in CarbonLib 1.0 and later
  235. * Mac OS X: in version 10.0 and later
  236. }
  237. procedure DisposeCollectionFlattenUPP(userUPP: CollectionFlattenUPP); external name '_DisposeCollectionFlattenUPP';
  238. {
  239. * DisposeCollectionExceptionUPP()
  240. *
  241. * Availability:
  242. * Non-Carbon CFM: available as macro/inline
  243. * CarbonLib: in CarbonLib 1.0 and later
  244. * Mac OS X: in version 10.0 and later
  245. }
  246. procedure DisposeCollectionExceptionUPP(userUPP: CollectionExceptionUPP); external name '_DisposeCollectionExceptionUPP';
  247. {
  248. * InvokeCollectionFlattenUPP()
  249. *
  250. * Availability:
  251. * Non-Carbon CFM: available as macro/inline
  252. * CarbonLib: in CarbonLib 1.0 and later
  253. * Mac OS X: in version 10.0 and later
  254. }
  255. function InvokeCollectionFlattenUPP(size: SInt32; data: UnivPtr; refCon: UnivPtr; userRoutine: CollectionFlattenUPP): OSErr; external name '_InvokeCollectionFlattenUPP'; { old name was CallCollectionFlattenProc }
  256. {
  257. * InvokeCollectionExceptionUPP()
  258. *
  259. * Availability:
  260. * Non-Carbon CFM: available as macro/inline
  261. * CarbonLib: in CarbonLib 1.0 and later
  262. * Mac OS X: in version 10.0 and later
  263. }
  264. function InvokeCollectionExceptionUPP(c: Collection; status: OSErr; userRoutine: CollectionExceptionUPP): OSErr; external name '_InvokeCollectionExceptionUPP'; { old name was CallCollectionExceptionProc }
  265. {*******************************************}
  266. {************ Public interfaces ************}
  267. {*******************************************}
  268. {
  269. * NewCollection()
  270. *
  271. * Availability:
  272. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  273. * CarbonLib: in CarbonLib 1.0 and later
  274. * Mac OS X: in version 10.0 and later
  275. }
  276. function NewCollection: Collection; external name '_NewCollection';
  277. {
  278. * DisposeCollection()
  279. *
  280. * Availability:
  281. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  282. * CarbonLib: in CarbonLib 1.0 and later
  283. * Mac OS X: in version 10.0 and later
  284. }
  285. procedure DisposeCollection(c: Collection); external name '_DisposeCollection';
  286. {
  287. * CloneCollection()
  288. *
  289. * Availability:
  290. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  291. * CarbonLib: in CarbonLib 1.0 and later
  292. * Mac OS X: in version 10.0 and later
  293. }
  294. function CloneCollection(c: Collection): Collection; external name '_CloneCollection';
  295. {
  296. * CountCollectionOwners()
  297. *
  298. * Availability:
  299. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  300. * CarbonLib: in CarbonLib 1.0 and later
  301. * Mac OS X: in version 10.0 and later
  302. }
  303. function CountCollectionOwners(c: Collection): SInt32; external name '_CountCollectionOwners';
  304. {
  305. * RetainCollection()
  306. *
  307. * Availability:
  308. * Non-Carbon CFM: not available
  309. * CarbonLib: in CarbonLib 1.1 and later
  310. * Mac OS X: in version 10.0 and later
  311. }
  312. function RetainCollection(c: Collection): OSStatus; external name '_RetainCollection';
  313. {
  314. * ReleaseCollection()
  315. *
  316. * Availability:
  317. * Non-Carbon CFM: not available
  318. * CarbonLib: in CarbonLib 1.1 and later
  319. * Mac OS X: in version 10.0 and later
  320. }
  321. function ReleaseCollection(c: Collection): OSStatus; external name '_ReleaseCollection';
  322. {
  323. * GetCollectionRetainCount()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: not available
  327. * CarbonLib: in CarbonLib 1.1 and later
  328. * Mac OS X: in version 10.0 and later
  329. }
  330. function GetCollectionRetainCount(c: Collection): ItemCount; external name '_GetCollectionRetainCount';
  331. {
  332. * CopyCollection()
  333. *
  334. * Availability:
  335. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  336. * CarbonLib: in CarbonLib 1.0 and later
  337. * Mac OS X: in version 10.0 and later
  338. }
  339. function CopyCollection(srcCollection: Collection; dstCollection: Collection): Collection; external name '_CopyCollection';
  340. {
  341. * GetCollectionDefaultAttributes()
  342. *
  343. * Availability:
  344. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  345. * CarbonLib: in CarbonLib 1.0 and later
  346. * Mac OS X: in version 10.0 and later
  347. }
  348. function GetCollectionDefaultAttributes(c: Collection): SInt32; external name '_GetCollectionDefaultAttributes';
  349. {
  350. * SetCollectionDefaultAttributes()
  351. *
  352. * Availability:
  353. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  354. * CarbonLib: in CarbonLib 1.0 and later
  355. * Mac OS X: in version 10.0 and later
  356. }
  357. procedure SetCollectionDefaultAttributes(c: Collection; whichAttributes: SInt32; newAttributes: SInt32); external name '_SetCollectionDefaultAttributes';
  358. {
  359. * CountCollectionItems()
  360. *
  361. * Availability:
  362. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  363. * CarbonLib: in CarbonLib 1.0 and later
  364. * Mac OS X: in version 10.0 and later
  365. }
  366. function CountCollectionItems(c: Collection): SInt32; external name '_CountCollectionItems';
  367. {
  368. * AddCollectionItem()
  369. *
  370. * Availability:
  371. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  372. * CarbonLib: in CarbonLib 1.0 and later
  373. * Mac OS X: in version 10.0 and later
  374. }
  375. function AddCollectionItem(c: Collection; tag: CollectionTag; id: SInt32; itemSize: SInt32; itemData: UnivPtr): OSErr; external name '_AddCollectionItem';
  376. {
  377. * GetCollectionItem()
  378. *
  379. * Availability:
  380. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  381. * CarbonLib: in CarbonLib 1.0 and later
  382. * Mac OS X: in version 10.0 and later
  383. }
  384. function GetCollectionItem(c: Collection; tag: CollectionTag; id: SInt32; var itemSize: SInt32; itemData: UnivPtr): OSErr; external name '_GetCollectionItem';
  385. {
  386. * RemoveCollectionItem()
  387. *
  388. * Availability:
  389. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  390. * CarbonLib: in CarbonLib 1.0 and later
  391. * Mac OS X: in version 10.0 and later
  392. }
  393. function RemoveCollectionItem(c: Collection; tag: CollectionTag; id: SInt32): OSErr; external name '_RemoveCollectionItem';
  394. {
  395. * SetCollectionItemInfo()
  396. *
  397. * Availability:
  398. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  399. * CarbonLib: in CarbonLib 1.0 and later
  400. * Mac OS X: in version 10.0 and later
  401. }
  402. function SetCollectionItemInfo(c: Collection; tag: CollectionTag; id: SInt32; whichAttributes: SInt32; newAttributes: SInt32): OSErr; external name '_SetCollectionItemInfo';
  403. {
  404. * GetCollectionItemInfo()
  405. *
  406. * Availability:
  407. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  408. * CarbonLib: in CarbonLib 1.0 and later
  409. * Mac OS X: in version 10.0 and later
  410. }
  411. function GetCollectionItemInfo(c: Collection; tag: CollectionTag; id: SInt32; var index: SInt32; var itemSize: SInt32; var attributes: SInt32): OSErr; external name '_GetCollectionItemInfo';
  412. {
  413. * ReplaceIndexedCollectionItem()
  414. *
  415. * Availability:
  416. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  417. * CarbonLib: in CarbonLib 1.0 and later
  418. * Mac OS X: in version 10.0 and later
  419. }
  420. function ReplaceIndexedCollectionItem(c: Collection; index: SInt32; itemSize: SInt32; itemData: UnivPtr): OSErr; external name '_ReplaceIndexedCollectionItem';
  421. {
  422. * GetIndexedCollectionItem()
  423. *
  424. * Availability:
  425. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  426. * CarbonLib: in CarbonLib 1.0 and later
  427. * Mac OS X: in version 10.0 and later
  428. }
  429. function GetIndexedCollectionItem(c: Collection; index: SInt32; var itemSize: SInt32; itemData: UnivPtr): OSErr; external name '_GetIndexedCollectionItem';
  430. {
  431. * RemoveIndexedCollectionItem()
  432. *
  433. * Availability:
  434. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  435. * CarbonLib: in CarbonLib 1.0 and later
  436. * Mac OS X: in version 10.0 and later
  437. }
  438. function RemoveIndexedCollectionItem(c: Collection; index: SInt32): OSErr; external name '_RemoveIndexedCollectionItem';
  439. {
  440. * SetIndexedCollectionItemInfo()
  441. *
  442. * Availability:
  443. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  444. * CarbonLib: in CarbonLib 1.0 and later
  445. * Mac OS X: in version 10.0 and later
  446. }
  447. function SetIndexedCollectionItemInfo(c: Collection; index: SInt32; whichAttributes: SInt32; newAttributes: SInt32): OSErr; external name '_SetIndexedCollectionItemInfo';
  448. {
  449. * GetIndexedCollectionItemInfo()
  450. *
  451. * Availability:
  452. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  453. * CarbonLib: in CarbonLib 1.0 and later
  454. * Mac OS X: in version 10.0 and later
  455. }
  456. function GetIndexedCollectionItemInfo(c: Collection; index: SInt32; var tag: CollectionTag; var id: SInt32; var itemSize: SInt32; var attributes: SInt32): OSErr; external name '_GetIndexedCollectionItemInfo';
  457. {
  458. * CollectionTagExists()
  459. *
  460. * Availability:
  461. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Mac OS X: in version 10.0 and later
  464. }
  465. function CollectionTagExists(c: Collection; tag: CollectionTag): boolean; external name '_CollectionTagExists';
  466. {
  467. * CountCollectionTags()
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Mac OS X: in version 10.0 and later
  473. }
  474. function CountCollectionTags(c: Collection): SInt32; external name '_CountCollectionTags';
  475. {
  476. * GetIndexedCollectionTag()
  477. *
  478. * Availability:
  479. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  480. * CarbonLib: in CarbonLib 1.0 and later
  481. * Mac OS X: in version 10.0 and later
  482. }
  483. function GetIndexedCollectionTag(c: Collection; tagIndex: SInt32; var tag: CollectionTag): OSErr; external name '_GetIndexedCollectionTag';
  484. {
  485. * CountTaggedCollectionItems()
  486. *
  487. * Availability:
  488. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Mac OS X: in version 10.0 and later
  491. }
  492. function CountTaggedCollectionItems(c: Collection; tag: CollectionTag): SInt32; external name '_CountTaggedCollectionItems';
  493. {
  494. * GetTaggedCollectionItem()
  495. *
  496. * Availability:
  497. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  498. * CarbonLib: in CarbonLib 1.0 and later
  499. * Mac OS X: in version 10.0 and later
  500. }
  501. function GetTaggedCollectionItem(c: Collection; tag: CollectionTag; whichItem: SInt32; var itemSize: SInt32; itemData: UnivPtr): OSErr; external name '_GetTaggedCollectionItem';
  502. {
  503. * GetTaggedCollectionItemInfo()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Mac OS X: in version 10.0 and later
  509. }
  510. function GetTaggedCollectionItemInfo(c: Collection; tag: CollectionTag; whichItem: SInt32; var id: SInt32; var index: SInt32; var itemSize: SInt32; var attributes: SInt32): OSErr; external name '_GetTaggedCollectionItemInfo';
  511. {
  512. * PurgeCollection()
  513. *
  514. * Availability:
  515. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  516. * CarbonLib: in CarbonLib 1.0 and later
  517. * Mac OS X: in version 10.0 and later
  518. }
  519. procedure PurgeCollection(c: Collection; whichAttributes: SInt32; matchingAttributes: SInt32); external name '_PurgeCollection';
  520. {
  521. * PurgeCollectionTag()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. }
  528. procedure PurgeCollectionTag(c: Collection; tag: CollectionTag); external name '_PurgeCollectionTag';
  529. {
  530. * EmptyCollection()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. }
  537. procedure EmptyCollection(c: Collection); external name '_EmptyCollection';
  538. {
  539. * FlattenCollection()
  540. *
  541. * Availability:
  542. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Mac OS X: in version 10.0 and later
  545. }
  546. function FlattenCollection(c: Collection; flattenProc: CollectionFlattenUPP; refCon: UnivPtr): OSErr; external name '_FlattenCollection';
  547. {
  548. * FlattenPartialCollection()
  549. *
  550. * Availability:
  551. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  552. * CarbonLib: in CarbonLib 1.0 and later
  553. * Mac OS X: in version 10.0 and later
  554. }
  555. function FlattenPartialCollection(c: Collection; flattenProc: CollectionFlattenUPP; refCon: UnivPtr; whichAttributes: SInt32; matchingAttributes: SInt32): OSErr; external name '_FlattenPartialCollection';
  556. {
  557. * UnflattenCollection()
  558. *
  559. * Availability:
  560. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  561. * CarbonLib: in CarbonLib 1.0 and later
  562. * Mac OS X: in version 10.0 and later
  563. }
  564. function UnflattenCollection(c: Collection; flattenProc: CollectionFlattenUPP; refCon: UnivPtr): OSErr; external name '_UnflattenCollection';
  565. {
  566. * GetCollectionExceptionProc()
  567. *
  568. * Availability:
  569. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  570. * CarbonLib: in CarbonLib 1.0 and later
  571. * Mac OS X: in version 10.0 and later
  572. }
  573. function GetCollectionExceptionProc(c: Collection): CollectionExceptionUPP; external name '_GetCollectionExceptionProc';
  574. {
  575. * SetCollectionExceptionProc()
  576. *
  577. * Availability:
  578. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Mac OS X: in version 10.0 and later
  581. }
  582. procedure SetCollectionExceptionProc(c: Collection; exceptionProc: CollectionExceptionUPP); external name '_SetCollectionExceptionProc';
  583. {
  584. * GetNewCollection()
  585. *
  586. * Availability:
  587. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  588. * CarbonLib: in CarbonLib 1.0 and later
  589. * Mac OS X: in version 10.0 and later
  590. }
  591. function GetNewCollection(collectionID: SInt16): Collection; external name '_GetNewCollection';
  592. {********************************************************************}
  593. {************* Utility routines for handle-based access *************}
  594. {********************************************************************}
  595. {
  596. * AddCollectionItemHdl()
  597. *
  598. * Availability:
  599. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  600. * CarbonLib: in CarbonLib 1.0 and later
  601. * Mac OS X: in version 10.0 and later
  602. }
  603. function AddCollectionItemHdl(aCollection: Collection; tag: CollectionTag; id: SInt32; itemData: Handle): OSErr; external name '_AddCollectionItemHdl';
  604. {
  605. * GetCollectionItemHdl()
  606. *
  607. * Availability:
  608. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  609. * CarbonLib: in CarbonLib 1.0 and later
  610. * Mac OS X: in version 10.0 and later
  611. }
  612. function GetCollectionItemHdl(aCollection: Collection; tag: CollectionTag; id: SInt32; itemData: Handle): OSErr; external name '_GetCollectionItemHdl';
  613. {
  614. * ReplaceIndexedCollectionItemHdl()
  615. *
  616. * Availability:
  617. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  618. * CarbonLib: in CarbonLib 1.0 and later
  619. * Mac OS X: in version 10.0 and later
  620. }
  621. function ReplaceIndexedCollectionItemHdl(aCollection: Collection; index: SInt32; itemData: Handle): OSErr; external name '_ReplaceIndexedCollectionItemHdl';
  622. {
  623. * GetIndexedCollectionItemHdl()
  624. *
  625. * Availability:
  626. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  627. * CarbonLib: in CarbonLib 1.0 and later
  628. * Mac OS X: in version 10.0 and later
  629. }
  630. function GetIndexedCollectionItemHdl(aCollection: Collection; index: SInt32; itemData: Handle): OSErr; external name '_GetIndexedCollectionItemHdl';
  631. {
  632. * FlattenCollectionToHdl()
  633. *
  634. * Availability:
  635. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  636. * CarbonLib: in CarbonLib 1.0 and later
  637. * Mac OS X: in version 10.0 and later
  638. }
  639. function FlattenCollectionToHdl(aCollection: Collection; flattened: Handle): OSErr; external name '_FlattenCollectionToHdl';
  640. {
  641. * UnflattenCollectionFromHdl()
  642. *
  643. * Availability:
  644. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  645. * CarbonLib: in CarbonLib 1.0 and later
  646. * Mac OS X: in version 10.0 and later
  647. }
  648. function UnflattenCollectionFromHdl(aCollection: Collection; flattened: Handle): OSErr; external name '_UnflattenCollectionFromHdl';
  649. {$ifc OLDROUTINENAMES}
  650. const
  651. dontWantTag = 0;
  652. dontWantId = 0;
  653. dontWantSize = 0;
  654. dontWantAttributes = 0;
  655. dontWantIndex = 0;
  656. dontWantData = 0;
  657. noCollectionAttributes = $00000000;
  658. allCollectionAttributes = $FFFFFFFF;
  659. userCollectionAttributes = $0000FFFF;
  660. defaultCollectionAttributes = $40000000;
  661. collectionUser0Bit = 0;
  662. collectionUser1Bit = 1;
  663. collectionUser2Bit = 2;
  664. collectionUser3Bit = 3;
  665. collectionUser4Bit = 4;
  666. collectionUser5Bit = 5;
  667. collectionUser6Bit = 6;
  668. collectionUser7Bit = 7;
  669. collectionUser8Bit = 8;
  670. collectionUser9Bit = 9;
  671. collectionUser10Bit = 10;
  672. collectionUser11Bit = 11;
  673. collectionUser12Bit = 12;
  674. collectionUser13Bit = 13;
  675. collectionUser14Bit = 14;
  676. collectionUser15Bit = 15;
  677. collectionReserved0Bit = 16;
  678. collectionReserved1Bit = 17;
  679. collectionReserved2Bit = 18;
  680. collectionReserved3Bit = 19;
  681. collectionReserved4Bit = 20;
  682. collectionReserved5Bit = 21;
  683. collectionReserved6Bit = 22;
  684. collectionReserved7Bit = 23;
  685. collectionReserved8Bit = 24;
  686. collectionReserved9Bit = 25;
  687. collectionReserved10Bit = 26;
  688. collectionReserved11Bit = 27;
  689. collectionReserved12Bit = 28;
  690. collectionReserved13Bit = 29;
  691. collectionPersistenceBit = 30;
  692. collectionLockBit = 31;
  693. collectionUser0Mask = $00000001;
  694. collectionUser1Mask = $00000002;
  695. collectionUser2Mask = $00000004;
  696. collectionUser3Mask = $00000008;
  697. collectionUser4Mask = $00000010;
  698. collectionUser5Mask = $00000020;
  699. collectionUser6Mask = $00000040;
  700. collectionUser7Mask = $00000080;
  701. collectionUser8Mask = $00000100;
  702. collectionUser9Mask = $00000200;
  703. collectionUser10Mask = $00000400;
  704. collectionUser11Mask = $00000800;
  705. collectionUser12Mask = $00001000;
  706. collectionUser13Mask = $00002000;
  707. collectionUser14Mask = $00004000;
  708. collectionUser15Mask = $00008000;
  709. collectionReserved0Mask = $00010000;
  710. collectionReserved1Mask = $00020000;
  711. collectionReserved2Mask = $00040000;
  712. collectionReserved3Mask = $00080000;
  713. collectionReserved4Mask = $00100000;
  714. collectionReserved5Mask = $00200000;
  715. collectionReserved6Mask = $00400000;
  716. collectionReserved7Mask = $00800000;
  717. collectionReserved8Mask = $01000000;
  718. collectionReserved9Mask = $02000000;
  719. collectionReserved10Mask = $04000000;
  720. collectionReserved11Mask = $08000000;
  721. collectionReserved12Mask = $10000000;
  722. collectionReserved13Mask = $20000000;
  723. collectionPersistenceMask = $40000000;
  724. collectionLockMask = $80000000;
  725. {$endc} {OLDROUTINENAMES}
  726. {$ALIGN MAC68K}
  727. end.