AEDataModel.pas 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  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' *); { Deprecated, use typeUTF8Text instead. }
  97. { The preferred unicode text types. In both cases, there is no explicit null termination or length byte. }
  98. typeUTF16ExternalRepresentation = $75743136 (* 'ut16' *); { big-endian 16 bit unicode with optional byte-order-mark, or little-endian 16 bit unicode with required byte-order-mark. }
  99. typeUTF8Text = $75746638 (* 'utf8' *); { 8 bit unicode }
  100. { Preferred numeric Apple event descriptor types }
  101. typeSInt16 = $73686F72 (* 'shor' *);
  102. typeSInt32 = $6C6F6E67 (* 'long' *);
  103. typeUInt32 = $6D61676E (* 'magn' *);
  104. typeSInt64 = $636F6D70 (* 'comp' *);
  105. typeIEEE32BitFloatingPoint = $73696E67 (* 'sing' *);
  106. typeIEEE64BitFloatingPoint = $646F7562 (* 'doub' *);
  107. type128BitFloatingPoint = $6C64626C (* 'ldbl' *);
  108. typeDecimalStruct = $6465636D (* 'decm' *);
  109. { Non-preferred Apple event descriptor types }
  110. typeSMInt = $73686F72 (* 'shor' *);
  111. typeShortInteger = $73686F72 (* 'shor' *);
  112. typeInteger = $6C6F6E67 (* 'long' *);
  113. typeLongInteger = $6C6F6E67 (* 'long' *);
  114. typeMagnitude = $6D61676E (* 'magn' *);
  115. typeComp = $636F6D70 (* 'comp' *);
  116. typeSMFloat = $73696E67 (* 'sing' *);
  117. typeShortFloat = $73696E67 (* 'sing' *);
  118. typeFloat = $646F7562 (* 'doub' *);
  119. typeLongFloat = $646F7562 (* 'doub' *);
  120. typeExtended = $65787465 (* 'exte' *);
  121. { More Apple event descriptor types }
  122. typeAEList = $6C697374 (* 'list' *);
  123. typeAERecord = $7265636F (* 'reco' *);
  124. typeAppleEvent = $61657674 (* 'aevt' *);
  125. typeEventRecord = $65767263 (* 'evrc' *);
  126. typeTrue = $74727565 (* 'true' *);
  127. typeFalse = $66616C73 (* 'fals' *);
  128. typeAlias = $616C6973 (* 'alis' *);
  129. typeEnumerated = $656E756D (* 'enum' *);
  130. typeType = $74797065 (* 'type' *);
  131. typeAppParameters = $61707061 (* 'appa' *);
  132. typeProperty = $70726F70 (* 'prop' *);
  133. typeFSS = $66737320 (* 'fss ' *);
  134. typeFSRef = $66737266 (* 'fsrf' *);
  135. typeFileURL = $6675726C (* 'furl' *);
  136. typeKeyword = $6B657977 (* 'keyw' *);
  137. typeSectionH = $73656374 (* 'sect' *);
  138. typeWildCard = $2A2A2A2A (* '****' *);
  139. typeApplSignature = $7369676E (* 'sign' *);
  140. typeQDRectangle = $71647274 (* 'qdrt' *);
  141. typeFixed = $66697864 (* 'fixd' *);
  142. typeProcessSerialNumber = $70736E20 (* 'psn ' *);
  143. typeApplicationURL = $6170726C (* 'aprl' *);
  144. typeNull = $6E756C6C (* 'null' *); { null or nonexistent data }
  145. {$ifc CALL_NOT_IN_CARBON}
  146. { Deprecated addressing modes under Carbon }
  147. typeSessionID = $73736964 (* 'ssid' *);
  148. typeTargetID = $74617267 (* 'targ' *);
  149. typeDispatcherID = $64737074 (* 'dspt' *);
  150. {$endc} {CALL_NOT_IN_CARBON}
  151. { New addressing modes for MacOS X }
  152. typeKernelProcessID = $6B706964 (* 'kpid' *);
  153. typeMachPort = $706F7274 (* 'port' *);
  154. { Targeting applications by bundle ID is only available in Mac OS X 10.3 or later. }
  155. typeApplicationBundleID = $62756E64 (* 'bund' *);
  156. { Keywords for Apple event attributes }
  157. keyTransactionIDAttr = $7472616E (* 'tran' *);
  158. keyReturnIDAttr = $72746964 (* 'rtid' *);
  159. keyEventClassAttr = $6576636C (* 'evcl' *);
  160. keyEventIDAttr = $65766964 (* 'evid' *);
  161. keyAddressAttr = $61646472 (* 'addr' *);
  162. keyOptionalKeywordAttr = $6F70746B (* 'optk' *);
  163. keyTimeoutAttr = $74696D6F (* 'timo' *);
  164. keyInteractLevelAttr = $696E7465 (* 'inte' *); { this attribute is read only - will be set in AESend }
  165. keyEventSourceAttr = $65737263 (* 'esrc' *); { this attribute is read only - returned as typeShortInteger }
  166. keyMissedKeywordAttr = $6D697373 (* 'miss' *); { this attribute is read only }
  167. keyOriginalAddressAttr = $66726F6D (* 'from' *); { new in 1.0.1 }
  168. keyAcceptTimeoutAttr = $6163746D (* 'actm' *); { new for Mac OS X }
  169. keyReplyRequestedAttr = $72657071 (* 'repq' *); { Was a reply requested for this event - returned as typeBoolean }
  170. { These bits are specified in the keyXMLDebuggingAttr (an SInt32) }
  171. kAEDebugPOSTHeader = 1 shl 0; { headers of the HTTP post we sent - typeChar }
  172. kAEDebugReplyHeader = 1 shl 1; { headers returned by the server }
  173. kAEDebugXMLRequest = 1 shl 2; { the XML request we sent }
  174. kAEDebugXMLResponse = 1 shl 3; { the XML reply from the server }
  175. kAEDebugXMLDebugAll = $FFFFFFFF; { everything! }
  176. { These values can be added as a parameter to the direct object of a
  177. SOAP message to specify the serialization schema. If not
  178. specified, kSOAP1999Schema is the default. These should be added as
  179. typeType. }
  180. kSOAP1999Schema = $73733939 (* 'ss99' *);
  181. kSOAP2001Schema = $73733031 (* 'ss01' *);
  182. { outgoing event attributes }
  183. keyUserNameAttr = $756E616D (* 'unam' *);
  184. keyUserPasswordAttr = $70617373 (* 'pass' *); { not sent with the event }
  185. keyDisableAuthenticationAttr = $61757468 (* 'auth' *); { When present and with a non zero value (that is, false, or integer 0), }
  186. { AESend will not authenticate the user. If not present, or with a non-zero}
  187. { value, AESend will prompt for authentication information from the user if the interaction level allows. }
  188. keyXMLDebuggingAttr = $78646267 (* 'xdbg' *); { a bitfield of specifying which XML debugging data is to be returned with the event }
  189. { Event class / id }
  190. kAERPCClass = $72706320 (* 'rpc ' *); { for outgoing XML events }
  191. kAEXMLRPCScheme = $52504332 (* 'RPC2' *); { event ID: event should be sent to an XMLRPC endpoint }
  192. kAESOAPScheme = $534F4150 (* 'SOAP' *); { event ID: event should be sent to a SOAP endpoint }
  193. kAESharedScriptHandler = $77736370 (* 'wscp' *); { event ID: handler for incoming XML requests }
  194. { these parameters exist as part of the direct object of the event for both incoming and outgoing requests }
  195. keyRPCMethodName = $6D657468 (* 'meth' *); { name of the method to call }
  196. keyRPCMethodParam = $7061726D (* 'parm' *); { the list (or structure) of parameters }
  197. keyRPCMethodParamOrder = $2F6F7264 (* '/ord' *); { if a structure, the order of parameters (a list) }
  198. { when keyXMLDebugginAttr so specifies, these additional parameters will be part of the reply. }
  199. keyAEPOSTHeaderData = $70686564 (* 'phed' *); { what we sent to the server }
  200. keyAEReplyHeaderData = $72686564 (* 'rhed' *); { what the server sent to us }
  201. keyAEXMLRequestData = $78726571 (* 'xreq' *); { what we sent to the server }
  202. keyAEXMLReplyData = $78726570 (* 'xrep' *); { what the server sent to us }
  203. { additional parameters that can be specified in the direct object of the event }
  204. keyAdditionalHTTPHeaders = $61686564 (* 'ahed' *); { list of additional HTTP headers (a list of 2 element lists) }
  205. keySOAPAction = $73616374 (* 'sact' *); { the SOAPAction header (required for SOAP messages) }
  206. keySOAPMethodNameSpace = $6D737063 (* 'mspc' *); { Optional namespace (defaults to m:) }
  207. keySOAPMethodNameSpaceURI = $6D737075 (* 'mspu' *); { Required namespace URI }
  208. keySOAPSchemaVersion = $73736368 (* 'ssch' *); { Optional XML Schema version, defaults to kSOAP1999Schama }
  209. {
  210. When serializing AERecords as SOAP structures, it is possible
  211. to specify the namespace and type of the structure. To do this,
  212. add a keySOAPStructureMetaData record to the top level of the
  213. record to be serialized. If present, this will be used to specify
  214. the structure namespace. This will produce a structure elment that
  215. looks like:
  216. <myStruct
  217. xmlns:myNamespace="http://myUri.org/xsd",
  218. xsi:type="myNamespace:MyStructType">
  219. ...
  220. </myStruct>
  221. }
  222. keySOAPStructureMetaData = $2F736D64 (* '/smd' *);
  223. keySOAPSMDNamespace = $73736E73 (* 'ssns' *); { "myNamespace"}
  224. keySOAPSMDNamespaceURI = $73736E75 (* 'ssnu' *); { "http://myUri.org/xsd"}
  225. keySOAPSMDType = $73737470 (* 'sstp' *); { "MyStructType"}
  226. {
  227. * Web Services Proxy support. Available only on Mac OS X 10.2 or later.
  228. * These constants should be added as attributes on the event that is
  229. * being sent (not part of the direct object.)
  230. }
  231. { Automatically configure the proxy based on System Configuration }
  232. kAEUseHTTPProxyAttr = $78757072 (* 'xupr' *); { a typeBoolean. Defaults to true.}
  233. { manually specify the proxy host and port. }
  234. kAEHTTPProxyPortAttr = $78687470 (* 'xhtp' *); { a typeSInt32}
  235. kAEHTTPProxyHostAttr = $78687468 (* 'xhth' *); { a typeChar}
  236. {
  237. * Web Services SOCKS support. kAEUseSocksAttr is a boolean that
  238. * specifies whether to automatically configure SOCKS proxies by
  239. * querying System Configuration.
  240. }
  241. kAESocks4Protocol = 4;
  242. kAESocks5Protocol = 5;
  243. kAEUseSocksAttr = $78736373 (* 'xscs' *); { a typeBoolean. Defaults to true.}
  244. { This attribute specifies a specific SOCKS protocol to be used }
  245. kAESocksProxyAttr = $78736F6B (* 'xsok' *); { a typeSInt32}
  246. { if version >= 4 }
  247. kAESocksHostAttr = $78736873 (* 'xshs' *); { a typeChar}
  248. kAESocksPortAttr = $78736870 (* 'xshp' *); { a typeSInt32}
  249. kAESocksUserAttr = $78736875 (* 'xshu' *); { a typeChar}
  250. { if version >= 5 }
  251. kAESocksPasswordAttr = $78736877 (* 'xshw' *); { a typeChar}
  252. { Constants used for specifying the factoring of AEDescLists. }
  253. kAEDescListFactorNone = 0;
  254. kAEDescListFactorType = 4;
  255. kAEDescListFactorTypeAndSize = 8;
  256. { Constants used creating an AppleEvent }
  257. { Constant for the returnID param of AECreateAppleEvent }
  258. kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID }
  259. { Constant for transaction IDÕs }
  260. kAnyTransactionID = 0; { no transaction is in use }
  261. { Apple event manager data types }
  262. type
  263. DescType = ResType;
  264. DescTypePtr = ^DescType;
  265. AEKeyword = FourCharCode;
  266. AEKeywordPtr = ^AEKeyword;
  267. {$ifc OPAQUE_TOOLBOX_STRUCTS}
  268. AEDataStorage = ^SInt32; { an opaque 32-bit type }
  269. AEDataStoragePtr = ^AEDataStorage; { when a var xx:AEDataStorage parameter can be nil, it is changed to xx: AEDataStoragePtr }
  270. {$elsec}
  271. AEDataStorage = Handle;
  272. {$endc} {OPAQUE_TOOLBOX_STRUCTS}
  273. AEDescPtr = ^AEDesc;
  274. AEDesc = record
  275. descriptorType: DescType;
  276. dataHandle: AEDataStorage;
  277. end;
  278. AEKeyDescPtr = ^AEKeyDesc;
  279. AEKeyDesc = record
  280. descKey: AEKeyword;
  281. descContent: AEDesc;
  282. end;
  283. { a list of AEDesc's is a special kind of AEDesc }
  284. AEDescList = AEDesc;
  285. AEDescListPtr = ^AEDescList;
  286. { AERecord is a list of keyworded AEDesc's }
  287. AERecord = AEDescList;
  288. AERecordPtr = ^AERecord;
  289. { an AEDesc which contains address data }
  290. AEAddressDesc = AEDesc;
  291. AEAddressDescPtr = ^AEAddressDesc;
  292. { an AERecord that contains an AppleEvent, and related data types }
  293. AppleEvent = AERecord;
  294. AppleEventPtr = ^AppleEvent;
  295. AEReturnID = SInt16;
  296. AETransactionID = SInt32;
  297. AEEventClass = FourCharCode;
  298. AEEventID = FourCharCode;
  299. AEArrayType = SInt8;
  300. const
  301. kAEDataArray = 0;
  302. kAEPackedArray = 1;
  303. kAEDescArray = 3;
  304. kAEKeyDescArray = 4;
  305. kAEHandleArray = 2;
  306. type
  307. AEArrayDataPtr = ^AEArrayData;
  308. AEArrayData = record
  309. case SInt16 of
  310. 0: (
  311. kAEDataArray: array [0..0] of SInt16;
  312. );
  313. 1: (
  314. kAEPackedArray: SInt8;
  315. );
  316. 2: (
  317. kAEHandleArray: array [0..0] of Handle;
  318. );
  319. 3: (
  320. kAEDescArray: array [0..0] of AEDesc;
  321. );
  322. 4: (
  323. kAEKeyDescArray: array [0..0] of AEKeyDesc;
  324. );
  325. end;
  326. AEArrayDataPointer = ^AEArrayData;
  327. AEArrayDataPointerPtr = ^AEArrayDataPointer;
  328. { *************************************************************************
  329. These constants are used by AEMach and AEInteraction APIs. They are not
  330. strictly part of the data format, but are declared here due to layering.
  331. ************************************************************************* }
  332. AESendPriority = SInt16;
  333. const
  334. kAENormalPriority = $00000000; { post message at the end of the event queue }
  335. kAEHighPriority = $00000001; { post message at the front of the event queue (same as nAttnMsg) }
  336. type
  337. AESendMode = SInt32;
  338. const
  339. kAENoReply = $00000001; { sender doesn't want a reply to event }
  340. kAEQueueReply = $00000002; { sender wants a reply but won't wait }
  341. kAEWaitReply = $00000003; { sender wants a reply and will wait }
  342. kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox }
  343. kAEWantReceipt = $00000200; { (nReturnReceipt) sender wants a receipt of message }
  344. kAENeverInteract = $00000010; { server should not interact with user }
  345. kAECanInteract = $00000020; { server may try to interact with user }
  346. kAEAlwaysInteract = $00000030; { server should always interact with user where appropriate }
  347. kAECanSwitchLayer = $00000040; { interaction may switch layer }
  348. kAEDontRecord = $00001000; { don't record this event - available only in vers 1.0.1 and greater }
  349. kAEDontExecute = $00002000; { don't send the event for recording - available only in vers 1.0.1 and greater }
  350. kAEProcessNonReplyEvents = $00008000; { allow processing of non-reply events while awaiting synchronous AppleEvent reply }
  351. { Constants for timeout durations }
  352. kAEDefaultTimeout = -1; { timeout value determined by AEM }
  353. kNoTimeOut = -2; { wait until reply comes back, however long it takes }
  354. { *************************************************************************
  355. These calls are used to set up and modify the coercion dispatch table.
  356. ************************************************************************* }
  357. type
  358. {$ifc TYPED_FUNCTION_POINTERS}
  359. AECoerceDescProcPtr = function(const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SInt32; var toDesc: AEDesc): OSErr;
  360. {$elsec}
  361. AECoerceDescProcPtr = ProcPtr;
  362. {$endc}
  363. {$ifc TYPED_FUNCTION_POINTERS}
  364. AECoercePtrProcPtr = function(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SInt32; var result: AEDesc): OSErr;
  365. {$elsec}
  366. AECoercePtrProcPtr = ProcPtr;
  367. {$endc}
  368. {$ifc OPAQUE_UPP_TYPES}
  369. AECoerceDescUPP = ^SInt32; { an opaque UPP }
  370. {$elsec}
  371. AECoerceDescUPP = UniversalProcPtr;
  372. {$endc}
  373. {$ifc OPAQUE_UPP_TYPES}
  374. AECoercePtrUPP = ^SInt32; { an opaque UPP }
  375. {$elsec}
  376. AECoercePtrUPP = UniversalProcPtr;
  377. {$endc}
  378. const
  379. uppAECoerceDescProcInfo = $00003FE0;
  380. uppAECoercePtrProcInfo = $0003FFE0;
  381. {
  382. * NewAECoerceDescUPP()
  383. *
  384. * Availability:
  385. * Non-Carbon CFM: available as macro/inline
  386. * CarbonLib: in CarbonLib 1.0 and later
  387. * Mac OS X: in version 10.0 and later
  388. }
  389. function NewAECoerceDescUPP(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP; external name '_NewAECoerceDescUPP'; { old name was NewAECoerceDescProc }
  390. {
  391. * NewAECoercePtrUPP()
  392. *
  393. * Availability:
  394. * Non-Carbon CFM: available as macro/inline
  395. * CarbonLib: in CarbonLib 1.0 and later
  396. * Mac OS X: in version 10.0 and later
  397. }
  398. function NewAECoercePtrUPP(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP; external name '_NewAECoercePtrUPP'; { old name was NewAECoercePtrProc }
  399. {
  400. * DisposeAECoerceDescUPP()
  401. *
  402. * Availability:
  403. * Non-Carbon CFM: available as macro/inline
  404. * CarbonLib: in CarbonLib 1.0 and later
  405. * Mac OS X: in version 10.0 and later
  406. }
  407. procedure DisposeAECoerceDescUPP(userUPP: AECoerceDescUPP); external name '_DisposeAECoerceDescUPP';
  408. {
  409. * DisposeAECoercePtrUPP()
  410. *
  411. * Availability:
  412. * Non-Carbon CFM: available as macro/inline
  413. * CarbonLib: in CarbonLib 1.0 and later
  414. * Mac OS X: in version 10.0 and later
  415. }
  416. procedure DisposeAECoercePtrUPP(userUPP: AECoercePtrUPP); external name '_DisposeAECoercePtrUPP';
  417. {
  418. * InvokeAECoerceDescUPP()
  419. *
  420. * Availability:
  421. * Non-Carbon CFM: available as macro/inline
  422. * CarbonLib: in CarbonLib 1.0 and later
  423. * Mac OS X: in version 10.0 and later
  424. }
  425. function InvokeAECoerceDescUPP(const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SInt32; var toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr; external name '_InvokeAECoerceDescUPP'; { old name was CallAECoerceDescProc }
  426. {
  427. * InvokeAECoercePtrUPP()
  428. *
  429. * Availability:
  430. * Non-Carbon CFM: available as macro/inline
  431. * CarbonLib: in CarbonLib 1.0 and later
  432. * Mac OS X: in version 10.0 and later
  433. }
  434. 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 }
  435. { a AECoercionHandlerUPP is by default a AECoerceDescUPP. If you are registering a
  436. Ptr based coercion handler you will have to add a cast to AECoerceDescUPP from
  437. your AECoercePtrUPP type. A future release of the interfaces will fix this by
  438. introducing seperate Desc and Ptr coercion handler installation/remove/query routines. }
  439. type
  440. AECoercionHandlerUPP = AECoerceDescUPP;
  441. {
  442. * AEInstallCoercionHandler()
  443. *
  444. * Mac OS X threading:
  445. * Thread safe since version 10.2
  446. *
  447. * Availability:
  448. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  449. * CarbonLib: in CarbonLib 1.0 and later
  450. * Mac OS X: in version 10.0 and later
  451. }
  452. function AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: SInt32; fromTypeIsDesc: boolean; isSysHandler: boolean): OSErr; external name '_AEInstallCoercionHandler';
  453. {
  454. * AERemoveCoercionHandler()
  455. *
  456. * Mac OS X threading:
  457. * Thread safe since version 10.2
  458. *
  459. * Availability:
  460. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  461. * CarbonLib: in CarbonLib 1.0 and later
  462. * Mac OS X: in version 10.0 and later
  463. }
  464. function AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: boolean): OSErr; external name '_AERemoveCoercionHandler';
  465. {
  466. * AEGetCoercionHandler()
  467. *
  468. * Mac OS X threading:
  469. * Thread safe since version 10.2
  470. *
  471. * Availability:
  472. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  473. * CarbonLib: in CarbonLib 1.0 and later
  474. * Mac OS X: in version 10.0 and later
  475. }
  476. function AEGetCoercionHandler(fromType: DescType; toType: DescType; var handler: AECoercionHandlerUPP; var handlerRefcon: SInt32; var fromTypeIsDesc: boolean; isSysHandler: boolean): OSErr; external name '_AEGetCoercionHandler';
  477. {*************************************************************************
  478. The following calls provide for a coercion interface.
  479. *************************************************************************}
  480. {
  481. * AECoercePtr()
  482. *
  483. * Mac OS X threading:
  484. * Thread safe since version 10.2
  485. *
  486. * Availability:
  487. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  488. * CarbonLib: in CarbonLib 1.0 and later
  489. * Mac OS X: in version 10.0 and later
  490. }
  491. function AECoercePtr(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; toType: DescType; var result: AEDesc): OSErr; external name '_AECoercePtr';
  492. {
  493. * AECoerceDesc()
  494. *
  495. * Mac OS X threading:
  496. * Thread safe since version 10.2
  497. *
  498. * Availability:
  499. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  500. * CarbonLib: in CarbonLib 1.0 and later
  501. * Mac OS X: in version 10.0 and later
  502. }
  503. function AECoerceDesc(const (*var*) theAEDesc: AEDesc; toType: DescType; var result: AEDesc): OSErr; external name '_AECoerceDesc';
  504. {*************************************************************************
  505. The following calls apply to any AEDesc. Every 'result' descriptor is
  506. created for you, so you will be responsible for memory management
  507. (including disposing) of the descriptors so created.
  508. *************************************************************************}
  509. { because AEDescs are opaque under Carbon, this AEInitializeDesc provides a
  510. 'clean' way of initializating them to be empty. }
  511. {
  512. * AEInitializeDesc()
  513. *
  514. * Mac OS X threading:
  515. * Thread safe since version 10.2
  516. *
  517. * Availability:
  518. * Non-Carbon CFM: not available
  519. * CarbonLib: in CarbonLib 1.4 and later
  520. * Mac OS X: in version 10.0 and later
  521. }
  522. procedure AEInitializeDesc(var desc: AEDesc); external name '_AEInitializeDesc';
  523. {
  524. * AECreateDesc()
  525. *
  526. * Mac OS X threading:
  527. * Thread safe since version 10.2
  528. *
  529. * Availability:
  530. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  531. * CarbonLib: in CarbonLib 1.0 and later
  532. * Mac OS X: in version 10.0 and later
  533. }
  534. function AECreateDesc(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; var result: AEDesc): OSErr; external name '_AECreateDesc';
  535. {
  536. * AEDisposeDesc()
  537. *
  538. * Mac OS X threading:
  539. * Thread safe since version 10.2
  540. *
  541. * Availability:
  542. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Mac OS X: in version 10.0 and later
  545. }
  546. function AEDisposeDesc(var theAEDesc: AEDesc): OSErr; external name '_AEDisposeDesc';
  547. {
  548. * AEDuplicateDesc()
  549. *
  550. * Mac OS X threading:
  551. * Thread safe since version 10.2
  552. *
  553. * Availability:
  554. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  555. * CarbonLib: in CarbonLib 1.0 and later
  556. * Mac OS X: in version 10.0 and later
  557. }
  558. function AEDuplicateDesc(const (*var*) theAEDesc: AEDesc; var result: AEDesc): OSErr; external name '_AEDuplicateDesc';
  559. {
  560. * Create an AEDesc with memory "borrowed" from the application. The
  561. * data passed in *must* be immutable and not freed until the Dispose
  562. * callback is made.
  563. * The dispose callback may be made at any time, including during the
  564. * creation of the descriptor.
  565. * If possible, the descriptor will be copied to the address space of
  566. * any recipient process using virtual memory APIs and avoid an
  567. * actual memory copy.
  568. }
  569. type
  570. AEDisposeExternalProcPtr = procedure( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SInt32 );
  571. {$ifc OPAQUE_UPP_TYPES}
  572. AEDisposeExternalUPP = ^SInt32; { an opaque UPP }
  573. {$elsec}
  574. AEDisposeExternalUPP = UniversalProcPtr;
  575. {$endc}
  576. {
  577. * AECreateDescFromExternalPtr()
  578. *
  579. * Mac OS X threading:
  580. * Thread safe since version 10.2
  581. *
  582. * Availability:
  583. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  584. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  585. * Non-Carbon CFM: not available
  586. }
  587. function AECreateDescFromExternalPtr( descriptorType: OSType; dataPtr: {const} UnivPtr; dataLength: Size; disposeCallback: AEDisposeExternalUPP; disposeRefcon: SInt32; var theDesc: AEDesc ): OSStatus; external name '_AECreateDescFromExternalPtr';
  588. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  589. {*************************************************************************
  590. The following calls apply to AEDescList. Since AEDescList is a subtype of
  591. AEDesc, the calls in the previous section can also be used for AEDescList.
  592. All list and array indices are 1-based. If the data was greater than
  593. maximumSize in the routines below, then actualSize will be greater than
  594. maximumSize, but only maximumSize bytes will actually be retrieved.
  595. *************************************************************************}
  596. {
  597. * AECreateList()
  598. *
  599. * Mac OS X threading:
  600. * Thread safe since version 10.2
  601. *
  602. * Availability:
  603. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  604. * CarbonLib: in CarbonLib 1.0 and later
  605. * Mac OS X: in version 10.0 and later
  606. }
  607. function AECreateList(factoringPtr: UnivPtr; factoredSize: Size; isRecord: boolean; var resultList: AEDescList): OSErr; external name '_AECreateList';
  608. {
  609. * AECountItems()
  610. *
  611. * Mac OS X threading:
  612. * Thread safe since version 10.2
  613. *
  614. * Availability:
  615. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  616. * CarbonLib: in CarbonLib 1.0 and later
  617. * Mac OS X: in version 10.0 and later
  618. }
  619. function AECountItems(const (*var*) theAEDescList: AEDescList; var theCount: SInt32): OSErr; external name '_AECountItems';
  620. {
  621. * AEPutPtr()
  622. *
  623. * Mac OS X threading:
  624. * Thread safe since version 10.2
  625. *
  626. * Availability:
  627. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  628. * CarbonLib: in CarbonLib 1.0 and later
  629. * Mac OS X: in version 10.0 and later
  630. }
  631. function AEPutPtr(var theAEDescList: AEDescList; index: SInt32; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutPtr';
  632. {
  633. * AEPutDesc()
  634. *
  635. * Mac OS X threading:
  636. * Thread safe since version 10.2
  637. *
  638. * Availability:
  639. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  640. * CarbonLib: in CarbonLib 1.0 and later
  641. * Mac OS X: in version 10.0 and later
  642. }
  643. function AEPutDesc(var theAEDescList: AEDescList; index: SInt32; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutDesc';
  644. {
  645. * AEGetNthPtr()
  646. *
  647. * Mac OS X threading:
  648. * Thread safe since version 10.2
  649. *
  650. * Availability:
  651. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  652. * CarbonLib: in CarbonLib 1.0 and later
  653. * Mac OS X: in version 10.0 and later
  654. }
  655. function AEGetNthPtr(const (*var*) theAEDescList: AEDescList; index: SInt32; desiredType: DescType; theAEKeywordPtr: AEKeywordPtr; typeCode: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetNthPtr';
  656. {
  657. * AEGetNthDesc()
  658. *
  659. * Mac OS X threading:
  660. * Thread safe since version 10.2
  661. *
  662. * Availability:
  663. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  664. * CarbonLib: in CarbonLib 1.0 and later
  665. * Mac OS X: in version 10.0 and later
  666. }
  667. function AEGetNthDesc(const (*var*) theAEDescList: AEDescList; index: SInt32; desiredType: DescType; theAEKeywordPtr: AEKeywordPtr; var result: AEDesc): OSErr; external name '_AEGetNthDesc';
  668. {
  669. * AESizeOfNthItem()
  670. *
  671. * Mac OS X threading:
  672. * Thread safe since version 10.2
  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. }
  679. function AESizeOfNthItem(const (*var*) theAEDescList: AEDescList; index: SInt32; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfNthItem';
  680. {
  681. * AEGetArray()
  682. *
  683. * Mac OS X threading:
  684. * Thread safe since version 10.2
  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. 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';
  692. {
  693. * AEPutArray()
  694. *
  695. * Mac OS X threading:
  696. * Thread safe since version 10.2
  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. }
  703. function AEPutArray(var theAEDescList: AEDescList; arrayType: AEArrayType; const (*var*) arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: SInt32): OSErr; external name '_AEPutArray';
  704. {
  705. * AEDeleteItem()
  706. *
  707. * Mac OS X threading:
  708. * Thread safe since version 10.2
  709. *
  710. * Availability:
  711. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  712. * CarbonLib: in CarbonLib 1.0 and later
  713. * Mac OS X: in version 10.0 and later
  714. }
  715. function AEDeleteItem(var theAEDescList: AEDescList; index: SInt32): OSErr; external name '_AEDeleteItem';
  716. {*************************************************************************
  717. The following calls apply to AERecord. Since AERecord is a subtype of
  718. AEDescList, the calls in the previous sections can also be used for
  719. AERecord an AERecord can be created by using AECreateList with isRecord
  720. set to true.
  721. *************************************************************************}
  722. {************************************************************************
  723. AERecords can have an abitrary descriptorType. This allows you to
  724. check if desc is truly an AERecord
  725. ***********************************************************************}
  726. {
  727. * AECheckIsRecord()
  728. *
  729. * Mac OS X threading:
  730. * Thread safe since version 10.2
  731. *
  732. * Availability:
  733. * Non-Carbon CFM: not available
  734. * CarbonLib: in CarbonLib 1.4 and later
  735. * Mac OS X: in version 10.0 and later
  736. }
  737. function AECheckIsRecord(const (*var*) theDesc: AEDesc): boolean; external name '_AECheckIsRecord';
  738. {
  739. Note: none of the ÒkeyÓ calls were available in the PowerPC 7.x IntefaceLib.
  740. In C, a #define is used to map ÒkeyÓ calls to ÒparamÓ calls. In pascal
  741. this mapping is done in externally linked glue code.
  742. }
  743. {$ifc CALL_NOT_IN_CARBON}
  744. {
  745. * AEPutKeyPtr()
  746. *
  747. * Availability:
  748. * Non-Carbon CFM: not available
  749. * CarbonLib: not available
  750. * Mac OS X: not available
  751. }
  752. function AEPutKeyPtr(var theAERecord: AERecord; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutKeyPtr';
  753. {
  754. * AEPutKeyDesc()
  755. *
  756. * Availability:
  757. * Non-Carbon CFM: not available
  758. * CarbonLib: not available
  759. * Mac OS X: not available
  760. }
  761. function AEPutKeyDesc(var theAERecord: AERecord; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutKeyDesc';
  762. {
  763. * AEGetKeyPtr()
  764. *
  765. * Availability:
  766. * Non-Carbon CFM: not available
  767. * CarbonLib: not available
  768. * Mac OS X: not available
  769. }
  770. function AEGetKeyPtr(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: UnivPtr; maximumSize: Size; var actualSize: Size): OSErr; external name '_AEGetKeyPtr';
  771. {
  772. * AEGetKeyDesc()
  773. *
  774. * Availability:
  775. * Non-Carbon CFM: not available
  776. * CarbonLib: not available
  777. * Mac OS X: not available
  778. }
  779. function AEGetKeyDesc(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetKeyDesc';
  780. {
  781. * AESizeOfKeyDesc()
  782. *
  783. * Availability:
  784. * Non-Carbon CFM: not available
  785. * CarbonLib: not available
  786. * Mac OS X: not available
  787. }
  788. function AESizeOfKeyDesc(const (*var*) theAERecord: AERecord; theAEKeyword: AEKeyword; var typeCode: DescType; var dataSize: Size): OSErr; external name '_AESizeOfKeyDesc';
  789. {
  790. * AEDeleteKeyDesc()
  791. *
  792. * Availability:
  793. * Non-Carbon CFM: not available
  794. * CarbonLib: not available
  795. * Mac OS X: not available
  796. }
  797. function AEDeleteKeyDesc(var theAERecord: AERecord; theAEKeyword: AEKeyword): OSErr; external name '_AEDeleteKeyDesc';
  798. {$endc} {CALL_NOT_IN_CARBON}
  799. {*************************************************************************
  800. The following calls create and manipulate the AppleEvent data type.
  801. *************************************************************************}
  802. {
  803. * AECreateAppleEvent()
  804. *
  805. * Mac OS X threading:
  806. * Thread safe since version 10.2
  807. *
  808. * Availability:
  809. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  810. * CarbonLib: in CarbonLib 1.0 and later
  811. * Mac OS X: in version 10.0 and later
  812. }
  813. function AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; const (*var*) target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; var result: AppleEvent): OSErr; external name '_AECreateAppleEvent';
  814. {*************************************************************************
  815. The following calls are used to pack and unpack parameters from records
  816. of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  817. in the previous sections can also be used for variables of type
  818. AppleEvent. The next six calls are in fact identical to the six calls
  819. for AERecord.
  820. *************************************************************************}
  821. {
  822. * AEPutParamPtr()
  823. *
  824. * Mac OS X threading:
  825. * Thread safe since version 10.2
  826. *
  827. * Availability:
  828. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  829. * CarbonLib: in CarbonLib 1.0 and later
  830. * Mac OS X: in version 10.0 and later
  831. }
  832. function AEPutParamPtr(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutParamPtr';
  833. {
  834. * AEPutParamDesc()
  835. *
  836. * Mac OS X threading:
  837. * Thread safe since version 10.2
  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. }
  844. function AEPutParamDesc(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutParamDesc';
  845. {
  846. * AEGetParamPtr()
  847. *
  848. * Mac OS X threading:
  849. * Thread safe since version 10.2
  850. *
  851. * Availability:
  852. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  853. * CarbonLib: in CarbonLib 1.0 and later
  854. * Mac OS X: in version 10.0 and later
  855. }
  856. function AEGetParamPtr(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; actualType: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetParamPtr';
  857. {
  858. * AEGetParamDesc()
  859. *
  860. * Mac OS X threading:
  861. * Thread safe since version 10.2
  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. }
  868. function AEGetParamDesc(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetParamDesc';
  869. {
  870. * AESizeOfParam()
  871. *
  872. * Mac OS X threading:
  873. * Thread safe since version 10.2
  874. *
  875. * Availability:
  876. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  877. * CarbonLib: in CarbonLib 1.0 and later
  878. * Mac OS X: in version 10.0 and later
  879. }
  880. function AESizeOfParam(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfParam';
  881. {
  882. * AEDeleteParam()
  883. *
  884. * Mac OS X threading:
  885. * Thread safe since version 10.2
  886. *
  887. * Availability:
  888. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  889. * CarbonLib: in CarbonLib 1.0 and later
  890. * Mac OS X: in version 10.0 and later
  891. }
  892. function AEDeleteParam(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr; external name '_AEDeleteParam';
  893. {*************************************************************************
  894. The following calls also apply to type AppleEvent. Message attributes are
  895. far more restricted, and can only be accessed through the following 5
  896. calls. The various list and record routines cannot be used to access the
  897. attributes of an event.
  898. *************************************************************************}
  899. {
  900. * AEGetAttributePtr()
  901. *
  902. * Mac OS X threading:
  903. * Thread safe since version 10.2
  904. *
  905. * Availability:
  906. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  907. * CarbonLib: in CarbonLib 1.0 and later
  908. * Mac OS X: in version 10.0 and later
  909. }
  910. function AEGetAttributePtr(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; typeCode: DescTypePtr; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr): OSErr; external name '_AEGetAttributePtr';
  911. {
  912. * AEGetAttributeDesc()
  913. *
  914. * Mac OS X threading:
  915. * Thread safe since version 10.2
  916. *
  917. * Availability:
  918. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  919. * CarbonLib: in CarbonLib 1.0 and later
  920. * Mac OS X: in version 10.0 and later
  921. }
  922. function AEGetAttributeDesc(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc): OSErr; external name '_AEGetAttributeDesc';
  923. {
  924. * AESizeOfAttribute()
  925. *
  926. * Mac OS X threading:
  927. * Thread safe since version 10.2
  928. *
  929. * Availability:
  930. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  931. * CarbonLib: in CarbonLib 1.0 and later
  932. * Mac OS X: in version 10.0 and later
  933. }
  934. function AESizeOfAttribute(const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr; dataSize: SizePtr): OSErr; external name '_AESizeOfAttribute';
  935. {
  936. * AEPutAttributePtr()
  937. *
  938. * Mac OS X threading:
  939. * Thread safe since version 10.2
  940. *
  941. * Availability:
  942. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  943. * CarbonLib: in CarbonLib 1.0 and later
  944. * Mac OS X: in version 10.0 and later
  945. }
  946. function AEPutAttributePtr(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UnivPtr; dataSize: Size): OSErr; external name '_AEPutAttributePtr';
  947. {
  948. * AEPutAttributeDesc()
  949. *
  950. * Mac OS X threading:
  951. * Thread safe since version 10.2
  952. *
  953. * Availability:
  954. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  955. * CarbonLib: in CarbonLib 1.0 and later
  956. * Mac OS X: in version 10.0 and later
  957. }
  958. function AEPutAttributeDesc(var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc): OSErr; external name '_AEPutAttributeDesc';
  959. {*************************************************************************
  960. AppleEvent Serialization Support
  961. AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
  962. These calls will work for all AppleEvent data types and between different
  963. versions of the OS (including between Mac OS 9 and X)
  964. Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
  965. themselves may not be reliably flattened for storage.
  966. *************************************************************************}
  967. {
  968. AEFlattenDesc
  969. Returns the amount of buffer space needed to flatten the
  970. AEDesc. Call this before AEFlattenDesc to make sure your
  971. buffer has enough room for the operation.
  972. }
  973. {
  974. * AESizeOfFlattenedDesc()
  975. *
  976. * Mac OS X threading:
  977. * Thread safe since version 10.2
  978. *
  979. * Availability:
  980. * Non-Carbon CFM: not available
  981. * CarbonLib: in CarbonLib 1.4 and later
  982. * Mac OS X: in version 10.0 and later
  983. }
  984. function AESizeOfFlattenedDesc(const (*var*) theAEDesc: AEDesc): Size; external name '_AESizeOfFlattenedDesc';
  985. {
  986. AEFlattenDesc
  987. Fills a buffer with a flattened representation of the
  988. AEDesc and returns the amount of buffer used in actualSize.
  989. If bufferSize was too small it returns errAEBufferTooSmall
  990. (-1741) and does not fill in any of the buffer. The resulting
  991. buffer is only useful with an AEUnflattenDesc call.
  992. Note: if you pass a NULL buffer pointer it returns noErr but
  993. fills in the actualSize field anyway.
  994. }
  995. {
  996. * AEFlattenDesc()
  997. *
  998. * Mac OS X threading:
  999. * Thread safe since version 10.2
  1000. *
  1001. * Availability:
  1002. * Non-Carbon CFM: not available
  1003. * CarbonLib: in CarbonLib 1.4 and later
  1004. * Mac OS X: in version 10.0 and later
  1005. }
  1006. function AEFlattenDesc(const (*var*) theAEDesc: AEDesc; buffer: Ptr; bufferSize: Size; var actualSize: Size): OSStatus; external name '_AEFlattenDesc';
  1007. {
  1008. AEUnflattenDesc
  1009. Allocates an AEDesc (given a Null Desc) given a flattened
  1010. data buffer. It assumes it was given a good buffer filled
  1011. in by AEFlattenDesc. It returns paramErr if it discovers
  1012. something fishy about the buffer.
  1013. }
  1014. {
  1015. * AEUnflattenDesc()
  1016. *
  1017. * Mac OS X threading:
  1018. * Thread safe since version 10.2
  1019. *
  1020. * Availability:
  1021. * Non-Carbon CFM: not available
  1022. * CarbonLib: in CarbonLib 1.4 and later
  1023. * Mac OS X: in version 10.0 and later
  1024. }
  1025. function AEUnflattenDesc(buffer: Ptr; var result: AEDesc): OSStatus; external name '_AEUnflattenDesc';
  1026. {*************************************************************************
  1027. The following calls are necessary to deal with opaque data in AEDescs, because the
  1028. traditional way of dealing with a basic AEDesc has been to dereference the dataHandle
  1029. directly. This is not supported under Carbon.
  1030. *************************************************************************}
  1031. {$ifc ACCESSOR_CALLS_ARE_FUNCTIONS}
  1032. {
  1033. AEGetDescData no longer supports automatic coercion. If you'd like to
  1034. coerce the descriptor use AECoerceDesc.
  1035. }
  1036. {
  1037. * AEGetDescData()
  1038. *
  1039. * Mac OS X threading:
  1040. * Thread safe since version 10.2
  1041. *
  1042. * Availability:
  1043. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  1044. * CarbonLib: in CarbonLib 1.0 and later
  1045. * Mac OS X: in version 10.0 and later
  1046. }
  1047. function AEGetDescData(const (*var*) theAEDesc: AEDesc; dataPtr: UnivPtr; maximumSize: Size): OSErr; external name '_AEGetDescData';
  1048. {
  1049. * AEGetDescDataSize()
  1050. *
  1051. * Mac OS X threading:
  1052. * Thread safe since version 10.2
  1053. *
  1054. * Availability:
  1055. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  1056. * CarbonLib: in CarbonLib 1.0 and later
  1057. * Mac OS X: in version 10.0 and later
  1058. }
  1059. function AEGetDescDataSize(const (*var*) theAEDesc: AEDesc): Size; external name '_AEGetDescDataSize';
  1060. {
  1061. * AEReplaceDescData()
  1062. *
  1063. * Mac OS X threading:
  1064. * Thread safe since version 10.2
  1065. *
  1066. * Availability:
  1067. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  1068. * CarbonLib: in CarbonLib 1.0 and later
  1069. * Mac OS X: in version 10.0 and later
  1070. }
  1071. function AEReplaceDescData(typeCode: DescType; dataPtr: UnivPtr; dataSize: Size; var theAEDesc: AEDesc): OSErr; external name '_AEReplaceDescData';
  1072. {$endc} {ACCESSOR_CALLS_ARE_FUNCTIONS}
  1073. {
  1074. * Retrieve a range of bytes from an AEDesc. This obviates the need
  1075. * to retrieve the entire data from the event using AEGetDescData.
  1076. * This is only valid for data type AEDescs. If the requested length
  1077. * and offset are such that they do not fit entirely with the data of the
  1078. * desc, errAEBufferTooSmall is returned.
  1079. }
  1080. {
  1081. * AEGetDescDataRange()
  1082. *
  1083. * Mac OS X threading:
  1084. * Thread safe since version 10.2
  1085. *
  1086. * Availability:
  1087. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1088. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1089. * Non-Carbon CFM: not available
  1090. }
  1091. function AEGetDescDataRange( const (*var*) dataDesc: AEDesc; buffer: UnivPtr; offset: Size; length: Size ): OSStatus; external name '_AEGetDescDataRange';
  1092. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1093. {*************************************************************************
  1094. A AEEventHandler is installed to process an AppleEvent
  1095. *************************************************************************}
  1096. type
  1097. {$ifc TYPED_FUNCTION_POINTERS}
  1098. AEEventHandlerProcPtr = function(const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SInt32): OSErr;
  1099. {$elsec}
  1100. AEEventHandlerProcPtr = ProcPtr;
  1101. {$endc}
  1102. {$ifc OPAQUE_UPP_TYPES}
  1103. AEEventHandlerUPP = ^SInt32; { an opaque UPP }
  1104. {$elsec}
  1105. AEEventHandlerUPP = UniversalProcPtr;
  1106. {$endc}
  1107. const
  1108. uppAEEventHandlerProcInfo = $00000FE0;
  1109. {
  1110. * NewAEDisposeExternalUPP()
  1111. *
  1112. * Availability:
  1113. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1114. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1115. * Non-Carbon CFM: available as macro/inline
  1116. }
  1117. function NewAEDisposeExternalUPP( userRoutine: AEDisposeExternalProcPtr ): AEDisposeExternalUPP; external name '_NewAEDisposeExternalUPP';
  1118. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1119. {
  1120. * NewAEEventHandlerUPP()
  1121. *
  1122. * Availability:
  1123. * Non-Carbon CFM: available as macro/inline
  1124. * CarbonLib: in CarbonLib 1.0 and later
  1125. * Mac OS X: in version 10.0 and later
  1126. }
  1127. function NewAEEventHandlerUPP(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP; external name '_NewAEEventHandlerUPP'; { old name was NewAEEventHandlerProc }
  1128. {
  1129. * DisposeAEDisposeExternalUPP()
  1130. *
  1131. * Availability:
  1132. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1133. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1134. * Non-Carbon CFM: available as macro/inline
  1135. }
  1136. procedure DisposeAEDisposeExternalUPP( userUPP: AEDisposeExternalUPP ); external name '_DisposeAEDisposeExternalUPP';
  1137. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1138. {
  1139. * DisposeAEEventHandlerUPP()
  1140. *
  1141. * Availability:
  1142. * Non-Carbon CFM: available as macro/inline
  1143. * CarbonLib: in CarbonLib 1.0 and later
  1144. * Mac OS X: in version 10.0 and later
  1145. }
  1146. procedure DisposeAEEventHandlerUPP(userUPP: AEEventHandlerUPP); external name '_DisposeAEEventHandlerUPP';
  1147. {
  1148. * InvokeAEDisposeExternalUPP()
  1149. *
  1150. * Availability:
  1151. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1152. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1153. * Non-Carbon CFM: available as macro/inline
  1154. }
  1155. procedure InvokeAEDisposeExternalUPP( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SInt32; userUPP: AEDisposeExternalUPP ); external name '_InvokeAEDisposeExternalUPP';
  1156. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  1157. {
  1158. * InvokeAEEventHandlerUPP()
  1159. *
  1160. * Availability:
  1161. * Non-Carbon CFM: available as macro/inline
  1162. * CarbonLib: in CarbonLib 1.0 and later
  1163. * Mac OS X: in version 10.0 and later
  1164. }
  1165. function InvokeAEEventHandlerUPP(const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SInt32; userRoutine: AEEventHandlerUPP): OSErr; external name '_InvokeAEEventHandlerUPP'; { old name was CallAEEventHandlerProc }
  1166. {$ALIGN MAC68K}
  1167. end.