Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1036 lines
31 KiB

  1. /*
  2. File: Collections.h
  3. Contains: Collection Manager Interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1989-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __COLLECTIONS__
  11. #define __COLLECTIONS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. /*************/
  28. /* Constants */
  29. /*************/
  30. /* Convenience constants for functions which optionally return values */
  31. enum {
  32. kCollectionDontWantTag = 0L,
  33. kCollectionDontWantId = 0L,
  34. kCollectionDontWantSize = 0L,
  35. kCollectionDontWantAttributes = 0L,
  36. kCollectionDontWantIndex = 0L,
  37. kCollectionDontWantData = 0L
  38. };
  39. /* attributes bits */
  40. enum {
  41. kCollectionNoAttributes = 0x00000000, /* no attributes bits set */
  42. kCollectionAllAttributes = (long)0xFFFFFFFF, /* all attributes bits set */
  43. kCollectionUserAttributes = 0x0000FFFF, /* user attributes bits */
  44. kCollectionDefaultAttributes = 0x40000000 /* default attributes - unlocked, persistent */
  45. };
  46. /*
  47. Attribute bits 0 through 15 (entire low word) are reserved for use by the application.
  48. Attribute bits 16 through 31 (entire high word) are reserved for use by the Collection Manager.
  49. Only bits 31 (kCollectionLockBit) and 30 (kCollectionPersistenceBit) currently have meaning.
  50. */
  51. enum {
  52. kCollectionUser0Bit = 0,
  53. kCollectionUser1Bit = 1,
  54. kCollectionUser2Bit = 2,
  55. kCollectionUser3Bit = 3,
  56. kCollectionUser4Bit = 4,
  57. kCollectionUser5Bit = 5,
  58. kCollectionUser6Bit = 6,
  59. kCollectionUser7Bit = 7,
  60. kCollectionUser8Bit = 8,
  61. kCollectionUser9Bit = 9,
  62. kCollectionUser10Bit = 10,
  63. kCollectionUser11Bit = 11,
  64. kCollectionUser12Bit = 12,
  65. kCollectionUser13Bit = 13,
  66. kCollectionUser14Bit = 14,
  67. kCollectionUser15Bit = 15,
  68. kCollectionReserved0Bit = 16,
  69. kCollectionReserved1Bit = 17,
  70. kCollectionReserved2Bit = 18,
  71. kCollectionReserved3Bit = 19,
  72. kCollectionReserved4Bit = 20,
  73. kCollectionReserved5Bit = 21,
  74. kCollectionReserved6Bit = 22,
  75. kCollectionReserved7Bit = 23,
  76. kCollectionReserved8Bit = 24,
  77. kCollectionReserved9Bit = 25,
  78. kCollectionReserved10Bit = 26,
  79. kCollectionReserved11Bit = 27,
  80. kCollectionReserved12Bit = 28,
  81. kCollectionReserved13Bit = 29,
  82. kCollectionPersistenceBit = 30,
  83. kCollectionLockBit = 31
  84. };
  85. /* attribute masks */
  86. enum {
  87. kCollectionUser0Mask = 1L << kCollectionUser0Bit,
  88. kCollectionUser1Mask = 1L << kCollectionUser1Bit,
  89. kCollectionUser2Mask = 1L << kCollectionUser2Bit,
  90. kCollectionUser3Mask = 1L << kCollectionUser3Bit,
  91. kCollectionUser4Mask = 1L << kCollectionUser4Bit,
  92. kCollectionUser5Mask = 1L << kCollectionUser5Bit,
  93. kCollectionUser6Mask = 1L << kCollectionUser6Bit,
  94. kCollectionUser7Mask = 1L << kCollectionUser7Bit,
  95. kCollectionUser8Mask = 1L << kCollectionUser8Bit,
  96. kCollectionUser9Mask = 1L << kCollectionUser9Bit,
  97. kCollectionUser10Mask = 1L << kCollectionUser10Bit,
  98. kCollectionUser11Mask = 1L << kCollectionUser11Bit,
  99. kCollectionUser12Mask = 1L << kCollectionUser12Bit,
  100. kCollectionUser13Mask = 1L << kCollectionUser13Bit,
  101. kCollectionUser14Mask = 1L << kCollectionUser14Bit,
  102. kCollectionUser15Mask = 1L << kCollectionUser15Bit,
  103. kCollectionReserved0Mask = 1L << kCollectionReserved0Bit,
  104. kCollectionReserved1Mask = 1L << kCollectionReserved1Bit,
  105. kCollectionReserved2Mask = 1L << kCollectionReserved2Bit,
  106. kCollectionReserved3Mask = 1L << kCollectionReserved3Bit,
  107. kCollectionReserved4Mask = 1L << kCollectionReserved4Bit,
  108. kCollectionReserved5Mask = 1L << kCollectionReserved5Bit,
  109. kCollectionReserved6Mask = 1L << kCollectionReserved6Bit,
  110. kCollectionReserved7Mask = 1L << kCollectionReserved7Bit,
  111. kCollectionReserved8Mask = 1L << kCollectionReserved8Bit,
  112. kCollectionReserved9Mask = 1L << kCollectionReserved9Bit,
  113. kCollectionReserved10Mask = 1L << kCollectionReserved10Bit,
  114. kCollectionReserved11Mask = 1L << kCollectionReserved11Bit,
  115. kCollectionReserved12Mask = 1L << kCollectionReserved12Bit,
  116. kCollectionReserved13Mask = 1L << kCollectionReserved13Bit,
  117. kCollectionPersistenceMask = 1L << kCollectionPersistenceBit,
  118. kCollectionLockMask = 1L << kCollectionLockBit
  119. };
  120. /***********/
  121. /* Types */
  122. /***********/
  123. /* abstract data type for a collection */
  124. typedef struct OpaqueCollection* Collection;
  125. /* collection member 4 byte tag */
  126. typedef FourCharCode CollectionTag;
  127. typedef CALLBACK_API( OSErr , CollectionFlattenProcPtr )(SInt32 size, void *data, void *refCon);
  128. typedef CALLBACK_API( OSErr , CollectionExceptionProcPtr )(Collection c, OSErr status);
  129. typedef STACK_UPP_TYPE(CollectionFlattenProcPtr) CollectionFlattenUPP;
  130. typedef STACK_UPP_TYPE(CollectionExceptionProcPtr) CollectionExceptionUPP;
  131. /*
  132. * NewCollectionFlattenUPP()
  133. *
  134. * Availability:
  135. * Non-Carbon CFM: available as macro/inline
  136. * CarbonLib: in CarbonLib 1.0 and later
  137. * Mac OS X: in version 10.0 and later
  138. */
  139. EXTERN_API_C( CollectionFlattenUPP )
  140. NewCollectionFlattenUPP(CollectionFlattenProcPtr userRoutine);
  141. #if !OPAQUE_UPP_TYPES
  142. enum { uppCollectionFlattenProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  143. #ifdef __cplusplus
  144. inline DEFINE_API_C(CollectionFlattenUPP) NewCollectionFlattenUPP(CollectionFlattenProcPtr userRoutine) { return (CollectionFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionFlattenProcInfo, GetCurrentArchitecture()); }
  145. #else
  146. #define NewCollectionFlattenUPP(userRoutine) (CollectionFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionFlattenProcInfo, GetCurrentArchitecture())
  147. #endif
  148. #endif
  149. /*
  150. * NewCollectionExceptionUPP()
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: available as macro/inline
  154. * CarbonLib: in CarbonLib 1.0 and later
  155. * Mac OS X: in version 10.0 and later
  156. */
  157. EXTERN_API_C( CollectionExceptionUPP )
  158. NewCollectionExceptionUPP(CollectionExceptionProcPtr userRoutine);
  159. #if !OPAQUE_UPP_TYPES
  160. enum { uppCollectionExceptionProcInfo = 0x000002E0 }; /* pascal 2_bytes Func(4_bytes, 2_bytes) */
  161. #ifdef __cplusplus
  162. inline DEFINE_API_C(CollectionExceptionUPP) NewCollectionExceptionUPP(CollectionExceptionProcPtr userRoutine) { return (CollectionExceptionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionExceptionProcInfo, GetCurrentArchitecture()); }
  163. #else
  164. #define NewCollectionExceptionUPP(userRoutine) (CollectionExceptionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionExceptionProcInfo, GetCurrentArchitecture())
  165. #endif
  166. #endif
  167. /*
  168. * DisposeCollectionFlattenUPP()
  169. *
  170. * Availability:
  171. * Non-Carbon CFM: available as macro/inline
  172. * CarbonLib: in CarbonLib 1.0 and later
  173. * Mac OS X: in version 10.0 and later
  174. */
  175. EXTERN_API_C( void )
  176. DisposeCollectionFlattenUPP(CollectionFlattenUPP userUPP);
  177. #if !OPAQUE_UPP_TYPES
  178. #ifdef __cplusplus
  179. inline DEFINE_API_C(void) DisposeCollectionFlattenUPP(CollectionFlattenUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  180. #else
  181. #define DisposeCollectionFlattenUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  182. #endif
  183. #endif
  184. /*
  185. * DisposeCollectionExceptionUPP()
  186. *
  187. * Availability:
  188. * Non-Carbon CFM: available as macro/inline
  189. * CarbonLib: in CarbonLib 1.0 and later
  190. * Mac OS X: in version 10.0 and later
  191. */
  192. EXTERN_API_C( void )
  193. DisposeCollectionExceptionUPP(CollectionExceptionUPP userUPP);
  194. #if !OPAQUE_UPP_TYPES
  195. #ifdef __cplusplus
  196. inline DEFINE_API_C(void) DisposeCollectionExceptionUPP(CollectionExceptionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  197. #else
  198. #define DisposeCollectionExceptionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  199. #endif
  200. #endif
  201. /*
  202. * InvokeCollectionFlattenUPP()
  203. *
  204. * Availability:
  205. * Non-Carbon CFM: available as macro/inline
  206. * CarbonLib: in CarbonLib 1.0 and later
  207. * Mac OS X: in version 10.0 and later
  208. */
  209. EXTERN_API_C( OSErr )
  210. InvokeCollectionFlattenUPP(
  211. SInt32 size,
  212. void * data,
  213. void * refCon,
  214. CollectionFlattenUPP userUPP);
  215. #if !OPAQUE_UPP_TYPES
  216. #ifdef __cplusplus
  217. inline DEFINE_API_C(OSErr) InvokeCollectionFlattenUPP(SInt32 size, void * data, void * refCon, CollectionFlattenUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppCollectionFlattenProcInfo, size, data, refCon); }
  218. #else
  219. #define InvokeCollectionFlattenUPP(size, data, refCon, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppCollectionFlattenProcInfo, (size), (data), (refCon))
  220. #endif
  221. #endif
  222. /*
  223. * InvokeCollectionExceptionUPP()
  224. *
  225. * Availability:
  226. * Non-Carbon CFM: available as macro/inline
  227. * CarbonLib: in CarbonLib 1.0 and later
  228. * Mac OS X: in version 10.0 and later
  229. */
  230. EXTERN_API_C( OSErr )
  231. InvokeCollectionExceptionUPP(
  232. Collection c,
  233. OSErr status,
  234. CollectionExceptionUPP userUPP);
  235. #if !OPAQUE_UPP_TYPES
  236. #ifdef __cplusplus
  237. inline DEFINE_API_C(OSErr) InvokeCollectionExceptionUPP(Collection c, OSErr status, CollectionExceptionUPP userUPP) { return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppCollectionExceptionProcInfo, c, status); }
  238. #else
  239. #define InvokeCollectionExceptionUPP(c, status, userUPP) (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCollectionExceptionProcInfo, (c), (status))
  240. #endif
  241. #endif
  242. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  243. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  244. #define NewCollectionFlattenProc(userRoutine) NewCollectionFlattenUPP(userRoutine)
  245. #define NewCollectionExceptionProc(userRoutine) NewCollectionExceptionUPP(userRoutine)
  246. #define CallCollectionFlattenProc(userRoutine, size, data, refCon) InvokeCollectionFlattenUPP(size, data, refCon, userRoutine)
  247. #define CallCollectionExceptionProc(userRoutine, c, status) InvokeCollectionExceptionUPP(c, status, userRoutine)
  248. #endif /* CALL_NOT_IN_CARBON */
  249. /*********************************************/
  250. /************* Public interfaces *************/
  251. /*********************************************/
  252. /*
  253. * NewCollection()
  254. *
  255. * Availability:
  256. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  257. * CarbonLib: in CarbonLib 1.0 and later
  258. * Mac OS X: in version 10.0 and later
  259. */
  260. EXTERN_API( Collection )
  261. NewCollection(void) TWOWORDINLINE(0x7000, 0xABF6);
  262. /*
  263. * DisposeCollection()
  264. *
  265. * Availability:
  266. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  267. * CarbonLib: in CarbonLib 1.0 and later
  268. * Mac OS X: in version 10.0 and later
  269. */
  270. EXTERN_API( void )
  271. DisposeCollection(Collection c) TWOWORDINLINE(0x7001, 0xABF6);
  272. /*
  273. * CloneCollection()
  274. *
  275. * Availability:
  276. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  277. * CarbonLib: in CarbonLib 1.0 and later
  278. * Mac OS X: in version 10.0 and later
  279. */
  280. EXTERN_API( Collection )
  281. CloneCollection(Collection c) TWOWORDINLINE(0x7002, 0xABF6);
  282. /*
  283. * CountCollectionOwners()
  284. *
  285. * Availability:
  286. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  287. * CarbonLib: in CarbonLib 1.0 and later
  288. * Mac OS X: in version 10.0 and later
  289. */
  290. EXTERN_API( SInt32 )
  291. CountCollectionOwners(Collection c) TWOWORDINLINE(0x7003, 0xABF6);
  292. /*
  293. * RetainCollection()
  294. *
  295. * Availability:
  296. * Non-Carbon CFM: not available
  297. * CarbonLib: in CarbonLib 1.1 and later
  298. * Mac OS X: in version 10.1 and later
  299. */
  300. EXTERN_API( OSStatus )
  301. RetainCollection(Collection c);
  302. /*
  303. * ReleaseCollection()
  304. *
  305. * Availability:
  306. * Non-Carbon CFM: not available
  307. * CarbonLib: in CarbonLib 1.1 and later
  308. * Mac OS X: in version 10.1 and later
  309. */
  310. EXTERN_API( OSStatus )
  311. ReleaseCollection(Collection c);
  312. /*
  313. * GetCollectionRetainCount()
  314. *
  315. * Availability:
  316. * Non-Carbon CFM: not available
  317. * CarbonLib: in CarbonLib 1.1 and later
  318. * Mac OS X: in version 10.1 and later
  319. */
  320. EXTERN_API( ItemCount )
  321. GetCollectionRetainCount(Collection c);
  322. /*
  323. * CopyCollection()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  327. * CarbonLib: in CarbonLib 1.0 and later
  328. * Mac OS X: in version 10.0 and later
  329. */
  330. EXTERN_API( Collection )
  331. CopyCollection(
  332. Collection srcCollection,
  333. Collection dstCollection) TWOWORDINLINE(0x7004, 0xABF6);
  334. /*
  335. * GetCollectionDefaultAttributes()
  336. *
  337. * Availability:
  338. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  339. * CarbonLib: in CarbonLib 1.0 and later
  340. * Mac OS X: in version 10.0 and later
  341. */
  342. EXTERN_API( SInt32 )
  343. GetCollectionDefaultAttributes(Collection c) TWOWORDINLINE(0x7005, 0xABF6);
  344. /*
  345. * SetCollectionDefaultAttributes()
  346. *
  347. * Availability:
  348. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  349. * CarbonLib: in CarbonLib 1.0 and later
  350. * Mac OS X: in version 10.0 and later
  351. */
  352. EXTERN_API( void )
  353. SetCollectionDefaultAttributes(
  354. Collection c,
  355. SInt32 whichAttributes,
  356. SInt32 newAttributes) TWOWORDINLINE(0x7006, 0xABF6);
  357. /*
  358. * CountCollectionItems()
  359. *
  360. * Availability:
  361. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  362. * CarbonLib: in CarbonLib 1.0 and later
  363. * Mac OS X: in version 10.0 and later
  364. */
  365. EXTERN_API( SInt32 )
  366. CountCollectionItems(Collection c) TWOWORDINLINE(0x7007, 0xABF6);
  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. EXTERN_API( OSErr )
  376. AddCollectionItem(
  377. Collection c,
  378. CollectionTag tag,
  379. SInt32 id,
  380. SInt32 itemSize,
  381. const void * itemData) TWOWORDINLINE(0x7008, 0xABF6);
  382. /*
  383. * GetCollectionItem()
  384. *
  385. * Availability:
  386. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  387. * CarbonLib: in CarbonLib 1.0 and later
  388. * Mac OS X: in version 10.0 and later
  389. */
  390. EXTERN_API( OSErr )
  391. GetCollectionItem(
  392. Collection c,
  393. CollectionTag tag,
  394. SInt32 id,
  395. SInt32 * itemSize,
  396. void * itemData) TWOWORDINLINE(0x7009, 0xABF6);
  397. /*
  398. * RemoveCollectionItem()
  399. *
  400. * Availability:
  401. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  402. * CarbonLib: in CarbonLib 1.0 and later
  403. * Mac OS X: in version 10.0 and later
  404. */
  405. EXTERN_API( OSErr )
  406. RemoveCollectionItem(
  407. Collection c,
  408. CollectionTag tag,
  409. SInt32 id) TWOWORDINLINE(0x700A, 0xABF6);
  410. /*
  411. * SetCollectionItemInfo()
  412. *
  413. * Availability:
  414. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  415. * CarbonLib: in CarbonLib 1.0 and later
  416. * Mac OS X: in version 10.0 and later
  417. */
  418. EXTERN_API( OSErr )
  419. SetCollectionItemInfo(
  420. Collection c,
  421. CollectionTag tag,
  422. SInt32 id,
  423. SInt32 whichAttributes,
  424. SInt32 newAttributes) TWOWORDINLINE(0x700B, 0xABF6);
  425. /*
  426. * GetCollectionItemInfo()
  427. *
  428. * Availability:
  429. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  430. * CarbonLib: in CarbonLib 1.0 and later
  431. * Mac OS X: in version 10.0 and later
  432. */
  433. EXTERN_API( OSErr )
  434. GetCollectionItemInfo(
  435. Collection c,
  436. CollectionTag tag,
  437. SInt32 id,
  438. SInt32 * index,
  439. SInt32 * itemSize,
  440. SInt32 * attributes) TWOWORDINLINE(0x700C, 0xABF6);
  441. /*
  442. * ReplaceIndexedCollectionItem()
  443. *
  444. * Availability:
  445. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  446. * CarbonLib: in CarbonLib 1.0 and later
  447. * Mac OS X: in version 10.0 and later
  448. */
  449. EXTERN_API( OSErr )
  450. ReplaceIndexedCollectionItem(
  451. Collection c,
  452. SInt32 index,
  453. SInt32 itemSize,
  454. const void * itemData) TWOWORDINLINE(0x700D, 0xABF6);
  455. /*
  456. * GetIndexedCollectionItem()
  457. *
  458. * Availability:
  459. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  460. * CarbonLib: in CarbonLib 1.0 and later
  461. * Mac OS X: in version 10.0 and later
  462. */
  463. EXTERN_API( OSErr )
  464. GetIndexedCollectionItem(
  465. Collection c,
  466. SInt32 index,
  467. SInt32 * itemSize,
  468. void * itemData) TWOWORDINLINE(0x700E, 0xABF6);
  469. /*
  470. * RemoveIndexedCollectionItem()
  471. *
  472. * Availability:
  473. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  474. * CarbonLib: in CarbonLib 1.0 and later
  475. * Mac OS X: in version 10.0 and later
  476. */
  477. EXTERN_API( OSErr )
  478. RemoveIndexedCollectionItem(
  479. Collection c,
  480. SInt32 index) TWOWORDINLINE(0x700F, 0xABF6);
  481. /*
  482. * SetIndexedCollectionItemInfo()
  483. *
  484. * Availability:
  485. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  486. * CarbonLib: in CarbonLib 1.0 and later
  487. * Mac OS X: in version 10.0 and later
  488. */
  489. EXTERN_API( OSErr )
  490. SetIndexedCollectionItemInfo(
  491. Collection c,
  492. SInt32 index,
  493. SInt32 whichAttributes,
  494. SInt32 newAttributes) TWOWORDINLINE(0x7010, 0xABF6);
  495. /*
  496. * GetIndexedCollectionItemInfo()
  497. *
  498. * Availability:
  499. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  500. * CarbonLib: in CarbonLib 1.0 and later
  501. * Mac OS X: in version 10.0 and later
  502. */
  503. EXTERN_API( OSErr )
  504. GetIndexedCollectionItemInfo(
  505. Collection c,
  506. SInt32 index,
  507. CollectionTag * tag,
  508. SInt32 * id,
  509. SInt32 * itemSize,
  510. SInt32 * attributes) TWOWORDINLINE(0x7011, 0xABF6);
  511. /*
  512. * CollectionTagExists()
  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. EXTERN_API( Boolean )
  520. CollectionTagExists(
  521. Collection c,
  522. CollectionTag tag) TWOWORDINLINE(0x7012, 0xABF6);
  523. /*
  524. * CountCollectionTags()
  525. *
  526. * Availability:
  527. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  528. * CarbonLib: in CarbonLib 1.0 and later
  529. * Mac OS X: in version 10.0 and later
  530. */
  531. EXTERN_API( SInt32 )
  532. CountCollectionTags(Collection c) TWOWORDINLINE(0x7013, 0xABF6);
  533. /*
  534. * GetIndexedCollectionTag()
  535. *
  536. * Availability:
  537. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  538. * CarbonLib: in CarbonLib 1.0 and later
  539. * Mac OS X: in version 10.0 and later
  540. */
  541. EXTERN_API( OSErr )
  542. GetIndexedCollectionTag(
  543. Collection c,
  544. SInt32 tagIndex,
  545. CollectionTag * tag) TWOWORDINLINE(0x7014, 0xABF6);
  546. /*
  547. * CountTaggedCollectionItems()
  548. *
  549. * Availability:
  550. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  551. * CarbonLib: in CarbonLib 1.0 and later
  552. * Mac OS X: in version 10.0 and later
  553. */
  554. EXTERN_API( SInt32 )
  555. CountTaggedCollectionItems(
  556. Collection c,
  557. CollectionTag tag) TWOWORDINLINE(0x7015, 0xABF6);
  558. /*
  559. * GetTaggedCollectionItem()
  560. *
  561. * Availability:
  562. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  563. * CarbonLib: in CarbonLib 1.0 and later
  564. * Mac OS X: in version 10.0 and later
  565. */
  566. EXTERN_API( OSErr )
  567. GetTaggedCollectionItem(
  568. Collection c,
  569. CollectionTag tag,
  570. SInt32 whichItem,
  571. SInt32 * itemSize,
  572. void * itemData) TWOWORDINLINE(0x7016, 0xABF6);
  573. /*
  574. * GetTaggedCollectionItemInfo()
  575. *
  576. * Availability:
  577. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  578. * CarbonLib: in CarbonLib 1.0 and later
  579. * Mac OS X: in version 10.0 and later
  580. */
  581. EXTERN_API( OSErr )
  582. GetTaggedCollectionItemInfo(
  583. Collection c,
  584. CollectionTag tag,
  585. SInt32 whichItem,
  586. SInt32 * id,
  587. SInt32 * index,
  588. SInt32 * itemSize,
  589. SInt32 * attributes) TWOWORDINLINE(0x7017, 0xABF6);
  590. /*
  591. * PurgeCollection()
  592. *
  593. * Availability:
  594. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  595. * CarbonLib: in CarbonLib 1.0 and later
  596. * Mac OS X: in version 10.0 and later
  597. */
  598. EXTERN_API( void )
  599. PurgeCollection(
  600. Collection c,
  601. SInt32 whichAttributes,
  602. SInt32 matchingAttributes) TWOWORDINLINE(0x7018, 0xABF6);
  603. /*
  604. * PurgeCollectionTag()
  605. *
  606. * Availability:
  607. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  608. * CarbonLib: in CarbonLib 1.0 and later
  609. * Mac OS X: in version 10.0 and later
  610. */
  611. EXTERN_API( void )
  612. PurgeCollectionTag(
  613. Collection c,
  614. CollectionTag tag) TWOWORDINLINE(0x7019, 0xABF6);
  615. /*
  616. * EmptyCollection()
  617. *
  618. * Availability:
  619. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  620. * CarbonLib: in CarbonLib 1.0 and later
  621. * Mac OS X: in version 10.0 and later
  622. */
  623. EXTERN_API( void )
  624. EmptyCollection(Collection c) TWOWORDINLINE(0x701A, 0xABF6);
  625. /*
  626. * FlattenCollection()
  627. *
  628. * Availability:
  629. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  630. * CarbonLib: in CarbonLib 1.0 and later
  631. * Mac OS X: in version 10.0 and later
  632. */
  633. EXTERN_API( OSErr )
  634. FlattenCollection(
  635. Collection c,
  636. CollectionFlattenUPP flattenProc,
  637. void * refCon) TWOWORDINLINE(0x701B, 0xABF6);
  638. /*
  639. * FlattenPartialCollection()
  640. *
  641. * Availability:
  642. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  643. * CarbonLib: in CarbonLib 1.0 and later
  644. * Mac OS X: in version 10.0 and later
  645. */
  646. EXTERN_API( OSErr )
  647. FlattenPartialCollection(
  648. Collection c,
  649. CollectionFlattenUPP flattenProc,
  650. void * refCon,
  651. SInt32 whichAttributes,
  652. SInt32 matchingAttributes) TWOWORDINLINE(0x701C, 0xABF6);
  653. /*
  654. * UnflattenCollection()
  655. *
  656. * Availability:
  657. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  658. * CarbonLib: in CarbonLib 1.0 and later
  659. * Mac OS X: in version 10.0 and later
  660. */
  661. EXTERN_API( OSErr )
  662. UnflattenCollection(
  663. Collection c,
  664. CollectionFlattenUPP flattenProc,
  665. void * refCon) TWOWORDINLINE(0x701D, 0xABF6);
  666. /*
  667. * GetCollectionExceptionProc()
  668. *
  669. * Availability:
  670. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  671. * CarbonLib: in CarbonLib 1.0 and later
  672. * Mac OS X: in version 10.0 and later
  673. */
  674. EXTERN_API( CollectionExceptionUPP )
  675. GetCollectionExceptionProc(Collection c) TWOWORDINLINE(0x701E, 0xABF6);
  676. /*
  677. * SetCollectionExceptionProc()
  678. *
  679. * Availability:
  680. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  681. * CarbonLib: in CarbonLib 1.0 and later
  682. * Mac OS X: in version 10.0 and later
  683. */
  684. EXTERN_API( void )
  685. SetCollectionExceptionProc(
  686. Collection c,
  687. CollectionExceptionUPP exceptionProc) TWOWORDINLINE(0x701F, 0xABF6);
  688. /*
  689. * GetNewCollection()
  690. *
  691. * Availability:
  692. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  693. * CarbonLib: in CarbonLib 1.0 and later
  694. * Mac OS X: in version 10.0 and later
  695. */
  696. EXTERN_API( Collection )
  697. GetNewCollection(SInt16 collectionID) TWOWORDINLINE(0x7020, 0xABF6);
  698. /**********************************************************************/
  699. /************** Utility routines for handle-based access **************/
  700. /**********************************************************************/
  701. /*
  702. * AddCollectionItemHdl()
  703. *
  704. * Availability:
  705. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  706. * CarbonLib: in CarbonLib 1.0 and later
  707. * Mac OS X: in version 10.0 and later
  708. */
  709. EXTERN_API( OSErr )
  710. AddCollectionItemHdl(
  711. Collection aCollection,
  712. CollectionTag tag,
  713. SInt32 id,
  714. Handle itemData) TWOWORDINLINE(0x7021, 0xABF6);
  715. /*
  716. * GetCollectionItemHdl()
  717. *
  718. * Availability:
  719. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  720. * CarbonLib: in CarbonLib 1.0 and later
  721. * Mac OS X: in version 10.0 and later
  722. */
  723. EXTERN_API( OSErr )
  724. GetCollectionItemHdl(
  725. Collection aCollection,
  726. CollectionTag tag,
  727. SInt32 id,
  728. Handle itemData) TWOWORDINLINE(0x7022, 0xABF6);
  729. /*
  730. * ReplaceIndexedCollectionItemHdl()
  731. *
  732. * Availability:
  733. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  734. * CarbonLib: in CarbonLib 1.0 and later
  735. * Mac OS X: in version 10.0 and later
  736. */
  737. EXTERN_API( OSErr )
  738. ReplaceIndexedCollectionItemHdl(
  739. Collection aCollection,
  740. SInt32 index,
  741. Handle itemData) TWOWORDINLINE(0x7023, 0xABF6);
  742. /*
  743. * GetIndexedCollectionItemHdl()
  744. *
  745. * Availability:
  746. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  747. * CarbonLib: in CarbonLib 1.0 and later
  748. * Mac OS X: in version 10.0 and later
  749. */
  750. EXTERN_API( OSErr )
  751. GetIndexedCollectionItemHdl(
  752. Collection aCollection,
  753. SInt32 index,
  754. Handle itemData) TWOWORDINLINE(0x7024, 0xABF6);
  755. /*
  756. * FlattenCollectionToHdl()
  757. *
  758. * Availability:
  759. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  760. * CarbonLib: in CarbonLib 1.0 and later
  761. * Mac OS X: in version 10.0 and later
  762. */
  763. EXTERN_API( OSErr )
  764. FlattenCollectionToHdl(
  765. Collection aCollection,
  766. Handle flattened) TWOWORDINLINE(0x7025, 0xABF6);
  767. /*
  768. * UnflattenCollectionFromHdl()
  769. *
  770. * Availability:
  771. * Non-Carbon CFM: in CollectionsLib 1.0 and later
  772. * CarbonLib: in CarbonLib 1.0 and later
  773. * Mac OS X: in version 10.0 and later
  774. */
  775. EXTERN_API( OSErr )
  776. UnflattenCollectionFromHdl(
  777. Collection aCollection,
  778. Handle flattened) TWOWORDINLINE(0x7026, 0xABF6);
  779. #if OLDROUTINENAMES
  780. enum {
  781. dontWantTag = kCollectionDontWantTag,
  782. dontWantId = kCollectionDontWantId,
  783. dontWantSize = kCollectionDontWantSize,
  784. dontWantAttributes = kCollectionDontWantAttributes,
  785. dontWantIndex = kCollectionDontWantIndex,
  786. dontWantData = kCollectionDontWantData
  787. };
  788. enum {
  789. noCollectionAttributes = kCollectionNoAttributes,
  790. allCollectionAttributes = kCollectionAllAttributes,
  791. userCollectionAttributes = kCollectionUserAttributes,
  792. defaultCollectionAttributes = kCollectionDefaultAttributes
  793. };
  794. enum {
  795. collectionUser0Bit = kCollectionUser0Bit,
  796. collectionUser1Bit = kCollectionUser1Bit,
  797. collectionUser2Bit = kCollectionUser2Bit,
  798. collectionUser3Bit = kCollectionUser3Bit,
  799. collectionUser4Bit = kCollectionUser4Bit,
  800. collectionUser5Bit = kCollectionUser5Bit,
  801. collectionUser6Bit = kCollectionUser6Bit,
  802. collectionUser7Bit = kCollectionUser7Bit,
  803. collectionUser8Bit = kCollectionUser8Bit,
  804. collectionUser9Bit = kCollectionUser9Bit,
  805. collectionUser10Bit = kCollectionUser10Bit,
  806. collectionUser11Bit = kCollectionUser11Bit,
  807. collectionUser12Bit = kCollectionUser12Bit,
  808. collectionUser13Bit = kCollectionUser13Bit,
  809. collectionUser14Bit = kCollectionUser14Bit,
  810. collectionUser15Bit = kCollectionUser15Bit,
  811. collectionReserved0Bit = kCollectionReserved0Bit,
  812. collectionReserved1Bit = kCollectionReserved1Bit,
  813. collectionReserved2Bit = kCollectionReserved2Bit,
  814. collectionReserved3Bit = kCollectionReserved3Bit,
  815. collectionReserved4Bit = kCollectionReserved4Bit,
  816. collectionReserved5Bit = kCollectionReserved5Bit,
  817. collectionReserved6Bit = kCollectionReserved6Bit,
  818. collectionReserved7Bit = kCollectionReserved7Bit,
  819. collectionReserved8Bit = kCollectionReserved8Bit,
  820. collectionReserved9Bit = kCollectionReserved9Bit,
  821. collectionReserved10Bit = kCollectionReserved10Bit,
  822. collectionReserved11Bit = kCollectionReserved11Bit,
  823. collectionReserved12Bit = kCollectionReserved12Bit,
  824. collectionReserved13Bit = kCollectionReserved13Bit,
  825. collectionPersistenceBit = kCollectionPersistenceBit,
  826. collectionLockBit = kCollectionLockBit
  827. };
  828. enum {
  829. collectionUser0Mask = kCollectionUser0Mask,
  830. collectionUser1Mask = kCollectionUser1Mask,
  831. collectionUser2Mask = kCollectionUser2Mask,
  832. collectionUser3Mask = kCollectionUser3Mask,
  833. collectionUser4Mask = kCollectionUser4Mask,
  834. collectionUser5Mask = kCollectionUser5Mask,
  835. collectionUser6Mask = kCollectionUser6Mask,
  836. collectionUser7Mask = kCollectionUser7Mask,
  837. collectionUser8Mask = kCollectionUser8Mask,
  838. collectionUser9Mask = kCollectionUser9Mask,
  839. collectionUser10Mask = kCollectionUser10Mask,
  840. collectionUser11Mask = kCollectionUser11Mask,
  841. collectionUser12Mask = kCollectionUser12Mask,
  842. collectionUser13Mask = kCollectionUser13Mask,
  843. collectionUser14Mask = kCollectionUser14Mask,
  844. collectionUser15Mask = kCollectionUser15Mask,
  845. collectionReserved0Mask = kCollectionReserved0Mask,
  846. collectionReserved1Mask = kCollectionReserved1Mask,
  847. collectionReserved2Mask = kCollectionReserved2Mask,
  848. collectionReserved3Mask = kCollectionReserved3Mask,
  849. collectionReserved4Mask = kCollectionReserved4Mask,
  850. collectionReserved5Mask = kCollectionReserved5Mask,
  851. collectionReserved6Mask = kCollectionReserved6Mask,
  852. collectionReserved7Mask = kCollectionReserved7Mask,
  853. collectionReserved8Mask = kCollectionReserved8Mask,
  854. collectionReserved9Mask = kCollectionReserved9Mask,
  855. collectionReserved10Mask = kCollectionReserved10Mask,
  856. collectionReserved11Mask = kCollectionReserved11Mask,
  857. collectionReserved12Mask = kCollectionReserved12Mask,
  858. collectionReserved13Mask = kCollectionReserved13Mask,
  859. collectionPersistenceMask = kCollectionPersistenceMask,
  860. collectionLockMask = kCollectionLockMask
  861. };
  862. #endif /* OLDROUTINENAMES */
  863. #ifdef PRAGMA_IMPORT_OFF
  864. #pragma import off
  865. #elif PRAGMA_IMPORT
  866. #pragma import reset
  867. #endif
  868. #ifdef __cplusplus
  869. }
  870. #endif
  871. #endif /* __COLLECTIONS__ */