AEDataModel.pas 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712
  1. {
  2. File: AE/AEDataModel.h
  3. Contains: AppleEvent Data Model Interfaces.
  4. Copyright: © 1996-2008 by Apple Computer, Inc., all rights reserved
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation Updated: Gale R Paeper, <[email protected]>, July 2018 }
  10. {
  11. Modified for use with Free Pascal
  12. Version 308
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  16. {$mode macpas}
  17. {$modeswitch cblocks}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$calling mwpascal}
  22. {$IFNDEF FPC_DOTTEDUNITS}
  23. unit AEDataModel;
  24. {$ENDIF FPC_DOTTEDUNITS}
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined iphonesim}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined iphonesim}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. {$ifc defined ios}
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_OS_EMBEDDED := TRUE}
  153. {$elsec}
  154. {$setc TARGET_OS_MAC := TRUE}
  155. {$setc TARGET_OS_IPHONE := FALSE}
  156. {$setc TARGET_OS_EMBEDDED := FALSE}
  157. {$endc}
  158. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  159. {$elsec}
  160. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  161. {$endc}
  162. {$ifc defined __LP64__ and __LP64__ }
  163. {$setc TARGET_CPU_64 := TRUE}
  164. {$elsec}
  165. {$setc TARGET_CPU_64 := FALSE}
  166. {$endc}
  167. {$ifc defined FPC_BIG_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  170. {$elifc defined FPC_LITTLE_ENDIAN}
  171. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  172. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  173. {$elsec}
  174. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  175. {$endc}
  176. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  177. {$setc CALL_NOT_IN_CARBON := FALSE}
  178. {$setc OLDROUTINENAMES := FALSE}
  179. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  180. {$setc OPAQUE_UPP_TYPES := TRUE}
  181. {$setc OTCARBONAPPLICATION := TRUE}
  182. {$setc OTKERNEL := FALSE}
  183. {$setc PM_USE_SESSION_APIS := TRUE}
  184. {$setc TARGET_API_MAC_CARBON := TRUE}
  185. {$setc TARGET_API_MAC_OS8 := FALSE}
  186. {$setc TARGET_API_MAC_OSX := TRUE}
  187. {$setc TARGET_CARBON := TRUE}
  188. {$setc TARGET_CPU_68K := FALSE}
  189. {$setc TARGET_CPU_MIPS := FALSE}
  190. {$setc TARGET_CPU_SPARC := FALSE}
  191. {$setc TARGET_OS_UNIX := FALSE}
  192. {$setc TARGET_OS_WIN32 := FALSE}
  193. {$setc TARGET_RT_MAC_68881 := FALSE}
  194. {$setc TARGET_RT_MAC_CFM := FALSE}
  195. {$setc TARGET_RT_MAC_MACHO := TRUE}
  196. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  197. {$setc TYPE_BOOL := FALSE}
  198. {$setc TYPE_EXTENDED := FALSE}
  199. {$setc TYPE_LONGLONG := TRUE}
  200. {$IFDEF FPC_DOTTEDUNITS}
  201. uses MacOsApi.MacTypes,MacOsApi.MixedMode;
  202. {$ELSE FPC_DOTTEDUNITS}
  203. uses MacTypes,MixedMode;
  204. {$ENDIF FPC_DOTTEDUNITS}
  205. {$endc} {not MACOSALLINCLUDE}
  206. {$ifc TARGET_OS_MAC}
  207. {$ALIGN MAC68K}
  208. { Apple event descriptor types }
  209. const
  210. typeBoolean = FourCharCode('bool');
  211. typeChar = FourCharCode('TEXT'); { Deprecated, use typeUTF8Text instead. }
  212. {
  213. * The following descriptor types are deprecated due to their lack of
  214. * explicit encoding or byte order definition. Please use
  215. * typeUTF16ExternalRepresentation or typeUTF8Text instead. }
  216. const
  217. typeStyledUnicodeText = FourCharCode('sutx'); { Not implemented }
  218. typeEncodedString = FourCharCode('encs'); { Not implemented }
  219. typeUnicodeText = FourCharCode('utxt'); { native byte ordering, optional BOM }
  220. typeCString = FourCharCode('cstr'); { MacRoman characters followed by a NULL byte }
  221. typePString = FourCharCode('pstr'); { Unsigned length byte followed by MacRoman characters }
  222. {
  223. * The preferred unicode text types. In both cases, there is no explicit null termination or length byte.
  224. }
  225. const
  226. typeUTF16ExternalRepresentation = FourCharCode('ut16'); { big-endian 16 bit unicode with optional byte-order-mark, or little-endian 16 bit unicode with required byte-order-mark. }
  227. typeUTF8Text = FourCharCode('utf8'); { 8 bit unicode }
  228. { Preferred numeric Apple event descriptor types }
  229. const
  230. typeSInt16 = FourCharCode('shor'); { SInt16 : signed, 16 bit integer }
  231. typeUInt16 = FourCharCode('ushr'); { UInt16 : unsigned, 16 bit integer }
  232. typeSInt32 = FourCharCode('long'); { SInt32 : signed, 32 bit integer }
  233. typeUInt32 = FourCharCode('magn'); { UInt32 : unsigned, 32 bit integer }
  234. typeSInt64 = FourCharCode('comp'); { SInt64 : signed, 64 bit integer }
  235. typeUInt64 = FourCharCode('ucom'); { UInt64 : unsigned, 64 bit integer }
  236. typeIEEE32BitFloatingPoint = FourCharCode('sing'); { float }
  237. typeIEEE64BitFloatingPoint = FourCharCode('doub'); { double }
  238. type128BitFloatingPoint = FourCharCode('ldbl');
  239. typeDecimalStruct = FourCharCode('decm');
  240. { Non-preferred Apple event descriptor types }
  241. {$ifc TARGET_CPU_64}
  242. { On Mac OS X 64 bit, the following types have been removed because their meaning is unclear or confusing.
  243. For example, people have assumed that the appropriate data type for typeLongInteger would be long; but
  244. on 64 bit 'long' is a 64 bit value and the appropriate type should be typeComp.
  245. You should change your existing code to not use the following types, and use the more specific ones. Check
  246. through your code to make sure that the datasize referenced by these types is the correct type.
  247. type constant change to data type should be
  248. ------------- --------- -------------------
  249. typeSMInt typeSInt16 SInt16
  250. typeShortInteger typeSInt16 SInt16
  251. typeInteger typeSInt32 SInt32
  252. typeLongInteger typeSInt32 SInt32
  253. typeComp typeSInt64 SInt64 or Wide
  254. typeSMFloat typeIEEE32BitFloatingPoint Float32
  255. typeShortFloat typeIEEE32BitFloatingPoint Float32
  256. typeLongFloat typeIEEE64BitFloatingPoint Float64
  257. There is no good type on 64 bit to use for typeEntended; either change your code to pass typeIEEE64BitFloatingPoint
  258. for typeExtended and live with the reduction in range or use type128BitFloatingPoint.
  259. }
  260. {$elsec} {TARGET_CPU_64}
  261. { Non-preferred Apple event descriptor types }
  262. typeSMInt = FourCharCode('shor');
  263. typeShortInteger = FourCharCode('shor');
  264. typeInteger = FourCharCode('long');
  265. typeLongInteger = FourCharCode('long');
  266. typeMagnitude = FourCharCode('magn');
  267. typeComp = FourCharCode('comp');
  268. typeSMFloat = FourCharCode('sing');
  269. typeShortFloat = FourCharCode('sing');
  270. typeFloat = FourCharCode('doub');
  271. typeLongFloat = FourCharCode('doub');
  272. typeExtended = FourCharCode('exte');
  273. {$endc} {TARGET_CPU_64}
  274. { More Apple event descriptor types }
  275. const
  276. typeAEList = FourCharCode('list');
  277. typeAERecord = FourCharCode('reco');
  278. typeAppleEvent = FourCharCode('aevt');
  279. typeEventRecord = FourCharCode('evrc');
  280. typeTrue = FourCharCode('true');
  281. typeFalse = FourCharCode('fals');
  282. typeAlias = FourCharCode('alis'); { AliasPtr, from a valid AliasHandle }
  283. typeEnumerated = FourCharCode('enum');
  284. typeType = FourCharCode('type'); { OSType }
  285. typeAppParameters = FourCharCode('appa');
  286. typeProperty = FourCharCode('prop');
  287. typeFSRef = FourCharCode('fsrf'); { FSRef. Deprecated; use typeFileURL or typeBookmark data to refer to files in AppleEvents }
  288. typeFileURL = FourCharCode('furl'); { a UTF-8 encoded full path, using native path separators }
  289. typeBookmarkData = FourCharCode('bmrk'); { the bytes of a CFURLBookmarkData }
  290. typeKeyword = FourCharCode('keyw'); { OSType }
  291. typeSectionH = FourCharCode('sect');
  292. typeWildCard = FourCharCode('****');
  293. typeApplSignature = FourCharCode('sign'); { OSType }
  294. typeQDRectangle = FourCharCode('qdrt');
  295. typeFixed = FourCharCode('fixd');
  296. typeProcessSerialNumber = FourCharCode('psn '); { ProcessSerialNumber }
  297. typeApplicationURL = FourCharCode('aprl');
  298. typeNull = FourCharCode('null'); { null or nonexistent data }
  299. {$ifc not TARGET_CPU_64}
  300. {
  301. FSSpecs are deprecated on Mac OS X, and their use in AppleEvents is discouraged. You should change
  302. your code to use typeFileURL or typeFileBookmark. In __LP64__ code, coercions into typeFSS is not supported,
  303. and coercion from typeFSS is not guaranteed to work correctly in all cases.
  304. }
  305. const
  306. typeFSS = FourCharCode('fss '); { FSSpec }
  307. {$endc} {not TARGET_CPU_64}
  308. const
  309. typeCFAttributedStringRef = FourCharCode('cfas');
  310. typeCFMutableAttributedStringRef = FourCharCode('cfaa');
  311. typeCFStringRef = FourCharCode('cfst');
  312. typeCFMutableStringRef = FourCharCode('cfms');
  313. typeCFArrayRef = FourCharCode('cfar');
  314. typeCFMutableArrayRef = FourCharCode('cfma');
  315. typeCFDictionaryRef = FourCharCode('cfdc');
  316. typeCFMutableDictionaryRef = FourCharCode('cfmd');
  317. typeCFNumberRef = FourCharCode('cfnb');
  318. typeCFBooleanRef = FourCharCode('cftf');
  319. typeCFTypeRef = FourCharCode('cfty');
  320. { New addressing modes for MacOS X }
  321. const
  322. typeKernelProcessID = FourCharCode('kpid');
  323. typeMachPort = FourCharCode('port');
  324. const
  325. typeAuditToken = FourCharCode('tokn'); { Mac OS X 10.8, returned as keyAuditTokenAttr and is a typedef audit_token_t }
  326. { Targeting applications by bundle ID is only available in Mac OS X 10.3 or later. }
  327. const
  328. typeApplicationBundleID = FourCharCode('bund');
  329. { Keywords for Apple event attributes }
  330. const
  331. keyTransactionIDAttr = FourCharCode('tran'); { AETransactionID }
  332. keyReturnIDAttr = FourCharCode('rtid'); { AEReturnID }
  333. keyEventClassAttr = FourCharCode('evcl'); { AEEventClass }
  334. keyEventIDAttr = FourCharCode('evid'); { AEEventID }
  335. keyAddressAttr = FourCharCode('addr');
  336. keyOptionalKeywordAttr = FourCharCode('optk');
  337. keyTimeoutAttr = FourCharCode('timo'); { SInt32 }
  338. keyInteractLevelAttr = FourCharCode('inte'); { this attribute is read only - will be set in AESend }
  339. keyEventSourceAttr = FourCharCode('esrc'); { this attribute is read only - returned as typeShortInteger }
  340. keyMissedKeywordAttr = FourCharCode('miss'); { this attribute is read only }
  341. keyOriginalAddressAttr = FourCharCode('from'); { new in 1.0.1 }
  342. keyAcceptTimeoutAttr = FourCharCode('actm'); { new for Mac OS X }
  343. keyReplyRequestedAttr = FourCharCode('repq'); { Was a reply requested for this event - returned as typeBoolean }
  344. // #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
  345. keySenderEUIDAttr = FourCharCode('seid'); { read only, returned as typeSInt32. Will be the euid of the sender of this event. }
  346. keySenderEGIDAttr = FourCharCode('sgid'); { read only, returned as typeSInt32. Will be the egid of the sender of this event. }
  347. keySenderUIDAttr = FourCharCode('uids'); { read only, returned as typeSInt32. Will be the uid of the sender of this event. }
  348. keySenderGIDAttr = FourCharCode('gids'); { read only, returned as typeSInt32. Will be the gid of the sender of this event. }
  349. keySenderPIDAttr = FourCharCode('spid'); { read only, returned as typeSInt32. Will be the pid of the sender of this event. }
  350. keySenderAuditTokenAttr = FourCharCode('tokn'); { read only, returned as an audit_token_t. Will be the audit token of the sender of this event. }
  351. // #endif
  352. // #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  353. keySenderApplescriptEntitlementsAttr = FourCharCode('entl'); { read only, an AEDesc containing opaque data representing the entitlements held by the sender. Interpreted by sandbox routines. }
  354. keySenderApplicationIdentifierEntitlementAttr = FourCharCode('aiea');
  355. keySenderApplicationSandboxed = FourCharCode('sssb'); { read-only, an AEDesc typeBoolean, true if the sender application was in an application sandbox }
  356. keyActualSenderAuditToken = FourCharCode('acat'); { read-only, an AEDesc typeAuditToken of the acual ( possibly over-ridden ) audit token for the sender of this event }
  357. // #endif
  358. // #if defined(__MAC_10_13) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13
  359. keyAppleEventAttributesAttr = FourCharCode('attr'); { read-only, an AEDescList of AEKeyword entries of the attributes on this event. }
  360. // #endif
  361. { These bits are specified in the keyXMLDebuggingAttr (an SInt32) }
  362. const
  363. kAEDebugPOSTHeader = 1 shl 0; { headers of the HTTP post we sent - typeChar }
  364. kAEDebugReplyHeader = 1 shl 1; { headers returned by the server }
  365. kAEDebugXMLRequest = 1 shl 2; { the XML request we sent }
  366. kAEDebugXMLResponse = 1 shl 3; { the XML reply from the server }
  367. kAEDebugXMLDebugAll = $FFFFFFFF; { everything! }
  368. { These values can be added as a parameter to the direct object of a
  369. SOAP message to specify the serialization schema. If not
  370. specified, kSOAP1999Schema is the default. These should be added as
  371. typeType. }
  372. const
  373. kSOAP1999Schema = FourCharCode('ss99');
  374. kSOAP2001Schema = FourCharCode('ss01');
  375. const
  376. { outgoing event attributes }
  377. keyUserNameAttr = FourCharCode('unam');
  378. keyUserPasswordAttr = FourCharCode('pass'); { not sent with the event }
  379. keyDisableAuthenticationAttr = FourCharCode('auth'); { When present and with a non zero value (that is, false, or integer 0), }
  380. { AESend will not authenticate the user. If not present, or with a non-zero}
  381. { value, AESend will prompt for authentication information from the user if the interaction level allows. }
  382. keyXMLDebuggingAttr = FourCharCode('xdbg'); { a bitfield of specifying which XML debugging data is to be returned with the event }
  383. { Event class / id }
  384. kAERPCClass = FourCharCode('rpc '); { for outgoing XML events }
  385. kAEXMLRPCScheme = FourCharCode('RPC2'); { event ID: event should be sent to an XMLRPC endpoint }
  386. kAESOAPScheme = FourCharCode('SOAP'); { event ID: event should be sent to a SOAP endpoint }
  387. kAESharedScriptHandler = FourCharCode('wscp'); { event ID: handler for incoming XML requests }
  388. { these parameters exist as part of the direct object of the event for both incoming and outgoing requests }
  389. keyRPCMethodName = FourCharCode('meth'); { name of the method to call }
  390. keyRPCMethodParam = FourCharCode('parm'); { the list (or structure) of parameters }
  391. keyRPCMethodParamOrder = FourCharCode('/ord'); { if a structure, the order of parameters (a list) }
  392. { when keyXMLDebugginAttr so specifies, these additional parameters will be part of the reply. }
  393. keyAEPOSTHeaderData = FourCharCode('phed'); { what we sent to the server }
  394. keyAEReplyHeaderData = FourCharCode('rhed'); { what the server sent to us }
  395. keyAEXMLRequestData = FourCharCode('xreq'); { what we sent to the server }
  396. keyAEXMLReplyData = FourCharCode('xrep'); { what the server sent to us }
  397. { additional parameters that can be specified in the direct object of the event }
  398. keyAdditionalHTTPHeaders = FourCharCode('ahed'); { list of additional HTTP headers (a list of 2 element lists) }
  399. keySOAPAction = FourCharCode('sact'); { the SOAPAction header (required for SOAP messages) }
  400. keySOAPMethodNameSpace = FourCharCode('mspc'); { Optional namespace (defaults to m:) }
  401. keySOAPMethodNameSpaceURI = FourCharCode('mspu'); { Required namespace URI }
  402. keySOAPSchemaVersion = FourCharCode('ssch'); { Optional XML Schema version, defaults to kSOAP1999Schama }
  403. {
  404. When serializing AERecords as SOAP structures, it is possible
  405. to specify the namespace and type of the structure. To do this,
  406. add a keySOAPStructureMetaData record to the top level of the
  407. record to be serialized. If present, this will be used to specify
  408. the structure namespace. This will produce a structure elment that
  409. looks like:
  410. <myStruct
  411. xmlns:myNamespace="http://myUri.org/xsd",
  412. xsi:type="myNamespace:MyStructType">
  413. ...
  414. </myStruct>
  415. }
  416. const
  417. keySOAPStructureMetaData = FourCharCode('/smd');
  418. keySOAPSMDNamespace = FourCharCode('ssns'); { "myNamespace"}
  419. keySOAPSMDNamespaceURI = FourCharCode('ssnu'); { "http://myUri.org/xsd"}
  420. keySOAPSMDType = FourCharCode('sstp'); { "MyStructType"}
  421. {
  422. * Web Services Proxy support. Available only on Mac OS X 10.2 or later.
  423. * These constants should be added as attributes on the event that is
  424. * being sent (not part of the direct object.)
  425. }
  426. const
  427. { Automatically configure the proxy based on System Configuration }
  428. kAEUseHTTPProxyAttr = FourCharCode('xupr'); { a typeBoolean. Defaults to true.}
  429. { manually specify the proxy host and port. }
  430. kAEHTTPProxyPortAttr = FourCharCode('xhtp'); { a typeSInt32}
  431. kAEHTTPProxyHostAttr = FourCharCode('xhth'); { a typeChar}
  432. {
  433. * Web Services SOCKS support. kAEUseSocksAttr is a boolean that
  434. * specifies whether to automatically configure SOCKS proxies by
  435. * querying System Configuration.
  436. }
  437. const
  438. kAESocks4Protocol = 4;
  439. kAESocks5Protocol = 5;
  440. const
  441. kAEUseSocksAttr = FourCharCode('xscs'); { a typeBoolean. Defaults to true.}
  442. { This attribute specifies a specific SOCKS protocol to be used }
  443. kAESocksProxyAttr = FourCharCode('xsok'); { a typeSInt32}
  444. { if version >= 4 }
  445. kAESocksHostAttr = FourCharCode('xshs'); { a typeChar}
  446. kAESocksPortAttr = FourCharCode('xshp'); { a typeSInt32}
  447. kAESocksUserAttr = FourCharCode('xshu'); { a typeChar}
  448. { if version >= 5 }
  449. kAESocksPasswordAttr = FourCharCode('xshw'); { a typeChar}
  450. { Constants used for specifying the factoring of AEDescLists. }
  451. const
  452. kAEDescListFactorNone = 0;
  453. kAEDescListFactorType = 4;
  454. kAEDescListFactorTypeAndSize = 8;
  455. { Constants used creating an AppleEvent }
  456. const
  457. { Constant for the returnID param of AECreateAppleEvent }
  458. kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID }
  459. { Constant for transaction IDs }
  460. kAnyTransactionID = 0; { no transaction is in use }
  461. { Apple event manager data types }
  462. type
  463. DescType = ResType;
  464. DescTypePtr = ^DescType;
  465. AEKeyword = FourCharCode;
  466. AEKeywordPtr = ^AEKeyword;
  467. {$ifc OPAQUE_TOOLBOX_STRUCTS}
  468. AEDataStorage = ^OpaqueAEDataStorage; { an opaque type }
  469. OpaqueAEDataStorage = record end;
  470. AEDataStoragePtr = ^AEDataStorage; { when a var xx:AEDataStorage parameter can be nil, it is changed to xx: AEDataStoragePtr }
  471. {$elsec}
  472. AEDataStorage = Handle;
  473. {$endc} {OPAQUE_TOOLBOX_STRUCTS}
  474. AEDescPtr = ^AEDesc;
  475. AEDesc = record
  476. descriptorType: DescType;
  477. { No alignment dummy here for 64 bit, also compiled with m68k alignment in C! }
  478. dataHandle: AEDataStorage;
  479. end;
  480. type
  481. AEKeyDescPtr = ^AEKeyDesc;
  482. AEKeyDesc = record
  483. descKey: AEKeyword;
  484. descContent: AEDesc;
  485. end;
  486. { a list of AEDesc's is a special kind of AEDesc }
  487. type
  488. AEDescList = AEDesc;
  489. AEDescListPtr = ^AEDescList;
  490. { AERecord is a list of keyworded AEDesc's }
  491. type
  492. AERecord = AEDescList;
  493. AERecordPtr = ^AERecord;
  494. { an AEDesc which contains address data }
  495. type
  496. AEAddressDesc = AEDesc;
  497. AEAddressDescPtr = ^AEAddressDesc;
  498. { an AERecord that contains an AppleEvent, and related data types }
  499. type
  500. AppleEvent = AERecord;
  501. AppleEventPtr = ^AppleEvent;
  502. AEReturnID = SInt16;
  503. AETransactionID = SInt32;
  504. AEEventClass = FourCharCode;
  505. AEEventID = FourCharCode;
  506. AEArrayType = SInt8;
  507. const
  508. kAEDataArray = 0;
  509. kAEPackedArray = 1;
  510. kAEDescArray = 3;
  511. kAEKeyDescArray = 4;
  512. const
  513. kAEHandleArray = 2;
  514. type
  515. AEArrayDataPtr = ^AEArrayData;
  516. AEArrayData = record
  517. case SInt16 of
  518. 0: (
  519. kAEDataArray: array [0..0] of SInt16;
  520. );
  521. 1: (
  522. kAEPackedArray: SInt8;
  523. );
  524. 2: (
  525. kAEHandleArray: array [0..0] of Handle;
  526. );
  527. 3: (
  528. kAEDescArray: array [0..0] of AEDesc;
  529. );
  530. 4: (
  531. kAEKeyDescArray: array [0..0] of AEKeyDesc;
  532. );
  533. end;
  534. type
  535. AEArrayDataPointer = ^AEArrayData;
  536. AEArrayDataPointerPtr = ^AEArrayDataPointer;
  537. {*************************************************************************
  538. These constants are used by AEMach and AEInteraction APIs. They are not
  539. strictly part of the data format, but are declared here due to layering.
  540. *************************************************************************}
  541. type
  542. AESendPriority = SInt16;
  543. const
  544. kAENormalPriority = $00000000; { post message at the end of the event queue }
  545. kAEHighPriority = $00000001; { post message at the front of the event queue (same as nAttnMsg) }
  546. type
  547. AESendMode = SInt32;
  548. const
  549. kAENoReply = $00000001; { sender doesn't want a reply to event }
  550. kAEQueueReply = $00000002; { sender wants a reply but won't wait }
  551. kAEWaitReply = $00000003; { sender wants a reply and will wait }
  552. kAEDontReconnect = $00000080; { don't reconnect if there is a sessClosedErr from PPCToolbox }
  553. kAEWantReceipt = $00000200; { (nReturnReceipt) sender wants a receipt of message }
  554. kAENeverInteract = $00000010; { server should not interact with user }
  555. kAECanInteract = $00000020; { server may try to interact with user }
  556. kAEAlwaysInteract = $00000030; { server should always interact with user where appropriate }
  557. kAECanSwitchLayer = $00000040; { interaction may switch layer }
  558. kAEDontRecord = $00001000; { don't record this event - available only in vers 1.0.1 and greater }
  559. kAEDontExecute = $00002000; { don't send the event for recording - available only in vers 1.0.1 and greater }
  560. kAEProcessNonReplyEvents = $00008000; { allow processing of non-reply events while awaiting synchronous AppleEvent reply }
  561. kAEDoNotAutomaticallyAddAnnotationsToEvent = $00010000; { if set, don't automatically add any sandbox or other annotations to the event }
  562. { Constants for timeout durations }
  563. const
  564. kAEDefaultTimeout = -1; { timeout value determined by AEM }
  565. kNoTimeOut = -2; { wait until reply comes back, however long it takes }
  566. {*************************************************************************
  567. These calls are used to set up and modify the coercion dispatch table.
  568. *************************************************************************}
  569. type
  570. AECoerceDescProcPtr = function( const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SRefCon; var toDesc: AEDesc ): OSErr;
  571. AECoercePtrProcPtr = function( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SRefCon; var result: AEDesc ): OSErr;
  572. AECoerceDescUPP = UniversalProcPtr;
  573. AECoercePtrUPP = UniversalProcPtr;
  574. {
  575. * NewAECoerceDescUPP()
  576. *
  577. * Availability:
  578. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  579. * CarbonLib: in CarbonLib 1.0 and later
  580. * Non-Carbon CFM: available as macro/inline
  581. }
  582. function NewAECoerceDescUPP( userRoutine: AECoerceDescProcPtr ): AECoerceDescUPP; external name '_NewAECoerceDescUPP';
  583. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  584. {
  585. * NewAECoercePtrUPP()
  586. *
  587. * Availability:
  588. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  589. * CarbonLib: in CarbonLib 1.0 and later
  590. * Non-Carbon CFM: available as macro/inline
  591. }
  592. function NewAECoercePtrUPP( userRoutine: AECoercePtrProcPtr ): AECoercePtrUPP; external name '_NewAECoercePtrUPP';
  593. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  594. {
  595. * DisposeAECoerceDescUPP()
  596. *
  597. * Availability:
  598. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  599. * CarbonLib: in CarbonLib 1.0 and later
  600. * Non-Carbon CFM: available as macro/inline
  601. }
  602. procedure DisposeAECoerceDescUPP( userUPP: AECoerceDescUPP ); external name '_DisposeAECoerceDescUPP';
  603. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  604. {
  605. * DisposeAECoercePtrUPP()
  606. *
  607. * Availability:
  608. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  609. * CarbonLib: in CarbonLib 1.0 and later
  610. * Non-Carbon CFM: available as macro/inline
  611. }
  612. procedure DisposeAECoercePtrUPP( userUPP: AECoercePtrUPP ); external name '_DisposeAECoercePtrUPP';
  613. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  614. {
  615. * InvokeAECoerceDescUPP()
  616. *
  617. * Availability:
  618. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  619. * CarbonLib: in CarbonLib 1.0 and later
  620. * Non-Carbon CFM: available as macro/inline
  621. }
  622. function InvokeAECoerceDescUPP( const (*var*) fromDesc: AEDesc; toType: DescType; handlerRefcon: SRefCon; var toDesc: AEDesc; userUPP: AECoerceDescUPP ): OSErr; external name '_InvokeAECoerceDescUPP';
  623. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  624. {
  625. * InvokeAECoercePtrUPP()
  626. *
  627. * Availability:
  628. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  629. * CarbonLib: in CarbonLib 1.0 and later
  630. * Non-Carbon CFM: available as macro/inline
  631. }
  632. function InvokeAECoercePtrUPP( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; handlerRefcon: SRefCon; var result: AEDesc; userUPP: AECoercePtrUPP ): OSErr; external name '_InvokeAECoercePtrUPP';
  633. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  634. { a AECoercionHandlerUPP is by default a AECoerceDescUPP. If you are registering a
  635. Ptr based coercion handler you will have to add a cast to AECoerceDescUPP from
  636. your AECoercePtrUPP type. A future release of the interfaces will fix this by
  637. introducing seperate Desc and Ptr coercion handler installation/remove/query routines. }
  638. type
  639. AECoercionHandlerUPP = AECoerceDescUPP;
  640. {
  641. * AEInstallCoercionHandler()
  642. *
  643. * Summary:
  644. * Installs a coercion handler in either the application or system
  645. * coercion handler dispatch table.
  646. *
  647. * Discussion:
  648. * Before using AEInstallCoercionHandler to install a handler for a
  649. * particular descriptor type, you can use the AEGetCoercionHandler
  650. * function to determine whether the table already contains a
  651. * coercion handler for that type.
  652. * Version Notes
  653. * See the Version Notes section for the AECoercePtr function for
  654. * information on when to use descriptor-based versus pointer-based
  655. * coercion handlers starting in Mac OS X version 10.2.
  656. * Your application should not install a coercion handler in a
  657. * system coercion handler dispatch table with the goal that the
  658. * handler will get called when other applications perform coercions
  659. * - this won't work in Mac OS X. For more information, see "Writing
  660. * and Installing Coercion Handlers" in Apple Events Programming
  661. * Guide.
  662. *
  663. * Mac OS X threading:
  664. * Thread safe since version 10.2
  665. *
  666. * Parameters:
  667. *
  668. * fromType:
  669. * The descriptor type of the data coerced by the handler.
  670. *
  671. * toType:
  672. * The descriptor type of the resulting data.
  673. * If there was already an entry in the specified coercion handler
  674. * table for the same source descriptor type and result descriptor
  675. * type, the existing entry is replaced.
  676. *
  677. * handler:
  678. * A universal procedure pointer to the coercion handler function
  679. * to install.
  680. *
  681. * handlerRefcon:
  682. * A reference constant. The Apple Event Manager passes this value
  683. * to the handler each time it calls it. If your handler doesn't
  684. * require a reference constant, pass 0 for this parameter.
  685. *
  686. * fromTypeIsDesc:
  687. * Specifies the form of the data to coerce. Pass TRUE if the
  688. * coercion handler expects the data as a descriptor or FALSE if
  689. * the coercion handler expects a pointer to the data. The Apple
  690. * Event Manager can provide a pointer to data more efficiently
  691. * than it can provide a descriptor, so all coercion functions
  692. * should accept a pointer to data if possible.
  693. *
  694. * isSysHandler:
  695. * Specifies the coercion table to add the handler to. Pass TRUE
  696. * to add the handler to the system coercion table or FALSE to add
  697. * the handler to your application's coercion table. Use of the
  698. * system coercion table is not recommended.
  699. *
  700. * Availability:
  701. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  702. * CarbonLib: in CarbonLib 1.0 and later
  703. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  704. }
  705. function AEInstallCoercionHandler( fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: SRefCon; fromTypeIsDesc: Boolean; isSysHandler: Boolean ): OSErr; external name '_AEInstallCoercionHandler';
  706. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  707. {
  708. * AERemoveCoercionHandler()
  709. *
  710. * Discussion:
  711. * Removes a coercion handler from a coercion handler dispatch table.
  712. *
  713. * Mac OS X threading:
  714. * Thread safe since version 10.2
  715. *
  716. * Parameters:
  717. *
  718. * fromType:
  719. * The descriptor type of the data coerced by the handler.
  720. *
  721. * toType:
  722. * The descriptor type of the resulting data.
  723. *
  724. * handler:
  725. * A universal procedure pointer to the coercion handler to
  726. * remove. Although the parameters fromType and toType are
  727. * sufficient to identify the handler, you can identify the
  728. * handler explicitly as a safeguard. If you pass NULL for this
  729. * parameter, the Apple Event Manager relies solely on the event
  730. * class and event ID to identify the handler.
  731. *
  732. * isSysHandler:
  733. * Specifies the coercion table to remove the handler from. Pass
  734. * TRUE to remove the handler from the system coercion table or
  735. * FALSE to remove the handler from your application's coercion
  736. * table. Use of the system coercion table is not recommended.
  737. *
  738. * Availability:
  739. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  740. * CarbonLib: in CarbonLib 1.0 and later
  741. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  742. }
  743. function AERemoveCoercionHandler( fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveCoercionHandler';
  744. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  745. {
  746. * AEGetCoercionHandler()
  747. *
  748. * Discussion:
  749. * Gets the coercion handler for a specified descriptor type.
  750. *
  751. * Mac OS X threading:
  752. * Thread safe since version 10.2
  753. *
  754. * Parameters:
  755. *
  756. * fromType:
  757. * The descriptor type of the data coerced by the handler.
  758. *
  759. * toType:
  760. * The descriptor type of the resulting data.
  761. *
  762. * handler:
  763. * A universal procedure pointer. On return, a pointer to the
  764. * specified handler, if a coercion table entry exists that
  765. * exactly matches the values supplied in the parameters fromType
  766. * and toType. See AECoercionHandlerUPP.
  767. *
  768. * handlerRefcon:
  769. * A pointer to a reference constant. On return, the reference
  770. * constant from the coercion table entry for the specified
  771. * coercion handler. The Apple Event Manager passes this reference
  772. * constant to the handler each time it calls the handler. The
  773. * reference constant may have a value of 0.
  774. *
  775. * fromTypeIsDesc:
  776. * A pointer to a Boolean value. The AEGetCoercionHandler function
  777. * returns a value of TRUE in this parameter if the coercion
  778. * handler expects the data as a descriptor or FALSE, if the
  779. * coercion handler expects a pointer to the data.
  780. *
  781. * isSysHandler:
  782. * Specifies the coercion table to get the handler from. Pass TRUE
  783. * to get the handler from the system coercion table or FALSE to
  784. * get the handler from your application's coercion table. Use of
  785. * the system coercion table is not recommended.
  786. *
  787. * Availability:
  788. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  789. * CarbonLib: in CarbonLib 1.0 and later
  790. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  791. }
  792. function AEGetCoercionHandler( fromType: DescType; toType: DescType; var handler: AECoercionHandlerUPP; var handlerRefcon: SRefCon; var fromTypeIsDesc: Boolean; isSysHandler: Boolean ): OSErr; external name '_AEGetCoercionHandler';
  793. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  794. {*************************************************************************
  795. The following calls provide for a coercion interface.
  796. *************************************************************************}
  797. {
  798. * AECoercePtr()
  799. *
  800. * Discussion:
  801. * Coerces data to a desired descriptor type and creates a
  802. * descriptor containing the newly coerced data.
  803. *
  804. * Mac OS X threading:
  805. * Thread safe since version 10.2
  806. *
  807. * Parameters:
  808. *
  809. * typeCode:
  810. * The descriptor type of the source data.
  811. *
  812. * dataPtr:
  813. * A pointer to the data to coerce.
  814. *
  815. * dataSize:
  816. * The length, in bytes, of the data to coerce.
  817. *
  818. * toType:
  819. * The desired descriptor type of the resulting descriptor.
  820. *
  821. * result:
  822. * A pointer to a descriptor. On successful return, a descriptor
  823. * containing the coerced data and matching the descriptor type
  824. * specified in toType. On error, a null descriptor. If the
  825. * function returns successfully, your application should call the
  826. * AEDisposeDesc function to dispose of the resulting descriptor
  827. * after it has finished using it. See AEDesc.
  828. *
  829. * Availability:
  830. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  831. * CarbonLib: in CarbonLib 1.0 and later
  832. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  833. }
  834. function AECoercePtr( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; toType: DescType; var result: AEDesc ): OSErr; external name '_AECoercePtr';
  835. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  836. {
  837. * AECoerceDesc()
  838. *
  839. * Discussion:
  840. * Coerces the data in a descriptor to another descriptor type and
  841. * creates a descriptor containing the newly coerced data.
  842. *
  843. * Mac OS X threading:
  844. * Thread safe since version 10.2
  845. *
  846. * Parameters:
  847. *
  848. * theAEDesc:
  849. * A pointer to the descriptor containing the data to coerce.
  850. *
  851. * toType:
  852. * The desired descriptor type of the resulting descriptor.
  853. *
  854. * result:
  855. * A pointer to a descriptor. On successful return, a descriptor
  856. * containing the coerced data and matching the descriptor type
  857. * specified in toType. On error, a null descriptor. If the
  858. * function returns successfully, your application should call the
  859. * AEDisposeDesc function to dispose of the resulting descriptor
  860. * after it has finished using it.
  861. *
  862. * Availability:
  863. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  864. * CarbonLib: in CarbonLib 1.0 and later
  865. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  866. }
  867. function AECoerceDesc( const (*var*) theAEDesc: AEDesc; toType: DescType; var result: AEDesc ): OSErr; external name '_AECoerceDesc';
  868. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  869. {*************************************************************************
  870. The following calls apply to any AEDesc. Every 'result' descriptor is
  871. created for you, so you will be responsible for memory management
  872. (including disposing) of the descriptors so created.
  873. *************************************************************************}
  874. { because AEDescs are opaque under Carbon, this AEInitializeDesc provides a
  875. 'clean' way of initializating them to be empty. }
  876. {
  877. * AEInitializeDesc()
  878. *
  879. * Discussion:
  880. * The function sets the type of the descriptor to typeNull and sets
  881. * the data handle to NULL. If you need to initialize a descriptor
  882. * that already has some data in it, use AEDisposeDesc to deallocate
  883. * the memory and initialize the descriptor.
  884. *
  885. * Mac OS X threading:
  886. * Thread safe since version 10.2
  887. *
  888. * Parameters:
  889. *
  890. * desc:
  891. * A pointer to a new descriptor.
  892. *
  893. * Availability:
  894. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  895. * CarbonLib: in CarbonLib 1.4 and later
  896. * Non-Carbon CFM: not available
  897. }
  898. procedure AEInitializeDesc( var desc: AEDesc ); external name '_AEInitializeDesc';
  899. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  900. {
  901. * AECreateDesc()
  902. *
  903. * Summary:
  904. * Creates a new descriptor that incorporates the specified data.
  905. *
  906. * Discussion:
  907. * While it is possible to create an Apple event descriptor or a
  908. * descriptor list or a descriptor with the AECreateDesc function
  909. * (assuming you have access to the raw data for an Apple event,
  910. * list, or descriptor), you typically create these structured
  911. * objects with their specific creation routines -
  912. * AECreateAppleEvent, AECreateList, or AECreateDesc.
  913. *
  914. * Mac OS X threading:
  915. * Thread safe since version 10.2
  916. *
  917. * Parameters:
  918. *
  919. * typeCode:
  920. * The descriptor type for the new descriptor.
  921. *
  922. * dataPtr:
  923. * A pointer to the data for the new descriptor. This data is
  924. * copied into a newly-allocated block of memory for the
  925. * descriptor that is created. To minimize copying overhead,
  926. * consider using AECreateDescFromExternalPtr.
  927. *
  928. * dataSize:
  929. * The length, in bytes, of the data for the new descriptor.
  930. *
  931. * result:
  932. * A pointer to a descriptor. On successful return, a descriptor
  933. * that incorporates the data specified by the dataPtr parameter.
  934. * On error, a null descriptor. If the function returns
  935. * successfully, your application should call the AEDisposeDesc
  936. * function to dispose of the resulting descriptor after it has
  937. * finished using it.
  938. *
  939. * Availability:
  940. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  941. * CarbonLib: in CarbonLib 1.0 and later
  942. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  943. }
  944. function AECreateDesc( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; var result: AEDesc ): OSErr; external name '_AECreateDesc';
  945. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  946. {
  947. * AEDisposeDesc()
  948. *
  949. * Summary:
  950. * Deallocates the memory used by a descriptor.
  951. *
  952. * Discussion:
  953. * The AEDisposeDesc function deallocates the memory used by a
  954. * descriptor. After calling this method, the descriptor becomes an
  955. * empty descriptor with a type of typeNULL. Because all Apple event
  956. * structures (except for keyword-specified descriptors) are
  957. * descriptors, you can use AEDisposeDesc for any of them.
  958. * Do not call AEDisposeDesc on a descriptor obtained from another
  959. * Apple Event Manager function (such as the reply event from a call
  960. * to AESend) unless that function returns successfully.
  961. * Special Considerations
  962. * If the AEDesc might contain an OSL token, dispose of it with
  963. * AEDisposeToken.
  964. *
  965. * Mac OS X threading:
  966. * Thread safe since version 10.2
  967. *
  968. * Parameters:
  969. *
  970. * theAEDesc:
  971. * A pointer to the descriptor to deallocate. On return, a null
  972. * descriptor. If you pass a null descriptor in this parameter,
  973. * AEDisposeDesc returns noErr.
  974. *
  975. * Availability:
  976. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  977. * CarbonLib: in CarbonLib 1.0 and later
  978. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  979. }
  980. function AEDisposeDesc( var theAEDesc: AEDesc ): OSErr; external name '_AEDisposeDesc';
  981. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  982. {
  983. * AEDuplicateDesc()
  984. *
  985. * Summary:
  986. * Creates a copy of a descriptor.
  987. *
  988. * Discussion:
  989. * It is common for applications to send Apple events that have one
  990. * or more attributes or parameters in common. For example, if you
  991. * send a series of Apple events to the same application, the
  992. * address attribute is the same. In these cases, the most efficient
  993. * way to create the necessary Apple events is to make a template
  994. * Apple event that you can then copy - by calling the
  995. * AEDuplicateDesc function - as needed. You then fill in or change
  996. * the remaining parameters and attributes of the copy, send the
  997. * copy by calling the AESend function and, after AESend returns a
  998. * result code, dispose of the copy by calling AEDisposeDesc. You
  999. * can use this approach to prepare structures of type AEDesc,
  1000. * AEDescList, AERecord, and AppleEvent.
  1001. *
  1002. * Mac OS X threading:
  1003. * Thread safe since version 10.2
  1004. *
  1005. * Parameters:
  1006. *
  1007. * theAEDesc:
  1008. * A pointer to the descriptor to duplicate. See AEDesc.
  1009. *
  1010. * result:
  1011. * A pointer to a descriptor. On return, the descriptor contains a
  1012. * copy of the descriptor specified by the theAEDesc parameter. If
  1013. * the function returns successfully, your application should call
  1014. * the AEDisposeDesc function to dispose of the resulting
  1015. * descriptor after it has finished using it.
  1016. *
  1017. * Availability:
  1018. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1019. * CarbonLib: in CarbonLib 1.0 and later
  1020. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1021. }
  1022. function AEDuplicateDesc( const (*var*) theAEDesc: AEDesc; var result: AEDesc ): OSErr; external name '_AEDuplicateDesc';
  1023. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1024. {
  1025. * Create an AEDesc with memory "borrowed" from the application. The
  1026. * data passed in *must* be immutable and not freed until the Dispose
  1027. * callback is made.
  1028. * The dispose callback may be made at any time, including during the
  1029. * creation of the descriptor.
  1030. * If possible, the descriptor will be copied to the address space of
  1031. * any recipient process using virtual memory APIs and avoid an
  1032. * actual memory copy.
  1033. }
  1034. type
  1035. AEDisposeExternalProcPtr = procedure( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SRefCon );
  1036. AEDisposeExternalUPP = AEDisposeExternalProcPtr;
  1037. {
  1038. * AECreateDescFromExternalPtr()
  1039. *
  1040. * Summary:
  1041. * Creates a new descriptor that uses a memory buffer supplied by
  1042. * the caller.
  1043. *
  1044. * Discussion:
  1045. * This function is different than AECreateDesc, in that it creates
  1046. * a descriptor that uses the data block provided by the caller "in
  1047. * place," rather than allocate a block of memory and copy the data
  1048. * to it. This function can provide dramatically improved
  1049. * performance if you're working with large chunks of data. It
  1050. * attempts to copy the descriptor to the address space of any
  1051. * recipient process using virtual memory APIs, avoiding an actual
  1052. * memory copy. For example, you might want to use this function to
  1053. * pass a large image in an Apple event.
  1054. * You can use the AEGetDescDataRange function to access a specific
  1055. * section of a large block of data.
  1056. *
  1057. * Mac OS X threading:
  1058. * Thread safe since version 10.2
  1059. *
  1060. * Parameters:
  1061. *
  1062. * descriptorType:
  1063. * The descriptor type for the new descriptor.
  1064. *
  1065. * dataPtr:
  1066. * A pointer to the data for the new descriptor. The memory that
  1067. * is pointed to cannot be a Handle (which may move in memory),
  1068. * cannot be modified by the caller, and must be preserved in
  1069. * place (and not freed), until the disposeCallback function is
  1070. * called.
  1071. * If possible, the descriptor will be mapped into the address
  1072. * space of the recipient using shared memory, avoiding an actual
  1073. * memory copy.
  1074. * The pointer that is passed in does not need to be aligned to
  1075. * any particular boundary, but is optimized to transfer data on a
  1076. * page boundary. You can get the current page size (4096 on all
  1077. * current Mac OS X systems) with the getpagesize(3) call. (Type
  1078. * man 3 getpagesize in a Terminal window for documentation.)
  1079. *
  1080. * dataLength:
  1081. * The length, in bytes, of the data for the new descriptor.
  1082. *
  1083. * disposeCallback:
  1084. * A universal procedure pointer to a dispose callback function of
  1085. * type AEDisposeExternalProcPtr. Your callback function will be
  1086. * called when the block of memory provided by dataPtr is no
  1087. * longer needed by the Apple Event Manager. The function can be
  1088. * called at any time, including during creation of the descriptor.
  1089. *
  1090. * disposeRefcon:
  1091. * A reference constant the Apple Event Manager passes to the
  1092. * disposeCallback function whenever it calls the function. If
  1093. * your dispose function doesn't require a reference constant,
  1094. * pass 0 for this parameter.
  1095. *
  1096. * theDesc:
  1097. * A pointer to a descriptor. On successful return, a descriptor
  1098. * that incorporates the data specified by the dataPtr parameter.
  1099. * On error, a null descriptor. If the function returns
  1100. * successfully, your application should call the AEDisposeDesc
  1101. * function to dispose of the resulting descriptor after it has
  1102. * finished using it.
  1103. *
  1104. * Availability:
  1105. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  1106. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1107. * Non-Carbon CFM: not available
  1108. }
  1109. function AECreateDescFromExternalPtr( descriptorType: OSType; dataPtr: {const} UnivPtr; dataLength: Size; disposeCallback: AEDisposeExternalUPP; disposeRefcon: SRefCon; var theDesc: AEDesc ): OSStatus; external name '_AECreateDescFromExternalPtr';
  1110. (* __OSX_AVAILABLE_STARTING( __MAC_10_2, __IPHONE_NA ) *)
  1111. {
  1112. * AECompareDesc()
  1113. *
  1114. * Discussion:
  1115. * Compare two AEDesc descriptors and return whether they are
  1116. * identical or not.
  1117. *
  1118. * Mac OS X threading:
  1119. * Thread safe since version 10.8
  1120. *
  1121. * Parameters:
  1122. *
  1123. * desc1, desc2:
  1124. * A pointer to an AEDesc to be compared.
  1125. *
  1126. * resultP:
  1127. * If non-NULL, on a noErr return will be filled in with
  1128. * true or false indicating whether the descriptors are
  1129. * equilavent or not.
  1130. *
  1131. * Two descriptors are identical if they are the same type and have
  1132. * the same data; typeAEList descriptors must contain the same number
  1133. * of items and every item in each list must itself be identical;
  1134. * typeAERecord descriptors must contain the same number of keys
  1135. * and values and each key/value must match between the two.
  1136. * typeAppleEvents match like typeAERecord and also require that
  1137. * most attributes of the two events are identical.
  1138. *
  1139. * Availability:
  1140. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1141. * CarbonLib: in CarbonLib 1.0 and later
  1142. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1143. }
  1144. function AECompareDesc( const (*var*) desc1: AEDesc; const (*var*) desc2: AEDesc; var resultP: Boolean ): OSStatus; external name '_AECompareDesc';
  1145. (* __OSX_AVAILABLE_STARTING( __MAC_10_8, __IPHONE_NA ) *)
  1146. {*************************************************************************
  1147. The following calls apply to AEDescList. Since AEDescList is a subtype of
  1148. AEDesc, the calls in the previous section can also be used for AEDescList.
  1149. All list and array indices are 1-based. If the data was greater than
  1150. maximumSize in the routines below, then actualSize will be greater than
  1151. maximumSize, but only maximumSize bytes will actually be retrieved.
  1152. *************************************************************************}
  1153. {
  1154. * AECreateList()
  1155. *
  1156. * Discussion:
  1157. * Creates an empty descriptor list or Apple event record.
  1158. *
  1159. * Mac OS X threading:
  1160. * Thread safe since version 10.2
  1161. *
  1162. * Parameters:
  1163. *
  1164. * factoringPtr:
  1165. * A pointer to the data at the beginning of each descriptor that
  1166. * is the same for all descriptors in the list. If there is no
  1167. * common data, or if you decide not to isolate the common data,
  1168. * pass NULL as the value of this parameter.
  1169. *
  1170. * factoredSize:
  1171. * The size of the common data. If there is no common data, or if
  1172. * you decide not to isolate the common data, pass 0 as the value
  1173. * of this parameter. (See the Discussion section for more
  1174. * information.)
  1175. *
  1176. * isRecord:
  1177. * A Boolean value that specifies the kind of list to create. Pass
  1178. * a value of TRUE to create an Apple event record (a data
  1179. * structure of type AERecord) or FALSE to create a descriptor
  1180. * list.
  1181. *
  1182. * resultList:
  1183. * A pointer to a descriptor list variable. On successful return,
  1184. * the descriptor list or Apple event record that the AECreateList
  1185. * function creates. On error, a null descriptor. See AEDescList.
  1186. *
  1187. * Availability:
  1188. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1189. * CarbonLib: in CarbonLib 1.0 and later
  1190. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1191. }
  1192. function AECreateList( factoringPtr: {const} UnivPtr; factoredSize: Size; isRecord: Boolean; var resultList: AEDescList ): OSErr; external name '_AECreateList';
  1193. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1194. {
  1195. * AECountItems()
  1196. *
  1197. * Discussion:
  1198. * Counts the number of descriptors in a descriptor list.
  1199. *
  1200. * Mac OS X threading:
  1201. * Thread safe since version 10.2
  1202. *
  1203. * Parameters:
  1204. *
  1205. * theAEDescList:
  1206. * A pointer to the descriptor list to count
  1207. *
  1208. * theCount:
  1209. * A pointer to a count variable. On return, the number of
  1210. * descriptors in the specified descriptor list. Currently an
  1211. * AEDescList is limited to 2^31 items.
  1212. *
  1213. * Availability:
  1214. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1215. * CarbonLib: in CarbonLib 1.0 and later
  1216. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1217. }
  1218. function AECountItems( const (*var*) theAEDescList: AEDescList; var theCount: SIGNEDLONG ): OSErr; external name '_AECountItems';
  1219. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1220. {
  1221. * AEPutPtr()
  1222. *
  1223. * Discussion:
  1224. * Puts data specified in a buffer to a descriptor list as a
  1225. * descriptor, possibly replacing an existing descriptor in the list.
  1226. *
  1227. * Mac OS X threading:
  1228. * Thread safe since version 10.2
  1229. *
  1230. * Parameters:
  1231. *
  1232. * theAEDescList:
  1233. * A pointer to the descriptor list to add a descriptor to. See
  1234. * AEDescList.
  1235. *
  1236. * index:
  1237. * A one-based positive integer indicating the position to insert
  1238. * the descriptor at. If there is already a descriptor in the
  1239. * specified position, it is replaced. You can pass a value of
  1240. * zero or count + 1 to add the descriptor at the end of the list.
  1241. * AEPutPtr returns an error (AEIllegalIndex) if you pass a
  1242. * negative number or a value that is out of range. Currently the
  1243. * upper limit on index is 2^31 items.
  1244. *
  1245. * typeCode:
  1246. * The descriptor type for the descriptor to be put into the list.
  1247. *
  1248. * dataPtr:
  1249. * A pointer to the data for the descriptor to add.
  1250. *
  1251. * dataSize:
  1252. * The length, in bytes, of the data for the descriptor to add.
  1253. *
  1254. * Availability:
  1255. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1256. * CarbonLib: in CarbonLib 1.0 and later
  1257. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1258. }
  1259. function AEPutPtr( var theAEDescList: AEDescList; index: SIGNEDLONG; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutPtr';
  1260. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1261. {
  1262. * AEPutDesc()
  1263. *
  1264. * Discussion:
  1265. * Adds a descriptor to any descriptor list, possibly replacing an
  1266. * existing descriptor in the list.
  1267. *
  1268. * Mac OS X threading:
  1269. * Thread safe since version 10.2
  1270. *
  1271. * Parameters:
  1272. *
  1273. * theAEDescList:
  1274. * A pointer to the descriptor list to add a descriptor to. See
  1275. * AEDescList.
  1276. *
  1277. * index:
  1278. * A one-based positive integer indicating the position to insert
  1279. * the descriptor at. If there is already a descriptor in the
  1280. * specified position, it is replaced. You can pass a value of
  1281. * zero or count + 1 to add the descriptor at the end of the list.
  1282. * AEPutPtr returns an error (AEIllegalIndex) if you pass a
  1283. * negative number or a value that is out of range. Currently the
  1284. * upper limit on index is 2^31 items.
  1285. *
  1286. * theAEDesc:
  1287. * A pointer to the descriptor to add to the list.
  1288. *
  1289. * Availability:
  1290. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1291. * CarbonLib: in CarbonLib 1.0 and later
  1292. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1293. }
  1294. function AEPutDesc( var theAEDescList: AEDescList; index: SIGNEDLONG; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutDesc';
  1295. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1296. {
  1297. * AEGetNthPtr()
  1298. *
  1299. * Discussion:
  1300. * Gets a copy of the data from a descriptor at a specified position
  1301. * in a descriptor list; typically used when your application needs
  1302. * to work with the extracted data directly.
  1303. *
  1304. * Mac OS X threading:
  1305. * Thread safe since version 10.2
  1306. *
  1307. * Parameters:
  1308. *
  1309. * theAEDescList:
  1310. * A pointer to the descriptor list to add a descriptor to. See
  1311. * AEDescList.
  1312. *
  1313. * index:
  1314. * A one-based positive integer indicating the position in the
  1315. * descriptor list of the descriptor to get the data from.
  1316. * AEGetNthPtr returns an error if you pass zero, a negative
  1317. * number, or a value that is out of range. Currently the upper
  1318. * limit on index is 2^31 items.
  1319. *
  1320. * desiredType:
  1321. * The desired descriptor type for the copied data. For a list of
  1322. * AppleScript's predefined descriptor types. If the descriptor
  1323. * specified by the index parameter is not of the desired type,
  1324. * AEGetNthPtr attempts to coerce the data to this type. If you
  1325. * pass a value of typeWildCard, no coercion is performed, and the
  1326. * descriptor type of the copied data is the same as the
  1327. * descriptor type of the original descriptor.
  1328. *
  1329. * theAEKeyword:
  1330. * A pointer to a keyword or NULL. On return, the keyword for the
  1331. * specified descriptor, if you are getting data from a list of
  1332. * keyword-specified descriptors; otherwise, AEGetNthPtr returns
  1333. * the value typeWildCard.
  1334. *
  1335. * typeCode:
  1336. * A pointer to a descriptor type or NULL. On return, specifies
  1337. * the descriptor type of the data pointed to by dataPtr.
  1338. *
  1339. * dataPtr:
  1340. * A pointer to a buffer, local variable, or other storage
  1341. * location created and disposed of by your application. The size
  1342. * in bytes must be at least as large as the value you pass in the
  1343. * maximumSize parameter. On return, contains the data from the
  1344. * descriptor at the position in the descriptor list specified by
  1345. * the index parameter.
  1346. *
  1347. * maximumSize:
  1348. * The maximum length, in bytes, of the expected data. The
  1349. * AEGetNthPtr function will not return more data than you specify
  1350. * in this parameter.
  1351. *
  1352. * actualSize:
  1353. * A pointer to a size variable or NULL. On return, the length, in
  1354. * bytes, of the data for the specified descriptor. If this value
  1355. * is larger than the value of the maximumSize parameter, the
  1356. * buffer pointed to by dataPtr was not large enough to contain
  1357. * all of the data for the descriptor, though AEGetNthPtr does not
  1358. * write beyond the end of the buffer. If the buffer was too
  1359. * small, you can resize it and call AEGetNthPtr again.
  1360. *
  1361. * Availability:
  1362. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1363. * CarbonLib: in CarbonLib 1.0 and later
  1364. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1365. }
  1366. function AEGetNthPtr( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; desiredType: DescType; theAEKeyword: AEKeywordPtr { can be NULL }; typeCode: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetNthPtr';
  1367. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1368. {
  1369. * AEGetNthDesc()
  1370. *
  1371. * Discussion:
  1372. * Copies a descriptor from a specified position in a descriptor
  1373. * list into a specified descriptor; typically used when your
  1374. * application needs to pass the extracted data to another function
  1375. * as a descriptor.
  1376. *
  1377. * Mac OS X threading:
  1378. * Thread safe since version 10.2
  1379. *
  1380. * Parameters:
  1381. *
  1382. * theAEDescList:
  1383. * A pointer to the descriptor list to add a descriptor to. See
  1384. * AEDescList.
  1385. *
  1386. * index:
  1387. * A one-based positive integer indicating the position in the
  1388. * descriptor list of the descriptor to get the data from.
  1389. * AEGetNthDesc returns an error if you pass zero, a negative
  1390. * number, or a value that is out of range. Currently the upper
  1391. * limit on index is 2^31 items.
  1392. *
  1393. * desiredType:
  1394. * The desired descriptor type for the copied data. For a list of
  1395. * AppleScript's predefined descriptor types. If the descriptor
  1396. * specified by the index parameter is not of the desired type,
  1397. * AEGetNthDesc attempts to coerce the data to this type. If you
  1398. * pass a value of typeWildCard, no coercion is performed, and the
  1399. * descriptor type of the copied data is the same as the
  1400. * descriptor type of the original descriptor.
  1401. *
  1402. * theAEKeyword:
  1403. * A pointer to a keyword or NULL. On return, the keyword for the
  1404. * specified descriptor, if you are getting data from a list of
  1405. * keyword-specified descriptors; otherwise, AEGetNthDesc returns
  1406. * the value typeWildCard.
  1407. *
  1408. * result:
  1409. * A pointer to a descriptor. On successful return, a copy of the
  1410. * descriptor specified by the index parameter, coerced, if
  1411. * necessary, to the descriptor type specified by the desiredType
  1412. * parameter. On error, a null descriptor. If the function returns
  1413. * successfully, your application should call the AEDisposeDesc
  1414. * function to dispose of the resulting descriptor after it has
  1415. * finished using it.
  1416. *
  1417. * Availability:
  1418. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1419. * CarbonLib: in CarbonLib 1.0 and later
  1420. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1421. }
  1422. function AEGetNthDesc( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; desiredType: DescType; theAEKeyword: AEKeywordPtr { can be NULL }; var result: AEDesc ): OSErr; external name '_AEGetNthDesc';
  1423. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1424. {
  1425. * AESizeOfNthItem()
  1426. *
  1427. * Discussion:
  1428. * Gets the data size and descriptor type of the descriptor at a
  1429. * specified position in a descriptor list.
  1430. *
  1431. * Mac OS X threading:
  1432. * Thread safe since version 10.2
  1433. *
  1434. * Parameters:
  1435. *
  1436. * theAEDescList:
  1437. * A pointer to the descriptor list to add a descriptor to. See
  1438. * AEDescList.
  1439. *
  1440. * index:
  1441. * A one-based positive integer indicating the position in the
  1442. * descriptor list of the descriptor to get the data from.
  1443. * AESizeOfNthItem returns an error if you pass zero, a negative
  1444. * number, or a value that is out of range. Currently the upper
  1445. * limit on index is 2^31 items.
  1446. *
  1447. * typeCode:
  1448. * A pointer to a descriptor type or NULL. On return, specifies
  1449. * the descriptor type of the descriptor.
  1450. *
  1451. * dataSize:
  1452. * A pointer to a size variable or NULL. On return, the length (in
  1453. * bytes) of the data in the descriptor.
  1454. *
  1455. * Availability:
  1456. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1457. * CarbonLib: in CarbonLib 1.0 and later
  1458. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1459. }
  1460. function AESizeOfNthItem( const (*var*) theAEDescList: AEDescList; index: SIGNEDLONG; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfNthItem';
  1461. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1462. {
  1463. * AEGetArray()
  1464. *
  1465. * Discussion:
  1466. * Extracts data from an Apple event array created with the
  1467. * AEPutArray function and stores it as a standard array of fixed
  1468. * size items in the specified buffer.
  1469. *
  1470. * Mac OS X threading:
  1471. * Thread safe since version 10.2
  1472. *
  1473. * Parameters:
  1474. *
  1475. * theAEDescList:
  1476. * A pointer to the descriptor list to add a descriptor to. See
  1477. * AEDescList.
  1478. *
  1479. * arrayType:
  1480. * The Apple event array type to convert. Pass one of the
  1481. * constants: kAEDataArray, kAEPackedArray, kAEDescArray,
  1482. * kAEKeyDescArray
  1483. *
  1484. * arrayPtr:
  1485. * A pointer to a buffer, allocated and disposed of by your
  1486. * application, for storing the array. The size in bytes must be
  1487. * at least as large as the value you pass in the maximumSize
  1488. * parameter. On return, the buffer contains the array of
  1489. * fixed-size items.
  1490. *
  1491. * maximumSize:
  1492. * The maximum length, in bytes, of the expected data. The
  1493. * AEGetArray function will not return more data than you specify
  1494. * in this parameter.
  1495. *
  1496. * itemType:
  1497. * A pointer to a descriptor type. On return, for arrays of type
  1498. * kAEDataArray, kAEPackedArray, or kAEHandleArray, the descriptor
  1499. * type of the items in the returned array. The AEGetArray
  1500. * function doesn't supply a value in itemType for arrays of type
  1501. * kAEDescArray and kAEKeyDescArray because they may contain
  1502. * descriptors of different types.
  1503. *
  1504. * itemSize:
  1505. * A pointer to a size variable. On return, for arrays of type
  1506. * kAEDataArray or kAEPackedArray, the size (in bytes) of each
  1507. * item in the returned array. You don't get an item size for
  1508. * arrays of type kAEDescArray, kAEKeyDescArray, or kAEHandleArray
  1509. * because descriptors and handles (though not the data they point
  1510. * to) have a known size.
  1511. *
  1512. * itemCount:
  1513. * A pointer to a size variable. On return, the number of items in
  1514. * the returned array. Currently the upper limit on the size of
  1515. * an array is 2^31 items.
  1516. *
  1517. * Availability:
  1518. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1519. * CarbonLib: in CarbonLib 1.0 and later
  1520. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1521. }
  1522. function AEGetArray( const (*var*) theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; var itemType: DescType; var itemSize: Size; var itemCount: SIGNEDLONG ): OSErr; external name '_AEGetArray';
  1523. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1524. {
  1525. * AEPutArray()
  1526. *
  1527. * Discussion:
  1528. * Extracts data from an Apple event array created with the
  1529. * AEPutArray function and stores it as a standard array of fixed
  1530. * size items in the specified buffer.
  1531. *
  1532. * Mac OS X threading:
  1533. * Thread safe since version 10.2
  1534. *
  1535. * Parameters:
  1536. *
  1537. * theAEDescList:
  1538. * A pointer to the descriptor list to add a descriptor to. See
  1539. * AEDescList.
  1540. *
  1541. * arrayType:
  1542. * The Apple event array type to convert. Pass one of the
  1543. * constants: kAEDataArray, kAEPackedArray, kAEDescArray,
  1544. * kAEKeyDescArray
  1545. *
  1546. * arrayPtr:
  1547. * A pointer to a buffer, local variable, or other storage
  1548. * location, created and disposed of by your application, that
  1549. * contains the array to put into the descriptor list.
  1550. *
  1551. * itemType:
  1552. * For arrays of type kAEDataArray, kAEPackedArray, or
  1553. * kAEHandleArray, the descriptor type of the array items to
  1554. * create. Use one of the constants such as typeLongInteger. You
  1555. * don't need to specify an item type for arrays of type
  1556. * kAEDescArray or kAEKeyDescArray because the data is already
  1557. * stored in descriptors which contain a descriptor type.
  1558. *
  1559. * itemSize:
  1560. * For arrays of type kAEDataArray or kAEPackedArray, the size (in
  1561. * bytes) of the array items to create. You don't need to specify
  1562. * an item size for arrays of type kAEDescArray, kAEKeyDescArray,
  1563. * or kAEHandleArray because their descriptors (though not the
  1564. * data they point to) have a known size.
  1565. *
  1566. * itemCount:
  1567. * A pointer to a size variable. On return, the number of items in
  1568. * the returned array. Currently the upper limit on the size of
  1569. * an array is 2^31 items.
  1570. *
  1571. * Availability:
  1572. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1573. * CarbonLib: in CarbonLib 1.0 and later
  1574. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1575. }
  1576. function AEPutArray( var theAEDescList: AEDescList; arrayType: AEArrayType; const (*var*) arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: SIGNEDLONG ): OSErr; external name '_AEPutArray';
  1577. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1578. {
  1579. * AEDeleteItem()
  1580. *
  1581. * Discussion:
  1582. * Deletes a descriptor from a descriptor list, causing all
  1583. * subsequent descriptors to move up one place.
  1584. *
  1585. * Mac OS X threading:
  1586. * Thread safe since version 10.2
  1587. *
  1588. * Parameters:
  1589. *
  1590. * theAEDescList:
  1591. * A pointer to the descriptor list to add a descriptor to. See
  1592. * AEDescList.
  1593. *
  1594. * index:
  1595. * A one-based positive integer indicating the position in the
  1596. * descriptor list of the descriptor to delete. AEDeleteItem
  1597. * returns an error if you pass zero, a negative number, or a
  1598. * value that is out of range. Currently the upper limit on index
  1599. * is 2^31 items.
  1600. *
  1601. * Availability:
  1602. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1603. * CarbonLib: in CarbonLib 1.0 and later
  1604. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1605. }
  1606. function AEDeleteItem( var theAEDescList: AEDescList; index: SIGNEDLONG ): OSErr; external name '_AEDeleteItem';
  1607. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1608. {*************************************************************************
  1609. The following calls apply to AERecord. Since AERecord is a subtype of
  1610. AEDescList, the calls in the previous sections can also be used for
  1611. AERecord an AERecord can be created by using AECreateList with isRecord
  1612. set to true.
  1613. *************************************************************************}
  1614. {************************************************************************
  1615. AERecords can have an abitrary descriptorType. This allows you to
  1616. check if desc is truly an AERecord
  1617. ***********************************************************************}
  1618. {
  1619. * AECheckIsRecord()
  1620. *
  1621. * Mac OS X threading:
  1622. * Thread safe since version 10.2
  1623. *
  1624. * Availability:
  1625. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1626. * CarbonLib: in CarbonLib 1.4 and later
  1627. * Non-Carbon CFM: not available
  1628. }
  1629. function AECheckIsRecord( const (*var*) theDesc: AEDesc ): Boolean; external name '_AECheckIsRecord';
  1630. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1631. {*************************************************************************
  1632. The following calls create and manipulate the AppleEvent data type.
  1633. *************************************************************************}
  1634. {
  1635. * AECreateAppleEvent()
  1636. *
  1637. * Summary:
  1638. * Creates an Apple event with several important attributes but no
  1639. * parameters.
  1640. *
  1641. * Discussion:
  1642. * The AECreateAppleEvent function creates an empty Apple event. You
  1643. * can add parameters to the Apple event after you create it with
  1644. * the functions described in "Adding Parameters and Attributes to
  1645. * an Apple Event".
  1646. *
  1647. * Mac OS X threading:
  1648. * Thread safe since version 10.2
  1649. *
  1650. * Parameters:
  1651. *
  1652. * theAEEventClass:
  1653. * The event class of the Apple event to create. This parameter
  1654. * becomes accessible through the keyEventClassAttr attribute of
  1655. * the Apple event. Some event classes are described in "Event
  1656. * Class Constants".
  1657. *
  1658. * theAEEventID:
  1659. * The event ID of the Apple event to create. This parameter
  1660. * becomes accessible through the keyEventIDAttr attribute of the
  1661. * Apple event.
  1662. *
  1663. * target:
  1664. * A pointer to an address descriptor. Before calling
  1665. * AECreateAppleEvent, you set the descriptor to identify the
  1666. * target (or server) application for the Apple event. This
  1667. * parameter becomes accessible through the keyAddressAttr
  1668. * attribute of the Apple event.
  1669. *
  1670. * returnID:
  1671. * The return ID for the created Apple event. If you pass a value
  1672. * of kAutoGenerateReturnID, the Apple Event Manager assigns the
  1673. * created Apple event a return ID that is unique to the current
  1674. * session. If you pass any other value, the Apple Event Manager
  1675. * assigns that value for the ID. This parameter becomes
  1676. * accessible through the keyReturnIDAttr attribute of the Apple
  1677. * event. The return ID constant is described in "ID Constants for
  1678. * the AECreateAppleEvent Function".
  1679. *
  1680. * transactionID:
  1681. * The transaction ID for this Apple event. A transaction is a
  1682. * sequence of Apple events that are sent back and forth between
  1683. * the client and server applications, beginning with the client's
  1684. * initial request for a service. All Apple events that are part
  1685. * of a transaction must have the same transaction ID. You can
  1686. * specify the kAnyTransactionID constant if the Apple event is
  1687. * not one of a series of interdependent Apple events. This
  1688. * parameter becomes accessible through the keyTransactionIDAttr
  1689. * attribute of the Apple event.
  1690. *
  1691. * result:
  1692. * A pointer to an Apple event. On successful return, the new
  1693. * Apple event. On error, a null descriptor (one with descriptor
  1694. * type typeNull). If the function returns successfully, your
  1695. * application should call the AEDisposeDesc function to dispose
  1696. * of the resulting Apple event after it has finished using it.
  1697. * See the AppleEvent data type.
  1698. *
  1699. * Availability:
  1700. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1701. * CarbonLib: in CarbonLib 1.0 and later
  1702. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1703. }
  1704. function AECreateAppleEvent( theAEEventClass: AEEventClass; theAEEventID: AEEventID; const (*var*) target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; var result: AppleEvent ): OSErr; external name '_AECreateAppleEvent';
  1705. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1706. {*************************************************************************
  1707. The following calls are used to pack and unpack parameters from records
  1708. of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  1709. in the previous sections can also be used for variables of type
  1710. AppleEvent. The next six calls are in fact identical to the six calls
  1711. for AERecord.
  1712. *************************************************************************}
  1713. {
  1714. * AEPutParamPtr()
  1715. *
  1716. * Discussion:
  1717. * Puts a pointer to data, a descriptor type, and a keyword into an
  1718. * Apple event or Apple event record as an Apple event parameter.
  1719. *
  1720. * Mac OS X threading:
  1721. * Thread safe since version 10.2
  1722. *
  1723. * Parameters:
  1724. *
  1725. * theAppleEvent:
  1726. * A pointer to the Apple event to add a parameter to. See the
  1727. * AppleEvent data type.
  1728. *
  1729. * theAEKeyword:
  1730. * The keyword for the parameter to add. If the Apple event
  1731. * already includes an parameter with this keyword, the parameter
  1732. * is replaced.
  1733. *
  1734. * typeCode:
  1735. * The descriptor type for the parameter to add.
  1736. *
  1737. * dataPtr:
  1738. * A pointer to the data for the parameter to add.
  1739. *
  1740. * dataSize:
  1741. * The length, in bytes, of the data for the parameter to add.
  1742. *
  1743. * Availability:
  1744. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1745. * CarbonLib: in CarbonLib 1.0 and later
  1746. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1747. }
  1748. function AEPutParamPtr( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutParamPtr';
  1749. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1750. {
  1751. * AEPutParamDesc()
  1752. *
  1753. * Discussion:
  1754. * Puts a descriptor and a keyword into an Apple event or Apple
  1755. * event record as an Apple event parameter.
  1756. *
  1757. * Mac OS X threading:
  1758. * Thread safe since version 10.2
  1759. *
  1760. * Parameters:
  1761. *
  1762. * theAppleEvent:
  1763. * A pointer to the Apple event to add a parameter to.
  1764. *
  1765. * theAEKeyword:
  1766. * The keyword specifying the parameter to add. If the Apple event
  1767. * already has a parameter with this keyword, the parameter is
  1768. * replaced.
  1769. *
  1770. * theAEDesc:
  1771. * A pointer to the descriptor for the parameter to add. See
  1772. * AEDesc.
  1773. *
  1774. * Availability:
  1775. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1776. * CarbonLib: in CarbonLib 1.0 and later
  1777. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1778. }
  1779. function AEPutParamDesc( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutParamDesc';
  1780. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1781. {
  1782. * AEGetParamPtr()
  1783. *
  1784. * Summary:
  1785. * Gets a copy of the data for a specified Apple event parameter
  1786. * from an Apple event or an Apple event record (type AERecord);
  1787. * typically used when your application needs to work with the
  1788. * extracted data directly.
  1789. *
  1790. * Discussion:
  1791. * You should use this function only to extract data from value
  1792. * descriptors such as typeUTF8Text.
  1793. * Because this function allows you to specify a desired type, it
  1794. * can result in coercion. When used correctly, this has the
  1795. * positive effect of returning the data in the desired format.
  1796. * However, it can have side effects you may not be expecting, such
  1797. * as the overhead of calls to coercion handlers. See also the
  1798. * Version Notes section below for possible problems with
  1799. * coercion.
  1800. * To get Apple event parameter data for your application to use
  1801. * directly, call AEGetParamPtr. To get a descriptor for an Apple
  1802. * event parameter to pass on to another Apple Event Manager
  1803. * routine, call AEGetParamDesc.
  1804. * Before calling AEGetParamPtr, you can call the AESizeOfParam
  1805. * function to determine a size for the dataPtr buffer. However,
  1806. * unless you specify typeWildCard for the desiredType parameter,
  1807. * AEGetParamPtr may coerce the data, which may cause the size of
  1808. * the data to change.
  1809. * In some cases, you may get improved efficiency extracting
  1810. * information from an Apple event with the AEGetDescDataRange
  1811. * function.
  1812. *
  1813. * Mac OS X threading:
  1814. * Thread safe since version 10.2
  1815. *
  1816. * Parameters:
  1817. *
  1818. * theAppleEvent:
  1819. * A pointer to the Apple event to get the parameter data from.
  1820. * See AppleEvent.
  1821. *
  1822. * theAEKeyword:
  1823. * The keyword that specifies the desired Apple event parameter.
  1824. *
  1825. * desiredType:
  1826. * The desired descriptor type for the copied data. If the
  1827. * descriptor specified by the theAEKeyword parameter is not of
  1828. * the desired type, AEGetParamPtr attempts to coerce the data to
  1829. * this type. However, if the desired type is typeWildCard, no
  1830. * coercion is performed. On return, you can determine the actual
  1831. * descriptor type by examining the typeCode parameter.
  1832. *
  1833. * actualType:
  1834. * A pointer to a descriptor type. On return, specifies the
  1835. * descriptor type of the data pointed to by dataPtr. The returned
  1836. * type is either the same as the type specified by the
  1837. * desiredType parameter or, if the desired type was typeWildcard,
  1838. * the true type of the descriptor. Specify NULL if you do not
  1839. * care about this return value.
  1840. *
  1841. * dataPtr:
  1842. * A pointer to a buffer, local variable, or other storage
  1843. * location created and disposed of by your application. The size
  1844. * in bytes must be at least as large as the value you pass in the
  1845. * maximumSize parameter. On return, contains the parameter data.
  1846. * Specify NULL if you do not care about this return value.
  1847. *
  1848. * maximumSize:
  1849. * The maximum length, in bytes, of the expected Apple event
  1850. * parameter data. The AEGetParamPtr function will not return more
  1851. * data than you specify in this parameter.
  1852. *
  1853. * actualSize:
  1854. * A pointer to a variable of type Size. On return, the length, in
  1855. * bytes, of the data for the specified Apple event parameter. If
  1856. * this value is larger than the value you passed in the
  1857. * maximumSize parameter, the buffer pointed to by dataPtr was not
  1858. * large enough to contain all of the data for the parameter,
  1859. * though AEGetParamPtr does not write beyond the end of the
  1860. * buffer. If the buffer was too small, you can resize it and call
  1861. * AEGetParamPtr again. Specify NULL if you do not care about this
  1862. * return value.
  1863. *
  1864. * Availability:
  1865. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1866. * CarbonLib: in CarbonLib 1.0 and later
  1867. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1868. }
  1869. function AEGetParamPtr( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; actualType: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetParamPtr';
  1870. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1871. {
  1872. * AEGetParamDesc()
  1873. *
  1874. * Summary:
  1875. * Gets a copy of the descriptor for a keyword-specified Apple event
  1876. * parameter from an Apple event or an Apple event record (type
  1877. * AERecord); typically used when your application needs to pass the
  1878. * extracted data to another function as a descriptor.
  1879. *
  1880. * Discussion:
  1881. * To get Apple event parameter data for your application to use
  1882. * directly, call AEGetParamPtr. To get a descriptor for an Apple
  1883. * event parameter to pass on to another Apple Event Manager
  1884. * routine, call AEGetParamDesc.
  1885. * If the actual parameter you are getting with AEGetParamDesc is a
  1886. * record, AEGetParamDesc will only allow you to request it as a
  1887. * typeAERecord, typeAEList, or typeWildcard. For any other type, it
  1888. * will return errAECoercionFail.
  1889. *
  1890. * Mac OS X threading:
  1891. * Thread safe since version 10.2
  1892. *
  1893. * Parameters:
  1894. *
  1895. * theAppleEvent:
  1896. * A pointer to the Apple event to get the parameter descriptor
  1897. * from.
  1898. *
  1899. * theAEKeyword:
  1900. * A keyword that specifies the desired Apple event parameter.
  1901. *
  1902. * desiredType:
  1903. * The descriptor type for the desired Apple event parameter. If
  1904. * the requested Apple event parameter is not of the desired type,
  1905. * the Apple Event Manager attempts to coerce it to the desired
  1906. * type. However, if you pass a value of typeWildCard, no coercion
  1907. * is performed, and the descriptor type of the returned
  1908. * descriptor is the same as the descriptor type of the Apple
  1909. * event parameter.
  1910. *
  1911. * result:
  1912. * A pointer to a descriptor. On successful return, a copy of the
  1913. * descriptor for the specified Apple event parameter, coerced, if
  1914. * necessary, to the descriptor type specified by the desiredType
  1915. * parameter. On error, a null descriptor. If the function returns
  1916. * successfully, your application should call the AEDisposeDesc
  1917. * function to dispose of the resulting descriptor after it has
  1918. * finished using it. See AEDesc.
  1919. *
  1920. * Availability:
  1921. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1922. * CarbonLib: in CarbonLib 1.0 and later
  1923. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1924. }
  1925. function AEGetParamDesc( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc ): OSErr; external name '_AEGetParamDesc';
  1926. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1927. {
  1928. * AESizeOfParam()
  1929. *
  1930. * Discussion:
  1931. * Gets the size and descriptor type of an Apple event parameter
  1932. * from a descriptor of type AERecord or AppleEvent.
  1933. *
  1934. * Mac OS X threading:
  1935. * Thread safe since version 10.2
  1936. *
  1937. * Parameters:
  1938. *
  1939. * theAppleEvent:
  1940. * A pointer to the Apple event to get the parameter data from.
  1941. * See AppleEvent.
  1942. *
  1943. * theAEKeyword:
  1944. * The keyword that specifies the desired parameter.
  1945. *
  1946. * typeCode:
  1947. * A pointer to a descriptor type. On return, specifies the
  1948. * descriptor type of the Apple event parameter.
  1949. *
  1950. * dataSize:
  1951. * A pointer to a size variable. On return, the length, in bytes,
  1952. * of the data in the Apple event parameter.
  1953. *
  1954. * Availability:
  1955. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1956. * CarbonLib: in CarbonLib 1.0 and later
  1957. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1958. }
  1959. function AESizeOfParam( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfParam';
  1960. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1961. {
  1962. * AEDeleteParam()
  1963. *
  1964. * Discussion:
  1965. * Deletes a keyword-specified parameter from an Apple event or
  1966. * Apple event record.
  1967. *
  1968. * Mac OS X threading:
  1969. * Thread safe since version 10.2
  1970. *
  1971. * Parameters:
  1972. *
  1973. * theAppleEvent:
  1974. * A pointer to the Apple event or Apple event record to delete
  1975. * the parameter from.
  1976. *
  1977. * theAEKeyword:
  1978. * The keyword that specifies the parameter to delete.
  1979. *
  1980. * Availability:
  1981. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1982. * CarbonLib: in CarbonLib 1.0 and later
  1983. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1984. }
  1985. function AEDeleteParam( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword ): OSErr; external name '_AEDeleteParam';
  1986. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  1987. {*************************************************************************
  1988. The following calls also apply to type AppleEvent. Message attributes are
  1989. far more restricted, and can only be accessed through the following 5
  1990. calls. The various list and record routines cannot be used to access the
  1991. attributes of an event.
  1992. *************************************************************************}
  1993. {
  1994. * AEGetAttributePtr()
  1995. *
  1996. * Summary:
  1997. * Gets a copy of the data for a specified Apple event attribute
  1998. * from an Apple event; typically used when your application needs
  1999. * to work with the data directly.
  2000. *
  2001. * Discussion:
  2002. * To get Apple event attribute data for your application to use
  2003. * directly, call AEGetAttributePtr. To get a descriptor for an
  2004. * Apple event attribute to pass on to another Apple Event Manager
  2005. * routine, call AEGetAttributeDesc.
  2006. * Before calling AEGetAttributePtr, you can call the
  2007. * AESizeOfAttribute function to determine a size for the dataPtr
  2008. * buffer. However, unless you specify typeWildCard for the
  2009. * desiredType parameter, AEGetAttributePtr may coerce the data,
  2010. * which may cause the size of the data to change.
  2011. *
  2012. * Mac OS X threading:
  2013. * Thread safe since version 10.2
  2014. *
  2015. * Parameters:
  2016. *
  2017. * theAppleEvent:
  2018. * A pointer to the Apple event to get the attribute data from.
  2019. *
  2020. * theAEKeyword:
  2021. * The keyword that specifies the desired attribute.
  2022. *
  2023. * desiredType:
  2024. * The desired descriptor type for the copied data. If the
  2025. * descriptor specified by the theAEKeyword parameter is not of
  2026. * the desired type, AEGetAttributePtr attempts to coerce the data
  2027. * to this type. However, if you pass a value of typeWildCard, no
  2028. * coercion is performed, and the descriptor type of the returned
  2029. * data is the same as the descriptor type of the Apple event
  2030. * attribute. On return, you can determine the actual descriptor
  2031. * type by examining the typeCode parameter.
  2032. *
  2033. * typeCode:
  2034. * A pointer to a descriptor type. On return, specifies the
  2035. * descriptor type of the attribute data pointed to by dataPtr.
  2036. * The returned type is either the same as the type specified by
  2037. * the desiredType parameter or, if the desired type was type
  2038. * wildcard, the true type of the descriptor. For a list of
  2039. * AppleScript's predefined descriptor types, see "Descriptor Type
  2040. * Constants". See DescType.
  2041. *
  2042. * dataPtr:
  2043. * A pointer to a buffer, local variable, or other storage
  2044. * location, created and disposed of by your application. The size
  2045. * in bytes must be at least as large as the value you pass in the
  2046. * maximumSize parameter. On return, contains the attribute data.
  2047. *
  2048. * maximumSize:
  2049. * The maximum length, in bytes, of the expected attribute data.
  2050. * The AEGetAttributePtr function will not return more data than
  2051. * you specify in this parameter.
  2052. *
  2053. * actualSize:
  2054. * A pointer to a size variable. On return, the length, in bytes,
  2055. * of the data for the specified Apple event attribute. If this
  2056. * value is larger than the value you passed in the maximumSize
  2057. * parameter, the buffer pointed to by dataPtr was not large
  2058. * enough to contain all of the data for the attribute, though
  2059. * AEGetAttributePtr does not write beyond the end of the buffer.
  2060. * If the buffer was too small, you can resize it and call
  2061. * AEGetAttributePtr again.
  2062. *
  2063. * Availability:
  2064. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2065. * CarbonLib: in CarbonLib 1.0 and later
  2066. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2067. }
  2068. function AEGetAttributePtr( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; typeCode: DescTypePtr { can be NULL }; dataPtr: UnivPtr; maximumSize: Size; actualSize: SizePtr { can be NULL } ): OSErr; external name '_AEGetAttributePtr';
  2069. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2070. {
  2071. * AEGetAttributeDesc()
  2072. *
  2073. * Summary:
  2074. * Gets a copy of the descriptor for a specified Apple event
  2075. * attribute from an Apple event; typically used when your
  2076. * application needs to pass the descriptor on to another function.
  2077. *
  2078. * Discussion:
  2079. * To get Apple event attribute data for your application to use
  2080. * directly, call AEGetAttributePtr. To get a descriptor for an
  2081. * Apple event attribute to pass on to another Apple Event Manager
  2082. * routine, call AEGetAttributeDesc.
  2083. *
  2084. * Mac OS X threading:
  2085. * Thread safe since version 10.2
  2086. *
  2087. * Parameters:
  2088. *
  2089. * theAppleEvent:
  2090. * A pointer to the Apple event to get the attribute descriptor
  2091. * from. See AppleEvent.
  2092. *
  2093. * theAEKeyword:
  2094. * The keyword that specifies the desired attribute.
  2095. *
  2096. * desiredType:
  2097. * The desired descriptor type for the copied data. If the
  2098. * descriptor specified by the theAEKeyword parameter is not of
  2099. * the desired type, AEGetAttributePtr attempts to coerce the data
  2100. * to this type. However, if you pass a value of typeWildCard, no
  2101. * coercion is performed, and the descriptor type of the returned
  2102. * data is the same as the descriptor type of the Apple event
  2103. * attribute. On return, you can determine the actual descriptor
  2104. * type by examining the typeCode parameter.
  2105. *
  2106. * result:
  2107. * A pointer to a descriptor. On successful return, a copy of the
  2108. * specified Apple event attribute, coerced, if necessary, to the
  2109. * descriptor type specified in desiredType. On error, a null
  2110. * descriptor. If the function returns successfully, your
  2111. * application should call the AEDisposeDesc function to dispose
  2112. * of the resulting descriptor after it has finished using it. See
  2113. * AEDesc.
  2114. *
  2115. * Availability:
  2116. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2117. * CarbonLib: in CarbonLib 1.0 and later
  2118. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2119. }
  2120. function AEGetAttributeDesc( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var result: AEDesc ): OSErr; external name '_AEGetAttributeDesc';
  2121. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2122. {
  2123. * AESizeOfAttribute()
  2124. *
  2125. * Discussion:
  2126. * Gets the size and descriptor type of an Apple event attribute
  2127. * from a descriptor of type AppleEvent.
  2128. *
  2129. * Mac OS X threading:
  2130. * Thread safe since version 10.2
  2131. *
  2132. * Parameters:
  2133. *
  2134. * theAppleEvent:
  2135. * A pointer to the Apple event to get the attribute data from.
  2136. *
  2137. * theAEKeyword:
  2138. * The keyword that specifies the attribute.
  2139. *
  2140. * typeCode:
  2141. * A pointer to a descriptor type. On return, specifies the
  2142. * descriptor type of the attribute. Can be NULL.
  2143. *
  2144. * dataSize:
  2145. * A pointer to a size variable. On return, the length, in bytes,
  2146. * of the data in the attribute. Can be NULL.
  2147. *
  2148. * Availability:
  2149. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2150. * CarbonLib: in CarbonLib 1.0 and later
  2151. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2152. }
  2153. function AESizeOfAttribute( const (*var*) theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescTypePtr { can be NULL }; dataSize: SizePtr { can be NULL } ): OSErr; external name '_AESizeOfAttribute';
  2154. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2155. {
  2156. * AEPutAttributePtr()
  2157. *
  2158. * Discussion:
  2159. * Adds a pointer to data, a descriptor type, and a keyword to an
  2160. * Apple event as an attribute.
  2161. *
  2162. * Mac OS X threading:
  2163. * Thread safe since version 10.2
  2164. *
  2165. * Parameters:
  2166. *
  2167. * theAppleEvent:
  2168. * A pointer to the Apple event to add an attribute to. See the
  2169. * AppleEvent data type.
  2170. *
  2171. * theAEKeyword:
  2172. * The keyword for the attribute to add. If the Apple event
  2173. * already includes an attribute with this keyword, the attribute
  2174. * is replaced.
  2175. *
  2176. * typeCode:
  2177. * The descriptor type for the attribute to add.
  2178. *
  2179. * dataPtr:
  2180. * A pointer to the data for the attribute to add.
  2181. *
  2182. * dataSize:
  2183. * The length, in bytes, of the data for the attribute to add.
  2184. *
  2185. * Availability:
  2186. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2187. * CarbonLib: in CarbonLib 1.0 and later
  2188. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2189. }
  2190. function AEPutAttributePtr( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size ): OSErr; external name '_AEPutAttributePtr';
  2191. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2192. {
  2193. * AEPutAttributeDesc()
  2194. *
  2195. * Summary:
  2196. * Adds a descriptor and a keyword to an Apple event as an attribute.
  2197. *
  2198. * Discussion:
  2199. * The AEPutAttributeDesc function takes a descriptor and a keyword
  2200. * and adds them to an Apple event as an attribute. If the
  2201. * descriptor type required for the attribute is different from the
  2202. * descriptor type of the descriptor, the Apple Event Manager
  2203. * attempts to coerce the descriptor into the required type, with
  2204. * one exception: the Apple Event Manager does not attempt to coerce
  2205. * the data for an address attribute, thereby allowing applications
  2206. * to use their own address types.
  2207. *
  2208. * Mac OS X threading:
  2209. * Thread safe since version 10.2
  2210. *
  2211. * Parameters:
  2212. *
  2213. * theAppleEvent:
  2214. * A pointer to the Apple event to add an attribute to. See the
  2215. * AppleEvent data type.
  2216. *
  2217. * theAEKeyword:
  2218. * The keyword for the attribute to add. If the Apple event
  2219. * already includes an attribute with this keyword, the attribute
  2220. * is replaced.
  2221. *
  2222. * theAEDesc:
  2223. * A pointer to the descriptor to assign to the attribute. The
  2224. * descriptor type of the specified descriptor should match the
  2225. * defined descriptor type for that attribute.
  2226. *
  2227. * Availability:
  2228. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2229. * CarbonLib: in CarbonLib 1.0 and later
  2230. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2231. }
  2232. function AEPutAttributeDesc( var theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; const (*var*) theAEDesc: AEDesc ): OSErr; external name '_AEPutAttributeDesc';
  2233. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2234. {*************************************************************************
  2235. AppleEvent Serialization Support
  2236. AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
  2237. These calls will work for all AppleEvent data types and between different
  2238. versions of the OS (including between Mac OS 9 and X)
  2239. Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
  2240. themselves may not be reliably flattened for storage.
  2241. *************************************************************************}
  2242. {
  2243. * AESizeOfFlattenedDesc()
  2244. *
  2245. * Discussion:
  2246. * Returns the amount of buffer space needed to flatten the AEDesc.
  2247. * Call this before AEFlattenDesc to make sure your buffer has
  2248. * enough room for the operation.
  2249. *
  2250. * Mac OS X threading:
  2251. * Thread safe since version 10.2
  2252. *
  2253. * Parameters:
  2254. *
  2255. * theAEDesc:
  2256. * A pointer to the descriptor to be flattened.
  2257. *
  2258. * Availability:
  2259. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2260. * CarbonLib: in CarbonLib 1.4 and later
  2261. * Non-Carbon CFM: not available
  2262. }
  2263. function AESizeOfFlattenedDesc( const (*var*) theAEDesc: AEDesc ): Size; external name '_AESizeOfFlattenedDesc';
  2264. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2265. {
  2266. * AEFlattenDesc()
  2267. *
  2268. * Discussion:
  2269. * Fills a buffer with a flattened representation of the AEDesc and
  2270. * returns the amount of buffer used in actualSize. If bufferSize
  2271. * was too small it returns errAEBufferTooSmall (-1741) and does not
  2272. * fill in any of the buffer. The resulting buffer is only useful
  2273. * with an AEUnflattenDesc call.
  2274. * Note: if you pass a NULL buffer pointer it returns noErr but
  2275. * fills in the actualSize field anyway.
  2276. *
  2277. * Mac OS X threading:
  2278. * Thread safe since version 10.2
  2279. *
  2280. * Parameters:
  2281. *
  2282. * theAEDesc:
  2283. * A pointer to the descriptor to be flattened.
  2284. *
  2285. * buffer:
  2286. * A pointer to memory, allocated by the application, where the
  2287. * flattened data will be stored. See the bufferSize parameter for
  2288. * information on how large a buffer you should allocate.
  2289. *
  2290. * bufferSize:
  2291. * The size of the buffer pointed to by buffer. Prior to calling
  2292. * AEFlattenDesc, you call the AESizeOfFlattenedDesc function to
  2293. * determine the required size of the buffer for the flatten
  2294. * operation.
  2295. * If bufferSize is too small, AEFlattenDesc returns
  2296. * errAEBufferTooSmall and doesn't store any data in the buffer.
  2297. *
  2298. * actualSize:
  2299. * A pointer to a size variable. On return, the variable contains
  2300. * the actual size of the flattened data. You can specify NULL for
  2301. * this parameter if you do not care about the returned size.
  2302. *
  2303. * Availability:
  2304. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2305. * CarbonLib: in CarbonLib 1.4 and later
  2306. * Non-Carbon CFM: not available
  2307. }
  2308. function AEFlattenDesc( const (*var*) theAEDesc: AEDesc; buffer: Ptr; bufferSize: Size; var actualSize: Size ): OSStatus; external name '_AEFlattenDesc';
  2309. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2310. {
  2311. * AEUnflattenDesc()
  2312. *
  2313. * Discussion:
  2314. * Allocates an AEDesc (given a Null Desc) given a flattened data
  2315. * buffer. It assumes it was given a good buffer filled in by
  2316. * AEFlattenDesc. It returns paramErr if it discovers something
  2317. * fishy about the buffer.
  2318. *
  2319. * Mac OS X threading:
  2320. * Thread safe since version 10.2
  2321. *
  2322. * Parameters:
  2323. *
  2324. * buffer:
  2325. * A pointer to memory, allocated by the application, that
  2326. * contains flattened data produced by a previous call to
  2327. * AEFlattenDesc.
  2328. *
  2329. * result:
  2330. * A null descriptor. On successful completion, points to a
  2331. * descriptor created from the flattened data. The caller is
  2332. * responsible for disposing of the descriptor.
  2333. *
  2334. * Availability:
  2335. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2336. * CarbonLib: in CarbonLib 1.4 and later
  2337. * Non-Carbon CFM: not available
  2338. }
  2339. function AEUnflattenDesc( buffer: {const} UnivPtr; var result: AEDesc ): OSStatus; external name '_AEUnflattenDesc';
  2340. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2341. {*************************************************************************
  2342. The following calls are necessary to deal with opaque data in AEDescs, because the
  2343. traditional way of dealing with a basic AEDesc has been to dereference the dataHandle
  2344. directly. This is not supported under Carbon.
  2345. *************************************************************************}
  2346. {
  2347. AEGetDescData no longer supports automatic coercion. If you'd like to
  2348. coerce the descriptor use AECoerceDesc.
  2349. }
  2350. {
  2351. * AEGetDescData()
  2352. *
  2353. * Discussion:
  2354. * Gets the data from the specified descriptor. AEGetDescData no
  2355. * longer supports automatic coercion. If you'd like to coerce the
  2356. * descriptor use AECoerceDesc.
  2357. *
  2358. * Mac OS X threading:
  2359. * Thread safe since version 10.2
  2360. *
  2361. * Parameters:
  2362. *
  2363. * theAEDesc:
  2364. * A pointer to the descriptor to get the data from.
  2365. *
  2366. * dataPtr:
  2367. * A pointer to a buffer, local variable, or other storage
  2368. * location created and disposed of by your application. The size
  2369. * in bytes should be the same as the value you pass in the
  2370. * maximumSize parameter. On return, contains the data from the
  2371. * descriptor.
  2372. *
  2373. * maximumSize:
  2374. * The length, in bytes, of the expected descriptor data. The
  2375. * AEGetDescData function will not return more data than you
  2376. * specify in this parameter. You typically determine the maximum
  2377. * size by calling AEGetDescDataSize.
  2378. *
  2379. * Availability:
  2380. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2381. * CarbonLib: in CarbonLib 1.0 and later
  2382. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  2383. }
  2384. function AEGetDescData( const (*var*) theAEDesc: AEDesc; dataPtr: UnivPtr; maximumSize: Size ): OSErr; external name '_AEGetDescData';
  2385. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2386. {
  2387. * AEGetDescDataSize()
  2388. *
  2389. * Discussion:
  2390. * Gets the size, in bytes, of the data in the specified descriptor.
  2391. *
  2392. * Mac OS X threading:
  2393. * Thread safe since version 10.2
  2394. *
  2395. * Parameters:
  2396. *
  2397. * theAEDesc:
  2398. * A pointer to the descriptor to obtain the data size for. See
  2399. * AEDesc.
  2400. *
  2401. * Availability:
  2402. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2403. * CarbonLib: in CarbonLib 1.0 and later
  2404. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  2405. }
  2406. function AEGetDescDataSize( const (*var*) theAEDesc: AEDesc ): Size; external name '_AEGetDescDataSize';
  2407. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2408. {
  2409. * AEReplaceDescData()
  2410. *
  2411. * Discussion:
  2412. * Copies the specified data into the specified descriptor,
  2413. * replacing any previous data.
  2414. *
  2415. * Mac OS X threading:
  2416. * Thread safe since version 10.2
  2417. *
  2418. * Parameters:
  2419. *
  2420. * typeCode:
  2421. * Specifies the descriptor type of the data pointed to by dataPtr.
  2422. *
  2423. * dataPtr:
  2424. * A pointer to the data to store in the specified descriptor.
  2425. *
  2426. * dataSize:
  2427. * The size, in bytes, of the data pointed to by the dataSize
  2428. * parameter.
  2429. *
  2430. * theAEDesc:
  2431. * A pointer to a descriptor. On return, contains the copied data.
  2432. *
  2433. * Availability:
  2434. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2435. * CarbonLib: in CarbonLib 1.0 and later
  2436. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  2437. }
  2438. function AEReplaceDescData( typeCode: DescType; dataPtr: {const} UnivPtr; dataSize: Size; var theAEDesc: AEDesc ): OSErr; external name '_AEReplaceDescData';
  2439. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2440. {
  2441. * AEGetDescDataRange()
  2442. *
  2443. * Discussion:
  2444. * Retrieve a range of bytes from an AEDesc. This obviates the need
  2445. * to retrieve the entire data from the event using AEGetDescData.
  2446. * This is only valid for data type AEDescs. If the requested
  2447. * length and offset are such that they do not fit entirely with the
  2448. * data of the desc, errAEBufferTooSmall is returned.
  2449. *
  2450. * Mac OS X threading:
  2451. * Thread safe since version 10.2
  2452. *
  2453. * Parameters:
  2454. *
  2455. * dataDesc:
  2456. * A pointer to the descriptor to get the data from.
  2457. *
  2458. * buffer:
  2459. * A pointer to a buffer, local variable, or other storage
  2460. * location created and disposed of by your application. The size
  2461. * in bytes should be at least as large as the value you pass in
  2462. * the length parameter. On return, contains the specified data
  2463. * from the descriptor.
  2464. *
  2465. * offset:
  2466. * The zero-based offset to the data to be retrieved from the
  2467. * descriptor.
  2468. *
  2469. * length:
  2470. * The number of bytes of contiguous data to retrieve.
  2471. *
  2472. * Availability:
  2473. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2474. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2475. * Non-Carbon CFM: not available
  2476. }
  2477. function AEGetDescDataRange( const (*var*) dataDesc: AEDesc; buffer: UnivPtr; offset: Size; length: Size ): OSStatus; external name '_AEGetDescDataRange';
  2478. (* __OSX_AVAILABLE_STARTING( __MAC_10_2, __IPHONE_NA ) *)
  2479. {*************************************************************************
  2480. A AEEventHandler is installed to process an AppleEvent
  2481. *************************************************************************}
  2482. type
  2483. AEEventHandlerProcPtr = function( const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SRefCon ): OSErr;
  2484. AEEventHandlerUPP = AEEventHandlerProcPtr;
  2485. {
  2486. * NewAEDisposeExternalUPP()
  2487. *
  2488. * Availability:
  2489. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2490. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2491. * Non-Carbon CFM: available as macro/inline
  2492. }
  2493. function NewAEDisposeExternalUPP( userRoutine: AEDisposeExternalProcPtr ): AEDisposeExternalUPP; external name '_NewAEDisposeExternalUPP';
  2494. (* __OSX_AVAILABLE_STARTING( __MAC_10_2, __IPHONE_NA ) *)
  2495. {
  2496. * NewAEEventHandlerUPP()
  2497. *
  2498. * Availability:
  2499. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2500. * CarbonLib: in CarbonLib 1.0 and later
  2501. * Non-Carbon CFM: available as macro/inline
  2502. }
  2503. function NewAEEventHandlerUPP( userRoutine: AEEventHandlerProcPtr ): AEEventHandlerUPP; external name '_NewAEEventHandlerUPP';
  2504. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2505. {
  2506. * DisposeAEDisposeExternalUPP()
  2507. *
  2508. * Availability:
  2509. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2510. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2511. * Non-Carbon CFM: available as macro/inline
  2512. }
  2513. procedure DisposeAEDisposeExternalUPP( userUPP: AEDisposeExternalUPP ); external name '_DisposeAEDisposeExternalUPP';
  2514. (* __OSX_AVAILABLE_STARTING( __MAC_10_2, __IPHONE_NA ) *)
  2515. {
  2516. * DisposeAEEventHandlerUPP()
  2517. *
  2518. * Availability:
  2519. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2520. * CarbonLib: in CarbonLib 1.0 and later
  2521. * Non-Carbon CFM: available as macro/inline
  2522. }
  2523. procedure DisposeAEEventHandlerUPP( userUPP: AEEventHandlerUPP ); external name '_DisposeAEEventHandlerUPP';
  2524. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2525. {
  2526. * InvokeAEDisposeExternalUPP()
  2527. *
  2528. * Availability:
  2529. * Mac OS X: in version 10.2 and later in ApplicationServices.framework
  2530. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  2531. * Non-Carbon CFM: available as macro/inline
  2532. }
  2533. procedure InvokeAEDisposeExternalUPP( dataPtr: {const} UnivPtr; dataLength: Size; refcon: SRefCon; userUPP: AEDisposeExternalUPP ); external name '_InvokeAEDisposeExternalUPP';
  2534. (* __OSX_AVAILABLE_STARTING( __MAC_10_2, __IPHONE_NA ) *)
  2535. {
  2536. * InvokeAEEventHandlerUPP()
  2537. *
  2538. * Availability:
  2539. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  2540. * CarbonLib: in CarbonLib 1.0 and later
  2541. * Non-Carbon CFM: available as macro/inline
  2542. }
  2543. function InvokeAEEventHandlerUPP( const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; handlerRefcon: SRefCon; userUPP: AEEventHandlerUPP ): OSErr; external name '_InvokeAEEventHandlerUPP';
  2544. (* __OSX_AVAILABLE_STARTING( __MAC_10_0, __IPHONE_NA ) *)
  2545. {$endc} {TARGET_OS_MAC}
  2546. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  2547. end.
  2548. {$endc} {not MACOSALLINCLUDE}