/packages/univint/src/ASRegistry.pas
Pascal | 476 lines | 251 code | 37 blank | 188 comment | 0 complexity | 51c568d41b9731122a04888adde9d076 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
1{ 2 File: OpenScripting/ASRegistry.h 3 4 Contains: AppleScript Registry constants. 5 6 Version: OSA-148~28 7 8 Copyright: � 1991-2008 by Apple Computer, Inc., all rights reserved 9 10 Bugs?: For bug reports, consult the following page on 11 the World Wide Web: 12 13 http://www.freepascal.org/bugs.html 14 15} 16 17{ Pascal Translation Updated: Gorazd Krosl <gorazd_1957@yahoo.ca>, October 2009 } 18{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 } 19{ 20 Modified for use with Free Pascal 21 Version 308 22 Please report any bugs to <gpc@microbizz.nl> 23} 24 25{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE} 26{$mode macpas} 27{$packenum 1} 28{$macro on} 29{$inline on} 30{$calling mwpascal} 31 32unit ASRegistry; 33interface 34{$setc UNIVERSAL_INTERFACES_VERSION := $0400} 35{$setc GAP_INTERFACES_VERSION := $0308} 36 37{$ifc not defined USE_CFSTR_CONSTANT_MACROS} 38 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE} 39{$endc} 40 41{$ifc defined CPUPOWERPC and defined CPUI386} 42 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386} 43{$endc} 44{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN} 45 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN} 46{$endc} 47 48{$ifc not defined __ppc__ and defined CPUPOWERPC32} 49 {$setc __ppc__ := 1} 50{$elsec} 51 {$setc __ppc__ := 0} 52{$endc} 53{$ifc not defined __ppc64__ and defined CPUPOWERPC64} 54 {$setc __ppc64__ := 1} 55{$elsec} 56 {$setc __ppc64__ := 0} 57{$endc} 58{$ifc not defined __i386__ and defined CPUI386} 59 {$setc __i386__ := 1} 60{$elsec} 61 {$setc __i386__ := 0} 62{$endc} 63{$ifc not defined __x86_64__ and defined CPUX86_64} 64 {$setc __x86_64__ := 1} 65{$elsec} 66 {$setc __x86_64__ := 0} 67{$endc} 68{$ifc not defined __arm__ and defined CPUARM} 69 {$setc __arm__ := 1} 70{$elsec} 71 {$setc __arm__ := 0} 72{$endc} 73 74{$ifc defined cpu64} 75 {$setc __LP64__ := 1} 76{$elsec} 77 {$setc __LP64__ := 0} 78{$endc} 79 80 81{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__} 82 {$error Conflicting definitions for __ppc__ and __i386__} 83{$endc} 84 85{$ifc defined __ppc__ and __ppc__} 86 {$setc TARGET_CPU_PPC := TRUE} 87 {$setc TARGET_CPU_PPC64 := FALSE} 88 {$setc TARGET_CPU_X86 := FALSE} 89 {$setc TARGET_CPU_X86_64 := FALSE} 90 {$setc TARGET_CPU_ARM := FALSE} 91 {$setc TARGET_OS_MAC := TRUE} 92 {$setc TARGET_OS_IPHONE := FALSE} 93 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 94 {$setc TARGET_OS_EMBEDDED := FALSE} 95{$elifc defined __ppc64__ and __ppc64__} 96 {$setc TARGET_CPU_PPC := FALSE} 97 {$setc TARGET_CPU_PPC64 := TRUE} 98 {$setc TARGET_CPU_X86 := FALSE} 99 {$setc TARGET_CPU_X86_64 := FALSE} 100 {$setc TARGET_CPU_ARM := FALSE} 101 {$setc TARGET_OS_MAC := TRUE} 102 {$setc TARGET_OS_IPHONE := FALSE} 103 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 104 {$setc TARGET_OS_EMBEDDED := FALSE} 105{$elifc defined __i386__ and __i386__} 106 {$setc TARGET_CPU_PPC := FALSE} 107 {$setc TARGET_CPU_PPC64 := FALSE} 108 {$setc TARGET_CPU_X86 := TRUE} 109 {$setc TARGET_CPU_X86_64 := FALSE} 110 {$setc TARGET_CPU_ARM := FALSE} 111{$ifc defined(iphonesim)} 112 {$setc TARGET_OS_MAC := FALSE} 113 {$setc TARGET_OS_IPHONE := TRUE} 114 {$setc TARGET_IPHONE_SIMULATOR := TRUE} 115{$elsec} 116 {$setc TARGET_OS_MAC := TRUE} 117 {$setc TARGET_OS_IPHONE := FALSE} 118 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 119{$endc} 120 {$setc TARGET_OS_EMBEDDED := FALSE} 121{$elifc defined __x86_64__ and __x86_64__} 122 {$setc TARGET_CPU_PPC := FALSE} 123 {$setc TARGET_CPU_PPC64 := FALSE} 124 {$setc TARGET_CPU_X86 := FALSE} 125 {$setc TARGET_CPU_X86_64 := TRUE} 126 {$setc TARGET_CPU_ARM := FALSE} 127 {$setc TARGET_OS_MAC := TRUE} 128 {$setc TARGET_OS_IPHONE := FALSE} 129 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 130 {$setc TARGET_OS_EMBEDDED := FALSE} 131{$elifc defined __arm__ and __arm__} 132 {$setc TARGET_CPU_PPC := FALSE} 133 {$setc TARGET_CPU_PPC64 := FALSE} 134 {$setc TARGET_CPU_X86 := FALSE} 135 {$setc TARGET_CPU_X86_64 := FALSE} 136 {$setc TARGET_CPU_ARM := TRUE} 137 { will require compiler define when/if other Apple devices with ARM cpus ship } 138 {$setc TARGET_OS_MAC := FALSE} 139 {$setc TARGET_OS_IPHONE := TRUE} 140 {$setc TARGET_IPHONE_SIMULATOR := FALSE} 141 {$setc TARGET_OS_EMBEDDED := TRUE} 142{$elsec} 143 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.} 144{$endc} 145 146{$ifc defined __LP64__ and __LP64__ } 147 {$setc TARGET_CPU_64 := TRUE} 148{$elsec} 149 {$setc TARGET_CPU_64 := FALSE} 150{$endc} 151 152{$ifc defined FPC_BIG_ENDIAN} 153 {$setc TARGET_RT_BIG_ENDIAN := TRUE} 154 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE} 155{$elifc defined FPC_LITTLE_ENDIAN} 156 {$setc TARGET_RT_BIG_ENDIAN := FALSE} 157 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE} 158{$elsec} 159 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.} 160{$endc} 161{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE} 162{$setc CALL_NOT_IN_CARBON := FALSE} 163{$setc OLDROUTINENAMES := FALSE} 164{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE} 165{$setc OPAQUE_UPP_TYPES := TRUE} 166{$setc OTCARBONAPPLICATION := TRUE} 167{$setc OTKERNEL := FALSE} 168{$setc PM_USE_SESSION_APIS := TRUE} 169{$setc TARGET_API_MAC_CARBON := TRUE} 170{$setc TARGET_API_MAC_OS8 := FALSE} 171{$setc TARGET_API_MAC_OSX := TRUE} 172{$setc TARGET_CARBON := TRUE} 173{$setc TARGET_CPU_68K := FALSE} 174{$setc TARGET_CPU_MIPS := FALSE} 175{$setc TARGET_CPU_SPARC := FALSE} 176{$setc TARGET_OS_UNIX := FALSE} 177{$setc TARGET_OS_WIN32 := FALSE} 178{$setc TARGET_RT_MAC_68881 := FALSE} 179{$setc TARGET_RT_MAC_CFM := FALSE} 180{$setc TARGET_RT_MAC_MACHO := TRUE} 181{$setc TYPED_FUNCTION_POINTERS := TRUE} 182{$setc TYPE_BOOL := FALSE} 183{$setc TYPE_EXTENDED := FALSE} 184{$setc TYPE_LONGLONG := TRUE} 185uses MacTypes,AERegistry,AEDataModel,AEObjects; 186{$endc} {not MACOSALLINCLUDE} 187 188 189{$ifc TARGET_OS_MAC} 190 191{$ALIGN POWER} 192 193 194const 195 keyAETarget = FourCharCode('targ'); 196 keySubjectAttr = FourCharCode('subj'); { Magic 'returning' parameter: } 197 keyASReturning = FourCharCode('Krtn'); { AppleScript Specific Codes: } 198 kASAppleScriptSuite = FourCharCode('ascr'); 199 kASScriptEditorSuite = FourCharCode('ToyS'); 200 kASTypeNamesSuite = FourCharCode('tpnm'); { dynamic terminologies } 201 typeAETE = FourCharCode('aete'); 202 typeAEUT = FourCharCode('aeut'); 203 kGetAETE = FourCharCode('gdte'); 204 kGetAEUT = FourCharCode('gdut'); 205 kUpdateAEUT = FourCharCode('udut'); 206 kUpdateAETE = FourCharCode('udte'); 207 kCleanUpAEUT = FourCharCode('cdut'); 208 kASComment = FourCharCode('cmnt'); 209 kASLaunchEvent = FourCharCode('noop'); 210 keyScszResource = FourCharCode('scsz'); 211 typeScszResource = FourCharCode('scsz'); { subroutine calls } 212 kASSubroutineEvent = FourCharCode('psbr'); 213 keyASSubroutineName = FourCharCode('snam'); 214 kASPrepositionalSubroutine = FourCharCode('psbr'); 215 keyASPositionalArgs = FourCharCode('parg'); 216 217const 218{ Add this parameter to a Get Data result if your app handled the 'as' parameter } 219 keyAppHandledCoercion = FourCharCode('idas'); 220 221const 222{ Miscellaneous AppleScript commands } 223 kASStartLogEvent = FourCharCode('log1'); 224 kASStopLogEvent = FourCharCode('log0'); 225 kASCommentEvent = FourCharCode('cmnt'); 226 227 228{ Operator Events: } 229const 230{ Binary: } 231 kASAdd = FourCharCode('+ '); 232 kASSubtract = FourCharCode('- '); 233 kASMultiply = FourCharCode('* '); 234 kASDivide = FourCharCode('/ '); 235 kASQuotient = FourCharCode('div '); 236 kASRemainder = FourCharCode('mod '); 237 kASPower = FourCharCode('^ '); 238 kASEqual = kAEEquals; 239 kASNotEqual = $AD202020; 240 kASGreaterThan = kAEGreaterThan; 241 kASGreaterThanOrEqual = kAEGreaterThanEquals; 242 kASLessThan = kAELessThan; 243 kASLessThanOrEqual = kAELessThanEquals; 244 kASComesBefore = FourCharCode('cbfr'); 245 kASComesAfter = FourCharCode('cafr'); 246 kASConcatenate = FourCharCode('ccat'); 247 kASStartsWith = kAEBeginsWith; 248 kASEndsWith = kAEEndsWith; 249 kASContains = kAEContains; 250 251const 252 kASAnd = kAEAND; 253 kASOr = kAEOR; { Unary: } 254 kASNot = kAENOT; 255 kASNegate = FourCharCode('neg '); 256 keyASArg = FourCharCode('arg '); 257 258const 259{ event code for the 'error' statement } 260 kASErrorEventCode = FourCharCode('err '); 261 kOSAErrorArgs = FourCharCode('erra'); 262 keyAEErrorObject = FourCharCode('erob'); { Properties: } 263 pLength = FourCharCode('leng'); 264 pReverse = FourCharCode('rvse'); 265 pRest = FourCharCode('rest'); 266 pInherits = FourCharCode('c@#^'); 267 pProperties = FourCharCode('pALL'); { User-Defined Record Fields: } 268 keyASUserRecordFields = FourCharCode('usrf'); 269 typeUserRecordFields = typeAEList; 270 271{ Prepositions: } 272const 273 keyASPrepositionAt = FourCharCode('at '); 274 keyASPrepositionIn = FourCharCode('in '); 275 keyASPrepositionFrom = FourCharCode('from'); 276 keyASPrepositionFor = FourCharCode('for '); 277 keyASPrepositionTo = FourCharCode('to '); 278 keyASPrepositionThru = FourCharCode('thru'); 279 keyASPrepositionThrough = FourCharCode('thgh'); 280 keyASPrepositionBy = FourCharCode('by '); 281 keyASPrepositionOn = FourCharCode('on '); 282 keyASPrepositionInto = FourCharCode('into'); 283 keyASPrepositionOnto = FourCharCode('onto'); 284 keyASPrepositionBetween = FourCharCode('btwn'); 285 keyASPrepositionAgainst = FourCharCode('agst'); 286 keyASPrepositionOutOf = FourCharCode('outo'); 287 keyASPrepositionInsteadOf = FourCharCode('isto'); 288 keyASPrepositionAsideFrom = FourCharCode('asdf'); 289 keyASPrepositionAround = FourCharCode('arnd'); 290 keyASPrepositionBeside = FourCharCode('bsid'); 291 keyASPrepositionBeneath = FourCharCode('bnth'); 292 keyASPrepositionUnder = FourCharCode('undr'); 293 294const 295 keyASPrepositionOver = FourCharCode('over'); 296 keyASPrepositionAbove = FourCharCode('abve'); 297 keyASPrepositionBelow = FourCharCode('belw'); 298 keyASPrepositionApartFrom = FourCharCode('aprt'); 299 keyASPrepositionGiven = FourCharCode('givn'); 300 keyASPrepositionWith = FourCharCode('with'); 301 keyASPrepositionWithout = FourCharCode('wout'); 302 keyASPrepositionAbout = FourCharCode('abou'); 303 keyASPrepositionSince = FourCharCode('snce'); 304 keyASPrepositionUntil = FourCharCode('till'); 305 306const 307{ Terminology & Dialect things: } 308 kDialectBundleResType = FourCharCode('Dbdl'); { AppleScript Classes and Enums: } 309 cConstant = typeEnumerated; 310 cClassIdentifier = pClass; 311 cObjectBeingExamined = typeObjectBeingExamined; 312 cList = typeAEList; 313 cSmallReal = typeIEEE32BitFloatingPoint; 314 cReal = typeIEEE64BitFloatingPoint; 315 cRecord = typeAERecord; 316 cReference = cObjectSpecifier; 317 cUndefined = FourCharCode('undf'); 318 cMissingValue = FourCharCode('msng'); 319 cSymbol = FourCharCode('symb'); 320 cLinkedList = FourCharCode('llst'); 321 cVector = FourCharCode('vect'); 322 cEventIdentifier = FourCharCode('evnt'); 323 cKeyIdentifier = FourCharCode('kyid'); 324 cUserIdentifier = FourCharCode('uid '); 325 cPreposition = FourCharCode('prep'); 326 cKeyForm = enumKeyForm; 327 cScript = FourCharCode('scpt'); 328 cHandler = FourCharCode('hand'); 329 cProcedure = FourCharCode('proc'); 330 331const 332 cHandleBreakpoint = FourCharCode('brak'); 333 334const 335 cClosure = FourCharCode('clsr'); 336 cRawData = FourCharCode('rdat'); 337 cStringClass = typeChar; 338 cNumber = FourCharCode('nmbr'); 339 cListElement = FourCharCode('celm'); 340 cListOrRecord = FourCharCode('lr '); 341 cListOrString = FourCharCode('ls '); 342 cListRecordOrString = FourCharCode('lrs '); 343 cNumberOrString = FourCharCode('ns '); 344 cNumberOrDateTime = FourCharCode('nd '); 345 cNumberDateTimeOrString = FourCharCode('nds '); 346 cAliasOrString = FourCharCode('sf '); 347 cSeconds = FourCharCode('scnd'); 348 typeSound = FourCharCode('snd '); 349 enumBooleanValues = FourCharCode('boov'); { Use this instead of typeBoolean to avoid with/without conversion } 350 kAETrue = typeTrue; 351 kAEFalse = typeFalse; 352 enumMiscValues = FourCharCode('misc'); 353 kASCurrentApplication = FourCharCode('cura'); { User-defined property ospecs: } 354 formUserPropertyID = FourCharCode('usrp'); 355 356const 357 cString = cStringClass; { old name for cStringClass - can't be used in .r files} 358 359const 360{ Global properties: } 361 pASIt = FourCharCode('it '); 362 pASMe = FourCharCode('me '); 363 pASResult = FourCharCode('rslt'); 364 pASSpace = FourCharCode('spac'); 365 pASReturn = FourCharCode('ret '); 366 pASTab = FourCharCode('tab '); 367 pASPi = FourCharCode('pi '); 368 pASParent = FourCharCode('pare'); 369 kASInitializeEventCode = FourCharCode('init'); 370 pASPrintLength = FourCharCode('prln'); 371 pASPrintDepth = FourCharCode('prdp'); 372 pASTopLevelScript = FourCharCode('ascr'); 373 374const 375{ Considerations } 376 kAECase = FourCharCode('case'); 377 kAEDiacritic = FourCharCode('diac'); 378 kAEWhiteSpace = FourCharCode('whit'); 379 kAEHyphens = FourCharCode('hyph'); 380 kAEExpansion = FourCharCode('expa'); 381 kAEPunctuation = FourCharCode('punc'); 382 kAEZenkakuHankaku = FourCharCode('zkhk'); 383 kAESmallKana = FourCharCode('skna'); 384 kAEKataHiragana = FourCharCode('hika'); 385 kASConsiderReplies = FourCharCode('rmte'); 386 kASNumericStrings = FourCharCode('nume'); 387 enumConsiderations = FourCharCode('cons'); 388 389{ Considerations bit masks } 390const 391 kAECaseConsiderMask = $00000001; 392 kAEDiacriticConsiderMask = $00000002; 393 kAEWhiteSpaceConsiderMask = $00000004; 394 kAEHyphensConsiderMask = $00000008; 395 kAEExpansionConsiderMask = $00000010; 396 kAEPunctuationConsiderMask = $00000020; 397 kASConsiderRepliesConsiderMask = $00000040; 398 kASNumericStringsConsiderMask = $00000080; 399 kAECaseIgnoreMask = $00010000; 400 kAEDiacriticIgnoreMask = $00020000; 401 kAEWhiteSpaceIgnoreMask = $00040000; 402 kAEHyphensIgnoreMask = $00080000; 403 kAEExpansionIgnoreMask = $00100000; 404 kAEPunctuationIgnoreMask = $00200000; 405 kASConsiderRepliesIgnoreMask = $00400000; 406 kASNumericStringsIgnoreMask = $00800000; 407 enumConsidsAndIgnores = FourCharCode('csig'); 408 409const 410 cCoercion = FourCharCode('coec'); 411 cCoerceUpperCase = FourCharCode('txup'); 412 cCoerceLowerCase = FourCharCode('txlo'); 413 cCoerceRemoveDiacriticals = FourCharCode('txdc'); 414 cCoerceRemovePunctuation = FourCharCode('txpc'); 415 cCoerceRemoveHyphens = FourCharCode('txhy'); 416 cCoerceOneByteToTwoByte = FourCharCode('txex'); 417 cCoerceRemoveWhiteSpace = FourCharCode('txws'); 418 cCoerceSmallKana = FourCharCode('txsk'); 419 cCoerceZenkakuhankaku = FourCharCode('txze'); 420 cCoerceKataHiragana = FourCharCode('txkh'); { Lorax things: } 421 cZone = FourCharCode('zone'); 422 cMachine = FourCharCode('mach'); 423 cAddress = FourCharCode('addr'); 424 cRunningAddress = FourCharCode('radd'); 425 cStorage = FourCharCode('stor'); 426 427const 428{ DateTime things: } 429 pASWeekday = FourCharCode('wkdy'); 430 pASMonth = FourCharCode('mnth'); 431 pASDay = FourCharCode('day '); 432 pASYear = FourCharCode('year'); 433 pASTime = FourCharCode('time'); 434 pASDateString = FourCharCode('dstr'); 435 pASTimeString = FourCharCode('tstr'); { Months } 436 cMonth = pASMonth; 437 cJanuary = FourCharCode('jan '); 438 cFebruary = FourCharCode('feb '); 439 cMarch = FourCharCode('mar '); 440 cApril = FourCharCode('apr '); 441 cMay = FourCharCode('may '); 442 cJune = FourCharCode('jun '); 443 cJuly = FourCharCode('jul '); 444 cAugust = FourCharCode('aug '); 445 cSeptember = FourCharCode('sep '); 446 cOctober = FourCharCode('oct '); 447 cNovember = FourCharCode('nov '); 448 cDecember = FourCharCode('dec '); 449 450const 451{ Weekdays } 452 cWeekday = pASWeekday; 453 cSunday = FourCharCode('sun '); 454 cMonday = FourCharCode('mon '); 455 cTuesday = FourCharCode('tue '); 456 cWednesday = FourCharCode('wed '); 457 cThursday = FourCharCode('thu '); 458 cFriday = FourCharCode('fri '); 459 cSaturday = FourCharCode('sat '); { AS 1.1 Globals: } 460 pASQuote = FourCharCode('quot'); 461 pASSeconds = FourCharCode('secs'); 462 pASMinutes = FourCharCode('min '); 463 pASHours = FourCharCode('hour'); 464 pASDays = FourCharCode('days'); 465 pASWeeks = FourCharCode('week'); { Writing Code things: } 466 cWritingCodeInfo = FourCharCode('citl'); 467 pScriptCode = FourCharCode('pscd'); 468 pLangCode = FourCharCode('plcd'); { Magic Tell and End Tell events for logging: } 469 kASMagicTellEvent = FourCharCode('tell'); 470 kASMagicEndTellEvent = FourCharCode('tend'); 471 472{$endc} {TARGET_OS_MAC} 473{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE} 474 475end. 476{$endc} {not MACOSALLINCLUDE}