AEDataModel.pas 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. {
  2. File: AEDataModel.p
  3. Contains: AppleEvent Data Model Interfaces.
  4. Version: Technology: Mac OS 9
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1996-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit AEDataModel;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MixedMode;
  92. {$ALIGN MAC68K}
  93. { Apple event descriptor types }
  94. const
  95. typeBoolean = $626F6F6C (* 'bool' *);
  96. typeChar = $54455854 (* 'TEXT' *);
  97. { Preferred numeric Apple event descriptor types }
  98. typeSInt16 = $73686F72 (* 'shor' *);
  99. typeSInt32 = $6C6F6E67 (* 'long' *);
  100. typeUInt32 = $6D61676E (* 'magn' *);
  101. typeSInt64 = $636F6D70 (* 'comp' *);
  102. typeIEEE32BitFloatingPoint = $73696E67 (* 'sing' *);
  103. typeIEEE64BitFloatingPoint = $646F7562 (* 'doub' *);
  104. type128BitFloatingPoint = $6C64626C (* 'ldbl' *);
  105. typeDecimalStruct = $6465636D (* 'decm' *);
  106. { Non-preferred Apple event descriptor types }
  107. typeSMInt = $73686F72 (* 'shor' *);
  108. typeShortInteger = $73686F72 (* 'shor' *);
  109. typeInteger = $6C6F6E67 (* 'long' *);
  110. typeLongInteger = $6C6F6E67 (* 'long' *);
  111. typeMagnitude = $6D61676E (* 'magn' *);
  112. typeComp = $636F6D70 (* 'comp' *);
  113. typeSMFloat = $73696E67 (* 'sing' *);
  114. typeShortFloat = $73696E67 (* 'sing' *);
  115. typeFloat = $646F7562 (* 'doub' *);
  116. typeLongFloat = $646F7562 (* 'doub' *);
  117. typeExtended = $65787465 (* 'exte' *);
  118. { More Apple event descriptor types }
  119. typeAEList = $6C697374 (* 'list' *);
  120. typeAERecord = $7265636F (* 'reco' *);
  121. typeAppleEvent = $61657674 (* 'aevt' *);
  122. typeEventRecord = $65767263 (* 'evrc' *);
  123. typeTrue = $74727565 (* 'true' *);
  124. typeFalse = $66616C73 (* 'fals' *);
  125. typeAlias = $616C6973 (* 'alis' *);
  126. typeEnumerated = $656E756D (* 'enum' *);
  127. typeType = $74797065 (* 'type' *);
  128. typeAppParameters = $61707061 (* 'appa' *);
  129. typeProperty = $70726F70 (* 'prop' *);
  130. typeFSS = $66737320 (* 'fss ' *);
  131. typeFSRef = $66737266 (* 'fsrf' *);
  132. typeFileURL = $6675726C (* 'furl' *);
  133. typeKeyword = $6B657977 (* 'keyw' *);
  134. typeSectionH = $73656374 (* 'sect' *);
  135. typeWildCard = $2A2A2A2A (* '****' *);
  136. typeApplSignature = $7369676E (* 'sign' *);
  137. typeQDRectangle = $71647274 (* 'qdrt' *);
  138. typeFixed = $66697864 (* 'fixd' *);
  139. typeProcessSerialNumber = $70736E20 (* 'psn ' *);
  140. typeApplicationURL = $6170726C (* 'aprl' *);
  141. typeNull = $6E756C6C (* 'null' *); { null or nonexistent data }
  142. {$ifc CALL_NOT_IN_CARBON}
  143. { Deprecated addressing modes under Carbon }
  144. typeSessionID = $73736964 (* 'ssid' *);
  145. typeTargetID = $74617267 (* 'targ' *);
  146. typeDispatcherID = $64737074 (* 'dspt' *);
  147. {$endc} {CALL_NOT_IN_CARBON}
  148. { Keywords for Apple event attributes }
  149. keyTransactionIDAttr = $7472616E (* 'tran' *);
  150. keyReturnIDAttr = $72746964 (* 'rtid' *);
  151. keyEventClassAttr = $6576636C (* 'evcl' *);
  152. keyEventIDAttr = $65766964 (* 'evid' *);
  153. keyAddressAttr = $61646472 (* 'addr' *);
  154. keyOptionalKeywordAttr = $6F70746B (* 'optk' *);
  155. keyTimeoutAttr = $74696D6F (* 'timo' *);
  156. keyInteractLevelAttr = $696E7465 (* 'inte' *); { this attribute is read only - will be set in AESend }
  157. keyEventSourceAttr = $65737263 (* 'esrc' *); { this attribute is read only - returned as typeShortInteger }
  158. keyMissedKeywordAttr = $6D697373 (* 'miss' *); { this attribute is read only }
  159. keyOriginalAddressAttr = $66726F6D (* 'from' *); { new in 1.0.1 }
  160. keyAcceptTimeoutAttr = $6163746D (* 'actm' *); { new for Mac OS X }
  161. { Constants used for specifying the factoring of AEDescLists. }
  162. kAEDescListFactorNone = 0;
  163. kAEDescListFactorType = 4;
  164. kAEDescListFactorTypeAndSize = 8;
  165. { Constants used creating an AppleEvent }
  166. { Constant for the returnID param of AECreateAppleEvent }
  167. kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID }
  168. { Constant for transaction IDÕs }
  169. kAnyTransactionID = 0; { no transaction is in use }
  170. { Apple event manager data types }
  171. type
  172. DescType = ResType;
  173. DescTypePtr = ^DescType;
  174. AEKeyword = FourCharCode;
  175. AEKeywordPtr = ^AEKeyword;
  176. {$ifc OPAQUE_TOOLBOX_STRUCTS}
  177. AEDataStorage = ^SInt32; { an opaque 32-bit type }
  178. AEDataStoragePtr = ^AEDataStorage; { when a var xx:AEDataStorage parameter can be nil, it is changed to xx: AEDataStoragePtr }
  179. {$elsec}
  180. AEDataStorage = Handle;
  181. {$endc} {OPAQUE_TOOLBOX_STRUCTS}
  182. AEDescPtr = ^AEDesc;
  183. AEDesc = record
  184. descriptorType: DescType;
  185. dataHandle: AEDataStorage;
  186. end;
  187. AEKeyDescPtr = ^AEKeyDesc;
  188. AEKeyDesc = record
  189. descKey: AEKeyword;
  190. descContent: AEDesc;
  191. end;
  192. { a list of AEDesc's is a special kind of AEDesc }
  193. AEDescList = AEDesc;
  194. AEDescListPtr = ^AEDescList;
  195. { AERecord is a list of keyworded AEDesc's }
  196. AERecord = AEDescList;
  197. AERecordPtr = ^AERecord;
  198. { an AEDesc which contains address data }
  199. AEAddressDesc = AEDesc;
  200. AEAddressDescPtr = ^AEAddressDesc;
  201. { an AERecord that contains an AppleEvent, and related data types }
  202. AppleEvent = AERecord;
  203. AppleEventPtr = ^AppleEvent;
  204. AEReturnID = SInt16;
  205. AETransactionID = SInt32;
  206. AEEventClass = FourCharCode;
  207. AEEventID = FourCharCode;
  208. AEArrayType = SInt8;
  209. const
  210. kAEDataArray = 0;
  211. kAEPackedArray = 1;
  212. kAEDescArray = 3;
  213. kAEKeyDescArray = 4;
  214. kAEHandleArray = 2;
  215. type
  216. AEArrayDataPtr = ^AEArrayData;
  217. AEArrayData = record
  218. case SInt16 of
  219. 0: (
  220. kAEDataArray: array [0..0] of SInt16;
  221. );
  222. 1: (
  223. kAEPackedArray: SInt8;
  224. );
  225. 2: (
  226. kAEHandleArray: array [0..0] of Handle;
  227. );
  228. 3: (
  229. kAEDescArray: array [0..0] of AEDesc;
  230. );
  231. 4: (
  232. kAEKeyDescArray: array [0..0] of AEKeyDesc;
  233. );
  234. end;
  235. AEArrayDataPointer = ^AEArrayData;
  236. AEArrayDataPointerPtr = ^AEArrayDataPointer;
  237. { *************************************************************************
  238. These constants are used by AEMach and AEInteraction APIs. They are not
  239. strictly part of the data format, but are declared here due to layering.
  240. ************************************************************************* }
  241. AESendPriority = SInt16;
  242. const
  243. kAENormalPriority = $00000000; { post message at the end of the event queue }
  244. kAEHighPriority = $00000001; { post message at the front of the event queue (same as nAttnMsg) }
  245. type
  246. AESendMode = SInt32;
  247. const
  248. kAENoReply = $00000001; { sender doesn't want a reply to event }
  249. kAEQueueReply = $00000002; { sender wants a reply but won't wait }
  250. kAEWaitReply = $00000003; { sender wants a reply and will wait }
  251. kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox }
  252. kAEWantReceipt = $00000200; { (nReturnReceipt) sender wants a receipt of message }
  253. kAENeverInteract = $00000010; { server should not interact with user }
  254. kAECanInteract = $00000020; { server may try to interact with user }
  255. kAEAlwaysInteract = $00000030; { server should always interact with user where appropriate }
  256. kAECanSwitchLayer = $00000040; { interaction may switch layer }
  257. kAEDontRecord = $00001000; { don't record this event - available only in vers 1.0.1 and greater }
  258. kAEDontExecute = $00002000; { don't send the event for recording - available only in vers 1.0.1 and greater }
  259. kAEProcessNonReplyEvents = $00008000; { allow processing of non-reply events while awaiting synchronous AppleEvent reply }
  260. { Constants for timeout durations }
  261. kAEDefaultTimeout = -1; { timeout value determined by AEM }
  262. kNoTimeOut = -2; { wait until reply comes back, however long it takes }
  263. { *************************************************************************
  264. These calls are used to set up and modify the coercion dispatch table.
  265. ************************************************************************* }
  266. type
  267. {$ifc TYPED_FUNCTION_POINTERS}
  268. AECoerceDescProcPtr = function(const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SInt32; var toDesc: AEDesc): OSErr;
  269. {$elsec}
  270. AECoerceDescProcPtr = ProcPtr;
  271. {$endc}
  272. {$ifc TYPED_FUNCTION_POINTERS}
  273. AECoercePtrProcPtr = function(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SInt32; var result: AEDesc): OSErr;
  274. {$elsec}
  275. AECoercePtrProcPtr = ProcPtr;
  276. {$endc}
  277. {$ifc OPAQUE_UPP_TYPES}
  278. AECoerceDescUPP = ^SInt32; { an opaque UPP }
  279. {$elsec}
  280. AECoerceDescUPP = UniversalProcPtr;
  281. {$endc}
  282. {$ifc OPAQUE_UPP_TYPES}
  283. AECoercePtrUPP = ^SInt32; { an opaque UPP }
  284. {$elsec}
  285. AECoercePtrUPP = UniversalProcPtr;
  286. {$endc}
  287. const
  288. uppAECoerceDescProcInfo = $00003FE0;
  289. uppAECoercePtrProcInfo = $0003FFE0;
  290. {
  291. * NewAECoerceDescUPP()
  292. *
  293. * Availability:
  294. * Non-Carbon CFM: available as macro/inline
  295. * CarbonLib: in CarbonLib 1.0 and later
  296. * Mac OS X: in version 10.0 and later
  297. }
  298. function NewAECoerceDescUPP(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP; external name '_NewAECoerceDescUPP'; { old name was NewAECoerceDescProc }
  299. {
  300. * NewAECoercePtrUPP()
  301. *
  302. * Availability:
  303. * Non-Carbon CFM: available as macro/inline
  304. * CarbonLib: in CarbonLib 1.0 and later
  305. * Mac OS X: in version 10.0 and later
  306. }
  307. function NewAECoercePtrUPP(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP; external name '_NewAECoercePtrUPP'; { old name was NewAECoercePtrProc }
  308. {
  309. * DisposeAECoerceDescUPP()
  310. *
  311. * Availability:
  312. * Non-Carbon CFM: available as macro/inline
  313. * CarbonLib: in CarbonLib 1.0 and later
  314. * Mac OS X: in version 10.0 and later
  315. }
  316. procedure DisposeAECoerceDescUPP(userUPP: AECoerceDescUPP); external name '_DisposeAECoerceDescUPP';
  317. {
  318. * DisposeAECoercePtrUPP()
  319. *
  320. * Availability:
  321. * Non-Carbon CFM: available as macro/inline
  322. * CarbonLib: in CarbonLib 1.0 and later
  323. * Mac OS X: in version 10.0 and later
  324. }
  325. procedure DisposeAECoercePtrUPP(userUPP: AECoercePtrUPP); external name '_DisposeAECoercePtrUPP';
  326. {
  327. * InvokeAECoerceDescUPP()
  328. *
  329. * Availability:
  330. * Non-Carbon CFM: available as macro/inline
  331. * CarbonLib: in CarbonLib 1.0 and later
  332. * Mac OS X: in version 10.0 and later
  333. }
  334. function InvokeAECoerceDescUPP(const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SInt32; var toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr; external name '_InvokeAECoerceDescUPP'; { old name was CallAECoerceDescProc }
  335. {
  336. * InvokeAECoercePtrUPP()
  337. *
  338. * Availability:
  339. * Non-Carbon CFM: available as macro/inline
  340. * CarbonLib: in CarbonLib 1.0 and later
  341. * Mac OS X: in version 10.0 and later
  342. }
  343. function InvokeAECoercePtrUPP(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SInt32; var result: AEDesc; userRoutine: AECoercePtrUPP): OSErr; external name '_InvokeAECoercePtrUPP'; { old name was CallAECoercePtrProc }
  344. { a AECoercionHandlerUPP is by default a AECoerceDescUPP. If you are registering a
  345. Ptr based coercion handler you will have to add a cast to AECoerceDescUPP from
  346. your AECoercePtrUPP type. A future release of the interfaces will fix this by
  347. introducing seperate Desc and Ptr coercion handler installation/remove/query routines. }
  348. type
  349. AECoercionHandlerUPP = AECoerceDescUPP;
  350. {
  351. * AEInstallCoercionHandler()
  352. *
  353. * Availability:
  354. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  355. * CarbonLib: in CarbonLib 1.0 and later
  356. * Mac OS X: in version 10.0 and later
  357. }
  358. function AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: SInt32; fromTypeIsDesc: boolean; isSysHandler: boolean): OSErr; external name '_AEInstallCoercionHandler';
  359. {
  360. * AERemoveCoercionHandler()
  361. *
  362. * Availability:
  363. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  364. * CarbonLib: in CarbonLib 1.0 and later
  365. * Mac OS X: in version 10.0 and later
  366. }
  367. function AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: boolean): OSErr; external name '_AERemoveCoercionHandler';
  368. {
  369. * AEGetCoercionHandler()
  370. *
  371. * Availability:
  372. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  373. * CarbonLib: in CarbonLib 1.0 and later
  374. * Mac OS X: in version 10.0 and later
  375. }
  376. function AEGetCoercionHandler(fromType: DescType; toType: DescType; var handler: AECoercionHandlerUPP; var handlerRefcon: SInt32; var fromTypeIsDesc: boolean; isSysHandler: boolean): OSErr; external name '_AEGetCoercionHandler';
  377. {*************************************************************************
  378. The following calls provide for a coercion interface.
  379. *************************************************************************}
  380. {
  381. * AECoercePtr()
  382. *
  383. * Availability:
  384. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  385. * CarbonLib: in CarbonLib 1.0 and later
  386. * Mac OS X: in version 10.0 and later
  387. }
  388. function AECoercePtr(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; toType: DescType; var result: AEDesc): OSErr; external name '_AECoercePtr';
  389. {
  390. * AECoerceDesc()
  391. *
  392. * Availability:
  393. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  394. * CarbonLib: in CarbonLib 1.0 and later
  395. * Mac OS X: in version 10.0 and later
  396. }
  397. function AECoerceDesc(const (*var*) theAEDesc: AEDesc; toType: DescType; var result: AEDesc): OSErr; external name '_AECoerceDesc';
  398. {*************************************************************************
  399. The following calls apply to any AEDesc. Every 'result' descriptor is
  400. created for you, so you will be responsible for memory management
  401. (including disposing) of the descriptors so created.
  402. *************************************************************************}
  403. { because AEDescs are opaque under Carbon, this AEInitializeDesc provides a
  404. 'clean' way of initializating them to be empty. }
  405. {
  406. * AEInitializeDesc()
  407. *
  408. * Availability:
  409. * Non-Carbon CFM: not available
  410. * CarbonLib: in CarbonLib 1.4 and later
  411. * Mac OS X: in version 10.0 and later
  412. }
  413. procedure AEInitializeDesc(var desc: AEDesc); external name '_AEInitializeDesc';
  414. {
  415. * AECreateDesc()
  416. *
  417. * Availability:
  418. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  419. * CarbonLib: in CarbonLib 1.0 and later
  420. * Mac OS X: in version 10.0 and later
  421. }
  422. function AECreateDesc(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; var result: AEDesc): OSErr; external name '_AECreateDesc';
  423. {
  424. * AEDisposeDesc()
  425. *
  426. * Availability:
  427. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  428. * CarbonLib: in CarbonLib 1.0 and later
  429. * Mac OS X: in version 10.0 and later
  430. }
  431. function AEDisposeDesc(var theAEDesc: AEDesc): OSErr; external name '_AEDisposeDesc';
  432. {
  433. * AEDuplicateDesc()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  437. * CarbonLib: in CarbonLib 1.0 and later
  438. * Mac OS X: in version 10.0 and later
  439. }
  440. function AEDuplicateDesc(const (*var*) theAEDesc: AEDesc; var result: AEDesc): OSErr; external name '_AEDuplicateDesc';
  441. {*************************************************************************
  442. The following calls apply to AEDescList. Since AEDescList is a subtype of
  443. AEDesc, the calls in the previous section can also be used for AEDescList.
  444. All list and array indices are 1-based. If the data was greater than
  445. maximumSize in the routines below, then actualSize will be greater than
  446. maximumSize, but only maximumSize bytes will actually be retrieved.
  447. *************************************************************************}
  448. {
  449. * AECreateList()
  450. *
  451. * Availability:
  452. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  453. * CarbonLib: in CarbonLib 1.0 and later
  454. * Mac OS X: in version 10.0 and later
  455. }
  456. function AECreateList(factoringPtr: UnivPtr; factoredSize: Size; isRecord: boolean; var resultList: AEDescList): OSErr; external name '_AECreateList';
  457. {
  458. * AECountItems()
  459. *
  460. * Availability:
  461. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  462. * CarbonLib: in CarbonLib 1.0 and later
  463. * Mac OS X: in version 10.0 and later
  464. }
  465. function AECountItems(const (*var*) theAEDescList: AEDescList; var theCount: SInt32): OSErr; external name '_AECountItems';
  466. {
  467. * AEPutPtr()
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Mac OS X: in version 10.0 and later
  473. }
  474. function AEPutPtr(var theAEDescList: AEDescList; index: SInt32; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutPtr';
  475. {
  476. * AEPutDesc()
  477. *
  478. * Availability:
  479. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  480. * CarbonLib: in CarbonLib 1.0 and later
  481. * Mac OS X: in version 10.0 and later
  482. }
  483. function AEPutDesc(var theAEDescList: AEDescList; index: SInt32; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutDesc';
  484. {
  485. * AEGetNthPtr()
  486. *
  487. * Availability:
  488. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  489. * CarbonLib: in CarbonLib 1.0 and later
  490. * Mac OS X: in version 10.0 and later
  491. }
  492. function AEGetNthPtr(const (*var*) theAEDescList: AEDescList; index: SInt32; desiredType: DescType; theAEKeywordPtr: AEKeywordPtr; typeCode: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetNthPtr';
  493. {
  494. * AEGetNthDesc()
  495. *
  496. * Availability:
  497. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  498. * CarbonLib: in CarbonLib 1.0 and later
  499. * Mac OS X: in version 10.0 and later
  500. }
  501. function AEGetNthDesc(const (*var*) theAEDescList: AEDescList; index: SInt32; desiredType: DescType; theAEKeywordPtr: AEKeywordPtr; var result: AEDesc): OSErr; external name '_AEGetNthDesc';
  502. {
  503. * AESizeOfNthItem()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Mac OS X: in version 10.0 and later
  509. }
  510. function AESizeOfNthItem(const (*var*) theAEDescList: AEDescList; index: SInt32; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfNthItem';
  511. {
  512. * AEGetArray()
  513. *
  514. * Availability:
  515. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  516. * CarbonLib: in CarbonLib 1.0 and later
  517. * Mac OS X: in version 10.0 and later
  518. }
  519. function AEGetArray(const (*var*) theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; var itemType: DescType; var itemSize: Size; var itemCount: SInt32): OSErr; external name '_AEGetArray';
  520. {
  521. * AEPutArray()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. }
  528. function AEPutArray(var theAEDescList: AEDescList; arrayType: AEArrayType; const (*var*) arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: SInt32): OSErr; external name '_AEPutArray';
  529. {
  530. * AEDeleteItem()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. }
  537. function AEDeleteItem(var theAEDescList: AEDescList; index: SInt32): OSErr; external name '_AEDeleteItem';
  538. {*************************************************************************
  539. The following calls apply to AERecord. Since AERecord is a subtype of
  540. AEDescList, the calls in the previous sections can also be used for
  541. AERecord an AERecord can be created by using AECreateList with isRecord
  542. set to true.
  543. *************************************************************************}
  544. {************************************************************************
  545. AERecords can have an abitrary descriptorType. This allows you to
  546. check if desc is truly an AERecord
  547. ***********************************************************************}
  548. {
  549. * AECheckIsRecord()
  550. *
  551. * Availability:
  552. * Non-Carbon CFM: not available
  553. * CarbonLib: in CarbonLib 1.4 and later
  554. * Mac OS X: in version 10.0 and later
  555. }
  556. function AECheckIsRecord(const (*var*) theDesc: AEDesc): boolean; external name '_AECheckIsRecord';
  557. {
  558. Note: none of the ÒkeyÓ calls were available in the PowerPC 7.x IntefaceLib.
  559. In C, a #define is used to map ÒkeyÓ calls to ÒparamÓ calls. In pascal
  560. this mapping is done in externally linked glue code.
  561. }
  562. {$ifc CALL_NOT_IN_CARBON}
  563. {
  564. * AEPutKeyPtr()
  565. *
  566. * Availability:
  567. * Non-Carbon CFM: not available
  568. * CarbonLib: not available
  569. * Mac OS X: not available
  570. }
  571. function AEPutKeyPtr(var theAERecord: AERecord; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutKeyPtr';
  572. {
  573. * AEPutKeyDesc()
  574. *
  575. * Availability:
  576. * Non-Carbon CFM: not available
  577. * CarbonLib: not available
  578. * Mac OS X: not available
  579. }
  580. function AEPutKeyDesc(var theAERecord: AERecord; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutKeyDesc';
  581. {
  582. * AEGetKeyPtr()
  583. *
  584. * Availability:
  585. * Non-Carbon CFM: not available
  586. * CarbonLib: not available
  587. * Mac OS X: not available
  588. }
  589. function AEGetKeyPtr(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: UnivPtr; maximumSize: Size; var actualSize: Size): OSErr; external name '_AEGetKeyPtr';
  590. {
  591. * AEGetKeyDesc()
  592. *
  593. * Availability:
  594. * Non-Carbon CFM: not available
  595. * CarbonLib: not available
  596. * Mac OS X: not available
  597. }
  598. function AEGetKeyDesc(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetKeyDesc';
  599. {
  600. * AESizeOfKeyDesc()
  601. *
  602. * Availability:
  603. * Non-Carbon CFM: not available
  604. * CarbonLib: not available
  605. * Mac OS X: not available
  606. }
  607. function AESizeOfKeyDesc(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; var typeCode: DescType; var dataSize: Size): OSErr; external name '_AESizeOfKeyDesc';
  608. {
  609. * AEDeleteKeyDesc()
  610. *
  611. * Availability:
  612. * Non-Carbon CFM: not available
  613. * CarbonLib: not available
  614. * Mac OS X: not available
  615. }
  616. function AEDeleteKeyDesc(var theAERecord: AERecord; theAEKeyword: AEKeyword): OSErr; external name '_AEDeleteKeyDesc';
  617. {$endc} {CALL_NOT_IN_CARBON}
  618. {*************************************************************************
  619. The following calls create and manipulate the AppleEvent data type.
  620. *************************************************************************}
  621. {
  622. * AECreateAppleEvent()
  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. }
  629. function AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; const (*var*) target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; var result: AppleEvent): OSErr; external name '_AECreateAppleEvent';
  630. {*************************************************************************
  631. The following calls are used to pack and unpack parameters from records
  632. of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  633. in the previous sections can also be used for variables of type
  634. AppleEvent. The next six calls are in fact identical to the six calls
  635. for AERecord.
  636. *************************************************************************}
  637. {
  638. * AEPutParamPtr()
  639. *
  640. * Availability:
  641. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  642. * CarbonLib: in CarbonLib 1.0 and later
  643. * Mac OS X: in version 10.0 and later
  644. }
  645. function AEPutParamPtr(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutParamPtr';
  646. {
  647. * AEPutParamDesc()
  648. *
  649. * Availability:
  650. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  651. * CarbonLib: in CarbonLib 1.0 and later
  652. * Mac OS X: in version 10.0 and later
  653. }
  654. function AEPutParamDesc(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutParamDesc';
  655. {
  656. * AEGetParamPtr()
  657. *
  658. * Availability:
  659. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  660. * CarbonLib: in CarbonLib 1.0 and later
  661. * Mac OS X: in version 10.0 and later
  662. }
  663. function AEGetParamPtr(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; actualType: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetParamPtr';
  664. {
  665. * AEGetParamDesc()
  666. *
  667. * Availability:
  668. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  669. * CarbonLib: in CarbonLib 1.0 and later
  670. * Mac OS X: in version 10.0 and later
  671. }
  672. function AEGetParamDesc(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetParamDesc';
  673. {
  674. * AESizeOfParam()
  675. *
  676. * Availability:
  677. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  678. * CarbonLib: in CarbonLib 1.0 and later
  679. * Mac OS X: in version 10.0 and later
  680. }
  681. function AESizeOfParam(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfParam';
  682. {
  683. * AEDeleteParam()
  684. *
  685. * Availability:
  686. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  687. * CarbonLib: in CarbonLib 1.0 and later
  688. * Mac OS X: in version 10.0 and later
  689. }
  690. function AEDeleteParam(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr; external name '_AEDeleteParam';
  691. {*************************************************************************
  692. The following calls also apply to type AppleEvent. Message attributes are
  693. far more restricted, and can only be accessed through the following 5
  694. calls. The various list and record routines cannot be used to access the
  695. attributes of an event.
  696. *************************************************************************}
  697. {
  698. * AEGetAttributePtr()
  699. *
  700. * Availability:
  701. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  702. * CarbonLib: in CarbonLib 1.0 and later
  703. * Mac OS X: in version 10.0 and later
  704. }
  705. function AEGetAttributePtr(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; typeCode: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetAttributePtr';
  706. {
  707. * AEGetAttributeDesc()
  708. *
  709. * Availability:
  710. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  711. * CarbonLib: in CarbonLib 1.0 and later
  712. * Mac OS X: in version 10.0 and later
  713. }
  714. function AEGetAttributeDesc(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetAttributeDesc';
  715. {
  716. * AESizeOfAttribute()
  717. *
  718. * Availability:
  719. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  720. * CarbonLib: in CarbonLib 1.0 and later
  721. * Mac OS X: in version 10.0 and later
  722. }
  723. function AESizeOfAttribute(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfAttribute';
  724. {
  725. * AEPutAttributePtr()
  726. *
  727. * Availability:
  728. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  729. * CarbonLib: in CarbonLib 1.0 and later
  730. * Mac OS X: in version 10.0 and later
  731. }
  732. function AEPutAttributePtr(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutAttributePtr';
  733. {
  734. * AEPutAttributeDesc()
  735. *
  736. * Availability:
  737. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  738. * CarbonLib: in CarbonLib 1.0 and later
  739. * Mac OS X: in version 10.0 and later
  740. }
  741. function AEPutAttributeDesc(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutAttributeDesc';
  742. {*************************************************************************
  743. AppleEvent Serialization Support
  744. AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
  745. These calls will work for all AppleEvent data types and between different
  746. versions of the OS (including between Mac OS 9 and X)
  747. Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
  748. themselves may not be reliably flattened for storage.
  749. *************************************************************************}
  750. {
  751. AEFlattenDesc
  752. Returns the amount of buffer space needed to flatten the
  753. AEDesc. Call this before AEFlattenDesc to make sure your
  754. buffer has enough room for the operation.
  755. }
  756. {
  757. * AESizeOfFlattenedDesc()
  758. *
  759. * Availability:
  760. * Non-Carbon CFM: not available
  761. * CarbonLib: in CarbonLib 1.4 and later
  762. * Mac OS X: in version 10.0 and later
  763. }
  764. function AESizeOfFlattenedDesc(const (*var*) theAEDesc: AEDesc): Size; external name '_AESizeOfFlattenedDesc';
  765. {
  766. AEFlattenDesc
  767. Fills a buffer with a flattened representation of the
  768. AEDesc and returns the amount of buffer used in actualSize.
  769. If bufferSize was too small it returns errAEBufferTooSmall
  770. (-1741) and does not fill in any of the buffer. The resulting
  771. buffer is only useful with an AEUnflattenDesc call.
  772. Note: if you pass a NULL buffer pointer it returns noErr but
  773. fills in the actualSize field anyway.
  774. }
  775. {
  776. * AEFlattenDesc()
  777. *
  778. * Availability:
  779. * Non-Carbon CFM: not available
  780. * CarbonLib: in CarbonLib 1.4 and later
  781. * Mac OS X: in version 10.0 and later
  782. }
  783. function AEFlattenDesc(const (*var*) theAEDesc: AEDesc; buffer: Ptr; bufferSize: Size; var actualSize: Size): OSStatus; external name '_AEFlattenDesc';
  784. {
  785. AEUnflattenDesc
  786. Allocates an AEDesc (given a Null Desc) given a flattened
  787. data buffer. It assumes it was given a good buffer filled
  788. in by AEFlattenDesc. It returns paramErr if it discovers
  789. something fishy about the buffer.
  790. }
  791. {
  792. * AEUnflattenDesc()
  793. *
  794. * Availability:
  795. * Non-Carbon CFM: not available
  796. * CarbonLib: in CarbonLib 1.4 and later
  797. * Mac OS X: in version 10.0 and later
  798. }
  799. function AEUnflattenDesc(buffer: Ptr; var result: AEDesc): OSStatus; external name '_AEUnflattenDesc';
  800. {*************************************************************************
  801. The following calls are necessary to deal with opaque data in AEDescs, because the
  802. traditional way of dealing with a basic AEDesc has been to dereference the dataHandle
  803. directly. This is not supported under Carbon.
  804. *************************************************************************}
  805. {$ifc ACCESSOR_CALLS_ARE_FUNCTIONS}
  806. {
  807. AEGetDescData no longer supports automatic coercion. If you'd like to
  808. coerce the descriptor use AECoerceDesc.
  809. }
  810. {
  811. * AEGetDescData()
  812. *
  813. * Availability:
  814. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  815. * CarbonLib: in CarbonLib 1.0 and later
  816. * Mac OS X: in version 10.0 and later
  817. }
  818. function AEGetDescData(const (*var*) theAEDesc: AEDesc; dataPtr: UnivPtr; maximumSize: Size): OSErr; external name '_AEGetDescData';
  819. {
  820. * AEGetDescDataSize()
  821. *
  822. * Availability:
  823. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  824. * CarbonLib: in CarbonLib 1.0 and later
  825. * Mac OS X: in version 10.0 and later
  826. }
  827. function AEGetDescDataSize(const (*var*) theAEDesc: AEDesc): Size; external name '_AEGetDescDataSize';
  828. {
  829. * AEReplaceDescData()
  830. *
  831. * Availability:
  832. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  833. * CarbonLib: in CarbonLib 1.0 and later
  834. * Mac OS X: in version 10.0 and later
  835. }
  836. function AEReplaceDescData(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; var theAEDesc: AEDesc): OSErr; external name '_AEReplaceDescData';
  837. {$endc} {ACCESSOR_CALLS_ARE_FUNCTIONS}
  838. {*************************************************************************
  839. A AEEventHandler is installed to process an AppleEvent
  840. *************************************************************************}
  841. type
  842. {$ifc TYPED_FUNCTION_POINTERS}
  843. AEEventHandlerProcPtr = function(const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SInt32): OSErr;
  844. {$elsec}
  845. AEEventHandlerProcPtr = ProcPtr;
  846. {$endc}
  847. {$ifc OPAQUE_UPP_TYPES}
  848. AEEventHandlerUPP = ^SInt32; { an opaque UPP }
  849. {$elsec}
  850. AEEventHandlerUPP = UniversalProcPtr;
  851. {$endc}
  852. const
  853. uppAEEventHandlerProcInfo = $00000FE0;
  854. {
  855. * NewAEEventHandlerUPP()
  856. *
  857. * Availability:
  858. * Non-Carbon CFM: available as macro/inline
  859. * CarbonLib: in CarbonLib 1.0 and later
  860. * Mac OS X: in version 10.0 and later
  861. }
  862. function NewAEEventHandlerUPP(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP; external name '_NewAEEventHandlerUPP'; { old name was NewAEEventHandlerProc }
  863. {
  864. * DisposeAEEventHandlerUPP()
  865. *
  866. * Availability:
  867. * Non-Carbon CFM: available as macro/inline
  868. * CarbonLib: in CarbonLib 1.0 and later
  869. * Mac OS X: in version 10.0 and later
  870. }
  871. procedure DisposeAEEventHandlerUPP(userUPP: AEEventHandlerUPP); external name '_DisposeAEEventHandlerUPP';
  872. {
  873. * InvokeAEEventHandlerUPP()
  874. *
  875. * Availability:
  876. * Non-Carbon CFM: available as macro/inline
  877. * CarbonLib: in CarbonLib 1.0 and later
  878. * Mac OS X: in version 10.0 and later
  879. }
  880. function InvokeAEEventHandlerUPP(const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SInt32; userRoutine: AEEventHandlerUPP): OSErr; external name '_InvokeAEEventHandlerUPP'; { old name was CallAEEventHandlerProc }
  881. {$ALIGN MAC68K}
  882. end.