AEDataModel.pas 106 KB

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