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.

1408 lines
48 KiB

  1. /*
  2. File: Components.h
  3. Contains: Component Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1990-2003 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 __COMPONENTS__
  11. #define __COMPONENTS__
  12. #ifndef __MACERRORS__
  13. #include <MacErrors.h>
  14. #endif
  15. #ifndef __MACTYPES__
  16. #include <MacTypes.h>
  17. #endif
  18. #ifndef __MIXEDMODE__
  19. #include <MixedMode.h>
  20. #endif
  21. #ifndef __FILES__
  22. #include <Files.h>
  23. #endif
  24. #if PRAGMA_ONCE
  25. #pragma once
  26. #endif
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #if PRAGMA_IMPORT
  31. #pragma import on
  32. #endif
  33. #if PRAGMA_STRUCT_ALIGN
  34. #pragma options align=mac68k
  35. #elif PRAGMA_STRUCT_PACKPUSH
  36. #pragma pack(push, 2)
  37. #elif PRAGMA_STRUCT_PACK
  38. #pragma pack(2)
  39. #endif
  40. enum {
  41. kAppleManufacturer = FOUR_CHAR_CODE('appl'), /* Apple supplied components */
  42. kComponentResourceType = FOUR_CHAR_CODE('thng'), /* a components resource type */
  43. kComponentAliasResourceType = FOUR_CHAR_CODE('thga') /* component alias resource type */
  44. };
  45. enum {
  46. kAnyComponentType = 0,
  47. kAnyComponentSubType = 0,
  48. kAnyComponentManufacturer = 0,
  49. kAnyComponentFlagsMask = 0
  50. };
  51. enum {
  52. cmpIsMissing = 1L << 29,
  53. cmpWantsRegisterMessage = 1L << 31
  54. };
  55. enum {
  56. kComponentOpenSelect = -1, /* ComponentInstance for this open */
  57. kComponentCloseSelect = -2, /* ComponentInstance for this close */
  58. kComponentCanDoSelect = -3, /* selector # being queried */
  59. kComponentVersionSelect = -4, /* no params */
  60. kComponentRegisterSelect = -5, /* no params */
  61. kComponentTargetSelect = -6, /* ComponentInstance for top of call chain */
  62. kComponentUnregisterSelect = -7, /* no params */
  63. kComponentGetMPWorkFunctionSelect = -8, /* some params */
  64. kComponentExecuteWiredActionSelect = -9, /* QTAtomContainer actionContainer, QTAtom actionAtom, QTCustomActionTargetPtr target, QTEventRecordPtr event */
  65. kComponentGetPublicResourceSelect = -10 /* OSType resourceType, short resourceId, Handle *resource */
  66. };
  67. /* Component Resource Extension flags */
  68. enum {
  69. componentDoAutoVersion = (1 << 0),
  70. componentWantsUnregister = (1 << 1),
  71. componentAutoVersionIncludeFlags = (1 << 2),
  72. componentHasMultiplePlatforms = (1 << 3),
  73. componentLoadResident = (1 << 4)
  74. };
  75. /* Set Default Component flags */
  76. enum {
  77. defaultComponentIdentical = 0,
  78. defaultComponentAnyFlags = 1,
  79. defaultComponentAnyManufacturer = 2,
  80. defaultComponentAnySubType = 4,
  81. defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
  82. defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
  83. };
  84. /* RegisterComponentResource flags */
  85. enum {
  86. registerComponentGlobal = 1,
  87. registerComponentNoDuplicates = 2,
  88. registerComponentAfterExisting = 4,
  89. registerComponentAliasesOnly = 8
  90. };
  91. struct ComponentDescription {
  92. OSType componentType; /* A unique 4-byte code indentifying the command set */
  93. OSType componentSubType; /* Particular flavor of this instance */
  94. OSType componentManufacturer; /* Vendor indentification */
  95. unsigned long componentFlags; /* 8 each for Component,Type,SubType,Manuf/revision */
  96. unsigned long componentFlagsMask; /* Mask for specifying which flags to consider in search, zero during registration */
  97. };
  98. typedef struct ComponentDescription ComponentDescription;
  99. struct ResourceSpec {
  100. OSType resType; /* 4-byte code */
  101. short resID; /* */
  102. };
  103. typedef struct ResourceSpec ResourceSpec;
  104. struct ComponentResource {
  105. ComponentDescription cd; /* Registration parameters */
  106. ResourceSpec component; /* resource where Component code is found */
  107. ResourceSpec componentName; /* name string resource */
  108. ResourceSpec componentInfo; /* info string resource */
  109. ResourceSpec componentIcon; /* icon resource */
  110. };
  111. typedef struct ComponentResource ComponentResource;
  112. typedef ComponentResource * ComponentResourcePtr;
  113. typedef ComponentResourcePtr * ComponentResourceHandle;
  114. struct ComponentPlatformInfo {
  115. long componentFlags; /* flags of Component */
  116. ResourceSpec component; /* resource where Component code is found */
  117. short platformType; /* gestaltSysArchitecture result */
  118. };
  119. typedef struct ComponentPlatformInfo ComponentPlatformInfo;
  120. struct ComponentResourceExtension {
  121. long componentVersion; /* version of Component */
  122. long componentRegisterFlags; /* flags for registration */
  123. short componentIconFamily; /* resource id of Icon Family */
  124. };
  125. typedef struct ComponentResourceExtension ComponentResourceExtension;
  126. struct ComponentPlatformInfoArray {
  127. long count;
  128. ComponentPlatformInfo platformArray[1];
  129. };
  130. typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
  131. struct ExtComponentResource {
  132. ComponentDescription cd; /* registration parameters */
  133. ResourceSpec component; /* resource where Component code is found */
  134. ResourceSpec componentName; /* name string resource */
  135. ResourceSpec componentInfo; /* info string resource */
  136. ResourceSpec componentIcon; /* icon resource */
  137. long componentVersion; /* version of Component */
  138. long componentRegisterFlags; /* flags for registration */
  139. short componentIconFamily; /* resource id of Icon Family */
  140. long count; /* elements in platformArray */
  141. ComponentPlatformInfo platformArray[1];
  142. };
  143. typedef struct ExtComponentResource ExtComponentResource;
  144. typedef ExtComponentResource * ExtComponentResourcePtr;
  145. typedef ExtComponentResourcePtr * ExtComponentResourceHandle;
  146. struct ComponentAliasResource {
  147. ComponentResource cr; /* Registration parameters */
  148. ComponentDescription aliasCD; /* component alias description */
  149. };
  150. typedef struct ComponentAliasResource ComponentAliasResource;
  151. /* Structure received by Component: */
  152. struct ComponentParameters {
  153. UInt8 flags; /* call modifiers: sync/async, deferred, immed, etc */
  154. UInt8 paramSize; /* size in bytes of actual parameters passed to this call */
  155. short what; /* routine selector, negative for Component management calls */
  156. long params[1]; /* actual parameters for the indicated routine */
  157. };
  158. typedef struct ComponentParameters ComponentParameters;
  159. struct ComponentRecord {
  160. long data[1];
  161. };
  162. typedef struct ComponentRecord ComponentRecord;
  163. typedef ComponentRecord * Component;
  164. struct ComponentInstanceRecord {
  165. long data[1];
  166. };
  167. typedef struct ComponentInstanceRecord ComponentInstanceRecord;
  168. typedef ComponentInstanceRecord * ComponentInstance;
  169. struct RegisteredComponentRecord {
  170. long data[1];
  171. };
  172. typedef struct RegisteredComponentRecord RegisteredComponentRecord;
  173. typedef RegisteredComponentRecord * RegisteredComponentRecordPtr;
  174. struct RegisteredComponentInstanceRecord {
  175. long data[1];
  176. };
  177. typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
  178. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
  179. typedef long ComponentResult;
  180. enum {
  181. platform68k = 1, /* platform type (response from gestaltComponentPlatform) */
  182. platformPowerPC = 2, /* (when gestaltComponentPlatform is not implemented, use */
  183. platformInterpreted = 3, /* gestaltSysArchitecture) */
  184. platformWin32 = 4,
  185. platformPowerPCNativeEntryPoint = 5
  186. };
  187. enum {
  188. mpWorkFlagDoWork = (1 << 0),
  189. mpWorkFlagDoCompletion = (1 << 1),
  190. mpWorkFlagCopyWorkBlock = (1 << 2),
  191. mpWorkFlagDontBlock = (1 << 3),
  192. mpWorkFlagGetProcessorCount = (1 << 4),
  193. mpWorkFlagGetIsRunning = (1 << 6)
  194. };
  195. enum {
  196. cmpAliasNoFlags = 0,
  197. cmpAliasOnlyThisFile = 1
  198. };
  199. struct ComponentMPWorkFunctionHeaderRecord {
  200. UInt32 headerSize;
  201. UInt32 recordSize;
  202. UInt32 workFlags;
  203. UInt16 processorCount;
  204. UInt8 unused;
  205. UInt8 isRunning;
  206. };
  207. typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
  208. typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
  209. typedef CALLBACK_API( ComponentResult , ComponentMPWorkFunctionProcPtr )(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
  210. typedef CALLBACK_API( ComponentResult , ComponentRoutineProcPtr )(ComponentParameters *cp, Handle componentStorage);
  211. typedef CALLBACK_API( OSErr , GetMissingComponentResourceProcPtr )(Component c, OSType resType, short resID, void *refCon, Handle *resource);
  212. typedef STACK_UPP_TYPE(ComponentMPWorkFunctionProcPtr) ComponentMPWorkFunctionUPP;
  213. typedef STACK_UPP_TYPE(ComponentRoutineProcPtr) ComponentRoutineUPP;
  214. typedef STACK_UPP_TYPE(GetMissingComponentResourceProcPtr) GetMissingComponentResourceUPP;
  215. /*
  216. The parameter list for each ComponentFunction is unique. It is
  217. therefore up to users to create the appropriate procInfo for their
  218. own ComponentFunctions where necessary.
  219. */
  220. typedef UniversalProcPtr ComponentFunctionUPP;
  221. /*
  222. * NewComponentFunctionUPP()
  223. *
  224. * Discussion:
  225. * For use in writing a Carbon compliant Component. It is used to
  226. * create a ComponentFunctionUPP needed to call
  227. * CallComponentFunction in the Components dispatch routine.
  228. *
  229. * Availability:
  230. * Non-Carbon CFM: available as macro/inline
  231. * CarbonLib: in CarbonLib 1.0 and later
  232. * Mac OS X: in version 10.0 and later
  233. */
  234. EXTERN_API( ComponentFunctionUPP )
  235. NewComponentFunctionUPP(
  236. ProcPtr userRoutine,
  237. ProcInfoType procInfo);
  238. #if !OPAQUE_UPP_TYPES
  239. #ifdef __cplusplus
  240. inline DEFINE_API(ComponentFunctionUPP ) NewComponentFunctionUPP(ProcPtr userRoutine, ProcInfoType procInfo) { return (ComponentFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), (ProcInfoType)procInfo, GetCurrentArchitecture()); }
  241. #else
  242. #define NewComponentFunctionUPP(userRoutine, procInfo) ((ComponentFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), (ProcInfoType)procInfo, GetCurrentArchitecture()))
  243. #endif
  244. #endif
  245. /*
  246. * DisposeComponentFunctionUPP()
  247. *
  248. * Discussion:
  249. * For use in writing a Carbon compliant Component. It is used to
  250. * dispose of a ComponentFunctionUPP created by
  251. * NewComponentFunctionUPP.
  252. *
  253. * Availability:
  254. * Non-Carbon CFM: available as macro/inline
  255. * CarbonLib: in CarbonLib 1.0 and later
  256. * Mac OS X: in version 10.0 and later
  257. */
  258. EXTERN_API( void )
  259. DisposeComponentFunctionUPP(ComponentFunctionUPP userUPP);
  260. #if !OPAQUE_UPP_TYPES
  261. #ifdef __cplusplus
  262. inline DEFINE_API(void) DisposeComponentFunctionUPP(ComponentFunctionUPP userUPP) { DisposeRoutineDescriptor(userUPP); }
  263. #else
  264. #define DisposeComponentFunctionUPP(userUPP) (DisposeRoutineDescriptor(userUPP))
  265. #endif
  266. #endif
  267. #if TARGET_RT_MAC_CFM
  268. /*
  269. CallComponentUPP is a global variable exported from InterfaceLib.
  270. It is the ProcPtr passed to CallUniversalProc to manually call a component function.
  271. */
  272. /*
  273. * CallComponentUPP
  274. *
  275. * Availability:
  276. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  277. * CarbonLib: not available
  278. * Mac OS X: not available
  279. */
  280. extern UniversalProcPtr CallComponentUPP;
  281. #endif
  282. #define ComponentCallNow( callNumber, paramSize ) \
  283. FIVEWORDINLINE( 0x2F3C,paramSize,callNumber,0x7000,0xA82A )
  284. /********************************************************
  285. * *
  286. * APPLICATION LEVEL CALLS *
  287. * *
  288. ********************************************************/
  289. /********************************************************
  290. * Component Database Add, Delete, and Query Routines
  291. ********************************************************/
  292. /*
  293. * RegisterComponent()
  294. *
  295. * Availability:
  296. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  297. * CarbonLib: in CarbonLib 1.0 and later
  298. * Mac OS X: in version 10.0 and later
  299. * Windows: in qtmlClient.lib 3.0 and later
  300. */
  301. EXTERN_API( Component )
  302. RegisterComponent(
  303. ComponentDescription * cd,
  304. ComponentRoutineUPP componentEntryPoint,
  305. short global,
  306. Handle componentName,
  307. Handle componentInfo,
  308. Handle componentIcon) TWOWORDINLINE(0x7001, 0xA82A);
  309. /*
  310. * RegisterComponentResource()
  311. *
  312. * Availability:
  313. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  314. * CarbonLib: in CarbonLib 1.0 and later
  315. * Mac OS X: in version 10.0 and later
  316. * Windows: in qtmlClient.lib 3.0 and later
  317. */
  318. EXTERN_API( Component )
  319. RegisterComponentResource(
  320. ComponentResourceHandle cr,
  321. short global) TWOWORDINLINE(0x7012, 0xA82A);
  322. /*
  323. * UnregisterComponent()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  327. * CarbonLib: in CarbonLib 1.0 and later
  328. * Mac OS X: in version 10.0 and later
  329. * Windows: in qtmlClient.lib 3.0 and later
  330. */
  331. EXTERN_API( OSErr )
  332. UnregisterComponent(Component aComponent) TWOWORDINLINE(0x7002, 0xA82A);
  333. /*
  334. * FindNextComponent()
  335. *
  336. * Availability:
  337. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  338. * CarbonLib: in CarbonLib 1.0 and later
  339. * Mac OS X: in version 10.0 and later
  340. * Windows: in qtmlClient.lib 3.0 and later
  341. */
  342. EXTERN_API( Component )
  343. FindNextComponent(
  344. Component aComponent,
  345. ComponentDescription * looking) TWOWORDINLINE(0x7004, 0xA82A);
  346. /*
  347. * CountComponents()
  348. *
  349. * Availability:
  350. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  351. * CarbonLib: in CarbonLib 1.0 and later
  352. * Mac OS X: in version 10.0 and later
  353. * Windows: in qtmlClient.lib 3.0 and later
  354. */
  355. EXTERN_API( long )
  356. CountComponents(ComponentDescription * looking) TWOWORDINLINE(0x7003, 0xA82A);
  357. /*
  358. * GetComponentInfo()
  359. *
  360. * Availability:
  361. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  362. * CarbonLib: in CarbonLib 1.0 and later
  363. * Mac OS X: in version 10.0 and later
  364. * Windows: in qtmlClient.lib 3.0 and later
  365. */
  366. EXTERN_API( OSErr )
  367. GetComponentInfo(
  368. Component aComponent,
  369. ComponentDescription * cd,
  370. Handle componentName,
  371. Handle componentInfo,
  372. Handle componentIcon) TWOWORDINLINE(0x7005, 0xA82A);
  373. /*
  374. * GetComponentListModSeed()
  375. *
  376. * Availability:
  377. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  378. * CarbonLib: in CarbonLib 1.0 and later
  379. * Mac OS X: in version 10.0 and later
  380. * Windows: in qtmlClient.lib 3.0 and later
  381. */
  382. EXTERN_API( long )
  383. GetComponentListModSeed(void) TWOWORDINLINE(0x7006, 0xA82A);
  384. /*
  385. * GetComponentTypeModSeed()
  386. *
  387. * Availability:
  388. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  389. * CarbonLib: in CarbonLib 1.0 and later
  390. * Mac OS X: in version 10.0 and later
  391. * Windows: in qtmlClient.lib 3.0 and later
  392. */
  393. EXTERN_API( long )
  394. GetComponentTypeModSeed(OSType componentType) TWOWORDINLINE(0x702C, 0xA82A);
  395. /********************************************************
  396. * Component Instance Allocation and dispatch routines
  397. ********************************************************/
  398. /*
  399. * OpenAComponent()
  400. *
  401. * Availability:
  402. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Mac OS X: in version 10.0 and later
  405. * Windows: in qtmlClient.lib 3.0 and later
  406. */
  407. EXTERN_API( OSErr )
  408. OpenAComponent(
  409. Component aComponent,
  410. ComponentInstance * ci) TWOWORDINLINE(0x702D, 0xA82A);
  411. /*
  412. * OpenComponent()
  413. *
  414. * Availability:
  415. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  416. * CarbonLib: in CarbonLib 1.0 and later
  417. * Mac OS X: in version 10.0 and later
  418. * Windows: in qtmlClient.lib 3.0 and later
  419. */
  420. EXTERN_API( ComponentInstance )
  421. OpenComponent(Component aComponent) TWOWORDINLINE(0x7007, 0xA82A);
  422. /*
  423. * CloseComponent()
  424. *
  425. * Availability:
  426. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  427. * CarbonLib: in CarbonLib 1.0 and later
  428. * Mac OS X: in version 10.0 and later
  429. * Windows: in qtmlClient.lib 3.0 and later
  430. */
  431. EXTERN_API( OSErr )
  432. CloseComponent(ComponentInstance aComponentInstance) TWOWORDINLINE(0x7008, 0xA82A);
  433. /*
  434. * GetComponentInstanceError()
  435. *
  436. * Availability:
  437. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  438. * CarbonLib: in CarbonLib 1.0 and later
  439. * Mac OS X: in version 10.0 and later
  440. * Windows: in qtmlClient.lib 3.0 and later
  441. */
  442. EXTERN_API( OSErr )
  443. GetComponentInstanceError(ComponentInstance aComponentInstance) TWOWORDINLINE(0x700A, 0xA82A);
  444. /********************************************************
  445. * Component aliases
  446. ********************************************************/
  447. /*
  448. * ResolveComponentAlias()
  449. *
  450. * Availability:
  451. * Non-Carbon CFM: in InterfaceLib via QuickTime 3.0 and later
  452. * CarbonLib: in CarbonLib 1.0 and later
  453. * Mac OS X: in version 10.0 and later
  454. * Windows: in qtmlClient.lib 3.0 and later
  455. */
  456. EXTERN_API( Component )
  457. ResolveComponentAlias(Component aComponent) TWOWORDINLINE(0x7020, 0xA82A);
  458. /********************************************************
  459. * Component public resources and public string lists
  460. ********************************************************/
  461. /* Note: GetComponentPublicResource returns a Handle, not a resource. The caller must dispose it with DisposeHandle. */
  462. /*
  463. * GetComponentPublicResource()
  464. *
  465. * Availability:
  466. * Non-Carbon CFM: in InterfaceLib via QuickTime 4.0 and later
  467. * CarbonLib: in CarbonLib 1.0.2 and later
  468. * Mac OS X: in version 10.0 and later
  469. */
  470. EXTERN_API( OSErr )
  471. GetComponentPublicResource(
  472. Component aComponent,
  473. OSType resourceType,
  474. short resourceID,
  475. Handle * theResource) TWOWORDINLINE(0x7038, 0xA82A);
  476. /*
  477. * GetComponentPublicResourceList()
  478. *
  479. * Availability:
  480. * Non-Carbon CFM: in InterfaceLib via QuickTime 4.0 and later
  481. * CarbonLib: in CarbonLib 1.0.2 and later
  482. * Mac OS X: in version 10.0 and later
  483. */
  484. EXTERN_API( OSErr )
  485. GetComponentPublicResourceList(
  486. OSType resourceType,
  487. short resourceID,
  488. long flags,
  489. ComponentDescription * cd,
  490. GetMissingComponentResourceUPP missingProc,
  491. void * refCon,
  492. void * atomContainerPtr) TWOWORDINLINE(0x7039, 0xA82A);
  493. /*
  494. * GetComponentPublicIndString()
  495. *
  496. * Availability:
  497. * Non-Carbon CFM: in InterfaceLib via QuickTime 4.0 and later
  498. * CarbonLib: in CarbonLib 1.3 and later
  499. * Mac OS X: in version 10.0 and later
  500. */
  501. EXTERN_API( OSErr )
  502. GetComponentPublicIndString(
  503. Component aComponent,
  504. Str255 theString,
  505. short strListID,
  506. short index) TWOWORDINLINE(0x703A, 0xA82A);
  507. /********************************************************
  508. * *
  509. * CALLS MADE BY COMPONENTS *
  510. * *
  511. ********************************************************/
  512. /********************************************************
  513. * Component Management routines
  514. ********************************************************/
  515. /*
  516. * SetComponentInstanceError()
  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. * Windows: in qtmlClient.lib 3.0 and later
  523. */
  524. EXTERN_API( void )
  525. SetComponentInstanceError(
  526. ComponentInstance aComponentInstance,
  527. OSErr theError) TWOWORDINLINE(0x700B, 0xA82A);
  528. /*
  529. * GetComponentRefcon()
  530. *
  531. * Availability:
  532. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Mac OS X: in version 10.0 and later
  535. * Windows: in qtmlClient.lib 3.0 and later
  536. */
  537. EXTERN_API( long )
  538. GetComponentRefcon(Component aComponent) TWOWORDINLINE(0x7010, 0xA82A);
  539. /*
  540. * SetComponentRefcon()
  541. *
  542. * Availability:
  543. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  544. * CarbonLib: in CarbonLib 1.0 and later
  545. * Mac OS X: in version 10.0 and later
  546. * Windows: in qtmlClient.lib 3.0 and later
  547. */
  548. EXTERN_API( void )
  549. SetComponentRefcon(
  550. Component aComponent,
  551. long theRefcon) TWOWORDINLINE(0x7011, 0xA82A);
  552. /*
  553. * OpenComponentResFile()
  554. *
  555. * Availability:
  556. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  557. * CarbonLib: in CarbonLib 1.0 and later
  558. * Mac OS X: in version 10.0 and later
  559. * Windows: in qtmlClient.lib 3.0 and later
  560. */
  561. EXTERN_API( short )
  562. OpenComponentResFile(Component aComponent) TWOWORDINLINE(0x7015, 0xA82A);
  563. /*
  564. * OpenAComponentResFile()
  565. *
  566. * Availability:
  567. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  568. * CarbonLib: in CarbonLib 1.0 and later
  569. * Mac OS X: in version 10.0 and later
  570. * Windows: in qtmlClient.lib 3.0 and later
  571. */
  572. EXTERN_API( OSErr )
  573. OpenAComponentResFile(
  574. Component aComponent,
  575. short * resRef) TWOWORDINLINE(0x702F, 0xA82A);
  576. /*
  577. * CloseComponentResFile()
  578. *
  579. * Availability:
  580. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  581. * CarbonLib: in CarbonLib 1.0 and later
  582. * Mac OS X: in version 10.0 and later
  583. * Windows: in qtmlClient.lib 3.0 and later
  584. */
  585. EXTERN_API( OSErr )
  586. CloseComponentResFile(short refnum) TWOWORDINLINE(0x7018, 0xA82A);
  587. /* Note: GetComponentResource returns a Handle, not a resource. The caller must dispose it with DisposeHandle. */
  588. /*
  589. * GetComponentResource()
  590. *
  591. * Availability:
  592. * Non-Carbon CFM: in InterfaceLib via QuickTime 3.0 and later
  593. * CarbonLib: in CarbonLib 1.0 and later
  594. * Mac OS X: in version 10.0 and later
  595. * Windows: in qtmlClient.lib 3.0 and later
  596. */
  597. EXTERN_API( OSErr )
  598. GetComponentResource(
  599. Component aComponent,
  600. OSType resType,
  601. short resID,
  602. Handle * theResource) TWOWORDINLINE(0x7035, 0xA82A);
  603. /*
  604. * GetComponentIndString()
  605. *
  606. * Availability:
  607. * Non-Carbon CFM: in InterfaceLib via QuickTime 3.0 and later
  608. * CarbonLib: in CarbonLib 1.0 and later
  609. * Mac OS X: in version 10.0 and later
  610. * Windows: in qtmlClient.lib 3.0 and later
  611. */
  612. EXTERN_API( OSErr )
  613. GetComponentIndString(
  614. Component aComponent,
  615. Str255 theString,
  616. short strListID,
  617. short index) TWOWORDINLINE(0x7036, 0xA82A);
  618. /********************************************************
  619. * Component Instance Management routines
  620. ********************************************************/
  621. /*
  622. * GetComponentInstanceStorage()
  623. *
  624. * Availability:
  625. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  626. * CarbonLib: in CarbonLib 1.0 and later
  627. * Mac OS X: in version 10.0 and later
  628. * Windows: in qtmlClient.lib 3.0 and later
  629. */
  630. EXTERN_API( Handle )
  631. GetComponentInstanceStorage(ComponentInstance aComponentInstance) TWOWORDINLINE(0x700C, 0xA82A);
  632. /*
  633. * SetComponentInstanceStorage()
  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. * Windows: in qtmlClient.lib 3.0 and later
  640. */
  641. EXTERN_API( void )
  642. SetComponentInstanceStorage(
  643. ComponentInstance aComponentInstance,
  644. Handle theStorage) TWOWORDINLINE(0x700D, 0xA82A);
  645. #if CALL_NOT_IN_CARBON
  646. /*
  647. * GetComponentInstanceA5()
  648. *
  649. * Availability:
  650. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  651. * CarbonLib: not available
  652. * Mac OS X: not available
  653. * Windows: in qtmlClient.lib 3.0 and later
  654. */
  655. EXTERN_API( long )
  656. GetComponentInstanceA5(ComponentInstance aComponentInstance) TWOWORDINLINE(0x700E, 0xA82A);
  657. /*
  658. * SetComponentInstanceA5()
  659. *
  660. * Availability:
  661. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  662. * CarbonLib: not available
  663. * Mac OS X: not available
  664. * Windows: in qtmlClient.lib 3.0 and later
  665. */
  666. EXTERN_API( void )
  667. SetComponentInstanceA5(
  668. ComponentInstance aComponentInstance,
  669. long theA5) TWOWORDINLINE(0x700F, 0xA82A);
  670. #endif /* CALL_NOT_IN_CARBON */
  671. /*
  672. * CountComponentInstances()
  673. *
  674. * Availability:
  675. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  676. * CarbonLib: in CarbonLib 1.0 and later
  677. * Mac OS X: in version 10.0 and later
  678. * Windows: in qtmlClient.lib 3.0 and later
  679. */
  680. EXTERN_API( long )
  681. CountComponentInstances(Component aComponent) TWOWORDINLINE(0x7013, 0xA82A);
  682. /* useful helper routines for convenient method dispatching */
  683. /*
  684. * CallComponentFunction()
  685. *
  686. * Availability:
  687. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  688. * CarbonLib: in CarbonLib 1.0 and later
  689. * Mac OS X: in version 10.0 and later
  690. */
  691. EXTERN_API( long )
  692. CallComponentFunction(
  693. ComponentParameters * params,
  694. ComponentFunctionUPP func) TWOWORDINLINE(0x70FF, 0xA82A);
  695. /*
  696. * CallComponentFunctionWithStorage()
  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. * Windows: in qtmlClient.lib 3.0 and later
  703. */
  704. EXTERN_API( long )
  705. CallComponentFunctionWithStorage(
  706. Handle storage,
  707. ComponentParameters * params,
  708. ComponentFunctionUPP func) TWOWORDINLINE(0x70FF, 0xA82A);
  709. #if TARGET_OS_MAC && !TARGET_CPU_68K
  710. /*
  711. * CallComponentFunctionWithStorageProcInfo()
  712. *
  713. * Availability:
  714. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  715. * CarbonLib: in CarbonLib 1.0 and later
  716. * Mac OS X: in version 10.0 and later
  717. */
  718. EXTERN_API( long )
  719. CallComponentFunctionWithStorageProcInfo(
  720. Handle storage,
  721. ComponentParameters * params,
  722. ProcPtr func,
  723. ProcInfoType funcProcInfo);
  724. #else
  725. #define CallComponentFunctionWithStorageProcInfo(storage, params, func, funcProcInfo ) CallComponentFunctionWithStorage(storage, params, func)
  726. #endif /* TARGET_OS_MAC && !TARGET_CPU_68K */
  727. /*
  728. * DelegateComponentCall()
  729. *
  730. * Availability:
  731. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  732. * CarbonLib: in CarbonLib 1.0 and later
  733. * Mac OS X: in version 10.0 and later
  734. * Windows: in qtmlClient.lib 3.0 and later
  735. */
  736. EXTERN_API( long )
  737. DelegateComponentCall(
  738. ComponentParameters * originalParams,
  739. ComponentInstance ci) TWOWORDINLINE(0x7024, 0xA82A);
  740. /*
  741. * SetDefaultComponent()
  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. * Windows: in qtmlClient.lib 3.0 and later
  748. */
  749. EXTERN_API( OSErr )
  750. SetDefaultComponent(
  751. Component aComponent,
  752. short flags) TWOWORDINLINE(0x701E, 0xA82A);
  753. /*
  754. * OpenDefaultComponent()
  755. *
  756. * Availability:
  757. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  758. * CarbonLib: in CarbonLib 1.0 and later
  759. * Mac OS X: in version 10.0 and later
  760. * Windows: in qtmlClient.lib 3.0 and later
  761. */
  762. EXTERN_API( ComponentInstance )
  763. OpenDefaultComponent(
  764. OSType componentType,
  765. OSType componentSubType) TWOWORDINLINE(0x7021, 0xA82A);
  766. /*
  767. * OpenADefaultComponent()
  768. *
  769. * Availability:
  770. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  771. * CarbonLib: in CarbonLib 1.0 and later
  772. * Mac OS X: in version 10.0 and later
  773. * Windows: in qtmlClient.lib 3.0 and later
  774. */
  775. EXTERN_API( OSErr )
  776. OpenADefaultComponent(
  777. OSType componentType,
  778. OSType componentSubType,
  779. ComponentInstance * ci) TWOWORDINLINE(0x702E, 0xA82A);
  780. /*
  781. * CaptureComponent()
  782. *
  783. * Availability:
  784. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  785. * CarbonLib: in CarbonLib 1.0 and later
  786. * Mac OS X: in version 10.0 and later
  787. * Windows: in qtmlClient.lib 3.0 and later
  788. */
  789. EXTERN_API( Component )
  790. CaptureComponent(
  791. Component capturedComponent,
  792. Component capturingComponent) TWOWORDINLINE(0x701C, 0xA82A);
  793. /*
  794. * UncaptureComponent()
  795. *
  796. * Availability:
  797. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  798. * CarbonLib: in CarbonLib 1.0 and later
  799. * Mac OS X: in version 10.0 and later
  800. * Windows: in qtmlClient.lib 3.0 and later
  801. */
  802. EXTERN_API( OSErr )
  803. UncaptureComponent(Component aComponent) TWOWORDINLINE(0x701D, 0xA82A);
  804. /*
  805. * RegisterComponentResourceFile()
  806. *
  807. * Availability:
  808. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  809. * CarbonLib: in CarbonLib 1.0 and later
  810. * Mac OS X: in version 10.0 and later
  811. * Windows: in qtmlClient.lib 3.0 and later
  812. */
  813. EXTERN_API( long )
  814. RegisterComponentResourceFile(
  815. short resRefNum,
  816. short global) TWOWORDINLINE(0x7014, 0xA82A);
  817. /*
  818. * GetComponentIconSuite()
  819. *
  820. * Availability:
  821. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  822. * CarbonLib: in CarbonLib 1.0 and later
  823. * Mac OS X: in version 10.0 and later
  824. * Windows: in qtmlClient.lib 3.0 and later
  825. */
  826. EXTERN_API( OSErr )
  827. GetComponentIconSuite(
  828. Component aComponent,
  829. Handle * iconSuite) TWOWORDINLINE(0x7029, 0xA82A);
  830. /********************************************************
  831. * *
  832. * Direct calls to the Components *
  833. * *
  834. ********************************************************/
  835. /* Old style names*/
  836. /*
  837. * ComponentFunctionImplemented()
  838. *
  839. * Availability:
  840. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  841. * CarbonLib: in CarbonLib 1.0 and later
  842. * Mac OS X: in version 10.0 and later
  843. * Windows: in qtmlClient.lib 3.0 and later
  844. */
  845. EXTERN_API( long )
  846. ComponentFunctionImplemented(
  847. ComponentInstance ci,
  848. short ftnNumber) FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  849. /*
  850. * GetComponentVersion()
  851. *
  852. * Availability:
  853. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  854. * CarbonLib: in CarbonLib 1.0 and later
  855. * Mac OS X: in version 10.0 and later
  856. * Windows: in qtmlClient.lib 3.0 and later
  857. */
  858. EXTERN_API( long )
  859. GetComponentVersion(ComponentInstance ci) FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  860. /*
  861. * ComponentSetTarget()
  862. *
  863. * Availability:
  864. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  865. * CarbonLib: in CarbonLib 1.0 and later
  866. * Mac OS X: in version 10.0 and later
  867. * Windows: in qtmlClient.lib 3.0 and later
  868. */
  869. EXTERN_API( long )
  870. ComponentSetTarget(
  871. ComponentInstance ci,
  872. ComponentInstance target) FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  873. /* New style names*/
  874. /*
  875. * CallComponentOpen()
  876. *
  877. * Availability:
  878. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  879. * CarbonLib: in CarbonLib 1.0 and later
  880. * Mac OS X: in version 10.0 and later
  881. * Windows: in qtmlClient.lib 3.0 and later
  882. */
  883. EXTERN_API( ComponentResult )
  884. CallComponentOpen(
  885. ComponentInstance ci,
  886. ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFF, 0x7000, 0xA82A);
  887. /*
  888. * CallComponentClose()
  889. *
  890. * Availability:
  891. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  892. * CarbonLib: in CarbonLib 1.0 and later
  893. * Mac OS X: in version 10.0 and later
  894. * Windows: in qtmlClient.lib 3.0 and later
  895. */
  896. EXTERN_API( ComponentResult )
  897. CallComponentClose(
  898. ComponentInstance ci,
  899. ComponentInstance self) FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFE, 0x7000, 0xA82A);
  900. /*
  901. * CallComponentCanDo()
  902. *
  903. * Availability:
  904. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  905. * CarbonLib: in CarbonLib 1.0 and later
  906. * Mac OS X: in version 10.0 and later
  907. * Windows: in qtmlClient.lib 3.0 and later
  908. */
  909. EXTERN_API( ComponentResult )
  910. CallComponentCanDo(
  911. ComponentInstance ci,
  912. short ftnNumber) FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  913. /*
  914. * CallComponentVersion()
  915. *
  916. * Availability:
  917. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  918. * CarbonLib: in CarbonLib 1.0 and later
  919. * Mac OS X: in version 10.0 and later
  920. * Windows: in qtmlClient.lib 3.0 and later
  921. */
  922. EXTERN_API( ComponentResult )
  923. CallComponentVersion(ComponentInstance ci) FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  924. /*
  925. * CallComponentRegister()
  926. *
  927. * Availability:
  928. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  929. * CarbonLib: in CarbonLib 1.0 and later
  930. * Mac OS X: in version 10.0 and later
  931. * Windows: in qtmlClient.lib 3.0 and later
  932. */
  933. EXTERN_API( ComponentResult )
  934. CallComponentRegister(ComponentInstance ci) FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFB, 0x7000, 0xA82A);
  935. /*
  936. * CallComponentTarget()
  937. *
  938. * Availability:
  939. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  940. * CarbonLib: in CarbonLib 1.0 and later
  941. * Mac OS X: in version 10.0 and later
  942. * Windows: in qtmlClient.lib 3.0 and later
  943. */
  944. EXTERN_API( ComponentResult )
  945. CallComponentTarget(
  946. ComponentInstance ci,
  947. ComponentInstance target) FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  948. /*
  949. * CallComponentUnregister()
  950. *
  951. * Availability:
  952. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  953. * CarbonLib: in CarbonLib 1.0 and later
  954. * Mac OS X: in version 10.0 and later
  955. * Windows: in qtmlClient.lib 3.0 and later
  956. */
  957. EXTERN_API( ComponentResult )
  958. CallComponentUnregister(ComponentInstance ci) FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFF9, 0x7000, 0xA82A);
  959. /*
  960. * CallComponentGetMPWorkFunction()
  961. *
  962. * Availability:
  963. * Non-Carbon CFM: in InterfaceLib via QuickTime 2.5 and later
  964. * CarbonLib: in CarbonLib 1.0 and later
  965. * Mac OS X: in version 10.0 and later
  966. * Windows: in qtmlClient.lib 3.0 and later
  967. */
  968. EXTERN_API( ComponentResult )
  969. CallComponentGetMPWorkFunction(
  970. ComponentInstance ci,
  971. ComponentMPWorkFunctionUPP * workFunction,
  972. void ** refCon) FIVEWORDINLINE(0x2F3C, 0x0008, 0xFFF8, 0x7000, 0xA82A);
  973. /*
  974. * CallComponentGetPublicResource()
  975. *
  976. * Availability:
  977. * Non-Carbon CFM: in InterfaceLib via QuickTime 4.0 and later
  978. * CarbonLib: in CarbonLib 1.1 and later
  979. * Mac OS X: in version 10.0 and later
  980. */
  981. EXTERN_API( ComponentResult )
  982. CallComponentGetPublicResource(
  983. ComponentInstance ci,
  984. OSType resourceType,
  985. short resourceID,
  986. Handle * resource) FIVEWORDINLINE(0x2F3C, 0x000A, 0xFFF6, 0x7000, 0xA82A);
  987. #if !TARGET_OS_MAC
  988. /*
  989. CallComponent is used by ComponentGlue routines to manually call a component function.
  990. */
  991. #if CALL_NOT_IN_CARBON
  992. /*
  993. * CallComponent()
  994. *
  995. * Availability:
  996. * Non-Carbon CFM: not available
  997. * CarbonLib: not available
  998. * Mac OS X: not available
  999. * Windows: in qtmlClient.lib 3.0 and later
  1000. */
  1001. EXTERN_API( ComponentResult )
  1002. CallComponent(
  1003. ComponentInstance ci,
  1004. ComponentParameters * cp);
  1005. #endif /* CALL_NOT_IN_CARBON */
  1006. #endif /* !TARGET_OS_MAC */
  1007. /*
  1008. CallComponentDispatch is a CarbonLib routine that replaces CallComponent inline glue
  1009. to call a component function.
  1010. */
  1011. /*
  1012. * CallComponentDispatch()
  1013. *
  1014. * Availability:
  1015. * Non-Carbon CFM: not available
  1016. * CarbonLib: in CarbonLib 1.0 and later
  1017. * Mac OS X: in version 10.0 and later
  1018. */
  1019. EXTERN_API( ComponentResult )
  1020. CallComponentDispatch(ComponentParameters * cp);
  1021. /* UPP call backs */
  1022. /*
  1023. * NewComponentMPWorkFunctionUPP()
  1024. *
  1025. * Availability:
  1026. * Non-Carbon CFM: available as macro/inline
  1027. * CarbonLib: in CarbonLib 1.0 and later
  1028. * Mac OS X: in version 10.0 and later
  1029. */
  1030. EXTERN_API_C( ComponentMPWorkFunctionUPP )
  1031. NewComponentMPWorkFunctionUPP(ComponentMPWorkFunctionProcPtr userRoutine);
  1032. #if !OPAQUE_UPP_TYPES
  1033. enum { uppComponentMPWorkFunctionProcInfo = 0x000003F0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  1034. #ifdef __cplusplus
  1035. inline DEFINE_API_C(ComponentMPWorkFunctionUPP) NewComponentMPWorkFunctionUPP(ComponentMPWorkFunctionProcPtr userRoutine) { return (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture()); }
  1036. #else
  1037. #define NewComponentMPWorkFunctionUPP(userRoutine) (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture())
  1038. #endif
  1039. #endif
  1040. /*
  1041. * NewComponentRoutineUPP()
  1042. *
  1043. * Availability:
  1044. * Non-Carbon CFM: available as macro/inline
  1045. * CarbonLib: in CarbonLib 1.0 and later
  1046. * Mac OS X: in version 10.0 and later
  1047. */
  1048. EXTERN_API_C( ComponentRoutineUPP )
  1049. NewComponentRoutineUPP(ComponentRoutineProcPtr userRoutine);
  1050. #if !OPAQUE_UPP_TYPES
  1051. enum { uppComponentRoutineProcInfo = 0x000003F0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  1052. #ifdef __cplusplus
  1053. inline DEFINE_API_C(ComponentRoutineUPP) NewComponentRoutineUPP(ComponentRoutineProcPtr userRoutine) { return (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture()); }
  1054. #else
  1055. #define NewComponentRoutineUPP(userRoutine) (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture())
  1056. #endif
  1057. #endif
  1058. /*
  1059. * NewGetMissingComponentResourceUPP()
  1060. *
  1061. * Availability:
  1062. * Non-Carbon CFM: available as macro/inline
  1063. * CarbonLib: in CarbonLib 1.0 and later
  1064. * Mac OS X: in version 10.0 and later
  1065. */
  1066. EXTERN_API_C( GetMissingComponentResourceUPP )
  1067. NewGetMissingComponentResourceUPP(GetMissingComponentResourceProcPtr userRoutine);
  1068. #if !OPAQUE_UPP_TYPES
  1069. enum { uppGetMissingComponentResourceProcInfo = 0x0000FBE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  1070. #ifdef __cplusplus
  1071. inline DEFINE_API_C(GetMissingComponentResourceUPP) NewGetMissingComponentResourceUPP(GetMissingComponentResourceProcPtr userRoutine) { return (GetMissingComponentResourceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetMissingComponentResourceProcInfo, GetCurrentArchitecture()); }
  1072. #else
  1073. #define NewGetMissingComponentResourceUPP(userRoutine) (GetMissingComponentResourceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetMissingComponentResourceProcInfo, GetCurrentArchitecture())
  1074. #endif
  1075. #endif
  1076. /*
  1077. * DisposeComponentMPWorkFunctionUPP()
  1078. *
  1079. * Availability:
  1080. * Non-Carbon CFM: available as macro/inline
  1081. * CarbonLib: in CarbonLib 1.0 and later
  1082. * Mac OS X: in version 10.0 and later
  1083. */
  1084. EXTERN_API_C( void )
  1085. DisposeComponentMPWorkFunctionUPP(ComponentMPWorkFunctionUPP userUPP);
  1086. #if !OPAQUE_UPP_TYPES
  1087. #ifdef __cplusplus
  1088. inline DEFINE_API_C(void) DisposeComponentMPWorkFunctionUPP(ComponentMPWorkFunctionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1089. #else
  1090. #define DisposeComponentMPWorkFunctionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1091. #endif
  1092. #endif
  1093. /*
  1094. * DisposeComponentRoutineUPP()
  1095. *
  1096. * Availability:
  1097. * Non-Carbon CFM: available as macro/inline
  1098. * CarbonLib: in CarbonLib 1.0 and later
  1099. * Mac OS X: in version 10.0 and later
  1100. */
  1101. EXTERN_API_C( void )
  1102. DisposeComponentRoutineUPP(ComponentRoutineUPP userUPP);
  1103. #if !OPAQUE_UPP_TYPES
  1104. #ifdef __cplusplus
  1105. inline DEFINE_API_C(void) DisposeComponentRoutineUPP(ComponentRoutineUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1106. #else
  1107. #define DisposeComponentRoutineUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1108. #endif
  1109. #endif
  1110. /*
  1111. * DisposeGetMissingComponentResourceUPP()
  1112. *
  1113. * Availability:
  1114. * Non-Carbon CFM: available as macro/inline
  1115. * CarbonLib: in CarbonLib 1.0 and later
  1116. * Mac OS X: in version 10.0 and later
  1117. */
  1118. EXTERN_API_C( void )
  1119. DisposeGetMissingComponentResourceUPP(GetMissingComponentResourceUPP userUPP);
  1120. #if !OPAQUE_UPP_TYPES
  1121. #ifdef __cplusplus
  1122. inline DEFINE_API_C(void) DisposeGetMissingComponentResourceUPP(GetMissingComponentResourceUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1123. #else
  1124. #define DisposeGetMissingComponentResourceUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1125. #endif
  1126. #endif
  1127. /*
  1128. * InvokeComponentMPWorkFunctionUPP()
  1129. *
  1130. * Availability:
  1131. * Non-Carbon CFM: available as macro/inline
  1132. * CarbonLib: in CarbonLib 1.0 and later
  1133. * Mac OS X: in version 10.0 and later
  1134. */
  1135. EXTERN_API_C( ComponentResult )
  1136. InvokeComponentMPWorkFunctionUPP(
  1137. void * globalRefCon,
  1138. ComponentMPWorkFunctionHeaderRecordPtr header,
  1139. ComponentMPWorkFunctionUPP userUPP);
  1140. #if !OPAQUE_UPP_TYPES
  1141. #ifdef __cplusplus
  1142. inline DEFINE_API_C(ComponentResult) InvokeComponentMPWorkFunctionUPP(void * globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header, ComponentMPWorkFunctionUPP userUPP) { return (ComponentResult)CALL_TWO_PARAMETER_UPP(userUPP, uppComponentMPWorkFunctionProcInfo, globalRefCon, header); }
  1143. #else
  1144. #define InvokeComponentMPWorkFunctionUPP(globalRefCon, header, userUPP) (ComponentResult)CALL_TWO_PARAMETER_UPP((userUPP), uppComponentMPWorkFunctionProcInfo, (globalRefCon), (header))
  1145. #endif
  1146. #endif
  1147. /*
  1148. * InvokeComponentRoutineUPP()
  1149. *
  1150. * Availability:
  1151. * Non-Carbon CFM: available as macro/inline
  1152. * CarbonLib: in CarbonLib 1.0 and later
  1153. * Mac OS X: in version 10.0 and later
  1154. */
  1155. EXTERN_API_C( ComponentResult )
  1156. InvokeComponentRoutineUPP(
  1157. ComponentParameters * cp,
  1158. Handle componentStorage,
  1159. ComponentRoutineUPP userUPP);
  1160. #if !OPAQUE_UPP_TYPES
  1161. #ifdef __cplusplus
  1162. inline DEFINE_API_C(ComponentResult) InvokeComponentRoutineUPP(ComponentParameters * cp, Handle componentStorage, ComponentRoutineUPP userUPP) { return (ComponentResult)CALL_TWO_PARAMETER_UPP(userUPP, uppComponentRoutineProcInfo, cp, componentStorage); }
  1163. #else
  1164. #define InvokeComponentRoutineUPP(cp, componentStorage, userUPP) (ComponentResult)CALL_TWO_PARAMETER_UPP((userUPP), uppComponentRoutineProcInfo, (cp), (componentStorage))
  1165. #endif
  1166. #endif
  1167. /*
  1168. * InvokeGetMissingComponentResourceUPP()
  1169. *
  1170. * Availability:
  1171. * Non-Carbon CFM: available as macro/inline
  1172. * CarbonLib: in CarbonLib 1.0 and later
  1173. * Mac OS X: in version 10.0 and later
  1174. */
  1175. EXTERN_API_C( OSErr )
  1176. InvokeGetMissingComponentResourceUPP(
  1177. Component c,
  1178. OSType resType,
  1179. short resID,
  1180. void * refCon,
  1181. Handle * resource,
  1182. GetMissingComponentResourceUPP userUPP);
  1183. #if !OPAQUE_UPP_TYPES
  1184. #ifdef __cplusplus
  1185. inline DEFINE_API_C(OSErr) InvokeGetMissingComponentResourceUPP(Component c, OSType resType, short resID, void * refCon, Handle * resource, GetMissingComponentResourceUPP userUPP) { return (OSErr)CALL_FIVE_PARAMETER_UPP(userUPP, uppGetMissingComponentResourceProcInfo, c, resType, resID, refCon, resource); }
  1186. #else
  1187. #define InvokeGetMissingComponentResourceUPP(c, resType, resID, refCon, resource, userUPP) (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppGetMissingComponentResourceProcInfo, (c), (resType), (resID), (refCon), (resource))
  1188. #endif
  1189. #endif
  1190. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  1191. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  1192. #define NewComponentMPWorkFunctionProc(userRoutine) NewComponentMPWorkFunctionUPP(userRoutine)
  1193. #define NewComponentRoutineProc(userRoutine) NewComponentRoutineUPP(userRoutine)
  1194. #define NewGetMissingComponentResourceProc(userRoutine) NewGetMissingComponentResourceUPP(userRoutine)
  1195. #define CallComponentMPWorkFunctionProc(userRoutine, globalRefCon, header) InvokeComponentMPWorkFunctionUPP(globalRefCon, header, userRoutine)
  1196. #define CallComponentRoutineProc(userRoutine, cp, componentStorage) InvokeComponentRoutineUPP(cp, componentStorage, userRoutine)
  1197. #define CallGetMissingComponentResourceProc(userRoutine, c, resType, resID, refCon, resource) InvokeGetMissingComponentResourceUPP(c, resType, resID, refCon, resource, userRoutine)
  1198. #endif /* CALL_NOT_IN_CARBON */
  1199. /* ProcInfos */
  1200. /* MixedMode ProcInfo constants for component calls */
  1201. enum {
  1202. uppComponentFunctionImplementedProcInfo = 0x000002F0,
  1203. uppGetComponentVersionProcInfo = 0x000000F0,
  1204. uppComponentSetTargetProcInfo = 0x000003F0,
  1205. uppCallComponentOpenProcInfo = 0x000003F0,
  1206. uppCallComponentCloseProcInfo = 0x000003F0,
  1207. uppCallComponentCanDoProcInfo = 0x000002F0,
  1208. uppCallComponentVersionProcInfo = 0x000000F0,
  1209. uppCallComponentRegisterProcInfo = 0x000000F0,
  1210. uppCallComponentTargetProcInfo = 0x000003F0,
  1211. uppCallComponentUnregisterProcInfo = 0x000000F0,
  1212. uppCallComponentGetMPWorkFunctionProcInfo = 0x00000FF0,
  1213. uppCallComponentGetPublicResourceProcInfo = 0x00003BF0
  1214. };
  1215. #if PRAGMA_STRUCT_ALIGN
  1216. #pragma options align=reset
  1217. #elif PRAGMA_STRUCT_PACKPUSH
  1218. #pragma pack(pop)
  1219. #elif PRAGMA_STRUCT_PACK
  1220. #pragma pack()
  1221. #endif
  1222. #ifdef PRAGMA_IMPORT_OFF
  1223. #pragma import off
  1224. #elif PRAGMA_IMPORT
  1225. #pragma import reset
  1226. #endif
  1227. #ifdef __cplusplus
  1228. }
  1229. #endif
  1230. #endif /* __COMPONENTS__ */