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.

691 lines
21 KiB

  1. /*
  2. File: Scrap.h
  3. Contains: Scrap Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1985-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 __SCRAP__
  11. #define __SCRAP__
  12. #ifndef __MIXEDMODE__
  13. #include <MixedMode.h>
  14. #endif
  15. #ifndef __MACERRORS__
  16. #include <MacErrors.h>
  17. #endif
  18. #ifndef __CFSTRING__
  19. #include <CFString.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if PRAGMA_IMPORT
  28. #pragma import on
  29. #endif
  30. #if PRAGMA_STRUCT_ALIGN
  31. #pragma options align=mac68k
  32. #elif PRAGMA_STRUCT_PACKPUSH
  33. #pragma pack(push, 2)
  34. #elif PRAGMA_STRUCT_PACK
  35. #pragma pack(2)
  36. #endif
  37. /*
  38. ________________________________________________________________
  39. UNIVERSAL SCRAP MANAGER INTERFACES
  40. ________________________________________________________________
  41. The following interfaces are available when compiling for BOTH
  42. Carbon AND Mac OS 8.
  43. ________________________________________________________________
  44. */
  45. /*
  46. While we're in here mucking about, we defined a new type to
  47. to put some confusion to rest. The old calls, as well as the
  48. new calls, use the new type. Existing clients should be
  49. blissfully ignorant.
  50. */
  51. typedef FourCharCode ScrapFlavorType;
  52. /*
  53. Newsflash! After 15 years of arduous toil, it's finally possible
  54. for specially trained typists wielding advanced text editing
  55. technology to define symbolic names for commonly used scrap
  56. flavor type constants! Apple triumphs again!
  57. */
  58. enum {
  59. kScrapFlavorTypePicture = FOUR_CHAR_CODE('PICT'), /* contents of a PicHandle*/
  60. kScrapFlavorTypeText = FOUR_CHAR_CODE('TEXT'), /* stream of characters*/
  61. kScrapFlavorTypeTextStyle = FOUR_CHAR_CODE('styl'), /* see TEGetStyleScrapHandle*/
  62. kScrapFlavorTypeMovie = FOUR_CHAR_CODE('moov'), /* reference to a movie*/
  63. kScrapFlavorTypeSound = FOUR_CHAR_CODE('snd '), /* see SndRecord and SndPlay*/
  64. kScrapFlavorTypeUnicode = FOUR_CHAR_CODE('utxt'), /* stream of UTF16 characters*/
  65. kScrapFlavorTypeUnicodeStyle = FOUR_CHAR_CODE('ustl') /* ATSUI defines; Textension uses*/
  66. };
  67. /*
  68. If you are a Carbon client and you need to run on Mac OS 8,
  69. you may still need to load and unload the scrap. Under Mac OS
  70. X, the scrap is held by the pasteboard server instead of in a
  71. handle in your app's heap, so LoadScrap and UnloadScrap do
  72. nothing when called under Mac OS X.
  73. */
  74. /*
  75. * LoadScrap()
  76. *
  77. * Availability:
  78. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  79. * CarbonLib: in CarbonLib 1.0 and later
  80. * Mac OS X: in version 10.0 and later
  81. */
  82. EXTERN_API( OSStatus )
  83. LoadScrap(void) ONEWORDINLINE(0xA9FB);
  84. /*
  85. * UnloadScrap()
  86. *
  87. * Availability:
  88. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  89. * CarbonLib: in CarbonLib 1.0 and later
  90. * Mac OS X: in version 10.0 and later
  91. */
  92. EXTERN_API( OSStatus )
  93. UnloadScrap(void) ONEWORDINLINE(0xA9FA);
  94. #if CALL_NOT_IN_CARBON
  95. /*
  96. ________________________________________________________________
  97. MAC OS 8 SCRAP MANAGER INTERFACES
  98. ________________________________________________________________
  99. The following interfaces are available only when compiling for
  100. plain vanilla Mac OS 8. We didn't add comments to them because
  101. Inside Mac covers them in detail.
  102. ________________________________________________________________
  103. */
  104. struct ScrapStuff {
  105. SInt32 scrapSize;
  106. Handle scrapHandle;
  107. SInt16 scrapCount;
  108. SInt16 scrapState;
  109. StringPtr scrapName;
  110. };
  111. typedef struct ScrapStuff ScrapStuff;
  112. typedef ScrapStuff * PScrapStuff;
  113. typedef ScrapStuff * ScrapStuffPtr;
  114. #endif /* CALL_NOT_IN_CARBON */
  115. #if CALL_NOT_IN_CARBON
  116. /*
  117. * InfoScrap()
  118. *
  119. * Availability:
  120. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  121. * CarbonLib: not available
  122. * Mac OS X: not available
  123. */
  124. EXTERN_API( ScrapStuffPtr )
  125. InfoScrap(void) ONEWORDINLINE(0xA9F9);
  126. /*
  127. * GetScrap()
  128. *
  129. * Availability:
  130. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  131. * CarbonLib: not available
  132. * Mac OS X: not available
  133. */
  134. EXTERN_API( long )
  135. GetScrap(
  136. Handle destination,
  137. ScrapFlavorType flavorType,
  138. SInt32 * offset) ONEWORDINLINE(0xA9FD);
  139. /*
  140. * ZeroScrap()
  141. *
  142. * Availability:
  143. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  144. * CarbonLib: not available
  145. * Mac OS X: not available
  146. */
  147. EXTERN_API( OSStatus )
  148. ZeroScrap(void) ONEWORDINLINE(0xA9FC);
  149. /*
  150. * PutScrap()
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  154. * CarbonLib: not available
  155. * Mac OS X: not available
  156. */
  157. EXTERN_API( OSStatus )
  158. PutScrap(
  159. SInt32 sourceBufferByteCount,
  160. ScrapFlavorType flavorType,
  161. const void * sourceBuffer) ONEWORDINLINE(0xA9FE);
  162. /*
  163. ________________________________________________________________
  164. CARBON SCRAP MANAGER INTERFACES
  165. ________________________________________________________________
  166. The following interfaces are available only when compiling for
  167. Carbon.
  168. ________________________________________________________________
  169. */
  170. /*
  171. When promising a scrap flavor, it's OK if you
  172. don't yet know how big the flavor data will be.
  173. In this case, just pass kScrapFlavorSizeUnknown
  174. for the flavor data size.
  175. */
  176. #endif /* CALL_NOT_IN_CARBON */
  177. enum {
  178. kScrapFlavorSizeUnknown = -1
  179. };
  180. /*
  181. kScrapReservedFlavorType is a flavor type which is reserved
  182. for use by Scrap Manager. If you pass it to Scrap Manager,
  183. it will be rejected.
  184. */
  185. enum {
  186. kScrapReservedFlavorType = FOUR_CHAR_CODE('srft')
  187. };
  188. /*
  189. We've added scrap flavor flags ala Drag Manager.
  190. kScrapFlavorMaskNone means you want none of the flags.
  191. kScrapFlavorSenderOnlyMask means only the process which
  192. put the flavor on the scrap can see it. If some other
  193. process put a flavor with this flag on the scrap,
  194. your process will never see the flavor, so there's
  195. no point in testing for this flag.
  196. kScrapFlavorTranslated means the flavor was translated
  197. from some other flavor in the scrap by Translation Manager.
  198. Most callers should not care about this bit.
  199. */
  200. enum {
  201. kScrapFlavorMaskNone = 0x00000000,
  202. kScrapFlavorMaskSenderOnly = 0x00000001,
  203. kScrapFlavorMaskTranslated = 0x00000002
  204. };
  205. typedef UInt32 ScrapFlavorFlags;
  206. /*
  207. ScrapFlavorInfo describes a single flavor within
  208. a scrap.
  209. */
  210. struct ScrapFlavorInfo {
  211. ScrapFlavorType flavorType;
  212. ScrapFlavorFlags flavorFlags;
  213. };
  214. typedef struct ScrapFlavorInfo ScrapFlavorInfo;
  215. typedef struct OpaqueScrapRef* ScrapRef;
  216. /*
  217. kScrapRefNone is guaranteed to be an invalid ScrapRef. This
  218. is convenient when initializing application variables.
  219. */
  220. #define kScrapRefNone ((ScrapRef)NULL)
  221. /*
  222. Defined Apple scrap names for GetScrapByName
  223. kScrapClipboardScrap traditional clipboard scrap
  224. kScrapFindScrap compatible with Cocoa's global find scrap
  225. */
  226. #define kScrapClipboardScrap CFSTR("com.apple.scrap.clipboard")
  227. #define kScrapFindScrap CFSTR("com.apple.scrap.find")
  228. /* Enumerated options to be passed to GetScrapByName*/
  229. enum {
  230. kScrapGetNamedScrap = 0, /* get current named scrap without bumping*/
  231. kScrapClearNamedScrap = (1L << 0) /* acquire the named scrap, bumping and clearing*/
  232. };
  233. /*
  234. GetScrapByName allows access to an indefinite number of public or private
  235. scraps. The constant kScrapClipboardScrap refers to the "current" scrap
  236. we've all come to know and love. kScrapFindScrap allows Carbon apps to
  237. interact seamlessly with Cocoa's global find scrap. Note that calling:
  238. GetScrapByName( kScrapClipboardScrap, kScrapGetNamedScrap, &scrap );
  239. is an exact match to the call:
  240. GetCurrentScrap( &scrap );
  241. Additionally, a call to:
  242. GetScrapByName( kScrapClipboardScrap, kScrapClearNamedScrap, &scrap );
  243. is a replacement for the sequence:
  244. ClearCurrentScrap();
  245. GetCurrentScrap( &scrap );
  246. You can use this API to generate your own private scraps to use as a high
  247. level interprocess communication between your main and helper apps. The Java
  248. naming convention is suggested for your scraps ( ie. com.joeco.scrap.secret ).
  249. CarbonLib does not support arbitrary named scraps; when calling this API on
  250. CarbonLib, kScrapClipboardScrap is the only supported value for the name parameter.
  251. */
  252. /*
  253. * GetScrapByName()
  254. *
  255. * Availability:
  256. * Non-Carbon CFM: not available
  257. * CarbonLib: in CarbonLib 1.5 and later
  258. * Mac OS X: in version 10.1 and later
  259. */
  260. EXTERN_API( OSStatus )
  261. GetScrapByName(
  262. CFStringRef name,
  263. OptionBits options,
  264. ScrapRef * scrap);
  265. /*
  266. GetCurrentScrap obtains a reference to the current scrap.
  267. The ScrapRef obtained via GetCurrentScrap will become
  268. invalid and unusable after the scrap is cleared.
  269. */
  270. /*
  271. * GetCurrentScrap()
  272. *
  273. * Availability:
  274. * Non-Carbon CFM: not available
  275. * CarbonLib: in CarbonLib 1.0 and later
  276. * Mac OS X: in version 10.0 and later
  277. */
  278. EXTERN_API( OSStatus )
  279. GetCurrentScrap(ScrapRef * scrap);
  280. /*
  281. GetScrapFlavorFlags tells you [a] whether the scrap contains
  282. data for a particular flavor and [b] some things about that
  283. flavor if it exists. This call never blocks, and is useful
  284. for deciding whether to enable the Paste item in your Edit
  285. menu, among other things.
  286. */
  287. /*
  288. * GetScrapFlavorFlags()
  289. *
  290. * Availability:
  291. * Non-Carbon CFM: not available
  292. * CarbonLib: in CarbonLib 1.0 and later
  293. * Mac OS X: in version 10.0 and later
  294. */
  295. EXTERN_API( OSStatus )
  296. GetScrapFlavorFlags(
  297. ScrapRef scrap,
  298. ScrapFlavorType flavorType,
  299. ScrapFlavorFlags * flavorFlags);
  300. /*
  301. GetScrapFlavorSize gets the size of the data of the specified
  302. flavor. This function blocks until the specified flavor
  303. data is available. GetScrapFlavorSize is intended as a prelude
  304. to allocating memory and calling GetScrapFlavorData.
  305. */
  306. /*
  307. * GetScrapFlavorSize()
  308. *
  309. * Availability:
  310. * Non-Carbon CFM: not available
  311. * CarbonLib: in CarbonLib 1.0 and later
  312. * Mac OS X: in version 10.0 and later
  313. */
  314. EXTERN_API( OSStatus )
  315. GetScrapFlavorSize(
  316. ScrapRef scrap,
  317. ScrapFlavorType flavorType,
  318. Size * byteCount);
  319. /*
  320. GetScrapFlavorData gets the data from the specified flavor in the
  321. specified scrap. This function blocks until the specified flavor
  322. data is available. Specify the maximum size your buffer can contain;
  323. on output, this function produces the number of bytes that were
  324. available (even if this is more than you requested).
  325. */
  326. /*
  327. * GetScrapFlavorData()
  328. *
  329. * Availability:
  330. * Non-Carbon CFM: not available
  331. * CarbonLib: in CarbonLib 1.0 and later
  332. * Mac OS X: in version 10.0 and later
  333. */
  334. EXTERN_API( OSStatus )
  335. GetScrapFlavorData(
  336. ScrapRef scrap,
  337. ScrapFlavorType flavorType,
  338. Size * byteCount,
  339. void * destination);
  340. /*
  341. ClearCurrentScrap clears the current scrap. Call this
  342. first when the user requests a Copy or Cut operation --
  343. even if you maintain a private scrap! You should not wait
  344. until receiving a suspend event to call ClearCurrentScrap. Call
  345. it immediately after the user requests a Copy or Cut operation.
  346. You don't need to put any data on the scrap immediately (although
  347. it's perfectly fine to do so). You DO need to call GetCurrentScrap
  348. after ClearCurrentScrap so you'll have a valid ScrapRef to pass
  349. to other functions.
  350. */
  351. /*
  352. * ClearCurrentScrap()
  353. *
  354. * Availability:
  355. * Non-Carbon CFM: not available
  356. * CarbonLib: in CarbonLib 1.0 and later
  357. * Mac OS X: in version 10.0 and later
  358. */
  359. EXTERN_API( OSStatus )
  360. ClearCurrentScrap(void);
  361. /*
  362. ClearScrap will clear the scrap passed in and return the bumped
  363. ScrapRef value. ClearScrap behaves similarly to GetScrapByName
  364. when called with the kScrapClearNamedScrap option with the
  365. benefit of not requiring a name in the event one is not available.
  366. CarbonLib does not support arbitrary named scraps; when calling this
  367. API on CarbonLib, only clearing the current scrap is supported.
  368. */
  369. /*
  370. * ClearScrap()
  371. *
  372. * Availability:
  373. * Non-Carbon CFM: not available
  374. * CarbonLib: in CarbonLib 1.5 and later
  375. * Mac OS X: in version 10.1 and later
  376. */
  377. EXTERN_API( OSStatus )
  378. ClearScrap(ScrapRef * inOutScrap);
  379. /*
  380. PutScrapFlavor is a lot like PutScrap, with two differences:
  381. we added a ScrapRef parameter at the beginning and you can
  382. "promise" various aspects of a flavor. If you pass a NIL
  383. data pointer, this is a promise that in the future you
  384. will provide data for this flavor. Provide the data
  385. through a subsequent call to PutScrapFlavor, either later
  386. in the same code flow or during a scrap promise keeper proc.
  387. If you know how big the data is, you can pass the size as
  388. well, and this may allow subsequent callers of GetScrapFlavorInfo
  389. to avoid blocking. If you don't know the size, pass -1.
  390. If you pass a 0 size, you are telling Scrap Manager not to
  391. expect any data for this flavor. In this case, the flavor
  392. data pointer is ignored. NOTE: the last time you can provide
  393. scrap flavor data is when your scrap promise keeper gets
  394. called. It is NOT possible to call PutScrapFlavor while
  395. handling a suspend event; suspend events under Carbon
  396. simply don't work the way they do under Mac OS 8.
  397. The method for setting Scrap Manager promises differs from that for Drag Manger promises.
  398. This chart describes the method for setting scrap promises via PutScrapFlavor().
  399. dataPtr dataSize result
  400. pointer value actual data size The data of size dataSize pointed to by dataPtr is added to the scrap.
  401. 0 actual data size A promise for data of size dataSize is placed on the scrap.
  402. 0 -1 A promise for data of an undetermined size is placed on the scrap.
  403. ignored 0 A flavor with no data expected is placed on the scrap. This is not a promise.
  404. */
  405. /*
  406. * PutScrapFlavor()
  407. *
  408. * Availability:
  409. * Non-Carbon CFM: not available
  410. * CarbonLib: in CarbonLib 1.0 and later
  411. * Mac OS X: in version 10.0 and later
  412. */
  413. EXTERN_API( OSStatus )
  414. PutScrapFlavor(
  415. ScrapRef scrap,
  416. ScrapFlavorType flavorType,
  417. ScrapFlavorFlags flavorFlags,
  418. Size flavorSize,
  419. const void * flavorData); /* can be NULL */
  420. /*
  421. ScrapPromiseKeeper is a function you write which is called by
  422. Scrap Manager as needed to keep your earlier promise of a
  423. particular scrap flavor. When your function is called, deliver
  424. the requested data by calling PutScrapFlavor.
  425. */
  426. typedef CALLBACK_API( OSStatus , ScrapPromiseKeeperProcPtr )(ScrapRef scrap, ScrapFlavorType flavorType, void *userData);
  427. typedef STACK_UPP_TYPE(ScrapPromiseKeeperProcPtr) ScrapPromiseKeeperUPP;
  428. /*
  429. * NewScrapPromiseKeeperUPP()
  430. *
  431. * Availability:
  432. * Non-Carbon CFM: available as macro/inline
  433. * CarbonLib: in CarbonLib 1.0 and later
  434. * Mac OS X: in version 10.0 and later
  435. */
  436. EXTERN_API_C( ScrapPromiseKeeperUPP )
  437. NewScrapPromiseKeeperUPP(ScrapPromiseKeeperProcPtr userRoutine);
  438. #if !OPAQUE_UPP_TYPES
  439. enum { uppScrapPromiseKeeperProcInfo = 0x00000FF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  440. #ifdef __cplusplus
  441. inline DEFINE_API_C(ScrapPromiseKeeperUPP) NewScrapPromiseKeeperUPP(ScrapPromiseKeeperProcPtr userRoutine) { return (ScrapPromiseKeeperUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppScrapPromiseKeeperProcInfo, GetCurrentArchitecture()); }
  442. #else
  443. #define NewScrapPromiseKeeperUPP(userRoutine) (ScrapPromiseKeeperUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppScrapPromiseKeeperProcInfo, GetCurrentArchitecture())
  444. #endif
  445. #endif
  446. /*
  447. * DisposeScrapPromiseKeeperUPP()
  448. *
  449. * Availability:
  450. * Non-Carbon CFM: available as macro/inline
  451. * CarbonLib: in CarbonLib 1.0 and later
  452. * Mac OS X: in version 10.0 and later
  453. */
  454. EXTERN_API_C( void )
  455. DisposeScrapPromiseKeeperUPP(ScrapPromiseKeeperUPP userUPP);
  456. #if !OPAQUE_UPP_TYPES
  457. #ifdef __cplusplus
  458. inline DEFINE_API_C(void) DisposeScrapPromiseKeeperUPP(ScrapPromiseKeeperUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  459. #else
  460. #define DisposeScrapPromiseKeeperUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  461. #endif
  462. #endif
  463. /*
  464. * InvokeScrapPromiseKeeperUPP()
  465. *
  466. * Availability:
  467. * Non-Carbon CFM: available as macro/inline
  468. * CarbonLib: in CarbonLib 1.0 and later
  469. * Mac OS X: in version 10.0 and later
  470. */
  471. EXTERN_API_C( OSStatus )
  472. InvokeScrapPromiseKeeperUPP(
  473. ScrapRef scrap,
  474. ScrapFlavorType flavorType,
  475. void * userData,
  476. ScrapPromiseKeeperUPP userUPP);
  477. #if !OPAQUE_UPP_TYPES
  478. #ifdef __cplusplus
  479. inline DEFINE_API_C(OSStatus) InvokeScrapPromiseKeeperUPP(ScrapRef scrap, ScrapFlavorType flavorType, void * userData, ScrapPromiseKeeperUPP userUPP) { return (OSStatus)CALL_THREE_PARAMETER_UPP(userUPP, uppScrapPromiseKeeperProcInfo, scrap, flavorType, userData); }
  480. #else
  481. #define InvokeScrapPromiseKeeperUPP(scrap, flavorType, userData, userUPP) (OSStatus)CALL_THREE_PARAMETER_UPP((userUPP), uppScrapPromiseKeeperProcInfo, (scrap), (flavorType), (userData))
  482. #endif
  483. #endif
  484. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  485. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  486. #define NewScrapPromiseKeeperProc(userRoutine) NewScrapPromiseKeeperUPP(userRoutine)
  487. #define CallScrapPromiseKeeperProc(userRoutine, scrap, flavorType, userData) InvokeScrapPromiseKeeperUPP(scrap, flavorType, userData, userRoutine)
  488. #endif /* CALL_NOT_IN_CARBON */
  489. /*
  490. SetScrapPromiseKeeper associates a ScrapPromiseKeeper with a
  491. scrap. You can remove a ScrapPromiseKeeper from a scrap by
  492. passing a NIL ScrapPromiseKeeper to SetScrapPromiseKeeper.
  493. Pass whatever you like in the last parameter; its value will
  494. be passed to your ScrapPromiseKeeper, which can do whatever
  495. it likes with the value. You might choose to pass a pointer
  496. or handle to some private scrap data which the
  497. ScrapPromiseKeeper could use in fabricating one or more
  498. promised flavors.
  499. */
  500. /*
  501. * SetScrapPromiseKeeper()
  502. *
  503. * Availability:
  504. * Non-Carbon CFM: not available
  505. * CarbonLib: in CarbonLib 1.0 and later
  506. * Mac OS X: in version 10.0 and later
  507. */
  508. EXTERN_API( OSStatus )
  509. SetScrapPromiseKeeper(
  510. ScrapRef scrap,
  511. ScrapPromiseKeeperUPP upp,
  512. const void * userData);
  513. /*
  514. GetScrapFlavorCount produces the number of
  515. items which can be obtained by GetScrapFlavorInfoList.
  516. */
  517. /*
  518. * GetScrapFlavorCount()
  519. *
  520. * Availability:
  521. * Non-Carbon CFM: not available
  522. * CarbonLib: in CarbonLib 1.0 and later
  523. * Mac OS X: in version 10.0 and later
  524. */
  525. EXTERN_API( OSStatus )
  526. GetScrapFlavorCount(
  527. ScrapRef scrap,
  528. UInt32 * infoCount);
  529. /*
  530. GetScrapFlavorInfoList fills a list (array)
  531. of items which each describe the corresponding
  532. flavor in the scrap. It fills no more array
  533. elements as are specified. On exit, it produces
  534. the count of elements it filled (which may be
  535. smaller than the count requested). Yes, YOU
  536. must provide the memory for the array.
  537. */
  538. /*
  539. * GetScrapFlavorInfoList()
  540. *
  541. * Availability:
  542. * Non-Carbon CFM: not available
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Mac OS X: in version 10.0 and later
  545. */
  546. EXTERN_API( OSStatus )
  547. GetScrapFlavorInfoList(
  548. ScrapRef scrap,
  549. UInt32 * infoCount,
  550. ScrapFlavorInfo info[]);
  551. /*
  552. CallInScrapPromises forces all promises to be kept.
  553. If your application promises at least one flavor
  554. AND it does NOT adopt the new event model, you
  555. should call this function when your application
  556. is about to quit. If your app promises no flavors,
  557. there is no need to call this function, and if
  558. your app adopts the new event model, this function
  559. will be called automagically for you. It doesn't
  560. hurt to call this function more than once, though
  561. promise keepers may be asked to keep promises
  562. they already tried and failed.
  563. */
  564. /*
  565. * CallInScrapPromises()
  566. *
  567. * Availability:
  568. * Non-Carbon CFM: not available
  569. * CarbonLib: in CarbonLib 1.0 and later
  570. * Mac OS X: in version 10.0 and later
  571. */
  572. EXTERN_API( OSStatus )
  573. CallInScrapPromises(void);
  574. #if PRAGMA_STRUCT_ALIGN
  575. #pragma options align=reset
  576. #elif PRAGMA_STRUCT_PACKPUSH
  577. #pragma pack(pop)
  578. #elif PRAGMA_STRUCT_PACK
  579. #pragma pack()
  580. #endif
  581. #ifdef PRAGMA_IMPORT_OFF
  582. #pragma import off
  583. #elif PRAGMA_IMPORT
  584. #pragma import reset
  585. #endif
  586. #ifdef __cplusplus
  587. }
  588. #endif
  589. #endif /* __SCRAP__ */