Browse Source

* updated r308 of common Mac OS X interfaces:
o all headers updated to Mac OS X 10.6
o 64 bit support (commented out unsupported routines under 64 bit, fixed
types)
o iPhoneOS support to the extent that this is available in the standard
Mac OS X 10.6 headers (these are not covered under the iPhone SDK
derivative works limitation)
o a few new frameworks translated: CoreType, CoreVideo, AudioUnits
o a number of changes can cause compatibility problems with existing
programs, listed below
* many cases where signed parameters were turned into unsigned parameters
and vice versa, too many to list (due to differences between the classic
Pascal headers and the new C headers)
* ATSFontFindFromContainer: ioArray var -> ptr because array
* ATSFontGetFileSpecification: oFile FSSpec -> ATSFSSpec (was translation
error?)
* CFNetworkCopyProxiesForAutoConfigurationScript: got extra CFErrorRef para
* CMGetDeviceFactoryProfiles: defaultProfID var -> ptr, because can be nil
* CMIterateColorDevices: seed and count var -> ptr, because can be nil
* CMIterateDeviceProfiles: seed and count var -> ptr, because can be nil
* CMSetDeviceProfiles: profileScope and deviceProfiles const -> ptr, because
can be nil
* ConvertFromUnicodeToScriptCodeRun: oScriptCodeRuns var -> ptr because
array
* ConvertFromUnicodeToTextRun: oEncodingRuns var -> ptr because array
* CreateUnicodeToTextRunInfo: iUnicodeMappings var -> ptr because array
* DCMCreateFieldInfoRecord: findMethods var -> ptr because array
* DCMGetFieldFindMethods: findMethods var -> ptr because array
* GetIconRefFromFileInfo: outlabel var -> ptr because can be nil
* HIImageViewCreate: last parameter ControlRef -> HIViewRef
* HIViewNewTrackingArea: outRef var -> ptr because can be nil in 10.5+
* LAGetEnvironmentList: environmentList var -> ptr because array
* LAListAvailableDictionaries: dictionaryList and opened var -> ptr because
array
* LSGetApplicationForURL: outAppRef and outAppURL var -> ptr because can be
nil
* LocaleOperationGetLocales: localeVariantList var -> ptr because can be nil
* MPWaitOnQueue: param1-3 value -> var because "void **" in C
* QTVRSetBackBufferImagingProc: areasOfInterest var -> ptr because array
* QueryUnicodeMappings: oReturnedMappings var -> ptr because array
* TECConvertTextToMultipleEncodings: outEncodingsBuffer var -> ptr because
array
* TECFlushMultipleEncodings: outEncodingsBuffer var -> ptr because array
* TECSniffTextEncoding: numErrsArray and numFeaturesArray var -> ptr because
array
* FSCreateResFile: catalogInfo const -> ptr because can be nil

git-svn-id: trunk@14089 -

Jonas Maebe 15 years ago
parent
commit
f9eb89eb98
100 changed files with 27691 additions and 8765 deletions
  1. 116 18
      .gitattributes
  2. 68 61
      packages/Makefile
  3. 14 12
      packages/Makefile.fpc
  4. 2 3
      packages/fcl-base/src/custapp.pp
  5. 2 1
      packages/univint/Makefile
  6. 113 80
      packages/univint/Makefile.fpc
  7. 109 23
      packages/univint/src/ABActions.pas
  8. 149 52
      packages/univint/src/ABAddressBook.pas
  9. 103 11
      packages/univint/src/ABGlobals.pas
  10. 146 59
      packages/univint/src/ABPeoplePicker.pas
  11. 130 25
      packages/univint/src/ABTypedefs.pas
  12. 613 295
      packages/univint/src/AEDataModel.pas
  13. 409 96
      packages/univint/src/AEHelpers.pas
  14. 136 16
      packages/univint/src/AEInteraction.pas
  15. 208 77
      packages/univint/src/AEMach.pas
  16. 398 304
      packages/univint/src/AEObjects.pas
  17. 130 31
      packages/univint/src/AEPackObject.pas
  18. 1021 905
      packages/univint/src/AERegistry.pas
  19. 135 59
      packages/univint/src/AEUserTermTypes.pas
  20. 232 146
      packages/univint/src/AIFF.pas
  21. 265 90
      packages/univint/src/ASDebugging.pas
  22. 366 269
      packages/univint/src/ASRegistry.pas
  23. 696 179
      packages/univint/src/ATSFont.pas
  24. 329 163
      packages/univint/src/ATSLayoutTypes.pas
  25. 326 191
      packages/univint/src/ATSTypes.pas
  26. 143 41
      packages/univint/src/ATSUnicodeDirectAccess.pas
  27. 280 95
      packages/univint/src/ATSUnicodeDrawing.pas
  28. 184 100
      packages/univint/src/ATSUnicodeFlattening.pas
  29. 308 135
      packages/univint/src/ATSUnicodeFonts.pas
  30. 219 108
      packages/univint/src/ATSUnicodeGlyphs.pas
  31. 335 126
      packages/univint/src/ATSUnicodeObjects.pas
  32. 225 202
      packages/univint/src/ATSUnicodeTypes.pas
  33. 1474 0
      packages/univint/src/AUComponent.pas
  34. 730 307
      packages/univint/src/AVLTree.pas
  35. 89 7
      packages/univint/src/AXActionConstants.pas
  36. 231 17
      packages/univint/src/AXAttributeConstants.pas
  37. 182 0
      packages/univint/src/AXConstants.pas
  38. 108 25
      packages/univint/src/AXErrors.pas
  39. 113 7
      packages/univint/src/AXNotificationConstants.pas
  40. 124 7
      packages/univint/src/AXRoleConstants.pas
  41. 129 27
      packages/univint/src/AXTextAttributedString.pas
  42. 94 11
      packages/univint/src/AXUIElement.pas
  43. 96 12
      packages/univint/src/AXValue.pas
  44. 89 7
      packages/univint/src/AXValueConstants.pas
  45. 178 0
      packages/univint/src/Accessibility.pas
  46. 947 216
      packages/univint/src/Aliases.pas
  47. 364 636
      packages/univint/src/Appearance.pas
  48. 92 15
      packages/univint/src/AppleDiskPartitions.pas
  49. 194 99
      packages/univint/src/AppleEvents.pas
  50. 154 70
      packages/univint/src/AppleHelp.pas
  51. 265 102
      packages/univint/src/AppleScript.pas
  52. 1208 0
      packages/univint/src/AudioCodecs.pas
  53. 412 0
      packages/univint/src/AudioComponents.pas
  54. 380 107
      packages/univint/src/AudioHardware.pas
  55. 217 0
      packages/univint/src/AudioOutputUnit.pas
  56. 318 0
      packages/univint/src/AudioUnitCarbonViews.pas
  57. 697 0
      packages/univint/src/AudioUnitParameters.pas
  58. 3045 0
      packages/univint/src/AudioUnitProperties.pas
  59. 123 31
      packages/univint/src/AuthSession.pas
  60. 163 67
      packages/univint/src/Authorization.pas
  61. 136 40
      packages/univint/src/AuthorizationDB.pas
  62. 475 0
      packages/univint/src/AuthorizationPlugin.pas
  63. 131 36
      packages/univint/src/AuthorizationTags.pas
  64. 257 0
      packages/univint/src/BackupCore.pas
  65. 131 13
      packages/univint/src/CFArray.pas
  66. 90 11
      packages/univint/src/CFAttributedString.pas
  67. 86 8
      packages/univint/src/CFBag.pas
  68. 200 34
      packages/univint/src/CFBase.pas
  69. 128 19
      packages/univint/src/CFBinaryHeap.pas
  70. 88 10
      packages/univint/src/CFBitVector.pas
  71. 155 26
      packages/univint/src/CFBundle.pas
  72. 88 10
      packages/univint/src/CFByteOrders.pas
  73. 94 10
      packages/univint/src/CFCalendar.pas
  74. 93 15
      packages/univint/src/CFCharacterSet.pas
  75. 99 9
      packages/univint/src/CFData.pas
  76. 89 11
      packages/univint/src/CFDate.pas
  77. 128 12
      packages/univint/src/CFDateFormatter.pas
  78. 127 13
      packages/univint/src/CFDictionary.pas
  79. 87 8
      packages/univint/src/CFError.pas
  80. 308 232
      packages/univint/src/CFFTPStream.pas
  81. 350 271
      packages/univint/src/CFHTTPAuthentication.pas
  82. 367 294
      packages/univint/src/CFHTTPMessage.pas
  83. 272 195
      packages/univint/src/CFHTTPStream.pas
  84. 406 330
      packages/univint/src/CFHost.pas
  85. 146 18
      packages/univint/src/CFLocale.pas
  86. 86 8
      packages/univint/src/CFMachPort.pas
  87. 96 8
      packages/univint/src/CFMessagePort.pas
  88. 179 101
      packages/univint/src/CFNetDiagnostics.pas
  89. 944 890
      packages/univint/src/CFNetServices.pas
  90. 271 102
      packages/univint/src/CFNetworkErrorss.pas
  91. 95 14
      packages/univint/src/CFNotificationCenter.pas
  92. 97 12
      packages/univint/src/CFNumber.pas
  93. 113 24
      packages/univint/src/CFNumberFormatter.pas
  94. 90 11
      packages/univint/src/CFPlugIn.pas
  95. 89 9
      packages/univint/src/CFPlugInCOM.pas
  96. 89 8
      packages/univint/src/CFPreferences.pas
  97. 133 19
      packages/univint/src/CFPropertyList.pas
  98. 538 166
      packages/univint/src/CFProxySupport.pas
  99. 96 9
      packages/univint/src/CFRunLoop.pas
  100. 118 16
      packages/univint/src/CFSet.pas

+ 116 - 18
.gitattributes

@@ -5136,9 +5136,11 @@ packages/univint/src/ATSUnicodeFonts.pas svneol=native#text/plain
 packages/univint/src/ATSUnicodeGlyphs.pas svneol=native#text/plain
 packages/univint/src/ATSUnicodeObjects.pas svneol=native#text/plain
 packages/univint/src/ATSUnicodeTypes.pas svneol=native#text/plain
+packages/univint/src/AUComponent.pas svneol=native#text/plain
 packages/univint/src/AVLTree.pas svneol=native#text/plain
 packages/univint/src/AXActionConstants.pas svneol=native#text/plain
 packages/univint/src/AXAttributeConstants.pas svneol=native#text/plain
+packages/univint/src/AXConstants.pas svneol=native#text/plain
 packages/univint/src/AXErrors.pas svneol=native#text/plain
 packages/univint/src/AXNotificationConstants.pas svneol=native#text/plain
 packages/univint/src/AXRoleConstants.pas svneol=native#text/plain
@@ -5146,17 +5148,26 @@ packages/univint/src/AXTextAttributedString.pas svneol=native#text/plain
 packages/univint/src/AXUIElement.pas svneol=native#text/plain
 packages/univint/src/AXValue.pas svneol=native#text/plain
 packages/univint/src/AXValueConstants.pas svneol=native#text/plain
+packages/univint/src/Accessibility.pas svneol=native#text/plain
 packages/univint/src/Aliases.pas svneol=native#text/plain
 packages/univint/src/Appearance.pas svneol=native#text/plain
 packages/univint/src/AppleDiskPartitions.pas svneol=native#text/plain
 packages/univint/src/AppleEvents.pas svneol=native#text/plain
 packages/univint/src/AppleHelp.pas svneol=native#text/plain
 packages/univint/src/AppleScript.pas svneol=native#text/plain
+packages/univint/src/AudioCodecs.pas svneol=native#text/plain
+packages/univint/src/AudioComponents.pas svneol=native#text/plain
 packages/univint/src/AudioHardware.pas svneol=native#text/plain
+packages/univint/src/AudioOutputUnit.pas svneol=native#text/plain
+packages/univint/src/AudioUnitCarbonViews.pas svneol=native#text/plain
+packages/univint/src/AudioUnitParameters.pas svneol=native#text/plain
+packages/univint/src/AudioUnitProperties.pas svneol=native#text/plain
 packages/univint/src/AuthSession.pas svneol=native#text/plain
 packages/univint/src/Authorization.pas svneol=native#text/plain
 packages/univint/src/AuthorizationDB.pas svneol=native#text/plain
+packages/univint/src/AuthorizationPlugin.pas svneol=native#text/plain
 packages/univint/src/AuthorizationTags.pas svneol=native#text/plain
+packages/univint/src/BackupCore.pas svneol=native#text/plain
 packages/univint/src/CFArray.pas svneol=native#text/plain
 packages/univint/src/CFAttributedString.pas svneol=native#text/plain
 packages/univint/src/CFBag.pas svneol=native#text/plain
@@ -5226,10 +5237,16 @@ packages/univint/src/CGFont.pas svneol=native#text/plain
 packages/univint/src/CGFunction.pas svneol=native#text/plain
 packages/univint/src/CGGLContext.pas svneol=native#text/plain
 packages/univint/src/CGGeometry.pas svneol=native#text/plain
+packages/univint/src/CGGradient.pas svneol=native#text/plain
 packages/univint/src/CGImage.pas svneol=native#text/plain
 packages/univint/src/CGImageDestination.pas svneol=native#text/plain
 packages/univint/src/CGImageProperties.pas svneol=native#text/plain
 packages/univint/src/CGImageSource.pas svneol=native#text/plain
+packages/univint/src/CGLCurrent.pas svneol=native#text/plain
+packages/univint/src/CGLDevice.pas svneol=native#text/plain
+packages/univint/src/CGLProfiler.pas svneol=native#text/plain
+packages/univint/src/CGLProfilerFunctionEnums.pas svneol=native#text/plain
+packages/univint/src/CGLRenderers.pas svneol=native#text/plain
 packages/univint/src/CGLTypes.pas svneol=native#text/plain
 packages/univint/src/CGLayer.pas svneol=native#text/plain
 packages/univint/src/CGPDFArray.pas svneol=native#text/plain
@@ -5249,20 +5266,36 @@ packages/univint/src/CGPattern.pas svneol=native#text/plain
 packages/univint/src/CGRemoteOperation.pas svneol=native#text/plain
 packages/univint/src/CGSession.pas svneol=native#text/plain
 packages/univint/src/CGShading.pas svneol=native#text/plain
+packages/univint/src/CGWindow.pas svneol=native#text/plain
 packages/univint/src/CGWindowLevels.pas svneol=native#text/plain
-packages/univint/src/CMApplication.pas svneol=native#text/plain
 packages/univint/src/CMCalibrator.pas svneol=native#text/plain
-packages/univint/src/CMDeviceIntegration.pas svneol=native#text/plain
-packages/univint/src/CMICCProfile.pas svneol=native#text/plain
-packages/univint/src/CMMComponent.pas svneol=native#text/plain
-packages/univint/src/CMPRComponent.pas svneol=native#text/plain
-packages/univint/src/CMScriptingPlugin.pas svneol=native#text/plain
-packages/univint/src/CMTypes.pas svneol=native#text/plain
+packages/univint/src/CSIdentity.pas svneol=native#text/plain
+packages/univint/src/CSIdentityAuthority.pas svneol=native#text/plain
+packages/univint/src/CSIdentityQuery.pas svneol=native#text/plain
+packages/univint/src/CTFont.pas svneol=native#text/plain
+packages/univint/src/CTFontCollection.pas svneol=native#text/plain
+packages/univint/src/CTFontDescriptor.pas svneol=native#text/plain
+packages/univint/src/CTFontManager.pas svneol=native#text/plain
+packages/univint/src/CTFontManagerErrors.pas svneol=native#text/plain
+packages/univint/src/CTFontTraits.pas svneol=native#text/plain
+packages/univint/src/CTFrame.pas svneol=native#text/plain
+packages/univint/src/CTFramesetter.pas svneol=native#text/plain
+packages/univint/src/CTGlyphInfo.pas svneol=native#text/plain
+packages/univint/src/CTLine.pas svneol=native#text/plain
+packages/univint/src/CTParagraphStyle.pas svneol=native#text/plain
+packages/univint/src/CTRun.pas svneol=native#text/plain
+packages/univint/src/CTStringAttributes.pas svneol=native#text/plain
+packages/univint/src/CTTextTab.pas svneol=native#text/plain
+packages/univint/src/CTTypesetter.pas svneol=native#text/plain
 packages/univint/src/CVBase.pas svneol=native#text/plain
 packages/univint/src/CVBuffer.pas svneol=native#text/plain
 packages/univint/src/CVDisplayLink.pas svneol=native#text/plain
 packages/univint/src/CVHostTime.pas svneol=native#text/plain
 packages/univint/src/CVImageBuffer.pas svneol=native#text/plain
+packages/univint/src/CVOpenGLBuffer.pas svneol=native#text/plain
+packages/univint/src/CVOpenGLBufferPool.pas svneol=native#text/plain
+packages/univint/src/CVOpenGLTexture.pas svneol=native#text/plain
+packages/univint/src/CVOpenGLTextureCache.pas svneol=native#text/plain
 packages/univint/src/CVPixelBuffer.pas svneol=native#text/plain
 packages/univint/src/CVPixelBufferPool.pas svneol=native#text/plain
 packages/univint/src/CVPixelFormatDescription.pas svneol=native#text/plain
@@ -5272,6 +5305,11 @@ packages/univint/src/CarbonEventsCore.pas svneol=native#text/plain
 packages/univint/src/CodeFragments.pas svneol=native#text/plain
 packages/univint/src/Collections.pas svneol=native#text/plain
 packages/univint/src/ColorPicker.pas svneol=native#text/plain
+packages/univint/src/ColorSyncCMM.pas svneol=native#text/plain
+packages/univint/src/ColorSyncDeprecated.pas svneol=native#text/plain
+packages/univint/src/ColorSyncDevice.pas svneol=native#text/plain
+packages/univint/src/ColorSyncProfile.pas svneol=native#text/plain
+packages/univint/src/ColorSyncTransform.pas svneol=native#text/plain
 packages/univint/src/Components.pas svneol=native#text/plain
 packages/univint/src/ConditionalMacros.pas svneol=native#text/plain
 packages/univint/src/ControlDefinitions.pas svneol=native#text/plain
@@ -5279,24 +5317,25 @@ packages/univint/src/Controls.pas svneol=native#text/plain
 packages/univint/src/CoreAudioTypes.pas svneol=native#text/plain
 packages/univint/src/CoreFoundation.pas svneol=native#text/plain
 packages/univint/src/CoreGraphics.pas svneol=native#text/plain
+packages/univint/src/CoreText.pas svneol=native#text/plain
+packages/univint/src/DADisk.pas svneol=native#text/plain
+packages/univint/src/DASession.pas svneol=native#text/plain
 packages/univint/src/DHCPClientPreferences.pas svneol=native#text/plain
 packages/univint/src/DateTimeUtils.pas svneol=native#text/plain
 packages/univint/src/Debugging.pas svneol=native#text/plain
-packages/univint/src/Devices.pas svneol=native#text/plain
 packages/univint/src/Dialogs.pas svneol=native#text/plain
 packages/univint/src/Dictionary.pas svneol=native#text/plain
+packages/univint/src/DigitalHubRegistry.pas svneol=native#text/plain
 packages/univint/src/Displays.pas svneol=native#text/plain
 packages/univint/src/Drag.pas svneol=native#text/plain
 packages/univint/src/DrawSprocket.pas svneol=native#text/plain
-packages/univint/src/DriverFamilyMatching.pas svneol=native#text/plain
-packages/univint/src/DriverGestalt.pas svneol=native#text/plain
 packages/univint/src/DriverServices.pas svneol=native#text/plain
 packages/univint/src/DriverSynchronization.pas svneol=native#text/plain
 packages/univint/src/Endian.pas svneol=native#text/plain
 packages/univint/src/Events.pas svneol=native#text/plain
+packages/univint/src/FSEvents.pas svneol=native#text/plain
 packages/univint/src/FileTypesAndCreators.pas svneol=native#text/plain
 packages/univint/src/Files.pas svneol=native#text/plain
-packages/univint/src/FindByContent.pas svneol=native#text/plain
 packages/univint/src/Finder.pas svneol=native#text/plain
 packages/univint/src/FinderRegistry.pas svneol=native#text/plain
 packages/univint/src/FixMath.pas svneol=native#text/plain
@@ -5305,38 +5344,75 @@ packages/univint/src/FontPanel.pas svneol=native#text/plain
 packages/univint/src/FontSync.pas svneol=native#text/plain
 packages/univint/src/Fonts.pas svneol=native#text/plain
 packages/univint/src/GPCStrings.pas svneol=native#text/plain
-packages/univint/src/GXTypes.pas svneol=native#text/plain
 packages/univint/src/GestaltEqu.pas svneol=native#text/plain
 packages/univint/src/HFSVolumes.pas svneol=native#text/plain
+packages/univint/src/HIAccessibility.pas svneol=native#text/plain
 packages/univint/src/HIArchive.pas svneol=native#text/plain
+packages/univint/src/HIButtonViews.pas svneol=native#text/plain
+packages/univint/src/HIClockView.pas svneol=native#text/plain
+packages/univint/src/HIComboBox.pas svneol=native#text/plain
+packages/univint/src/HIContainerViews.pas svneol=native#text/plain
+packages/univint/src/HIDataBrowser.pas svneol=native#text/plain
+packages/univint/src/HIDisclosureViews.pas svneol=native#text/plain
 packages/univint/src/HIGeometry.pas svneol=native#text/plain
+packages/univint/src/HIImageViews.pas svneol=native#text/plain
+packages/univint/src/HILittleArrows.pas svneol=native#text/plain
+packages/univint/src/HIMenuView.pas svneol=native#text/plain
 packages/univint/src/HIMovieView.pas svneol=native#text/plain
 packages/univint/src/HIObject.pas svneol=native#text/plain
-packages/univint/src/HIObjectCore.pas svneol=native#text/plain
+packages/univint/src/HIPopupButton.pas svneol=native#text/plain
+packages/univint/src/HIProgressViews.pas svneol=native#text/plain
+packages/univint/src/HIRelevanceBar.pas svneol=native#text/plain
+packages/univint/src/HIScrollView.pas svneol=native#text/plain
+packages/univint/src/HISearchField.pas svneol=native#text/plain
+packages/univint/src/HISegmentedView.pas svneol=native#text/plain
+packages/univint/src/HISeparator.pas svneol=native#text/plain
 packages/univint/src/HIShape.pas svneol=native#text/plain
+packages/univint/src/HISlider.pas svneol=native#text/plain
+packages/univint/src/HITabbedView.pas svneol=native#text/plain
+packages/univint/src/HITextLengthFilter.pas svneol=native#text/plain
 packages/univint/src/HITextUtils.pas svneol=native#text/plain
+packages/univint/src/HITextViews.pas svneol=native#text/plain
 packages/univint/src/HITheme.pas svneol=native#text/plain
 packages/univint/src/HIToolbar.pas svneol=native#text/plain
 packages/univint/src/HIToolbox.pas svneol=native#text/plain
+packages/univint/src/HIToolboxDebugging.pas svneol=native#text/plain
 packages/univint/src/HIView.pas svneol=native#text/plain
+packages/univint/src/HIWindowViews.pas svneol=native#text/plain
 packages/univint/src/HTMLRendering.pas svneol=native#text/plain
 packages/univint/src/HostTime.pas svneol=native#text/plain
 packages/univint/src/IBCarbonRuntime.pas svneol=native#text/plain
 packages/univint/src/ICAApplication.pas svneol=native#text/plain
 packages/univint/src/ICACamera.pas svneol=native#text/plain
 packages/univint/src/ICADevice.pas svneol=native#text/plain
+packages/univint/src/IconStorage.pas svneol=native#text/plain
 packages/univint/src/Icons.pas svneol=native#text/plain
+packages/univint/src/IconsCore.pas svneol=native#text/plain
 packages/univint/src/ImageCodec.pas svneol=native#text/plain
 packages/univint/src/ImageCompression.pas svneol=native#text/plain
 packages/univint/src/InternetConfig.pas svneol=native#text/plain
 packages/univint/src/IntlResources.pas svneol=native#text/plain
+packages/univint/src/KeyEvents.pas svneol=native#text/plain
 packages/univint/src/Keyboards.pas svneol=native#text/plain
 packages/univint/src/KeychainCore.pas svneol=native#text/plain
 packages/univint/src/KeychainHI.pas svneol=native#text/plain
+packages/univint/src/LSInfo.pas svneol=native#text/plain
+packages/univint/src/LSOpen.pas svneol=native#text/plain
+packages/univint/src/LSQuarantine.pas svneol=native#text/plain
+packages/univint/src/LSSharedFileList.pas svneol=native#text/plain
 packages/univint/src/LanguageAnalysis.pas svneol=native#text/plain
-packages/univint/src/LaunchServices.pas svneol=native#text/plain
 packages/univint/src/Lists.pas svneol=native#text/plain
 packages/univint/src/LowMem.pas svneol=native#text/plain
+packages/univint/src/MDExternalDatastore.pas svneol=native#text/plain
+packages/univint/src/MDImporter.pas svneol=native#text/plain
+packages/univint/src/MDItem.pas svneol=native#text/plain
+packages/univint/src/MDLineage.pas svneol=native#text/plain
+packages/univint/src/MDQuery.pas svneol=native#text/plain
+packages/univint/src/MDSchema.pas svneol=native#text/plain
+packages/univint/src/MIDIDriver.pas svneol=native#text/plain
+packages/univint/src/MIDIServices.pas svneol=native#text/plain
+packages/univint/src/MIDISetup.pas svneol=native#text/plain
+packages/univint/src/MIDIThruConnection.pas svneol=native#text/plain
 packages/univint/src/MacApplication.pas svneol=native#text/plain
 packages/univint/src/MacErrors.pas svneol=native#text/plain
 packages/univint/src/MacHelp.pas svneol=native#text/plain
@@ -5345,6 +5421,7 @@ packages/univint/src/MacMemory.pas svneol=native#text/plain
 packages/univint/src/MacOS.pas svneol=native#text/plain
 packages/univint/src/MacOSAll.pas svneol=native#text/plain
 packages/univint/src/MacOSXPosix.pas svneol=native#text/plain
+packages/univint/src/MacOpenGL.pas svneol=native#text/plain
 packages/univint/src/MacTextEditor.pas svneol=native#text/plain
 packages/univint/src/MacTypes.pas svneol=native#text/plain
 packages/univint/src/MacWindows.pas svneol=native#text/plain
@@ -5355,10 +5432,11 @@ packages/univint/src/Menus.pas svneol=native#text/plain
 packages/univint/src/MixedMode.pas svneol=native#text/plain
 packages/univint/src/Movies.pas svneol=native#text/plain
 packages/univint/src/MoviesFormat.pas svneol=native#text/plain
+packages/univint/src/MultiProcessingInfo.pas svneol=native#text/plain
 packages/univint/src/Multiprocessing.pas svneol=native#text/plain
+packages/univint/src/MusicDevice.pas svneol=native#text/plain
 packages/univint/src/NSL.pas svneol=native#text/plain
 packages/univint/src/NSLCore.pas svneol=native#text/plain
-packages/univint/src/NameRegistry.pas svneol=native#text/plain
 packages/univint/src/Navigation.pas svneol=native#text/plain
 packages/univint/src/Notification.pas svneol=native#text/plain
 packages/univint/src/NumberFormatting.pas svneol=native#text/plain
@@ -5373,32 +5451,42 @@ packages/univint/src/OpenTransportProviders.pas svneol=native#text/plain
 packages/univint/src/PEFBinaryFormat.pas svneol=native#text/plain
 packages/univint/src/PLStringFuncs.pas svneol=native#text/plain
 packages/univint/src/PMApplication.pas svneol=native#text/plain
+packages/univint/src/PMApplicationDeprecated.pas svneol=native#text/plain
 packages/univint/src/PMCore.pas svneol=native#text/plain
+packages/univint/src/PMCoreDeprecated.pas svneol=native#text/plain
 packages/univint/src/PMDefinitions.pas svneol=native#text/plain
+packages/univint/src/PMDefinitionsDeprecated.pas svneol=native#text/plain
+packages/univint/src/PMErrors.pas svneol=native#text/plain
+packages/univint/src/PMPrintAETypes.pas svneol=native#text/plain
+packages/univint/src/PMPrintSettingsKeys.pas svneol=native#text/plain
+packages/univint/src/PMPrintingDialogExtensions.pas svneol=native#text/plain
 packages/univint/src/Palettes.pas svneol=native#text/plain
 packages/univint/src/Pasteboard.pas svneol=native#text/plain
 packages/univint/src/PictUtils.pas svneol=native#text/plain
 packages/univint/src/Power.pas svneol=native#text/plain
-packages/univint/src/Printing.pas svneol=native#text/plain
 packages/univint/src/Processes.pas svneol=native#text/plain
+packages/univint/src/QDCMCommon.pas svneol=native#text/plain
 packages/univint/src/QDOffscreen.pas svneol=native#text/plain
 packages/univint/src/QDPictToCGContext.pas svneol=native#text/plain
 packages/univint/src/QTML.pas svneol=native#text/plain
 packages/univint/src/QTSMovie.pas svneol=native#text/plain
 packages/univint/src/QTStreamingComponents.pas svneol=native#text/plain
 packages/univint/src/QuickTimeComponents.pas svneol=native#text/plain
+packages/univint/src/QuickTimeErrors.pas svneol=native#text/plain
 packages/univint/src/QuickTimeMusic.pas svneol=native#text/plain
 packages/univint/src/QuickTimeStreaming.pas svneol=native#text/plain
 packages/univint/src/QuickTimeVR.pas svneol=native#text/plain
 packages/univint/src/QuickTimeVRFormat.pas svneol=native#text/plain
 packages/univint/src/Quickdraw.pas svneol=native#text/plain
 packages/univint/src/QuickdrawText.pas svneol=native#text/plain
+packages/univint/src/QuickdrawTypes.pas svneol=native#text/plain
 packages/univint/src/Resources.pas svneol=native#text/plain
 packages/univint/src/SCDynamicStore.pas svneol=native#text/plain
 packages/univint/src/SCDynamicStoreCopyDHCPInfos.pas svneol=native#text/plain
 packages/univint/src/SCDynamicStoreCopySpecific.pas svneol=native#text/plain
 packages/univint/src/SCDynamicStoreKey.pas svneol=native#text/plain
 packages/univint/src/SCNetwork.pas svneol=native#text/plain
+packages/univint/src/SCNetworkConfiguration.pas svneol=native#text/plain
 packages/univint/src/SCNetworkConnection.pas svneol=native#text/plain
 packages/univint/src/SCNetworkReachability.pas svneol=native#text/plain
 packages/univint/src/SCPreferences.pas svneol=native#text/plain
@@ -5408,8 +5496,10 @@ packages/univint/src/SCSI.pas svneol=native#text/plain
 packages/univint/src/SCSchemaDefinitions.pas svneol=native#text/plain
 packages/univint/src/SFNTLayoutTypes.pas svneol=native#text/plain
 packages/univint/src/SFNTTypes.pas svneol=native#text/plain
+packages/univint/src/ScalerStreamTypes.pas svneol=native#text/plain
 packages/univint/src/Scrap.pas svneol=native#text/plain
 packages/univint/src/Script.pas svneol=native#text/plain
+packages/univint/src/SecBase.pas svneol=native#text/plain
 packages/univint/src/Sound.pas svneol=native#text/plain
 packages/univint/src/SpeechRecognition.pas svneol=native#text/plain
 packages/univint/src/SpeechSynthesis.pas svneol=native#text/plain
@@ -5432,7 +5522,6 @@ packages/univint/src/TranslationExtensions.pas svneol=native#text/plain
 packages/univint/src/TranslationServices.pas svneol=native#text/plain
 packages/univint/src/TypeSelect.pas svneol=native#text/plain
 packages/univint/src/URLAccess.pas svneol=native#text/plain
-packages/univint/src/USB.pas svneol=native#text/plain
 packages/univint/src/UTCUtils.pas svneol=native#text/plain
 packages/univint/src/UTCoreTypes.pas svneol=native#text/plain
 packages/univint/src/UTType.pas svneol=native#text/plain
@@ -5440,9 +5529,18 @@ packages/univint/src/UnicodeConverter.pas svneol=native#text/plain
 packages/univint/src/UnicodeUtilities.pas svneol=native#text/plain
 packages/univint/src/UniversalAccess.pas svneol=native#text/plain
 packages/univint/src/Video.pas svneol=native#text/plain
-packages/univint/src/WorldScript.pas svneol=native#text/plain
+packages/univint/src/WSMethodInvocation.pas svneol=native#text/plain
+packages/univint/src/WSProtocolHandler.pas svneol=native#text/plain
+packages/univint/src/WSTypes.pas svneol=native#text/plain
+packages/univint/src/cblas.pas svneol=native#text/plain
 packages/univint/src/fenv.pas svneol=native#text/plain
 packages/univint/src/fp.pas svneol=native#text/plain
+packages/univint/src/gliContexts.pas svneol=native#text/plain
+packages/univint/src/gliDispatch.pas svneol=native#text/plain
+packages/univint/src/gluContext.pas svneol=native#text/plain
+packages/univint/src/macgl.pas svneol=native#text/plain
+packages/univint/src/macglext.pas svneol=native#text/plain
+packages/univint/src/macglu.pas svneol=native#text/plain
 packages/univint/src/vBLAS.pas svneol=native#text/plain
 packages/univint/src/vDSP.pas svneol=native#text/plain
 packages/univint/src/xattr.pas svneol=native#text/plain

+ 68 - 61
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/08/20]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/08/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -304,7 +304,7 @@ ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint graph sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl cocoaint
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv zlib libpng x11 tcl fpgtk rexx os2units gtk1 imlib
@@ -361,7 +361,7 @@ ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint graph sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl cocoaint
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv opengl
@@ -388,7 +388,7 @@ ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc gmp fcl-extra libxml
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib cocoaint
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv winunits-base winunits-jedi fcl-web fastcgi ibase mysql zlib oracle odbc postgres sqlite imagemagick tcl opengl gtk1 fpgtk fftw sdl openssl cdrom httpd13 httpd20 httpd22 numlib fcl-extra
@@ -403,7 +403,7 @@ ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  palmunits
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra httpd13 httpd20 httpd22 opengles objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint httpd13 httpd20 httpd22 opengles objcrtl
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  winceunits httpd22 fcl-web fastcgi tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
@@ -424,7 +424,7 @@ ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 fcl-extra imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib gmp graph
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib cocoaint
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic bzip2
@@ -2283,9 +2283,8 @@ TARGET_DIRS_NUMLIB=1
 TARGET_DIRS_ICONVENC=1
 TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
-TARGET_DIRS_GRAPH=1
 TARGET_DIRS_UNIVINT=1
-TARGET_DIRS_COCOAINT=1
+TARGET_DIRS_GRAPH=1
 TARGET_DIRS_SDL=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
@@ -2302,6 +2301,7 @@ TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_IMLIB=1
 TARGET_DIRS_OPENGLES=1
 TARGET_DIRS_OBJCRTL=1
+TARGET_DIRS_COCOAINT=1
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 TARGET_DIRS_HASH=1
@@ -3112,9 +3112,8 @@ TARGET_DIRS_NUMLIB=1
 TARGET_DIRS_ICONVENC=1
 TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
-TARGET_DIRS_GRAPH=1
 TARGET_DIRS_UNIVINT=1
-TARGET_DIRS_COCOAINT=1
+TARGET_DIRS_GRAPH=1
 TARGET_DIRS_SDL=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
@@ -3130,6 +3129,7 @@ TARGET_DIRS_HTTPD20=1
 TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_IMLIB=1
 TARGET_DIRS_OBJCRTL=1
+TARGET_DIRS_COCOAINT=1
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 TARGET_DIRS_HASH=1
@@ -3629,6 +3629,7 @@ TARGET_DIRS_NUMLIB=1
 TARGET_DIRS_ICONVENC=1
 TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
+TARGET_DIRS_UNIVINT=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
 TARGET_DIRS_CAIRO=1
@@ -3642,6 +3643,7 @@ TARGET_DIRS_HTTPD13=1
 TARGET_DIRS_HTTPD20=1
 TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_IMLIB=1
+TARGET_DIRS_COCOAINT=1
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 TARGET_DIRS_HASH=1
@@ -3877,6 +3879,7 @@ TARGET_DIRS_NUMLIB=1
 TARGET_DIRS_ICONVENC=1
 TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
+TARGET_DIRS_UNIVINT=1
 TARGET_DIRS_HTTPD13=1
 TARGET_DIRS_HTTPD20=1
 TARGET_DIRS_HTTPD22=1
@@ -4154,6 +4157,7 @@ TARGET_DIRS_NUMLIB=1
 TARGET_DIRS_ICONVENC=1
 TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
+TARGET_DIRS_UNIVINT=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
 TARGET_DIRS_CAIRO=1
@@ -4167,6 +4171,7 @@ TARGET_DIRS_HTTPD13=1
 TARGET_DIRS_HTTPD20=1
 TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_IMLIB=1
+TARGET_DIRS_COCOAINT=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 TARGET_DIRS_HASH=1
@@ -8463,51 +8468,6 @@ univint:
 	$(MAKE) -C univint all
 .PHONY: univint_all univint_debug univint_smart univint_release univint_units univint_examples univint_shared univint_install univint_sourceinstall univint_exampleinstall univint_distinstall univint_zipinstall univint_zipsourceinstall univint_zipexampleinstall univint_zipdistinstall univint_clean univint_distclean univint_cleanall univint_info univint_makefiles univint
 endif
-ifdef TARGET_DIRS_COCOAINT
-cocoaint_all:
-	$(MAKE) -C cocoaint all
-cocoaint_debug:
-	$(MAKE) -C cocoaint debug
-cocoaint_smart:
-	$(MAKE) -C cocoaint smart
-cocoaint_release:
-	$(MAKE) -C cocoaint release
-cocoaint_units:
-	$(MAKE) -C cocoaint units
-cocoaint_examples:
-	$(MAKE) -C cocoaint examples
-cocoaint_shared:
-	$(MAKE) -C cocoaint shared
-cocoaint_install:
-	$(MAKE) -C cocoaint install
-cocoaint_sourceinstall:
-	$(MAKE) -C cocoaint sourceinstall
-cocoaint_exampleinstall:
-	$(MAKE) -C cocoaint exampleinstall
-cocoaint_distinstall:
-	$(MAKE) -C cocoaint distinstall
-cocoaint_zipinstall:
-	$(MAKE) -C cocoaint zipinstall
-cocoaint_zipsourceinstall:
-	$(MAKE) -C cocoaint zipsourceinstall
-cocoaint_zipexampleinstall:
-	$(MAKE) -C cocoaint zipexampleinstall
-cocoaint_zipdistinstall:
-	$(MAKE) -C cocoaint zipdistinstall
-cocoaint_clean:
-	$(MAKE) -C cocoaint clean
-cocoaint_distclean:
-	$(MAKE) -C cocoaint distclean
-cocoaint_cleanall:
-	$(MAKE) -C cocoaint cleanall
-cocoaint_info:
-	$(MAKE) -C cocoaint info
-cocoaint_makefiles:
-	$(MAKE) -C cocoaint makefiles
-cocoaint:
-	$(MAKE) -C cocoaint all
-.PHONY: cocoaint_all cocoaint_debug cocoaint_smart cocoaint_release cocoaint_units cocoaint_examples cocoaint_shared cocoaint_install cocoaint_sourceinstall cocoaint_exampleinstall cocoaint_distinstall cocoaint_zipinstall cocoaint_zipsourceinstall cocoaint_zipexampleinstall cocoaint_zipdistinstall cocoaint_clean cocoaint_distclean cocoaint_cleanall cocoaint_info cocoaint_makefiles cocoaint
-endif
 ifdef TARGET_DIRS_OPENGLES
 opengles_all:
 	$(MAKE) -C opengles all
@@ -8598,6 +8558,51 @@ objcrtl:
 	$(MAKE) -C objcrtl all
 .PHONY: objcrtl_all objcrtl_debug objcrtl_smart objcrtl_release objcrtl_units objcrtl_examples objcrtl_shared objcrtl_install objcrtl_sourceinstall objcrtl_exampleinstall objcrtl_distinstall objcrtl_zipinstall objcrtl_zipsourceinstall objcrtl_zipexampleinstall objcrtl_zipdistinstall objcrtl_clean objcrtl_distclean objcrtl_cleanall objcrtl_info objcrtl_makefiles objcrtl
 endif
+ifdef TARGET_DIRS_COCOAINT
+cocoaint_all:
+	$(MAKE) -C cocoaint all
+cocoaint_debug:
+	$(MAKE) -C cocoaint debug
+cocoaint_smart:
+	$(MAKE) -C cocoaint smart
+cocoaint_release:
+	$(MAKE) -C cocoaint release
+cocoaint_units:
+	$(MAKE) -C cocoaint units
+cocoaint_examples:
+	$(MAKE) -C cocoaint examples
+cocoaint_shared:
+	$(MAKE) -C cocoaint shared
+cocoaint_install:
+	$(MAKE) -C cocoaint install
+cocoaint_sourceinstall:
+	$(MAKE) -C cocoaint sourceinstall
+cocoaint_exampleinstall:
+	$(MAKE) -C cocoaint exampleinstall
+cocoaint_distinstall:
+	$(MAKE) -C cocoaint distinstall
+cocoaint_zipinstall:
+	$(MAKE) -C cocoaint zipinstall
+cocoaint_zipsourceinstall:
+	$(MAKE) -C cocoaint zipsourceinstall
+cocoaint_zipexampleinstall:
+	$(MAKE) -C cocoaint zipexampleinstall
+cocoaint_zipdistinstall:
+	$(MAKE) -C cocoaint zipdistinstall
+cocoaint_clean:
+	$(MAKE) -C cocoaint clean
+cocoaint_distclean:
+	$(MAKE) -C cocoaint distclean
+cocoaint_cleanall:
+	$(MAKE) -C cocoaint cleanall
+cocoaint_info:
+	$(MAKE) -C cocoaint info
+cocoaint_makefiles:
+	$(MAKE) -C cocoaint makefiles
+cocoaint:
+	$(MAKE) -C cocoaint all
+.PHONY: cocoaint_all cocoaint_debug cocoaint_smart cocoaint_release cocoaint_units cocoaint_examples cocoaint_shared cocoaint_install cocoaint_sourceinstall cocoaint_exampleinstall cocoaint_distinstall cocoaint_zipinstall cocoaint_zipsourceinstall cocoaint_zipexampleinstall cocoaint_zipdistinstall cocoaint_clean cocoaint_distclean cocoaint_cleanall cocoaint_info cocoaint_makefiles cocoaint
+endif
 ifdef TARGET_DIRS_AMUNITS
 amunits_all:
 	$(MAKE) -C amunits all
@@ -8737,17 +8742,12 @@ fcl-extra_smart: fcl-base_smart winunits-base_smart winunits-jedi_smart
 fcl-extra_release: fcl-base_release winunits-base_release winunits-jedi_release
 fcl-extra_shared: fcl-base_shared winunits-base_shared winunits-jedi_shared
 else
-ifneq ($(findstring $(FULL_TARGET),powerpc-darwin i386-darwin),)
+ifneq ($(findstring $(OS_TARGET),darwin darwin),)
 fcl-extra_all: univint_all fcl-base_all
 fcl-extra_debug: univint_debug fcl-base_debug
 fcl-extra_smart: univint_smart fcl-base_release
 fcl-extra_release: univint_release fcl-base_release
 fcl-extra_shared: univint_shared fcl-base_shared
-cocoaint_all: univint_all
-cocoaint_debug: univint_debug
-cocoaint_smart: univint_smart
-cocoaint_release: univint_release
-cocoaint_shared: univint_shared
 else
 fcl-extra_all: fcl-base_all
 fcl-extra_debug: fcl-base_debug
@@ -8756,6 +8756,13 @@ fcl-extra_release: fcl-base_release
 fcl-extra_shared: fcl-base_shared
 endif
 endif
+ifneq ($(findstring $(FULL_TARGET),i386-darwin powerpc-darwin x86_64-darwin powerpc64-darwin),)
+cocoaint_all: univint_all
+cocoaint_debug: univint_debug
+cocoaint_smart: univint_smart
+cocoaint_release: univint_release
+cocoaint_shared: univint_shared
+endif
 fcl-xml_all: fcl-base_all
 fcl-xml_debug: fcl-base_debug
 fcl-xml_smart: fcl-base_smart

+ 14 - 12
packages/Makefile.fpc

@@ -26,11 +26,11 @@ dirs_freebsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc p
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib \
                users iconvenc gmp fcl-extra libxml
 dirs_darwin=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
-                libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra
-dirs_i386_darwin=graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
-dirs_powerpc_darwin=graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
-dirs_x86_64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
-dirs_powerpc64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
+               libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint
+dirs_i386_darwin=graph sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl cocoaint
+dirs_powerpc_darwin=graph sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl cocoaint
+dirs_x86_64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib cocoaint
+dirs_powerpc64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib cocoaint
 dirs_arm_darwin= httpd13 httpd20 httpd22 opengles objcrtl
 dirs_solaris=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib fcl-extra \
@@ -95,18 +95,12 @@ fcl-extra_smart: fcl-base_smart winunits-base_smart winunits-jedi_smart
 fcl-extra_release: fcl-base_release winunits-base_release winunits-jedi_release
 fcl-extra_shared: fcl-base_shared winunits-base_shared winunits-jedi_shared
 else
-ifneq ($(findstring $(FULL_TARGET),powerpc-darwin i386-darwin),)
+ifneq ($(findstring $(OS_TARGET),darwin darwin),)
 fcl-extra_all: univint_all fcl-base_all
 fcl-extra_debug: univint_debug fcl-base_debug
 fcl-extra_smart: univint_smart fcl-base_release
 fcl-extra_release: univint_release fcl-base_release
 fcl-extra_shared: univint_shared fcl-base_shared
-
-cocoaint_all: univint_all
-cocoaint_debug: univint_debug
-cocoaint_smart: univint_smart
-cocoaint_release: univint_release
-cocoaint_shared: univint_shared
 else
 fcl-extra_all: fcl-base_all
 fcl-extra_debug: fcl-base_debug
@@ -116,6 +110,14 @@ fcl-extra_shared: fcl-base_shared
 endif
 endif
 
+ifneq ($(findstring $(FULL_TARGET),i386-darwin powerpc-darwin x86_64-darwin powerpc64-darwin),)
+cocoaint_all: univint_all
+cocoaint_debug: univint_debug
+cocoaint_smart: univint_smart
+cocoaint_release: univint_release
+cocoaint_shared: univint_shared
+endif
+
 fcl-xml_all: fcl-base_all
 fcl-xml_debug: fcl-base_debug
 fcl-xml_smart: fcl-base_smart

+ 2 - 3
packages/fcl-base/src/custapp.pp

@@ -84,7 +84,7 @@ var CustomApplication : TCustomApplication = nil;
 
 Implementation
 
-{$if defined(darwin) and (defined(cpu386) or defined(cpupowerpc32))}
+{$ifdef darwin}
 uses
   MacOSAll;
 {$endif}
@@ -92,8 +92,7 @@ uses
 { TCustomApplication }
 
 function TCustomApplication.GetExeName: string;
-{ we don't have 64 bit clean interfaces to CoreFoundation yet }
-{$if defined(darwin) and (defined(cpu386) or defined(cpupowerpc32))}
+{$if defined(darwin)}
 var
   mainBundle: CFBundleRef;
   executableUrl: CFURLRef;

File diff suppressed because it is too large
+ 2 - 1
packages/univint/Makefile


+ 113 - 80
packages/univint/Makefile.fpc

@@ -8,86 +8,116 @@ version=2.5.1
 
 [target]
 units=MacOSAll MacOS
-implicitunits=ABActions ABAddressBook ABGlobals ABPeoplePicker ABTypedefs \
-  AEDataModel AEHelpers AEInteraction AEMach AEObjects \
-  AEPackObject AERegistry AEUserTermTypes AIFF ASDebugging \
-  ASRegistry ATSFont ATSLayoutTypes ATSTypes \
-  ATSUnicodeDirectAccess ATSUnicodeDrawing \
-  ATSUnicodeFlattening ATSUnicodeFonts ATSUnicodeGlyphs \
-  ATSUnicodeObjects ATSUnicodeTypes AVLTree \
-  AXErrors AXUIElement AXValue Aliases Appearance \
-  AppleDiskPartitions AppleEvents AppleHelp AppleScript \
-  AuthSession Authorization AuthorizationDB AuthorizationTags \
-  CFArray CFAttributedString CFBag CFBase CFBinaryHeap \
-  CFBitVector CFBundle CFByteOrders CFCalendar CFCharacterSet \
-  CFData CFDate CFDateFormatter CFDictionary CFFTPStream \
-  CFHTTPMessage CFHTTPStream CFHost CFLocale CFMachPort \
-  CFMessagePort CFNetServices CFNotificationCenter CFNumber \
-  CFNumberFormatter CFPlugIn CFPlugInCOM CFPreferences \
-  CFPropertyList CFRunLoop CFSet CFSocket CFSocketStream \
-  CFStream CFString CFStringEncodingExt CFTimeZone CFTree \
-  CFURL CFURLAccess CFUUID CFUserNotification CFXMLNode \
-  CFXMLParser CGAffineTransforms CGBase CGBitmapContext \
-  CGColor CGColorSpace CGContext CGDataConsumer CGDataProvider \
-  CGDirectDisplay CGDirectPalette CGDisplayConfiguration \
-  CGErrors CGEvent CGEventSource CGEventTypes \
-  CGFont CGFunction CGGLContext CGGeometry CGImage CGLayer \
-  CGPDFArray CGPDFContentStream CGPDFContext CGPDFDictionary \
-  CGPDFDocument CGPDFObject CGPDFOperatorTable CGPDFPage \
-  CGPDFScanner CGPDFStream CGPDFString CGPSConverter CGPath \
-  CGPattern CGRemoteOperation CGSession CGShading \
-  CGWindowLevels CMApplication CMCalibrator \
-  CMDeviceIntegration CMICCProfile CMMComponent CMPRComponent \
-  CMScriptingPlugin CMTypes CarbonEvents CarbonEventsCore \
-  CodeFragments Collections ColorPicker Components \
-  ConditionalMacros ControlDefinitions Controls CoreFoundation \
-  CoreGraphics DHCPClientPreferences DateTimeUtils Debugging \
-  Devices Dialogs Dictionary Displays Drag DrawSprocket \
-  DriverFamilyMatching DriverGestalt DriverSynchronization \
-  Endian Events FileTypesAndCreators Files FindByContent \
-  Finder FinderRegistry FixMath Folders FontSync Fonts GXTypes \
-  GestaltEqu HFSVolumes HIArchive HIGeometry HIObject \
-  HIObjectCore HIShape HITextUtils HITheme HIToolbar HIToolbox \
-  HIView HTMLRendering IBCarbonRuntime ICAApplication \
-  ICACamera ICADevice Icons ImageCodec ImageCompression \
-  InternetConfig IntlResources Keyboards KeychainCore \
-  KeychainHI LanguageAnalysis LaunchServices Lists LowMem \
-  MacApplication MacErrors MacHelp MacLocales MacMemory \
-  MacOSXPosix MacTextEditor MacTypes MacWindows \
-  MachineExceptions Math64 MediaHandlers Menus MixedMode \
-  Movies MoviesFormat Multiprocessing NSL NSLCore NameRegistry \
-  Navigation Notification NumberFormatting OSA OSAComp \
-  OSAGeneric OSUtils OpenTransport OpenTransportProtocol \
-  OpenTransportProviders PEFBinaryFormat PLStringFuncs \
-  PMApplication PMCore PMDefinitions Palettes Pasteboard \
-  PictUtils Power Printing Processes QDOffscreen \
-  QDPictToCGContext QTML QTSMovie QTStreamingComponents \
-  QuickTimeComponents QuickTimeMusic QuickTimeStreaming \
-  QuickTimeVR QuickTimeVRFormat Quickdraw QuickdrawText \
-  Resources SCDynamicStore SCDynamicStoreCopyDHCPInfos \
-  SCDynamicStoreCopySpecific SCDynamicStoreKey SCNetwork \
-  SCNetworkConnection SCNetworkReachability SCPreferences \
-  SCPreferencesPath SCPreferencesSetSpecific SCSI \
-  SCSchemaDefinitions SFNTLayoutTypes SFNTTypes Scrap Script \
-  Sound SpeechRecognition SpeechSynthesis StringCompare \
-  SystemConfiguration SystemSound TSMTE TextCommon TextEdit \
-  TextEncodingConverter TextEncodingPlugin TextServices \
-  TextUtils Threads Timer ToolUtils Translation \
-  TranslationExtensions TypeSelect URLAccess USB UTCUtils \
-  UTType UnicodeConverter UnicodeUtilities Video WorldScript \
-  fenv fp vBLAS vDSP \
-  UTCoreTypes xattr FontPanel CoreAudioTypes \
-  AXNotificationConstants AudioHardware AXRoleConstants \
-  TranslationServices AXActionConstants HIMovieView \
-  CGImageDestination AXValueConstants AXAttributeConstants \
-  AXTextAttributedString CGImageProperties CGImageSource \
-  UniversalAccess HostTime GPCStrings \
-  CGDisplayFades CGLTypes CVBase CVBuffer \
-  CVDisplayLink CVHostTime CVImageBuffer CVPixelBuffer \
-  CVPixelBufferPool CVPixelFormatDescription CVReturns \
-  ObjCRuntime CFNetworkErrorss CFHTTPAuthentication \
-  CFError CFNetDiagnostics DriverServices TextInputSources
-
+implicitunits=ABActions.pas ABAddressBook.pas ABGlobals.pas ABPeoplePicker.pas \ 
+  ABTypedefs.pas AEDataModel.pas AEHelpers.pas AEInteraction.pas AEMach.pas \ 
+  AEObjects.pas AEPackObject.pas AERegistry.pas AEUserTermTypes.pas AIFF.pas \ 
+  ASDebugging.pas ASRegistry.pas ATSFont.pas ATSLayoutTypes.pas ATSTypes.pas \ 
+  ATSUnicodeDirectAccess.pas ATSUnicodeDrawing.pas ATSUnicodeFlattening.pas \ 
+  ATSUnicodeFonts.pas ATSUnicodeGlyphs.pas ATSUnicodeObjects.pas \ 
+  ATSUnicodeTypes.pas AUComponent.pas AVLTree.pas AXActionConstants.pas \ 
+  AXAttributeConstants.pas AXConstants.pas AXErrors.pas \ 
+  AXNotificationConstants.pas AXRoleConstants.pas AXTextAttributedString.pas \ 
+  AXUIElement.pas AXValue.pas AXValueConstants.pas Accessibility.pas Aliases.pas \ 
+  Appearance.pas AppleDiskPartitions.pas AppleEvents.pas AppleHelp.pas \ 
+  AppleScript.pas AudioCodecs.pas AudioComponents.pas AudioHardware.pas \ 
+  AudioOutputUnit.pas AudioUnitCarbonViews.pas AudioUnitParameters.pas \ 
+  AudioUnitProperties.pas AuthSession.pas Authorization.pas AuthorizationDB.pas \ 
+  AuthorizationPlugin.pas AuthorizationTags.pas BackupCore.pas CFArray.pas \ 
+  CFAttributedString.pas CFBag.pas CFBase.pas CFBinaryHeap.pas CFBitVector.pas \ 
+  CFBundle.pas CFByteOrders.pas CFCalendar.pas CFCharacterSet.pas CFData.pas \ 
+  CFDate.pas CFDateFormatter.pas CFDictionary.pas CFError.pas CFFTPStream.pas \ 
+  CFHTTPAuthentication.pas CFHTTPMessage.pas CFHTTPStream.pas CFHost.pas \ 
+  CFLocale.pas CFMachPort.pas CFMessagePort.pas CFNetDiagnostics.pas \ 
+  CFNetServices.pas CFNetworkErrorss.pas CFNotificationCenter.pas CFNumber.pas \ 
+  CFNumberFormatter.pas CFPlugIn.pas CFPlugInCOM.pas CFPreferences.pas \ 
+  CFPropertyList.pas CFProxySupport.pas CFRunLoop.pas CFSet.pas CFSocket.pas \ 
+  CFSocketStream.pas CFStream.pas CFString.pas CFStringEncodingExt.pas \ 
+  CFTimeZone.pas CFTree.pas CFURL.pas CFURLAccess.pas CFUUID.pas \ 
+  CFUserNotification.pas CFXMLNode.pas CFXMLParser.pas CGAffineTransforms.pas \ 
+  CGBase.pas CGBitmapContext.pas CGColor.pas CGColorSpace.pas CGContext.pas \ 
+  CGDataConsumer.pas CGDataProvider.pas CGDirectDisplay.pas CGDirectPalette.pas \ 
+  CGDisplayConfiguration.pas CGDisplayFades.pas CGErrors.pas CGEvent.pas \ 
+  CGEventSource.pas CGEventTypes.pas CGFont.pas CGFunction.pas CGGLContext.pas \ 
+  CGGeometry.pas CGGradient.pas CGImage.pas CGImageDestination.pas \ 
+  CGImageProperties.pas CGImageSource.pas CGLCurrent.pas CGLDevice.pas \ 
+  CGLProfiler.pas CGLProfilerFunctionEnums.pas CGLRenderers.pas CGLTypes.pas \ 
+  CGLayer.pas CGPDFArray.pas CGPDFContentStream.pas CGPDFContext.pas \ 
+  CGPDFDictionary.pas CGPDFDocument.pas CGPDFObject.pas CGPDFOperatorTable.pas \ 
+  CGPDFPage.pas CGPDFScanner.pas CGPDFStream.pas CGPDFString.pas \ 
+  CGPSConverter.pas CGPath.pas CGPattern.pas CGRemoteOperation.pas CGSession.pas \ 
+  CGShading.pas CGWindow.pas CGWindowLevels.pas CMApplication.pas \ 
+  CMCalibrator.pas CMDeviceIntegration.pas CMICCProfile.pas CMMComponent.pas \ 
+  CMPRComponent.pas CMScriptingPlugin.pas CMTypes.pas CSIdentity.pas \ 
+  CSIdentityAuthority.pas CSIdentityQuery.pas CTFont.pas CTFontCollection.pas \ 
+  CTFontDescriptor.pas CTFontManager.pas CTFontManagerErrors.pas \ 
+  CTFontTraits.pas CTFrame.pas CTFramesetter.pas CTGlyphInfo.pas CTLine.pas \ 
+  CTParagraphStyle.pas CTRun.pas CTStringAttributes.pas CTTextTab.pas \ 
+  CTTypesetter.pas CVBase.pas CVBuffer.pas CVDisplayLink.pas CVHostTime.pas \ 
+  CVImageBuffer.pas CVOpenGLBuffer.pas CVOpenGLBufferPool.pas \ 
+  CVOpenGLTexture.pas CVOpenGLTextureCache.pas CVPixelBuffer.pas \ 
+  CVPixelBufferPool.pas CVPixelFormatDescription.pas CVReturns.pas \ 
+  CarbonEvents.pas CarbonEventsCore.pas CodeFragments.pas Collections.pas \ 
+  ColorPicker.pas ColorSyncCMM.pas ColorSyncDeprecated.pas ColorSyncDevice.pas \ 
+  ColorSyncProfile.pas ColorSyncTransform.pas Components.pas \ 
+  ConditionalMacros.pas ControlDefinitions.pas Controls.pas CoreAudioTypes.pas \ 
+  CoreFoundation.pas CoreGraphics.pas CoreText.pas DADisk.pas DASession.pas \ 
+  DHCPClientPreferences.pas DateTimeUtils.pas Debugging.pas Devices.pas \ 
+  Dialogs.pas Dictionary.pas DigitalHubRegistry.pas Displays.pas Drag.pas \ 
+  DrawSprocket.pas DriverFamilyMatching.pas DriverGestalt.pas DriverServices.pas \ 
+  DriverSynchronization.pas Endian.pas Events.pas FSEvents.pas \ 
+  FileTypesAndCreators.pas Files.pas FindByContent.pas Finder.pas \ 
+  FinderRegistry.pas FixMath.pas Folders.pas FontPanel.pas FontSync.pas \ 
+  Fonts.pas GPCStrings.pas GXTypes.pas GestaltEqu.pas HFSVolumes.pas \ 
+  HIAccessibility.pas HIArchive.pas HIButtonViews.pas HIClockView.pas \ 
+  HIComboBox.pas HIContainerViews.pas HIDataBrowser.pas HIDisclosureViews.pas \ 
+  HIGeometry.pas HIImageViews.pas HILittleArrows.pas HIMenuView.pas \ 
+  HIMovieView.pas HIObject.pas HIObjectCore.pas HIPopupButton.pas \ 
+  HIProgressViews.pas HIRelevanceBar.pas HIScrollView.pas HISearchField.pas \ 
+  HISegmentedView.pas HISeparator.pas HIShape.pas HISlider.pas HITabbedView.pas \ 
+  HITextLengthFilter.pas HITextUtils.pas HITextViews.pas HITheme.pas \ 
+  HIToolbar.pas HIToolbox.pas HIToolboxDebugging.pas HIView.pas \ 
+  HIWindowViews.pas HTMLRendering.pas HostTime.pas IBCarbonRuntime.pas \ 
+  ICAApplication.pas ICACamera.pas ICADevice.pas IconStorage.pas Icons.pas \ 
+  IconsCore.pas ImageCodec.pas ImageCompression.pas InternetConfig.pas \ 
+  IntlResources.pas Keyboards.pas KeychainCore.pas KeychainHI.pas LSInfo.pas \ 
+  LSOpen.pas LSQuarantine.pas LSSharedFileList.pas LanguageAnalysis.pas \ 
+  LaunchServices.pas Lists.pas LowMem.pas MDExternalDatastore.pas MDImporter.pas \ 
+  MDItem.pas MDLineage.pas MDQuery.pas MDSchema.pas MIDIDriver.pas \ 
+  MIDIServices.pas MIDISetup.pas MIDIThruConnection.pas MacApplication.pas \ 
+  MacErrors.pas MacHelp.pas MacLocales.pas MacMemory.pas MacOSXPosix.pas \ 
+  MacOpenGL.pas MacTextEditor.pas MacTypes.pas MacWindows.pas \ 
+  MachineExceptions.pas Math64.pas MediaHandlers.pas Menus.pas MixedMode.pas \ 
+  Movies.pas MoviesFormat.pas MultiProcessingInfo.pas Multiprocessing.pas \ 
+  MusicDevice.pas NSL.pas NSLCore.pas NameRegistry.pas Navigation.pas \ 
+  Notification.pas NumberFormatting.pas OSA.pas OSAComp.pas OSAGeneric.pas \ 
+  OSUtils.pas ObjCRuntime.pas OpenTransport.pas \ 
+  OpenTransportProtocol.pas OpenTransportProviders.pas PEFBinaryFormat.pas \ 
+  PLStringFuncs.pas PMApplication.pas PMApplicationDeprecated.pas PMCore.pas \ 
+  PMCoreDeprecated.pas PMDefinitions.pas PMDefinitionsDeprecated.pas \ 
+  PMErrors.pas PMPrintAETypes.pas PMPrintSettingsKeys.pas \ 
+  PMPrintingDialogExtensions.pas Palettes.pas Pasteboard.pas PictUtils.pas \ 
+  Power.pas Printing.pas Processes.pas QDCMCommon.pas QDOffscreen.pas \ 
+  QDPictToCGContext.pas QTML.pas QTSMovie.pas QTStreamingComponents.pas \ 
+  QuickTimeComponents.pas QuickTimeErrors.pas QuickTimeMusic.pas \ 
+  QuickTimeStreaming.pas QuickTimeVR.pas QuickTimeVRFormat.pas Quickdraw.pas \ 
+  QuickdrawText.pas QuickdrawTypes.pas Resources.pas SCDynamicStore.pas \ 
+  SCDynamicStoreCopyDHCPInfos.pas SCDynamicStoreCopySpecific.pas \ 
+  SCDynamicStoreKey.pas SCNetwork.pas SCNetworkConfiguration.pas \ 
+  SCNetworkConnection.pas SCNetworkReachability.pas SCPreferences.pas \ 
+  SCPreferencesPath.pas SCPreferencesSetSpecific.pas SCSI.pas \ 
+  SCSchemaDefinitions.pas SFNTLayoutTypes.pas SFNTTypes.pas \ 
+  ScalerStreamTypes.pas Scrap.pas Script.pas SecBase.pas Sound.pas \ 
+  SpeechRecognition.pas SpeechSynthesis.pas StringCompare.pas \ 
+  SystemConfiguration.pas SystemSound.pas TSMTE.pas TextCommon.pas TextEdit.pas \ 
+  TextEncodingConverter.pas TextEncodingPlugin.pas TextInputSources.pas \ 
+  TextServices.pas TextUtils.pas Threads.pas Timer.pas ToolUtils.pas \ 
+  Translation.pas TranslationExtensions.pas TranslationServices.pas \ 
+  TypeSelect.pas URLAccess.pas USB.pas UTCUtils.pas UTCoreTypes.pas UTType.pas \ 
+  UnicodeConverter.pas UnicodeUtilities.pas UniversalAccess.pas Video.pas \ 
+  WSMethodInvocation.pas WSProtocolHandler.pas WSTypes.pas WorldScript.pas \ 
+  cblas.pas fenv.pas fp.pas gliContexts.pas gliDispatch.pas gluContext.pas \ 
+  macgl.pas macglext.pas macglu.pas vBLAS.pas vDSP.pas xattr.pas \
+  KeyEvents
   
 exampledirs=examples
 
@@ -107,6 +137,9 @@ sourcedir=src tests
 [default]
 fpcdir=../..
 
+[prerules]
+override FPCOPT+=-Mmacpas
+
 [rules]
 MacOSAll$(PPUEXT): $(filter-out MacOS.pas GPCStrings.pas,$(wildcard *.pas))
 MacOS$(PPUEXT): $(filter-out MacOSAll.pas,$(wildcard *.pas))

+ 109 - 23
packages/univint/src/ABActions.pas

@@ -1,18 +1,21 @@
-//
+{
 //  ABActionsC.h
 //  AddressBook Framework
 //
-//  Copyright (c) 2003 Apple Computer. All rights reserved.
+//  Copyright (c) 2003-2007 Apple Inc.  All rights reserved.
 //
+//
+}
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, November 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -21,8 +24,8 @@
 
 unit ABActions;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -35,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -52,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -85,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -96,7 +171,12 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ABAddressBook,CFBase;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
 
 // --------------------------------------------------------------------------------
 //      Action Support
@@ -125,24 +205,30 @@ uses MacTypes,ABAddressBook,CFBase;
 //
 // Action plugins are stored in ~/Library/Address Book Plug-Ins or /Library/Address Book Plug-Ins
 //
-// There can be only 1 Action plug in per bundle.
+// There can be only 1 Action plugin per bundle.
 
-type ABActionGetPropertyCallback = function: CFStringRef;
-type ABActionCopyTitleCallback = function( person: ABPersonRef; identifier: CFStringRef ): CFStringRef;
-type ABActionEnabledCallback = function( person: ABPersonRef; identifier: CFStringRef ): Boolean;
-type ABActionSelectedCallback = procedure( person: ABPersonRef; identifier: CFStringRef );
+type
+	ABActionGetPropertyCallback = function: CFStringRef;
+	ABActionCopyTitleCallback = function( person: ABPersonRef; identifier: CFStringRef ): CFStringRef;
+	ABActionEnabledCallback = function( person: ABPersonRef; identifier: CFStringRef ): Boolean;
+	ABActionSelectedCallback = procedure( person: ABPersonRef; identifier: CFStringRef );
 
-type ABActionCallbacks = record
-    version: CFIndex;
-    proprty: ABActionGetPropertyCallback;
-    title: ABActionCopyTitleCallback;
-    enabled: ABActionEnabledCallback;
-    selected: ABActionSelectedCallback;
-end;
+type
+	ABActionCallbacks = record
+		version: CFIndex;
+		proprty: ABActionGetPropertyCallback;
+		title: ABActionCopyTitleCallback;
+		enabled: ABActionEnabledCallback;
+		selected: ABActionSelectedCallback;
+	end;
 
 // Your CFBundle MUST include a function named ABActionRegisterCallbacks which returns a pointer
 // to a filled out ABActionCallbacks struct:
 //
 // ABActionCallbacks* ABActionRegisterCallbacks(void);
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 149 - 52
packages/univint/src/ABAddressBook.pas

@@ -1,19 +1,21 @@
-//
+{
 //  ABAddressBookC.h
 //  AddressBook Framework
 //
-//  Copyright (c) 2002-2003 Apple Computer. All rights reserved.
+//  Copyright (c) 2003-2007 Apple Inc.  All rights reserved.
 //
-
+//
+}
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, November 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -22,8 +24,8 @@
 
 unit ABAddressBook;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -36,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -53,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -86,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -97,16 +171,28 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ABTypedefs,ABGlobals,CFBase,CFArray,CFDictionary,CFData;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
 
 type
-	ABRecordRef    = ^SInt32; { an opaque 32-bit type }
-	ABPersonRef    = ^SInt32; { an opaque 32-bit type }
-	ABGroupRef    = ^SInt32; { an opaque 32-bit type }
-	ABSearchElementRef    = ^SInt32; { an opaque 32-bit type }
-	ABAddressBookRef    = ^SInt32; { an opaque 32-bit type }
-	ABMultiValueRef    = ^SInt32; { an opaque 32-bit type }
-	ABMutableMultiValueRef    = ^SInt32; { an opaque 32-bit type }
+	ABRecordRef = UnivPtr;
+	ABPersonRef = ^__ABPerson; { an opaque type }
+	__ABPerson = record end;
+	ABGroupRef = ^__ABGroup; { an opaque type }
+	__ABGroup = record end;
+	ABSearchElementRef = ^__ABSearchElementRef; { an opaque type }
+	__ABSearchElementRef = record end;
+	ABAddressBookRef = ^__ABAddressBookRef; { an opaque type }
+	__ABAddressBookRef = record end;
+	ABMultiValueRef = ^__ABMultiValue; { an opaque type }
+	__ABMultiValue = record end;
+	ABMutableMultiValueRef = ^__ABMultiValue; { an opaque type }
 
 // --------------------------------------------------------------------------------
 //	LSOpenCFURLRef support
@@ -145,28 +231,28 @@ function ABGetSharedAddressBook: ABAddressBookRef; external name '_ABGetSharedAd
 function ABCopyArrayOfMatchingRecords( addressBook: ABAddressBookRef; search: ABSearchElementRef ): CFArrayRef; external name '_ABCopyArrayOfMatchingRecords';
 
     // --- Saving
-function ABSave( addressBook: ABAddressBookRef ): Boolean; external name '_ABSave';
-function ABHasUnsavedChanges( addressBook: ABAddressBookRef ): Boolean; external name '_ABHasUnsavedChanges';
+function ABSave( addressBook: ABAddressBookRef ): CBool; external name '_ABSave';
+function ABHasUnsavedChanges( addressBook: ABAddressBookRef ): CBool; external name '_ABHasUnsavedChanges';
 
     // --- Me
 function ABGetMe( addressBook: ABAddressBookRef ): ABPersonRef; external name '_ABGetMe'; // Not retain???
 procedure ABSetMe( addressBook: ABAddressBookRef; moi: ABPersonRef ); external name '_ABSetMe';
 
     // Returns the record class Name for a particular uniqueId
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABCopyRecordTypeFromUniqueId( addressBook: ABAddressBookRef; uniqueId: CFStringRef ): CFStringRef; external name '_ABCopyRecordTypeFromUniqueId';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // --- Properties
     // Property names must be unique for a record type
-function ABAddPropertiesAndTypes( addressBook: ABAddressBookRef; recordType: CFStringRef; propertiesAnTypes: CFDictionaryRef ): SInt32; external name '_ABAddPropertiesAndTypes';
-function ABRemoveProperties( addressBook: ABAddressBookRef; recordType: CFStringRef; properties: CFArrayRef ): SInt32; external name '_ABRemoveProperties';
+function ABAddPropertiesAndTypes( addressBook: ABAddressBookRef; recordType: CFStringRef; propertiesAnTypes: CFDictionaryRef ): CFIndex; external name '_ABAddPropertiesAndTypes';
+function ABRemoveProperties( addressBook: ABAddressBookRef; recordType: CFStringRef; properties: CFArrayRef ): CFIndex; external name '_ABRemoveProperties';
 function ABCopyArrayOfPropertiesForRecordType( addressBook: ABAddressBookRef; recordType: CFStringRef ): CFArrayRef; external name '_ABCopyArrayOfPropertiesForRecordType';
 function ABTypeOfProperty( addressBook: ABAddressBookRef; recordType: CFStringRef; proprty: CFStringRef ): ABPropertyType; external name '_ABTypeOfProperty';
 
     // --- Records (Person, Group)
 function ABCopyRecordForUniqueId( addressBook: ABAddressBookRef; uniqueId: CFStringRef ): ABRecordRef; external name '_ABCopyRecordForUniqueId';
-function ABAddRecord( addressBook: ABAddressBookRef; recrd: ABRecordRef ): Boolean; external name '_ABAddRecord';
-function ABRemoveRecord( addressBook: ABAddressBookRef; recrd: ABRecordRef ): Boolean; external name '_ABRemoveRecord';
+function ABAddRecord( addressBook: ABAddressBookRef; recrd: ABRecordRef ): CBool; external name '_ABAddRecord';
+function ABRemoveRecord( addressBook: ABAddressBookRef; recrd: ABRecordRef ): CBool; external name '_ABRemoveRecord';
 
     // --- People
 function ABCopyArrayOfAllPeople( addressBook: ABAddressBookRef ): CFArrayRef; external name '_ABCopyArrayOfAllPeople';                  // Array of ABPerson
@@ -178,14 +264,20 @@ function ABCopyArrayOfAllGroups( addressBook: ABAddressBookRef ): CFArrayRef; ex
 //      ABRecord
 // --------------------------------------------------------------------------------
 
+function ABRecordCreateCopy( recrd: ABRecordRef ): ABRecordRef; external name '_ABRecordCreateCopy';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
 function ABRecordCopyRecordType( recrd: ABRecordRef ): CFStringRef; external name '_ABRecordCopyRecordType';
 
     // --- Property value
 function ABRecordCopyValue( recrd: ABRecordRef; proprty: CFStringRef ): CFTypeRef; external name '_ABRecordCopyValue';
     // returns a CFDictionary for multi-value properties
-function ABRecordSetValue( recrd: ABRecordRef; proprty: CFStringRef; value: CFTypeRef ): Boolean; external name '_ABRecordSetValue';
+function ABRecordSetValue( recrd: ABRecordRef; proprty: CFStringRef; value: CFTypeRef ): CBool; external name '_ABRecordSetValue';
     // takes a CFDictionary for multi-value properties
-function ABRecordRemoveValue( recrd: ABRecordRef; proprty: CFStringRef ): Boolean; external name '_ABRecordRemoveValue';
+function ABRecordRemoveValue( recrd: ABRecordRef; proprty: CFStringRef ): CBool; external name '_ABRecordRemoveValue';
+   // is the record read only
+function ABRecordIsReadOnly( recrd: ABRecordRef ): CBool; external name '_ABRecordIsReadOnly';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
     // ---- Unique ID access convenience
 function ABRecordCopyUniqueId( recrd: ABRecordRef ): CFStringRef; external name '_ABRecordCopyUniqueId';
@@ -212,19 +304,19 @@ function ABGroupCreate: ABGroupRef; external name '_ABGroupCreate';
 
     // --- Dealing with Persons
 function ABGroupCopyArrayOfAllMembers( group: ABGroupRef ): CFArrayRef; external name '_ABGroupCopyArrayOfAllMembers';
-function ABGroupAddMember( group: ABGroupRef; personToAdd: ABPersonRef ): Boolean; external name '_ABGroupAddMember';
-function ABGroupRemoveMember( group: ABGroupRef; personToRemove: ABPersonRef ): Boolean; external name '_ABGroupRemoveMember';
+function ABGroupAddMember( group: ABGroupRef; personToAdd: ABPersonRef ): CBool; external name '_ABGroupAddMember';
+function ABGroupRemoveMember( group: ABGroupRef; personToRemove: ABPersonRef ): CBool; external name '_ABGroupRemoveMember';
 
     // --- Dealing with Groups
 function ABGroupCopyArrayOfAllSubgroups( group: ABGroupRef ): CFArrayRef; external name '_ABGroupCopyArrayOfAllSubgroups';
-function ABGroupAddGroup( group: ABGroupRef; groupToAdd: ABGroupRef ): Boolean; external name '_ABGroupAddGroup';
-function ABGroupRemoveGroup( group: ABGroupRef; groupToRemove: ABGroupRef ): Boolean; external name '_ABGroupRemoveGroup';
+function ABGroupAddGroup( group: ABGroupRef; groupToAdd: ABGroupRef ): CBool; external name '_ABGroupAddGroup';
+function ABGroupRemoveGroup( group: ABGroupRef; groupToRemove: ABGroupRef ): CBool; external name '_ABGroupRemoveGroup';
 
-    // --- Dealong with Parents
+    // --- Dealing with Parents
 function ABGroupCopyParentGroups( group: ABGroupRef ): CFArrayRef; external name '_ABGroupCopyParentGroups';
 
     // --- Distribution list
-function ABGroupSetDistributionIdentifier( group: ABGroupRef; person: ABPersonRef; proprty: CFStringRef; identifier: CFStringRef ): Boolean; external name '_ABGroupSetDistributionIdentifier';
+function ABGroupSetDistributionIdentifier( group: ABGroupRef; person: ABPersonRef; proprty: CFStringRef; identifier: CFStringRef ): CBool; external name '_ABGroupSetDistributionIdentifier';
 function ABGroupCopyDistributionIdentifier( group: ABGroupRef; person: ABPersonRef; proprty: CFStringRef ): CFStringRef; external name '_ABGroupCopyDistributionIdentifier';
 
     // --- Search elements
@@ -236,19 +328,19 @@ function ABGroupCreateSearchElement( proprty: CFStringRef; labl: CFStringRef; ke
 
 function ABSearchElementCreateWithConjunction( conjunction: ABSearchConjunction; childrenSearchElement: CFArrayRef ): ABSearchElementRef; external name '_ABSearchElementCreateWithConjunction';
 
-function ABSearchElementMatchesRecord( searchElement: ABSearchElementRef; recrd: ABRecordRef ): Boolean; external name '_ABSearchElementMatchesRecord';
+function ABSearchElementMatchesRecord( searchElement: ABSearchElementRef; recrd: ABRecordRef ): CBool; external name '_ABSearchElementMatchesRecord';
 
 // --------------------------------------------------------------------------------
 //      ABMultiValue
 // --------------------------------------------------------------------------------
 
 function ABMultiValueCreate: ABMultiValueRef; external name '_ABMultiValueCreate';
-function ABMultiValueCount( multiValue: ABMultiValueRef ): UInt32; external name '_ABMultiValueCount';
-function ABMultiValueCopyValueAtIndex( multiValue: ABMultiValueRef; index: SInt32 ): CFTypeRef; external name '_ABMultiValueCopyValueAtIndex';
-function ABMultiValueCopyLabelAtIndex( multiValue: ABMultiValueRef; index: SInt32 ): CFStringRef; external name '_ABMultiValueCopyLabelAtIndex';
+function ABMultiValueCount( multiValue: ABMultiValueRef ): CFIndex; external name '_ABMultiValueCount';
+function ABMultiValueCopyValueAtIndex( multiValue: ABMultiValueRef; index: CFIndex ): CFTypeRef; external name '_ABMultiValueCopyValueAtIndex';
+function ABMultiValueCopyLabelAtIndex( multiValue: ABMultiValueRef; index: CFIndex ): CFStringRef; external name '_ABMultiValueCopyLabelAtIndex';
 function ABMultiValueCopyPrimaryIdentifier( multiValue: ABMultiValueRef ): CFStringRef; external name '_ABMultiValueCopyPrimaryIdentifier';
-function ABMultiValueIndexForIdentifier( multiValue: ABMultiValueRef; identifier: CFStringRef ): SInt32; external name '_ABMultiValueIndexForIdentifier';
-function ABMultiValueCopyIdentifierAtIndex( multiValue: ABMultiValueRef; index: SInt32 ): CFStringRef; external name '_ABMultiValueCopyIdentifierAtIndex';
+function ABMultiValueIndexForIdentifier( multiValue: ABMultiValueRef; identifier: CFStringRef ): CFIndex; external name '_ABMultiValueIndexForIdentifier';
+function ABMultiValueCopyIdentifierAtIndex( multiValue: ABMultiValueRef; index: CFIndex ): CFStringRef; external name '_ABMultiValueCopyIdentifierAtIndex';
 function ABMultiValuePropertyType( multiValue: ABMultiValueRef ): ABPropertyType; external name '_ABMultiValuePropertyType';
 function ABMultiValueCreateCopy( multiValue: ABMultiValueRef ): ABMultiValueRef; external name '_ABMultiValueCreateCopy';
 
@@ -257,12 +349,12 @@ function ABMultiValueCreateCopy( multiValue: ABMultiValueRef ): ABMultiValueRef;
 // --------------------------------------------------------------------------------
 
 function ABMultiValueCreateMutable: ABMutableMultiValueRef; external name '_ABMultiValueCreateMutable';
-function ABMultiValueAdd( multiValue: ABMutableMultiValueRef; value: CFTypeRef; labl: CFStringRef; var outIdentifier: CFStringRef ): Boolean; external name '_ABMultiValueAdd';
-function ABMultiValueInsert( multiValue: ABMutableMultiValueRef; value: CFTypeRef; labl: CFStringRef; index: SInt32; var outIdentifier: CFStringRef ): Boolean; external name '_ABMultiValueInsert';
-function ABMultiValueRemove( multiValue: ABMutableMultiValueRef; index: SInt32 ): Boolean; external name '_ABMultiValueRemove';
-function ABMultiValueReplaceValue( multiValue: ABMutableMultiValueRef; value: CFTypeRef; index: SInt32 ): Boolean; external name '_ABMultiValueReplaceValue';
-function ABMultiValueReplaceLabel( multiValue: ABMutableMultiValueRef; labl: CFStringRef; index: SInt32 ): Boolean; external name '_ABMultiValueReplaceLabel';
-function ABMultiValueSetPrimaryIdentifier( multiValue: ABMutableMultiValueRef; identifier: CFStringRef ): Boolean; external name '_ABMultiValueSetPrimaryIdentifier';
+function ABMultiValueAdd( multiValue: ABMutableMultiValueRef; value: CFTypeRef; labl: CFStringRef; var outIdentifier: CFStringRef ): CBool; external name '_ABMultiValueAdd';
+function ABMultiValueInsert( multiValue: ABMutableMultiValueRef; value: CFTypeRef; labl: CFStringRef; index: CFIndex; var outIdentifier: CFStringRef ): CBool; external name '_ABMultiValueInsert';
+function ABMultiValueRemove( multiValue: ABMutableMultiValueRef; index: CFIndex ): CBool; external name '_ABMultiValueRemove';
+function ABMultiValueReplaceValue( multiValue: ABMutableMultiValueRef; value: CFTypeRef; index: CFIndex ): CBool; external name '_ABMultiValueReplaceValue';
+function ABMultiValueReplaceLabel( multiValue: ABMutableMultiValueRef; labl: CFStringRef; index: CFIndex ): CBool; external name '_ABMultiValueReplaceLabel';
+function ABMultiValueSetPrimaryIdentifier( multiValue: ABMutableMultiValueRef; identifier: CFStringRef ): CBool; external name '_ABMultiValueSetPrimaryIdentifier';
 function ABMultiValueCreateMutableCopy( multiValue: ABMultiValueRef ): ABMutableMultiValueRef; external name '_ABMultiValueCreateMutableCopy';
 
 // --------------------------------------------------------------------------------
@@ -272,21 +364,26 @@ function ABMultiValueCreateMutableCopy( multiValue: ABMultiValueRef ): ABMutable
 function ABCopyLocalizedPropertyOrLabel( labelOrProperty: CFStringRef ): CFStringRef; external name '_ABCopyLocalizedPropertyOrLabel';
 
 // --- Address formatting
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABCreateFormattedAddressFromDictionary( addressBook: ABAddressBookRef; address: CFDictionaryRef ): CFStringRef; external name '_ABCreateFormattedAddressFromDictionary';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 function ABCopyDefaultCountryCode( addressBook: ABAddressBookRef ): CFStringRef; external name '_ABCopyDefaultCountryCode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 // --------------------------------------------------------------------------------
 //      Person Image Loading
 // --------------------------------------------------------------------------------
 
-function ABPersonSetImageData( person: ABPersonRef; imageData: CFDataRef ): Boolean; external name '_ABPersonSetImageData';
+function ABPersonSetImageData( person: ABPersonRef; imageData: CFDataRef ): CBool; external name '_ABPersonSetImageData';
 function ABPersonCopyImageData( person: ABPersonRef ): CFDataRef; external name '_ABPersonCopyImageData';
 
-type ABImageClientCallback = procedure ( imageData: CFDataRef; tag: SInt32; refcon: UnivPtr );
+type
+	ABImageClientCallback = procedure( imageData: CFDataRef; tag: CFIndex; refcon: UnivPtr );
+
+function ABBeginLoadingImageDataForClient( person: ABPersonRef; callback: ABImageClientCallback; refcon: UnivPtr ): CFIndex; external name '_ABBeginLoadingImageDataForClient';
+procedure ABCancelLoadingImageDataForTag( tag: CFIndex ); external name '_ABCancelLoadingImageDataForTag';
 
-function ABBeginLoadingImageDataForClient( person: ABPersonRef; callback: ABImageClientCallback; refcon: UnivPtr ): SInt32; external name '_ABBeginLoadingImageDataForClient';
-procedure ABCancelLoadingImageDataForTag( tag: SInt32 ); external name '_ABCancelLoadingImageDataForTag';
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 103 - 11
packages/univint/src/ABGlobals.pas

@@ -1,19 +1,21 @@
 {
- *  ABGlobals.h
+ *  ABGlobalsC.h
  *  AddressBook Framework
  *
- *  Copyright (c) 2002-2003 Apple Computer. All rights reserved.
+ *  Copyright (c) 2003-2007 Apple Inc.  All rights reserved.
  *
  }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, Feburary 2006 }
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, November 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -22,8 +24,8 @@
 
 unit ABGlobals;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -36,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -53,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -86,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -97,8 +171,14 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
+
 // NOTE: This header is for C programmers. For Objective-C use ABGlobals.h
 
 // ================================================================
@@ -154,7 +234,6 @@ var kABAddressWorkLabel: CFStringRef; external name '_kABAddressWorkLabel'; (* a
  * kABAddressCountryCodeKey code must be one of the following:
  * iso country codes
  *
- *    ae = United Arab Emirates
  *    ar = Argentina
  *    at = Austria
  *    au = Australia
@@ -213,7 +292,6 @@ var kABAddressWorkLabel: CFStringRef; external name '_kABAddressWorkLabel'; (* a
  *    uk = United Kingdom
  *    us = United States
  *    ye = Yemen
- *    yu = Serbia and Montenegro
  *    za = South Africa
  *
  }
@@ -317,6 +395,16 @@ var kABHomeLabel: CFStringRef; external name '_kABHomeLabel'; (* attribute const
     // Can be used with any multi-value property
 var kABOtherLabel: CFStringRef; external name '_kABOtherLabel'; (* attribute const *)
 
+// ================================================================
+//      RecordTypes
+// ================================================================
+
+    // Type of a ABPersonRef
+var kABPersonRecordType : CFStringRef; external name '_kABPersonRecordType'; (* attribute const *)
+
+    // Type of a ABGroupRef
+var kABGroupRecordType : CFStringRef; external name '_kABGroupRecordType'; (* attribute const *)
+
 // ================================================================
 //      Notifications published when something changes
 // ================================================================
@@ -350,4 +438,8 @@ var kABDeletedRecords: CFStringRef; external name '_kABDeletedRecords'; (* attri
     // Returns propertyOrLabel if not found (e.g. if not built in)
 function ABLocalizedPropertyOrLabel( propertyOrLabel: CFStringRef ): CFStringRef; external name '_ABLocalizedPropertyOrLabel';
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 146 - 59
packages/univint/src/ABPeoplePicker.pas

@@ -1,18 +1,21 @@
+{
 //
 //  ABPeoplePickerC.h
 //  AddressBook Framework
 //
-//  Copyright (c) 2003 Apple Computer. All rights reserved.
+//  Copyright (c) 2003-2007 Apple Inc.  All rights reserved.
 //
+}
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, November 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -21,8 +24,8 @@
 
 unit ABPeoplePicker;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -35,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -52,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -85,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -95,11 +170,18 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,ABAddressBook,CFBase,CFArray,CGGeometry,Drag,HIObjectCore,HIGeometry;
-{$ALIGN MAC68K}
+uses MacTypes,ABAddressBook,CFBase,CFArray,CGGeometry,HIGeometry,CarbonEventsCore;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
 
 type
-	ABPickerRef							= ^SInt32;
+	ABPickerRef = ^OpaqueABPicker; { an opaque type }
+	OpaqueABPicker = record end;
 
 {
  * Picker creation and manipulation
@@ -107,44 +189,45 @@ type
 
 // Creates an ABPickerRef. Release with CFRelease(). The window is created hidden. Call
 // ABPickerSetVisibility() to show it.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCreate: ABPickerRef; external name '_ABPickerCreate';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 // Change the structural frame of the window.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerSetFrame( inPicker: ABPickerRef; const (*var*) inFrame: HIRect ); external name '_ABPickerSetFrame';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerGetFrame( inPicker: ABPickerRef; var outFrame: HIRect ); external name '_ABPickerGetFrame';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure ABPickerSetVisibility( inPicker: ABPickerRef; visible: Boolean ); external name '_ABPickerSetVisibility';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-function ABPickerIsVisible( inPicker: ABPickerRef ): Boolean; external name '_ABPickerIsVisible';
+procedure ABPickerSetVisibility( inPicker: ABPickerRef; visible: CBool ); external name '_ABPickerSetVisibility';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+function ABPickerIsVisible( inPicker: ABPickerRef ): CBool; external name '_ABPickerIsVisible';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 {
  * Look and Feel
  }
 
 const
-    // Choose the selection behavior for the value column. If multiple behaviors are selected,
+// Choose the selection behavior for the value column. If multiple behaviors are selected,
     // the most restrictive behavior will be used. Defaults to kABPickerSingleValueSelection set
     // to TRUE.
-    kABPickerSingleValueSelection   = 1 shl 0; // Allow user to choose a single value for a person.
-    kABPickerMultipleValueSelection = 1 shl 1; // Allow user to choose multiple values for a person.
+	kABPickerSingleValueSelection = 1 shl 0; // Allow user to choose a single value for a person.
+	kABPickerMultipleValueSelection = 1 shl 1; // Allow user to choose multiple values for a person.
 
     // Allow the user to select entire groups in the group column. If false, at least one
     // person in the group will be selected. Defaults to FALSE.
-    kABPickerAllowGroupSelection    = 1 shl 2;
+	kABPickerAllowGroupSelection = 1 shl 2;
 
     // Allow the user to select more than one group/record at a time. Defaults to TRUE.
-    kABPickerAllowMultipleSelection = 1 shl 3;
+	kABPickerAllowMultipleSelection = 1 shl 3;
 
-type ABPickerAttributes = OptionBits;
+type
+	ABPickerAttributes = OptionBits;
 
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerGetAttributes( inPicker: ABPickerRef ): ABPickerAttributes; external name '_ABPickerGetAttributes';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerChangeAttributes( inPicker: ABPickerRef; inAttributesToSet: ABPickerAttributes; inAttributesToClear: ABPickerAttributes ); external name '_ABPickerChangeAttributes';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 {
  * Value column
@@ -154,66 +237,66 @@ procedure ABPickerChangeAttributes( inPicker: ABPickerRef; inAttributesToSet: AB
     // display if an AB property is added. A popup button in the column header will be used if more
     // than one property is added. Titles for built in properties will localized automatically. A
     // list of AB properties can be found in <AddressBook/ABGlobals.h>.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerAddProperty( inPicker: ABPickerRef; inProperty: CFStringRef ); external name '_ABPickerAddProperty';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerRemoveProperty( inPicker: ABPickerRef; inProperty: CFStringRef ); external name '_ABPickerRemoveProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
     // Returns an array of AB Properties as CFStringRefs.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCopyProperties( inPicker: ABPickerRef ): CFArrayRef; external name '_ABPickerCopyProperties';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Localized titles for third party properties should be set with these methods.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerSetColumnTitle( inPicker: ABPickerRef; inTitle: CFStringRef; inProperty: CFStringRef ); external name '_ABPickerSetColumnTitle';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 function ABPickerCopyColumnTitle( inPicker: ABPickerRef; inProperty: CFStringRef ): CFStringRef; external name '_ABPickerCopyColumnTitle';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Display one of the properties added above in the values column.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerSetDisplayedProperty( inPicker: ABPickerRef; inProperty: CFStringRef ); external name '_ABPickerSetDisplayedProperty';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 function ABPickerCopyDisplayedProperty( inPicker: ABPickerRef ): CFStringRef; external name '_ABPickerCopyDisplayedProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 {
  * Selection
  }
 
     // Returns group column selection as an array of ABGroupRef objects.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCopySelectedGroups( inPicker: ABPickerRef ): CFArrayRef; external name '_ABPickerCopySelectedGroups';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Returns names column selection as an array of ABGroupRef or ABPersonRef objects.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCopySelectedRecords( inPicker: ABPickerRef ): CFArrayRef; external name '_ABPickerCopySelectedRecords';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // This method returns an array of selected multi-value identifiers. Returns nil if the displayed
     // property is a single value type.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCopySelectedIdentifiers( inPicker: ABPickerRef; inPerson: ABPersonRef ): CFArrayRef; external name '_ABPickerCopySelectedIdentifiers';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Returns an array containing CFStringRefs for each item selected in the values column.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function ABPickerCopySelectedValues( inPicker: ABPickerRef ): CFArrayRef; external name '_ABPickerCopySelectedValues';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Select group/name/value programatically.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure ABPickerSelectGroup( inPicker: ABPickerRef; inGroup: ABGroupRef; inExtendSelection: Boolean ); external name '_ABPickerSelectGroup';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure ABPickerSelectRecord( inPicker: ABPickerRef; inRecord: ABRecordRef; inExtendSelection: Boolean ); external name '_ABPickerSelectRecord';
+procedure ABPickerSelectGroup( inPicker: ABPickerRef; inGroup: ABGroupRef; inExtendSelection: CBool ); external name '_ABPickerSelectGroup';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+procedure ABPickerSelectRecord( inPicker: ABPickerRef; inRecord: ABRecordRef; inExtendSelection: CBool ); external name '_ABPickerSelectRecord';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
     // Individual values contained within an multi-value property can be selected with this method.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure ABPickerSelectIdentifier( inPicker: ABPickerRef; inPerson: ABPersonRef; inIdentifier: CFStringRef; inExtendSelection: Boolean ); external name '_ABPickerSelectIdentifier';
+procedure ABPickerSelectIdentifier( inPicker: ABPickerRef; inPerson: ABPersonRef; inIdentifier: CFStringRef; inExtendSelection: CBool ); external name '_ABPickerSelectIdentifier';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Remove selection
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerDeselectGroup( inPicker: ABPickerRef; inGroup: ABGroupRef ); external name '_ABPickerDeselectGroup';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerDeselectRecord( inPicker: ABPickerRef; inRecord: ABRecordRef ); external name '_ABPickerDeselectRecord';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerDeselectIdentifier( inPicker: ABPickerRef; inPerson: ABPersonRef; inIdentifier: CFStringRef ); external name '_ABPickerDeselectIdentifier';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerDeselectAll( inPicker: ABPickerRef ); external name '_ABPickerDeselectAll';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 {
  * Events and Actions
@@ -229,8 +312,8 @@ procedure ABPickerDeselectAll( inPicker: ABPickerRef ); external name '_ABPicker
  }
 
 const
-    // Carbon Event class for People Picker
-    kEventClassABPeoplePicker = FourCharCode('abpp');
+// Carbon Event class for People Picker
+	kEventClassABPeoplePicker = FourCharCode('abpp');
 
 const
     // Carbon Event kinds for People Picker
@@ -243,23 +326,27 @@ const
     kEventABPeoplePickerNameDoubleClicked         = 6;
 
 const
-    // Carbon Event parameter name
-    kEventParamABPickerRef	=  FourCharCode('abpp');
+// Carbon Event parameter name
+	kEventParamABPickerRef = FourCharCode('abpp');
 
     // Set the event handler for People Picker events.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-procedure ABPickerSetDelegate( inPicker: ABPickerRef; inDelegate: HIObjectRef ); external name '_ABPickerSetDelegate';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-function ABPickerGetDelegate( inPicker: ABPickerRef ): HIObjectRef; external name '_ABPickerGetDelegate';
+procedure ABPickerSetDelegate( inPicker: ABPickerRef; inDelegate: EventTargetRef ); external name '_ABPickerSetDelegate';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+function ABPickerGetDelegate( inPicker: ABPickerRef ): EventTargetRef; external name '_ABPickerGetDelegate';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Clear the search field and reset the list of displayed names.
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerClearSearchField( inPicker: ABPickerRef ); external name '_ABPickerClearSearchField';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
     // Launch AddressBook and edit the current selection
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure ABPickerEditInAddressBook( inPicker: ABPickerRef ); external name '_ABPickerEditInAddressBook';
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 procedure ABPickerSelectInAddressBook( inPicker: ABPickerRef ); external name '_ABPickerSelectInAddressBook';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 130 - 25
packages/univint/src/ABTypedefs.pas

@@ -2,18 +2,19 @@
  *  ABTypedefs.h
  *  AddressBook Framework
  *
- *  Copyright (c) 2002-2003 Apple Computer. All rights reserved.
+ *  Copyright (c) 2003-2007 Apple Inc.  All rights reserved.
  *
  }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, November 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -22,8 +23,8 @@
 
 unit ABTypedefs;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -36,16 +37,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -53,14 +76,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -86,7 +160,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -97,7 +170,21 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+// These typedefs are CFIndexes rather then NSIntegers because
+// they're used in the C API as well as the Obj-C one.
+
+// ================================================================
+//      Property Type
+// ================================================================
+
 const
 	kABMultiValueMask  = $100;
 
@@ -127,26 +214,44 @@ const
 type
 	ABSearchComparison = SInt32;
 const
-        kABEqual = 0;
-        kABNotEqual = 1;
-        kABLessThan = 2;
-        kABLessThanOrEqual = 3;
-        kABGreaterThan = 4;
-        kABGreaterThanOrEqual = 5;
-
-        kABEqualCaseInsensitive = 6;
-        kABContainsSubString = 7;
-        kABContainsSubStringCaseInsensitive = 8;
-        kABPrefixMatch = 9;
-        kABPrefixMatchCaseInsensitive = 10;
+	kABEqual 										= 0;
+	kABNotEqual 									= 1;
+	kABLessThan  		 		 					= 2;
+	kABLessThanOrEqual  		 					= 3;
+	kABGreaterThan 		 		 					= 4;
+	kABGreaterThanOrEqual 		 					= 5;
+	kABEqualCaseInsensitive 		 				= 6;
+	kABContainsSubString 		 					= 7;
+	kABContainsSubStringCaseInsensitive 			= 8;
+	kABPrefixMatch 		 		 					= 9;
+	kABPrefixMatchCaseInsensitive 					= 10;
 // #if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED
-        kABBitsInBitFieldMatch = 11;
+	kABBitsInBitFieldMatch 		 					= 11;
+// #endif
+// #if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED
+	kABDoesNotContainSubString 		 		 		= 12;
+	kABDoesNotContainSubStringCaseInsensitive 		= 13;
+	kABNotEqualCaseInsensitive 		 		 		= 14;
+	kABSuffixMatch 		 		 		 		 	= 15;
+	kABSuffixMatchCaseInsensitive 		 		 	= 16;
+	kABWithinIntervalAroundToday 		 		 	= 17;
+	kABWithinIntervalAroundTodayYearless 		 	= 18;
+	kABNotWithinIntervalAroundToday 		 		= 19;
+	kABNotWithinIntervalAroundTodayYearless 		= 20;
+	kABWithinIntervalFromToday 		 		 		= 21;
+	kABWithinIntervalFromTodayYearless 		 		= 22;
+	kABNotWithinIntervalFromToday 		 		 	= 23;
+	kABNotWithinIntervalFromTodayYearless 		 	= 24;
 // #endif
 
 type
 	ABSearchConjunction = SInt32;
 const
-        kABSearchAnd = 0;
-        kABSearchOr = 1;
+	kABSearchAnd = 0;
+	kABSearchOr = 1;
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 613 - 295
packages/univint/src/AEDataModel.pas


+ 409 - 96
packages/univint/src/AEHelpers.pas

@@ -1,12 +1,11 @@
 {
-     File:       AEHelpers.p
+     File:       AE/AEHelpers.h
  
      Contains:   AEPrint, AEBuild and AEStream for Carbon
  
-     Version:    Technology: Mac OS X, CarbonLib
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1999-2002 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 1999-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,17 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-{
- * Originally from AEGIzmos by Jens Alfke, circa 1992.
- }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -33,8 +29,8 @@
 
 unit AEHelpers;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -47,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -64,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -97,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -108,12 +176,163 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,AppleEvents,AEDataModel;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{
+ * Originally from AEGIzmos by Jens Alfke, circa 1992.
+ }
+
 
 {$ALIGN MAC68K}
 
 {
- * AEBuild is only available for C programmers.
+ * AEBuild:
+ *
+ * AEBuild provides a very high level abstraction for building
+ * complete AppleEvents and complex ObjectSpeciers.  Using AEBuild it
+ * is easy to produce a textual representation of an AEDesc.  The
+ * format is similar to the stdio printf call, where meta data is
+ * extracted from a format string and used to build the final
+ * representation.
+ * 
+ * For more information on AEBuild and other APIs in AEHelpers, see:
+ *     <http://developer.apple.com/technotes/tn/tn2045.html>
+ }
+{ Syntax Error Codes: }
+type
+	AEBuildErrorCode = UInt32;
+const
+	aeBuildSyntaxNoErr = 0;    { (No error) }
+	aeBuildSyntaxBadToken = 1;    { Illegal character }
+	aeBuildSyntaxBadEOF = 2;    { Unexpected end of format string }
+	aeBuildSyntaxNoEOF = 3;    { Unexpected extra stuff past end }
+	aeBuildSyntaxBadNegative = 4;    { "-" not followed by digits }
+	aeBuildSyntaxMissingQuote = 5;    { Missing close "'" }
+	aeBuildSyntaxBadHex = 6;    { Non-digit in hex string }
+	aeBuildSyntaxOddHex = 7;    { Odd # of hex digits }
+	aeBuildSyntaxNoCloseHex = 8;    { Missing hex quote close "È" }
+	aeBuildSyntaxUncoercedHex = 9;    { Hex string must be coerced to a type }
+	aeBuildSyntaxNoCloseString = 10;   { Missing close quote }
+	aeBuildSyntaxBadDesc = 11;   { Illegal descriptor }
+	aeBuildSyntaxBadData = 12;   { Bad data value inside (Ç È) }
+	aeBuildSyntaxNoCloseParen = 13;   { Missing ")" after data value }
+	aeBuildSyntaxNoCloseBracket = 14;   { Expected "," or "]" }
+	aeBuildSyntaxNoCloseBrace = 15;   { Expected "," or ")" }
+	aeBuildSyntaxNoKey = 16;   { Missing keyword in record }
+	aeBuildSyntaxNoColon = 17;   { Missing ":" after keyword in record }
+	aeBuildSyntaxCoercedList = 18;   { Cannot coerce a list }
+	aeBuildSyntaxUncoercedDoubleAt = 19;   { "@@" substitution must be coerced }
+
+{ A structure containing error state.}
+
+type
+	AEBuildErrorPtr = ^AEBuildError;
+	AEBuildError = record
+		fError: AEBuildErrorCode;
+		fErrorPos: UInt32;
+	end;
+{
+   Create an AEDesc from the format string.  AEBuildError can be NULL, in which case
+   no explicit error information will be returned.
+}
+{
+ *  AEBuildDesc()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+function AEBuildDesc( var dst: AEDesc; error: AEBuildErrorPtr { can be NULL }; src: ConstCStringPtr; ... ): OSStatus; external name '_AEBuildDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{ varargs version of AEBuildDesc}
+{
+ *  vAEBuildDesc()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+// function vAEBuildDesc( var dst: AEDesc; error: AEBuildErrorPtr { can be NULL }; src: ConstCStringPtr; args: va_list ): OSStatus;
+// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
+
+
+{ Append parameters to an existing AppleEvent}
+{
+ *  AEBuildParameters()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+function AEBuildParameters( var event: AppleEvent; error: AEBuildErrorPtr { can be NULL }; format: ConstCStringPtr; ... ): OSStatus; external name '_AEBuildParameters';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{ varargs version of AEBuildParameters}
+{
+ *  vAEBuildParameters()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+// function vAEBuildParameters( var event: AppleEvent; error: AEBuildErrorPtr { can be NULL }; format: ConstCStringPtr; args: va_list ): OSStatus;
+// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
+
+
+{ Building an entire Apple event:}
+{
+ *  AEBuildAppleEvent()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+function AEBuildAppleEvent( theClass: AEEventClass; theID: AEEventID; addressType: DescType; addressData: {const} UnivPtr; addressLength: Size; returnID: SInt16; transactionID: SInt32; var result: AppleEvent; error: AEBuildErrorPtr { can be NULL }; paramsFmt: ConstCStringPtr; ... ): OSStatus; external name '_AEBuildAppleEvent';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{ varargs version of AEBuildAppleEvent}
+{
+ *  vAEBuildAppleEvent()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
  }
+// function vAEBuildAppleEvent( theClass: AEEventClass; theID: AEEventID; addressType: DescType; addressData: {const} UnivPtr; addressLength: Size; returnID: SInt16; transactionID: SInt32; var resultEvt: AppleEvent; error: AEBuildErrorPtr { can be NULL }; paramsFmt: ConstCStringPtr; args: va_list ): OSStatus;
+// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
+
+
 {
  * AEPrintDescToHandle
  *
@@ -126,12 +345,17 @@ uses MacTypes,AppleEvents,AEDataModel;
 {
  *  AEPrintDescToHandle()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEPrintDescToHandle(const (*var*) desc: AEDesc; var result: Handle): OSStatus; external name '_AEPrintDescToHandle';
+function AEPrintDescToHandle( const (*var*) desc: AEDesc; var result: Handle ): OSStatus; external name '_AEPrintDescToHandle';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
  * AEStream:
@@ -143,23 +367,26 @@ function AEPrintDescToHandle(const (*var*) desc: AEDesc; var result: Handle): OS
  * AEDesc, which may be partially complete, or may be a complete
  * AppleEvent.
  }
-
 type
-	AEStreamRef    = ^SInt32; { an opaque 32-bit type }
-	AEStreamRefPtr = ^AEStreamRef;  { when a var xx:AEStreamRef parameter can be nil, it is changed to xx: AEStreamRefPtr }
-	{
-	   Create and return an AEStreamRef
-	   Returns NULL on memory allocation failure
-	}
-	{
-	 *  AEStreamOpen()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   not available
-	 *    CarbonLib:        in CarbonLib 1.1 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
+	AEStreamRef = ^SInt32; { an opaque type }
+{
+   Create and return an AEStreamRef
+   Returns NULL on memory allocation failure
+}
+{
+ *  AEStreamOpen()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
 function AEStreamOpen: AEStreamRef; external name '_AEStreamOpen';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Closes and disposes of an AEStreamRef, producing
@@ -169,12 +396,17 @@ function AEStreamOpen: AEStreamRef; external name '_AEStreamOpen';
 {
  *  AEStreamClose()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamClose(ref: AEStreamRef; var desc: AEDesc): OSStatus; external name '_AEStreamClose';
+function AEStreamClose( ref: AEStreamRef; var desc: AEDesc ): OSStatus; external name '_AEStreamClose';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Prepares an AEStreamRef for appending data to a newly created desc.
@@ -183,23 +415,33 @@ function AEStreamClose(ref: AEStreamRef; var desc: AEDesc): OSStatus; external n
 {
  *  AEStreamOpenDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOpenDesc(ref: AEStreamRef; newType: DescType): OSStatus; external name '_AEStreamOpenDesc';
+function AEStreamOpenDesc( ref: AEStreamRef; newType: DescType ): OSStatus; external name '_AEStreamOpenDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Append data to the previously opened desc. }
+{ Append data to the previously opened desc.}
 {
  *  AEStreamWriteData()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamWriteData(ref: AEStreamRef; data: UnivPtr; length: Size): OSStatus; external name '_AEStreamWriteData';
+function AEStreamWriteData( ref: AEStreamRef; data: {const} UnivPtr; length: Size ): OSStatus; external name '_AEStreamWriteData';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Finish a desc.  After this, you can close the stream, or adding new
@@ -208,34 +450,49 @@ function AEStreamWriteData(ref: AEStreamRef; data: UnivPtr; length: Size): OSSta
 {
  *  AEStreamCloseDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamCloseDesc(ref: AEStreamRef): OSStatus; external name '_AEStreamCloseDesc';
+function AEStreamCloseDesc( ref: AEStreamRef ): OSStatus; external name '_AEStreamCloseDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Write data as a desc to the stream }
+{ Write data as a desc to the stream}
 {
  *  AEStreamWriteDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamWriteDesc(ref: AEStreamRef; newType: DescType; data: UnivPtr; length: Size): OSStatus; external name '_AEStreamWriteDesc';
+function AEStreamWriteDesc( ref: AEStreamRef; newType: DescType; data: {const} UnivPtr; length: Size ): OSStatus; external name '_AEStreamWriteDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Write an entire desc to the stream }
+{ Write an entire desc to the stream}
 {
  *  AEStreamWriteAEDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamWriteAEDesc(ref: AEStreamRef; const (*var*) desc: AEDesc): OSStatus; external name '_AEStreamWriteAEDesc';
+function AEStreamWriteAEDesc( ref: AEStreamRef; const (*var*) desc: AEDesc ): OSStatus; external name '_AEStreamWriteAEDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Begin a list.  You can then append to the list by doing
@@ -244,23 +501,33 @@ function AEStreamWriteAEDesc(ref: AEStreamRef; const (*var*) desc: AEDesc): OSSt
 {
  *  AEStreamOpenList()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOpenList(ref: AEStreamRef): OSStatus; external name '_AEStreamOpenList';
+function AEStreamOpenList( ref: AEStreamRef ): OSStatus; external name '_AEStreamOpenList';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Finish a list. }
+{ Finish a list.}
 {
  *  AEStreamCloseList()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamCloseList(ref: AEStreamRef): OSStatus; external name '_AEStreamCloseList';
+function AEStreamCloseList( ref: AEStreamRef ): OSStatus; external name '_AEStreamCloseList';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Begin a record.  A record usually has type 'reco', however, this is
@@ -269,34 +536,49 @@ function AEStreamCloseList(ref: AEStreamRef): OSStatus; external name '_AEStream
 {
  *  AEStreamOpenRecord()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOpenRecord(ref: AEStreamRef; newType: DescType): OSStatus; external name '_AEStreamOpenRecord';
+function AEStreamOpenRecord( ref: AEStreamRef; newType: DescType ): OSStatus; external name '_AEStreamOpenRecord';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Change the type of a record. }
+{ Change the type of a record.}
 {
  *  AEStreamSetRecordType()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamSetRecordType(ref: AEStreamRef; newType: DescType): OSStatus; external name '_AEStreamSetRecordType';
+function AEStreamSetRecordType( ref: AEStreamRef; newType: DescType ): OSStatus; external name '_AEStreamSetRecordType';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-{  Finish a record }
+
+{ Finish a record}
 {
  *  AEStreamCloseRecord()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamCloseRecord(ref: AEStreamRef): OSStatus; external name '_AEStreamCloseRecord';
+function AEStreamCloseRecord( ref: AEStreamRef ): OSStatus; external name '_AEStreamCloseRecord';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Add a keyed descriptor to a record.  This is analogous to AEPutParamDesc.
@@ -305,37 +587,52 @@ function AEStreamCloseRecord(ref: AEStreamRef): OSStatus; external name '_AEStre
 {
  *  AEStreamWriteKeyDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamWriteKeyDesc(ref: AEStreamRef; key: AEKeyword; newType: DescType; data: UnivPtr; length: Size): OSStatus; external name '_AEStreamWriteKeyDesc';
+function AEStreamWriteKeyDesc( ref: AEStreamRef; key: AEKeyword; newType: DescType; data: {const} UnivPtr; length: Size ): OSStatus; external name '_AEStreamWriteKeyDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
-   OpenDesc for a keyed record entry.  You can youse AEStreamWriteData
+   OpenDesc for a keyed record entry.  You can use AEStreamWriteData
    after opening a keyed desc.
 }
 {
  *  AEStreamOpenKeyDesc()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOpenKeyDesc(ref: AEStreamRef; key: AEKeyword; newType: DescType): OSStatus; external name '_AEStreamOpenKeyDesc';
+function AEStreamOpenKeyDesc( ref: AEStreamRef; key: AEKeyword; newType: DescType ): OSStatus; external name '_AEStreamOpenKeyDesc';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{  Write a key to the stream - you can follow this with an AEWriteDesc. }
+{ Write a key to the stream - you can follow this with an AEWriteDesc.}
 {
  *  AEStreamWriteKey()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamWriteKey(ref: AEStreamRef; key: AEKeyword): OSStatus; external name '_AEStreamWriteKey';
+function AEStreamWriteKey( ref: AEStreamRef; key: AEKeyword ): OSStatus; external name '_AEStreamWriteKey';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    Create a complete AppleEvent.  This creates and returns a new stream.
@@ -345,12 +642,17 @@ function AEStreamWriteKey(ref: AEStreamRef; key: AEKeyword): OSStatus; external
 {
  *  AEStreamCreateEvent()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamCreateEvent(clazz: AEEventClass; id: AEEventID; targetType: DescType; targetData: UnivPtr; targetLength: SInt32; returnID: SInt16; transactionID: SInt32): AEStreamRef; external name '_AEStreamCreateEvent';
+function AEStreamCreateEvent( clazz: AEEventClass; id: AEEventID; targetType: DescType; targetData: {const} UnivPtr; targetLength: Size; returnID: SInt16; transactionID: SInt32 ): AEStreamRef; external name '_AEStreamCreateEvent';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
    This call lets you augment an existing AppleEvent using the stream
@@ -363,25 +665,36 @@ function AEStreamCreateEvent(clazz: AEEventClass; id: AEEventID; targetType: Des
 {
  *  AEStreamOpenEvent()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOpenEvent(var event: AppleEvent): AEStreamRef; external name '_AEStreamOpenEvent';
+function AEStreamOpenEvent( var event: AppleEvent ): AEStreamRef; external name '_AEStreamOpenEvent';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-{  Mark a keyword as being an optional parameter. }
+
+{ Mark a keyword as being an optional parameter.}
 {
  *  AEStreamOptionalParam()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AEStreamOptionalParam(ref: AEStreamRef; key: AEKeyword): OSStatus; external name '_AEStreamOptionalParam';
+function AEStreamOptionalParam( ref: AEStreamRef; key: AEKeyword ): OSStatus; external name '_AEStreamOptionalParam';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-{$ALIGN MAC68K}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 136 - 16
packages/univint/src/AEInteraction.pas

@@ -3,9 +3,9 @@
  
      Contains:   AppleEvent functions that deal with Events and interacting with user
  
-     Version:    HIToolbox-219.4.81~2
+     Version:    HIToolbox-437~1
  
-     Copyright:  © 2000-2005 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2000-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,12 +14,14 @@
  
 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, August 2005 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -28,8 +30,8 @@
 
 unit AEInteraction;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -42,16 +44,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -59,14 +83,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -92,7 +167,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -102,7 +176,12 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,Quickdraw,AEDataModel,Notification,Events;
+uses MacTypes,QuickdrawTypes,AEDataModel,Notification,Events,CarbonEventsCore;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN MAC68K}
 
 
@@ -111,11 +190,8 @@ uses MacTypes,Quickdraw,AEDataModel,Notification,Events;
 *************************************************************************}
 type
 	AEIdleProcPtr = function( var theEvent: EventRecord; var sleepTime: SInt32; var mouseRgn: RgnHandle ): Boolean;
-type
-	AEFilterProcPtr = function( var theEvent: EventRecord; returnID: SInt32; transactionID: SInt32; const (*var*) sender: AEAddressDesc ): Boolean;
-type
+	AEFilterProcPtr = function( var theEvent: EventRecord; returnID: SInt32; transactionID: AETransactionID; const (*var*) sender: AEAddressDesc ): Boolean;
 	AEIdleUPP = AEIdleProcPtr;
-type
 	AEFilterUPP = AEFilterProcPtr;
 
 {*************************************************************************
@@ -152,6 +228,47 @@ function AEProcessAppleEvent( const (*var*) theEventRecord: EventRecord ): OSErr
 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
 
+{
+ *  AEProcessEvent()
+ *  
+ *  Summary:
+ *    Dispatches a Carbon event of type kEventAppleEvent to the
+ *    appropriate AppleEvent handlers.
+ *  
+ *  Discussion:
+ *    This API is similar to AEProcessAppleEvent, but does not require
+ *    the Carbon event to be converted to an EventRecord. Also, unlike
+ *    AEProcessAppleEvent, this API does not require that an event be
+ *    removed from its event queue before processing; the AppleEvent
+ *    will be correctly dispatched even if the Carbon event is still in
+ *    its event queue. Of course, you should still remove the Carbon
+ *    event from its event queue later once you're done handling it,
+ *    and it is also acceptable to remove it from the event queue
+ *    before calling this API.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe
+ *  
+ *  Parameters:
+ *    
+ *    inEvent:
+ *      A Carbon event of class kEventClassAppleEvent and kind
+ *      kEventAppleEvent.
+ *  
+ *  Result:
+ *    The operating system result code returned by the AppleEvent
+ *    handler, or paramErr if the event passed to this API is not of
+ *    the correct class and kind.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function AEProcessEvent( inEvent: EventRef ): OSStatus; external name '_AEProcessEvent';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
 { 
  Note: during event processing, an event handler may realize that it is likely
  to exceed the client's timeout limit. Passing the reply to this
@@ -293,7 +410,7 @@ const
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AEResumeTheCurrentEvent( const (*var*) theAppleEvent: AppleEvent; const (*var*) reply: AppleEvent; dispatcher: AEEventHandlerUPP { can be NULL }; handlerRefcon: SInt32 ): OSErr; external name '_AEResumeTheCurrentEvent';
+function AEResumeTheCurrentEvent( const (*var*) theAppleEvent: AppleEvent; const (*var*) reply: AppleEvent; dispatcher: AEEventHandlerUPP { can be NULL }; handlerRefcon: SRefCon ): OSErr; external name '_AEResumeTheCurrentEvent';
 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
 
@@ -393,8 +510,11 @@ function InvokeAEIdleUPP( var theEvent: EventRecord; var sleepTime: SInt32; var
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeAEFilterUPP( var theEvent: EventRecord; returnID: SInt32; transactionID: SInt32; const (*var*) sender: AEAddressDesc; userUPP: AEFilterUPP ): Boolean; external name '_InvokeAEFilterUPP';
+function InvokeAEFilterUPP( var theEvent: EventRecord; returnID: SInt32; transactionID: AETransactionID; const (*var*) sender: AEAddressDesc; userUPP: AEFilterUPP ): Boolean; external name '_InvokeAEFilterUPP';
 (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 208 - 77
packages/univint/src/AEMach.pas

@@ -1,12 +1,11 @@
 {
-     File:       AEMach.p
+     File:       AE/AEMach.h
  
      Contains:   AppleEvent over mach_msg interfaces
  
-     Version:    Technology: For Mac OS X
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 2000-2002 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2000-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AEMach;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,10 +175,11 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,MixedMode,AEDataModel;
+uses MacTypes,MacOSXPosix,AEDataModel;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
+{$ifc TARGET_OS_MAC}
 
 {-
  * AE Mach API --
@@ -122,101 +194,160 @@ uses MacTypes,MixedMode,AEDataModel;
  * the target parameter.)  If a port cannot be found,
  * procNotFound (-600) will be returned on AESend.
  *
- * Of note is a new attribute for an AppleEvent, typeReplyPortAttr.
+ * Of note is a new attribute for an AppleEvent, keyReplyPortAttr.
  * This specifies the mach_port_t to which an AppleEvent reply
  * should be directed.  By default, replies are sent to the
- * processes registered port where they are culled from the normal  
+ * processes' registered port where they are culled from the normal  
  * event stream if there is an outstanding AESend + kAEWaitReply.
  * But it may be desirable for a client to specify their own port to
- * receive quued replies.
- * (In the case of AESendMessage with kAEWaitReply specified, an 
- * anonymous port will be used to block until the reply is received.)
+ * receive queud replies.
+ *
+ * In the case of AESendMessage with kAEWaitReply specified, an 
+ * anonymous port will be used to block until the reply is received.
  *
  * Not supplied is a convenience routine to block a server and
  * process AppleEvents.  This implementation will be detailed in a
  * tech note.
+ *
+ * In general, the AppleEvent APIs are thread safe, but the mechanism
+ * of their delivery (AEProcessAppleEvent, AEResumeTheCurrentEvent)
+ * are not.  If you're attemping to write a thread safe server, you
+ * should avoid AppleEvent routines that don't explicitly state their
+ * thread safety.
+ *
  *}
+const
+	keyReplyPortAttr = FourCharCode('repp');
 
+{ typeReplyPortAttr was misnamed and is deprecated; use keyReplyPortAttr instead. }
 const
-	typeReplyPortAttr			= FourCharCode('repp');
-
-{$ifc TARGET_RT_MAC_MACHO}
-{$ifc not undefined _MACH_MESSAGE_H_}
-	{	-
-	 * Return the mach_port_t that was registered with the bootstrap
-	 * server for this process.  This port is considered public, and
-	 * will be used by other applications to target your process.  You
-	 * are free to use this mach_port_t to add to a port set, if and
-	 * only if, you are not also using routines from HIToolbox.  In that
-	 * case, HIToolbox retains control of this port and AppleEvents are
-	 * dispatched through the main event loop.  
-	 *	}
-	{
-	 *  AEGetRegisteredMachPort()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   not available
-	 *    CarbonLib:        not available
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
+	typeReplyPortAttr = keyReplyPortAttr;
+
+{
+ *  AEGetRegisteredMachPort()
+ *  
+ *  Discussion:
+ *    Return the mach_port_t that was registered by the AppleEvent
+ *    framework for this process.  This port is considered public, and
+ *    will be used by other applications to target your process.  You
+ *    are free to use this mach_port_t to add to a port set, if and
+ *    only if, you are not also using routines from HIToolbox.  In that
+ *    case, HIToolbox retains control of this port and AppleEvents are
+ *    dispatched through the main event loop.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
+ *    Non-Carbon CFM:   not available
+ }
 function AEGetRegisteredMachPort: mach_port_t; external name '_AEGetRegisteredMachPort';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{-
- * Decode a mach_msg into an AppleEvent and its related reply.  (The
- * reply is set up from fields of the event.)  You can call this
- * routine if you wish to dispatch or handle the event yourself.  To
- * return a reply to the sender, you should call:
- *
- *  AESendMessage(reply, NULL, kAENoReply, kAENormalPriority, kAEDefaultTimeout);
- *
- * The contents of the header are invalid after this call.  
- *}
 {
  *  AEDecodeMessage()
  *  
+ *  Discussion:
+ *    Decode a mach_msg into an AppleEvent and its related reply.  (The
+ *    reply is set up from fields of the event.)  You can call this
+ *    routine if you wish to dispatch or handle the event yourself.  To
+ *    return a reply to the sender, you should call:
+ *     AESendMessage(reply, NULL, kAENoReply, kAENormalPriority,
+ *    kAEDefaultTimeout);
+ *    If this message is a reply, the 'reply' parameter will be
+ *    initialized to ( typeNull, 0 ), and the 'event' parameter will be
+ *    the AppleEvent reply with a event class attribute of
+ *    typeAppleEvent, class typeAppleEventReply:
+ *    The contents of the header are invalid after this call.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Parameters:
+ *    
+ *    header:
+ *      The incoming mach message to be dispatched
+ *    
+ *    event:
+ *      The AppleEvent to decode the message in header into
+ *    
+ *    reply:
+ *      The AppleEvent reply is decoded into reply
+ *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  *    Non-Carbon CFM:   not available
- *    CarbonLib:        not available
- *    Mac OS X:         in version 10.0 and later
  }
-function AEDecodeMessage(var header: mach_msg_header_t; var event: AppleEvent; reply: AppleEventPtr): OSStatus; external name '_AEDecodeMessage';
+function AEDecodeMessage( var header: mach_msg_header_t; var event: AppleEvent; reply: AppleEventPtr { can be NULL } ): OSStatus; external name '_AEDecodeMessage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{-
- * Decodes and dispatches an event to an event handler.  Handles
- * packaging and returning the reply to the sender.
- *
- * The contents of the header are invalid after this call.
- *}
 {
  *  AEProcessMessage()
  *  
+ *  Discussion:
+ *    Decodes and dispatches an event to an event handler.  Handles
+ *    packaging and returning the reply to the sender.
+ *    The contents of the header are invalid after this call.
+ *  
+ *  Mac OS X threading:
+ *    Not thread safe since version 10.3
+ *  
+ *  Parameters:
+ *    
+ *    header:
+ *      The incoming mach message to be dispatched.
+ *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  *    Non-Carbon CFM:   not available
- *    CarbonLib:        not available
- *    Mac OS X:         in version 10.0 and later
  }
-function AEProcessMessage(var header: mach_msg_header_t): OSStatus; external name '_AEProcessMessage';
+function AEProcessMessage( var header: mach_msg_header_t ): OSStatus; external name '_AEProcessMessage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{-
- * Send an AppleEvent to a target process.  If the target is the
- * current process (as specified by using typeProcessSerialNumber of
- * ( 0, kCurrentProcess ) it is dispatched directly to the
- * appropriate event handler in your process and not serialized.
- *}
 {
  *  AESendMessage()
  *  
+ *  Discussion:
+ *    Send an AppleEvent to a target process.  If the target is the
+ *    current process (as specified by using typeProcessSerialNumber of
+ *    ( 0, kCurrentProcess ) it is dispatched directly to the
+ *    appropriate event handler in your process and not serialized.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Parameters:
+ *    
+ *    event:
+ *      The event to be sent
+ *    
+ *    reply:
+ *      The reply for the event, if non-NULL
+ *    
+ *    sendMode:
+ *      The mode to send the event
+ *    
+ *    timeOutInTicks:
+ *      The timeout for sending the event, in ticks.  If 0, there is no
+ *      timeout.
+ *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  *    Non-Carbon CFM:   not available
- *    CarbonLib:        not available
- *    Mac OS X:         in version 10.0 and later
  }
-function AESendMessage(const (*var*) event: AppleEvent; reply: AppleEventPtr; sendMode: AESendMode; timeOutInTicks: SInt32): OSStatus; external name '_AESendMessage';
-
-{$endc}  {_MACH_MESSAGE_H_}
-{$endc}  {TARGET_RT_MAC_MACHO}
-
-{$ALIGN MAC68K}
+function AESendMessage( const (*var*) event: AppleEvent; reply: AppleEventPtr { can be NULL }; sendMode: AESendMode; timeOutInTicks: SIGNEDLONG ): OSStatus; external name '_AESendMessage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 398 - 304
packages/univint/src/AEObjects.pas

@@ -1,12 +1,11 @@
 {
-     File:       AEObjects.p
+     File:       AE/AEObjects.h
  
      Contains:   Object Support Library Interfaces.
  
-     Version:    Technology: System 8.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1991-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1991-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AEObjects;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,500 +176,523 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,AEDataModel,OSUtils,AppleEvents,MacErrors;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
+{$ifc TARGET_OS_MAC}
 
+{$ALIGN MAC68K}
 
 const
-																{ *** LOGICAL OPERATOR CONSTANTS  *** }
-	kAEAND						= FourCharCode('AND ');						{   0x414e4420   }
-	kAEOR						= FourCharCode('OR  ');						{   0x4f522020   }
-	kAENOT						= FourCharCode('NOT ');						{   0x4e4f5420   }
-																{ *** ABSOLUTE ORDINAL CONSTANTS  *** }
-	kAEFirst					= FourCharCode('firs');						{   0x66697273   }
-	kAELast						= FourCharCode('last');						{   0x6c617374   }
-	kAEMiddle					= FourCharCode('midd');						{   0x6d696464   }
-	kAEAny						= FourCharCode('any ');						{   0x616e7920   }
-	kAEAll						= FourCharCode('all ');						{   0x616c6c20   }
-																{ *** RELATIVE ORDINAL CONSTANTS  *** }
-	kAENext						= FourCharCode('next');						{   0x6e657874   }
-	kAEPrevious					= FourCharCode('prev');						{   0x70726576   }
-																{ *** KEYWORD CONSTANT    *** }
-	keyAECompOperator			= FourCharCode('relo');						{   0x72656c6f   }
-	keyAELogicalTerms			= FourCharCode('term');						{   0x7465726d   }
-	keyAELogicalOperator		= FourCharCode('logc');						{   0x6c6f6763   }
-	keyAEObject1				= FourCharCode('obj1');						{   0x6f626a31   }
-	keyAEObject2				= FourCharCode('obj2');						{   0x6f626a32   }
-																{     ... for Keywords for getting fields out of object specifier records.  }
-	keyAEDesiredClass			= FourCharCode('want');						{   0x77616e74   }
-	keyAEContainer				= FourCharCode('from');						{   0x66726f6d   }
-	keyAEKeyForm				= FourCharCode('form');						{   0x666f726d   }
-	keyAEKeyData				= FourCharCode('seld');						{   0x73656c64   }
-
-																{     ... for Keywords for getting fields out of Range specifier records.  }
-	keyAERangeStart				= FourCharCode('star');						{   0x73746172   }
-	keyAERangeStop				= FourCharCode('stop');						{   0x73746f70   }
-																{     ... special handler selectors for OSL Callbacks.  }
-	keyDisposeTokenProc			= FourCharCode('xtok');						{   0x78746f6b   }
-	keyAECompareProc			= FourCharCode('cmpr');						{   0x636d7072   }
-	keyAECountProc				= FourCharCode('cont');						{   0x636f6e74   }
-	keyAEMarkTokenProc			= FourCharCode('mkid');						{   0x6d6b6964   }
-	keyAEMarkProc				= FourCharCode('mark');						{   0x6d61726b   }
-	keyAEAdjustMarksProc		= FourCharCode('adjm');						{   0x61646a6d   }
-	keyAEGetErrDescProc			= FourCharCode('indc');						{   0x696e6463   }
-
-	{	***   VALUE and type CONSTANTS    ***	}
-																{     ... possible values for the keyAEKeyForm field of an object specifier.  }
-	formAbsolutePosition		= FourCharCode('indx');						{   0x696e6478   }
-	formRelativePosition		= FourCharCode('rele');						{   0x72656c65   }
-	formTest					= FourCharCode('test');						{   0x74657374   }
-	formRange					= FourCharCode('rang');						{   0x72616e67   }
-	formPropertyID				= FourCharCode('prop');						{   0x70726f70   }
-	formName					= FourCharCode('name');						{   0x6e616d65   }
-																{     ... relevant types (some of these are often pared with forms above).  }
-	typeObjectSpecifier			= FourCharCode('obj ');						{   0x6f626a20   }
-	typeObjectBeingExamined		= FourCharCode('exmn');						{   0x65786d6e   }
-	typeCurrentContainer		= FourCharCode('ccnt');						{   0x63636e74   }
-	typeToken					= FourCharCode('toke');						{   0x746f6b65   }
-	typeRelativeDescriptor		= FourCharCode('rel ');						{   0x72656c20   }
-	typeAbsoluteOrdinal			= FourCharCode('abso');						{   0x6162736f   }
-	typeIndexDescriptor			= FourCharCode('inde');						{   0x696e6465   }
-	typeRangeDescriptor			= FourCharCode('rang');						{   0x72616e67   }
-	typeLogicalDescriptor		= FourCharCode('logi');						{   0x6c6f6769   }
-	typeCompDescriptor			= FourCharCode('cmpd');						{   0x636d7064   }
-	typeOSLTokenList			= FourCharCode('ostl');						{   0x6F73746C   }
-
-	{	 Possible values for flags parameter to AEResolve.  They're additive 	}
-	kAEIDoMinimum				= $0000;
-	kAEIDoWhose					= $0001;
-	kAEIDoMarking				= $0004;
-	kAEPassSubDescs				= $0008;
-	kAEResolveNestedLists		= $0010;
-	kAEHandleSimpleRanges		= $0020;
-	kAEUseRelativeIterators		= $0040;
-
-	{	*** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION 	}
-	typeWhoseDescriptor			= FourCharCode('whos');						{   0x77686f73   }
-	formWhose					= FourCharCode('whos');						{   0x77686f73   }
-	typeWhoseRange				= FourCharCode('wrng');						{   0x77726e67   }
-	keyAEWhoseRangeStart		= FourCharCode('wstr');						{   0x77737472   }
-	keyAEWhoseRangeStop			= FourCharCode('wstp');						{   0x77737470   }
-	keyAEIndex					= FourCharCode('kidx');						{   0x6b696478   }
-	keyAETest					= FourCharCode('ktst');						{   0x6b747374   }
-
-	{	
-	    used for rewriting tokens in place of 'ccnt' descriptors
-	    This record is only of interest to those who, when they...
-	    ...get ranges as key data in their accessor procs, choose
-	    ...to resolve them manually rather than call AEResolve again.
-		}
+{*** LOGICAL OPERATOR CONSTANTS  ***}
+	kAEAND = FourCharCode('AND '); {  0x414e4420  }
+	kAEOR = FourCharCode('OR  '); {  0x4f522020  }
+	kAENOT = FourCharCode('NOT '); {  0x4e4f5420  }
+                                        {*** ABSOLUTE ORDINAL CONSTANTS  ***}
+	kAEFirst = FourCharCode('firs'); {  0x66697273  }
+	kAELast = FourCharCode('last'); {  0x6c617374  }
+	kAEMiddle = FourCharCode('midd'); {  0x6d696464  }
+	kAEAny = FourCharCode('any '); {  0x616e7920  }
+	kAEAll = FourCharCode('all '); {  0x616c6c20  }
+                                        {*** RELATIVE ORDINAL CONSTANTS  ***}
+	kAENext = FourCharCode('next'); {  0x6e657874  }
+	kAEPrevious = FourCharCode('prev'); {  0x70726576  }
+                                        {*** KEYWORD CONSTANT    ***}
+	keyAECompOperator = FourCharCode('relo'); {  0x72656c6f  }
+	keyAELogicalTerms = FourCharCode('term'); {  0x7465726d  }
+	keyAELogicalOperator = FourCharCode('logc'); {  0x6c6f6763  }
+	keyAEObject1 = FourCharCode('obj1'); {  0x6f626a31  }
+	keyAEObject2 = FourCharCode('obj2'); {  0x6f626a32  }
+                                        {    ... for Keywords for getting fields out of object specifier records. }
+	keyAEDesiredClass = FourCharCode('want'); {  0x77616e74  }
+	keyAEContainer = FourCharCode('from'); {  0x66726f6d  }
+	keyAEKeyForm = FourCharCode('form'); {  0x666f726d  }
+	keyAEKeyData = FourCharCode('seld'); {  0x73656c64  }
 
+const
+{    ... for Keywords for getting fields out of Range specifier records. }
+	keyAERangeStart = FourCharCode('star'); {  0x73746172  }
+	keyAERangeStop = FourCharCode('stop'); {  0x73746f70  }
+                                        {    ... special handler selectors for OSL Callbacks. }
+	keyDisposeTokenProc = FourCharCode('xtok'); {  0x78746f6b  }
+	keyAECompareProc = FourCharCode('cmpr'); {  0x636d7072  }
+	keyAECountProc = FourCharCode('cont'); {  0x636f6e74  }
+	keyAEMarkTokenProc = FourCharCode('mkid'); {  0x6d6b6964  }
+	keyAEMarkProc = FourCharCode('mark'); {  0x6d61726b  }
+	keyAEAdjustMarksProc = FourCharCode('adjm'); {  0x61646a6d  }
+	keyAEGetErrDescProc = FourCharCode('indc'); {  0x696e6463  }
+
+{***   VALUE and TYPE CONSTANTS    ***}
+const
+{    ... possible values for the keyAEKeyForm field of an object specifier. }
+	formAbsolutePosition = FourCharCode('indx'); {  0x696e6478  }
+	formRelativePosition = FourCharCode('rele'); {  0x72656c65  }
+	formTest = FourCharCode('test'); {  0x74657374  }
+	formRange = FourCharCode('rang'); {  0x72616e67  }
+	formPropertyID = FourCharCode('prop'); {  0x70726f70  }
+	formName = FourCharCode('name'); {  0x6e616d65  }
+	formUniqueID = FourCharCode('ID  '); {  0x49442020  }
+                                        {    ... relevant types (some of these are often pared with forms above). }
+	typeObjectSpecifier = FourCharCode('obj '); {  0x6f626a20  }
+	typeObjectBeingExamined = FourCharCode('exmn'); {  0x65786d6e  }
+	typeCurrentContainer = FourCharCode('ccnt'); {  0x63636e74  }
+	typeToken = FourCharCode('toke'); {  0x746f6b65  }
+	typeRelativeDescriptor = FourCharCode('rel '); {  0x72656c20  }
+	typeAbsoluteOrdinal = FourCharCode('abso'); {  0x6162736f  }
+	typeIndexDescriptor = FourCharCode('inde'); {  0x696e6465  }
+	typeRangeDescriptor = FourCharCode('rang'); {  0x72616e67  }
+	typeLogicalDescriptor = FourCharCode('logi'); {  0x6c6f6769  }
+	typeCompDescriptor = FourCharCode('cmpd'); {  0x636d7064  }
+	typeOSLTokenList = FourCharCode('ostl'); {  0x6F73746C  }
+
+{ Possible values for flags parameter to AEResolve.  They're additive }
+const
+	kAEIDoMinimum = $0000;
+	kAEIDoWhose = $0001;
+	kAEIDoMarking = $0004;
+	kAEPassSubDescs = $0008;
+	kAEResolveNestedLists = $0010;
+	kAEHandleSimpleRanges = $0020;
+	kAEUseRelativeIterators = $0040;
+
+{*** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION }
+const
+	typeWhoseDescriptor = FourCharCode('whos'); {  0x77686f73  }
+	formWhose = FourCharCode('whos'); {  0x77686f73  }
+	typeWhoseRange = FourCharCode('wrng'); {  0x77726e67  }
+	keyAEWhoseRangeStart = FourCharCode('wstr'); {  0x77737472  }
+	keyAEWhoseRangeStop = FourCharCode('wstp'); {  0x77737470  }
+	keyAEIndex = FourCharCode('kidx'); {  0x6b696478  }
+	keyAETest = FourCharCode('ktst'); {  0x6b747374  }
+
+{
+    used for rewriting tokens in place of 'ccnt' descriptors
+    This record is only of interest to those who, when they...
+    ...get ranges as key data in their accessor procs, choose
+    ...to resolve them manually rather than call AEResolve again.
+}
 type
 	ccntTokenRecordPtr = ^ccntTokenRecord;
 	ccntTokenRecord = record
-		tokenClass:				DescType;
-		token:					AEDesc;
+		tokenClass: DescType;
+		token: AEDesc;
 	end;
-
-	ccntTokenRecPtr						= ^ccntTokenRecord;
-	ccntTokenRecHandle					= ^ccntTokenRecPtr;
+type
+	ccntTokenRecPtr = ccntTokenRecordPtr;
+	ccntTokenRecHandle = ^ccntTokenRecPtr;
 {$ifc OLDROUTINENAMES}
-	DescPtr								= ^AEDesc;
-	DescHandle							= ^DescPtr;
-{$endc}  {OLDROUTINENAMES}
-
-	{	 typedefs providing type checking for procedure pointers 	}
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLAccessorProcPtr = function(desiredClass: DescType; const (*var*) container: AEDesc; containerClass: DescType; form: DescType; const (*var*) selectionData: AEDesc; var value: AEDesc; accessorRefcon: SInt32): OSErr;
-{$elsec}
-	OSLAccessorProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLCompareProcPtr = function(oper: DescType; const (*var*) obj1: AEDesc; const (*var*) obj2: AEDesc; var result: boolean): OSErr;
-{$elsec}
-	OSLCompareProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLCountProcPtr = function(desiredType: DescType; containerClass: DescType; const (*var*) container: AEDesc; var result: SInt32): OSErr;
-{$elsec}
-	OSLCountProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLDisposeTokenProcPtr = function(var unneededToken: AEDesc): OSErr;
-{$elsec}
-	OSLDisposeTokenProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLGetMarkTokenProcPtr = function(const (*var*) dContainerToken: AEDesc; containerClass: DescType; var result: AEDesc): OSErr;
-{$elsec}
-	OSLGetMarkTokenProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLGetErrDescProcPtr = function(var appDescPtr: AEDescPtr): OSErr;
-{$elsec}
-	OSLGetErrDescProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLMarkProcPtr = function(const (*var*) dToken: AEDesc; const (*var*) markToken: AEDesc; index: SInt32): OSErr;
-{$elsec}
-	OSLMarkProcPtr = ProcPtr;
-{$endc}
-
-{$ifc TYPED_FUNCTION_POINTERS}
-	OSLAdjustMarksProcPtr = function(newStart: SInt32; newStop: SInt32; const (*var*) markToken: AEDesc): OSErr;
-{$elsec}
-	OSLAdjustMarksProcPtr = ProcPtr;
-{$endc}
+type
+	DescPtr = AEDescPtr;
+	DescHandle = DescPtrPtr;
+{$endc} {OLDROUTINENAMES}
 
-{$ifc OPAQUE_UPP_TYPES}
-	OSLAccessorUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLAccessorUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLCompareUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLCompareUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLCountUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLCountUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLDisposeTokenUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLDisposeTokenUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLGetMarkTokenUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLGetMarkTokenUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLGetErrDescUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLGetErrDescUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLMarkUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLMarkUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	OSLAdjustMarksUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	OSLAdjustMarksUPP = UniversalProcPtr;
-{$endc}	
+{ typedefs providing type checking for procedure pointers }
+type
+	OSLAccessorProcPtr = function( desiredClass: DescType; const (*var*) container: AEDesc; containerClass: DescType; form: DescType; const (*var*) selectionData: AEDesc; var value: AEDesc; accessorRefcon: SRefCon ): OSErr;
+	OSLCompareProcPtr = function( oper: DescType; const (*var*) obj1: AEDesc; const (*var*) obj2: AEDesc; var result: Boolean ): OSErr;
+	OSLCountProcPtr = function( desiredType: DescType; containerClass: DescType; const (*var*) container: AEDesc; var result: SIGNEDLONG ): OSErr;
+	OSLDisposeTokenProcPtr = function( var unneededToken: AEDesc ): OSErr;
+	OSLGetMarkTokenProcPtr = function( const (*var*) dContainerToken: AEDesc; containerClass: DescType; var result: AEDesc ): OSErr;
+	OSLGetErrDescProcPtr = function( var appDescPtr: AEDescPtr ): OSErr;
+	OSLMarkProcPtr = function( const (*var*) dToken: AEDesc; const (*var*) markToken: AEDesc; index: SIGNEDLONG ): OSErr;
+	OSLAdjustMarksProcPtr = function( newStart: SIGNEDLONG; newStop: SIGNEDLONG; const (*var*) markToken: AEDesc ): OSErr;
+	OSLAccessorUPP = OSLAccessorProcPtr;
+	OSLCompareUPP = OSLCompareProcPtr;
+	OSLCountUPP = OSLCountProcPtr;
+	OSLDisposeTokenUPP = OSLDisposeTokenProcPtr;
+	OSLGetMarkTokenUPP = OSLGetMarkTokenProcPtr;
+	OSLGetErrDescUPP = OSLGetErrDescProcPtr;
+	OSLMarkUPP = OSLMarkProcPtr;
+	OSLAdjustMarksUPP = OSLAdjustMarksProcPtr;
+{
+ *  NewOSLAccessorUPP()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
+ }
+function NewOSLAccessorUPP( userRoutine: OSLAccessorProcPtr ): OSLAccessorUPP; external name '_NewOSLAccessorUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-const
-	uppOSLAccessorProcInfo = $000FFFE0;
-	uppOSLCompareProcInfo = $00003FE0;
-	uppOSLCountProcInfo = $00003FE0;
-	uppOSLDisposeTokenProcInfo = $000000E0;
-	uppOSLGetMarkTokenProcInfo = $00000FE0;
-	uppOSLGetErrDescProcInfo = $000000E0;
-	uppOSLMarkProcInfo = $00000FE0;
-	uppOSLAdjustMarksProcInfo = $00000FE0;
-	{
-	 *  NewOSLAccessorUPP()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   available as macro/inline
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function NewOSLAccessorUPP(userRoutine: OSLAccessorProcPtr): OSLAccessorUPP; external name '_NewOSLAccessorUPP'; { old name was NewOSLAccessorProc }
 {
  *  NewOSLCompareUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLCompareUPP(userRoutine: OSLCompareProcPtr): OSLCompareUPP; external name '_NewOSLCompareUPP'; { old name was NewOSLCompareProc }
+function NewOSLCompareUPP( userRoutine: OSLCompareProcPtr ): OSLCompareUPP; external name '_NewOSLCompareUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLCountUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLCountUPP(userRoutine: OSLCountProcPtr): OSLCountUPP; external name '_NewOSLCountUPP'; { old name was NewOSLCountProc }
+function NewOSLCountUPP( userRoutine: OSLCountProcPtr ): OSLCountUPP; external name '_NewOSLCountUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLDisposeTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLDisposeTokenUPP(userRoutine: OSLDisposeTokenProcPtr): OSLDisposeTokenUPP; external name '_NewOSLDisposeTokenUPP'; { old name was NewOSLDisposeTokenProc }
+function NewOSLDisposeTokenUPP( userRoutine: OSLDisposeTokenProcPtr ): OSLDisposeTokenUPP; external name '_NewOSLDisposeTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLGetMarkTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLGetMarkTokenUPP(userRoutine: OSLGetMarkTokenProcPtr): OSLGetMarkTokenUPP; external name '_NewOSLGetMarkTokenUPP'; { old name was NewOSLGetMarkTokenProc }
+function NewOSLGetMarkTokenUPP( userRoutine: OSLGetMarkTokenProcPtr ): OSLGetMarkTokenUPP; external name '_NewOSLGetMarkTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLGetErrDescUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLGetErrDescUPP(userRoutine: OSLGetErrDescProcPtr): OSLGetErrDescUPP; external name '_NewOSLGetErrDescUPP'; { old name was NewOSLGetErrDescProc }
+function NewOSLGetErrDescUPP( userRoutine: OSLGetErrDescProcPtr ): OSLGetErrDescUPP; external name '_NewOSLGetErrDescUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLMarkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLMarkUPP(userRoutine: OSLMarkProcPtr): OSLMarkUPP; external name '_NewOSLMarkUPP'; { old name was NewOSLMarkProc }
+function NewOSLMarkUPP( userRoutine: OSLMarkProcPtr ): OSLMarkUPP; external name '_NewOSLMarkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  NewOSLAdjustMarksUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewOSLAdjustMarksUPP(userRoutine: OSLAdjustMarksProcPtr): OSLAdjustMarksUPP; external name '_NewOSLAdjustMarksUPP'; { old name was NewOSLAdjustMarksProc }
+function NewOSLAdjustMarksUPP( userRoutine: OSLAdjustMarksProcPtr ): OSLAdjustMarksUPP; external name '_NewOSLAdjustMarksUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLAccessorUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLAccessorUPP(userUPP: OSLAccessorUPP); external name '_DisposeOSLAccessorUPP';
+procedure DisposeOSLAccessorUPP( userUPP: OSLAccessorUPP ); external name '_DisposeOSLAccessorUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLCompareUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLCompareUPP(userUPP: OSLCompareUPP); external name '_DisposeOSLCompareUPP';
+procedure DisposeOSLCompareUPP( userUPP: OSLCompareUPP ); external name '_DisposeOSLCompareUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLCountUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLCountUPP(userUPP: OSLCountUPP); external name '_DisposeOSLCountUPP';
+procedure DisposeOSLCountUPP( userUPP: OSLCountUPP ); external name '_DisposeOSLCountUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLDisposeTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLDisposeTokenUPP(userUPP: OSLDisposeTokenUPP); external name '_DisposeOSLDisposeTokenUPP';
+procedure DisposeOSLDisposeTokenUPP( userUPP: OSLDisposeTokenUPP ); external name '_DisposeOSLDisposeTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLGetMarkTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLGetMarkTokenUPP(userUPP: OSLGetMarkTokenUPP); external name '_DisposeOSLGetMarkTokenUPP';
+procedure DisposeOSLGetMarkTokenUPP( userUPP: OSLGetMarkTokenUPP ); external name '_DisposeOSLGetMarkTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLGetErrDescUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLGetErrDescUPP(userUPP: OSLGetErrDescUPP); external name '_DisposeOSLGetErrDescUPP';
+procedure DisposeOSLGetErrDescUPP( userUPP: OSLGetErrDescUPP ); external name '_DisposeOSLGetErrDescUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLMarkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLMarkUPP(userUPP: OSLMarkUPP); external name '_DisposeOSLMarkUPP';
+procedure DisposeOSLMarkUPP( userUPP: OSLMarkUPP ); external name '_DisposeOSLMarkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeOSLAdjustMarksUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeOSLAdjustMarksUPP(userUPP: OSLAdjustMarksUPP); external name '_DisposeOSLAdjustMarksUPP';
+procedure DisposeOSLAdjustMarksUPP( userUPP: OSLAdjustMarksUPP ); external name '_DisposeOSLAdjustMarksUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLAccessorUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLAccessorUPP(desiredClass: DescType; const (*var*) container: AEDesc; containerClass: DescType; form: DescType; const (*var*) selectionData: AEDesc; var value: AEDesc; accessorRefcon: SInt32; userRoutine: OSLAccessorUPP): OSErr; external name '_InvokeOSLAccessorUPP'; { old name was CallOSLAccessorProc }
+function InvokeOSLAccessorUPP( desiredClass: DescType; const (*var*) container: AEDesc; containerClass: DescType; form: DescType; const (*var*) selectionData: AEDesc; var value: AEDesc; accessorRefcon: SRefCon; userUPP: OSLAccessorUPP ): OSErr; external name '_InvokeOSLAccessorUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLCompareUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLCompareUPP(oper: DescType; const (*var*) obj1: AEDesc; const (*var*) obj2: AEDesc; var result: boolean; userRoutine: OSLCompareUPP): OSErr; external name '_InvokeOSLCompareUPP'; { old name was CallOSLCompareProc }
+function InvokeOSLCompareUPP( oper: DescType; const (*var*) obj1: AEDesc; const (*var*) obj2: AEDesc; var result: Boolean; userUPP: OSLCompareUPP ): OSErr; external name '_InvokeOSLCompareUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLCountUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLCountUPP(desiredType: DescType; containerClass: DescType; const (*var*) container: AEDesc; var result: SInt32; userRoutine: OSLCountUPP): OSErr; external name '_InvokeOSLCountUPP'; { old name was CallOSLCountProc }
+function InvokeOSLCountUPP( desiredType: DescType; containerClass: DescType; const (*var*) container: AEDesc; var result: SIGNEDLONG; userUPP: OSLCountUPP ): OSErr; external name '_InvokeOSLCountUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLDisposeTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLDisposeTokenUPP(var unneededToken: AEDesc; userRoutine: OSLDisposeTokenUPP): OSErr; external name '_InvokeOSLDisposeTokenUPP'; { old name was CallOSLDisposeTokenProc }
+function InvokeOSLDisposeTokenUPP( var unneededToken: AEDesc; userUPP: OSLDisposeTokenUPP ): OSErr; external name '_InvokeOSLDisposeTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLGetMarkTokenUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLGetMarkTokenUPP(const (*var*) dContainerToken: AEDesc; containerClass: DescType; var result: AEDesc; userRoutine: OSLGetMarkTokenUPP): OSErr; external name '_InvokeOSLGetMarkTokenUPP'; { old name was CallOSLGetMarkTokenProc }
+function InvokeOSLGetMarkTokenUPP( const (*var*) dContainerToken: AEDesc; containerClass: DescType; var result: AEDesc; userUPP: OSLGetMarkTokenUPP ): OSErr; external name '_InvokeOSLGetMarkTokenUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLGetErrDescUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLGetErrDescUPP(var appDescPtr: AEDescPtr; userRoutine: OSLGetErrDescUPP): OSErr; external name '_InvokeOSLGetErrDescUPP'; { old name was CallOSLGetErrDescProc }
+function InvokeOSLGetErrDescUPP( var appDescPtr: AEDescPtr; userUPP: OSLGetErrDescUPP ): OSErr; external name '_InvokeOSLGetErrDescUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLMarkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLMarkUPP(const (*var*) dToken: AEDesc; const (*var*) markToken: AEDesc; index: SInt32; userRoutine: OSLMarkUPP): OSErr; external name '_InvokeOSLMarkUPP'; { old name was CallOSLMarkProc }
+function InvokeOSLMarkUPP( const (*var*) dToken: AEDesc; const (*var*) markToken: AEDesc; index: SIGNEDLONG; userUPP: OSLMarkUPP ): OSErr; external name '_InvokeOSLMarkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeOSLAdjustMarksUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeOSLAdjustMarksUPP(newStart: SInt32; newStop: SInt32; const (*var*) markToken: AEDesc; userRoutine: OSLAdjustMarksUPP): OSErr; external name '_InvokeOSLAdjustMarksUPP'; { old name was CallOSLAdjustMarksProc }
+function InvokeOSLAdjustMarksUPP( newStart: SIGNEDLONG; newStop: SIGNEDLONG; const (*var*) markToken: AEDesc; userUPP: OSLAdjustMarksUPP ): OSErr; external name '_InvokeOSLAdjustMarksUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  AEObjectInit()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
 function AEObjectInit: OSErr; external name '_AEObjectInit';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 { Not done by inline, but by direct linking into code.  It sets up the pack
   such that further calls can be via inline }
 {
  *  AESetObjectCallbacks()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AESetObjectCallbacks(myCompareProc: OSLCompareUPP; myCountProc: OSLCountUPP; myDisposeTokenProc: OSLDisposeTokenUPP; myGetMarkTokenProc: OSLGetMarkTokenUPP; myMarkProc: OSLMarkUPP; myAdjustMarksProc: OSLAdjustMarksUPP; myGetErrDescProcPtr: OSLGetErrDescUPP): OSErr; external name '_AESetObjectCallbacks';
+function AESetObjectCallbacks( myCompareProc: OSLCompareUPP; myCountProc: OSLCountUPP; myDisposeTokenProc: OSLDisposeTokenUPP; myGetMarkTokenProc: OSLGetMarkTokenUPP; myMarkProc: OSLMarkUPP; myAdjustMarksProc: OSLAdjustMarksUPP; myGetErrDescProcPtr: OSLGetErrDescUPP ): OSErr; external name '_AESetObjectCallbacks';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEResolve()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AEResolve(const (*var*) objectSpecifier: AEDesc; callbackFlags: SInt16; var theToken: AEDesc): OSErr; external name '_AEResolve';
+function AEResolve( const (*var*) objectSpecifier: AEDesc; callbackFlags: SInt16; var theToken: AEDesc ): OSErr; external name '_AEResolve';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEInstallObjectAccessor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AEInstallObjectAccessor(desiredClass: DescType; containerType: DescType; theAccessor: OSLAccessorUPP; accessorRefcon: SInt32; isSysHandler: boolean): OSErr; external name '_AEInstallObjectAccessor';
+function AEInstallObjectAccessor( desiredClass: DescType; containerType: DescType; theAccessor: OSLAccessorUPP; accessorRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEInstallObjectAccessor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AERemoveObjectAccessor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AERemoveObjectAccessor(desiredClass: DescType; containerType: DescType; theAccessor: OSLAccessorUPP; isSysHandler: boolean): OSErr; external name '_AERemoveObjectAccessor';
+function AERemoveObjectAccessor( desiredClass: DescType; containerType: DescType; theAccessor: OSLAccessorUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveObjectAccessor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEGetObjectAccessor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AEGetObjectAccessor(desiredClass: DescType; containerType: DescType; var accessor: OSLAccessorUPP; var accessorRefcon: SInt32; isSysHandler: boolean): OSErr; external name '_AEGetObjectAccessor';
+function AEGetObjectAccessor( desiredClass: DescType; containerType: DescType; var accessor: OSLAccessorUPP; var accessorRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEGetObjectAccessor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEDisposeToken()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AEDisposeToken(var theToken: AEDesc): OSErr; external name '_AEDisposeToken';
+function AEDisposeToken( var theToken: AEDesc ): OSErr; external name '_AEDisposeToken';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AECallObjectAccessor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function AECallObjectAccessor(desiredClass: DescType; const (*var*) containerToken: AEDesc; containerClass: DescType; keyForm: DescType; const (*var*) keyData: AEDesc; var token: AEDesc): OSErr; external name '_AECallObjectAccessor';
-{$ALIGN MAC68K}
+function AECallObjectAccessor( desiredClass: DescType; const (*var*) containerToken: AEDesc; containerClass: DescType; keyForm: DescType; const (*var*) keyData: AEDesc; var token: AEDesc ): OSErr; external name '_AECallObjectAccessor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{$endc} {TARGET_OS_MAC}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 130 - 31
packages/univint/src/AEPackObject.pas

@@ -1,12 +1,11 @@
 {
-     File:       AEPackObject.p
+     File:       AE/AEPackObject.h
  
      Contains:   AppleEvents object packing Interfaces.
  
-     Version:    Technology: System 7.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1991-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1991-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AEPackObject;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,63 +176,91 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,AEDataModel,AppleEvents;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
 
 { These are the object packing routines.  }
 {
  *  CreateOffsetDescriptor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function CreateOffsetDescriptor(theOffset: SInt32; var theDescriptor: AEDesc): OSErr; external name '_CreateOffsetDescriptor';
+function CreateOffsetDescriptor( theOffset: SIGNEDLONG; var theDescriptor: AEDesc ): OSErr; external name '_CreateOffsetDescriptor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
  *  CreateCompDescriptor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function CreateCompDescriptor(comparisonOperator: DescType; var operand1: AEDesc; var operand2: AEDesc; disposeInputs: boolean; var theDescriptor: AEDesc): OSErr; external name '_CreateCompDescriptor';
+function CreateCompDescriptor( comparisonOperator: DescType; var operand1: AEDesc; var operand2: AEDesc; disposeInputs: Boolean; var theDescriptor: AEDesc ): OSErr; external name '_CreateCompDescriptor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
  *  CreateLogicalDescriptor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function CreateLogicalDescriptor(var theLogicalTerms: AEDescList; theLogicOperator: DescType; disposeInputs: boolean; var theDescriptor: AEDesc): OSErr; external name '_CreateLogicalDescriptor';
+function CreateLogicalDescriptor( var theLogicalTerms: AEDescList; theLogicOperator: DescType; disposeInputs: Boolean; var theDescriptor: AEDesc ): OSErr; external name '_CreateLogicalDescriptor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
 
 {
  *  CreateObjSpecifier()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function CreateObjSpecifier(desiredClass: DescType; var theContainer: AEDesc; keyForm: DescType; var keyData: AEDesc; disposeInputs: boolean; var objSpecifier: AEDesc): OSErr; external name '_CreateObjSpecifier';
+function CreateObjSpecifier( desiredClass: DescType; var theContainer: AEDesc; keyForm: DescType; var keyData: AEDesc; disposeInputs: Boolean; var objSpecifier: AEDesc ): OSErr; external name '_CreateObjSpecifier';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
  *  CreateRangeDescriptor()
  *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in ObjectSupportLib 1.0 and later
  }
-function CreateRangeDescriptor(var rangeStart: AEDesc; var rangeStop: AEDesc; disposeInputs: boolean; var theDescriptor: AEDesc): OSErr; external name '_CreateRangeDescriptor';
-
-{$ALIGN MAC68K}
+function CreateRangeDescriptor( var rangeStart: AEDesc; var rangeStop: AEDesc; disposeInputs: Boolean; var theDescriptor: AEDesc ): OSErr; external name '_CreateRangeDescriptor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 1021 - 905
packages/univint/src/AERegistry.pas

@@ -1,12 +1,11 @@
 {
-     File:       AERegistry.p
+     File:       AE/AERegistry.h
  
      Contains:   AppleEvents Registry Interface.
  
-     Version:    Technology: Mac OS 8.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1993-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1993-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AERegistry;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,934 +175,979 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,ATSTypes,MacErrors,AppleEvents;
+uses MacTypes,ATSTypes,MacErrors,AppleEvents,AEDataModel;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
 
 {$ALIGN MAC68K}
 
 
 const
-	cAEList						= FourCharCode('list');						{   0x6c697374   }
-	cApplication				= FourCharCode('capp');						{   0x63617070   }
-	cArc						= FourCharCode('carc');						{   0x63617263   }
-	cBoolean					= FourCharCode('bool');						{   0x626f6f6c   }
-	cCell						= FourCharCode('ccel');						{   0x6363656c   }
-	cChar						= FourCharCode('cha ');						{   0x63686120   }
-	cColorTable					= FourCharCode('clrt');						{   0x636c7274   }
-	cColumn						= FourCharCode('ccol');						{   0x63636f6c   }
-	cDocument					= FourCharCode('docu');						{   0x646f6375   }
-	cDrawingArea				= FourCharCode('cdrw');						{   0x63647277   }
-	cEnumeration				= FourCharCode('enum');						{   0x656e756d   }
-	cFile						= FourCharCode('file');						{   0x66696c65   }
-	cFixed						= FourCharCode('fixd');						{   0x66697864   }
-	cFixedPoint					= FourCharCode('fpnt');						{   0x66706e74   }
-	cFixedRectangle				= FourCharCode('frct');						{   0x66726374   }
-	cGraphicLine				= FourCharCode('glin');						{   0x676c696e   }
-	cGraphicObject				= FourCharCode('cgob');						{   0x63676f62   }
-	cGraphicShape				= FourCharCode('cgsh');						{   0x63677368   }
-	cGraphicText				= FourCharCode('cgtx');						{   0x63677478   }
-	cGroupedGraphic				= FourCharCode('cpic');						{   0x63706963   }
-
-	cInsertionLoc				= FourCharCode('insl');						{   0x696e736c   }
-	cInsertionPoint				= FourCharCode('cins');						{   0x63696e73   }
-	cIntlText					= FourCharCode('itxt');						{   0x69747874   }
-	cIntlWritingCode			= FourCharCode('intl');						{   0x696e746c   }
-	cItem						= FourCharCode('citm');						{   0x6369746d   }
-	cLine						= FourCharCode('clin');						{   0x636c696e   }
-	cLongDateTime				= FourCharCode('ldt ');						{   0x6c647420   }
-	cLongFixed					= FourCharCode('lfxd');						{   0x6c667864   }
-	cLongFixedPoint				= FourCharCode('lfpt');						{   0x6c667074   }
-	cLongFixedRectangle			= FourCharCode('lfrc');						{   0x6c667263   }
-	cLongInteger				= FourCharCode('long');						{   0x6c6f6e67   }
-	cLongPoint					= FourCharCode('lpnt');						{   0x6c706e74   }
-	cLongRectangle				= FourCharCode('lrct');						{   0x6c726374   }
-	cMachineLoc					= FourCharCode('mLoc');						{   0x6d4c6f63   }
-	cMenu						= FourCharCode('cmnu');						{   0x636d6e75   }
-	cMenuItem					= FourCharCode('cmen');						{   0x636d656e   }
-	cObject						= FourCharCode('cobj');						{   0x636f626a   }
-	cObjectSpecifier			= FourCharCode('obj ');						{   0x6f626a20   }
-	cOpenableObject				= FourCharCode('coob');						{   0x636f6f62   }
-	cOval						= FourCharCode('covl');						{   0x636f766c   }
-
-	cParagraph					= FourCharCode('cpar');						{   0x63706172   }
-	cPICT						= FourCharCode('PICT');						{   0x50494354   }
-	cPixel						= FourCharCode('cpxl');						{   0x6370786c   }
-	cPixelMap					= FourCharCode('cpix');						{   0x63706978   }
-	cPolygon					= FourCharCode('cpgn');						{   0x6370676e   }
-	cProperty					= FourCharCode('prop');						{   0x70726f70   }
-	cQDPoint					= FourCharCode('QDpt');						{   0x51447074   }
-	cQDRectangle				= FourCharCode('qdrt');						{   0x71647274   }
-	cRectangle					= FourCharCode('crec');						{   0x63726563   }
-	cRGBColor					= FourCharCode('cRGB');						{   0x63524742   }
-	cRotation					= FourCharCode('trot');						{   0x74726f74   }
-	cRoundedRectangle			= FourCharCode('crrc');						{   0x63727263   }
-	cRow						= FourCharCode('crow');						{   0x63726f77   }
-	cSelection					= FourCharCode('csel');						{   0x6373656c   }
-	cShortInteger				= FourCharCode('shor');						{   0x73686f72   }
-	cTable						= FourCharCode('ctbl');						{   0x6374626c   }
-	cText						= FourCharCode('ctxt');						{   0x63747874   }
-	cTextFlow					= FourCharCode('cflo');						{   0x63666c6f   }
-	cTextStyles					= FourCharCode('tsty');						{   0x74737479   }
-	cType						= FourCharCode('type');						{   0x74797065   }
-
-	cVersion					= FourCharCode('vers');						{   0x76657273   }
-	cWindow						= FourCharCode('cwin');						{   0x6377696e   }
-	cWord						= FourCharCode('cwor');						{   0x63776f72   }
-	enumArrows					= FourCharCode('arro');						{   0x6172726f   }
-	enumJustification			= FourCharCode('just');						{   0x6a757374   }
-	enumKeyForm					= FourCharCode('kfrm');						{   0x6b66726d   }
-	enumPosition				= FourCharCode('posi');						{   0x706f7369   }
-	enumProtection				= FourCharCode('prtn');						{   0x7072746e   }
-	enumQuality					= FourCharCode('qual');						{   0x7175616c   }
-	enumSaveOptions				= FourCharCode('savo');						{   0x7361766f   }
-	enumStyle					= FourCharCode('styl');						{   0x7374796c   }
-	enumTransferMode			= FourCharCode('tran');						{   0x7472616e   }
-	formUniqueID				= FourCharCode('ID  ');						{   0x49442020   }
-	kAEAbout					= FourCharCode('abou');						{   0x61626f75   }
-	kAEAfter					= FourCharCode('afte');						{   0x61667465   }
-	kAEAliasSelection			= FourCharCode('sali');						{   0x73616c69   }
-	kAEAllCaps					= FourCharCode('alcp');						{   0x616c6370   }
-	kAEArrowAtEnd				= FourCharCode('aren');						{   0x6172656e   }
-	kAEArrowAtStart				= FourCharCode('arst');						{   0x61727374   }
-	kAEArrowBothEnds			= FourCharCode('arbo');						{   0x6172626f   }
-
-	kAEAsk						= FourCharCode('ask ');						{   0x61736b20   }
-	kAEBefore					= FourCharCode('befo');						{   0x6265666f   }
-	kAEBeginning				= FourCharCode('bgng');						{   0x62676e67   }
-	kAEBeginsWith				= FourCharCode('bgwt');						{   0x62677774   }
-	kAEBeginTransaction			= FourCharCode('begi');						{   0x62656769   }
-	kAEBold						= FourCharCode('bold');						{   0x626f6c64   }
-	kAECaseSensEquals			= FourCharCode('cseq');						{   0x63736571   }
-	kAECentered					= FourCharCode('cent');						{   0x63656e74   }
-	kAEChangeView				= FourCharCode('view');						{   0x76696577   }
-	kAEClone					= FourCharCode('clon');						{   0x636c6f6e   }
-	kAEClose					= FourCharCode('clos');						{   0x636c6f73   }
-	kAECondensed				= FourCharCode('cond');						{   0x636f6e64   }
-	kAEContains					= FourCharCode('cont');						{   0x636f6e74   }
-	kAECopy						= FourCharCode('copy');						{   0x636f7079   }
-	kAECoreSuite				= FourCharCode('core');						{   0x636f7265   }
-	kAECountElements			= FourCharCode('cnte');						{   0x636e7465   }
-	kAECreateElement			= FourCharCode('crel');						{   0x6372656c   }
-	kAECreatePublisher			= FourCharCode('cpub');						{   0x63707562   }
-	kAECut						= FourCharCode('cut ');						{   0x63757420   }
-	kAEDelete					= FourCharCode('delo');						{   0x64656c6f   }
-
-	kAEDoObjectsExist			= FourCharCode('doex');						{   0x646f6578   }
-	kAEDoScript					= FourCharCode('dosc');						{   0x646f7363   }
-	kAEDrag						= FourCharCode('drag');						{   0x64726167   }
-	kAEDuplicateSelection		= FourCharCode('sdup');						{   0x73647570   }
-	kAEEditGraphic				= FourCharCode('edit');						{   0x65646974   }
-	kAEEmptyTrash				= FourCharCode('empt');						{   0x656d7074   }
-	kAEEnd						= FourCharCode('end ');						{   0x656e6420   }
-	kAEEndsWith					= FourCharCode('ends');						{   0x656e6473   }
-	kAEEndTransaction			= FourCharCode('endt');						{   0x656e6474   }
-	kAEEquals					= FourCharCode('=   ');						{   0x3d202020   }
-	kAEExpanded					= FourCharCode('pexp');						{   0x70657870   }
-	kAEFast						= FourCharCode('fast');						{   0x66617374   }
-	kAEFinderEvents				= FourCharCode('FNDR');						{   0x464e4452   }
-	kAEFormulaProtect			= FourCharCode('fpro');						{   0x6670726f   }
-	kAEFullyJustified			= FourCharCode('full');						{   0x66756c6c   }
-	kAEGetClassInfo				= FourCharCode('qobj');						{   0x716f626a   }
-	kAEGetData					= FourCharCode('getd');						{   0x67657464   }
-	kAEGetDataSize				= FourCharCode('dsiz');						{   0x6473697a   }
-	kAEGetEventInfo				= FourCharCode('gtei');						{   0x67746569   }
-	kAEGetInfoSelection			= FourCharCode('sinf');						{   0x73696e66   }
-
-	kAEGetPrivilegeSelection	= FourCharCode('sprv');						{   0x73707276   }
-	kAEGetSuiteInfo				= FourCharCode('gtsi');						{   0x67747369   }
-	kAEGreaterThan				= FourCharCode('>   ');						{   0x3e202020   }
-	kAEGreaterThanEquals		= FourCharCode('>=  ');						{   0x3e3d2020   }
-	kAEGrow						= FourCharCode('grow');						{   0x67726f77   }
-	kAEHidden					= FourCharCode('hidn');						{   0x6869646e   }
-	kAEHiQuality				= FourCharCode('hiqu');						{   0x68697175   }
-	kAEImageGraphic				= FourCharCode('imgr');						{   0x696d6772   }
-	kAEIsUniform				= FourCharCode('isun');						{   0x6973756e   }
-	kAEItalic					= FourCharCode('ital');						{   0x6974616c   }
-	kAELeftJustified			= FourCharCode('left');						{   0x6c656674   }
-	kAELessThan					= FourCharCode('<   ');						{   0x3c202020   }
-	kAELessThanEquals			= FourCharCode('<=  ');						{   0x3c3d2020   }
-	kAELowercase				= FourCharCode('lowc');						{   0x6c6f7763   }
-	kAEMakeObjectsVisible		= FourCharCode('mvis');						{   0x6d766973   }
-	kAEMiscStandards			= FourCharCode('misc');						{   0x6d697363   }
-	kAEModifiable				= FourCharCode('modf');						{   0x6d6f6466   }
-	kAEMove						= FourCharCode('move');						{   0x6d6f7665   }
-	kAENo						= FourCharCode('no  ');						{   0x6e6f2020   }
-	kAENoArrow					= FourCharCode('arno');						{   0x61726e6f   }
-
-	kAENonmodifiable			= FourCharCode('nmod');						{   0x6e6d6f64   }
-	kAEOpen						= FourCharCode('odoc');						{   0x6f646f63   }
-	kAEOpenSelection			= FourCharCode('sope');						{   0x736f7065   }
-	kAEOutline					= FourCharCode('outl');						{   0x6f75746c   }
-	kAEPageSetup				= FourCharCode('pgsu');						{   0x70677375   }
-	kAEPaste					= FourCharCode('past');						{   0x70617374   }
-	kAEPlain					= FourCharCode('plan');						{   0x706c616e   }
-	kAEPrint					= FourCharCode('pdoc');						{   0x70646f63   }
-	kAEPrintSelection			= FourCharCode('spri');						{   0x73707269   }
-	kAEPrintWindow				= FourCharCode('pwin');						{   0x7077696e   }
-	kAEPutAwaySelection			= FourCharCode('sput');						{   0x73707574   }
-	kAEQDAddOver				= FourCharCode('addo');						{   0x6164646f   }
-	kAEQDAddPin					= FourCharCode('addp');						{   0x61646470   }
-	kAEQDAdMax					= FourCharCode('admx');						{   0x61646d78   }
-	kAEQDAdMin					= FourCharCode('admn');						{   0x61646d6e   }
-	kAEQDBic					= FourCharCode('bic ');						{   0x62696320   }
-	kAEQDBlend					= FourCharCode('blnd');						{   0x626c6e64   }
-	kAEQDCopy					= FourCharCode('cpy ');						{   0x63707920   }
-	kAEQDNotBic					= FourCharCode('nbic');						{   0x6e626963   }
-	kAEQDNotCopy				= FourCharCode('ncpy');						{   0x6e637079   }
-
-	kAEQDNotOr					= FourCharCode('ntor');						{   0x6e746f72   }
-	kAEQDNotXor					= FourCharCode('nxor');						{   0x6e786f72   }
-	kAEQDOr						= FourCharCode('or  ');						{   0x6f722020   }
-	kAEQDSubOver				= FourCharCode('subo');						{   0x7375626f   }
-	kAEQDSubPin					= FourCharCode('subp');						{   0x73756270   }
-	kAEQDSupplementalSuite		= FourCharCode('qdsp');						{   0x71647370   }
-	kAEQDXor					= FourCharCode('xor ');						{   0x786f7220   }
-	kAEQuickdrawSuite			= FourCharCode('qdrw');						{   0x71647277   }
-	kAEQuitAll					= FourCharCode('quia');						{   0x71756961   }
-	kAERedo						= FourCharCode('redo');						{   0x7265646f   }
-	kAERegular					= FourCharCode('regl');						{   0x7265676c   }
-	kAEReopenApplication		= FourCharCode('rapp');						{   0x72617070   }
-	kAEReplace					= FourCharCode('rplc');						{   0x72706c63   }
-	kAERequiredSuite			= FourCharCode('reqd');						{   0x72657164   }
-	kAERestart					= FourCharCode('rest');						{   0x72657374   }
-	kAERevealSelection			= FourCharCode('srev');						{   0x73726576   }
-	kAERevert					= FourCharCode('rvrt');						{   0x72767274   }
-	kAERightJustified			= FourCharCode('rght');						{   0x72676874   }
-	kAESave						= FourCharCode('save');						{   0x73617665   }
-	kAESelect					= FourCharCode('slct');						{   0x736c6374   }
-	kAESetData					= FourCharCode('setd');						{   0x73657464   }
-
-	kAESetPosition				= FourCharCode('posn');						{   0x706f736e   }
-	kAEShadow					= FourCharCode('shad');						{   0x73686164   }
-	kAEShowClipboard			= FourCharCode('shcl');						{   0x7368636c   }
-	kAEShutDown					= FourCharCode('shut');						{   0x73687574   }
-	kAESleep					= FourCharCode('slep');						{   0x736c6570   }
-	kAESmallCaps				= FourCharCode('smcp');						{   0x736d6370   }
-	kAESpecialClassProperties	= FourCharCode('c@#!');						{   0x63402321   }
-	kAEStrikethrough			= FourCharCode('strk');						{   0x7374726b   }
-	kAESubscript				= FourCharCode('sbsc');						{   0x73627363   }
-	kAESuperscript				= FourCharCode('spsc');						{   0x73707363   }
-	kAETableSuite				= FourCharCode('tbls');						{   0x74626c73   }
-	kAETextSuite				= FourCharCode('TEXT');						{   0x54455854   }
-	kAETransactionTerminated	= FourCharCode('ttrm');						{   0x7474726d   }
-	kAEUnderline				= FourCharCode('undl');						{   0x756e646c   }
-	kAEUndo						= FourCharCode('undo');						{   0x756e646f   }
-	kAEWholeWordEquals			= FourCharCode('wweq');						{   0x77776571   }
-	kAEYes						= FourCharCode('yes ');						{   0x79657320   }
-	kAEZoom						= FourCharCode('zoom');						{   0x7a6f6f6d   }
-
-    { events that can be sent to the "system" process (eg, loginwindow) on OS X 10.2 or later }
-	kAELogOut                   = FourCharCode('logo');
-	kAEReallyLogOut             = FourCharCode('rlgo');
-	kAEShowRestartDialog        = FourCharCode('rrst');
-	kAEShowShutdownDialog       = FourCharCode('rsdn');
-
-	{	 EventRecord Classes and EventIDs 	}
-	kAEMouseClass				= FourCharCode('mous');
-	kAEDown						= FourCharCode('down');
-	kAEUp						= FourCharCode('up  ');
-	kAEMoved					= FourCharCode('move');
-	kAEStoppedMoving			= FourCharCode('stop');
-	kAEWindowClass				= FourCharCode('wind');
-	kAEUpdate					= FourCharCode('updt');
-	kAEActivate					= FourCharCode('actv');
-	kAEDeactivate				= FourCharCode('dact');
-	kAECommandClass				= FourCharCode('cmnd');						{  Modern Command Event Class  }
-	kAEKeyClass					= FourCharCode('keyc');
-	kAERawKey					= FourCharCode('rkey');						{  Modern Raw Key Event  }
-	kAEVirtualKey				= FourCharCode('keyc');						{  Modern Virtual Key Event  }
-	kAENavigationKey			= FourCharCode('nave');						{  Modern Navigation Key Event  }
-	kAEAutoDown					= FourCharCode('auto');
-	kAEApplicationClass			= FourCharCode('appl');
-	kAESuspend					= FourCharCode('susp');
-	kAEResume					= FourCharCode('rsme');
-	kAEDiskEvent				= FourCharCode('disk');
-	kAENullEvent				= FourCharCode('null');
-	kAEWakeUpEvent				= FourCharCode('wake');
-	kAEScrapEvent				= FourCharCode('scrp');
-	kAEHighLevel				= FourCharCode('high');
-
-	keyAEAngle					= FourCharCode('kang');						{   0x6b616e67   }
-	keyAEArcAngle				= FourCharCode('parc');						{   0x70617263   }
-
-	keyAEBaseAddr				= FourCharCode('badd');						{   0x62616464   }
-	keyAEBestType				= FourCharCode('pbst');						{   0x70627374   }
-	keyAEBgndColor				= FourCharCode('kbcl');						{   0x6b62636c   }
-	keyAEBgndPattern			= FourCharCode('kbpt');						{   0x6b627074   }
-	keyAEBounds					= FourCharCode('pbnd');						{   0x70626e64   }
-	keyAECellList				= FourCharCode('kclt');						{   0x6b636c74   }
-	keyAEClassID				= FourCharCode('clID');						{   0x636c4944   }
-	keyAEColor					= FourCharCode('colr');						{   0x636f6c72   }
-	keyAEColorTable				= FourCharCode('cltb');						{   0x636c7462   }
-	keyAECurveHeight			= FourCharCode('kchd');						{   0x6b636864   }
-	keyAECurveWidth				= FourCharCode('kcwd');						{   0x6b637764   }
-	keyAEDashStyle				= FourCharCode('pdst');						{   0x70647374   }
-	keyAEData					= FourCharCode('data');						{   0x64617461   }
-	keyAEDefaultType			= FourCharCode('deft');						{   0x64656674   }
-	keyAEDefinitionRect			= FourCharCode('pdrt');						{   0x70647274   }
-	keyAEDescType				= FourCharCode('dstp');						{   0x64737470   }
-	keyAEDestination			= FourCharCode('dest');						{   0x64657374   }
-	keyAEDoAntiAlias			= FourCharCode('anta');						{   0x616e7461   }
-	keyAEDoDithered				= FourCharCode('gdit');						{   0x67646974   }
-	keyAEDoRotate				= FourCharCode('kdrt');						{   0x6b647274   }
-
-	keyAEDoScale				= FourCharCode('ksca');						{   0x6b736361   }
-	keyAEDoTranslate			= FourCharCode('ktra');						{   0x6b747261   }
-	keyAEEditionFileLoc			= FourCharCode('eloc');						{   0x656c6f63   }
-	keyAEElements				= FourCharCode('elms');						{   0x656c6d73   }
-	keyAEEndPoint				= FourCharCode('pend');						{   0x70656e64   }
-	keyAEEventClass				= FourCharCode('evcl');						{   0x6576636c   }
-	keyAEEventID				= FourCharCode('evti');						{   0x65767469   }
-	keyAEFile					= FourCharCode('kfil');						{   0x6b66696c   }
-	keyAEFileType				= FourCharCode('fltp');						{   0x666c7470   }
-	keyAEFillColor				= FourCharCode('flcl');						{   0x666c636c   }
-	keyAEFillPattern			= FourCharCode('flpt');						{   0x666c7074   }
-	keyAEFlipHorizontal			= FourCharCode('kfho');						{   0x6b66686f   }
-	keyAEFlipVertical			= FourCharCode('kfvt');						{   0x6b667674   }
-	keyAEFont					= FourCharCode('font');						{   0x666f6e74   }
-	keyAEFormula				= FourCharCode('pfor');						{   0x70666f72   }
-	keyAEGraphicObjects			= FourCharCode('gobs');						{   0x676f6273   }
-	keyAEID						= FourCharCode('ID  ');						{   0x49442020   }
-	keyAEImageQuality			= FourCharCode('gqua');						{   0x67717561   }
-	keyAEInsertHere				= FourCharCode('insh');						{   0x696e7368   }
-	keyAEKeyForms				= FourCharCode('keyf');						{   0x6b657966   }
-
-	keyAEKeyword				= FourCharCode('kywd');						{   0x6b797764   }
-	keyAELevel					= FourCharCode('levl');						{   0x6c65766c   }
-	keyAELineArrow				= FourCharCode('arro');						{   0x6172726f   }
-	keyAEName					= FourCharCode('pnam');						{   0x706e616d   }
-	keyAENewElementLoc			= FourCharCode('pnel');						{   0x706e656c   }
-	keyAEObject					= FourCharCode('kobj');						{   0x6b6f626a   }
-	keyAEObjectClass			= FourCharCode('kocl');						{   0x6b6f636c   }
-	keyAEOffStyles				= FourCharCode('ofst');						{   0x6f667374   }
-	keyAEOnStyles				= FourCharCode('onst');						{   0x6f6e7374   }
-	keyAEParameters				= FourCharCode('prms');						{   0x70726d73   }
-	keyAEParamFlags				= FourCharCode('pmfg');						{   0x706d6667   }
-	keyAEPenColor				= FourCharCode('ppcl');						{   0x7070636c   }
-	keyAEPenPattern				= FourCharCode('pppa');						{   0x70707061   }
-	keyAEPenWidth				= FourCharCode('ppwd');						{   0x70707764   }
-	keyAEPixelDepth				= FourCharCode('pdpt');						{   0x70647074   }
-	keyAEPixMapMinus			= FourCharCode('kpmm');						{   0x6b706d6d   }
-	keyAEPMTable				= FourCharCode('kpmt');						{   0x6b706d74   }
-	keyAEPointList				= FourCharCode('ptlt');						{   0x70746c74   }
-	keyAEPointSize				= FourCharCode('ptsz');						{   0x7074737a   }
-	keyAEPosition				= FourCharCode('kpos');						{   0x6b706f73   }
-
-	keyAEPropData				= FourCharCode('prdt');						{   0x70726474   }
-	keyAEProperties				= FourCharCode('qpro');						{   0x7170726f   }
-	keyAEProperty				= FourCharCode('kprp');						{   0x6b707270   }
-	keyAEPropFlags				= FourCharCode('prfg');						{   0x70726667   }
-	keyAEPropID					= FourCharCode('prop');						{   0x70726f70   }
-	keyAEProtection				= FourCharCode('ppro');						{   0x7070726f   }
-	keyAERenderAs				= FourCharCode('kren');						{   0x6b72656e   }
-	keyAERequestedType			= FourCharCode('rtyp');						{   0x72747970   }
-	keyAEResult					= FourCharCode('----');						{   0x2d2d2d2d   }
-	keyAEResultInfo				= FourCharCode('rsin');						{   0x7273696e   }
-	keyAERotation				= FourCharCode('prot');						{   0x70726f74   }
-	keyAERotPoint				= FourCharCode('krtp');						{   0x6b727470   }
-	keyAERowList				= FourCharCode('krls');						{   0x6b726c73   }
-	keyAESaveOptions			= FourCharCode('savo');						{   0x7361766f   }
-	keyAEScale					= FourCharCode('pscl');						{   0x7073636c   }
-	keyAEScriptTag				= FourCharCode('psct');						{   0x70736374   }
-	keyAEShowWhere				= FourCharCode('show');						{   0x73686f77   }
-	keyAEStartAngle				= FourCharCode('pang');						{   0x70616e67   }
-	keyAEStartPoint				= FourCharCode('pstp');						{   0x70737470   }
-	keyAEStyles					= FourCharCode('ksty');						{   0x6b737479   }
-
-	keyAESuiteID				= FourCharCode('suit');						{   0x73756974   }
-	keyAEText					= FourCharCode('ktxt');						{   0x6b747874   }
-	keyAETextColor				= FourCharCode('ptxc');						{   0x70747863   }
-	keyAETextFont				= FourCharCode('ptxf');						{   0x70747866   }
-	keyAETextPointSize			= FourCharCode('ptps');						{   0x70747073   }
-	keyAETextStyles				= FourCharCode('txst');						{   0x74787374   }
-	keyAETextLineHeight			= FourCharCode('ktlh');						{  type ShortInteger  }
-	keyAETextLineAscent			= FourCharCode('ktas');						{  type ShortInteger  }
-	keyAETheText				= FourCharCode('thtx');						{   0x74687478   }
-	keyAETransferMode			= FourCharCode('pptm');						{   0x7070746d   }
-	keyAETranslation			= FourCharCode('ptrs');						{   0x70747273   }
-	keyAETryAsStructGraf		= FourCharCode('toog');						{   0x746f6f67   }
-	keyAEUniformStyles			= FourCharCode('ustl');						{   0x7573746c   }
-	keyAEUpdateOn				= FourCharCode('pupd');						{   0x70757064   }
-	keyAEUserTerm				= FourCharCode('utrm');						{   0x7574726d   }
-	keyAEWindow					= FourCharCode('wndw');						{   0x776e6477   }
-	keyAEWritingCode			= FourCharCode('wrcd');						{   0x77726364   }
-
-	keyMiscellaneous			= FourCharCode('fmsc');						{   0x666d7363   }
-	keySelection				= FourCharCode('fsel');						{   0x6673656c   }
-	keyWindow					= FourCharCode('kwnd');						{   0x6b776e64   }
-																{  EventRecord keys  }
-	keyWhen						= FourCharCode('when');
-	keyWhere					= FourCharCode('wher');
-	keyModifiers				= FourCharCode('mods');
-	keyKey						= FourCharCode('key ');
-	keyKeyCode					= FourCharCode('code');
-	keyKeyboard					= FourCharCode('keyb');
-	keyDriveNumber				= FourCharCode('drv#');
-	keyErrorCode				= FourCharCode('err#');
-	keyHighLevelClass			= FourCharCode('hcls');
-	keyHighLevelID				= FourCharCode('hid ');
-
-	pArcAngle					= FourCharCode('parc');						{   0x70617263   }
-	pBackgroundColor			= FourCharCode('pbcl');						{   0x7062636c   }
-	pBackgroundPattern			= FourCharCode('pbpt');						{   0x70627074   }
-	pBestType					= FourCharCode('pbst');						{   0x70627374   }
-	pBounds						= FourCharCode('pbnd');						{   0x70626e64   }
-	pClass						= FourCharCode('pcls');						{   0x70636c73   }
-	pClipboard					= FourCharCode('pcli');						{   0x70636c69   }
-	pColor						= FourCharCode('colr');						{   0x636f6c72   }
-	pColorTable					= FourCharCode('cltb');						{   0x636c7462   }
-	pContents					= FourCharCode('pcnt');						{   0x70636e74   }
-	pCornerCurveHeight			= FourCharCode('pchd');						{   0x70636864   }
-	pCornerCurveWidth			= FourCharCode('pcwd');						{   0x70637764   }
-	pDashStyle					= FourCharCode('pdst');						{   0x70647374   }
-	pDefaultType				= FourCharCode('deft');						{   0x64656674   }
-	pDefinitionRect				= FourCharCode('pdrt');						{   0x70647274   }
-	pEnabled					= FourCharCode('enbl');						{   0x656e626c   }
-	pEndPoint					= FourCharCode('pend');						{   0x70656e64   }
-	pFillColor					= FourCharCode('flcl');						{   0x666c636c   }
-	pFillPattern				= FourCharCode('flpt');						{   0x666c7074   }
-	pFont						= FourCharCode('font');						{   0x666f6e74   }
-
-	pFormula					= FourCharCode('pfor');						{   0x70666f72   }
-	pGraphicObjects				= FourCharCode('gobs');						{   0x676f6273   }
-	pHasCloseBox				= FourCharCode('hclb');						{   0x68636c62   }
-	pHasTitleBar				= FourCharCode('ptit');						{   0x70746974   }
-	pID							= FourCharCode('ID  ');						{   0x49442020   }
-	pIndex						= FourCharCode('pidx');						{   0x70696478   }
-	pInsertionLoc				= FourCharCode('pins');						{   0x70696e73   }
-	pIsFloating					= FourCharCode('isfl');						{   0x6973666c   }
-	pIsFrontProcess				= FourCharCode('pisf');						{   0x70697366   }
-	pIsModal					= FourCharCode('pmod');						{   0x706d6f64   }
-	pIsModified					= FourCharCode('imod');						{   0x696d6f64   }
-	pIsResizable				= FourCharCode('prsz');						{   0x7072737a   }
-	pIsStationeryPad			= FourCharCode('pspd');						{   0x70737064   }
-	pIsZoomable					= FourCharCode('iszm');						{   0x69737a6d   }
-	pIsZoomed					= FourCharCode('pzum');						{   0x707a756d   }
-	pItemNumber					= FourCharCode('itmn');						{   0x69746d6e   }
-	pJustification				= FourCharCode('pjst');						{   0x706a7374   }
-	pLineArrow					= FourCharCode('arro');						{   0x6172726f   }
-	pMenuID						= FourCharCode('mnid');						{   0x6d6e6964   }
-	pName						= FourCharCode('pnam');						{   0x706e616d   }
-
-	pNewElementLoc				= FourCharCode('pnel');						{   0x706e656c   }
-	pPenColor					= FourCharCode('ppcl');						{   0x7070636c   }
-	pPenPattern					= FourCharCode('pppa');						{   0x70707061   }
-	pPenWidth					= FourCharCode('ppwd');						{   0x70707764   }
-	pPixelDepth					= FourCharCode('pdpt');						{   0x70647074   }
-	pPointList					= FourCharCode('ptlt');						{   0x70746c74   }
-	pPointSize					= FourCharCode('ptsz');						{   0x7074737a   }
-	pProtection					= FourCharCode('ppro');						{   0x7070726f   }
-	pRotation					= FourCharCode('prot');						{   0x70726f74   }
-	pScale						= FourCharCode('pscl');						{   0x7073636c   }
-	pScript						= FourCharCode('scpt');						{   0x73637074   }
-	pScriptTag					= FourCharCode('psct');						{   0x70736374   }
-	pSelected					= FourCharCode('selc');						{   0x73656c63   }
-	pSelection					= FourCharCode('sele');						{   0x73656c65   }
-	pStartAngle					= FourCharCode('pang');						{   0x70616e67   }
-	pStartPoint					= FourCharCode('pstp');						{   0x70737470   }
-	pTextColor					= FourCharCode('ptxc');						{   0x70747863   }
-	pTextFont					= FourCharCode('ptxf');						{   0x70747866   }
-	pTextItemDelimiters			= FourCharCode('txdl');						{   0x7478646c   }
-	pTextPointSize				= FourCharCode('ptps');						{   0x70747073   }
-
-	pTextStyles					= FourCharCode('txst');						{   0x74787374   }
-	pTransferMode				= FourCharCode('pptm');						{   0x7070746d   }
-	pTranslation				= FourCharCode('ptrs');						{   0x70747273   }
-	pUniformStyles				= FourCharCode('ustl');						{   0x7573746c   }
-	pUpdateOn					= FourCharCode('pupd');						{   0x70757064   }
-	pUserSelection				= FourCharCode('pusl');						{   0x7075736c   }
-	pVersion					= FourCharCode('vers');						{   0x76657273   }
-	pVisible					= FourCharCode('pvis');						{   0x70766973   }
-
-	typeAEText					= FourCharCode('tTXT');						{   0x74545854   }
-	typeArc						= FourCharCode('carc');						{   0x63617263   }
-	typeBest					= FourCharCode('best');						{   0x62657374   }
-	typeCell					= FourCharCode('ccel');						{   0x6363656c   }
-	typeClassInfo				= FourCharCode('gcli');						{   0x67636c69   }
-	typeColorTable				= FourCharCode('clrt');						{   0x636c7274   }
-	typeColumn					= FourCharCode('ccol');						{   0x63636f6c   }
-	typeDashStyle				= FourCharCode('tdas');						{   0x74646173   }
-	typeData					= FourCharCode('tdta');						{   0x74647461   }
-	typeDrawingArea				= FourCharCode('cdrw');						{   0x63647277   }
-	typeElemInfo				= FourCharCode('elin');						{   0x656c696e   }
-	typeEnumeration				= FourCharCode('enum');						{   0x656e756d   }
-	typeEPS						= FourCharCode('EPS ');						{   0x45505320   }
-	typeEventInfo				= FourCharCode('evin');						{   0x6576696e   }
-
-	typeFinderWindow			= FourCharCode('fwin');						{   0x6677696e   }
-	typeFixedPoint				= FourCharCode('fpnt');						{   0x66706e74   }
-	typeFixedRectangle			= FourCharCode('frct');						{   0x66726374   }
-	typeGraphicLine				= FourCharCode('glin');						{   0x676c696e   }
-	typeGraphicText				= FourCharCode('cgtx');						{   0x63677478   }
-	typeGroupedGraphic			= FourCharCode('cpic');						{   0x63706963   }
-	typeInsertionLoc			= FourCharCode('insl');						{   0x696e736c   }
-	typeIntlText				= FourCharCode('itxt');						{   0x69747874   }
-	typeIntlWritingCode			= FourCharCode('intl');						{   0x696e746c   }
-	typeLongDateTime			= FourCharCode('ldt ');						{   0x6c647420   }
-	typeISO8601DateTime         = FourCharCode('isot');                       {   0x69736f74  data is ascii text of an ISO8601 date }
-	typeLongFixed				= FourCharCode('lfxd');						{   0x6c667864   }
-	typeLongFixedPoint			= FourCharCode('lfpt');						{   0x6c667074   }
-	typeLongFixedRectangle		= FourCharCode('lfrc');						{   0x6c667263   }
-	typeLongPoint				= FourCharCode('lpnt');						{   0x6c706e74   }
-	typeLongRectangle			= FourCharCode('lrct');						{   0x6c726374   }
-	typeMachineLoc				= FourCharCode('mLoc');						{   0x6d4c6f63   }
-	typeOval					= FourCharCode('covl');						{   0x636f766c   }
-	typeParamInfo				= FourCharCode('pmin');						{   0x706d696e   }
-	typePict					= FourCharCode('PICT');						{   0x50494354   }
-
-	typePixelMap				= FourCharCode('cpix');						{   0x63706978   }
-	typePixMapMinus				= FourCharCode('tpmm');						{   0x74706d6d   }
-	typePolygon					= FourCharCode('cpgn');						{   0x6370676e   }
-	typePropInfo				= FourCharCode('pinf');						{   0x70696e66   }
-	typePtr						= FourCharCode('ptr ');						{   0x70747220   }
-	typeQDPoint					= FourCharCode('QDpt');						{   0x51447074   }
-	typeQDRegion				= FourCharCode('Qrgn');						{   0x51447074  (data is actual region data, including rectangle and size, _not_ region handle or ptr) }
-	typeRectangle				= FourCharCode('crec');						{   0x63726563   }
-	typeRGB16					= FourCharCode('tr16');						{   0x74723136   }
-	typeRGB96					= FourCharCode('tr96');						{   0x74723936   }
-	typeRGBColor				= FourCharCode('cRGB');						{   0x63524742   }
-	typeRotation				= FourCharCode('trot');						{   0x74726f74   }
-	typeRoundedRectangle		= FourCharCode('crrc');						{   0x63727263   }
-	typeRow						= FourCharCode('crow');						{   0x63726f77   }
-	typeScrapStyles				= FourCharCode('styl');						{   0x7374796c   }
-	typeScript					= FourCharCode('scpt');						{   0x73637074   }
-	typeStyledText				= FourCharCode('STXT');						{   0x53545854   }
-	typeSuiteInfo				= FourCharCode('suin');						{   0x7375696e   }
-	typeTable					= FourCharCode('ctbl');						{   0x6374626c   }
-	typeTextStyles				= FourCharCode('tsty');						{   0x74737479   }
-
-	typeTIFF					= FourCharCode('TIFF');						{   0x54494646   }
-	typeJPEG                    = FourCharCode('JPEG');
-	typeGIF                     = FourCharCode('GIFf');
-	typeVersion					= FourCharCode('vers');						{   0x76657273   }
-
-	kAEMenuClass				= FourCharCode('menu');
-	kAEMenuSelect				= FourCharCode('mhit');
-	kAEMouseDown				= FourCharCode('mdwn');
-	kAEMouseDownInBack			= FourCharCode('mdbk');
-	kAEKeyDown					= FourCharCode('kdwn');
-	kAEResized					= FourCharCode('rsiz');
-	kAEPromise					= FourCharCode('prom');
-
-	keyMenuID					= FourCharCode('mid ');
-	keyMenuItem					= FourCharCode('mitm');
-	keyCloseAllWindows			= FourCharCode('caw ');
-	keyOriginalBounds			= FourCharCode('obnd');
-	keyNewBounds				= FourCharCode('nbnd');
-	keyLocalWhere				= FourCharCode('lwhr');
-
-	typeHIMenu					= FourCharCode('mobj');
-	typeHIWindow				= FourCharCode('wobj');
-
-	kBySmallIcon				= 0;
-	kByIconView					= 1;
-	kByNameView					= 2;
-	kByDateView					= 3;
-	kBySizeView					= 4;
-	kByKindView					= 5;
-	kByCommentView				= 6;
-	kByLabelView				= 7;
-	kByVersionView				= 8;
-
-	kAEInfo						= 11;
-	kAEMain						= 0;
-	kAESharing					= 13;
-
-	kAEZoomIn					= 7;
-	kAEZoomOut					= 8;
-
-	kTextServiceClass			= FourCharCode('tsvc');
-	kUpdateActiveInputArea		= FourCharCode('updt');						{  update the active input area  }
-	kShowHideInputWindow		= FourCharCode('shiw');						{  show or hide the input window  }
-	kPos2Offset					= FourCharCode('p2st');						{  converting global coordinates to char position  }
-	kOffset2Pos					= FourCharCode('st2p');						{  converting char position to global coordinates  }
-	kUnicodeNotFromInputMethod	= FourCharCode('unim');						{  Unicode text when event not handled by Input Method or no Input Method  }
-	kGetSelectedText			= FourCharCode('gtxt');						{  Get text for current selection  }
-	keyAETSMDocumentRefcon		= FourCharCode('refc');						{  TSM document refcon, typeLongInteger  }
-	keyAEServerInstance			= FourCharCode('srvi');						{  component instance  }
-	keyAETheData				= FourCharCode('kdat');						{  typeText  }
-	keyAEFixLength				= FourCharCode('fixl');						{  fix len  }
-	keyAEUpdateRange			= FourCharCode('udng');						{  typeTextRangeArray  }
-	keyAECurrentPoint			= FourCharCode('cpos');						{  current point  }
-	keyAEBufferSize				= FourCharCode('buff');						{  buffer size to get the text  }
-	keyAEMoveView				= FourCharCode('mvvw');						{  move view flag  }
-	keyAENextBody				= FourCharCode('nxbd');						{  next or previous body  }
-	keyAETSMScriptTag			= FourCharCode('sclg');
-	keyAETSMTextFont			= FourCharCode('ktxf');						{  FMFontFamily or FOND ID  }
-	keyAETSMTextFMFont			= FourCharCode('ktxm');						{  FMFont  }
-	keyAETSMTextPointSize		= FourCharCode('ktps');
-	keyAETSMEventRecord			= FourCharCode('tevt');						{  Low level Event Record, typeLowLevelEventRecord  }
-	keyAETSMEventRef			= FourCharCode('tevr');						{  Carbon EventRef, typeEventRef  }
-	keyAETextServiceEncoding	= FourCharCode('tsen');						{  Text Service encoding, mac or Unicode in UpdateActiveInputArea or GetSelectedText events.  }
-	keyAETextServiceMacEncoding	= FourCharCode('tmen');						{  Target mac encoding for TSM conversion of text from Unicode text service.  }
-	typeTextRange				= FourCharCode('txrn');						{  TextRange  }
-	typeComponentInstance		= FourCharCode('cmpi');						{  server instance  }
-	typeOffsetArray				= FourCharCode('ofay');						{  offset array  }
-	typeTextRangeArray			= FourCharCode('tray');
-	typeLowLevelEventRecord		= FourCharCode('evtr');						{  Low Level Event Record  }
-	typeEventRef				= FourCharCode('evrf');						{  Carbon EventRef  }
-	typeText					= FourCharCode('TEXT');						{  Plain text  }
-
-
-	{	 Desc type constants 	}
-	kTSMOutsideOfBody			= 1;
-	kTSMInsideOfBody			= 2;
-	kTSMInsideOfActiveInputArea	= 3;
-
-	kNextBody					= 1;
-	kPreviousBody				= 2;
+	cAEList = FourCharCode('list'); {  0x6c697374  }
+	cApplication = FourCharCode('capp'); {  0x63617070  }
+	cArc = FourCharCode('carc'); {  0x63617263  }
+	cBoolean = FourCharCode('bool'); {  0x626f6f6c  }
+	cCell = FourCharCode('ccel'); {  0x6363656c  }
+	cChar = FourCharCode('cha '); {  0x63686120  }
+	cColorTable = FourCharCode('clrt'); {  0x636c7274  }
+	cColumn = FourCharCode('ccol'); {  0x63636f6c  }
+	cDocument = FourCharCode('docu'); {  0x646f6375  }
+	cDrawingArea = FourCharCode('cdrw'); {  0x63647277  }
+	cEnumeration = FourCharCode('enum'); {  0x656e756d  }
+	cFile = FourCharCode('file'); {  0x66696c65  }
+	cFixed = FourCharCode('fixd'); {  0x66697864  }
+	cFixedPoint = FourCharCode('fpnt'); {  0x66706e74  }
+	cFixedRectangle = FourCharCode('frct'); {  0x66726374  }
+	cGraphicLine = FourCharCode('glin'); {  0x676c696e  }
+	cGraphicObject = FourCharCode('cgob'); {  0x63676f62  }
+	cGraphicShape = FourCharCode('cgsh'); {  0x63677368  }
+	cGraphicText = FourCharCode('cgtx'); {  0x63677478  }
+	cGroupedGraphic = FourCharCode('cpic'); {  0x63706963  }
+
+const
+	cInsertionLoc = FourCharCode('insl'); {  0x696e736c  }
+	cInsertionPoint = FourCharCode('cins'); {  0x63696e73  }
+	cIntlText = FourCharCode('itxt'); {  0x69747874  }
+	cIntlWritingCode = FourCharCode('intl'); {  0x696e746c  }
+	cItem = FourCharCode('citm'); {  0x6369746d  }
+	cLine = FourCharCode('clin'); {  0x636c696e  }
+	cLongDateTime = FourCharCode('ldt '); {  0x6c647420  }
+	cLongFixed = FourCharCode('lfxd'); {  0x6c667864  }
+	cLongFixedPoint = FourCharCode('lfpt'); {  0x6c667074  }
+	cLongFixedRectangle = FourCharCode('lfrc'); {  0x6c667263  }
+	cLongInteger = FourCharCode('long'); {  0x6c6f6e67  }
+	cLongPoint = FourCharCode('lpnt'); {  0x6c706e74  }
+	cLongRectangle = FourCharCode('lrct'); {  0x6c726374  }
+	cMachineLoc = FourCharCode('mLoc'); {  0x6d4c6f63  }
+	cMenu = FourCharCode('cmnu'); {  0x636d6e75  }
+	cMenuItem = FourCharCode('cmen'); {  0x636d656e  }
+	cObject = FourCharCode('cobj'); {  0x636f626a  }
+	cObjectSpecifier = FourCharCode('obj '); {  0x6f626a20  }
+	cOpenableObject = FourCharCode('coob'); {  0x636f6f62  }
+	cOval = FourCharCode('covl'); {  0x636f766c  }
+
+const
+	cParagraph = FourCharCode('cpar'); {  0x63706172  }
+	cPICT = FourCharCode('PICT'); {  0x50494354  }
+	cPixel = FourCharCode('cpxl'); {  0x6370786c  }
+	cPixelMap = FourCharCode('cpix'); {  0x63706978  }
+	cPolygon = FourCharCode('cpgn'); {  0x6370676e  }
+	cProperty = FourCharCode('prop'); {  0x70726f70  }
+	cQDPoint = FourCharCode('QDpt'); {  0x51447074  }
+	cQDRectangle = FourCharCode('qdrt'); {  0x71647274  }
+	cRectangle = FourCharCode('crec'); {  0x63726563  }
+	cRGBColor = FourCharCode('cRGB'); {  0x63524742  }
+	cRotation = FourCharCode('trot'); {  0x74726f74  }
+	cRoundedRectangle = FourCharCode('crrc'); {  0x63727263  }
+	cRow = FourCharCode('crow'); {  0x63726f77  }
+	cSelection = FourCharCode('csel'); {  0x6373656c  }
+	cShortInteger = FourCharCode('shor'); {  0x73686f72  }
+	cTable = FourCharCode('ctbl'); {  0x6374626c  }
+	cText = FourCharCode('ctxt'); {  0x63747874  }
+	cTextFlow = FourCharCode('cflo'); {  0x63666c6f  }
+	cTextStyles = FourCharCode('tsty'); {  0x74737479  }
+	cType = FourCharCode('type'); {  0x74797065  }
+
+const
+	cVersion = FourCharCode('vers'); {  0x76657273  }
+	cWindow = FourCharCode('cwin'); {  0x6377696e  }
+	cWord = FourCharCode('cwor'); {  0x63776f72  }
+	enumArrows = FourCharCode('arro'); {  0x6172726f  }
+	enumJustification = FourCharCode('just'); {  0x6a757374  }
+	enumKeyForm = FourCharCode('kfrm'); {  0x6b66726d  }
+	enumPosition = FourCharCode('posi'); {  0x706f7369  }
+	enumProtection = FourCharCode('prtn'); {  0x7072746e  }
+	enumQuality = FourCharCode('qual'); {  0x7175616c  }
+	enumSaveOptions = FourCharCode('savo'); {  0x7361766f  }
+	enumStyle = FourCharCode('styl'); {  0x7374796c  }
+	enumTransferMode = FourCharCode('tran'); {  0x7472616e  }
+	kAEAbout = FourCharCode('abou'); {  0x61626f75  }
+	kAEAfter = FourCharCode('afte'); {  0x61667465  }
+	kAEAliasSelection = FourCharCode('sali'); {  0x73616c69  }
+	kAEAllCaps = FourCharCode('alcp'); {  0x616c6370  }
+	kAEArrowAtEnd = FourCharCode('aren'); {  0x6172656e  }
+	kAEArrowAtStart = FourCharCode('arst'); {  0x61727374  }
+	kAEArrowBothEnds = FourCharCode('arbo'); {  0x6172626f  }
+
+const
+	kAEAsk = FourCharCode('ask '); {  0x61736b20  }
+	kAEBefore = FourCharCode('befo'); {  0x6265666f  }
+	kAEBeginning = FourCharCode('bgng'); {  0x62676e67  }
+	kAEBeginsWith = FourCharCode('bgwt'); {  0x62677774  }
+	kAEBeginTransaction = FourCharCode('begi'); {  0x62656769  }
+	kAEBold = FourCharCode('bold'); {  0x626f6c64  }
+	kAECaseSensEquals = FourCharCode('cseq'); {  0x63736571  }
+	kAECentered = FourCharCode('cent'); {  0x63656e74  }
+	kAEChangeView = FourCharCode('view'); {  0x76696577  }
+	kAEClone = FourCharCode('clon'); {  0x636c6f6e  }
+	kAEClose = FourCharCode('clos'); {  0x636c6f73  }
+	kAECondensed = FourCharCode('cond'); {  0x636f6e64  }
+	kAEContains = FourCharCode('cont'); {  0x636f6e74  }
+	kAECopy = FourCharCode('copy'); {  0x636f7079  }
+	kAECoreSuite = FourCharCode('core'); {  0x636f7265  }
+	kAECountElements = FourCharCode('cnte'); {  0x636e7465  }
+	kAECreateElement = FourCharCode('crel'); {  0x6372656c  }
+	kAECreatePublisher = FourCharCode('cpub'); {  0x63707562  }
+	kAECut = FourCharCode('cut '); {  0x63757420  }
+	kAEDelete = FourCharCode('delo'); {  0x64656c6f  }
+
+const
+	kAEDoObjectsExist = FourCharCode('doex'); {  0x646f6578  }
+	kAEDoScript = FourCharCode('dosc'); {  0x646f7363  }
+	kAEDrag = FourCharCode('drag'); {  0x64726167  }
+	kAEDuplicateSelection = FourCharCode('sdup'); {  0x73647570  }
+	kAEEditGraphic = FourCharCode('edit'); {  0x65646974  }
+	kAEEmptyTrash = FourCharCode('empt'); {  0x656d7074  }
+	kAEEnd = FourCharCode('end '); {  0x656e6420  }
+	kAEEndsWith = FourCharCode('ends'); {  0x656e6473  }
+	kAEEndTransaction = FourCharCode('endt'); {  0x656e6474  }
+	kAEEquals = FourCharCode('=   '); {  0x3d202020  }
+	kAEExpanded = FourCharCode('pexp'); {  0x70657870  }
+	kAEFast = FourCharCode('fast'); {  0x66617374  }
+	kAEFinderEvents = FourCharCode('FNDR'); {  0x464e4452  }
+	kAEFormulaProtect = FourCharCode('fpro'); {  0x6670726f  }
+	kAEFullyJustified = FourCharCode('full'); {  0x66756c6c  }
+	kAEGetClassInfo = FourCharCode('qobj'); {  0x716f626a  }
+	kAEGetData = FourCharCode('getd'); {  0x67657464  }
+	kAEGetDataSize = FourCharCode('dsiz'); {  0x6473697a  }
+	kAEGetEventInfo = FourCharCode('gtei'); {  0x67746569  }
+	kAEGetInfoSelection = FourCharCode('sinf'); {  0x73696e66  }
+
+const
+	kAEGetPrivilegeSelection = FourCharCode('sprv'); {  0x73707276  }
+	kAEGetSuiteInfo = FourCharCode('gtsi'); {  0x67747369  }
+	kAEGreaterThan = FourCharCode('>   '); {  0x3e202020  }
+	kAEGreaterThanEquals = FourCharCode('>=  '); {  0x3e3d2020  }
+	kAEGrow = FourCharCode('grow'); {  0x67726f77  }
+	kAEHidden = FourCharCode('hidn'); {  0x6869646e  }
+	kAEHiQuality = FourCharCode('hiqu'); {  0x68697175  }
+	kAEImageGraphic = FourCharCode('imgr'); {  0x696d6772  }
+	kAEIsUniform = FourCharCode('isun'); {  0x6973756e  }
+	kAEItalic = FourCharCode('ital'); {  0x6974616c  }
+	kAELeftJustified = FourCharCode('left'); {  0x6c656674  }
+	kAELessThan = FourCharCode('<   '); {  0x3c202020  }
+	kAELessThanEquals = FourCharCode('<=  '); {  0x3c3d2020  }
+	kAELowercase = FourCharCode('lowc'); {  0x6c6f7763  }
+	kAEMakeObjectsVisible = FourCharCode('mvis'); {  0x6d766973  }
+	kAEMiscStandards = FourCharCode('misc'); {  0x6d697363  }
+	kAEModifiable = FourCharCode('modf'); {  0x6d6f6466  }
+	kAEMove = FourCharCode('move'); {  0x6d6f7665  }
+	kAENo = FourCharCode('no  '); {  0x6e6f2020  }
+	kAENoArrow = FourCharCode('arno'); {  0x61726e6f  }
+
+const
+	kAENonmodifiable = FourCharCode('nmod'); {  0x6e6d6f64  }
+	kAEOpen = FourCharCode('odoc'); {  0x6f646f63  }
+	kAEOpenSelection = FourCharCode('sope'); {  0x736f7065  }
+	kAEOutline = FourCharCode('outl'); {  0x6f75746c  }
+	kAEPageSetup = FourCharCode('pgsu'); {  0x70677375  }
+	kAEPaste = FourCharCode('past'); {  0x70617374  }
+	kAEPlain = FourCharCode('plan'); {  0x706c616e  }
+	kAEPrint = FourCharCode('pdoc'); {  0x70646f63  }
+	kAEPrintSelection = FourCharCode('spri'); {  0x73707269  }
+	kAEPrintWindow = FourCharCode('pwin'); {  0x7077696e  }
+	kAEPutAwaySelection = FourCharCode('sput'); {  0x73707574  }
+	kAEQDAddOver = FourCharCode('addo'); {  0x6164646f  }
+	kAEQDAddPin = FourCharCode('addp'); {  0x61646470  }
+	kAEQDAdMax = FourCharCode('admx'); {  0x61646d78  }
+	kAEQDAdMin = FourCharCode('admn'); {  0x61646d6e  }
+	kAEQDBic = FourCharCode('bic '); {  0x62696320  }
+	kAEQDBlend = FourCharCode('blnd'); {  0x626c6e64  }
+	kAEQDCopy = FourCharCode('cpy '); {  0x63707920  }
+	kAEQDNotBic = FourCharCode('nbic'); {  0x6e626963  }
+	kAEQDNotCopy = FourCharCode('ncpy'); {  0x6e637079  }
+
+const
+	kAEQDNotOr = FourCharCode('ntor'); {  0x6e746f72  }
+	kAEQDNotXor = FourCharCode('nxor'); {  0x6e786f72  }
+	kAEQDOr = FourCharCode('or  '); {  0x6f722020  }
+	kAEQDSubOver = FourCharCode('subo'); {  0x7375626f  }
+	kAEQDSubPin = FourCharCode('subp'); {  0x73756270  }
+	kAEQDSupplementalSuite = FourCharCode('qdsp'); {  0x71647370  }
+	kAEQDXor = FourCharCode('xor '); {  0x786f7220  }
+	kAEQuickdrawSuite = FourCharCode('qdrw'); {  0x71647277  }
+	kAEQuitAll = FourCharCode('quia'); {  0x71756961  }
+	kAERedo = FourCharCode('redo'); {  0x7265646f  }
+	kAERegular = FourCharCode('regl'); {  0x7265676c  }
+	kAEReopenApplication = FourCharCode('rapp'); {  0x72617070  }
+	kAEReplace = FourCharCode('rplc'); {  0x72706c63  }
+	kAERequiredSuite = FourCharCode('reqd'); {  0x72657164  }
+	kAERestart = FourCharCode('rest'); {  0x72657374  }
+	kAERevealSelection = FourCharCode('srev'); {  0x73726576  }
+	kAERevert = FourCharCode('rvrt'); {  0x72767274  }
+	kAERightJustified = FourCharCode('rght'); {  0x72676874  }
+	kAESave = FourCharCode('save'); {  0x73617665  }
+	kAESelect = FourCharCode('slct'); {  0x736c6374  }
+	kAESetData = FourCharCode('setd'); {  0x73657464  }
+
+const
+	kAESetPosition = FourCharCode('posn'); {  0x706f736e  }
+	kAEShadow = FourCharCode('shad'); {  0x73686164  }
+	kAEShowClipboard = FourCharCode('shcl'); {  0x7368636c  }
+	kAEShutDown = FourCharCode('shut'); {  0x73687574  }
+	kAESleep = FourCharCode('slep'); {  0x736c6570  }
+	kAESmallCaps = FourCharCode('smcp'); {  0x736d6370  }
+	kAESpecialClassProperties = FourCharCode('c@#!'); {  0x63402321  }
+	kAEStrikethrough = FourCharCode('strk'); {  0x7374726b  }
+	kAESubscript = FourCharCode('sbsc'); {  0x73627363  }
+	kAESuperscript = FourCharCode('spsc'); {  0x73707363  }
+	kAETableSuite = FourCharCode('tbls'); {  0x74626c73  }
+	kAETextSuite = FourCharCode('TEXT'); {  0x54455854  }
+	kAETransactionTerminated = FourCharCode('ttrm'); {  0x7474726d  }
+	kAEUnderline = FourCharCode('undl'); {  0x756e646c  }
+	kAEUndo = FourCharCode('undo'); {  0x756e646f  }
+	kAEWholeWordEquals = FourCharCode('wweq'); {  0x77776571  }
+	kAEYes = FourCharCode('yes '); {  0x79657320  }
+	kAEZoom = FourCharCode('zoom'); {  0x7a6f6f6d  }
+
+{ events that can be sent to the "system" process (eg, loginwindow) on OS X 10.2 or later }
+const
+	kAELogOut = FourCharCode('logo');
+	kAEReallyLogOut = FourCharCode('rlgo');
+	kAEShowRestartDialog = FourCharCode('rrst');
+	kAEShowShutdownDialog = FourCharCode('rsdn');
+
+{ EventRecord Classes and EventIDs }
+const
+	kAEMouseClass = FourCharCode('mous');
+	kAEDown = FourCharCode('down');
+	kAEUp = FourCharCode('up  ');
+	kAEMoved = FourCharCode('move');
+	kAEStoppedMoving = FourCharCode('stop');
+	kAEWindowClass = FourCharCode('wind');
+	kAEUpdate = FourCharCode('updt');
+	kAEActivate = FourCharCode('actv');
+	kAEDeactivate = FourCharCode('dact');
+	kAECommandClass = FourCharCode('cmnd'); { Modern Command Event Class }
+	kAEKeyClass = FourCharCode('keyc');
+	kAERawKey = FourCharCode('rkey'); { Modern Raw Key Event }
+	kAEVirtualKey = FourCharCode('keyc'); { Modern Virtual Key Event }
+	kAENavigationKey = FourCharCode('nave'); { Modern Navigation Key Event }
+	kAEAutoDown = FourCharCode('auto');
+	kAEApplicationClass = FourCharCode('appl');
+	kAESuspend = FourCharCode('susp');
+	kAEResume = FourCharCode('rsme');
+	kAEDiskEvent = FourCharCode('disk');
+	kAENullEvent = FourCharCode('null');
+	kAEWakeUpEvent = FourCharCode('wake');
+	kAEScrapEvent = FourCharCode('scrp');
+	kAEHighLevel = FourCharCode('high');
+
+const
+	keyAEAngle = FourCharCode('kang'); {  0x6b616e67  }
+	keyAEArcAngle = FourCharCode('parc'); {  0x70617263  }
 
+const
+	keyAEBaseAddr = FourCharCode('badd'); {  0x62616464  }
+	keyAEBestType = FourCharCode('pbst'); {  0x70627374  }
+	keyAEBgndColor = FourCharCode('kbcl'); {  0x6b62636c  }
+	keyAEBgndPattern = FourCharCode('kbpt'); {  0x6b627074  }
+	keyAEBounds = FourCharCode('pbnd'); {  0x70626e64  }
+	keyAECellList = FourCharCode('kclt'); {  0x6b636c74  }
+	keyAEClassID = FourCharCode('clID'); {  0x636c4944  }
+	keyAEColor = FourCharCode('colr'); {  0x636f6c72  }
+	keyAEColorTable = FourCharCode('cltb'); {  0x636c7462  }
+	keyAECurveHeight = FourCharCode('kchd'); {  0x6b636864  }
+	keyAECurveWidth = FourCharCode('kcwd'); {  0x6b637764  }
+	keyAEDashStyle = FourCharCode('pdst'); {  0x70647374  }
+	keyAEData = FourCharCode('data'); {  0x64617461  }
+	keyAEDefaultType = FourCharCode('deft'); {  0x64656674  }
+	keyAEDefinitionRect = FourCharCode('pdrt'); {  0x70647274  }
+	keyAEDescType = FourCharCode('dstp'); {  0x64737470  }
+	keyAEDestination = FourCharCode('dest'); {  0x64657374  }
+	keyAEDoAntiAlias = FourCharCode('anta'); {  0x616e7461  }
+	keyAEDoDithered = FourCharCode('gdit'); {  0x67646974  }
+	keyAEDoRotate = FourCharCode('kdrt'); {  0x6b647274  }
+
+const
+	keyAEDoScale = FourCharCode('ksca'); {  0x6b736361  }
+	keyAEDoTranslate = FourCharCode('ktra'); {  0x6b747261  }
+	keyAEEditionFileLoc = FourCharCode('eloc'); {  0x656c6f63  }
+	keyAEElements = FourCharCode('elms'); {  0x656c6d73  }
+	keyAEEndPoint = FourCharCode('pend'); {  0x70656e64  }
+	keyAEEventClass = FourCharCode('evcl'); {  0x6576636c  }
+	keyAEEventID = FourCharCode('evti'); {  0x65767469  }
+	keyAEFile = FourCharCode('kfil'); {  0x6b66696c  }
+	keyAEFileType = FourCharCode('fltp'); {  0x666c7470  }
+	keyAEFillColor = FourCharCode('flcl'); {  0x666c636c  }
+	keyAEFillPattern = FourCharCode('flpt'); {  0x666c7074  }
+	keyAEFlipHorizontal = FourCharCode('kfho'); {  0x6b66686f  }
+	keyAEFlipVertical = FourCharCode('kfvt'); {  0x6b667674  }
+	keyAEFont = FourCharCode('font'); {  0x666f6e74  }
+	keyAEFormula = FourCharCode('pfor'); {  0x70666f72  }
+	keyAEGraphicObjects = FourCharCode('gobs'); {  0x676f6273  }
+	keyAEID = FourCharCode('ID  '); {  0x49442020  }
+	keyAEImageQuality = FourCharCode('gqua'); {  0x67717561  }
+	keyAEInsertHere = FourCharCode('insh'); {  0x696e7368  }
+	keyAEKeyForms = FourCharCode('keyf'); {  0x6b657966  }
+
+const
+	keyAEKeyword = FourCharCode('kywd'); {  0x6b797764  }
+	keyAELevel = FourCharCode('levl'); {  0x6c65766c  }
+	keyAELineArrow = FourCharCode('arro'); {  0x6172726f  }
+	keyAEName = FourCharCode('pnam'); {  0x706e616d  }
+	keyAENewElementLoc = FourCharCode('pnel'); {  0x706e656c  }
+	keyAEObject = FourCharCode('kobj'); {  0x6b6f626a  }
+	keyAEObjectClass = FourCharCode('kocl'); {  0x6b6f636c  }
+	keyAEOffStyles = FourCharCode('ofst'); {  0x6f667374  }
+	keyAEOnStyles = FourCharCode('onst'); {  0x6f6e7374  }
+	keyAEParameters = FourCharCode('prms'); {  0x70726d73  }
+	keyAEParamFlags = FourCharCode('pmfg'); {  0x706d6667  }
+	keyAEPenColor = FourCharCode('ppcl'); {  0x7070636c  }
+	keyAEPenPattern = FourCharCode('pppa'); {  0x70707061  }
+	keyAEPenWidth = FourCharCode('ppwd'); {  0x70707764  }
+	keyAEPixelDepth = FourCharCode('pdpt'); {  0x70647074  }
+	keyAEPixMapMinus = FourCharCode('kpmm'); {  0x6b706d6d  }
+	keyAEPMTable = FourCharCode('kpmt'); {  0x6b706d74  }
+	keyAEPointList = FourCharCode('ptlt'); {  0x70746c74  }
+	keyAEPointSize = FourCharCode('ptsz'); {  0x7074737a  }
+	keyAEPosition = FourCharCode('kpos'); {  0x6b706f73  }
+
+const
+	keyAEPropData = FourCharCode('prdt'); {  0x70726474  }
+	keyAEProperties = FourCharCode('qpro'); {  0x7170726f  }
+	keyAEProperty = FourCharCode('kprp'); {  0x6b707270  }
+	keyAEPropFlags = FourCharCode('prfg'); {  0x70726667  }
+	keyAEPropID = FourCharCode('prop'); {  0x70726f70  }
+	keyAEProtection = FourCharCode('ppro'); {  0x7070726f  }
+	keyAERenderAs = FourCharCode('kren'); {  0x6b72656e  }
+	keyAERequestedType = FourCharCode('rtyp'); {  0x72747970  }
+	keyAEResult = FourCharCode('----'); {  0x2d2d2d2d  }
+	keyAEResultInfo = FourCharCode('rsin'); {  0x7273696e  }
+	keyAERotation = FourCharCode('prot'); {  0x70726f74  }
+	keyAERotPoint = FourCharCode('krtp'); {  0x6b727470  }
+	keyAERowList = FourCharCode('krls'); {  0x6b726c73  }
+	keyAESaveOptions = FourCharCode('savo'); {  0x7361766f  }
+	keyAEScale = FourCharCode('pscl'); {  0x7073636c  }
+	keyAEScriptTag = FourCharCode('psct'); {  0x70736374  }
+	keyAESearchText = FourCharCode('stxt'); {  0x73747874  }
+	keyAEShowWhere = FourCharCode('show'); {  0x73686f77  }
+	keyAEStartAngle = FourCharCode('pang'); {  0x70616e67  }
+	keyAEStartPoint = FourCharCode('pstp'); {  0x70737470  }
+	keyAEStyles = FourCharCode('ksty'); {  0x6b737479  }
+
+const
+	keyAESuiteID = FourCharCode('suit'); {  0x73756974  }
+	keyAEText = FourCharCode('ktxt'); {  0x6b747874  }
+	keyAETextColor = FourCharCode('ptxc'); {  0x70747863  }
+	keyAETextFont = FourCharCode('ptxf'); {  0x70747866  }
+	keyAETextPointSize = FourCharCode('ptps'); {  0x70747073  }
+	keyAETextStyles = FourCharCode('txst'); {  0x74787374  }
+	keyAETextLineHeight = FourCharCode('ktlh'); { type ShortInteger }
+	keyAETextLineAscent = FourCharCode('ktas'); { type ShortInteger }
+	keyAETheText = FourCharCode('thtx'); {  0x74687478  }
+	keyAETransferMode = FourCharCode('pptm'); {  0x7070746d  }
+	keyAETranslation = FourCharCode('ptrs'); {  0x70747273  }
+	keyAETryAsStructGraf = FourCharCode('toog'); {  0x746f6f67  }
+	keyAEUniformStyles = FourCharCode('ustl'); {  0x7573746c  }
+	keyAEUpdateOn = FourCharCode('pupd'); {  0x70757064  }
+	keyAEUserTerm = FourCharCode('utrm'); {  0x7574726d  }
+	keyAEWindow = FourCharCode('wndw'); {  0x776e6477  }
+	keyAEWritingCode = FourCharCode('wrcd'); {  0x77726364  }
+
+const
+	keyMiscellaneous = FourCharCode('fmsc'); {  0x666d7363  }
+	keySelection = FourCharCode('fsel'); {  0x6673656c  }
+	keyWindow = FourCharCode('kwnd'); {  0x6b776e64  }
+                                        { EventRecord keys }
+	keyWhen = FourCharCode('when');
+	keyWhere = FourCharCode('wher');
+	keyModifiers = FourCharCode('mods');
+	keyKey = FourCharCode('key ');
+	keyKeyCode = FourCharCode('code');
+	keyKeyboard = FourCharCode('keyb');
+	keyDriveNumber = FourCharCode('drv#');
+	keyErrorCode = FourCharCode('err#');
+	keyHighLevelClass = FourCharCode('hcls');
+	keyHighLevelID = FourCharCode('hid ');
+
+const
+	pArcAngle = FourCharCode('parc'); {  0x70617263  }
+	pBackgroundColor = FourCharCode('pbcl'); {  0x7062636c  }
+	pBackgroundPattern = FourCharCode('pbpt'); {  0x70627074  }
+	pBestType = FourCharCode('pbst'); {  0x70627374  }
+	pBounds = FourCharCode('pbnd'); {  0x70626e64  }
+	pClass = FourCharCode('pcls'); {  0x70636c73  }
+	pClipboard = FourCharCode('pcli'); {  0x70636c69  }
+	pColor = FourCharCode('colr'); {  0x636f6c72  }
+	pColorTable = FourCharCode('cltb'); {  0x636c7462  }
+	pContents = FourCharCode('pcnt'); {  0x70636e74  }
+	pCornerCurveHeight = FourCharCode('pchd'); {  0x70636864  }
+	pCornerCurveWidth = FourCharCode('pcwd'); {  0x70637764  }
+	pDashStyle = FourCharCode('pdst'); {  0x70647374  }
+	pDefaultType = FourCharCode('deft'); {  0x64656674  }
+	pDefinitionRect = FourCharCode('pdrt'); {  0x70647274  }
+	pEnabled = FourCharCode('enbl'); {  0x656e626c  }
+	pEndPoint = FourCharCode('pend'); {  0x70656e64  }
+	pFillColor = FourCharCode('flcl'); {  0x666c636c  }
+	pFillPattern = FourCharCode('flpt'); {  0x666c7074  }
+	pFont = FourCharCode('font'); {  0x666f6e74  }
+
+const
+	pFormula = FourCharCode('pfor'); {  0x70666f72  }
+	pGraphicObjects = FourCharCode('gobs'); {  0x676f6273  }
+	pHasCloseBox = FourCharCode('hclb'); {  0x68636c62  }
+	pHasTitleBar = FourCharCode('ptit'); {  0x70746974  }
+	pID = FourCharCode('ID  '); {  0x49442020  }
+	pIndex = FourCharCode('pidx'); {  0x70696478  }
+	pInsertionLoc = FourCharCode('pins'); {  0x70696e73  }
+	pIsFloating = FourCharCode('isfl'); {  0x6973666c  }
+	pIsFrontProcess = FourCharCode('pisf'); {  0x70697366  }
+	pIsModal = FourCharCode('pmod'); {  0x706d6f64  }
+	pIsModified = FourCharCode('imod'); {  0x696d6f64  }
+	pIsResizable = FourCharCode('prsz'); {  0x7072737a  }
+	pIsStationeryPad = FourCharCode('pspd'); {  0x70737064  }
+	pIsZoomable = FourCharCode('iszm'); {  0x69737a6d  }
+	pIsZoomed = FourCharCode('pzum'); {  0x707a756d  }
+	pItemNumber = FourCharCode('itmn'); {  0x69746d6e  }
+	pJustification = FourCharCode('pjst'); {  0x706a7374  }
+	pLineArrow = FourCharCode('arro'); {  0x6172726f  }
+	pMenuID = FourCharCode('mnid'); {  0x6d6e6964  }
+	pName = FourCharCode('pnam'); {  0x706e616d  }
+
+const
+	pNewElementLoc = FourCharCode('pnel'); {  0x706e656c  }
+	pPenColor = FourCharCode('ppcl'); {  0x7070636c  }
+	pPenPattern = FourCharCode('pppa'); {  0x70707061  }
+	pPenWidth = FourCharCode('ppwd'); {  0x70707764  }
+	pPixelDepth = FourCharCode('pdpt'); {  0x70647074  }
+	pPointList = FourCharCode('ptlt'); {  0x70746c74  }
+	pPointSize = FourCharCode('ptsz'); {  0x7074737a  }
+	pProtection = FourCharCode('ppro'); {  0x7070726f  }
+	pRotation = FourCharCode('prot'); {  0x70726f74  }
+	pScale = FourCharCode('pscl'); {  0x7073636c  }
+	pScript = FourCharCode('scpt'); {  0x73637074  }
+	pScriptTag = FourCharCode('psct'); {  0x70736374  }
+	pSelected = FourCharCode('selc'); {  0x73656c63  }
+	pSelection = FourCharCode('sele'); {  0x73656c65  }
+	pStartAngle = FourCharCode('pang'); {  0x70616e67  }
+	pStartPoint = FourCharCode('pstp'); {  0x70737470  }
+	pTextColor = FourCharCode('ptxc'); {  0x70747863  }
+	pTextFont = FourCharCode('ptxf'); {  0x70747866  }
+	pTextItemDelimiters = FourCharCode('txdl'); {  0x7478646c  }
+	pTextPointSize = FourCharCode('ptps'); {  0x70747073  }
+
+const
+	pTextStyles = FourCharCode('txst'); {  0x74787374  }
+	pTransferMode = FourCharCode('pptm'); {  0x7070746d  }
+	pTranslation = FourCharCode('ptrs'); {  0x70747273  }
+	pUniformStyles = FourCharCode('ustl'); {  0x7573746c  }
+	pUpdateOn = FourCharCode('pupd'); {  0x70757064  }
+	pUserSelection = FourCharCode('pusl'); {  0x7075736c  }
+	pVersion = FourCharCode('vers'); {  0x76657273  }
+	pVisible = FourCharCode('pvis'); {  0x70766973  }
+
+const
+	typeAEText = FourCharCode('tTXT'); {  0x74545854  }
+	typeArc = FourCharCode('carc'); {  0x63617263  }
+	typeBest = FourCharCode('best'); {  0x62657374  }
+	typeCell = FourCharCode('ccel'); {  0x6363656c  }
+	typeClassInfo = FourCharCode('gcli'); {  0x67636c69  }
+	typeColorTable = FourCharCode('clrt'); {  0x636c7274  }
+	typeColumn = FourCharCode('ccol'); {  0x63636f6c  }
+	typeDashStyle = FourCharCode('tdas'); {  0x74646173  }
+	typeData = FourCharCode('tdta'); {  0x74647461  }
+	typeDrawingArea = FourCharCode('cdrw'); {  0x63647277  }
+	typeElemInfo = FourCharCode('elin'); {  0x656c696e  }
+	typeEnumeration = FourCharCode('enum'); {  0x656e756d  }
+	typeEPS = FourCharCode('EPS '); {  0x45505320  }
+	typeEventInfo = FourCharCode('evin'); {  0x6576696e  }
+
+const
+	typeFinderWindow = FourCharCode('fwin'); {  0x6677696e  }
+	typeFixedPoint = FourCharCode('fpnt'); {  0x66706e74  }
+	typeFixedRectangle = FourCharCode('frct'); {  0x66726374  }
+	typeGraphicLine = FourCharCode('glin'); {  0x676c696e  }
+	typeGraphicText = FourCharCode('cgtx'); {  0x63677478  }
+	typeGroupedGraphic = FourCharCode('cpic'); {  0x63706963  }
+	typeInsertionLoc = FourCharCode('insl'); {  0x696e736c  }
+	typeIntlText = FourCharCode('itxt'); {  0x69747874  }
+	typeIntlWritingCode = FourCharCode('intl'); {  0x696e746c  }
+	typeLongDateTime = FourCharCode('ldt '); {  0x6c647420  }
+	typeCFAbsoluteTime = FourCharCode('cfat');
+	typeISO8601DateTime = FourCharCode('isot'); {  0x69736f74  data is ascii text of an ISO8601 date }
+	typeLongFixed = FourCharCode('lfxd'); {  0x6c667864  }
+	typeLongFixedPoint = FourCharCode('lfpt'); {  0x6c667074  }
+	typeLongFixedRectangle = FourCharCode('lfrc'); {  0x6c667263  }
+	typeLongPoint = FourCharCode('lpnt'); {  0x6c706e74  }
+	typeLongRectangle = FourCharCode('lrct'); {  0x6c726374  }
+	typeMachineLoc = FourCharCode('mLoc'); {  0x6d4c6f63  }
+	typeOval = FourCharCode('covl'); {  0x636f766c  }
+	typeParamInfo = FourCharCode('pmin'); {  0x706d696e  }
+	typePict = FourCharCode('PICT'); {  0x50494354  }
+
+const
+	typePixelMap = FourCharCode('cpix'); {  0x63706978  }
+	typePixMapMinus = FourCharCode('tpmm'); {  0x74706d6d  }
+	typePolygon = FourCharCode('cpgn'); {  0x6370676e  }
+	typePropInfo = FourCharCode('pinf'); {  0x70696e66  }
+	typePtr = FourCharCode('ptr '); {  0x70747220  }
+	typeQDPoint = FourCharCode('QDpt'); {  0x51447074  }
+	typeQDRegion = FourCharCode('Qrgn'); {  0x51447074  (data is actual region data, including rectangle and size, _not_ region handle or ptr)}
+	typeRectangle = FourCharCode('crec'); {  0x63726563  }
+	typeRGB16 = FourCharCode('tr16'); {  0x74723136  }
+	typeRGB96 = FourCharCode('tr96'); {  0x74723936  }
+	typeRGBColor = FourCharCode('cRGB'); {  0x63524742  }
+	typeRotation = FourCharCode('trot'); {  0x74726f74  }
+	typeRoundedRectangle = FourCharCode('crrc'); {  0x63727263  }
+	typeRow = FourCharCode('crow'); {  0x63726f77  }
+	typeScrapStyles = FourCharCode('styl'); {  0x7374796c  }
+	typeScript = FourCharCode('scpt'); {  0x73637074  }
+	typeStyledText = FourCharCode('STXT'); {  0x53545854  }
+	typeSuiteInfo = FourCharCode('suin'); {  0x7375696e  }
+	typeTable = FourCharCode('ctbl'); {  0x6374626c  }
+	typeTextStyles = FourCharCode('tsty'); {  0x74737479  }
+
+const
+	typeTIFF = FourCharCode('TIFF'); {  0x54494646  }
+	typeJPEG = FourCharCode('JPEG');
+	typeGIF = FourCharCode('GIFf');
+	typeVersion = FourCharCode('vers'); {  0x76657273  }
+
+const
+	kAEMenuClass = FourCharCode('menu');
+	kAEMenuSelect = FourCharCode('mhit');
+	kAEMouseDown = FourCharCode('mdwn');
+	kAEMouseDownInBack = FourCharCode('mdbk');
+	kAEKeyDown = FourCharCode('kdwn');
+	kAEResized = FourCharCode('rsiz');
+	kAEPromise = FourCharCode('prom');
+
+const
+	keyMenuID = FourCharCode('mid ');
+	keyMenuItem = FourCharCode('mitm');
+	keyCloseAllWindows = FourCharCode('caw ');
+	keyOriginalBounds = FourCharCode('obnd');
+	keyNewBounds = FourCharCode('nbnd');
+	keyLocalWhere = FourCharCode('lwhr');
+
+const
+	typeHIMenu = FourCharCode('mobj');
+	typeHIWindow = FourCharCode('wobj');
+
+const
+	kAEQuitReason = FourCharCode('why?'); { in a kAEQuitApplication event, this property if present is the reason the quit is being sent.  The possible values are kAEQuitAll, kAEShutDown, kAERestart, kAEReallyLogOut }
+
+const
+	kBySmallIcon = 0;
+	kByIconView = 1;
+	kByNameView = 2;
+	kByDateView = 3;
+	kBySizeView = 4;
+	kByKindView = 5;
+	kByCommentView = 6;
+	kByLabelView = 7;
+	kByVersionView = 8;
+
+const
+	kAEInfo = 11;
+	kAEMain = 0;
+	kAESharing = 13;
+
+const
+	kAEZoomIn = 7;
+	kAEZoomOut = 8;
+
+const
+	kTextServiceClass = FourCharCode('tsvc');
+	kUpdateActiveInputArea = FourCharCode('updt'); { update the active input area }
+	kShowHideInputWindow = FourCharCode('shiw'); { show or hide the input window }
+	kPos2Offset = FourCharCode('p2st'); { converting global coordinates to char position }
+	kOffset2Pos = FourCharCode('st2p'); { converting char position to global coordinates }
+	kUnicodeNotFromInputMethod = FourCharCode('unim'); { Unicode text when event not handled by Input Method or no Input Method }
+	kGetSelectedText = FourCharCode('gtxt'); { Get text for current selection }
+	keyAETSMDocumentRefcon = FourCharCode('refc'); { TSM document refcon, typeLongInteger }
+	keyAEServerInstance = FourCharCode('srvi'); { component instance }
+	keyAETheData = FourCharCode('kdat'); { typeText }
+	keyAEFixLength = FourCharCode('fixl'); { fix len }
+	keyAEUpdateRange = FourCharCode('udng'); { typeTextRangeArray }
+	keyAECurrentPoint = FourCharCode('cpos'); { current point }
+	keyAEBufferSize = FourCharCode('buff'); { buffer size to get the text }
+	keyAEMoveView = FourCharCode('mvvw'); { move view flag }
+	keyAENextBody = FourCharCode('nxbd'); { next or previous body }
+	keyAETSMScriptTag = FourCharCode('sclg');
+	keyAETSMTextFont = FourCharCode('ktxf'); { FMFontFamily or FOND ID }
+	keyAETSMTextFMFont = FourCharCode('ktxm'); { FMFont }
+	keyAETSMTextPointSize = FourCharCode('ktps');
+	keyAETSMEventRecord = FourCharCode('tevt'); { Low level Event Record, typeLowLevelEventRecord }
+	keyAETSMEventRef = FourCharCode('tevr'); { Carbon EventRef, typeEventRef }
+	keyAETextServiceEncoding = FourCharCode('tsen'); { Text Service encoding, mac or Unicode in UpdateActiveInputArea or GetSelectedText events. }
+	keyAETextServiceMacEncoding = FourCharCode('tmen'); { Target mac encoding for TSM conversion of text from Unicode text service. }
+	keyAETSMGlyphInfoArray = FourCharCode('tgia'); { typeGlyphInfoArray }
+	typeTextRange = FourCharCode('txrn'); { TextRange }
+	typeComponentInstance = FourCharCode('cmpi'); { server instance }
+	typeOffsetArray = FourCharCode('ofay'); { offset array }
+	typeTextRangeArray = FourCharCode('tray');
+	typeLowLevelEventRecord = FourCharCode('evtr'); { Low Level Event Record }
+	typeGlyphInfoArray = FourCharCode('glia'); { Glyph/FMFont info array for sub ranges of Unicode text.  See GlyphInfoArray in TextServices.h  }
+	typeEventRef = FourCharCode('evrf'); { Carbon EventRef }
+	typeText = typeChar; { Plain text }
+
+
+{ Desc type constants }
+const
+	kTSMOutsideOfBody = 1;
+	kTSMInsideOfBody = 2;
+	kTSMInsideOfActiveInputArea = 3;
+
+const
+	kNextBody = 1;
+	kPreviousBody = 2;
 
 type
-	TextRangePtr = ^TextRange;
 	TextRange = record
-		fStart:					SInt32;
-		fEnd:					SInt32;
-		fHiliteStyle:			SInt16;
+		fStart: SInt32;
+		fEnd: SInt32;
+		fHiliteStyle: SInt16;
 	end;
-
-	TextRangeHandle						= ^TextRangePtr;
-	TextRangeArrayPtr = ^TextRangeArray;
+	TextRangePtr = ^TextRange;
+type
+	TextRangeHandle = ^TextRangePtr;
 	TextRangeArray = record
-		fNumOfRanges:			SInt16;								{  specify the size of the fRange array  }
-		fRange:					array [0..0] of TextRange;				{  when fNumOfRanges > 1, the size of this array has to be calculated  }
+		fNumOfRanges: SInt16;           { specify the size of the fRange array }
+		fRange: array [0..0] of TextRange;              { when fNumOfRanges > 1, the size of this array has to be calculated }
 	end;
-
-	TextRangeArrayHandle				= ^TextRangeArrayPtr;
-	OffsetArrayPtr = ^OffsetArray;
+	TextRangeArrayPtr = ^TextRangeArray;
+type
+	TextRangeArrayHandle = ^TextRangeArrayPtr;
 	OffsetArray = record
-		fNumOfOffsets:			SInt16;								{  specify the size of the fOffset array  }
-		fOffset:				array [0..0] of SInt32;				{  when fNumOfOffsets > 1, the size of this array has to be calculated  }
+		fNumOfOffsets: SInt16;          { specify the size of the fOffset array }
+		fOffset: array [0..0] of SInt32;             { when fNumOfOffsets > 1, the size of this array has to be calculated }
 	end;
-
-	OffsetArrayHandle					= ^OffsetArrayPtr;
-	WritingCodePtr = ^WritingCode;
+	OffsetArrayPtr = ^OffsetArray;
+type
+	OffsetArrayHandle = ^OffsetArrayPtr;
 	WritingCode = record
-		theScriptCode:			ScriptCode;
-		theLangCode:			LangCode;
+		theScriptCode: ScriptCode;
+		theLangCode: LangCode;
 	end;
-
-	IntlTextPtr = ^IntlText;
+	WritingCodePtr = ^WritingCode;
+type
 	IntlText = record
-		theScriptCode:			ScriptCode;
-		theLangCode:			LangCode;
-		theText:				SInt8;									{  variable length data  }
+		theScriptCode: ScriptCode;
+		theLangCode: LangCode;
+		theText: SInt8;             { variable length data }
 	end;
+	IntlTextPtr = ^IntlText;
 
-
-	{	 Hilite styles 	}
-
+{ Hilite styles }
 const
-	kTSMHiliteCaretPosition     = 1;    { specify caret position }
-	kTSMHiliteRawText           = 2;    { specify range of raw text }
-	kTSMHiliteSelectedRawText   = 3;    { specify range of selected raw text }
-	kTSMHiliteConvertedText     = 4;    { specify range of converted text }
+	kTSMHiliteCaretPosition = 1;    { specify caret position }
+	kTSMHiliteRawText = 2;    { specify range of raw text }
+	kTSMHiliteSelectedRawText = 3;    { specify range of selected raw text }
+	kTSMHiliteConvertedText = 4;    { specify range of converted text }
 	kTSMHiliteSelectedConvertedText = 5;  { specify range of selected converted text }
-	kTSMHiliteBlockFillText     = 6;    { Block Fill hilite style }
-	kTSMHiliteOutlineText       = 7;    { Outline hilite style }
-	kTSMHiliteSelectedText      = 8;    { Selected hilite style }
-	kTSMHiliteNoHilite          = 9;     { specify range of non-hilited text }
+	kTSMHiliteBlockFillText = 6;    { Block Fill hilite style }
+	kTSMHiliteOutlineText = 7;    { Outline hilite style }
+	kTSMHiliteSelectedText = 8;    { Selected hilite style }
+	kTSMHiliteNoHilite = 9;     { specify range of non-hilited text }
+
 
 {$ifc OLDROUTINENAMES}
 { Hilite styles }
 const
-	kCaretPosition             = kTSMHiliteCaretPosition;
-	kRawText                   = kTSMHiliteRawText;
-	kSelectedRawText           = kTSMHiliteSelectedRawText;
-	kConvertedText             = kTSMHiliteConvertedText;
-	kSelectedConvertedText     = kTSMHiliteSelectedConvertedText;
-	kBlockFillText             = kTSMHiliteBlockFillText;
-	kOutlineText               = kTSMHiliteOutlineText;
-	kSelectedText              = kTSMHiliteSelectedText;
+	kCaretPosition = kTSMHiliteCaretPosition;
+	kRawText = kTSMHiliteRawText;
+	kSelectedRawText = kTSMHiliteSelectedRawText;
+	kConvertedText = kTSMHiliteConvertedText;
+	kSelectedConvertedText = kTSMHiliteSelectedConvertedText;
+	kBlockFillText = kTSMHiliteBlockFillText;
+	kOutlineText = kTSMHiliteOutlineText;
+	kSelectedText = kTSMHiliteSelectedText;
 
 {$endc}  {OLDROUTINENAMES}
 
-
-	keyAEHiliteRange			= FourCharCode('hrng');						{  typeTextRangeArray for System 7, typeHiliteRangeArray for System 8  }
-	keyAEPinRange				= FourCharCode('pnrg');						{  typeTextRange for System 7, typeTextRegionRange for System 8    }
-	keyAEClauseOffsets			= FourCharCode('clau');						{  typeOffsetArray for System 7, typeClauseOffsetArray for System 8  }
-	keyAEOffset					= FourCharCode('ofst');						{  typeLongInteger for System 7, typeByteOffset for System 8   }
-	keyAEPoint					= FourCharCode('gpos');						{  typePoint for System 7, typeQDPoint for System 8  }
-	keyAELeftSide				= FourCharCode('klef');						{  typeBoolean  }
-	keyAERegionClass			= FourCharCode('rgnc');						{  typeShortInteger for System 7, typeRegionClass for System 8  }
-	keyAEDragging				= FourCharCode('bool');						{  typeBoolean  }
+const
+	keyAEHiliteRange = FourCharCode('hrng'); { typeTextRangeArray for System 7, typeHiliteRangeArray for System 8 }
+	keyAEPinRange = FourCharCode('pnrg'); { typeTextRange for System 7, typeTextRegionRange for System 8   }
+	keyAEClauseOffsets = FourCharCode('clau'); { typeOffsetArray for System 7, typeClauseOffsetArray for System 8 }
+	keyAEOffset = FourCharCode('ofst'); { typeLongInteger for System 7, typeByteOffset for System 8  }
+	keyAEPoint = FourCharCode('gpos'); { typePoint for System 7, typeQDPoint for System 8 }
+	keyAELeftSide = FourCharCode('klef'); { typeBoolean }
+	keyAERegionClass = FourCharCode('rgnc'); { typeShortInteger for System 7, typeRegionClass for System 8 }
+	keyAEDragging = FourCharCode('bool'); { typeBoolean }
 
 
 {$ifc OLDROUTINENAMES}
-	keyAELeadingEdge			= FourCharCode('klef');
+const
+	keyAELeadingEdge = keyAELeftSide;
 
 {$endc}  {OLDROUTINENAMES}
 
-																{  AppleScript 1.3: New Text types  }
-{
- * The following descriptor types are deprecated due to their lack of
- * explicit encoding or byte order definition.  Please use
- * typeUTF16ExternalRepresentation or typeUTF8Text instead. }
-
-	typeUnicodeText				= FourCharCode('utxt'); { native byte ordering, optional BOM 
-	typeStyledUnicodeText		= FourCharCode('sutx'); { Not implemented }
-	typeEncodedString			= FourCharCode('encs'); { Not implemented }
-	typeCString					= FourCharCode('cstr'); { MacRoman characters followed by a NULL byte }
-	typePString					= FourCharCode('pstr'); { Unsigned length byte followed by MacRoman characters }
-
-																{  AppleScript 1.3: Unit types  }
-	typeMeters					= FourCharCode('metr');						{  Base Unit  }
-	typeInches					= FourCharCode('inch');
-	typeFeet					= FourCharCode('feet');
-	typeYards					= FourCharCode('yard');
-	typeMiles					= FourCharCode('mile');
-	typeKilometers				= FourCharCode('kmtr');
-	typeCentimeters				= FourCharCode('cmtr');
-	typeSquareMeters			= FourCharCode('sqrm');						{  Base Unit  }
-	typeSquareFeet				= FourCharCode('sqft');
-	typeSquareYards				= FourCharCode('sqyd');
-	typeSquareMiles				= FourCharCode('sqmi');
-	typeSquareKilometers		= FourCharCode('sqkm');
-	typeLiters					= FourCharCode('litr');						{  Base Unit  }
-	typeQuarts					= FourCharCode('qrts');
-	typeGallons					= FourCharCode('galn');
-	typeCubicMeters				= FourCharCode('cmet');						{  Base Unit  }
-	typeCubicFeet				= FourCharCode('cfet');
-	typeCubicInches				= FourCharCode('cuin');
-	typeCubicCentimeter			= FourCharCode('ccmt');
-	typeCubicYards				= FourCharCode('cyrd');
-	typeKilograms				= FourCharCode('kgrm');						{  Base Unit  }
-	typeGrams					= FourCharCode('gram');
-	typeOunces					= FourCharCode('ozs ');
-	typePounds					= FourCharCode('lbs ');
-	typeDegreesC				= FourCharCode('degc');						{  Base Unit  }
-	typeDegreesF				= FourCharCode('degf');
-	typeDegreesK				= FourCharCode('degk');
-
-																{  AppleScript 1.3: Folder Actions  }
-	kFAServerApp				= FourCharCode('ssrv');						{  Creator code for Folder Actions Server }
-	kDoFolderActionEvent		= FourCharCode('fola');						{  Event the Finder sends to the Folder Actions FBA }
-	kFolderActionCode			= FourCharCode('actn');						{  Parameter that contains the Folder Action }
-	kFolderOpenedEvent			= FourCharCode('fopn');						{  Value of kFolderActionCode parameter; sent to script as event }
-	kFolderClosedEvent			= FourCharCode('fclo');
-	kFolderWindowMovedEvent		= FourCharCode('fsiz');
-	kFolderItemsAddedEvent		= FourCharCode('fget');
-	kFolderItemsRemovedEvent	= FourCharCode('flos');
-	kItemList					= FourCharCode('flst');						{  List parameter for added and removed items }
-	kNewSizeParameter			= FourCharCode('fnsz');						{  Parameter for moved window }
-	kFASuiteCode				= FourCharCode('faco');						{  Suite code for the following events }
-	kFAAttachCommand			= FourCharCode('atfa');						{  Attach event id }
-	kFARemoveCommand			= FourCharCode('rmfa');						{  Remove event id }
-	kFAEditCommand				= FourCharCode('edfa');						{  Edit event id }
-	kFAFileParam				= FourCharCode('faal');						{  Key for file parameter for Attach }
-	kFAIndexParam				= FourCharCode('indx');						{  Key for index (0-based) parameter for Remove and Edit }
-
-	{	 AppleScript 1.3 Internet Suite 	}
-																{  Suite code  }
-	kAEInternetSuite			= FourCharCode('gurl');
-	kAEISWebStarSuite			= FourCharCode('WWW½');
-
-																{  Events  }
-	kAEISGetURL					= FourCharCode('gurl');
-	KAEISHandleCGI				= FourCharCode('sdoc');
-
-																{  Classes  }
-	cURL						= FourCharCode('url ');
-	cInternetAddress			= FourCharCode('IPAD');
-	cHTML						= FourCharCode('html');
-	cFTPItem					= FourCharCode('ftp ');
-
-																{  Parameters  }
-	kAEISHTTPSearchArgs			= FourCharCode('kfor');
-	kAEISPostArgs				= FourCharCode('post');
-	kAEISMethod					= FourCharCode('meth');
-	kAEISClientAddress			= FourCharCode('addr');
-	kAEISUserName				= FourCharCode('user');
-	kAEISPassword				= FourCharCode('pass');
-	kAEISFromUser				= FourCharCode('frmu');
-	kAEISServerName				= FourCharCode('svnm');
-	kAEISServerPort				= FourCharCode('svpt');
-	kAEISScriptName				= FourCharCode('scnm');
-	kAEISContentType			= FourCharCode('ctyp');
-	kAEISReferrer				= FourCharCode('refr');
-	kAEISUserAgent				= FourCharCode('Agnt');
-	kAEISAction					= FourCharCode('Kact');
-	kAEISActionPath				= FourCharCode('Kapt');
-	kAEISClientIP				= FourCharCode('Kcip');
-	kAEISFullRequest			= FourCharCode('Kfrq');
-
-																{  Properties  }
-	pScheme						= FourCharCode('pusc');
-	pHost						= FourCharCode('HOST');
-	pPath						= FourCharCode('FTPc');
-	pUserName					= FourCharCode('RAun');
-	pUserPassword				= FourCharCode('RApw');
-	pDNSForm					= FourCharCode('pDNS');
-	pURL						= FourCharCode('pURL');
-	pTextEncoding				= FourCharCode('ptxe');
-	pFTPKind					= FourCharCode('kind');
-
-																{  Scheme enumerations  }
-	eScheme						= FourCharCode('esch');
-	eurlHTTP					= FourCharCode('http');						{  RFC 2068  }
-	eurlHTTPS					= FourCharCode('htps');
-	eurlFTP						= FourCharCode('ftp ');						{  RFC 1738  }
-	eurlMail					= FourCharCode('mail');						{  RFC 2638  }
-	eurlFile					= FourCharCode('file');						{  RFC 1738  }
-	eurlGopher					= FourCharCode('gphr');						{  RFC 1738  }
-	eurlTelnet					= FourCharCode('tlnt');						{  RFC 1738  }
-	eurlNews					= FourCharCode('news');						{  RFC 1738  }
-	eurlSNews					= FourCharCode('snws');
-	eurlNNTP					= FourCharCode('nntp');						{  RFC 1738  }
-	eurlMessage					= FourCharCode('mess');
-	eurlMailbox					= FourCharCode('mbox');
-	eurlMulti					= FourCharCode('mult');
-	eurlLaunch					= FourCharCode('laun');
-	eurlAFP						= FourCharCode('afp ');
-	eurlAT						= FourCharCode('at  ');
-	eurlEPPC					= FourCharCode('eppc');
-	eurlRTSP					= FourCharCode('rtsp');						{  RFC 2326  }
-	eurlIMAP					= FourCharCode('imap');						{  RFC 2192  }
-	eurlNFS						= FourCharCode('unfs');						{  RFC 2224  }
-	eurlPOP						= FourCharCode('upop');						{  RFC 2384  }
-	eurlLDAP					= FourCharCode('uldp');						{  RFC 2255  }
-	eurlUnknown					= FourCharCode('url?');
-
-																{  AppleScript 1.3: Connectivity Suite in aeut  }
-	kConnSuite					= FourCharCode('macc');
-	cDevSpec					= FourCharCode('cdev');
-	cAddressSpec				= FourCharCode('cadr');
-	cADBAddress					= FourCharCode('cadb');
-	cAppleTalkAddress			= FourCharCode('cat ');
-	cBusAddress					= FourCharCode('cbus');
-	cEthernetAddress			= FourCharCode('cen ');
-	cFireWireAddress			= FourCharCode('cfw ');
-	cIPAddress					= FourCharCode('cip ');
-	cLocalTalkAddress			= FourCharCode('clt ');
-	cSCSIAddress				= FourCharCode('cscs');
-	cTokenRingAddress			= FourCharCode('ctok');
-	cUSBAddress					= FourCharCode('cusb');						{   }
-																{  Properties  }
-	pDeviceType					= FourCharCode('pdvt');
-	pDeviceAddress				= FourCharCode('pdva');
-	pConduit					= FourCharCode('pcon');
-	pProtocol					= FourCharCode('pprt');						{  cde 4/27/98 was 'ppro' conflicted with DB suite  }
-	pATMachine					= FourCharCode('patm');
-	pATZone						= FourCharCode('patz');
-	pATType						= FourCharCode('patt');
-	pDottedDecimal				= FourCharCode('pipd');
-	pDNS						= FourCharCode('pdns');
-	pPort						= FourCharCode('ppor');
-	pNetwork					= FourCharCode('pnet');
-	pNode						= FourCharCode('pnod');
-	pSocket						= FourCharCode('psoc');
-	pSCSIBus					= FourCharCode('pscb');
-	pSCSILUN					= FourCharCode('pslu');						{  cde 5/22/98 per WWDC developer request  }
-																{  Enumerations and enumerators  }
-	eDeviceType					= FourCharCode('edvt');
-	eAddressSpec				= FourCharCode('eads');
-	eConduit					= FourCharCode('econ');
-	eProtocol					= FourCharCode('epro');
-	eADB						= FourCharCode('eadb');
-	eAnalogAudio				= FourCharCode('epau');
-	eAppleTalk					= FourCharCode('epat');
-	eAudioLineIn				= FourCharCode('ecai');
-	eAudioLineOut				= FourCharCode('ecal');						{  cde 4/24/98 changed from 'ecao' to not conflict  }
-	eAudioOut					= FourCharCode('ecao');
-	eBus						= FourCharCode('ebus');
-	eCDROM						= FourCharCode('ecd ');
-	eCommSlot					= FourCharCode('eccm');
-	eDigitalAudio				= FourCharCode('epda');
-	eDisplay					= FourCharCode('edds');
-	eDVD						= FourCharCode('edvd');
-	eEthernet					= FourCharCode('ecen');
-	eFireWire					= FourCharCode('ecfw');
-	eFloppy						= FourCharCode('efd ');
-	eHD							= FourCharCode('ehd ');
-	eInfrared					= FourCharCode('ecir');
-	eIP							= FourCharCode('epip');
-	eIrDA						= FourCharCode('epir');
-	eIRTalk						= FourCharCode('epit');
-	eKeyboard					= FourCharCode('ekbd');
-	eLCD						= FourCharCode('edlc');
-	eLocalTalk					= FourCharCode('eclt');
-	eMacIP						= FourCharCode('epmi');
-	eMacVideo					= FourCharCode('epmv');
-	eMicrophone					= FourCharCode('ecmi');
-	eModemPort					= FourCharCode('ecmp');
-	eModemPrinterPort			= FourCharCode('empp');
-	eModem						= FourCharCode('edmm');
-	eMonitorOut					= FourCharCode('ecmn');
-	eMouse						= FourCharCode('emou');
-	eNuBusCard					= FourCharCode('ednb');
-	eNuBus						= FourCharCode('enub');
-	ePCcard						= FourCharCode('ecpc');
-	ePCIbus						= FourCharCode('ecpi');
-	ePCIcard					= FourCharCode('edpi');
-	ePDSslot					= FourCharCode('ecpd');
-	ePDScard					= FourCharCode('epds');
-	ePointingDevice				= FourCharCode('edpd');
-	ePostScript					= FourCharCode('epps');
-	ePPP						= FourCharCode('eppp');
-	ePrinterPort				= FourCharCode('ecpp');
-	ePrinter					= FourCharCode('edpr');
-	eSvideo						= FourCharCode('epsv');
-	eSCSI						= FourCharCode('ecsc');
-	eSerial						= FourCharCode('epsr');
-	eSpeakers					= FourCharCode('edsp');
-	eStorageDevice				= FourCharCode('edst');
-	eSVGA						= FourCharCode('epsg');
-	eTokenRing					= FourCharCode('etok');
-	eTrackball					= FourCharCode('etrk');
-	eTrackpad					= FourCharCode('edtp');
-	eUSB						= FourCharCode('ecus');
-	eVideoIn					= FourCharCode('ecvi');
-	eVideoMonitor				= FourCharCode('edvm');
-	eVideoOut					= FourCharCode('ecvo');
-
-																{  AppleScript 1.3: Keystroke class  }
-	cKeystroke					= FourCharCode('kprs');
-	pKeystrokeKey				= FourCharCode('kMsg');
-	pModifiers					= FourCharCode('kMod');
-	pKeyKind					= FourCharCode('kknd');
-	eModifiers					= FourCharCode('eMds');
-	eOptionDown					= FourCharCode('Kopt');
-	eCommandDown				= FourCharCode('Kcmd');
-	eControlDown				= FourCharCode('Kctl');
-	eShiftDown					= FourCharCode('Ksft');
-	eCapsLockDown				= FourCharCode('Kclk');
-	eKeyKind					= FourCharCode('ekst');						{   }
-																{  Special keys all start with 'ks'  }
-	eEscapeKey					= $6B733500;					{  Third byte is virtual key code byte         }
-	eDeleteKey					= $6B733300;					{  (see IM Mac Toolbox Essentials, pp. 2-43)  }
-	eTabKey						= $6B733000;
-	eReturnKey					= $6B732400;
-	eClearKey					= $6B734700;
-	eEnterKey					= $6B734C00;
-	eUpArrowKey					= $6B737E00;
-	eDownArrowKey				= $6B737D00;
-	eLeftArrowKey				= $6B737B00;
-	eRightArrowKey				= $6B737C00;
-	eHelpKey					= $6B737200;
-	eHomeKey					= $6B737300;
-	ePageUpKey					= $6B737400;
-	ePageDownKey				= $6B737900;
-	eForwardDelKey				= $6B737500;
-	eEndKey						= $6B737700;
-	eF1Key						= $6B737A00;
-	eF2Key						= $6B737800;
-	eF3Key						= $6B736300;
-	eF4Key						= $6B737600;
-	eF5Key						= $6B736000;
-	eF6Key						= $6B736100;
-	eF7Key						= $6B736200;
-	eF8Key						= $6B736400;
-	eF9Key						= $6B736500;
-	eF10Key						= $6B736D00;
-	eF11Key						= $6B736700;
-	eF12Key						= $6B736F00;
-	eF13Key						= $6B736900;
-	eF14Key						= $6B736B00;
-	eF15Key						= $6B737100;
-
-	keyAEQuitWithoutUI          = FourCharCode('noui'); { If present in a kAEQuitApplication event, autosave any documents with uncommitted changes and quit }
+const
+{ AppleScript 1.3: Unit types }
+	typeMeters = FourCharCode('metr'); { Base Unit }
+	typeInches = FourCharCode('inch');
+	typeFeet = FourCharCode('feet');
+	typeYards = FourCharCode('yard');
+	typeMiles = FourCharCode('mile');
+	typeKilometers = FourCharCode('kmtr');
+	typeCentimeters = FourCharCode('cmtr');
+	typeSquareMeters = FourCharCode('sqrm'); { Base Unit }
+	typeSquareFeet = FourCharCode('sqft');
+	typeSquareYards = FourCharCode('sqyd');
+	typeSquareMiles = FourCharCode('sqmi');
+	typeSquareKilometers = FourCharCode('sqkm');
+	typeLiters = FourCharCode('litr'); { Base Unit }
+	typeQuarts = FourCharCode('qrts');
+	typeGallons = FourCharCode('galn');
+	typeCubicMeters = FourCharCode('cmet'); { Base Unit }
+	typeCubicFeet = FourCharCode('cfet');
+	typeCubicInches = FourCharCode('cuin');
+	typeCubicCentimeter = FourCharCode('ccmt');
+	typeCubicYards = FourCharCode('cyrd');
+	typeKilograms = FourCharCode('kgrm'); { Base Unit }
+	typeGrams = FourCharCode('gram');
+	typeOunces = FourCharCode('ozs ');
+	typePounds = FourCharCode('lbs ');
+	typeDegreesC = FourCharCode('degc'); { Base Unit }
+	typeDegreesF = FourCharCode('degf');
+	typeDegreesK = FourCharCode('degk');
+
+const
+{ AppleScript 1.3: Folder Actions }
+	kFAServerApp = FourCharCode('ssrv'); { Creator code for Folder Actions Server}
+	kDoFolderActionEvent = FourCharCode('fola'); { Event the Finder sends to the Folder Actions FBA}
+	kFolderActionCode = FourCharCode('actn'); { Parameter that contains the Folder Action}
+	kFolderOpenedEvent = FourCharCode('fopn'); { Value of kFolderActionCode parameter; sent to script as event}
+	kFolderClosedEvent = FourCharCode('fclo');
+	kFolderWindowMovedEvent = FourCharCode('fsiz');
+	kFolderItemsAddedEvent = FourCharCode('fget');
+	kFolderItemsRemovedEvent = FourCharCode('flos');
+	kItemList = FourCharCode('flst'); { List parameter for added and removed items}
+	kNewSizeParameter = FourCharCode('fnsz'); { Parameter for moved window}
+	kFASuiteCode = FourCharCode('faco'); { Suite code for the following events}
+	kFAAttachCommand = FourCharCode('atfa'); { Attach event id}
+	kFARemoveCommand = FourCharCode('rmfa'); { Remove event id}
+	kFAEditCommand = FourCharCode('edfa'); { Edit event id}
+	kFAFileParam = FourCharCode('faal'); { Key for file parameter for Attach}
+	kFAIndexParam = FourCharCode('indx'); { Key for index (0-based) parameter for Remove and Edit}
+
+{ AppleScript 1.3 Internet Suite }
+const
+{ Suite code }
+	kAEInternetSuite = FourCharCode('gurl');
+	kAEISWebStarSuite = $575757BD;
+
+const
+{ Events }
+	kAEISGetURL = FourCharCode('gurl');
+	KAEISHandleCGI = FourCharCode('sdoc');
+
+const
+{ Classes }
+	cURL = FourCharCode('url ');
+	cInternetAddress = FourCharCode('IPAD');
+	cHTML = FourCharCode('html');
+	cFTPItem = FourCharCode('ftp ');
+
+const
+{ Parameters }
+	kAEISHTTPSearchArgs = FourCharCode('kfor');
+	kAEISPostArgs = FourCharCode('post');
+	kAEISMethod = FourCharCode('meth');
+	kAEISClientAddress = FourCharCode('addr');
+	kAEISUserName = FourCharCode('user');
+	kAEISPassword = FourCharCode('pass');
+	kAEISFromUser = FourCharCode('frmu');
+	kAEISServerName = FourCharCode('svnm');
+	kAEISServerPort = FourCharCode('svpt');
+	kAEISScriptName = FourCharCode('scnm');
+	kAEISContentType = FourCharCode('ctyp');
+	kAEISReferrer = FourCharCode('refr');
+	kAEISUserAgent = FourCharCode('Agnt');
+	kAEISAction = FourCharCode('Kact');
+	kAEISActionPath = FourCharCode('Kapt');
+	kAEISClientIP = FourCharCode('Kcip');
+	kAEISFullRequest = FourCharCode('Kfrq');
+
+const
+{ Properties }
+	pScheme = FourCharCode('pusc');
+	pHost = FourCharCode('HOST');
+	pPath = FourCharCode('FTPc');
+	pUserName = FourCharCode('RAun');
+	pUserPassword = FourCharCode('RApw');
+	pDNSForm = FourCharCode('pDNS');
+	pURL = FourCharCode('pURL');
+	pTextEncoding = FourCharCode('ptxe');
+	pFTPKind = FourCharCode('kind');
+
+const
+{ Scheme enumerations }
+	eScheme = FourCharCode('esch');
+	eurlHTTP = FourCharCode('http'); { RFC 2068 }
+	eurlHTTPS = FourCharCode('htps');
+	eurlFTP = FourCharCode('ftp '); { RFC 1738 }
+	eurlMail = FourCharCode('mail'); { RFC 2638 }
+	eurlFile = FourCharCode('file'); { RFC 1738 }
+	eurlGopher = FourCharCode('gphr'); { RFC 1738 }
+	eurlTelnet = FourCharCode('tlnt'); { RFC 1738 }
+	eurlNews = FourCharCode('news'); { RFC 1738 }
+	eurlSNews = FourCharCode('snws');
+	eurlNNTP = FourCharCode('nntp'); { RFC 1738 }
+	eurlMessage = FourCharCode('mess');
+	eurlMailbox = FourCharCode('mbox');
+	eurlMulti = FourCharCode('mult');
+	eurlLaunch = FourCharCode('laun');
+	eurlAFP = FourCharCode('afp ');
+	eurlAT = FourCharCode('at  ');
+	eurlEPPC = FourCharCode('eppc');
+	eurlRTSP = FourCharCode('rtsp'); { RFC 2326 }
+	eurlIMAP = FourCharCode('imap'); { RFC 2192 }
+	eurlNFS = FourCharCode('unfs'); { RFC 2224 }
+	eurlPOP = FourCharCode('upop'); { RFC 2384 }
+	eurlLDAP = FourCharCode('uldp'); { RFC 2255 }
+	eurlUnknown = FourCharCode('url?');
+
+const
+{ AppleScript 1.3: Connectivity Suite in aeut }
+	kConnSuite = FourCharCode('macc');
+	cDevSpec = FourCharCode('cdev');
+	cAddressSpec = FourCharCode('cadr');
+	cADBAddress = FourCharCode('cadb');
+	cAppleTalkAddress = FourCharCode('cat ');
+	cBusAddress = FourCharCode('cbus');
+	cEthernetAddress = FourCharCode('cen ');
+	cFireWireAddress = FourCharCode('cfw ');
+	cIPAddress = FourCharCode('cip ');
+	cLocalTalkAddress = FourCharCode('clt ');
+	cSCSIAddress = FourCharCode('cscs');
+	cTokenRingAddress = FourCharCode('ctok');
+	cUSBAddress = FourCharCode('cusb'); { }
+                                        { Properties }
+	pDeviceType = FourCharCode('pdvt');
+	pDeviceAddress = FourCharCode('pdva');
+	pConduit = FourCharCode('pcon');
+	pProtocol = FourCharCode('pprt'); { cde 4/27/98 was 'ppro' conflicted with DB suite }
+	pATMachine = FourCharCode('patm');
+	pATZone = FourCharCode('patz');
+	pATType = FourCharCode('patt');
+	pDottedDecimal = FourCharCode('pipd');
+	pDNS = FourCharCode('pdns');
+	pPort = FourCharCode('ppor');
+	pNetwork = FourCharCode('pnet');
+	pNode = FourCharCode('pnod');
+	pSocket = FourCharCode('psoc');
+	pSCSIBus = FourCharCode('pscb');
+	pSCSILUN = FourCharCode('pslu'); { cde 5/22/98 per WWDC developer request }
+                                        { Enumerations and enumerators }
+	eDeviceType = FourCharCode('edvt');
+	eAddressSpec = FourCharCode('eads');
+	eConduit = FourCharCode('econ');
+	eProtocol = FourCharCode('epro');
+	eADB = FourCharCode('eadb');
+	eAnalogAudio = FourCharCode('epau');
+	eAppleTalk = FourCharCode('epat');
+	eAudioLineIn = FourCharCode('ecai');
+	eAudioLineOut = FourCharCode('ecal'); { cde 4/24/98 changed from 'ecao' to not conflict }
+	eAudioOut = FourCharCode('ecao');
+	eBus = FourCharCode('ebus');
+	eCDROM = FourCharCode('ecd ');
+	eCommSlot = FourCharCode('eccm');
+	eDigitalAudio = FourCharCode('epda');
+	eDisplay = FourCharCode('edds');
+	eDVD = FourCharCode('edvd');
+	eEthernet = FourCharCode('ecen');
+	eFireWire = FourCharCode('ecfw');
+	eFloppy = FourCharCode('efd ');
+	eHD = FourCharCode('ehd ');
+	eInfrared = FourCharCode('ecir');
+	eIP = FourCharCode('epip');
+	eIrDA = FourCharCode('epir');
+	eIRTalk = FourCharCode('epit');
+	eKeyboard = FourCharCode('ekbd');
+	eLCD = FourCharCode('edlc');
+	eLocalTalk = FourCharCode('eclt');
+	eMacIP = FourCharCode('epmi');
+	eMacVideo = FourCharCode('epmv');
+	eMicrophone = FourCharCode('ecmi');
+	eModemPort = FourCharCode('ecmp');
+	eModemPrinterPort = FourCharCode('empp');
+	eModem = FourCharCode('edmm');
+	eMonitorOut = FourCharCode('ecmn');
+	eMouse = FourCharCode('emou');
+	eNuBusCard = FourCharCode('ednb');
+	eNuBus = FourCharCode('enub');
+	ePCcard = FourCharCode('ecpc');
+	ePCIbus = FourCharCode('ecpi');
+	ePCIcard = FourCharCode('edpi');
+	ePDSslot = FourCharCode('ecpd');
+	ePDScard = FourCharCode('epds');
+	ePointingDevice = FourCharCode('edpd');
+	ePostScript = FourCharCode('epps');
+	ePPP = FourCharCode('eppp');
+	ePrinterPort = FourCharCode('ecpp');
+	ePrinter = FourCharCode('edpr');
+	eSvideo = FourCharCode('epsv');
+	eSCSI = FourCharCode('ecsc');
+	eSerial = FourCharCode('epsr');
+	eSpeakers = FourCharCode('edsp');
+	eStorageDevice = FourCharCode('edst');
+	eSVGA = FourCharCode('epsg');
+	eTokenRing = FourCharCode('etok');
+	eTrackball = FourCharCode('etrk');
+	eTrackpad = FourCharCode('edtp');
+	eUSB = FourCharCode('ecus');
+	eVideoIn = FourCharCode('ecvi');
+	eVideoMonitor = FourCharCode('edvm');
+	eVideoOut = FourCharCode('ecvo');
+
+const
+{ AppleScript 1.3: Keystroke class }
+	cKeystroke = FourCharCode('kprs');
+	pKeystrokeKey = FourCharCode('kMsg');
+	pModifiers = FourCharCode('kMod');
+	pKeyKind = FourCharCode('kknd');
+	eModifiers = FourCharCode('eMds');
+	eOptionDown = FourCharCode('Kopt');
+	eCommandDown = FourCharCode('Kcmd');
+	eControlDown = FourCharCode('Kctl');
+	eShiftDown = FourCharCode('Ksft');
+	eCapsLockDown = FourCharCode('Kclk');
+	eKeyKind = FourCharCode('ekst'); { }
+                                        { Special keys all start with 'ks' }
+	eEscapeKey = $6B733500; { Third byte is virtual key code byte        }
+	eDeleteKey = $6B733300; { (see IM Mac Toolbox Essentials, pp. 2-43) }
+	eTabKey = $6B733000;
+	eReturnKey = $6B732400;
+	eClearKey = $6B734700;
+	eEnterKey = $6B734C00;
+	eUpArrowKey = $6B737E00;
+	eDownArrowKey = $6B737D00;
+	eLeftArrowKey = $6B737B00;
+	eRightArrowKey = $6B737C00;
+	eHelpKey = $6B737200;
+	eHomeKey = $6B737300;
+	ePageUpKey = $6B737400;
+	ePageDownKey = $6B737900;
+	eForwardDelKey = $6B737500;
+	eEndKey = $6B737700;
+	eF1Key = $6B737A00;
+	eF2Key = $6B737800;
+	eF3Key = $6B736300;
+	eF4Key = $6B737600;
+	eF5Key = $6B736000;
+	eF6Key = $6B736100;
+	eF7Key = $6B736200;
+	eF8Key = $6B736400;
+	eF9Key = $6B736500;
+	eF10Key = $6B736D00;
+	eF11Key = $6B736700;
+	eF12Key = $6B736F00;
+	eF13Key = $6B736900;
+	eF14Key = $6B736B00;
+	eF15Key = $6B737100;
+
+const
+	keyAELaunchedAsLogInItem = FourCharCode('lgit'); { If present in a kAEOpenApplication event, application was launched as a login item and probably shouldn't open up untitled documents, etc. Mac OS X 10.4 and later. }
+	keyAELaunchedAsServiceItem = FourCharCode('svit'); { If present in a kAEOpenApplication event, application was launched as a service item and probably shouldn't open up untitled documents, etc. Mac OS X 10.4 and later. }
 
-{$ALIGN MAC68K}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 135 - 59
packages/univint/src/AEUserTermTypes.pas

@@ -1,12 +1,11 @@
 {
-     File:       AEUserTermTypes.p
+     File:       AE/AEUserTermTypes.h
  
      Contains:   AppleEvents AEUT resource format Interfaces.
  
-     Version:    Technology: System 7.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1991-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1991-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AEUserTermTypes;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,68 +176,73 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ConditionalMacros;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
+{$ifc TARGET_OS_MAC}
 
+{$ALIGN MAC68K}
 
 const
-	kAEUserTerminology			= FourCharCode('aeut');						{   0x61657574   }
-	kAETerminologyExtension		= FourCharCode('aete');						{   0x61657465   }
-	kAEScriptingSizeResource	= FourCharCode('scsz');						{   0x7363737a   }
-	kAEOSAXSizeResource			= FourCharCode('osiz');
-
-	kAEUTHasReturningParam		= 31;							{  if event has a keyASReturning param  }
-	kAEUTOptional				= 15;							{  if something is optional  }
-	kAEUTlistOfItems			= 14;							{  if property or reply is a list.  }
-	kAEUTEnumerated				= 13;							{  if property or reply is of an enumerated type.  }
-	kAEUTReadWrite				= 12;							{  if property is writable.  }
-	kAEUTChangesState			= 12;							{  if an event changes state.  }
-	kAEUTTightBindingFunction	= 12;							{  if this is a tight-binding precedence function.  }
-																{  AppleScript 1.3: new bits for reply, direct parameter, parameter, and property flags  }
-	kAEUTEnumsAreTypes			= 11;							{  if the enumeration is a list of types, not constants  }
-	kAEUTEnumListIsExclusive	= 10;							{  if the list of enumerations is a proper set  }
-	kAEUTReplyIsReference		= 9;							{  if the reply is a reference, not a value  }
-	kAEUTDirectParamIsReference	= 9;							{  if the direct parameter is a reference, not a value  }
-	kAEUTParamIsReference		= 9;							{  if the parameter is a reference, not a value  }
-	kAEUTPropertyIsReference	= 9;							{  if the property is a reference, not a value  }
-	kAEUTNotDirectParamIsTarget	= 8;							{  if the direct parameter is not the target of the event  }
-	kAEUTParamIsTarget			= 8;							{  if the parameter is the target of the event  }
-	kAEUTApostrophe				= 3;							{  if a term contains an apostrophe.  }
-	kAEUTFeminine				= 2;							{  if a term is feminine gender.  }
-	kAEUTMasculine				= 1;							{  if a term is masculine gender.  }
-	kAEUTPlural					= 0;							{  if a term is plural.  }
+	kAEUserTerminology = FourCharCode('aeut'); {  0x61657574  }
+	kAETerminologyExtension = FourCharCode('aete'); {  0x61657465  }
+	kAEScriptingSizeResource = FourCharCode('scsz'); {  0x7363737a  }
+	kAEOSAXSizeResource = FourCharCode('osiz');
 
+const
+	kAEUTHasReturningParam = 31;   { if event has a keyASReturning param }
+	kAEUTOptional = 15;   { if something is optional }
+	kAEUTlistOfItems = 14;   { if property or reply is a list. }
+	kAEUTEnumerated = 13;   { if property or reply is of an enumerated type. }
+	kAEUTReadWrite = 12;   { if property is writable. }
+	kAEUTChangesState = 12;   { if an event changes state. }
+	kAEUTTightBindingFunction = 12;   { if this is a tight-binding precedence function. }
+                                        { AppleScript 1.3: new bits for reply, direct parameter, parameter, and property flags }
+	kAEUTEnumsAreTypes = 11;   { if the enumeration is a list of types, not constants }
+	kAEUTEnumListIsExclusive = 10;   { if the list of enumerations is a proper set }
+	kAEUTReplyIsReference = 9;    { if the reply is a reference, not a value }
+	kAEUTDirectParamIsReference = 9;    { if the direct parameter is a reference, not a value }
+	kAEUTParamIsReference = 9;    { if the parameter is a reference, not a value }
+	kAEUTPropertyIsReference = 9;    { if the property is a reference, not a value }
+	kAEUTNotDirectParamIsTarget = 8;    { if the direct parameter is not the target of the event }
+	kAEUTParamIsTarget = 8;    { if the parameter is the target of the event }
+	kAEUTApostrophe = 3;    { if a term contains an apostrophe. }
+	kAEUTFeminine = 2;    { if a term is feminine gender. }
+	kAEUTMasculine = 1;    { if a term is masculine gender. }
+	kAEUTPlural = 0;     { if a term is plural. }
 
 type
 	TScriptingSizeResourcePtr = ^TScriptingSizeResource;
 	TScriptingSizeResource = record
-		scriptingSizeFlags:		SInt16;
-		minStackSize:			UInt32;
-		preferredStackSize:		UInt32;
-		maxStackSize:			UInt32;
-		minHeapSize:			UInt32;
-		preferredHeapSize:		UInt32;
-		maxHeapSize:			UInt32;
+		scriptingSizeFlags: SInt16;
+		minStackSize: UInt32;
+		preferredStackSize: UInt32;
+		maxStackSize: UInt32;
+		minHeapSize: UInt32;
+		preferredHeapSize: UInt32;
+		maxHeapSize: UInt32;
 	end;
+const
+	kLaunchToGetTerminology = 1 shl 15; {    If kLaunchToGetTerminology is 0, 'aete' is read directly from res file.  If set to 1, then launch and use 'gdut' to get terminology. }
+	kDontFindAppBySignature = 1 shl 14; {    If kDontFindAppBySignature is 0, then find app with signature if lost.  If 1, then don't }
+	kAlwaysSendSubject = 1 shl 13; {    If kAlwaysSendSubject 0, then send subject when appropriate. If 1, then every event has Subject Attribute }
 
-
+{ old names for above bits. }
 const
-	kLaunchToGetTerminology		= $8000;						{     If kLaunchToGetTerminology is 0, 'aete' is read directly from res file.  If set to 1, then launch and use 'gdut' to get terminology.  }
-	kDontFindAppBySignature		= $4000;						{     If kDontFindAppBySignature is 0, then find app with signature if lost.  If 1, then don't  }
-	kAlwaysSendSubject			= $2000;						{     If kAlwaysSendSubject 0, then send subject when appropriate. If 1, then every event has Subject Attribute  }
+	kReadExtensionTermsMask = 1 shl 15;
 
-	{	 old names for above bits. 	}
-	kReadExtensionTermsMask		= $8000;
+const
+{ AppleScript 1.3: Bit positions for osiz resource }
+                                        { AppleScript 1.3: Bit masks for osiz resources }
+	kOSIZDontOpenResourceFile = 15;   { If set, resource file is not opened when osax is loaded }
+	kOSIZdontAcceptRemoteEvents = 14;   { If set, handler will not be called with events from remote machines }
+	kOSIZOpenWithReadPermission = 13;   { If set, file will be opened with read permission only }
+	kOSIZCodeInSharedLibraries = 11;    { If set, loader will look for handler in shared library, not osax resources }
 
-																{  AppleScript 1.3: Bit positions for osiz resource  }
-																{  AppleScript 1.3: Bit masks for osiz resources  }
-	kOSIZDontOpenResourceFile	= 15;							{  If set, resource file is not opened when osax is loaded  }
-	kOSIZdontAcceptRemoteEvents	= 14;							{  If set, handler will not be called with events from remote machines  }
-	kOSIZOpenWithReadPermission	= 13;							{  If set, file will be opened with read permission only  }
-	kOSIZCodeInSharedLibraries	= 11;							{  If set, loader will look for handler in shared library, not osax resources  }
 
-{$ALIGN MAC68K}
+{$endc} {TARGET_OS_MAC}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 232 - 146
packages/univint/src/AIFF.pas

@@ -1,12 +1,11 @@
 {
-     File:       AIFF.p
+     File:       CarbonCore/AIFF.h
  
      Contains:   Definition of AIFF file format components.
  
-     Version:    Technology: System 8.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    CarbonCore-859.2~1
  
-     Copyright:  © 1989-2002 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 1989-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AIFF;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,187 +176,202 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
 
+{$ALIGN MAC68K}
 
 const
-	AIFFID						= FourCharCode('AIFF');
-	AIFCID						= FourCharCode('AIFC');
-	FormatVersionID				= FourCharCode('FVER');
-	CommonID					= FourCharCode('COMM');
-	FORMID						= FourCharCode('FORM');
-	SoundDataID					= FourCharCode('SSND');
-	MarkerID					= FourCharCode('MARK');
-	InstrumentID				= FourCharCode('INST');
-	MIDIDataID					= FourCharCode('MIDI');
-	AudioRecordingID			= FourCharCode('AESD');
-	ApplicationSpecificID		= FourCharCode('APPL');
-	CommentID					= FourCharCode('COMT');
-	NameID						= FourCharCode('NAME');
-	AuthorID					= FourCharCode('AUTH');
-	CopyrightID					= FourCharCode('(c) ');
-	AnnotationID				= FourCharCode('ANNO');
+	AIFFID = FourCharCode('AIFF');
+	AIFCID = FourCharCode('AIFC');
+	FormatVersionID = FourCharCode('FVER');
+	CommonID = FourCharCode('COMM');
+	FORMID = FourCharCode('FORM');
+	SoundDataID = FourCharCode('SSND');
+	MarkerID = FourCharCode('MARK');
+	InstrumentID = FourCharCode('INST');
+	MIDIDataID = FourCharCode('MIDI');
+	AudioRecordingID = FourCharCode('AESD');
+	ApplicationSpecificID = FourCharCode('APPL');
+	CommentID = FourCharCode('COMT');
+	NameID = FourCharCode('NAME');
+	AuthorID = FourCharCode('AUTH');
+	CopyrightID = FourCharCode('(c) ');
+	AnnotationID = FourCharCode('ANNO');
 
-	NoLooping					= 0;
-	ForwardLooping				= 1;
-	ForwardBackwardLooping		= 2;
+const
+	NoLooping = 0;
+	ForwardLooping = 1;
+	ForwardBackwardLooping = 2;
 
-																{  AIFF-C Versions  }
-	AIFCVersion1				= $A2805140;
 
-	{	 Compression Names 	}
-	NoneName					= 'not compressed';
-	ACE2to1Name					= 'ACE 2-to-1';
-	ACE8to3Name					= 'ACE 8-to-3';
-	MACE3to1Name				= 'MACE 3-to-1';
-	MACE6to1Name				= 'MACE 6-to-1';
-																{  Compression Types  }
-	NoneType					= FourCharCode('NONE');
-	ACE2Type					= FourCharCode('ACE2');
-	ACE8Type					= FourCharCode('ACE8');
-	MACE3Type					= FourCharCode('MAC3');
-	MACE6Type					= FourCharCode('MAC6');
+const
+{ AIFF-C Versions }
+	AIFCVersion1 = $A2805140;
 
+{ Compression Names }
+const
+	NoneName = 'not compressed';
+const
+	ACE2to1Name = 'ACE 2-to-1';
+const
+	ACE8to3Name = 'ACE 8-to-3';
+const
+	MACE3to1Name = 'MACE 3-to-1';
+const
+	MACE6to1Name = 'MACE 6-to-1';
+const
+{ Compression Types }
+	NoneType = FourCharCode('NONE');
+	ACE2Type = FourCharCode('ACE2');
+	ACE8Type = FourCharCode('ACE8');
+	MACE3Type = FourCharCode('MAC3');
+	MACE6Type = FourCharCode('MAC6');
 
+{
+    AIFF.h use to define a type, ID, which causes conflicts with other headers and application which want to use
+    this pretty common name as their own type.  If you were previously relying on this being defined here, you 
+    should either define it yourself or change your references to it into a UInt32.
+    
+    typedef UInt32 ID;
+}
 type
-{ changed from ID to ChunkID, as ID is used in objc.pas (sorry) }
-	ChunkID									= UInt32; {ID}
-	MarkerIdType						= SInt16;
+	MarkerIdType = SInt16;
 	ChunkHeaderPtr = ^ChunkHeader;
 	ChunkHeader = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
+		ckID: UInt32;
+		ckSize: SInt32;
 	end;
-
+type
 	ContainerChunkPtr = ^ContainerChunk;
 	ContainerChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		formType:				ChunkID;
+		ckID: UInt32;
+		ckSize: SInt32;
+		formType: UInt32;
 	end;
-
-	FormatVersionChunkPtr = ^FormatVersionChunk;
+type
 	FormatVersionChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		timestamp:				UInt32;
+		ckID: UInt32;
+		ckSize: SInt32;
+		timestamp: UInt32;
 	end;
-
-	CommonChunkPtr = ^CommonChunk;
+	FormatVersionChunkPtr = ^FormatVersionChunk;
+type
 	CommonChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		numChannels:			SInt16;
-		numSampleFrames:		UInt32;
-		sampleSize:				SInt16;
-		sampleRate:				extended80;
+		ckID: UInt32;
+		ckSize: SInt32;
+		numChannels: SInt16;
+		numSampleFrames: UInt32;
+		sampleSize: SInt16;
+		sampleRate: extended80;
 	end;
-
-	ExtCommonChunkPtr = ^ExtCommonChunk;
+	CommonChunkPtr = ^CommonChunk;
+type
 	ExtCommonChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		numChannels:			SInt16;
-		numSampleFrames:		UInt32;
-		sampleSize:				SInt16;
-		sampleRate:				extended80;
-		compressionType:		ChunkID;
-		compressionName:		SInt8;									{  variable length array, Pascal string  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		numChannels: SInt16;
+		numSampleFrames: UInt32;
+		sampleSize: SInt16;
+		sampleRate: extended80;
+		compressionType: UInt32;
+		compressionName: SInt8;     { variable length array, Pascal string }
 	end;
-
-	SoundDataChunkPtr = ^SoundDataChunk;
+	ExtCommonChunkPtr = ^ExtCommonChunk;
+type
 	SoundDataChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		offset:					UInt32;
-		blockSize:				UInt32;
+		ckID: UInt32;
+		ckSize: SInt32;
+		offset: UInt32;
+		blockSize: UInt32;
 	end;
-
+	SoundDataChunkPtr = ^SoundDataChunk;
+type
 	MarkerPtr = ^Marker;
 	Marker = record
-		id:						MarkerIdType;
-		position:				UInt32;
-		markerName:				Str255;
+		id: MarkerIdType;
+		position: UInt32;
+		markerName: Str255;
 	end;
-
-	MarkerChunkPtr = ^MarkerChunk;
+type
 	MarkerChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		numMarkers:				UInt16;
-		Markers:				array [0..0] of Marker;					{  variable length array  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		numMarkers: UInt16;
+		Markers: array [0..0] of Marker;             { variable length array }
 	end;
-
+	MarkerChunkPtr = ^MarkerChunk;
+type
 	AIFFLoopPtr = ^AIFFLoop;
 	AIFFLoop = record
-		playMode:				SInt16;
-		beginLoop:				MarkerIdType;
-		endLoop:				MarkerIdType;
+		playMode: SInt16;
+		beginLoop: MarkerIdType;
+		endLoop: MarkerIdType;
 	end;
-
-	InstrumentChunkPtr = ^InstrumentChunk;
-	InstrumentChunk = packed record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		baseFrequency:			UInt8;
-		detune:					UInt8;
-		lowFrequency:			UInt8;
-		highFrequency:			UInt8;
-		lowVelocity:			UInt8;
-		highVelocity:			UInt8;
-		gain:					SInt16;
-		sustainLoop:			AIFFLoop;
-		releaseLoop:			AIFFLoop;
+type
+	InstrumentChunk = record
+		ckID: UInt32;
+		ckSize: SInt32;
+		baseFrequency: UInt8;
+		detune: UInt8;
+		lowFrequency: UInt8;
+		highFrequency: UInt8;
+		lowVelocity: UInt8;
+		highVelocity: UInt8;
+		gain: SInt16;
+		sustainLoop: AIFFLoop;
+		releaseLoop: AIFFLoop;
 	end;
-
-	MIDIDataChunkPtr = ^MIDIDataChunk;
+	InstrumentChunkPtr = ^InstrumentChunk;
+type
 	MIDIDataChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		MIDIdata:				SInt8;									{  variable length array  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		MIDIdata: SInt8;            { variable length array }
 	end;
-
-	AudioRecordingChunkPtr = ^AudioRecordingChunk;
+	MIDIDataChunkPtr = ^MIDIDataChunk;
+type
 	AudioRecordingChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
+		ckID: UInt32;
+		ckSize: SInt32;
 		AESChannelStatus:		packed array [0..23] of UInt8;
 	end;
-
-	ApplicationSpecificChunkPtr = ^ApplicationSpecificChunk;
+	AudioRecordingChunkPtr = ^AudioRecordingChunk;
+type
 	ApplicationSpecificChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		applicationSignature:	OSType;
-		data:					SInt8;									{  variable length array  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		applicationSignature: OSType;
+		data: UInt8;                { variable length array }
 	end;
-
+	ApplicationSpecificChunkPtr = ^ApplicationSpecificChunk;
+type
 	CommentPtr = ^Comment;
 	Comment = record
-		timeStamp:				UInt32;
-		marker:					MarkerIdType;
-		count:					UInt16;
-		text:					SInt8;									{  variable length array, Pascal string  }
+		timeStamp: UInt32;
+		marker: MarkerIdType;
+		count: UInt16;
+		text: SInt8;                { variable length array, Pascal string }
 	end;
-
-	CommentsChunkPtr = ^CommentsChunk;
+	Comment_fix = Comment;
+type
 	CommentsChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		numComments:			UInt16;
-		comments:				array [0..0] of Comment;				{  variable length array  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		numComments: UInt16;
+		Comment: array [0..0] of Comment_fix;            { variable length array }
 	end;
-
-	TextChunkPtr = ^TextChunk;
+	CommentsChunkPtr = ^CommentsChunk;
+type
 	TextChunk = record
-		ckID:					ChunkID;
-		ckSize:					SInt32;
-		text:					SInt8;									{  variable length array, Pascal string  }
+		ckID: UInt32;
+		ckSize: SInt32;
+		text: SInt8;                { variable length array, Pascal string }
 	end;
+	TextChunkPtr = ^TextChunk;
 
-{$ALIGN MAC68K}
-
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 265 - 90
packages/univint/src/ASDebugging.pas

@@ -1,12 +1,11 @@
 {
-     File:       ASDebugging.p
+     File:       OpenScripting/ASDebugging.h
  
      Contains:   AppleScript Debugging Interfaces.
  
-     Version:    Technology: AppleScript 1.1
-                 Release:    Universal Interfaces 3.4.2
+     Version:    OSA-136~14
  
-     Copyright:  © 1992-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1992-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -15,13 +14,15 @@
  
 }
 
+{ Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +31,8 @@
 
 unit ASDebugging;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +45,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +84,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +168,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,10 +177,14 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,AEDataModel,OSA,Files,Components,AppleEvents,AppleScript;
+uses MacTypes,AEDataModel,OSA,Files,Components,AppleEvents,AppleScript,CFBase,CFData,CFURL;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
 
-{$ALIGN MAC68K}
 
 {*************************************************************************
     Mode Flags
@@ -117,170 +194,268 @@ uses MacTypes,AEDataModel,OSA,Files,Components,AppleEvents,AppleScript;
     that doesn't already have bindings for them. An error is returned if
     a current binding doesn't already exist. 
 }
-
 const
-	kOSAModeDontDefine			= $0001;
+	kOSAModeDontDefine = $0001;
 
-	{	*************************************************************************
-	    Component Selectors
-	*************************************************************************	}
+{*************************************************************************
+    Component Selectors
+*************************************************************************}
+const
 	kASSelectSetPropertyObsolete = $1101;
 	kASSelectGetPropertyObsolete = $1102;
-	kASSelectSetHandlerObsolete	= $1103;
-	kASSelectGetHandlerObsolete	= $1104;
+	kASSelectSetHandlerObsolete = $1103;
+	kASSelectGetHandlerObsolete = $1104;
 	kASSelectGetAppTerminologyObsolete = $1105;
-	kASSelectSetProperty		= $1106;
-	kASSelectGetProperty		= $1107;
-	kASSelectSetHandler			= $1108;
-	kASSelectGetHandler			= $1109;
-	kASSelectGetAppTerminology	= $110A;
-	kASSelectGetSysTerminology	= $110B;
-	kASSelectGetPropertyNames	= $110C;
-	kASSelectGetHandlerNames	= $110D;
-
-	{	*************************************************************************
-	    Context Accessors
-	*************************************************************************	}
-	{
-	 *  OSASetProperty()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function OSASetProperty(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) variableName: AEDesc; scriptValueID: OSAID): OSAError; external name '_OSASetProperty';
+	kASSelectSetProperty = $1106;
+	kASSelectGetProperty = $1107;
+	kASSelectSetHandler = $1108;
+	kASSelectGetHandler = $1109;
+	kASSelectGetAppTerminology = $110A;
+	kASSelectGetSysTerminology = $110B;
+	kASSelectGetPropertyNames = $110C;
+	kASSelectGetHandlerNames = $110D;
+
+{*************************************************************************
+    Context Accessors
+*************************************************************************}
 {
- *  OSAGetProperty()
+ *  OSASetProperty()
  *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ }
+function OSASetProperty( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) variableName: AEDesc; scriptValueID: OSAID ): OSAError; external name '_OSASetProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  OSAGetProperty()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetProperty(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) variableName: AEDesc; var resultingScriptValueID: OSAID): OSAError; external name '_OSAGetProperty';
+function OSAGetProperty( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) variableName: AEDesc; var resultingScriptValueID: OSAID ): OSAError; external name '_OSAGetProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  OSAGetPropertyNames()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetPropertyNames(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; var resultingPropertyNames: AEDescList): OSAError; external name '_OSAGetPropertyNames';
+function OSAGetPropertyNames( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; var resultingPropertyNames: AEDescList ): OSAError; external name '_OSAGetPropertyNames';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  OSASetHandler()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSASetHandler(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) handlerName: AEDesc; compiledScriptID: OSAID): OSAError; external name '_OSASetHandler';
+function OSASetHandler( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) handlerName: AEDesc; compiledScriptID: OSAID ): OSAError; external name '_OSASetHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  OSAGetHandler()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetHandler(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) handlerName: AEDesc; var resultingCompiledScriptID: OSAID): OSAError; external name '_OSAGetHandler';
+function OSAGetHandler( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; const (*var*) handlerName: AEDesc; var resultingCompiledScriptID: OSAID ): OSAError; external name '_OSAGetHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  OSAGetHandlerNames()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetHandlerNames(scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; var resultingHandlerNames: AEDescList): OSAError; external name '_OSAGetHandlerNames';
+function OSAGetHandlerNames( scriptingComponent: ComponentInstance; modeFlags: SInt32; contextID: OSAID; var resultingHandlerNames: AEDescList ): OSAError; external name '_OSAGetHandlerNames';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+//#if !__LP64__
+{$ifc not TARGET_CPU_64}
 {
- *  OSAGetAppTerminology()
+ *  OSAGetAppTerminology()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    use OSACopyScriptingDefinition instead.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetAppTerminology(scriptingComponent: ComponentInstance; modeFlags: SInt32; var fileSpec: FSSpec; terminologyID: SInt16; var didLaunch: boolean; var terminologyList: AEDesc): OSAError; external name '_OSAGetAppTerminology';
-{ Errors:
-       errOSASystemError        operation failed
-    }
+function OSAGetAppTerminology( scriptingComponent: ComponentInstance; modeFlags: SInt32; var fileSpec: FSSpec; terminologyID: SInt16; var didLaunch: Boolean; var terminologyList: AEDesc ): OSAError; external name '_OSAGetAppTerminology';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
+{$endc} { TARGET_CPU_64 }
+
 {
  *  OSAGetSysTerminology()
  *  
+ *  Discussion:
+ *    A terminology ID is derived from script code and language code as
+ *    follows: terminologyID = ((scriptCode & 0x7F) << 8) | (langCode &
+ *    0xFF)
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function OSAGetSysTerminology(scriptingComponent: ComponentInstance; modeFlags: SInt32; terminologyID: SInt16; var terminologyList: AEDesc): OSAError; external name '_OSAGetSysTerminology';
-{ Errors:
-       errOSASystemError        operation failed
-    }
-{ Notes on terminology ID
+function OSAGetSysTerminology( scriptingComponent: ComponentInstance; modeFlags: SInt32; terminologyID: SInt16; var terminologyList: AEDesc ): OSAError; external name '_OSAGetSysTerminology';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  OSACopyScriptingDefinition()
+ *  
+ *  Discussion:
+ *    Gets the scripting definition of the specified bundle.  See
+ *    sdef(5) for details of the sdef format.
+ *  
+ *  Parameters:
+ *    
+ *    ref:
+ *      The file (or bundle) to look in.
+ *    
+ *    modeFlags:
+ *      There are no flags defined at this time; pass 0.
+ *    
+ *    sdef:
+ *      The resulting sdef as XML data.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function OSACopyScriptingDefinition( const (*var*) ref: FSRef; modeFlags: SInt32; var sdef: CFDataRef ): OSAError; external name '_OSACopyScriptingDefinition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  OSACopyScriptingDefinitionFromURL()
+ *  
+ *  Discussion:
+ *    Gets the scripting definition of the specified URL.  See sdef(5)
+ *    for details of the sdef format.  If used with a file: URL, this
+ *    call is equivalent to OSACopyScriptingDefinition.
+ *  
+ *  Parameters:
+ *    
+ *    url:
+ *      The URL to look in; this should be a file: or eppc: URL.
+ *    
+ *    modeFlags:
+ *      There are no flags defined at this time; pass 0.
+ *    
+ *    sdef:
+ *      The resulting sdef as XML data.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function OSACopyScriptingDefinitionFromURL( url: CFURLRef; modeFlags: SInt32; var sdef: CFDataRef ): OSAError; external name '_OSACopyScriptingDefinitionFromURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
 
-    A terminology ID is derived from script code and language code
-    as follows;
 
-        terminologyID = ((scriptCode & 0x7F) << 8) | (langCode & 0xFF)
-}
 {*************************************************************************
     Obsolete versions provided for backward compatibility:
 }
+//#if !__LP64__
+{$ifc not TARGET_CPU_64}
 {
  *  ASSetProperty()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASSetProperty(scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) variableName: AEDesc; scriptValueID: OSAID): OSAError; external name '_ASSetProperty';
+function ASSetProperty( scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) variableName: AEDesc; scriptValueID: OSAID ): OSAError; external name '_ASSetProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  ASGetProperty()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASGetProperty(scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) variableName: AEDesc; var resultingScriptValueID: OSAID): OSAError; external name '_ASGetProperty';
+function ASGetProperty( scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) variableName: AEDesc; var resultingScriptValueID: OSAID ): OSAError; external name '_ASGetProperty';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  ASSetHandler()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASSetHandler(scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) handlerName: AEDesc; compiledScriptID: OSAID): OSAError; external name '_ASSetHandler';
+function ASSetHandler( scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) handlerName: AEDesc; compiledScriptID: OSAID ): OSAError; external name '_ASSetHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  ASGetHandler()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASGetHandler(scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) handlerName: AEDesc; var resultingCompiledScriptID: OSAID): OSAError; external name '_ASGetHandler';
+function ASGetHandler( scriptingComponent: ComponentInstance; contextID: OSAID; const (*var*) handlerName: AEDesc; var resultingCompiledScriptID: OSAID ): OSAError; external name '_ASGetHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  ASGetAppTerminology()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework [32-bit only]
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASGetAppTerminology(scriptingComponent: ComponentInstance; var fileSpec: FSSpec; terminologID: SInt16; var didLaunch: boolean; var terminologyList: AEDesc): OSAError; external name '_ASGetAppTerminology';
+function ASGetAppTerminology( scriptingComponent: ComponentInstance; var fileSpec: FSSpec; terminologID: SInt16; var didLaunch: Boolean; var terminologyList: AEDesc ): OSAError; external name '_ASGetAppTerminology';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 { Errors:
         errOSASystemError       operation failed
     }
 {************************************************************************}
 
 
-{$ALIGN MAC68K}
+{$endc}	{ TARGET_CPU_64 }
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 366 - 269
packages/univint/src/ASRegistry.pas

@@ -1,12 +1,11 @@
 {
-     File:       ASRegistry.p
+     File:       OpenScripting/ASRegistry.h
  
      Contains:   AppleScript Registry constants.
  
-     Version:    Technology: AppleScript 1.3
-                 Release:    Universal Interfaces 3.4.2
+     Version:    OSA-136~14
  
-     Copyright:  © 1991-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1991-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -15,13 +14,15 @@
  
 }
 
+{ Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +31,8 @@
 
 unit ASRegistry;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +45,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +84,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +168,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,271 +177,295 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,AERegistry,AEObjects;
+uses MacTypes,AERegistry,AEDataModel,AEObjects;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
 
-{$ALIGN MAC68K}
+{$ALIGN POWER}
 
 
 const
-	keyAETarget					= FourCharCode('targ');
-	keySubjectAttr				= FourCharCode('subj');						{  Magic 'returning' parameter:  }
-	keyASReturning				= FourCharCode('Krtn');						{  AppleScript Specific Codes:  }
-	kASAppleScriptSuite			= FourCharCode('ascr');
-	kASScriptEditorSuite		= FourCharCode('ToyS');
-	kASTypeNamesSuite			= FourCharCode('tpnm');						{  dynamic terminologies  }
-	typeAETE					= FourCharCode('aete');
-	typeAEUT					= FourCharCode('aeut');
-	kGetAETE					= FourCharCode('gdte');
-	kGetAEUT					= FourCharCode('gdut');
-	kUpdateAEUT					= FourCharCode('udut');
-	kUpdateAETE					= FourCharCode('udte');
-	kCleanUpAEUT				= FourCharCode('cdut');
-	kASComment					= FourCharCode('cmnt');
-	kASLaunchEvent				= FourCharCode('noop');
-	keyScszResource				= FourCharCode('scsz');
-	typeScszResource			= FourCharCode('scsz');						{  subroutine calls  }
-	kASSubroutineEvent			= FourCharCode('psbr');
-	keyASSubroutineName			= FourCharCode('snam');
-	kASPrepositionalSubroutine	= FourCharCode('psbr');
-	keyASPositionalArgs			= FourCharCode('parg');
-
-																{  Add this parameter to a Get Data result if your app handled the 'as' parameter  }
-	keyAppHandledCoercion		= FourCharCode('idas');
-
-																{  Miscellaneous AppleScript commands  }
-	kASStartLogEvent			= FourCharCode('log1');
-	kASStopLogEvent				= FourCharCode('log0');
-	kASCommentEvent				= FourCharCode('cmnt');
-
-
-	{	 Operator Events: 	}
-																{  Binary:  }
-	kASAdd						= FourCharCode('+   ');
-	kASSubtract					= FourCharCode('-   ');
-	kASMultiply					= FourCharCode('*   ');
-	kASDivide					= FourCharCode('/   ');
-	kASQuotient					= FourCharCode('div ');
-	kASRemainder				= FourCharCode('mod ');
-	kASPower					= FourCharCode('^   ');
-	kASEqual					= FourCharCode('=   ');
-	kASNotEqual					= FourCharCode('­   ');
-	kASGreaterThan				= FourCharCode('>   ');
-	kASGreaterThanOrEqual		= FourCharCode('>=  ');
-	kASLessThan					= FourCharCode('<   ');
-	kASLessThanOrEqual			= FourCharCode('<=  ');
-	kASComesBefore				= FourCharCode('cbfr');
-	kASComesAfter				= FourCharCode('cafr');
-	kASConcatenate				= FourCharCode('ccat');
-	kASStartsWith				= FourCharCode('bgwt');
-	kASEndsWith					= FourCharCode('ends');
-	kASContains					= FourCharCode('cont');
-
-	kASAnd						= FourCharCode('AND ');
-	kASOr						= FourCharCode('OR  ');						{  Unary:  }
-	kASNot						= FourCharCode('NOT ');
-	kASNegate					= FourCharCode('neg ');
-	keyASArg					= FourCharCode('arg ');
-
-																{  event code for the 'error' statement  }
-	kASErrorEventCode			= FourCharCode('err ');
-	kOSAErrorArgs				= FourCharCode('erra');
-	keyAEErrorObject			= FourCharCode('erob');						{  Properties:  }
-	pLength						= FourCharCode('leng');
-	pReverse					= FourCharCode('rvse');
-	pRest						= FourCharCode('rest');
-	pInherits					= FourCharCode('c@#^');
-	pProperties					= FourCharCode('pALL');						{  User-Defined Record Fields:  }
-	keyASUserRecordFields		= FourCharCode('usrf');
-	typeUserRecordFields		= FourCharCode('list');
-
-	{	 Prepositions: 	}
-	keyASPrepositionAt			= FourCharCode('at  ');
-	keyASPrepositionIn			= FourCharCode('in  ');
-	keyASPrepositionFrom		= FourCharCode('from');
-	keyASPrepositionFor			= FourCharCode('for ');
-	keyASPrepositionTo			= FourCharCode('to  ');
-	keyASPrepositionThru		= FourCharCode('thru');
-	keyASPrepositionThrough		= FourCharCode('thgh');
-	keyASPrepositionBy			= FourCharCode('by  ');
-	keyASPrepositionOn			= FourCharCode('on  ');
-	keyASPrepositionInto		= FourCharCode('into');
-	keyASPrepositionOnto		= FourCharCode('onto');
-	keyASPrepositionBetween		= FourCharCode('btwn');
-	keyASPrepositionAgainst		= FourCharCode('agst');
-	keyASPrepositionOutOf		= FourCharCode('outo');
-	keyASPrepositionInsteadOf	= FourCharCode('isto');
-	keyASPrepositionAsideFrom	= FourCharCode('asdf');
-	keyASPrepositionAround		= FourCharCode('arnd');
-	keyASPrepositionBeside		= FourCharCode('bsid');
-	keyASPrepositionBeneath		= FourCharCode('bnth');
-	keyASPrepositionUnder		= FourCharCode('undr');
-
-	keyASPrepositionOver		= FourCharCode('over');
-	keyASPrepositionAbove		= FourCharCode('abve');
-	keyASPrepositionBelow		= FourCharCode('belw');
-	keyASPrepositionApartFrom	= FourCharCode('aprt');
-	keyASPrepositionGiven		= FourCharCode('givn');
-	keyASPrepositionWith		= FourCharCode('with');
-	keyASPrepositionWithout		= FourCharCode('wout');
-	keyASPrepositionAbout		= FourCharCode('abou');
-	keyASPrepositionSince		= FourCharCode('snce');
-	keyASPrepositionUntil		= FourCharCode('till');
-
-																{  Terminology & Dialect things:  }
-	kDialectBundleResType		= FourCharCode('Dbdl');						{  AppleScript Classes and Enums:  }
-	cConstant					= FourCharCode('enum');
-	cClassIdentifier			= FourCharCode('pcls');
-	cObjectBeingExamined		= FourCharCode('exmn');
-	cList						= FourCharCode('list');
-	cSmallReal					= FourCharCode('sing');
-	cReal						= FourCharCode('doub');
-	cRecord						= FourCharCode('reco');
-	cReference					= FourCharCode('obj ');
-	cUndefined					= FourCharCode('undf');
-	cMissingValue				= FourCharCode('msng');
-	cSymbol						= FourCharCode('symb');
-	cLinkedList					= FourCharCode('llst');
-	cVector						= FourCharCode('vect');
-	cEventIdentifier			= FourCharCode('evnt');
-	cKeyIdentifier				= FourCharCode('kyid');
-	cUserIdentifier				= FourCharCode('uid ');
-	cPreposition				= FourCharCode('prep');
-	cKeyForm					= FourCharCode('kfrm');
-	cScript						= FourCharCode('scpt');
-	cHandler					= FourCharCode('hand');
-	cProcedure					= FourCharCode('proc');
-
-	cHandleBreakpoint			= FourCharCode('brak');
-
-	cClosure					= FourCharCode('clsr');
-	cRawData					= FourCharCode('rdat');
-	cStringClass				= FourCharCode('TEXT');
-	cNumber						= FourCharCode('nmbr');
-	cListElement				= FourCharCode('celm');
-	cListOrRecord				= FourCharCode('lr  ');
-	cListOrString				= FourCharCode('ls  ');
-	cListRecordOrString			= FourCharCode('lrs ');
-	cNumberOrString				= FourCharCode('ns  ');
-	cNumberOrDateTime			= FourCharCode('nd  ');
-	cNumberDateTimeOrString		= FourCharCode('nds ');
-	cAliasOrString				= FourCharCode('sf  ');
-	cSeconds					= FourCharCode('scnd');
-	typeSound					= FourCharCode('snd ');
-	enumBooleanValues			= FourCharCode('boov');						{   Use this instead of typeBoolean to avoid with/without conversion   }
-	kAETrue						= FourCharCode('true');
-	kAEFalse					= FourCharCode('fals');
-	enumMiscValues				= FourCharCode('misc');
-	kASCurrentApplication		= FourCharCode('cura');						{  User-defined property ospecs:  }
-	formUserPropertyID			= FourCharCode('usrp');
-
-//	cString						= FourCharCode('TEXT');						{  old name for cStringClass - can't be used in .r files }
-
-																{  Global properties:  }
-	pASIt						= FourCharCode('it  ');
-	pASMe						= FourCharCode('me  ');
-	pASResult					= FourCharCode('rslt');
-	pASSpace					= FourCharCode('spac');
-	pASReturn					= FourCharCode('ret ');
-	pASTab						= FourCharCode('tab ');
-	pASPi						= FourCharCode('pi  ');
-	pASParent					= FourCharCode('pare');
-	kASInitializeEventCode		= FourCharCode('init');
-	pASPrintLength				= FourCharCode('prln');
-	pASPrintDepth				= FourCharCode('prdp');
-	pASTopLevelScript			= FourCharCode('ascr');
-
-																{  Considerations  }
-	kAECase						= FourCharCode('case');
-	kAEDiacritic				= FourCharCode('diac');
-	kAEWhiteSpace				= FourCharCode('whit');
-	kAEHyphens					= FourCharCode('hyph');
-	kAEExpansion				= FourCharCode('expa');
-	kAEPunctuation				= FourCharCode('punc');
-	kAEZenkakuHankaku			= FourCharCode('zkhk');
-	kAESmallKana				= FourCharCode('skna');
-	kAEKataHiragana				= FourCharCode('hika');
-	kASConsiderReplies			= FourCharCode('rmte');
-	enumConsiderations			= FourCharCode('cons');
-
-	{	 Considerations bit masks 	}
-	kAECaseConsiderMask			= $00000001;
-	kAEDiacriticConsiderMask	= $00000002;
-	kAEWhiteSpaceConsiderMask	= $00000004;
-	kAEHyphensConsiderMask		= $00000008;
-	kAEExpansionConsiderMask	= $00000010;
-	kAEPunctuationConsiderMask	= $00000020;
+	keyAETarget = FourCharCode('targ');
+	keySubjectAttr = FourCharCode('subj'); { Magic 'returning' parameter: }
+	keyASReturning = FourCharCode('Krtn'); { AppleScript Specific Codes: }
+	kASAppleScriptSuite = FourCharCode('ascr');
+	kASScriptEditorSuite = FourCharCode('ToyS');
+	kASTypeNamesSuite = FourCharCode('tpnm'); { dynamic terminologies }
+	typeAETE = FourCharCode('aete');
+	typeAEUT = FourCharCode('aeut');
+	kGetAETE = FourCharCode('gdte');
+	kGetAEUT = FourCharCode('gdut');
+	kUpdateAEUT = FourCharCode('udut');
+	kUpdateAETE = FourCharCode('udte');
+	kCleanUpAEUT = FourCharCode('cdut');
+	kASComment = FourCharCode('cmnt');
+	kASLaunchEvent = FourCharCode('noop');
+	keyScszResource = FourCharCode('scsz');
+	typeScszResource = FourCharCode('scsz'); { subroutine calls }
+	kASSubroutineEvent = FourCharCode('psbr');
+	keyASSubroutineName = FourCharCode('snam');
+	kASPrepositionalSubroutine = FourCharCode('psbr');
+	keyASPositionalArgs = FourCharCode('parg');
+
+const
+{ Add this parameter to a Get Data result if your app handled the 'as' parameter }
+	keyAppHandledCoercion = FourCharCode('idas');
+
+const
+{ Miscellaneous AppleScript commands }
+	kASStartLogEvent = FourCharCode('log1');
+	kASStopLogEvent = FourCharCode('log0');
+	kASCommentEvent = FourCharCode('cmnt');
+
+
+{ Operator Events: }
+const
+{ Binary: }
+	kASAdd = FourCharCode('+   ');
+	kASSubtract = FourCharCode('-   ');
+	kASMultiply = FourCharCode('*   ');
+	kASDivide = FourCharCode('/   ');
+	kASQuotient = FourCharCode('div ');
+	kASRemainder = FourCharCode('mod ');
+	kASPower = FourCharCode('^   ');
+	kASEqual = kAEEquals;
+	kASNotEqual = $AD202020;
+	kASGreaterThan = kAEGreaterThan;
+	kASGreaterThanOrEqual = kAEGreaterThanEquals;
+	kASLessThan = kAELessThan;
+	kASLessThanOrEqual = kAELessThanEquals;
+	kASComesBefore = FourCharCode('cbfr');
+	kASComesAfter = FourCharCode('cafr');
+	kASConcatenate = FourCharCode('ccat');
+	kASStartsWith = kAEBeginsWith;
+	kASEndsWith = kAEEndsWith;
+	kASContains = kAEContains;
+
+const
+	kASAnd = kAEAND;
+	kASOr = kAEOR; { Unary: }
+	kASNot = kAENOT;
+	kASNegate = FourCharCode('neg ');
+	keyASArg = FourCharCode('arg ');
+
+const
+{ event code for the 'error' statement }
+	kASErrorEventCode = FourCharCode('err ');
+	kOSAErrorArgs = FourCharCode('erra');
+	keyAEErrorObject = FourCharCode('erob'); { Properties: }
+	pLength = FourCharCode('leng');
+	pReverse = FourCharCode('rvse');
+	pRest = FourCharCode('rest');
+	pInherits = FourCharCode('c@#^');
+	pProperties = FourCharCode('pALL'); { User-Defined Record Fields: }
+	keyASUserRecordFields = FourCharCode('usrf');
+	typeUserRecordFields = typeAEList;
+
+{ Prepositions: }
+const
+	keyASPrepositionAt = FourCharCode('at  ');
+	keyASPrepositionIn = FourCharCode('in  ');
+	keyASPrepositionFrom = FourCharCode('from');
+	keyASPrepositionFor = FourCharCode('for ');
+	keyASPrepositionTo = FourCharCode('to  ');
+	keyASPrepositionThru = FourCharCode('thru');
+	keyASPrepositionThrough = FourCharCode('thgh');
+	keyASPrepositionBy = FourCharCode('by  ');
+	keyASPrepositionOn = FourCharCode('on  ');
+	keyASPrepositionInto = FourCharCode('into');
+	keyASPrepositionOnto = FourCharCode('onto');
+	keyASPrepositionBetween = FourCharCode('btwn');
+	keyASPrepositionAgainst = FourCharCode('agst');
+	keyASPrepositionOutOf = FourCharCode('outo');
+	keyASPrepositionInsteadOf = FourCharCode('isto');
+	keyASPrepositionAsideFrom = FourCharCode('asdf');
+	keyASPrepositionAround = FourCharCode('arnd');
+	keyASPrepositionBeside = FourCharCode('bsid');
+	keyASPrepositionBeneath = FourCharCode('bnth');
+	keyASPrepositionUnder = FourCharCode('undr');
+
+const
+	keyASPrepositionOver = FourCharCode('over');
+	keyASPrepositionAbove = FourCharCode('abve');
+	keyASPrepositionBelow = FourCharCode('belw');
+	keyASPrepositionApartFrom = FourCharCode('aprt');
+	keyASPrepositionGiven = FourCharCode('givn');
+	keyASPrepositionWith = FourCharCode('with');
+	keyASPrepositionWithout = FourCharCode('wout');
+	keyASPrepositionAbout = FourCharCode('abou');
+	keyASPrepositionSince = FourCharCode('snce');
+	keyASPrepositionUntil = FourCharCode('till');
+
+const
+{ Terminology & Dialect things: }
+	kDialectBundleResType = FourCharCode('Dbdl'); { AppleScript Classes and Enums: }
+	cConstant = typeEnumerated;
+	cClassIdentifier = pClass;
+	cObjectBeingExamined = typeObjectBeingExamined;
+	cList = typeAEList;
+	cSmallReal = typeIEEE32BitFloatingPoint;
+	cReal = typeIEEE64BitFloatingPoint;
+	cRecord = typeAERecord;
+	cReference = cObjectSpecifier;
+	cUndefined = FourCharCode('undf');
+	cMissingValue = FourCharCode('msng');
+	cSymbol = FourCharCode('symb');
+	cLinkedList = FourCharCode('llst');
+	cVector = FourCharCode('vect');
+	cEventIdentifier = FourCharCode('evnt');
+	cKeyIdentifier = FourCharCode('kyid');
+	cUserIdentifier = FourCharCode('uid ');
+	cPreposition = FourCharCode('prep');
+	cKeyForm = enumKeyForm;
+	cScript = FourCharCode('scpt');
+	cHandler = FourCharCode('hand');
+	cProcedure = FourCharCode('proc');
+
+const
+	cHandleBreakpoint = FourCharCode('brak');
+
+const
+	cClosure = FourCharCode('clsr');
+	cRawData = FourCharCode('rdat');
+	cStringClass = typeChar;
+	cNumber = FourCharCode('nmbr');
+	cListElement = FourCharCode('celm');
+	cListOrRecord = FourCharCode('lr  ');
+	cListOrString = FourCharCode('ls  ');
+	cListRecordOrString = FourCharCode('lrs ');
+	cNumberOrString = FourCharCode('ns  ');
+	cNumberOrDateTime = FourCharCode('nd  ');
+	cNumberDateTimeOrString = FourCharCode('nds ');
+	cAliasOrString = FourCharCode('sf  ');
+	cSeconds = FourCharCode('scnd');
+	typeSound = FourCharCode('snd ');
+	enumBooleanValues = FourCharCode('boov'); {  Use this instead of typeBoolean to avoid with/without conversion  }
+	kAETrue = typeTrue;
+	kAEFalse = typeFalse;
+	enumMiscValues = FourCharCode('misc');
+	kASCurrentApplication = FourCharCode('cura'); { User-defined property ospecs: }
+	formUserPropertyID = FourCharCode('usrp');
+
+const
+	cString = cStringClass; { old name for cStringClass - can't be used in .r files}
+
+const
+{ Global properties: }
+	pASIt = FourCharCode('it  ');
+	pASMe = FourCharCode('me  ');
+	pASResult = FourCharCode('rslt');
+	pASSpace = FourCharCode('spac');
+	pASReturn = FourCharCode('ret ');
+	pASTab = FourCharCode('tab ');
+	pASPi = FourCharCode('pi  ');
+	pASParent = FourCharCode('pare');
+	kASInitializeEventCode = FourCharCode('init');
+	pASPrintLength = FourCharCode('prln');
+	pASPrintDepth = FourCharCode('prdp');
+	pASTopLevelScript = FourCharCode('ascr');
+
+const
+{ Considerations }
+	kAECase = FourCharCode('case');
+	kAEDiacritic = FourCharCode('diac');
+	kAEWhiteSpace = FourCharCode('whit');
+	kAEHyphens = FourCharCode('hyph');
+	kAEExpansion = FourCharCode('expa');
+	kAEPunctuation = FourCharCode('punc');
+	kAEZenkakuHankaku = FourCharCode('zkhk');
+	kAESmallKana = FourCharCode('skna');
+	kAEKataHiragana = FourCharCode('hika');
+	kASConsiderReplies = FourCharCode('rmte');
+	kASNumericStrings = FourCharCode('nume');
+	enumConsiderations = FourCharCode('cons');
+
+{ Considerations bit masks }
+const
+	kAECaseConsiderMask = $00000001;
+	kAEDiacriticConsiderMask = $00000002;
+	kAEWhiteSpaceConsiderMask = $00000004;
+	kAEHyphensConsiderMask = $00000008;
+	kAEExpansionConsiderMask = $00000010;
+	kAEPunctuationConsiderMask = $00000020;
 	kASConsiderRepliesConsiderMask = $00000040;
-	kAECaseIgnoreMask			= $00010000;
-	kAEDiacriticIgnoreMask		= $00020000;
-	kAEWhiteSpaceIgnoreMask		= $00040000;
-	kAEHyphensIgnoreMask		= $00080000;
-	kAEExpansionIgnoreMask		= $00100000;
-	kAEPunctuationIgnoreMask	= $00200000;
+	kASNumericStringsConsiderMask = $00000080;
+	kAECaseIgnoreMask = $00010000;
+	kAEDiacriticIgnoreMask = $00020000;
+	kAEWhiteSpaceIgnoreMask = $00040000;
+	kAEHyphensIgnoreMask = $00080000;
+	kAEExpansionIgnoreMask = $00100000;
+	kAEPunctuationIgnoreMask = $00200000;
 	kASConsiderRepliesIgnoreMask = $00400000;
-	enumConsidsAndIgnores		= FourCharCode('csig');
-
-	cCoercion					= FourCharCode('coec');
-	cCoerceUpperCase			= FourCharCode('txup');
-	cCoerceLowerCase			= FourCharCode('txlo');
-	cCoerceRemoveDiacriticals	= FourCharCode('txdc');
-	cCoerceRemovePunctuation	= FourCharCode('txpc');
-	cCoerceRemoveHyphens		= FourCharCode('txhy');
-	cCoerceOneByteToTwoByte		= FourCharCode('txex');
-	cCoerceRemoveWhiteSpace		= FourCharCode('txws');
-	cCoerceSmallKana			= FourCharCode('txsk');
-	cCoerceZenkakuhankaku		= FourCharCode('txze');
-	cCoerceKataHiragana			= FourCharCode('txkh');						{  Lorax things:  }
-	cZone						= FourCharCode('zone');
-	cMachine					= FourCharCode('mach');
-	cAddress					= FourCharCode('addr');
-	cRunningAddress				= FourCharCode('radd');
-	cStorage					= FourCharCode('stor');
-
-																{  DateTime things:  }
-	pASWeekday					= FourCharCode('wkdy');
-	pASMonth					= FourCharCode('mnth');
-	pASDay						= FourCharCode('day ');
-	pASYear						= FourCharCode('year');
-	pASTime						= FourCharCode('time');
-	pASDateString				= FourCharCode('dstr');
-	pASTimeString				= FourCharCode('tstr');						{  Months  }
-	cMonth						= FourCharCode('mnth');
-	cJanuary					= FourCharCode('jan ');
-	cFebruary					= FourCharCode('feb ');
-	cMarch						= FourCharCode('mar ');
-	cApril						= FourCharCode('apr ');
-	cMay						= FourCharCode('may ');
-	cJune						= FourCharCode('jun ');
-	cJuly						= FourCharCode('jul ');
-	cAugust						= FourCharCode('aug ');
-	cSeptember					= FourCharCode('sep ');
-	cOctober					= FourCharCode('oct ');
-	cNovember					= FourCharCode('nov ');
-	cDecember					= FourCharCode('dec ');
-
-																{  Weekdays  }
-	cWeekday					= FourCharCode('wkdy');
-	cSunday						= FourCharCode('sun ');
-	cMonday						= FourCharCode('mon ');
-	cTuesday					= FourCharCode('tue ');
-	cWednesday					= FourCharCode('wed ');
-	cThursday					= FourCharCode('thu ');
-	cFriday						= FourCharCode('fri ');
-	cSaturday					= FourCharCode('sat ');						{  AS 1.1 Globals:  }
-	pASQuote					= FourCharCode('quot');
-	pASSeconds					= FourCharCode('secs');
-	pASMinutes					= FourCharCode('min ');
-	pASHours					= FourCharCode('hour');
-	pASDays						= FourCharCode('days');
-	pASWeeks					= FourCharCode('week');						{  Writing Code things:  }
-	cWritingCodeInfo			= FourCharCode('citl');
-	pScriptCode					= FourCharCode('pscd');
-	pLangCode					= FourCharCode('plcd');						{  Magic Tell and End Tell events for logging:  }
-	kASMagicTellEvent			= FourCharCode('tell');
-	kASMagicEndTellEvent		= FourCharCode('tend');
-
-{$ALIGN MAC68K}
+	kASNumericStringsIgnoreMask = $00800000;
+	enumConsidsAndIgnores = FourCharCode('csig');
+
+const
+	cCoercion = FourCharCode('coec');
+	cCoerceUpperCase = FourCharCode('txup');
+	cCoerceLowerCase = FourCharCode('txlo');
+	cCoerceRemoveDiacriticals = FourCharCode('txdc');
+	cCoerceRemovePunctuation = FourCharCode('txpc');
+	cCoerceRemoveHyphens = FourCharCode('txhy');
+	cCoerceOneByteToTwoByte = FourCharCode('txex');
+	cCoerceRemoveWhiteSpace = FourCharCode('txws');
+	cCoerceSmallKana = FourCharCode('txsk');
+	cCoerceZenkakuhankaku = FourCharCode('txze');
+	cCoerceKataHiragana = FourCharCode('txkh'); { Lorax things: }
+	cZone = FourCharCode('zone');
+	cMachine = FourCharCode('mach');
+	cAddress = FourCharCode('addr');
+	cRunningAddress = FourCharCode('radd');
+	cStorage = FourCharCode('stor');
 
+const
+{ DateTime things: }
+	pASWeekday = FourCharCode('wkdy');
+	pASMonth = FourCharCode('mnth');
+	pASDay = FourCharCode('day ');
+	pASYear = FourCharCode('year');
+	pASTime = FourCharCode('time');
+	pASDateString = FourCharCode('dstr');
+	pASTimeString = FourCharCode('tstr'); { Months }
+	cMonth = pASMonth;
+	cJanuary = FourCharCode('jan ');
+	cFebruary = FourCharCode('feb ');
+	cMarch = FourCharCode('mar ');
+	cApril = FourCharCode('apr ');
+	cMay = FourCharCode('may ');
+	cJune = FourCharCode('jun ');
+	cJuly = FourCharCode('jul ');
+	cAugust = FourCharCode('aug ');
+	cSeptember = FourCharCode('sep ');
+	cOctober = FourCharCode('oct ');
+	cNovember = FourCharCode('nov ');
+	cDecember = FourCharCode('dec ');
+
+const
+{ Weekdays }
+	cWeekday = pASWeekday;
+	cSunday = FourCharCode('sun ');
+	cMonday = FourCharCode('mon ');
+	cTuesday = FourCharCode('tue ');
+	cWednesday = FourCharCode('wed ');
+	cThursday = FourCharCode('thu ');
+	cFriday = FourCharCode('fri ');
+	cSaturday = FourCharCode('sat '); { AS 1.1 Globals: }
+	pASQuote = FourCharCode('quot');
+	pASSeconds = FourCharCode('secs');
+	pASMinutes = FourCharCode('min ');
+	pASHours = FourCharCode('hour');
+	pASDays = FourCharCode('days');
+	pASWeeks = FourCharCode('week'); { Writing Code things: }
+	cWritingCodeInfo = FourCharCode('citl');
+	pScriptCode = FourCharCode('pscd');
+	pLangCode = FourCharCode('plcd'); { Magic Tell and End Tell events for logging: }
+	kASMagicTellEvent = FourCharCode('tell');
+	kASMagicEndTellEvent = FourCharCode('tend');
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 696 - 179
packages/univint/src/ATSFont.pas


+ 329 - 163
packages/univint/src/ATSLayoutTypes.pas

@@ -1,27 +1,36 @@
 {
-     File:       ATSLayoutTypes.p
+     File:       ATS/ATSLayoutTypes.h
  
      Contains:   Apple Type Services layout public structures and constants.
  
-     Version:    Technology: Mac OS 9/Carbon
-                 Release:    Universal Interfaces 3.4.2
+     Copyright:  © 1994-2008 by Apple Inc., all rights reserved.
  
-     Copyright:  © 1994-2002 by Apple Computer, Inc., all rights reserved.
+     Warning:    *** APPLE INTERNAL USE ONLY ***
+                 This file may contain unreleased API's
  
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
+     BuildInfo:  Built by:            root
+                 On:                  Fri Jul 24 22:21:51 2009
+                 With Interfacer:     3.0d46   (Mac OS X for PowerPC)
+                 From:                ATSLayoutTypes.i
+                     Revision:        1.5
+                     Dated:           2007/01/15 23:28:25
+                     Last change by:  kurita
+                     Last comment:    <rdar://problem/4916090> updated copyright.
  
-                     http://www.freepascal.org/bugs.html
+     Bugs:       Report bugs to Radar component "System Interfaces", "Latest"
+                 List the version information (from above) in the Problem Description.
  
 }
 
+{ Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +39,8 @@
 
 unit ATSLayoutTypes;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +53,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +92,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +176,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,19 +186,61 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,SFNTLayoutTypes,ATSTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
 
+{$ALIGN POWER}
 
-{$ALIGN MAC68K}
 
 { --------------------------------------------------------------------------- }
 { CONSTANTS and related scalar types }
 { --------------------------------------------------------------------------- }
-{ Miscellaneous constants }
+{ --------------------------------------------------------------------------- }
+{ Miscellaneous Constants }
+{ --------------------------------------------------------------------------- }
+const
+	kATSUseGlyphAdvance = $7FFFFFFF; { assignment to use natural glyph advance value }
+	kATSUseLineHeight = $7FFFFFFF; { assignment to use natural line ascent/descent values }
+	kATSNoTracking = $80000000; { negativeInfinity }
+
+{ --------------------------------------------------------------------------- }
 
+{
+ *  Summary:
+ *    These values are passed into the ATSUGetGlyphBounds function to
+ *    indicate whether the width of the resulting typographic glyph
+ *    bounds will be determined using the caret origin, glyph origin in
+ *    device space, or glyph origin in fractional absolute positions
+ }
 const
-  kATSUseGlyphAdvance   = $7FFFFFFF;					{ assignment to use natural glyph advance value }
-	kATSUseLineHeight			= $7FFFFFFF;					{  assignment to use natural line ascent/descent values  }
-	kATSNoTracking				= $80000000;					{  negativeInfinity  }
+{
+   * Specifies that the width of the typographic glyph bounds will be
+   * determined using the caret origin. The caret origin is halfway
+   * between two characters.
+   }
+	kATSUseCaretOrigins = 0;
+
+  {
+   * Specifies that the width of the typographic glyph bounds will be
+   * determined using the glyph origin in device space. This is useful
+   * for adjusting text on the screen.
+   }
+	kATSUseDeviceOrigins = 1;
+
+  {
+   * Specifies that the width of the typographic glyph bounds will be
+   * determined using the glyph origin in fractional absolute
+   * positions, which are uncorrected for device display. This provides
+   * the ideal position of laid-out text and is useful for scaling text
+   * on the screen. This origin is also used to get the width of the
+   * typographic bounding rectangle when you call ATSUMeasureText.
+   }
+	kATSUseFractionalOrigins = 2;
+	kATSUseOriginFlags = 3;
+
+{ ---------------------------------------------------------------------------- }
 
 {
  *  ATSULayoutOperationSelector
@@ -126,45 +249,45 @@ const
  *    This is used to select which operations to override, or which
  *    operation is currently being run.
  }
-type ATSULayoutOperationSelector = UInt32;
+type
+	ATSULayoutOperationSelector = UInt32;
 const
-
-  {
+{
    * No Layout operation is currently selected.
    }
-  kATSULayoutOperationNone      = $00000000;
+	kATSULayoutOperationNone = $00000000;
 
   {
    * Select the Justification operation.
    }
-  kATSULayoutOperationJustification = $00000001;
+	kATSULayoutOperationJustification = $00000001;
 
   {
    * Select the character morphing operation.
    }
-  kATSULayoutOperationMorph     = $00000002;
+	kATSULayoutOperationMorph = $00000002;
 
   {
    * Select the kerning adjustment operation.
    }
-  kATSULayoutOperationKerningAdjustment = $00000004;
+	kATSULayoutOperationKerningAdjustment = $00000004;
 
   {
    * Select the baseline adjustment operation.
    }
-  kATSULayoutOperationBaselineAdjustment = $00000008;
+	kATSULayoutOperationBaselineAdjustment = $00000008;
 
   {
    * Select the tracking adjustment operation.
    }
-  kATSULayoutOperationTrackingAdjustment = $00000010;
+	kATSULayoutOperationTrackingAdjustment = $00000010;
 
   {
    * Select the period of time after ATSUI has finished all of it's
    * layout operations.
    }
-  kATSULayoutOperationPostLayoutAdjustment = $00000020;
-  kATSULayoutOperationAppleReserved = $FFFFFFC0;
+	kATSULayoutOperationPostLayoutAdjustment = $00000020;
+	kATSULayoutOperationAppleReserved = $FFFFFFC0;
 
 { ---------------------------------------------------------------------------- }
 
@@ -176,23 +299,22 @@ const
  *    ATSUDLayoutOperationOverrideUPP callback function in order to
  *    indicate ATSUI's status.
  }
-type ATSULayoutOperationCallbackStatus = UInt32;
+type
+	ATSULayoutOperationCallbackStatus = UInt32;
 const
-
-  {
+{
    * Return this if the callback function has totally handled the
    * operation which triggered the callback and does not need ATSUI to
    * run any further processing for the operation.
    }
-  kATSULayoutOperationCallbackStatusHandled = $00000000;
+	kATSULayoutOperationCallbackStatusHandled = $00000000;
 
   {
    * Return this if the callback function has not totally handled the
    * operation which triggered the callback and needs ATSUI to run it's
    * own processing.
    }
-  kATSULayoutOperationCallbackStatusContinue = $00000001;
-
+	kATSULayoutOperationCallbackStatusContinue = $00000001;
 
 { ---------------------------------------------------------------------------- }
 
@@ -204,94 +326,93 @@ const
  *    via the kATSULineLayoutOptionsTag layout control attribute. They
  *    can also be set in an ATSLineLayoutParams structure.
  }
-type ATSLineLayoutOptions = UInt32;
+type
+	ATSLineLayoutOptions = UInt32;
 const
-
-  {
+{
    * No options specified.
    }
-  kATSLineNoLayoutOptions       = $00000000;
+	kATSLineNoLayoutOptions = $00000000;
 
   {
    * This line option is no longer used.
    }
-  kATSLineIsDisplayOnly         = $00000001; { obsolete option }
+	kATSLineIsDisplayOnly = $00000001; { obsolete option}
 
   {
    * Specifies that no hangers to be formed on the line.
    }
-  kATSLineHasNoHangers          = $00000002;
+	kATSLineHasNoHangers = $00000002;
 
   {
    * Specifies that no optical alignment to be performed on the line.
    }
-  kATSLineHasNoOpticalAlignment = $00000004;
+	kATSLineHasNoOpticalAlignment = $00000004;
 
   {
    * Specifies that space charcters should not be treated as hangers.
    }
-  kATSLineKeepSpacesOutOfMargin = $00000008;
+	kATSLineKeepSpacesOutOfMargin = $00000008;
 
   {
    * Specifies no post-compensation justification is to be performed.
    }
-  kATSLineNoSpecialJustification = $00000010;
+	kATSLineNoSpecialJustification = $00000010;
 
   {
    * Specifies that if the line is the last of a paragraph, it will not
    * get justified.
    }
-  kATSLineLastNoJustification   = $00000020;
+	kATSLineLastNoJustification = $00000020;
 
   {
    * Specifies that the displayed line glyphs will adjust for device
    * metrics.
    }
-  kATSLineFractDisable          = $00000040;
+	kATSLineFractDisable = $00000040;
 
   {
    * Specifies that the carets at the ends of the line will be
    * guarenteed to be perpendicular to the baseline.
    }
-  kATSLineImposeNoAngleForEnds  = $00000080;
+	kATSLineImposeNoAngleForEnds = $00000080;
 
   {
    * Highlights for the line end characters will be extended to 0 and
    * the specified line width.
    }
-  kATSLineFillOutToWidth        = $00000100;
+	kATSLineFillOutToWidth = $00000100;
 
   {
    * Specifies that the tab character width will be automatically
    * adjusted to fit the specified line width.
    }
-  kATSLineTabAdjustEnabled      = $00000200;
+	kATSLineTabAdjustEnabled = $00000200;
 
   {
    * Specifies that any leading value specified by a font will be
    * ignored.
    }
-  kATSLineIgnoreFontLeading     = $00000400;
+	kATSLineIgnoreFontLeading = $00000400;
 
   {
    * Specifies that ATS produce antialiased glyph images despite system
-   * preferences or CGContext settings.
+   * preferences (negates kATSLineNoAntiAliasing bit if set).
    }
-  kATSLineApplyAntiAliasing     = $00000800;
+	kATSLineApplyAntiAliasing = $00000800;
 
   {
    * Specifies that ATS turn-off antialiasing glyph imaging despite
-   * system preferences or CGContext settings (negates
-   * kATSLineApplyAntiAliasing bit if set).
+   * system preferences (negates kATSLineApplyAntiAliasing bit if set).
    }
-  kATSLineNoAntiAliasing        = $00001000;
+	kATSLineNoAntiAliasing = $00001000;
 
   {
    * Specifies that if the line width is not sufficient to hold all its
    * glyphs, glyph positions are allowed to extend beyond the line's
    * assigned width so negative justification is not used.
    }
-  kATSLineDisableNegativeJustification = $00002000;
+	kATSLineDisableNegativeJustification = $00002000;
 
   {
    * Specifies that lines with any integer glyph positioning (due to
@@ -299,63 +420,62 @@ const
    * specified), not automatically esthetically adjust individual
    * character positions while rendering to display.
    }
-  kATSLineDisableAutoAdjustDisplayPos = $00004000;
+	kATSLineDisableAutoAdjustDisplayPos = $00004000;
 
   {
-   * Specifies that rendering be done through Quickdraw (default
-   * rendering in ATSUI is through CoreGraphics on MacOSX).
+   * Specifies that rendering be done simulating Quickdraw rendering
+   * (4-bit pixel aligned antialiasing).
    }
-  kATSLineUseQDRendering        = $00008000;
+	kATSLineUseQDRendering = $00008000;
 
   {
    * Specifies that any Justification operations will not be run.
    }
-  kATSLineDisableAllJustification = $00010000;
+	kATSLineDisableAllJustification = $00010000;
 
   {
    * Specifies that any glyph morphing operations will not be run.
    }
-  kATSLineDisableAllGlyphMorphing = $00020000;
+	kATSLineDisableAllGlyphMorphing = $00020000;
 
   {
    * Specifies that any kerning adjustment operations will not be run.
    }
-  kATSLineDisableAllKerningAdjustments = $00040000;
+	kATSLineDisableAllKerningAdjustments = $00040000;
 
   {
    * Specifies that any baseline adjustment operations will not be run.
    }
-  kATSLineDisableAllBaselineAdjustments = $00080000;
+	kATSLineDisableAllBaselineAdjustments = $00080000;
 
   {
    * Specifies that any tracking adjustment operations will not be run.
    }
-  kATSLineDisableAllTrackingAdjustments = $00100000;
+	kATSLineDisableAllTrackingAdjustments = $00100000;
 
   {
    * Convenience constant for turning-off all adjustments.
    }
-  kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification or kATSLineDisableAllGlyphMorphing or kATSLineDisableAllKerningAdjustments or kATSLineDisableAllBaselineAdjustments or kATSLineDisableAllTrackingAdjustments;
+	kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification or kATSLineDisableAllGlyphMorphing or kATSLineDisableAllKerningAdjustments or kATSLineDisableAllBaselineAdjustments or kATSLineDisableAllTrackingAdjustments;
 
   {
    * Specifies to optimize for displaying text only.  Note, rounded
    * device metrics will be used instead of fractional path metrics.
    }
-  kATSLineUseDeviceMetrics      = $01000000;
+	kATSLineUseDeviceMetrics = $01000000;
 
   {
    * Specifies that line breaking should occur at the nearest
    * character, not word.  This could cause a word to be split among
    * multiple lines.
    }
-  kATSLineBreakToNearestCharacter = $02000000;
+	kATSLineBreakToNearestCharacter = $02000000;
 
   {
    * These bits are reserved by Apple and will result in a invalid
    * value error if attemped to set. Obsolete constants:
    }
-  kATSLineAppleReserved         = $FCE00000;
-
+	kATSLineAppleReserved = $FCE00000;
 
 { --------------------------------------------------------------------------- }
 
@@ -367,45 +487,49 @@ const
  *    attribute tag kATSUStyleRenderingOptions. They provide finer
  *    control over how the style is rendered.
  }
-type ATSStyleRenderingOptions = UInt32;
+type
+	ATSStyleRenderingOptions = UInt32;
 const
-
-  {
+{
    * No options specified.
    }
-  kATSStyleNoOptions            = $00000000;
+	kATSStyleNoOptions = $00000000;
 
   {
    * Specifies that ATS produce "unhinted" glyph outlines (default is
    * hinted glyph outlines).
    }
-  kATSStyleNoHinting            = $00000001;
+	kATSStyleNoHinting = $00000001;
 
   {
    * Specifies that ATS produce antialiased glyph images despite system
-   * preferences or CGContext settings.
+   * preferences or LineLayoutOptions (negates kATSStyleNoAntiAliasing
+   * bit if set).
    }
-  kATSStyleApplyAntiAliasing    = $00000002;
+	kATSStyleApplyAntiAliasing = $00000002;
 
   {
    * Specifies that ATS turn-off antialiasing glyph imaging despite
-   * system preferences or CGContext settings (negates
+   * system preferences or LineLayoutOptions (negates
    * kATSStyleApplyAntiAliasing bit if set).
    }
-  kATSStyleNoAntiAliasing       = $00000004;
+	kATSStyleNoAntiAliasing = $00000004;
 
   {
    * These bits are reserved by Apple and will result in a invalid
    * value error if attemped to set.
    }
-  kATSStyleAppleReserved        = $FFFFFFF8;
+	kATSStyleAppleReserved = $FFFFFFF8;
 
   {
    * (OBSOLETE) Specifies that ATS produce "hinted" glyph outlines (the
    * default behavior). THIS NAME IS OBSOLETE. DO NOT USE. It's only
    * left in for backwards compatibility.
    }
-  kATSStyleApplyHints           = kATSStyleNoOptions;
+	kATSStyleApplyHints = kATSStyleNoOptions;
+
+{ --------------------------------------------------------------------------- }
+
 
 {
  *  ATSGlyphInfoFlags
@@ -416,45 +540,45 @@ const
  *    The are used by the layout engine to flag a glyph with specific
  *    properties.
  }
-type ATSGlyphInfoFlags = UInt32;
+type
+	ATSGlyphInfoFlags = UInt32;
 const
-
-  {
+{
    * These bits are Apple reserved and may result in an invalid value
    * error if attempted to set.
    }
-  kATSGlyphInfoAppleReserved    = $1FFBFFE8;
+	kATSGlyphInfoAppleReserved = $1FFBFFE8;
 
   {
    * The glyph attaches to another glyph.
    }
-  kATSGlyphInfoIsAttachment     = $80000000;
+	kATSGlyphInfoIsAttachment = $80000000;
 
   {
    * The glyph can hang off left/top edge of line.
    }
-  kATSGlyphInfoIsLTHanger       = $40000000;
+	kATSGlyphInfoIsLTHanger = $40000000;
 
   {
    * The glyph can hang off right/bottom edge of line.
    }
-  kATSGlyphInfoIsRBHanger       = $20000000;
+	kATSGlyphInfoIsRBHanger = $20000000;
 
   {
    * The glyph is not really a glyph at all, but an end-marker designed
    * to allow the calculation of the previous glyph's advance.
    }
-  kATSGlyphInfoTerminatorGlyph  = $00080000;
+	kATSGlyphInfoTerminatorGlyph = $00080000;
 
   {
    * The glyph is a white space glyph.
    }
-  kATSGlyphInfoIsWhiteSpace     = $00040000;
+	kATSGlyphInfoIsWhiteSpace = $00040000;
 
   {
    * Glyph has a style specified imposed width (i.e. advance)
    }
-  kATSGlyphInfoHasImposedWidth  = $00000010;
+	kATSGlyphInfoHasImposedWidth = $00000010;
 
   {
    * A three-bit mask, that can be used to get the size of the original
@@ -462,83 +586,114 @@ const
    * with this mask and an ATSGlyphInfoFlags variable, it will yield
    * the size in bytes of the original character (0 - 7 bytes possible).
    }
-  kATSGlyphInfoByteSizeMask     = $00000007;
-
+	kATSGlyphInfoByteSizeMask = $00000007;
 
 { --------------------------------------------------------------------------- }
+{ STRUCTURED TYPES and related constants }
+{ --------------------------------------------------------------------------- }
 
 {
+ *  ATSLayoutRecord
+ *  
  *  Summary:
- *    These values are passed into the ATSUGetGlyphBounds function to
- *    indicate whether the width of the resulting typographic glyph
- *    bounds will be determined using the caret origin, glyph origin in
- *    device space, or glyph origin in fractional absolute positions
+ *    The ATSLayoutRecord structure defines all the needed info for a
+ *    single glyph during the layout process.  This struct must be
+ *    declared as the first element of an enclosing glyph record struct
+ *    defined by ATSUI DirectAccess clients.
  }
-const
+type
+	ATSLayoutRecord = record
+{
+   * The glyph ID reference.
+   }
+		glyphID: ATSGlyphRef;
 
   {
-   * Specifies that the width of the typographic glyph bounds will be
-   * determined using the caret origin. The caret origin is halfway
-   * between two characters.
+   * These flags describe the individual state of the glyph (see above).
    }
-  kATSUseCaretOrigins           = 0;
+		flags: ATSGlyphInfoFlags;
 
   {
-   * Specifies that the width of the typographic glyph bounds will be
-   * determined using the glyph origin in device space. This is useful
-   * for adjusting text on the screen.
+   * The byte offset of the original character that spawned this glyph.
    }
-  kATSUseDeviceOrigins          = 1;
+		originalOffset: ByteCount;
 
   {
-   * Specifies that the width of the typographic glyph bounds will be
-   * determined using the glyph origin in fractional absolute
-   * positions, which are uncorrected for device display. This provides
-   * the ideal position of laid-out text and is useful for scaling text
-   * on the screen. This origin is also used to get the width of the
-   * typographic bounding rectangle when you call ATSUMeasureText.
+   * This is the real position that the glyph sits.
    }
-  kATSUseFractionalOrigins      = 2;
-  kATSUseOriginFlags            = 3;
-
-
-	{	 --------------------------------------------------------------------------- 	}
-	{	 STRUCTURED TYPES and related constants 	}
-	{	 --------------------------------------------------------------------------- 	}
-
-	{	
-	    The ATSTrapezoid structure supplies a convenient container
-	    for glyph bounds in trapezoidal form.
-		}
+		realPos: Fixed;
+	end;
+	ATSLayoutRecordPtr = ^ATSLayoutRecord;
+	
+{ --------------------------------------------------------------------------- }
 
+{
+ *  ATSTrapezoid
+ *  
+ *  Summary:
+ *    The ATSTrapezoid structure supplies a convenient container for
+ *    glyph bounds in trapezoidal form.
+ }
 type
-	ATSTrapezoidPtr = ^ATSTrapezoid;
 	ATSTrapezoid = record
-		upperLeft:				FixedPoint;
-		upperRight:				FixedPoint;
-		lowerRight:				FixedPoint;
-		lowerLeft:				FixedPoint;
+		upperLeft: FixedPoint;
+		upperRight: FixedPoint;
+		lowerRight: FixedPoint;
+		lowerLeft: FixedPoint;
 	end;
+	ATSTrapezoidPtr = ^ATSTrapezoid;
+	
+{ --------------------------------------------------------------------------- }
 
-	{	
-	    The JustWidthDeltaEntryOverride structure specifies values for the grow and shrink case during
-	    justification, both on the left and on the right. It also contains flags.  This particular structure
-	    is used for passing justification overrides to LLC.  For further sfnt resource 'just' table
-	    constants and structures, see SFNTLayoutTypes.h.
-		}
-	ATSJustWidthDeltaEntryOverridePtr = ^ATSJustWidthDeltaEntryOverride;
+{
+ *  ATSJustWidthDeltaEntryOverride
+ *  
+ *  Summary:
+ *    The JustWidthDeltaEntryOverride structure specifies values for
+ *    the grow and shrink case during justification, both on the left
+ *    and on the right. It also contains flags.  This particular
+ *    structure is used for passing justification overrides to LLC. For
+ *    further sfnt resource 'just' table constants and structures, see
+ *    SFNTLayoutTypes.h.
+ }
+type
 	ATSJustWidthDeltaEntryOverride = record
-		beforeGrowLimit:		Fixed;									{  ems AW can grow by at most on LT  }
-		beforeShrinkLimit:		Fixed;									{  ems AW can shrink by at most on LT  }
-		afterGrowLimit:			Fixed;									{  ems AW can grow by at most on RB  }
-		afterShrinkLimit:		Fixed;									{  ems AW can shrink by at most on RB  }
-		growFlags:				JustificationFlags;						{  flags controlling grow case  }
-		shrinkFlags:			JustificationFlags;						{  flags controlling shrink case  }
-	end;
+{
+   * ems AW can grow by at most on LT
+   }
+		beforeGrowLimit: Fixed;
 
-	{	 The JustPriorityOverrides type is an array of 4 width delta records, one per priority level override. 	}
-	ATSJustPriorityWidthDeltaOverrides	= array [0..3] of ATSJustWidthDeltaEntryOverride;
-	{	 --------------------------------------------------------------------------- 	}
+  {
+   * ems AW can shrink by at most on LT
+   }
+		beforeShrinkLimit: Fixed;
+
+  {
+   * ems AW can grow by at most on RB
+   }
+		afterGrowLimit: Fixed;
+
+  {
+   * ems AW can shrink by at most on RB
+   }
+		afterShrinkLimit: Fixed;
+
+  {
+   * flags controlling grow case
+   }
+		growFlags: JustificationFlags;
+
+  {
+   * flags controlling shrink case
+   }
+		shrinkFlags: JustificationFlags;
+	end;
+	ATSJustWidthDeltaEntryOverridePtr = ^ATSJustWidthDeltaEntryOverride;
+	
+{ The JustPriorityOverrides type is an array of 4 width delta records, one per priority level override. }
+	ATSJustPriorityWidthDeltaOverrides = array[0..3] of ATSJustWidthDeltaEntryOverride;
+	
+{ ---------------------------------------------------------------------------- }
 
 {
  *  ATSULineRef
@@ -551,7 +706,8 @@ type
  *    only time the line ref is valid is inside of the callback.
  }
 type
-	ATSULineRef    = ^SInt32; { an opaque 32-bit type }
+	ATSGlyphVector = record end;
+	ATSULineRef = ^ATSGlyphVector;
 { ---------------------------------------------------------------------------- }
 { DirectAccess Layout Callback Definitions                                     }
 { ---------------------------------------------------------------------------- }
@@ -590,10 +746,10 @@ type
  *    error. ATSULayoutOperationSelector and
  *    ATSULayoutOperationCallbackStatus are defined in ATSLayoutTypes.i.
  }
-type ATSUDirectLayoutOperationOverrideProcPtr = function( iCurrentOperation: ATSULayoutOperationSelector; iLineRef: ATSULineRef; iRefCon: UInt32; iOperationCallbackParameterPtr: UnivPtr; var oCallbackStatus: ATSULayoutOperationCallbackStatus ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSUDirectLayoutOperationOverrideProcPtr)  ATSUDirectLayoutOperationOverrideUPP;
-type ATSUDirectLayoutOperationOverrideUPP = Ptr;
+type
+	ATSUDirectLayoutOperationOverrideProcPtr = function( iCurrentOperation: ATSULayoutOperationSelector; iLineRef: ATSULineRef; iRefCon: URefCon; iOperationCallbackParameterPtr: UnivPtr; var oCallbackStatus: ATSULayoutOperationCallbackStatus ): OSStatus;
+	ATSUDirectLayoutOperationOverrideUPP = ATSUDirectLayoutOperationOverrideProcPtr;
+
 {
  *  NewATSUDirectLayoutOperationOverrideUPP()
  *  
@@ -602,8 +758,8 @@ type ATSUDirectLayoutOperationOverrideUPP = Ptr;
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 function NewATSUDirectLayoutOperationOverrideUPP( userRoutine: ATSUDirectLayoutOperationOverrideProcPtr ): ATSUDirectLayoutOperationOverrideUPP; external name '_NewATSUDirectLayoutOperationOverrideUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
 {
  *  DisposeATSUDirectLayoutOperationOverrideUPP()
@@ -613,8 +769,8 @@ function NewATSUDirectLayoutOperationOverrideUPP( userRoutine: ATSUDirectLayoutO
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 procedure DisposeATSUDirectLayoutOperationOverrideUPP( userUPP: ATSUDirectLayoutOperationOverrideUPP ); external name '_DisposeATSUDirectLayoutOperationOverrideUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
 
 {
  *  InvokeATSUDirectLayoutOperationOverrideUPP()
@@ -624,8 +780,16 @@ procedure DisposeATSUDirectLayoutOperationOverrideUPP( userUPP: ATSUDirectLayout
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function InvokeATSUDirectLayoutOperationOverrideUPP( iCurrentOperation: ATSULayoutOperationSelector; iLineRef: ATSULineRef; iRefCon: UInt32; iOperationCallbackParameterPtr: UnivPtr; var oCallbackStatus: ATSULayoutOperationCallbackStatus; userUPP: ATSUDirectLayoutOperationOverrideUPP ): OSStatus; external name '_InvokeATSUDirectLayoutOperationOverrideUPP';
+function InvokeATSUDirectLayoutOperationOverrideUPP( iCurrentOperation: ATSULayoutOperationSelector; iLineRef: ATSULineRef; iRefCon: URefCon; iOperationCallbackParameterPtr: UnivPtr; var oCallbackStatus: ATSULayoutOperationCallbackStatus; userUPP: ATSUDirectLayoutOperationOverrideUPP ): OSStatus; external name '_InvokeATSUDirectLayoutOperationOverrideUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+{
+#if __MACH__
+    #define NewATSUDirectLayoutOperationOverrideUPP(userRoutine) ((ATSUDirectLayoutOperationOverrideUPP)userRoutine)
+    #define DisposeATSUDirectLayoutOperationOverrideUPP(userUPP)
+    #define InvokeATSUDirectLayoutOperationOverrideUPP(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus, userUPP) (*userUPP)(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus)
+#endif
+}
 
 { ---------------------------------------------------------------------------- }
 
@@ -640,17 +804,19 @@ function InvokeATSUDirectLayoutOperationOverrideUPP( iCurrentOperation: ATSULayo
  }
 type
 	ATSULayoutOperationOverrideSpecifier = record
-			{
-			 * A bitfield containing the selector for the operations in which the
-			 * callback will be installed for.
-			 }
+{
+   * A bitfield containing the selector for the operations in which the
+   * callback will be installed for.
+   }
 		operationSelector: ATSULayoutOperationSelector;
 		overrideUPP: ATSUDirectLayoutOperationOverrideUPP;
 	end;
 	ATSULayoutOperationOverrideSpecifierPtr = ^ATSULayoutOperationOverrideSpecifier;
+	
+//#pragma pack(pop)
 
-
-{$ALIGN MAC68K}
-
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 326 - 191
packages/univint/src/ATSTypes.pas

@@ -1,27 +1,36 @@
 {
-     File:       ATSTypes.p
+     File:       ATS/ATSTypes.h
  
      Contains:   Public interfaces for Apple Type Services components.
  
-     Version:    Technology: Mac OS 9 / Carbon
-                 Release:    Universal Interfaces 3.4.2
+     Copyright:  © 1997-2008 by Apple Inc., all rights reserved.
  
-     Copyright:  © 1997-2002 by Apple Computer, Inc., all rights reserved.
+     Warning:    *** APPLE INTERNAL USE ONLY ***
+                 This file may contain unreleased API's
  
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
+     BuildInfo:  Built by:            root
+                 On:                  Fri Jul 24 22:21:51 2009
+                 With Interfacer:     3.0d46   (Mac OS X for PowerPC)
+                 From:                ATSTypes.i
+                     Revision:        1.14
+                     Dated:           2007/04/24 03:44:18
+                     Last change by:  juliog
+                     Last comment:    <rdar://problem/5152407> File based filter for 64bit causes binary
  
-                     http://www.freepascal.org/bugs.html
+     Bugs:       Report bugs to Radar component "System Interfaces", "Latest"
+                 List the version information (from above) in the Problem Description.
  
 }
 
+{ Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +39,8 @@
 
 unit ATSTypes;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +53,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +92,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +176,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,291 +185,345 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,Files,MixedMode;
+uses MacTypes,Files,CGBase,CGGeometry;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
 
 {$ALIGN MAC68K}
 
 
+//#pragma pack(push, 2)
+
+
+{$ifc TARGET_CPU_64}
+type
+	ATSPoint = CGPoint;
+{$elsec}
+type
+	ATSPoint = Float32Point;
+{$endc}  { TARGET_CPU_64 }
+
+{$ifc TARGET_CPU_64}
+{
+   ATSFSSpec serves as a temporary place holder for the FSSpec data type which is deprecated for 64-bit. 
+   A 64-bit replacement for FSSpec based APIs will be introduced.  
+}
+type
+	ATSFSSpec = record
+		vRefNum: FSVolumeRefNum;
+		parID: SInt32;
+		name: StrFileName;
+	end;
+{$elsec}
 type
-	FMGeneration						= UInt32;
-	{	 The FMFontFamily reference represents a collection of fonts with the same design
-	   characteristics. It replaces the standard QuickDraw font identifer and may be used
-	   with all QuickDraw functions including GetFontName and TextFont. It cannot be used
-	   with the Resource Manager to access information from a FOND resource handle. A font
-	   reference does not imply a particular script system, nor is the character encoding
-	   of a font family determined by an arithmetic mapping of its value.
-		}
-	FMFontFamily						= SInt16;
-	FMFontStyle							= SInt16;
-	FMFontStylePtr						= ^FMFontStyle; { when a VAR xx: FMFontStyle parameter can be nil, it is changed to xx: FMFontStylePtr }
-	FMFontSize							= SInt16;
-	FMFontSizePtr						= ^FMFontSize; { when a VAR xx: FMFontSize parameter can be nil, it is changed to xx: FMFontSizePtr }
-	{	 
-	   The font family is a collection of fonts, each of which is identified
-	   by an FMFont reference that maps to a single object registered with
-	   the font database. The font references associated with the font
-	   family consist of individual outline and bitmapped fonts that may be
-	   used with the font access routines of the Font Manager and ATS.
-		}
-	FMFont								= UInt32;
-	FMFontPtr							= ^FMFont; { when a VAR xx: FMFont parameter can be nil, it is changed to xx: FMFontPtr }
+	ATSFSSpec = FSSpec;
+{$endc}  { TARGET_CPU_64 }
+	
+	ATSFSSpecPtr = ^ATSFSSpec;
+	
+{ FMGeneration }
+
+	FMGeneration = UInt32;
+{ The FMFontFamily reference represents a collection of fonts with the same design
+   characteristics. It replaces the standard QuickDraw font identifer and may be used
+   with all QuickDraw functions including GetFontName and TextFont. It cannot be used
+   with the Resource Manager to access information from a FOND resource handle. A font
+   reference does not imply a particular script system, nor is the character encoding
+   of a font family determined by an arithmetic mapping of its value.
+}
+
+	FMFontFamily = SInt16;
+	FMFontFamilyPtr = ^FMFontFamily;
+	
+	FMFontStyle = SInt16;
+	FMFontStylePtr = ^FMFontStyle;
+	
+	FMFontSize = SInt16;
+	FMFontSizePtr = ^FMFontSize;
+	
+{ 
+   The font family is a collection of fonts, each of which is identified
+   by an FMFont reference that maps to a single object registered with
+   the font database. The font references associated with the font
+   family consist of individual outline and bitmapped fonts that may be
+   used with the font access routines of the Font Manager and ATS.
+}
+
+	FMFont = UInt32;
+	FMFontPtr = ^FMFont;
+	
 	FMFontFamilyInstancePtr = ^FMFontFamilyInstance;
 	FMFontFamilyInstance = record
-		fontFamily:				FMFontFamily;
-		fontStyle:				FMFontStyle;
+		fontFamily: FMFontFamily;
+		fontStyle: FMFontStyle;
 	end;
 
-	FMFontFamilyIteratorPtr = ^FMFontFamilyIterator;
 	FMFontFamilyIterator = record
-		reserved:				array [0..15] of UInt32;
+		reserved: array[0..15] of UInt32;
 	end;
+	FMFontFamilyIteratorPtr = ^FMFontFamilyIterator;
+
 
-	FMFontIteratorPtr = ^FMFontIterator;
 	FMFontIterator = record
-		reserved:				array [0..15] of UInt32;
+		reserved: array[0..15] of UInt32;
 	end;
+	FMFontIteratorPtr = ^FMFontIterator;
+	
 
-	FMFontFamilyInstanceIteratorPtr = ^FMFontFamilyInstanceIterator;
 	FMFontFamilyInstanceIterator = record
-		reserved:				array [0..15] of UInt32;
+		reserved: array[0..15] of UInt32;
 	end;
-
-
+	FMFontFamilyInstanceIteratorPtr = ^FMFontFamilyInstanceIterator;
+	
 const
-	kInvalidGeneration			= 0;
-	kInvalidFontFamily			= -1;
-	kInvalidFont				= 0;
+	kInvalidGeneration = 0;
+	kInvalidFontFamily = -1;
+	kInvalidFont = 0;
 
-	kFMCurrentFilterFormat		= 0;
 
-	{	 kFMDefaultOptions & kFMUseGlobalScopeOption moved to Fonts.h 	}
+	kFMCurrentFilterFormat = 0;
 
 type
-	FMFilterSelector 			= UInt32;
+	FMFilterSelector = UInt32;
 const
 	kFMFontTechnologyFilterSelector = 1;
 	kFMFontContainerFilterSelector = 2;
-	kFMGenerationFilterSelector	= 3;
+	kFMGenerationFilterSelector = 3;
 	kFMFontFamilyCallbackFilterSelector = 4;
 	kFMFontCallbackFilterSelector = 5;
 	kFMFontDirectoryFilterSelector = 6;
+	kFMFontFileRefFilterSelector = 10;
 
-	kFMTrueTypeFontTechnology	= FourCharCode('true');
-	kFMPostScriptFontTechnology	= FourCharCode('typ1');
 
+	kFMTrueTypeFontTechnology = FourCharCode('true');
+	kFMPostScriptFontTechnology = FourCharCode('typ1');
 
 type
-{$ifc TYPED_FUNCTION_POINTERS}
-	FMFontFamilyCallbackFilterProcPtr = function(iFontFamily: FMFontFamily; iRefCon: UnivPtr): OSStatus;
-{$elsec}
-	FMFontFamilyCallbackFilterProcPtr = ProcPtr;
-{$endc}
+	FMFontFamilyCallbackFilterProcPtr = function( iFontFamily: FMFontFamily; iRefCon: UnivPtr ): OSStatus;
+	FMFontCallbackFilterProcPtr = function( iFont: FMFont; iRefCon: UnivPtr ): OSStatus;
+	FMFontFamilyCallbackFilterUPP = FMFontFamilyCallbackFilterProcPtr;
+	FMFontCallbackFilterUPP = FMFontCallbackFilterProcPtr;
 
-{$ifc TYPED_FUNCTION_POINTERS}
-	FMFontCallbackFilterProcPtr = function(iFont: FMFont; iRefCon: UnivPtr): OSStatus;
-{$elsec}
-	FMFontCallbackFilterProcPtr = ProcPtr;
-{$endc}
-
-{$ifc OPAQUE_UPP_TYPES}
-	FMFontFamilyCallbackFilterUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	FMFontFamilyCallbackFilterUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	FMFontCallbackFilterUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	FMFontCallbackFilterUPP = UniversalProcPtr;
-{$endc}	
+{
+ *  NewFMFontFamilyCallbackFilterUPP()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
+ }
+function NewFMFontFamilyCallbackFilterUPP( userRoutine: FMFontFamilyCallbackFilterProcPtr ): FMFontFamilyCallbackFilterUPP; external name '_NewFMFontFamilyCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-const
-	uppFMFontFamilyCallbackFilterProcInfo = $000003B0;
-	uppFMFontCallbackFilterProcInfo = $000003F0;
-	{
-	 *  NewFMFontFamilyCallbackFilterUPP()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   available as macro/inline
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function NewFMFontFamilyCallbackFilterUPP(userRoutine: FMFontFamilyCallbackFilterProcPtr): FMFontFamilyCallbackFilterUPP; external name '_NewFMFontFamilyCallbackFilterUPP'; { old name was NewFMFontFamilyCallbackFilterProc }
 {
  *  NewFMFontCallbackFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewFMFontCallbackFilterUPP(userRoutine: FMFontCallbackFilterProcPtr): FMFontCallbackFilterUPP; external name '_NewFMFontCallbackFilterUPP'; { old name was NewFMFontCallbackFilterProc }
+function NewFMFontCallbackFilterUPP( userRoutine: FMFontCallbackFilterProcPtr ): FMFontCallbackFilterUPP; external name '_NewFMFontCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeFMFontFamilyCallbackFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeFMFontFamilyCallbackFilterUPP(userUPP: FMFontFamilyCallbackFilterUPP); external name '_DisposeFMFontFamilyCallbackFilterUPP';
+procedure DisposeFMFontFamilyCallbackFilterUPP( userUPP: FMFontFamilyCallbackFilterUPP ); external name '_DisposeFMFontFamilyCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  DisposeFMFontCallbackFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeFMFontCallbackFilterUPP(userUPP: FMFontCallbackFilterUPP); external name '_DisposeFMFontCallbackFilterUPP';
+procedure DisposeFMFontCallbackFilterUPP( userUPP: FMFontCallbackFilterUPP ); external name '_DisposeFMFontCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeFMFontFamilyCallbackFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeFMFontFamilyCallbackFilterUPP(iFontFamily: FMFontFamily; iRefCon: UnivPtr; userRoutine: FMFontFamilyCallbackFilterUPP): OSStatus; external name '_InvokeFMFontFamilyCallbackFilterUPP'; { old name was CallFMFontFamilyCallbackFilterProc }
+function InvokeFMFontFamilyCallbackFilterUPP( iFontFamily: FMFontFamily; iRefCon: UnivPtr; userUPP: FMFontFamilyCallbackFilterUPP ): OSStatus; external name '_InvokeFMFontFamilyCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
  *  InvokeFMFontCallbackFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeFMFontCallbackFilterUPP(iFont: FMFont; iRefCon: UnivPtr; userRoutine: FMFontCallbackFilterUPP): OSStatus; external name '_InvokeFMFontCallbackFilterUPP'; { old name was CallFMFontCallbackFilterProc }
+function InvokeFMFontCallbackFilterUPP( iFont: FMFont; iRefCon: UnivPtr; userUPP: FMFontCallbackFilterUPP ): OSStatus; external name '_InvokeFMFontCallbackFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+{
+#if __MACH__
+    #define NewFMFontFamilyCallbackFilterUPP(userRoutine)       ((FMFontFamilyCallbackFilterUPP)userRoutine)
+    #define NewFMFontCallbackFilterUPP(userRoutine)             ((FMFontCallbackFilterUPP)userRoutine)
+    #define DisposeFMFontFamilyCallbackFilterUPP(userUPP)
+    #define DisposeFMFontCallbackFilterUPP(userUPP)
+    #define InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userUPP) (*userUPP)(iFontFamily, iRefCon)
+    #define InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userUPP) (*userUPP)(iFont, iRefCon)
+#endif
+}
 type
-	FMFontDirectoryFilterPtr = ^FMFontDirectoryFilter;
 	FMFontDirectoryFilter = record
-		fontFolderDomain:		SInt16;
-		reserved:				array [0..1] of UInt32;
+		fontFolderDomain: SInt16;
+		reserved: array[0..1] of UInt32;
 	end;
-
-	FMFilterPtr = ^FMFilter;
+	FMFontDirectoryFilterPtr = ^FMFontDirectoryFilter;
+	
+{
+   Note: The fontContainerFilter member is not available in 64-bit. Use fontFileRefFilter
+   and the kFMFontFileRefFilterSelector enum instead.
+}
+type
+	FMFilterfilter = record
+		case Byte of
+			0:	(fontTechnologyFilter: FourCharCode);
+			1:	(fontContainerFilter: ATSFSSpec);
+			2:	(generationFilter: FMGeneration);
+			3:	(fontFamilyCallbackFilter: FMFontFamilyCallbackFilterUPP);
+			4:	(fontCallbackFilter: FMFontCallbackFilterUPP);
+			5:	(fontDirectoryFilter: FMFontDirectoryFilter);
+			6:	(fontFileRefFilter: { const } FSRefPtr);
+	end;
+	
 	FMFilter = record
-		format:					UInt32;
-		selector:				FMFilterSelector;
-		case SInt16 of
-		0: (
-			fontTechnologyFilter: FourCharCode;
-			);
-		1: (
-			fontContainerFilter: FSSpec;
-			);
-		2: (
-			generationFilter:	FMGeneration;
-			);
-		3: (
-			fontFamilyCallbackFilter: FMFontFamilyCallbackFilterUPP;
-			);
-		4: (
-			fontCallbackFilter:	FMFontCallbackFilterUPP;
-			);
-		5: (
-			fontDirectoryFilter: FMFontDirectoryFilter;
-			);
+		format: UInt32;
+		selector: FMFilterSelector;
+		filter : FMFilterfilter;
 	end;
+	FMFilterPtr = ^FMFilter;
+	
+	ATSOptionFlags = OptionBits;
+	ATSGeneration = UInt32;
+	ATSFontContainerRef = UInt32;
+	
+	ATSFontFamilyRef = UInt32;
+	ATSFontFamilyRefPtr = ^ATSFontFamilyRef;
+	
+	ATSFontRef = UInt32;
+	ATSFontRefPtr = ^ATSFontRef;
+
+	ATSGlyphRef = UInt16;
+	ATSGlyphRefPtr = ^ATSGlyphRef;
+	
+	ATSFontSize = CGFloat;
+	ATSFontFormat = UInt32;
+const
+	kATSFontFormatUnspecified = 0;
 
-	ATSOptionFlags						= OptionBits;
-	ATSGeneration						= UInt32;
-	ATSFontContainerRef					= UInt32;
-	ATSFontFamilyRef					= UInt32;
-	ATSFontRef							= UInt32;
-	ATSGlyphRef							= UInt16;
-	ATSFontSize							= Float32;
 
-const
-	kATSGenerationUnspecified	= 0;
+	kATSGenerationUnspecified = 0;
 	kATSFontContainerRefUnspecified = 0;
 	kATSFontFamilyRefUnspecified = 0;
-	kATSFontRefUnspecified		= 0;
-
+	kATSFontRefUnspecified = 0;
 
+{
+    ATSFontMetrics measurements are relative to a font's point size.
+    For example, when a font with an ATSFontMetrics ascent of 0.6 is drawn at 18 points, its actual ascent is (0.6 * 18) = 10.8 points.
+}
 type
-	ATSFontMetricsPtr = ^ATSFontMetrics;
 	ATSFontMetrics = record
-		version:				UInt32;
-		ascent:					Float32;								{  Maximum height above baseline reached by the glyphs in the font  }
-																		{  or maximum distance to the right of the centerline reached by the glyphs in the font  }
-		descent:				Float32;								{  Maximum depth below baseline reached by the glyphs in the font  }
-																		{  or maximum distance to the left of the centerline reached by the glyphs in the font  }
-		leading:				Float32;								{  Desired spacing between lines of text  }
-		avgAdvanceWidth:		Float32;
-		maxAdvanceWidth:		Float32;								{  Maximum advance width or height of the glyphs in the font  }
-		minLeftSideBearing:		Float32;								{  Minimum left or top side bearing  }
-		minRightSideBearing:	Float32;								{  Minimum right or bottom side bearing  }
-		stemWidth:				Float32;								{  Width of the dominant vertical stems of the glyphs in the font  }
-		stemHeight:				Float32;								{  Vertical width of the dominant horizontal stems of glyphs in the font  }
-		capHeight:				Float32;								{  Height of a capital letter from the baseline to the top of the letter  }
-		xHeight:				Float32;								{  Height of lowercase characters in a font, specifically the letter x, excluding ascenders and descenders  }
-		italicAngle:			Float32;								{  Angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the glyphs in the font  }
-		underlinePosition:		Float32;								{  Distance from the baseline for positioning underlining strokes  }
-		underlineThickness:		Float32;								{  Stroke width for underlining  }
+		version: UInt32;
+		ascent: CGFloat;                 { Maximum height above baseline reached by the glyphs in the font }
+                                              { or maximum distance to the right of the centerline reached by the glyphs in the font }
+		descent: CGFloat;                { Maximum depth below baseline reached by the glyphs in the font }
+                                              { or maximum distance to the left of the centerline reached by the glyphs in the font }
+		leading: CGFloat;                { Desired spacing between lines of text }
+		avgAdvanceWidth: CGFloat;
+		maxAdvanceWidth: CGFloat;        { Maximum advance width or height of the glyphs in the font }
+		minLeftSideBearing: CGFloat;     { Minimum left or top side bearing }
+		minRightSideBearing: CGFloat;    { Minimum right or bottom side bearing }
+		stemWidth: CGFloat;              { Width of the dominant vertical stems of the glyphs in the font }
+		stemHeight: CGFloat;             { Vertical width of the dominant horizontal stems of glyphs in the font }
+		capHeight: CGFloat;              { Height of a capital letter from the baseline to the top of the letter }
+		xHeight: CGFloat;                { Height of lowercase characters in a font, specifically the letter x, excluding ascenders and descenders }
+		italicAngle: CGFloat;            { Angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the glyphs in the font }
+		underlinePosition: CGFloat;      { Distance from the baseline for positioning underlining strokes }
+		underlineThickness: CGFloat;     { Stroke width for underlining }
 	end;
-
-
+	ATSFontMetricsPtr = ^ATSFontMetrics;
+	
 const
-	kATSItalicQDSkew			= $00004000;					{  fixed value of 0.25  }
-	kATSBoldQDStretch			= $00018000;					{  fixed value of 1.50  }
-	kATSRadiansFactor			= 1144;							{  fixed value of approx. pi/180 (0.0174560546875)  }
-
-	{	 Glyph outline path constants used in ATSFontGetNativeCurveType. 	}
+	kATSItalicQDSkew = (1 shl 16) / 4; { fixed value of 0.25 }
+	kATSBoldQDStretch = (1 shl 16) * 3 / 2; { fixed value of 1.50 }
+	kATSRadiansFactor = 1144;  { fixed value of approx. pi/180 (0.0174560546875) }
 
+{ Glyph outline path constants used in ATSFontGetNativeCurveType. }
 type
-	ATSCurveType 				= UInt16;
+	ATSCurveType = UInt16;
 const
-	kATSCubicCurveType			= $0001;
-	kATSQuadCurveType			= $0002;
-	kATSOtherCurveType			= $0003;
+	kATSCubicCurveType = $0001;
+	kATSQuadCurveType = $0002;
+	kATSOtherCurveType = $0003;
 
 { 
     This is what the ATSGlyphRef is set to when the glyph is deleted -
     that is, when the glyph is set to no longer appear when the layout
     is actually drawn
 }
-const
-  kATSDeletedGlyphcode          = $FFFF;
 
+	kATSDeletedGlyphcode = $FFFF;
 
 type
 	ATSUCurvePathPtr = ^ATSUCurvePath;
 	ATSUCurvePath = record
-		vectors:				UInt32;
-		controlBits:			array [0..0] of UInt32;
-		vector:					array [0..0] of Float32Point;
+		vectors: UInt32;
+  		controlBits: array[0..0] of UInt32;
+        vector: array[0..0] of ATSPoint;
 	end;
 
 	ATSUCurvePathsPtr = ^ATSUCurvePaths;
 	ATSUCurvePaths = record
-		contours:				UInt32;
-		contour:				array [0..0] of ATSUCurvePath;
+		contours: UInt32;
+        contour: array[0..0] of ATSUCurvePath;
 	end;
+{ Glyph ideal metrics }
 
-	{	 Glyph ideal metrics 	}
 	ATSGlyphIdealMetricsPtr = ^ATSGlyphIdealMetrics;
 	ATSGlyphIdealMetrics = record
-		advance:				Float32Point;
-		sideBearing:			Float32Point;
-		otherSideBearing:		Float32Point;
+		advance: ATSPoint;
+		sideBearing: ATSPoint;
+		otherSideBearing: ATSPoint;
 	end;
+{ Glyph screen metrics }
 
-	{	 Glyph screen metrics 	}
 	ATSGlyphScreenMetricsPtr = ^ATSGlyphScreenMetrics;
 	ATSGlyphScreenMetrics = record
-		deviceAdvance:			Float32Point;
-		topLeft:				Float32Point;
-		height:					UInt32;
-		width:					UInt32;
-		sideBearing:			Float32Point;
-		otherSideBearing:		Float32Point;
+		deviceAdvance: ATSPoint;
+		topLeft: ATSPoint;
+		height: UInt32;
+		width: UInt32;
+		sideBearing: ATSPoint;
+		otherSideBearing: ATSPoint;
 	end;
+{ Glyph References }
 
-	GlyphID								= ATSGlyphRef;
-	GlyphID_fix	= GlyphID; { used as field type when a record declaration contains a GlyphID field identifier }
+	GlyphID = ATSGlyphRef;
 	GlyphIDPtr = ^GlyphID;
-{$ALIGN MAC68K}
+	GlyphID_fix = GlyphID;
+
+
+{$endc} {TARGET_OS_MAC}
 
+	{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 143 - 41
packages/univint/src/ATSUnicodeDirectAccess.pas

@@ -3,9 +3,9 @@
  
      Contains:   Public Interfaces/Types for Low Level ATSUI
  
-     Version:    Quickdraw-150~1
+     Version:    Quickdraw-262~1
  
-     Copyright:  © 2002-2003 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2002-2008 by Apple Inc. all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +14,14 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +30,8 @@
 
 unit ATSUnicodeDirectAccess;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +44,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +83,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +167,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,12 +177,19 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ATSLayoutTypes,ATSUnicodeTypes,TextCommon;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
 
 { ---------------------------------------------------------------------------- }
 { Constants                                                                    }
 { ---------------------------------------------------------------------------- }
 
+
 {
  *  ATSUDirectDataSelector
  *  
@@ -119,10 +198,10 @@ uses MacTypes,ATSLayoutTypes,ATSUnicodeTypes,TextCommon;
  *    ATSUDirectGetLayoutDataArrayPtr function to get the needed layout
  *    data array pointer.
  }
-type ATSUDirectDataSelector = UInt32;
+type
+	ATSUDirectDataSelector = UInt32;
 const
-
-  {
+{
    * Returns the parallel advance delta (delta X) array. (Array Type):
    * Fixed (Return Time): Constant, unless creation is necessary, or
    * unless requested by ATSUDirectGetLayoutDataArrayPtrFromTextLayout.
@@ -131,7 +210,7 @@ const
    * had not been previously allocated it will be allocated and
    * zero-filled when iCreate is set to true.
    }
-  kATSUDirectDataAdvanceDeltaFixedArray = 0;
+	kATSUDirectDataAdvanceDeltaFixedArray = 0;
 
   {
    * Returns the parallel baseline delta (delta Y) array. (Array Type):
@@ -142,7 +221,7 @@ const
    * had not been previously allocated it will be allocated and
    * zero-filled when iCreate is set to true.
    }
-  kATSUDirectDataBaselineDeltaFixedArray = 1;
+	kATSUDirectDataBaselineDeltaFixedArray = 1;
 
   {
    * Returns the parallel device delta array for device- specific
@@ -157,7 +236,7 @@ const
    * previously allocated it will be allocated and zero-filled when
    * iCreate is set to true.
    }
-  kATSUDirectDataDeviceDeltaSInt16Array = 2;
+	kATSUDirectDataDeviceDeltaSInt16Array = 2;
 
   {
    * Returns the parallel style index array. The indexes setting in the
@@ -172,7 +251,7 @@ const
    * previously allocated it will be allocated and zero-filled when
    * iCreate is set to true.
    }
-  kATSUDirectDataStyleIndexUInt16Array = 3;
+	kATSUDirectDataStyleIndexUInt16Array = 3;
 
   {
    * Returns the style setting ref array. (Array Type):
@@ -181,7 +260,7 @@ const
    * present if the layout has any text assigned to it at all. Setting
    * iCreate has no effect.
    }
-  kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4;
+	kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4;
 
   {
    * Returns the ATSLayoutRecord, version 1 array. This should not be
@@ -197,7 +276,7 @@ const
    * array is always present if the layout has any text assigned to it
    * at all. Setting iCreate has no effect
    }
-  kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100;
+	kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100;
 
   {
    * Returns the ATSLayoutRecord. This will return the most current
@@ -210,7 +289,7 @@ const
    * array is always present if the layout has any text assigned to it
    * at all. Setting iCreate has no effect.
    }
-  kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1;
+	kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1;
 
 { ---------------------------------------------------------------------------- }
 { Data Types                                                                   }
@@ -224,12 +303,15 @@ const
  *    ATSUStyle plus any cached/set information about that style.
  }
 type
-	ATSUStyleSettingRef    = ^SInt32; { an opaque 32-bit type }
+	ATSUStyleSettingRef = ^SInt32; { an opaque type }
 { ---------------------------------------------------------------------------- }
 { Direct Accessors                                                             }
 { ---------------------------------------------------------------------------- }
 {
- *  ATSUDirectGetLayoutDataArrayPtrFromLineRef()
+ *  ATSUDirectGetLayoutDataArrayPtrFromLineRef()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetGlyphsPtr or CTRunGetPositionsPtr instead.
  *  
  *  Summary:
  *    Returns the data pointer specified by iDataSelector and
@@ -286,24 +368,28 @@ type
  *      iLineRef references those values. If this is not the case, then
  *      NULL will be returned, unless iCreate is set to true and the
  *      array can be created. This parameter itself may be set to NULL
- *      if only a count of the entries is needed. can be NULL
+ *      if only a count of the entries is needed.
  *    
  *    oLayoutDataCount:
  *      Upon sucessful return, this parameter will contain a count of
  *      the entries in the array returned in oLayoutDataArray.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUDirectGetLayoutDataArrayPtrFromLineRef( iLineRef: ATSULineRef; iDataSelector: ATSUDirectDataSelector; iCreate: Boolean; oLayoutDataArrayPtr: PtrPtr; var oLayoutDataCount: ItemCount ): OSStatus; external name '_ATSUDirectGetLayoutDataArrayPtrFromLineRef';
+function ATSUDirectGetLayoutDataArrayPtrFromLineRef( iLineRef: ATSULineRef; iDataSelector: ATSUDirectDataSelector; iCreate: Boolean; oLayoutDataArrayPtr: PtrPtr { can be NULL }; var oLayoutDataCount: ItemCount ): OSStatus; external name '_ATSUDirectGetLayoutDataArrayPtrFromLineRef';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUDirectGetLayoutDataArrayPtrFromTextLayout()
+ *  ATSUDirectGetLayoutDataArrayPtrFromTextLayout()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetGlyphs or CTRunGetPositions instead.
  *  
  *  Summary:
  *    Returns the data pointer specified by iDataSelector and
@@ -361,24 +447,29 @@ function ATSUDirectGetLayoutDataArrayPtrFromLineRef( iLineRef: ATSULineRef; iDat
  *      in iTextLayout references those values for the line offset
  *      iLineOffset. If this is not the case, then NULL will be
  *      returned. This parameter itself may be set to NULL if only a
- *      count of the entries is needed. can be NULL
+ *      count of the entries is needed.
  *    
  *    oLayoutDataCount:
  *      Upon sucessful return, this parameter will contain a count of
  *      the entries in the array returned in oLayoutDataArray.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUDirectGetLayoutDataArrayPtrFromTextLayout( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iDataSelector: ATSUDirectDataSelector; oLayoutDataArrayPtr: PtrPtr; var oLayoutDataCount: ItemCount ): OSStatus; external name '_ATSUDirectGetLayoutDataArrayPtrFromTextLayout';
+function ATSUDirectGetLayoutDataArrayPtrFromTextLayout( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iDataSelector: ATSUDirectDataSelector; oLayoutDataArrayPtr: PtrPtr { can be NULL }; var oLayoutDataCount: ItemCount ): OSStatus; external name '_ATSUDirectGetLayoutDataArrayPtrFromTextLayout';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
+{$endc} {not TARGET_CPU_64}
+
 {
- *  ATSUDirectReleaseLayoutDataArrayPtr()
+ *  ATSUDirectReleaseLayoutDataArrayPtr()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CoreText API instead.
  *  
  *  Summary:
  *    Properly releases of an array pointer returned by
@@ -398,7 +489,7 @@ function ATSUDirectGetLayoutDataArrayPtrFromTextLayout( iTextLayout: ATSUTextLay
  *    iLineRef:
  *      The lineRef from which the layout data array pointer came from.
  *      If the layout data array pointer did not come from a lineRef,
- *      then set this to NULL. can be NULL
+ *      then set this to NULL.
  *    
  *    iDataSelector:
  *      The selector for which iLayoutDataArrayPtr was obtained.
@@ -407,17 +498,21 @@ function ATSUDirectGetLayoutDataArrayPtrFromTextLayout( iTextLayout: ATSUTextLay
  *      A pointer to the layout data array which is to be disposed of.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUDirectReleaseLayoutDataArrayPtr( iLineRef: ATSULineRef; iDataSelector: ATSUDirectDataSelector; iLayoutDataArrayPtr: PtrPtr ): OSStatus; external name '_ATSUDirectReleaseLayoutDataArrayPtr';
+function ATSUDirectReleaseLayoutDataArrayPtr( iLineRef: ATSULineRef { can be NULL }; iDataSelector: ATSUDirectDataSelector; iLayoutDataArrayPtr: PtrPtr ): OSStatus; external name '_ATSUDirectReleaseLayoutDataArrayPtr';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUDirectAddStyleSettingRef()
+ *  ATSUDirectAddStyleSettingRef()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetGlyphsPtr or CTRunGetGlyphs instead.
  *  
  *  Summary:
  *    This function will fetch a style index for the
@@ -455,11 +550,18 @@ function ATSUDirectReleaseLayoutDataArrayPtr( iLineRef: ATSULineRef; iDataSelect
  *      new index will be returned here.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 function ATSUDirectAddStyleSettingRef( iLineRef: ATSULineRef; iStyleSettingRef: ATSUStyleSettingRef; var oStyleIndex: UInt16 ): OSStatus; external name '_ATSUDirectAddStyleSettingRef';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
+
+
+{$endc} {not TARGET_CPU_64}
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 280 - 95
packages/univint/src/ATSUnicodeDrawing.pas

@@ -3,9 +3,9 @@
  
      Contains:   ATSUI drawing, measuring, and highlighting functions.
  
-     Version:    Quickdraw-150~1
+     Version:    Quickdraw-262~1
  
-     Copyright:  © 2003 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2003-2008 by Apple Inc. all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +14,14 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +30,8 @@
 
 unit ATSUnicodeDrawing;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +44,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +83,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +167,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,15 +176,25 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,TextCommon,Quickdraw,ATSLayoutTypes,ATSUnicodeTypes;
-{$ALIGN MAC68K}
+uses MacTypes,TextCommon,QuickdrawTypes,ATSLayoutTypes,ATSUnicodeTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
 
 { ---------------------------------------------------------------------------- }
 {  ATSUI drawing and measuring                                                 }
 { ---------------------------------------------------------------------------- }
 
+
 {
- *  ATSUDrawText()
+ *  ATSUDrawText()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFrameDraw, CTLiineDraw, or CTRunDraw instead.
  *  
  *  Summary:
  *    Draws a specified range of text in a QuickDraw graphics port or
@@ -190,16 +272,21 @@ uses MacTypes,TextCommon,Quickdraw,ATSLayoutTypes,ATSUnicodeTypes;
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUDrawText( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iLineLength: UniCharCount; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement ): OSStatus; external name '_ATSUDrawText';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUGetUnjustifiedBounds()
+ *  ATSUGetUnjustifiedBounds()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetTypographicBounds or
+ *    CTLineGetTrailingWhitespaceWidth instead.
  *  
  *  Summary:
  *    Obtains the typographic bounding rectangle for a line of text
@@ -274,16 +361,19 @@ function ATSUDrawText( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOff
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 function ATSUGetUnjustifiedBounds( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineLength: UniCharCount; var oTextBefore: ATSUTextMeasurement; var oTextAfter: ATSUTextMeasurement; var oAscent: ATSUTextMeasurement; var oDescent: ATSUTextMeasurement ): OSStatus; external name '_ATSUGetUnjustifiedBounds';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUMeasureTextImage()
+ *  ATSUMeasureTextImage()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetImageBounds or CTRunGetImageBounds instead.
  *  
  *  Summary:
  *    Obtains the image bounding rectangle for a line of text after
@@ -353,16 +443,23 @@ function ATSUGetUnjustifiedBounds( iTextLayout: ATSUTextLayout; iLineStart: UniC
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUMeasureTextImage( iTextLayout: ATSUTextLayout; iLineOffset: UniCharArrayOffset; iLineLength: UniCharCount; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; var oTextImageRect: Rect ): OSStatus; external name '_ATSUMeasureTextImage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
+{$endc} {not TARGET_CPU_64}
+
 {
- *  ATSUGetGlyphBounds()
+ *  ATSUGetGlyphBounds()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetTypographicBounds, CTLineGetTypographicBounds,
+ *    CTFontGetAscent, CTFontGetDescent, CTFontGetLeading, or
+ *    CTFontGetUnitsPerEm instead.
  *  
  *  Summary:
  *    Obtains the typographic bounds of a line of glyphs after final
@@ -466,32 +563,38 @@ function ATSUMeasureTextImage( iTextLayout: ATSUTextLayout; iLineOffset: UniChar
  *      ATSUI 1.2, the maximum number is 127. If you pass a range that
  *      covers an entire line, ATSUGetGlyphBounds always returns only 1
  *      trapezoid. If you are uncertain of how much memory to allocate
- *      for this array, see the Discussion. can be NULL
+ *      for this array, see the Discussion.
  *    
  *    oActualNumberOfBounds:
  *      On return, the value specifies the actual number of enclosing
  *      trapezoids bounding the specified characters. This may be
  *      greater than the value you provide in the iMaxNumberOfBounds
- *      parameter. can be NULL
+ *      parameter.
  *  
  *  Result:
  *    On success, noErr is returned. See MacErrors.h for possible error
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.6 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGetGlyphBounds( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iBoundsCharStart: UniCharArrayOffset; iBoundsCharLength: UniCharCount; iTypeOfBounds: UInt16; iMaxNumberOfBounds: ItemCount; oGlyphBounds: ATSTrapezoidPtr; var oActualNumberOfBounds: ItemCount ): OSStatus; external name '_ATSUGetGlyphBounds';
+function ATSUGetGlyphBounds( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iBoundsCharStart: UniCharArrayOffset; iBoundsCharLength: UniCharCount; iTypeOfBounds: UInt16; iMaxNumberOfBounds: ItemCount; oGlyphBounds: {variable-size-array} ATSTrapezoidPtr { can be NULL }; var oActualNumberOfBounds: ItemCount  ): OSStatus; external name '_ATSUGetGlyphBounds';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
 {  ATSUI line breaking                                                         }
 { ---------------------------------------------------------------------------- }
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUBatchBreakLines()
+ *  ATSUBatchBreakLines()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTTypesetterSuggestLineBreak,
+ *    CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
+ *    instead.
  *  
  *  Summary:
  *    Soft wraps a range of text in a layout to a constant line width.
@@ -527,23 +630,28 @@ function ATSUGetGlyphBounds( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUT
  *    oBreakCount:
  *      On return, the number of soft breaks that were set in the
  *      layout. Use this to determine how much memory to allocate when
- *      calling ATSUGetSoftLineBreaks. can be NULL
+ *      calling ATSUGetSoftLineBreaks.
  *  
  *  Result:
  *    On success, noErr is returned. See MacErrors.h for possible error
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUBatchBreakLines( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iLineWidth: ATSUTextMeasurement; oBreakCount: ItemCountPtr ): OSStatus; external name '_ATSUBatchBreakLines';
+function ATSUBatchBreakLines( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iLineWidth: ATSUTextMeasurement; oBreakCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUBatchBreakLines';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUBreakLine()
+ *  ATSUBreakLine()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTTypesetterSuggestLineBreak,
+ *    CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
+ *    instead.
  *  
  *  Summary:
  *    Soft wraps a single line of text within a layout.
@@ -604,19 +712,24 @@ function ATSUBatchBreakLines( iTextLayout: ATSUTextLayout; iRangeStart: UniCharA
  *    line break to be in the middle of a word, it returns the result
  *    code kATSULineBreakInWord. Note that ATSUI produces a line break
  *    in the middle of a word only as a last resort. See MacErrors.h
- *    for other possible error codes. can be NULL
+ *    for other possible error codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUBreakLine( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineWidth: ATSUTextMeasurement; iUseAsSoftLineBreak: Boolean; oLineBreak: UniCharArrayOffsetPtr ): OSStatus; external name '_ATSUBreakLine';
+function ATSUBreakLine( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineWidth: ATSUTextMeasurement; iUseAsSoftLineBreak: Boolean; oLineBreak: UniCharArrayOffsetPtr { can be NULL } ): OSStatus; external name '_ATSUBreakLine';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUSetSoftLineBreak()
+ *  ATSUSetSoftLineBreak()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTTypesetterSuggestLineBreak,
+ *    CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
+ *    instead.
  *  
  *  Summary:
  *    Sets a soft line break at the specified point in a text layout.
@@ -645,16 +758,21 @@ function ATSUBreakLine( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOff
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUSetSoftLineBreak( iTextLayout: ATSUTextLayout; iLineBreak: UniCharArrayOffset ): OSStatus; external name '_ATSUSetSoftLineBreak';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUGetSoftLineBreaks()
+ *  ATSUGetSoftLineBreaks()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTTypesetterSuggestLineBreak,
+ *    CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
+ *    instead.
  *  
  *  Summary:
  *    Obtains the soft line breaks that are currently set in a given
@@ -702,28 +820,33 @@ function ATSUSetSoftLineBreak( iTextLayout: ATSUTextLayout; iLineBreak: UniCharA
  *      On return, the array contains offsets from the beginning of the
  *      text buffer to each of the soft line breaks in the text range.
  *      If you are uncertain of how much memory to allocate for this
- *      array, see the Discussion. can be NULL
+ *      array, see the Discussion.
  *    
  *    oBreakCount:
  *      On return, the number of soft breaks set in iTextLayout. Note
  *      that this value may be greater than what you pass in for
- *      iMaximumBreaks. can be NULL
+ *      iMaximumBreaks.
  *  
  *  Result:
  *    On success, noErr is returned. See MacErrors.h for possible error
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGetSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iMaximumBreaks: ItemCount; oBreaks: UniCharArrayOffsetPtr; oBreakCount: ItemCountPtr ): OSStatus; external name '_ATSUGetSoftLineBreaks';
+function ATSUGetSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount; iMaximumBreaks: ItemCount; oBreaks: {variable-size-array} UniCharArrayOffsetPtr { can be NULL }; oBreakCount: ItemCountPtr { can be NULL } ): OSStatus; external name '_ATSUGetSoftLineBreaks';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUClearSoftLineBreaks()
+ *  ATSUClearSoftLineBreaks()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTTypesetterSuggestLineBreak,
+ *    CTTypesetterSuggestClusterBreak, or CTTypesetterCreateLine
+ *    instead.
  *  
  *  Summary:
  *    Unsets any currently set soft breaks in a range of text.
@@ -756,19 +879,23 @@ function ATSUGetSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCha
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUClearSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniCharArrayOffset; iRangeLength: UniCharCount ): OSStatus; external name '_ATSUClearSoftLineBreaks';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
 {  ATSUI highlighting                                                          }
 { ---------------------------------------------------------------------------- }
 {
- *  ATSUSetHighlightingMethod()
+ *  ATSUSetHighlightingMethod()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Specifies the methods ATSUI will use for highlighting and
@@ -815,7 +942,7 @@ function ATSUClearSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniC
  *    area. If you choose to also redraw the text, then your callback
  *    should return false as a function result. If your callback
  *    returns true ATSUI redraws any text that needs to be redrawn. See
- *    RedrawBackgroundProcPtr for additional information. 
+ *    RedrawBackgroundProcPtr for additional information.
  *  
  *  Parameters:
  *    
@@ -832,23 +959,27 @@ function ATSUClearSoftLineBreaks( iTextLayout: ATSUTextLayout; iRangeStart: UniC
  *      Data needed to redraw the background or NULL if inversion is
  *      being chosen. See the definition of ATSUUnhighlightData for
  *      more information about the possible contents of this structure.
- *      Also see the Discussion for this function. can be NULL
+ *      Also see the Discussion for this function.
  *  
  *  Result:
  *    On success, noErr is returned. See MacErrors.h for possible error
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUSetHighlightingMethod( iTextLayout: ATSUTextLayout; iMethod: ATSUHighlightMethod; iUnhighlightData: ATSUUnhighlightDataPtr ): OSStatus; external name '_ATSUSetHighlightingMethod';
+function ATSUSetHighlightingMethod( iTextLayout: ATSUTextLayout; iMethod: ATSUHighlightMethod; {const} iUnhighlightData: ATSUUnhighlightDataPtr { can be NULL } ): OSStatus; external name '_ATSUSetHighlightingMethod';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUHighlightText()
+ *  ATSUHighlightText()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Renders a highlighted range of text at a specified location in a
@@ -910,16 +1041,20 @@ function ATSUSetHighlightingMethod( iTextLayout: ATSUTextLayout; iMethod: ATSUHi
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUHighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUHighlightText';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUUnhighlightText()
+ *  ATSUUnhighlightText()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Renders a previously highlighted range of text in an
@@ -980,16 +1115,20 @@ function ATSUHighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTe
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUUnhighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUUnhighlightText';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUGetTextHighlight()
+ *  ATSUGetTextHighlight()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the highlight region for a range of text.
@@ -1048,16 +1187,20 @@ function ATSUUnhighlightText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSU
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUGetTextHighlight( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount; oHighlightRegion: RgnHandle ): OSStatus; external name '_ATSUGetTextHighlight';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUHighlightInactiveText()
+ *  ATSUHighlightInactiveText()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition  instead.
  *  
  *  Summary:
  *    Highlights text using the standard Mac OS X UI convention for an
@@ -1109,19 +1252,24 @@ function ATSUGetTextHighlight( iTextLayout: ATSUTextLayout; iTextBasePointX: ATS
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
 function ATSUHighlightInactiveText( iTextLayout: ATSUTextLayout; iTextBasePointX: ATSUTextMeasurement; iTextBasePointY: ATSUTextMeasurement; iHighlightStart: UniCharArrayOffset; iHighlightLength: UniCharCount ): OSStatus; external name '_ATSUHighlightInactiveText';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
 {  ATSUI hit-testing                                                           }
 { ---------------------------------------------------------------------------- }
+{$endc} {not TARGET_CPU_64}
+
 {
- *  ATSUPositionToOffset()
+ *  ATSUPositionToOffset()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the glyph edge nearest a mouse-down
@@ -1227,16 +1375,20 @@ function ATSUHighlightInactiveText( iTextLayout: ATSUTextLayout; iTextBasePointX
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUPositionToOffset( iTextLayout: ATSUTextLayout; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; var ioPrimaryOffset: UniCharArrayOffset; var oIsLeading: Boolean; var oSecondaryOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPositionToOffset';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUOffsetToPosition()
+ *  ATSUOffsetToPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the caret position(s) corresponding to a memory offset.
@@ -1316,16 +1468,19 @@ function ATSUPositionToOffset( iTextLayout: ATSUTextLayout; iLocationX: ATSUText
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUOffsetToPosition( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; iIsLeading: Boolean; var oMainCaret: ATSUCaret; var oSecondCaret: ATSUCaret; var oCaretIsSplit: Boolean ): OSStatus; external name '_ATSUOffsetToPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUPositionToCursorOffset()
+ *  ATSUPositionToCursorOffset()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the glyph edge nearest a mouse-down
@@ -1397,16 +1552,20 @@ function ATSUOffsetToPosition( iTextLayout: ATSUTextLayout; iOffset: UniCharArra
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.5 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.2.2 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUPositionToCursorOffset( iTextLayout: ATSUTextLayout; iLocationX: ATSUTextMeasurement; iLocationY: ATSUTextMeasurement; iMovementType: ATSUCursorMovementType; var ioPrimaryOffset: UniCharArrayOffset; var oIsLeading: Boolean; var oSecondaryOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPositionToCursorOffset';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUOffsetToCursorPosition()
+ *  ATSUOffsetToCursorPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the caret position(s) corresponding to a memory offset,
@@ -1470,19 +1629,23 @@ function ATSUPositionToCursorOffset( iTextLayout: ATSUTextLayout; iLocationX: AT
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.5 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.2.2 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUOffsetToCursorPosition( iTextLayout: ATSUTextLayout; iOffset: UniCharArrayOffset; iIsLeading: Boolean; iMovementType: ATSUCursorMovementType; var oMainCaret: ATSUCaret; var oSecondCaret: ATSUCaret; var oCaretIsSplit: Boolean ): OSStatus; external name '_ATSUOffsetToCursorPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
 {  ATSUI cursor movement                                                       }
 { ---------------------------------------------------------------------------- }
 {
- *  ATSUNextCursorPosition()
+ *  ATSUNextCursorPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the insertion point that follows
@@ -1518,16 +1681,20 @@ function ATSUOffsetToCursorPosition( iTextLayout: ATSUTextLayout; iOffset: UniCh
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUNextCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUNextCursorPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUPreviousCursorPosition()
+ *  ATSUPreviousCursorPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the insertion point that preceeds
@@ -1563,16 +1730,20 @@ function ATSUNextCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCha
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUPreviousCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSUPreviousCursorPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSURightwardCursorPosition()
+ *  ATSURightwardCursorPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the insertion point that is to the
@@ -1615,16 +1786,20 @@ function ATSUPreviousCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: Un
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSURightwardCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSURightwardCursorPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSULeftwardCursorPosition()
+ *  ATSULeftwardCursorPosition()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTLineGetOffsetForStringIndex,
+ *    CTLineGetStringIndexForPosition instead.
  *  
  *  Summary:
  *    Obtains the memory offset for the insertion point that is to the
@@ -1667,29 +1842,39 @@ function ATSURightwardCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: U
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSULeftwardCursorPosition( iTextLayout: ATSUTextLayout; iOldOffset: UniCharArrayOffset; iMovementType: ATSUCursorMovementType; var oNewOffset: UniCharArrayOffset ): OSStatus; external name '_ATSULeftwardCursorPosition';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { Functions listed beyond this point are either deprecated or not recommended }
 
 {
- *  ATSUMeasureText()
+ *  ATSUMeasureText()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use ATSUGetUnjustifiedBounds instead.
  *  
  *  Discussion:
  *    This function is no longer recommended. Please use
  *    ATSUGetUnjustifiedBounds instead.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.3
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUMeasureText( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineLength: UniCharCount; var oTextBefore: ATSUTextMeasurement; var oTextAfter: ATSUTextMeasurement; var oAscent: ATSUTextMeasurement; var oDescent: ATSUTextMeasurement ): OSStatus; external name '_ATSUMeasureText';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+
+
+{$endc} {not TARGET_CPU_64}
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 184 - 100
packages/univint/src/ATSUnicodeFlattening.pas

@@ -3,9 +3,9 @@
  
      Contains:   Public interfaces for Apple Type Services for Unicode Imaging
  
-     Version:    Quickdraw-150~1
+     Version:    Quickdraw-262~1
  
-     Copyright:  © 2002-2003 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2002-2008 by Apple Inc. all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +14,14 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +30,8 @@
 
 unit ATSUnicodeFlattening;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +44,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +83,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +167,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,7 +177,10 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ATSUnicodeTypes,SFNTTypes;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
 
 { ---------------------------------------------------------------------------- }
 { Constants                                                                    }
@@ -116,9 +191,13 @@ uses MacTypes,ATSUnicodeTypes,SFNTTypes;
    or parsing.
 }
 
-type ATSUFlattenedDataStreamFormat = UInt32;
+
+{$ALIGN MAC68K}
+
+type
+	ATSUFlattenedDataStreamFormat = UInt32;
 const
-  kATSUDataStreamUnicodeStyledText = FourCharCode('ustl');
+	kATSUDataStreamUnicodeStyledText = FourCharCode('ustl');
 
 
 {
@@ -126,18 +205,20 @@ const
    into the ATSUFlattenStyleRunsToStream API. Currently, there are no options. 
    This is here for future expansion.
 }
-type ATSUFlattenStyleRunOptions = UInt32;
+type
+	ATSUFlattenStyleRunOptions = UInt32;
 const
-  kATSUFlattenOptionNoOptionsMask = $00000000;
+	kATSUFlattenOptionNoOptionsMask = $00000000;
 
 {
    ATSUUnFlattenStyleRunOptions is a bitfield list of options that can be passed
    into the ATSUUnFlattenStyleRunsToStream API. Currently, there are no options. 
    This is here for future expansion.
 }
-type ATSUUnFlattenStyleRunOptions = UInt32;
+type
+	ATSUUnFlattenStyleRunOptions = UInt32;
 const
-  kATSUUnFlattenOptionNoOptionsMask = $00000000;
+	kATSUUnFlattenOptionNoOptionsMask = $00000000;
 
 
 { ---------------------------------------------------------------------------- }
@@ -145,15 +226,15 @@ const
 { ---------------------------------------------------------------------------- }
 
 {
-   ATSUStyleRunInfo is a structure that contrains an index into an array of 
+   ATSUStyleRunInfo is a structure that contains an index into an array of 
    unique ATSUStyle objects as well as the length of the run that the style run 
    object covers. This structure is utilized by ATSUUnflattenStyleRunsFromStream() 
    to return the style run info to the caller. 
 }
 type
 	ATSUStyleRunInfo = record
-		runLength: UniCharCount;
-		styleObjectIndex: ItemCount;
+		runLength: UInt32;
+		styleObjectIndex: UInt32;
 	end;
 	ATSUStyleRunInfoPtr = ^ATSUStyleRunInfo;
 { ---------------------------------------------------------------------------- }
@@ -176,10 +257,10 @@ type
    versions were not completly specified and have been obsoleted.
 }
 const
-  kATSFlatDataUstlVersion0      = 0;
-  kATSFlatDataUstlVersion1      = 1;
-  kATSFlatDataUstlVersion2      = 2;
-  kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2;
+	kATSFlatDataUstlVersion0 = 0;
+	kATSFlatDataUstlVersion1 = 1;
+	kATSFlatDataUstlVersion2 = 2;
+	kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2;
 
 { ------------------ }
 { Block 1 Structures }
@@ -191,27 +272,26 @@ const
 }
 type
 	ATSFlatDataMainHeaderBlock = record
-
-                                              { the 'ustl' version number. This needs to be the first item in the}
+{ the 'ustl' version number. This needs to be the first item in the}
                                               { data block do as not to confuse parsers of earlier (and possibly}
                                               { later) versions of the spec *|}
 		version: UInt32;
 
                                               { the total size of the stream in bytes, including the four bytes in}
                                               { the version above}
-		sizeOfDataBlock: ByteCount;
+		sizeOfDataBlock: UInt32;
 
                                               { offset from the beginning of the stream to the flattened text layout data.}
                                               { This can be set to 0 if there are no text layouts stored in the stream.}
-		offsetToTextLayouts: ByteCount;
+		offsetToTextLayouts: UInt32;
 
                                               { offset from the beginning of the stream to the flattened style run data. }
                                               { This can be set to 0 if there is no flattened style run data in the stream}
-		offsetToStyleRuns: ByteCount;
+		offsetToStyleRuns: UInt32;
 
                                               { offset to the flattened style list data. This can be set to 0 if there}
                                               { is no flattened style list data}
-		offsetToStyleList: ByteCount;
+		offsetToStyleList: UInt32;
 	end;
 	ATSFlatDataMainHeaderBlockPtr = ^ATSFlatDataMainHeaderBlock;
 { ------------------ }
@@ -230,23 +310,22 @@ type
 }
 type
 	ATSFlatDataTextLayoutDataHeader = record
-
-                                              { the total size of this particular flattened text layout, including any}
+{ the total size of this particular flattened text layout, including any}
                                               { padding bytes and such. }
-		sizeOfLayoutData: ByteCount;
+		sizeOfLayoutData: UInt32;
 
                                               { the number of characters covered by this flattened text layout}
-		textLayoutLength: ByteCount;
+		textLayoutLength: UInt32;
 
                                               { the byte offset relative to the start of this structure to the flattened}
                                               { layout control data. This can be set to zero if there are no layout}
                                               { controls.}
-		offsetToLayoutControls: ByteCount;
+		offsetToLayoutControls: UInt32;
 
                                               { the byte offset, relative to the start of this structure to the}
                                               { flattened line info. This can be set to zero if there is no line info }
                                               { in this layout.}
-		offsetToLineInfo: ByteCount;
+		offsetToLineInfo: UInt32;
 
                                               { if the offsetToLayoutControls is non-zero, then following this block}
                                               { there will be a ATSFlattenedLayoutDataFlattenedLayoutControlsHeader}
@@ -263,11 +342,10 @@ type
 }
 type
 	ATSFlatDataTextLayoutHeader = record
-
-                                              { the total number of flattened text layouts stored in this block.}
+{ the total number of flattened text layouts stored in this block.}
                                               { This must be non-zero, as if there were no flattened text layouts, the}
                                               { entire block 2 would not exist}
-		numFlattenedTextLayouts: ItemCount;
+		numFlattenedTextLayouts: UInt32;
 
                                               { first of possibly many flattened text layouts. There should be one of}
                                               { these for each flattened text layout as determined by the}
@@ -282,10 +360,9 @@ type
 }
 type
 	ATSFlatDataLayoutControlsDataHeader = record
-
-                                              { the number of flattened layout controls. It is suggested that there be}
+{ the number of flattened layout controls. It is suggested that there be}
                                               { at least one layout control to output the line direction for the layout}
-		numberOfLayoutControls: ItemCount;
+		numberOfLayoutControls: UInt32;
 
                                               { first of possibly many flattened layout controls. There should be one }
                                               { of these for each layout control as determined by the}
@@ -299,13 +376,12 @@ type
 	ATSFlatDataLayoutControlsDataHeaderPtr = ^ATSFlatDataLayoutControlsDataHeader;
 type
 	ATSFlatDataLineInfoData = record
-
-                                              { the length of this particular line in UniChars}
-		lineLength: UniCharCount;
+{ the length of this particular line in UniChars}
+		lineLength: UInt32;
 
                                               { the number of line controls applied to this line. This can be set}
                                               { to zero if there are no special line controls applied to this line.}
-		numberOfLineControls: ItemCount;
+		numberOfLineControls: UInt32;
 
                                               { the numberOfLineControls is non-zero, then following this structure}
                                               { must be an array of ATSUAttributeInfo structures. There must be one}
@@ -319,12 +395,11 @@ type
 }
 type
 	ATSFlatDataLineInfoHeader = record
-
-                                              { the number of flattened line info structures that are stored in this}
+{ the number of flattened line info structures that are stored in this}
                                               { block. This value should really be equal to the number of soft line}
                                               { breaks in the layout + 1. Of course if numberOfLines is zero, then}
                                               { this structure shouldn't even be used.}
-		numberOfLines: ItemCount;
+		numberOfLines: UInt32;
 
                                               { the first in a array of ATSFlatDataLineInfoData structures. There}
                                               { needs to be a ATSFlatDataLineInfoData for each numberOfLines}
@@ -349,9 +424,8 @@ type
 }
 type
 	ATSFlatDataStyleRunDataHeader = record
-
-                                              { the number of style run data structures stored in this block}
-		numberOfStyleRuns: ItemCount;
+{ the number of style run data structures stored in this block}
+		numberOfStyleRuns: UInt32;
 
                                               { the first in an array of ATSUStyleRunInfo structures. There needs to}
                                               { be a ATSUStyleRunInfo structure for each numberOfStyleRuns specified}
@@ -374,24 +448,23 @@ type
 }
 type
 	ATSFlatDataStyleListStyleDataHeader = record
-
-                                              { the size of this flattened style object, including these four bytes and}
+{ the size of this flattened style object, including these four bytes and}
                                               { any padding bytes at the end of the structure. Basically, this can be}
                                               { used to determine where the next structure in the array begins.}
-		sizeOfStyleInfo: ByteCount;
+		sizeOfStyleInfo: UInt32;
 
                                               { the number of attributes set in this flattened style object. This should }
                                               { be at least one for the font data, although it can be 0 if this is to be}
                                               { unspecfied.}
-		numberOfSetAttributes: ItemCount;
+		numberOfSetAttributes: UInt32;
 
                                               { the number of font features set in the flattened style object. This can}
                                               { be set to 0 if there are no font features set in the style object. }
-		numberOfSetFeatures: ItemCount;
+		numberOfSetFeatures: UInt32;
 
                                               { the number of font variations set in the flattened style object. This}
                                               { can be set to 0 if there are no font variations set in the style object.}
-		numberOfSetVariations: ItemCount;
+		numberOfSetVariations: UInt32;
 
                                               { after this structure header, there is the following data in this block:}
 
@@ -423,9 +496,8 @@ type
 }
 type
 	ATSFlatDataStyleListHeader = record
-
-                                              { the total number of flattened style objects stored in this block}
-		numberOfStyles: ItemCount;
+{ the total number of flattened style objects stored in this block}
+		numberOfStyles: UInt32;
 
                                               { the first in an array of flattned style entries. The data stored}
                                               { in them is variably sized, so a simply array access won't do for}
@@ -433,7 +505,6 @@ type
                                               { ATSFlatDataStyleListStyleDataHeader structures for each }
                                               { numberOfStyles above.}
 		styleDataArray: array[0..0] of ATSFlatDataStyleListStyleDataHeader;
-
 	end;
 	ATSFlatDataStyleListHeaderPtr = ^ATSFlatDataStyleListHeader;
 {
@@ -443,8 +514,7 @@ type
 }
 type
 	ATSFlatDataStyleListFeatureData = record
-
-                                              { the font feature type}
+{ the font feature type}
 		theFeatureType: ATSUFontFeatureType;
 
                                               { the font feature selector}
@@ -459,8 +529,7 @@ type
 }
 type
 	ATSFlatDataStyleListVariationData = record
-
-                                              { the variation axis}
+{ the variation axis}
 		theVariationAxis: ATSUFontVariationAxis;
 
                                               { the variation value}
@@ -480,11 +549,12 @@ type
 
 
 { these are the currenly supported font specifiers. }
-type ATSFlatDataFontSpeciferType = UInt32;
+type
+	ATSFlatDataFontSpeciferType = UInt32;
 const
-                                        { this specifier allows the storage of font data based on name data. This}
+{ this specifier allows the storage of font data based on name data. This}
                                         { uses the stuctures below to store the actual data itself.}
-  kATSFlattenedFontSpecifierRawNameData = FourCharCode('namd');
+	kATSFlattenedFontSpecifierRawNameData = FourCharCode('namd');
 
 {
    this is the main header for the font data. It dictates what type of data
@@ -493,22 +563,20 @@ const
 }
 type
 	ATSFlatDataFontNameDataHeader = record
-
-                                              { the type of data that is flattened in this structure}
+{ the type of data that is flattened in this structure}
 		nameSpecifierType: ATSFlatDataFontSpeciferType;
 
                                               { the size of the data that is flattened in this structre, not including }
                                               { any padding bytes that may be necessary to achive the four byte }
                                               { alignment of the data, unless they are specified as part of structure, }
                                               { such as with the ATSFlatDataFontSpecRawNameData structure.}
-		nameSpecifierSize: ByteCount;
+		nameSpecifierSize: UInt32;
 
                                               { after this header comes the flattened font name data which matches}
                                               { the type specified by the nameSpecifierType above. For instance, if }
                                               { the nameSpecType is kATSFlattenedFontNameSpecifierRawNameData, the}
                                               { structure that immediately follows this would be a}
                                               { ATSFlatDataFontNameRawNameDataHeader structure. }
-
 	end;
 	ATSFlatDataFontNameDataHeaderPtr = ^ATSFlatDataFontNameDataHeader;
 {
@@ -520,8 +588,7 @@ type
 { this is the structure in which raw font name data is actually stored. }
 type
 	ATSFlatDataFontSpecRawNameData = record
-
-                                              { the type of name being specified}
+{ the type of name being specified}
 		fontNameType: FontNameCode;
 
                                               { the platform type of the font name, whether it be Unicode, Mac, etc.  }
@@ -543,11 +610,10 @@ type
 
                                               { the length of the font name in bytes, not including any padding bytes}
                                               { added to maintain the four byte alignment}
-		fontNameLength: ByteCount;
+		fontNameLength: UInt32;
 
                                               { after the name length comes the actual font name data itself, plus any}
                                               { padding bytes needed to maintain the four byte alignment.}
-
 	end;
 	ATSFlatDataFontSpecRawNameDataPtr = ^ATSFlatDataFontSpecRawNameData;
 {
@@ -563,24 +629,26 @@ type
 }
 type
 	ATSFlatDataFontSpecRawNameDataHeader = record
-
-                                              { the number of flattened font names. There must be at least one flattened }
+{ the number of flattened font names. There must be at least one flattened }
                                               { font name, otherwise the structure is malformed.}
-		numberOfFlattenedNames: ItemCount;
+		numberOfFlattenedNames: UInt32;
 
                                               { the first in an array of possibly many font name specifiers - depending}
                                               { on how specific the caller wants this. There must be one }
                                               { ATSFlatDataFontNameData structure for each numberOfFlattenedNames}
                                               { above.}
 		nameDataArray: array[0..0] of ATSFlatDataFontSpecRawNameData;
-
 	end;
 	ATSFlatDataFontSpecRawNameDataHeaderPtr = ^ATSFlatDataFontSpecRawNameDataHeader;
 { ---------------------------------------------------------------------------- }
 { Style Flattening and Parsing Functions                                       }
 { ---------------------------------------------------------------------------- }
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUFlattenStyleRunsToStream()
+ *  ATSUFlattenStyleRunsToStream()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CoreFoundation flattening API instead.
  *  
  *  Summary:
  *    Converts a series of ATSUStyle objects and associated run info to
@@ -598,7 +666,7 @@ type
  *    iFlattenOptions, iNumberOfRunInfo, iRunInfoArray,
  *    iNumberOfStyleObjects, and iStyleArray parameters. Set
  *    iStreamBufferSize to 0, oStreamBuffer to NULL, and pass a valid
- *    reference to a ByteCount variable in the oActualStreamBufferSize
+ *    reference to a UInt32 variable in the oActualStreamBufferSize
  *    parameter. Call the function ATSUFlattenStyleRunsToStream. On
  *    return, oActualStreamBufferSize points to the size needed for the
  *    buffer. (2) Allocate an appropriately-sized buffer for the
@@ -615,7 +683,7 @@ type
  *    iFlattenOptions:
  *      The options you want to use to flatten the data. There are no
  *      options supported at this time, so you must pass the constant
- *      kATSUFlattenOptionsNoOptionsMask.
+ *      kATSUFlattenOptionNoOptionsMask.
  *    
  *    iNumberOfRunInfo:
  *      The number of style run information structures passed in the
@@ -668,16 +736,19 @@ type
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUFlattenStyleRunsToStream( iStreamFormat: ATSUFlattenedDataStreamFormat; iFlattenOptions: ATSUFlattenStyleRunOptions; iNumberOfRunInfo: ItemCount; iRunInfoArray: ATSUStyleRunInfoPtr; iNumberOfStyleObjects: ItemCount; iStyleArray: ATSUStylePtr; iStreamBufferSize: ByteCount; oStreamBuffer: UnivPtr; oActualStreamBufferSize: ByteCountPtr ): OSStatus; external name '_ATSUFlattenStyleRunsToStream';
+function ATSUFlattenStyleRunsToStream( iStreamFormat: ATSUFlattenedDataStreamFormat; iFlattenOptions: ATSUFlattenStyleRunOptions; iNumberOfRunInfo: ItemCount; {const} iRunInfoArray: {variable-size-array} ATSUStyleRunInfoPtr; iNumberOfStyleObjects: ItemCount; {const} iStyleArray: {variable-size-array} ATSUStylePtr; iStreamBufferSize: ByteCount; oStreamBuffer: UnivPtr; oActualStreamBufferSize: ByteCountPtr ): OSStatus; external name '_ATSUFlattenStyleRunsToStream';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUUnflattenStyleRunsFromStream()
+ *  ATSUUnflattenStyleRunsFromStream()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CoreFoundation flattening API instead.
  *  
  *  Summary:
  *    Creates a series of ATSUStyle objects and associated run
@@ -719,7 +790,7 @@ function ATSUFlattenStyleRunsToStream( iStreamFormat: ATSUFlattenedDataStreamFor
  *    iUnflattenOptions:
  *      The options you want to use to unflatten the data. There are no
  *      options supported at this time, so you must pass the constant
- *      kATSUUnflattenOptionsNoOptionsMask.
+ *      kATSUUnflattenOptionNoOptionsMask.
  *    
  *    iStreamBufferSize:
  *      The size of the buffer pointed to by the iStreamBuffer
@@ -733,7 +804,7 @@ function ATSUFlattenStyleRunsToStream( iStreamFormat: ATSUFlattenedDataStreamFor
  *    
  *    iNumberOfRunInfo:
  *      The number of style run information structures passed in the
- *      iRunInfoArray parameter. If you are uncertain of the number of
+ *      oRunInfoArray parameter. If you are uncertain of the number of
  *      style run information structures, see the Discussion.
  *    
  *    iNumberOfStyleObjects:
@@ -776,46 +847,59 @@ function ATSUFlattenStyleRunsToStream( iStreamFormat: ATSUFlattenedDataStreamFor
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.2 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  *    Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
-function ATSUUnflattenStyleRunsFromStream( iStreamFormat: ATSUFlattenedDataStreamFormat; iUnflattenOptions: ATSUUnFlattenStyleRunOptions; iStreamBufferSize: ByteCount; iStreamBuffer: UnivPtr; iNumberOfRunInfo: ItemCount; iNumberOfStyleObjects: ItemCount; oRunInfoArray: ATSUStyleRunInfoPtr; oStyleArray: ATSUStylePtr; oActualNumberOfRunInfo: ItemCountPtr; oActualNumberOfStyleObjects: ItemCountPtr ): OSStatus; external name '_ATSUUnflattenStyleRunsFromStream';
+function ATSUUnflattenStyleRunsFromStream( iStreamFormat: ATSUFlattenedDataStreamFormat; iUnflattenOptions: ATSUUnFlattenStyleRunOptions; iStreamBufferSize: ByteCount; iStreamBuffer: {const} UnivPtr; iNumberOfRunInfo: ItemCount; iNumberOfStyleObjects: ItemCount; oRunInfoArray: {variable-size-array} ATSUStyleRunInfoPtr; oStyleArray: {variable-size-array} ATSUStylePtr; oActualNumberOfRunInfo: ItemCountPtr; oActualNumberOfStyleObjects: ItemCountPtr ): OSStatus; external name '_ATSUUnflattenStyleRunsFromStream';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { Functions listed beyond this point are either deprecated or not recommended }
 
 {
- *  ATSUCopyToHandle()
+ *  ATSUCopyToHandle()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CoreFoundation flattening API instead.
  *  
  *  Discussion:
  *    This function is no longer recommended. Please use
  *    ATSUFlattenStyleRunsToStream instead.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.1
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUCopyToHandle( iStyle: ATSUStyle; oStyleHandle: Handle ): OSStatus; external name '_ATSUCopyToHandle';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 *)
 
 
 {
- *  ATSUPasteFromHandle()
+ *  ATSUPasteFromHandle()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CoreFoundation flattening API instead.
  *  
  *  Discussion:
  *    This function is no longer recommended. Please use
  *    ATSUUnflattenStyleRunsFromStream instead.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.1
  *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 8.5 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUPasteFromHandle( iStyle: ATSUStyle; iStyleHandle: Handle ): OSStatus; external name '_ATSUPasteFromHandle';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 *)
+
+
+{$endc} {not TARGET_CPU_64}
+
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 308 - 135
packages/univint/src/ATSUnicodeFonts.pas


+ 219 - 108
packages/univint/src/ATSUnicodeGlyphs.pas

@@ -3,9 +3,9 @@
  
      Contains:   ATSUI glyph handling functions.
  
-     Version:    Quickdraw-150~1
+     Version:    Quickdraw-262~1
  
-     Copyright:  © 2003 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2003-2008 by Apple Inc. all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +14,14 @@
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +30,8 @@
 
 unit ATSUnicodeGlyphs;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +44,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +83,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +167,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,15 +177,27 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,ATSUnicodeTypes,TextCommon,ATSTypes;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
 
 { ---------------------------------------------------------------------------- }
 { ATSUI glyph metrics                                                          }
 { ---------------------------------------------------------------------------- }
 
 
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUGlyphGetIdealMetrics()
+ *  ATSUGlyphGetIdealMetrics()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontGetGlyphWithName,
+ *    CTFontGetVerticalTranslationsForGlyphs,
+ *    CTFontGetBoundingRectsForGlyphs, or CTFontGetAdvancesForGlyphs
+ *    instead.
  *  
  *  Summary:
  *    Obtains resolution-independent font metric information for glyphs
@@ -167,16 +251,21 @@ uses MacTypes,ATSUnicodeTypes,TextCommon,ATSTypes;
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGlyphGetIdealMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCount; iGlyphIDs: GlyphIDPtr; iInputOffset: ByteOffset; oIdealMetrics: ATSGlyphIdealMetricsPtr ): OSStatus; external name '_ATSUGlyphGetIdealMetrics';
+function ATSUGlyphGetIdealMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCount; iGlyphIDs: {variable-size-array} GlyphIDPtr; iInputOffset: ByteOffset; oIdealMetrics: {variable-size-array} ATSGlyphIdealMetricsPtr ): OSStatus; external name '_ATSUGlyphGetIdealMetrics';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUGlyphGetScreenMetrics()
+ *  ATSUGlyphGetScreenMetrics()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontGetBoundingBox, CTFontGetUnderlinePosition,
+ *    CTFontGetUnderlineThickness, CTFontGetSlantAngle,
+ *    CTFontGetCapHeight, or CTFontGetXHeight iinstead.
  *  
  *  Summary:
  *    Obtains device-adjusted font metric information for glyphs
@@ -230,19 +319,22 @@ function ATSUGlyphGetIdealMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCoun
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGlyphGetScreenMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCount; iGlyphIDs: GlyphIDPtr; iInputOffset: ByteOffset; iForcingAntiAlias: Boolean; iAntiAliasSwitch: Boolean; oScreenMetrics: ATSGlyphScreenMetricsPtr ): OSStatus; external name '_ATSUGlyphGetScreenMetrics';
+function ATSUGlyphGetScreenMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCount; iGlyphIDs: {variable-size-array} GlyphIDPtr; iInputOffset: ByteOffset; iForcingAntiAlias: Boolean; iAntiAliasSwitch: Boolean; oScreenMetrics: {variable-size-array} ATSGlyphScreenMetricsPtr ): OSStatus; external name '_ATSUGlyphGetScreenMetrics';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { ---------------------------------------------------------------------------- }
 { ATSUI glyph curve access functions and callbacks                             }
 { ---------------------------------------------------------------------------- }
 {
- *  ATSUGetNativeCurveType()
+ *  ATSUGetNativeCurveType()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontCreatePathForGlyph instead.
  *  
  *  Summary:
  *    Returns the native curve format for a specific font.
@@ -273,12 +365,15 @@ function ATSUGlyphGetScreenMetrics( iATSUStyle: ATSUStyle; iNumOfGlyphs: ItemCou
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUGetNativeCurveType( iATSUStyle: ATSUStyle; var oCurveType: ATSCurveType ): OSStatus; external name '_ATSUGetNativeCurveType';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
+
+
+{$endc} {not TARGET_CPU_64}
 
 
 {
@@ -302,11 +397,9 @@ function ATSUGetNativeCurveType( iATSUStyle: ATSUStyle; var oCurveType: ATSCurve
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSQuadraticNewPathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSQuadraticNewPathProcPtr)              ATSQuadraticNewPathUPP;
-type ATSQuadraticNewPathUPP = Ptr;
-
+type
+	ATSQuadraticNewPathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
+	ATSQuadraticNewPathUPP = ATSQuadraticNewPathProcPtr;
 {
  *  NewATSQuadraticNewPathUPP()
  *  
@@ -315,8 +408,8 @@ type ATSQuadraticNewPathUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSQuadraticNewPathUPP( userRoutine: ATSQuadraticNewPathProcPtr ): ATSQuadraticNewPathUPP; external name '_NewATSQuadraticNewPathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSQuadraticNewPathUPP()
@@ -326,8 +419,8 @@ function NewATSQuadraticNewPathUPP( userRoutine: ATSQuadraticNewPathProcPtr ): A
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSQuadraticNewPathUPP( userUPP: ATSQuadraticNewPathUPP ); external name '_DisposeATSQuadraticNewPathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSQuadraticNewPathUPP()
@@ -337,9 +430,8 @@ procedure DisposeATSQuadraticNewPathUPP( userUPP: ATSQuadraticNewPathUPP ); exte
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function InvokeATSQuadraticNewPathUPP( callBackDataPtr: UnivPtr; userUPP: ATSQuadraticNewPathUPP ): OSStatus; external name '_InvokeATSQuadraticNewPathUPP';
-
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSQuadraticLineProcPtr
@@ -368,10 +460,9 @@ function InvokeATSQuadraticNewPathUPP( callBackDataPtr: UnivPtr; userUPP: ATSQua
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSQuadraticLineProcPtr = function( const (*var*) pt1, pt2: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSQuadraticLineProcPtr)                 ATSQuadraticLineUPP;
-type ATSQuadraticLineUPP = Ptr;
+type
+	ATSQuadraticLineProcPtr = function( const (*var*) pt1: Float32Point; const (*var*) pt2: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
+	ATSQuadraticLineUPP = ATSQuadraticLineProcPtr;
 {
  *  NewATSQuadraticLineUPP()
  *  
@@ -380,8 +471,8 @@ type ATSQuadraticLineUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSQuadraticLineUPP( userRoutine: ATSQuadraticLineProcPtr ): ATSQuadraticLineUPP; external name '_NewATSQuadraticLineUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSQuadraticLineUPP()
@@ -391,8 +482,8 @@ function NewATSQuadraticLineUPP( userRoutine: ATSQuadraticLineProcPtr ): ATSQuad
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSQuadraticLineUPP( userUPP: ATSQuadraticLineUPP ); external name '_DisposeATSQuadraticLineUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSQuadraticLineUPP()
@@ -402,9 +493,8 @@ procedure DisposeATSQuadraticLineUPP( userUPP: ATSQuadraticLineUPP ); external n
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function InvokeATSQuadraticLineUPP( const (*var*) pt1, pt2: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSQuadraticLineUPP ): OSStatus; external name '_InvokeATSQuadraticLineUPP';
-
+function InvokeATSQuadraticLineUPP( const (*var*) pt1: Float32Point; const (*var*) pt2: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSQuadraticLineUPP ): OSStatus; external name '_InvokeATSQuadraticLineUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSQuadraticCurveProcPtr
@@ -438,10 +528,9 @@ function InvokeATSQuadraticLineUPP( const (*var*) pt1, pt2: Float32Point; callBa
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSQuadraticCurveProcPtr = function( const (*var*) pt1, controlPt, pt2: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSQuadraticCurveProcPtr)                ATSQuadraticCurveUPP;
-type ATSQuadraticCurveUPP = Ptr;
+type
+	ATSQuadraticCurveProcPtr = function( const (*var*) pt1: Float32Point; const (*var*) controlPt: Float32Point; const (*var*) pt2: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
+	ATSQuadraticCurveUPP = ATSQuadraticCurveProcPtr;
 {
  *  NewATSQuadraticCurveUPP()
  *  
@@ -450,8 +539,8 @@ type ATSQuadraticCurveUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSQuadraticCurveUPP( userRoutine: ATSQuadraticCurveProcPtr ): ATSQuadraticCurveUPP; external name '_NewATSQuadraticCurveUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSQuadraticCurveUPP()
@@ -461,8 +550,8 @@ function NewATSQuadraticCurveUPP( userRoutine: ATSQuadraticCurveProcPtr ): ATSQu
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSQuadraticCurveUPP( userUPP: ATSQuadraticCurveUPP ); external name '_DisposeATSQuadraticCurveUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSQuadraticCurveUPP()
@@ -472,9 +561,8 @@ procedure DisposeATSQuadraticCurveUPP( userUPP: ATSQuadraticCurveUPP ); external
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function InvokeATSQuadraticCurveUPP( const (*var*) pt1, controlPt, pt2: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSQuadraticCurveUPP ): OSStatus; external name '_InvokeATSQuadraticCurveUPP';
-
+function InvokeATSQuadraticCurveUPP( const (*var*) pt1: Float32Point; const (*var*) controlPt: Float32Point; const (*var*) pt2: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSQuadraticCurveUPP ): OSStatus; external name '_InvokeATSQuadraticCurveUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSQuadraticClosePathProcPtr
@@ -497,10 +585,9 @@ function InvokeATSQuadraticCurveUPP( const (*var*) pt1, controlPt, pt2: Float32P
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSQuadraticClosePathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSQuadraticClosePathProcPtr)            ATSQuadraticClosePathUPP;
-type ATSQuadraticClosePathUPP = Ptr;
+type
+	ATSQuadraticClosePathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
+	ATSQuadraticClosePathUPP = ATSQuadraticClosePathProcPtr;
 {
  *  NewATSQuadraticClosePathUPP()
  *  
@@ -509,8 +596,8 @@ type ATSQuadraticClosePathUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSQuadraticClosePathUPP( userRoutine: ATSQuadraticClosePathProcPtr ): ATSQuadraticClosePathUPP; external name '_NewATSQuadraticClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSQuadraticClosePathUPP()
@@ -520,8 +607,8 @@ function NewATSQuadraticClosePathUPP( userRoutine: ATSQuadraticClosePathProcPtr
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSQuadraticClosePathUPP( userUPP: ATSQuadraticClosePathUPP ); external name '_DisposeATSQuadraticClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSQuadraticClosePathUPP()
@@ -531,11 +618,15 @@ procedure DisposeATSQuadraticClosePathUPP( userUPP: ATSQuadraticClosePathUPP );
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function InvokeATSQuadraticClosePathUPP( callBackDataPtr: UnivPtr; userUPP: ATSQuadraticClosePathUPP ): OSStatus; external name '_InvokeATSQuadraticClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUGlyphGetQuadraticPaths()
+ *  ATSUGlyphGetQuadraticPaths()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontCreatePathForGlyph instead.
  *  
  *  Summary:
  *    Uses a callback mechanism to obtain a set of Quadratic outlines
@@ -604,12 +695,15 @@ function InvokeATSQuadraticClosePathUPP( callBackDataPtr: UnivPtr; userUPP: ATSQ
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUGlyphGetQuadraticPaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; iNewPathProc: ATSQuadraticNewPathUPP; iLineProc: ATSQuadraticLineUPP; iCurveProc: ATSQuadraticCurveUPP; iClosePathProc: ATSQuadraticClosePathUPP; iCallbackDataPtr: UnivPtr; var oCallbackResult: OSStatus ): OSStatus; external name '_ATSUGlyphGetQuadraticPaths';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
+
+
+{$endc} {not TARGET_CPU_64}
 
 
 {
@@ -636,10 +730,9 @@ function ATSUGlyphGetQuadraticPaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; i
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSCubicMoveToProcPtr = function( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSCubicMoveToProcPtr)                   ATSCubicMoveToUPP;
-type ATSCubicMoveToUPP = Ptr;
+type
+	ATSCubicMoveToProcPtr = function( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
+	ATSCubicMoveToUPP = ATSCubicMoveToProcPtr;
 {
  *  NewATSCubicMoveToUPP()
  *  
@@ -648,8 +741,8 @@ type ATSCubicMoveToUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSCubicMoveToUPP( userRoutine: ATSCubicMoveToProcPtr ): ATSCubicMoveToUPP; external name '_NewATSCubicMoveToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSCubicMoveToUPP()
@@ -659,8 +752,8 @@ function NewATSCubicMoveToUPP( userRoutine: ATSCubicMoveToProcPtr ): ATSCubicMov
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSCubicMoveToUPP( userUPP: ATSCubicMoveToUPP ); external name '_DisposeATSCubicMoveToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSCubicMoveToUPP()
@@ -670,9 +763,8 @@ procedure DisposeATSCubicMoveToUPP( userUPP: ATSCubicMoveToUPP ); external name
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function InvokeATSCubicMoveToUPP( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSCubicMoveToUPP ): OSStatus; external name '_InvokeATSCubicMoveToUPP';
-
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSCubicLineToProcPtr
@@ -699,10 +791,9 @@ function InvokeATSCubicMoveToUPP( const (*var*) pt: Float32Point; callBackDataPt
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSCubicLineToProcPtr = function( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSCubicLineToProcPtr)                   ATSCubicLineToUPP;
-type ATSCubicLineToUPP = Ptr;
+type
+	ATSCubicLineToProcPtr = function( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
+	ATSCubicLineToUPP = ATSCubicLineToProcPtr;
 {
  *  NewATSCubicLineToUPP()
  *  
@@ -711,8 +802,8 @@ type ATSCubicLineToUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSCubicLineToUPP( userRoutine: ATSCubicLineToProcPtr ): ATSCubicLineToUPP; external name '_NewATSCubicLineToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSCubicLineToUPP()
@@ -722,8 +813,8 @@ function NewATSCubicLineToUPP( userRoutine: ATSCubicLineToProcPtr ): ATSCubicLin
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSCubicLineToUPP( userUPP: ATSCubicLineToUPP ); external name '_DisposeATSCubicLineToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSCubicLineToUPP()
@@ -733,9 +824,8 @@ procedure DisposeATSCubicLineToUPP( userUPP: ATSCubicLineToUPP ); external name
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function InvokeATSCubicLineToUPP( const (*var*) pt: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSCubicLineToUPP ): OSStatus; external name '_InvokeATSCubicLineToUPP';
-
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSCubicCurveToProcPtr
@@ -769,10 +859,9 @@ function InvokeATSCubicLineToUPP( const (*var*) pt: Float32Point; callBackDataPt
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSCubicCurveToProcPtr = function( const (*var*) pt, pt2, pt3: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSCubicCurveToProcPtr)                  ATSCubicCurveToUPP;
-type ATSCubicCurveToUPP = Ptr;
+type
+	ATSCubicCurveToProcPtr = function( const (*var*) pt1: Float32Point; const (*var*) pt2: Float32Point; const (*var*) pt3: Float32Point; callBackDataPtr: UnivPtr ): OSStatus;
+	ATSCubicCurveToUPP = ATSCubicCurveToProcPtr;
 {
  *  NewATSCubicCurveToUPP()
  *  
@@ -781,8 +870,8 @@ type ATSCubicCurveToUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSCubicCurveToUPP( userRoutine: ATSCubicCurveToProcPtr ): ATSCubicCurveToUPP; external name '_NewATSCubicCurveToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSCubicCurveToUPP()
@@ -792,8 +881,8 @@ function NewATSCubicCurveToUPP( userRoutine: ATSCubicCurveToProcPtr ): ATSCubicC
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSCubicCurveToUPP( userUPP: ATSCubicCurveToUPP ); external name '_DisposeATSCubicCurveToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSCubicCurveToUPP()
@@ -803,9 +892,8 @@ procedure DisposeATSCubicCurveToUPP( userUPP: ATSCubicCurveToUPP ); external nam
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function InvokeATSCubicCurveToUPP( const (*var*) pt, pt2, pt3: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSCubicCurveToUPP ): OSStatus; external name '_InvokeATSCubicCurveToUPP';
-
+function InvokeATSCubicCurveToUPP( const (*var*) pt1: Float32Point; const (*var*) pt2: Float32Point; const (*var*) pt3: Float32Point; callBackDataPtr: UnivPtr; userUPP: ATSCubicCurveToUPP ): OSStatus; external name '_InvokeATSCubicCurveToUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  ATSCubicClosePathProcPtr
@@ -828,10 +916,9 @@ function InvokeATSCubicCurveToUPP( const (*var*) pt, pt2, pt3: Float32Point; cal
  *    value. Note that any nonzero result from this callback will halt
  *    the curve drawing process.
  }
-type ATSCubicClosePathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
-// Beats me what this translates to.  If someone finds out they can tell me and we'll update it
-// typedef STACK_UPP_TYPE(ATSCubicClosePathProcPtr)                ATSCubicClosePathUPP;
-type ATSCubicClosePathUPP = Ptr;
+type
+	ATSCubicClosePathProcPtr = function( callBackDataPtr: UnivPtr ): OSStatus;
+	ATSCubicClosePathUPP = ATSCubicClosePathProcPtr;
 {
  *  NewATSCubicClosePathUPP()
  *  
@@ -840,8 +927,8 @@ type ATSCubicClosePathUPP = Ptr;
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function NewATSCubicClosePathUPP( userRoutine: ATSCubicClosePathProcPtr ): ATSCubicClosePathUPP; external name '_NewATSCubicClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  DisposeATSCubicClosePathUPP()
@@ -851,8 +938,8 @@ function NewATSCubicClosePathUPP( userRoutine: ATSCubicClosePathProcPtr ): ATSCu
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 procedure DisposeATSCubicClosePathUPP( userUPP: ATSCubicClosePathUPP ); external name '_DisposeATSCubicClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 {
  *  InvokeATSCubicClosePathUPP()
@@ -862,11 +949,15 @@ procedure DisposeATSCubicClosePathUPP( userUPP: ATSCubicClosePathUPP ); external
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   available as macro/inline
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function InvokeATSCubicClosePathUPP( callBackDataPtr: UnivPtr; userUPP: ATSCubicClosePathUPP ): OSStatus; external name '_InvokeATSCubicClosePathUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
+{$ifc not TARGET_CPU_64}
 {
- *  ATSUGlyphGetCubicPaths()
+ *  ATSUGlyphGetCubicPaths()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontCreatePathForGlyph instead.
  *  
  *  Summary:
  *    Uses a callback mechanism to obtain a set of Cubic outlines for a
@@ -924,7 +1015,7 @@ function InvokeATSCubicClosePathUPP( callBackDataPtr: UnivPtr; userUPP: ATSCubic
  *    
  *    iCallbackDataPtr:
  *      Any valid pointer. Any application specific data you wish to
- *      pass to your callbacks may be sent through this parameter. can be NULL
+ *      pass to your callbacks may be sent through this parameter.
  *    
  *    oCallbackResult:
  *      On return, status returned by callback functions. If an error
@@ -935,16 +1026,19 @@ function InvokeATSCubicClosePathUPP( callBackDataPtr: UnivPtr; userUPP: ATSCubic
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGlyphGetCubicPaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; iMoveToProc: ATSCubicMoveToUPP; iLineToProc: ATSCubicLineToUPP; iCurveToProc: ATSCubicCurveToUPP; iClosePathProc: ATSCubicClosePathUPP; iCallbackDataPtr: UnivPtr; var oCallbackResult: OSStatus ): OSStatus; external name '_ATSUGlyphGetCubicPaths';
+function ATSUGlyphGetCubicPaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; iMoveToProc: ATSCubicMoveToUPP; iLineToProc: ATSCubicLineToUPP; iCurveToProc: ATSCubicCurveToUPP; iClosePathProc: ATSCubicClosePathUPP; iCallbackDataPtr: UnivPtr { can be NULL }; var oCallbackResult: OSStatus ): OSStatus; external name '_ATSUGlyphGetCubicPaths';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 {
- *  ATSUGlyphGetCurvePaths()
+ *  ATSUGlyphGetCurvePaths()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTFontCreatePathForGlyph instead.
  *  
  *  Summary:
  *    Obtains glyph curve data without the use of callbacks.
@@ -986,19 +1080,19 @@ function ATSUGlyphGetCubicPaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; iMove
  *    oPaths:
  *      On return, a data structure containing glyph outline
  *      information. See ATSTypes.h for a definition of this data
- *      structure. can be NULL
+ *      structure.
  *  
  *  Result:
  *    On success, noErr is returned. See MacErrors.h for possible error
  *    codes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.6
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
-function ATSUGlyphGetCurvePaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; ioBufferSize: ByteCountPtr; oPaths: ATSUCurvePathsPtr ): OSStatus; external name '_ATSUGlyphGetCurvePaths';
+function ATSUGlyphGetCurvePaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; ioBufferSize: ByteCountPtr; oPaths: ATSUCurvePathsPtr { can be NULL } ): OSStatus; external name '_ATSUGlyphGetCurvePaths';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 *)
 
 
 { Functions listed beyond this point are either deprecated or not recommended }
@@ -1007,7 +1101,12 @@ function ATSUGlyphGetCurvePaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; ioBuf
 { ATSUI glyphInfo access (deprecated)                                          }
 { ---------------------------------------------------------------------------- }
 {
- *  ATSUGetGlyphInfo()
+ *  ATSUGetGlyphInfo()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetGlyphsPtr,CTRunGetGlyphs, CTRunGetPositionsPtr,
+ *    CTRunGetPositions, CTRunGetStringIndicesPtr,
+ *    CTRunGetStringIndices, CTRunGetStringRange instead.
  *  
  *  Summary:
  *    Obtains a copy of the style and layout information for each glyph
@@ -1017,16 +1116,21 @@ function ATSUGlyphGetCurvePaths( iATSUStyle: ATSUStyle; iGlyphID: GlyphID; ioBuf
  *    Please see ATSUnicodeDirectAccess.h for replacement functions.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.3
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUGetGlyphInfo( iTextLayout: ATSUTextLayout; iLineStart: UniCharArrayOffset; iLineLength: UniCharCount; ioBufferSize: ByteCountPtr; oGlyphInfoPtr: ATSUGlyphInfoArrayPtr ): OSStatus; external name '_ATSUGetGlyphInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
 
 
 {
- *  ATSUDrawGlyphInfo()
+ *  ATSUDrawGlyphInfo()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use CTRunGetGlyphsPtr,CTRunGetGlyphs, CTRunGetPositionsPtr,
+ *    CTRunGetPositions, CTRunGetStringIndicesPtr,
+ *    CTRunGetStringIndices, CTRunGetStringRange instead.
  *  
  *  Summary:
  *    Draws glyphs at the specified location, based on style and layout
@@ -1036,11 +1140,18 @@ function ATSUGetGlyphInfo( iTextLayout: ATSUTextLayout; iLineStart: UniCharArray
  *    Please see ATSUnicodeDirectAccess.h for replacement functions.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.3
  *    CarbonLib:        in CarbonLib 1.1 and later
  *    Non-Carbon CFM:   in ATSUnicodeLib 9.1 and later
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
 function ATSUDrawGlyphInfo( iGlyphInfoArray: ATSUGlyphInfoArrayPtr; iLocation: Float32Point ): OSStatus; external name '_ATSUDrawGlyphInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+
+
+{$endc} {not TARGET_CPU_64}
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 335 - 126
packages/univint/src/ATSUnicodeObjects.pas


File diff suppressed because it is too large
+ 225 - 202
packages/univint/src/ATSUnicodeTypes.pas


+ 1474 - 0
packages/univint/src/AUComponent.pas

@@ -0,0 +1,1474 @@
+{
+	File:		AUComponent.h
+
+	Contains:	AudioUnit Interfaces
+
+	Copyright:	© 2002-2008 by Apple Inc., all rights reserved.
+
+	Bugs?:		For bug reports, consult the following page on
+				the World Wide Web:
+
+					http://www.freepascal.org/bugs.html
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AUComponent;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,AudioComponents,CoreAudioTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
+
+//=====================================================================================================================
+//#pragma mark Overview
+
+{!
+    @header AUComponent
+	
+	@discussion
+	This file defines the collection of API calls for an audio unit. An audio unit is a plugin that can be loaded
+	into an application's process and used to process or generate audio. An audio unit is an AudioComponent type and so
+	the AudioComponent APIs are used to find specific types of audio units, open and close them.
+	
+	Audio units use a general notion of description to specify an unique instance. The Type is the general category of 
+	an audio unit. The SubType is an unique identifier specifed by the Manufacturer (provider) of the audio unit.
+	The IDs that are used for Type are specified by apple, the Manufacturer ID should be specified by an unique identifier
+	(as registered with apple). See AudioComponentDescription.
+	
+	Audio unit types are of the following (see below for more information)
+
+		kAudioUnitType_Output					= 'auou',
+		kAudioUnitType_MusicDevice				= 'aumu',
+		kAudioUnitType_MusicEffect				= 'aumf',
+		kAudioUnitType_FormatConverter			= 'aufc',	
+		kAudioUnitType_Effect					= 'aufx',	
+		kAudioUnitType_Mixer					= 'aumx',
+		kAudioUnitType_Panner					= 'aupn',
+		kAudioUnitType_OfflineEffect			= 'auol',
+		kAudioUnitType_Generator				= 'augn',
+
+	An audio unit's general opeartions are:
+		Open an audio unit (AudioComponentInstanceNew)
+		Configure it based on the context - AudioUnitSetProperty
+		Initialise the audio unit (AudioUnitInitialize)
+			- at this point the audio unit is in a state where it can render audio
+		Render audio (AudioUnitRender)
+		
+	An important part of a render operation for an audio unit is to manipulate the various controls that the unit provides
+	to change the render effects; for instance to change the decay time of a reverb, the cut off frequency of a filter, etc.
+	These are called parameters, and AudioUnitGetParameter and AudioUnitSetParameter are used to interact with these.
+	
+	If any reconfiguration of the audio unit is required, then:
+		uninitialise (AudioUnitUninitialise)
+		Configure it based on the context - AudioUnitSetProperty
+		Initialise the audio unit (AudioUnitInitialize)
+
+	Once the host is finished with an audio unit, it closes it:
+		Dispose audio unit (AudioComponentInstanceDispose)
+	
+	Audio units can be used programmatically (for instance a mixers could be used to render audio for a game, a generator 
+	to play audio files, etc), or they can be hosted in Digital Audio Workstation (DAW) applications such as Logic, Garage Band.
+	In the DAW case, it is common for an audio unit to provide a custom view to allow the user to interact with what can be
+	complex DSP opearations that the audio unit performs. The view is retrieved from an audio unit through AudioUnitGetProperty
+	and then the host instantiates it (see <AudioUnit/AUCocoaUIView.h>)
+	
+}
+
+
+//#if !__LP64__
+//	#if PRAGMA_STRUCT_ALIGN
+//		#pragma options align=mac68k
+//	#elif PRAGMA_STRUCT_PACKPUSH
+//		#pragma pack(push, 2)
+//	#elif PRAGMA_STRUCT_PACK
+//		#pragma pack(2)
+//	#endif
+//#endif
+{$ifc not TARGET_CPU_64}
+{$ALIGN MAC68K}
+{$endc}
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Audio Unit Types
+{!
+	@typedef			AudioUnit
+	@discussion			An audio unit is of type AudioComponentInstance as defined in AudioComponent.h
+}
+type
+	AudioUnit = AudioComponentInstance;
+
+
+{!
+    @enum           Audio Unit Types
+    @abstract		different types of audio units
+	@discussion		Audio unit's are classified into different types, where those types perform different roles and functions.
+					There are some general categories of functionality that apply across different types of audio units:
+					(1) Real-time usage
+						The audio unit will complete its operations in less time that is represented by the render buffer.
+						All audio units with the exception of the OfflineEffect should meet this criteria
+					(2) Real-time I/O
+						Will request the same amount of audio input as it is being asked to produce for output. Effects, Panners, 
+						Mixers and MusicDevices are required to adhere to this restriction. FormatConverter's can with some contraints
+						be used in this situation (for instance, sample rate conversion, float-int), but the host of the
+						audio unit is responsible for insuring this.
+					(3) UI versus Programmatic usage
+						UI usage covers the case of using an audio unit in a Digital Audio Workstation (DAW) with appropriate
+						UI (for example a filter in Garage Band or Logic). Effects, Panners, MusicDevices are all expected to be 
+						usable within this context. 
+						Programmatic usage is where an audio unit is used by a host app as part of a general signal processing chain.
+						For instance, a mixer audio unit can be used to take several different audio sources in a game and mix them together.
+						Mixers, Output units are for programmatic usage. 
+						FormatConverter and Generator types are generally programmatic audio units, but if they can be used in a UI situation,
+						they specify a custom view. The app can then use that to decide that, with appropraite constraints, the audio unit
+						could be presented in a DAW type application. For instance, the AUConveter audio unit from apple can do sample rate
+						conversion, etc, but has not general utility for a user in a DAW app. Apple's Varispeed or AUTimePitch audio units 
+						can be used to change the playback rate and pitch and so could be used to good affect by a user in a DAW type environment,
+						as well as just providing this general functionality to any program.
+					
+	@constant		kAudioUnitType_Output
+					An output unit can be used as the head of an AUGraph. Apple provides a number of output units that interface
+					directly with an audio device
+					
+	@constant		kAudioUnitType_MusicDevice
+					Used to describe software musical instruments such as samplers and synthesisers. They respond to MIDI and create
+					notes, which are then controlled through parameters or MIDI control messages. See <AudioUnit/MusicDevice.h>
+										
+	@constant		kAudioUnitType_MusicEffect
+					Is an effect that is also able to respond directly to MIDI control messages, typically through the mapping of
+					these MIDI messages to different parameters of the effect's DSP algorithm.
+					
+	@constant		kAudioUnitType_FormatConverter
+					A format converter is a general category for audio units that can change the format (for instance, sample rate conversion)
+					from an input to an output, as well as other, non-I/O type manipulations (like a deferred render or varispeed type of operation).
+					As such, a format converter can ask for as much or as little audio input to produce a given output. They are still expected to
+					complete their rendering within the time represented by the output buffer. 
+					For format converters that have some utility as an "audio effect or processor", it is quite common to provide an offline version
+					of this audio unit as well. For instance, Apple ships a format converter (for use in a "real-time" like situation) and an offline
+					version (for processing audio files) of the Time Pitch and Varispeed audio units.
+					
+	@constant		kAudioUnitType_Effect
+					An audio unit that will process some x number of audio input samples to produce x number of audio output samples. The common case for an 
+					effect is to have a single input to a single output, though some effects take side-chain inputs as well. Effects can be run in
+					"offline" contexts (such as procesing a file), but they are expected to run in real-time. A delay unit or reverb is
+					a good example of this.
+					
+	@constant		kAudioUnitType_Mixer
+					An audio unit that takes some number of inputs, mixing them to provide 1 or more audio outputs. A stere mixer (mono and stereo inputs
+					to produce one stereo output) is an example of this.
+					
+	@constant		kAudioUnitType_Panner
+					A panner is a specialised effect that will pan a single audio input to a single output. Panner units are required to support
+					a collection of standardised parameters that specify the panning coordinates (aside from whatever custom parameters the
+					panner may provide). A surround panner is an example of this
+					
+	@constant		kAudioUnitType_Generator
+					A generator will have no audio input, but will just produce audio output. In some ways it is similar to a MusicDevice, except that a
+					generator provides no MIDI input, or notion of "notes". A tone generator is a good example of this.
+					
+	@constant		kAudioUnitType_OfflineEffect
+					An offline effect is used to process data from a file and is also used to publish a capability that cannot be run in real-time. For instance,
+					the process of normalisation requires seeing the entire audio input before the scalar to apply in the normalisation process can be estimated.
+					As such, offline effects also have a notion of a priming stage that can be performed before the actual rendering/processing phase is executed.
+}
+const
+	kAudioUnitType_Output = FourCharCode('auou');
+	kAudioUnitType_MusicDevice = FourCharCode('aumu');
+	kAudioUnitType_MusicEffect = FourCharCode('aumf');
+	kAudioUnitType_FormatConverter = FourCharCode('aufc');
+	kAudioUnitType_Effect = FourCharCode('aufx');
+	kAudioUnitType_Mixer = FourCharCode('aumx');
+	kAudioUnitType_Panner = FourCharCode('aupn');
+	kAudioUnitType_Generator = FourCharCode('augn');
+	kAudioUnitType_OfflineEffect = FourCharCode('auol');
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Apple Audio Units
+{!
+    @enum           Apple audio unit manufacturer ID.
+    @discussion		the unique ID used to identifier audio units provided by Apple Inc.
+}
+const
+	kAudioUnitManufacturer_Apple = FourCharCode('appl');
+	
+{!
+	@enum			Apple output audio unit sub types 
+	@discussion		These are the subtypes for the various output units that apple ships. Output units add an additional notion of Start and Stop
+					see <AudioUnit/AudioOutputUnit.h>
+
+	@constant		kAudioUnitSubType_GenericOutput
+					A generic output unit provides the start/stop API, and provides the basic services to convert Linear PCM formats.
+
+
+	@constant		kAudioUnitSubType_HALOutput			
+						- desktop only
+					The audio unit that interfaces to any audio device. The user specifies which audio device to track. The audio unit
+					can do input from the device as well as output to the device. Bus 0 is used for the output side, bus 1 is used
+					to get audio input from the device.
+					
+	@constant		kAudioUnitSubType_DefaultOutput		
+						- desktop only
+					A specialisation of AUHAL that is used to track the user's selection of the default device as set in the Sound Prefs
+					
+	@constant		kAudioUnitSubType_SystemOutput		
+						- desktop only
+					A specialisation of AUHAL that is used to track the user's selection of the device to use for sound effects, alerts
+					and other UI sounds.
+
+	@constant		kAudioUnitSubType_RemoteIO			
+						- iPhone only
+					The audio unit that interfaces to the audio I/O pathways of the iPhone. The audio unit
+					can do input as well as output. Bus 0 is used for the output side, bus 1 is used
+					to get audio input.
+}
+const
+	kAudioUnitSubType_GenericOutput = FourCharCode('genr');
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitSubType_HALOutput = FourCharCode('ahal');
+	kAudioUnitSubType_DefaultOutput = FourCharCode('def ');
+	kAudioUnitSubType_SystemOutput = 'sys ';
+//#else
+{$elsec} { not TARGET_OS_IPHONE }
+	kAudioUnitSubType_RemoteIO				= 'rioc';
+//#endif;
+{$endc} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple music instrument audio unit sub types 
+
+	@constant		kAudioUnitSubType_DLSSynth			
+						- desktop only
+					A multi-timbral music device that can use sample banks in either DLS or SoundFont formats. It fully supports GM-MIDI
+					and the basic extensions of GS-MIDI
+}
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+const
+	kAudioUnitSubType_DLSSynth = FourCharCode('dls ');
+//#endif
+{$endc} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple converter audio unit sub types 
+	@discussion		These are the subtypes for the various converter units that apple ships. Except for AUConverter, which is available
+					on both desktop and iPhone, these audio units are only available on the desktop.
+
+	@constant		kAudioUnitSubType_AUConverter
+					An audio unit that uses an AudioConverter to do Linear PCM conversions (sample rate, bit depth, interleaving).
+
+	@constant		kAudioUnitSubType_TimePitch
+						- desktop only
+					An audio unit that can be used to have independent control of both playback rate and pitch. It provides a generic view,
+					so can be used in both a UI and programmatic context. It also comes in an Offline version so can be used to process
+					audio files.
+					
+	@constant		kAudioUnitSubType_Varispeed
+						- desktop only
+					An audio unit that can be used to control playback rate (as the rate is faster, the pitch is higher). It provides a generic view,
+					so can be used in both a UI and programmatic context. It also comes in an Offline version so can be used to process
+					audio files.
+					
+	@constant		kAudioUnitSubType_DeferredRenderer
+						- desktop only
+					An audio unit that is used to get its input from a separate thread than the thread that its render method is called. It thus
+					allows an application to introduce multiple threads into a rendering graph. There is a buffer sized delay introduced between
+					the input and output
+					
+	@constant		kAudioUnitSubType_Splitter
+						- desktop only
+					An audio unit that provides 2 output buses and 1 input bus. The audio unit splits (duplicates) the input signal to the two 
+					output buses
+					
+	@constant		kAudioUnitSubType_Merger
+						- desktop only
+					An audio unit that provides 2 input buses and 2 output bus. The audio unit merges the two inputs to the single output
+
+	@constant		kAudioUnitSubType_AUiPodTime
+						- iPhone only
+					An audio unit that provides simple (and limited) control over playback rate and time.
+}
+const
+	kAudioUnitSubType_AUConverter = FourCharCode('conv');
+	
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitSubType_TimePitch = FourCharCode('tmpt');
+	kAudioUnitSubType_Varispeed = FourCharCode('vari');
+	kAudioUnitSubType_DeferredRenderer = FourCharCode('defr');
+	kAudioUnitSubType_Splitter = FourCharCode('splt');
+	kAudioUnitSubType_Merger = FourCharCode('merg');
+//#else
+{$elsec} { not TARGET_OS_IPHONE }
+	kAudioUnitSubType_AUiPodTime			= FourCharCode('iptm');
+//#endif;
+{$endc} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple effect audio unit sub types 
+	@discussion		These are the subtypes for the various effect units that apple ships
+
+	@constant		kAudioUnitSubType_Delay					
+						- desktop only
+					A delay audio unit
+					
+	@constant		kAudioUnitSubType_LowPassFilter			
+						- desktop only
+					A filter that passes frequencies below a specified cut-off frequency
+					
+	@constant		kAudioUnitSubType_HighPassFilter		
+						- desktop only
+					A filter that passes frequencies above a specified cut-off frequency
+					
+	@constant		kAudioUnitSubType_BandPassFilter		
+						- desktop only
+					A filter that passes frequencies between a low and high cut-off frequency.
+					
+	@constant		kAudioUnitSubType_HighShelfFilter		
+						- desktop only
+					A filter that can be used to implement a "treble" control
+					
+	@constant		kAudioUnitSubType_LowShelfFilter		
+						- desktop only
+					A filter that can be used to implement a "bass" control
+
+	@constant		kAudioUnitSubType_ParametricEQ			
+						- desktop only
+					A parameteric EQ filter
+					
+	@constant		kAudioUnitSubType_GraphicEQ				
+						- desktop only
+					A 10 or 31 band Graphic EQ
+					
+	@constant		kAudioUnitSubType_PeakLimiter			
+						- desktop only
+					A peak limiter
+					
+	@constant		kAudioUnitSubType_DynamicsProcessor		
+						- desktop only
+					A dynamics compressor/expander
+					
+	@constant		kAudioUnitSubType_MultiBandCompressor	
+						- desktop only
+					A 4 band compressor/expander
+					
+	@constant		kAudioUnitSubType_MatrixReverb			
+						- desktop only
+					A reverb that can be used to simulate various and different spaces
+					
+	@constant		kAudioUnitSubType_SampleDelay			
+						- desktop only
+					A delay that is used to delay the input a specified number of samples until the output
+					
+	@constant		kAudioUnitSubType_Pitch					
+						- desktop only
+					An audio unit used to change the pitch
+					
+	@constant		kAudioUnitSubType_AUFilter				
+						- desktop only
+					A filter unit that combines 5 different filters (low, 3 mids, high)
+					
+	@constant		kAudioUnitSubType_NetSend				
+						- desktop only
+					An audio unit that is used in conjunction with _NetReceive to send audio across the network (or between different applications)
+					
+	@constant		kAudioUnitSubType_Distortion			
+						- desktop only
+					A distortion audio unit 
+					
+	@constant		kAudioUnitSubType_RogerBeep				
+						- desktop only
+					An audio unit that can be used to emit a short tone in gaps between speech - similar to the tones used in a walkie-talkie
+					
+	@constant		kAudioUnitSubType_AUiPodEQ				
+						- iPhone only
+					A graphic EQ
+}
+const
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitSubType_Delay = FourCharCode('dely');
+	kAudioUnitSubType_LowPassFilter = FourCharCode('lpas');
+	kAudioUnitSubType_HighPassFilter = FourCharCode('hpas');
+	kAudioUnitSubType_BandPassFilter = FourCharCode('bpas');
+	kAudioUnitSubType_HighShelfFilter = FourCharCode('hshf');
+	kAudioUnitSubType_LowShelfFilter = FourCharCode('lshf');
+	kAudioUnitSubType_ParametricEQ = FourCharCode('pmeq');
+	kAudioUnitSubType_GraphicEQ = FourCharCode('greq');
+	kAudioUnitSubType_PeakLimiter = FourCharCode('lmtr');
+	kAudioUnitSubType_DynamicsProcessor = FourCharCode('dcmp');
+	kAudioUnitSubType_MultiBandCompressor = FourCharCode('mcmp');
+	kAudioUnitSubType_MatrixReverb = FourCharCode('mrev');
+	kAudioUnitSubType_SampleDelay = FourCharCode('sdly');
+	kAudioUnitSubType_Pitch = FourCharCode('tmpt');
+	kAudioUnitSubType_AUFilter = FourCharCode('filt');
+	kAudioUnitSubType_NetSend = FourCharCode('nsnd');
+	kAudioUnitSubType_Distortion = FourCharCode('dist');
+	kAudioUnitSubType_RogerBeep = FourCharCode('rogr');
+//#else
+{$elsec} { not TARGET_OS_IPHONE }
+	kAudioUnitSubType_AUiPodEQ				= FourCharCode('ipeq');
+//#endif
+{$endif} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple mixer audio unit sub types 
+	@discussion		These are the subtypes for the various mixer units that apple ships
+
+	@constant		kAudioUnitSubType_MultiChannelMixer
+					Can have any number of inputs, with any number of channels on any input to one output bus with any number of channels on 
+					the desktop. On iPhone the output number of channels is 2.
+				
+	@constant		kAudioUnitSubType_StereoMixer
+						- desktop only
+					Inputs can be mono or stereo. Single stereo output
+					
+	@constant		kAudioUnitSubType_3DMixer
+						- desktop only
+					Inputs can be mono, in which case they can be panned around using 3D coordinates and parameters. 
+					Stereo inputs are passed directly through to the output.
+					4 channel "ambisonic" inputs will be rendered to the output configuration
+					A single output of 2, 4, 5, 6, 7 or 8 channels.
+					
+	@constant		kAudioUnitSubType_MatrixMixer
+						- desktop only
+					Any number of input and output buses with any number of channels on any bus. The mix is presented as a matrix
+					of channels that can be controlled through input volume per channel, "cross-point" volume (a given input channel to a given output channel),
+					output volume per channel and a global volume across the whole matrix
+
+	@constant		kAudioUnitSubType_AU3DMixerEmbedded
+						- iPhone only
+					A scaled-down version of the AU3DMixer that presents a stereo output, mono or stereo inputs
+}
+const
+	kAudioUnitSubType_MultiChannelMixer = FourCharCode('mcmx');
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitSubType_StereoMixer = FourCharCode('smxr');
+	kAudioUnitSubType_3DMixer = FourCharCode('3dmx');
+	kAudioUnitSubType_MatrixMixer = FourCharCode('mxmx');
+//#else
+{$elsec} { not TARGET_OS_IPHONE }
+	kAudioUnitSubType_AU3DMixerEmbedded		= FourCharCode('3dem');
+//#endif;
+{$endc} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple panner audio unit sub types 
+	@discussion		These are the subtypes for the various panner units that apple ships
+
+	@constant		kAudioUnitSubType_SphericalHeadPanner
+						- desktop only
+					A panner unit that uses the spherical head model to pan to a stereo output
+					
+	@constant		kAudioUnitSubType_VectorPanner
+						- desktop only
+					A panner unit that uses a moving pan between the two closes, adjacent channels in a 3D space to a
+					surround output
+					
+	@constant		kAudioUnitSubType_SoundFieldPanner
+						- desktop only
+					A panner unit that uses a sound-field notion to pan to a surround output
+					
+	@constant		kAudioUnitSubType_HRTFPanner
+						- desktop only
+					A panner unit that uses a generic "HRTF" model to pan to a stereo output
+}
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+const
+	kAudioUnitSubType_SphericalHeadPanner = FourCharCode('sphr');
+	kAudioUnitSubType_VectorPanner = FourCharCode('vbas');
+	kAudioUnitSubType_SoundFieldPanner = FourCharCode('ambi');
+	kAudioUnitSubType_HRTFPanner = FourCharCode('hrtf');
+//#endif
+{$endc} { not TARGET_OS_IPHONE }
+
+{!
+	@enum			Apple generator audio unit sub types 
+	@discussion		These are the subtypes for the various generator units that apple ships
+
+	@constant		kAudioUnitSubType_ScheduledSoundPlayer
+						- desktop only
+					A generator unit that can be used to schedule slices of audio to be played at a specified time. The audio
+					is scheduled using the time stamps for the render operation, and can be scheduled from any thread.
+					
+	@constant		kAudioUnitSubType_AudioFilePlayer
+						- desktop only
+					A generator unit that is used to play a file. It presents a custom UI so can be used in a UI context as well
+					
+	@constant		kAudioUnitSubType_NetReceive
+						- desktop only
+					A generator unit that is paired with _NetSend to receive the audio that unit sends. 
+					It presents a custom UI so can be used in a UI context as well
+}
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+const
+	kAudioUnitSubType_ScheduledSoundPlayer = FourCharCode('sspl');
+	kAudioUnitSubType_AudioFilePlayer = FourCharCode('afpl');
+	kAudioUnitSubType_NetReceive = FourCharCode('nrcv');
+//#endif
+{$endc} { not TARGET_OS_IPHONE }
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Audio Unit Constants and typedefs
+{!
+	@enum			AudioUnitRenderActionFlags
+	@discussion		These flags can be set in a callback from an audio unit during an audio unit render operation from 
+					either the RenderNotify Proc or the render input callback.
+
+	@constant		kAudioUnitRenderAction_PreRender
+					Called on a render notification Proc - which is called either before or after the render operation 
+					of the audio unit. If this flag is set, the proc is being called before the render operation is performed.
+					
+	@constant		kAudioUnitRenderAction_PostRender
+					Called on a render notification Proc - which is called either before or after the render operation 
+					of the audio unit. If this flag is set, the proc is being called after the render operation is completed.
+
+	@constant		kAudioUnitRenderAction_OutputIsSilence
+					This flag can be set in a render input callback (or in the audio unit's render operation itself) and is used to 
+					indicate that the render buffer contains only silence. It can then be used by the caller as a hint to whether 
+					the buffer needs to be processed or not.
+					
+	@constant		kAudioOfflineUnitRenderAction_Preflight
+					This is used with offline audio units (of type 'auol'). It is used when an offline unit is being preflighted, which
+					is performed prior to the actual offline rendering actions are performed. It is used for those cases where the 
+					offline process needs it (for example, with an offline unit that normalises an audio file, it needs to see all
+					of the audio data first before it can perform its normalisation)
+					
+	@constant		kAudioOfflineUnitRenderAction_Render
+					Once an offline unit has been successfully preflighted, it is then put into its render mode. So this flag is set
+					to indicate to the audio unit that it is now in that state and that it should perform its processing on the input data.
+					
+	@constant		kAudioOfflineUnitRenderAction_Complete	= (1 << 7),
+					This flag is set when an offline unit has completed either its preflight or performed render operations
+					
+	@constant		kAudioUnitRenderAction_PostRenderError
+					If this flag is set on the post-render call an error was returned by the AUs render operation. 
+					In this case, the error can be retrieved through the lastRenderError property and the audio data in
+					ioData handed to the post-render notification will be invalid.
+}
+const
+	kAudioUnitRenderAction_PreRender = 1 shl 2;
+	kAudioUnitRenderAction_PostRender = 1 shl 3;
+	kAudioUnitRenderAction_OutputIsSilence = 1 shl 4;
+	kAudioOfflineUnitRenderAction_Preflight = 1 shl 5;
+	kAudioOfflineUnitRenderAction_Render = 1 shl 6;
+	kAudioOfflineUnitRenderAction_Complete = 1 shl 7;
+	kAudioUnitRenderAction_PostRenderError = 1 shl 8;
+type
+	AudioUnitRenderActionFlags = UInt32;
+
+{!
+	@enum			Audio unit errors
+	@discussion		These are the various errors that can be returned by AudioUnit... API calls
+
+	@constant		kAudioUnitErr_InvalidProperty
+					The property is not supported
+	@constant		kAudioUnitErr_InvalidParameter
+					The parameter is not supported
+	@constant		kAudioUnitErr_InvalidElement
+					The specified element is not valid
+	@constant		kAudioUnitErr_NoConnection
+					There is no connection (generally an audio unit is asked to render but it has not input from which to gather data)
+	@constant		kAudioUnitErr_FailedInitialization
+					The audio unit is unable to be initialised
+	@constant		kAudioUnitErr_TooManyFramesToProcess
+					When an audio unit is initialised it has a value which specifies the max number of frames it will be asked to render at any 
+					given time. If an audio unit is asked to render more than this, this error is returned.
+	@constant		kAudioUnitErr_InvalidFile
+					If an audio unit uses external files as a data source, this error is returned if a file is invalid (Apple's DLS synth returns this error)
+	@constant		kAudioUnitErr_FormatNotSupported
+					Returned if an input or output format is not supported
+	@constant		kAudioUnitErr_Uninitialized
+					Returned if an operation requires an audio unit to be initialised and it is not.
+	@constant		kAudioUnitErr_InvalidScope
+					The specified scope is invalid
+	@constant		kAudioUnitErr_PropertyNotWritable
+					The property cannot be written
+	@constant		kAudioUnitErr_CannotDoInCurrentContext
+					Returned when an audio unit is in a state where it can't perform the requested action now - but it could later. Its usually used
+					to guard a render operation when a reconfiguration of its internal state is being performed.
+	@constant		kAudioUnitErr_InvalidPropertyValue
+					The property is valid, but the value of the property being provided is not
+	@constant		kAudioUnitErr_PropertyNotInUse
+					Returned when a property is valid, but it hasn't been set to a valid value at this time.	
+	@constant		kAudioUnitErr_Initialized
+					Indicates the operation cannot be performed because the audio unit is initialized.
+	@constant		kAudioUnitErr_InvalidOfflineRender
+					Used to indicate that the offline render operation is invalid. For instance, when the audio unit needs to be pre-flighted, 
+					but it hasn't been.
+	@constant		kAudioUnitErr_Unauthorized
+					Returned by either Open or Initialise, this error is used to indicate that the audio unit is not authorised, that it cannot
+					be used. A host can then present a UI to notify the user the audio unit is not able to be used in its current state.
+}
+const
+	kAudioUnitErr_InvalidProperty = -10879;
+	kAudioUnitErr_InvalidParameter = -10878;
+	kAudioUnitErr_InvalidElement = -10877;
+	kAudioUnitErr_NoConnection = -10876;
+	kAudioUnitErr_FailedInitialization = -10875;
+	kAudioUnitErr_TooManyFramesToProcess = -10874;
+	kAudioUnitErr_InvalidFile = -10871;
+	kAudioUnitErr_FormatNotSupported = -10868;
+	kAudioUnitErr_Uninitialized = -10867;
+	kAudioUnitErr_InvalidScope = -10866;
+	kAudioUnitErr_PropertyNotWritable = -10865;
+	kAudioUnitErr_CannotDoInCurrentContext = -10863;
+	kAudioUnitErr_InvalidPropertyValue = -10851;
+	kAudioUnitErr_PropertyNotInUse = -10850;
+	kAudioUnitErr_Initialized = -10849;
+	kAudioUnitErr_InvalidOfflineRender = -10848;
+	kAudioUnitErr_Unauthorized = -10847;
+
+{!
+	@typedef			AudioUnitPropertyID
+	@discussion			Type used for audio unit properties. 
+						Properties are used to describe the state of an audio unit (for instance, the input or output audio format)
+}
+type
+	AudioUnitPropertyID = UInt32;
+{!
+	@typedef			AudioUnitScope
+	@discussion			Type used for audio unit scopes. Apple reserves the 0 < 1024 range for audio unit scope identifiers.  
+						Scopes are used to delineate a major attribute of an audio unit (for instance, global, input, output)
+}
+type
+	AudioUnitScope = UInt32;
+{!
+	@typedef			AudioUnitElement
+	@discussion			Type used for audio unit elements.
+						Scopes can have one or more member, and a member of a scope is addressed / described by its element
+						For instance, input bus 1 is input scope, element 1
+}
+type
+	AudioUnitElement = UInt32;
+{!
+	@typedef			AudioUnitParameterID
+	@discussion			Type used for audio unit parameters. 
+						Parameters are typically used to control and set render state (for instance, filter cut-off frequency)
+}
+type
+	AudioUnitParameterID = UInt32;
+{!
+	@typedef			AudioUnitParameterValue
+	@discussion			Type used for audio unit parameter values. 
+						The value of a given parameter is specified using this type (typically a Float32)
+}
+type
+	AudioUnitParameterValue = Float32;
+	AudioUnitParameterValuePtr = ^AudioUnitParameterValue;
+
+{!
+	@enum			AUParameterEventType
+	@discussion		The type of a parameter event (see AudioUnitScheduleParameter)
+
+	@constant		kParameterEvent_Immediate
+					The parameter event describes an immediate change to the parameter value to the new value
+	@constant		kParameterEvent_Ramped
+					The parameter event describes a change to the parameter value that should be applied over
+					the specified period of time
+}
+const
+	kParameterEvent_Immediate = 1;
+	kParameterEvent_Ramped = 2;
+type
+	AUParameterEventType = UInt32;
+
+{!
+	@struct			AudioUnitParameterEvent
+	@discussion		A parameter event describes a change to a parameter's value, where the type of the event describes
+					how that change is to be applied (see AUParameterEventType). A parameter is uniquely defined through
+					the triplet of scope, element and parameterID.
+					
+					See AudioUnitScheduleParameters
+
+	@field			scope	
+					The scope for the parameter
+	@field			element
+					The element for the parameter
+	@field			parameter
+					The parameterID for the parameter
+	
+	@field			eventType
+					The event type. This field further defines how the union described by eventValues is to be interpreted.
+	
+	@field			eventValues
+					If the parameter event type is _Immediate, then the immediate struct of this union should be used.
+					If the parameter event type is _Ramped, then the ramp struct of this union should be used.
+					
+}
+type
+	AudioUnitParameterEventRampRec = record
+		startBufferOffset: SInt32;
+		durationInFrames: UInt32;
+		startValue: AudioUnitParameterValue;
+		endValue: AudioUnitParameterValue;
+	end;
+	AudioUnitParameterEventImmediateRec = record
+		bufferOffset: UInt32;
+		value: AudioUnitParameterValue;
+	end;
+	AudioUnitParameterEventEventValues = record
+		case UInt8 of
+			0:	(ramp : AudioUnitParameterEventRampRec);
+			1:	(immediate : AudioUnitParameterEventImmediateRec);
+	end;
+	
+	AudioUnitParameterEvent = record
+		scope: AudioUnitScope;
+		element: AudioUnitElement;
+		parameter: AudioUnitParameterID;
+	
+		eventType: AUParameterEventType;
+		eventValues: AudioUnitParameterEventEventValues;
+	end;
+	AudioUnitParameterEventPtr = ^AudioUnitParameterEvent;
+	
+{!
+	@struct			AudioUnitParameter
+	@discussion		An audio unit parameter is defined by the triplet of audio unit scope, element and parameterID. This struct
+					is used with the functions in AudioUnitUtilities.h to deal with audio unit parameters, but is included
+					in this header file for completeness
+
+	@field			mAudioUnit
+					The audio unit instance which the specified parameter applies too
+	@field			mParameterID
+					The parameterID for the parameter
+	@field			mScope	
+					The scope for the parameter
+	@field			mElement
+					The element for the parameter
+}
+type
+	AudioUnitParameter = record
+		mAudioUnit: AudioUnit;
+		mParameterID: AudioUnitParameterID;
+		mScope: AudioUnitScope;
+		mElement: AudioUnitElement;
+	end;
+	AudioUnitParameterPtr = ^AudioUnitParameter;
+	
+{!
+	@struct			AudioUnitProperty
+	@discussion		An audio unit property is defined by the triplet of audio unit scope, element and propertyID. This struct
+					is used with the functions in AudioUnitUtilities.h to deal with audio unit properties, but is included
+					in this header file for completeness
+
+	@field			mAudioUnit
+					The audio unit instance which the specified property applies too
+	@field			mPropertyID
+					The propertyID for the property
+	@field			mScope	
+					The scope for the property
+	@field			mElement
+					The element for the property
+}
+type
+	AudioUnitProperty = record
+		mAudioUnit: AudioUnit;
+		mPropertyID: AudioUnitPropertyID;
+		mScope: AudioUnitScope;
+		mElement: AudioUnitElement;
+	end;
+	AudioUnitPropertyPtr = ^AudioUnitProperty;
+	
+
+{!
+	@typedef		AURenderCallback
+	@discussion		This is the prototype for a function callback Proc that is used both with the AudioUnit render notification
+					API and the render input callback. See kAudioUnitProperty_SetRenderCallback property or AudioUnitAddRenderNotify.
+					This callback is part of the process of a call to AudioUnitRender. As a notification it is called either before
+					or after the audio unit's render operations. As a render input callback, it is called to provide input data for
+					the particular input bus the callback is attached too.
+	
+	@param			inRefCon
+					The client data that is provided either with the AURenderCallbackStruct or as specified with the Add API call
+	@param			ioActionFlags
+					Flags used to describe more about the context of this call (pre or post in the notify case for instance) 
+	@param			inTimeStamp
+					The times stamp associated with this call of audio unit render
+	@param			inBusNumber
+					The bus numbeer associated with this call of audio unit render
+	@param			inNumberFrames
+					The number of sample frames that will be represented in the audio data in the provided ioData parameter
+	@param			ioData
+					The AudioBufferList that will be used to contain the rendered or provided audio data
+}
+type
+	AURenderCallback = function( inRefCon: UnivPtr; var ioActionFlags: AudioUnitRenderActionFlags; const (*var*) inTimeStamp: AudioTimeStamp; inBusNumber: UInt32; inNumberFrames: UInt32; var ioData: AudioBufferList ): OSStatus;
+
+{!
+	@typedef		AudioUnitPropertyListenerProc
+	@discussion		This is the prototype for a function callback Proc that is registered with an audio unit to notify the caller
+					of any changes to a value of an audio unit property. See AudioUnitAddPropertyListener
+	
+	@param			inRefCon
+					The client data that is provided with the add property listener registration
+	@param			inUnit
+					The audio unit upon which the specified property value has changed
+	@param			inID
+					The property whose value has changed
+	@param			inScope
+					The scope of the property whose value has changed
+	@param			inElement
+					The element ID on the scope of the property whose value has changed
+}
+type
+	AudioUnitPropertyListenerProc = procedure( inRefCon: UnivPtr; inUnit: AudioUnit; inID: AudioUnitPropertyID; inScope: AudioUnitScope; inElement: AudioUnitElement );
+
+{!
+	@typedef		AUInputSamplesInOutputCallback
+	@discussion		This is the prototype for a function callback Proc that is registered with an audio unit to notify the caller
+					of for the user of a varispeed or AUTimePitch audio unit where it is not clear what input sample is represented
+					in the rendered output samples.
+	
+	@param			inRefCon
+					The client data that is provided with the add property listener registration
+	@param			inOutputTimeStamp
+					The time stamp that corresponds to the first sample of audio data produced in AudioUnitRender (its output data)
+	@param			inInputSample
+					The sample number of the input that is represented in the first sample of that output time stamp
+	@param			inNumberInputSamples
+					The number of input samples that are represented in an output buffer
+}
+type
+	AUInputSamplesInOutputCallback = procedure( inRefCon: UnivPtr; const (*var*) inOutputTimeStamp: AudioTimeStamp; inInputSample: Float64; inNumberInputSamples: Float64 );
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Functions
+
+{!
+	@function		AudioUnitInitialize
+	@abstract		initialize an audio unit
+	@discussion		Upon success, the audio unit has been successfully initialised. This means that the formats for input
+					and output are valid and can be supported and it has based its allocations on the max number of frames
+					that it is able to render at any given time. Once initialised, it is in a state where it can be asked 
+					to render.
+					
+					In common practise major state of an audio unit (such as its I/O formats, memory allocations) cannot be changed
+					while an audio unit is inialized.
+	
+	@param			inUnit
+					The audio unit to initialise
+	@result			noErr, or an error representing the reasons why the audio unit was not able to be initialised successfully
+}
+function AudioUnitInitialize( inUnit: AudioUnit ): OSStatus; external name '_AudioUnitInitialize';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitUninitialize
+	@abstract		uninitialize and audio unit
+	@discussion		Once an audio unit has been initialised, to change its state in response to some kind of environmental change,
+					the audio unit should be uninitialised. This will have the effect of the audio unit de-allocating its resources.
+					The caller can then reconfigure the audio unit to match the new environment (for instance, the sample rate to proces
+					audio is different than it was) and then re-initialise the audio unit when those changes have been applied.
+	
+	@param			inUnit
+					The audio unit to uninitialise
+	@result			noErr, or an error representing the reasons why the audio unit was not able to be initialised successfully. Typically
+					this call won't return an error unless the audio unit in question is no longer valid.
+}
+function AudioUnitUninitialize( inUnit: AudioUnit ): OSStatus; external name '_AudioUnitUninitialize';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioUnitGetPropertyInfo
+	@abstract		retrieves information about a specified property
+	@discussion		The API can be used to retrieve both the size of the property, and whether it is writable or not. In order to 
+					get a general answer on the capability of an audio unit, this function should be called before the audio unit
+					is initialized (as some properties are writable when the audio unit is initialized, and others not)
+
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the proeprty identifier
+	@param			inScope
+					the scope of the property
+	@param			inElement
+					the element of the scope
+	@param			outDataSize
+					if not null, then will retrieve the maximum size for the property. if null, then it is ignored
+	@param			outWritable	
+					if not null, then will retrieve whether the property can be written or not. if null, then it is ignored
+	
+	@result			noErr, or various audio unit errors related to properties
+}
+function AudioUnitGetPropertyInfo( inUnit: AudioUnit; inID: AudioUnitPropertyID; inScope: AudioUnitScope; inElement: AudioUnitElement; outDataSize: UInt32Ptr; outWritable: BooleanPtr ): OSStatus; external name '_AudioUnitGetPropertyInfo';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitGetProperty
+	@abstract		retrieves the value of a specified property
+	@discussion		The API can is used to retrieve the value of the property. Property values for audio units are always passed
+					by reference
+					
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the proeprty identifier
+	@param			inScope
+					the scope of the property
+	@param			inElement
+					the element of the scope
+	@param			outData
+					used to retrieve the value of the property. It should point to memory at least as large as the value
+					desribed by ioDataSize 
+	@param			ioDataSize	
+					on input contains the size of the data pointed to by outData, on output, the size of the data that was returned.
+
+	@result			noErr, or various audio unit errors related to properties
+}
+function AudioUnitGetProperty( inUnit: AudioUnit; inID: AudioUnitPropertyID; inScope: AudioUnitScope; inElement: AudioUnitElement; outData: UnivPtr; var ioDataSize: UInt32 ): OSStatus; external name '_AudioUnitGetProperty';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitSetProperty
+	@abstract		sets the value of a specified property
+	@discussion		The API can is used to set the value of the property. Property values for audio units are always passed
+					by reference
+					
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the proeprty identifier
+	@param			inScope
+					the scope of the property
+	@param			inElement
+					the element of the scope
+	@param			inData
+					if not null, then is the new value for the property that will be set. If null, then inDataSize should be zero,
+					and the call is then used to remove a previously set value for a property. This removal is only valid for
+					some properties, as most properties will always have a default value if not set.
+	@param			inDataSize	
+					the size of the data being provided in inData
+
+	@result			noErr, or various audio unit errors related to properties
+}
+function AudioUnitSetProperty( inUnit: AudioUnit; inID: AudioUnitPropertyID; inScope: AudioUnitScope; inElement: AudioUnitElement; inData: {const} UnivPtr; inDataSize: UInt32 ): OSStatus; external name '_AudioUnitSetProperty';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitAddPropertyListener
+	@abstract		registration call to receive notifications for when a property changes
+	@discussion		When an audio unit property value changes, a notification callback can be called by the audio unit to 
+					inform interested parties that this event has occurred. The notification is defined by the tuple of
+					inProc and inProcUserData as paired to the specified property ID, so the previously defined 
+					AudioUnitRemovePropertyListener is dperecated because it didn't allow for the provision of
+					the inProcUserData to remove a given listener (so, you should use AudioUnitRemovePropertyListenerWithUserData).
+					
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the proeprty identifier
+	@param			inProc
+					the proceedure to call when the property changes (on any scope or element)
+	@param			inProcUserData
+					the user data to provide with the callback
+
+	@result			noErr, or various audio unit errors related to properties
+}
+function AudioUnitAddPropertyListener( inUnit: AudioUnit; inID: AudioUnitPropertyID; inProc: AudioUnitPropertyListenerProc; inProcUserData: UnivPtr ): OSStatus; external name '_AudioUnitAddPropertyListener';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitRemovePropertyListenerWithUserData
+	@abstract		remove a previously registered property listener
+	@discussion		Removes a previously registered property listener as specified by the inProc and inProcUser data
+					as paired to the property identifier
+					
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the proeprty identifier
+	@param			inProc
+					the proceedure previously registered
+	@param			inProcUserData
+					the user data paired with the provided inProc
+
+	@result			noErr, or various audio unit errors related to properties
+}
+function AudioUnitRemovePropertyListenerWithUserData( inUnit: AudioUnit; inID: AudioUnitPropertyID; inProc: AudioUnitPropertyListenerProc; inProcUserData: UnivPtr ): OSStatus; external name '_AudioUnitRemovePropertyListenerWithUserData';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitAddRenderNotify
+	@abstract		a notification callback to call when an audio unit is asked to render
+	@discussion		allows an application to register a callback with an audio unit for whenever the audio unit is asked
+					to render. The callback is called both before the audio unit performs its render operations (the render
+					flag's pre-render bit is set) and after the audio unit has completed its render operations (the render
+					flag's post-render bit is set). On post-render, the audio buffer list (ioData) will contain valid
+					audio data that was rendered by the audio unit.
+					
+					The inProc and inProcUserData are treated as a tuple entity, so when wanting to remove one, both the inProc
+					and its inProcUserData must be specified
+					
+	@param			inUnit
+					the audio unit
+	@param			inProc
+					an AURenderCallback proc
+	@param			inProcUserData
+					the user data that will be provided with the proc when it is called
+
+	@result			noErr, or an audio unit error code
+}
+function AudioUnitAddRenderNotify( inUnit: AudioUnit; inProc: AURenderCallback; inProcUserData: UnivPtr ): OSStatus; external name '_AudioUnitAddRenderNotify';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitRemoveRenderNotify
+	@abstract		remove a previously registered render notification proc
+	
+	@param			inUnit
+					the audio unit
+	@param			inProc
+					an AURenderCallback proc
+	@param			inProcUserData
+					the user data that was provided with the proc when it was previously registered
+
+	@result			noErr, or an audio unit error code
+}
+function AudioUnitRemoveRenderNotify( inUnit: AudioUnit; inProc: AURenderCallback; inProcUserData: UnivPtr ): OSStatus; external name '_AudioUnitRemoveRenderNotify';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitGetParameter
+	@abstract		Get the value of a parameter
+	@discussion		Get the value of a parameter as specified by its ID, scope and element. 
+	
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the parameter ID
+	@param			inScope
+					the scope for the parameter
+	@param			inElement
+					the element on the scope for the parameter
+	@param			outValue
+					Must be non-null, and upon success will contain the current value for the specified parameter
+	
+	@result			noErr, or an audio unit error code (such as InvalidParameter)
+}
+function AudioUnitGetParameter( inUnit: AudioUnit; inID: AudioUnitParameterID; inScope: AudioUnitScope; inElement: AudioUnitElement; var outValue: AudioUnitParameterValue ): OSStatus; external name '_AudioUnitGetParameter';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitSetParameter
+	@abstract		Set the value of a parameter
+	@discussion		Set the value of a parameter as specified by its ID, scope and element. Parameter IDs are consistent
+					across all of the elements in a scope - so for a mixer, the "input volume" parameter can be applied
+					on any input, and the particular input is specified by the elementID.
+	
+	@param			inUnit
+					the audio unit
+	@param			inID
+					the parameter ID
+	@param			inScope
+					the scope for the parameter
+	@param			inElement
+					the element on the scope for the parameter
+	@param			inValue
+					the new value for the parameter.
+	@param			inBufferOffsetInFrames
+					generally should be set to zero - see AudioUnitScheduleParameters
+	
+	@result			noErr, or an audio unit error code (such as InvalidParameter)
+}
+function AudioUnitSetParameter( inUnit: AudioUnit; inID: AudioUnitParameterID; inScope: AudioUnitScope; inElement: AudioUnitElement; inValue: AudioUnitParameterValue; inBufferOffsetInFrames: UInt32 ): OSStatus; external name '_AudioUnitSetParameter';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitScheduleParameters
+	@abstract		Schedule changes to the value of a parameter
+	@discussion		This API is used to schedule intra-buffer changes to the value of a parameter (immediate) or to
+					ramp a parameter from a start value to an end value for a specified number of samples (ramp)
+					
+					The API allows for the scheduling of multiple parameter events with the one call. All of the
+					parameter events must apply to the current (and only apply to the current) audio unit render
+					call, so the events are scheduled as a part of the pre-render notification callback.
+					
+					When scheduling an immediate parameter event, the new value at the specified sample buffer offset
+					is provided
+					
+					When scheduling a ramped parameter, the ramp is scheduled each audio unit render for the duration
+					of the ramp. Each schedule of the the new audio unit render specifies the progress of the ramp.
+					
+					Parameters that can have events scheduled to them will indicate this through their parameter info struct
+					
+	@param			inUnit
+					the audio unit
+	@param			inParameterEvent
+					a pointer to an array of parameter event structs
+	@param			inNumParamEvents
+					the number of parameter event structs pointed to by inParameterEvent
+	
+	@result			noErr, or an audio unit error code (such as InvalidParameter)
+}
+function AudioUnitScheduleParameters( inUnit: AudioUnit; const inParameterEvent: AudioUnitParameterEventPtr; inNumParamEvents: UInt32 ): OSStatus; external name '_AudioUnitScheduleParameters';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitRender
+	@abstract		the render operation where ioData will contain the results of the audio unit's render operations
+	@discussion		an audio unit will render the amount of audio data described by inNumberOfFrames and the results
+					of that render will be contained within ioData. The caller should provide audio time stamps 
+					where at least the sample time is valid and it is incrementing sequentially from its
+					previous call (so, the next time stamp will be the current time stamp + inNumberFrames) 
+					If the sample time is not incrementing sequentially, the audio unit will infer
+					that there is some discontinuity with the timeline it is rendering for
+	
+					The caller must provide a valid ioData AudioBufferList that matches the expected topology for the
+					current audio format for the given bus. The buffer list can be of two variants:
+					(1) If the mData pointers are non-null then the audio unit will render its output into those buffers
+					(2) If the mData pointers are null, then the audio unit can provide pointers to its own buffers. In this case
+					the audio unit is required to keep those buffers valid for the duration of the calling thread's I/O cycle
+					 
+	@param			inUnit
+					the audio unit
+	@param			ioActionFlags
+					any appropriate action flags for the render operation
+	@param			inTimeStamp
+					the time stamp that applies to this particular render operation. when rendering for multiple output buses
+					the time stamp will generally be the same for each output bus, so the audio unit is able to determine
+					without doubt that this the same render operation
+	@param			inOutputBusNumber
+					the output bus to render for
+	@param			inNumberFrames
+					the number of sample frames to render
+	@param			ioData
+					the audio buffer list that the audio unit is to render into.
+	
+	@result			noErr, or an audio unit render error
+}
+function AudioUnitRender( inUnit: AudioUnit; var ioActionFlags: AudioUnitRenderActionFlags; const (*var*) inTimeStamp: AudioTimeStamp; inOutputBusNumber: UInt32; inNumberFrames: UInt32; ioData: AudioBufferListPtr ): OSStatus; external name '_AudioUnitRender';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+{!
+	@function		AudioUnitReset
+	@abstract		reset an audio unit's render state
+	@discussion		This call will clear any render state of an audio unit. For instance, with a delay or reverb type of audio unit
+					reset will clear any of the delay lines maintained within the audio unit. Typically, this call is made when an
+					audio unit was previously rendering, and was taken out of the render chain (say, the track it is in was muted)
+					and is being added back in (unmuted). The host should reset the audio unit before adding it back so that 
+					it doesn't produce audio from its delay lines that is no longer valid.
+					
+					The call should only clear memory, it should NOT allocate or free memory resources (this is done in the 
+					Initialize calls).
+	
+	@param			inUnit
+					the audio unit
+	@param			inScope
+					the scope - typically this is set to GlobalScope
+	@param			inElement
+					the element - typically this is set to 0
+	
+	@result			noErr, or an audio unit error
+}
+function AudioUnitReset( inUnit: AudioUnit; inScope: AudioUnitScope; inElement: AudioUnitElement ): OSStatus; external name '_AudioUnitReset';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+
+{!
+	@enum			AudioUnitRange
+	@discussion		the range of selectors that are used to dispatch through to the various audio unit API
+
+	@constant		kAudioUnitRange
+	@constant		kAudioUnitInitializeSelect
+	@constant		kAudioUnitUninitializeSelect
+	@constant		kAudioUnitGetPropertyInfoSelect
+	@constant		kAudioUnitGetPropertySelect
+	@constant		kAudioUnitSetPropertySelect
+	@constant		kAudioUnitAddPropertyListenerSelect
+	@constant		kAudioUnitRemovePropertyListenerSelect
+	@constant		kAudioUnitRemovePropertyListenerWithUserDataSelect
+	@constant		kAudioUnitAddRenderNotifySelect
+	@constant		kAudioUnitRemoveRenderNotifySelect
+	@constant		kAudioUnitGetParameterSelect
+	@constant		kAudioUnitSetParameterSelect
+	@constant		kAudioUnitScheduleParametersSelect
+	@constant		kAudioUnitRenderSelect
+	@constant		kAudioUnitResetSelect
+}
+const
+	kAudioUnitRange = $0000;	// range of selectors for audio units
+	kAudioUnitInitializeSelect = $0001;
+	kAudioUnitUninitializeSelect = $0002;
+	kAudioUnitGetPropertyInfoSelect = $0003;
+	kAudioUnitGetPropertySelect = $0004;
+	kAudioUnitSetPropertySelect = $0005;
+	kAudioUnitAddPropertyListenerSelect = $000A;
+	kAudioUnitRemovePropertyListenerSelect = $000B;
+	kAudioUnitRemovePropertyListenerWithUserDataSelect = $0012;
+	kAudioUnitAddRenderNotifySelect = $000F;
+	kAudioUnitRemoveRenderNotifySelect = $0010;
+	kAudioUnitGetParameterSelect = $0006;
+	kAudioUnitSetParameterSelect = $0007;
+	kAudioUnitScheduleParametersSelect = $0011;
+	kAudioUnitRenderSelect = $000E;
+	kAudioUnitResetSelect = $0009;
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Fast-dispatch function prototypes
+{!
+	@typedef		AudioUnitGetParameterProc
+	@discussion		This proc can be exported through the FastDispatch property. A host can
+					then retrieve this Proc using that property and thus make a direct
+					call into your audio unit bypassing the component dispatch glue which
+					can add considerable overhead and is desirable to avoid.
+					
+					The arguments are the same as are provided to the corresponding API call
+	
+	@param			inComponentStorage
+					For a component manager component, this is the component instance storage pointer
+	@param			inID
+	@param			inScope
+	@param			inElement
+	@param			outValue
+}
+type
+	AudioUnitGetParameterProc = function( inComponentStorage: UnivPtr; inID: AudioUnitParameterID; inScope: AudioUnitScope; inElement: AudioUnitElement; var outValue: AudioUnitParameterValue ): OSStatus;
+								
+{!
+	@typedef		AudioUnitSetParameterProc
+	@discussion		This proc can be exported through the FastDispatch property. A host can
+					then retrieve this Proc using that property and thus make a direct
+					call into your audio unit bypassing the component dispatch glue which
+					can add considerable overhead and is desirable to avoid.
+					
+					The arguments are the same as are provided to the corresponding API call
+	
+	@param			inComponentStorage
+					For a component manager component, this is the component instance storage pointer
+	@param			inID
+	@param			inScope
+	@param			inElement
+	@param			inValue
+	@param			inBufferOffsetInFrames
+}
+type
+	AudioUnitSetParameterProc = function( inComponentStorage: UnivPtr; inID: AudioUnitParameterID; inScope: AudioUnitScope; inElement: AudioUnitElement; inValue: AudioUnitParameterValue; inBufferOffsetInFrames: UInt32 ): OSStatus;
+								
+{!
+	@typedef		AudioUnitRenderProc
+	@discussion		This proc can be exported through the FastDispatch property. A host can
+					then retrieve this Proc using that property and thus make a direct
+					call into your audio unit bypassing the component dispatch glue which
+					can add considerable overhead and is desirable to avoid.
+					
+					The arguments are the same as are provided to the corresponding API call
+	
+	@param			inComponentStorage
+					For a component manager component, this is the component instance storage pointer
+	@param			ioActionFlags
+	@param			inTimeStamp
+	@param			inOutputBusNumber
+	@param			inNumberFrames
+	@param			ioData
+}
+type
+	AudioUnitRenderProc = function( inComponentStorage: UnivPtr; var ioActionFlags: AudioUnitRenderActionFlags; const (*var*) inTimeStamp: AudioTimeStamp; inOutputBusNumber: UInt32; inNumberFrames: UInt32; ioData: AudioBufferListPtr ): OSStatus;
+
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Deprecated
+{!
+	@enum			deprecated - Audio unit errors
+	@discussion		These are the various errors that can be returned by AudioUnit... API calls
+
+	@constant		kAudioUnitErr_IllegalInstrument
+					Apple's DLS synth returns this error if information about a particular instrument patch is requested, but is not valid.
+	@constant		kAudioUnitErr_InstrumentTypeNotFound
+					Apple's DLS synth returns this error if information about a particular instrument patch is requested, but is not valid.
+	@constant		kAudioUnitErr_UnknownFileType
+					If an audio unit uses external files as a data source, this error is returned if a file is invalid (Apple's DLS synth returns this error)
+	@constant		kAudioUnitErr_FileNotSpecified
+					If an audio unit uses external files as a data source, this error is returned if a file hasn't been set on it 
+					(Apple's DLS synth returns this error)
+}
+const
+	kAudioUnitErr_IllegalInstrument = -10873;
+	kAudioUnitErr_InstrumentTypeNotFound = -10872;
+	kAudioUnitErr_UnknownFileType = -10870;
+	kAudioUnitErr_FileNotSpecified = -10869;
+
+//#if !__LP64__ && !TARGET_OS_IPHONE
+{$ifc not TARGET_CPU_64 and not TARGET_OS_IPHONE}
+// this call is deprecated and replaced by AudioUnitRemovePropertyListenerWithUserData
+// this allows apps to use the same function pointer more than once
+// you provide the same function ptr and user data as provided when you add a property listener
+function AudioUnitRemovePropertyListener( inUnit: AudioUnit; inID: AudioUnitPropertyID; inProc: AudioUnitPropertyListenerProc ): OSStatus; external name '_AudioUnitRemovePropertyListener';
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5, __IPHONE_NA, __IPHONE_NA) *)
+//#endif
+{$endc}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 730 - 307
packages/univint/src/AVLTree.pas

@@ -1,11 +1,11 @@
 {
-     File:       AVLTree.p
+     File:       CarbonCore/AVLTree.h
  
-     Contains:   Prototypes for routines which create, destroy, allow for
+     Contains:   Interfaces for AVL balanced trees.
  
-     Version:    Universal Interfaces 3.4.2
+     Version:    CarbonCore-859.2~1
  
-     Copyright:  © 1999-2002 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 1999-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -13,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -29,8 +29,8 @@
 
 unit AVLTree;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -43,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -60,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -93,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -103,443 +175,794 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,MixedMode;
+uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
 
 {$ALIGN MAC68K}
 
 
+{
+ *  AVLVisitStage
+ *  
+ *  Discussion:
+ *    The visit stage for AVLWalk() walkProcs
+ }
 type
-	AVLFlags 					= UInt32;
+	AVLVisitStage = UInt16;
 const
-	kAVLFlagUseHandleForDataStorageMask = $00000001;
+{
+   * Passed the first time AVLWalk iterates thru a given node.
+   }
+	kAVLPreOrder = 0;
 
-	{	 The visit stage for AVLWalk() walkProcs 	}
+  {
+   * Passed the AVLWalk iterates thru a given node when it is 'in
+   * order'.
+   }
+	kAVLInOrder = 1;
 
-type
-	AVLVisitStage 				= UInt16;
-const
-	kAVLPreOrder				= 0;
-	kAVLInOrder					= 1;
-	kAVLPostOrder				= 2;
+  {
+   * Passed the last time AVLWalk iterates thru a given node.
+   }
+	kAVLPostOrder = 2;
 
-	{	 The order the tree is walked or disposed of. 	}
 
+{
+ *  AVLOrder
+ *  
+ *  Discussion:
+ *    The order the tree is walked or disposed of.
+ }
 type
-	AVLOrder 					= UInt16;
+	AVLOrder = UInt16;
 const
-	kAVLLeftToRight				= 0;
-	kAVLRightToLeft				= 1;
+{
+   * Walk the tree in left-to-right order ( smaller to bigger, usually )
+   }
+	kLeftToRight = 0;
+
+  {
+   * Walk the tree in right-to-left order ( bigger to smaller, usually )
+   }
+	kRightToLeft = 1;
 
-	{	 The type of the node being passed to a callback proc. 	}
 
+{
+ *  AVLNodeType
+ *  
+ *  Discussion:
+ *    The type of the node being passed to a callback proc.
+ }
 type
-	AVLNodeType 				= UInt16;
+	AVLNodeType = UInt16;
+const
+	kAVLIsTree = 0;
+	kAVLIsLeftBranch = 1;
+	kAVLIsRightBranch = 2;
+	kAVLIsLeaf = 3;
+	kAVLNullNode = 4;
+
 const
-	kAVLIsTree					= 0;
-	kAVLIsLeftBranch			= 1;
-	kAVLIsRightBranch			= 2;
-	kAVLIsLeaf					= 3;
-	kAVLNullNode				= 4;
-
-	errItemAlreadyInTree		= -960;
-	errNotValidTree				= -961;
-	errItemNotFoundInTree		= -962;
+	errItemAlreadyInTree = -960;
+	errNotValidTree = -961;
+	errItemNotFoundInTree = -962;
 	errCanNotInsertWhileWalkProcInProgress = -963;
-	errTreeIsLocked				= -964;
-	errTreeIsCorrupt			= -965;
+	errTreeIsLocked = -964;
 
-	{   The structure of a tree.  It's opaque; don't assume it's 52 bytes in size. }
 
+{
+ *  AVLTreeStruct
+ *  
+ *  Summary:
+ *    An opaque structure for a balanced binary tree.
+ *  
+ *  Discussion:
+ *    The structure of a tree.  It's opaque; don't assume it's 36 bytes
+ *    in size.
+ }
 type
 	AVLTreeStructPtr = ^AVLTreeStruct;
 	AVLTreeStruct = record
-		signature:				OSType;
-		privateStuff:			array [0..11] of UInt32;
+		signature: OSType;
+		privateStuff:			array [0..7] of UNSIGNEDLONG;
 	end;
+type
+	AVLTreePtr = AVLTreeStructPtr;
 
-	AVLTreePtr							= ^AVLTreeStruct;
-	{
-	    Every tree must have a function which compares the data for two items and returns < 0, 0, or >0
-	    for the items - < 0 if the first item is 'before' the second item according to some criteria,
-	    == 0 if the two items are identical according to the criteria, or > 0 if the first item is
-	    'after' the second item according to the criteria.  The comparison function is also passed the
-	    node type, but most of the time this can be ignored.
-	}
-{$ifc TYPED_FUNCTION_POINTERS}
-	AVLCompareItemsProcPtr = function(tree: AVLTreePtr; i1: UnivPtr; i2: UnivPtr; nd_typ: AVLNodeType): SInt32;
-{$elsec}
-	AVLCompareItemsProcPtr = ProcPtr;
-{$endc}
-
-	{
-	    Every tree must have a itemSizeProc; this routine gets passed a pointer to the item's data and
-	    returns the size of the data.  If a tree contains records of a fixed size, this function can
-	    just return sizeof( that-struct ); otherwise it should calculate the size of the item based on
-	    the data for the item.
-	}
-{$ifc TYPED_FUNCTION_POINTERS}
-	AVLItemSizeProcPtr = function(tree: AVLTreePtr; itemPtr: UnivPtr): UInt32;
-{$elsec}
-	AVLItemSizeProcPtr = ProcPtr;
-{$endc}
+{
+ *  AVLCompareItemsProcPtr
+ *  
+ *  Summary:
+ *    A callback function which compares two data items and returns
+ *    their ordering.
+ *  
+ *  Discussion:
+ *    Every tree must have a function which compares the data for two
+ *    items and returns < 0, 0, or >0 for the items - < 0 if the first
+ *    item is 'before' the second item according to some criteria, == 0
+ *    if the two items are identical according to the criteria, or > 0
+ *    if the first item is 'after' the second item according to the
+ *    criteria.  The comparison function is also passed the node type,
+ *    but most of the time this can be ignored.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree which contains the items being compared
+ *    
+ *    i1:
+ *      A pointer to the first item
+ *    
+ *    i2:
+ *      A pointer to the second item
+ *    
+ *    nd_typ:
+ *      The type of the nodes being compared.  This is not terribly
+ *      useful most of the time.
+ *  
+ *  Result:
+ *    A value < 0 if i1 is 'before' i2, > 0 if i1 is 'after' i2, or ==
+ *    0 if i1 is equal to i2.
+ }
+type
+	AVLCompareItemsProcPtr = function( tree: AVLTreePtr; i1: {const} UnivPtr; i2: {const} UnivPtr; nd_typ: AVLNodeType ): SInt32;
 
-	{
-	    A tree may have an optional disposeItemProc, which gets called whenever an item is removed
-	    from the tree ( via AVLRemove() or when AVLDispose() deletes all of the items in the tree ).
-	    This might be useful if the nodes in the tree own 'resources'  ( like, open files ) which
-	    should be released before the item is removed.
-	}
-{$ifc TYPED_FUNCTION_POINTERS}
-	AVLDisposeItemProcPtr = procedure(tree: AVLTreePtr; dataP: UnivPtr);
-{$elsec}
-	AVLDisposeItemProcPtr = ProcPtr;
-{$endc}
+{
+ *  AVLItemSizeProcPtr
+ *  
+ *  Summary:
+ *    A callback function which returns the size of an item.
+ *  
+ *  Discussion:
+ *    Every tree must have a itemSizeProc; this routine gets passed a
+ *    pointer to the item's data and returns the size of the data.  If
+ *    a tree contains records of a fixed size, this function can just
+ *    return sizeof( that-struct ); otherwise it should calculate the
+ *    size of the item based on the data for the item.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree which contains the item whose size is being requested.
+ *    
+ *    itemPtr:
+ *      A pointer to the item whose size is being returned.
+ *  
+ *  Result:
+ *    The size of the item.
+ }
+type
+	AVLItemSizeProcPtr = function( tree: AVLTreePtr; itemPtr: {const} UnivPtr ): ByteCount;
 
-	{
-	    The common way to iterate across all of the items in a tree is via AVLWalk(), which takes
-	    a walkProcPtr.  This function will get called for every item in the tree three times, as
-	    the tree is being walked across.  First, the walkProc will get called with visitStage ==
-	    kAVLPreOrder, at which point internally the node of the tree for the given data has just
-	    been reached.  Later, this function will get called with visitStage == kAVLInOrder, and
-	    lastly this function will get called with visitStage == kAVLPostOrder.
-	    The 'minimum' item in the tree will get called with visitStage == kInOrder first, followed
-	    by the 'next' item in the tree, up until the last item in the tree structure is called.
-	    In general, you'll only care about calls to this function when visitStage == kAVLInOrder.
-	}
-{$ifc TYPED_FUNCTION_POINTERS}
-	AVLWalkProcPtr = function(tree: AVLTreePtr; dataP: UnivPtr; visitStage: AVLVisitStage; node: AVLNodeType; level: UInt32; balance: SInt32; refCon: UnivPtr): OSErr;
-{$elsec}
-	AVLWalkProcPtr = ProcPtr;
-{$endc}
+{
+ *  AVLDisposeItemProcPtr
+ *  
+ *  Summary:
+ *    Dispose of any additional memory associated with an item in the
+ *    tree.
+ *  
+ *  Discussion:
+ *    A tree may have an optional disposeItemProc, which gets called
+ *    whenever an item is removed from the tree ( via AVLRemove() or
+ *    when AVLDispose() deletes all of the items in the tree ). This
+ *    might be useful if the nodes in the tree own 'resources'  ( like,
+ *    open files ) which should be released before the item is removed.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree containing the item being disposed.
+ *    
+ *    dataP:
+ *      A pointer to the data for the item being disposed.
+ }
+type
+	AVLDisposeItemProcPtr = procedure( tree: AVLTreePtr; dataP: {const} UnivPtr );
 
-{$ifc OPAQUE_UPP_TYPES}
-	AVLCompareItemsUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	AVLCompareItemsUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	AVLItemSizeUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	AVLItemSizeUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	AVLDisposeItemUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	AVLDisposeItemUPP = UniversalProcPtr;
-{$endc}	
-{$ifc OPAQUE_UPP_TYPES}
-	AVLWalkUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	AVLWalkUPP = UniversalProcPtr;
-{$endc}	
+{
+ *  AVLWalkProcPtr
+ *  
+ *  Summary:
+ *    A callback function which gets passed each item in the tree, in a
+ *    specified order.
+ *  
+ *  Discussion:
+ *    The common way to iterate across all of the items in a tree is
+ *    via AVLWalk(), which takes a walkProcPtr.  This function will get
+ *    called for every item in the tree three times, as the tree is
+ *    being walked across.  First, the walkProc will get called with
+ *    visitStage == kAVLPreOrder, at which point internally the node of
+ *    the tree for the given data has just been reached.  Later, this
+ *    function will get called with visitStage == kAVLInOrder, and
+ *    lastly this function will get called with visitStage ==
+ *    kAVLPostOrder. The 'minimum' item in the tree will get called
+ *    with visitStage == kInOrder first, followed by the 'next' item in
+ *    the tree, up until the last item in the tree structure is called.
+ *    In general, you'll only care about calls to this function when
+ *    visitStage == kAVLInOrder.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree being walked.
+ *    
+ *    dataPtr:
+ *      A pointer to the data for an item in the tree.
+ *    
+ *    visitStage:
+ *      The stage of the walk for the given node.
+ *    
+ *    node:
+ *      The type of the given node. This is not terribly useful most of
+ *      the time.
+ *    
+ *    level:
+ *      How 'deep' in the tree the given node is.  This is not terribly
+ *      useful most of the time.
+ *    
+ *    balance:
+ *      How balanced the given node in the tree is.  This is not
+ *      terribly useful most of the time.
+ *    
+ *    refCon:
+ *      The refCon passed into AVLWalk() for this call.
+ *  
+ *  Result:
+ *    Return 0 to continue walking the tree, or 1 to terminate.
+ }
+type
+	AVLWalkProcPtr = function( tree: AVLTreePtr; dataPtr: {const} UnivPtr; visitStage: AVLVisitStage; node: AVLNodeType; level: UInt32; balance: SInt32; refCon: UnivPtr ): OSErr;
+	AVLCompareItemsUPP = AVLCompareItemsProcPtr;
+	AVLItemSizeUPP = AVLItemSizeProcPtr;
+	AVLDisposeItemUPP = AVLDisposeItemProcPtr;
+	AVLWalkUPP = AVLWalkProcPtr;
+{
+ *  NewAVLCompareItemsUPP()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
+ }
+function NewAVLCompareItemsUPP( userRoutine: AVLCompareItemsProcPtr ): AVLCompareItemsUPP; external name '_NewAVLCompareItemsUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
 
-const
-	uppAVLCompareItemsProcInfo = $00002FF0;
-	uppAVLItemSizeProcInfo = $000003F0;
-	uppAVLDisposeItemProcInfo = $000003C0;
-	uppAVLWalkProcInfo = $000FEBE0;
-	{
-	 *  NewAVLCompareItemsUPP()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   available as macro/inline
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function NewAVLCompareItemsUPP(userRoutine: AVLCompareItemsProcPtr): AVLCompareItemsUPP; external name '_NewAVLCompareItemsUPP'; { old name was NewAVLCompareItemsProc }
 {
  *  NewAVLItemSizeUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewAVLItemSizeUPP(userRoutine: AVLItemSizeProcPtr): AVLItemSizeUPP; external name '_NewAVLItemSizeUPP'; { old name was NewAVLItemSizeProc }
+function NewAVLItemSizeUPP( userRoutine: AVLItemSizeProcPtr ): AVLItemSizeUPP; external name '_NewAVLItemSizeUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  NewAVLDisposeItemUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewAVLDisposeItemUPP(userRoutine: AVLDisposeItemProcPtr): AVLDisposeItemUPP; external name '_NewAVLDisposeItemUPP'; { old name was NewAVLDisposeItemProc }
+function NewAVLDisposeItemUPP( userRoutine: AVLDisposeItemProcPtr ): AVLDisposeItemUPP; external name '_NewAVLDisposeItemUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  NewAVLWalkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewAVLWalkUPP(userRoutine: AVLWalkProcPtr): AVLWalkUPP; external name '_NewAVLWalkUPP'; { old name was NewAVLWalkProc }
+function NewAVLWalkUPP( userRoutine: AVLWalkProcPtr ): AVLWalkUPP; external name '_NewAVLWalkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  DisposeAVLCompareItemsUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeAVLCompareItemsUPP(userUPP: AVLCompareItemsUPP); external name '_DisposeAVLCompareItemsUPP';
+procedure DisposeAVLCompareItemsUPP( userUPP: AVLCompareItemsUPP ); external name '_DisposeAVLCompareItemsUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  DisposeAVLItemSizeUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeAVLItemSizeUPP(userUPP: AVLItemSizeUPP); external name '_DisposeAVLItemSizeUPP';
+procedure DisposeAVLItemSizeUPP( userUPP: AVLItemSizeUPP ); external name '_DisposeAVLItemSizeUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  DisposeAVLDisposeItemUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeAVLDisposeItemUPP(userUPP: AVLDisposeItemUPP); external name '_DisposeAVLDisposeItemUPP';
+procedure DisposeAVLDisposeItemUPP( userUPP: AVLDisposeItemUPP ); external name '_DisposeAVLDisposeItemUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  DisposeAVLWalkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure DisposeAVLWalkUPP(userUPP: AVLWalkUPP); external name '_DisposeAVLWalkUPP';
+procedure DisposeAVLWalkUPP( userUPP: AVLWalkUPP ); external name '_DisposeAVLWalkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  InvokeAVLCompareItemsUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeAVLCompareItemsUPP(tree: AVLTreePtr; i1: UnivPtr; i2: UnivPtr; nd_typ: AVLNodeType; userRoutine: AVLCompareItemsUPP): SInt32; external name '_InvokeAVLCompareItemsUPP'; { old name was CallAVLCompareItemsProc }
+function InvokeAVLCompareItemsUPP( tree: AVLTreePtr; i1: {const} UnivPtr; i2: {const} UnivPtr; nd_typ: AVLNodeType; userUPP: AVLCompareItemsUPP ): SInt32; external name '_InvokeAVLCompareItemsUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  InvokeAVLItemSizeUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeAVLItemSizeUPP(tree: AVLTreePtr; itemPtr: UnivPtr; userRoutine: AVLItemSizeUPP): UInt32; external name '_InvokeAVLItemSizeUPP'; { old name was CallAVLItemSizeProc }
+function InvokeAVLItemSizeUPP( tree: AVLTreePtr; itemPtr: {const} UnivPtr; userUPP: AVLItemSizeUPP ): ByteCount; external name '_InvokeAVLItemSizeUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  InvokeAVLDisposeItemUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-procedure InvokeAVLDisposeItemUPP(tree: AVLTreePtr; dataP: UnivPtr; userRoutine: AVLDisposeItemUPP); external name '_InvokeAVLDisposeItemUPP'; { old name was CallAVLDisposeItemProc }
+procedure InvokeAVLDisposeItemUPP( tree: AVLTreePtr; dataP: {const} UnivPtr; userUPP: AVLDisposeItemUPP ); external name '_InvokeAVLDisposeItemUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
 {
  *  InvokeAVLWalkUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function InvokeAVLWalkUPP(tree: AVLTreePtr; dataP: UnivPtr; visitStage: AVLVisitStage; node: AVLNodeType; level: UInt32; balance: SInt32; refCon: UnivPtr; userRoutine: AVLWalkUPP): OSErr; external name '_InvokeAVLWalkUPP'; { old name was CallAVLWalkProc }
-{
-    Create an AVL tree.  The compareItemsProc and the sizeItemProc are required; disposeItemProc is
-    optional and can be nil.  The refCon is stored with the list, and is passed back to the
-    compareItemsProc, sizeItemProc, and disposeItemsProc calls.  The allocation of the tree ( and all
-    nodes later added to the list with AVLInsert ) will be created in what is the current zone at the
-    time AVLInit() is called.  Always call AVLDispose() to dispose of a list created with AVLInit().
-}
+function InvokeAVLWalkUPP( tree: AVLTreePtr; dataPtr: {const} UnivPtr; visitStage: AVLVisitStage; node: AVLNodeType; level: UInt32; balance: SInt32; refCon: UnivPtr; userUPP: AVLWalkUPP ): OSErr; external name '_InvokeAVLWalkUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+{$ifc not TARGET_CPU_64}
 {
- *  AVLInit()
+ *  AVLInit()   *** DEPRECATED ***
  *  
- *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
- }
-function AVLInit(flags: UInt32; compareItemsProc: AVLCompareItemsUPP; sizeItemProc: AVLItemSizeUPP; disposeItemProc: AVLDisposeItemUPP; refCon: UnivPtr; var tree: AVLTreePtr): OSErr; external name '_AVLInit';
-{
-    Dispose of an AVL tree.  This will dispose of each item in the tree in the order specified,
-    call the tree's disposeProc proc for each item, and then dispose of the space allocated for
-    the tree itself.
-}
-{
- *  AVLDispose()
+ *  Summary:
+ *    Create an AVL ( balanced binary ) tree
+ *  
+ *  Discussion:
+ *    Create an AVL tree.  The compareItemsProc and the sizeItemProc
+ *    are required; disposeItemProc is optional and can be nil.  The
+ *    refCon is stored with the list, and is passed back to the
+ *    compareItemsProc, sizeItemProc, and disposeItemsProc calls.  The
+ *    allocation of the tree ( and all nodes later added to the list
+ *    with AVLInsert ) will be created in what is the current zone at
+ *    the time AVLInit() is called.  Always call AVLDispose() to
+ *    dispose of a list created with AVLInit().
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *  
+ *  Parameters:
+ *    
+ *    flags:
+ *      Creation flags.  Currently, no flags are defined, so pass 0.
+ *    
+ *    compareItemsProc:
+ *      A UPP for a function which compares two data items, and returns
+ *      a value which is < 0, == 0, or > 0 depending on whether the
+ *      first item is 'before', 'equal', or 'after' the first item.
+ *    
+ *    sizeItemProc:
+ *      A UPP for a function which takes a pointer to a data item, and
+ *      returns the size in bytes which it requires to store.
+ *    
+ *    disposeItemProc:
+ *      A UPP for a function which takes a pointer to a data item, and
+ *      disposes of any memory which may have been allocated for the
+ *      item.  This does not need to dispose of the item itself ( the
+ *      AVLTree Manager will do that ), only any memory which the item
+ *      passed in may be pointing to.  This function may be NULL if
+ *      data items do not use any memory besides that taken up by the
+ *      item itself.
+ *    
+ *    refCon:
+ *      A 32 bit quantity which is stored with this tree, and can be
+ *      retrieved at an time ( and in a callback, if desired ) with
+ *      AVLGetRefcon().
+ *    
+ *    tree:
+ *      The created AVLTree, or NULL if there is an error.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLDispose(var tree: AVLTreePtr; order: AVLOrder): OSErr; external name '_AVLDispose';
-{
-    Iterate across all of the items in the tree, in the order specified.  kLeftToRight is
-    basically lowest-to-highest order, kRightToLeft is highest-to-lowest order.  For each
-    node in the tree, it will call the walkProc with three messages ( at the appropriate 
-    time ).  First, with kAVLPreOrder when the walking gets to this node in the tree,
-    before handling either the left or right subtree, secondly, with kAVLInOrder after
-    handling one subtree but before handling the other, and lastly with kAVLPostOrder after
-    handling both subtrees.  If you want to handle items in order, then only do something
-    if the visit stage is kAVLInOrder.  You can only call AVLRemove() from inside a walkProc
-    if visit stage is kAVLPostOrder ( because if you remove a node during the pre or in order
-    stages you will corrupt the list ) OR if you return a non-zero result from the walkProc
-    call which called AVLRemove() to immediately terminate the walkProc.  Do not call AVLInsert()
-    to insert a node into the tree from inside a walkProc.
-    The walkProc function gets called with the AVLTreePtr, a pointer to the data for the
-    current node ( which you can change in place as long as you do not affect the order within
-    the tree ), the visit stage, the type of the current node ( leaf node, right or left branch,
-    or full tree ), the level within the tree ( the root is level 1 ), the balance for the
-    current node, and the refCon passed to AVLWalk().  This refCon is different from the one passed
-    into AVLInit(); use AVLGetRefCon() to get that refCon if you want it inside a walkProc.
-    ( Most walkProcs will not care about the values for node type, level, or balance. )
-}
+function AVLInit( flags: UInt32; compareItemsProc: AVLCompareItemsUPP; sizeItemProc: AVLItemSizeUPP; disposeItemProc: AVLDisposeItemUPP; refCon: UnivPtr; var tree: AVLTreePtr ): OSErr; external name '_AVLInit';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLWalk()
+ *  AVLDispose()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Dispose of an AVL tree created with AVLInit()
+ *  
+ *  Discussion:
+ *    Dispose of an AVL tree.  This will dispose of each item in the
+ *    tree in the order specified, call the tree's disposeProc proc for
+ *    each item, and then dispose of the space allocated for the tree
+ *    itself.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLDispose is thread safe provided no other thread is still using
+ *    the tree being dispose.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to dispose, which was created with AVLInit().
+ *    
+ *    order:
+ *      The order to dispose of the items in the tree.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLWalk(tree: AVLTreePtr; walkProc: AVLWalkUPP; order: AVLOrder; walkRefCon: UnivPtr): OSErr; external name '_AVLWalk';
-{   Return  the number of items in the given tree. }
+function AVLDispose( var tree: AVLTreePtr; order: AVLOrder ): OSErr; external name '_AVLDispose';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLCount()
+ *  AVLWalk()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Iterate across all of the items in an AVL tree, in a specified
+ *    order.
+ *  
+ *  Discussion:
+ *    Iterate across all of the items in the tree, in the order
+ *    specified.  kLeftToRight is basically lowest-to-highest order,
+ *    kRightToLeft is highest-to-lowest order.  For each node in the
+ *    tree, it will call the walkProc with three messages ( at the
+ *    appropriate time ).  First, with kAVLPreOrder when the walking
+ *    gets to this node in the tree, before handling either the left or
+ *    right subtree, secondly, with kAVLInOrder after handling one
+ *    subtree but before handling the other, and lastly with
+ *    kAVLPostOrder after handling both subtrees.  If you want to
+ *    handle items in order, then only do something if the visit stage
+ *    is kAVLInOrder.  You can only call AVLRemove() from inside a
+ *    walkProc if visit stage is kAVLPostOrder ( because if you remove
+ *    a node during the pre or in order stages you will corrupt the
+ *    list ) OR if you return a non-zero result from the walkProc call
+ *    which called AVLRemove() to immediately terminate the walkProc. 
+ *    Do not call AVLInsert() to insert a node into the tree from
+ *    inside a walkProc. The walkProc function gets called with the
+ *    AVLTreePtr, a pointer to the data for the current node ( which
+ *    you can change in place as long as you do not affect the order
+ *    within the tree ), the visit stage, the type of the current node
+ *    ( leaf node, right or left branch, or full tree ), the level
+ *    within the tree ( the root is level 1 ), the balance for the
+ *    current node, and the refCon passed to AVLWalk().  This refCon is
+ *    different from the one passed into AVLInit(); use AVLGetRefCon()
+ *    to get that refCon if you want it inside a walkProc. ( Most
+ *    walkProcs will not care about the values for node type, level, or
+ *    balance. )
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLWalk is thread safe as long as no other thread tries to modify
+ *    the tree by inserting or removing an item, or disposing of the
+ *    tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to dispose, which was created with AVLInit().
+ *    
+ *    walkProc:
+ *      A UPP for a function which is called during the walk thru the
+ *      tree for each item.
+ *    
+ *    order:
+ *      The order to iterate thru the tree.
+ *    
+ *    walkRefCon:
+ *      A 32 bit value passed to the walkProc each time it is called.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLCount(tree: AVLTreePtr; var count: UInt32): OSErr; external name '_AVLCount';
-{
-    Return the one-based index-th item from the tree by putting it's data at dataPtr
-    if dataPtr is non-nil, and it's size into *itemSize if itemSize is non-nil.
-    If index is out of range, return errItemNotFoundInTree.  ( Internally, this does
-    an AVLWalk(), so the tree can not be modified while this call is in progress ).
-}
+function AVLWalk( tree: AVLTreePtr; walkProc: AVLWalkUPP; order: AVLOrder; walkRefCon: UnivPtr ): OSErr; external name '_AVLWalk';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLGetIndItem()
+ *  AVLCount()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Return the number of items in the given tree.
+ *  
+ *  Discussion:
+ *    Return the number of items in the given tree.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLCount is thread safe as long as no other thread tries to
+ *    modify the tree by inserting or removing an item, or disposing of
+ *    the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the count of items for.
+ *    
+ *    count:
+ *      On return, the count of items ( 1-based ) in the tree.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLGetIndItem(tree: AVLTreePtr; index: UInt32; dataPtr: UnivPtr; var itemSize: UInt32): OSErr; external name '_AVLGetIndItem';
-{
-    Insert the given item into the tree.  This will call the tree's sizeItemProc
-    to determine how big the item at data is, and then will make a copy of the
-    item and insert it into the tree in the appropriate place.  If an item already
-    exists in the tree with the same key ( so that the compareItemsUPP returns 0
-    when asked to compare this item to an existing one ), then it will return
-    errItemNotFoundInTree.
-}
+function AVLCount( tree: AVLTreePtr; var count: UInt32 ): OSErr; external name '_AVLCount';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLInsert()
+ *  AVLGetIndItem()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Return the data of the index-th item from the tree.
+ *  
+ *  Discussion:
+ *    Return the one-based index-th item from the tree by putting it's
+ *    data at dataPtr if dataPtr is non-nil, and it's size into
+ *    *itemSize if itemSize is non-nil. If index is out of range,
+ *    return errItemNotFoundInTree.  ( Internally, this does an
+ *    AVLWalk(), so the tree can not be modified while this call is in
+ *    progress ).
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLGetIndItem is thread safe as long as no other thread tries to
+ *    modify the tree by inserting or removing an item, or disposing of
+ *    the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the index-th items for.
+ *    
+ *    index:
+ *      A index of the item to return.  The 'first' item in the tree is
+ *      index = 1, the last item is index = the count of items in the
+ *      tree.
+ *    
+ *    dataPtr:
+ *      An address in memory to return the data for the item, or NULL
+ *      if you don not want data returned.  The memory point to must be
+ *      large enough to hold all of the data for the item.
+ *    
+ *    itemSize:
+ *      On return, the size of the data for the index-th item.  If you
+ *      do not care about the size of the data, pass NULL.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLInsert(tree: AVLTreePtr; data: UnivPtr): OSErr; external name '_AVLInsert';
-{
-    Remove any item from the tree with the given key.  If dataPtr != nil, then
-    copy the item's data to dataPtr before removing it from the tree.  Before
-    removing the item, call the tree's disposeItemProc to let it release anything
-    used by the data in the tree.  It is not necessary to fill in a complete
-    record for key, only that the compareItemsProc return 0 when asked to compare
-    the data at key with the node in the tree to be deleted.  If the item cannot
-    be found in the tree, this will return errItemNotFoundInTree.
-}
+function AVLGetIndItem( tree: AVLTreePtr; index: UInt32; dataPtr: UnivPtr; var itemSize: ByteCount ): OSErr; external name '_AVLGetIndItem';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLRemove()
+ *  AVLInsert()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Insert an item into the tree.
+ *  
+ *  Discussion:
+ *    Insert the given item into the tree.  This will call the tree's
+ *    sizeItemProc to determine how big the item at data is, and then
+ *    will make a copy of the item and insert it into the tree in the
+ *    appropriate place.  If an item already exists in the tree with
+ *    the same key ( so that the compareItemsUPP returns 0 when asked
+ *    to compare this item to an existing one ), then it will return
+ *    errItemNotFoundInTree.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLInsert is thread safe as long as no other thread tries to walk
+ *    or modify the tree by inserting or removing an item, or disposing
+ *    of the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the index-th items for.
+ *    
+ *    data:
+ *      A pointer to the item to be inserted.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLRemove(tree: AVLTreePtr; key: UnivPtr; dataPtr: UnivPtr; var itemSize: UInt32): OSErr; external name '_AVLRemove';
-{
-    Find the item in the tree with the given key, and return it's data in
-    dataPtr ( if dataPtr != nil ), and it's size in *itemSize ( if itemSize
-    != nil ).  It is not necessary to fill in a complete record for key,
-    only that the compareItemsProc return 0 when asked to compare the data
-    at key with the node in the tree to be deleted.  If the item cannot
-    be found in the tree, this will return errItemNotFoundInTree.
-}
+function AVLInsert( tree: AVLTreePtr; data: {const} UnivPtr ): OSErr; external name '_AVLInsert';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLFind()
+ *  AVLRemove()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Remove an item from the tree.
+ *  
+ *  Discussion:
+ *    Remove any item from the tree with the given key.  If dataPtr !=
+ *    nil, then copy the item's data to dataPtr before removing it from
+ *    the tree.  Before removing the item, call the tree's
+ *    disposeItemProc to let it release anything used by the data in
+ *    the tree.  It is not necessary to fill in a complete record for
+ *    key, only that the compareItemsProc return 0 when asked to
+ *    compare the data at key with the node in the tree to be deleted. 
+ *    If the item cannot be found in the tree, this will return
+ *    errItemNotFoundInTree.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLRemove is thread safe as long as no other thread tries to walk
+ *    or modify the tree by inserting or removing an item, or disposing
+ *    of the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the index-th items for.
+ *    
+ *    key:
+ *      A pointer to the item to be removed ( or, enough of the item
+ *      that it can be found in the tree ).
+ *    
+ *    dataPtr:
+ *      An address in memory to return the data for the item, or NULL
+ *      if you don not want data returned.  The memory point to must be
+ *      large enough to hold all of the data for the item.
+ *    
+ *    itemSize:
+ *      On return, the size of the data for the index-th item.  If you
+ *      do not care about the size of the data, pass NULL.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLFind(tree: AVLTreePtr; key: UnivPtr; dataPtr: UnivPtr; var itemSize: UInt32): OSErr; external name '_AVLFind';
-{
-    Get the refCon for the given tree ( set in AVLInit ) and return it.
-    If the given tree is invalid, then return nil.
-}
+function AVLRemove( tree: AVLTreePtr; key: {const} UnivPtr; dataPtr: UnivPtr; var itemSize: ByteCount ): OSErr; external name '_AVLRemove';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLGetRefcon()
+ *  AVLFind()   *** DEPRECATED ***
+ *  
+ *  Summary:
+ *    Remove an item from the tree.
+ *  
+ *  Discussion:
+ *    Find the item in the tree with the given key, and return it's
+ *    data in dataPtr ( if dataPtr != nil ), and it's size in *itemSize
+ *    ( if itemSize != nil ).  It is not necessary to fill in a
+ *    complete record for key, only that the compareItemsProc return 0
+ *    when asked to compare the data at key with the node in the tree
+ *    to be deleted.  If the item cannot be found in the tree, this
+ *    will return errItemNotFoundInTree.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLRemove is thread safe as long as no other thread tries to walk
+ *    or modify the tree by inserting or removing an item, or disposing
+ *    of the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the index-th items for.
+ *    
+ *    key:
+ *      A pointer to the item to be found ( or, enough of the item that
+ *      it can be found in the tree ).
+ *    
+ *    dataPtr:
+ *      An address in memory to return the data for the item, or NULL
+ *      if you don not want data returned.  The memory point to must be
+ *      large enough to hold all of the data for the item.
+ *    
+ *    itemSize:
+ *      On return, the size of the data for the index-th item.  If you
+ *      do not care about the size of the data, pass NULL.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLGetRefcon(tree: AVLTreePtr; var refCon: UnivPtr): OSErr; external name '_AVLGetRefcon';
-{
-    Get the refCon for the given tree ( set in AVLInit ) and return it.
-    If the given tree is invalid, then return nil.
-}
-{$ifc CALL_NOT_IN_CARBON}
+function AVLFind( tree: AVLTreePtr; key: {const} UnivPtr; dataPtr: UnivPtr; var itemSize: ByteCount ): OSErr; external name '_AVLFind';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  AVLLockTree()
+ *  AVLGetRefcon()   *** DEPRECATED ***
  *  
- *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.2.1 and later
- *    CarbonLib:        not available
- *    Mac OS X:         not available
- }
-function AVLLockTree(tree: AVLTreePtr): OSErr; external name '_AVLLockTree';
-{
-    Get the refCon for the given tree ( set in AVLInit ) and return it.
-    If the given tree is invalid, then return nil.
-}
-{
- *  AVLUnlockTree()
+ *  Summary:
+ *    Return the refCon set when the tree was created.
  *  
- *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.2.1 and later
- *    CarbonLib:        not available
- *    Mac OS X:         not available
- }
-function AVLUnlockTree(tree: AVLTreePtr): OSErr; external name '_AVLUnlockTree';
-{
-    Get the refCon for the given tree ( set in AVLInit ) and return it.
-    If the given tree is invalid, then return nil.
-}
-{
- *  AVLCheckTree()
+ *  Discussion:
+ *    Get the refCon for the given tree ( set in AVLInit ) and return
+ *    it.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe
+ *    AVLGetRefcon is thread safe as long as no other thread tries to
+ *    dispose of the tree itself.
+ *  
+ *  Parameters:
+ *    
+ *    tree:
+ *      The tree to return the refcon for.
+ *    
+ *    refCon:
+ *      On return, the refCon for the tree, or NULL if tree is invalid.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.2.1 and later
- *    CarbonLib:        not available
- *    Mac OS X:         not available
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.0 and later
  }
-function AVLCheckTree(tree: AVLTreePtr): OSErr; external name '_AVLCheckTree';
-{$endc}  {CALL_NOT_IN_CARBON}
+function AVLGetRefcon( tree: AVLTreePtr; var refCon: UnivPtr ): OSErr; external name '_AVLGetRefcon';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
 
-{$ALIGN MAC68K}
 
+{$endc} {not TARGET_CPU_64}
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 89 - 7
packages/univint/src/AXActionConstants.pas

@@ -8,13 +8,15 @@
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 (no changes in 10.6) }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -23,8 +25,8 @@
 
 unit AXActionConstants;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -37,16 +39,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -54,14 +78,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -87,7 +162,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -98,6 +172,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
 
@@ -137,5 +216,8 @@ uses MacTypes;
 {$definec kAXPickAction CFSTRP('AXPick')}
 {$endc}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 231 - 17
packages/univint/src/AXAttributeConstants.pas

@@ -3,18 +3,20 @@
  *  HIServices
  *
  *  Created by John Louch on Wed Feb 25 2004.
- *  Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *  Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved.
  *
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -23,8 +25,8 @@
 
 unit AXAttributeConstants;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -37,16 +39,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -54,14 +78,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -87,7 +162,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -98,6 +172,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
 
@@ -135,6 +214,7 @@ uses MacTypes;
 	
 	// value attributes
 	kAXValueAttribute
+    kAXValueDescriptionAttribute
 	kAXMinValueAttribute
 	kAXMaxValueAttribute
 	kAXValueIncrementAttribute
@@ -144,6 +224,7 @@ uses MacTypes;
 	// text-specific attributes
 	kAXSelectedTextAttribute
 	kAXSelectedTextRangeAttribute
+    kAXSelectedTextRangesAttribute
 	kAXVisibleCharacterRangeAttribute
 	kAXNumberOfCharactersAttribute
 	kAXSharedTextUIElementsAttribute
@@ -387,6 +468,29 @@ uses MacTypes;
 {$endc}
 
 
+{
+    kAXValueDescriptionAttribute
+    
+    Used to supplement kAXValueAttribute.  This attribute returns a string description that best 
+    describes the current value stored in kAXValueAttribute.  This is useful for things like
+    slider where the numeric value in kAXValueAttribute does not always convey enough information
+    about the adjustment made on the slider.  As an example, a color slider that adjusts thru various  
+    colors cannot be well-described by the numeric value in existing AXValueAttribute.  This is where 
+    the kAXValueDescriptionAttribute comes in handy.  In this example, the developer can provide the  
+    color information using this attribute.       
+    
+    Value: A localized, human-readable CFStringRef.
+	
+	Writable? No.
+    
+    Recommended for elements that support kAXValueAttribute.
+
+}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXValueDescriptionAttribute CFSTRP('AXValueDescription')}
+{$endc}
+
+
 {
 	kAXMinValueAttribute
 	
@@ -465,6 +569,22 @@ uses MacTypes;
 {$endc}
 
 
+{
+	kAXPlaceholderValueAttribute
+	
+	The value of placeholder text as found in a text field.
+	
+	Value: A CFStringRef.
+	
+	Writable? No.
+	
+	Recommended for text fields and other elements that have a placeholder value.
+}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXPlaceholderValueAttribute CFSTRP('AXPlaceholderValue')}
+{$endc}
+
+
 {
 	kAXEnabledAttribute
 	
@@ -670,7 +790,7 @@ uses MacTypes;
 {
 	kAXOrientationAttribute
 	
-	An indiciation of whether an element is drawn and/or interacted with in a
+	An indication of whether an element is drawn and/or interacted with in a
 	vertical or horizontal manner. Elements such as scroll bars and sliders offer
 	the kAXOrientationAttribute.
 	
@@ -690,11 +810,11 @@ uses MacTypes;
 {
 	kAXDescriptionAttribute
 	
-	An indication of an element's purpose, in a way that is slightly more specific
-	than the kAXRoleDescriptionAttribute, but which is less wordy than the
-	kAXHelpAttribute. In English, the description should typically be a concatenation
-	of a usage adjective with the element's role description. For example, the
-	description of a slider in a font panel might be "font size slider". The string
+	A localized, human-readable string that indicates an element's purpose in a way
+	that is slightly more specific than the kAXRoleDescriptionAttribute, but which
+	is less wordy than the kAXHelpAttribute. Typically, the description should be
+	an adjective or short phrase that describes the element's usage. For example,
+	the description of a slider in a font panel might be "font size". The string
 	should be all lower-case and contain no punctuation.
 	
 	Value: A localized, human-readable CFStringRef.
@@ -745,6 +865,22 @@ uses MacTypes;
 {$definec kAXSelectedTextRangeAttribute CFSTRP('AXSelectedTextRange')}
 {$endc}
 
+{
+	kAXSelectedTextRangesAttribute
+	
+	An array of noncontiguous ranges of characters (not bytes) that defines the current selections of an
+	editable text element.  
+	
+	Value: A CFArrayRef of kAXValueCFRanges.
+	
+	Writable? Yes.
+	
+	Recommended for text elements that support noncontiguous selections.
+}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXSelectedTextRangesAttribute CFSTRP('AXSelectedTextRanges')}
+{$endc}
+
 
 {
 	kAXVisibleCharacterRangeAttribute
@@ -759,6 +895,7 @@ uses MacTypes;
 	Required for elements of role kAXTextAreaRole. Not required for any other
 	elements, including those of role kAXTextFieldRole.
 }
+
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXVisibleCharacterRangeAttribute CFSTRP('AXVisibleCharacterRange')}
 {$endc}
@@ -1342,9 +1479,6 @@ uses MacTypes;
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXSortDirectionAttribute CFSTRP('AXSortDirection')}
 {$endc}
-{$ifc USE_CFSTR_CONSTANT_MACROS}
-{$definec kAXColumnHeaderUIElementsAttribute CFSTRP('AXColumnHeaderUIElements')}
-{$endc}
 
 // row/column attributes
 {$ifc USE_CFSTR_CONSTANT_MACROS}
@@ -1408,6 +1542,64 @@ uses MacTypes;
 {$definec kAXFocusedApplicationAttribute CFSTRP('AXFocusedApplication')}
 {$endc}
 
+// grid attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRowCountAttribute CFSTRP('AXRowCount')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXColumnCountAttribute CFSTRP('AXColumnCount')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXOrderedByRowAttribute CFSTRP('AXOrderedByRow')}
+{$endc}
+
+// level indicator attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXWarningValueAttribute CFSTRP('AXWarningValue')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXCriticalValueAttribute CFSTRP('AXCriticalValue')}
+{$endc}
+
+// cell-based table attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXSelectedCellsAttribute CFSTRP('AXSelectedCells')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXVisibleCellsAttribute CFSTRP('AXVisibleCells')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRowHeaderUIElementsAttribute CFSTRP('AXRowHeaderUIElements')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXColumnHeaderUIElementsAttribute CFSTRP('AXColumnHeaderUIElements')}
+{$endc}
+
+// cell attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRowIndexRangeAttribute CFSTRP('AXRowIndexRange')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXColumnIndexRangeAttribute CFSTRP('AXColumnIndexRange')}
+{$endc}
+
+// layout area attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXHorizontalUnitsAttribute CFSTRP('AXHorizontalUnits')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXVerticalUnitsAttribute CFSTRP('AXVerticalUnits')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXHorizontalUnitDescriptionAttribute CFSTRP('AXHorizontalUnitDescription')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXVerticalUnitDescriptionAttribute CFSTRP('AXVerticalUnitDescription')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXHandlesAttribute CFSTRP('AXHandles')}
+{$endc}
+
 // obsolete/unknown attributes
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXTextAttribute CFSTRP('AXText')}
@@ -1456,5 +1648,27 @@ uses MacTypes;
 {$definec kAXStyleRangeForIndexParameterizedAttribute CFSTRP('AXStyleRangeForIndex')}
 {$endc}
 
+// cell-based table parameterized attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXCellForColumnAndRowParameterizedAttribute CFSTRP('AXCellForColumnAndRow')}
+{$endc}
+
+// layout area parameterized attributes
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXLayoutPointForScreenPointParameterizedAttribute CFSTRP('AXLayoutPointForScreenPoint')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXLayoutSizeForScreenSizeParameterizedAttribute CFSTRP('AXLayoutSizeForScreenSize')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXScreenPointForLayoutPointParameterizedAttribute CFSTRP('AXScreenPointForLayoutPoint')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXScreenSizeForLayoutSizeParameterizedAttribute CFSTRP('AXScreenSizeForLayoutSize')}
+{$endc}
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 182 - 0
packages/univint/src/AXConstants.pas

@@ -0,0 +1,182 @@
+{       Pascal Translation:  Jonas Maebe, <[email protected]>, October 2009 }
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AXConstants;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+{$endc} {not MACOSALLINCLUDE}
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  AXConstants.h
+ *
+ *  Created by John Louch on Tue Mar 26 2002.
+ *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ *
+ }
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 108 - 25
packages/univint/src/AXErrors.pas

@@ -4,16 +4,18 @@
  *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
  *
  }
-{	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Unit name changed to AXErrors to avoid conflict with AXError type }
+{	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -22,8 +24,8 @@
 
 unit AXErrors;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -36,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -53,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -86,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -97,25 +171,34 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN MAC68K}
 const
-    kAXErrorSuccess 				= 0;
-    kAXErrorFailure				= -25200;
-    kAXErrorIllegalArgument			= -25201;
-    kAXErrorInvalidUIElement			= -25202;
-    kAXErrorInvalidUIElementObserver		= -25203;
-    kAXErrorCannotComplete			= -25204;
-    kAXErrorAttributeUnsupported		= -25205;
-    kAXErrorActionUnsupported			= -25206;
-    kAXErrorNotificationUnsupported		= -25207;
-    kAXErrorNotImplemented			= -25208;
-    kAXErrorNotificationAlreadyRegistered	= -25209;
-    kAXErrorNotificationNotRegistered		= -25210;
-    kAXErrorAPIDisabled				= -25211;
-    kAXErrorNoValue				= -25212;
-    kAXErrorParameterizedAttributeUnsupported	= -25213;
-
+	kAXErrorSuccess = 0;
+	kAXErrorFailure = -25200;
+	kAXErrorIllegalArgument = -25201;
+	kAXErrorInvalidUIElement = -25202;
+	kAXErrorInvalidUIElementObserver = -25203;
+	kAXErrorCannotComplete = -25204;
+	kAXErrorAttributeUnsupported = -25205;
+	kAXErrorActionUnsupported = -25206;
+	kAXErrorNotificationUnsupported = -25207;
+	kAXErrorNotImplemented = -25208;
+	kAXErrorNotificationAlreadyRegistered = -25209;
+	kAXErrorNotificationNotRegistered = -25210;
+	kAXErrorAPIDisabled = -25211;
+	kAXErrorNoValue = -25212;
+	kAXErrorParameterizedAttributeUnsupported = -25213;
+	kAXErrorNotEnoughPrecision = -25214;
 type
-  AXError = SInt32;
+	AXError = SInt32;
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 113 - 7
packages/univint/src/AXNotificationConstants.pas

@@ -8,13 +8,15 @@
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{	 Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -23,8 +25,8 @@
 
 unit AXNotificationConstants;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -37,16 +39,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -54,14 +78,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -87,7 +162,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -98,6 +172,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
 
@@ -178,6 +257,27 @@ uses MacTypes;
 {$definec kAXRowCountChangedNotification CFSTRP('AXRowCountChanged')}
 {$endc}
 
+// outline notifications
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRowExpandedNotification CFSTRP('AXRowExpanded')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRowCollapsedNotification CFSTRP('AXRowCollapsed')}
+{$endc}
+
+// cell-based table notifications
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXSelectedCellsChangedNotification CFSTRP('AXSelectedCellsChanged')}
+{$endc}
+
+// layout area notifications
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXUnitsChangedNotification CFSTRP('AXUnitsChanged')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXSelectedChildrenMovedNotification CFSTRP('AXSelectedChildrenMoved')}
+{$endc}
+
 // other notifications
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXSelectedChildrenChangedNotification CFSTRP('AXSelectedChildrenChanged')}
@@ -200,6 +300,12 @@ uses MacTypes;
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXSelectedTextChangedNotification CFSTRP('AXSelectedTextChanged')}
 {$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXTitleChangedNotification CFSTRP('AXTitleChangedNotification')}
+{$endc}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 124 - 7
packages/univint/src/AXRoleConstants.pas

@@ -8,13 +8,15 @@
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -23,8 +25,8 @@
 
 unit AXRoleConstants;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -37,16 +39,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -54,14 +78,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -87,7 +162,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -98,6 +172,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
 
@@ -392,6 +471,29 @@ uses MacTypes;
 {$definec kAXRulerMarkerRole CFSTRP('AXRulerMarker')}
 {$endc}
 
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXGridRole CFSTRP('AXGrid')}
+{$endc}
+
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXLevelIndicatorRole CFSTRP('AXLevelIndicator')}
+{$endc}
+
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXCellRole CFSTRP('AXCell')}
+{$endc}
+
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXLayoutAreaRole CFSTRP('AXLayoutArea')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXLayoutItemRole CFSTRP('AXLayoutItem')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXHandleRole CFSTRP('AXHandle')}
+{$endc}
+
+
 {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
 { Subroles                                                                                }
 {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
@@ -456,6 +558,18 @@ uses MacTypes;
 {$ifc USE_CFSTR_CONSTANT_MACROS}
 {$definec kAXSearchFieldSubrole CFSTRP('AXSearchField')}
 {$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXTimelineSubrole CFSTRP('AXTimeline')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXRatingIndicatorSubrole CFSTRP('AXRatingIndicator')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXContentListSubrole CFSTRP('AXContentList')}
+{$endc}
+{$ifc USE_CFSTR_CONSTANT_MACROS}
+{$definec kAXDefinitionListSubrole CFSTRP('AXDefinitionList')}
+{$endc}
 
 // dock subroles
 {$ifc USE_CFSTR_CONSTANT_MACROS}
@@ -483,5 +597,8 @@ uses MacTypes;
 {$definec kAXProcessSwitcherListSubrole CFSTRP('AXProcessSwitcherList')}
 {$endc}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 129 - 27
packages/univint/src/AXTextAttributedString.pas

@@ -6,13 +6,15 @@
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -21,8 +23,8 @@
 
 unit AXTextAttributedString;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -35,16 +37,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -52,14 +76,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -85,7 +160,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -96,31 +170,54 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFBase;
-{$ALIGN POWER}
+{$endc} {not MACOSALLINCLUDE}
 
-var kAXFontTextAttribute: CFStringRef; external name '_kAXFontTextAttribute'; (* attribute const *)		// CFDictionaryRef - see kAXFontTextAttribute keys below
-var kAXForegroundColorTextAttribute: CFStringRef; external name '_kAXForegroundColorTextAttribute'; (* attribute const *)	// CGColorRef
-var kAXBackgroundColorTextAttribute: CFStringRef; external name '_kAXBackgroundColorTextAttribute'; (* attribute const *)	// CGColorRef
-var kAXUnderlineColorTextAttribute: CFStringRef; external name '_kAXUnderlineColorTextAttribute'; (* attribute const *)	// CGColorRef
-var kAXStrikethroughColorTextAttribute: CFStringRef; external name '_kAXStrikethroughColorTextAttribute'; (* attribute const *)	// CGColorRef
-var kAXUnderlineTextAttribute: CFStringRef; external name '_kAXUnderlineTextAttribute'; (* attribute const *)		// CFNumberRef - AXUnderlineStyle
-var kAXSuperscriptTextAttribute: CFStringRef; external name '_kAXSuperscriptTextAttribute'; (* attribute const *)		// CFNumberRef = + number for superscript - for subscript
-var kAXStrikethroughTextAttribute: CFStringRef; external name '_kAXStrikethroughTextAttribute'; (* attribute const *)	// CFBooleanRef
-var kAXShadowTextAttribute: CFStringRef; external name '_kAXShadowTextAttribute'; (* attribute const *)		// CFBooleanRef
 
-var kAXAttachmentTextAttribute: CFStringRef; external name '_kAXAttachmentTextAttribute'; (* attribute const *)		// AXUIElementRef
-var kAXLinkTextAttribute: CFStringRef; external name '_kAXLinkTextAttribute'; (* attribute const *)		// AXUIElementRef
+{$ifc TARGET_OS_MAC}
 
-var kAXNaturalLanguageTextAttribute: CFStringRef; external name '_kAXNaturalLanguageTextAttribute'; (* attribute const *)	// CFStringRef - the spoken language of the text
-var kAXReplacementStringTextAttribute: CFStringRef; external name '_kAXReplacementStringTextAttribute'; (* attribute const *)	// CFStringRef
+{$ALIGN POWER}
 
-var kAXMisspelledTextAttribute: CFStringRef; external name '_kAXMisspelledTextAttribute'; (* attribute const *)		// AXUIElementRef
+var kAXFontTextAttribute: CFStringRef; external name '_kAXFontTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFDictionaryRef - see kAXFontTextAttribute keys below
+var kAXForegroundColorTextAttribute: CFStringRef; external name '_kAXForegroundColorTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CGColorRef
+var kAXBackgroundColorTextAttribute: CFStringRef; external name '_kAXBackgroundColorTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CGColorRef
+var kAXUnderlineColorTextAttribute: CFStringRef; external name '_kAXUnderlineColorTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CGColorRef
+var kAXStrikethroughColorTextAttribute: CFStringRef; external name '_kAXStrikethroughColorTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CGColorRef
+var kAXUnderlineTextAttribute: CFStringRef; external name '_kAXUnderlineTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFNumberRef - AXUnderlineStyle
+var kAXSuperscriptTextAttribute: CFStringRef; external name '_kAXSuperscriptTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFNumberRef = + number for superscript - for subscript
+var kAXStrikethroughTextAttribute: CFStringRef; external name '_kAXStrikethroughTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFBooleanRef
+var kAXShadowTextAttribute: CFStringRef; external name '_kAXShadowTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFBooleanRef
+
+var kAXAttachmentTextAttribute: CFStringRef; external name '_kAXAttachmentTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// AXUIElementRef
+var kAXLinkTextAttribute: CFStringRef; external name '_kAXLinkTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// AXUIElementRef
+
+var kAXNaturalLanguageTextAttribute: CFStringRef; external name '_kAXNaturalLanguageTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFStringRef - the spoken language of the text
+var kAXReplacementStringTextAttribute: CFStringRef; external name '_kAXReplacementStringTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFStringRef
+
+var kAXMisspelledTextAttribute: CFStringRef; external name '_kAXMisspelledTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// AXUIElementRef
 
 // kAXFontTextAttribute keys
-var kAXFontNameKey: CFStringRef; external name '_kAXFontNameKey'; (* attribute const *)		// CFStringRef - required
-var kAXFontFamilyKey: CFStringRef; external name '_kAXFontFamilyKey'; (* attribute const *)		// CFStringRef - not required
-var kAXVisibleNameKey: CFStringRef; external name '_kAXVisibleNameKey'; (* attribute const *)		// CFStringRef - not required
-var kAXFontSizeKey: CFStringRef; external name '_kAXFontSizeKey'; (* attribute const *)		// CFNumberRef - required
+var kAXFontNameKey: CFStringRef; external name '_kAXFontNameKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFStringRef - required
+var kAXFontFamilyKey: CFStringRef; external name '_kAXFontFamilyKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFStringRef - not required
+var kAXVisibleNameKey: CFStringRef; external name '_kAXVisibleNameKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFStringRef - not required
+var kAXFontSizeKey: CFStringRef; external name '_kAXFontSizeKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CFNumberRef - required
 
 const
 	kAXUnderlineStyleNone = $0;
@@ -132,6 +229,11 @@ type
 
 
 // DO NOT USE. This is an old, misspelled version of one of the above constants.
-var kAXForegoundColorTextAttribute: CFStringRef; external name '_kAXForegoundColorTextAttribute'; (* attribute const *)	// CGColorRef
+var kAXForegoundColorTextAttribute: CFStringRef; external name '_kAXForegoundColorTextAttribute'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)	// CGColorRef
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 94 - 11
packages/univint/src/AXUIElement.pas

@@ -5,14 +5,16 @@
  *
  }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2006 }
+{   Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2006 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -21,8 +23,8 @@
 
 unit AXUIElement;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -35,16 +37,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -52,14 +76,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -85,7 +160,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -96,6 +170,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFArray,AXErrors,CFRunLoop,CGRemoteOperation,MacOSXPosix;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN MAC68K}
 
 function AXAPIEnabled: Boolean; external name '_AXAPIEnabled';
@@ -106,7 +185,7 @@ function AXMakeProcessTrusted( executablePath: CFStringRef ): AXError; external
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
 type
-	AXUIElementRef    = ^SInt32; { an opaque 32-bit type }
+	AXUIElementRef = ^SInt32; { an opaque type }
 
 const
 	kAXCopyMultipleAttributeOptionStopOnError = $1;
@@ -155,10 +234,10 @@ function AXUIElementPostKeyboardEvent( application: AXUIElementRef; keyChar: CGC
 
 // Notification APIs
 type
-	AXObserverRef    = ^SInt32; { an opaque 32-bit type }
+	AXObserverRef = ^SInt32; { an opaque type }
 
 type
-    AXObserverCallback = procedure( observer: AXObserverRef; element: AXUIElementRef; notification: CFStringRef; refcon: UnivPtr );
+	AXObserverCallback = procedure( observer: AXObserverRef; element: AXUIElementRef; notification: CFStringRef; refcon: UnivPtr );
 
 function AXObserverGetTypeID: CFTypeID; external name '_AXObserverGetTypeID';
 
@@ -169,4 +248,8 @@ function AXObserverRemoveNotification( observer: AXObserverRef; element: AXUIEle
 
 function AXObserverGetRunLoopSource( observer: AXObserverRef ): CFRunLoopSourceRef; external name '_AXObserverGetRunLoopSource';
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 96 - 12
packages/univint/src/AXValue.pas

@@ -6,14 +6,16 @@
  *
  }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2006 }
+{   Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2006 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -22,8 +24,8 @@
 
 unit AXValue;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -36,16 +38,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -53,14 +77,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -86,7 +161,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -97,6 +171,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN MAC68K}
 type AXValueType = UInt32;
 const
@@ -114,15 +193,20 @@ const
     { Other }
     kAXValueIllegalType = 0;
 
-type AXValueRef = ^UInt32;
+type
+	AXValueRef = ^SInt32; { an opaque type }
 
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function AXValueGetTypeID: CFTypeID; external name '_AXValueGetTypeID';
+(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
 
-function AXValueCreate( theType: AXValueType;  valuePtr: UnivPtr ): AXValueRef; external name '_AXValueCreate';
+function AXValueCreate( theType: AXValueType; valuePtr: {const} UnivPtr ): AXValueRef; external name '_AXValueCreate';
 function AXValueGetType( value: AXValueRef ): AXValueType; external name '_AXValueGetType';
 
-function AXValueGetValue( value: AXValueRef; theType: AXValueType;  valuePtr: UnivPtr ): Boolean; external name '_AXValueGetValue';
+function AXValueGetValue( value: AXValueRef; theType: AXValueType; valuePtr: UnivPtr ): Boolean; external name '_AXValueGetValue';
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 89 - 7
packages/univint/src/AXValueConstants.pas

@@ -8,13 +8,15 @@
  }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2006 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 (no changes in 10.6) }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -23,8 +25,8 @@
 
 unit AXValueConstants;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -37,16 +39,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -54,14 +78,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -87,7 +162,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -98,6 +172,11 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {$ALIGN POWER}
 
 
@@ -123,5 +202,8 @@ uses MacTypes;
 {$definec kAXUnknownSortDirectionValue CFSTRP('AXUnknownSortDirection')}
 {$endc}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 178 - 0
packages/univint/src/Accessibility.pas

@@ -0,0 +1,178 @@
+ {
+ *  Accessibility.h
+ *
+ *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ *
+ }
+{       Pascal Translation:  Jonas Maebe, <[email protected]>, October 2009 }
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit Accessibility;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,AXErrors,AXConstants,AXUIElement,AXValue,AXTextAttributedString;
+{$endc} {not MACOSALLINCLUDE}
+
+
+
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 947 - 216
packages/univint/src/Aliases.pas

@@ -1,12 +1,11 @@
 {
-     File:       Aliases.p
+     File:       CarbonCore/Aliases.h
  
      Contains:   Alias Manager Interfaces.
  
-     Version:    Technology: Mac OS 8.1
-                 Release:    Universal Interfaces 3.4.2
+     Version:    CarbonCore-859.2~1
  
-     Copyright:  © 1989-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1989-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit Aliases;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,344 +175,1004 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,Files;
+uses MacTypes,Files,UTCUtils,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
 
 {$ALIGN MAC68K}
 
 
+type
+	FSAliasInfoBitmap = UInt32;
+	FSAliasInfoBitmapPtr = ^FSAliasInfoBitmap;
+const
+	kFSAliasInfoNone = $00000000; { no valid info}
+	kFSAliasInfoVolumeCreateDate = $00000001; { volume creation date is valid}
+	kFSAliasInfoTargetCreateDate = $00000002; { target creation date is valid}
+	kFSAliasInfoFinderInfo = $00000004; { file type and creator are valid}
+	kFSAliasInfoIsDirectory = $00000008; { isDirectory boolean is valid}
+	kFSAliasInfoIDs = $00000010; { parentDirID and nodeID are valid}
+	kFSAliasInfoFSInfo = $00000020; { filesystemID and signature are valid}
+	kFSAliasInfoVolumeFlags = $00000040; { volumeIsBootVolume, volumeIsAutomounted, volumeIsEjectable and volumeHasPersistentFileIDs are valid}
+
+const
+	rAliasType = FourCharCode('alis'); { Aliases are stored as resources of this type }
+
+const
+{ define alias resolution action rules mask }
+	kARMMountVol = $00000001; { mount the volume automatically }
+	kARMNoUI = $00000002; { no user interface allowed during resolution }
+	kARMMultVols = $00000008; { search on multiple volumes }
+	kARMSearch = $00000100; { search quickly }
+	kARMSearchMore = $00000200; { search further }
+	kARMSearchRelFirst = $00000400; { search target on a relative path first }
+	kARMTryFileIDFirst = $00000800; { search by file id before path }
+
+const
+{ define alias record information types }
+	asiZoneName = -3;   { get zone name }
+	asiServerName = -2;   { get server name }
+	asiVolumeName = -1;   { get volume name }
+	asiAliasName = 0;    { get aliased file/folder/volume name }
+	asiParentName = 1;     { get parent folder name }
+
+{ ResolveAliasFileWithMountFlags options }
 const
-	rAliasType					= FourCharCode('alis');						{  Aliases are stored as resources of this type  }
-
-																{  define alias resolution action rules mask  }
-	kARMMountVol				= $00000001;					{  mount the volume automatically  }
-	kARMNoUI					= $00000002;					{  no user interface allowed during resolution  }
-	kARMMultVols				= $00000008;					{  search on multiple volumes  }
-	kARMSearch					= $00000100;					{  search quickly  }
-	kARMSearchMore				= $00000200;					{  search further  }
-	kARMSearchRelFirst			= $00000400;					{  search target on a relative path first  }
-
-																{  define alias record information types  }
-	asiZoneName					= -3;							{  get zone name  }
-	asiServerName				= -2;							{  get server name  }
-	asiVolumeName				= -1;							{  get volume name  }
-	asiAliasName				= 0;							{  get aliased file/folder/volume name  }
-	asiParentName				= 1;							{  get parent folder name  }
-
-	{	 ResolveAliasFileWithMountFlags options 	}
-	kResolveAliasFileNoUI		= $00000001;					{  no user interaction during resolution  }
+	kResolveAliasFileNoUI = $00000001; { no user interaction during resolution }
+	kResolveAliasTryFileIDFirst = $00000002; { search by file id before path }
 
 	{	 define the alias record that will be the blackbox for the caller 	}
 
 type
 	AliasRecordPtr = ^AliasRecord;
+  { Opaque as of Mac OS X 10.4 ... }
 	AliasRecord = record
-		userType:				OSType;									{  appl stored type like creator type  }
-		aliasSize:				UInt16;									{  alias record size in bytes, for appl usage  }
+		userType: OSType;               { appl stored type like creator type }
+		aliasSize: UInt16;              { alias record size in bytes, for appl usage }
 	end;
 
-	AliasPtr							= ^AliasRecord;
-	AliasHandle							= ^AliasPtr;
-	{	 alias record information type 	}
-	AliasInfoType						= SInt16;
-	{
-	 *  NewAlias()
-	 *  
-	 *  Summary:
-	 *    create a new alias between fromFile and target, returns alias
-	 *    record handle
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function NewAlias(fromFile: {Const}FSSpecPtr; const (*var*) target: FSSpec; var alias: AliasHandle): OSErr; external name '_NewAlias';
-{
- *  NewAliasMinimal()
+type
+	AliasPtr = AliasRecordPtr;
+	AliasHandle = ^AliasPtr;
+{ info block to pass to FSCopyAliasInfo }
+type
+	FSAliasInfo = record
+		volumeCreateDate: UTCDateTime;
+		targetCreateDate: UTCDateTime;
+		fileType: OSType;
+		fileCreator: OSType;
+		parentDirID: UInt32;
+		nodeID: UInt32;
+		filesystemID: UInt16;
+		signature: UInt16;
+		volumeIsBootVolume: Boolean;
+		volumeIsAutomounted: Boolean;
+		volumeIsEjectable: Boolean;
+		volumeHasPersistentFileIDs: Boolean;
+		isDirectory: Boolean;
+	end;
+	FSAliasInfoPtr = ^FSAliasInfo;
+{ alias record information type }
+type
+	AliasInfoType = SInt16;
+{$ifc not TARGET_CPU_64}
+type
+	AliasFilterProcPtr = function( cpbPtr: CInfoPBPtr; var quitFlag: Boolean; myDataPtr: Ptr ): Boolean;
+	AliasFilterUPP = AliasFilterProcPtr;
+{
+ *  NewAliasFilterUPP()
  *  
- *  Summary:
- *    create a minimal new alias for a target and return alias record
- *    handle
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
+ }
+{ old name was NewAliasFilterProc }
+function NewAliasFilterUPP( userRoutine: AliasFilterProcPtr ): AliasFilterUPP; external name '_NewAliasFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+{
+ *  DisposeAliasFilterUPP()
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
  }
-function NewAliasMinimal(const (*var*) target: FSSpec; var alias: AliasHandle): OSErr; external name '_NewAliasMinimal';
+procedure DisposeAliasFilterUPP( userUPP: AliasFilterUPP ); external name '_DisposeAliasFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 {
- *  NewAliasMinimalFromFullPath()
+ *  InvokeAliasFilterUPP()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   available as macro/inline
+ }
+function InvokeAliasFilterUPP( cpbPtr: CInfoPBPtr; var quitFlag: Boolean; myDataPtr: Ptr; userUPP: AliasFilterUPP ): Boolean; external name '_InvokeAliasFilterUPP';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+{#if __MACH__
+    #define NewAliasFilterUPP(userRoutine)                      ((AliasFilterUPP)userRoutine)
+    #define DisposeAliasFilterUPP(userUPP)
+    #define InvokeAliasFilterUPP(cpbPtr, quitFlag, myDataPtr, userUPP) (*userUPP)(cpbPtr, quitFlag, myDataPtr)
+#endif}
+
+{$endc} {not TARGET_CPU_64}
+
+type
+	FSAliasFilterProcPtr = function( const (*var*) ref: FSRef; var quitFlag: Boolean; myDataPtr: Ptr ): Boolean;
+	FSAliasFilterUPP = FSAliasFilterProcPtr;
+
+{
+ *  FSNewAlias()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSNewAlias( {const} fromFile: FSRefPtr { can be NULL }; const (*var*) target: FSRef; var inAlias: AliasHandle ): OSErr; external name '_FSNewAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSNewAliasMinimal()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSNewAliasMinimal( const (*var*) target: FSRef; var inAlias: AliasHandle ): OSErr; external name '_FSNewAliasMinimal';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSIsAliasFile()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSIsAliasFile( const (*var*) fileRef: FSRef; var aliasFileFlag: Boolean; var folderFlag: Boolean ): OSErr; external name '_FSIsAliasFile';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSResolveAliasWithMountFlags()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSResolveAliasWithMountFlags( {const} fromFile: FSRefPtr { can be NULL }; inAlias: AliasHandle; var target: FSRef; var wasChanged: Boolean; mountFlags: UNSIGNEDLONG ): OSErr; external name '_FSResolveAliasWithMountFlags';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSResolveAlias()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSResolveAlias( {const} fromFile: FSRefPtr { can be NULL }; alias: AliasHandle; var target: FSRef; var wasChanged: Boolean ): OSErr; external name '_FSResolveAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSResolveAliasFileWithMountFlags()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSResolveAliasFileWithMountFlags( var theRef: FSRef; resolveAliasChains: Boolean; var targetIsFolder: Boolean; var wasAliased: Boolean; mountFlags: UNSIGNEDLONG ): OSErr; external name '_FSResolveAliasFileWithMountFlags';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSResolveAliasFile()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSResolveAliasFile( var theRef: FSRef; resolveAliasChains: Boolean; var targetIsFolder: Boolean; var wasAliased: Boolean ): OSErr; external name '_FSResolveAliasFile';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSFollowFinderAlias()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSFollowFinderAlias( fromFile: FSRefPtr { can be NULL }; alias: AliasHandle; logon: Boolean; var target: FSRef; var wasChanged: Boolean ): OSErr; external name '_FSFollowFinderAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSUpdateAlias()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
+ }
+function FSUpdateAlias( {const} fromFile: FSRefPtr { can be NULL }; const (*var*) target: FSRef; alias: AliasHandle; var wasChanged: Boolean ): OSErr; external name '_FSUpdateAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  FSNewAliasUnicode()
  *  
  *  Summary:
- *    create a minimal new alias from a target fullpath (optional zone
- *    and server name) and return alias record handle
+ *    Creates an alias given a ref to the target's parent directory and
+ *    the target's unicode name.  If the target does not exist fnfErr
+ *    will be returned but the alias will still be created.  This
+ *    allows the creation of aliases to targets that do not exist.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Parameters:
+ *    
+ *    fromFile:
+ *      The starting point for a relative search.
+ *    
+ *    targetParentRef:
+ *      An FSRef to the parent directory of the target.
+ *    
+ *    targetNameLength:
+ *      Number of Unicode characters in the target's name.
+ *    
+ *    targetName:
+ *      A pointer to the Unicode name.
+ *    
+ *    inAlias:
+ *      A Handle to the newly created alias record.
+ *    
+ *    isDirectory:
+ *      On input, if target does not exist, a flag to indicate whether
+ *      or not the target is a directory.  On output, if the target did
+ *      exist, a flag indicating if the target is a directory.  Pass
+ *      NULL in the non-existant case if unsure.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
+ *    Non-Carbon CFM:   not available
  }
-function NewAliasMinimalFromFullPath(fullPathLength: SInt16; fullPath: UnivPtr; const (*var*) zoneName: Str32; const (*var*) serverName: Str31; var alias: AliasHandle): OSErr; external name '_NewAliasMinimalFromFullPath';
+function FSNewAliasUnicode( {const} fromFile: FSRefPtr { can be NULL }; const (*var*) targetParentRef: FSRef; targetNameLength: UniCharCount; targetName: ConstUniCharPtr; var inAlias: AliasHandle; isDirectory: BooleanPtr { can be NULL } ): OSErr; external name '_FSNewAliasUnicode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
- *  ResolveAlias()
+ *  FSNewAliasMinimalUnicode()
  *  
  *  Summary:
- *    given an alias handle and fromFile, resolve the alias, update the
- *    alias record and return aliased filename and wasChanged flag.
+ *    Creates a minimal alias given a ref to the target's parent
+ *    directory and the target's unicode name.  If the target does not
+ *    exist fnfErr will be returned but the alias will still be created.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Parameters:
+ *    
+ *    targetParentRef:
+ *      An FSRef to the parent directory of the target.
+ *    
+ *    targetNameLength:
+ *      Number of Unicode characters in the target's name.
+ *    
+ *    targetName:
+ *      A pointer to the Unicode name.
+ *    
+ *    inAlias:
+ *      A Handle to the newly created alias record.
+ *    
+ *    isDirectory:
+ *      On input, if target does not exist, a flag to indicate whether
+ *      or not the target is a directory.  On output, if the target did
+ *      exist, a flag indicating if the target is a directory.  Pass
+ *      NULL in the non-existant case if unsure.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
+ *    Non-Carbon CFM:   not available
  }
-function ResolveAlias(fromFile: {Const}FSSpecPtr; alias: AliasHandle; var target: FSSpec; var wasChanged: boolean): OSErr; external name '_ResolveAlias';
+function FSNewAliasMinimalUnicode( const (*var*) targetParentRef: FSRef; targetNameLength: UniCharCount; targetName: ConstUniCharPtr; var inAlias: AliasHandle; isDirectory: BooleanPtr { can be NULL } ): OSErr; external name '_FSNewAliasMinimalUnicode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
- *  GetAliasInfo()
+ *  FSNewAliasFromPath()
  *  
  *  Summary:
- *    given an alias handle and an index specifying requested alias
- *    information type, return the information from alias record as a
- *    string.
+ *    Creates an alias given a POSIX style utf-8 path to the target. 
+ *    If the target file does not exist but the path up to the leaf
+ *    does then fnfErr will be returned but the alias will still be
+ *    created.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.5
+ *  
+ *  Parameters:
+ *    
+ *    fromFilePath:
+ *      The starting point for a relative search.
+ *    
+ *    targetPath:
+ *      POSIX style UTF-8 path to target.
+ *    
+ *    flags:
+ *      Options for future use.  Pass in 0.
+ *    
+ *    inAlias:
+ *      A Handle to the newly created alias record.
+ *    
+ *    isDirectory:
+ *      On input, if target does not exist, a flag to indicate whether
+ *      or not the target is a directory.  On output, if the target did
+ *      exist, a flag indicating if the target is a directory.  Pass
+ *      NULL in the non-existant case if unsure.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.5 and later
+ *    Non-Carbon CFM:   not available
  }
-function GetAliasInfo(alias: AliasHandle; index: AliasInfoType; var theString: Str63): OSErr; external name '_GetAliasInfo';
+function FSNewAliasFromPath( fromFilePath: ConstCStringPtr { can be NULL }; targetPath: ConstCStringPtr; flags: OptionBits; var inAlias: AliasHandle; isDirectory: BooleanPtr { can be NULL } ): OSStatus; external name '_FSNewAliasFromPath';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
 {
- *  IsAliasFile()
+ *  FSMatchAliasBulk()
+ *  
+ *  Summary:
+ *    Given an alias handle and fromFile, match the alias and return
+ *    FSRefs to the aliased file(s) and needsUpdate flag
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.5
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
  }
-function IsAliasFile(const (*var*) fileFSSpec: FSSpec; var aliasFileFlag: boolean; var folderFlag: boolean): OSErr; external name '_IsAliasFile';
+function FSMatchAliasBulk( {const} fromFile: FSRefPtr { can be NULL }; rulesMask: UNSIGNEDLONG; inAlias: AliasHandle; var aliasCount: SInt16; var aliasList: FSRef; var needsUpdate: Boolean; aliasFilter: FSAliasFilterProcPtr { can be NULL }; yourDataPtr: UnivPtr { can be NULL } ): OSStatus; external name '_FSMatchAliasBulk';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
 {
- *  ResolveAliasWithMountFlags()
+ *  FSCopyAliasInfo()
+ *  
+ *  Discussion:
+ *    This routine will return the requested information from the
+ *    passed in aliasHandle.  The information is gathered only from the
+ *    alias record so it may not match what is on disk (no disk i/o is
+ *    performed).  The whichInfo paramter is an output parameter that
+ *    signifies which fields in the info record contain valid data.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Parameters:
+ *    
+ *    inAlias:
+ *      A handle to the alias record to get the information from.
+ *    
+ *    targetName:
+ *      The name of the target item.
+ *    
+ *    volumeName:
+ *      The name of the volume the target resides on.
+ *    
+ *    pathString:
+ *      POSIX path to target.
+ *    
+ *    whichInfo:
+ *      An indication of which fields in the info block contain valid
+ *      data.
+ *    
+ *    info:
+ *      Returned information about the alias.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
+ *    Non-Carbon CFM:   not available
  }
-function ResolveAliasWithMountFlags(fromFile: {Const}FSSpecPtr; alias: AliasHandle; var target: FSSpec; var wasChanged: boolean; mountFlags: UInt32): OSErr; external name '_ResolveAliasWithMountFlags';
+function FSCopyAliasInfo( inAlias: AliasHandle; targetName: HFSUniStr255Ptr { can be NULL }; volumeName: HFSUniStr255Ptr { can be NULL }; pathString: CFStringRefPtr { can be NULL }; whichInfo: FSAliasInfoBitmapPtr { can be NULL }; info: FSAliasInfoPtr { can be NULL } ): OSStatus; external name '_FSCopyAliasInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+
+
 {
- *  ResolveAliasFile()
+ *  GetAliasSize()
  *  
- *  Summary:
- *    Given a file spec, return target file spec if input file spec is
- *    an alias. It resolves the entire alias chain or one step of the
- *    chain.  It returns info about whether the target is a folder or
- *    file; and whether the input file spec was an alias or not.
+ *  Discussion:
+ *    This routine will return the size of the alias record referenced
+ *    by the AliasHandle alias.  This will be smaller than the size
+ *    returned by GetHandleSize if any custom data has been added (IM
+ *    Files 4-13).
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A handle to the alias record to get the information from.
+ *  
+ *  Result:
+ *    The size of the private section of the alias record.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
+ *    Non-Carbon CFM:   not available
  }
-function ResolveAliasFile(var theSpec: FSSpec; resolveAliasChains: boolean; var targetIsFolder: boolean; var wasAliased: boolean): OSErr; external name '_ResolveAliasFile';
+function GetAliasSize( alias: AliasHandle ): Size; external name '_GetAliasSize';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
 {
- *  ResolveAliasFileWithMountFlags()
+ *  GetAliasUserType()
+ *  
+ *  Discussion:
+ *    This routine will return the usertype associated with the alias
+ *    record referenced by the AliasHandle alias.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A handle to the alias record to get the userType from.
+ *  
+ *  Result:
+ *    The userType associated with the alias as an OSType
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
+ *    Non-Carbon CFM:   not available
  }
-function ResolveAliasFileWithMountFlags(var theSpec: FSSpec; resolveAliasChains: boolean; var targetIsFolder: boolean; var wasAliased: boolean; mountFlags: UInt32): OSErr; external name '_ResolveAliasFileWithMountFlags';
+function GetAliasUserType( alias: AliasHandle ): OSType; external name '_GetAliasUserType';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
 {
- *  FollowFinderAlias()
+ *  SetAliasUserType()
+ *  
+ *  Discussion:
+ *    This routine will set the userType associated with an alias
+ *    record.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A handle to the alias record to set the userType for.
+ *    
+ *    userType:
+ *      The OSType to set the userType to.
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
+ *    Non-Carbon CFM:   not available
  }
-function FollowFinderAlias(fromFile: {Const}FSSpecPtr; alias: AliasHandle; logon: boolean; var target: FSSpec; var wasChanged: boolean): OSErr; external name '_FollowFinderAlias';
-{ 
-   Low Level Routines 
-}
+procedure SetAliasUserType( alias: AliasHandle; userType: OSType ); external name '_SetAliasUserType';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  GetAliasSizeFromPtr()
+ *  
+ *  Discussion:
+ *    This routine will return the size of the alias record referenced
+ *    by a pointer to the AliasRecord.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A pointer to the alias record to get the information from.
+ *  
+ *  Result:
+ *    The size of the private section of the alias record.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function GetAliasSizeFromPtr( const (*var*) alias: AliasRecord ): Size; external name '_GetAliasSizeFromPtr';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  GetAliasUserTypeFromPtr()
+ *  
+ *  Discussion:
+ *    This routine will return the usertype associated withthe alias
+ *    record pointed to by alias.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A pointer to the alias record to get the userType from.
+ *  
+ *  Result:
+ *    The userType associated with the alias as an OSType
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function GetAliasUserTypeFromPtr( const (*var*) alias: AliasRecord ): OSType; external name '_GetAliasUserTypeFromPtr';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{
+ *  SetAliasUserTypeWithPtr()
+ *  
+ *  Discussion:
+ *    This routine will set the userType associated with an alias
+ *    record.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.4
+ *  
+ *  Parameters:
+ *    
+ *    alias:
+ *      A pointer to the alias record to set the userType for.
+ *    
+ *    userType:
+ *      The OSType to set the userType to.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.4 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+procedure SetAliasUserTypeWithPtr( alias: AliasPtr; userType: OSType ); external name '_SetAliasUserTypeWithPtr';
+(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+
+
+{ Functions beyond this point are deprecated}
+
+{$ifc not TARGET_CPU_64}
 {
- *  UpdateAlias()
+ *  FSMatchAlias()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSMatchAliasBulk instead
  *  
  *  Summary:
- *    given a fromFile-target pair and an alias handle, update the
- *    alias record pointed to by alias handle to represent target as
- *    the new alias.
+ *    Given an alias handle and fromFile, match the alias and return
+ *    FSRefs to the aliased file(s) and needsUpdate flag
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
+ *    Non-Carbon CFM:   not available
  }
-function UpdateAlias(fromFile: {Const}FSSpecPtr; const (*var*) target: FSSpec; alias: AliasHandle; var wasChanged: boolean): OSErr; external name '_UpdateAlias';
-type
-{$ifc TYPED_FUNCTION_POINTERS}
-	AliasFilterProcPtr = function(cpbPtr: CInfoPBPtr; var quitFlag: boolean; myDataPtr: Ptr): boolean;
-{$elsec}
-	AliasFilterProcPtr = ProcPtr;
-{$endc}
+function FSMatchAlias( {const} fromFile: FSRefPtr { can be NULL }; rulesMask: UNSIGNEDLONG; inAlias: AliasHandle; var aliasCount: SInt16; var aliasList: FSRef; var needsUpdate: Boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr ): OSErr; external name '_FSMatchAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
 
-{$ifc OPAQUE_UPP_TYPES}
-	AliasFilterUPP = ^SInt32; { an opaque UPP }
-{$elsec}
-	AliasFilterUPP = UniversalProcPtr;
-{$endc}	
 
-const
-	uppAliasFilterProcInfo = $00000FD0;
-	{
-	 *  NewAliasFilterUPP()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   available as macro/inline
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function NewAliasFilterUPP(userRoutine: AliasFilterProcPtr): AliasFilterUPP; external name '_NewAliasFilterUPP'; { old name was NewAliasFilterProc }
 {
- *  DisposeAliasFilterUPP()
+ *  FSMatchAliasNoUI()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSMatchAliasBulk with the kARMNoUI flag instead
+ *  
+ *  Summary:
+ *    variation on FSMatchAlias that does not prompt user with a dialog
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
- *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.2 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
+ *    Non-Carbon CFM:   not available
  }
-procedure DisposeAliasFilterUPP(userUPP: AliasFilterUPP); external name '_DisposeAliasFilterUPP';
+function FSMatchAliasNoUI( {const} fromFile: FSRefPtr { can be NULL }; rulesMask: UNSIGNEDLONG; inAlias: AliasHandle; var aliasCount: SInt16; var aliasList: FSRef; var needsUpdate: Boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr ): OSErr; external name '_FSMatchAliasNoUI';
+(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
- *  InvokeAliasFilterUPP()
+ *  NewAlias()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSNewAlias
+ *  
+ *  Summary:
+ *    create a new alias between fromFile and target, returns alias
+ *    record handle
+ *  
+ *  Discussion:
+ *    Create an alias betwen fromFile and target, and return it in an
+ *    AliasHandle. This function is deprecated in Mac OS X 10.4;
+ *    instead, you should use FSNewAliasUnicode() because NewAlias()
+ *    has problems creating aliases to certain files, including those
+ *    which are impossible to represent in an FSSpec.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   available as macro/inline
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function InvokeAliasFilterUPP(cpbPtr: CInfoPBPtr; var quitFlag: boolean; myDataPtr: Ptr; userRoutine: AliasFilterUPP): boolean; external name '_InvokeAliasFilterUPP'; { old name was CallAliasFilterProc }
+function NewAlias( {const} fromFile: FSSpecPtr { can be NULL }; const (*var*) target: FSSpec; var alias: AliasHandle ): OSErr; external name '_NewAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  MatchAlias()
+ *  NewAliasMinimal()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSNewAliasMinimalUnicode
  *  
  *  Summary:
- *    Given an alias handle and fromFile, match the alias and return
- *    aliased filename(s) and needsUpdate flag
+ *    create a minimal new alias for a target and return alias record
+ *    handle
+ *  
+ *  Discussion:
+ *    Create a minimal alias for a target, and return it in an
+ *    AliasHandle. This function is deprecated in Mac OS X 10.4;
+ *    instead, you should use FSNewAliasMinimalUnicode() because
+ *    NewAliasMinimalAlias() has problems creating aliases to certain
+ *    files, including those which are impossible to represent in an
+ *    FSSpec.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ }
+function NewAliasMinimal( const (*var*) target: FSSpec; var alias: AliasHandle ): OSErr; external name '_NewAliasMinimal';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
+{
+ *  NewAliasMinimalFromFullPath()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSNewAliasMinimalUnicode
+ *  
+ *  Summary:
+ *    create a minimal new alias from a target fullpath (optional zone
+ *    and server name) and return alias record handle
+ *  
+ *  Discussion:
+ *    Create a minimal alias for a target fullpath, and return it in an
+ *    AliasHandle. This function is deprecated in Mac OS X 10.4;
+ *    instead, you should use FSNewAliasMinimalUnicode() because
+ *    NewAliasMinimalFromFullPath() has problems creating aliases to
+ *    certain files, including those which are impossible to represent
+ *    in an FSSpec.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function MatchAlias(fromFile: {Const}FSSpecPtr; rulesMask: UInt32; alias: AliasHandle; var aliasCount: SInt16; aliasList: FSSpecArrayPtr; var needsUpdate: boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr): OSErr; external name '_MatchAlias';
+function NewAliasMinimalFromFullPath( fullPathLength: SInt16; fullPath: {const} UnivPtr; const (*var*) zoneName: Str32; const (*var*) serverName: Str31; var alias: AliasHandle ): OSErr; external name '_NewAliasMinimalFromFullPath';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  ResolveAliasFileWithMountFlagsNoUI()
+ *  ResolveAlias()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSResolveAlias() or FSResolveAliasWithMountFlags() instead.
  *  
  *  Summary:
- *    variation on ResolveAliasFile that does not prompt user with a
- *    dialog
+ *    given an alias handle and fromFile, resolve the alias, update the
+ *    alias record and return aliased filename and wasChanged flag.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function ResolveAliasFileWithMountFlagsNoUI(var theSpec: FSSpec; resolveAliasChains: boolean; var targetIsFolder: boolean; var wasAliased: boolean; mountFlags: UInt32): OSErr; external name '_ResolveAliasFileWithMountFlagsNoUI';
+function ResolveAlias( {const} fromFile: FSSpecPtr { can be NULL }; alias: AliasHandle; var target: FSSpec; var wasChanged: Boolean ): OSErr; external name '_ResolveAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
 
 {
- *  MatchAliasNoUI()
+ *  GetAliasInfo()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSCopyAliasInfo instead.
  *  
  *  Summary:
- *    variation on MatchAlias that does not prompt user with a dialog
+ *    This call does not work on all aliases. Given an alias handle and
+ *    an index specifying requested alias information type, return the
+ *    information from alias record as a string. An empty string is
+ *    returned when the index is greater than the number of levels
+ *    between the target and root.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.0
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.3
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function MatchAliasNoUI(fromFile: {Const}FSSpecPtr; rulesMask: UInt32; alias: AliasHandle; var aliasCount: SInt16; aliasList: FSSpecArrayPtr; var needsUpdate: boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr): OSErr; external name '_MatchAliasNoUI';
+function GetAliasInfo( alias: AliasHandle; itemIndex: AliasInfoType; var theString: Str63 ): OSErr; external name '_GetAliasInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+
 
 {
- *  FSNewAlias()
+ *  IsAliasFile()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSIsAliasFile() instead.
+ *  
+ *  Summary:
+ *    Return true if the file pointed to by fileFSSpec is an alias file.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.0
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
  }
-function FSNewAlias(fromFile: {Const}FSRefPtr; const (*var*) target: FSRef; var inAlias: AliasHandle): OSErr; external name '_FSNewAlias';
+function IsAliasFile( const (*var*) fileFSSpec: FSSpec; var aliasFileFlag: Boolean; var folderFlag: Boolean ): OSErr; external name '_IsAliasFile';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  FSNewAliasMinimal()
+ *  ResolveAliasWithMountFlags()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSResolveAliasWithMountFlags() instead.
+ *  
+ *  Summary:
+ *    Given an AliasHandle, return target file spec. It resolves the
+ *    entire alias chain or one step of the chain.  It returns info
+ *    about whether the target is a folder or file; and whether the
+ *    input file spec was an alias or not.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
  }
-function FSNewAliasMinimal(const (*var*) target: FSRef; var inAlias: AliasHandle): OSErr; external name '_FSNewAliasMinimal';
+function ResolveAliasWithMountFlags( {const} fromFile: FSSpecPtr { can be NULL }; alias: AliasHandle; var target: FSSpec; var wasChanged: Boolean; mountFlags: UNSIGNEDLONG ): OSErr; external name '_ResolveAliasWithMountFlags';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  FSIsAliasFile()
+ *  ResolveAliasFile()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSResolveAliasFile
+ *  
+ *  Summary:
+ *    Given a file spec, return target file spec if input file spec is
+ *    an alias. It resolves the entire alias chain or one step of the
+ *    chain.  It returns info about whether the target is a folder or
+ *    file; and whether the input file spec was an alias or not.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function FSIsAliasFile(const (*var*) fileRef: FSRef; var aliasFileFlag: boolean; var folderFlag: boolean): OSErr; external name '_FSIsAliasFile';
+function ResolveAliasFile( var theSpec: FSSpec; resolveAliasChains: Boolean; var targetIsFolder: Boolean; var wasAliased: Boolean ): OSErr; external name '_ResolveAliasFile';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
+{ Deprecated: Use FSResolveAliasFileWithMountFlags instead}
 {
- *  FSResolveAliasWithMountFlags()
+ *  ResolveAliasFileWithMountFlags()   *** DEPRECATED ***
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
  }
-function FSResolveAliasWithMountFlags(fromFile: {Const}FSRefPtr; inAlias: AliasHandle; var target: FSRef; var wasChanged: boolean; mountFlags: UInt32): OSErr; external name '_FSResolveAliasWithMountFlags';
+function ResolveAliasFileWithMountFlags( var theSpec: FSSpec; resolveAliasChains: Boolean; var targetIsFolder: Boolean; var wasAliased: Boolean; mountFlags: UNSIGNEDLONG ): OSErr; external name '_ResolveAliasFileWithMountFlags';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
+{ Deprecated:  Use FSFollowFinderAlias instead}
 {
- *  FSResolveAlias()
+ *  FollowFinderAlias()   *** DEPRECATED ***
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 8.5 and later
  }
-function FSResolveAlias(fromFile: {Const}FSRefPtr; alias: AliasHandle; var target: FSRef; var wasChanged: boolean): OSErr; external name '_FSResolveAlias';
+function FollowFinderAlias( {const} fromFile: FSSpecPtr { can be NULL }; alias: AliasHandle; logon: Boolean; var target: FSSpec; var wasChanged: Boolean ): OSErr; external name '_FollowFinderAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
+{ 
+   Low Level Routines 
+}
 {
- *  FSResolveAliasFileWithMountFlags()
+ *  UpdateAlias()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    UseFSUpdateAlias
+ *  
+ *  Summary:
+ *    given a fromFile-target pair and an alias handle, update the
+ *    alias record pointed to by alias handle to represent target as
+ *    the new alias.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function FSResolveAliasFileWithMountFlags(var theRef: FSRef; resolveAliasChains: boolean; var targetIsFolder: boolean; var wasAliased: boolean; mountFlags: UInt32): OSErr; external name '_FSResolveAliasFileWithMountFlags';
+function UpdateAlias( {const} fromFile: FSSpecPtr { can be NULL }; const (*var*) target: FSSpec; alias: AliasHandle; var wasChanged: Boolean ): OSErr; external name '_UpdateAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  FSResolveAliasFile()
+ *  MatchAlias()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSMatchAliasBulk instead
+ *  
+ *  Summary:
+ *    Given an alias handle and fromFile, match the alias and return
+ *    FSSpecs to the aliased file(s) and needsUpdate flag
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function FSResolveAliasFile(var theRef: FSRef; resolveAliasChains: boolean; var targetIsFolder: boolean; var wasAliased: boolean): OSErr; external name '_FSResolveAliasFile';
+function MatchAlias( {const} fromFile: FSSpecPtr { can be NULL }; rulesMask: UNSIGNEDLONG; alias: AliasHandle; var aliasCount: SInt16; aliasList: FSSpecArrayPtr; var needsUpdate: Boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr ): OSErr; external name '_MatchAlias';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  FSFollowFinderAlias()
+ *  ResolveAliasFileWithMountFlagsNoUI()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSResolveAliasFileWithMountFlags passing in the
+ *    kResolveAliasFileNoUI flag
+ *  
+ *  Summary:
+ *    variation on ResolveAliasFile that does not prompt user with a
+ *    dialog
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function FSFollowFinderAlias(fromFile: FSRefPtr; alias: AliasHandle; logon: boolean; var target: FSRef; var wasChanged: boolean): OSErr; external name '_FSFollowFinderAlias';
+function ResolveAliasFileWithMountFlagsNoUI( var theSpec: FSSpec; resolveAliasChains: Boolean; var targetIsFolder: Boolean; var wasAliased: Boolean; mountFlags: UNSIGNEDLONG ): OSErr; external name '_ResolveAliasFileWithMountFlagsNoUI';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
+
 {
- *  FSUpdateAlias()
+ *  MatchAliasNoUI()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    Use FSMatchAliasBulk with the kARMNoUI flag instead
+ *  
+ *  Summary:
+ *    variation on MatchAlias that does not prompt user with a dialog
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.3
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 9.1 and later
- *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Mac OS X:         in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function FSUpdateAlias(fromFile: {Const}FSRefPtr; const (*var*) target: FSRef; alias: AliasHandle; var wasChanged: boolean): OSErr; external name '_FSUpdateAlias';
-{$ALIGN MAC68K}
+function MatchAliasNoUI( {const} fromFile: FSSpecPtr { can be NULL }; rulesMask: UNSIGNEDLONG; alias: AliasHandle; var aliasCount: SInt16; aliasList: FSSpecArrayPtr; var needsUpdate: Boolean; aliasFilter: AliasFilterUPP; yourDataPtr: UnivPtr ): OSErr; external name '_MatchAliasNoUI';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
+{$endc} {not TARGET_CPU_64}
+
+{$endc} {TARGET_OS_MAC}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 364 - 636
packages/univint/src/Appearance.pas


+ 92 - 15
packages/univint/src/AppleDiskPartitions.pas

@@ -1,12 +1,11 @@
 {
-     File:       AppleDiskPartitions.p
+     File:       OSServices/AppleDiskPartitions.h
  
      Contains:   The Apple disk partition scheme as defined in Inside Macintosh: Volume V.
  
-     Version:    Technology: Mac OS 9
-                 Release:    Universal Interfaces 3.4.2
+     Version:    OSServices-352~2
  
-     Copyright:  © 2000-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 2000-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{       Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 (only changes in C header were layout, so not updated since deprecated) }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AppleDiskPartitions;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,7 +176,12 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
+
+// warning AppleDiskPartitions.h is no longer maintained.  You should switch to IOApplePartitionScheme.h
 
 {$ALIGN MAC68K}
 
@@ -210,7 +286,8 @@ const
 	kDriveSetupHFSSignature		= FourCharCode('DSU1');						{  Drive Setup HFS partition         }
 
 
-{$ALIGN MAC68K}
-
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 194 - 99
packages/univint/src/AppleEvents.pas

@@ -1,12 +1,11 @@
 {
-     File:       AppleEvents.p
+     File:       AE/AppleEvents.h
  
      Contains:   AppleEvent Package Interfaces.
  
-     Version:    Technology: System 7.5
-                 Release:    Universal Interfaces 3.4.2
+     Version:    AppleEvents-496~1
  
-     Copyright:  © 1989-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1989-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AppleEvents;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,95 +176,104 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,MixedMode,AEDataModel,AEInteraction, CFArray, CFBase, CFRunLoop, CFStream, CFURL;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
 {
     Note:   The functions and types for the building and parsing AppleEvent  
             messages has moved to AEDataModel.h
 }
 
-{
-    Note:   The functions for interacting with events has moved to AEInteraction.h
-}
 
 {$ALIGN MAC68K}
 
+const
+{ Keywords for Apple event parameters }
+	keyDirectObject = FourCharCode('----');
+	keyErrorNumber = FourCharCode('errn');
+	keyErrorString = FourCharCode('errs');
+	keyProcessSerialNumber = FourCharCode('psn '); { Keywords for special handlers }
+	keyPreDispatch = FourCharCode('phac'); { preHandler accessor call }
+	keySelectProc = FourCharCode('selh'); { more selector call }
+                                        { Keyword for recording }
+	keyAERecorderCount = FourCharCode('recr'); { available only in vers 1.0.1 and greater }
+                                        { Keyword for version information }
+	keyAEVersion = FourCharCode('vers'); { available only in vers 1.0.1 and greater }
+
+{ Event Class }
+const
+	kCoreEventClass = FourCharCode('aevt');
 
+{ Event ID's }
+const
+	kAEOpenApplication = FourCharCode('oapp');
+	kAEOpenDocuments = FourCharCode('odoc');
+	kAEPrintDocuments = FourCharCode('pdoc');
+	kAEOpenContents = FourCharCode('ocon');
+	kAEQuitApplication = FourCharCode('quit'); { may include a property kAEQuitReason indicating what lead to the quit being sent. }
+	kAEAnswer = FourCharCode('ansr');
+	kAEApplicationDied = FourCharCode('obit');
+	kAEShowPreferences = FourCharCode('pref'); { sent by Mac OS X when the user chooses the Preferences item }
+
+{ Constants for recording }
 const
-																{  Keywords for Apple event parameters  }
-	keyDirectObject				= FourCharCode('----');
-	keyErrorNumber				= FourCharCode('errn');
-	keyErrorString				= FourCharCode('errs');
-	keyProcessSerialNumber		= FourCharCode('psn ');						{  Keywords for special handlers  }
-	keyPreDispatch				= FourCharCode('phac');						{  preHandler accessor call  }
-	keySelectProc				= FourCharCode('selh');						{  more selector call  }
-																{  Keyword for recording  }
-	keyAERecorderCount			= FourCharCode('recr');						{  available only in vers 1.0.1 and greater  }
-																{  Keyword for version information  }
-	keyAEVersion				= FourCharCode('vers');						{  available only in vers 1.0.1 and greater  }
-
-	{	 Event Class 	}
-	kCoreEventClass				= FourCharCode('aevt');
-
-	{	 Event IDÕs 	}
-	kAEOpenApplication			= FourCharCode('oapp');
-	kAEOpenDocuments			= FourCharCode('odoc');
-	kAEPrintDocuments			= FourCharCode('pdoc');
-	kAEQuitApplication			= FourCharCode('quit');
-	kAEAnswer					= FourCharCode('ansr');
-	kAEApplicationDied			= FourCharCode('obit');
-	kAEShowPreferences			= FourCharCode('pref');						{  sent by Mac OS X when the user chooses the Preferences item  }
-	kAEAutosaveNow              = FourCharCode('asav');                       { sent by Mac OS X when it is advisable to autosave all the user's documents with uncommitted changes. }
-
-	{	 Constants for recording 	}
-	kAEStartRecording			= FourCharCode('reca');						{  available only in vers 1.0.1 and greater  }
-	kAEStopRecording			= FourCharCode('recc');						{  available only in vers 1.0.1 and greater  }
-	kAENotifyStartRecording		= FourCharCode('rec1');						{  available only in vers 1.0.1 and greater  }
-	kAENotifyStopRecording		= FourCharCode('rec0');						{  available only in vers 1.0.1 and greater  }
-	kAENotifyRecording			= FourCharCode('recr');						{  available only in vers 1.0.1 and greater  }
-
-
-	{	
-	 * AEEventSource is defined as an SInt8 for compatability with pascal.
-	 * Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
-	 * Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
-	 * compared directly against the following enums.
-	 	}
+	kAEStartRecording = FourCharCode('reca'); { available only in vers 1.0.1 and greater }
+	kAEStopRecording = FourCharCode('recc'); { available only in vers 1.0.1 and greater }
+	kAENotifyStartRecording = FourCharCode('rec1'); { available only in vers 1.0.1 and greater }
+	kAENotifyStopRecording = FourCharCode('rec0'); { available only in vers 1.0.1 and greater }
+	kAENotifyRecording = FourCharCode('recr'); { available only in vers 1.0.1 and greater }
 
+
+{
+ * AEEventSource is defined as an SInt8 for compatability with pascal.
+ * Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
+ * Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
+ * compared directly against the following enums.
+ }
 type
-	AEEventSource 				= SInt8;
+	AEEventSource = SInt8;
 const
-	kAEUnknownSource			= 0;
-	kAEDirectCall				= 1;
-	kAESameProcess				= 2;
-	kAELocalProcess				= 3;
-	kAERemoteProcess			= 4;
-
-	{	*************************************************************************
-	  These calls are used to set up and modify the event dispatch table.
-	*************************************************************************	}
-	{
-	 *  AEInstallEventHandler()
-	 *  
-	 *  Mac OS X threading:
-	 *    Thread safe since version 10.2
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function AEInstallEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: SInt32; isSysHandler: boolean): OSErr; external name '_AEInstallEventHandler';
+	kAEUnknownSource = 0;
+	kAEDirectCall = 1;
+	kAESameProcess = 2;
+	kAELocalProcess = 3;
+	kAERemoteProcess = 4;
+
+{*************************************************************************
+  These calls are used to set up and modify the event dispatch table.
+*************************************************************************}
 {
- *  AERemoveEventHandler()
+ *  AEInstallEventHandler()
  *  
  *  Mac OS X threading:
  *    Thread safe since version 10.2
  *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ }
+function AEInstallEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEInstallEventHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
+{
+ *  AERemoveEventHandler()
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.2
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: boolean): OSErr; external name '_AERemoveEventHandler';
+function AERemoveEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveEventHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEGetEventHandler()
  *  
@@ -201,11 +281,14 @@ function AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEve
  *    Thread safe since version 10.2
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; var handler: AEEventHandlerUPP; var handlerRefcon: SInt32; isSysHandler: boolean): OSErr; external name '_AEGetEventHandler';
+function AEGetEventHandler( theAEEventClass: AEEventClass; theAEEventID: AEEventID; var handler: AEEventHandlerUPP; var handlerRefcon: SRefCon; isSysHandler: Boolean ): OSErr; external name '_AEGetEventHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {*************************************************************************
   These calls are used to set up and modify special hooks into the
   AppleEvent manager.
@@ -217,11 +300,14 @@ function AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventI
  *    Thread safe since version 10.2
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AEInstallSpecialHandler(functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: boolean): OSErr; external name '_AEInstallSpecialHandler';
+function AEInstallSpecialHandler( functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AEInstallSpecialHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AERemoveSpecialHandler()
  *  
@@ -229,11 +315,14 @@ function AEInstallSpecialHandler(functionClass: AEKeyword; handler: AEEventHandl
  *    Thread safe since version 10.2
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AERemoveSpecialHandler(functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: boolean): OSErr; external name '_AERemoveSpecialHandler';
+function AERemoveSpecialHandler( functionClass: AEKeyword; handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AERemoveSpecialHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
  *  AEGetSpecialHandler()
  *  
@@ -241,11 +330,14 @@ function AERemoveSpecialHandler(functionClass: AEKeyword; handler: AEEventHandle
  *    Thread safe since version 10.2
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AEGetSpecialHandler(functionClass: AEKeyword; var handler: AEEventHandlerUPP; isSysHandler: boolean): OSErr; external name '_AEGetSpecialHandler';
+function AEGetSpecialHandler( functionClass: AEKeyword; var handler: AEEventHandlerUPP; isSysHandler: Boolean ): OSErr; external name '_AEGetSpecialHandler';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {*************************************************************************
   This call was added in version 1.0.1. If called with the keyword
   keyAERecorderCount ('recr'), the number of recorders that are
@@ -259,11 +351,13 @@ function AEGetSpecialHandler(functionClass: AEKeyword; var handler: AEEventHandl
  *    Thread safe since version 10.2
  *  
  *  Availability:
- *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
+ *    Mac OS X:         in version 10.0 and later in ApplicationServices.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
  }
-function AEManagerInfo(keyWord: AEKeyword; var result: SInt32): OSErr; external name '_AEManagerInfo';
+function AEManagerInfo( keyWord: AEKeyword; var result: SIGNEDLONG ): OSErr; external name '_AEManagerInfo';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
   AERemoteProcessResolver:
@@ -352,6 +446,7 @@ var kAERemoteProcessProcessIDKey: CFStringRef; external name '_kAERemoteProcessP
  *    callback is made, the info pointer is passed to the callback.
  }
 type
+	AERemoteProcessResolverContextPtr = ^AERemoteProcessResolverContext;
 	AERemoteProcessResolverContext = record
 {
    * set to zero (0)
@@ -379,8 +474,6 @@ type
 		copyDescription: CFAllocatorCopyDescriptionCallBack;
 	end;
 
-    AERemoteProcessResolverContextPtr = ^AERemoteProcessResolverContext; { when a var xx: AERemoteProcessResolverContext parameter can be nil, it is changed to xx: AERemoteProcessResolverContextPtr }
-
 {
  *  AERemoteProcessResolverRef
  *  
@@ -392,7 +485,7 @@ type
  *    AERemoteProcessResolverRef is not a CFType.
  }
 type
-	AERemoteProcessResolverRef = ^SInt32; { an opaque 32-bit type }
+	AERemoteProcessResolverRef = ^SInt32; { an opaque type }
 {
  *  AECreateRemoteProcessResolver()
  *  
@@ -547,7 +640,9 @@ type
 procedure AERemoteProcessResolverScheduleWithRunLoop( ref: AERemoteProcessResolverRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef; callback: AERemoteProcessResolverCallback; {const} ctx: AERemoteProcessResolverContextPtr { can be NULL } ); external name '_AERemoteProcessResolverScheduleWithRunLoop';
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
-{$ALIGN MAC68K}
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 154 - 70
packages/univint/src/AppleHelp.pas

@@ -1,12 +1,11 @@
 {
-     File:       AppleHelp.p
+     File:       Help/AppleHelp.h
  
      Contains:   Apple Help
  
-     Version:    Technology: Mac OS X/CarbonLib 1.1
-                 Release:    Universal Interfaces 3.4.2
+     Version:    Help-36~232
  
-     Copyright:  © 2000-2002 by Apple Computer, Inc., all rights reserved.
+     Copyright:  © 2000-2008 by Apple Computer, Inc., all rights reserved.
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -14,14 +13,14 @@
                      http://www.freepascal.org/bugs.html
  
 }
-
-
+{       Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit AppleHelp;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,59 +176,64 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,Files,CFString;
+{$endc} {not MACOSALLINCLUDE}
 
 
-{$ALIGN MAC68K}
+{$ifc TARGET_OS_MAC}
 
-{ AppleHelp Error Codes }
+{$ALIGN POWER}
 
+{ AppleHelp Error Codes }
 const
-	kAHInternalErr				= -10790;
-	kAHInternetConfigPrefErr	= -10791;
+	kAHInternalErr = -10790;
+	kAHInternetConfigPrefErr = -10791;
 
 
 type
-	AHTOCType 					= SInt16;
+	AHTOCType = SInt16;
 const
-	kAHTOCTypeUser				= 0;
-	kAHTOCTypeDeveloper			= 1;
+	kAHTOCTypeUser = 0;
+	kAHTOCTypeDeveloper = 1;
+
+{
+ *  AHSearch()
+ *  
+ *  Discussion:
+ *    Delivers a request to perform the specified search to the Help
+ *    Viewer application.
+ *  
+ *  Parameters:
+ *    
+ *    bookname:
+ *      Optionally, the AppleTitle of the Help book to be searched. If
+ *      NULL, all installed Help books are searched.
+ *    
+ *    query:
+ *      The query to be made. This string can, if desired, have boolean
+ *      operators or be a natural language phrase.
+ *  
+ *  Result:
+ *    An operating system result code that indicates whether the
+ *    request was successfully sent to the Help Viewer application.
+ *    Possible values: noErr, paramErr, kAHInternalErr.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
+ *    CarbonLib:        in CarbonLib 1.1 and later
+ *    Non-Carbon CFM:   not available
+ }
+function AHSearch( bookname: CFStringRef; query: CFStringRef ): OSStatus; external name '_AHSearch';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
-	{
-	 *  AHSearch()
-	 *  
-	 *  Discussion:
-	 *    Delivers a request to perform the specified search to the Help
-	 *    Viewer application.
-	 *  
-	 *  Parameters:
-	 *    
-	 *    bookname:
-	 *      Optionally, the AppleTitle of the Help book to be searched. If
-	 *      NULL, all installed Help books are searched.
-	 *    
-	 *    query:
-	 *      The query to be made. This string can, if desired, have boolean
-	 *      operators or be a natural language phrase.
-	 *  
-	 *  Result:
-	 *    An operating system result code that indicates whether the
-	 *    request was successfully sent to the Help Viewer application.
-	 *    Possible values: noErr, paramErr, kAHInternalErr,
-	 *    kAHInternetConfigPrefErr.
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   not available
-	 *    CarbonLib:        in CarbonLib 1.1 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function AHSearch(bookname: CFStringRef; query: CFStringRef): OSStatus; external name '_AHSearch';
 
 {
- *  AHGotoMainTOC()
+ *  AHGotoMainTOC()   *** DEPRECATED ***
  *  
  *  Discussion:
  *    Delivers a request to load the main table of contents of
- *    installed help books to the Help Viewer application.
+ *    installed help books to the Help Viewer application. This method
+ *    has been deprecated in Mac OS X 10.4. Instead, please use
+ *    AHGotoPage to jump directly to different books or anchors.
  *  
  *  Parameters:
  *    
@@ -167,15 +243,16 @@ function AHSearch(bookname: CFStringRef; query: CFStringRef): OSStatus; external
  *  Result:
  *    An operating system result code that indicates whether the
  *    request was successfully sent to the Help Viewer application.
- *    Possible values: noErr, paramErr, kAHInternalErr,
- *    kAHInternetConfigPrefErr.
+ *    Possible values: noErr, paramErr, kAHInternalErr.
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework but deprecated in 10.4
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AHGotoMainTOC(toctype: AHTOCType): OSStatus; external name '_AHGotoMainTOC';
+function AHGotoMainTOC( toctype: AHTOCType ): OSStatus; external name '_AHGotoMainTOC';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+
 
 {
  *  AHGotoPage()
@@ -206,15 +283,16 @@ function AHGotoMainTOC(toctype: AHTOCType): OSStatus; external name '_AHGotoMain
  *  Result:
  *    An operating system result code that indicates whether the
  *    request was successfully sent to the Help Viewer application.
- *    Possible values: noErr, paramErr, kAHInternalErr,
- *    kAHInternetConfigPrefErr.
+ *    Possible values: noErr, paramErr, kAHInternalErr.
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AHGotoPage(bookname: CFStringRef; path: CFStringRef; anchor: CFStringRef): OSStatus; external name '_AHGotoPage';
+function AHGotoPage( bookname: CFStringRef; path: CFStringRef; anchor: CFStringRef ): OSStatus; external name '_AHGotoPage';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
 {
  *  AHLookupAnchor()
@@ -238,15 +316,15 @@ function AHGotoPage(bookname: CFStringRef; path: CFStringRef; anchor: CFStringRe
  *  Result:
  *    An operating system result code that indicates whether the
  *    request was successfully sent to the Help Viewer application.
- *    Possible values: noErr, paramErr, kAHInternalErr,
- *    kAHInternetConfigPrefErr.
+ *    Possible values: noErr, paramErr, kAHInternalErr.
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AHLookupAnchor(bookname: CFStringRef; anchor: CFStringRef): OSStatus; external name '_AHLookupAnchor';
+function AHLookupAnchor( bookname: CFStringRef; anchor: CFStringRef ): OSStatus; external name '_AHLookupAnchor';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
 
 {
@@ -272,13 +350,19 @@ function AHLookupAnchor(bookname: CFStringRef; anchor: CFStringRef): OSStatus; e
  *    Possible values: noErr, paramErr, kAHInternalErr, dirNFErr.
  *  
  *  Availability:
- *    Non-Carbon CFM:   not available
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.1 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   not available
  }
-function AHRegisterHelpBook(const (*var*) appBundleRef: FSRef): OSStatus; external name '_AHRegisterHelpBook';
+function AHRegisterHelpBook( const (*var*) appBundleRef: FSRef ): OSStatus; external name '_AHRegisterHelpBook';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
 
-{$ALIGN MAC68K}
+function AHRegisterHelpBookWithURL( {const} applicationURL: CFURLRef ): OSStatus; external name '_AHRegisterHelpBookWithURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 265 - 102
packages/univint/src/AppleScript.pas

@@ -1,12 +1,11 @@
 {
-     File:       AppleScript.p
+     File:       OpenScripting/AppleScript.h
  
      Contains:   AppleScript Specific Interfaces.
  
-     Version:    Technology: AppleScript 1.1
-                 Release:    Universal Interfaces 3.4.2
+     Version:    OSA-136~14
  
-     Copyright:  © 1992-2002 by Apple Computer, Inc., all rights reserved
+     Copyright:  © 1992-2008 by Apple Computer, Inc., all rights reserved
  
      Bugs?:      For bug reports, consult the following page on
                  the World Wide Web:
@@ -15,13 +14,15 @@
  
 }
 
+{ Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +31,8 @@
 
 unit AppleScript;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +45,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +84,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +168,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -104,10 +177,14 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,AEDataModel,Components,MacErrors,AppleEvents,OSA,TextEdit;
+uses MacTypes,AEDataModel,Components,MacErrors,OSA,TextEdit,CFBase,CFArray;
+{$endc} {not MACOSALLINCLUDE}
+
 
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
 
-{$ALIGN MAC68K}
 
 {*************************************************************************
     Types and Constants
@@ -116,46 +193,52 @@ uses MacTypes,AEDataModel,Components,MacErrors,AppleEvents,OSA,TextEdit;
     The specific type for the AppleScript instance of the
     Open Scripting Architecture type.
 }
-
 const
-	typeAppleScript				= FourCharCode('ascr');
-	kAppleScriptSubtype			= FourCharCode('ascr');
-	typeASStorage				= FourCharCode('ascr');
+	typeAppleScript = FourCharCode('ascr');
+	kAppleScriptSubtype = typeAppleScript;
+	typeASStorage = typeAppleScript;
 
-	{	*************************************************************************
-	    Component Selectors
-	*************************************************************************	}
+{*************************************************************************
+    Component Selectors
+*************************************************************************}
 
-	kASSelectInit				= $1001;
-	kASSelectSetSourceStyles	= $1002;
-	kASSelectGetSourceStyles	= $1003;
+const
+	kASSelectInit = $1001;
+	kASSelectSetSourceStyles = $1002;
+	kASSelectGetSourceStyles = $1003;
 	kASSelectGetSourceStyleNames = $1004;
+	kASSelectCopySourceAttributes = $1005;
+	kASSelectSetSourceAttributes = $1006;
+
+
+{*************************************************************************
+    OSAGetScriptInfo Selectors
+*************************************************************************}
+const
+	kASHasOpenHandler = FourCharCode('hsod');
+
+{
+        This selector is used to query a context as to whether it contains
+        a handler for the kAEOpenDocuments event. This allows "applets" to be 
+        distinguished from "droplets."  OSAGetScriptInfo returns false if
+        there is no kAEOpenDocuments handler, and returns the error value 
+        errOSAInvalidAccess if the input is not a context.
+    }
+{*************************************************************************
+    Initialization
+*************************************************************************}
+{
+ *  ASInit()
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
+ *    CarbonLib:        in CarbonLib 1.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ }
+function ASInit( scriptingComponent: ComponentInstance; modeFlags: SInt32; minStackSize: UInt32; preferredStackSize: UInt32; maxStackSize: UInt32; minHeapSize: UInt32; preferredHeapSize: UInt32; maxHeapSize: UInt32 ): OSAError; external name '_ASInit';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
 
 
-	{	*************************************************************************
-	    OSAGetScriptInfo Selectors
-	*************************************************************************	}
-	kASHasOpenHandler			= FourCharCode('hsod');
-
-	{	
-	        This selector is used to query a context as to whether it contains
-	        a handler for the kAEOpenDocuments event. This allows "applets" to be 
-	        distinguished from "droplets."  OSAGetScriptInfo returns false if
-	        there is no kAEOpenDocuments handler, and returns the error value 
-	        errOSAInvalidAccess if the input is not a context.
-	    	}
-	{	*************************************************************************
-	    Initialization
-	*************************************************************************	}
-	{
-	 *  ASInit()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function ASInit(scriptingComponent: ComponentInstance; modeFlags: SInt32; minStackSize: SInt32; preferredStackSize: SInt32; maxStackSize: SInt32; minHeapSize: SInt32; preferredHeapSize: SInt32; maxHeapSize: SInt32): OSAError; external name '_ASInit';
 {
         ComponentCallNow(kASSelectInit, 28);
         This call can be used to explicitly initialize AppleScript.  If it is
@@ -171,83 +254,163 @@ function ASInit(scriptingComponent: ComponentInstance; modeFlags: SInt32; minSta
     These values will be used if ASInit is not called explicitly, or if any
     of ASInit's parameters are zero:
 }
-
 const
-	kASDefaultMinStackSize		= 4096;
-	kASDefaultPreferredStackSize = 16384;
-	kASDefaultMaxStackSize		= 16384;
-	kASDefaultMinHeapSize		= 4096;
-	kASDefaultPreferredHeapSize	= 16384;
-	kASDefaultMaxHeapSize		= 33554432;
-
-	{	*************************************************************************
-	    Source Styles
-	*************************************************************************	}
-	{
-	 *  ASSetSourceStyles()
-	 *  
-	 *  Availability:
-	 *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
-	 *    CarbonLib:        in CarbonLib 1.0 and later
-	 *    Mac OS X:         in version 10.0 and later
-	 	}
-function ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError; external name '_ASSetSourceStyles';
-{
-        ComponentCallNow(kASSelectSetSourceStyles, 4);
-        Errors:
-        errOSASystemError       operation failed
-    }
+	kASDefaultMinStackSize = 4 * 1024;
+	kASDefaultPreferredStackSize = 16 * 1024;
+	kASDefaultMaxStackSize = 16 * 1024;
+	kASDefaultMinHeapSize = 4 * 1024;
+	kASDefaultPreferredHeapSize = 16 * 1024;
+	kASDefaultMaxHeapSize = 32 * 1024 * 1024;
+
+{*************************************************************************
+    Source Styles
+*************************************************************************}
 {
- *  ASGetSourceStyles()
+ *  ASSetSourceStyles()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    use ASSetSourceAttributes instead.
  *  
  *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework but deprecated in 10.5
+ *    CarbonLib:        in CarbonLib 1.0 and later
  *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ }
+function ASSetSourceStyles( scriptingComponent: ComponentInstance; sourceStyles: STHandle ): OSAError; external name '_ASSetSourceStyles';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
+{
+ *  ASGetSourceStyles()   *** DEPRECATED ***
+ *  
+ *  Deprecated:
+ *    use ASCopySourceAttributes instead.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework but deprecated in 10.5
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASGetSourceStyles(scriptingComponent: ComponentInstance; var resultingSourceStyles: STHandle): OSAError; external name '_ASGetSourceStyles';
+function ASGetSourceStyles( scriptingComponent: ComponentInstance; var resultingSourceStyles: STHandle ): OSAError; external name '_ASGetSourceStyles';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
+
+
 {
-        ComponentCallNow(kASSelectGetSourceStyles, 4);
-        Errors:
-        errOSASystemError       operation failed
-    }
+ *  ASCopySourceAttributes()
+ *  
+ *  Summary:
+ *    Get the current AppleScript source style attributes.
+ *  
+ *  Discussion:
+ *    A "style attribute" will typically be something meaningful to a
+ *    CFAttributedString, but clients may add any attributes they like
+ *    using ASSetSourceAttributes.
+ *  
+ *  Parameters:
+ *    
+ *    scriptingComponent:
+ *      A valid AppleScript component instance.
+ *    
+ *    resultingSourceAttributes:
+ *      If successful, *resultingSourceAttributes will be set to a
+ *      CFArray of CFDictionaries of text attributes.  The order of the
+ *      array elements corresponds to the source style constants below,
+ *      and therefore also to the names returned by
+ *      ASGetSourceStyleNames. The caller is responsible for releasing
+ *      this array.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function ASCopySourceAttributes( scriptingComponent: ComponentInstance; var resultingSourceAttributes: CFArrayRef ): OSAError; external name '_ASCopySourceAttributes';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  ASSetSourceAttributes()
+ *  
+ *  Summary:
+ *    Set the AppleScript source style attributes.
+ *  
+ *  Discussion:
+ *    A "style attribute" will typically be something meaningful to a
+ *    CFAttributedString, but clients may add any attributes they like.
+ *     Because of this, you should generally call ASSetSourceAttributes
+ *    with a modified copy of the result from ASCopySourceAttributes,
+ *    not a built-from-scratch set of attributes.
+ *  
+ *  Parameters:
+ *    
+ *    scriptingComponent:
+ *      A valid AppleScript component instance.
+ *    
+ *    sourceAttributes:
+ *      A CFArray of CFDictionaries of text attributes.  The order of
+ *      the array elements corresponds to the source style constants
+ *      below, and therefore also to the names returned by
+ *      ASGetSourceStyleNames.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in Carbon.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function ASSetSourceAttributes( scriptingComponent: ComponentInstance; sourceAttributes: CFArrayRef ): OSAError; external name '_ASSetSourceAttributes';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
 {
  *  ASGetSourceStyleNames()
  *  
+ *  Summary:
+ *    Returns the AppleScript source style names.
+ *  
+ *  Discussion:
+ *    This call returns an AEList of text descriptors with the names of
+ *    the source styles.  The order of the names corresponds to the
+ *    order of the source style constants, below.  The precise type of
+ *    the text descriptors is not defined; you should coerce them to
+ *    the type you want to handle.
+ *  
  *  Availability:
- *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
+ *    Mac OS X:         in version 10.0 and later in Carbon.framework
  *    CarbonLib:        in CarbonLib 1.0 and later
- *    Mac OS X:         in version 10.0 and later
+ *    Non-Carbon CFM:   in AppleScriptLib 1.1 and later
  }
-function ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: SInt32; var resultingSourceStyleNamesList: AEDescList): OSAError; external name '_ASGetSourceStyleNames';
-{
-        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
-        This call returns an AEList of styled text descriptors the names of the
-        source styles in the current dialect.  The order of the names corresponds
-        to the order of the source style constants, below.  The style of each
-        name is the same as the styles returned by ASGetSourceStyles.
-        
-        Errors:
-        errOSASystemError       operation failed
-    }
+function ASGetSourceStyleNames( scriptingComponent: ComponentInstance; modeFlags: SInt32; var resultingSourceStyleNamesList: AEDescList ): OSAError; external name '_ASGetSourceStyleNames';
+(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
+
+
 {
     Elements of STHandle correspond to following categories of tokens, and
     accessed through following index constants:
 }
-
 const
 	kASSourceStyleUncompiledText = 0;
-	kASSourceStyleNormalText	= 1;
+	kASSourceStyleNormalText = 1;
 	kASSourceStyleLanguageKeyword = 2;
 	kASSourceStyleApplicationKeyword = 3;
-	kASSourceStyleComment		= 4;
-	kASSourceStyleLiteral		= 5;
-	kASSourceStyleUserSymbol	= 6;
-	kASSourceStyleObjectSpecifier = 7;
-	kASNumberOfSourceStyles		= 8;
-
-
-{$ALIGN MAC68K}
+	kASSourceStyleComment = 4;
+	kASSourceStyleLiteral = 5;
+	kASSourceStyleUserSymbol = 6;
+	kASSourceStyleObjectSpecifier = 7;    { Obsolete. Has been reused for strings. }
+	kASSourceStyleString = 7;    { This and after were added in Mac OS X 10.6. }
+	kASSourceStyleEventName = 8;
+	kASSourceStyleParameterName = 9;
+	kASSourceStyleClass = 10;
+	kASSourceStyleProperty = 11;
+	kASSourceStyleEnumValue = 12;
+	kASSourceStyleDynamicEventName = 13;
+	kASSourceStyleDynamicParameterName = 14;
+	kASSourceStyleDynamicClass = 15;
+	kASSourceStyleDynamicProperty = 16;
+	kASSourceStyleDynamicEnumValue = 17;
+	kASNumberOfSourceStyles = 18;    { Deprecated. Don't assume the array length is fixed, and don't assume all indices are in the array. Always get its size at runtime. }
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 1208 - 0
packages/univint/src/AudioCodecs.pas

@@ -0,0 +1,1208 @@
+{==================================================================================================
+     File:       AudioUnit/AudioCodec.h
+
+     Contains:   A component API for encoding/decoding audio data.
+
+     Copyright:  (c) 1985-2008 by Apple Inc., all rights reserved.
+
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+
+                     http://www.freepascal.org/bugs.html
+
+==================================================================================================}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioCodecs;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,CoreAudioTypes,AudioComponents;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+{!
+	@header AudioCodec
+ 
+	This header defines the property sets and the public API for various audio codecs.
+
+	<h2>Theory of Operation</h2>
+ 
+	AudioCodec components translate audio data from one format to another. There
+	are three kinds of AudioCodec components. Decoder components ('adec') 
+	translate data that isn't in linear PCM into linear PCM formatted data. 
+	Encoder components ('aenc') translate linear PCM data into some other format. 
+	Unity codecs ('acdc') translate between different flavors of the same type 
+	(e.g. 16 bit signed integer linear PCM into 32 bit floating point linear PCM).
+ 
+	AudioCodec components are standard components and are managed by the Component
+	Manager.
+ 
+	Once an AudioCodec is found that implements the translation in question,
+	it has to be set up to do the translation. This can be done by setting the
+	appropriate properties or by calling AudioCodecInitialize. If the translation
+	is specified by properties, AudioCodecInitialize still needs to be called
+	prior to appending input data or producing output data.
+ 
+	AudioCodecInitialize puts the codec into the "initialized" state. In this state,
+	the format information for the translation cannot be changed. The codec
+	has to be in the initialized state for AudioCodecAppendInputData and
+	AudioCodecProduceOutputData to work. They will return kAudioCodecStateError
+	if the codec isn't initialized.
+ 
+	AudioCodecUninitialize will return the codec to the uninitialized state and
+	release any allocated resources. The codec may then be configured freely. It is not
+	necessary to call AudioCodecUninitialize prior to closing the codec.
+ 
+	Once in the initialized state, the codec is ready to receive input and produce
+	output using the AudioCodecAppendInputData and AudioCodecProduceOutputData
+	routines. Input data can be fed into an encoder and some decoders in any size (even 
+	byte by byte). Input data fed to a decoder should be in terms of whole packets in the 
+	encoded format if the format is variable bit rate and is not self framing (e.g. MPEG 4 AAC). 
+	Output data can only be produced in whole packet sizes. Both routines will return 
+	the amount of data they consume/produce.
+ 
+	AudioCodecProduceOutputData also returns a status code to the caller that
+	indicates the result of the operation (success or failure) as well as the
+	state of the input buffer.
+	
+	The combination of AppendInputData and ProduceOutputPackets can be thought of a "push-pull"
+	model of data handling. First, the input data is pushed into the component and the 
+	resulting output data gets pulled out of that same component.
+ 
+	Basic Workflow
+	1. Find the appropriate codec component
+	2. Open the codec component
+	3. Configure it (AudioCodecGetPropertyInfo, AudioCodecGetProperty, AudioCodecSetProperty)
+	4. AudioCodecInitialize
+	5. Loop
+		a. AppendInputData (EOF is signaled by passing a 0-sized buffer)
+		b. ProduceOutputPackets
+	6. Close the codec component
+	
+ }
+
+//=============================================================================
+
+
+//=============================================================================
+//#pragma mark Types specific to AudioCodecs
+//=============================================================================
+
+
+type
+	AudioCodec = AudioComponentInstance;
+	AudioCodecPropertyID = UInt32;
+
+{!
+    @struct AudioCodecMagicCookieInfo
+ 
+	@abstract Structure holding the <em>magic cookie</em> information.
+ 
+	@discussion Passed as input to AudioCodecGetProperty for kAudioCodecPropertyFormatList.
+				The first four + sizeof(void *) bytes of the buffer pointed at by outPropertyData
+				will contain this struct.
+ 
+	@field mMagicCookieSize
+        The size of the magic cookie
+	@field mMagicCookie
+        Generic const pointer to magic cookie
+}
+type
+	AudioCodecMagicCookieInfo = record
+		mMagicCookieSize: UInt32;
+		mMagicCookie: (*const*) UnivPtr;
+	end;
+	AudioCodecMagicCookieInfoPtr = ^AudioCodecMagicCookieInfo;
+	
+//=============================================================================
+//#pragma mark AudioCodec Component Constants
+//=============================================================================
+
+
+{!
+	@enum           AudioCodecComponentType
+ 
+	@discussion     Collection of audio codec component types
+ 
+	@constant		kAudioDecoderComponentType
+					A codec that translates data in some other format into linear PCM.
+					The component subtype specifies the format ID of the other format.
+	@constant		kAudioEncoderComponentType
+					A codec that translates linear PCM data into some other format
+					The component subtype specifies the format ID of the other format
+	@constant		kAudioUnityCodecComponentType
+					A codec that translates between different flavors of the same format
+					The component subtype specifies the format ID of this format.
+}
+const
+	kAudioDecoderComponentType = FourCharCode('adec');
+	kAudioEncoderComponentType = FourCharCode('aenc');
+	kAudioUnityCodecComponentType = FourCharCode('acdc');
+
+
+//=============================================================================
+//#pragma	mark Global Codec Properties
+
+//	Used with the AudioCodecXXXXPropertyXXXX family of routines.
+//	All Audio Codec properties are readable only.
+//=============================================================================
+
+{!
+	@enum		AudioCodecGlobalProperty
+
+	@discussion	These properties reflect the capabilities of the underlying codec.
+				The values of these properties are independent of the codec's internal
+				state.
+				
+				These properties can be read at any time the codec is open.
+
+	@constant	kAudioCodecPropertyNameCFString
+					The name of the codec component as a CFStringRef. The CFStringRef
+					retrieved via this property must be released by the caller.
+	@constant	kAudioCodecPropertyManufacturerCFString
+					The manufacturer of the codec as a CFStringRef. The CFStringRef 
+					retrieved via this property must be released by the caller.
+	@constant	kAudioCodecPropertyFormatCFString
+					The name of the codec's format as a CFStringRef. The CFStringRef
+					retrieved via this property must be released by the caller.
+	@constant	kAudioCodecPropertySupportedInputFormats
+					An array of AudioStreamBasicDescription structs describing what formats 
+					the codec supports for input data
+	@constant	kAudioCodecPropertySupportedOutputFormats
+					An array of AudioStreamBasicDescription structs describing what formats 
+					the codec supports for output data
+ 	@constant	kAudioCodecPropertyAvailableInputSampleRates
+					An array of AudioValueRange indicating the valid ranges for the
+					input sample rate of the codec.
+					Required for encoders.
+					(see also kAudioCodecPropertyApplicableInputSampleRates)
+	@constant	kAudioCodecPropertyAvailableOutputSampleRates
+					An array of AudioValueRange indicating the valid ranges for the
+					output sample rate of the codec.
+					Required for encoders.
+					(see also kAudioCodecPropertyApplicableOutputSampleRates)
+	@constant	kAudioCodecPropertyAvailableBitRateRange
+					An array of AudioValueRange that indicate the target bit rates
+					supported by the encoder. This can be total bit rate or bit
+					rate per channel as appropriate. 
+					This property is only relevant to encoders.
+					(see also kAudioCodecPropertyApplicableBitRateRange)
+	@constant	kAudioCodecPropertyMinimumNumberInputPackets
+					A UInt32 indicating the minimum number of input packets
+					that need to be supplied to the codec. The actual input the
+					codec accepts could be less than this.
+					For most codecs this value will be 1.
+	@constant	kAudioCodecPropertyMinimumNumberOutputPackets
+					A UInt32 indicating the minimum number of output packets
+					that need to be handled from the codec. The actual output
+					might be less than this.
+					For most codecs this value will be 1.
+	@constant	kAudioCodecPropertyAvailableNumberChannels
+					An array of UInt32 that specifies the number of channels the codec is
+					capable of encoding or decoding to. 0xFFFFFFFF means any number
+					of channels.
+	@constant	kAudioCodecPropertyDoesSampleRateConversion
+					A UInt32 indicating if the codec wants to do a sample rate conversion (if 
+					necessary) because it can do it in a way that is meaningful for quality.
+					Value is 1 if true, 0 otherwise.
+	@constant	kAudioCodecPropertyAvailableInputChannelLayoutTags
+					An array of AudioChannelLayoutTag that specifies what channel layouts the codec is
+					capable of using on input.
+	@constant	kAudioCodecPropertyAvailableOutputChannelLayoutTags
+					An array of AudioChannelLayoutTag that specifies what channel layouts the codec is
+					capable of using on output.
+	@constant	kAudioCodecPropertyInputFormatsForOutputFormat
+					An array of AudioStreamBasicDescription indicating what the codec supports
+					for input data given an output format that's passed in as the first member of
+					the array (and is overwritten on the reply). Always a subset of 
+					kAudioCodecPropertySupportedInputFormats
+	@constant	kAudioCodecPropertyOutputFormatsForInputFormat
+					An array of AudioStreamBasicDescription indicating what the codec supports
+					for output data given an input format that's passed in as the first member of
+					the array (and is overwritten on the reply). Always a subset of 
+					kAudioCodecPropertySupportedOutputFormats
+	@constant	kAudioCodecPropertyFormatInfo
+					Takes an AudioFormatInfo on input. This AudioformatInfo is validated either through
+					the provided magic cookie or the AudioStreamBasicDescription and where applicable,
+					wildcards are overwritten with default values.
+}
+const
+	kAudioCodecPropertyNameCFString = FourCharCode('lnam');
+	kAudioCodecPropertyManufacturerCFString = FourCharCode('lmak');
+	kAudioCodecPropertyFormatCFString = FourCharCode('lfor');
+	kAudioCodecPropertyHasVariablePacketByteSizes = FourCharCode('vpk?');
+	kAudioCodecPropertySupportedInputFormats = FourCharCode('ifm#');
+	kAudioCodecPropertySupportedOutputFormats = FourCharCode('ofm#');
+	kAudioCodecPropertyAvailableInputSampleRates = FourCharCode('aisr');
+	kAudioCodecPropertyAvailableOutputSampleRates = FourCharCode('aosr');
+	kAudioCodecPropertyAvailableBitRateRange = FourCharCode('abrt');
+	kAudioCodecPropertyMinimumNumberInputPackets = FourCharCode('mnip');
+	kAudioCodecPropertyMinimumNumberOutputPackets = FourCharCode('mnop');
+	kAudioCodecPropertyAvailableNumberChannels = FourCharCode('cmnc');
+	kAudioCodecPropertyDoesSampleRateConversion = FourCharCode('lmrc');
+	kAudioCodecPropertyAvailableInputChannelLayoutTags = FourCharCode('aicl');
+	kAudioCodecPropertyAvailableOutputChannelLayoutTags = FourCharCode('aocl');
+	kAudioCodecPropertyInputFormatsForOutputFormat = FourCharCode('if4o');
+	kAudioCodecPropertyOutputFormatsForInputFormat = FourCharCode('of4i');
+	kAudioCodecPropertyFormatInfo = FourCharCode('acfi');
+
+//=============================================================================
+//#pragma	mark Instance Codec Properties
+
+//	Used with the AudioCodecXXXXPropertyXXXX family of routines.
+//=============================================================================
+
+{!
+	@enum			AudioCodecInstanceProperty
+ 
+	@discussion		Properties which can be set or read on an instance of the
+					underlying audio codec. These properties are dependent on the 
+					codec's current state. A property may be read/write or read
+					only, depending on the data format of the codec.
+					
+					These properties may have different values depending on whether the
+					codec is initialized or not. All properties can be read at any time
+					the codec is open. However, to ensure the codec is in a valid 
+					operational state and therefore the property value is valid the codec
+					must be initialized at the time the property is read.
+					
+					Properties that are writable are only writable when the codec
+					is not initialized.
+ 
+	@constant		kAudioCodecPropertyInputBufferSize
+						A UInt32 indicating the maximum input buffer size for the codec
+						in bytes. 
+						Not writable, but can vary on some codecs depending on the bit stream 
+						format being handled.
+	@constant		kAudioCodecPropertyPacketFrameSize
+						A UInt32 indicating the number of frames of audio data encapsulated in each
+						packet of data in the codec's format. For encoders, this is the
+						output format. For decoders this is the input format.
+						Formats with variable frames per packet should return a maximum value 
+						for this property.
+						Not writable.
+	@constant		kAudioCodecPropertyHasVariablePacketByteSizes
+						A UInt32 where 0 indicates that all packets in the codec's format
+						have the same byte size (sometimes referred to as CBR codecs),
+						and 1 indicates that they vary in size (sometimes referred to as 
+						VBR codecs). The maximum size of a variable packet is up to 
+						the one indicated in kAudioCodecPropertyMaximumPacketByteSize.
+						Any codec that reports 1 for this property must be able to handle packet
+						descriptions, though it does not have to require them.
+						May be writable.
+	@constant		kAudioCodecPropertyMaximumPacketByteSize
+						A UInt32 indicating the maximum number of bytes a packet of data
+						in the codec's format will be. If the format is constant bit rate,
+						all packets will be this size. If it is variable bit rate, the packets
+						will never exceed this size.
+						This always refers to the encoded data, so for encoders it refers to the
+						output data and for decoders the input data.
+						Not writable.
+	@constant		kAudioCodecPropertyCurrentInputFormat
+						An AudioStreamBasicDescription describing the format the codec
+						expects its input data in
+						Almost always writable, but if the codec only supports one unique input format
+						it does not have to be
+	@constant		kAudioCodecPropertyCurrentOutputFormat
+						An AudioStreamBasicDescription describing the format the codec
+						provides its output data in
+						Almost always writable, but if the codec only supports one unique output format
+						it does not have to be
+	@constant		kAudioCodecPropertyMagicCookie
+						An untyped buffer of out of band configuration data the codec
+						requires to process the stream of data correctly. The contents
+						of this data is private to the codec. 
+						Not all codecs have magic cookies. If a call to AudioCodecGetPropertyInfo
+						returns a size greater than 0 then the codec may take one.
+						Writable if present.
+	@constant		kAudioCodecPropertyUsedInputBufferSize
+						A UInt32 indicating the number of bytes in the codec's input
+						buffer. The amount of available buffer space is	simply the
+						answer from kAudioCodecPropertyInputBufferSize minus the answer
+						from this property.
+						Not writable.
+	@constant		kAudioCodecPropertyIsInitialized
+						A UInt32 where 0 means the codec is uninitialized and anything
+						else means the codec is initialized. This should never be settable directly.
+						Must be set by AudioCodecInitialize and AudioCodecUnitialize.
+	@constant		kAudioCodecPropertyCurrentTargetBitRate
+						A UInt32 containing the number of bits per second to aim for when encoding
+						data. This property is usually only relevant to encoders, but if a decoder
+						can know what bit rate it's set to it may report it.
+						This property is irrelevant if the encoder is configured as kAudioCodecBitRateControlMode_Variable.
+						Writable on encoders if supported.
+	@constant		kAudioCodecPropertyCurrentInputSampleRate
+						A Float64 containing the current input sample rate in Hz. No Default.
+						May be writable. If only one sample rate is supported it does not have to be.
+	@constant		kAudioCodecPropertyCurrentOutputSampleRate
+						A Float64 containing the current output sample rate in Hz. No Default.
+						May be writable. If only one sample rate is supported it does not have to be.
+	@constant		kAudioCodecPropertyQualitySetting
+						A UInt32 that sets the tradeoff between sound quality and CPU time consumption.
+						The property value is between [0 - 0x7F].
+						Some enum constants are defined below for convenience.
+						Writable if supported.
+	@constant		kAudioCodecPropertyApplicableBitRateRange
+						An array of AudioValueRange indicating the target bit rates
+						supported by the encoder in its current configuration.
+						This property is only relevant to encoders.
+						See also kAudioCodecPropertyAvailableBitRateRange.
+						Not writable.
+	@constant		kAudioCodecPropertyApplicableInputSampleRates
+						An array of AudioValueRange indicating the valid ranges for the
+						input sample rate of the codec for the current bit rate. 
+						This property is only relevant to encoders.
+						See also kAudioCodecPropertyAvailableInputSampleRates.
+						Not writable.
+	@constant		kAudioCodecPropertyApplicableOutputSampleRates
+						An array of AudioValueRange indicating the valid ranges for the
+						output sample rate of the codec for the current bit rate. 
+						This property is only relevant to encoders.
+						See also kAudioCodecPropertyAvailableOutputSampleRates.
+						Not writable.
+	@constant		kAudioCodecPropertyPaddedZeros
+						A UInt32 indicating the number of zeros (samples) that were appended
+						to the last packet of input data to make a complete packet encoding.
+						Encoders only. No default.
+						Not writable.
+	@constant		kAudioCodecPropertyPrimeMethod
+						A UInt32 specifying priming method.
+						See enum below.
+						May be writable. Some encoders offer the option of padding out the last packet, and this 
+						may be set here.
+	@constant		kAudioCodecPropertyPrimeInfo
+						A pointer to an AudioCodecPrimeInfo struct.
+						Not writable on encoders. On decoders this may be writable, telling the decoder to trim the
+						first and/or last packet.
+	@constant		kAudioCodecPropertyCurrentInputChannelLayout
+						An AudioChannelLayout that specifies the channel layout that the codec is using for input.
+						May be writable. If only one channel layout is supported it does not have to be.
+	@constant		kAudioCodecPropertyCurrentOutputChannelLayout
+						An AudioChannelLayout that specifies the channel layout that the codec is using for output.
+						If settable on a encoder, it means the encoder can re-map channels
+						May be writable. If only one channel layout is supported or the codec does no channel remapping
+						(ie, output channel layout always equals the input channel layout) it does not have to be.
+	@constant		kAudioCodecPropertySettings
+						A CFDictionaryRef that lists both the settable codec settings and their values.
+						Encoders only.
+						Obviously this will be linked to many of the other properties listed herein and as such
+						it potentially will cause synchronization problems. Therefore, when setting this property
+						on an encoder a GetProperty should be done first to retrieve the current dictionary, 
+						and only one setting within the dictionary should change with each SetProperty call, 
+						as it is not guaranteed that changing one property will not have side effects.
+						Writable if supported.
+	@constant		kAudioCodecPropertyBitRateControlMode
+						A UInt32 indicating which bit rate control mode will be applied to encoders that 
+						can produce variable packet sizes (sometimes referred to as VBR encoders).
+						Although the packet size may be variable, a constant bit rate can be maintained 
+						over a transmission channel when decoding in real-time with a fixed end-to-end audio delay. 
+						E.g., MP3 and MPEG-AAC use a bit reservoir mechanism to meet that constraint.
+						See enum below. 
+						Only needs to be settable if the codec supports multiple bit rate control strategies.
+	@constant		kAudioCodecPropertyFormatList
+						An array of AudioFormatListItem structs list all formats that can be handled by the decoder
+						For decoders, takes a Magic Cookie that gets passed in on the GetProperty call. No default.
+						On input, the outPropertyData parameter passed to GetProperty should begin with a 
+						AudioCodecMagicCookieInfo struct which will be overwritten by the AudioFormatListItems 
+						returned from the property. For encoders, returns a list of formats which will be in the
+						bitstream. No input data required.
+						Important note: this encoder property is only applicable to audio formats which are made of
+						two or more layers where the base layers(s) can be decoded by systems which aren't capable of
+						handling the enhancement layers. For example, a High Efficiency AAC bitstream which contains 
+						an AAC Low Complexity base layer can be decoded by any AAC decoder.
+	@constant		kAudioCodecPropertySoundQualityForVBR
+						A UInt32 that sets a target sound quality level.
+						Unlike kAudioCodecPropertyQualitySetting which is relevant to all BitRate Control Modes,
+						this property only needs to be set by an encoder configured at kAudioCodecBitRateControlMode_Variable.
+						The property value is between [0 - 0x7F].
+						See also kAudioCodecPropertyQualitySetting
+						Writable if supported.
+	@constant		kAudioCodecPropertyMinimumDelayMode
+						A UInt32 equal 1 sets the encoder, where applicable, in it's lowest possible delay mode. An encoder
+						may prepend zero valued samples to the input signal in order to make additional delays, like e.g.
+						from a filter, coincide on a block boundary. This operation, however, results in an increased
+						encoding/ decoding delay which may be undesired and turned off with this property.
+						Writable if supported.
+ }
+const
+	kAudioCodecPropertyInputBufferSize = FourCharCode('tbuf');
+	kAudioCodecPropertyPacketFrameSize = FourCharCode('pakf');
+	kAudioCodecPropertyMaximumPacketByteSize = FourCharCode('pakb');
+	kAudioCodecPropertyCurrentInputFormat = FourCharCode('ifmt');
+	kAudioCodecPropertyCurrentOutputFormat = FourCharCode('ofmt');
+	kAudioCodecPropertyMagicCookie = FourCharCode('kuki');
+	kAudioCodecPropertyUsedInputBufferSize = FourCharCode('ubuf');
+	kAudioCodecPropertyIsInitialized = FourCharCode('init');
+	kAudioCodecPropertyCurrentTargetBitRate = FourCharCode('brat');
+	kAudioCodecPropertyCurrentInputSampleRate = FourCharCode('cisr');
+	kAudioCodecPropertyCurrentOutputSampleRate = FourCharCode('cosr');
+	kAudioCodecPropertyQualitySetting = FourCharCode('srcq');
+	kAudioCodecPropertyApplicableBitRateRange = FourCharCode('brta');
+	kAudioCodecPropertyApplicableInputSampleRates = FourCharCode('isra');
+	kAudioCodecPropertyApplicableOutputSampleRates = FourCharCode('osra');
+	kAudioCodecPropertyPaddedZeros = FourCharCode('pad0');
+	kAudioCodecPropertyPrimeMethod = FourCharCode('prmm');
+	kAudioCodecPropertyPrimeInfo = FourCharCode('prim');
+	kAudioCodecPropertyCurrentInputChannelLayout = FourCharCode('icl ');
+	kAudioCodecPropertyCurrentOutputChannelLayout = FourCharCode('ocl ');
+	kAudioCodecPropertySettings = FourCharCode('acs ');
+	kAudioCodecPropertyFormatList = FourCharCode('acfl');
+	kAudioCodecPropertyBitRateControlMode = FourCharCode('acbf');
+	kAudioCodecPropertySoundQualityForVBR = FourCharCode('vbrq');
+	kAudioCodecPropertyMinimumDelayMode = FourCharCode('mdel');
+
+
+{!
+	@enum			AudioCodecQuality
+ 
+	@discussion		Constants to be used with kAudioCodecPropertyQualitySetting
+ 
+	@constant		kAudioCodecQuality_Max
+	@constant		kAudioCodecQuality_High
+	@constant		kAudioCodecQuality_Medium
+	@constant		kAudioCodecQuality_Low
+	@constant		kAudioCodecQuality_Min
+}
+const
+	kAudioCodecQuality_Max = $7F;
+	kAudioCodecQuality_High = $60;
+	kAudioCodecQuality_Medium = $40;
+	kAudioCodecQuality_Low = $20;
+	kAudioCodecQuality_Min = 0;
+
+
+{!
+	@enum			AudioCodecPrimeMethod
+ 
+	@discussion		Constants to be used with kAudioCodecPropertyPrimeMethod.
+ 
+	@constant		kAudioCodecPrimeMethod_Pre
+						Primes with leading and trailing input frames
+	@constant		kAudioCodecPrimeMethod_Normal
+						Only primes with trailing (zero latency)
+						leading frames are assumed to be silence
+	@constant		kAudioCodecPrimeMethod_None
+						Acts in "latency" mode
+						both leading and trailing frames assumed to be silence
+}
+const
+	kAudioCodecPrimeMethod_Pre = 0;
+	kAudioCodecPrimeMethod_Normal = 1;
+	kAudioCodecPrimeMethod_None = 2;
+
+
+{!
+	@enum			kAudioCodecPropertyBitRateControlMode
+ 
+	@discussion		Constants defining various bit rate control modes
+					to be used with kAudioCodecPropertyBitRateControlMode.
+					These modes are only applicable to encoders that can produce
+					variable packet sizes, such as AAC.
+
+	@constant		kAudioCodecBitRateControlMode_Constant
+						The encoder maintains a constant bit rate suitable for use over a transmission 
+						channel when decoding in real-time with a fixed end-to-end audio delay.  
+						Note that while a constant bit rate is maintained in this mode, the number of bits 
+						allocated to encode each fixed length of audio data may be variable 
+						(ie. packet sizes are variable).
+						E.g., MP3 and MPEG-AAC use a bit reservoir mechanism to meet that constraint.
+	@constant		kAudioCodecBitRateControlMode_LongTermAverage
+						 The provided target bit rate is achieved over a long term average
+						 (typically after the first 1000 packets). This mode is similar to 
+						 kAudioCodecBitRateControlMode_Constant in the sense that the 
+						 target bit rate will be maintained in a long term average. However, it does not 
+						 provide constant delay when using constant bit rate transmission. This mode offers 
+						 a better sound quality than kAudioCodecBitRateControlMode_Constant 
+						 can, that is, a more efficient encoding is performed. 
+	@constant		kAudioCodecBitRateControlMode_VariableConstrained
+						Encoder dynamically allocates the bit resources according to the characteristics
+						of the underlying signal. However, some constraints are applied in order to limit 
+						the variation of the bit rate.
+	@constant		kAudioCodecBitRateControlMode_Variable
+						Similar to the VBR constrained mode, however the packet size is virtually unconstrained.
+						The coding process targets constant sound quality, and the sound quality level is 
+						set by kAudioCodecPropertySoundQualityForVBR.
+						This mode usually provides the best tradeoff between quality and bit rate.
+}
+const
+	kAudioCodecBitRateControlMode_Constant = 0;
+	kAudioCodecBitRateControlMode_LongTermAverage = 1;
+	kAudioCodecBitRateControlMode_VariableConstrained = 2;
+	kAudioCodecBitRateControlMode_Variable = 3;
+
+{!
+	@struct			AudioCodecPrimeInfo 
+ 
+	@discussion		Specifies the number of leading and trailing empty frames
+					which have to be inserted.
+ 
+	@field			leadingFrames
+						An unsigned integer specifying the number of leading empty frames
+	@field			trailingFrames
+						An unsigned integer specifying the number of trailing empty frames 
+}
+type
+	AudioCodecPrimeInfo = record
+		leadingFrames: UInt32;
+		trailingFrames: UInt32;
+	end;
+	AudioCodecPrimeInfoPtr = ^AudioCodecPrimeInfo;
+	
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Constants for kAudioCodecPropertySettings
+//=============================================================================
+
+const
+	kAudioSettings_TopLevelKey = 'name';
+const
+	kAudioSettings_Version = 'version';
+const
+	kAudioSettings_Parameters = 'parameters';
+const
+	kAudioSettings_SettingKey = 'key';
+const
+	kAudioSettings_SettingName = 'name';
+const
+	kAudioSettings_ValueType = 'value type';
+const
+	kAudioSettings_AvailableValues = 'available values';
+const
+	kAudioSettings_LimitedValues = 'limited values';
+const
+	kAudioSettings_CurrentValue = 'current value';
+const
+	kAudioSettings_Summary = 'summary';
+const
+	kAudioSettings_Hint = 'hint';
+const
+	kAudioSettings_Unit = 'unit';
+
+
+{!
+	@enum			AudioSettingsFlag
+ 
+	@discussion		Constants to be used with kAudioSettings_Hint
+					in the kAudioCodecPropertySettings property dictionary.
+					Indicates any special characteristics of each parameter within the dictionary, 
+
+	@constant		kAudioSettingsFlags_ExpertParameter
+						If set, then the parameter is an expert parameter.
+	@constant		kAudioSettingsFlags_InvisibleParameter
+						If set, then the parameter should not be displayed. 
+	@constant		kAudioSettingsFlags_MetaParameter
+						If set, then changing this parameter may affect the values of other parameters. 
+						If not set, then this parameter can be set without affecting the values of other parameters.
+	@constant		kAudioSettingsFlags_UserInterfaceParameter
+						If set, then this is only a user interface element and not reflected in the codec's bit stream.
+}
+const
+	kAudioSettingsFlags_ExpertParameter = 1 shl 0;
+	kAudioSettingsFlags_InvisibleParameter = 1 shl 1;
+	kAudioSettingsFlags_MetaParameter = 1 shl 2;
+	kAudioSettingsFlags_UserInterfaceParameter = 1 shl 3;
+
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Status values returned from the AudioCodecProduceOutputPackets routine
+//=============================================================================
+{!
+	@enum			AudioCodecProduceOutputPacketStatus
+ 
+	@discussion		Possible return status
+ 
+	@constant		kAudioCodecProduceOutputPacketFailure
+						Couldn't complete the request due to an error. It is possible
+						that some output data was produced. This is reflected in the value
+						returned in ioNumberPackets. 
+	@constant		kAudioCodecProduceOutputPacketSuccess
+						The number of requested output packets was produced without incident
+						and there isn't any more input data to process
+	@constant		kAudioCodecProduceOutputPacketSuccessHasMore
+						The number of requested output packets was produced and there is
+						enough input data to produce at least one more packet of output data
+	@constant		kAudioCodecProduceOutputPacketNeedsMoreInputData
+						There was insufficient input data to produce the requested
+						number of output packets, The value returned in ioNumberPackets
+						holds the number of output packets produced.
+	@constant		kAudioCodecProduceOutputPacketAtEOF
+						The end-of-file marker was hit during the processing. Fewer
+						than the requested number of output packets may have been
+						produced. Check the value returned in ioNumberPackets for the
+						actual number produced. Note that not all formats have EOF
+						markers in them. 
+}
+const
+	kAudioCodecProduceOutputPacketFailure = 1;
+	kAudioCodecProduceOutputPacketSuccess = 2;
+	kAudioCodecProduceOutputPacketSuccessHasMore = 3;
+	kAudioCodecProduceOutputPacketNeedsMoreInputData = 4;
+	kAudioCodecProduceOutputPacketAtEOF = 5;
+
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Selectors for the component routines (preliminary)
+//=============================================================================
+{!
+	@enum			AudioCodecSelectors
+ 
+	@discussion		Allows selection of component routines supported the the AudioCodec API
+					Used by the Component Manager.
+ 
+	@constant		kAudioCodecGetPropertyInfoSelect
+	@constant		kAudioCodecGetPropertySelect
+	@constant		kAudioCodecSetPropertySelect
+	@constant		kAudioCodecInitializeSelect
+	@constant		kAudioCodecUninitializeSelect
+	@constant		kAudioCodecAppendInputDataSelect
+	@constant		kAudioCodecProduceOutputDataSelect
+	@constant		kAudioCodecResetSelect
+}
+const
+	kAudioCodecGetPropertyInfoSelect = $0001;
+	kAudioCodecGetPropertySelect = $0002;
+	kAudioCodecSetPropertySelect = $0003;
+	kAudioCodecInitializeSelect = $0004;
+	kAudioCodecUninitializeSelect = $0005;
+	kAudioCodecAppendInputDataSelect = $0006;
+	kAudioCodecProduceOutputDataSelect = $0007;
+	kAudioCodecResetSelect = $0008;
+
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Errors
+//=============================================================================
+{!
+	@enum			AudioCodecErrors
+ 
+	@discussion		Possible errors returned by audio codec components
+ 
+	@constant		kAudioCodecNoError
+	@constant		kAudioCodecUnspecifiedError
+	@constant		kAudioCodecUnknownPropertyError
+	@constant		kAudioCodecBadPropertySizeError
+	@constant		kAudioCodecIllegalOperationError
+	@constant		kAudioCodecUnsupportedFormatError
+	@constant		kAudioCodecStateError
+	@constant		kAudioCodecNotEnoughBufferSpaceError
+}
+const
+	kAudioCodecNoError = 0;
+	kAudioCodecUnspecifiedError = FourCharCode('what');
+	kAudioCodecUnknownPropertyError = FourCharCode('who?');
+	kAudioCodecBadPropertySizeError = FourCharCode('!siz');
+	kAudioCodecIllegalOperationError = FourCharCode('nope');
+	kAudioCodecUnsupportedFormatError = FourCharCode('!dat');
+	kAudioCodecStateError = FourCharCode('!stt');
+	kAudioCodecNotEnoughBufferSpaceError = FourCharCode('!buf');
+
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Codec Property Management
+//=============================================================================
+
+{!
+	@function		AudioCodecGetPropertyInfo
+ 
+	@discussion		Retrieve information about the given property. The outSize argument
+					will return the size in bytes of the current value of the property.
+					The outWritable argument will return whether or not the property
+					in question can be changed.
+ 
+	@param			inCodec
+						An AudioCodec instance
+	@param			inPropertyID
+						Property ID whose value should be read
+	@param			outSize
+						Size in bytes of the property
+	@param			outWritable
+						Flag indicating wether the underlying property can be modified or not 
+ 
+	@result			The OSStatus value
+}
+function AudioCodecGetPropertyInfo( inCodec: AudioCodec; inPropertyID: AudioCodecPropertyID; var outSize: UInt32; var outWritable: Boolean ): OSStatus; external name '_AudioCodecGetPropertyInfo';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioCodecGetProperty
+ 
+	@discussion		Retrieve the indicated property data. On input, ioDataSize has the size
+					of the data pointed to by outPropertyData. On output, ioDataSize will contain
+					the amount written.
+ 
+	@param			inCodec
+						An AudioCodec instance
+	@param			inPropertyID
+						Property ID whose value should be read
+	@param			ioPropertyDataSize
+						Size in bytes of the property data
+	@param			outPropertyData
+						Pointer to the property data buffer
+
+	@result			The OSStatus value
+}
+function AudioCodecGetProperty( inCodec: AudioCodec; inPropertyID: AudioCodecPropertyID; var ioPropertyDataSize: UInt32; outPropertyData: UnivPtr ): OSStatus; external name '_AudioCodecGetProperty';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioCodecSetProperty
+
+	@discussion		Set the indicated property data.
+ 
+	@param			inCodec
+						An AudioCodec instance
+	@param			inPropertyID
+						Property ID whose value should be changed
+	@param			inPropertyDataSize
+						Size in bytes of the property data
+	@param			inPropertyData
+						Pointer to the property data buffer
+ 
+	@result			The OSStatus value
+}
+function AudioCodecSetProperty( inCodec: AudioCodec; inPropertyID: AudioCodecPropertyID; inPropertyDataSize: UInt32; inPropertyData: {const} UnivPtr ): OSStatus; external name '_AudioCodecSetProperty';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+//=============================================================================
+//#pragma mark -
+//#pragma mark Codec Data Handling Routines
+//=============================================================================
+
+{!
+	@function		AudioCodecInitialize
+ 
+	@discussion		This call will allocate any buffers needed and otherwise set the codec
+					up to perform the indicated translation. If an argument is NULL, any
+					previously set properties will be used for preparing the codec for work.
+					Note that this routine will also validate the format information as useable.
+ 
+	@param			inCodec
+						An AudioCodec instance
+	@param			inInputFormat
+						Pointer to an input format structure
+	@param			inInputFormat
+						Pointer to an output format structure
+	@param			inMagicCookie
+						Pointer to the magic cookie
+	@param			inMagicCookieByteSize
+						Size in bytes of the magic cookie
+  
+	@result			The OSStatus value
+}
+function AudioCodecInitialize( inCodec: AudioCodec; const (*var*) inInputFormat: AudioStreamBasicDescription; const (*var*) inOutputFormat: AudioStreamBasicDescription; inMagicCookie: {const} UnivPtr; inMagicCookieByteSize: UInt32 ): OSStatus; external name '_AudioCodecInitialize';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioCodecUninitialize
+  
+	@discussion		This call will move the codec from the initialized state back to the
+					uninitialized state. The codec will release any resources it allocated
+					or claimed in AudioCodecInitialize.
+ 
+	@param			inCodec
+						An AudioCodec instance
+ 
+	@result			The OSStatus value
+}
+function AudioCodecUninitialize( inCodec: AudioCodec ): OSStatus; external name '_AudioCodecUninitialize';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioCodecAppendInputData
+ 
+	@discussion		Append as much of the given data in inInputData to the codec's input buffer as possible
+					and return in ioInputDataByteSize the amount of data used.
+ 
+					The inPacketDescription argument is an array of AudioStreamPacketDescription
+					structs that describes the packet layout. The number of elements in this array
+					is indicated on input by ioNumberPackets. On return, this number indicates the number
+					of packets consumed.
+ 
+					Note also in this case that it is an error to supply less than a full packet
+					of data at a time.
+ 
+	@param			inCodec
+						An AudioCodec instance
+	@param			inInputData
+						A const pointer to the input data
+	@param			ioInputDataByteSize
+						The size in bytes of the input data in inInputData on input,
+						the number of bytes consumed on output
+	@param			ioNumberPackets
+						The number of packets
+	@param			inPacketDescription
+						The packet description pointer
+ 
+	@result			The OSStatus value
+}
+function AudioCodecAppendInputData( inCodec: AudioCodec; inInputData: {const} UnivPtr; var ioInputDataByteSize: UInt32; var ioNumberPackets: UInt32; const (*var*) inPacketDescription: AudioStreamPacketDescription ): OSStatus; external name '_AudioCodecAppendInputData';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+{!
+	@function		AudioCodecProduceOutputPackets
+
+	@discussion		Produce as many output packets as requested and the amount of input data
+					allows for. The outStatus argument returns information about the codec's
+					status to allow for proper data management. See the constants above for
+					the possible values that can be returned.
+ 
+					The outPacketDescription argument is an array of AudioStreamPacketDescription
+					structs that describes the packet layout returned in outOutputData. This
+					argument is optional. Pass NULL if this information is not to be returned.
+					Note that this information is only provided when the output format isn't
+					linear PCM.
+
+					Note that decoders will always only produce linear PCM data in multiples of
+					the number frames in a packet of the encoded format (as returned by
+					kAudioCodecPropertyPacketFrameSize). Encoders will consume this many frames
+					of linear PCM data to produce a packet of their format.
+ 
+	@param			inCodec
+						The AudioCodec instance
+	@param			outOutputData
+						Pointer to the output data buffer
+	@param			ioOutputDataByteSize
+						A pointer to the size
+	@param			ioNumberPackets
+						number of input/output packets
+	@result			The OSStatus value
+}
+function AudioCodecProduceOutputPackets( inCodec: AudioCodec; outOutputData: UnivPtr; var ioOutputDataByteSize: UInt32; var ioNumberPackets: UInt32; var outPacketDescription: AudioStreamPacketDescription; var outStatus: UInt32 ): OSStatus; external name '_AudioCodecProduceOutputPackets';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+{!
+	@function		AudioCodecReset
+
+	@discussion		Flushes all the data in the codec and clears the input buffer. Note that
+					the formats, and magic cookie will be retained so they won't need to be
+					set up again to decode the same data.
+ 
+	@param			inCodec The audio codec descriptor
+ 
+	@result			the OSStatus value
+}
+function AudioCodecReset( inCodec: AudioCodec ): OSStatus; external name '_AudioCodecReset';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
+
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Deprecated Properties
+
+
+{!
+	@enum		AudioCodecProperty
+	@deprecated	in version 10.5
+ 
+	@constant	kAudioCodecPropertyRequiresPacketDescription
+					A UInt32 where a non-zero value indicates that the format the codec implements
+					requires that an AudioStreamPacketDescription array must be supplied with any data
+					in that format. Note that this implies that data must also be handled strictly in
+					packets. For a decoder, this applies to input data. For an encoder, it applies to
+					output data, which means that the encoder will be filling out provided packet descriptions
+					on output.
+					A decoder must be able to handle packet descriptions even if it does not require them.
+					An encoder does not have to fill out packet descriptions if it does not require them.
+					Redundant due to kAudioCodecPropertyHasVariablePacketByteSizes. Codecs with variable-sized 
+					packets must handle packet descriptions while codecs with constant-sized packets do not 
+					have to.
+	@constant	kAudioCodecPropertyAvailableBitRates
+					An array of UInt32 that indicates the target bit rates
+					supported by the encoder. This property is only relevant to
+					encoders. Replaced with kAudioCodecPropertyAvailableBitRateRange
+	@constant	kAudioCodecExtendFrequencies
+					A UInt32 indicating whether an encoder should extend its cutoff frequency
+					if such an option exists. 0 == extended frequencies off, 1 == extended frequencies on
+					e.g. some encoders normally cut off the signal at 16 kHz but can encode up to 20 kHz if 
+					asked to.
+					Redundant.
+	@constant	kAudioCodecUseRecommendedSampleRate
+					For encoders that do sample rate conversion, a UInt32 indicating whether or
+					not the encoder is using the recommended sample rate for the given input. 
+					A value of 0 indicates it isn't, 1 indicates it is.
+					This property is read only and indicates whether or not a user has explicitly set an output 
+					sample rate.
+					Redundant as 0.0 for a sample rate means let the codec decide.
+	@constant	kAudioCodecOutputPrecedence
+					For encoders that do sample rate conversion, a UInt32 indicating whether the
+					bit rate, sample rate, or neither have precedence over the other. See enum below.
+					Redundant because precedence is implicitly set by either providing a non-zero bit rate or 
+					sample rate and setting the other to zero (which allows the encoder to choose any applicable rate). 
+					If both values are set to non-zero, neither value has precedence.
+	@constant	kAudioCodecDoesSampleRateConversion
+					Renamed to kAudioCodecPropertyDoesSampleRateConversion
+	@constant	kAudioCodecBitRateFormat
+					Renamed to kAudioCodecPropertyBitRateControlMode
+	@constant	kAudioCodecInputFormatsForOutputFormat
+					Renamed to kAudioCodecPropertyInputFormatsForOutputFormat
+	@constant	kAudioCodecOutputFormatsForInputFormat
+					Renamed to kAudioCodecPropertyOutputFormatsForInputFormat
+	@constant	kAudioCodecPropertyInputChannelLayout
+					Renamed to kAudioCodecPropertyCurrentInputChannelLayout
+	@constant	kAudioCodecPropertyOutputChannelLayout
+					Renamed to kAudioCodecPropertyCurrentOutputChannelLayout
+	@constant	kAudioCodecPropertyZeroFramesPadded
+					Renamed to kAudioCodecPropertyPaddedZeros
+ }
+const
+	kAudioCodecPropertyRequiresPacketDescription = FourCharCode('pakd');
+	kAudioCodecPropertyAvailableBitRates = FourCharCode('brt#');
+	kAudioCodecExtendFrequencies = FourCharCode('acef');
+	kAudioCodecUseRecommendedSampleRate = FourCharCode('ursr');
+	kAudioCodecOutputPrecedence = FourCharCode('oppr');
+	kAudioCodecBitRateFormat = kAudioCodecPropertyBitRateControlMode;
+	kAudioCodecDoesSampleRateConversion = kAudioCodecPropertyDoesSampleRateConversion;
+	kAudioCodecInputFormatsForOutputFormat = kAudioCodecPropertyInputFormatsForOutputFormat;
+	kAudioCodecOutputFormatsForInputFormat = kAudioCodecPropertyOutputFormatsForInputFormat;
+	kAudioCodecPropertyInputChannelLayout = kAudioCodecPropertyCurrentInputChannelLayout;
+	kAudioCodecPropertyOutputChannelLayout = kAudioCodecPropertyCurrentOutputChannelLayout;
+	kAudioCodecPropertyAvailableInputChannelLayouts = kAudioCodecPropertyAvailableInputChannelLayoutTags;
+	kAudioCodecPropertyAvailableOutputChannelLayouts = kAudioCodecPropertyAvailableOutputChannelLayoutTags;
+	kAudioCodecPropertyZeroFramesPadded = kAudioCodecPropertyPaddedZeros;
+
+{!
+	@enum		AudioCodecBitRateFormat
+
+	@deprecated	in version 10.5
+
+	@discussion	Constants to be used with kAudioCodecBitRateFormat.
+					This is deprecated. 
+					Use kAudioCodecVariablePacketSizeBitRateControlMode instead.
+ 
+	@constant	kAudioCodecBitRateFormat_CBR is mapped to kAudioCodecBitRateControlMode_Constant
+	@constant	kAudioCodecBitRateFormat_ABR is mapped to kAudioCodecBitRateControlMode_LongTermAverage
+	@constant	kAudioCodecBitRateFormat_VBR is mapped to kAudioCodecBitRateControlMode_VariableConstrained
+ }
+const
+	kAudioCodecBitRateFormat_CBR = kAudioCodecBitRateControlMode_Constant;
+	kAudioCodecBitRateFormat_ABR = kAudioCodecBitRateControlMode_LongTermAverage;
+	kAudioCodecBitRateFormat_VBR = kAudioCodecBitRateControlMode_VariableConstrained;
+
+{!
+	@enum		AudioCodecOutputPrecedence
+
+	@deprecated	in version 10.5
+
+	@discussion	Constants to be used with kAudioCodecOutputPrecedence
+ 
+	@constant	kAudioCodecOutputPrecedenceNone
+					Change in the bit rate or the sample rate are constrained by
+					the other value.
+	@constant	kAudioCodecOutputPrecedenceBitRate
+					The bit rate may be changed freely,
+					adjusting the sample rate if necessary
+	@constant	kAudioCodecOutputPrecedenceSampleRate
+					The sample rate may be changed freely,
+					adjusting the bit rate if necessary
+ }
+const
+	kAudioCodecOutputPrecedenceNone = 0;
+	kAudioCodecOutputPrecedenceBitRate = 1;
+	kAudioCodecOutputPrecedenceSampleRate = 2;
+
+{!
+	@typedef	MagicCookieInfo
+ 
+	@deprecated	in version 10.5
+ 
+	@discussion	renamed to AudioCodecMagicCookieInfo 
+ }
+type
+	MagicCookieInfo = AudioCodecMagicCookieInfo;
+
+{!
+	@enum		AudioCodecSettingsHint
+ 
+	@deprecated	in version 10.4
+ 
+	@discussion	Constants to be used with kAudioSettings_Hint.
+				This is deprecated.
+				Use	AudioSettingsFlag instead.
+ 
+	@constant	kHintBasic
+	@constant	kHintAdvanced
+	@constant	kHintHidden
+ }
+const
+	kHintBasic = 0;
+	kHintAdvanced = 1;
+	kHintHidden = 2;
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 412 - 0
packages/univint/src/AudioComponents.pas

@@ -0,0 +1,412 @@
+{
+     File:      AudioUnit/AudioComponent.h
+ 
+     Contains:  API for finding and opening audio components
+  
+     Copyright: (c) 2007 - 2008 by Apple Inc., all rights reserved.
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioComponents;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,CoreAudioTypes,Components,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
+
+//=====================================================================================================================
+////#pragma mark Overview
+
+{!
+    @header AudioComponent
+
+	@discussion
+	This file defines a collection of APIs that are designed to be used when finding and opening audio components
+	(such as audio units, audio codecs, audio file components).
+	
+	Traditionally, the ComponentManager has been used for the registration, discovery, and packaging of these loadable
+	code modules. However, this may not always be the case. In order to provide an API that will be supported going forward
+	from SnowLeopard (10.6) and iPhone 2.0, it is advised that applications use the AudioComponent APIs to find and load(open)
+	audio components such as audio units. 
+	
+	The type "AudioComponent" or "AudioComponentInstance" should be seen and used as a distinct type from the Component Manager
+	types of "Component" and "ComponentInstance". It is not the case that it is safe to assume a direct cast is compatible between
+	this type and the other.
+	
+	The AudioComponent APIs provide a general, and mostly complete service for doing the basic task of finding and using audio components. 
+	If however, you find that you need functionality that is not provided by this API that was previously supported by the ComponentMgr then
+	you should use the ComponentMgr APIs exclusively to find and open the Component Mgr components. In other words, you should not assume that
+	an audio component instance is always interchangeable with the existing Component Instance type.
+}
+
+
+//=====================================================================================================================
+//#pragma mark Data Types
+
+{!
+	@struct			AudioComponentDescription
+	@discussion		A structure used to describe the unique and identifying IDs of an audio component 
+	@field			componentType
+						A unique 4-byte code indentifying the generic type of an audio component
+	@field			componentSubType
+						the particular flavor of this instance
+	@field			componentManufacturer
+						vendor identification
+	@field			componentFlags
+						must be set to zero unless a known specific value is requested
+	@field			componentFlagsMask
+						must be set to zero unless a known specific value is requested
+}
+//#pragma pack(push, 4)
+
+type
+	AudioComponentDescription = record
+		componentType: OSType;
+		componentSubType: OSType;
+		componentManufacturer: OSType;
+		componentFlags: UInt32;
+		componentFlagsMask: UInt32;
+	end;
+	AudioComponentDescriptionPtr = ^AudioComponentDescription;
+//#pragma pack(pop)
+
+
+{!
+	@typedef		AudioComponent
+	@abstract		The type used to represent a class of particular audio components
+	@discussion		An audio component is usually found through a search and is then uniquely identified by the triple of
+					an audio component's type, subtype and manufacturer. 
+					
+					It can have properties associated with it (such as a name, a version).
+					
+					It is then used as a factory (like a class in an OO language) from which to create particular instances. The
+					instances are used to do the actualy work.
+					
+					For example:
+					'aufx', 'dely', 'appl' describes the digital delay, audio unit effect from Apple Inc. You can find this component
+					through searching explicitly for the audio component that matches this pattern (this is an unique identifier - there is
+					only one match to this triple ID). Then once found, the Apple delay effect audio unit can be created from its audio component
+					and used to apply that effect to an audio signal. While the audio component is a singleton, you can of course create as many
+					instances of a given audio component that you need to do the work you need to do.
+}
+type
+	AudioComponent = ^SInt32; { an opaque type }
+
+{!
+	@typedef		AudioComponentInstance
+	@abstract		The type used to represent an instance of a particular audio component
+	@discussion		An audio component instance is created from its factory/producer audio component. It is the body of code that does the work.
+	
+					A special note: While on the desktop this is typedef'd to a ComponentInstanceRecord *, you should not always assume that this
+					will always be compatible and usable with ComponentMgr calls. 
+}
+//#if TARGET_OS_IPHONE
+{$ifc TARGET_OS_IPHONE}
+type
+	AudioComponentInstance = ^SInt32; { an opaque type }
+//#else
+{$elsec}
+type
+	AudioComponentInstance = ComponentInstanceRecordPtr;
+//#endif
+{$endc}
+
+
+//=====================================================================================================================
+//#pragma mark Functions
+
+
+{!
+    @function       AudioComponentFindNext
+    @abstract       find an audio component
+    @discussion     This function is used to find an audio component that is the closest match to the provide values.
+    @param          inComponent
+						If NULL, then the search starts from the beginning until an audio component is found that matches
+						the description provided by inDesc
+						If not-NULL, then the search starts (continues) from the previously found audio component specified
+						by inComponent, and will return the nextfound audio component
+	@param			inDesc
+						The type, subtype and manufacturer fields are used to specify the audio component to search for.
+						A value of 0 (zero) for any of these fiels is a wildcard, so the first match found is returned
+	@result			An audio component that matches the search parameters, or NULL if none found
+}
+function AudioComponentFindNext( inComponent: AudioComponent; const (*var*) inDesc: AudioComponentDescription ): AudioComponent; external name '_AudioComponentFindNext';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentCount
+    @abstract       number of audio components
+    @discussion     the number of AudioComponenents that match the specified AudioComponentDescription. 
+	@param			inDesc
+						The type, subtype and manufacturer fields are used to specify the audio components to count
+						A value of 0 (zero) for any of these fiels is a wildcard, so will match any value for this field
+	@result			a UInt32. 0 (zero) means no audio components were found that matched the search parameters.
+}
+function AudioComponentCount( const (*var*) inDesc: AudioComponentDescription ): UInt32; external name '_AudioComponentCount';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentCopyName
+    @abstract       used to retrieve the name of an audio component
+    @discussion     the name of an audio component
+	@param			inComponent
+						the audio component (must not be NULL)
+	@param			outName
+						a CFString that is the name of the audio component. This string should be released by the caller.
+    @result			an OSStatus result code.
+}
+function AudioComponentCopyName( inComponent: AudioComponent; var outName: CFStringRef ): OSStatus; external name '_AudioComponentCopyName';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentGetDescription
+    @abstract       used to retrieve the audio component's description
+    @discussion     will return the fully specified audio component description for the provided audio component
+	@param			inComponent
+						the audio component (must not be NULL)
+	@param			outDesc
+						the audio component description for the specified audio component
+    @result			an OSStatus result code.
+}
+function AudioComponentGetDescription( inComponent: AudioComponent; var outDesc: AudioComponentDescription ): OSStatus; external name '_AudioComponentGetDescription';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentGetVersion
+    @abstract       used to retrieve the audio component's version
+    @discussion     will return the version number of a given audio component
+	@param			inComponent
+						the audio component (must not be NULL)
+	@param			outVersion
+						the audio component's version in the form of 0xMMMMmmDD (Major, Minor, Dot)
+    @result			an OSStatus result code.
+}
+function AudioComponentGetVersion( inComponent: AudioComponent; var outVersion: UInt32 ): OSStatus; external name '_AudioComponentGetVersion';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentInstanceNew
+    @abstract       used to create an audio component instance
+    @discussion     this call creates an instance of a given audio component. The audio component instance is the object
+					that does all of the work, whereas the audio component is the way that a program finds and then makes this object
+					to do this work. For example, an audio unit is a type of audio component instance, so to use an audio unit, one
+					finds its audio component, and then creates a new instance of that component. This instance is then used
+					to process, mix, synthesise, etc the audio tasks for which it was designed.
+	@param			inComponent
+						the audio component (must not be NULL)
+	@param			outInstance
+						the audio component instance
+    @result			an OSStatus result code.
+}
+function AudioComponentInstanceNew( inComponent: AudioComponent; var outInstance: AudioComponentInstance ): OSStatus; external name '_AudioComponentInstanceNew';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentInstanceDispose
+    @abstract       used to dispose of an audio component instance
+    @discussion     this call will dispose the audio component instance that was created with the New call. It will deallocate any resources
+					that the instance was using.
+	@param			inInstance
+						the audio component instance to dispose (must not be NULL)
+    @result			an OSStatus result code.
+}
+function AudioComponentInstanceDispose( inInstance: AudioComponentInstance ): OSStatus; external name '_AudioComponentInstanceDispose';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+// retrieves the class object assosciated with the instance
+{!
+    @function       AudioComponentInstanceGetComponent
+    @abstract       used to retrieve the audio component from its instance
+    @discussion     allows the application at any time to retrieve the audio component that is the factory object of a given instance 
+					(ie, the audio component that was used to create the instnace in the first place). This allows the application to
+					retrieve general information about a particular audio component (its name, version, etc) when one just has an
+					audio component instance to work with 
+	@param			inInstance
+						the audio component instance (must not be NULL, and instance must be valid - that is, not disposed)
+    @result			a valid audio component or NULL if no component was found.
+}
+function AudioComponentInstanceGetComponent( inInstance: AudioComponentInstance ): AudioComponent; external name '_AudioComponentInstanceGetComponent';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+{!
+    @function       AudioComponentInstanceCanDo
+    @discussion     this call is used to determine if an audio component instance implements a particular component API call
+					as signified by the specified selector identifier token.
+	@param			inInstance
+						the audio component instance
+	@param			inSelectorID
+						a number to signify the audio component API (component selector) as appropriate for the instance's component type.
+    @result			a boolean
+}
+function AudioComponentInstanceCanDo( inInstance: AudioComponentInstance; inSelectorID: SInt16 ): Boolean; external name '_AudioComponentInstanceCanDo';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0) *)
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 380 - 107
packages/univint/src/AudioHardware.pas


+ 217 - 0
packages/univint/src/AudioOutputUnit.pas

@@ -0,0 +1,217 @@
+{
+     File:       AudioOutputUnit.h
+ 
+     Contains:   AudioOutputUnit Interfaces
+ 
+     Copyright:  © 2000-2008 by Apple Inc., all rights reserved.
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+ 
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioOutputUnit;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,AUComponent;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
+{
+#if !__LP64__
+	#if PRAGMA_STRUCT_ALIGN
+		#pragma options align=mac68k
+	#elif PRAGMA_STRUCT_PACKPUSH
+		#pragma pack(push, 2)
+	#elif PRAGMA_STRUCT_PACK
+		#pragma pack(2)
+	#endif
+#endif
+}
+{$ifc not TARGET_CPU_64}
+{$ALIGN MAC68K}
+{$endc}
+
+//-----------------------------------------------------------------------------
+//	Start/stop methods for output units
+//-----------------------------------------------------------------------------
+function AudioOutputUnitStart( ci: AudioUnit ): OSStatus; external name '_AudioOutputUnitStart';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+function AudioOutputUnitStop( ci: AudioUnit ): OSStatus; external name '_AudioOutputUnitStop';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_2_0) *)
+
+//-----------------------------------------------------------------------------
+//	Selectors for component calls
+//-----------------------------------------------------------------------------
+const
+	kAudioOutputUnitRange = $0200;	// selector range
+	kAudioOutputUnitStartSelect = $0201;
+	kAudioOutputUnitStopSelect = $0202;
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 318 - 0
packages/univint/src/AudioUnitCarbonViews.pas

@@ -0,0 +1,318 @@
+{
+     File:       AudioUnitCarbonView.h
+ 
+     Contains:   AudioUnitCarbonView Interfaces
+ 
+     Copyright:  © 2002-2008 by Apple, Inc., all rights reserved.
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+ 
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioUnitCarbonViews;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,MacWindows,HIObject,QuickdrawTypes,AUComponent,Components;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ifc TARGET_OS_MAC}
+{$ALIGN MAC68K}
+
+
+{!
+	@header		AudioUnitCarbonView
+	@abstract	This file defines interfaces for creating and event handling in carbon-based views of Audio Units.
+}
+
+{!
+	@typedef	AudioUnitCarbonView
+	@abstract	An audio unit Carbon view is of type ComponentInstance, defined by the Component Manager.
+}
+type
+	AudioUnitCarbonView = ComponentInstance;
+
+{!
+	@enum		Carbon view component types and subtypes
+	@constant	kAudioUnitCarbonViewComponentType
+					The four char-code type of a carbon-based view component
+	@constant	kAUCarbonViewSubType_Generic
+					The four char-code subtype of a carbon-based view component
+}
+const
+	kAudioUnitCarbonViewComponentType = FourCharCode('auvw');
+	kAUCarbonViewSubType_Generic = FourCharCode('gnrc');
+
+
+{!
+	@enum		Carbon view events
+	@constant	kAudioUnitCarbonViewEvent_MouseDownInControl
+					The event type indicating that the mouse is pressed in a control
+	@constant	kAudioUnitCarbonViewEvent_MouseUpInControl
+					The event type indicating that the mouse is released in a control
+}
+const
+	kAudioUnitCarbonViewEvent_MouseDownInControl = 0;
+	kAudioUnitCarbonViewEvent_MouseUpInControl = 1;
+
+{!
+	@typedef	AudioUnitcarbViewEventID
+	@abstract	Specifies an event passed to an AudioUnitCarbonViewEventListener callback.
+}
+type
+	AudioUnitCarbonViewEventID = SInt32;
+
+{!
+	@typedef	AudioUnitCarbonViewEventListener
+	@abstract	Defines a callback function that is called when certain events occur in an
+				Audio Unit Carbon view, such as mouse-down and up events on a control.
+				
+	@param		inUserData
+					A user-defined pointer that was passed to an AudioUnitCarbonViewSetEventListener callback.
+	@param		inView
+					The Audio unit Carbon vIew that generated the message.
+	@param		inParameter
+					The parameter associated with the control generating the message.
+	@param		inEvent
+					The type of event, as listed in Audio unit Carbon view events.
+	@param		inEventParam
+					Further information about the event, dependent on its type.
+}
+//#ifndef __LP64__
+{$ifc not TARGET_CPU_64}
+type
+	AudioUnitCarbonViewEventListener = procedure( inUserData: UnivPtr; inView: AudioUnitCarbonView; const (*var*) inParameter: AudioUnitParameter; inEvent: AudioUnitCarbonViewEventID; inEventParam: {const} UnivPtr );
+{$endc}
+
+{!
+	@function	AudioUnitCarbonViewCreate
+	@abstract	A callback that tells an Audio unit Carbon view to open its user interface (user pane).
+	@discussion	The host application specifies the audio unit which the view is to control. The host 
+				also provides the window, parent control, and rectangle into which the Audio unit 
+				Carbon view component (of type AudioUnitCarbonView) is to create itself.
+
+				The host application is responsible for closing the component (by calling the
+				CloseComponent function) before closing its window.
+				
+	@param		inView
+					The view component instance.
+	@param		inAudioUnit
+					The audio unit component instance which the view is to control.
+	@param		inWindow
+					The Carbon window in which the user interface is to be opened.
+	@param		inParentControl
+					The Carbon control into which the user interface is to be embedded. 
+					(This is typically the window's root control).
+	@param		inLocation
+					The host application's requested location for the view. The view should 
+					always create itself at the specified location.
+	@param		inSize
+					The host application's requested size for the view. The view may choose a 
+					different size for itself. The actual dimensions of the view are described 
+					by the value of the outControl parameter.
+	@param		outControl
+					The Carbon control which contains the entire user interface for the view.
+}
+
+function AudioUnitCarbonViewCreate( inView: AudioUnitCarbonView; inAudioUnit: AudioUnit; inWindow: WindowRef; inParentControl: ControlRef; const inLocation: Float32PointPtr; const inSize: Float32PointPtr; var outControl: ControlRef ): OSStatus; external name '_AudioUnitCarbonViewCreate';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_NA) *)
+
+{!
+	@function	AudioUnitCarbonViewSetEventListener
+	@abstract	Add an event listener to the carbon view.
+	@deprecated	in Mac OS X version 10.4
+	@discussion	Use the AUEventListener functions in <AudioToolbox/AudioUnitUtilities.h> instead.
+	
+	@param		inView
+					The Carbon view component instance.
+	@param		inCallback
+					The event listener callback function.
+	@param		inUserData
+					A user data pointer passed to the callback.
+}
+//#ifndef __LP64__
+{$ifc not TARGET_CPU_64}
+function AudioUnitCarbonViewSetEventListener( inView: AudioUnitCarbonView; inCallback: AudioUnitCarbonViewEventListener; inUserData: UnivPtr ): OSStatus; external name '_AudioUnitCarbonViewSetEventListener';
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
+{$endc}
+
+{!
+	@enum		Selectors for component calls
+	@constant	kAudioUnitCarbonViewRange
+					Range of selectors
+	@constant	kAudioUnitCarbonViewCreateSelect
+					Selector for creating the carbon view
+	@constant	kAudioUnitCarbonViewSetEventListenerSelect
+					Selector for setting the event listener callback
+}
+const
+	kAudioUnitCarbonViewRange = $0300;	// range of selectors
+	kAudioUnitCarbonViewCreateSelect = $0301;
+	kAudioUnitCarbonViewSetEventListenerSelect = $0302;
+
+
+{$endc}	{ TARGET_OS_MAC }{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 697 - 0
packages/univint/src/AudioUnitParameters.pas

@@ -0,0 +1,697 @@
+{
+     File:       AudioUnitParameters.h
+ 
+     Contains:   Parameter constants for Apple AudioUnits
+ 
+     Copyright:  (c) 2002-2008 by Apple Inc., all rights reserved.
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+ 
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioUnitParameters;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
+
+//#pragma mark General Declarations
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+{ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The following specifies the equivalent parameterID's for the Group scope for standard
+MIDI Controllers. This list is not exhaustive. It represents the parameters, and their corresponding 
+MIDI messages, that should be supported in Group scope by MIDI capable AUs.
+
+Group scope parameter IDs from 0 < 512 are reserved for mapping MIDI controllers.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
+const
+	kAUGroupParameterID_Volume = 7;	// value 0 < 128
+	kAUGroupParameterID_Sustain = 64; 	// value 0-63 (off), 64-127 (on)
+	kAUGroupParameterID_AllNotesOff = 123;	// value ignored
+	kAUGroupParameterID_ModWheel = 1;	// value 0 < 128
+	kAUGroupParameterID_PitchBend = $E0;	// value -8192 - 8191
+	kAUGroupParameterID_AllSoundOff = 120;	// value ignored
+	kAUGroupParameterID_ResetAllControllers = 121;	// value ignored
+	kAUGroupParameterID_Pan = 10;	// value 0 < 128
+	kAUGroupParameterID_Foot = 4;	// value 0 < 128
+	kAUGroupParameterID_ChannelPressure = $D0;	// value 0 < 128
+	kAUGroupParameterID_KeyPressure = $A0;	// values 0 < 128
+	kAUGroupParameterID_Expression = 11;	// value 0 < 128
+	kAUGroupParameterID_DataEntry = 6;	// value 0 < 128
+
+	kAUGroupParameterID_Volume_LSB = kAUGroupParameterID_Volume + 32;		// value 0 < 128
+	kAUGroupParameterID_ModWheel_LSB = kAUGroupParameterID_ModWheel + 32;	// value 0 < 128
+	kAUGroupParameterID_Pan_LSB = kAUGroupParameterID_Pan + 32;			// value 0 < 128
+	kAUGroupParameterID_Foot_LSB = kAUGroupParameterID_Foot + 32;		// value 0 < 128
+	kAUGroupParameterID_Expression_LSB = kAUGroupParameterID_Expression + 32;	// value 0 < 128
+	kAUGroupParameterID_DataEntry_LSB = kAUGroupParameterID_DataEntry + 32;	// value 0 < 128
+	
+	kAUGroupParameterID_KeyPressure_FirstKey = 256;	// value 0 < 128
+	kAUGroupParameterID_KeyPressure_LastKey = 383;	// value 0 < 128	
+
+
+{ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Supporting the kAUGroupParameterID_KeyPressure parameter indicates to hosts that your audio unit
+supports polyphonic "aftertouch" key pressure. 
+
+Each of the 128 MIDI key numbers can have its own value for polyphonic aftertouch. To respond to 
+aftertouch for a particular key, your audio unit needs to support an additional parameter 
+specifically for that key. The aftertouch parameter ID for a given MIDI key is equal to the MIDI 
+key number plus 256. For example, the aftertouch parameter ID for MIDI key #60 (middle C) is:
+
+	60 + kAUGroupParameterID_KeyPressure_FirstKey = 316
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
+
+// Parameters for all Panner AudioUnits
+const
+	kPannerParam_Gain = 0;			// 0 .. 1
+	
+	kPannerParam_Azimuth = 1;		// -180 .. +180 degrees
+	kPannerParam_Elevation = 2;		// -90 .. +90 degrees
+	kPannerParam_Distance = 3;		// 0 .. 1
+	
+	kPannerParam_CoordScale = 4;	// 0.01 .. 1000 meters
+	kPannerParam_RefDistance = 5;	// 0.01 .. 1000 meters
+
+{$endc}	{ not TARGET_OS_IPHONE }
+
+//#pragma mark Apple Specific
+
+// Parameters for the AUMixer3D unit
+// only some of these parameters are available in the embedded implementation of this AU
+const
+// Input, Degrees, -180->180, 0
+	k3DMixerParam_Azimuth = 0;
+        
+		// Input, Degrees, -90->90, 0
+	k3DMixerParam_Elevation = 1;
+        
+		// Input, Metres, 0->10000, 1
+	k3DMixerParam_Distance = 2;
+        
+		// Input/Output, dB, -120->20, 0
+	k3DMixerParam_Gain = 3;
+	
+		// Input, rate scaler	0.5 -> 2.0
+	k3DMixerParam_PlaybackRate = 4;
+
+// Parameters for the AUMultiChannelMixer unit
+const
+	kMultiChannelMixerParam_Volume = 0;
+	kMultiChannelMixerParam_Enable = 1;
+
+		// read-only
+	// these report level in dB, as do the other mixers
+	kMultiChannelMixerParam_PreAveragePower = 1000;
+	kMultiChannelMixerParam_PrePeakHoldLevel = 2000;
+	kMultiChannelMixerParam_PostAveragePower = 3000;
+	kMultiChannelMixerParam_PostPeakHoldLevel = 4000;
+
+// Output Units
+// Parameters for the AudioDeviceOutput, DefaultOutputUnit, and SystemOutputUnit units
+const
+// Global, LinearGain, 0->1, 1
+	kHALOutputParam_Volume = 14;
+
+// Parameters for the AUTimePitch, AUTimePitch (offline), AUPitch units
+const
+	kTimePitchParam_Rate = 0;
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	kTimePitchParam_Pitch = 1;
+	kTimePitchParam_EffectBlend = 2;		// only for the AUPitch unit
+{$endc} { not TARGET_OS_IPHONE }
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+const
+// Input, Dry/Wet equal-power blend, %	  0.0 -> 100.0
+	k3DMixerParam_ReverbBlend = 5;
+
+		// Global, dB,		-40.0 -> +40.0
+	k3DMixerParam_GlobalReverbGain = 6;
+	
+		// Input, Lowpass filter attenuation at 5KHz :		decibels -100.0dB -> 0.0dB
+		// smaller values make sound more muffled; a value of 0.0 indicates no filtering
+	k3DMixerParam_OcclusionAttenuation = 7;
+	
+		// Input, Lowpass filter attenuation at 5KHz :		decibels -100.0dB -> 0.0dB
+		// smaller values make sound more muffled; a value of 0.0 indicates no filtering
+	k3DMixerParam_ObstructionAttenuation = 8;
+	
+		// read-only
+		//
+		// For each of the following, use the parameter ID plus the channel number
+		// to get the specific parameter ID for a given channel.
+		// For example, k3DMixerParam_PostAveragePower indicates the left channel
+		// while k3DMixerParam_PostAveragePower + 1 indicates the right channel.
+	k3DMixerParam_PreAveragePower = 1000;
+	k3DMixerParam_PrePeakHoldLevel = 2000;
+	k3DMixerParam_PostAveragePower = 3000;
+	k3DMixerParam_PostPeakHoldLevel = 4000;
+{$endc} { not TARGET_OS_IPHONE }
+
+//#pragma mark Apple Specific - Desktop
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+{ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The following sections specify the parameter IDs for the audio units included in Mac OS X.
+Host applications can use these IDs to directly address these parameters without first discovering 
+them through the AUParameterInfo mechanism (see the AudioUnitProperties.h header file)
+
+Each parameter is preceeded by a comment that indicates scope, unit of measurement, minimum
+value, maximum value, and default value.
+    
+See the AudioUnitProperties.h header file for additional information that a parameter may report
+
+When displaying to the user information about a parameter, a host application should always
+get the parameter information from the audio unit itself.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }
+
+
+// Effect units
+// The values for some effect unit parameters depend on the audio unit's sample rate.
+// For example, maximum values are typically the Nyquist frequency (indicated here as 
+// SampleRate/2).
+
+// Parameters for the AUBandpass unit
+const
+// Global, Hz, 20->(SampleRate/2), 5000
+	kBandpassParam_CenterFrequency = 0;
+
+		// Global, Cents, 100->12000, 600
+	kBandpassParam_Bandwidth = 1;
+
+// Some parameters for the AUGraphicEQ unit
+const
+// Global, Indexed, currently either 10 or 31
+	kGraphicEQParam_NumberOfBands = 10000;
+
+// Parameters for the AUHipass unit
+const
+// Global, Hz, 10->(SampleRate/2), 6900
+	kHipassParam_CutoffFrequency = 0;
+		
+		// Global, dB, -20->40, 0
+	kHipassParam_Resonance = 1;
+
+// Parameters for the AULowpass unit
+const
+// Global, Hz, 10->(SampleRate/2), 6900
+	kLowPassParam_CutoffFrequency = 0;
+		
+		// Global, dB, -20->40, 0
+	kLowPassParam_Resonance = 1;
+
+// Parameters for the AUHighShelfFilter unit
+const
+// Global, Hz, 10000->(SampleRate/2), 10000
+	kHighShelfParam_CutOffFrequency = 0;
+		
+		// Global, dB, -40->40, 0
+	kHighShelfParam_Gain = 1;
+
+// Parameters for the AULowShelfFilter unit
+const
+// Global, Hz, 10->200, 80
+	kAULowShelfParam_CutoffFrequency = 0;
+		
+		// Global, dB, -40->40, 0
+	kAULowShelfParam_Gain = 1;
+
+// Parameters for the AUParametricEQ unit
+const
+// Global, Hz, 20->(SampleRate/2), 2000
+	kParametricEQParam_CenterFreq = 0;
+		
+		// Global, Hz, 0.1->20, 1.0
+	kParametricEQParam_Q = 1;
+		
+		// Global, dB, -20->20, 0
+	kParametricEQParam_Gain = 2;
+
+// Parameters for the AUMatrixReverb unit
+const
+// Global, EqPow CrossFade, 0->100, 100
+	kReverbParam_DryWetMix = 0;
+		
+		// Global, EqPow CrossFade, 0->100, 50
+	kReverbParam_SmallLargeMix = 1;
+		
+		// Global, Secs, 0.005->0.020, 0.06
+	kReverbParam_SmallSize = 2;
+		
+		// Global, Secs, 0.4->10.0, 3.07
+	kReverbParam_LargeSize = 3;
+		
+		// Global, Secs, 0.001->0.03, 0.025
+	kReverbParam_PreDelay = 4;
+		
+		// Global, Secs, 0.001->0.1, 0.035
+	kReverbParam_LargeDelay = 5;
+		
+		// Global, Genr, 0->1, 0.28
+	kReverbParam_SmallDensity = 6;
+		
+		// Global, Genr, 0->1, 0.82
+	kReverbParam_LargeDensity = 7;
+		
+		// Global, Genr, 0->1, 0.3
+	kReverbParam_LargeDelayRange = 8;
+		
+		// Global, Genr, 0.1->1, 0.96
+	kReverbParam_SmallBrightness = 9;
+		
+		// Global, Genr, 0.1->1, 0.49
+	kReverbParam_LargeBrightness = 10;
+
+		// Global, Genr, 0->1 0.5
+	kReverbParam_SmallDelayRange = 11;
+
+		// Global, Hz, 0.001->2.0, 1.0
+	kReverbParam_ModulationRate = 12;
+
+		// Global, Genr, 0.0 -> 1.0, 0.2
+	kReverbParam_ModulationDepth = 13;
+
+		// Global, Hertz, 10.0 -> 20000.0, 800.0
+	kReverbParam_FilterFrequency = 14;
+
+		// Global, Octaves, 0.05 -> 4.0, 3.0
+	kReverbParam_FilterBandwidth = 15;
+
+		// Global, Decibels, -18.0 -> +18.0, 0.0
+	kReverbParam_FilterGain = 16;
+
+// Parameters for the AUDelay unit
+const
+// Global, EqPow Crossfade, 0->100, 50
+	kDelayParam_WetDryMix = 0;
+		
+		// Global, Secs, 0->2, 1
+	kDelayParam_DelayTime = 1;
+		
+		// Global, Percent, -100->100, 50
+	kDelayParam_Feedback = 2;
+		
+		// Global, Hz, 10->(SampleRate/2), 15000
+	kDelayParam_LopassCutoff = 3;
+
+// Parameters for the AUPeakLimiter unit
+const
+// Global, Secs, 0.001->0.03, 0.012
+	kLimiterParam_AttackTime = 0;
+		
+		// Global, Secs, 0.001->0.06, 0.024
+	kLimiterParam_DecayTime = 1;
+		
+		// Global, dB, -40->40, 0
+	kLimiterParam_PreGain = 2;
+
+
+// Parameters for the AUDynamicsProcessor unit
+const
+// Global, dB, -40->20, -20
+	kDynamicsProcessorParam_Threshold = 0;
+		
+		// Global, dB, 0.1->40.0, 5
+	kDynamicsProcessorParam_HeadRoom = 1;
+		
+		// Global, rate, 1->50.0, 2
+	kDynamicsProcessorParam_ExpansionRatio = 2;
+		
+		// Global, dB
+	kDynamicsProcessorParam_ExpansionThreshold = 3;
+		
+		// Global, secs, 0.0001->0.2, 0.001
+	kDynamicsProcessorParam_AttackTime = 4;
+		
+		// Global, secs, 0.01->3, 0.05
+	kDynamicsProcessorParam_ReleaseTime = 5;
+		
+		// Global, dB, -40->40, 0
+	kDynamicsProcessorParam_MasterGain = 6;
+	
+		// Global, dB, read-only parameter
+	kDynamicsProcessorParam_CompressionAmount = 1000;
+	kDynamicsProcessorParam_InputAmplitude = 2000;
+	kDynamicsProcessorParam_OutputAmplitude = 3000;
+
+
+// Parameters for the AUMultibandCompressor unit
+const
+	kMultibandCompressorParam_Pregain = 0;
+	kMultibandCompressorParam_Postgain = 1;
+	kMultibandCompressorParam_Crossover1 = 2;
+	kMultibandCompressorParam_Crossover2 = 3;
+	kMultibandCompressorParam_Crossover3 = 4;
+	kMultibandCompressorParam_Threshold1 = 5;
+	kMultibandCompressorParam_Threshold2 = 6;
+	kMultibandCompressorParam_Threshold3 = 7;
+	kMultibandCompressorParam_Threshold4 = 8;
+	kMultibandCompressorParam_Headroom1 = 9;
+	kMultibandCompressorParam_Headroom2 = 10;
+	kMultibandCompressorParam_Headroom3 = 11;
+	kMultibandCompressorParam_Headroom4 = 12;
+	kMultibandCompressorParam_AttackTime = 13;
+	kMultibandCompressorParam_ReleaseTime = 14;
+	kMultibandCompressorParam_EQ1 = 15;
+	kMultibandCompressorParam_EQ2 = 16;
+	kMultibandCompressorParam_EQ3 = 17;
+	kMultibandCompressorParam_EQ4 = 18;
+	
+	// read-only parameters
+	kMultibandCompressorParam_CompressionAmount1 = 1000;
+	kMultibandCompressorParam_CompressionAmount2 = 2000;
+	kMultibandCompressorParam_CompressionAmount3 = 3000;
+	kMultibandCompressorParam_CompressionAmount4 = 4000;
+	kMultibandCompressorParam_InputAmplitude1 = 5000;
+	kMultibandCompressorParam_InputAmplitude2 = 6000;
+	kMultibandCompressorParam_InputAmplitude3 = 7000;
+	kMultibandCompressorParam_InputAmplitude4 = 8000;
+	kMultibandCompressorParam_OutputAmplitude1 = 9000;
+	kMultibandCompressorParam_OutputAmplitude2 = 10000;
+	kMultibandCompressorParam_OutputAmplitude3 = 11000;
+	kMultibandCompressorParam_OutputAmplitude4 = 12000;
+
+// Parameters for the AUVarispeed unit
+const
+	kVarispeedParam_PlaybackRate = 0;
+	kVarispeedParam_PlaybackCents = 1;
+
+// Parameters for the AUFilter unit
+const
+	kMultibandFilter_LowFilterType = 0;
+	kMultibandFilter_LowFrequency = 1;
+	kMultibandFilter_LowGain = 2;
+	kMultibandFilter_CenterFreq1 = 3;
+	kMultibandFilter_CenterGain1 = 4;
+	kMultibandFilter_Bandwidth1 = 5;
+	kMultibandFilter_CenterFreq2 = 6;
+	kMultibandFilter_CenterGain2 = 7;
+	kMultibandFilter_Bandwidth2 = 8;
+	kMultibandFilter_CenterFreq3 = 9;
+	kMultibandFilter_CenterGain3 = 10;
+	kMultibandFilter_Bandwidth3 = 11;
+	kMultibandFilter_HighFilterType = 12;
+	kMultibandFilter_HighFrequency = 13;
+	kMultibandFilter_HighGain = 14;
+
+// Mixer Units
+
+// Parameters for the Stereo Mixer unit
+const
+// Input/Output, Mixer Fader Curve, 0->1, 1
+	kStereoMixerParam_Volume = 0;
+		
+		// Input, Pan, 0->1, 0.5
+	kStereoMixerParam_Pan = 1;
+	
+		// read-only
+		//
+		// For each of the following, use the parameter ID for the left channel
+		// and the parameter ID plus one for the right channel.
+		// For example, kStereoMixerParam_PostAveragePower indicates the left channel
+		// while kStereiMixerParam_PostAveragePower + 1 indicates the right channel.
+	kStereoMixerParam_PreAveragePower = 1000;
+	kStereoMixerParam_PrePeakHoldLevel = 2000;
+	kStereoMixerParam_PostAveragePower = 3000;
+	kStereoMixerParam_PostPeakHoldLevel = 4000;
+
+// Parameters for the AUMatrixMixer unit
+const
+	kMatrixMixerParam_Volume = 0;
+	kMatrixMixerParam_Enable = 1;
+	
+		// read-only
+	// these report level in dB, as do the other mixers
+	kMatrixMixerParam_PreAveragePower = 1000;
+	kMatrixMixerParam_PrePeakHoldLevel = 2000;
+	kMatrixMixerParam_PostAveragePower = 3000;
+	kMatrixMixerParam_PostPeakHoldLevel = 4000;
+
+	// these report linear levels - for "expert" use only.
+	kMatrixMixerParam_PreAveragePowerLinear = 5000;
+	kMatrixMixerParam_PrePeakHoldLevelLinear = 6000;
+	kMatrixMixerParam_PostAveragePowerLinear = 7000;
+	kMatrixMixerParam_PostPeakHoldLevelLinear = 8000;
+
+// Parameters for the AUNetReceive unit
+const
+	kAUNetReceiveParam_Status = 0;
+	kAUNetReceiveParam_NumParameters = 1;
+
+// Parameters for the AUNetSend unit
+const
+	kAUNetSendParam_Status = 0;
+	kAUNetSendParam_NumParameters = 1;
+
+
+// Status values for the AUNetSend and AUNetReceive units
+const
+	kAUNetStatus_NotConnected = 0;
+	kAUNetStatus_Connected = 1;
+	kAUNetStatus_Overflow = 2;
+	kAUNetStatus_Underflow = 3;
+	kAUNetStatus_Connecting = 4;
+	kAUNetStatus_Listening = 5;
+
+// Parameters for the Distortion unit 
+const
+	kDistortionParam_Delay = 0;
+	kDistortionParam_Decay = 1;
+	kDistortionParam_DelayMix = 2;
+	kDistortionParam_Decimation = 3;
+	kDistortionParam_Rounding = 4;
+	kDistortionParam_DecimationMix = 5;
+	kDistortionParam_LinearTerm = 6;
+	kDistortionParam_SquaredTerm = 7;
+	kDistortionParam_CubicTerm = 8;
+	kDistortionParam_PolynomialMix = 9;
+	kDistortionParam_RingModFreq1 = 10;
+	kDistortionParam_RingModFreq2 = 11;
+	kDistortionParam_RingModBalance = 12;
+	kDistortionParam_RingModMix = 13;
+	kDistortionParam_SoftClipGain = 14;
+	kDistortionParam_FinalMix = 15;
+
+// Parameters for AURogerBeep
+const
+	kRogerBeepParam_InGateThreshold = 0;
+	kRogerBeepParam_InGateThresholdTime = 1;
+	kRogerBeepParam_OutGateThreshold = 2;
+	kRogerBeepParam_OutGateThresholdTime = 3;
+	kRogerBeepParam_Sensitivity = 4;
+	kRogerBeepParam_RogerType = 5;
+	kRogerBeepParam_RogerGain = 6;
+
+// Music Device
+// Parameters for the DLSMusicDevice unit - defined and reported in the global scope
+const
+// Global, Cents, -1200, 1200, 0
+	kMusicDeviceParam_Tuning = 0;
+
+		// Global, dB, -120->40, 0
+	kMusicDeviceParam_Volume = 1;
+
+		// Global, dB, -120->40, 0
+	kMusicDeviceParam_ReverbVolume = 2;
+// In Mac OS X v10.5, the DLSMusicDevice audio unit does not report parameters in the Group scope.
+// However, parameter values can be set in Group scope that correspond to controller values defined  
+// by the MIDI specification. This includes the standard MIDI Controller values (such as Volume and
+// Mod Wheel) as well as MIDI status messages (such as Pitch Bend and Channel Pressure) and the 
+// MIDI RPN control messages.
+
+// For MIDI status messages, use a value of 0 for the "channel part" (lower four bits) when setting  
+// these parameters. This allows audio units to distinguish these IDs from the 0-127 
+// values used by MIDI controllers in the first byte of status messages.
+// 
+// The element ID represents the group or channel number.
+//
+// You can use the MusicDeviceMIDIEvent function to send a MIDI formatted control command to a device.
+//
+// You can use the SetParameter API calls, declared in the AUComponent.h header file, as follows:
+//
+//	scope == kAudioUnitScope_Group
+//	element == groupID -> in MIDI equivalent to channel number 0->15, 
+//			but this is not a limitation of the MusicDevice and values greater than 15 can be specified
+//	paramID == midi controller value (0->127), (status bytes corresponding to pitch bend, channel pressure)
+//	value == typically the range associated with the corresponding MIDI message	(7 bit, 0->127)
+//			pitch bend is specified as a 14 bit value
+	
+// See the MusicDevice.h header file for more about using the extended control semantics 
+// of this API.	
+
+{$endc} { not TARGET_OS_IPHONE }
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 3045 - 0
packages/univint/src/AudioUnitProperties.pas

@@ -0,0 +1,3045 @@
+{
+     File:       AudioUnitProperties.h
+ 
+     Contains:   Property constants for AudioUnits
+ 
+     Copyright:  (c) 2001-2008 by Apple Inc., all rights reserved.
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+ 
+}
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AudioUnitProperties;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,AUComponent,CoreAudioTypes,MIDIServices,CFBase,CFURL;
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
+
+//=====================================================================================================================
+//#pragma mark Overview
+{!
+    @header AudioUnitProperties
+	This file defines a collection of property IDs and their accompanying structures that are used
+	by audio units. Properties form the basis of much of the audio unit API. You use them with 
+	the Audio Unit framework's Get and Set property API calls declared in the AUComponent.h header
+	file:
+	
+		AudioUnitGetPropertyInfo
+		AudioUnitGetProperty
+		AudioUnitSetProperty
+	
+	This file first lists generic audio unit properties (those that are potentially applicable to 
+	any audio unit), followed by properties specific to Apple audio units.
+
+	Apple reserves property IDs from 0 -> 63999. Developers are free to use property IDs above this 
+	range.
+	
+	All property values are passed by reference. When a property's value type is listed below,
+	that value type is always passed by reference. For example, CFStringRef is passed as 
+	&myCFString.
+	
+	Properties are described below using a general form:
+		Scope:				The audio unit scope that the property applies to. For example, Global, 
+							Input, Output, etc. For an explanation of audio unit scopes, see the 
+							Audio Unit Programming Guide in the ADC Reference Library.
+		Value Type:			The data type used to hold the value associated with the property. For 
+							example, CFStringRef or UInt32
+		Access:				How a host application can access the property in a hosted audio unit: 
+							read only, write only, or read/write.
+		Description:		A description of the property's role.
+	
+	The descriptions in this file apply to typical or recommended usage. Audio unit developers can vary 
+	the way each property is used. For example, a property may be described as applying to both input and  
+	output scopes, but a given audio unit may implement the property on the input scope only. As another 
+	example, a property may be described here as having read/write access, but an audio unit may 
+	implement the property as read only.
+	
+	The properties are divided into two primary sections:
+		(1) Core/Embedded Implementation
+			- these properties are available on all platforms where audio units are available
+		
+		(2) Desktop 
+			- these properties are available on only available on desktop platforms
+	
+	The following file is organised into these two sections
+}
+
+//#pragma mark -
+//#pragma mark Core Implementation
+//#pragma mark -
+{!
+    @enum           Audio Unit scope types
+    @abstract       The scope IDs for audio units define basic roles and contexts for an audio unit's state.
+    @discussion		Each scope is a discrete context. Apple reserves scope IDs from 0 through 1024.
+
+	@constant		kAudioUnitScope_Global	The context for audio unit characteristics that apply to the audio unit as a 
+											whole
+	@constant		kAudioUnitScope_Input	The context for audio data coming into an audio unit
+	@constant		kAudioUnitScope_Output	The context for audio data leaving an audio unit
+	@constant		kAudioUnitScope_Group	A context specific to the control scope of parameters (for instance, 
+											MIDI Channels is an example of this scope)
+	@constant		kAudioUnitScope_Part	A distinct rendering context. For instance a single timbre in a multi-timbral 
+											instrument, a single loop in a multi looping capable looper unit, etc.
+	@constant		kAudioUnitScope_Note	A scope that can be used to apply changes to an individual note. The 
+											elementID used with this scope is the unique note ID returned from
+											a started note (see MusicDeviceStartNote)
+}
+const
+	kAudioUnitScope_Global = 0;
+	kAudioUnitScope_Input = 1;
+	kAudioUnitScope_Output = 2;
+//#if !TARGET_OS_IPHONE;
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitScope_Group = 3;
+	kAudioUnitScope_Part = 4;
+	kAudioUnitScope_Note = 5;
+//#endif;
+{$endc}
+
+
+//=====================================================================================================================
+//#pragma mark Audio Unit Properties
+
+{!
+    @enum           Generic Property IDs
+    @abstract       Properties that can apply to any audio unit.
+	
+	@constant		kAudioUnitProperty_ClassInfo
+						Scope:			Global (or Part for a part scope preset)
+						Value Type:		CFDictionaryRef
+						Access:			Read / Write
+						
+						The complete state of an audio unit if on global scope. An audio unit that supports part scope, may also support presets on the part scope
+						that apply to individual parts
+						
+	@constant		kAudioUnitProperty_MakeConnection
+						Scope:			Input
+						Value Type:		AudioUnitConnection
+						Access:			Write
+	
+	@constant		kAudioUnitProperty_SampleRate
+						Scope:			Input / Output
+						Value Type:		Float64
+						Access:			Read / Write
+						
+	@constant		kAudioUnitProperty_ParameterList
+						Scope:			Any
+						Value Type:		AudioUnitParameterID
+						Access:			Read
+						
+						The list of parameter IDs on the specifed scope
+						
+	@constant		kAudioUnitProperty_ParameterInfo
+						Scope:			Any
+						Value Type:		AudioUnitParameterInfo
+						Access:
+						
+						The info struct describes the general characteristics of an individual parameterID
+						
+	@constant		kAudioUnitProperty_FastDispatch
+						Scope:			Global
+						Value Type:		void* (function pointer)
+						Access:			Read
+						
+						The caller provides the selector for a given audio unit API, and retrieves a function pointer for that selector. For instance,
+						this enables the caller to retrieve the function pointer for the AudioUnitRender call, so that call can be made directly
+						through to the audio unit to avoid the overhead of the Component Mgr's dispatch.
+	
+	@constant		kAudioUnitProperty_CPULoad
+						Scope:			Global
+						Value Type:		Float64
+						Access:			Read
+						
+						Can be used to retrieve the duty cycle (as a value from 0 to 1) of the render time that an audio unit is spending in its render call.
+	
+	@constant		kAudioUnitProperty_StreamFormat
+						Scope:			Input / Output
+						Value Type:		AudioStreamBasicDescription
+						Access:			Read / Write
+						
+						An AudioStreamBasicDescription is used to specify the basic format for an audio data path. For instance, 2 channels, 44.1KHz, Float32 linear pcm.
+						The value can be both set and retrieve from an I/O element (bus)
+	
+	@constant		kAudioUnitProperty_ElementCount
+						Scope:			Any (though Global scope will always have and element count of 1)
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						Most audio units will only implement the read version of this call, thus they would have a fixed bus topology (number of input and output elements/buses).
+						Some audio units possess the capability to add or remove elements, so in that case this property will be writable.
+						
+	@constant		kAudioUnitProperty_Latency
+						Scope:			Global
+						Value Type:		Float64
+						Access:			Read
+						
+						The processing latency (the time it takes an audio unit to represent an input in its audio output) specified in seconds
+						
+	@constant		kAudioUnitProperty_SupportedNumChannels
+						Scope:			Global
+						Value Type:		AUChannelInfo array
+						Access:			Read
+						
+						The size of this property will represent the number of AUChannelInfo structs that an audio unit provides. Each entry describes a particular number of 
+						channels on any input, matched to a particular number of channels on any output. Thus an entry (2, 2) says the audio unit will support a channel configuration
+						of 2 channels on an input and 2 channels on an output.
+						
+						Negative numbers (-1, -2) are used to indicate *any* number of channels. So (-1, -1) means any number of channels on input and output as long as they are the same.
+						(1, -2) means any number of channels on input or output buses
+						
+						A negative number less than -2 is used to indicate a total number of channels across every bus on that scope, regardless of how many channels are set on any
+						particular bus.
+						
+						Zero on any side (typically only input) means that the audio unit doesn't have any input elements, and is expressing the capability of configuring its output channels.
+						
+	@constant		kAudioUnitProperty_MaximumFramesPerSlice
+						Scope:			Global
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						This property is used to describe to an audio unit the maximum number of samples it will be asked to produce on any single given call to audio unit render. 
+						
+						If an audio unit can require more or less input data than its output request, then it should limit any given request for input to this number of frames (that is,
+						it should "break up" its input pulls).
+	
+	@constant		kAudioUnitProperty_SetExternalBuffer
+						Scope:			Global
+						Value Type:		AudioUnitExternalBuffer
+						Access:			Write
+						
+						This is used to provide to an audio unit a buffer that it can use with its input render callback's audio buffer list
+	
+	@constant		kAudioUnitProperty_ParameterValueStrings
+						Scope:			Any
+						Value Type:		CFArrayRef
+						Access:			Read
+						
+						Some audio unit parameters that are of an index type, can also provide names for each value of the parameter. This property returns an array containing CFStrings, where
+						each element in the array is the name that should be used for that parameter value. The size of the array should be the same as the range between the parameters min and max values.
+						The array's strings can then be used to build a menu for that parameter.
+	
+	@constant		kAudioUnitProperty_GetUIComponentList
+						Scope:			Any
+						Value Type:		AudioComponentDescription array
+						Access:			Read
+						
+						Presents an array of AudioComponentDescription that are of type 'auvw' (AudioUnitCarbonView). These are the carbon based custom views for that audio unit. 
+	
+	@constant		kAudioUnitProperty_AudioChannelLayout
+						Scope:			Input/Output
+						Value Type:		struct AudioChannelLayout
+						Access:			read/write
+
+						Description:
+						Describes for a given scope/element the order of channels within a given stream. 
+						The number of channels it describes must match the number of channels set for that 
+						scope/element. Each input and output bus in an audio unit can have one instance of 
+						this property. 
+						
+						Some audio units require this property. For example, the 3DMixer unit must 
+						implement this property on its output bus. If a host application attempts to 
+						clear the value of this property on a bus that requires a valid value, the
+						audio unit will return a kAudioUnitErr_InvalidPropertyValue error.
+						
+						Input and output buses can be in one of three states in regard to Audio 
+						channel layout:
+						
+						1. implemented and set
+						2. implemented but not set 
+						3. unimplemented 
+						
+						Requesting the value of this property when it is implemented but not set
+						results in a kAudioUnitErr_PropertyNotInUse error.
+						
+						Use the kAudioUnitProperty_AudioChannelLayout property whenever channel
+						layout is relevant. By comparison, the kAudioUnitProperty_StreamFormat 
+						property cannot specify channel layout or purpose.
+						
+						See also: kAudioUnitProperty_SupportedChannelLayoutTags, 
+						kAudioUnitProperty_StreamFormat.
+	 
+	@constant		kAudioUnitProperty_TailTime
+						Scope:			Global
+						Value Type:		Float64
+						Access:			Read
+						
+						The time in seconds that will remain after the last valid input of any audio unit has been processed before the output is silent. For example, this could be the total
+						decay time of a reverb or a delay. In general this will be a conservative estimate.
+	
+	@constant		kAudioUnitProperty_BypassEffect
+						Scope:			Global
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						A boolean value that can be used to bypass the processing in an effect unit, so that the input is passed unchanged through to the output
+	
+	@constant		kAudioUnitProperty_LastRenderError
+						Scope:			Global
+						Value Type:		OSStatus
+						Access:			Read
+						
+						This property is set if there is an error in AudioUnitRender. The AU will then fire a property changed notification to any listeners on this property and 
+						those listeners can then use this property ID to retrieve that error.
+	
+	@constant		kAudioUnitProperty_SetRenderCallback
+						Scope:			Input
+						Value Type:		AURenderCallbackStruct
+						Access:			Write
+						
+						This is used to provide the audio unit with input on the specified element (input bus) with audio data from the provided callback. The callback is delivered a buffer list
+						which it must fill in with audio data. If no data is available, it should set the audio data to 0 (silence). In the normal case, f an error is returned, the audio is not processed 
+						and the audio unit will return an error from AudioUnitRender.
+
+	@constant		kAudioUnitProperty_FactoryPresets
+						Scope:			Global
+						Value Type:		CFArray of AUPreset structures
+						Access:			Read
+						
+						An array of preset structures that provide a name and number for each preset. A factory preset is then chosen using the PresentPreset property. 
+	
+	@constant		kAudioUnitProperty_ContextName
+						Scope:			Global
+						Value Type:		CFString
+						Access:			Read / Write
+						
+						The host can set this as information to the audio unit to describe something about the context within which the audio unit is instantiated. For instance, "track 3" could
+						be set as the context, so that the audio unit's view could then display "My audio unit on track 3" as information to the user of the particular context for any audio unit.
+						
+	@constant		kAudioUnitProperty_RenderQuality
+						Scope:			Global
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						A value (0 - 127) that can be used to control the quality (complexity) of the rendering operation. A typical usage is to set render quality to maximum for best quality, but
+						if CPU usage is a concern a lesser quality can be set to trade off render quality.
+	
+	@constant		kAudioUnitProperty_HostCallbacks
+						Scope:			Global
+						Value Type:		HostCallbackInfo
+						Access:			Write
+						
+						The audio unit should only call the host callbacks while it is in its render function. The audio unit must provide the client info when calling the callbacks as provided
+						by the host. They are provided as a means for an audio unit to gain information from the host about parameters that may affect its rendering operation. 
+						For example, what is the current beat of the host, is the transport running, and so forth.
+						
+						Any of the parameters of the callback function, when called by the audio unit, can be NULL. This indicates that the unit doesn't want to know that particular information. 
+						The exception is that the unit must always specify the HostUserData which was be supplied to the unit when the property was set.
+
+						If the host is unable to provide the requested information then it can return the kAudioUnitErr_CannotDoInCurrentContext error code
+
+	@constant		kAudioUnitProperty_InPlaceProcessing
+						Scope:			Global
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						A property that can be used to determine if the audio unit can process input data on the same data as is provided to it, and if so this can be turned off if the host
+						has a particular buffer management strategy and such an operation would defeat that.
+	
+	@constant		kAudioUnitProperty_ElementName
+						Scope:				any
+						Value Type:			CFStringRef
+						Access:				read/write
+						Description:
+						The name of the specified element. The Host owns a reference to this property value 
+						(as with all other CF properties), and should release the string retrieved or used when setting.
+	
+	@constant		kAudioUnitProperty_CocoaUI
+						Scope:				Global
+						Value Type:			struct AudioUnitCocoaViewInfo
+						Access:				read
+
+						Publishes the audio unit's custom Cocoa NSViews. The Host can determine how big this structure is by 
+						querying the size of the property (ie. How many alternate UI classes there are for the unit)
+						Typically, most audio units will provide 1 UI class per unit
+	
+	@constant		kAudioUnitProperty_SupportedChannelLayoutTags
+						Scope:				Input/Output
+						Value Type:			AudioChannelLayoutTags[ variable number of elements ]
+						Access:				read only
+
+						Used with GetProperty to ascertain what an audio unit understands about
+						laying out of channel orders. This will normally return one or more of the specified layout tags.
+						
+						When a specific set of layouts are returned, the client then uses the 
+						kAudioUnitProperty_AudioChannelLayout property (with one of those layout tags specified) to set 
+						the unit to use that layout. In this case the client (and the audio unit when reporting its 
+						AudioChannelLayout) is only expected to have set an AudioChannelLayout which only sets the 
+						layout tag as the valid field.
+						
+						Custom Channel Maps:
+						Some audio units may return the tag:
+							kAudioChannelLayoutTag_UseChannelDescriptions
+						
+						In this case, the host then can look at supported number of channels on that scope
+						(using the kAudioUnitProperty_SupportedNumChannels), and supply an AudioChannelLayout with the 
+						kAudioUnitProperty_AudioChannelLayout property to specify the layout, number of channels
+						and location of each of those channels. This custom channel map MUST have a channel valence
+						that is supported by the Audio Unit.
+						
+						The UseChannelBitmap field is NOT used within the context of the AudioUnit.
+	
+	@constant		kAudioUnitProperty_ParameterIDName
+						Scope:				any
+						Value Type:			AudioUnitParameterNameInfo
+						Access:				read
+
+						An audio unit returns the full parameter name in the GetParameterInfo struct/property.
+						In some display situations however, there may only be room for a few characters, and
+						truncating this full name may give a less than optimal name for the user. Thus, 
+						this property can be used to ask the audio unit whether it can supply a truncated name, with
+						the host suggesting a length (number of characters). If the unit returns a longer
+						name than the host requests, that name maybe truncated to the requested characters in display.
+						The unit could return a shorter name than requeseted as well. The unit returns a CFString
+						that should be released by the host. When using this property, the host asks for
+						the name in the same scope and element as the unit publishes the parameter.
+
+	@constant		kAudioUnitProperty_ParameterClumpName
+						Scope:				any
+						Value Type:			AudioUnitParameterNameInfo
+						Access:				read
+
+						This works in a similar manner to the ParameterIDName property, except that the inID
+						value is one of the clumpID's that are returned with the audio unit's ParameterInfo 
+						structure.
+	
+	@constant		kAudioUnitProperty_PresentPreset
+						Scope:				Global/Part
+						Value Type:			AUPreset
+						Access:				read/write
+
+						This property replaces the deprecated CurrentPreset property, due to the ambiguity of
+						ownership of the CFString of the preset name in the older CurrentPreset property. 
+						With PresentPreset the client of the audio unit owns the CFString when it retrieves the
+						preset with PresentPreset and is expected to release this (as with ALL properties 
+						that retrieve a CF object from an audio unit).
+	
+	@constant		kAudioUnitProperty_OfflineRender
+						Scope:				Global
+						Value Type:			UInt32
+						Access:				Read / Write
+						
+						This is used by the host to indicate when an audio unit (that normally operates within a general real-time calling model) is 
+						rendering in an offline context. A typical usage of this is to set this to true when the rendering operation an audio unit is being used within is 
+						going to write out the results to a file. The value defaults to false, as the common usage of audio units is for real-time processing
+	
+	@constant		kAudioUnitProperty_ParameterStringFromValue
+						Scope:				any
+						Value Type:			AudioUnitParameterStringFromValue
+						Access:				read
+
+						This property is used with parameters that are marked with the
+						kAudioUnitParameterFlag_HasName parameter info flag. This indicates that some
+						(or all) of the values represented by the parameter can and should be
+						represented by a special display string.
+						
+						This is NOT to be confused with kAudioUnitProperty_ParameterValueStrings. That property
+						is used with parameters that are indexed and is typically used for instance to build
+						a menu item of choices for one of several parameter values.
+						
+						kAudioUnitProperty_ParameterStringFromValue can have a continuous range, and merely states
+						to the host that if it is displaying those parameter's values, they should request
+						a name any time any value of the parameter is set when displaying that parameter.
+						
+						For instance (a trivial example), a unit may present a gain parameter in a dB scale,
+						and wish to display its minimum value as "negative infinity". In this case, the audio unit
+						will not return names for any parameter value greater than its minimum value - so the host
+						will then just display the parameter value as is. For values less than or equal to the 
+						minimum value, the audio unit will return a string for "negative infinity" which the host can
+						use to display appropriately.
+						
+						A less trivial example might be a parameter that presents its values as seconds. However,
+						in some situations this value should be better displayed in a SMPTE style of display:
+							HH:MM:SS:FF
+						In this case, the audio unit would return a name for any value of the parameter.
+						
+						The GetProperty call is used in the same scope and element as the inParamID 
+						that is declared in the struct passed in to this property.
+						
+						If the *inValue member is NULL, then the audio unit should take the current value
+						of the specified parameter. If the *inValue member is NOT NULL, then the audio unit should
+						return the name used for the specified value.
+						
+						On exit, the outName may point to a CFStringRef (which if so must be released by the caller).
+						If the parameter has no special name that should be applied to that parameter value,
+						then outName will be NULL, and the host should display the parameter value as
+						appropriate.
+					
+	
+	@constant		kAudioUnitProperty_ParameterValueFromString
+						Scope:				any
+						Value Type:			AudioUnitParameterValueFromString
+						Access:				read
+	
+						This property returns the value of a parameter from its string representation. See kAudioUnitProperty_ParameterStringFromValue.
+						
+	@constant		kAudioUnitProperty_IconLocation	
+						Scope:				Global
+						Value Type:			CFURLRef
+						Access:				Read
+						
+						A URL that will specify the location of an icon file that can be used when presenting UI for this audio unit.
+	
+	@constant		kAudioUnitProperty_PresentationLatency
+						Scope:				Input/Output
+						Value Type:			Float64
+						Access:				write
+
+						This property is set by a host to describe to the audio unit the presentation latency of both
+						any of its input and/or output audio data. 
+						It describes this latency in seconds. A value of zero means either no latency
+						or an unknown latency.
+						
+						This is a write only property because the host is telling the audio unit the latency of both the 
+						data it provides it for input and the latency from getting the data from the unit until it is 
+						presented.
+						
+						The property is should be set on each active input and output bus (Scope/Element pair). 
+						For example, an audio unit with multiple outputs will have the output data it produces processed 
+						by different audio units, etc before it is mixed and presented. Thus, in this case, each output 
+						element could have a different presentation latency.
+						
+						This should not be confused with the Latency property, where the audio unit describes to the host 
+						any processing latency it introduces between its input and its output.
+						
+						For input:
+							Describes how long ago the audio given to an audio unit was acquired. For instance, when 
+							reading from a file to the first audio unit, then its input presentation latency will be zero. 
+							When processing audio input from a  device, then this initial input latency will be the 
+							presentation latency of the device itself, the device's safety offset and latency.
+							
+							The next audio unit's (connected to that first unit) input presentation latency will be the 
+							input presentation latency of the first unit, plus the processing latency (as expressed by 
+							kAudioUnitProperty_Latency) of the first unit.
+							
+						For output:
+							Describes how long before the output audio of an audio unit is to be presented. For instance, 
+							when writing to a file, then the last audio unit's output presentation latency will be zero. 
+							When the audio from that audio unit is to be played to an AudioDevice, then that initial 
+							presentation latency will be the latency of the device itself - which is the I/O buffer size, 
+							and the device's safety offset and latency
+							
+							The previous audio unit's (connected to this last unit) output presenation latency will be that 
+							initial presentation latency plus the processing latency (as expressed by 
+							kAudioUnitProperty_Latency) of the last unit.
+							
+						So, for a given audio unit anywhere within a mixing graph, the input and output presentation 
+						latencies describe to that unit how long from the moment of generation it will take for its 
+						input to arrive, and how long it will take for its output to be presented. 
+						
+						You can use this property, for example, to provide metering for for an audio unit that 
+						is generating output to be presented to the user at a future time.
+	
+	@constant		kAudioUnitProperty_DependentParameters
+						Scope:				any
+						Value Type:			array of AUDependentParameter
+						Access:				read
+		
+						This property is used for parameters with the kAudioUnitParameterFlag_IsGlobalMeta 
+						or kAudioUnitParameterFlag_IsElementMeta flags set. Hosts applications (and the 
+						AudioUnitParameterListener mechanism) can interrogate this property to determine which parameters 
+						are dependent on a
+						meta-parameter.
+						
+						For parameters marked with kAudioUnitParameterFlag_IsGlobalMeta, any non-global
+						dependent parameters are assumed to be dependent in every element of their scope.
+						
+						For parameters marked with kAudioUnitParameterFlag_IsElementMeta, then its dependent
+						parameters must all be the same scope, and are assumed to apply only within a single element,
+						not to other instances of the same parameter in other elements.
+	
+	@constant		kAudioUnitProperty_AUHostIdentifier
+						Scope:				Global
+						Value Type:			AUHostVersionIdentifier
+						Access:				write
+
+						Determine which application (and which version) an audio unit is being hosted by. 
+						This is made more complex through the intervention of audio units such as Kore, that are hosting 
+						other audio units (in this case of course, the real host of the audio unit is the hosting unit, 
+						not the host application, so the previous mechanism of getting the main bundle ID is no longer 
+						correct). 
+						
+						There are also inconsistencies in the way that bundle identifiers are applied (with apps changing 
+						these from version to version), and we'd prefer to see a more consistent identifier used with 
+						this property. This is in spirit similar to the string returned by CFBundle API, except that we 
+						require this host string be consistent and reliable through different revisions of the host.
+
+						The audio unit is responsible for retaining the hostName string if it needs to use it past the 
+						duration of the actual call. The host should set this property as early as possible within the 
+						lifetime of the unit in a session.
+						
+						This API used to take a NumVersion struct. It is redefined to take an AUHostVersionIdentifier struct
+						which is binary compatible with the existing usage, but not source compatible.
+						
+	@constant		kAudioUnitProperty_MIDIOutputCallbackInfo
+						Scope:				Global
+						Value Type:			CFArrayRef
+						Access:				read
+
+						The host will also need to determine how many MIDI output streams the audio unit can generate 
+						(and the name for each of these outputs). Each MIDI output is a complete MIDI data stream, 
+						such as embodied by a MIDIEndpointRef in CoreMIDI.
+						
+						To do, the host uses this property and retrieves an array of CFStringRefs:
+							- the size of the array is the number of MIDI Outputs the audio unit supports
+							- each item in the array is the name for that output at that index
+						
+						The host should release the array when it is finished with it.
+						
+						Once the host has determined the audio unit supports this feature, it then instantiates a callback 
+						with the unit that the unit will call with MIDI data (see kAudioUnitProperty_MIDIOutputCallback).
+	
+	@constant		kAudioUnitProperty_MIDIOutputCallback
+						Scope:				Global
+						Value Type:			AUMIDIOutputCallbackStruct
+						Access:				write
+
+						The host sets this property on the audio unit with the callback (and its user data) set 
+						appropriately.
+						
+						Operational Parameters:
+							In the render call, just as is the expected usage of the AUHostCallbacks, the audio unit can 
+							call the provided callback to provide MIDI data to the host that it will associate with the 
+							current AudioUnitRender call in process.
+
+						The audio unit in the callback provides:
+							- the user data provided by the host when the callback was established
+							- the AudioTimeStamp that was provided to the audio unit for this particular call of 
+								AudioUnitRender
+							- the output number to associate this MIDI data with
+							- a MIDI Packet List containing MIDI data. The time stamp values contained within the 
+							MIDIPackets in this list are **sample offsets*** from the AudioTimeStamp provided. 
+							This allows MIDI data to be time-stamped with a sample offset that is directly associated 
+							with the audio data it is generating in the current call to the AudioUnitRender function
+
+						There is no implied or expected association between the number (or position) of an audio unit's 
+						audio or MIDI outputs.
+
+	@constant		kAudioUnitProperty_InputSamplesInOutput
+						Scope:			Global
+						Value Type:		struct AUInputSamplesInOutputCallbackStruct
+						Access: 		read/write
+ 
+						An audio unit calls this callback at the end of its render call. The audio unit supplies the 
+						following information:
+
+						outputTime      - The timestamp passed in to the audio unit's render call. This timestamp 
+											represents the time of the first output sample.
+						inputSample     - The sample number of the first input sample that is present in the output 
+											audio.
+						numInputSamples - The number of input samples that were used and are present in the output 
+											audio.
+
+						This property allows a host application to determine which input samples correspond to a sample 
+						in the output buffer. It is useful only for audio units that do time-stretching, such as the 
+						AUVaripseed and AUTimePitch units, where the relationship between input and output samples is 
+						non-trivial. For these units, the range of input samples that correspond to an output buffer 
+						typically differs from the range of input samples that were pulled for that render call. 
+						This difference arises because of internal buffering, processing latency, and other factors.
+	
+	@constant		kAudioUnitProperty_ClassInfoFromDocument
+						Scope:			Global
+						Value Type:		CFDictionary
+						Access: 		read/write
+ 
+						If the audio unit implements this property then it is going to do different actions establishing
+						its state from a document rather than from a user preset. Thus, a host app should use this property
+						first (instead of kAudioUnitProperty_ClassInfo) when restoring the state of an audio unit when 
+						opening a document. If the audio unit returns an error (or doesn't implement this property) then
+						the host should use the same preset with the kAudioUnitProperty_ClassInfo. 
+ 
+
+	@constant		kAudioUnitProperty_ShouldAllocateBuffer
+						Scope:			input/output elements (settable per element)
+						Value Type:		UInt32
+						Access: 		read/write
+ 
+						By default this value is true. This affects the allocations of the buffers for I/O (the mData field
+						of the AudioBufferList used with AudioUnitRender, callbacks and connections)
+						
+						If true, the element will create a buffer for rendering into.
+						
+						If false, the element will not create a buffer for rendering.
+						
+						For example, if the audio unit is only ever going to have a connection as its input and never a callback, then
+						it should not need to create a buffer (the API contract expects an audio unit to provide a buffer for
+						callbacks, but no buffer for connections).
+						
+						If the audio unit is always going to be pulled for audio with the client providing audio data buffers to 
+						the AudioUnitRender call, then it will never need to create an audio buffer on the output side.
+						
+						So, this property can be used to control the default allocation strategy of an audio unit. If the audio unit
+						needs a buffer, but one hasn't been allocated, then an error will be thrown from that call to AudioUnitRender.
+						
+						This property cannot be set on Initialised audio units as it may end up reallocating memory.
+
+
+	@constant		kAudioUnitProperty_FrequencyResponse
+						Scope:			input/output elements (settable per element)
+						Value Type:		AudioUnitFrequencyResponseBin
+						Access: 		read
+						
+						The property provides a way for a user interface view to get points for drawing a graph of the frequency
+						response of the AU. 
+						
+						An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
+						with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
+						If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with 
+						a negative frequency.
+ }	
+const
+// range (0 -> 999)
+	kAudioUnitProperty_ClassInfo = 0;
+	kAudioUnitProperty_MakeConnection = 1;
+	kAudioUnitProperty_SampleRate = 2;
+	kAudioUnitProperty_ParameterList = 3;
+	kAudioUnitProperty_ParameterInfo = 4;
+	kAudioUnitProperty_StreamFormat = 8;
+	kAudioUnitProperty_ElementCount = 11;
+	kAudioUnitProperty_Latency = 12;
+	kAudioUnitProperty_SupportedNumChannels = 13;
+	kAudioUnitProperty_MaximumFramesPerSlice = 14;
+	kAudioUnitProperty_AudioChannelLayout = 19;
+	kAudioUnitProperty_TailTime = 20;
+	kAudioUnitProperty_BypassEffect = 21;
+	kAudioUnitProperty_LastRenderError = 22;
+	kAudioUnitProperty_SetRenderCallback = 23;
+	kAudioUnitProperty_FactoryPresets = 24;
+	kAudioUnitProperty_RenderQuality = 26;
+	kAudioUnitProperty_InPlaceProcessing = 29;
+	kAudioUnitProperty_ElementName = 30;
+	kAudioUnitProperty_SupportedChannelLayoutTags = 32;
+	kAudioUnitProperty_PresentPreset = 36;
+	kAudioUnitProperty_ShouldAllocateBuffer = 51;
+
+//#if !TARGET_OS_IPHONE;
+{$ifc not TARGET_OS_IPHONE}
+	kAudioUnitProperty_FastDispatch = 5;
+	kAudioUnitProperty_CPULoad = 6;
+	kAudioUnitProperty_SetExternalBuffer = 15;
+	kAudioUnitProperty_ParameterValueStrings = 16;
+	kAudioUnitProperty_GetUIComponentList = 18;
+	kAudioUnitProperty_ContextName = 25;
+	kAudioUnitProperty_HostCallbacks = 27;
+	kAudioUnitProperty_CocoaUI = 31;
+	kAudioUnitProperty_ParameterIDName = 34;
+	kAudioUnitProperty_ParameterClumpName = 35;
+	kAudioUnitProperty_ParameterStringFromValue = 33;
+	kAudioUnitProperty_OfflineRender = 37;
+	kAudioUnitProperty_ParameterValueFromString = 38;
+	kAudioUnitProperty_IconLocation = 39;
+	kAudioUnitProperty_PresentationLatency = 40;
+	kAudioUnitProperty_DependentParameters = 45;
+	kAudioUnitProperty_AUHostIdentifier = 46;
+	kAudioUnitProperty_MIDIOutputCallbackInfo = 47;
+	kAudioUnitProperty_MIDIOutputCallback = 48;
+	kAudioUnitProperty_InputSamplesInOutput = 49;
+	kAudioUnitProperty_ClassInfoFromDocument = 50;
+	kAudioUnitProperty_FrequencyResponse = 52;
+//#endif;
+{$endc}
+
+{!
+    @abstract       Keys contains in an audio unit preset (ClassInfo) dictionary
+    @discussion     These strings are used as keys in the AUPreset-"classInfo" dictionary
+					The actual keys are CFStrings to use these keys you define the key as:
+						static const CFStringRef kMyVersionString = CFSTR(kAUPresetVersionKey);
+}
+const
+	kAUPresetVersionKey = 'version';
+const
+	kAUPresetTypeKey = 'type';
+const
+	kAUPresetSubtypeKey = 'subtype';
+const
+	kAUPresetManufacturerKey = 'manufacturer';
+const
+	kAUPresetDataKey = 'data';
+const
+	kAUPresetNameKey = 'name';
+const
+	kAUPresetRenderQualityKey = 'render-quality';
+const
+	kAUPresetCPULoadKey = 'cpu-load';
+const
+	kAUPresetElementNameKey = 'element-name';
+const
+	kAUPresetExternalFileRefs = 'file-references';
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+	// these are keys to use when a preset contains data from other plugin formats
+	// vstdata is used to signify VST state from a vst "bank"
+const kAUPresetVSTDataKey = 'vstdata';
+	// vstpreset is used to signify VST state from a vst "preset"
+const kAUPresetVSTPresetKey = 'vstpreset';
+const kAUPresetMASDataKey = 'masdata';
+//#endif
+{$endc}
+
+{!
+    @defined        kAUPresetPartKey
+    @discussion     This key if present, distinguishes a global preset that is set 
+					on the global scope with a part-based preset that is set on the part scope. 
+					The value of this key is audio unit defined
+}
+const
+	kAUPresetPartKey = 'part';
+
+
+{!
+    @struct         AudioUnitConnection
+    @abstract       This structure contains the information needed to make a connection between a source
+					and destination audio unit.
+	@discussion		The structure is set on the destination audio unit's input element
+    @field          sourceAudioUnit
+						The audio unit that is the source for the connection
+    @field          sourceOutputNumber
+						The source audio unit's output element to be used in the connection
+    @field          destInputNumber
+						The destination audio unit's input element to be used in the connection						
+}
+type
+	AudioUnitConnection = record
+		sourceAudioUnit: AudioUnit;
+		sourceOutputNumber: UInt32;
+		destInputNumber: UInt32;
+	end;
+	AudioUnitConnectionPtr = ^AudioUnitConnection;
+	
+{!
+	@struct			AUChannelInfo
+	@abstract		Define an audio unit's channel handling capabilities
+}
+type
+	AUChannelInfo = record
+		inChannels: SInt16;
+		outChannels: SInt16;
+	end;
+	AUChannelInfoPtr = ^AUChannelInfo;
+	
+{!
+	@struct			AudioUnitExternalBuffer
+	@abstract		Allow a host to tell an audio unit to use the provided memory for its input callback
+}
+type
+	AudioUnitExternalBuffer = record
+		buffer: BytePtr;
+		size: UInt32;
+	end;
+	AudioUnitExternalBufferPtr = ^AudioUnitExternalBuffer;
+	
+{!
+	@struct			AURenderCallbackStruct
+	@abstract		Used by a host when registering a callback with the audio unit to provide input
+}
+type
+	AURenderCallbackStruct = record
+		inputProc: AURenderCallback;
+		inputProcRefCon: UnivPtr;
+	end;
+	AURenderCallbackStructPtr = ^AURenderCallbackStruct;
+	
+{!
+	@struct			AUPreset
+	@abstract		Used to publish and set factory presets on an audio unit
+	@field			presetNumber
+						If < 0, then preset is a user preset
+						If >= 0, then this field is used to select the factory preset
+	@field			presetName
+						If a factory preset, the name of the specified factory preset
+}
+type
+	AUPreset = record
+		presetNumber: SInt32;
+		presetName: CFStringRef;
+	end;
+	AUPresetPtr = ^AUPreset;
+	
+{!
+	@enum			RenderQuality
+	@abstract		Used to get/set a render quality setting on an audio unit
+	@discussion		Typically, this property is used to trade-off between CPU usage, latency
+					and the quality of the audio unit's processing/output.
+}
+const
+	kRenderQuality_Max = $7F;
+	kRenderQuality_High = $60;
+	kRenderQuality_Medium = $40;
+	kRenderQuality_Low = $20;
+	kRenderQuality_Min = 0;
+
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+{!
+	@enum			kNumberOfResponseFrequencies
+	@abstract		The maximum number of frequency response bins for kAudioUnitProperty_FrequencyResponse.
+	@discussion		An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
+					with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
+					If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with 
+					a negative frequency.
+}
+const
+	kNumberOfResponseFrequencies = 1024;
+
+{!
+	@struct			AudioUnitFrequencyResponseBin
+	@abstract		Structure used to get the magnitude of the frequency response at a particular frequency via kAudioUnitProperty_FrequencyResponse. 
+	@discussion		An array of AudioUnitFrequencyResponseBin are passed in to kAudioUnitProperty_FrequencyResponse
+					with the mFrequency field filled in. The array is returned with the mMagnitude fields filled in.
+					If fewer than kNumberOfResponseFrequencies are needed, then the first unused bin should be marked with 
+					a negative frequency.
+}
+type
+	AudioUnitFrequencyResponseBin = record
+		mFrequency: Float64;
+		mMagnitude: Float64;
+	end;
+	AudioUnitFrequencyResponseBinPtr = ^AudioUnitFrequencyResponseBin;
+
+{!
+	@typedef		HostCallback_GetBeatAndTempo
+	@abstract		Retrieve information about the current beat and/or tempo
+}
+type
+	HostCallback_GetBeatAndTempo = function( inHostUserData: UnivPtr; var outCurrentBeat: Float64; var outCurrentTempo: Float64 ): OSStatus;
+
+{!
+	@typedef		HostCallback_GetMusicalTimeLocation
+	@abstract		Retrieve information about the general musical time state of the host
+}
+type
+	HostCallback_GetMusicalTimeLocation = function( inHostUserData: UnivPtr; var outDeltaSampleOffsetToNextBeat: UInt32; var outTimeSig_Numerator: Float32; var outTimeSig_Denominator: UInt32; var outCurrentMeasureDownBeat: Float64 ): OSStatus;
+
+{!
+	@typedef		HostCallback_GetTransportState
+	@abstract		Retrieve information about the time line's (or transport) state of the host
+}
+type
+	HostCallback_GetTransportState = function( inHostUserData: UnivPtr; var outIsPlaying: Boolean; var outTransportStateChanged: Boolean; var outCurrentSampleInTimeLine: Float64; var outIsCycling: Boolean; var outCycleStartBeat: Float64; var outCycleEndBeat: Float64 ): OSStatus;
+
+{!
+	@struct			HostCallbackInfo
+	@abstract		Contains the various callbacks (or NULL) for an audio unit to call
+}
+type
+	HostCallbackInfo = record
+		hostUserData: UnivPtr;
+		beatAndTempoProc: HostCallback_GetBeatAndTempo;
+		musicalTimeLocationProc: HostCallback_GetMusicalTimeLocation;
+		transportStateProc: HostCallback_GetTransportState;
+	end;
+	HostCallbackInfoPtr = ^HostCallbackInfo;
+	
+
+{!
+	@struct			AudioUnitCocoaViewInfo
+	@abstract		The name and how many, NSView objects an audio unit publishes as a custom Cocoa view.
+	@field			mCocoaAUViewBundleLocation
+						Contains the location of the bundle which the host app can then use to locate the bundle
+	@field			mCocoaAUViewClass
+						Contains the names of the classes that implements the required protocol for an AUView
+}
+type
+	AudioUnitCocoaViewInfo = record
+		mCocoaAUViewBundleLocation: CFURLRef;
+		mCocoaAUViewClass: array[0..0] of CFStringRef;
+	end;
+	AudioUnitCocoaViewInfoPtr = ^AudioUnitCocoaViewInfo;
+	
+{!
+	@struct			AUDependentParameter
+	@abstract		Used to represent a dependent parameter that can change as a result of its parent meta-parameter
+					changing
+}
+type
+	AUDependentParameter = record
+		mScope: AudioUnitScope;
+		mParameterID: AudioUnitParameterID;
+	end;
+	AUDependentParameterPtr = ^AUDependentParameter;
+	
+{!
+	@struct			AUHostVersionIdentifier
+	@abstract		Used to describe the name and version of the audio unit's host
+}
+type
+	AUHostVersionIdentifier = record
+		hostName: CFStringRef;	
+		hostVersion: UInt32;
+	end;
+	AUHostVersionIdentifierPtr = ^AUHostVersionIdentifier;
+	
+{
+	@typedef		AUMIDIOutputCallback
+	@abstract		A callback used by an audio unit to provide MIDI data to a host application
+}
+type
+	AUMIDIOutputCallback = function( userData: UnivPtr; const (*var*) timeStamp: AudioTimeStamp; midiOutNum: UInt32; {const} pktlist: MIDIPacketListPtr ): OSStatus;
+
+{!
+	@struct			AUMIDIOutputCallbackStruct
+	@abstract		Set by host application to provide the callback and user data for an audio 
+					unit that provides MIDI output
+}
+type
+	AUMIDIOutputCallbackStruct = record
+		midiOutputCallback: AUMIDIOutputCallback;
+		userData: UnivPtr;
+	end;
+	AUMIDIOutputCallbackStructPtr = ^AUMIDIOutputCallbackStruct;
+	
+{!
+	@struct			AUInputSamplesInOutputCallbackStruct
+	@abstract		Used by a host when registering a callback with an audio unit, to provide 
+					input-to-output samples mapping
+}
+type
+	AUInputSamplesInOutputCallbackStruct = record
+		inputToOutputCallback: AUInputSamplesInOutputCallback;
+		userData: UnivPtr;
+	end;
+	AUInputSamplesInOutputCallbackStructPtr = ^AUInputSamplesInOutputCallbackStruct;
+	
+{$endc} { not TARGET_OS_IPHONE }
+
+//=====================================================================================================================
+//#pragma mark - Parameter Definitions
+
+// assume kAudioUnitParameterUnit_Generic if not found in this enum
+{!
+	@enum			AudioUnitParameterUnit
+	@constant		kAudioUnitParameterUnit_Generic
+						untyped value generally between 0.0 and 1.0
+	@constant		kAudioUnitParameterUnit_Indexed
+						takes an integer value (good for menu selections)
+	@constant		kAudioUnitParameterUnit_Boolean
+						0.0 means FALSE, non-zero means TRUE
+	@constant		kAudioUnitParameterUnit_Percent
+						usually from 0 -> 100, sometimes -50 -> +50
+	@constant		kAudioUnitParameterUnit_Seconds
+						absolute or relative time
+	@constant		kAudioUnitParameterUnit_SampleFrames
+						one sample frame equals (1.0/sampleRate) seconds
+	@constant		kAudioUnitParameterUnit_Phase
+						-180 to 180 degrees
+	@constant		kAudioUnitParameterUnit_Rate
+						rate multiplier, for playback speed, etc. (e.g. 2.0 == twice as fast)
+	@constant		kAudioUnitParameterUnit_Hertz
+						absolute frequency/pitch in cycles/second
+	@constant		kAudioUnitParameterUnit_Cents
+						unit of relative pitch
+	@constant		kAudioUnitParameterUnit_RelativeSemiTones
+						useful for coarse detuning
+	@constant		kAudioUnitParameterUnit_MIDINoteNumber
+						absolute pitch as defined in the MIDI spec (exact freq may depend on tuning table)
+	@constant		kAudioUnitParameterUnit_MIDIController
+						a generic MIDI controller value from 0 -> 127
+	@constant		kAudioUnitParameterUnit_Decibels
+						logarithmic relative gain
+	@constant		kAudioUnitParameterUnit_LinearGain
+						linear relative gain
+	@constant		kAudioUnitParameterUnit_Degrees
+						-180 to 180 degrees, similar to phase but more general (good for 3D coord system)
+	@constant		kAudioUnitParameterUnit_EqualPowerCrossfade
+						0 -> 100, crossfade mix two sources according to sqrt(x) and sqrt(1.0 - x)
+	@constant		kAudioUnitParameterUnit_MixerFaderCurve1
+						0.0 -> 1.0, pow(x, 3.0) -> linear gain to simulate a reasonable mixer channel fader response
+	@constant		kAudioUnitParameterUnit_Pan
+						standard left to right mixer pan
+	@constant		kAudioUnitParameterUnit_Meters
+						distance measured in meters
+	@constant		kAudioUnitParameterUnit_AbsoluteCents
+						absolute frequency measurement : 
+						if f is freq in hertz then absoluteCents = 1200 * log2(f / 440) + 6900
+	@constant		kAudioUnitParameterUnit_Octaves
+						octaves in relative pitch where a value of 1 is equal to 1200 cents
+	@constant		kAudioUnitParameterUnit_BPM
+						beats per minute, ie tempo
+    @constant		kAudioUnitParameterUnit_Beats
+						time relative to tempo, ie. 1.0 at 120 BPM would equal 1/2 a second
+	@constant		kAudioUnitParameterUnit_Milliseconds
+						parameter is expressed in milliseconds
+	@constant		kAudioUnitParameterUnit_Ratio
+						for compression, expansion ratio, etc.
+	@constant		kAudioUnitParameterUnit_CustomUnit
+						this is the parameter unit type for parameters that present a custom unit name
+}
+const
+	kAudioUnitParameterUnit_Generic = 0;
+	kAudioUnitParameterUnit_Indexed = 1;
+	kAudioUnitParameterUnit_Boolean = 2;
+	kAudioUnitParameterUnit_Percent = 3;
+	kAudioUnitParameterUnit_Seconds = 4;
+	kAudioUnitParameterUnit_SampleFrames = 5;
+	kAudioUnitParameterUnit_Phase = 6;
+	kAudioUnitParameterUnit_Rate = 7;
+	kAudioUnitParameterUnit_Hertz = 8;
+	kAudioUnitParameterUnit_Cents = 9;
+	kAudioUnitParameterUnit_RelativeSemiTones = 10;
+	kAudioUnitParameterUnit_MIDINoteNumber = 11;
+	kAudioUnitParameterUnit_MIDIController = 12;
+	kAudioUnitParameterUnit_Decibels = 13;
+	kAudioUnitParameterUnit_LinearGain = 14;
+	kAudioUnitParameterUnit_Degrees = 15;
+	kAudioUnitParameterUnit_EqualPowerCrossfade = 16;
+	kAudioUnitParameterUnit_MixerFaderCurve1 = 17;
+	kAudioUnitParameterUnit_Pan = 18;
+	kAudioUnitParameterUnit_Meters = 19;
+	kAudioUnitParameterUnit_AbsoluteCents = 20;
+	kAudioUnitParameterUnit_Octaves = 21;
+	kAudioUnitParameterUnit_BPM = 22;
+	kAudioUnitParameterUnit_Beats = 23;
+	kAudioUnitParameterUnit_Milliseconds = 24;
+	kAudioUnitParameterUnit_Ratio = 25;
+	kAudioUnitParameterUnit_CustomUnit = 26;
+{!
+	@typedef		AudioUnitParameterUnit
+}
+type
+	AudioUnitParameterUnit = UInt32;
+
+{!
+	@struct			AudioUnitParameterInfo
+	@field			name
+						UNUSED - set to zero - UTF8 encoded C string (originally). 
+	@field			unitName
+						only valid if kAudioUnitParameterUnit_CustomUnit is set. If kAudioUnitParameterUnit_CustomUnit
+						is set, this field must contain a valid CFString.
+	@field			clumpID
+						only valid if kAudioUnitParameterFlag_HasClump
+	@field			cfNameString
+						only valid if kAudioUnitParameterFlag_HasCFNameString
+	@field			unit				
+						if the "unit" field contains a value not in the enum above, then assume 
+						kAudioUnitParameterUnit_Generic
+	@field			minValue
+	@field			maxValue
+	@field			defaultValue
+	@field			flags
+						Due to some vagaries about the ways in which Parameter's CFNames have been described, it was
+						necessary to add a flag: kAudioUnitParameterFlag_CFNameRelease
+						In normal usage a parameter name is essentially a static object, but sometimes an audio unit will 
+						generate parameter names dynamically.. As these are expected to be CFStrings, in that case
+						the host should release those names when it is finished with them, but there was no way
+						to communicate this distinction in behavior.
+						Thus, if an audio unit will (or could) generate a name dynamically, it should set this flag in 
+						the paramter's info.. The host should check for this flag, and if present, release the parameter
+						name when it is finished with it.
+}
+type
+	AudioUnitParameterInfo = record
+		name : packed array [0..51] of char;
+		unitName: CFStringRef;
+		clumpID: UInt32;
+		cfNameString: CFStringRef;
+		unt: AudioUnitParameterUnit;						
+		minValue: AudioUnitParameterValue;			
+		maxValue: AudioUnitParameterValue;			
+		defaultValue: AudioUnitParameterValue;		
+		flags: UInt32;
+	end;
+	AudioUnitParameterInfoPtr = ^AudioUnitParameterInfo;
+	
+{!
+	@enum			Audio Unit Parameter Flags
+	@discussion		Bit positions 18, 17, and 16 are set aside for display scales. Bit 19 is reserved.
+	@constant		kAudioUnitParameterFlag_CFNameRelease
+	@constant		kAudioUnitParameterFlag_MeterReadOnly
+	@constant		kAudioUnitParameterFlag_DisplayMask
+	@constant		kAudioUnitParameterFlag_DisplaySquareRoot
+	@constant		kAudioUnitParameterFlag_DisplaySquared
+	@constant		kAudioUnitParameterFlag_DisplayCubed
+	@constant		kAudioUnitParameterFlag_DisplayCubeRoot
+	@constant		kAudioUnitParameterFlag_DisplayExponential
+	@constant		kAudioUnitParameterFlag_HasClump
+	@constant		kAudioUnitParameterFlag_ValuesHaveStrings
+	@constant		kAudioUnitParameterFlag_DisplayLogarithmic		
+	@constant		kAudioUnitParameterFlag_IsHighResolution
+	@constant		kAudioUnitParameterFlag_NonRealTime
+	@constant		kAudioUnitParameterFlag_CanRamp
+	@constant		kAudioUnitParameterFlag_ExpertMode
+	@constant		kAudioUnitParameterFlag_HasCFNameString
+	@constant		kAudioUnitParameterFlag_IsGlobalMeta
+	@constant		kAudioUnitParameterFlag_IsElementMeta
+	@constant		kAudioUnitParameterFlag_IsReadable
+	@constant		kAudioUnitParameterFlag_IsWritable
+}
+const
+	kAudioUnitParameterFlag_CFNameRelease = 1 shl 4;
+	kAudioUnitParameterFlag_MeterReadOnly = 1 shl 15;
+	
+	// bit positions 18,17,16 are set aside for display scales. bit 19 is reserved.
+	kAudioUnitParameterFlag_DisplayMask = (7 shl 16) or (1 shl 22);
+	kAudioUnitParameterFlag_DisplaySquareRoot = 1 shl 16;
+	kAudioUnitParameterFlag_DisplaySquared = 2 shl 16;
+	kAudioUnitParameterFlag_DisplayCubed = 3 shl 16;
+	kAudioUnitParameterFlag_DisplayCubeRoot = 4 shl 16;
+	kAudioUnitParameterFlag_DisplayExponential = 5 shl 16;
+	kAudioUnitParameterFlag_HasClump = 1 shl 20;
+	kAudioUnitParameterFlag_ValuesHaveStrings = 1 shl 21;
+	kAudioUnitParameterFlag_DisplayLogarithmic = 1 shl 22;
+	kAudioUnitParameterFlag_IsHighResolution = 1 shl 23;
+	kAudioUnitParameterFlag_NonRealTime = 1 shl 24;
+	kAudioUnitParameterFlag_CanRamp = 1 shl 25;
+	kAudioUnitParameterFlag_ExpertMode = 1 shl 26;
+	kAudioUnitParameterFlag_HasCFNameString = 1 shl 27;
+	kAudioUnitParameterFlag_IsGlobalMeta = 1 shl 28;
+	kAudioUnitParameterFlag_IsElementMeta = 1 shl 29;
+	kAudioUnitParameterFlag_IsReadable = 1 shl 30;
+	kAudioUnitParameterFlag_IsWritable = 1 shl 31;
+
+{!
+	@enum			Audio Unit Clump ID
+	@discussion		Audio unit developers should not use a clump ID of 0. This value is reserved for system use.
+}
+const
+	kAudioUnitClumpID_System = 0;
+function GetAudioUnitParameterDisplayType(flags : UInt32) : UInt32; inline;
+function AudioUnitDisplayTypeIsLogarithmic(flags : UInt32) : Boolean; inline;
+function AudioUnitDisplayTypeIsSquareRoot(flags : UInt32) : Boolean; inline;
+function AudioUnitDisplayTypeIsSquared(flags : UInt32) : Boolean; inline;
+function AudioUnitDisplayTypeIsCubed(flags : UInt32) : Boolean; inline;
+function AudioUnitDisplayTypeIsCubeRoot(flags : UInt32) : Boolean; inline;
+function AudioUnitDisplayTypeIsExponential(flags : UInt32) : Boolean; inline;
+procedure SetAudioUnitParameterDisplayType(var flags : UInt32; displayType : UInt32); inline;
+
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+{
+	The following properties are used with display names and are only available
+	in the full desktop environment
+}
+
+{!
+	@enum			Audio Unit Parameter Full Name
+	@discussion		Used with the AudioUnitParameterNameInfo.inDesiredLength field to indicate the full name
+					of the requested parameter.
+}
+const
+	kAudioUnitParameterName_Full = -1;
+
+{!
+	@struct			AudioUnitParameterNameInfo
+	@abstract		Used to provide shorter names for a specified parameter
+}
+type
+	AudioUnitParameterNameInfo = record
+		inID: AudioUnitParameterID;
+		inDesiredLength: SInt32;
+		outName: CFStringRef;
+	end;
+	AudioUnitParameterNameInfoPtr = ^AudioUnitParameterNameInfo;
+	
+{!
+	@struct			AudioUnitParameterStringFromValue
+	@abstract		Provide a string representation of a parameter's value
+}
+type
+	AudioUnitParameterStringFromValue = record
+		inParamID: AudioUnitParameterID;
+		inValue: { const } AudioUnitParameterValuePtr;	
+		outString: CFStringRef;
+	end;
+	AudioUnitParameterStringFromValuePtr = ^AudioUnitParameterStringFromValue;
+	
+{!
+	@struct			AudioUnitParameterValueFromString
+	@abstract		Provide the parameter's value for a given string representation of it
+}
+type
+	AudioUnitParameterValueFromString = record
+		inParamID: AudioUnitParameterID;
+		inString: CFStringRef;
+		outValue: AudioUnitParameterValue;
+	end;
+	AudioUnitParameterValueFromStringPtr = ^AudioUnitParameterValueFromString;
+	
+{$endc} { not TARGET_OS_IPHONE}
+
+//=====================================================================================================================
+//#pragma mark - Output Unit
+{!
+    @enum           Output Unit Properties
+    @abstract       The collection of properties for output units
+	@constant		kAudioOutputUnitProperty_IsRunning
+	@discussion			Scope:
+						Value Type:
+						Access:
+}
+const
+// range  (2000 -> 2999)
+	kAudioOutputUnitProperty_IsRunning = 2001;
+
+//#pragma mark -
+//#pragma mark Desktop Availability
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+
+//=====================================================================================================================
+//#pragma mark - Music Effects and Instruments
+{!
+    @enum           Music Effect and Instrument Unit (MusicDevice) Properties
+    @abstract       The collection of Music Effects and Instrument Unit Property IDs
+	@discussion
+		These properties are used to:
+			Describe a current set of mappings between MIDI messages and Parameter value setting
+			Create a mapping between a parameter and a MIDI message through either:
+				- explicitly adding (or removing) the mapping
+				- telling the audio unit to hot-map the next MIDI message to a specified Parameter
+			The same MIDI Message can map to one or more parameters
+			
+		These properties normally apply only to the two types of audio units that implement 
+		the MIDI API, instrument units ('aumu') and music effects ('aumf').
+
+		These properties are used in the Global scope. The scope and element members of the structure describe
+		the scope and element of the parameter. In all usages, mScope, mElement and mParameterID must be
+		correctly specified.
+
+		
+		* The AUParameterMIDIMapping Structure
+
+		Command				mStatus			mData1			
+		Note Off			0x8n			Note Num		
+		Note On				0x9n			Note Num		
+		Key Pressure		0xAn			Note Num		
+		Control Change		0xBn			ControllerID	
+		Patch Change		0xCn			Patch Num		
+		Channel Pressure	DxDn			0 (Unused)		
+		Pitch Bend			0xEn			0 (Unused)		
+		
+		(where n is 0-0xF to correspond to MIDI channels 1-16)
+		
+		Details:
+
+		In general MIDI Commands can be mapped to either a specific channel as specified in the mStatus bit.
+		If the kAUParameterMIDIMapping_AnyChannelFlag bit is set mStatus is a MIDI channel message, then the 
+		MIDI channel number in the status byte is ignored; the mapping is from the specified MIDI message on ANY channel.
+		
+		For note commands (note on, note off, key pressure), the MIDI message can trigger either with just a specific
+		note number, or any note number if the kAUParameterMIDIMapping_AnyNoteFlag bit is set. In these instances, the
+		note number is used as the trigger value (for instance, a note message could be used to set the 
+		cut off frequency of a filter).
+		
+		When the parameter mapping list changes through addition/replace, removal, the implementation should
+		fire a notification on the kAudioUnitProperty_AllParameterMIDIMappings property. The host can then
+		retrieve the full set of mappings for the audio unit.
+		
+		When a hot mapping is made, the notification should just be delivered for the HotMap property. The host can
+		retrieve the last current hot mapping made through getting the value of that property.
+	
+	@constant		kAudioUnitProperty_AllParameterMIDIMappings
+	@discussion			Scope:				any
+						Value Type:			array of AUParameterMIDIMapping
+						Access:				read/write
+
+						This property allows setting and retreiving the current mapping state between 
+						(some/many/all of) an audio unit's parameters and MIDI messages. When set, it should replace 
+						any previous mapped settings the audio unit had.
+					
+						If this property is implemented by a non-MIDI capable audio unit (such as an 'aufx' type), 
+						then the property is read only and should recommend a suggested set of mappings for the host 
+						to perform. In this case, it is the host's responsibility to map MIDI message to the audio 
+						unit parameters.
+						
+						This property's size varies depending on the number of mappings currently in effect. A host 
+						application should always get the size of this property before retrieving it. The audio
+						unit should return an error if the host doesn't provide enough space to return all of the 
+						current mappings.
+	
+	@constant		kAudioUnitProperty_AddParameterMIDIMapping
+	@discussion			Scope:				any
+						Value Type:			array of AUParameterMIDIMapping
+						Access:				write
+						
+						Use this property to add parameter-to-MIDI mappings to an audio unit's existing set of 
+						mappings. There can be only one mapping per parameter. When you set a mapping for a parameter, 
+						it replaces the previous mapping.
+	
+	@constant		kAudioUnitProperty_RemoveParameterMIDIMapping
+	@discussion			Scope:				any
+						Value Type:			array of AUParameterMIDIMapping
+						Access:				write
+
+						Use this property to remove mappings from an audio unit. If a mapping is specified that
+						does not currently exist in an audio unit, then the audio unit should ignore the request. 
+						The Scope/Element/ParameterID is used to find the mapping to remove.
+
+	@constant		kAudioUnitProperty_HotMapParameterMIDIMapping
+	@discussion			Scope:				any
+						Value Type:			AUParameterMIDIMapping
+						Access:				read/write
+
+						This property can be used in two ways, determined by the value supplied by the host 
+						application.
+						
+						(1) If a mapping structure is provided, then that structure provides all the information 
+						that the audio unit should use to map the parameter, except for the MIDI message. The audio 
+						unit should then listen for the next MIDI message and associate that MIDI message with the 
+						supplied parameter mapping. When this MIDI message is received and the mapping made, the 
+						audio unit should also issue a notification on this property to indicate to the host that 
+						the mapping has been made. The host can then retrieve the mapping that was made by getting the 
+						value of this property.
+						
+						To avoid possible confusion, it is recommended that once the host has retrieved this mapping 
+						(if it is presenting a user interface to describe the mappings, for example), that the host
+						should then clear the mapping state, as described in (2).
+						
+						The only time this property will return a valid value is when an audio unit has implemented the 
+						requested mapping. If the audio unit's mapping state has been cleared (or if it has not been 
+						asked to make a mapping), then the audio unit should return a kAudioUnitErr_InvalidPropertyValue 
+						error when the host tries to read this property's value.
+						
+						(2) If the value passed in this property is NULL, and if the audio unit had a parameter that 
+						it was in the process of mapping, the audio unit should disregard the parameter mapping request 
+						and discard the partially mapped structure. If the value is NULL and the audio unit is not in 
+						the process of mapping, the audio unit can just ignore the request.
+						
+						At all times, the _AllMappings property will completely describe the current known state of an 
+						audio unit's mappings of MIDI messages to parameters.		
+}
+const
+	kAudioUnitProperty_AllParameterMIDIMappings = 41;
+	kAudioUnitProperty_AddParameterMIDIMapping = 42;
+	kAudioUnitProperty_RemoveParameterMIDIMapping = 43;
+	kAudioUnitProperty_HotMapParameterMIDIMapping = 44;
+	
+{!
+	@enum			ParameterMIDIMappings
+	@abstract		General defined values to customize the behavior of parameter-to-MIDI mappings
+
+	@constant		kAUParameterMIDIMapping_AnyChannelFlag
+	@discussion			If this flag is set and the value of the mStatus field is a MIDI channel message, then 
+						the MIDI channel number in the status byte is ignored; the mapping is from the specified 
+						MIDI message on any channel.
+	
+	@constant		kAUParameterMIDIMapping_AnyNoteFlag
+	@discussion			If this flag is set and the value of the mStatus field is a Note On, Note Off, or 
+						Polyphonic Pressure message, the message's note number is ignored. The mapping is from 
+						any note number.
+	
+	@constant		kAUParameterMIDIMapping_SubRange
+	@discussion			Set this flag if the MIDI control should map only to a sub-range of the parameter's value.
+						Then specify that range in the mSubRangeMin and mSubRangeMax member fields.
+						
+	@constant		kAUParameterMIDIMapping_Toggle
+	@discussion			Intended for Boolean typed parameters. When this property is set, it means that the 
+						parameter's value should be toggled when the mapped MIDI message is received. For example,
+						if the parameter's value is currently TRUE, when the mapped MIDI message is received
+						the value changes to FALSE. 
+
+	@constant		kAUParameterMIDIMapping_Bipolar
+	@discussion			This property is useful when mapping a parameter to a MIDI Controller. When set, it 
+						indicates that the parameter can assume only two values: on or off. For this reason, a 
+						parameter associated with this property is typically Boolean. For example, if this 
+						property is set for a parameter mapped to a sustain pedal MIDI controller, controller 
+						values from 0 to 64 result in the parameter switched to its "off" state; controller
+						values from 65 to 127 result in the parameter switched to its "on" state.
+						
+						This property works in connection with the kAUParameterMIDIMapping_Bipolar_On property.
+						The value of the kAUParameterMIDIMapping_Bipolar_On property 
+
+	@constant		kAUParameterMIDIMapping_Bipolar_On
+	@discussion			Determines whether the  "on" state of a parameter is mapped to the "on" or "off" state 
+						of the associated MIDI controller. Only valid  if the  kAUParameterMIDIMapping_Bipolar 
+						property is set.
+}
+const
+	kAUParameterMIDIMapping_AnyChannelFlag = 1 shl 0;
+	kAUParameterMIDIMapping_AnyNoteFlag = 1 shl 1;
+	kAUParameterMIDIMapping_SubRange = 1 shl 2;
+	kAUParameterMIDIMapping_Toggle = 1 shl 3;
+	kAUParameterMIDIMapping_Bipolar = 1 shl 4;
+	kAUParameterMIDIMapping_Bipolar_On = 1 shl 5;
+
+{!
+	@struct			AUParameterMIDIMapping
+	@abstract		Represents a mapping between a MIDI message and an audio unit's parameter.
+	@discussion		The reserved fields in this structure are for future use. In the current implementation, 
+					they help align the structure to 64 bit size. Do not use the names of these fields in a 
+					host application. They are subject to change.
+}
+type
+	AUParameterMIDIMapping = record
+		mScope: AudioUnitScope;
+		mElement: AudioUnitElement;
+		mParameterID: AudioUnitParameterID;
+		mFlags: UInt32;
+		mSubRangeMin: AudioUnitParameterValue;
+		mSubRangeMax: AudioUnitParameterValue;
+		mStatus: UInt8;
+		mData1: UInt8;
+		reserved1: UInt8; // MUST be set to zero
+		reserved2: UInt8; // MUST be set to zero
+		reserved3: UInt32; // MUST be set to zero
+	end;
+	AUParameterMIDIMappingPtr = ^AUParameterMIDIMapping;
+
+//=====================================================================================================================
+//#pragma mark - Music Device
+{!
+    @enum           Instrument Unit (MusicDevice) Properties
+    @abstract       The collection of Instrument Unit Property IDs
+
+	@constant		kMusicDeviceProperty_InstrumentCount
+	@discussion			Scope:				Global
+						Value Type:			UInt32
+						Access:				read
+						
+						For a mono-timbral music instrument, this property should return 0 (it should be implemented).
+						
+						For a multi-timbral music instrument, this property can return the number of independent patches that
+						are available to be chosen as an active patch for the instrument. For instance, for Apple's DLS Music Device
+						this value returns the number of patches that are found in a given DLS or SoundFont file when loaded.
+
+	@constant		kMusicDeviceProperty_MIDIXMLNames
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_PartGroup
+	@discussion			Scope:				Part
+						Value Type:			AudioUnitElement
+						Access:				read/write
+
+						This property's value specifies the group ID (the Group scope's element) 
+						that the part is (or should be) assigned to. The property is used in the Part scope, 
+						where the element ID is the part that is being queried (or assigned).
+						
+						This property may be implemented in an audio unit as read only, as writeable only if the 
+						audio unit is uninitialized, or as read/write. Apple recommends that it should be 
+						writable at any time.
+						
+						The effect of assigning a new group to a part is undefined. Typically, however, it can be 
+						expected that all existing notes would be turned off before the re-assignment is made by 
+						the audio unit.
+
+	@constant		kMusicDeviceProperty_DualSchedulingMode
+	@discussion			Scope:				Global
+						Value Type:			UInt32
+						Access:				write
+
+						Some instrument units need to distinguish realtime note and control events (such as from 
+						incoming MIDI) from sequenced or pre-scheduled events. To support this, a host application 
+						may set this property to 1. If the instrument unit returns a value of noErr, it supports 
+						an alternate interpretation of the inOffsetSampleFrame parameter for the following 
+						functions:
+
+							MusicDeviceMIDIEvent
+							MusicDeviceStartNote
+							MusicDeviceStopNote
+							AudioUnitSetParameter
+
+						Once the host sets this property to 1 and the instrument unit returns noErr, the 
+						inOffsetSampleFrame field becomes a bitfield:
+
+							kMusicDeviceSampleFrameMask_SampleOffset = 0xFFFFFF // AND with this to obtain sample offset
+							kMusicDeviceSampleFrameMask_IsScheduled = 0x01000000
+
+						The IsScheduled bit should be set on events which are being scheduled ahead of time from 
+						a prerecorded track. The IsScheduled bit should be clear on events which are being sent 
+						to the instrument unit in response to realtime events, such as incoming MIDI or control 
+						changes in a view.
+
+	@constant		kMusicDeviceProperty_SupportsStartStopNote
+	@discussion			Scope:				Global
+						Value Type:			UInt32
+						Access:				read
+						
+						The MusicDeviceStartNote and MusicDeviceStopNote APIs have been available since Mac OS X v10.0. 
+						However, many third-party audio units do not implement these calls. This property can
+						be used to determine if an audio unit does provide a compliant implementation. A compliant
+						audio unit will both implement the property and return !0 as the value for the property. 
+						Apple's DLSMusicDevice unit has implemented MusicDeviceStartNote and MusicDeviceStopNote
+						since Mac OS X v10.0. The kMusicDeviceProperty_SupportsStartStopNote property was introduced
+						with Mac OS X v10.5, so the DLSMusicDevice unit will not return an appropriate value for
+						this property on a pre-10.5 system.
+						
+}	
+const
+// range  (1000 -> 1999)
+	kMusicDeviceProperty_InstrumentCount = 1000;
+	kMusicDeviceProperty_MIDIXMLNames = 1006;
+	kMusicDeviceProperty_PartGroup = 1010;
+	kMusicDeviceProperty_DualSchedulingMode = 1013;
+	kMusicDeviceProperty_SupportsStartStopNote = 1014;
+
+{!
+	@enum			DualSchedulingMode
+}
+const
+	kMusicDeviceSampleFrameMask_SampleOffset = $FFFFFF; // AND with this to obtain the sample offset
+	kMusicDeviceSampleFrameMask_IsScheduled = $01000000;
+
+//=====================================================================================================================
+//#pragma mark - Offline Unit
+{!
+    @enum           Offline Unit Properties
+    @abstract       The collection of properties for offline units 
+	@constant		kAudioUnitOfflineProperty_InputSize
+	@discussion			Scope:			Global
+						Value Type:		UInt64
+						Access:			read/write
+
+						Once this property is set, an audio unit will assume that its input samples 
+						have been reset to a new region. Setting this property will also cause the 
+						audio unit's internal DSP state to be reset. That is, the audio unit calls 
+						the AudioUnitReset function on itself.
+						
+						This property tells the offline unit how many samples to process. Once it 
+						knows this number it will then request from 0 to (nSamples-1) in its input
+						callback. The host of the audio unit is then required to provide the samples 
+						specified in the sample count field of that Input's callback.
+
+	@constant		kAudioUnitOfflineProperty_OutputSize
+	@discussion			Scope:			Global
+						Value Type:		UInt64
+						Access:			read
+						
+						The host can use this property to estimate how many output samples an audio 
+						unit will produce for the specified input samples. The property value
+						is invalid if InputSize is not set. 
+						
+						The host cannot assume that the value returned is exact.
+						It is a guide only, so is suitable for use in a progress bar, for instance.
+						
+						Termination of processing is solely determined by the setting of the 
+						kAudioUnitStatus_OfflineRenderComplete property in the 
+						ioRenderActionFlags from the AudioUnitRender function.
+
+	@constant		kAudioUnitOfflineProperty_StartOffset
+	@discussion			Scope:			Global
+						Value Type:		UInt64
+						Access:			read/write
+
+						The host sets this property to tell an audio unit that the start offset of 
+						the data it is processing has been changed. This should be set along with 
+						the InputSize property, so that the unit knows its input data has been set 
+						or changed.
+
+	@constant		kAudioUnitOfflineProperty_PreflightRequirements
+	@discussion			Scope:			Global
+						Value Type:		UInt32
+						Access:			read
+
+						Returns one of the kOfflinePreflight_ results (see the Offline Preflight 
+						enumeration).
+						
+	@constant		kAudioUnitOfflineProperty_PreflightName
+	@discussion			Scope:			Global
+						Value Type:		CFStringRef
+						Access:			read
+
+						For an audio unit that allows or requires preflighting, this property lets
+						the unit give its host application a name to describe the preflight 
+						operations.
+}
+const
+// range (3020->3040)
+	kAudioUnitOfflineProperty_InputSize = 3020;
+	kAudioUnitOfflineProperty_OutputSize = 3021;
+	kAudioUnitOfflineProperty_StartOffset = 3022;
+	kAudioUnitOfflineProperty_PreflightRequirements = 3023;
+	kAudioUnitOfflineProperty_PreflightName = 3024;
+
+{!
+	@enum		Offline Preflight Flags
+	@abstract	Used to indicate an Offline Unit's preflight requirements
+	@constant	kOfflinePreflight_NotRequired
+	@discussion		Offline unit does not require preflight
+	@constant	kOfflinePreflight_Optional
+	@discussion		Offline unit will generally behave better if it is preflighted, but it is not
+					required to be preflighted.
+	@constant	kOfflinePreflight_Required
+	@discussion		Offline unit requires preflighting or it cannot do its work
+
+}
+const
+	kOfflinePreflight_NotRequired = 0;
+	kOfflinePreflight_Optional = 1;
+	kOfflinePreflight_Required = 2;
+
+//=====================================================================================================================
+//#pragma mark - Panner Unit
+{!
+    @enum           Panner Unit Properties
+    @abstract       The collection of properties for panner units
+	@constant		kAudioUnitProperty_DistanceAttenuationData
+	@discussion			Scope:			Global
+						Value Type:		AUDistanceAttenuationData
+						Access:			Read
+}
+const
+// range (3060->3999)
+	kAudioUnitProperty_DistanceAttenuationData = 3600;
+
+{!
+	@struct			AUDistanceAttenuationData
+}
+type
+	AUDistanceAttenuationDataPairsRec = record
+		inDistance: Float32;	// 0-1000
+		outGain: Float32;	// 0-1
+	end;
+	AUDistanceAttenuationDataPairsRecPtr = ^AUDistanceAttenuationDataPairsRec;
+	
+	AUDistanceAttenuationData = record
+		inNumberOfPairs: UInt32;
+		pairs: array[0..0] of AUDistanceAttenuationDataPairsRec; // this is a variable length array of inNumberOfPairs elements
+	end;
+	AUDistanceAttenuationDataPtr = ^AUDistanceAttenuationData;
+
+
+//=====================================================================================================================
+//#pragma mark - Translation Service
+{!
+    @enum           Translation Properties
+    @abstract       The collection of properties for migrating data from other audio plug-ins to the 
+    				Audio Unit architecture
+	@discussion		While this is a general service, there are two formats that are explicitly defined: 
+					MAS and VST. An audio unit may have MAS settings given to it in one of two ways:
+
+						(1) The settings may have a single setting. This may be set multiple times with 
+						different settings each time. In this case, numberOfSettings will be 1.
+
+						(2) The settings may be set in one hit, providing all SettingData at once. 
+						In this case, numberOfSettings may be more than 1, and will be the number of 
+						settings the host has from the MAS plugin.
+
+						AU-VST - the CFDataRef data contains VST chunk data with no additional information. 
+
+					In addition, this can be used to migrate settings from an older audio unit; this allows manufacturers 
+					to deprecate older audio units and replace them with new ones. The data for the older audio unit is 
+					the audio unit preset CFDictionary that that unit generated.
+
+	@constant		kAudioUnitMigrateProperty_FromPlugin
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitMigrateProperty_OldAutomation
+	@discussion			Scope:
+						Value Type:
+						Access:
+}
+const
+// range (4000->4020)
+	kAudioUnitMigrateProperty_FromPlugin = 4000;
+	kAudioUnitMigrateProperty_OldAutomation = 4001;
+
+{!
+	@enum			Other Plug-in Formats
+}
+const
+	kOtherPluginFormat_Undefined = 0; //reserving this value for future use
+	kOtherPluginFormat_kMAS = 1;
+	kOtherPluginFormat_kVST = 2;
+	kOtherPluginFormat_AU = 3;
+
+{!
+	@struct			AudioUnitOtherPluginDesc
+	@discussion
+
+	@field			format
+	@discussion			One of the OtherPluginFormat values
+						
+	@field			plugin
+	@discussion			struct AudioClassDescription (
+							OSType mType;
+							OSType mSubType;
+							OSType mManufacturer;
+						);
+						is defined in <CoreAudio/CoreAudioTypes.h>
+
+					mType specifies a generic, plug-in format defined descriptor
+							mSubType is usually left to the manufacturer to use at their discretion
+							mManufacturer is a registered code to identify all plugins from the same manufacturer
+
+}
+type
+	AudioUnitOtherPluginDesc = record
+		format: UInt32;
+		plugin: AudioClassDescription;
+	end;
+	AudioUnitOtherPluginDescPtr = ^AudioUnitOtherPluginDesc;
+
+{!
+	@struct			AudioUnitParameterValueTranslation
+	@abstract		Used to translate another plug-in's parameter values to  audio unit parameter 
+					values
+}
+type
+	AudioUnitParameterValueTranslation = record
+		otherDesc: AudioUnitOtherPluginDesc;
+		otherParamID: UInt32;
+		otherValue: Float32;
+		auParamID: AudioUnitParameterID;
+		auValue: AudioUnitParameterValue;
+	end;
+	AudioUnitParameterValueTranslationPtr = ^AudioUnitParameterValueTranslation;
+
+{!
+	@struct			AudioUnitPresetMAS_SettingData
+	@discussion		AU-MAS specific structs for the data contained in the "masdata" key of an audio 
+					unit preset dictionary
+}
+type
+	AudioUnitPresetMAS_SettingData = record
+		isStockSetting: UInt32; // zero or 1  i.e. "long bool"
+		settingID: UInt32;
+		dataLen: UInt32; //length of following data
+		data: array[0..0] of UInt8;
+	end;
+	AudioUnitPresetMAS_SettingDataPtr = ^AudioUnitPresetMAS_SettingData;
+	
+{!
+	@struct			AudioUnitPresetMAS_Settings
+	@discussion		See MAS documentation
+}
+type
+	AudioUnitPresetMAS_Settings = record
+		manufacturerID: UInt32;
+		effectID: UInt32;
+		variantID: UInt32;
+		settingsVersion: UInt32;
+		numberOfSettings: UInt32;
+	 	settings: array[0..0] of AudioUnitPresetMAS_SettingData;
+	end;
+
+{$endc}	{ not TARGET_OS_IPHONE }
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Apple Specific Properties
+
+//=====================================================================================================================
+//#pragma mark - AUConverter
+{!
+    @enum           Apple AUConverter Property IDs
+    @abstract       The collection of property IDs for Apple AUConverter
+	
+	@constant		kAudioUnitProperty_SampleRateConverterComplexity
+	@discussion			Scope:			Global
+						Value Type:		UInt32
+						Access:			read/write
+}
+const
+	kAudioUnitProperty_SampleRateConverterComplexity = 3014;
+
+{!
+	@enum			Audio Unit Sample Rate Converter Complexity
+	@discussion		The lowest quality of the Mastering algorithm is higher than the highest quality of the Normal algorithm.
+	@constant		kAudioUnitSampleRateConverterComplexity_Normal
+	@discussion			Normal quality sample rate conversion.
+	@constant		kAudioUnitSampleRateConverterComplexity_Mastering
+	@discussion			Mastering quality sample rate conversion. More expensive.
+}
+const
+	kAudioUnitSampleRateConverterComplexity_Linear = FourCharCode('line');	// linear interpolation
+	kAudioUnitSampleRateConverterComplexity_Normal = FourCharCode('norm');	// the default
+	kAudioUnitSampleRateConverterComplexity_Mastering = FourCharCode('bats');	// higher quality, more expensive
+
+//=====================================================================================================================
+//#pragma mark - AUHAL and device units
+{!
+    @enum           Apple Output Property IDs
+    @abstract       The collection of property IDs for Apple output units
+	
+	@constant		kAudioOutputUnitProperty_CurrentDevice
+	@discussion			Scope:			Global
+						Value Type:		AudioDeviceID
+						Access:			read/write
+						
+						The audio device being used (or to be used) by and output device unit
+						
+	@constant		kAudioOutputUnitProperty_ChannelMap
+	@discussion			Scope:			Input/Output
+						Value Type:		Array of UInt32
+						Access:			Read / Write
+
+						This will also work with AUConverter. This property is used to map input channels from an input (source) to a destination.
+						The number of channels represented in the channel map is the number of channels of the destination. The channel map entries
+						contain a channel number of the source that should be mapped to that destination channel. If -1 is specified, than that 
+						destination channel will not contain any channel from the source (so it will be silent)
+						
+	@constant		kAudioOutputUnitProperty_EnableIO
+	@discussion			Scope: ( scope output, element 0 = output ) ( scope input, element 1 = input )
+						Value Type: UInt32
+						Access: read/write
+							Output units default to output-only operation. Host applications may disable 
+							output or enable input operation using this property, if the output unit 
+							supports it. 0=disabled, 1=enabled using I/O proc.
+
+	@constant		kAudioOutputUnitProperty_StartTime
+	@discussion			Scope: Global
+						Value Type: AudioOutputUnitStartAtTimeParams
+						Access: write only
+							When this property is set on an output unit, it will cause the next Start request
+							(but no subsequent Starts) to use AudioDeviceStartAtTime, using the specified 
+							timestamp, passing false for inRequestedStartTimeIsInput.
+
+	@constant		kAudioOutputUnitProperty_SetInputCallback
+	@discussion			Scope: Global
+						Value Type: AURenderCallbackStruct
+						Access: read/write
+							When an output unit has been enabled for input operation, this callback can be 
+							used to provide a single callback to the host application from the input 
+							I/O proc, in order to notify the host that input is available and may be 
+							obtained by calling the AudioUnitRender function.
+
+	@constant		kAudioOutputUnitProperty_HasIO
+	@discussion			Scope: ( scope output, element 0 = output ) ( scope input, element 1 = input )
+						Value Type: UInt32
+						Access:
+							See kAudioOutputUnitProperty_EnableIO
+							Property value is 1 if input or output is enabled on the specified element.
+
+	@constant		kAudioOutputUnitProperty_StartTimestampsAtZero
+	@discussion			Scope: Global
+						Value Type: UInt32
+						Access: read/write
+
+							Apple output units typically begin their stream of timestamps presented to their
+							inputs at sample time 0. Some applications may wish to receive the HAL's timestamps
+							directly instead. When this property is set to false, the output unit's sample times
+							will be direct reflections of the HAL's -- except when a sample rate conversion
+							makes this impossible.
+							
+							This property also applies to AUConverter. Its value defaults to 1 for AUHAL;
+							1 for other AUs.
+}
+const
+	kAudioOutputUnitProperty_CurrentDevice = 2000;
+	kAudioOutputUnitProperty_ChannelMap = 2002; // this will also work with AUConverter
+	kAudioOutputUnitProperty_EnableIO = 2003;
+	kAudioOutputUnitProperty_StartTime = 2004;
+	kAudioOutputUnitProperty_SetInputCallback = 2005;
+	kAudioOutputUnitProperty_HasIO = 2006;
+	kAudioOutputUnitProperty_StartTimestampsAtZero = 2007;	// this will also work with AUConverter
+
+{!
+	@struct			AudioOutputUnitStartAtTimeParams
+}
+type
+	AudioOutputUnitStartAtTimeParams = record
+	// see AudioDeviceStartAtTime
+		mTimestamp: AudioTimeStamp;
+		mFlags: UInt32;
+	end;
+	AudioOutputUnitStartAtTimeParamsPtr = ^AudioOutputUnitStartAtTimeParams;
+
+//=====================================================================================================================
+//#pragma mark - Mixers
+{!
+    @enum           Apple Mixer Property IDs
+    @abstract       The collection of property IDs for Apple mixers
+	
+	@constant		kAudioUnitProperty_MeteringMode
+	@discussion			Scope: ( scope / element )
+						Value Type: UInt32
+						Access: read/write
+						
+						Enable or disable metering on a particular scope/element
+
+	@constant		kAudioUnitProperty_MatrixLevels
+	@discussion			Scope:			Global
+						Value Type:		Float32 array
+						Access:			Read
+						
+						This property is used to retrieve the entire state of a matrix mixer. The size required is
+						the number of (input  channels + 1) * (output channels + 1) - see _MatrixDimensions
+						
+						So a matrix mixer that has 2 input channels and 2 output channels, will need a 3 x 3 array of Float32
+						  
+						Global volume is stored at volumes[2][2]
+						Input volumes are stored in the last column (volumes[0][2] for the first input channel,  volumes[1][2] for the second)
+						Output volumes are stored in the last row (volumes [2][0] and [2][1])
+						Cross point volumes are stored at their expected locations ([0][1], etc)
+						
+	@constant		kAudioUnitProperty_MatrixDimensions
+	@discussion			Scope:			Global
+						Value Type:		2 x UInt32
+						Access:			Read only
+							
+						Returns the total number of channels for input and output of a given matrix mixer
+
+	@constant		kAudioUnitProperty_MeterClipping
+	@discussion			Scope:			Global
+						Value Type:		AudioUnitMeterClipping
+						Access:			Read
+						
+						A mixer returns an AudioUnitMeterClipping structure.
+
+}
+const
+// General mixers
+	kAudioUnitProperty_MeteringMode = 3007;
+	
+	// Matrix Mixer
+	kAudioUnitProperty_MatrixLevels = 3006;
+	kAudioUnitProperty_MatrixDimensions = 3009;
+	kAudioUnitProperty_MeterClipping = 3011;
+
+{!
+	@struct			AudioUnitMeterClipping
+	
+	@field			peakValueSinceLastCall; 
+	@discussion			The maximum value seen on the channel since the last time the property was retrieved.
+	@field			sawInfinity;
+	@discussion			TRUE if there was an infinite value on this channel.
+	@field			sawNotANumber
+	@discussion			TRUE if there was a floating point Not-A-Number value on this channel.
+}
+type
+	AudioUnitMeterClipping = record
+		peakValueSinceLastCall: Float32; 
+		sawInfinity: Boolean;
+		sawNotANumber: Boolean;
+	end;
+	AudioUnitMeterClippingPtr = ^AudioUnitMeterClipping;
+
+//=====================================================================================================================
+//#pragma mark - _3DMixer
+{!
+    @enum           Apple Mixer Property IDs
+    @abstract       The collection of property IDs for Apple mixers
+	
+	@constant		kAudioUnitProperty_MeteringMode
+	@discussion			Scope: ( scope / element )
+						Value Type: UInt32
+						Access: read/write
+						
+						Enable or disable metering on a particular scope/element
+
+	@constant		kAudioUnitProperty_SpatializationAlgorithm
+	@discussion			Scope:			Input
+						Value Type:		UInt32
+						Access:			Read / Write
+						
+						Used to set the spatialisation algorithm used by an input of the 3DMixer. See kSpatializationAlgorithm_
+						
+	@constant		kAudioUnitProperty_DopplerShift
+	@discussion			Scope:			Input
+						Value Type:		UInt32
+						Access:			Write
+						
+						Use a boolean true/false value to enable doppler shift for any specified input
+						
+	@constant		kAudioUnitProperty_3DMixerRenderingFlags
+	@discussion			Scope:			Input
+						Value Type:		UInt32
+						Access:			Read / Write
+
+						Used to enable various rendering operations on a given input for the 3DMixer. See k3DMixerRenderingFlags_
+						
+	@constant		kAudioUnitProperty_3DMixerDistanceAtten
+	@discussion			Scope:			
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_3DMixerDistanceParams
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_ReverbPreset
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_3DMixerAttenuationCurve 
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_MatrixLevels
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_MatrixDimensions
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_MeterClipping
+	@discussion			Scope:
+						Value Type: AudioUnitMeterClipping
+						Access:
+							A mixer returns an AudioUnitMeterClipping structure.
+
+}
+const
+	kAudioUnitProperty_3DMixerDistanceParams = 3010;
+	kAudioUnitProperty_3DMixerAttenuationCurve = 3013;
+	kAudioUnitProperty_SpatializationAlgorithm = 3000;
+	kAudioUnitProperty_DopplerShift = 3002;
+	kAudioUnitProperty_3DMixerRenderingFlags = 3003;
+	kAudioUnitProperty_3DMixerDistanceAtten = 3004;
+	kAudioUnitProperty_ReverbPreset = 3012;
+
+{!
+	@enum 3D Mixer Attenuation Curves
+}
+const
+	k3DMixerAttenuationCurve_Power = 0;
+	k3DMixerAttenuationCurve_Exponential = 1;
+	k3DMixerAttenuationCurve_Inverse = 2;
+	k3DMixerAttenuationCurve_Linear = 3;
+
+{!
+	@struct			MixerDistanceParams
+}
+type
+	MixerDistanceParams = record
+		mReferenceDistance: Float32;
+		mMaxDistance: Float32;
+		mMaxAttenuation: Float32;	// in decibels
+	end;
+	MixerDistanceParamsPtr = ^MixerDistanceParams;
+
+{!
+	@enum 	Spatialization Algorithms
+}
+const
+	kSpatializationAlgorithm_EqualPowerPanning = 0;
+	kSpatializationAlgorithm_SphericalHead = 1;
+	kSpatializationAlgorithm_HRTF = 2;
+	kSpatializationAlgorithm_SoundField = 3;
+	kSpatializationAlgorithm_VectorBasedPanning = 4;
+	kSpatializationAlgorithm_StereoPassThrough = 5;
+
+{!
+	@enum	3D Mixer Rendering Flags
+}
+const
+	k3DMixerRenderingFlags_InterAuralDelay = 1 shl 0;
+	k3DMixerRenderingFlags_DopplerShift = 1 shl 1;
+	k3DMixerRenderingFlags_DistanceAttenuation = 1 shl 2;
+	k3DMixerRenderingFlags_DistanceFilter = 1 shl 3;
+	k3DMixerRenderingFlags_DistanceDiffusion = 1 shl 4;
+	k3DMixerRenderingFlags_LinearDistanceAttenuation = 1 shl 5;
+	k3DMixerRenderingFlags_ConstantReverbBlend = 1 shl 6;
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Desktop Apple Specific Properties
+
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+
+//=====================================================================================================================
+//#pragma mark - DLSMusicDevice and Internal Reverb
+{!
+    @enum           Generic Property IDs
+    @abstract       The collection of general audio unit property IDs
+	
+	@constant		kAudioUnitProperty_ReverbRoomType
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAudioUnitProperty_UsesInternalReverb
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_InstrumentName
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_InstrumentNumber
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_BankName
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_SoundBankData
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_StreamFromDisk
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_SoundBankFSRef
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kMusicDeviceProperty_SoundBankURL
+	@discussion			Scope:
+						Value Type:
+						Access:
+}
+const
+	kAudioUnitProperty_ReverbRoomType = 10;
+
+	// 3DMixer, DLSMusicDevice
+	kAudioUnitProperty_UsesInternalReverb = 1005;
+
+	// DLS Music Device
+	kMusicDeviceProperty_InstrumentName = 1001;
+	kMusicDeviceProperty_InstrumentNumber = 1004;
+	kMusicDeviceProperty_UsesInternalReverb = kAudioUnitProperty_UsesInternalReverb;
+	kMusicDeviceProperty_BankName = 1007;
+	kMusicDeviceProperty_SoundBankData = 1008;
+	kMusicDeviceProperty_StreamFromDisk = 1011;
+	kMusicDeviceProperty_SoundBankFSRef = 1012;
+	kMusicDeviceProperty_SoundBankURL = 1100;
+
+{!
+	@enum	Reverb Room Types
+	@discussion Used to specify room type (as identified by a factory preset number) on Apple audio 
+				units that use internal reverb.
+}
+const
+	kReverbRoomType_SmallRoom = 0;
+	kReverbRoomType_MediumRoom = 1;
+	kReverbRoomType_LargeRoom = 2;
+	kReverbRoomType_MediumHall = 3;
+	kReverbRoomType_LargeHall = 4;
+	kReverbRoomType_Plate = 5;
+	kReverbRoomType_MediumChamber = 6;
+	kReverbRoomType_LargeChamber = 7;
+	kReverbRoomType_Cathedral = 8;
+	kReverbRoomType_LargeRoom2 = 9;
+	kReverbRoomType_MediumHall2 = 10;
+	kReverbRoomType_MediumHall3 = 11;
+	kReverbRoomType_LargeHall2 = 12;
+
+//=====================================================================================================================
+//#pragma mark - AUScheduledSoundPlayer
+{!
+    @enum           Apple AUScheduledSoundPlayer Property IDs
+    @abstract       The collection of property IDs for the Apple AUScheduledSoundPlayer audio unit.
+
+	@discussion		The AUScheduledSoundPlayer audio unit lets a client schedule audio buffers for
+					future playback, with sample-accurate timing.
+					
+					
+					Elements and Formats
+					
+					This unit has one output element and no input elements. The output's format
+					should be a canonical audio unit stream format (native Float32, deinterleaved).
+
+
+					Scheduling
+
+					To schedule slices of audio for future playback, set the
+					kAudioUnitProperty_ScheduleAudioSlice property, with a ScheduledAudioSlice
+					structure as the property value. The slice's mTimeStamp.mSampleTime field
+					determines when the slice will be played. This sample number is relative to
+					the unit's start time, which you must set using the
+					kAudioUnitProperty_ScheduleStartTimeStamp property before playback will
+					begin.
+
+					You must retain, unmodified, the ScheduledAudioSlice structure, including
+					its mBufferList and the buffers to which it points, until the slice has been
+					completely played, or until you stop playback by uninitializing or resetting
+					the unit. The format of the slice's buffer list must match the unit's output
+					stream format.
+					
+					(The fields other than mSampleTime and mFlags in the mTimestamp structure are 
+					currently ignored.)
+					
+					
+					Completion
+					
+					To receive a callback when the slice has been played, store a pointer to a
+					callback function in the mCompletionProc field. This function will be called 
+					(from the audio unit's rendering thread) when the slice has been completely 
+					played -- or when the slice is determined to be unplayable due to an error. 
+					As an alternative, you may also poll the slice's 
+					(mFlags & kScheduledAudioSliceFlag_Complete).
+
+					Upon completion, you can test (mFlags & kScheduledAudioSliceFlag_BeganToRenderLate) 
+					to determine whether some portion of the slice was not played due to its having 
+					been scheduled too late relative to the current playback time.
+					
+					
+					Start Time
+					
+					The audio unit will not play any slices following initialization or reset, until
+					its start time has been set. The start time establishes the beginning of a
+					timeline: the timestamps of all slices in the schedule are relative to the
+					start time.
+
+					Set a start time by setting the kAudioUnitProperty_ScheduleStartTimeStamp 
+					property with an AudioTimeStamp structure. If the timestamp contains a valid 
+					sample time (timestamp.mFlags & kAudioTimeStampSampleTimeValid), then playback 
+					begins when the timestamp passed to the AudioUnitRender function reaches the 
+					specified sample time. If the specified sample time is -1, playback begins on 
+					the next render cycle.
+					
+					If the start timestamp does not contain a valid sample time, but does contain a
+					valid host time (timestamp.mFlags & kAudioTimeStampHostTimeValid), then the
+					specified host time is translated to the sample time at which playback will
+					begin. A host time of 0 means "start on the next render cycle."
+					
+					The kAudioUnitProperty_ScheduleStartTimeStamp property may be queried to obtain 
+					the time at which playback began. If the start time has not yet been reached,
+					the timestamp returned will be whatever the host application last set.
+					
+					
+					Current play time
+					
+					The kAudioUnitProperty_CurrentPlayTime property may be queried to determine the 
+					audio unit's current time offset from its start time. This is useful, for 
+					example, to monitor playback progress.
+					
+					
+					Unscheduling events
+					
+					To clear an audio unit's play schedule, call the AudioUnitReset function. The 
+					completion proc (if any) for each slice in the schedule will called. Playback 
+					will not resume until a new start time has been set. This also happens when 
+					the audio unit is uninitialized.
+	
+	@constant		kAudioUnitProperty_ScheduleAudioSlice
+	@discussion			Scope:
+						Value Type: ScheduledAudioSlice
+						Access:
+
+	@constant		kAudioUnitProperty_ScheduleStartTimeStamp
+	@discussion			Scope:
+						Value Type: AudioTimeStamp
+						Access:
+							Sample time or host time valid. Sample time takes precedence, 
+							-1 means "now". Host time of 0 means "now."
+							
+	@constant		kAudioUnitProperty_CurrentPlayTime
+	@discussion			Scope:
+						Value Type: AudioTimeStamp
+						Access:
+							AudioTimeStamp, relative to start time, sample time of -1 if not yet started.
+}
+const
+	kAudioUnitProperty_ScheduleAudioSlice = 3300;
+	kAudioUnitProperty_ScheduleStartTimeStamp = 3301;
+	kAudioUnitProperty_CurrentPlayTime = 3302;
+
+{!
+	@enum			ScheduledAudioSlice
+	@abstract		bits in ScheduledAudioSlice.mFlags
+	@constant		kScheduledAudioSliceFlag_Complete
+						Set if the unit is done with this slice
+	@constant		kScheduledAudioSliceFlag_BeganToRender
+						Set if any portion of the buffer has been played
+	@constant		kScheduledAudioSliceFlag_BeganToRenderLate
+						Set if any portion of the buffer was not played because it was scheduled late
+}
+const
+	kScheduledAudioSliceFlag_Complete = 1;
+	kScheduledAudioSliceFlag_BeganToRender = 2;
+	kScheduledAudioSliceFlag_BeganToRenderLate = 4;
+
+type
+	// forward dec, see definition below
+	ScheduledAudioSlicePtr = ^ScheduledAudioSlice;
+{!
+	@typedef			ScheduledAudioSliceCompletionProc
+}
+
+	ScheduledAudioSliceCompletionProc = procedure(userData : UnivPtr; bufferList : ScheduledAudioSlicePtr);
+				
+{
+	@struct				ScheduledAudioSlice
+	@field				mTimeStamp;
+	@field				mCompletionProc;
+							May be null
+	@field				mCompletionProcUserData;
+	@field				mFlags;
+	@field				mReserved;
+							Must be 0
+	@field				mReserved2;
+							For internal use
+	@field				mNumberFrames;
+							Must be consistent with byte count of mBufferList
+	@field				mBufferList;
+							Must contain deinterleaved Float32
+}
+	ScheduledAudioSlice = record
+		mTimeStamp: AudioTimeStamp;
+		mCompletionProc: ScheduledAudioSliceCompletionProc;	// may be null
+		mCompletionProcUserData: UnivPtr;
+		mFlags: UInt32;
+		mReserved: UInt32;		// must be 0
+		mReserved2: UnivPtr;		// for internal use
+		mNumberFrames: UInt32;  // must be consistent with byte count of mBufferList
+		mBufferList: AudioBufferListPtr;	// must contain deinterleaved Float32
+	end;
+
+//=====================================================================================================================
+//#pragma mark - AUAudioFilePlayer
+{!
+    @enum           Apple AUAudioFilePlayer Property IDs
+    @abstract       The collection of property IDs for Apple AUAudioFilePlayer
+	@discussion		This audio unit lets you schedule regions of audio files for future playback,
+					with sample-accurate timing.
+
+					The unit is a subclass of AUScheduledSoundPlayer and inherits all of its
+					behavior. In particular, this unit implements the kAudioUnitProperty_ScheduleStartTimeStamp 
+					and kAudioUnitProperty_CurrentPlayTime properties. Instead of scheduling 
+					slices (buffers) of audio to be played (via kAudioUnitProperty_ScheduleAudioSlice), 
+					however, you schedule regions of audio files to be played. The unit reads and
+					converts audio file data into its own internal buffers. It performs disk I/O
+					on a high-priority thread shared among all instances of this unit within a
+					process. Upon completion of a disk read, the unit internally schedules
+					buffers for playback.
+
+
+					Elements and Formats
+					
+					This unit has one output element and no input elements. The output's format
+					should be a canonical audio unit stream format (native Float32,
+					deinterleaved). This format should have at least as many channels are in the
+					audio file(s) to be played (otherwise channels will be dropped). During
+					playback, all audio file data is converted to the unit's output format.
+					
+
+					Audio Files
+
+					Before starting playback, you must first open all audio files to be played
+					using the AudioFile API's (see AudioToolbox/AudioFile.h), and pass their
+					AudioFileIDs to the unit by setting the kAudioUnitProperty_ScheduledFileIDs
+					propery. This property must not be set during playback. The audio files must
+					be kept open for the duration of playback.
+
+
+					Scheduling Regions
+					
+					To schedule the playback of a region of an audio file, set the
+					kAudioUnitProperty_ScheduledFileRegion property. This is a
+					ScheduledAudioFileRegion structure. mTimeStamp.mSampleTime must be valid and
+					is interpreted relative to the unit's start time -- the start time semantics
+					(using kAudioUnitProperty_ScheduleStartTimeStamp) are identical to those of
+					AUScheduledSoundPlayer. Unlike the ScheduledAudioSlice structures, the unit
+					makes copies of ScheduledAudioFileRegions, so you may create them on the
+					stack or otherwise reuse/dispose of them immediately after scheduling them.
+					
+					
+					Priming
+					
+					You should set kAudioUnitProperty_ScheduledFilePrime after scheduling
+					initial file regions to be played and before starting playback. This SetProperty call
+					will begin reading the audio files and not return until the number of frames
+					specifed by the property value have been read.
+					
+					
+					Completion Callbacks
+					
+					A region's completion callback (mCompletionProc) is called when it has been
+					completely scheduled for reading from disk. This callback is issued on the disk 
+					read thread. If the region is not read from disk in time to play at its
+					scheduled time, mCompletionProc is called a second time with an error code,
+					also from the read thread. Note that the region passed to the callback will not
+					be the same memory object as was passed by the client (since the unit copies the region).
+					
+					
+					Start Time and Current Time
+					
+					These properties work identically as in AUScheduledSoundPlayer.
+					
+					
+					Unscheduling regions
+					
+					To clear the unit's play schedule, call the AudioUnitReset function. The completion proc
+					(if any) for each file region in the schedule will be called. Playback will
+					not resume until a new start time has been set. This also happens when the
+					unit is uninitialized.
+					
+					
+					Customization
+					
+					The size and number of the player's disk read buffers default to "sensible"
+					values, but may be configured with the properties:
+						kAudioUnitProperty_ScheduledFileBufferSizeFrames
+						kAudioUnitProperty_ScheduledFileNumberBuffers
+					
+
+					Bugs
+					
+					kAudioUnitProperty_ScheduledFileBufferSizeFrames
+					kAudioUnitProperty_ScheduledFileNumberBuffers
+						are currently unimplemented
+
+					An option to make the unit not perform conversion from the audio file sample
+					rate to the unit's output rate may be desirable.
+	
+	@constant		kAudioUnitProperty_ScheduledFileIDs
+	@discussion			Scope:
+						Value Type: Array of AudioFileIDs
+						Access:
+							Must set this property on scheduled file player for all files to be played
+
+	@constant		kAudioUnitProperty_ScheduledFileRegion
+	@discussion			Scope:
+						Value Type: ScheduledAudioFileRegion
+						Access:
+
+	@constant		kAudioUnitProperty_ScheduledFilePrime
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+							The number of frames to read from disk before returning, or 0 to specify use 
+							of a default value
+
+	@constant		kAudioUnitProperty_ScheduledFileBufferSizeFrames
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+
+	@constant		kAudioUnitProperty_ScheduledFileNumberBuffers
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+}
+const
+	kAudioUnitProperty_ScheduledFileIDs = 3310;
+	kAudioUnitProperty_ScheduledFileRegion = 3311;
+	kAudioUnitProperty_ScheduledFilePrime = 3312;
+	kAudioUnitProperty_ScheduledFileBufferSizeFrames = 3313;
+	kAudioUnitProperty_ScheduledFileNumberBuffers = 3314;
+
+type
+	ScheduledAudioFileRegionPtr = ^ScheduledAudioFileRegion; //forward declaraion, see definition below
+{!
+	@typedef		ScheduledAudioFileRegionCompletionProc
+}
+	ScheduledAudioFileRegionCompletionProc = procedure(userData : UnivPtr; fileRegion : ScheduledAudioFileRegionPtr; aResult : OSStatus);
+
+{!
+	@struct			ScheduledAudioFileRegion
+	@field			mTimeStamp
+	@field			mCompletionProc
+						may be NULL
+	@field			mCompletionProcUserData
+	@field			mAudioFile
+						must be a valid and open AudioFileID
+						defined in AudioToolbox/AudioFile.h: typedef	struct OpaqueAudioFileID	*AudioFileID;
+	@field			mLoopCount
+						0 = don't loop
+	@field			mStartFrame
+						offset into file
+	@field			mFramesToPlay
+						number of frames to play
+	
+}
+
+	ScheduledAudioFileRegion = record
+		mTimeStamp: AudioTimeStamp;
+		mCompletionProc: ScheduledAudioFileRegionCompletionProc;
+		mCompletionProcUserData: UnivPtr;
+		mAudioFile: Pointer; { struct OpaqueAudioFileID * }
+		mLoopCount: UInt32;
+		mStartFrame: SInt64;
+		mFramesToPlay: UInt32;
+	end;
+
+//=====================================================================================================================
+//#pragma mark - AUDeferredRenderer
+{!
+	@enum			AUDeferredRenderer
+	@discussion		This audio unit has one input element and one output element. They must both have
+					the same format, which must be canonical (Float32 deinterleaved) and must have 
+					the same number of channels.
+
+					The AUDeferredRenderer unit creates a high-priority producer thread, on which 
+					calls by this AU for input are performed at a constant buffer size. This buffer size may be
+					set with the kAudioUnitProperty_DeferredRendererPullSize property. The deferred 
+					renderer may be asked to render at different buffer sizes by a downstream unit or
+					host application, but it always pulls upstream at its constant buffer size.
+					The upstream pull size MUST be greater than or equal to the downstream pull
+					size.
+
+					The upstream producer thread runs in advance of calls to its Render
+					function, with respect to the timestamps being passed to Render and
+					PullInput. The difference between these timestamps is the unit's "latency",
+					which is always at least one upstream pull buffer. The client may specify
+					additional latency with the property
+					kAudioUnitProperty_DeferredRendererExtraLatency, which is a number of sample
+					frames.
+
+					It is possible, at Render time, for the producer thread to have not yet
+					finished rendering the necessary data. This generates an error. In order to
+					give the producer a small amount of extra time to finish rendering, the
+					client may set the unit's property
+					kAudioUnitProperty_DeferredRendererWaitFrames. If this property is non-zero,
+					then when Render finds that insufficient data has been produced, it will
+					sleep for the amount of realtime corresponding to the number of wait frames.
+					It will then check again to see if the required amount of data has been
+					produced, and fail if it hasn't.
+
+	@constant		kAudioUnitProperty_DeferredRendererPullSize
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+
+	@constant		kAudioUnitProperty_DeferredRendererExtraLatency
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+
+	@constant		kAudioUnitProperty_DeferredRendererWaitFrames
+	@discussion			Scope:
+						Value Type: UInt32
+						Access:
+}
+const
+	kAudioUnitProperty_DeferredRendererPullSize = 3320;
+	kAudioUnitProperty_DeferredRendererExtraLatency = 3321;
+	kAudioUnitProperty_DeferredRendererWaitFrames = 3322;
+
+//=====================================================================================================================
+//#pragma mark - AUNetReceive
+{!
+	@enum			AUNetReceive
+	@constant		kAUNetReceiveProperty_Hostname
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetReceiveProperty_Password
+	@discussion			Scope:
+						Value Type:
+						Access:
+}
+const
+	kAUNetReceiveProperty_Hostname = 3511;
+	kAUNetReceiveProperty_Password = 3512;
+	
+//=====================================================================================================================
+//#pragma mark - AUNetSend
+{!
+	@enum			AUNetSend
+	@constant		kAUNetSendProperty_PortNum
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetSendProperty_TransmissionFormat
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetSendProperty_TransmissionFormatIndex
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetSendProperty_ServiceName
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetSendProperty_Disconnect
+	@discussion			Scope:
+						Value Type:
+						Access:
+
+	@constant		kAUNetSendProperty_Password
+	@discussion			Scope:
+						Value Type:
+						Access:
+}
+const
+	kAUNetSendProperty_PortNum = 3513;
+	kAUNetSendProperty_TransmissionFormat = 3514;
+	kAUNetSendProperty_TransmissionFormatIndex = 3515;
+	kAUNetSendProperty_ServiceName = 3516;
+	kAUNetSendProperty_Disconnect = 3517;
+	kAUNetSendProperty_Password = 3518;
+
+{!
+	@enum			NetSendPresetFormat
+	@constant		kAUNetSendPresetFormat_PCMFloat32
+	@discussion			1411 kilobits per second per channel @ 44100KHz (kilo == 1000 not 1024)
+	@constant		kAUNetSendPresetFormat_PCMInt24
+	@discussion			1058 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_PCMInt16
+	@discussion			706 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_Lossless24
+	@discussion			650 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_Lossless16
+	@discussion			350 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_ULaw
+	@discussion			353 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_IMA4
+	@discussion			176 kilobits per second per channel @ 44100KHz
+	@constant		kAUNetSendPresetFormat_AAC_128kbpspc
+	@discussion			128 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_96kbpspc
+	@discussion			96 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_80kbpspc
+	@discussion			80 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_64kbpspc
+	@discussion			64 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_48kbpspc
+	@discussion			48 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_40kbpspc
+	@discussion			40 kilobits per second per channel
+	@constant		kAUNetSendPresetFormat_AAC_32kbpspc
+	@discussion			kilobits per second per channel
+	@constant		kAUNetSendNumPresetFormats = 14
+}
+const
+	kAUNetSendPresetFormat_PCMFloat32 = 0;
+	kAUNetSendPresetFormat_PCMInt24 = 1;
+	kAUNetSendPresetFormat_PCMInt16 = 2;
+	kAUNetSendPresetFormat_Lossless24 = 3;
+	kAUNetSendPresetFormat_Lossless16 = 4;
+	kAUNetSendPresetFormat_ULaw = 5;
+	kAUNetSendPresetFormat_IMA4 = 6;
+	kAUNetSendPresetFormat_AAC_128kbpspc = 7;
+	kAUNetSendPresetFormat_AAC_96kbpspc = 8;
+	kAUNetSendPresetFormat_AAC_80kbpspc = 9;
+	kAUNetSendPresetFormat_AAC_64kbpspc = 10;
+	kAUNetSendPresetFormat_AAC_48kbpspc = 11;
+	kAUNetSendPresetFormat_AAC_40kbpspc = 12;
+	kAUNetSendPresetFormat_AAC_32kbpspc = 13;
+	kAUNetSendPresetFormat_AAC_LD_64kbpspc = 14;
+	kAUNetSendPresetFormat_AAC_LD_48kbpspc = 15;
+	kAUNetSendPresetFormat_AAC_LD_40kbpspc = 16;
+	kAUNetSendPresetFormat_AAC_LD_32kbpspc = 17;
+	kAUNetSendNumPresetFormats = 18;
+
+{$endc}	{ not TARGET_OS_IPHONE }
+
+//=====================================================================================================================
+//#pragma mark -
+//#pragma mark Deprecated Properties
+
+//#if !TARGET_OS_IPHONE
+{$ifc not TARGET_OS_IPHONE}
+
+// NumVersion is no longer used (originally from MacTypes.h)
+type
+//#if TARGET_RT_BIG_ENDIAN
+{$ifc TARGET_RT_BIG_ENDIAN}
+
+	AUNumVersion = record
+{ Numeric version part of 'vers' resource }
+		majorRev: UInt8;               {1st part of version number in BCD}
+		minorAndBugRev: UInt8;         {2nd & 3rd part of version number share a byte}
+		stage: UInt8;                  {stage code: dev, alpha, beta, final}
+		nonRelRev: UInt8;              {revision level of non-released version}
+	end;
+{$elsec} { TARGET_RT_BIG_ENDIAN }
+
+	AUNumVersion = record
+{ Numeric version part of 'vers' resource accessable in little endian format }
+		nonRelRev: UInt8;              {revision level of non-released version}
+		stage: UInt8;                  {stage code: dev, alpha, beta, final}
+		minorAndBugRev: UInt8;         {2nd & 3rd part of version number share a byte}
+		majorRev: UInt8;               {1st part of version number in BCD}
+	end;
+{$endc}  { TARGET_RT_BIG_ENDIAN }
+	AUNumVersionPtr = ^AUNumVersion;
+	AUNumVersionHandle = ^AUNumVersionPtr;
+	
+{!
+	@struct			AUHostIdentifier
+	@abstract		Used to describe the name and version of the audio unit's host
+}
+type
+	AUHostIdentifier = record
+		hostName: CFStringRef;	
+		hostVersion: AUNumVersion;
+	end;
+
+
+// $$$ THESE NEED TO BE REMOVED FROM 64bit apps
+//=====================================================================================================================
+// GENERIC
+const
+	kAudioUnitParameterFlag_Global = 1 shl 0;	//	parameter scope is global
+	kAudioUnitParameterFlag_Input = 1 shl 1;	//	parameter scope is input
+	kAudioUnitParameterFlag_Output = 1 shl 2;	//	parameter scope is output
+	kAudioUnitParameterFlag_Group = 1 shl 3;		//	parameter scope is group
+
+const
+	kAudioUnitParameterFlag_HasName = kAudioUnitParameterFlag_ValuesHaveStrings;
+
+const
+//kAudioUnitProperty_SetInputCallback		= 7 -> deprecated
+	kAudioUnitProperty_SRCAlgorithm = 9; // see kAudioUnitProperty_SampleRateConverterComplexity
+	kAudioUnitProperty_MIDIControlMapping = 17; // see ParameterMIDIMapping Properties
+	kAudioUnitProperty_CurrentPreset = 28; // see PresentPreset
+
+	kAudioUnitProperty_ParameterValueName = kAudioUnitProperty_ParameterStringFromValue;
+	kAudioUnitProperty_BusCount = kAudioUnitProperty_ElementCount;
+	kAudioOfflineUnitProperty_InputSize = kAudioUnitOfflineProperty_InputSize;
+	kAudioOfflineUnitProperty_OutputSize = kAudioUnitOfflineProperty_OutputSize;
+
+const
+	kAudioUnitSRCAlgorithm_Polyphase = FourCharCode('poly');	// same as kAudioUnitSampleRateConverterComplexity_Normal
+	kAudioUnitSRCAlgorithm_MediumQuality = FourCharCode('csrc');	// same as kAudioUnitSampleRateConverterComplexity_Normal
+
+
+// Deprecated in Mac OS X v10.2. See AUParameterMIDIMapping.
+type
+	AudioUnitMIDIControlMapping = record
+		midiNRPN: UInt16;
+		midiControl: UInt8;
+		scope: UInt8;
+		element: AudioUnitElement;
+		parameter: AudioUnitParameterID;
+	end;
+
+// Deprecated. See AudioUnitParameterStringFromValue for equivalent structure, but with clearer field names
+type
+	AudioUnitParameterValueName = record
+		inParamID: AudioUnitParameterID;
+		inValue: {const} Float32Ptr;	// may be NULL if should translate current parameter value
+		outName: CFStringRef;  	// see comments for kAudioUnitProperty_ParameterStringFromValue
+	end;
+
+
+//=====================================================================================================================
+// Deprecated. These properties are Apple specific.
+const
+	kMusicDeviceProperty_GroupOutputBus = 1002;
+	kMusicDeviceProperty_SoundBankFSSpec = 1003;
+	kAudioUnitProperty_PannerMode = 3008;
+
+///$$$ THESE NEED TO BE EXCLUDED FROM 64BIT $$$
+
+const
+	kAudioUnitProperty_SpeakerConfiguration = 3001;
+
+	// Deprecated in favor of the newer AudioChannelLayout
+	// structure and its supporting property.
+const
+	kSpeakerConfiguration_HeadPhones = 0;
+	kSpeakerConfiguration_Stereo = 1;
+	kSpeakerConfiguration_Quad = 2;
+	kSpeakerConfiguration_5_0 = 3;
+	kSpeakerConfiguration_5_1 = kSpeakerConfiguration_5_0;
+
+
+//#endif !TARGET_OS_IPHONE
+{$endc}	{ not TARGET_OS_IPHONE }
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+implementation
+
+
+function GetAudioUnitParameterDisplayType(flags : UInt32) : UInt32; inline;
+begin
+	GetAudioUnitParameterDisplayType := flags and kAudioUnitParameterFlag_DisplayMask
+end;
+
+function AudioUnitDisplayTypeIsLogarithmic(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsLogarithmic := GetAudioUnitParameterDisplayType(flags) = 	kAudioUnitParameterFlag_DisplayLogarithmic
+end;
+
+function AudioUnitDisplayTypeIsSquareRoot(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsSquareRoot := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplaySquareRoot
+end;
+
+function AudioUnitDisplayTypeIsSquared(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsSquared := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplaySquared
+end;
+
+function AudioUnitDisplayTypeIsCubed(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsCubed := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayCubed
+end;
+
+function AudioUnitDisplayTypeIsCubeRoot(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsCubeRoot := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayCubeRoot
+end;
+
+function AudioUnitDisplayTypeIsExponential(flags : UInt32) : Boolean; inline;
+begin
+	AudioUnitDisplayTypeIsExponential := GetAudioUnitParameterDisplayType(flags) = kAudioUnitParameterFlag_DisplayExponential
+end;
+
+procedure SetAudioUnitParameterDisplayType(var flags : UInt32; displayType : UInt32); inline;
+begin
+	flags := (flags and (not kAudioUnitParameterFlag_DisplayMask)) or displayType
+end;
+
+end.
+
+{$endc} {not MACOSALLINCLUDE}

+ 123 - 31
packages/univint/src/AuthSession.pas

@@ -1,34 +1,35 @@
 {
  * Copyright (c) 2000-2003 Apple Computer, Inc. All Rights Reserved.
  * 
- * The contents of this file constitute Original Code as defined in and are
- * subject to the Apple Public Source License Version 1.2 (the 'License').
- * You may not use this file except in compliance with the License. Please obtain
- * a copy of the License at http://www.apple.com/publicsource and read it before
- * using this file.
+ * @APPLE_LICENSE_HEADER_START@
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY of ANY KIND, EITHER EXPRESS
- * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
- * LIMITATION, ANY WARRANTIES of MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
- * specific language governing rights and limitations under the License.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
  }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
-{
- *  AuthSession.h
- *  AuthSession - APIs for managing login, authorization, and security Sessions.
- }
-
+{	  Pascal Translation Update:  Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -37,8 +38,8 @@
 
 unit AuthSession;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -51,16 +52,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -68,14 +91,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -101,7 +175,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -112,7 +185,19 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,Authorization;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  AuthSession.h
+ *  AuthSession - APIs for managing login, authorization, and security Sessions.
+ }
+
 {!
 	@header AuthSession
 
@@ -153,9 +238,11 @@ type
     Here are some special values for SecuritySessionId. You may specify those
         on input to SessionAPI functions. They will never be returned from such
         functions.
+    
+    Note: -2 is reserved (see 4487137).  
 }
 const
-	noSecuritySession                      = 0;     { definitely not a valid SecuritySessionId }
+	noSecuritySession = 0;     { definitely not a valid SecuritySessionId }
 	callerSecuritySession = -1;     { the Session I (the caller) am in }
 
 
@@ -197,10 +284,11 @@ const
     Note that the AuthSession APIs can also return Authorization API error codes.
 }
 const
-	errSessionSuccess                       = 0;      { all is well }
-	errSessionInvalidId                     = -60500; { invalid session id specified }
-	errSessionInvalidAttributes             = -60501; { invalid set of requested attribute bits }
-	errSessionAuthorizationDenied           = -60502; { you are not allowed to do this }
+	errSessionSuccess = 0;      { all is well }
+	errSessionInvalidId = -60500; { invalid session id specified }
+	errSessionInvalidAttributes = -60501; { invalid set of requested attribute bits }
+	errSessionAuthorizationDenied = -60502; { you are not allowed to do this }
+	errSessionValueNotSet = -60503; { the session attribute you requested has not been set }
 
 	errSessionInternal                      = errAuthorizationInternal;	{ internal error }
 	errSessionInvalidFlags                  = errAuthorizationInvalidFlags; { invalid flags/options }
@@ -262,4 +350,8 @@ function SessionGetInfo( session: SecuritySessionId; sessionId: SecuritySessionI
 }
 function SessionCreate( flags: SessionCreationFlags; attributes: SessionAttributeBits ): OSStatus; external name '_SessionCreate';
 
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 163 - 67
packages/univint/src/Authorization.pas

@@ -1,34 +1,35 @@
 {
- * Copyright (c) 2000-2002 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2004,2007 Apple Inc. All Rights Reserved.
  * 
- * The contents of this file constitute Original Code as defined in and are
- * subject to the Apple Public Source License Version 1.2 (the 'License').
- * You may not use this file except in compliance with the License. Please obtain
- * a copy of the License at http://www.apple.com/publicsource and read it before
- * using this file.
+ * @APPLE_LICENSE_HEADER_START@
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY of ANY KIND, EITHER EXPRESS
- * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
- * LIMITATION, ANY WARRANTIES of MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
- * specific language governing rights and limitations under the License.
- }
-{	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
-{
- *  Authorization.h -- APIs for implementing access control in applications
- *  and daemons.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
  }
-
-
+ {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
+ {	  Pascal Translation Update:  Gorazd Krosl <[email protected]>, October 2009 }
+ {    Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -37,8 +38,8 @@
 
 unit Authorization;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -51,16 +52,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -68,14 +91,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -101,7 +175,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -112,7 +185,20 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  Authorization.h -- APIs for implementing access control in applications
+ *  and daemons.
+ }
+
+
 {!
 	@header Authorization
 	Version 1.0 10/16/2000
@@ -147,24 +233,26 @@ const kAuthorizationEmptyEnvironment = nil;
     The comments must not be multi-line, and should be in a form meaningful to an end user. If
     a different or additional comment is needed, it can be put in the header doc format, or on a
     line that does not start with errZZZ.
+
+    errAuthorizationSuccess can't include a string as it's also errSecSuccess in libsecurity_keychain/lib/SecBase.h
 }
 
 const
-	errAuthorizationSuccess					= 0;      { The operation completed successfully. }
-	errAuthorizationInvalidSet				= -60001; { The set parameter is invalid. }
-	errAuthorizationInvalidRef				= -60002; { The authorization parameter is invalid. }
-	errAuthorizationInvalidTag				= -60003; { The tag parameter is invalid. }
-	errAuthorizationInvalidPointer			= -60004; { The authorizedRights parameter is invalid. }
-	errAuthorizationDenied					= -60005; { The authorization was denied. }
-	errAuthorizationCanceled				= -60006; { The authorization was cancelled by the user. }
-	errAuthorizationInteractionNotAllowed	= -60007; { The authorization was denied since no user interaction was possible. }
-	errAuthorizationInternal                = -60008; { something else went wrong }
-	errAuthorizationExternalizeNotAllowed	= -60009; { authorization externalization denied }
-	errAuthorizationInternalizeNotAllowed	= -60010; { authorization internalization denied }
-	errAuthorizationInvalidFlags            = -60011; { invalid option flag(s) }
-	errAuthorizationToolExecuteFailure      = -60031; { cannot execute privileged tool }
-	errAuthorizationToolEnvironmentError    = -60032; { privileged tool environment error }
-	errAuthorizationBadAddress				= -60033; { invalid socket address requested }
+	errAuthorizationSuccess = 0;
+	errAuthorizationInvalidSet = -60001; { The authorization rights are invalid. }
+	errAuthorizationInvalidRef = -60002; { The authorization reference is invalid. }
+	errAuthorizationInvalidTag = -60003; { The authorization tag is invalid. }
+	errAuthorizationInvalidPointer = -60004; { The returned authorization is invalid. }
+	errAuthorizationDenied = -60005; { The authorization was denied. }
+	errAuthorizationCanceled = -60006; { The authorization was cancelled by the user. }
+	errAuthorizationInteractionNotAllowed = -60007; { The authorization was denied since no user interaction was possible. }
+	errAuthorizationInternal = -60008; { Unable to obtain authorization for this operation. }
+	errAuthorizationExternalizeNotAllowed = -60009; { The authorization is not allowed to be converted to an external format. }
+	errAuthorizationInternalizeNotAllowed = -60010; { The authorization is not allowed to be created from an external format. }
+	errAuthorizationInvalidFlags = -60011; { The provided option flag(s) are invalid for this authorization operation. }
+	errAuthorizationToolExecuteFailure = -60031; { The specified program could not be executed. }
+	errAuthorizationToolEnvironmentError = -60032; { An invalid status was returned during execution of a privileged tool. }
+	errAuthorizationBadAddress = -60033; { The requested socket address is invalid (must be 0-1023 inclusive). }
 
 
 {!
@@ -172,22 +260,23 @@ const
 	Optional flags passed in to serveral Authorization APIs. See the description of AuthorizationCreate, AuthorizationCopyRights and AuthorizationFree for a description of how they affect those calls.
 }
 const
-	kAuthorizationFlagDefaults              = 0;
-	kAuthorizationFlagInteractionAllowed	= (1 shl 0);
-	kAuthorizationFlagExtendRights			= (1 shl 1);
-	kAuthorizationFlagPartialRights			= (1 shl 2);
-	kAuthorizationFlagDestroyRights			= (1 shl 3);
-	kAuthorizationFlagPreAuthorize			= (1 shl 4);
+	kAuthorizationFlagDefaults = 0;
+	kAuthorizationFlagInteractionAllowed = 1 shl 0;
+	kAuthorizationFlagExtendRights = 1 shl 1;
+	kAuthorizationFlagPartialRights = 1 shl 2;
+	kAuthorizationFlagDestroyRights = 1 shl 3;
+	kAuthorizationFlagPreAuthorize = 1 shl 4;
 	
 	// private bits (do not use)
-	kAuthorizationFlagNoData                = (1 shl 20);
+	kAuthorizationFlagNoData = 1 shl 20;
 
 
 {!
 	@typedef AuthorizationFlags
 	Optional flags passed in to AuthorizationCreate.
 }
-type AuthorizationFlags = UInt32;
+type
+	AuthorizationFlags = UInt32;
 
 
 {!
@@ -195,7 +284,7 @@ type AuthorizationFlags = UInt32;
 	Flags returned in the flags field of ItemSet Items when calling AuthorizationCopyRights().
 }
 const
-	kAuthorizationFlagCanNotPreAuthorize = (1 shl 0);
+	kAuthorizationFlagCanNotPreAuthorize = 1 shl 0;
 
 
 {!
@@ -203,7 +292,7 @@ const
 	Opaque reference to an authorization object.
 }
 type
-	AuthorizationRef							= ^SInt32;
+	AuthorizationRef = ^SInt32;
 
 
 {!
@@ -211,7 +300,7 @@ type
 	A zero terminated string in UTF-8 encoding.
 }
 type AuthorizationString = CStringPtr;
-
+	 ConstAuthorizationString = ConstCStringPtr;	{ will need later in AuthorizationPlugin }
 
 {!
 	@struct AuthorizationItem
@@ -228,8 +317,8 @@ type AuthorizationString = CStringPtr;
 type
 	AuthorizationItem = record
 		name: AuthorizationString;
-		valueLength: UInt32;
-		value: Ptr;
+		valueLength: size_t;
+		value: UnivPtr;
 		flags: UInt32;
 	end;
 	AuthorizationItemPtr = ^AuthorizationItem;
@@ -260,7 +349,8 @@ type
 	SECURITY NOTE: Applications should take care to not disclose the AuthorizationExternalForm to
 	potential attackers since it would authorize rights to them.
 }
-const kAuthorizationExternalFormLength = 32;
+const
+	kAuthorizationExternalFormLength = 32;
 
 type
 	AuthorizationExternalForm = record
@@ -317,7 +407,7 @@ type AuthorizationEnvironmentPtr = ^AuthorizationEnvironment;
 
 	errAuthorizationInteractionNotAllowed -60007 The authorization was denied since no interaction with the user was allowed.
 }
-function AuthorizationCreate(rights: AuthorizationRightsPtr; environment: AuthorizationEnvironmentPtr; flags: AuthorizationFlags; var authorization: AuthorizationRef): OSStatus; external name '_AuthorizationCreate';
+function AuthorizationCreate( rights: AuthorizationRightsPtr; environment: AuthorizationEnvironmentPtr; flags: AuthorizationFlags; var authorization: AuthorizationRef ): OSStatus; external name '_AuthorizationCreate';
 
 
 {!
@@ -336,7 +426,8 @@ function AuthorizationCreate(rights: AuthorizationRightsPtr; environment: Author
 
     errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
 }
-function AuthorizationFree(authorization: AuthorizationRef;flags: AuthorizationFlags): OSStatus; external name '_AuthorizationFree';
+function AuthorizationFree( authorization: AuthorizationRef; flags: AuthorizationFlags ): OSStatus; external name '_AuthorizationFree';
+
 
 {!
 	@function AuthorizationCopyRights
@@ -371,7 +462,7 @@ function AuthorizationFree(authorization: AuthorizationRef;flags: AuthorizationF
 
     errAuthorizationInvalidPointer -60004 The authorizedRights parameter is invalid.
 }
-function AuthorizationCopyRights(authorization: AuthorizationRef; const (*var*) rights: AuthorizationRights; environment: AuthorizationEnvironmentPtr; flags: AuthorizationFlags; authorizedRights: AuthorizationRightsPtrPtr): OSStatus; external name '_AuthorizationCopyRights';
+function AuthorizationCopyRights( authorization: AuthorizationRef; const (*var*) rights: AuthorizationRights; environment: AuthorizationEnvironmentPtr; flags: AuthorizationFlags; authorizedRights: AuthorizationRightsPtrPtr ): OSStatus; external name '_AuthorizationCopyRights';
 
 {!
 	@function AuthorizationCopyInfo
@@ -390,7 +481,7 @@ function AuthorizationCopyRights(authorization: AuthorizationRef; const (*var*)
 
     errAuthorizationInvalidPointer -60004 The info parameter is invalid.
 }
-function AuthorizationCopyInfo(authorization: AuthorizationRef; tag: AuthorizationString; var info: AuthorizationItemSetPtr): OSStatus; external name '_AuthorizationCopyInfo';
+function AuthorizationCopyInfo( authorization: AuthorizationRef; tag: AuthorizationString; var info: AuthorizationItemSetPtr ): OSStatus; external name '_AuthorizationCopyInfo';
 
 {!
 	@function AuthorizationMakeExternalForm
@@ -411,7 +502,7 @@ function AuthorizationCopyInfo(authorization: AuthorizationRef; tag: Authorizati
 
 
 }
-function AuthorizationMakeExternalForm(authorization: AuthorizationRef; var extForm: AuthorizationExternalForm): OSStatus; external name '_AuthorizationMakeExternalForm';
+function AuthorizationMakeExternalForm( authorization: AuthorizationRef; var extForm: AuthorizationExternalForm ): OSStatus; external name '_AuthorizationMakeExternalForm';
 
 
 {!
@@ -427,7 +518,7 @@ function AuthorizationMakeExternalForm(authorization: AuthorizationRef; var extF
 	
 	@result errAuthorizationInternalizeNotAllowed -60010 Internalizing this authorization is not allowed.
 }
-function AuthorizationCreateFromExternalForm(const (*var*) extForm: AuthorizationExternalForm; var authorization: AuthorizationRef): OSStatus; external name '_AuthorizationCreateFromExternalForm';
+function AuthorizationCreateFromExternalForm( const (*var*) extForm: AuthorizationExternalForm; var authorization: AuthorizationRef ): OSStatus; external name '_AuthorizationCreateFromExternalForm';
 
 
 {!
@@ -441,7 +532,7 @@ function AuthorizationCreateFromExternalForm(const (*var*) extForm: Authorizatio
 
     errAuthorizationInvalidSet -60001 The set parameter is invalid.
 }
-function AuthorizationFreeItemSet(var setx: AuthorizationItemSet): OSStatus; external name '_AuthorizationFreeItemSet';
+function AuthorizationFreeItemSet( var setx: AuthorizationItemSet ): OSStatus; external name '_AuthorizationFreeItemSet';
 
 
 {!
@@ -464,7 +555,7 @@ function AuthorizationFreeItemSet(var setx: AuthorizationItemSet): OSStatus; ext
 type
   Arg10000Type = array[0..10000] of CStringPtr;
   Arg10000TypePtr = ^Arg10000Type;
-function AuthorizationExecuteWithPrivileges(authorization: AuthorizationRef; pathToTool: CStringPtr; options: AuthorizationFlags; arguments: Arg10000TypePtr; communicationsPipe: UnivPtr): OSStatus; external name '_AuthorizationExecuteWithPrivileges';
+function AuthorizationExecuteWithPrivileges( authorization: AuthorizationRef; pathToTool: CStringPtr; options: AuthorizationFlags; arguments: Arg10000TypePtr; communicationsPipe: UnivPtr ): OSStatus; external name '_AuthorizationExecuteWithPrivileges';
 // communicationsPipe not yet supported
 
 
@@ -476,6 +567,11 @@ function AuthorizationExecuteWithPrivileges(authorization: AuthorizationRef; pat
 	launch your tool, the tool may want to avail itself of any additional pre-authorizations
 	the caller may have obtained through that reference.
  }
-function AuthorizationCopyPrivilegedReference(var authorization: AuthorizationRef; flags: AuthorizationFlags): OSStatus; external name '_AuthorizationCopyPrivilegedReference';
+function AuthorizationCopyPrivilegedReference( var authorization: AuthorizationRef; flags: AuthorizationFlags ): OSStatus; external name '_AuthorizationCopyPrivilegedReference';
+
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 136 - 40
packages/univint/src/AuthorizationDB.pas

@@ -1,33 +1,34 @@
 {
  * Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
  * 
- * The contents of this file constitute Original Code as defined in and are
- * subject to the Apple Public Source License Version 1.2 (the 'License').
- * You may not use this file except in compliance with the License. Please obtain
- * a copy of the License at http://www.apple.com/publicsource and read it before
- * using this file.
+ * @APPLE_LICENSE_HEADER_START@
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY of ANY KIND, EITHER EXPRESS
- * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
- * LIMITATION, ANY WARRANTIES of MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
- * specific language governing rights and limitations under the License.
- }
-{	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-{
- *  AuthorizationDB.h -- APIs for managing the authorization policy database
- *  and daemons.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
  }
-
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -36,8 +37,8 @@
 
 unit AuthorizationDB;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -50,16 +51,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -67,14 +90,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -100,7 +174,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -111,22 +184,36 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,Authorization,CFBase,CFDictionary,CFString,CFBundle;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+
+{$ALIGN POWER}
+
+
+{
+ *  AuthorizationDB.h -- APIs for managing the authorization policy database
+ *  and daemons.
+ }
+
+
 {!
 	@header AuthorizationDB
 	Version 1.0
 
 	This API allows for any programs to get, modify, delete and add new right definitions to the policy database.  Meta-rights specify whether and what authorization is required to make these modifications.
 	
-	AuthorizationRightSet(NULL, "com.ifoo.ifax.send", CFSTR(kRuleIsAdmin), CFSTR("You must authenticate to send a fax."), NULL, NULL)
+	AuthorizationRightSet(authRef, "com.ifoo.ifax.send", CFSTR(kRuleIsAdmin), CFSTR("You must authenticate to send a fax."), NULL, NULL)
 
 	add a rule for letting admins send faxes using a canned rule, delegating to a pre-specified rule that authorizes everyone who is an admin.
 	
-	AuthorizationRightSet(NULL, "com.ifoo.ifax.send", [[CFSTR(kRightRule), CFSTR(kRuleIsAdmin)], [CFSTR(kRightComment), CFSTR("authorizes sending of 1 fax message")]], CFSTR("Authorize sending of a fax"), NULL, NULL)
+	AuthorizationRightSet(authRef, "com.ifoo.ifax.send", [[CFSTR(kRightRule), CFSTR(kRuleIsAdmin)], [CFSTR(kRightComment), CFSTR("authorizes sending of 1 fax message")]], CFSTR("Authorize sending of a fax"), NULL, NULL)
 
 	add identical rule, but specify additional attributes this time.
 
-	Keep in mind while specifying a comment to be specific about what you need to authorize for (1 fax), in terms of a general message for user.  The means of proof required for kRuleIsAdmin (enter username/password for example) should not be included here, since it could be configured differently.
+	Keep in mind while specifying a comment to be specific about what you need to authorize for (1 fax), in terms of a general message for user.  The means of proof required for kRuleIsAdmin (enter username/password for example) should not be included here, since it could be configured differently.  Also note that the "authRef" variable used in each of the above examples must be a vaild AuthorizationRef obtained from AuthorizationCreate().
 
 }
 
@@ -134,38 +221,45 @@ uses MacTypes,Authorization,CFBase,CFDictionary,CFString,CFBundle;
 	rule delegation key.  Instead of specifying exact behavior some canned rules
    are shipped that may be switched by configurable security.
 }
-const kAuthorizationRightRule					= 'rule';
+const
+	kAuthorizationRightRule = 'rule';
 
 {! @defined kRuleIsAdmin
 	canned rule values for use with rule delegation definitions: require user to be an admin.
 }
-const kAuthorizationRuleIsAdmin				= 'is-admin';
+const
+	kAuthorizationRuleIsAdmin = 'is-admin';
 
 {! @defined kRuleAuthenticateAsSessionUser
 	canned rule value for use with rule delegation definitions: require user to authenticate as the session owner (logged-in user).
 }
-const kAuthorizationRuleAuthenticateAsSessionUser= 'authenticate-session-user';
+const
+	kAuthorizationRuleAuthenticateAsSessionUser = 'authenticate-session-owner';
 
 {! @defined kRuleAuthenticateAsAdmin
 	Canned rule value for use with rule delegation definitions: require user to authenticate as admin.
 }
-const kAuthorizationRuleAuthenticateAsAdmin	= 'authenticate-admin';
+const
+	kAuthorizationRuleAuthenticateAsAdmin = 'authenticate-admin';
 
 {! @defined kAuthorizationRuleClassAllow
 	Class that allows anything.
 }
-const kAuthorizationRuleClassAllow		= 'allow';
+const
+	kAuthorizationRuleClassAllow = 'allow';
 
 {! @defined kAuthorizationRuleClassDeny
 	Class that denies anything. 
 }
-const kAuthorizationRuleClassDeny			= 'deny';
+const
+	kAuthorizationRuleClassDeny = 'deny';
 
 {! @defined kAuthorizationComment
     comments for the administrator on what is being customized here;
    as opposed to (localized) descriptions presented to the user.
 }
-const kAuthorizationComment = 'comment';
+const
+	kAuthorizationComment = 'comment';
 
 
 {!
@@ -182,7 +276,6 @@ const kAuthorizationComment = 'comment';
 
 }
 function AuthorizationRightGet( rightName: ConstCStringPtr; rightDefinition: CFDictionaryRefPtr ): OSStatus; external name '_AuthorizationRightGet';
-// attribute(weak_import);
 
 {!
 	@function AuthorizationRightSet
@@ -205,8 +298,7 @@ function AuthorizationRightGet( rightName: ConstCStringPtr; rightDefinition: CFD
 	errAuthorizationInteractionNotAllowed -60007 Interaction was required but not possible.
 
 }
-function AuthorizationRightSet(authRef: AuthorizationRef; rightName: ConstCStringPtr; rightDefinition: CFTypeRef; descriptionKey: CFStringRef; bundle: CFBundleRef; localeTableName: CFStringRef): OSStatus; external name '_AuthorizationRightSet';
-// attribute(weak_import);
+function AuthorizationRightSet( authRef: AuthorizationRef; rightName: ConstCStringPtr; rightDefinition: CFTypeRef; descriptionKey: CFStringRef; bundle: CFBundleRef; localeTableName: CFStringRef ): OSStatus; external name '_AuthorizationRightSet';
 
 
 {!
@@ -218,6 +310,10 @@ function AuthorizationRightSet(authRef: AuthorizationRef; rightName: ConstCStrin
 	@param rightName (input) the rightname (ASCII).  Wildcard rightnames are not okay.
 	
 }
-function AuthorizationRightRemove(authRef: AuthorizationRef; rightName: ConstCStringPtr): OSStatus; external name '_AuthorizationRightRemove';
+function AuthorizationRightRemove( authRef: AuthorizationRef; rightName: ConstCStringPtr ): OSStatus; external name '_AuthorizationRightRemove';
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 475 - 0
packages/univint/src/AuthorizationPlugin.pas

@@ -0,0 +1,475 @@
+{
+ * Copyright (c) 2001-2002,2004 Apple Computer, Inc. All Rights Reserved.
+ * 
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ }
+{	  Pascal Translation:  Gorazd Krosl <[email protected]>, October 2009 }
+
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit AuthorizationPlugin;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,Authorization;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  AuthorizationPlugin.h
+ *  AuthorizationPlugin -- APIs for implementing authorization plugins.
+ }
+
+
+{!
+	@header AuthorizationPlugin
+	
+	The AuthorizationPlugin API allows the creation of plugins that can participate
+	in authorization decisions.  Using the AuthorizationDB API the system can be configured
+	to use these plugins.  Plugins are loaded into a separate process, the pluginhost, to 
+	isolate the process of authorization from the client.  There are two types of pluginhosts.
+	One runs as an anonymous user and can be used to communicate with the user, for example
+	to ask for a password.  Another one runs with root privileges to perform privileged
+	operations that may be required.
+
+    A typical use is to implement additional policies that cannot be expressed in the
+    authorization configuration.
+    
+    Plugins implement a handshake function called AuthorizationPluginCreate with which
+    their interface (AuthorizationPluginInterface) and the engine's interface
+    (AuthorizationCallbacks) are exchanged.  Plugins are asked to create 
+    Mechanisms, which are the basic element as authorizations are performed.  
+    
+    Mechanisms are invoked when it is time for them to make a decision.  A decision is 
+    made by setting a single result (AuthorizationResult).  Mechanisms in the 
+    authorization can communicate auxiliary information by setting and/or getting hints 
+    and setting and/or getting context data.  Hints are advisory and don't need to be
+    looked at, nor are they preserved as part of the authorization result. Context data
+    becomes part of the result of the authorization.
+    
+    Context data is tagged with a flag that describes whether the information is returned
+    to the authorization client upon request (AuthorizationCopyInfo() in Authorization.h)
+    or whether it's private to the mechanisms making a decision.
+    
+}
+
+
+{!
+	@typedef AuthorizationValue
+    Auxiliary data is passed between the engine and the mechanism as AuthorizationValues
+}
+type
+	AuthorizationValue = record
+		length: size_t;
+		data: UnivPtr;
+	end;
+	AuthorizationValuePtr = ^AuthorizationValue;
+	
+{!
+    @typedef AuthorizationValueVector
+    A vector of AuthorizationValues.  Used to communicate arguments passed from the 
+    configuration file <code>authorization(5)</code>.
+}
+type
+	AuthorizationValueVector = record
+		count: UInt32;
+		values: AuthorizationValuePtr;
+	end;
+	AuthorizationValueVectorPtr = ^AuthorizationValueVector;
+	
+{!
+    @typedef
+    Data produced as context during the authorization evaluation is tagged.  
+    If data is set to be extractable (kAuthorizationContextFlagExtractable), it will be possible for the client of authorization to obtain the value of this attribute using AuthorizationCopyInfo().
+    If data is marked as volatile (kAuthorizationContextFlagVolatile), this value will not be remembered in the AuthorizationRef.
+    Sticky data (kAuthorizationContextFlagSticky) persists through a failed or interrupted evaluation. It can be used to propagate an error condition from a downstream plugin to an upstream one. It is not remembered in the AuthorizationRef.
+}
+type
+	AuthorizationContextFlags = UInt32;
+const
+	kAuthorizationContextFlagExtractable = 1 shl 0;
+	kAuthorizationContextFlagVolatile = 1 shl 1;
+	kAuthorizationContextFlagSticky = 1 shl 2;
+
+
+{!
+	@typedef AuthorizationMechanismId
+    The mechanism id specified in the configuration is passed to the plugin to create the appropriate mechanism.
+}
+type
+	AuthorizationMechanismId = ConstAuthorizationString;
+
+{!
+    @typedef AuthorizationPluginId
+	Not used by plugin writers.  Loaded plugins are identified by their name.
+ }
+type
+	AuthorizationPluginId = ConstAuthorizationString;
+
+{!
+	@typedef AuthorizationPluginRef
+	Handle passed back by the plugin writer when creating a plugin.  Any pluginhost will only instantiate one instance.  The handle is used when creating mechanisms.
+}
+type
+	AuthorizationPluginRef = UnivPtr;
+
+{!
+	@typedef AuthorizationMechanismRef
+	Handle passed back by the plugin writer when creating an an instance of a mechanism in a plugin.  One instance will be created for any authorization.
+}
+type
+	AuthorizationMechanismRef = UnivPtr;
+
+{!
+	@typedef AuthorizationEngineRef
+	Handle passed from the engine to an instance of a mechanism in a plugin (corresponds to a particular AuthorizationMechanismRef).
+}
+type
+	__OpaqueAuthorizationEngine = Record end;
+	AuthorizationEngineRef = ^__OpaqueAuthorizationEngine;
+
+{!
+	@typedef AuthorizationSessionId
+	A unique value for an AuthorizationSession being evaluated, provided by the authorization engine.
+    A session is represented by a top level call to an Authorization API.
+}
+type
+	AuthorizationSessionId = UnivPtr;
+
+{!
+	@typedef AuthorizationResult
+	Type for SetResult().  See AuthorizationResultConstants for all allowed values.
+}
+type
+	AuthorizationResult = UInt32;
+
+{!
+    @enum AuthorizationResultConstants
+	Possible values for SetResult() in AuthorizationCallbacks.
+    
+    @constant kAuthorizationResultAllow the operation succeeded and authorization should be granted as far as this mechanism is concerned.
+    @constant kAuthorizationResultDeny the operation succeeded but authorization should be denied as far as this mechanism is concerned.
+    @constant kAuthorizationResultUndefined the operation failed for some reason and should not be retried for this session.
+    @constant kAuthorizationResultUserCanceled the user has requested that the evaluation be terminated.
+}
+const
+	kAuthorizationResultAllow = 0;
+	kAuthorizationResultDeny = 1;
+	kAuthorizationResultUndefined = 2;
+	kAuthorizationResultUserCanceled = 3;
+
+{!
+    @enum
+    Version of the interface (AuthorizationPluginInterface) implemented by the plugin.
+    The value is matched to the definition in this file.
+}
+const
+	kAuthorizationPluginInterfaceVersion = 0;
+
+{!
+    @enum
+    Version of the callback structure (AuthorizationCallbacks) passed to the plugin.
+    The value is matched to the definition in this file.  The engine may provide a newer
+    interface.
+}
+const
+	kAuthorizationCallbacksVersion = 0;
+
+
+{!
+    @struct
+    Callback API provided by the AuthorizationEngine. 
+    
+    @field version      Engine callback version.
+    @field SetResult    Set a result after a call to AuthorizationSessionInvoke.
+    @field RequestInterrupt Request authorization engine to interrupt all mechamisms invoked after this mechamism has called SessionSetResult and then call AuthorizationSessionInvoke again.
+    @field DidDeactivate    Respond to the Deactivate request.
+    @field GetContextValue  Read value from context.  AuthorizationValue does not own data.
+    @field SetContextValue  Write value to context.  AuthorizationValue and data are copied.
+    @field GetHintValue     Read value from hints. AuthorizationValue does not own data.
+    @field SetHintValue     Write value to hints.  AuthorizationValue and data are copied.
+    @field GetArguments     Read arguments passed.  AuthorizationValueVector does not own data.
+    @field GetSessionId     Read SessionId.
+}
+type
+	AuthorizationCallbacks = record
+{ Engine callback version. }
+		version: UInt32;
+
+    { Set a result after a call to AuthorizationSessionInvoke. }
+{    OSStatus (*SetResult)(AuthorizationEngineRef inEngine, AuthorizationResult inResult); }
+	 SetResult : function (inEngine : AuthorizationEngineRef; inResult : AuthorizationResult) : OSStatus;
+
+    { Request authorization engine to interrupt all mechamisms invoked after 
+        this mechamism has called SessionSetResult and then call 
+        AuthorizationSessionInvoke again. }
+     RequestInterrupt : function (inEngine : AuthorizationEngineRef) : OSStatus;
+     
+    { Respond to the Deactivate request. }
+	 DidDeactivate : function (inEngine : AuthorizationEngineRef) : OSStatus;
+
+    { Read value from context.  AuthorizationValue does not own data. }
+        GetContextValue : function (inEngine			: AuthorizationEngineRef;
+        							inKey				: AuthorizationString;
+        							var outContextFlags : AuthorizationContextFlags;
+        							var outValue		: AuthorizationValuePtr) : OSStatus;
+
+    { Write value to context.  AuthorizationValue and data are copied. }
+	 SetContextValue : function (inEngine 	: AuthorizationEngineRef;
+	 							 inKey		: AuthorizationString;
+	 							 inContextFlags	: AuthorizationContextFlags;
+	 							 inValue		: AuthorizationValuePtr) : OSStatus;
+
+    { Read value from hints. AuthorizationValue does not own data. }
+	GetHintValue : function (inEngine		: AuthorizationEngineRef;
+							 inKey			: AuthorizationString;
+							 var outValue	: AuthorizationValuePtr) : OSStatus;
+							 
+    { Write value to hints.  AuthorizationValue and data are copied. }
+	SetHintValue : function (inEngine	: AuthorizationEngineRef;
+							 inKey		: AuthorizationString;
+							 inValue	: AuthorizationValuePtr) : OSStatus;
+							 
+    { Read arguments passed.  AuthorizationValueVector does not own data. }
+	GetArguments : function (inEngine	 		: AuthorizationEngineRef;
+							 var outArguments	: AuthorizationValueVectorPtr) : OSStatus;
+							 
+    { Read SessionId. }
+      GetSessionId : function (inEngine			: AuthorizationEngineRef;
+      						   var outSessionId : AuthorizationSessionId) : OSStatus;
+	end;
+
+	AuthorizationCallbacksPtr = ^AuthorizationCallbacks;
+
+{!
+    @struct
+    Interface that must be implemented by each plugin. 
+    
+    @field version  Must be set to kAuthorizationPluginInterfaceVersion
+    @field PluginDestroy    Plugin should clean up and release any resources it is holding.
+    @field MechanismCreate  The plugin should create a mechanism named mechanismId.  The mechanism needs to use the AuthorizationEngineRef for the callbacks and pass back a   AuthorizationMechanismRef for itself.  MechanismDestroy will be called when it is no longer needed.
+    @field MechanismInvoke  Invoke an instance of a mechanism.  It should call SetResult during or after returning from this function.
+    @field MechanismDeactivate  Mechanism should respond with a DidDeactivate as soon as possible
+    @field MechanismDestroy Mechanism should clean up and release any resources it is holding
+}
+type
+	AuthorizationPluginInterface = record
+{ Must be set to kAuthorizationPluginInterfaceVersion. }
+		version: UInt32;
+
+    { Notify a plugin that it is about to be unloaded so it get a chance to clean up and release any resources it is holding.  }
+	PluginDestroy : function (inPlugin : AuthorizationPluginRef) : OSStatus;
+	
+    { The plugin should create a mechanism named mechanismId.  The mechanism needs to use the
+        AuthorizationEngineRef for the callbacks and pass back an AuthorizationMechanismRef for
+        itself.  MechanismDestroy will be called when it is no longer needed. }
+ 	MechanismCreate : function (inPlugin 			: AuthorizationPluginRef;
+								inEngine 			: AuthorizationEngineRef;
+								mechanismId			: AuthorizationMechanismId;
+								var outMechanism	: AuthorizationMechanismRef) : OSStatus;
+								
+    { Invoke an instance of a mechanism.  It should call SetResult during or after returning from this function.  }
+	MechanismInvoke : function (inMechanism : AuthorizationMechanismRef) : OSStatus;
+	
+    { Mechanism should respond with a DidDeactivate as soon as possible. }
+	MechanismDeactivate : function (inMechanism : AuthorizationMechanismRef) : OSStatus;
+	
+    { Mechanism should clean up and release any resources it is holding. }
+    MechanismDestroy : function (inMechanism : AuthorizationMechanismRef) : OSStatus;
+	end;
+
+	AuthorizationPluginInterfacePtr = ^AuthorizationPluginInterface;
+
+{!
+    @function AuthorizationPluginCreate
+
+    Initialize a plugin after it gets loaded.  This is the main entry point to a plugin.  This function will only be called once.  
+    After all Mechanism instances have been destroyed outPluginInterface->PluginDestroy will be called.
+
+    @param callbacks (input) A pointer to an AuthorizationCallbacks which contains the callbacks implemented by the AuthorizationEngine.
+    @param outPlugin (output) On successful completion should contain a valid AuthorizationPluginRef.  This will be passed in to any subsequent calls the engine makes to  outPluginInterface->MechanismCreate and outPluginInterface->PluginDestroy.
+    @param outPluginInterface (output) On successful completion should contain a pointer to a AuthorizationPluginInterface that will stay valid until outPluginInterface->PluginDestroy is called. }
+function AuthorizationPluginCreate( const callbacks: AuthorizationCallbacksPtr; var outPlugin: AuthorizationPluginRef; {const} var outPluginInterface: AuthorizationPluginInterfacePtr ): OSStatus; external name '_AuthorizationPluginCreate';
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 131 - 36
packages/univint/src/AuthorizationTags.pas

@@ -1,34 +1,35 @@
 {
- * Copyright (c) 2000-2002 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2004 Apple Computer, Inc. All Rights Reserved.
  * 
- * The contents of this file constitute Original Code as defined in and are
- * subject to the Apple Public Source License Version 1.2 (the 'License').
- * You may not use this file except in compliance with the License. Please obtain
- * a copy of the License at http://www.apple.com/publicsource and read it before
- * using this file.
+ * @APPLE_LICENSE_HEADER_START@
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY of ANY KIND, EITHER EXPRESS
- * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
- * LIMITATION, ANY WARRANTIES of MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
- * specific language governing rights and limitations under the License.
- }
-{	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
-{
- *  AuthorizationTags.h -- Right tags for implementing access control in
- *  applications and daemons
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
  }
-
-
+ {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
+ {	  Pascal Translation Update: Gorazd Krosl <[email protected]>, October 2009 }
+ 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -37,8 +38,8 @@
 
 unit AuthorizationTags;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -51,16 +52,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -68,14 +91,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -101,7 +175,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -112,10 +185,22 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  AuthorizationTags.h -- Right tags for implementing access control in
+ *  applications and daemons
+ }
+
+
 {!
 	@header AuthorizationTags
-	Draft version 2 01/23/2001
 
 	This header defines some of the supported rights tags to be used in the Authorization API.
 }
@@ -125,19 +210,22 @@ uses MacTypes;
 	@define kAuthorizationEnvironmentUsername
 	The name of the AuthorizationItem that should be passed into the environment when specifying a username.  The value and valueLength should contain the username itself.
 }
-const kAuthorizationEnvironmentUsername = 'username';
+const
+	kAuthorizationEnvironmentUsername = 'username';
 
 {!
 	@define kAuthorizationEnvironmentPassword
 	The name of the AuthorizationItem that should be passed into the environment when specifying a password for a given username.  The value and valueLength should contain the actual password data.
 }
-const kAuthorizationEnvironmentPassword = 'password';
+const
+	kAuthorizationEnvironmentPassword = 'password';
 
 {!
 	@define kAuthorizationEnvironmentShared
 	The name of the AuthorizationItem that should be passed into the environment when specifying a username and password.  Adding this entry to the environment will cause the username/password to be added to the shared credential pool of the calling applications session.  This means that further calls by other applications in this session will automatically have this credential availible to them.  The value is ignored.
 }
-const kAuthorizationEnvironmentShared = 'shared';
+const
+	kAuthorizationEnvironmentShared = 'shared';
 
 {!
 	@define kAuthorizationRightExecute
@@ -145,18 +233,25 @@ const kAuthorizationEnvironmentShared = 'shared';
 	
 	You need to aquire this right to be able to perform a AuthorizationExecuteWithPrivileges() operation.  In addtion to this right you should obtain whatever rights the tool you are executing with privileges need to perform it's operation on your behalf.  Currently no options are supported but you should pass in the full path of the tool you wish to execute in the value and valueLength fields.  In the future we will limit the right to only execute the requested path, and we will display this information to the user.
 }
-const kAuthorizationRightExecute= 'system.privilege.admin';
+const
+	kAuthorizationRightExecute = 'system.privilege.admin';
 
 {!
 	@define kAuthorizationEnvironmentPrompt
 	The name of the AuthorizationItem that should be passed into the environment when specifying a invocation specific additional text.  The value should be a localized UTF8 string.
 }
-const kAuthorizationEnvironmentPrompt = 'prompt';
+const
+	kAuthorizationEnvironmentPrompt = 'prompt';
 
 {!
 	@define kAuthorizationEnvironmentIcon
 	The name of the AuthorizationItem that should be passed into the environment when specifying an alternate icon to be used.  The value should be a full path to and image NSImage can deal with.
 }
-const kAuthorizationEnvironmentIcon = 'icon';
+const
+	kAuthorizationEnvironmentIcon = 'icon';
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 257 - 0
packages/univint/src/BackupCore.pas

@@ -0,0 +1,257 @@
+{
+     File:       CarbonCore/BackupCore.h
+ 
+     Contains:   Backup low level Interfaces.
+ 
+     Version:    CarbonCore-859.2~1
+ 
+     Copyright:  © 2006-2008 by Apple Computer, Inc.  All rights reserved
+ 
+     Bugs?:      For bug reports, consult the following page on
+                 the World Wide Web:
+ 
+                     http://www.freepascal.org/bugs.html
+ 
+}
+{   Pascal Translation:  Jonas Maebe, <[email protected]>, October 2009 }
+{
+    Modified for use with Free Pascal
+    Version 308
+    Please report any bugs to <[email protected]>
+}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+{$mode macpas}
+{$packenum 1}
+{$macro on}
+{$inline on}
+{$calling mwpascal}
+
+unit BackupCore;
+interface
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
+
+{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
+    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
+{$endc}
+
+{$ifc defined CPUPOWERPC and defined CPUI386}
+	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
+{$endc}
+{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
+	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
+{$endc}
+
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
+	{$setc __ppc__ := 1}
+{$elsec}
+	{$setc __ppc__ := 0}
+{$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
+{$ifc not defined __i386__ and defined CPUI386}
+	{$setc __i386__ := 1}
+{$elsec}
+	{$setc __i386__ := 0}
+{$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
+
+{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
+	{$error Conflicting definitions for __ppc__ and __i386__}
+{$endc}
+
+{$ifc defined __ppc__ and __ppc__}
+	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __i386__ and __i386__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
+{$endc}
+
+{$ifc defined FPC_BIG_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
+{$elifc defined FPC_LITTLE_ENDIAN}
+	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
+	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
+{$elsec}
+	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
+{$endc}
+{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
+{$setc CALL_NOT_IN_CARBON := FALSE}
+{$setc OLDROUTINENAMES := FALSE}
+{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
+{$setc OPAQUE_UPP_TYPES := TRUE}
+{$setc OTCARBONAPPLICATION := TRUE}
+{$setc OTKERNEL := FALSE}
+{$setc PM_USE_SESSION_APIS := TRUE}
+{$setc TARGET_API_MAC_CARBON := TRUE}
+{$setc TARGET_API_MAC_OS8 := FALSE}
+{$setc TARGET_API_MAC_OSX := TRUE}
+{$setc TARGET_CARBON := TRUE}
+{$setc TARGET_CPU_68K := FALSE}
+{$setc TARGET_CPU_MIPS := FALSE}
+{$setc TARGET_CPU_SPARC := FALSE}
+{$setc TARGET_OS_UNIX := FALSE}
+{$setc TARGET_OS_WIN32 := FALSE}
+{$setc TARGET_RT_MAC_68881 := FALSE}
+{$setc TARGET_RT_MAC_CFM := FALSE}
+{$setc TARGET_RT_MAC_MACHO := TRUE}
+{$setc TYPED_FUNCTION_POINTERS := TRUE}
+{$setc TYPE_BOOL := FALSE}
+{$setc TYPE_EXTENDED := FALSE}
+{$setc TYPE_LONGLONG := TRUE}
+uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
+
+{$ifc TARGET_OS_MAC}
+
+{$ALIGN POWER}
+
+
+{
+ *  CSBackupSetItemExcluded()
+ *  
+ *  Discussion:
+ *    Add or remove an item from the list of items excluded from
+ *    backup. When backing up, the backup daemon skips items marked by
+ *    this call. If a folder is marked for exclusion, it and its
+ *    contents are excluded from backup. When specifying by path, it is
+ *    OK to pass  a URL of an item/folder that does not exist yet.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.5
+ *  
+ *  Parameters:
+ *    
+ *    item:
+ *      The URL of the file/folder to be added or removed from the
+ *      exclusion list.
+ *    
+ *    exclude:
+ *      true to exclude an item, false to stop excluding it.
+ *    
+ *    excludeByPath:
+ *      false to make the exclusion bit 'sticky', i.e. follow the item
+ *      if it gets moved, true to tie the exclusion to an absolute path.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CSBackupSetItemExcluded( item: CFURLRef; exclude: Boolean; excludeByPath: Boolean ): OSStatus; external name '_CSBackupSetItemExcluded';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
+{
+ *  CSBackupIsItemExcluded()
+ *  
+ *  Discussion:
+ *    Report whether or not an item is being excluded from backup.
+ *  
+ *  Mac OS X threading:
+ *    Thread safe since version 10.5
+ *  
+ *  Parameters:
+ *    
+ *    item:
+ *      A URL to the item of interest.
+ *    
+ *    excludeByPath:
+ *      pass an optional return address to determine whether or not the
+ *      given item is excluded as an absolute path or whether it is
+ *      sticky to the item. Can be NULL.
+ *  
+ *  Result:
+ *    true if the item or any of its ancestors are excluded from
+ *    backup, false otherwise.
+ *  
+ *  Availability:
+ *    Mac OS X:         in version 10.5 and later in CoreServices.framework
+ *    CarbonLib:        not available
+ *    Non-Carbon CFM:   not available
+ }
+function CSBackupIsItemExcluded( item: CFURLRef; var excludeByPath: Boolean ): Boolean; external name '_CSBackupIsItemExcluded';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
+
+end.
+{$endc} {not MACOSALLINCLUDE}

+ 131 - 13
packages/univint/src/CFArray.pas

@@ -1,13 +1,15 @@
 {	CFArray.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFArray;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -110,6 +186,8 @@ uses MacTypes,CFBase;
 	Arrays come in two flavors, immutable, which cannot have values
 	added to them or removed from them after the array is created, and
 	mutable, to which you can add values or from which remove values.
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	Mutable arrays have two subflavors, fixed-capacity, for which there
 	is a maximum number set at creation time of values which can be put
 	into the array, and variable capacity, which can have an unlimited
@@ -118,6 +196,11 @@ uses MacTypes,CFBase;
 	arrays can be somewhat higher performing, if you can put a definite
 	upper limit on the number of values that might be put into the
 	array.
+#else
+	Mutable arrays can have an unlimited number of values (or rather,
+	limited only by constraints external to CFArray, like the amount
+	of available memory).
+#endif
 
 	As with all CoreFoundation collection types, arrays maintain hard
 	references on the values you put in them, but the retaining and
@@ -295,6 +378,7 @@ function CFArrayCreateCopy( allocator: CFAllocatorRef; theArray: CFArrayRef ): C
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFArray. The array starts empty, and can grow to this
 		number of values (and it can have less). If this parameter
@@ -302,6 +386,14 @@ function CFArrayCreateCopy( allocator: CFAllocatorRef; theArray: CFArrayRef ): C
 		only limited by address space and available memory
 		constraints). If this parameter is negative, the behavior is
 		undefined.
+#else
+	@param capacity A hint about the number of values that will be held
+		by the CFArray. Pass 0 for no hint. The implementation may
+		ignore this hint, or may use it to optimize various
+		operations. An array's actual capacity is only limited by
+		address space and available memory constraints). If this
+		parameter is negative, the behavior is undefined.
+#endif
 	@param callBacks A pointer to a CFArrayCallBacks structure
 		initialized with the callbacks for the array to use on each
 		value in the array. A copy of the contents of the
@@ -313,7 +405,7 @@ function CFArrayCreateCopy( allocator: CFAllocatorRef; theArray: CFArrayRef ): C
 		NULL, in which case the CFArray will do nothing to add a
 		retain to the contained values for the array. The release
 		field may be NULL, in which case the CFArray will do nothing
-		to remove the arrays retain (if any) on the values when the
+		to remove the array's retain (if any) on the values when the
 		array is destroyed. If the copyDescription field is NULL,
 		the array will create a simple description for the value. If
 		the equal field is NULL, the array will use pointer equality
@@ -339,6 +431,7 @@ function CFArrayCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex; {co
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFArray. The array starts empty, and can grow to this
 		number of values (and it can have less). If this parameter
@@ -348,6 +441,17 @@ function CFArrayCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex; {co
 		to the count of the array which is to be copied, or the
 		behavior is undefined. If this parameter is negative, the
 		behavior is undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+    by the CFArray. Pass 0 for no hint. The implementation may
+    ignore this hint, or may use it to optimize various
+    operations. An array's actual capacity is only limited by 
+    address space and available memory constraints).
+		This parameter must be greater than or equal
+		to the count of the array which is to be copied, or the
+		behavior is undefined. If this parameter is negative, the
+		behavior is undefined.
+#endif
 	@param theArray The array which is to be copied. The values from the
 		array are copied as pointers into the new array (that is,
 		the values themselves are copied, not that which the values
@@ -563,8 +667,11 @@ function CFArrayBSearchValues( theArray: CFArrayRef; range: CFRange; value: {con
 	Adds the value to the array giving it a new largest index.
 	@param theArray The array to which the value is to be added. If this
 		parameter is not a valid mutable CFArray, the behavior is
-		undefined. If the array is a fixed-capacity array and it
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the array is a fixed-capacity array and it
 		is full before this operation, the behavior is undefined.
+#endif
 	@param value The value to add to the array. The value is retained by
 		the array using the retain callback provided when the array
 		was created. If the value is not of the sort expected by the
@@ -579,8 +686,11 @@ procedure CFArrayAppendValue( theArray: CFMutableArrayRef; value: {const} UnivPt
 	Adds the value to the array, giving it the given index.
 	@param theArray The array to which the value is to be added. If this
 		parameter is not a valid mutable CFArray, the behavior is
-		undefined. If the array is a fixed-capacity array and it
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the array is a fixed-capacity array and it
 		is full before this operation, the behavior is undefined.
+#endif
 	@param idx The index to which to add the new value. If the index is
 		outside the index space of the array (0 to N inclusive,
 		where N is the count of the array before the operation), the
@@ -600,9 +710,12 @@ procedure CFArrayInsertValueAtIndex( theArray: CFMutableArrayRef; idx: CFIndex;
 	Changes the value with the given index in the array.
 	@param theArray The array in which the value is to be changed. If this
 		parameter is not a valid mutable CFArray, the behavior is
-		undefined. If the array is a fixed-capacity array and it
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the array is a fixed-capacity array and it
 		is full before this operation and the index is the same as
 		N, the behavior is undefined.
+#endif
 	@param idx The index to which to set the new value. If the index is
 		outside the index space of the array (0 to N inclusive,
 		where N is the count of the array before the operation), the
@@ -723,10 +836,13 @@ procedure CFArraySortValues( theArray: CFMutableArrayRef; range: CFRange; compar
 	Adds the values from an array to another array.
 	@param theArray The array to which values from the otherArray are to
 		be added. If this parameter is not a valid mutable CFArray,
-		the behavior is undefined. If the array is a fixed-capacity
+		the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the array is a fixed-capacity
 		array and adding range.length values from the otherArray
 		exceeds the capacity of the array, the behavior is
 		undefined.
+#endif
 	@param otherArray The array providing the values to be added to the
 		array. If this parameter is not a valid CFArray, the
 		behavior is undefined.
@@ -747,5 +863,7 @@ procedure CFArraySortValues( theArray: CFMutableArrayRef; range: CFRange; compar
 }
 procedure CFArrayAppendArray( theArray: CFMutableArrayRef; otherArray: CFArrayRef; otherRange: CFRange ); external name '_CFArrayAppendArray';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 90 - 11
packages/univint/src/CFAttributedString.pas

@@ -1,13 +1,16 @@
 {	CFAttributedString.h
-	Copyright (c) 2004-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2004-2009, Apple Inc. All rights reserved.
 }
 {       Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
+{       Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +19,8 @@
 
 unit CFAttributedString;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFString,CFDictionary;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -106,8 +183,8 @@ Attributes are identified by key/value pairs stored in CFDictionaryRefs. Keys mu
 { CFAttributedString comes in immutable and mutable flavors.
 }
 type
-	CFAttributedStringRef = ^SInt32; { an opaque 32-bit type }
-	CFMutableAttributedStringRef = ^SInt32; { an opaque 32-bit type }
+	CFAttributedStringRef = ^SInt32; { an opaque type }
+	CFMutableAttributedStringRef = ^SInt32; { an opaque type }
 
 {! @function CFAttributedStringGetTypeID
 Returns the type identifier of all CFAttributedString instances.
@@ -151,7 +228,7 @@ function CFAttributedStringGetLength( aStr: CFAttributedStringRef ): CFIndex; ex
 {! @function CFAttributedStringGetAttributes
 Returns the attributes at the specified location. If effectiveRange is not NULL, upon return *effectiveRange contains a range over which the exact same set of attributes apply. Note that for performance reasons, the returned effectiveRange is not necessarily the maximal range - for that, use CFAttributedStringGetAttributesAndLongestEffectiveRange().  It's a programming error for loc to specify a location outside the bounds of the attributed string.
 
-Note that the returned attribute dictionary might change in unpredicatable ways from under the caller if the attributed string is edited after this call. If you wish to hang on to the dictionary long-term, you should make an actual copy of it rather than just retaining it.  Also, no assumptions should be made about the relationship of the actual CFDictionaryRef returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionary will be identical (that is, ==) to those originally specified.
+Note that the returned attribute dictionary might change in unpredictable ways from under the caller if the attributed string is edited after this call. If you wish to hang on to the dictionary long-term, you should make an actual copy of it rather than just retaining it.  Also, no assumptions should be made about the relationship of the actual CFDictionaryRef returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionary will be identical (that is, ==) to those originally specified.
 }
 function CFAttributedStringGetAttributes( aStr: CFAttributedStringRef; loc: CFIndex; effectiveRange: CFRangePtr ): CFDictionaryRef; external name '_CFAttributedStringGetAttributes';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -241,5 +318,7 @@ In cases where attributed string might do a bunch of work to assure self-consist
 procedure CFAttributedStringEndEditing( aStr: CFMutableAttributedStringRef ); external name '_CFAttributedStringEndEditing';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 86 - 8
packages/univint/src/CFBag.pas

@@ -1,13 +1,15 @@
 {	CFBag.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFBag;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -156,5 +232,7 @@ procedure CFBagRemoveValue( theBag: CFMutableBagRef; value: {const} UnivPtr ); e
 
 procedure CFBagRemoveAllValues( theBag: CFMutableBagRef ); external name '_CFBagRemoveAllValues';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 200 - 34
packages/univint/src/CFBase.pas

@@ -1,13 +1,17 @@
 {	CFBase.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
+{ 		Pascal Translation Updated: Gorazd Krosl <[email protected]>, October 2009 }
+
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +20,8 @@
 
 unit CFBase;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,55 +167,143 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
+type
+  { type moved here to avoid circular dependency between Files and CFURL }
+	CFURLRef = ^SInt32; { an opaque 32-bit type }
+	CFURLRefPtr = ^CFURLRef;
 
 var kCFCoreFoundationVersionNumber: Float64; external name '_kCFCoreFoundationVersionNumber'; (* attribute const *)
 
+{$ifc TARGET_OS_MAC}
+const
+	kCFCoreFoundationVersionNumber10_0 = 196.40;
+const
+	kCFCoreFoundationVersionNumber10_0_3 = 196.50;
+const
+	kCFCoreFoundationVersionNumber10_1 = 226.00;
+const
+	kCFCoreFoundationVersionNumber10_1_1 = 226.00;
+{ Note the next three do not follow the usual numbering policy from the base release }
+const
+	kCFCoreFoundationVersionNumber10_1_2 = 227.20;
 const
-	kCFCoreFoundationVersionNumber10_0 = 196.4;
+	kCFCoreFoundationVersionNumber10_1_3 = 227.20;
 const
-	kCFCoreFoundationVersionNumber10_0_3 = 196.5;
+	kCFCoreFoundationVersionNumber10_1_4 = 227.30;
 const
-	kCFCoreFoundationVersionNumber10_1 = 226.0;
-{ Note the next two do not follow the usual numbering policy from the base release }
+	kCFCoreFoundationVersionNumber10_2 = 263.00;
 const
-	kCFCoreFoundationVersionNumber10_1_2 = 227.2;
+	kCFCoreFoundationVersionNumber10_2_1 = 263.10;
 const
-	kCFCoreFoundationVersionNumber10_1_4 = 227.3;
+	kCFCoreFoundationVersionNumber10_2_2 = 263.10;
 const
-	kCFCoreFoundationVersionNumber10_2 = 263.0;
+	kCFCoreFoundationVersionNumber10_2_3 = 263.30;
 const
-	kCFCoreFoundationVersionNumber10_3 = 299.0;
+	kCFCoreFoundationVersionNumber10_2_4 = 263.30;
 const
-	kCFCoreFoundationVersionNumber10_3_3 = 299.3;
+	kCFCoreFoundationVersionNumber10_2_5 = 263.50;
+const
+	kCFCoreFoundationVersionNumber10_2_6 = 263.50;
+const
+	kCFCoreFoundationVersionNumber10_2_7 = 263.50;
+const
+	kCFCoreFoundationVersionNumber10_2_8 = 263.50;
+const
+	kCFCoreFoundationVersionNumber10_3 = 299.00;
+const
+	kCFCoreFoundationVersionNumber10_3_1 = 299.00;
+const
+	kCFCoreFoundationVersionNumber10_3_2 = 299.00;
+const
+	kCFCoreFoundationVersionNumber10_3_3 = 299.30;
 const
 	kCFCoreFoundationVersionNumber10_3_4 = 299.31;
+const
+	kCFCoreFoundationVersionNumber10_3_5 = 299.31;
+const
+	kCFCoreFoundationVersionNumber10_3_6 = 299.32;
+const
+	kCFCoreFoundationVersionNumber10_3_7 = 299.33;
+const
+	kCFCoreFoundationVersionNumber10_3_8 = 299.33;
+const
+	kCFCoreFoundationVersionNumber10_3_9 = 299.35;
+const
+	kCFCoreFoundationVersionNumber10_4 = 368.00;
+const
+	kCFCoreFoundationVersionNumber10_4_1 = 368.10;
+const
+	kCFCoreFoundationVersionNumber10_4_2 = 368.11;
+const
+	kCFCoreFoundationVersionNumber10_4_3 = 368.18;
+const
+	kCFCoreFoundationVersionNumber10_4_4_Intel = 368.26;
+const
+	kCFCoreFoundationVersionNumber10_4_4_PowerPC = 368.25;
+const
+	kCFCoreFoundationVersionNumber10_4_5_Intel = 368.26;
+const
+	kCFCoreFoundationVersionNumber10_4_5_PowerPC = 368.25;
+const
+	kCFCoreFoundationVersionNumber10_4_6_Intel = 368.26;
+const
+	kCFCoreFoundationVersionNumber10_4_6_PowerPC = 368.25;
+const
+	kCFCoreFoundationVersionNumber10_4_7 = 368.27;
+const
+	kCFCoreFoundationVersionNumber10_4_8 = 368.27;
+const
+	kCFCoreFoundationVersionNumber10_4_9 = 368.28;
+const
+	kCFCoreFoundationVersionNumber10_4_10 = 368.28;
+const
+	kCFCoreFoundationVersionNumber10_4_11 = 368.31;
+const
+	kCFCoreFoundationVersionNumber10_5 = 476.00;
+const
+	kCFCoreFoundationVersionNumber10_5_1 = 476.00;
+const
+	kCFCoreFoundationVersionNumber10_5_2 = 476.10;
+const
+	kCFCoreFoundationVersionNumber10_5_3 = 476.13;
+const
+	kCFCoreFoundationVersionNumber10_5_4 = 476.14;
+const
+	kCFCoreFoundationVersionNumber10_5_5 = 476.15;
+const
+	kCFCoreFoundationVersionNumber10_5_6 = 476.17;
+{$endc}
+
+{$ifc TARGET_OS_IPHONE}
+const
+	kCFCoreFoundationVersionNumber_iPhoneOS_2_0 = 478.23;
+const
+	kCFCoreFoundationVersionNumber_iPhoneOS_2_1 = 478.26;
+const
+	kCFCoreFoundationVersionNumber_iPhoneOS_2_2 = 478.29;
+{$endc}
 
-{$ifc TARGET_CPU_PPC_64}
-type
-	CFTypeID = UInt32;
-	CFOptionFlags = UInt64;
-	CFHashCode = UInt32;
-	CFIndex = SInt64;
-	CFIndexPtr = ^CFIndex;
-{$elsec}
 type
-	CFTypeID = UInt32;
-	CFOptionFlags = UInt32;
-	CFHashCode = UInt32;
-	CFIndex = SInt32;
+	CFTypeID = UNSIGNEDLONG;
+	CFOptionFlags = UNSIGNEDLONG;
+	CFHashCode = UNSIGNEDLONG;
+	CFIndex = SIGNEDLONG;
 	CFIndexPtr = ^CFIndex;
-{$endc}
 
 { Base "type" of all "CF objects", and polymorphic functions on them }
 type
-	CFTypeRef = ^SInt32; { an opaque 32-bit type }
-
+	CFTypeRef = ^SInt32; { an opaque type }
+	
+{ GK: We need it for passing open arrays of CFTypes in MDQuery.pas }
+	CFTypeRefPtr = ^CFTypeRef;
 type
-	CFStringRef = ^SInt32; { an opaque 32-bit type }
+	CFStringRef = ^SInt32; { an opaque type }
 	CFStringRefPtr = ^CFStringRef;
-	CFMutableStringRef = ^SInt32; { an opaque 32-bit type }
+	CFMutableStringRef = ^SInt32; { an opaque type }
 	CFMutableStringRefPtr = ^CFMutableStringRef;
 
 {
@@ -326,5 +490,7 @@ function CFCopyDescription( cf: CFTypeRef ): CFStringRef; external name '_CFCopy
 
 function CFGetAllocator( cf: CFTypeRef ): CFAllocatorRef; external name '_CFGetAllocator';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 128 - 19
packages/univint/src/CFBinaryHeap.pas

@@ -1,13 +1,15 @@
 {	CFBinaryHeap.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFBinaryHeap;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 {!
@@ -136,7 +212,7 @@ type
 }
 type
 	CFBinaryHeapCallBacks = record
-	    version: CFIndex;
+	  version: CFIndex;
 		retain: function( allocator: CFAllocatorRef; info: {const} UnivPtr ): UnivPtr;
 		release: procedure( allocator: CFAllocatorRef; info: {const} UnivPtr );
 		copyDescription: function( info: {const} UnivPtr ): CFStringRef;
@@ -178,19 +254,32 @@ function CFBinaryHeapGetTypeID: CFTypeID; external name '_CFBinaryHeapGetTypeID'
 
 {!
 	@function CFBinaryHeapCreate
-	Creates a new mutable or fixed-mutable binary heap with the given values.
+	 Creates a new mutable
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+	 or fixed-mutable
+#endif
+	 binary heap with the given values.
 	@param allocator The CFAllocator which should be used to allocate
 		memory for the binary heap and its storage for values. This
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
-		by the CFBinaryHeap. The binary heap starts empty, and can grow to this
+	by the CFBinaryHeap. The binary heap starts empty, and can grow to this
 		number of values (and it can have less). If this parameter
 		is 0, the binary heap's maximum capacity is unlimited (or rather,
 		only limited by address space and available memory
 		constraints). If this parameter is negative, the behavior is
 		undefined.
+#else
+	@param capacity A hint about the number of values that will be held
+		by the CFBinaryHeap. Pass 0 for no hint. The implementation may
+		ignore this hint, or may use it to optimize various
+		operations. A heap's actual capacity is only limited by 
+		address space and available memory constraints). If this 
+		parameter is negative, the behavior is undefined.
+#endif
 	@param callBacks A pointer to a CFBinaryHeapCallBacks structure
 		initialized with the callbacks for the binary heap to use on
 		each value in the binary heap. A copy of the contents of the
@@ -216,26 +305,42 @@ function CFBinaryHeapGetTypeID: CFTypeID; external name '_CFBinaryHeapGetTypeID'
 		the behavior is undefined. If any of the values put into the
 		binary heap is not one understood by one of the callback functions
 		the behavior when that callback function is used is undefined.
-        @param compareContext A pointer to a CFBinaryHeapCompareContext structure.
+  @param compareContext A pointer to a CFBinaryHeapCompareContext structure.
 	@result A reference to the new CFBinaryHeap.
 }
 function CFBinaryHeapCreate( allocator: CFAllocatorRef; capacity: CFIndex; callBacks: CFBinaryHeapCallBacksPtr; const (*var*) compareContext: CFBinaryHeapCompareContext ): CFBinaryHeapRef; external name '_CFBinaryHeapCreate';
 
 {!
 	@function CFBinaryHeapCreateCopy
-	Creates a new mutable or fixed-mutable binary heap with the values from the given binary heap.
+	 Creates a new mutable
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+	 or fixed-mutable
+#endif
+	 binary heap with the values from the given binary heap.
 	@param allocator The CFAllocator which should be used to allocate
 		memory for the binary heap and its storage for values. This
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFBinaryHeap. The binary heap starts empty, and can grow to this
 		number of values (and it can have less). If this parameter
 		is 0, the binary heap's maximum capacity is unlimited (or rather,
 		only limited by address space and available memory
 		constraints). If this parameter is negative, or less than the number of
-                values in the given binary heap, the behavior is undefined.
+    values in the given binary heap, the behavior is undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+		by the CFBinaryHeap. Pass 0 for no hint. The implementation may
+		ignore this hint, or may use it to optimize various
+		operations. A heap's actual capacity is only limited by
+		address space and available memory constraints). 
+		This parameter must be greater than or equal
+		to the count of the heap which is to be copied, or the
+		behavior is undefined. If this parameter is negative, the
+		behavior is undefined.
+#endif
 	@param heap The binary heap which is to be copied. The values from the
 		binary heap are copied as pointers into the new binary heap (that is,
 		the values themselves are copied, not that which the values
@@ -244,7 +349,7 @@ function CFBinaryHeapCreate( allocator: CFAllocatorRef; capacity: CFIndex; callB
 		be the same as the given binary heap. The new binary heap uses the same
 		callbacks as the binary heap to be copied. If this parameter is
 		not a valid CFBinaryHeap, the behavior is undefined.
-	@result A reference to the new mutable or fixed-mutable binary heap.
+	@result A reference to the new binary heap.
 }
 function CFBinaryHeapCreateCopy( allocator: CFAllocatorRef; capacity: CFIndex; heap: CFBinaryHeapRef ): CFBinaryHeapRef; external name '_CFBinaryHeapCreateCopy';
 
@@ -348,11 +453,13 @@ procedure CFBinaryHeapApplyFunction( heap: CFBinaryHeapRef; applier: CFBinaryHea
 
 {!
 	@function CFBinaryHeapAddValue
-	Adds the value to the binary heap.
+	 Adds the value to the binary heap.
 	@param heap The binary heap to which the value is to be added. If this parameter is not a
-		valid mutable CFBinaryHeap, the behavior is undefined.
-                If the binary heap is a fixed-capacity binary heap and it
-		is full before this operation, the behavior is undefined.
+	 valid mutable CFBinaryHeap, the behavior is undefined.
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+	 If the binary heap is a fixed-capacity binary heap and it
+	 is full before this operation, the behavior is undefined.
+#endif
 	@param value The value to add to the binary heap. The value is retained by
 		the binary heap using the retain callback provided when the binary heap
 		was created. If the value is not of the sort expected by the
@@ -377,5 +484,7 @@ procedure CFBinaryHeapRemoveMinimumValue( heap: CFBinaryHeapRef ); external name
 }
 procedure CFBinaryHeapRemoveAllValues( heap: CFBinaryHeapRef ); external name '_CFBinaryHeapRemoveAllValues';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 88 - 10
packages/univint/src/CFBitVector.pas

@@ -1,14 +1,16 @@
 {	CFBitVector.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {       Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +19,8 @@
 
 unit CFBitVector;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -99,8 +175,8 @@ type
 	CFBit = UInt32;
 
 type
-	CFBitVectorRef = ^SInt32; { an opaque 32-bit type }
-	CFMutableBitVectorRef = ^SInt32; { an opaque 32-bit type }
+	CFBitVectorRef = ^SInt32; { an opaque type }
+	CFMutableBitVectorRef = ^SInt32; { an opaque type }
 
 function CFBitVectorGetTypeID: CFTypeID; external name '_CFBitVectorGetTypeID';
 
@@ -124,5 +200,7 @@ procedure CFBitVectorSetBitAtIndex( bv: CFMutableBitVectorRef; idx: CFIndex; val
 procedure CFBitVectorSetBits( bv: CFMutableBitVectorRef; range: CFRange; value: CFBit ); external name '_CFBitVectorSetBits';
 procedure CFBitVectorSetAllBits( bv: CFMutableBitVectorRef; value: CFBit ); external name '_CFBitVectorSetAllBits';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 155 - 26
packages/univint/src/CFBundle.pas

@@ -1,13 +1,15 @@
 {	CFBundle.h
-	Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1999-2009, Apple Inc. All rights reserved.
 }
 {       Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFBundle;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -90,21 +164,23 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,CFBase,CFArray,CFDictionary,CFString,CFURL;
+uses MacTypes,CFBase,CFArray,CFDictionary,CFError,CFString,CFURL;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 type
-	CFBundleRef = ^SInt32; { an opaque 32-bit type }
+	CFBundleRef = ^SInt32; { an opaque type }
 	CFBundleRefPtr = ^CFBundleRef;
-	CFPlugInRef = ^SInt32; { an opaque 32-bit type }
+	CFPlugInRef = ^SInt32; { an opaque type }
 	CFPlugInRefPtr = ^CFPlugInRef;
 
 { ===================== Standard Info.plist keys ===================== }
 var kCFBundleInfoDictionaryVersionKey: CFStringRef; external name '_kCFBundleInfoDictionaryVersionKey'; (* attribute const *)
     { The version of the Info.plist format }
 var kCFBundleExecutableKey: CFStringRef; external name '_kCFBundleExecutableKey'; (* attribute const *)
-    { The name of the executable in this bundle (if any) }
+    { The name of the executable in this bundle, if any }
 var kCFBundleIdentifierKey: CFStringRef; external name '_kCFBundleIdentifierKey'; (* attribute const *)
     { The bundle identifier (for CFBundleGetBundleWithIdentifier()) }
 var kCFBundleVersionKey: CFStringRef; external name '_kCFBundleVersionKey'; (* attribute const *)
@@ -131,18 +207,19 @@ function CFBundleGetBundleWithIdentifier( bundleID: CFStringRef ): CFBundleRef;
     { only bundles already loaded or otherwise known to the current process. }
 
 function CFBundleGetAllBundles: CFArrayRef; external name '_CFBundleGetAllBundles';
-    { This is potentially expensive.  Use with care. }
+    { This is potentially expensive, and not thread-safe.  Use with care. }
+    { Best used for debuggging or other diagnostic purposes. }
 
 { ===================== Creating Bundles ===================== }
 
-function CFBundleGetTypeID: UInt32; external name '_CFBundleGetTypeID';
+function CFBundleGetTypeID: CFTypeID; external name '_CFBundleGetTypeID';
 
 function CFBundleCreate( allocator: CFAllocatorRef; bundleURL: CFURLRef ): CFBundleRef; external name '_CFBundleCreate';
     { Might return an existing instance with the ref-count bumped. }
 
 function CFBundleCreateBundlesFromDirectory( allocator: CFAllocatorRef; directoryURL: CFURLRef; bundleType: CFStringRef ): CFArrayRef; external name '_CFBundleCreateBundlesFromDirectory';
-    { Create instances for all bundles in the given directory matching the given }
-    { type (or all of them if bundleType is NULL) }
+    { Create instances for all bundles in the given directory matching the given type }
+    { (or all of them if bundleType is NULL).  Instances are created using CFBundleCreate() and are not released. }
 
 { ==================== Basic Bundle Info ==================== }
 
@@ -187,7 +264,7 @@ function CFBundleCopyBuiltInPlugInsURL( bundle: CFBundleRef ): CFURLRef; externa
 function CFBundleCopyInfoDictionaryInDirectory( bundleURL: CFURLRef ): CFDictionaryRef; external name '_CFBundleCopyInfoDictionaryInDirectory';
 
 function CFBundleGetPackageInfoInDirectory( url: CFURLRef; var packageType: UInt32; var packageCreator: UInt32 ): Boolean; external name '_CFBundleGetPackageInfoInDirectory';
-    
+
 { ==================== Resource Handling API ==================== }
 
 function CFBundleCopyResourceURL( bundle: CFBundleRef; resourceName: CFStringRef; resourceType: CFStringRef; subDirName: CFStringRef ): CFURLRef; external name '_CFBundleCopyResourceURL';
@@ -241,6 +318,11 @@ function CFBundleCopyLocalizationsForPreferences( locArray: CFArrayRef; prefArra
 function CFBundleCopyResourceURLForLocalization( bundle: CFBundleRef; resourceName: CFStringRef; resourceType: CFStringRef; subDirName: CFStringRef; localizationName: CFStringRef ): CFURLRef; external name '_CFBundleCopyResourceURLForLocalization';
 
 function CFBundleCopyResourceURLsOfTypeForLocalization( bundle: CFBundleRef; resourceType: CFStringRef; subDirName: CFStringRef; localizationName: CFStringRef ): CFArrayRef; external name '_CFBundleCopyResourceURLsOfTypeForLocalization';
+    { The localizationName argument to CFBundleCopyResourceURLForLocalization() or }
+    { CFBundleCopyResourceURLsOfTypeForLocalization() must be identical to one of the }
+    { localizations in the bundle, as returned by CFBundleCopyBundleLocalizations(). }
+    { It is recommended that either CFBundleCopyPreferredLocalizationsFromArray() or }
+    { CFBundleCopyLocalizationsForPreferences() be used to select the localization. }
 
 {#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
 { =================== Unbundled application info ===================== }
@@ -248,18 +330,24 @@ function CFBundleCopyResourceURLsOfTypeForLocalization( bundle: CFBundleRef; res
 { information about an application that may be bundled or unbundled.   }
 function CFBundleCopyInfoDictionaryForURL( url: CFURLRef ): CFDictionaryRef; external name '_CFBundleCopyInfoDictionaryForURL';
     { For a directory URL, this is equivalent to CFBundleCopyInfoDictionaryInDirectory. }
-    { For a plain file URL representing an unbundled application, this will attempt to read }
-    { an info dictionary either from the (__TEXT, __info_plist) section (for a Mach-o file) }
+    { For a plain file URL representing an unbundled executable, this will attempt to read }
+    { an info dictionary from the (__TEXT, __info_plist) section, if it is a Mach-o file, }
     { or from a 'plst' resource.  }
 
 function CFBundleCopyLocalizationsForURL( url: CFURLRef ): CFArrayRef; external name '_CFBundleCopyLocalizationsForURL';
     { For a directory URL, this is equivalent to calling CFBundleCopyBundleLocalizations }
-    { on the corresponding bundle.  For a plain file URL representing an unbundled application, }
+    { on the corresponding bundle.  For a plain file URL representing an unbundled executable, }
     { this will attempt to determine its localizations using the CFBundleLocalizations and }
     { CFBundleDevelopmentRegion keys in the dictionary returned by CFBundleCopyInfoDictionaryForURL,}
-    { or a 'vers' resource if those are not present.  }
+    { or from a 'vers' resource if those are not present.  }
 {#endif}
 
+function CFBundleCopyExecutableArchitecturesForURL( url: CFURLRef ): CFArrayRef; external name '_CFBundleCopyExecutableArchitecturesForURL';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+    { For a directory URL, this is equivalent to calling CFBundleCopyExecutableArchitectures() }
+    { on the corresponding bundle.  For a plain file URL representing an unbundled executable, }
+    { this will return the architectures it provides, if it is a Mach-o file, or NULL otherwise. }
+
 { ==================== Primitive Code Loading API ==================== }
 { This API abstracts the various different executable formats supported on }
 { various platforms.  It can load DYLD, CFM, or DLL shared libraries (on their }
@@ -270,10 +358,40 @@ function CFBundleCopyLocalizationsForURL( url: CFURLRef ): CFArrayRef; external
 
 function CFBundleCopyExecutableURL( bundle: CFBundleRef ): CFURLRef; external name '_CFBundleCopyExecutableURL';
 
-function CFBundleIsExecutableLoaded( bundle: CFBundleRef ): Boolean; external name '_CFBundleIsExecutableLoaded';
+{#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+const
+	kCFBundleExecutableArchitectureI386 = $00000007;
+	kCFBundleExecutableArchitecturePPC = $00000012;
+	kCFBundleExecutableArchitectureX86_64 = $01000007;
+	kCFBundleExecutableArchitecturePPC64 = $01000012;
+{#endif} { MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED }
+
+function CFBundleCopyExecutableArchitectures( bundle: CFBundleRef ): CFArrayRef; external name '_CFBundleCopyExecutableArchitectures';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+    { If the bundle's executable exists and is a Mach-o file, this function will return an array }
+    { of CFNumbers whose values are integers representing the architectures the file provides. }
+    { The values currently in use are those listed in the enum above, but others may be added }
+    { in the future.  If the executable is not a Mach-o file, this function returns NULL. }
+
+function CFBundlePreflightExecutable( bundle: CFBundleRef; var error: CFErrorRef ): Boolean; external name '_CFBundlePreflightExecutable';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+    { This function will return true if the bundle is loaded, or if the bundle appears to be }
+    { loadable upon inspection.  This does not mean that the bundle is definitively loadable, }
+    { since it may fail to load due to link errors or other problems not readily detectable. }
+    { If this function detects problems, it will return false, and return a CFError by reference. }
+    { It is the responsibility of the caller to release the CFError. }
+
+function CFBundleLoadExecutableAndReturnError( bundle: CFBundleRef; var error: CFErrorRef ): Boolean; external name '_CFBundleLoadExecutableAndReturnError';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+    { If the bundle is already loaded, this function will return true.  Otherwise, it will attempt }
+    { to load the bundle, and it will return true if that attempt succeeds.  If the bundle fails }
+    { to load, this function will return false, and it will return a CFError by reference.  }
+    { It is the responsibility of the caller to release the CFError. }
 
 function CFBundleLoadExecutable( bundle: CFBundleRef ): Boolean; external name '_CFBundleLoadExecutable';
 
+function CFBundleIsExecutableLoaded( bundle: CFBundleRef ): Boolean; external name '_CFBundleIsExecutableLoaded';
+
 procedure CFBundleUnloadExecutable( bundle: CFBundleRef ); external name '_CFBundleUnloadExecutable';
 
 function CFBundleGetFunctionPointerForName( bundle: CFBundleRef; functionName: CFStringRef ): UnivPtr; external name '_CFBundleGetFunctionPointerForName';
@@ -299,20 +417,29 @@ function CFBundleGetPlugIn( bundle: CFBundleRef ): CFPlugInRef; external name '_
 
 { ==================== Resource Manager-Related API ==================== }
 
-function CFBundleOpenBundleResourceMap( bundle: CFBundleRef ): SInt16; external name '_CFBundleOpenBundleResourceMap';
+{$ifc TARGET_CPU_64}
+type
+	CFBundleRefNum = SInt32;
+{$elsec}
+type
+	CFBundleRefNum = SInt16;
+{$endc}
+
+function CFBundleOpenBundleResourceMap( bundle: CFBundleRef ): CFBundleRefNum; external name '_CFBundleOpenBundleResourceMap';
    { This function opens the non-localized and the localized resource files }
    { (if any) for the bundle, creates and makes current a single read-only }
    { resource map combining both, and returns a reference number for it. }
    { If it is called multiple times, it opens the files multiple times, }
    { and returns distinct reference numbers.  }
 
-function CFBundleOpenBundleResourceFiles( bundle: CFBundleRef; var refNum: SInt16; var localizedRefNum: SInt16 ): SInt32; external name '_CFBundleOpenBundleResourceFiles';
-   { Similar to CFBundleOpenBundleResourceMap, except that it creates two }
+function CFBundleOpenBundleResourceFiles( bundle: CFBundleRef; var refNum: CFBundleRefNum; var localizedRefNum: CFBundleRefNum ): SInt32; external name '_CFBundleOpenBundleResourceFiles';
+   { Similar to CFBundleOpenBundleResourceMap(), except that it creates two }
    { separate resource maps and returns reference numbers for both. }
 
-procedure CFBundleCloseBundleResourceMap( bundle: CFBundleRef; refNum: SInt16 ); external name '_CFBundleCloseBundleResourceMap';
+procedure CFBundleCloseBundleResourceMap( bundle: CFBundleRef; refNum: CFBundleRefNum ); external name '_CFBundleCloseBundleResourceMap';
 
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 implementation
 
 
@@ -340,3 +467,5 @@ end;
 
 
 end.
+
+{$endc} {not MACOSALLINCLUDE}

+ 88 - 10
packages/univint/src/CFByteOrders.pas

@@ -1,15 +1,16 @@
 {	CFByteOrder.h
-	Copyright (c) 1995-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1995-2009, Apple Inc. All rights reserved.
 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
-{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006, February 2008 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006, February 2008, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -18,8 +19,8 @@
 
 unit CFByteOrders;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -32,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -49,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -82,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -93,11 +166,13 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 type
-	CFByteOrder = SInt32;
+	CFByteOrder = SIGNEDLONG;
 const
 	CFByteOrderUnknown = 0;
 	CFByteOrderLittleEndian = 1;
@@ -167,6 +242,7 @@ function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 
 {$endc}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 implementation
 
 
@@ -400,3 +476,5 @@ end;
 
 
 end.
+
+{$endc} {not MACOSALLINCLUDE}

+ 94 - 10
packages/univint/src/CFCalendar.pas

@@ -1,13 +1,16 @@
 {	CFCalendar.h
-	Copyright (c) 2004-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2004-2009, Apple Inc. All rights reserved.
 }
 {       Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
+{       Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{       Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +19,8 @@
 
 unit CFCalendar;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFLocale,CFDate,CFTimeZone;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -98,7 +175,7 @@ uses MacTypes,CFBase,CFLocale,CFDate,CFTimeZone;
 
 
 type
-	CFCalendarRef = ^SInt32; { an opaque 32-bit type }
+	CFCalendarRef = ^SInt32; { an opaque type }
 
 function CFCalendarGetTypeID: CFTypeID; external name '_CFCalendarGetTypeID';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -141,7 +218,7 @@ procedure CFCalendarSetMinimumDaysInFirstWeek( calendar: CFCalendarRef; mwd: CFI
 
 
 type
-	CFCalendarUnit = SInt32;
+	CFCalendarUnit = UNSIGNEDLONG;
 const
 	kCFCalendarUnitEra = 1 shl 1;
 	kCFCalendarUnitYear = 1 shl 2;
@@ -153,6 +230,9 @@ const
 	kCFCalendarUnitWeek = 1 shl 8;
 	kCFCalendarUnitWeekday = 1 shl 9;
 	kCFCalendarUnitWeekdayOrdinal = 1 shl 10;
+{#if MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+	kCFCalendarUnitQuarter = 1 shl 11;
+{#endif}
 
 function CFCalendarGetMinimumRangeOfUnit( calendar: CFCalendarRef; unt: CFCalendarUnit ): CFRange; external name '_CFCalendarGetMinimumRangeOfUnit';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -166,6 +246,8 @@ function CFCalendarGetRangeOfUnit( calendar: CFCalendarRef; smallerUnit: CFCalen
 function CFCalendarGetOrdinalityOfUnit( calendar: CFCalendarRef; smallerUnit: CFCalendarUnit; biggerUnit: CFCalendarUnit; at: CFAbsoluteTime ): CFIndex; external name '_CFCalendarGetOrdinalityOfUnit';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+function CFCalendarGetTimeRangeOfUnit( calendar: CFCalendarRef; unt: CFCalendarUnit; at: CFAbsoluteTime; var startp: CFAbsoluteTime; var tip: CFTimeInterval ): Boolean; external name '_CFCalendarGetTimeRangeOfUnit';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
 
 function CFCalendarComposeAbsoluteTime( calendar: CFCalendarRef; var at: { out } CFAbsoluteTime; componentDesc: ConstCStringPtr; ... ): Boolean; external name '_CFCalendarComposeAbsoluteTime';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -187,5 +269,7 @@ function CFCalendarGetComponentDifference( calendar: CFCalendarRef; startingAT:
 
 {#endif}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 93 - 15
packages/univint/src/CFCharacterSet.pas

@@ -1,13 +1,15 @@
 {	CFCharacterSet.h
-	Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1999-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFCharacterSet;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFData;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -126,7 +202,7 @@ uses MacTypes,CFBase,CFData;
 	This is the type of a reference to immutable CFCharacterSets.
 }
 type
-	CFCharacterSetRef = ^SInt32; { an opaque 32-bit type }
+	CFCharacterSetRef = ^SInt32; { an opaque type }
 	CFCharacterSetRefPtr = ^CFCharacterSetRef;
 
 {!
@@ -142,7 +218,7 @@ type
         Type of the predefined CFCharacterSet selector values.
 }
 type
-	CFCharacterSetPredefinedSet = SInt32;
+	CFCharacterSetPredefinedSet = SIGNEDLONG;
 const
 	kCFCharacterSetControl = 1; { Control character set (Unicode General Category Cc and Cf) }
 	kCFCharacterSetWhitespace = 2; { Whitespace character set (Unicode General Category Zs and U0009 CHARACTER TABULATION) }
@@ -227,13 +303,13 @@ function CFCharacterSetCreateWithCharactersInString( alloc: CFAllocatorRef; theS
                 bitmap representation of the Unicode character points
                 the character set is filled with.  The bitmap
                 representation could contain all the Unicode character
-                range starting from BMP to Plane 16.  The first 8K bytes
-                of the data represents the BMP range.  The BMP range 8K
-                bytes can be followed by zero to sixteen 8K byte
+                range starting from BMP to Plane 16.  The first 8192 bytes
+                of the data represents the BMP range.  The BMP range 8192
+                bytes can be followed by zero to sixteen 8192 byte
                 bitmaps, each one with the plane index byte prepended.
                 For example, the bitmap representing the BMP and Plane 2
-                has the size of 16385 bytes (8K bytes for BMP, 1 byte
-                index + 8K bytes bitmap for Plane 2).  The plane index
+                has the size of 16385 bytes (8192 bytes for BMP, 1 byte
+                index + 8192 bytes bitmap for Plane 2).  The plane index
                 byte, in this case, contains the integer value two.  If
                 this parameter is not a valid CFData or it contains a
                 Plane index byte outside of the valid Plane range
@@ -456,5 +532,7 @@ procedure CFCharacterSetIntersect( theSet: CFMutableCharacterSetRef; theOtherSet
 }
 procedure CFCharacterSetInvert( theSet: CFMutableCharacterSetRef ); external name '_CFCharacterSetInvert';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 99 - 9
packages/univint/src/CFData.pas

@@ -1,13 +1,15 @@
 {	CFData.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFData;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,12 +165,14 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
     
 type
-	CFDataRef = ^SInt32; { an opaque 32-bit type }
+	CFDataRef = ^SInt32; { an opaque type }
 	CFDataRefPtr = ^CFDataRef;
 	CFMutableDataRef = CFDataRef;
 	CFMutableDataRefPtr = ^CFMutableDataRef;
@@ -132,5 +208,19 @@ procedure CFDataReplaceBytes( theData: CFMutableDataRef; range: CFRange; newByte
 
 procedure CFDataDeleteBytes( theData: CFMutableDataRef; range: CFRange ); external name '_CFDataDeleteBytes';
 
+{$ifc TARGET_OS_MAC}
+{#if MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+type
+	CFDataSearchFlags = CFOptionFlags;
+
+const
+	kCFDataSearchBackwards = 1 shl 0; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+	kCFDataSearchAnchored = 1 shl 1; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+function CFDataFind( theData: CFDataRef; dataToFind: CFDataRef; searchRange: CFRange; compareOptions: CFDataSearchFlags ): CFRange; external name '_CFDataFind'; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+{#endif}
+{$endc}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 89 - 11
packages/univint/src/CFDate.pas

@@ -1,13 +1,15 @@
 {	CFDate.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFDate;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -107,7 +183,7 @@ var kCFAbsoluteTimeIntervalSince1970: CFTimeInterval; external name '_kCFAbsolut
 var kCFAbsoluteTimeIntervalSince1904: CFTimeInterval; external name '_kCFAbsoluteTimeIntervalSince1904'; (* attribute const *)
 
 type
-	CFDateRef = ^SInt32; { an opaque 32-bit type }
+	CFDateRef = ^SInt32; { an opaque type }
 	CFDateRefPtr = ^CFDateRef;
 
 function CFDateGetTypeID: CFTypeID; external name '_CFDateGetTypeID';
@@ -121,7 +197,7 @@ function CFDateGetTimeIntervalSinceDate( theDate: CFDateRef; otherDate: CFDateRe
 function CFDateCompare( theDate: CFDateRef; otherDate: CFDateRef; context: UnivPtr ): CFComparisonResult; external name '_CFDateCompare';
 
 type
-	CFTimeZoneRef = ^SInt32; { an opaque 32-bit type }
+	CFTimeZoneRef = ^SInt32; { an opaque type }
 	CFTimeZoneRefPtr = ^CFTimeZoneRef;
 
 type
@@ -147,7 +223,7 @@ type
 	CFGregorianUnitsPtr = ^CFGregorianUnits;
 
 type
-	CFGregorianUnitFlags = SInt32;
+	CFGregorianUnitFlags = UNSIGNEDLONG;
 const
 	kCFGregorianUnitsYears = 1 shl 0;
 	kCFGregorianUnitsMonths = 1 shl 1;
@@ -173,5 +249,7 @@ function CFAbsoluteTimeGetDayOfYear( at: CFAbsoluteTime; tz: CFTimeZoneRef ): SI
 
 function CFAbsoluteTimeGetWeekOfYear( at: CFAbsoluteTime; tz: CFTimeZoneRef ): SInt32; external name '_CFAbsoluteTimeGetWeekOfYear';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 128 - 12
packages/univint/src/CFDateFormatter.pas

@@ -1,14 +1,17 @@
 {	CFDateFormatter.h
-	Copyright (c) 2003-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2003-2009, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +20,8 @@
 
 unit CFDateFormatter;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,23 +167,29 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFDate,CFLocale;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 {#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
 
 type
-	CFDateFormatterRef = ^SInt32; { an opaque 32-bit type }
+	CFDateFormatterRef = ^SInt32; { an opaque type }
 
 // CFDateFormatters are not thread-safe.  Do not use one from multiple threads!
 
+function CFDateFormatterCreateDateFormatFromTemplate( allocator: CFAllocatorRef; tmplate: CFStringRef; options: CFOptionFlags; locale: CFLocaleRef ): CFStringRef; external name '_CFDateFormatterCreateDateFormatFromTemplate';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+	// no options defined, pass 0 for now
+
 function CFDateFormatterGetTypeID: CFTypeID; external name '_CFDateFormatterGetTypeID';
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 
-// date and time format styles
 type
-	CFDateFormatterStyle = SInt32;
+	CFDateFormatterStyle = SIGNEDLONG;
 const
+// date and time format styles
 	kCFDateFormatterNoStyle = 0;
 	kCFDateFormatterShortStyle = 1;
 	kCFDateFormatterMediumStyle = 2;
@@ -213,6 +294,36 @@ var kCFDateFormatterAMSymbol: CFStringRef; external name '_kCFDateFormatterAMSym
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)		// CFString
 var kCFDateFormatterPMSymbol: CFStringRef; external name '_kCFDateFormatterPMSymbol'; (* attribute const *)
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)		// CFString
+var kCFDateFormatterLongEraSymbols: CFStringRef; external name '_kCFDateFormatterLongEraSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)   // CFArray of CFString
+var kCFDateFormatterVeryShortMonthSymbols: CFStringRef; external name '_kCFDateFormatterVeryShortMonthSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterStandaloneMonthSymbols: CFStringRef; external name '_kCFDateFormatterStandaloneMonthSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterShortStandaloneMonthSymbols: CFStringRef; external name '_kCFDateFormatterShortStandaloneMonthSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterVeryShortStandaloneMonthSymbols: CFStringRef; external name '_kCFDateFormatterVeryShortStandaloneMonthSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterVeryShortWeekdaySymbols: CFStringRef; external name '_kCFDateFormatterVeryShortWeekdaySymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterStandaloneWeekdaySymbols: CFStringRef; external name '_kCFDateFormatterStandaloneWeekdaySymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterShortStandaloneWeekdaySymbols: CFStringRef; external name '_kCFDateFormatterShortStandaloneWeekdaySymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterVeryShortStandaloneWeekdaySymbols: CFStringRef; external name '_kCFDateFormatterVeryShortStandaloneWeekdaySymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterQuarterSymbols: CFStringRef; external name '_kCFDateFormatterQuarterSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) 	// CFArray of CFString
+var kCFDateFormatterShortQuarterSymbols: CFStringRef; external name '_kCFDateFormatterShortQuarterSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterStandaloneQuarterSymbols: CFStringRef; external name '_kCFDateFormatterStandaloneQuarterSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterShortStandaloneQuarterSymbols: CFStringRef; external name '_kCFDateFormatterShortStandaloneQuarterSymbols'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFArray of CFString
+var kCFDateFormatterGregorianStartDate: CFStringRef; external name '_kCFDateFormatterGregorianStartDate'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFDate
+var kCFDateFormatterDoesRelativeDateFormattingKey: CFStringRef; external name '_kCFDateFormatterDoesRelativeDateFormattingKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *) // CFBoolean
 
 // See CFLocale.h for these calendar constants:
 //	const CFStringRef kCFGregorianCalendar;
@@ -222,9 +333,14 @@ var kCFDateFormatterPMSymbol: CFStringRef; external name '_kCFDateFormatterPMSym
 //	const CFStringRef kCFIslamicCivilCalendar;
 //	const CFStringRef kCFHebrewCalendar;
 //	const CFStringRef kCFChineseCalendar;
-
+//	const CFStringRef kCFRepublicOfChinaCalendar;
+//	const CFStringRef kCFPersianCalendar;
+//	const CFStringRef kCFIndianCalendar;
+//	const CFStringRef kCFISO8601Calendar;   not yet implemented
 
 {#endif}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 127 - 13
packages/univint/src/CFDictionary.pas

@@ -1,13 +1,15 @@
 {	CFDictionary.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFDictionary;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -112,6 +188,7 @@ uses MacTypes,CFBase;
 	dictionary form a set; that is, no two keys which are equal to
 	one another are present in the dictionary at any time.
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	Dictionaries come in two flavors, immutable, which cannot have
 	values added to them or removed from them after the dictionary is
 	created, and mutable, to which you can add values or from which
@@ -123,6 +200,14 @@ uses MacTypes,CFBase;
 	amount of available memory). Fixed-capacity dictionaries can be
 	somewhat higher performing, if you can put a definate upper limit
 	on the number of values that might be put into the dictionary.
+#else
+	Dictionaries come in two flavors, immutable, which cannot have
+	values added to them or removed from them after the dictionary is
+	created, and mutable, to which you can add values or from which
+	remove values. Mutable dictionaries can have an unlimited number
+	of values (or rather, limited only by constraints external to
+	CFDictionary, like the amount of available memory).
+#endif
 
 	As with all CoreFoundation collection types, dictionaries maintain
 	hard references on the values you put in them, but the retaining and
@@ -144,9 +229,9 @@ uses MacTypes,CFBase;
 
 	Computational Complexity
 	The access time for a value in the dictionary is guaranteed to be at
-	worst O(lg N) for any implementation, current and future, but will
+	worst O(N) for any implementation, current and future, but will
 	often be O(1) (constant time). Insertion or deletion operations
-	will typically be constant time as well, but are O(N*lg N) in the
+	will typically be constant time as well, but are O(N*N) in the
 	worst case in some implementations. Access of values through a key
 	is faster than accessing values directly (if there are any such
 	operations). Dictionaries will tend to use significantly more memory
@@ -271,7 +356,7 @@ type
 	This is the type of a reference to immutable CFDictionarys.
 }
 type
-	CFDictionaryRef = ^SInt32; { an opaque 32-bit type }
+	CFDictionaryRef = ^SInt32; { an opaque type }
 	CFDictionaryRefPtr = ^CFDictionaryRef;
 
 {!
@@ -403,6 +488,7 @@ function CFDictionaryCreateCopy( allocator: CFAllocatorRef; theDict: CFDictionar
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained by
 		the CFDictionary. The dictionary starts empty, and can grow
 		to this number of values (and it can have less). If this
@@ -410,6 +496,14 @@ function CFDictionaryCreateCopy( allocator: CFAllocatorRef; theDict: CFDictionar
 		(or rather, only limited by address space and available memory
 		constraints). If this parameter is negative, the behavior is
 		undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+    by the CFDictionary. Pass 0 for no hint. The implementation may
+    ignore this hint, or may use it to optimize various
+    operations. A dictionary's actual capacity is only limited by 
+    address space and available memory constraints). If this 
+    parameter is negative, the behavior is undefined.
+#endif
 	@param keyCallBacks A pointer to a CFDictionaryKeyCallBacks structure
 		initialized with the callbacks for the dictionary to use on
 		each key in the dictionary. A copy of the contents of the
@@ -476,6 +570,7 @@ function CFDictionaryCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFDictionary. The dictionary starts empty, and can grow
 		to this number of values (and it can have less). If this
@@ -485,6 +580,17 @@ function CFDictionaryCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex
 		to the count of the dictionary which is to be copied, or the
 		behavior is undefined. If this parameter is negative, the
 		behavior is undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+    by the CFDictionary. Pass 0 for no hint. The implementation may
+    ignore this hint, or may use it to optimize various
+    operations. A dictionary's actual capacity is only limited by
+    address space and available memory constraints). 
+    This parameter must be greater than or equal
+    to the count of the dictionary which is to be copied, or the
+    behavior is undefined. If this parameter is negative, the
+    behavior is undefined.
+#endif
 	@param theDict The dictionary which is to be copied. The keys and values
 		from the dictionary are copied as pointers into the new
 		dictionary (that is, the values themselves are copied, not
@@ -664,8 +770,11 @@ procedure CFDictionaryApplyFunction( theDict: CFDictionaryRef; applier: CFDictio
 	Adds the key-value pair to the dictionary if no such key already exists.
 	@param theDict The dictionary to which the value is to be added. If this
 		parameter is not a valid mutable CFDictionary, the behavior is
-		undefined. If the dictionary is a fixed-capacity dictionary and
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the dictionary is a fixed-capacity dictionary and
 		it is full before this operation, the behavior is undefined.
+#endif
 	@param key The key of the value to add to the dictionary. The key is
 		retained by the dictionary using the retain callback provided
 		when the dictionary was created. If the key is not of the sort
@@ -684,9 +793,12 @@ procedure CFDictionaryAddValue( theDict: CFMutableDictionaryRef; key: {const} Un
 	Sets the value of the key in the dictionary.
 	@param theDict The dictionary to which the value is to be set. If this
 		parameter is not a valid mutable CFDictionary, the behavior is
-		undefined. If the dictionary is a fixed-capacity dictionary and
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the dictionary is a fixed-capacity dictionary and
 		it is full before this operation, and the key does not exist in
 		the dictionary, the behavior is undefined.
+#endif
 	@param key The key of the value to set into the dictionary. If a key 
 		which matches this key is already present in the dictionary, only
 		the value is changed ("add if absent, replace if present"). If
@@ -743,5 +855,7 @@ procedure CFDictionaryRemoveValue( theDict: CFMutableDictionaryRef; key: {const}
 }
 procedure CFDictionaryRemoveAllValues( theDict: CFMutableDictionaryRef ); external name '_CFDictionaryRemoveAllValues';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 87 - 8
packages/univint/src/CFError.pas

@@ -3,13 +3,15 @@
 }
 
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -18,8 +20,8 @@
 
 unit CFError;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -32,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -49,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -82,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -93,6 +167,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFBase, CFDictionary;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -125,7 +201,8 @@ uses MacTypes, CFBase, CFDictionary;
 	    This is the type of a reference to CFErrors.  CFErrorRef is toll-free bridged with NSError.
 }
 type
-	CFErrorRef = ^SInt32; { an opaque 32-bit type }
+	CFErrorRef = ^SInt32; { an opaque type }
+	CFErrorRefPtr = ^CFErrorRef;
 
 {!
 	@function CFErrorGetTypeID
@@ -256,5 +333,7 @@ function CFErrorCopyFailureReason( err: CFErrorRef ): CFStringRef; external name
 }
 function CFErrorCopyRecoverySuggestion( err: CFErrorRef ): CFStringRef; external name '_CFErrorCopyRecoverySuggestion';
 (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 308 - 232
packages/univint/src/CFFTPStream.pas

@@ -1,27 +1,25 @@
 {
-     File:       CFNetwork/CFFTPStream.h
+	 File:	   CFNetwork/CFFTPStream.h
  
-     Contains:   CoreFoundation FTP stream header
+	 Contains:   CoreFoundation FTP stream header
+  
+	 Copyright:  Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  
-     Version:    CFNetwork-71.2~1
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
-     Copyright:  © 2001-2003 by Apple Computer, Inc., all rights reserved
- 
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
- 
-                     http://www.freepascal.org/bugs.html
+					 http://www.freepascal.org/bugs.html
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +28,8 @@
 
 unit CFFTPStream;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,21 +175,24 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFStream,CFURL,CFDictionary;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
+
 
 {
  *  kCFStreamErrorDomainFTP
  *  
  *  Discussion:
- *    Result code returned by FTP server
+ *	Result code returned by FTP server
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamErrorDomainFTP: SInt32; external name '_kCFStreamErrorDomainFTP'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
@@ -135,196 +208,196 @@ as definition) indicates the value type of the property.
  *  kCFStreamPropertyFTPUserName
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations.  CFString
- *    type to hold login user name.  Don't set this property if you
- *    want anonymous FTP.
+ *	Stream property key, for both set and copy operations.  CFString
+ *	type to hold login user name.  Don't set this property if you
+ *	want anonymous FTP.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPUserName: CFStringRef; external name '_kCFStreamPropertyFTPUserName'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPPassword
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations. CFString
- *    type to hold login password.  Don't set this property if you want
- *    anonymous FTP.
+ *	Stream property key, for both set and copy operations. CFString
+ *	type to hold login password.  Don't set this property if you want
+ *	anonymous FTP.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPPassword: CFStringRef; external name '_kCFStreamPropertyFTPPassword'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPUsePassiveMode
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations. CFBoolean
- *    type. kCFBooleanTrue means use passive mode, kCFBooleanFalse
- *    otherwise
+ *	Stream property key, for both set and copy operations. CFBoolean
+ *	type. kCFBooleanTrue means use passive mode, kCFBooleanFalse
+ *	otherwise
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPUsePassiveMode: CFStringRef; external name '_kCFStreamPropertyFTPUsePassiveMode'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPResourceSize
  *  
  *  Discussion:
- *    Stream property key, for read stream copy operations.  CFNumber
- *    of kCFNumberLongLongType to hold resource size in bytes.
+ *	Stream property key, for read stream copy operations.  CFNumber
+ *	of kCFNumberLongLongType to hold resource size in bytes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPResourceSize: CFStringRef; external name '_kCFStreamPropertyFTPResourceSize'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPFetchResourceInfo
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations.  CFBoolean
- *    type.  TRUE means that resource info, such as size, must be
- *    provided before download starts at higher cost.  Don't set if
- *    resource size/other info is unnecessary.  Initially, only
- *    resource size is implemented.
+ *	Stream property key, for both set and copy operations.  CFBoolean
+ *	type.  TRUE means that resource info, such as size, must be
+ *	provided before download starts at higher cost.  Don't set if
+ *	resource size/other info is unnecessary.  Initially, only
+ *	resource size is implemented.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPFetchResourceInfo: CFStringRef; external name '_kCFStreamPropertyFTPFetchResourceInfo'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPFileTransferOffset
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations.  CFNumber
- *    of kCFNumberLongLongType for the file offset to start transfer at.
+ *	Stream property key, for both set and copy operations.  CFNumber
+ *	of kCFNumberLongLongType for the file offset to start transfer at.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPFileTransferOffset: CFStringRef; external name '_kCFStreamPropertyFTPFileTransferOffset'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPAttemptPersistentConnection
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations.  CFBoolean
- *    type.  TRUE by default, set to FALSE to avoid reusing existing
- *    server connections.
+ *	Stream property key, for both set and copy operations.  CFBoolean
+ *	type.  TRUE by default, set to FALSE to avoid reusing existing
+ *	server connections.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPAttemptPersistentConnection: CFStringRef; external name '_kCFStreamPropertyFTPAttemptPersistentConnection'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPProxy
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations. 
- *    CFDictionary type that holds key-value pairs of proxy dictionary.
- *     The dictionary returned by SystemConfiguration can also be
- *    passed directly as the value.
+ *	Stream property key, for both set and copy operations. 
+ *	CFDictionary type that holds key-value pairs of proxy dictionary.
+ *	 The dictionary returned by SystemConfiguration can also be
+ *	passed directly as the value.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPProxy: CFStringRef; external name '_kCFStreamPropertyFTPProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPProxyHost
  *  
  *  Discussion:
- *    Stream property key or FTP Proxy dictionary key, for both set and
- *    copy operations.  It matches kSCPropNetProxiesFTPProxy defined in
- *    SCSchemaDefinitions.h.  CFString for proxy server host name. 
- *    This property can be set and copied individually or via a
- *    CFDictionary.
+ *	Stream property key or FTP Proxy dictionary key, for both set and
+ *	copy operations.  It matches kSCPropNetProxiesFTPProxy defined in
+ *	SCSchemaDefinitions.h.  CFString for proxy server host name. 
+ *	This property can be set and copied individually or via a
+ *	CFDictionary.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPProxyHost: CFStringRef; external name '_kCFStreamPropertyFTPProxyHost'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyFTPProxyPort
  *  
  *  Discussion:
- *    Stream property key or FTP Proxy dictionary key, for both set and
- *    copy operations.  It matches kSCPropNetProxiesFTPPort defined in
- *    SCSchemaDefinitions.h.  CFNumber of kCFNumberIntType for proxy
- *    server port number.  This property can be set and copied
- *    individually or via a CFDictionary.
+ *	Stream property key or FTP Proxy dictionary key, for both set and
+ *	copy operations.  It matches kSCPropNetProxiesFTPPort defined in
+ *	SCSchemaDefinitions.h.  CFNumber of kCFNumberIntType for proxy
+ *	server port number.  This property can be set and copied
+ *	individually or via a CFDictionary.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPProxyPort: CFStringRef; external name '_kCFStreamPropertyFTPProxyPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 {
  *  kCFStreamPropertyFTPProxyUser
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPProxyUser: CFStringRef; external name '_kCFStreamPropertyFTPProxyUser'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 {
  *  kCFStreamPropertyFTPProxyPassword
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamPropertyFTPProxyPassword: CFStringRef; external name '_kCFStreamPropertyFTPProxyPassword'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
@@ -338,252 +411,255 @@ CFFTPCreateParsedResourceListing.
  *  kCFFTPResourceMode
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFNumber to hold the
- *    resource access permission defined in sys/types.h.
+ *	CFDictionary key, for get value operation.  CFNumber to hold the
+ *	resource access permission defined in sys/types.h.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceMode: CFStringRef; external name '_kCFFTPResourceMode'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceName
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFString that holds
- *    the resource name.
+ *	CFDictionary key, for get value operation.  CFString that holds
+ *	the resource name.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceName: CFStringRef; external name '_kCFFTPResourceName'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceOwner
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFString that holds
- *    the resource owner's name.
+ *	CFDictionary key, for get value operation.  CFString that holds
+ *	the resource owner's name.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceOwner: CFStringRef; external name '_kCFFTPResourceOwner'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceGroup
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFString to hold the
- *    name of the group that shares the resource.
+ *	CFDictionary key, for get value operation.  CFString to hold the
+ *	name of the group that shares the resource.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceGroup: CFStringRef; external name '_kCFFTPResourceGroup'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceLink
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFString to hold
- *    symbolic link information.  If the item is a symbolic link the
- *    string will contain the path to the item the link references.
+ *	CFDictionary key, for get value operation.  CFString to hold
+ *	symbolic link information.  If the item is a symbolic link the
+ *	string will contain the path to the item the link references.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceLink: CFStringRef; external name '_kCFFTPResourceLink'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceSize
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFNumber of
- *    kCFNumberLongLongType to hold the resource length in bytes.
+ *	CFDictionary key, for get value operation.  CFNumber of
+ *	kCFNumberLongLongType to hold the resource length in bytes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceSize: CFStringRef; external name '_kCFFTPResourceSize'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceType
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFNumber to hold the
- *    resource type as defined in sys/dirent.h.
+ *	CFDictionary key, for get value operation.  CFNumber to hold the
+ *	resource type as defined in sys/dirent.h.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceType: CFStringRef; external name '_kCFFTPResourceType'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFFTPResourceModDate
  *  
  *  Discussion:
- *    CFDictinary key, for get value operation.  CFDate to hold the
- *    last modification date and time information.
+ *	CFDictionary key, for get value operation.  CFDate to hold the
+ *	last modification date and time information.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFFTPResourceModDate: CFStringRef; external name '_kCFFTPResourceModDate'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFReadStreamCreateWithFTPURL()
  *  
  *  Discussion:
- *    Create an FTP read stream for downloading operation from an FTP
- *    URL. If the URL refers to a directory, the stream is a filtered
- *    line-at-a-time read stream corresponding to the listing results
- *    provided by the server. If it's a file, then the stream is a
- *    regular read stream providing the data for that file.
+ *	Create an FTP read stream for downloading operation from an FTP
+ *	URL. If the URL refers to a directory, the stream is a filtered
+ *	line-at-a-time read stream corresponding to the listing results
+ *	provided by the server. If it's a file, then the stream is a
+ *	regular read stream providing the data for that file.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      A pointer to the CFAllocator which should be used to allocate
- *      memory for the CF read stream and its storage for values. If
- *      this reference is not a valid CFAllocator, the behavior is
- *      undefined.
- *    
- *    ftpURL:
- *      A pointer to a CFURL structure created by CFURLCreateWithString
- *      function.  If this parameter is not a pointer to a valid CFURL
- *      structure, the behavior is undefined.
+ *	
+ *	alloc:
+ *	  A pointer to the CFAllocator which should be used to allocate
+ *	  memory for the CF read stream and its storage for values. If
+ *	  this reference is not a valid CFAllocator, the behavior is
+ *	  undefined.
+ *	
+ *	ftpURL:
+ *	  A pointer to a CFURL structure created by CFURLCreateWithString
+ *	  function.  If this parameter is not a pointer to a valid CFURL
+ *	  structure, the behavior is undefined.
  *  
  *  Result:
- *    A pointer to the CF read stream created, or NULL if failed. It is
- *    caller's responsibilty to release the memory allocated for the
- *    read stream.
+ *	A pointer to the CF read stream created, or NULL if failed. It is
+ *	caller's responsibilty to release the memory allocated for the
+ *	read stream.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFReadStreamCreateWithFTPURL( alloc: CFAllocatorRef; ftpURL: CFURLRef ): CFReadStreamRef; external name '_CFReadStreamCreateWithFTPURL';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFFTPCreateParsedResourceListing()
  *  
  *  Discussion:
- *    Parse a line of file or folder listing of Unix format, and store
- *    the extracted result in a CFDictionary.
+ *	Parse a line of file or folder listing of Unix format, and store
+ *	the extracted result in a CFDictionary.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      A pointer to the CFAllocator which should be used to allocate
- *      memory for the CFDictionary to hold resource info.  If this
- *      reference is not a valid CFAllocator, the behavior is undefined.
- *    
- *    buffer:
- *      A pointer to a buffer that may hold lines of resource listing,
- *      but only the first line starting from buffer[0] will be parsed
- *      each call.
- *    
- *    bufferLength:
- *      The maximum buffer size in bytes started from the location
- *      pointed by "buffer."
- *    
- *    parsed:
- *      A pointer to a CFDictionary pointer.  The dictionary holds the
- *      extracted resource information.  When parsing fails, a NULL
- *      pointer will be returned.  It is caller's responsibilty to
- *      release the memory allocated for the dictionary.
+ *	
+ *	alloc:
+ *	  A pointer to the CFAllocator which should be used to allocate
+ *	  memory for the CFDictionary to hold resource info.  If this
+ *	  reference is not a valid CFAllocator, the behavior is undefined.
+ *	
+ *	buffer:
+ *	  A pointer to a buffer that may hold lines of resource listing,
+ *	  but only the first line starting from buffer[0] will be parsed
+ *	  each call.
+ *	
+ *	bufferLength:
+ *	  The maximum buffer size in bytes started from the location
+ *	  pointed by "buffer."
+ *	
+ *	parsed:
+ *	  A pointer to a CFDictionary pointer.  The dictionary holds the
+ *	  extracted resource information.  When parsing fails, a NULL
+ *	  pointer will be returned.  It is caller's responsibilty to
+ *	  release the memory allocated for the dictionary.
  *  
  *  Result:
- *    The number of bytes consumed from buffer, 0 if there are not
- *    enough bytes, or -1 if a parse failure occurs.
+ *	The number of bytes consumed from buffer, 0 if there are not
+ *	enough bytes, or -1 if a parse failure occurs.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFFTPCreateParsedResourceListing( alloc: CFAllocatorRef; buffer: UnivPtr; bufferLength: CFIndex; var parsed: CFDictionaryRef ): CFIndex; external name '_CFFTPCreateParsedResourceListing';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFWriteStreamCreateWithFTPURL()
  *  
  *  Discussion:
- *    Create an FTP write stream for uploading operation to a FTP URL.
- *    If the URL specifies a directory, the open will be followed by a
- *    close event/state and the directory will have been created. 
- *    Intermediary directory structure is not created.
+ *	Create an FTP write stream for uploading operation to a FTP URL.
+ *	If the URL specifies a directory, the open will be followed by a
+ *	close event/state and the directory will have been created. 
+ *	Intermediary directory structure is not created.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      A pointer to the CFAllocator which should be used to allocate
- *      memory for the CF read stream and its storage for values. If
- *      this reference is not a valid CFAllocator, the behavior is
- *      undefined.
- *    
- *    ftpURL:
- *      A pointer to a CFURL structure created by CFURLCreateWithString
- *      function.  If this parameter is not a pointer to a valid CFURL
- *      structure, the behavior is undefined.
+ *	
+ *	alloc:
+ *	  A pointer to the CFAllocator which should be used to allocate
+ *	  memory for the CF read stream and its storage for values. If
+ *	  this reference is not a valid CFAllocator, the behavior is
+ *	  undefined.
+ *	
+ *	ftpURL:
+ *	  A pointer to a CFURL structure created by CFURLCreateWithString
+ *	  function.  If this parameter is not a pointer to a valid CFURL
+ *	  structure, the behavior is undefined.
  *  
  *  Result:
- *    A pointer to the CF write stream created, or NULL if failed. It
- *    is caller's responsibilty to release the memory allocated for the
- *    write stream.
+ *	A pointer to the CF write stream created, or NULL if failed. It
+ *	is caller's responsibilty to release the memory allocated for the
+ *	write stream.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFWriteStreamCreateWithFTPURL( alloc: CFAllocatorRef; ftpURL: CFURLRef ): CFWriteStreamRef; external name '_CFWriteStreamCreateWithFTPURL';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 350 - 271
packages/univint/src/CFHTTPAuthentication.pas

@@ -1,23 +1,25 @@
 {
-     File:       CFNetwork/CFHTTPAuthentication.h
+	 File:	   CFNetwork/CFHTTPAuthentication.h
  
-     Contains:   CoreFoundation Network HTTP authentication header
+	 Contains:   CoreFoundation Network HTTP authentication header
  
-     Version:    CFNetwork-129.20~17
+	 Copyright:  Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  
-     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
+					 http://www.freepascal.org/bugs.html
  
 }
-
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -26,8 +28,8 @@
 
 unit CFHTTPAuthentication;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -40,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -57,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -90,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -101,6 +175,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFArray, CFBase, CFDictionary, CFHTTPMessage, CFStream;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -108,19 +184,19 @@ uses MacTypes, CFArray, CFBase, CFDictionary, CFHTTPMessage, CFStream;
  *  CFHTTPAuthenticationRef
  *  
  *  Discussion:
- *    This is the type of a reference to HTTP authentication
- *    information.
+ *	This is the type of a reference to HTTP authentication
+ *	information.
  }
 type
-	CFHTTPAuthenticationRef = ^SInt32; { an opaque 32-bit type }
+	CFHTTPAuthenticationRef = ^SInt32; { an opaque type }
 
 {
  *  CFStreamErrorHTTPAuthentication
  *  
  *  Discussion:
- *    Authentication errors which may be returned as a result of trying
- *    to apply authentication to a request.  These errors are in the
- *    kCFStreamErrorDomainHTTP domain.
+ *	Authentication errors which may be returned as a result of trying
+ *	to apply authentication to a request.  These errors are in the
+ *	kCFStreamErrorDomainHTTP domain.
  }
 type
 	CFStreamErrorHTTPAuthentication = SInt32;
@@ -148,466 +224,469 @@ const
  *  kCFHTTPAuthenticationUsername
  *  
  *  Discussion:
- *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
- *    username for authentication as a CFString.  Needs to be added if
- *    CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
+ *	CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *	username for authentication as a CFString.  Needs to be added if
+ *	CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFHTTPAuthenticationUsername: CFStringRef; external name '_kCFHTTPAuthenticationUsername'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 {
  *  kCFHTTPAuthenticationPassword
  *  
  *  Discussion:
- *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
- *    password for authentication as a CFString.  Needs to be added if
- *    CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
+ *	CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *	password for authentication as a CFString.  Needs to be added if
+ *	CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFHTTPAuthenticationPassword: CFStringRef; external name '_kCFHTTPAuthenticationPassword'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 {
  *  kCFHTTPAuthenticationAccountDomain
  *  
  *  Discussion:
- *    CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
- *    domain for authentication as a CFString.  Needs to be added if
- *    CFHTTPAuthenticationRequiresAccountDomain returns TRUE.
+ *	CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
+ *	domain for authentication as a CFString.  Needs to be added if
+ *	CFHTTPAuthenticationRequiresAccountDomain returns TRUE.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFHTTPAuthenticationAccountDomain: CFStringRef; external name '_kCFHTTPAuthenticationAccountDomain'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 {
  *  CFHTTPAuthenticationGetTypeID()
  *  
  *  Discussion:
- *    Returns the type identifier of all CFHTTPAuthentication instances.
+ *	Returns the type identifier of all CFHTTPAuthentication instances.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationGetTypeID: CFTypeID; external name '_CFHTTPAuthenticationGetTypeID';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationCreateFromResponse()
  *  
  *  Discussion:
- *    Based on a response of 401 or 407, this function will create a
- *    new authentication object which can be used for adding
- *    credentials to future requests.
+ *	Based on a response of 401 or 407, this function will create a
+ *	new authentication object which can be used for adding
+ *	credentials to future requests.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    alloc:
- *      Allocator to use for creating authentication object
- *    
- *    response:
- *      Failed response.
+ *	
+ *	alloc:
+ *	  Allocator to use for creating authentication object
+ *	
+ *	response:
+ *	  Failed response.
  *  
  *  Result:
- *    A freshly created authentication object useful for applying
- *    authentication credentials to new requests.
+ *	A freshly created authentication object useful for applying
+ *	authentication credentials to new requests.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationCreateFromResponse( alloc: CFAllocatorRef; response: CFHTTPMessageRef ): CFHTTPAuthenticationRef; external name '_CFHTTPAuthenticationCreateFromResponse';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationIsValid()
  *  
  *  Discussion:
- *    Returns TRUE if the given authentication information was
- *    instantiated correctly and contains enough information in order
- *    to be applied to a request. If FALSE is returned, the object may
- *    still contain information which is useful to the user, e.g.
- *    unsupported method name.  An invalid object may be queried for
- *    information but may not be applied to a request.
+ *	Returns TRUE if the given authentication information was
+ *	instantiated correctly and contains enough information in order
+ *	to be applied to a request. If FALSE is returned, the object may
+ *	still contain information which is useful to the user, e.g.
+ *	unsupported method name.  An invalid object may be queried for
+ *	information but may not be applied to a request.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
- *    
- *    error:
- *      Reference to a CFStreamError which will be populated in the
- *      case of an error in creation.  Pass NULL if not interested in
- *      the failure reason.  The error domain will be
- *      kCFStreamErrorDomainHTTP, and the error code will be one of
- *      those defined in CFHTTPStream.h or one of those listed as
- *      CFStreamErrorHTTPAuthentication.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
+ *	
+ *	error:
+ *	  Reference to a CFStreamError which will be populated in the
+ *	  case of an error in creation.  Pass NULL if not interested in
+ *	  the failure reason.  The error domain will be
+ *	  kCFStreamErrorDomainHTTP, and the error code will be one of
+ *	  those defined in CFHTTPStream.h or one of those listed as
+ *	  CFStreamErrorHTTPAuthentication.
  *  
  *  Result:
- *    TRUE or FALSE depending on whether the authentication object is
- *    good for applying credentials to further requests.
+ *	TRUE or FALSE depending on whether the authentication object is
+ *	good for applying credentials to further requests.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationIsValid( auth: CFHTTPAuthenticationRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPAuthenticationIsValid';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationAppliesToRequest()
  *  
  *  Discussion:
- *    Returns TRUE if the given request requires credentials based upon
- *    the given authentication information.
+ *	Returns TRUE if the given request requires credentials based upon
+ *	the given authentication information.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
- *    
- *    request:
- *      The request which is believed to need the given authentication.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
+ *	
+ *	request:
+ *	  The request which is believed to need the given authentication.
  *  
  *  Result:
- *    TRUE if the given authentication information should be applied to
- *    the request, otherwise FALSE is returned.
+ *	TRUE if the given authentication information should be applied to
+ *	the request, otherwise FALSE is returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationAppliesToRequest( auth: CFHTTPAuthenticationRef; request: CFHTTPMessageRef ): Boolean; external name '_CFHTTPAuthenticationAppliesToRequest';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationRequiresOrderedRequests()
  *  
  *  Discussion:
- *    Some authentication methods require that future requests must be
- *    performed in an ordered manner, so that information from a
- *    response can be added to a following request.
+ *	Some authentication methods require that future requests must be
+ *	performed in an ordered manner, so that information from a
+ *	response can be added to a following request.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    Returns TRUE if the given authentication method requires ordered
- *    requests.
+ *	Returns TRUE if the given authentication method requires ordered
+ *	requests.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationRequiresOrderedRequests( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresOrderedRequests';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPMessageApplyCredentials()
  *  
  *  Discussion:
- *    Perform the authentication method required on the request using
- *    the given username and password.
+ *	Perform the authentication method required on the request using
+ *	the given username and password.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    request:
- *      The request which is to receive the credentials.
- *    
- *    auth:
- *      The authentication information for the given request.
- *    
- *    username:
- *      The username to use for performing the authentication.
- *    
- *    password:
- *      The password to use for performing the authentication.
- *    
- *    error:
- *      Reference to a CFStreamError which will be populated with the
- *      error information should one occurr during the application of
- *      the credentials. Pass NULL if not interested in the failure
- *      reason.  The error domain will be kCFStreamErrorDomainHTTP, and
- *      the error code will be one of those define in CFHTTPStream.h or
- *      one of those listed as CFStreamErrorHTTPAuthentication.
+ *	
+ *	request:
+ *	  The request which is to receive the credentials.
+ *	
+ *	auth:
+ *	  The authentication information for the given request.
+ *	
+ *	username:
+ *	  The username to use for performing the authentication.
+ *	
+ *	password:
+ *	  The password to use for performing the authentication.
+ *	
+ *	error:
+ *	  Reference to a CFStreamError which will be populated with the
+ *	  error information should one occurr during the application of
+ *	  the credentials. Pass NULL if not interested in the failure
+ *	  reason.  The error domain will be kCFStreamErrorDomainHTTP, and
+ *	  the error code will be one of those define in CFHTTPStream.h or
+ *	  one of those listed as CFStreamErrorHTTPAuthentication.
  *  
  *  Result:
- *    TRUE will be returned if the application of the credentials to
- *    the request was successful, otherwise FALSE is returned.
+ *	TRUE will be returned if the application of the credentials to
+ *	the request was successful, otherwise FALSE is returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPMessageApplyCredentials( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; username: CFStringRef; password: CFStringRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentials';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPMessageApplyCredentialDictionary()
  *  
  *  Discussion:
- *    Perform the authentication method required on the request using
- *    the given credential information.
+ *	Perform the authentication method required on the request using
+ *	the given credential information.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    request:
- *      The request which is to receive the credentials.
- *    
- *    auth:
- *      The authentication information for the given request.
- *    
- *    dict:
- *      A dictionary containing credentials to be applied to the
- *      request.  Valid keys are declared above.
- *    
- *    error:
- *      Reference to a CFStreamError which will be populated with the
- *      error information should one occurr during the application of
- *      the credentials. Pass NULL if not interested in the failure
- *      reason.  The error domain will be kCFStreamErrorDomainHTTP, and
- *      the error code will be one of those define in CFHTTPStream.h or
- *      one of those listed as CFStreamErrorHTTPAuthentication.
+ *	
+ *	request:
+ *	  The request which is to receive the credentials.
+ *	
+ *	auth:
+ *	  The authentication information for the given request.
+ *	
+ *	dict:
+ *	  A dictionary containing credentials to be applied to the
+ *	  request.  Valid keys are declared above.
+ *	
+ *	error:
+ *	  Reference to a CFStreamError which will be populated with the
+ *	  error information should one occurr during the application of
+ *	  the credentials. Pass NULL if not interested in the failure
+ *	  reason.  The error domain will be kCFStreamErrorDomainHTTP, and
+ *	  the error code will be one of those define in CFHTTPStream.h or
+ *	  one of those listed as CFStreamErrorHTTPAuthentication.
  *  
  *  Result:
- *    TRUE will be returned if the application of the credentials to
- *    the request was successful, otherwise FALSE is returned.
+ *	TRUE will be returned if the application of the credentials to
+ *	the request was successful, otherwise FALSE is returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPMessageApplyCredentialDictionary( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; dict: CFDictionaryRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentialDictionary';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationCopyRealm()
  *  
  *  Discussion:
- *    Some authentication techniques provide for namespaces on top of
- *    domains. This call will return the authentication information's
- *    namespace if there is one, otherwise it will return NULL.  This
- *    namespace is usually used for prompting the application user for
- *    a name and password.
+ *	Some authentication techniques provide for namespaces on top of
+ *	domains. This call will return the authentication information's
+ *	namespace if there is one, otherwise it will return NULL.  This
+ *	namespace is usually used for prompting the application user for
+ *	a name and password.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    This call will return the authentication information's namespace
- *    if there is one, otherwise it will return NULL.
+ *	This call will return the authentication information's namespace
+ *	if there is one, otherwise it will return NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationCopyRealm( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyRealm';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationCopyDomains()
  *  
  *  Discussion:
- *    Returns a list of domain URL's on which the given authentication
- *    should be applied. This function is provided mostly for
- *    informational purposes. CFHTTPAuthenticationAppliesToRequest
- *    should be used in order to check whether a request requires the
- *    authentication.
+ *	Returns a list of domain URL's on which the given authentication
+ *	should be applied. This function is provided mostly for
+ *	informational purposes. CFHTTPAuthenticationAppliesToRequest
+ *	should be used in order to check whether a request requires the
+ *	authentication.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    Returns a list of domain URL's on which the given authentication
- *    should be applied.
+ *	Returns a list of domain URL's on which the given authentication
+ *	should be applied.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationCopyDomains( auth: CFHTTPAuthenticationRef ): CFArrayRef; external name '_CFHTTPAuthenticationCopyDomains';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationCopyMethod()
  *  
  *  Discussion:
- *    Returns the method of authentication which will be performed when
- *    applying credentials.  The strongest method of authentication
- *    will be chosen in the case of multiple choices.
+ *	Returns the method of authentication which will be performed when
+ *	applying credentials.  The strongest method of authentication
+ *	will be chosen in the case of multiple choices.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    Returns the method of authentication which will be performed when
- *    applying credentials.
+ *	Returns the method of authentication which will be performed when
+ *	applying credentials.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationCopyMethod( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyMethod';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationRequiresUserNameAndPassword()
  *  
  *  Discussion:
- *    Returns TRUE if the chosen authentication scheme requires a
- *    username and password.
+ *	Returns TRUE if the chosen authentication scheme requires a
+ *	username and password.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    Returns TRUE if the chosen authentication scheme requires a
- *    username and password.
+ *	Returns TRUE if the chosen authentication scheme requires a
+ *	username and password.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationRequiresUserNameAndPassword( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresUserNameAndPassword';
-(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHTTPAuthenticationRequiresAccountDomain()
  *  
  *  Discussion:
- *    Returns TRUE if the chosen authentication scheme requires a
- *    domain for authentication.  Currently, this will return TRUE for
- *    "NTLM" and FALSE for the other methods.
+ *	Returns TRUE if the chosen authentication scheme requires a
+ *	domain for authentication.  Currently, this will return TRUE for
+ *	"NTLM" and FALSE for the other methods.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The API's to CFHTTPAuthenticationRef are thread-safe so long as
- *    multiple threads are not altering the same
- *    CFHTTPAuthenticationRef at the same time.
+ *	Thread safe
+ *	The API's to CFHTTPAuthenticationRef are thread-safe so long as
+ *	multiple threads are not altering the same
+ *	CFHTTPAuthenticationRef at the same time.
  *  
  *  Parameters:
- *    
- *    auth:
- *      The authentication information being queried.
+ *	
+ *	auth:
+ *	  The authentication information being queried.
  *  
  *  Result:
- *    Returns TRUE if the chosen authentication scheme requires a
- *    domain for authentication.
+ *	Returns TRUE if the chosen authentication scheme requires a
+ *	domain for authentication.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFHTTPAuthenticationRequiresAccountDomain( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresAccountDomain';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

File diff suppressed because it is too large
+ 367 - 294
packages/univint/src/CFHTTPMessage.pas


+ 272 - 195
packages/univint/src/CFHTTPStream.pas

@@ -1,28 +1,26 @@
 {
-     File:       CFNetwork/CFHTTPStream.h
+	 File:	   CFNetwork/CFHTTPStream.h
  
-     Contains:   CoreFoundation Network HTTP streams header
+	 Contains:   CoreFoundation Network HTTP streams header
  
-     Version:    CFNetwork-219~1
+	 Copyright:  Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  
-     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
- 
-                     http://www.freepascal.org/bugs.html
+					 http://www.freepascal.org/bugs.html
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
-
-
+{   Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -31,8 +29,8 @@
 
 unit CFHTTPStream;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -45,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -62,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -95,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -106,27 +176,29 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFStream,CFBase,CFHTTPMessage;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
 
 {
  *  kCFStreamErrorDomainHTTP
  *  
  *  Discussion:
- *    Result code returned by HTTP server
+ *	Result code returned by HTTP server
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.1 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamErrorDomainHTTP: SInt32; external name '_kCFStreamErrorDomainHTTP'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0) *)
 
 {
  *  CFStreamErrorHTTP
  *  
  *  Discussion:
- *    Errors from the kCFStreamErrorDomainHTTP domain.
+ *	Errors from the kCFStreamErrorDomainHTTP domain.
  }
 type
 	CFStreamErrorHTTP = SInt32;
@@ -134,119 +206,119 @@ const
 {
    * Could not parse the request/response.
    }
-  kCFStreamErrorHTTPParseFailure = -1;
+	kCFStreamErrorHTTPParseFailure = -1;
 
   {
    * A loop was detected during redirection.
    }
-  kCFStreamErrorHTTPRedirectionLoop = -2;
+	kCFStreamErrorHTTPRedirectionLoop = -2;
 
   {
    * Could not retreive url for request/response.
    }
-  kCFStreamErrorHTTPBadURL      = -3;
+	kCFStreamErrorHTTPBadURL = -3;
 
 {
  *  kCFStreamPropertyHTTPResponseHeader
  *  
  *  Discussion:
- *    Stream property key, for copy operations. Value is a
- *    CFHTTPMessage with 0 bytes data.
+ *	Stream property key, for copy operations. Value is a
+ *	CFHTTPMessage with 0 bytes data.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.1 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPResponseHeader: CFStringRef; external name '_kCFStreamPropertyHTTPResponseHeader'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyHTTPFinalURL
  *  
  *  Discussion:
- *    Stream property key, for copy operations. The response header
- *    value is the CFURL from the final request; will only differ from
- *    the URL in the original request if an autoredirection has
- *    occurred.
+ *	Stream property key, for copy operations. The response header
+ *	value is the CFURL from the final request; will only differ from
+ *	the URL in the original request if an autoredirection has
+ *	occurred.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPFinalURL: CFStringRef; external name '_kCFStreamPropertyHTTPFinalURL'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 {
  *  kCFStreamPropertyHTTPFinalRequest
  *  
  *  Discussion:
- *    Stream property key, for copy operations. The value is the
- *    CFHTTPMessage transmitted by the stream, after all modifications
- *    (such as for authentication, connection policy, or redirection)
- *    have been made.
+ *	Stream property key, for copy operations. The value is the
+ *	CFHTTPMessage transmitted by the stream, after all modifications
+ *	(such as for authentication, connection policy, or redirection)
+ *	have been made.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPFinalRequest: CFStringRef; external name '_kCFStreamPropertyHTTPFinalRequest'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFStreamPropertyHTTPProxy
  *  
  *  Discussion:
- *    Stream property key, for both set and copy operations. The value
- *    is a CFDictionary. HTTP proxy information is set the same way as
- *    SOCKS proxies (see CFSocketStream.h). Call
- *    CFReadStreamSetProperty() passing an HTTP stream and the property
- *    kCFStreamPropertyHTTPProxy. The value should include at least one
- *    Host/Port pair from the keys below. Use the dictionary returned
- *    by SystemConfiguration.framework to set the default values for
- *    the system. HTTP proxies are not applied automatically.
+ *	Stream property key, for both set and copy operations. The value
+ *	is a CFDictionary. HTTP proxy information is set the same way as
+ *	SOCKS proxies (see CFSocketStream.h). Call
+ *	CFReadStreamSetProperty() passing an HTTP stream and the property
+ *	kCFStreamPropertyHTTPProxy. The value should include at least one
+ *	Host/Port pair from the keys below. Use the dictionary returned
+ *	by SystemConfiguration.framework to set the default values for
+ *	the system. HTTP proxies are not applied automatically.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPProxy: CFStringRef; external name '_kCFStreamPropertyHTTPProxy'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyHTTPProxyHost
  *  
  *  Discussion:
- *    Proxy dictionary key. The hostname of an HTTP proxy. The value is
- *    a CFString. The key name matches kSCPropNetProxiesHTTPProxy.
+ *	Proxy dictionary key. The hostname of an HTTP proxy. The value is
+ *	a CFString. The key name matches kSCPropNetProxiesHTTPProxy.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPProxyHost: CFStringRef; external name '_kCFStreamPropertyHTTPProxyHost'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyHTTPProxyPort
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFNumber.
+ *	Proxy dictionary key. Value is a CFNumber.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPProxyPort: CFStringRef; external name '_kCFStreamPropertyHTTPProxyPort'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 { matches kSCPropNetProxiesHTTPPort }
 
 
@@ -254,15 +326,15 @@ var kCFStreamPropertyHTTPProxyPort: CFStringRef; external name '_kCFStreamProper
  *  kCFStreamPropertyHTTPSProxyHost
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFString.
+ *	Proxy dictionary key. Value is a CFString.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPSProxyHost: CFStringRef; external name '_kCFStreamPropertyHTTPSProxyHost'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 { matches kSCPropNetProxiesHTTPSProxy }
 
 
@@ -270,15 +342,15 @@ var kCFStreamPropertyHTTPSProxyHost: CFStringRef; external name '_kCFStreamPrope
  *  kCFStreamPropertyHTTPSProxyPort
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFNumber.
+ *	Proxy dictionary key. Value is a CFNumber.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPSProxyPort: CFStringRef; external name '_kCFStreamPropertyHTTPSProxyPort'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 { matches kSCPropNetProxiesHTTPSPort }
 
 
@@ -286,53 +358,53 @@ var kCFStreamPropertyHTTPSProxyPort: CFStringRef; external name '_kCFStreamPrope
  *  kCFStreamPropertyHTTPShouldAutoredirect
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFBoolean. Redirection is not
- *    performed by default.
+ *	Proxy dictionary key. Value is a CFBoolean. Redirection is not
+ *	performed by default.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPShouldAutoredirect: CFStringRef; external name '_kCFStreamPropertyHTTPShouldAutoredirect'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyHTTPAttemptPersistentConnection
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFBoolean.  If this property is
- *    set to kCFBooleanTrue, an HTTP stream will look for an
- *    appropriate extant persistent connection to use, and if it finds
- *    none, will try to create one. Persistent connections are not used
- *    by default.
+ *	Proxy dictionary key. Value is a CFBoolean.  If this property is
+ *	set to kCFBooleanTrue, an HTTP stream will look for an
+ *	appropriate extant persistent connection to use, and if it finds
+ *	none, will try to create one. Persistent connections are not used
+ *	by default.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPAttemptPersistentConnection: CFStringRef; external name '_kCFStreamPropertyHTTPAttemptPersistentConnection'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamPropertyHTTPRequestBytesWrittenCount
  *  
  *  Discussion:
- *    Proxy dictionary key. Value is a CFNumber. This property can only
- *    be retrieved, not set. The number returned is the number of bytes
- *    from the body of the request that have been written to the
- *    underlying socket
+ *	Proxy dictionary key. Value is a CFNumber. This property can only
+ *	be retrieved, not set. The number returned is the number of bytes
+ *	from the body of the request that have been written to the
+ *	underlying socket
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamPropertyHTTPRequestBytesWrittenCount: CFStringRef; external name '_kCFStreamPropertyHTTPRequestBytesWrittenCount'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {*******************}
@@ -342,144 +414,149 @@ var kCFStreamPropertyHTTPRequestBytesWrittenCount: CFStringRef; external name '_
  *  CFReadStreamCreateForHTTPRequest()
  *  
  *  Discussion:
- *    Create an HTTP read stream for the response to the given request.
- *    When the stream is opened, it will begin transmitting the
- *    request. The bytes returned are the pure body bytes; the response
- *    header has been parsed off. To retrieve the response header, ask
- *    for kCFStreamPropertyHTTPResponseHeader, above, any time after
- *    the first bytes arrive on the stream (or when stream end is
- *    reported, if there are no data bytes). When an HTTP/1.1 server
- *    returns a chunked a response, the chunks will be formed into one
- *    continuous stream.
+ *	Create an HTTP read stream for the response to the given request.
+ *	When the stream is opened, it will begin transmitting the
+ *	request. The bytes returned are the pure body bytes; the response
+ *	header has been parsed off. To retrieve the response header, ask
+ *	for kCFStreamPropertyHTTPResponseHeader, above, any time after
+ *	the first bytes arrive on the stream (or when stream end is
+ *	reported, if there are no data bytes). When an HTTP/1.1 server
+ *	returns a chunked a response, the chunks will be formed into one
+ *	continuous stream.
  *  
  *  Parameters:
- *    
- *    alloc:
- *      A pointer to the CFAllocator which should be used to allocate
- *      memory for the CF read stream and its storage for values. If
- *      this reference is not a valid CFAllocator, the behavior is
- *      undefined.
- *    
- *    request:
- *      A pointer to a CFHTTPMessage created by the
- *      CFHTTPMessageCreateRequest function.
+ *	
+ *	alloc:
+ *	  A pointer to the CFAllocator which should be used to allocate
+ *	  memory for the CF read stream and its storage for values. If
+ *	  this reference is not a valid CFAllocator, the behavior is
+ *	  undefined.
+ *	
+ *	request:
+ *	  A pointer to a CFHTTPMessage created by the
+ *	  CFHTTPMessageCreateRequest function.
  *  
  *  Result:
- *    A pointer to the CF read stream created, or NULL if failed. It is
- *    caller's responsibilty to release the memory allocated for the
- *    read stream.
+ *	A pointer to the CF read stream created, or NULL if failed. It is
+ *	caller's responsibilty to release the memory allocated for the
+ *	read stream.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.1 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFReadStreamCreateForHTTPRequest( alloc: CFAllocatorRef; request: CFHTTPMessageRef ): CFReadStreamRef; external name '_CFReadStreamCreateForHTTPRequest';
-(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0) *)
 
 
 {
  *  CFReadStreamCreateForStreamedHTTPRequest()
  *  
  *  Discussion:
- *    Creates a read stream for the response to the given
- *    requestHeaders plus requestBody. Use in preference to
- *    CFReadStreamCreateForHTTPRequest() when the body of the request
- *    is larger than you wish to be resident in memory.  Note that
- *    because streams cannot be reset, read streams created this way
- *    cannot have autoredirection enabled.  If the Content-Length
- *    header is set in requestHeaders, it is assumed that the caller
- *    got the length right and that requestBody will report
- *    end-of-stream after precisely Content-Length bytes have been read
- *    from it. If the Content-Length header is not set, the chunked
- *    transfer-encoding will be added to requestHeaders, and bytes read
- *    from requestBody will be transmitted chunked. The body of
- *    requestHeaders is ignored.
+ *	Creates a read stream for the response to the given
+ *	requestHeaders plus requestBody. Use in preference to
+ *	CFReadStreamCreateForHTTPRequest() when the body of the request
+ *	is larger than you wish to be resident in memory.  Note that
+ *	because streams cannot be reset, read streams created this way
+ *	cannot have autoredirection enabled.  If the Content-Length
+ *	header is set in requestHeaders, it is assumed that the caller
+ *	got the length right and that requestBody will report
+ *	end-of-stream after precisely Content-Length bytes have been read
+ *	from it. If the Content-Length header is not set, the chunked
+ *	transfer-encoding will be added to requestHeaders, and bytes read
+ *	from requestBody will be transmitted chunked. The body of
+ *	requestHeaders is ignored.
  *  
  *  Parameters:
- *    
- *    alloc:
- *      A pointer to the CFAllocator which should be used to allocate
- *      memory for the CF read stream and its storage for values. If
- *      this reference is not a valid CFAllocator, the behavior is
- *      undefined.
- *    
- *    requestHeaders:
- *      A pointer to a CFHTTPMessage created by the
- *      CFHTTPMessageCreateRequest function. The body of requestHeaders
- *      is ignored.
- *    
- *    requestBody:
- *      A pointer to a CFReadStream.
+ *	
+ *	alloc:
+ *	  A pointer to the CFAllocator which should be used to allocate
+ *	  memory for the CF read stream and its storage for values. If
+ *	  this reference is not a valid CFAllocator, the behavior is
+ *	  undefined.
+ *	
+ *	requestHeaders:
+ *	  A pointer to a CFHTTPMessage created by the
+ *	  CFHTTPMessageCreateRequest function. The body of requestHeaders
+ *	  is ignored.
+ *	
+ *	requestBody:
+ *	  A pointer to a CFReadStream.
  *  
  *  Result:
- *    A pointer to the CF read stream created, or NULL if failed. It is
- *    caller's responsibilty to release the memory allocated for the
- *    read stream.
+ *	A pointer to the CF read stream created, or NULL if failed. It is
+ *	caller's responsibilty to release the memory allocated for the
+ *	read stream.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFReadStreamCreateForStreamedHTTPRequest( alloc: CFAllocatorRef; requestHeaders: CFHTTPMessageRef; requestBody: CFReadStreamRef ): CFReadStreamRef; external name '_CFReadStreamCreateForStreamedHTTPRequest';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
-
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
+{$ifc TARGET_OS_MAC}
 {
  *  CFHTTPReadStreamSetRedirectsAutomatically()   *** DEPRECATED ***
  *  
  *  Deprecated:
- *    Use the kCFStreamPropertyHTTPShouldAutoredirect property above
- *    instead.
+ *	Use the kCFStreamPropertyHTTPShouldAutoredirect property above
+ *	instead.
  *  
  *  Discussion:
- *    Sets the redirection property on the http stream.
+ *	Sets the redirection property on the http stream.
  *  
  *  Parameters:
- *    
- *    httpStream:
- *      A pointer to the CFHTTPStream to be set.
- *    
- *    shouldAutoRedirect:
- *      A boolean indicating whether to redirect or not.
+ *	
+ *	httpStream:
+ *	  A pointer to the CFHTTPStream to be set.
+ *	
+ *	shouldAutoRedirect:
+ *	  A boolean indicating whether to redirect or not.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework but deprecated in 10.3
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.1 and later in CoreServices.framework but deprecated in 10.3
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFHTTPReadStreamSetRedirectsAutomatically( httpStream: CFReadStreamRef; shouldAutoRedirect: Boolean ); external name '_CFHTTPReadStreamSetRedirectsAutomatically';
-(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_3,__IPHONE_NA,__IPHONE_NA) *)
 
 
 {
  *  CFHTTPReadStreamSetProxy()   *** DEPRECATED ***
  *  
  *  Deprecated:
- *    Use the kCFStreamPropertyHTTPProxy above instead.
+ *	Use the kCFStreamPropertyHTTPProxy above instead.
  *  
  *  Discussion:
- *    Sets the redirection property on the http stream.
+ *	Sets the redirection property on the http stream.
  *  
  *  Parameters:
- *    
- *    httpStream:
- *      A pointer to the CFHTTPStream to be set.
- *    
- *    proxyHost:
- *      The proxy hostname. A CFString value.
- *    
- *    proxyPort:
- *      The port number. A CFNumber value.
+ *	
+ *	httpStream:
+ *	  A pointer to the CFHTTPStream to be set.
+ *	
+ *	proxyHost:
+ *	  The proxy hostname. A CFString value.
+ *	
+ *	proxyPort:
+ *	  The port number. A CFNumber value.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.1 and later in CoreServices.framework but deprecated in 10.3
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.1 and later in CoreServices.framework but deprecated in 10.3
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFHTTPReadStreamSetProxy( httpStream: CFReadStreamRef; proxyHost: CFStringRef; proxyPort: CFIndex ); external name '_CFHTTPReadStreamSetProxy';
-(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_3,__IPHONE_NA,__IPHONE_NA) *)
+
+
+{$endc} {TARGET_OS_MAC}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 406 - 330
packages/univint/src/CFHost.pas

@@ -1,27 +1,25 @@
 {
-     File:       CFNetwork/CFHost.h
+	 File:	   CFNetwork/CFHost.h
  
-     Contains:   CoreFoundation CFHost header
+	 Contains:   CoreFoundation CFHost header
  
-     Version:    CFNetwork-71.2~1
+	 Copyright:  Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  
-     Copyright:  © 2001-2003 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
- 
-                     http://www.freepascal.org/bugs.html
+					 http://www.freepascal.org/bugs.html
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-
-
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +28,8 @@
 
 unit CFHost;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,117 +175,119 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFData,CFArray,CFRunLoop,CFStream;
-{$ALIGN MAC68K}
+{$endc} {not MACOSALLINCLUDE}
+
+{$ALIGN POWER}
 
 {
  *  CFHostRef
  *  
  *  Discussion:
- *    This is the type of a reference to a host name or address lookup.
+ *	This is the type of a reference to a host name or address lookup.
  }
 type
-	CFHostRef    = ^SInt32; { an opaque 32-bit type }
+	CFHostRef = ^SInt32; { an opaque type }
 
 {
  *  kCFStreamErrorDomainNetDB
  *  
  *  Discussion:
- *    Errors listed in netdb.h
+ *	Errors listed in netdb.h
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamErrorDomainNetDB: SInt32; external name '_kCFStreamErrorDomainNetDB'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  kCFStreamErrorDomainSystemConfiguration
  *  
  *  Discussion:
- *    Errors listed in SystemConfiguration/SystemConfiguration.h
+ *	Errors listed in SystemConfiguration/SystemConfiguration.h
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 var kCFStreamErrorDomainSystemConfiguration: SInt32; external name '_kCFStreamErrorDomainSystemConfiguration'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostInfoType
  *  
  *  Discussion:
- *    Host information types to be resolved.
+ *	Host information types to be resolved.
  }
 type
 	CFHostInfoType = SInt32;
 const
-  {
+{
    * Results value is a CFArray of CFData's (each being a struct
    * sockaddr)
    }
-  kCFHostAddresses              = 0;
+	kCFHostAddresses = 0;
 
   {
    * Results value is a CFArray of CFString's
    }
-  kCFHostNames                  = 1;
+	kCFHostNames = 1;
 
   {
    * Results value is a CFData wrapping SCNetworkConnectionFlags
    * (defined in SystemConfiguration/SCNetwork.h)
    }
-  kCFHostReachability           = 2;
+	kCFHostReachability = 2;
 
 
 {
  *  CFHostClientContext
  *  
  *  Discussion:
- *    Structure containing the user-defined data and callbacks for
- *    CFHost objects.
+ *	Structure containing the user-defined data and callbacks for
+ *	CFHost objects.
  }
 type
 	CFHostClientContext = record
-		{
-		 * The version number of the structure type being passed in as a
-		 * parameter to the CFHost client function. Valid version number is
-		 * currently 0.
-		 }
+{
+   * The version number of the structure type being passed in as a
+   * parameter to the CFHost client function. Valid version number is
+   * currently 0.
+   }
 		version: CFIndex;
-	
-		{
-		 * An arbitrary pointer to client-defined data, which can be
-		 * associated with the host and is passed to the callbacks.
-		 }
-		info: Ptr;
-	
-		{
-		 * The callback used to add a retain for the host on the info pointer
-		 * for the life of the host, and may be used for temporary references
-		 * the host needs to take. This callback returns the actual info
-		 * pointer to store in the host, almost always just the pointer
-		 * passed as the parameter.
-		 }
+
+  {
+   * An arbitrary pointer to client-defined data, which can be
+   * associated with the host and is passed to the callbacks.
+   }
+		info: UnivPtr;
+
+  {
+   * The callback used to add a retain for the host on the info pointer
+   * for the life of the host, and may be used for temporary references
+   * the host needs to take. This callback returns the actual info
+   * pointer to store in the host, almost always just the pointer
+   * passed as the parameter.
+   }
 		retain: CFAllocatorRetainCallBack;
-	
-		{
-		 * The callback used to remove a retain previously added for the host
-		 * on the info pointer.
-		 }
+
+  {
+   * The callback used to remove a retain previously added for the host
+   * on the info pointer.
+   }
 		release: CFAllocatorReleaseCallBack;
-	
-		{
-		 * The callback used to create a descriptive string representation of
-		 * the info pointer (or the data pointed to by the info pointer) for
-		 * debugging purposes. This is used by the CFCopyDescription()
-		 * function.
-		 }
+
+  {
+   * The callback used to create a descriptive string representation of
+   * the info pointer (or the data pointed to by the info pointer) for
+   * debugging purposes. This is used by the CFCopyDescription()
+   * function.
+   }
 		copyDescription: CFAllocatorCopyDescriptionCallBack;
 	end;
 	CFHostClientContextPtr = ^CFHostClientContext;
@@ -224,444 +296,448 @@ type
  *  CFHostClientCallBack
  *  
  *  Discussion:
- *    Callback function which is called upon error or completion of an
- *    asynchronous resolve.
+ *	Callback function which is called upon error or completion of an
+ *	asynchronous resolve.
  *  
  *  Parameters:
- *    
- *    theHost:
- *      Host whose resolution is complete.
- *    
- *    typeInfo:
- *      Enum representing which info resolution is complete.
- *    
- *    error:
- *      Reference to an error structure if the resolution failed.
- *    
- *    info:
- *      Client's info reference which was passed into the client
- *      context.
+ *	
+ *	theHost:
+ *	  Host whose resolution is complete.
+ *	
+ *	typeInfo:
+ *	  Enum representing which info resolution is complete.
+ *	
+ *	error:
+ *	  Reference to an error structure if the resolution failed.
+ *	
+ *	info:
+ *	  Client's info reference which was passed into the client
+ *	  context.
  }
-type CFHostClientCallBack = procedure( theHost: CFHostRef; typeInfo: CFHostInfoType; const (*var*) error: CFStreamError; info: UnivPtr );
+type
+	CFHostClientCallBack = procedure( theHost: CFHostRef; typeInfo: CFHostInfoType; const (*var*) error: CFStreamError; info: UnivPtr );
 
 
 {
  *  CFHostGetTypeID()
  *  
  *  Discussion:
- *    Returns the type identifier of all CFHost instances.
+ *	Returns the type identifier of all CFHost instances.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostGetTypeID: CFTypeID; external name '_CFHostGetTypeID';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostCreateWithName()
  *  
  *  Discussion:
- *    Creates a new host object with the given name.
+ *	Creates a new host object with the given name.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    allocator:
- *      The CFAllocator which should be used to allocate memory for the
- *      host. If this reference is not a valid CFAllocator, the
- *      behavior is undefined.
- *    
- *    hostname:
- *      A CFStringRef representing the name of the host. Must be
- *      non-NULL.  If this If this reference is not a valid
- *      CFStringRef, the behavior is undefined.
+ *	
+ *	allocator:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  host. If this reference is not a valid CFAllocator, the
+ *	  behavior is undefined.
+ *	
+ *	hostname:
+ *	  A CFStringRef representing the name of the host. Must be
+ *	  non-NULL.  If this reference is not a valid CFStringRef, the
+ *	  behavior is undefined.
  *  
  *  Result:
- *    A valid CFHostRef which may now be resolved, or NULL if
- *    unsuccessful.
+ *	A valid CFHostRef which may now be resolved, or NULL if
+ *	unsuccessful.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostCreateWithName( allocator: CFAllocatorRef; hostname: CFStringRef ): CFHostRef; external name '_CFHostCreateWithName';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostCreateWithAddress()
  *  
  *  Discussion:
- *    Creates a new host object with the given address.
+ *	Creates a new host object with the given address.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    allocator:
- *      The CFAllocator which should be used to allocate memory for the
- *      host. If this reference is not a valid CFAllocator, the
- *      behavior is undefined.
- *    
- *    addr:
- *      A CFDataRef containing a struct sockaddr which is the address
- *      of the host. Must be non-NULL.  If this If this reference is
- *      not a valid CFDataRef, the behavior is undefined.
+ *	
+ *	allocator:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  host. If this reference is not a valid CFAllocator, the
+ *	  behavior is undefined.
+ *	
+ *	addr:
+ *	  A CFDataRef containing a struct sockaddr which is the address
+ *	  of the host. Must be non-NULL.  If this reference is not a
+ *	  valid CFDataRef, the behavior is undefined.
  *  
  *  Result:
- *    A valid CFHostRef which may now be resolved, or NULL if
- *    unsuccessful.
+ *	A valid CFHostRef which may now be resolved, or NULL if
+ *	unsuccessful.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostCreateWithAddress( allocator: CFAllocatorRef; addr: CFDataRef ): CFHostRef; external name '_CFHostCreateWithAddress';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostCreateCopy()
  *  
  *  Discussion:
- *    Creates a new host object as a copy of host argument.
+ *	Creates a new host object as a copy of host argument.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CFAllocator which should be used to allocate memory for the
- *      new host. If this reference is not a valid CFAllocator, the
- *      behavior is undefined.
- *    
- *    host:
- *      A CFHostRef representing the original host. Must be non-NULL. 
- *      If this If this reference is not a valid CFHostRef, the
- *      behavior is undefined.
+ *	
+ *	alloc:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  new host. If this reference is not a valid CFAllocator, the
+ *	  behavior is undefined.
+ *	
+ *	host:
+ *	  A CFHostRef representing the original host. Must be non-NULL. 
+ *	  If this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
  *  
  *  Result:
- *    A valid CFHostRef which contains a copy of all previously
- *    resolved data from the original.  NULL is returned in the case of
- *    failure.
+ *	A valid CFHostRef which contains a copy of all previously
+ *	resolved data from the original.  NULL is returned in the case of
+ *	failure.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostCreateCopy( alloc: CFAllocatorRef; host: CFHostRef ): CFHostRef; external name '_CFHostCreateCopy';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostStartInfoResolution()
  *  
  *  Discussion:
- *    Performs a lookup for the given host.  It will search for the
- *    requested information if there is no other active request. 
- *    Previously cached information of the given type will be released.
+ *	Performs a lookup for the given host.  It will search for the
+ *	requested information if there is no other active request. 
+ *	Previously cached information of the given type will be released.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which should be resolved. Must be non-NULL. If
- *      this reference is not a valid CFHostRef, the behavior is
- *      undefined.
- *    
- *    info:
- *      The enum representing the type of information to be retrieved. 
- *      If the value is not a valid type, the behavior is undefined.
- *    
- *    error:
- *      A reference to a CFStreamError structure which will be filled
- *      with any error information should an error occur.  May be set
- *      to NULL if error information is not wanted.
+ *	
+ *	theHost:
+ *	  The CFHostRef which should be resolved. Must be non-NULL. If
+ *	  this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
+ *	
+ *	info:
+ *	  The enum representing the type of information to be retrieved. 
+ *	  If the value is not a valid type, the behavior is undefined.
+ *	
+ *	error:
+ *	  A reference to a CFStreamError structure which will be filled
+ *	  with any error information should an error occur.  May be set
+ *	  to NULL if error information is not wanted.
  *  
  *  Result:
- *    Returns TRUE on success and FALSE on failure.  In asynchronous
- *    mode, this function will return immediately.  In synchronous
- *    mode, it will block until the resolve has completed or until the
- *    resolve is cancelled.
+ *	Returns TRUE on success and FALSE on failure.  In asynchronous
+ *	mode, this function will return immediately.  In synchronous
+ *	mode, it will block until the resolve has completed or until the
+ *	resolve is cancelled.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-function CFHostStartInfoResolution( theHost: CFHostRef; info: CFHostInfoType; error: CFStreamErrorPtr ): Boolean; external name '_CFHostStartInfoResolution';
+function CFHostStartInfoResolution( theHost: CFHostRef; info: CFHostInfoType; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHostStartInfoResolution';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostGetAddressing()
  *  
  *  Discussion:
- *    Tries to retrieve the known addresses from the given host.
- *    Returns a CFArrayRef of addresses if known and there were some.
- *    NULL is returned otherwise.  Each address is a CFDataRef wrapping
- *    a struct sockaddr.
+ *	Tries to retrieve the known addresses from the given host.
+ *	Returns a CFArrayRef of addresses if known and there were some.
+ *	NULL is returned otherwise.  Each address is a CFDataRef wrapping
+ *	a struct sockaddr.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the host is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the host is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which contains the relevant information. Must be
- *      non-NULL. If this reference is not a valid CFHostRef, the
- *      behavior is undefined.
- *    
- *    hasBeenResolved:
- *      A reference to a Boolean which returns FALSE if the information
- *      was not available (e.g. CFHostStartInfoResolution has not been
- *      called), otherwise TRUE will be returned.
+ *	
+ *	theHost:
+ *	  The CFHostRef which contains the relevant information. Must be
+ *	  non-NULL. If this reference is not a valid CFHostRef, the
+ *	  behavior is undefined.
+ *	
+ *	hasBeenResolved:
+ *	  A reference to a Boolean which returns FALSE if the information
+ *	  was not available (e.g. CFHostStartInfoResolution has not been
+ *	  called), otherwise TRUE will be returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostGetAddressing( theHost: CFHostRef; var hasBeenResolved: Boolean ): CFArrayRef; external name '_CFHostGetAddressing';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostGetNames()
  *  
  *  Discussion:
- *    Tries to retrieve the names/aliases from the given host. Returns
- *    a CFArrayRef of names for the given host.  NULL is returned
- *    otherwise.
+ *	Tries to retrieve the names/aliases from the given host. Returns
+ *	a CFArrayRef of names for the given host.  NULL is returned
+ *	otherwise.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the host is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the host is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which contains the relevant information. Must be
- *      non-NULL. If this reference is not a valid CFHostRef, the
- *      behavior is undefined.
- *    
- *    hasBeenResolved:
- *      A reference to a Boolean which returns FALSE if the information
- *      was not available (e.g. CFHostStartInfoResolution has not been
- *      called), otherwise TRUE will be returned.
+ *	
+ *	theHost:
+ *	  The CFHostRef which contains the relevant information. Must be
+ *	  non-NULL. If this reference is not a valid CFHostRef, the
+ *	  behavior is undefined.
+ *	
+ *	hasBeenResolved:
+ *	  A reference to a Boolean which returns FALSE if the information
+ *	  was not available (e.g. CFHostStartInfoResolution has not been
+ *	  called), otherwise TRUE will be returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 function CFHostGetNames( theHost: CFHostRef; var hasBeenResolved: Boolean ): CFArrayRef; external name '_CFHostGetNames';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostGetReachability()
  *  
  *  Discussion:
- *    Tries to retrieve the reachability of the given host. Returns a
- *    CFDataRef which wraps the reachability flags. NULL will be
- *    returned if the value has not been resolved. The possible values
- *    of these flags is declared in SystemConfiguration/SCNetwork.h.
- *    Returns FALSE if the information was not available, otherwise
- *    TRUE will be returned with the results containing the requested
- *    information.
+ *	Tries to retrieve the reachability of the given host. Returns a
+ *	CFDataRef which wraps the reachability flags. NULL will be
+ *	returned if the value has not been resolved. The possible values
+ *	of these flags is declared in SystemConfiguration/SCNetwork.h.
+ *	Returns FALSE if the information was not available, otherwise
+ *	TRUE will be returned with the results containing the requested
+ *	information.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the host is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the host is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which contains the relevant information. Must be
- *      non-NULL. If this reference is not a valid CFHostRef, the
- *      behavior is undefined.
- *    
- *    hasBeenResolved:
- *      A reference to a Boolean which returns FALSE if the information
- *      was not available (e.g. CFHostStartInfoResolution has not been
- *      called), otherwise TRUE will be returned.  can be NULL
+ *	
+ *	theHost:
+ *	  The CFHostRef which contains the relevant information. Must be
+ *	  non-NULL. If this reference is not a valid CFHostRef, the
+ *	  behavior is undefined.
+ *	
+ *	hasBeenResolved:
+ *	  A reference to a Boolean which returns FALSE if the information
+ *	  was not available (e.g. CFHostStartInfoResolution has not been
+ *	  called), otherwise TRUE will be returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-function CFHostGetReachability( theHost: CFHostRef; hasBeenResolved: BooleanPtr ): CFDataRef; external name '_CFHostGetReachability';
+function CFHostGetReachability( theHost: CFHostRef; hasBeenResolved: BooleanPtr { can be NULL } ): CFDataRef; external name '_CFHostGetReachability';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostCancelInfoResolution()
  *  
  *  Discussion:
- *    Cancels an outstanding asynchronous or synchronous resolve.
+ *	Cancels an outstanding asynchronous or synchronous resolve.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which is currently resolving.  Must be non-NULL.
- *      If this reference is not a valid CFHostRef, the behavior is
- *      undefined.
- *    
- *    info:
- *      The enum representing which resolution to be canceled.  If the
- *      value is not a valid type, the behavior is undefined.
+ *	
+ *	theHost:
+ *	  The CFHostRef which is currently resolving.  Must be non-NULL.
+ *	  If this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
+ *	
+ *	info:
+ *	  The enum representing which resolution to be canceled.  If the
+ *	  value is not a valid type, the behavior is undefined.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure CFHostCancelInfoResolution( theHost: CFHostRef; info: CFHostInfoType ); external name '_CFHostCancelInfoResolution';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostSetClient()
  *  
  *  Discussion:
- *    Associates a client context and callback function with a
- *    CFHostRef.  This is required for asynchronous usage.  If not set,
- *    resolve will take place synchronously.
+ *	Associates a client context and callback function with a
+ *	CFHostRef.  This is required for asynchronous usage.  If not set,
+ *	resolve will take place synchronously.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which is getting a client.  Must be non-NULL. If
- *      this reference is not a valid CFHostRef, the behavior is
- *      undefined.
- *    
- *    clientCB:
- *      A CFHostClientCallBack which will be called when the resolve
- *      completes or is cancelled.  Use NULL to remove the client
- *      association with a host object.
- *    
- *    clientContext:
- *      A CFHostClientContext which is used to set the contextual
- *      information associated with the host object.  The info pointer
- *      from the struct will be passed to the callback function. If
- *      setting a client, this value must be non-NULL.
+ *	
+ *	theHost:
+ *	  The CFHostRef which is getting a client.  Must be non-NULL. If
+ *	  this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
+ *	
+ *	clientCB:
+ *	  A CFHostClientCallBack which will be called when the resolve
+ *	  completes or is cancelled.  Use NULL to remove the client
+ *	  association with a host object.
+ *	
+ *	clientContext:
+ *	  A CFHostClientContext which is used to set the contextual
+ *	  information associated with the host object.  The info pointer
+ *	  from the struct will be passed to the callback function. If
+ *	  setting a client, this value must be non-NULL.
  *  
  *  Result:
- *    Returns TRUE if the procedure was a success, otherwise it returns
- *    FALSE.
+ *	Returns TRUE if the procedure was a success, otherwise it returns
+ *	FALSE.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
-function CFHostSetClient( theHost: CFHostRef; clientCB: CFHostClientCallBack; clientContext: CFHostClientContextPtr ): Boolean; external name '_CFHostSetClient';
+function CFHostSetClient( theHost: CFHostRef; clientCB: CFHostClientCallBack { can be NULL }; clientContext: CFHostClientContextPtr { can be NULL } ): Boolean; external name '_CFHostSetClient';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostScheduleWithRunLoop()
  *  
  *  Discussion:
- *    Schedules the given host on a run loop and mode so the client
- *    will receive its callbacks on that loop and mode.
+ *	Schedules the given host on a run loop and mode so the client
+ *	will receive its callbacks on that loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which is being scheduled.  Must be non-NULL. If
- *      this reference is not a valid CFHostRef, the behavior is
- *      undefined.
- *    
- *    runLoop:
- *      A CFRunLoopRef on which the host should be scheduled. Must be
- *      non-NULL.  If this reference is not a valid CFRunLoopRef, the
- *      behavior is undefined.
- *    
- *    runLoopMode:
- *      A CFStringRef which is the mode in which the run loop will be
- *      running when notification occurs.  Must be non-NULL. If this
- *      reference is not a valid CFStringRef, the behavior is undefined.
+ *	
+ *	theHost:
+ *	  The CFHostRef which is being scheduled.  Must be non-NULL. If
+ *	  this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
+ *	
+ *	runLoop:
+ *	  A CFRunLoopRef on which the host should be scheduled. Must be
+ *	  non-NULL.  If this reference is not a valid CFRunLoopRef, the
+ *	  behavior is undefined.
+ *	
+ *	runLoopMode:
+ *	  A CFStringRef which is the mode in which the run loop will be
+ *	  running when notification occurs.  Must be non-NULL. If this
+ *	  reference is not a valid CFStringRef, the behavior is undefined.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure CFHostScheduleWithRunLoop( theHost: CFHostRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFHostScheduleWithRunLoop';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFHostUnscheduleFromRunLoop()
  *  
  *  Discussion:
- *    Unschedules the given host from a run loop and mode so the client
- *    will not receive its callbacks on that loop and mode.
+ *	Unschedules the given host from a run loop and mode so the client
+ *	will not receive its callbacks on that loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theHost:
- *      The CFHostRef which is being unscheduled.  Must be non-NULL. If
- *      this reference is not a valid CFHostRef, the behavior is
- *      undefined.
- *    
- *    runLoop:
- *      A CFRunLoopRef on which the host is scheduled and should now be
- *      unscheduled.  Must be non-NULL.  If this reference is not a
- *      valid CFRunLoopRef, the behavior is undefined.
- *    
- *    runLoopMode:
- *      A CFStringRef which is the mode in which the host is scheduled
- *      and should be unscheduled.  Must be non-NULL. If this reference
- *      is not a valid CFStringRef, the behavior is undefined.
+ *	
+ *	theHost:
+ *	  The CFHostRef which is being unscheduled.  Must be non-NULL. If
+ *	  this reference is not a valid CFHostRef, the behavior is
+ *	  undefined.
+ *	
+ *	runLoop:
+ *	  A CFRunLoopRef on which the host is scheduled and should now be
+ *	  unscheduled.  Must be non-NULL.  If this reference is not a
+ *	  valid CFRunLoopRef, the behavior is undefined.
+ *	
+ *	runLoopMode:
+ *	  A CFStringRef which is the mode in which the host is scheduled
+ *	  and should be unscheduled.  Must be non-NULL. If this reference
+ *	  is not a valid CFStringRef, the behavior is undefined.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-// AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
 procedure CFHostUnscheduleFromRunLoop( theHost: CFHostRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFHostUnscheduleFromRunLoop';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
+
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 146 - 18
packages/univint/src/CFLocale.pas

@@ -1,14 +1,17 @@
 {	CFLocale.h
-	Copyright (c) 2002-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2002-2009, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +20,8 @@
 
 unit CFLocale;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,6 +167,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFArray,CFDictionary;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -99,7 +176,7 @@ uses MacTypes,CFBase,CFArray,CFDictionary;
 
 
 type
-	CFLocaleRef = ^SInt32; { an opaque 32-bit type }
+	CFLocaleRef = ^SInt32; { an opaque type }
 
 function CFLocaleGetTypeID: CFTypeID; external name '_CFLocaleGetTypeID';
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
@@ -139,13 +216,22 @@ function CFLocaleCopyISOCountryCodes: CFArrayRef; external name '_CFLocaleCopyIS
 function CFLocaleCopyISOCurrencyCodes: CFArrayRef; external name '_CFLocaleCopyISOCurrencyCodes';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 	// Returns an array of CFStrings that represents all known legal ISO
-	// currency codes.  Note: some of these may not have any supporting
-	// locale data in Mac OS X.
+	// currency codes.  Note: some of these currencies may be obsolete, or
+	// represent other financial instruments.
+
+function CFLocaleCopyCommonISOCurrencyCodes: CFArrayRef; external name '_CFLocaleCopyCommonISOCurrencyCodes';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+	// Returns an array of CFStrings that represents ISO currency codes for
+	// currencies in common use.
+
+function CFLocaleCopyPreferredLanguages: CFArrayRef; external name '_CFLocaleCopyPreferredLanguages';
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+	// Returns the array of canonicalized CFString locale IDs that the user prefers.
 
 function CFLocaleCreateCanonicalLanguageIdentifierFromString( allocator: CFAllocatorRef; localeIdentifier: CFStringRef ): CFStringRef; external name '_CFLocaleCreateCanonicalLanguageIdentifierFromString';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
-	// Map an arbitrary locale identification string (something close at
-	// least) to a canonical language-only identifier.
+	// Map an arbitrary language identification string (something close at
+	// least) to a canonical language identifier.
 
 function CFLocaleCreateCanonicalLocaleIdentifierFromString( allocator: CFAllocatorRef; localeIdentifier: CFStringRef ): CFStringRef; external name '_CFLocaleCreateCanonicalLocaleIdentifierFromString';
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
@@ -156,6 +242,29 @@ function CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes( allocato
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 	// Map a Mac OS LangCode and RegionCode to the canonical locale identifier.
 
+function CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode( allocator: CFAllocatorRef; lcid: UInt32 ): CFStringRef; external name '_CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+	// Map a Windows LCID to the canonical locale identifier.
+
+function CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier( localeIdentifier: CFStringRef ): UInt32; external name '_CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+	// Map a locale identifier to a Windows LCID.
+
+type
+	CFLocaleLanguageDirection = SIGNEDLONG;
+const
+	kCFLocaleLanguageDirectionUnknown = 0;
+	kCFLocaleLanguageDirectionLeftToRight = 1;
+	kCFLocaleLanguageDirectionRightToLeft = 2;
+	kCFLocaleLanguageDirectionTopToBottom = 3;
+	kCFLocaleLanguageDirectionBottomToTop = 4;
+
+function CFLocaleGetLanguageCharacterDirection( isoLangCode: CFStringRef ): CFLocaleLanguageDirection; external name '_CFLocaleGetLanguageCharacterDirection';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+function CFLocaleGetLanguageLineDirection( isoLangCode: CFStringRef ): CFLocaleLanguageDirection; external name '_CFLocaleGetLanguageLineDirection';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
 function CFLocaleCreateComponentsFromLocaleIdentifier( allocator: CFAllocatorRef; localeID: CFStringRef ): CFDictionaryRef; external name '_CFLocaleCreateComponentsFromLocaleIdentifier';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 	// Parses a locale ID consisting of language, script, country, variant,
@@ -201,6 +310,10 @@ function CFLocaleCopyDisplayNameForPropertyValue( displayLocale: CFLocaleRef; ke
 	// not all locale property keys have values with display name values.
 
 
+var kCFLocaleCurrentLocaleDidChangeNotification: CFStringRef; external name '_kCFLocaleCurrentLocaleDidChangeNotification'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+
+
 // Locale Keys
 var kCFLocaleIdentifier: CFStringRef; external name '_kCFLocaleIdentifier'; (* attribute const *)
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -233,6 +346,16 @@ var kCFLocaleCurrencySymbol: CFStringRef; external name '_kCFLocaleCurrencySymbo
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
 var kCFLocaleCurrencyCode: CFStringRef; external name '_kCFLocaleCurrencyCode'; (* attribute const *)
 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // ISO 3-letter currency code
+var kCFLocaleCollatorIdentifier: CFStringRef; external name '_kCFLocaleCollatorIdentifier'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFLocaleQuotationBeginDelimiterKey: CFStringRef; external name '_kCFLocaleQuotationBeginDelimiterKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFLocaleQuotationEndDelimiterKey: CFStringRef; external name '_kCFLocaleQuotationEndDelimiterKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFLocaleAlternateQuotationBeginDelimiterKey: CFStringRef; external name '_kCFLocaleAlternateQuotationBeginDelimiterKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFLocaleAlternateQuotationEndDelimiterKey: CFStringRef; external name '_kCFLocaleAlternateQuotationEndDelimiterKey'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
 
 // Values for kCFLocaleCalendarIdentifier
 var kCFGregorianCalendar: CFStringRef; external name '_kCFGregorianCalendar'; (* attribute const *)
@@ -249,11 +372,16 @@ var kCFIslamicCivilCalendar: CFStringRef; external name '_kCFIslamicCivilCalenda
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 var kCFJapaneseCalendar: CFStringRef; external name '_kCFJapaneseCalendar'; (* attribute const *)
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+var kCFRepublicOfChinaCalendar: CFStringRef; external name '_kCFRepublicOfChinaCalendar'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFPersianCalendar: CFStringRef; external name '_kCFPersianCalendar'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFIndianCalendar: CFStringRef; external name '_kCFIndianCalendar'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+var kCFISO8601Calendar: CFStringRef; external name '_kCFISO8601Calendar'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
 
-
-
-
-{#endif}
-
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 86 - 8
packages/univint/src/CFMachPort.pas

@@ -1,14 +1,16 @@
 {	CFMachPort.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +19,8 @@
 
 unit CFMachPort;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFRunLoop,MacOSXPosix;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -126,5 +202,7 @@ procedure CFMachPortSetInvalidationCallBack( port: CFMachPortRef; callout: CFMac
 
 function CFMachPortCreateRunLoopSource( allocator: CFAllocatorRef; port: CFMachPortRef; order: CFIndex ): CFRunLoopSourceRef; external name '_CFMachPortCreateRunLoopSource';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 96 - 8
packages/univint/src/CFMessagePort.pas

@@ -1,14 +1,16 @@
 {	CFMessagePort.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +19,8 @@
 
 unit CFMessagePort;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFString,CFRunLoop,CFData,CFDate;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -104,6 +180,7 @@ const
 	kCFMessagePortReceiveTimeout = -2;
 	kCFMessagePortIsInvalid = -3;
 	kCFMessagePortTransportError = -4;
+	kCFMessagePortBecameInvalidError = -5;
 
 type
 	CFMessagePortContext = record
@@ -140,5 +217,16 @@ function CFMessagePortSendRequest( remote: CFMessagePortRef; msgid: SInt32; data
 
 function CFMessagePortCreateRunLoopSource( allocator: CFAllocatorRef; local: CFMessagePortRef; order: CFIndex ): CFRunLoopSourceRef; external name '_CFMessagePortCreateRunLoopSource';
 
+{#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)}
+{
+First requires translation of dispatch/dispatch.h and the files it includes
+
+procedure CFMessagePortSetDispatchQueue( ms: CFMessagePortRef; queue: dispatch_queue_t ); external name '_CFMessagePortSetDispatchQueue';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+}
+
+{#endif}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 179 - 101
packages/univint/src/CFNetDiagnostics.pas

@@ -1,24 +1,25 @@
 {
-     File:       CFNetwork/CFNetDiagnostics.h
+	 File:	   CFNetwork/CFNetDiagnostics.h
  
-     Contains:   CFNetDiagnostics interface
+	 Contains:   CFNetDiagnostics interface
+  
+	 Copyright:  Copyright (c) 2004-2008, Apple Inc. All rights reserved.
  
-     Version:    Technology: 1.0
-                 Release:    CFNetwork-219~1
- 
-     Copyright:  © 2004-2006 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
+					 http://www.freepascal.org/bugs.html
  
 }
-
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -27,8 +28,8 @@
 
 unit CFNetDiagnostics;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -41,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -58,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -91,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -102,6 +175,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFBase, CFStream, CFURL;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -110,17 +185,17 @@ uses MacTypes, CFBase, CFStream, CFURL;
  *  CFNetDiagnosticRef
  *  
  *  Discussion:
- *    This is the type used to describe the types of connection that
- *    clients may be querying about
+ *	This is the type used to describe the types of connection that
+ *	clients may be querying about
  }
 type
-	CFNetDiagnosticRef = ^SInt32; { an opaque 32-bit type }
+	CFNetDiagnosticRef = ^SInt32; { an opaque type }
 
 {
  *  CFNetDiagnosticStatusValues
  *  
  *  Discussion:
- *    Values for CFNetDiagnosticStatus
+ *	Values for CFNetDiagnosticStatus
  }
 type
 	CFNetDiagnosticStatusValues = SInt32;
@@ -151,7 +226,7 @@ const
  *  CFNetDiagnosticStatus
  *  
  *  Discussion:
- *    Returned by the various status and diagnostic calls
+ *	Returned by the various status and diagnostic calls
  }
 type
 	CFNetDiagnosticStatus = CFIndex;
@@ -159,146 +234,149 @@ type
  *  CFNetDiagnosticCreateWithStreams()
  *  
  *  Discussion:
- *    Creates a CFNetDiagnosticRef from a pair of CFStreams. Either
- *    stream may be NULL. This is the preferred interface for creating
- *    a CFNetDiagnosticRef.
+ *	Creates a CFNetDiagnosticRef from a pair of CFStreams. Either
+ *	stream may be NULL. This is the preferred interface for creating
+ *	a CFNetDiagnosticRef.
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CF allocator to use.
- *    
- *    readStream:
- *      CFReadStreamRef referring to the failed connection. May be NULL.
- *    
- *    writeStream:
- *      CFWriteStreamRef referring to the failed connection. May be
- *      NULL.
+ *	
+ *	alloc:
+ *	  The CF allocator to use.
+ *	
+ *	readStream:
+ *	  CFReadStreamRef referring to the failed connection. May be NULL.
+ *	
+ *	writeStream:
+ *	  CFWriteStreamRef referring to the failed connection. May be
+ *	  NULL.
  *  
  *  Result:
- *    A CFNetDiagnosticRef referring to the current networking issue.
+ *	A CFNetDiagnosticRef referring to the current networking issue.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetDiagnosticCreateWithStreams( alloc: CFAllocatorRef; readStream: CFReadStreamRef; writeStream: CFWriteStreamRef ): CFNetDiagnosticRef; external name '_CFNetDiagnosticCreateWithStreams';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetDiagnosticCreateWithURL()
  *  
  *  Discussion:
- *    Creates a CFNetDiagnosticRef based on a CFURLRef passed in by the
- *    application.
+ *	Creates a CFNetDiagnosticRef based on a CFURLRef passed in by the
+ *	application.
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CF allocator to use.
- *    
- *    url:
- *      CFURLRef referring to the failed connection.
+ *	
+ *	alloc:
+ *	  The CF allocator to use.
+ *	
+ *	url:
+ *	  CFURLRef referring to the failed connection.
  *  
  *  Result:
- *    A CFNetDiagnosticRef referring to the current networking issue.
+ *	A CFNetDiagnosticRef referring to the current networking issue.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetDiagnosticCreateWithURL( alloc: CFAllocatorRef; url: CFURLRef ): CFNetDiagnosticRef; external name '_CFNetDiagnosticCreateWithURL';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetDiagnosticSetName()
  *  
  *  Discussion:
- *    If the framework requires an application name to be displayed to
- *    the user it will derive it from the bundle identifier of the
- *    currently running application, in that application's current
- *    localization. If you want to override that you may use
- *    CFNetDiagnosticSetName to specify a CFStringRef to be used.
+ *	If the framework requires an application name to be displayed to
+ *	the user it will derive it from the bundle identifier of the
+ *	currently running application, in that application's current
+ *	localization. If you want to override that you may use
+ *	CFNetDiagnosticSetName to specify a CFStringRef to be used.
  *  
  *  Parameters:
- *    
- *    details:
- *      CFNetDiagnosticRef referring to the current problem.
- *    
- *    name:
- *      The localized name that should appear to the user when
- *      referring to the application.
+ *	
+ *	details:
+ *	  CFNetDiagnosticRef referring to the current problem.
+ *	
+ *	name:
+ *	  The localized name that should appear to the user when
+ *	  referring to the application.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetDiagnosticSetName( details: CFNetDiagnosticRef; name: CFStringRef ); external name '_CFNetDiagnosticSetName';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetDiagnosticDiagnoseProblemInteractively()
  *  
  *  Discussion:
- *    Opens the Network Diagnostics window and returns immediately once
- *    it is open. The client passes in a CFNetDiagnosticRef built with
- *    one of the creator functions.
+ *	Opens the Network Diagnostics window and returns immediately once
+ *	it is open. The client passes in a CFNetDiagnosticRef built with
+ *	one of the creator functions.
  *  
  *  Parameters:
- *    
- *    details:
- *      CFNetDiagnosticRef referring to the current problem.
+ *	
+ *	details:
+ *	  CFNetDiagnosticRef referring to the current problem.
  *  
  *  Result:
- *    A CFNetDiagnosticStatus. Will either be CFNetDiagnosticNoErr, or
- *    CFNetDiagnosticErr if there was an error attempting to run the
- *    diagnosis.
+ *	A CFNetDiagnosticStatus. Will either be CFNetDiagnosticNoErr, or
+ *	CFNetDiagnosticErr if there was an error attempting to run the
+ *	diagnosis.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetDiagnosticDiagnoseProblemInteractively( details: CFNetDiagnosticRef ): CFNetDiagnosticStatus; external name '_CFNetDiagnosticDiagnoseProblemInteractively';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetDiagnosticCopyNetworkStatusPassively()
  *  
  *  Discussion:
- *    Returns a status value that can be used to display basic
- *    information about the connection. If the caller wishes they may
- *    pass in a pointer to a CFStringRef that will be used to pass back
- *    a localized description of the problem. It is the caller's
- *    responsibility to release the CFStringRef. If the caller does not
- *    want a description they may pass in NULL.
- *    CFNetDiagnosticCopyNetworkStatusPassively() is guaranteed not to
- *    cause network activity.
+ *	Returns a status value that can be used to display basic
+ *	information about the connection. If the caller wishes they may
+ *	pass in a pointer to a CFStringRef that will be used to pass back
+ *	a localized description of the problem. It is the caller's
+ *	responsibility to release the CFStringRef. If the caller does not
+ *	want a description they may pass in NULL.
+ *	CFNetDiagnosticCopyNetworkStatusPassively() is guaranteed not to
+ *	cause network activity.
  *  
  *  Parameters:
- *    
- *    details:
- *      CFNetDiagnosticRef referring to the current problem.
- *    
- *    description:
- *      A pointer to a CFStringRef that, upon return, will point to a
- *      localized string containing a description of the current
- *      network status. May be NULL. If it is not NULL, the client must
- *      call CFRelease on the returned object.
+ *	
+ *	details:
+ *	  CFNetDiagnosticRef referring to the current problem.
+ *	
+ *	description:
+ *	  A pointer to a CFStringRef that, upon return, will point to a
+ *	  localized string containing a description of the current
+ *	  network status. May be NULL. If it is not NULL, the client must
+ *	  call CFRelease on the returned object.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetDiagnosticCopyNetworkStatusPassively( details: CFNetDiagnosticRef; description: CFStringRefPtr { can be NULL } ): CFNetDiagnosticStatus; external name '_CFNetDiagnosticCopyNetworkStatusPassively';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 944 - 890
packages/univint/src/CFNetServices.pas

@@ -1,27 +1,26 @@
 {
-     File:       CFNetwork/CFNetServices.h
+	 File:	   CFNetwork/CFNetServices.h
  
-     Contains:   CoreFoundation Network Net Services header
+	 Contains:   CoreFoundation Network Net Services header
  
-     Version:    CFNetwork-219~1
+	 Copyright:  Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  
-     Copyright:  © 2001-2006 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
  
-     Bugs?:      For bug reports, consult the following page on
-                 the World Wide Web:
- 
-                     http://www.freepascal.org/bugs.html
+					 http://www.freepascal.org/bugs.html
  
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
-{     Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
-
+{   Pascal Translation Updated:  Gale R Paeper, <[email protected]>, 2008 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -30,8 +29,8 @@
 
 unit CFNetServices;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -44,16 +43,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -61,14 +82,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -94,7 +166,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -105,99 +176,77 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFStream,CFArray,CFRunLoop, CFData, CFDate, CFDictionary;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN MAC68K}
-{
-CFNetServices
-Network Services is composed of two objects, a Network Service and
-a Network Service Browser.  A Network Service represents a single
-point service on the network.  Associated with a service is its name,
-type of service, domain, port, and possibly protocol specific information
-(for legacy protocols).  Services can be registered and resolved.
-Registering a service advertises the service on the network, so other
-computers can use the service.  Resolving a service performs a network
-lookup in order to find the computer which has registered the service.
-Lookup is contained by the services name, type of service, and the domain.
-The port and address of the registered service will be returned.  Services
-can be created or discovered.
-
-Discovery of services takes place through the use of the Network Service
-Browser.  Given a domain and a service type, the browser will search out
-those services on the network.  The returned services can then be resolved
-and then used.
-
-Service type values are keywords as registered with IANA.  A list of values
-may be retrieved from their web site at
-<http://www.iana.org/assignments/port-numbers>.
-}
+
 
 {
  *  CFNetServiceRef
  *  
  *  Discussion:
- *    This is the type of a reference to a service.  It may be used for
- *    registering or for resolving.
+ *	This is the type of a reference to a service.  It may be used for
+ *	registering or for resolving.
  }
 type
-	CFNetServiceRef = ^SInt32; { an opaque 32-bit type }
+	CFNetServiceRef = ^SInt32; { an opaque type }
 
 {
  *  CFNetServiceMonitorRef
  *  
  *  Discussion:
- *    This is the type of a reference to a service monitor.  It may be
- *    used for watching record changes on a CFNetServiceRef.
+ *	This is the type of a reference to a service monitor.  It may be
+ *	used for watching record changes on a CFNetServiceRef.
  }
 type
-	CFNetServiceMonitorRef = ^SInt32; { an opaque 32-bit type }
+	CFNetServiceMonitorRef = ^SInt32; { an opaque type }
 
 {
  *  CFNetServiceBrowserRef
  *  
  *  Discussion:
- *    This is the type of a reference to a service or domain browser.
- *    It may be used for discovering services or domains.
+ *	This is the type of a reference to a service or domain browser.
+ *	It may be used for discovering services or domains.
  }
 type
-	CFNetServiceBrowserRef = ^SInt32; { an opaque 32-bit type }
-
+	CFNetServiceBrowserRef = ^SInt32; { an opaque type }
 {
  *  kCFStreamErrorDomainMach
  *  
  *  Discussion:
- *    Errors reported by mach.  See <mach/error.h>
+ *	Errors reported by mach.  See <mach/error.h>
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamErrorDomainMach: SInt32; external name '_kCFStreamErrorDomainMach'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
-
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 {
  *  kCFStreamErrorDomainNetServices
  *  
  *  Discussion:
- *    Errors listed below or reported by the Service Discovery API's.
- *    See <dns_sd.h>.  The Service Discovery errors will only be
- *    returned when using the new, Mac OS X 10.4-based API's or
- *    CFNetServiceBrowser.
+ *	Errors listed below or reported by the Service Discovery API's.
+ *	See <dns_sd.h>.  The Service Discovery errors will only be
+ *	returned when using the new, Mac OS X 10.4-based API's or
+ *	CFNetServiceBrowser.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFStreamErrorDomainNetServices: SInt32; external name '_kCFStreamErrorDomainNetServices'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServicesError
  *  
  *  Discussion:
- *    Errors from the kCFStreamErrorDomainNetServices domain.
+ *	Errors from the kCFStreamErrorDomainNetServices domain.
  }
 type
 	CFNetServicesError = SInt32;
@@ -205,41 +254,41 @@ const
 {
    * An error of unknown type has occured.
    }
-  kCFNetServicesErrorUnknown    = -72000;
+	kCFNetServicesErrorUnknown = -72000;
 
   {
    * The given registration has had a name collision.  Registration
    * should be cancelled and should try again probably with a different
    * name.
    }
-  kCFNetServicesErrorCollision  = -72001;
+	kCFNetServicesErrorCollision = -72001;
 
   {
    * Not used
    }
-  kCFNetServicesErrorNotFound   = -72002;
+	kCFNetServicesErrorNotFound = -72002;
 
   {
    * There is already a register, resolve, browse, or monitor in
    * progress on the given object.
    }
-  kCFNetServicesErrorInProgress = -72003;
+	kCFNetServicesErrorInProgress = -72003;
 
   {
    * Not used
    }
-  kCFNetServicesErrorBadArgument = -72004;
+	kCFNetServicesErrorBadArgument = -72004;
 
   {
    * The register, resolve, or browse on the object has been cancelled.
    }
-  kCFNetServicesErrorCancel     = -72005;
+	kCFNetServicesErrorCancel = -72005;
 
   {
    * The given CFNetServiceBrowser or CFNetServiceMonitor has already
    * been invalidated and can no longer be used.
    }
-  kCFNetServicesErrorInvalid    = -72006;
+	kCFNetServicesErrorInvalid = -72006;
 
   {
    * The given CFNetServiceResolveWithTimeout has hit the timeout
@@ -252,8 +301,8 @@ const
  *  CFNetServiceMonitorType
  *  
  *  Discussion:
- *    Record type specifier in order to inform CFNetServiceMonitor to
- *    watch for certain record changes.
+ *	Record type specifier in order to inform CFNetServiceMonitor to
+ *	watch for certain record changes.
  }
 type
 	CFNetServiceMonitorType = SInt32;
@@ -268,32 +317,32 @@ const
  *  CFNetService flags
  *
  *  Discussion:
- *      Bit flags to be used for registration of a service with CFNetServiceRegisterWithOptions.
+ *	  Bit flags to be used for registration of a service with CFNetServiceRegisterWithOptions.
  }
 const
-	kCFNetServiceFlagNoAutoRename = 1;     { Indicate that registration should not auto-rename the service to prevent name conflicts.}
+	kCFNetServiceFlagNoAutoRename = 1;	 { Indicate that registration should not auto-rename the service to prevent name conflicts.}
 
 
 {
  *  CFNetServiceBrowser flags
  *  
  *  Discussion:
- *    Result bit flags passed to CFNetServiceBrowserClientCallBack.
+ *	Result bit flags passed to CFNetServiceBrowserClientCallBack.
  }
 const
-	kCFNetServiceFlagMoreComing = 1;    { Client will get another callback briefly and shouldn't do costly screen updates (or such).}
-	kCFNetServiceFlagIsDomain = 2;    { If off, the result is a service.}
-	kCFNetServiceFlagIsDefault = 4;    { The result domain is the default domain for the given domain browse type (registration or browse).}
-	kCFNetServiceFlagIsRegistrationDomain = 4; { Same as the previous but incorrectly named.   Kept for compatibility.}
-	kCFNetServiceFlagRemove = 8;     { The result item should be removed and not added.}
+	kCFNetServiceFlagMoreComing = 1;  { Client will get another callback briefly and shouldn't do costly screen updates (or such).}
+	kCFNetServiceFlagIsDomain = 2;  { If off, the result is a service.}
+	kCFNetServiceFlagIsDefault = 4;  { The result domain is the default domain for the given domain browse type (registration or browse).}
+	kCFNetServiceFlagIsRegistrationDomain = 4;  { Same as the previous but incorrectly named. Kept for compatibility.}
+	kCFNetServiceFlagRemove = 8;   { The result item should be removed and not added.}
 
 
 {
  *  CFNetServiceClientContext
  *  
  *  Discussion:
- *    Structure containing the user-defined data and callbacks for
- *    CFNetService and CFNetServiceBrowser objects.
+ *	Structure containing the user-defined data and callbacks for
+ *	CFNetService and CFNetServiceBrowser objects.
  }
 type
 	CFNetServiceClientContext = record
@@ -302,13 +351,13 @@ type
    * parameter to the CFNetService, Browser, or Monitor client
    * function.  The current version number is 0.
    }
-  version: CFIndex;
+		version: CFIndex;
 
   {
    * An arbitrary pointer to client-defined data, which can be
    * associated with the service/browser and is passed to the callbacks.
    }
-  info: UnivPtr;
+		info: UnivPtr;
 
   {
    * The callback used to add a retain for the service/browser on the
@@ -318,13 +367,13 @@ type
    * service/browser, almost always just the pointer passed as the
    * parameter.
    }
-  retain: CFAllocatorRetainCallBack;
+		retain: CFAllocatorRetainCallBack;
 
   {
    * The callback used to remove a retain previously added for the
    * service/browser on the info pointer.
    }
-  release: CFAllocatorReleaseCallBack;
+		release: CFAllocatorReleaseCallBack;
 
   {
    * The callback used to create a descriptive string representation of
@@ -332,30 +381,30 @@ type
    * debugging purposes. This is used by the CFCopyDescription()
    * function.
    }
-  copyDescription: CFAllocatorCopyDescriptionCallBack;
-end;
+		copyDescription: CFAllocatorCopyDescriptionCallBack;
+	end;
 CFNetServiceClientContextPtr = ^CFNetServiceClientContext;
 
 {
  *  CFNetServiceClientCallBack
  *  
  *  Discussion:
- *    Callback function which is called upon error or completion of
- *    resolve or register.  If resolving with the deprecated API's, the
- *    callback may be called multiple times, once for each resolved
- *    address.
+ *	Callback function which is called upon error or completion of
+ *	resolve or register.  If resolving with the deprecated API's, the
+ *	callback may be called multiple times, once for each resolved
+ *	address.
  *  
  *  Parameters:
- *    
- *    theService:
- *      Service receiving the event.
- *    
- *    error:
- *      Reference to an error structure if the event is a failure.
- *    
- *    info:
- *      Client's info reference which was passed into the client
- *      context.
+ *	
+ *	theService:
+ *	  Service receiving the event.
+ *	
+ *	error:
+ *	  Reference to an error structure if the event is a failure.
+ *	
+ *	info:
+ *	  Client's info reference which was passed into the client
+ *	  context.
  }
 type
 	CFNetServiceClientCallBack = procedure( theService: CFNetServiceRef; var error: CFStreamError; info: UnivPtr );
@@ -364,28 +413,28 @@ type
  *  CFNetServiceMonitorClientCallBack
  *  
  *  Discussion:
- *    Callback function which is called as the monitored record changes.
+ *	Callback function which is called as the monitored record changes.
  *  
  *  Parameters:
- *    
- *    theMonitor:
- *      CFNetServiceMonitor receiving the event.
- *    
- *    theService:
- *      Service receiving the event.
- *    
- *    typeInfo:
- *      The information type which changed.
- *    
- *    rdata:
- *      The contents of the record that changed.
- *    
- *    error:
- *      Reference to an error structure if the event is a failure.
- *    
- *    info:
- *      Client's info reference which was passed into the client
- *      context.
+ *	
+ *	theMonitor:
+ *	  CFNetServiceMonitor receiving the event.
+ *	
+ *	theService:
+ *	  Service receiving the event.
+ *	
+ *	typeInfo:
+ *	  The information type which changed.
+ *	
+ *	rdata:
+ *	  The contents of the record that changed.
+ *	
+ *	error:
+ *	  Reference to an error structure if the event is a failure.
+ *	
+ *	info:
+ *	  Client's info reference which was passed into the client
+ *	  context.
  }
 type
 	CFNetServiceMonitorClientCallBack = procedure( theMonitor: CFNetServiceMonitorRef; theService: CFNetServiceRef; typeInfo: CFNetServiceMonitorType; rdata: CFDataRef; var error: CFStreamError; info: UnivPtr );
@@ -394,29 +443,29 @@ type
  *  CFNetServiceBrowserClientCallBack
  *  
  *  Discussion:
- *    Callback function which is called upon error or upon successful
- *    discovery of services or domains.
+ *	Callback function which is called upon error or upon successful
+ *	discovery of services or domains.
  *  
  *  Parameters:
- *    
- *    browser:
- *      CFNetServiceBrowser receiving the event.
- *    
- *    flags:
- *      Bitwise flags indicating the event or further information about
- *      the event.
- *    
- *    domainOrService:
- *      If searching for domains, a CFStringRef indicating the domain
- *      which was found or is going away.  If searching for services,
- *      the service which was found or is going away.
- *    
- *    error:
- *      Reference to an error structure if the event is a failure.
- *    
- *    info:
- *      Client's info reference which was passed into the client
- *      context.
+ *	
+ *	browser:
+ *	  CFNetServiceBrowser receiving the event.
+ *	
+ *	flags:
+ *	  Bitwise flags indicating the event or further information about
+ *	  the event.
+ *	
+ *	domainOrService:
+ *	  If searching for domains, a CFStringRef indicating the domain
+ *	  which was found or is going away.  If searching for services,
+ *	  the service which was found or is going away.
+ *	
+ *	error:
+ *	  Reference to an error structure if the event is a failure.
+ *	
+ *	info:
+ *	  Client's info reference which was passed into the client
+ *	  context.
  }
 type
 	CFNetServiceBrowserClientCallBack = procedure( browser: CFNetServiceBrowserRef; flags: CFOptionFlags; domainOrService: CFTypeRef; var error: CFStreamError; info: UnivPtr );
@@ -424,1311 +473,1316 @@ type
  *  CFNetServiceGetTypeID()
  *  
  *  Discussion:
- *    Returns the type identifier of all CFNetService instances.
+ *	Returns the type identifier of all CFNetService instances.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetTypeID: CFTypeID; external name '_CFNetServiceGetTypeID';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorGetTypeID()
  *  
  *  Discussion:
- *    Returns the type identifier of all CFNetServiceMonitor instances.
+ *	Returns the type identifier of all CFNetServiceMonitor instances.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceMonitorGetTypeID: CFTypeID; external name '_CFNetServiceMonitorGetTypeID';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserGetTypeID()
  *  
  *  Discussion:
- *    Returns the type identifier of all CFNetServiceBrowser instances.
+ *	Returns the type identifier of all CFNetServiceBrowser instances.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceBrowserGetTypeID: CFTypeID; external name '_CFNetServiceBrowserGetTypeID';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceCreate()
  *  
  *  Discussion:
- *    Creates an instance of a Network Service.
+ *	Creates an instance of a Network Service.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CFAllocator which should be used to allocate memory for the
- *      service and its storage for values. If this reference is not a
- *      valid CFAllocator, the behavior is undefined.
- *    
- *    domain:
- *      The network domain in which it is registered or will be
- *      registered. This value must be non-NULL.
- *    
- *    serviceType:
- *      The type of service being registered or resolved on the
- *      network. The service type consists of the application protocol
- *      name followed by the transport protocol name, separated by a
- *      dot (e.g. "_ftp._tcp").  The application protocol name should
- *      be 14 characters or less, and should only contain lower-case
- *      letters, digits, and hyphens.  New service types should be
- *      registered at <htp://www.dns-sd.org/ServiceTypes.html>.  This
- *      value must be non-NULL.
- *    
- *    name:
- *      The name of the machine or application advertising the service.
- *       If this value is not unique, registering will eventually fail.
- *       This value must be non-NULL.  This value is usually displayed
- *      in a browser for the user.
- *    
- *    port:
- *      The port on which the service is listening.  This must be
- *      non-zero for services which are to be registered.
+ *	
+ *	alloc:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  service and its storage for values. If this reference is not a
+ *	  valid CFAllocator, the behavior is undefined.
+ *	
+ *	domain:
+ *	  The network domain in which it is registered or will be
+ *	  registered. This value must be non-NULL.
+ *	
+ *	serviceType:
+ *	  The type of service being registered or resolved on the
+ *	  network. The service type consists of the application protocol
+ *	  name followed by the transport protocol name, separated by a
+ *	  dot (e.g. "_ftp._tcp").  The application protocol name should
+ *	  be 14 characters or less, and should only contain lower-case
+ *	  letters, digits, and hyphens.  New service types should be
+ *	  registered at <htp://www.dns-sd.org/ServiceTypes.html>.  This
+ *	  value must be non-NULL.
+ *	
+ *	name:
+ *	  The name of the machine or application advertising the service.
+ *	   If this value is not unique, registering will eventually fail.
+ *	   This value must be non-NULL.  This value is usually displayed
+ *	  in a browser for the user.
+ *	
+ *	port:
+ *	  The port on which the service is listening.  This must be
+ *	  non-zero for services which are to be registered.
  *  
  *  Result:
- *    A valid CFNetService which may now be registered or resolved, or
- *    NULL if unsuccessful.
+ *	A valid CFNetService which may now be registered or resolved, or
+ *	NULL if unsuccessful.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceCreate( alloc: CFAllocatorRef; domain: CFStringRef; serviceType: CFStringRef; name: CFStringRef; port: SInt32 ): CFNetServiceRef; external name '_CFNetServiceCreate';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceCreateCopy()
  *  
  *  Discussion:
- *    Creates a new CFNetService object as a copy of service argument.
+ *	Creates a new CFNetService object as a copy of service argument.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CFAllocator which should be used to allocate memory for the
- *      new service. If this reference is not a valid CFAllocator, the
- *      behavior is undefined.
- *    
- *    service:
- *      A CFNetServiceRef representing the original service. Must be
- *      non-NULL.  If this If this reference is not a valid
- *      CFNetServiceRef, the behavior is undefined.
+ *	
+ *	alloc:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  new service. If this reference is not a valid CFAllocator, the
+ *	  behavior is undefined.
+ *	
+ *	service:
+ *	  A CFNetServiceRef representing the original service. Must be
+ *	  non-NULL.  If this If this reference is not a valid
+ *	  CFNetServiceRef, the behavior is undefined.
  *  
  *  Result:
- *    Returns a valid CFNetServiceRef which contains a copy of all
- *    previously resolved data from the original.  NULL is returned in
- *    the case of failure.
+ *	Returns a valid CFNetServiceRef which contains a copy of all
+ *	previously resolved data from the original.  NULL is returned in
+ *	the case of failure.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.3 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.3 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceCreateCopy( alloc: CFAllocatorRef; service: CFNetServiceRef ): CFNetServiceRef; external name '_CFNetServiceCreateCopy';
-(* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetDomain()
  *  
  *  Discussion:
- *    Query a Network Service for its domain.
+ *	Query a Network Service for its domain.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    CFStringRef which is the service's domain.
+ *	CFStringRef which is the service's domain.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetDomain( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetDomain';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetType()
  *  
  *  Discussion:
- *    Query a Network Service for its type.
+ *	Query a Network Service for its type.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    CFStringRef which is the service's service type.
+ *	CFStringRef which is the service's service type.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetType( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetType';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetName()
  *  
  *  Discussion:
- *    Query a Network Service for its name.
+ *	Query a Network Service for its name.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    CFStringRef which is the service's name.
+ *	CFStringRef which is the service's name.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetName( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetName';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceRegisterWithOptions()
  *  
  *  Discussion:
- *    Registers the entity on the network.  This requires that the
- *    service has a domain, a type, a name, and a port.  The service is
- *    registered on the network until this function returns or is
- *    cancelled by calling CFNetServiceCancel.  In synchronous mode,
- *    this function will block until there is an error or it is
- *    cancelled from another thread.  In asynchronous mode, this
- *    function returns immediately and the underlying network
- *    registration process will start.
+ *	Registers the entity on the network.  This requires that the
+ *	service has a domain, a type, a name, and a port.  The service is
+ *	registered on the network until this function returns or is
+ *	cancelled by calling CFNetServiceCancel.  In synchronous mode,
+ *	this function will block until there is an error or it is
+ *	cancelled from another thread.  In asynchronous mode, this
+ *	function returns immediately and the underlying network
+ *	registration process will start.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to register on the network.  Must be
- *      non-NULL.
- *    
- *    options:
- *      A set of bit options used to instruct the registration process.
- *      Current supported option is kCFNetServiceFlagNoAutoRename.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	theService:
+ *	  The Network Service to register on the network.  Must be
+ *	  non-NULL.
+ *	
+ *	options:
+ *	  A set of bit options used to instruct the registration process.
+ *	  Current supported option is kCFNetServiceFlagNoAutoRename.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if domain, type, name or port is NULL.  In
- *    synchronous mode, it will always return FALSE as a result of the
- *    error or the cancellation.  In asynchronous mode, it will return
- *    TRUE if the registration process could start.
+ *	Returns FALSE if domain, type, name or port is NULL.  In
+ *	synchronous mode, it will always return FALSE as a result of the
+ *	error or the cancellation.  In asynchronous mode, it will return
+ *	TRUE if the registration process could start.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceRegisterWithOptions( theService: CFNetServiceRef; options: CFOptionFlags; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceRegisterWithOptions';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceResolveWithTimeout()
  *  
  *  Discussion:
- *    Resolves the information related to this service.  It will
- *    resolve the target host, the addresses, and the first TXT record
- *    associated with the service.
+ *	Resolves the information related to this service.  It will
+ *	resolve the target host, the addresses, and the first TXT record
+ *	associated with the service.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The CFNetServiceRef which should be resolved. Must be non-NULL.
- *      If this reference is not a valid CFNetServiceRef, the behavior
- *      is undefined.
- *    
- *    timeout:
- *      CFTimeInterval representing the maximum amount of time to take
- *      to perform the resolve.  If the resolve can not be performed
- *      within this timeout, the function or callback will recieve a
- *      timeout error.  Values less than or equal to zero indicate an
- *      infinite timeout.
- *    
- *    error:
- *      A reference to a CFStreamError structure which will be filled
- *      with any error information should an error occur.  May be set
- *      to NULL if error information is not wanted.
+ *	
+ *	theService:
+ *	  The CFNetServiceRef which should be resolved. Must be non-NULL.
+ *	  If this reference is not a valid CFNetServiceRef, the behavior
+ *	  is undefined.
+ *	
+ *	timeout:
+ *	  CFTimeInterval representing the maximum amount of time to take
+ *	  to perform the resolve.  If the resolve can not be performed
+ *	  within this timeout, the function or callback will recieve a
+ *	  timeout error.  Values less than or equal to zero indicate an
+ *	  infinite timeout.
+ *	
+ *	error:
+ *	  A reference to a CFStreamError structure which will be filled
+ *	  with any error information should an error occur.  May be set
+ *	  to NULL if error information is not wanted.
  *  
  *  Result:
- *    Returns TRUE on success and FALSE on failure.  In asynchronous
- *    mode, this function will return immediately.  In synchronous
- *    mode, it will block until the resolve has completed or until the
- *    resolve is cancelled.
+ *	Returns TRUE on success and FALSE on failure.  In asynchronous
+ *	mode, this function will return immediately.  In synchronous
+ *	mode, it will block until the resolve has completed or until the
+ *	resolve is cancelled.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceResolveWithTimeout( theService: CFNetServiceRef; timeout: CFTimeInterval; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceResolveWithTimeout';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceCancel()
  *  
  *  Discussion:
- *    Cancels an outstanding request for registration or resolution.
+ *	Cancels an outstanding request for registration or resolution.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service which is active.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service which is active.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceCancel( theService: CFNetServiceRef ); external name '_CFNetServiceCancel';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetTargetHost()
  *  
  *  Discussion:
- *    Query a Network Service for its resolve target.
+ *	Query a Network Service for its resolve target.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    Returns The target hostname of the machine providing the service,
- *    or NULL if the entity's target is not known (has not been
- *    resolved).
+ *	Returns The target hostname of the machine providing the service,
+ *	or NULL if the entity's target is not known (has not been
+ *	resolved).
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetTargetHost( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetTargetHost';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetPortNumber()
  *  
  *  Discussion:
- *    Query a Network Service for its port number.
+ *	Query a Network Service for its port number.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    Returns a SInt32 containing the port number in host byte order.
- *    Returns -1 if the entity's port is not known (has not been
- *    resolved)
+ *	Returns a SInt32 containing the port number in host byte order.
+ *	Returns -1 if the entity's port is not known (has not been
+ *	resolved)
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetPortNumber( theService: CFNetServiceRef ): SInt32; external name '_CFNetServiceGetPortNumber';
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetAddressing()
  *  
  *  Discussion:
- *    Query a Network Service for its addressing.
+ *	Query a Network Service for its addressing.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    Returns NULL if the entity's addressing is not known (has not
- *    been resolved).  The array will contain a CFDataRef for each
- *    address resolved.  Each CFDataRef contains a struct sockaddr
- *    representing the address of the service.
+ *	Returns NULL if the entity's addressing is not known (has not
+ *	been resolved).  The array will contain a CFDataRef for each
+ *	address resolved.  Each CFDataRef contains a struct sockaddr
+ *	representing the address of the service.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetAddressing( theService: CFNetServiceRef ): CFArrayRef; external name '_CFNetServiceGetAddressing';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceGetTXTData()
  *  
  *  Discussion:
- *    Query a Network Service for its TXT record contents.
+ *	Query a Network Service for its TXT record contents.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    Returns NULL if the entity's TXT is not known (has not been
- *    resolved).  The result will contain the contents of the TXT
- *    record.  This is suitable to pass to
- *    CFNetServiceCreateDictionaryWithTXTData.
+ *	Returns NULL if the entity's TXT is not known (has not been
+ *	resolved).  The result will contain the contents of the TXT
+ *	record.  This is suitable to pass to
+ *	CFNetServiceCreateDictionaryWithTXTData.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetTXTData( theService: CFNetServiceRef ): CFDataRef; external name '_CFNetServiceGetTXTData';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceSetTXTData()
  *  
  *  Discussion:
- *    Sets the TXT record for the service.  If the service is currently
- *    registered on the network, the record will be broadcast.  Setting
- *    the TXT record on a resolving service is not allowed.
+ *	Sets the TXT record for the service.  If the service is currently
+ *	registered on the network, the record will be broadcast.  Setting
+ *	the TXT record on a resolving service is not allowed.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to receive the new record.  Must be
- *      non-NULL.
- *    
- *    txtRecord:
- *      The contents of the TXT record.  This should not exceed a
- *      length of 1450 bytes.
+ *	
+ *	theService:
+ *	  The Network Service to receive the new record.  Must be
+ *	  non-NULL.
+ *	
+ *	txtRecord:
+ *	  The contents of the TXT record.  This should not exceed a
+ *	  length of 1450 bytes.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceSetTXTData( theService: CFNetServiceRef; txtRecord: CFDataRef ): Boolean; external name '_CFNetServiceSetTXTData';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceCreateDictionaryWithTXTData()
  *  
  *  Discussion:
- *    Parses the given TXT record data into a set of key/value pairs as
- *    a CFDictionary where keys are CFStringRefs and values are
- *    CFDataRefs.  If the given record can not be parsed, NULL will be
- *    returned.  READ THE COMMENTS FOR
- *    CFNetServiceCreateTXTDataWithDictionary TO FULLY UNDERSTAND THE
- *    USE AND RESULTS OF THIS FUNCTION.
+ *	Parses the given TXT record data into a set of key/value pairs as
+ *	a CFDictionary where keys are CFStringRefs and values are
+ *	CFDataRefs.  If the given record can not be parsed, NULL will be
+ *	returned.  READ THE COMMENTS FOR
+ *	CFNetServiceCreateTXTDataWithDictionary TO FULLY UNDERSTAND THE
+ *	USE AND RESULTS OF THIS FUNCTION.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      CFAllocatorRef to be used for the creation of the result.
- *    
- *    txtRecord:
- *      The TXT record data as returned by CFNetServiceGetInfo.
+ *	
+ *	alloc:
+ *	  CFAllocatorRef to be used for the creation of the result.
+ *	
+ *	txtRecord:
+ *	  The TXT record data as returned by CFNetServiceGetInfo.
  *  
  *  Result:
- *    CFDictionaryRef containing the key/value pairs parsed from the
- *    record. It will return NULL if the record could not be parsed. 
- *    Keys in the dictionary are CFStringRef's.  Values are CFDataRef's.
+ *	CFDictionaryRef containing the key/value pairs parsed from the
+ *	record. It will return NULL if the record could not be parsed. 
+ *	Keys in the dictionary are CFStringRef's.  Values are CFDataRef's.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceCreateDictionaryWithTXTData( alloc: CFAllocatorRef; txtRecord: CFDataRef ): CFDictionaryRef; external name '_CFNetServiceCreateDictionaryWithTXTData';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceCreateTXTDataWithDictionary()
  *  
  *  Discussion:
- *    Flattens a set of key/value pairs into a CFDataRef suitable to
- *    pass into CFNetServiceSetTXTData.  This function will properly
- *    format the data for TXT record usage.  THIS IS NOT A GENERAL
- *    CFDictionaryRef FLATTENING ROUTINE.  CFDictionaryRef keys should
- *    be CFStringRef's and values should be CFDataRef's.  For
- *    convenience, values that are CFStringRef's will be converted to
- *    CFDataRef's representing the flattened UTF-8 bytes of the string.
- *     The types of the values are not encoded in the CFDataRef's,
- *    therefore CFStringRef's will be flattened into CFDataRef's, and
- *    they will come out of CFNetServiceCreateDictionaryWithTXTData as
- *    CFDataRef's.
+ *	Flattens a set of key/value pairs into a CFDataRef suitable to
+ *	pass into CFNetServiceSetTXTData.  This function will properly
+ *	format the data for TXT record usage.  THIS IS NOT A GENERAL
+ *	CFDictionaryRef FLATTENING ROUTINE.  CFDictionaryRef keys should
+ *	be CFStringRef's and values should be CFDataRef's.  For
+ *	convenience, values that are CFStringRef's will be converted to
+ *	CFDataRef's representing the flattened UTF-8 bytes of the string.
+ *	 The types of the values are not encoded in the CFDataRef's,
+ *	therefore CFStringRef's will be flattened into CFDataRef's, and
+ *	they will come out of CFNetServiceCreateDictionaryWithTXTData as
+ *	CFDataRef's.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      CFAllocatorRef to be used for the creation of the result.
- *    
- *    keyValuePairs:
- *      CFDictionaryRef containing keys and values to be placed into
- *      the TXT record.  The keys must be CFStringRef's.  The values
- *      should be CFDataRef's (CFStringRef's are permitted for
- *      convenience).  Any other types will cause a failure.  The
- *      length of a key and its value should not exceed 255.
+ *	
+ *	alloc:
+ *	  CFAllocatorRef to be used for the creation of the result.
+ *	
+ *	keyValuePairs:
+ *	  CFDictionaryRef containing keys and values to be placed into
+ *	  the TXT record.  The keys must be CFStringRef's.  The values
+ *	  should be CFDataRef's (CFStringRef's are permitted for
+ *	  convenience).  Any other types will cause a failure.  The
+ *	  length of a key and its value should not exceed 255.
  *  
  *  Result:
- *    CFDataRef containing the flattened form of the keys and values. 
- *    If the dictionary could not be flattend, NULL will be returned.
+ *	CFDataRef containing the flattened form of the keys and values. 
+ *	If the dictionary could not be flattend, NULL will be returned.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceCreateTXTDataWithDictionary( alloc: CFAllocatorRef; keyValuePairs: CFDictionaryRef ): CFDataRef; external name '_CFNetServiceCreateTXTDataWithDictionary';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceSetClient()
  *  
  *  Discussion:
- *    Sets up the service to be used in asynchronous mode. 
- *    Notification of registration failure or resolution completion
- *    will occur through the given callback.  Once the client is set,
- *    the service must be scheduled on a runloop. The client callback
- *    will be triggered via one of the scheduled run loops; It is the
- *    caller's responsibility to ensure that at least one of the
- *    scheduled run loops is being run.  This call must be performed
- *    before calling CFNetServiceRegister or CFNetServiceResolve,
- *    otherwise it will return FALSE.  TRUE will be returned if the
- *    client could be set.
+ *	Sets up the service to be used in asynchronous mode. 
+ *	Notification of registration failure or resolution completion
+ *	will occur through the given callback.  Once the client is set,
+ *	the service must be scheduled on a runloop. The client callback
+ *	will be triggered via one of the scheduled run loops; It is the
+ *	caller's responsibility to ensure that at least one of the
+ *	scheduled run loops is being run.  This call must be performed
+ *	before calling CFNetServiceRegister or CFNetServiceResolve,
+ *	otherwise it will return FALSE.  TRUE will be returned if the
+ *	client could be set.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The service to set up for asynchronous mode.  Must be non-NULL.
- *    
- *    clientCB:
- *      Function pointer will be called upon registration failure or
- *      upon resolution completion.  In the case of resolution, this
- *      callback may be called multiple times if there is more than one
- *      address for a service.  Passing NULL will remove the client
- *      from the entity and cancel any outstanding activity.
- *    
- *    clientContext:
- *      Client contextual information to be used when calling clientCB.
- *      Passing NULL will remove the client from the entity and cancel
- *      any outstanding activity.
+ *	
+ *	theService:
+ *	  The service to set up for asynchronous mode.  Must be non-NULL.
+ *	
+ *	clientCB:
+ *	  Function pointer will be called upon registration failure or
+ *	  upon resolution completion.  In the case of resolution, this
+ *	  callback may be called multiple times if there is more than one
+ *	  address for a service.  Passing NULL will remove the client
+ *	  from the entity and cancel any outstanding activity.
+ *	
+ *	clientContext:
+ *	  Client contextual information to be used when calling clientCB.
+ *	  Passing NULL will remove the client from the entity and cancel
+ *	  any outstanding activity.
  *  
  *  Result:
- *    Returns FALSE if the client could not be set, TRUE otherwise.
+ *	Returns FALSE if the client could not be set, TRUE otherwise.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceSetClient( theService: CFNetServiceRef; clientCB: CFNetServiceClientCallBack { can be NULL }; clientContext: CFNetServiceClientContextPtr { can be NULL } ): Boolean; external name '_CFNetServiceSetClient';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceScheduleWithRunLoop()
  *  
  *  Discussion:
- *    Schedule the given service on the given run loop and mode.
+ *	Schedule the given service on the given run loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The service which is set up for asynchronous mode. Must be
- *      non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop on which the service should be
- *      scheduled. Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode on which to schedule the service.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The service which is set up for asynchronous mode. Must be
+ *	  non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop on which the service should be
+ *	  scheduled. Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode on which to schedule the service.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceScheduleWithRunLoop( theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceScheduleWithRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceUnscheduleFromRunLoop()
  *  
  *  Discussion:
- *    Unschedule the given service from the given run loop and mode.
+ *	Unschedule the given service from the given run loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The service which is set up for asynchronous mode.  Must be
- *      non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop from which the service should be
- *      unscheduled.  Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode from which to unschedule the service.  Must be
- *      non-NULL.
+ *	
+ *	theService:
+ *	  The service which is set up for asynchronous mode.  Must be
+ *	  non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop from which the service should be
+ *	  unscheduled.  Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode from which to unschedule the service.  Must be
+ *	  non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceUnscheduleFromRunLoop( theService: CFNetServiceRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceUnscheduleFromRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorCreate()
  *  
  *  Discussion:
- *    Creates an instance of an object suitable for watching for
- *    CFNetService record changes on the network.
+ *	Creates an instance of an object suitable for watching for
+ *	CFNetService record changes on the network.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CFAllocator which should be used to allocate memory for the
- *      monitor and its storage for values. If this reference is not a
- *      valid CFAllocator, the behavior is undefined.
- *    
- *    theService:
- *      The CFNetService to be monitored for record changes.
- *    
- *    clientCB:
- *      Function pointer that will be called as record changes occur. 
- *      Must be non-NULL.
- *    
- *    clientContext:
- *      Client contextual information to be used when calling clientCB.
- *       Must be non-NULL.
+ *	
+ *	alloc:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  monitor and its storage for values. If this reference is not a
+ *	  valid CFAllocator, the behavior is undefined.
+ *	
+ *	theService:
+ *	  The CFNetService to be monitored for record changes.
+ *	
+ *	clientCB:
+ *	  Function pointer that will be called as record changes occur. 
+ *	  Must be non-NULL.
+ *	
+ *	clientContext:
+ *	  Client contextual information to be used when calling clientCB.
+ *	   Must be non-NULL.
  *  
  *  Result:
- *    Returns a new instance of a CFNetServiceMonitor, or NULL if the
- *    object could not be created.
+ *	Returns a new instance of a CFNetServiceMonitor, or NULL if the
+ *	object could not be created.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceMonitorCreate( alloc: CFAllocatorRef; theService: CFNetServiceRef; clientCB: CFNetServiceMonitorClientCallBack; var clientContext: CFNetServiceClientContext ): CFNetServiceMonitorRef; external name '_CFNetServiceMonitorCreate';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorInvalidate()
  *  
  *  Discussion:
- *    Invalidates the given monitor object so that it may no longer be
- *    scheduled and callback never be called.  This will also stop any
- *    monitors currently in progress.
+ *	Invalidates the given monitor object so that it may no longer be
+ *	scheduled and callback never be called.  This will also stop any
+ *	monitors currently in progress.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    monitor:
- *      CFNetServiceMonitor to invalidate.  Must be non-NULL.
+ *	
+ *	monitor:
+ *	  CFNetServiceMonitor to invalidate.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceMonitorInvalidate( monitor: CFNetServiceMonitorRef ); external name '_CFNetServiceMonitorInvalidate';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorStart()
  *  
  *  Discussion:
- *    Starts monitoring for record changes on a service.  It watches
- *    for changes of the given record type.  If there is already an
- *    outstanding monitor, it will return FALSE.  In synchronous mode,
- *    this call blocks until the monitor is stopped. It will return
- *    FALSE if there is an error performing the monitor or if there is
- *    some other error.  It will return TRUE otherwise.  In
- *    asynchronous mode, this call will return TRUE or FALSE depending
- *    if the underlying network query could be instantiated.
+ *	Starts monitoring for record changes on a service.  It watches
+ *	for changes of the given record type.  If there is already an
+ *	outstanding monitor, it will return FALSE.  In synchronous mode,
+ *	this call blocks until the monitor is stopped. It will return
+ *	FALSE if there is an error performing the monitor or if there is
+ *	some other error.  It will return TRUE otherwise.  In
+ *	asynchronous mode, this call will return TRUE or FALSE depending
+ *	if the underlying network query could be instantiated.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    monitor:
- *      CFNetServiceMonitor to perform the watch.
- *    
- *    recordType:
- *      CFNetServiceMonitorType indicating the record type to watch.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	monitor:
+ *	  CFNetServiceMonitor to perform the watch.
+ *	
+ *	recordType:
+ *	  CFNetServiceMonitorType indicating the record type to watch.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if an error occurs during a synchronous monitor or
- *    if the monitor could not start.  It returns TRUE otherwise.
+ *	Returns FALSE if an error occurs during a synchronous monitor or
+ *	if the monitor could not start.  It returns TRUE otherwise.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceMonitorStart( monitor: CFNetServiceMonitorRef; recordType: CFNetServiceMonitorType; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceMonitorStart';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorStop()
  *  
  *  Discussion:
- *    Stops an outstanding monitor.
+ *	Stops an outstanding monitor.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    monitor:
- *      CFNetServiceMonitor with an active monitor.  Must be non-NULL.
- *    
- *    error:
- *      Error value to be returned in "error" in
- *      CFNetServiceMonitorStart if monitor is being performed in
- *      synchronous mode.  In this case, a non-zero of the error field
- *      of the struct will cause CFNetServiceMonitorStart to return
- *      FALSE.  In asynchronous mode, the client call back will be
- *      called with this error.
+ *	
+ *	monitor:
+ *	  CFNetServiceMonitor with an active monitor.  Must be non-NULL.
+ *	
+ *	error:
+ *	  Error value to be returned in "error" in
+ *	  CFNetServiceMonitorStart if monitor is being performed in
+ *	  synchronous mode.  In this case, a non-zero of the error field
+ *	  of the struct will cause CFNetServiceMonitorStart to return
+ *	  FALSE.  In asynchronous mode, the client call back will be
+ *	  called with this error.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceMonitorStop( monitor: CFNetServiceMonitorRef; error: CFStreamErrorPtr { can be NULL } ); external name '_CFNetServiceMonitorStop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorScheduleWithRunLoop()
  *  
  *  Discussion:
- *    Schedules the monitor on a run loop and mode.  Use this to place
- *    the given monitor into asynchronous mode.  The client callback
- *    will be triggered via one of the scheduled run loops; It is the
- *    caller's responsibility to ensure that at least one of the
- *    scheduled run loops is being run.
+ *	Schedules the monitor on a run loop and mode.  Use this to place
+ *	the given monitor into asynchronous mode.  The client callback
+ *	will be triggered via one of the scheduled run loops; It is the
+ *	caller's responsibility to ensure that at least one of the
+ *	scheduled run loops is being run.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    monitor:
- *      CFNetServiceMonitor to schedule.  Must be non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop on which the monitor should be
- *      scheduled.  Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode on which to schedule the monitor.  Must be non-NULL.
+ *	
+ *	monitor:
+ *	  CFNetServiceMonitor to schedule.  Must be non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop on which the monitor should be
+ *	  scheduled.  Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode on which to schedule the monitor.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceMonitorScheduleWithRunLoop( monitor: CFNetServiceMonitorRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceMonitorScheduleWithRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceMonitorUnscheduleFromRunLoop()
  *  
  *  Discussion:
- *    Unschedules the browser from a run loop and mode.
+ *	Unschedules the browser from a run loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    monitor:
- *      CFNetServiceMonitor to unschedule.  Must be non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop from which the monitor should be
- *      unscheduled. Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode from which to unschedule the monitor.  Must be
- *      non-NULL.
+ *	
+ *	monitor:
+ *	  CFNetServiceMonitor to unschedule.  Must be non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop from which the monitor should be
+ *	  unscheduled. Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode from which to unschedule the monitor.  Must be
+ *	  non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.4 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.4 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceMonitorUnscheduleFromRunLoop( monitor: CFNetServiceMonitorRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceMonitorUnscheduleFromRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserCreate()
  *  
  *  Discussion:
- *    Creates an instance of a browser object.
+ *	Creates an instance of a browser object.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    alloc:
- *      The CFAllocator which should be used to allocate memory for the
- *      browser and its storage for values. If this reference is not a
- *      valid CFAllocator, the behavior is undefined.
- *    
- *    clientCB:
- *      Function pointer that will be called as domains or services are
- *      found on the network.  Must be non-NULL.
- *    
- *    clientContext:
- *      Client contextual information to be used when calling clientCB.
- *      Must be non-NULL.
+ *	
+ *	alloc:
+ *	  The CFAllocator which should be used to allocate memory for the
+ *	  browser and its storage for values. If this reference is not a
+ *	  valid CFAllocator, the behavior is undefined.
+ *	
+ *	clientCB:
+ *	  Function pointer that will be called as domains or services are
+ *	  found on the network.  Must be non-NULL.
+ *	
+ *	clientContext:
+ *	  Client contextual information to be used when calling clientCB.
+ *	  Must be non-NULL.
  *  
  *  Result:
- *    Returns a new instance of a browser, or NULL if the instance
- *    could not be created.
+ *	Returns a new instance of a browser, or NULL if the instance
+ *	could not be created.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceBrowserCreate( alloc: CFAllocatorRef; clientCB: CFNetServiceBrowserClientCallBack; var clientContext: CFNetServiceClientContext ): CFNetServiceBrowserRef; external name '_CFNetServiceBrowserCreate';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserInvalidate()
  *  
  *  Discussion:
- *    Invalidates the given browser object so that it may no longer be
- *    scheduled and callback never be called.  This will also stop any
- *    searches currently in progress.
+ *	Invalidates the given browser object so that it may no longer be
+ *	scheduled and callback never be called.  This will also stop any
+ *	searches currently in progress.
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser to invalidate.  Must be non-NULL.
+ *	
+ *	browser:
+ *	  Network Service Browser to invalidate.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceBrowserInvalidate( browser: CFNetServiceBrowserRef ); external name '_CFNetServiceBrowserInvalidate';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserSearchForDomains()
  *  
  *  Discussion:
- *    Starts a search for domains.  The browser will either try to find
- *    "Browse" domains or will search for "Registration" domains.  If
- *    there is already an outstanding search, it will return FALSE.  In
- *    syncronous mode, this call blocks until the search is stopped. 
- *    It will return FALSE if there is an error performing the search.
- *    It will return TRUE otherwise.  In asynchronous mode, this call
- *    will return TRUE or FALSE depending if the underlying network
- *    search could be started.
+ *	Starts a search for domains.  The browser will either try to find
+ *	"Browse" domains or will search for "Registration" domains.  If
+ *	there is already an outstanding search, it will return FALSE.  In
+ *	syncronous mode, this call blocks until the search is stopped. 
+ *	It will return FALSE if there is an error performing the search.
+ *	It will return TRUE otherwise.  In asynchronous mode, this call
+ *	will return TRUE or FALSE depending if the underlying network
+ *	search could be started.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser to perform the search.  Must be
- *      non-NULL.
- *    
- *    registrationDomains:
- *      FALSE if "Browse" domains are to be discovered. TRUE if only
- *      "Registration" domains are to be discovered.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	browser:
+ *	  Network Service Browser to perform the search.  Must be
+ *	  non-NULL.
+ *	
+ *	registrationDomains:
+ *	  FALSE if "Browse" domains are to be discovered. TRUE if only
+ *	  "Registration" domains are to be discovered.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if an error occurs during a synchronous search or
- *    if the search could not start.  It returns TRUE otherwise.
+ *	Returns FALSE if an error occurs during a synchronous search or
+ *	if the search could not start.  It returns TRUE otherwise.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceBrowserSearchForDomains( browser: CFNetServiceBrowserRef; registrationDomains: Boolean; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceBrowserSearchForDomains';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserSearchForServices()
  *  
  *  Discussion:
- *    Starts a search for a service type on the given domain.  If there
- *    is already an outstanding search, it will return FALSE.  In
- *    syncronous mode, this call blocks until the search is stopped. 
- *    It will return FALSE if there is an error performing the search
- *    or if there is some other error.  It will return TRUE otherwise.
- *    In asynchronous mode, this call will return TRUE or FALSE
- *    depending if the underlying network search could be instantiated.
+ *	Starts a search for a service type on the given domain.  If there
+ *	is already an outstanding search, it will return FALSE.  In
+ *	syncronous mode, this call blocks until the search is stopped. 
+ *	It will return FALSE if there is an error performing the search
+ *	or if there is some other error.  It will return TRUE otherwise.
+ *	In asynchronous mode, this call will return TRUE or FALSE
+ *	depending if the underlying network search could be instantiated.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser to perform the search.  Must be
- *      non-NULL.
- *    
- *    domain:
- *      Network domain to search in order to find the service.  Must be
- *      non-NULL.
- *    
- *    serviceType:
- *      Service type for which to search.  Must be non-NULL.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	browser:
+ *	  Network Service Browser to perform the search.  Must be
+ *	  non-NULL.
+ *	
+ *	domain:
+ *	  Network domain to search in order to find the service.  Must be
+ *	  non-NULL.
+ *	
+ *	serviceType:
+ *	  Service type for which to search.  Must be non-NULL.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if an error occurs during a synchronous search or
- *    if the search could not start.  It returns TRUE otherwise.
+ *	Returns FALSE if an error occurs during a synchronous search or
+ *	if the search could not start.  It returns TRUE otherwise.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceBrowserSearchForServices( browser: CFNetServiceBrowserRef; domain: CFStringRef; serviceType: CFStringRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceBrowserSearchForServices';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserStopSearch()
  *  
  *  Discussion:
- *    Stops an outstanding browser search.
+ *	Stops an outstanding browser search.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser performing the search.  Must be
- *      non-NULL.
- *    
- *    error:
- *      Error value to be returned in "error" in
- *      CFNetServiceBrowserStartServiceSearch if search is being
- *      performed in synchronous mode.  In this case, a non-zero of the
- *      error field of the struct will cause
- *      CFNetServiceBrowserStartServiceSearch to return FALSE. In
- *      asynchronous mode, the client call back will be called with
- *      this error.
+ *	
+ *	browser:
+ *	  Network Service Browser performing the search.  Must be
+ *	  non-NULL.
+ *	
+ *	error:
+ *	  Error value to be returned in "error" in
+ *	  CFNetServiceBrowserStartServiceSearch if search is being
+ *	  performed in synchronous mode.  In this case, a non-zero of the
+ *	  error field of the struct will cause
+ *	  CFNetServiceBrowserStartServiceSearch to return FALSE. In
+ *	  asynchronous mode, the client call back will be called with
+ *	  this error.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceBrowserStopSearch( browser: CFNetServiceBrowserRef; error: CFStreamErrorPtr { can be NULL } ); external name '_CFNetServiceBrowserStopSearch';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserScheduleWithRunLoop()
  *  
  *  Discussion:
- *    Schedules the browser on a run loop and mode.  Use this to place
- *    the given browser into asynchronous mode.  The client callback
- *    will be triggered via one of the scheduled run loops; It is the
- *    caller's responsibility to ensure that at least one of the
- *    scheduled run loops is being run.
+ *	Schedules the browser on a run loop and mode.  Use this to place
+ *	the given browser into asynchronous mode.  The client callback
+ *	will be triggered via one of the scheduled run loops; It is the
+ *	caller's responsibility to ensure that at least one of the
+ *	scheduled run loops is being run.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser to schedule.  Must be non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop on which the browser should be
- *      scheduled.  Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode on which to schedule the browser.  Must be non-NULL.
+ *	
+ *	browser:
+ *	  Network Service Browser to schedule.  Must be non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop on which the browser should be
+ *	  scheduled.  Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode on which to schedule the browser.  Must be non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceBrowserScheduleWithRunLoop( browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceBrowserScheduleWithRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
 
 {
  *  CFNetServiceBrowserUnscheduleFromRunLoop()
  *  
  *  Discussion:
- *    Unschedules the browser from a run loop and mode.
+ *	Unschedules the browser from a run loop and mode.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    browser:
- *      Network Service Browser to unschedule.  Must be non-NULL.
- *    
- *    runLoop:
- *      A reference to a runloop from which the browser should be
- *      unscheduled. Must be non-NULL.
- *    
- *    runLoopMode:
- *      The mode from which to unschedule the browser.  Must be
- *      non-NULL.
+ *	
+ *	browser:
+ *	  Network Service Browser to unschedule.  Must be non-NULL.
+ *	
+ *	runLoop:
+ *	  A reference to a runloop from which the browser should be
+ *	  unscheduled. Must be non-NULL.
+ *	
+ *	runLoopMode:
+ *	  The mode from which to unschedule the browser.  Must be
+ *	  non-NULL.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceBrowserUnscheduleFromRunLoop( browser: CFNetServiceBrowserRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFNetServiceBrowserUnscheduleFromRunLoop';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
-
+(* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
 
+{$ifc TARGET_OS_MAC}
 {
  *  CFNetServiceRegister()   *** DEPRECATED ***
  *  
  *  Discussion:
- *    Registers the entity on the network.  This requires that the
- *    service has a domain, a type, a name, and a port.  The service is
- *    registered on the network until this function returns or is
- *    cancelled by calling CFNetServiceCancel.  In synchronous mode,
- *    this function will block until there is an error or it is
- *    cancelled from another thread.  In asynchronous mode, this
- *    function returns immediately and the underlying network
- *    registration process will start. 
- *    
- *    As a result of new, better performing API's in Service Discovery,
- *    users should now call CFNetServiceRegisterWithOptions.  Using the
- *    new calls will allow your application to perform better on the
- *    network.
+ *	Registers the entity on the network.  This requires that the
+ *	service has a domain, a type, a name, and a port.  The service is
+ *	registered on the network until this function returns or is
+ *	cancelled by calling CFNetServiceCancel.  In synchronous mode,
+ *	this function will block until there is an error or it is
+ *	cancelled from another thread.  In asynchronous mode, this
+ *	function returns immediately and the underlying network
+ *	registration process will start. 
+ *	
+ *	As a result of new, better performing API's in Service Discovery,
+ *	users should now call CFNetServiceRegisterWithOptions.  Using the
+ *	new calls will allow your application to perform better on the
+ *	network.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to register on the network.  Must be
- *      non-NULL.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	theService:
+ *	  The Network Service to register on the network.  Must be
+ *	  non-NULL.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if domain, type, name or port is NULL.  In
- *    synchronous mode, it will always return FALSE as a result of the
- *    error or the cancellation.  In asynchronous mode, it will return
- *    TRUE if the registration process could start.
+ *	Returns FALSE if domain, type, name or port is NULL.  In
+ *	synchronous mode, it will always return FALSE as a result of the
+ *	error or the cancellation.  In asynchronous mode, it will return
+ *	TRUE if the registration process could start.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework but deprecated in 10.4
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework but deprecated in 10.4
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceRegister( theService: CFNetServiceRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceRegister';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
 
 
 {
  *  CFNetServiceResolve()   *** DEPRECATED ***
  *  
  *  Discussion:
- *    Resolves the addressing for the given service.  This requires
- *    that the service has a domain, a type, and a name.  The service
- *    is  resolved on the network until this function returns or is
- *    cancelled by calling CFNetServiceCancel. In synchronous mode,
- *    this function will block until there is an error or it is
- *    cancelled from another thread.  In asynchronous mode, this
- *    function returns immediately and the underlying network
- *    resolution process will start. 
- *    
- *    As a result of new, better performing API's in Service Discovery,
- *    users should now call CFNetServiceResolveWithTimeout.  If needing
- *    to monitor TXT record changes, users should use the new
- *    CFNetServiceMonitor object. Using the new calls will allow your
- *    application to perform better on the network.
+ *	Resolves the addressing for the given service.  This requires
+ *	that the service has a domain, a type, and a name.  The service
+ *	is  resolved on the network until this function returns or is
+ *	cancelled by calling CFNetServiceCancel. In synchronous mode,
+ *	this function will block until there is an error or it is
+ *	cancelled from another thread.  In asynchronous mode, this
+ *	function returns immediately and the underlying network
+ *	resolution process will start. 
+ *	
+ *	As a result of new, better performing API's in Service Discovery,
+ *	users should now call CFNetServiceResolveWithTimeout.  If needing
+ *	to monitor TXT record changes, users should use the new
+ *	CFNetServiceMonitor object. Using the new calls will allow your
+ *	application to perform better on the network.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to resolve on the network.  Must be
- *      non-NULL.
- *    
- *    error:
- *      A reference to an error struct which will be set to the error
- *      and domain of the error should one occur.  If the value of
- *      error is not desired, set to NULL.
+ *	
+ *	theService:
+ *	  The Network Service to resolve on the network.  Must be
+ *	  non-NULL.
+ *	
+ *	error:
+ *	  A reference to an error struct which will be set to the error
+ *	  and domain of the error should one occur.  If the value of
+ *	  error is not desired, set to NULL.
  *  
  *  Result:
- *    Returns FALSE if domain, type, or name is NULL.  In synchronous
- *    mode, it will return FALSE as a result of an error or a
- *    cancellation.  It will return TRUE if the resolution does
- *    succeed.  In asynchronous mode, it will return TRUE if the
- *    resolution process could start.
+ *	Returns FALSE if domain, type, or name is NULL.  In synchronous
+ *	mode, it will return FALSE as a result of an error or a
+ *	cancellation.  It will return TRUE if the resolution does
+ *	succeed.  In asynchronous mode, it will return TRUE if the
+ *	resolution process could start.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework but deprecated in 10.4
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework but deprecated in 10.4
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceResolve( theService: CFNetServiceRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFNetServiceResolve';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
 
 
 {
  *  CFNetServiceGetProtocolSpecificInformation()   *** DEPRECATED ***
  *  
  *  Discussion:
- *    Query a Network Service for its protocol specific information.
- *    
- *    
- *    As a result of new, better performing API's in Service Discovery,
- *    users should now call CFNetServiceGetTXTData.  If needing to
- *    monitor TXT record changes, users should use the new
- *    CFNetServiceMonitor object. Using the new calls will allow your
- *    application to perform better on the network.
+ *	Query a Network Service for its protocol specific information.
+ *	
+ *	
+ *	As a result of new, better performing API's in Service Discovery,
+ *	users should now call CFNetServiceGetTXTData.  If needing to
+ *	monitor TXT record changes, users should use the new
+ *	CFNetServiceMonitor object. Using the new calls will allow your
+ *	application to perform better on the network.
  *  
  *  Mac OS X threading:
- *    Thread safe
- *    The function gets the data in a thread-safe manner, but the
- *    resulting data is not safe.  Since it is returned as a matter of
- *    a get opposed to a copy, the data is not safe if the service is
- *    being altered from another thread.
+ *	Thread safe
+ *	The function gets the data in a thread-safe manner, but the
+ *	resulting data is not safe.  Since it is returned as a matter of
+ *	a get opposed to a copy, the data is not safe if the service is
+ *	being altered from another thread.
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
  *  
  *  Result:
- *    Returns NULL if a resolve has not been performed or if
- *    CFNetServiceSetProtocolSpecificInformation has not been called. 
- *    It will return a CFStringRef containing the specific information
- *    if there is some.
+ *	Returns NULL if a resolve has not been performed or if
+ *	CFNetServiceSetProtocolSpecificInformation has not been called. 
+ *	It will return a CFStringRef containing the specific information
+ *	if there is some.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework but deprecated in 10.4
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework but deprecated in 10.4
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetServiceGetProtocolSpecificInformation( theService: CFNetServiceRef ): CFStringRef; external name '_CFNetServiceGetProtocolSpecificInformation';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
 
 
 {
  *  CFNetServiceSetProtocolSpecificInformation()   *** DEPRECATED ***
  *  
  *  Discussion:
- *    Set a Network Service's protocol specific information. 
- *    
- *    As a result of new, better performing API's in Service Discovery,
- *    users should now call CFNetServiceSetTXTData.  Using the new
- *    calls will allow your application to perform better on the
- *    network.
+ *	Set a Network Service's protocol specific information. 
+ *	
+ *	As a result of new, better performing API's in Service Discovery,
+ *	users should now call CFNetServiceSetTXTData.  Using the new
+ *	calls will allow your application to perform better on the
+ *	network.
  *  
  *  Mac OS X threading:
- *    Thread safe
+ *	Thread safe
  *  
  *  Parameters:
- *    
- *    theService:
- *      The Network Service to be queried.  Must be non-NULL.
- *    
- *    theInfo:
- *      The protocol specific information to be added.  Pass NULL to
- *      remove the information from the service.
+ *	
+ *	theService:
+ *	  The Network Service to be queried.  Must be non-NULL.
+ *	
+ *	theInfo:
+ *	  The protocol specific information to be added.  Pass NULL to
+ *	  remove the information from the service.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.2 and later in CoreServices.framework but deprecated in 10.4
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.2 and later in CoreServices.framework but deprecated in 10.4
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 procedure CFNetServiceSetProtocolSpecificInformation( theService: CFNetServiceRef; theInfo: CFStringRef ); external name '_CFNetServiceSetProtocolSpecificInformation';
-(* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
+(* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_4,__IPHONE_NA,__IPHONE_NA) *)
+
+
+{$endc} {TARGET_OS_MAC}
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 271 - 102
packages/univint/src/CFNetworkErrorss.pas

@@ -1,22 +1,25 @@
 {
-     File:       CFNetwork/CFNetworkErrors.h
+	 File:	   CFNetwork/CFNetworkErrors.h
  
-     Contains:   CFNetwork error header
+	 Contains:   CFNetwork error header
  
-     Version:    CFNetwork-219~1
+	 Copyright:  Copyright (c) 2006-2008, Apple Inc. All rights reserved.
  
-     Copyright:  © 2006 by Apple Computer, Inc., all rights reserved
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
+ 
+					 http://www.freepascal.org/bugs.html
  
 }
-
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -25,8 +28,8 @@
 
 unit CFNetworkErrorss;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -39,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -56,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -89,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -100,6 +175,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 {GRP translation note: Double 's' unit name ending intentional to avoid GPC redeclaration error with 'CFNetworkErrors' type identifier.}
@@ -108,173 +185,265 @@ uses MacTypes, CFBase;
  *  kCFErrorDomainCFNetwork
  *  
  *  Discussion:
- *    Error domain for all errors originating in CFNetwork. Error codes
- *    may be interpreted using the list below.
+ *	Error domain for all errors originating in CFNetwork. Error codes
+ *	may be interpreted using the list below.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFErrorDomainCFNetwork: CFStringRef; external name '_kCFErrorDomainCFNetwork'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFErrorDomainWinSock
  *  
  *  Discussion:
- *    On Windows, errors originating from WinSock are represented using
- *    this domain.
+ *	On Windows, errors originating from WinSock are represented using
+ *	this domain.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFErrorDomainWinSock: CFStringRef; external name '_kCFErrorDomainWinSock'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 
 {
  *  CFNetworkErrors
  *  
  *  Discussion:
- *    The list of all error codes returned under the error domain
- *    kCFErrorDomainCFNetwork
+ *	The list of all public error codes returned under the error domain
+ *	kCFErrorDomainCFNetwork
  }
 type
 	CFNetworkErrors = SInt32;
 const
-	kCFHostErrorHostNotFound                   = 1;
-	kCFHostErrorUnknown                        = 2;    { Query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h}
-                                                       { SOCKS errors; in all cases you may query kCFSOCKSStatusCodeKey to recover the status code returned by the server}
-	kCFSOCKSErrorUnknownClientVersion          = 100;
-	kCFSOCKSErrorUnsupportedServerVersion      = 101; { Query the kCFSOCKSVersionKey to find the version requested by the server}
-                                                       { SOCKS4-specific errors}
-	kCFSOCKS4ErrorRequestFailed                = 110;  { request rejected or failed by the server}
-	kCFSOCKS4ErrorIdentdFailed                 = 111;  { request rejected because SOCKS server cannot connect to identd on the client}
-	kCFSOCKS4ErrorIdConflict                   = 112;  { request rejected because the client program and identd report different user-ids}
-	kCFSOCKS4ErrorUnknownStatusCode            = 113; { SOCKS5-specific errors}
-	kCFSOCKS5ErrorBadState                     = 120;
-	kCFSOCKS5ErrorBadResponseAddr              = 121;
-	kCFSOCKS5ErrorBadCredentials               = 122;
-	kCFSOCKS5ErrorUnsupportedNegotiationMethod = 123; { query kCFSOCKSNegotiationMethodKey to find the method requested}
-	kCFSOCKS5ErrorNoAcceptableMethod           = 124; { Errors originating from CFNetServices}
-	kCFNetServiceErrorUnknown                  = -72000;
-	kCFNetServiceErrorCollision                = -72001;
-	kCFNetServiceErrorNotFound                 = -72002;
-	kCFNetServiceErrorInProgress               = -72003;
-	kCFNetServiceErrorBadArgument              = -72004;
-	kCFNetServiceErrorCancel                   = -72005;
-	kCFNetServiceErrorInvalid                  = -72006;
-	kCFNetServiceErrorTimeout                  = -72007;
-	kCFNetServiceErrorDNSServiceFailure        = -73000; { An error from DNS discovery; look at kCFDNSServiceFailureKey to get the error number and interpret using dns_sd.h}
-                                                      { FTP errors; query the kCFFTPStatusCodeKey to get the status code returned by the server}
-	kCFFTPErrorUnexpectedStatusCode            = 200; { HTTP errors}
-	kCFErrorHTTPAuthenticationTypeUnsupported  = 300;
-	kCFErrorHTTPBadCredentials                 = 301;
-	kCFErrorHTTPConnectionLost                 = 302;
-	kCFErrorHTTPParseFailure                   = 303;
-	kCFErrorHTTPRedirectionLoopDetected        = 304;
-	kCFErrorHTTPBadURL                         = 305;
-	kCFErrorHTTPProxyConnectionFailure         = 306;
-	kCFErrorHTTPBadProxyCredentials            = 307;
+	kCFHostErrorHostNotFound = 1;
+	kCFHostErrorUnknown = 2; // Query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h
+  // SOCKS errors; in all cases you may query kCFSOCKSStatusCodeKey to recover the status code returned by the server
+	kCFSOCKSErrorUnknownClientVersion = 100;
+	kCFSOCKSErrorUnsupportedServerVersion = 101; // Query the kCFSOCKSVersionKey to find the version requested by the server
+  // SOCKS4-specific errors
+	kCFSOCKS4ErrorRequestFailed = 110;  // request rejected or failed by the server
+	kCFSOCKS4ErrorIdentdFailed = 111;  // request rejected because SOCKS server cannot connect to identd on the client
+	kCFSOCKS4ErrorIdConflict = 112;  // request rejected because the client program and identd report different user-ids
+	kCFSOCKS4ErrorUnknownStatusCode = 113;
+  // SOCKS5-specific errors
+	kCFSOCKS5ErrorBadState = 120;
+	kCFSOCKS5ErrorBadResponseAddr = 121;
+	kCFSOCKS5ErrorBadCredentials = 122;
+	kCFSOCKS5ErrorUnsupportedNegotiationMethod = 123; // query kCFSOCKSNegotiationMethodKey to find the method requested
+	kCFSOCKS5ErrorNoAcceptableMethod = 124;
+  // FTP errors; query the kCFFTPStatusCodeKey to get the status code returned by the server
+	kCFFTPErrorUnexpectedStatusCode = 200;
+  // HTTP errors
+	kCFErrorHTTPAuthenticationTypeUnsupported = 300;
+	kCFErrorHTTPBadCredentials = 301;
+	kCFErrorHTTPConnectionLost = 302;
+	kCFErrorHTTPParseFailure = 303;
+	kCFErrorHTTPRedirectionLoopDetected = 304;
+	kCFErrorHTTPBadURL = 305;
+	kCFErrorHTTPProxyConnectionFailure = 306;
+	kCFErrorHTTPBadProxyCredentials = 307;
+	kCFErrorPACFileError = 308;
+	kCFErrorPACFileAuth = 309;
+	kCFErrorHTTPSProxyConnectionFailure = 310;
+	
+  // Error codes for CFURLConnection and CFURLProtocol
+	kCFURLErrorUnknown = -998;
+	kCFURLErrorCancelled = -999;
+	kCFURLErrorBadURL = -1000;
+	kCFURLErrorTimedOut = -1001;
+	kCFURLErrorUnsupportedURL = -1002;
+	kCFURLErrorCannotFindHost = -1003;
+	kCFURLErrorCannotConnectToHost = -1004;
+	kCFURLErrorNetworkConnectionLost = -1005;
+	kCFURLErrorDNSLookupFailed = -1006;
+	kCFURLErrorHTTPTooManyRedirects = -1007;
+	kCFURLErrorResourceUnavailable = -1008;
+	kCFURLErrorNotConnectedToInternet = -1009;
+	kCFURLErrorRedirectToNonExistentLocation = -1010;
+	kCFURLErrorBadServerResponse = -1011;
+	kCFURLErrorUserCancelledAuthentication = -1012;
+	kCFURLErrorUserAuthenticationRequired = -1013;
+	kCFURLErrorZeroByteResource = -1014;
+	kCFURLErrorCannotDecodeRawData = -1015;
+	kCFURLErrorCannotDecodeContentData = -1016;
+	kCFURLErrorCannotParseResponse = -1017;
+	kCFURLErrorInternationalRoamingOff = -1018;
+	kCFURLErrorCallIsActive = -1019;
+	kCFURLErrorDataNotAllowed = -1020;
+	kCFURLErrorRequestBodyStreamExhausted = -1021;
+	kCFURLErrorFileDoesNotExist = -1100;
+	kCFURLErrorFileIsDirectory = -1101;
+	kCFURLErrorNoPermissionsToReadFile = -1102;
+	kCFURLErrorDataLengthExceedsMaximum = -1103;
+  // SSL errors
+	kCFURLErrorSecureConnectionFailed = -1200;
+	kCFURLErrorServerCertificateHasBadDate = -1201;
+	kCFURLErrorServerCertificateUntrusted = -1202;
+	kCFURLErrorServerCertificateHasUnknownRoot = -1203;
+	kCFURLErrorServerCertificateNotYetValid = -1204;
+	kCFURLErrorClientCertificateRejected = -1205;
+	kCFURLErrorClientCertificateRequired = -1206;
+	kCFURLErrorCannotLoadFromNetwork = -2000;
+  // Download and file I/O errors
+	kCFURLErrorCannotCreateFile = -3000;
+	kCFURLErrorCannotOpenFile = -3001;
+	kCFURLErrorCannotCloseFile = -3002;
+	kCFURLErrorCannotWriteToFile = -3003;
+	kCFURLErrorCannotRemoveFile = -3004;
+	kCFURLErrorCannotMoveFile = -3005;
+	kCFURLErrorDownloadDecodingFailedMidStream = -3006;
+	kCFURLErrorDownloadDecodingFailedToComplete = -3007;
+	
+  // Cookie errors
+	kCFHTTPCookieCannotParseCookieFile = -4000;
+
+  // Errors originating from CFNetServices
+	kCFNetServiceErrorUnknown = -72000;
+	kCFNetServiceErrorCollision = -72001;
+	kCFNetServiceErrorNotFound = -72002;
+	kCFNetServiceErrorInProgress = -72003;
+	kCFNetServiceErrorBadArgument = -72004;
+	kCFNetServiceErrorCancel = -72005;
+	kCFNetServiceErrorInvalid = -72006;
+	kCFNetServiceErrorTimeout = -72007;
+	kCFNetServiceErrorDNSServiceFailure = -73000; // An error from DNS discovery; look at kCFDNSServiceFailureKey to get the error number and interpret using dns_sd.h	
 
 
 { Keys used by CFNetwork to pass additional error information back to the user within CFError's userInfo dictionary }
+{
+ *  kCFURLErrorFailingURLErrorKey
+ *  
+ *  Discussion:
+ *	When an NSURLConnection or NSURLDownload error occurs, this key's
+ *  value is set to the URL which caused a load to fail
+ *  
+ *  Availability:
+ *	Mac OS X:		 in version 10.6 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
+ }
+var kCFURLErrorFailingURLErrorKey: CFStringRef; external name '_kCFURLErrorFailingURLErrorKey'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_2) *)
+
+{
+ *  kCFURLErrorFailingURLStringErrorKey
+ *  
+ *  Discussion:
+ *	When an NSURLConnection or NSURLDownload error occurs, this key's
+ *  value is set to the CFString value of the URL which caused a load
+ *  to fail
+ *  
+ *  Availability:
+ *	Mac OS X:		 in version 10.6 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
+ }
+var kCFURLErrorFailingURLStringErrorKey: CFStringRef; external name '_kCFURLErrorFailingURLStringErrorKey'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_2) *)
+
 {
  *  kCFGetAddrInfoFailureKey
  *  
  *  Discussion:
- *    When an error of kCFHostErrorUnknown is returned, this key's
- *    value is set to a CFNumber containing the raw error value
- *    returned by getaddrinfo()
+ *	When an error of kCFHostErrorUnknown is returned, this key's
+ *	value is set to a CFNumber containing the raw error value
+ *	returned by getaddrinfo()
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFGetAddrInfoFailureKey: CFStringRef; external name '_kCFGetAddrInfoFailureKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFSOCKSStatusCodeKey
  *  
  *  Discussion:
- *    When a SOCKS failure has occurred, this key's value is set to a
- *    CFString containing the status value returned by the SOCKS server.
+ *	When a SOCKS failure has occurred, this key's value is set to a
+ *	CFString containing the status value returned by the SOCKS server.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFSOCKSStatusCodeKey: CFStringRef; external name '_kCFSOCKSStatusCodeKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFSOCKSVersionKey
  *  
  *  Discussion:
- *    When an error of kCFSOCKSErrorUnsupportedServerVersion is
- *    returned, this key's value is set to a CFString containing the
- *    version number requested by the server.
+ *	When an error of kCFSOCKSErrorUnsupportedServerVersion is
+ *	returned, this key's value is set to a CFString containing the
+ *	version number requested by the server.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFSOCKSVersionKey: CFStringRef; external name '_kCFSOCKSVersionKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFSOCKSNegotiationMethodKey
  *  
  *  Discussion:
- *    When an error of kCFSOCKS5ErrorUnsupportedNegotiationMethod is
- *    returned, this key's value is set to a CFString containing the
- *    negotiation method requested by the server.
+ *	When an error of kCFSOCKS5ErrorUnsupportedNegotiationMethod is
+ *	returned, this key's value is set to a CFString containing the
+ *	negotiation method requested by the server.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFSOCKSNegotiationMethodKey: CFStringRef; external name '_kCFSOCKSNegotiationMethodKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFDNSServiceFailureKey
  *  
  *  Discussion:
- *    When an error of kCFNetServicesErrorDNSServiceFailure is
- *    returned, this key's value is set to a CFNumber containing the
- *    value returned from DNS; interret it using the values dns_sd.h
+ *	When an error of kCFNetServicesErrorDNSServiceFailure is
+ *	returned, this key's value is set to a CFNumber containing the
+ *	value returned from DNS; interret it using the values dns_sd.h
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFDNSServiceFailureKey: CFStringRef; external name '_kCFDNSServiceFailureKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFFTPStatusCodeKey
  *  
  *  Discussion:
- *    When an error of kCFFTPErrorUnexpectedStatusCode is returned,
- *    this key's value is set to a CFString containing the status code
- *    returned by the server
+ *	When an error of kCFFTPErrorUnexpectedStatusCode is returned,
+ *	this key's value is set to a CFString containing the status code
+ *	returned by the server
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFFTPStatusCodeKey: CFStringRef; external name '_kCFFTPStatusCodeKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 95 - 14
packages/univint/src/CFNotificationCenter.pas

@@ -1,14 +1,17 @@
 {	CFNotificationCenter.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {	  Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {	  Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +20,8 @@
 
 unit CFNotificationCenter;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,25 +167,27 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFDictionary;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 type
-	CFNotificationCenterRef = ^SInt32; { an opaque 32-bit type }
+	CFNotificationCenterRef = ^SInt32; { an opaque type }
 
 type
 	CFNotificationCallback = procedure( center: CFNotificationCenterRef; observer: UnivPtr; name: CFStringRef; objct: {const} UnivPtr; userInfo: CFDictionaryRef );
 
 type
-	CFNotificationSuspensionBehavior = SInt32;
+	CFNotificationSuspensionBehavior = SIGNEDLONG;
 const
-    CFNotificationSuspensionBehaviorDrop = 1;
+	CFNotificationSuspensionBehaviorDrop = 1;
         // The server will not queue any notifications with this name and object while the process/app is in the background.
-    CFNotificationSuspensionBehaviorCoalesce = 2;
+	CFNotificationSuspensionBehaviorCoalesce = 2;
         // The server will only queue the last notification of the specified name and object; earlier notifications are dropped. 
-    CFNotificationSuspensionBehaviorHold = 3;
+	CFNotificationSuspensionBehaviorHold = 3;
         // The server will hold all matching notifications until the queue has been filled (queue size determined by the server) at which point the server may flush queued notifications.
-    CFNotificationSuspensionBehaviorDeliverImmediately = 4;
+	CFNotificationSuspensionBehaviorDeliverImmediately = 4;
         // The server will deliver notifications matching this registration whether or not the process is in the background.  When a notification with this suspension behavior is matched, it has the effect of first flushing any queued notifications.
 
 function CFNotificationCenterGetTypeID: CFTypeID; external name '_CFNotificationCenterGetTypeID';
@@ -118,7 +195,9 @@ function CFNotificationCenterGetTypeID: CFTypeID; external name '_CFNotification
 function CFNotificationCenterGetLocalCenter: CFNotificationCenterRef; external name '_CFNotificationCenterGetLocalCenter';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
 
+{$ifc TARGET_OS_MAC or TARGET_OS_WIN32}
 function CFNotificationCenterGetDistributedCenter: CFNotificationCenterRef; external name '_CFNotificationCenterGetDistributedCenter';
+{$endc}
 
 function CFNotificationCenterGetDarwinNotifyCenter: CFNotificationCenterRef; external name '_CFNotificationCenterGetDarwinNotifyCenter';
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
@@ -157,5 +236,7 @@ procedure CFNotificationCenterPostNotificationWithOptions( center: CFNotificatio
 
 {#endif}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 97 - 12
packages/univint/src/CFNumber.pas

@@ -1,13 +1,15 @@
 {	CFNumber.h
-	Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1999-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFNumber;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,11 +165,13 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 type
-	CFBooleanRef = ^SInt32; { an opaque 32-bit type }
+	CFBooleanRef = ^SInt32; { an opaque type }
 	CFBooleanRefPtr = ^CFBooleanRef;
 
 var kCFBooleanTrue: CFBooleanRef; external name '_kCFBooleanTrue'; (* attribute const *)
@@ -106,7 +182,7 @@ function CFBooleanGetTypeID: CFTypeID; external name '_CFBooleanGetTypeID';
 function CFBooleanGetValue( value: CFBooleanRef ): Boolean; external name '_CFBooleanGetValue';
 
 type
-	CFNumberType = SInt32;
+	CFNumberType = SIGNEDLONG;
 const
 																{  Types from MacTypes.h  }
 	kCFNumberSInt8Type = 1;
@@ -124,10 +200,17 @@ const
 	kCFNumberFloatType = 12;
 	kCFNumberDoubleType = 13;							{  Other  }
 	kCFNumberCFIndexType = 14;
-	kCFNumberMaxType = 14;
+  kCFNumberMaxType_MAC_OS_X_VERSION_PRE_10_5 = 14;
+{#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+  kCFNumberNSIntegerType = 15; (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+  kCFNumberCGFloatType = 16; (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+  kCFNumberMaxType = 16;
+{#else
+ kCFNumberMaxType = 14
+#endif}
 
 type
-	CFNumberRef = ^SInt32; { an opaque 32-bit type }
+	CFNumberRef = ^SInt32; { an opaque type }
 	CFNumberRefPtr = ^CFNumberRef;
 
 var kCFNumberPositiveInfinity: CFNumberRef; external name '_kCFNumberPositiveInfinity'; (* attribute const *)
@@ -189,5 +272,7 @@ function CFNumberGetValue( number: CFNumberRef; theType: CFNumberType; valuePtr:
 }
 function CFNumberCompare( number: CFNumberRef; otherNumber: CFNumberRef; context: UnivPtr ): CFComparisonResult; external name '_CFNumberCompare';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 113 - 24
packages/univint/src/CFNumberFormatter.pas

@@ -1,14 +1,17 @@
 {	CFNumberFormatter.h
-	Copyright (c) 2003-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 2003-2009, Apple Inc. All rights reserved.
 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, 2004 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -17,8 +20,8 @@
 
 unit CFNumberFormatter;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -31,16 +34,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -48,14 +73,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -81,7 +157,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -92,6 +167,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFNumber,CFLocale;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -99,7 +176,7 @@ uses MacTypes,CFBase,CFNumber,CFLocale;
 
 
 type
-	CFNumberFormatterRef = ^SInt32; { an opaque 32-bit type }
+	CFNumberFormatterRef = ^SInt32; { an opaque type }
 
 // CFNumberFormatters are not thread-safe.  Do not use one from multiple threads!
 
@@ -108,7 +185,7 @@ function CFNumberFormatterGetTypeID: CFTypeID; external name '_CFNumberFormatter
 
 // number format styles
 type
-	CFNumberFormatterStyle = SInt32;
+	CFNumberFormatterStyle = SIGNEDLONG;
 const
 	kCFNumberFormatterNoStyle = 0;
 	kCFNumberFormatterDecimalStyle = 1;
@@ -153,7 +230,7 @@ function CFNumberFormatterCreateStringWithValue( allocator: CFAllocatorRef; form
 
 
 type
-	CFNumberFormatterOptionFlags = SInt32;
+	CFNumberFormatterOptionFlags = UNSIGNEDLONG;
 const
 	kCFNumberFormatterParseIntegersOnly = 1;	{ only parse integers }
 
@@ -247,25 +324,35 @@ var kCFNumberFormatterPerMillSymbol: CFStringRef; external name '_kCFNumberForma
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)		// CFString
 var kCFNumberFormatterInternationalCurrencySymbol: CFStringRef; external name '_kCFNumberFormatterInternationalCurrencySymbol'; (* attribute const *)
 (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
+var kCFNumberFormatterCurrencyGroupingSeparator: CFStringRef; external name '_kCFNumberFormatterCurrencyGroupingSeparator'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *) // CFString
+var kCFNumberFormatterIsLenient: CFStringRef; external name '_kCFNumberFormatterIsLenient'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)		// CFBoolean
+var kCFNumberFormatterUseSignificantDigits: CFStringRef; external name '_kCFNumberFormatterUseSignificantDigits'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)	// CFBoolean
+var kCFNumberFormatterMinSignificantDigits: CFStringRef; external name '_kCFNumberFormatterMinSignificantDigits'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)	// CFNumber
+var kCFNumberFormatterMaxSignificantDigits: CFStringRef; external name '_kCFNumberFormatterMaxSignificantDigits'; (* attribute const *)
+(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)	// CFNumber
 
 type
-	CFNumberFormatterRoundingMode = SInt32;
+	CFNumberFormatterRoundingMode = SIGNEDLONG;
 const
-    kCFNumberFormatterRoundCeiling = 0;
-    kCFNumberFormatterRoundFloor = 1;
-    kCFNumberFormatterRoundDown = 2;
-    kCFNumberFormatterRoundUp = 3;
-    kCFNumberFormatterRoundHalfEven = 4;
-    kCFNumberFormatterRoundHalfDown = 5;
-    kCFNumberFormatterRoundHalfUp = 6;
+	kCFNumberFormatterRoundCeiling = 0;
+	kCFNumberFormatterRoundFloor = 1;
+	kCFNumberFormatterRoundDown = 2;
+	kCFNumberFormatterRoundUp = 3;
+	kCFNumberFormatterRoundHalfEven = 4;
+	kCFNumberFormatterRoundHalfDown = 5;
+	kCFNumberFormatterRoundHalfUp = 6;
 
 type
-	CFNumberFormatterPadPosition = SInt32;
+	CFNumberFormatterPadPosition = SIGNEDLONG;
 const
-    kCFNumberFormatterPadBeforePrefix = 0;
-    kCFNumberFormatterPadAfterPrefix = 1;
-    kCFNumberFormatterPadBeforeSuffix = 2;
-    kCFNumberFormatterPadAfterSuffix = 3;
+	kCFNumberFormatterPadBeforePrefix = 0;
+	kCFNumberFormatterPadAfterPrefix = 1;
+	kCFNumberFormatterPadBeforeSuffix = 2;
+	kCFNumberFormatterPadAfterSuffix = 3;
 
 
 function CFNumberFormatterGetDecimalInfoForCurrencyCode( currencyCode: CFStringRef; defaultFractionDigits: SInt32Ptr; roundingIncrement: Float64Ptr ): Boolean; external name '_CFNumberFormatterGetDecimalInfoForCurrencyCode';
@@ -279,5 +366,7 @@ function CFNumberFormatterGetDecimalInfoForCurrencyCode( currencyCode: CFStringR
 
 {#endif}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 90 - 11
packages/univint/src/CFPlugIn.pas

@@ -1,13 +1,16 @@
 {	CFPlugIn.h
-	Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1999-2009, Apple Inc.  All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Gorazd Krosl, <[email protected], October 2009 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +19,8 @@
 
 unit CFPlugIn;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFArray,CFBundle,CFString,CFURL,CFUUID;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 {
@@ -118,7 +195,7 @@ type
 
 { ================= Creating PlugIns ================= }
 
-function CFPlugInGetTypeID: UInt32; external name '_CFPlugInGetTypeID';
+function CFPlugInGetTypeID: CFTypeID; external name '_CFPlugInGetTypeID';
 
 function CFPlugInCreate( allocator: CFAllocatorRef; plugInURL: CFURLRef ): CFPlugInRef; external name '_CFPlugInCreate';
     { Might return an existing instance with the ref-count bumped. }
@@ -174,7 +251,7 @@ procedure CFPlugInRemoveInstanceForFactory( factoryID: CFUUIDRef ); external nam
 { Obsolete API }
 
 type
-	CFPlugInInstanceRef = ^SInt32; { an opaque 32-bit type }
+	CFPlugInInstanceRef = ^SInt32; { an opaque type }
 	CFPlugInInstanceRefPtr = ^CFPlugInInstanceRef;
 
 type
@@ -184,10 +261,12 @@ type
 function CFPlugInInstanceGetInterfaceFunctionTable( instance: CFPlugInInstanceRef; interfaceName: CFStringRef; var ftbl: UnivPtr ): Boolean; external name '_CFPlugInInstanceGetInterfaceFunctionTable';
 function CFPlugInInstanceGetFactoryName( instance: CFPlugInInstanceRef ): CFStringRef; external name '_CFPlugInInstanceGetFactoryName';
 function CFPlugInInstanceGetInstanceData( instance: CFPlugInInstanceRef ): UnivPtr; external name '_CFPlugInInstanceGetInstanceData';
-function CFPlugInInstanceGetTypeID: UInt32; external name '_CFPlugInInstanceGetTypeID';
+function CFPlugInInstanceGetTypeID: CFTypeID; external name '_CFPlugInInstanceGetTypeID';
 function CFPlugInInstanceCreateWithInstanceDataSize( allocator: CFAllocatorRef; instanceDataSize: CFIndex; deallocateInstanceFunction: CFPlugInInstanceDeallocateInstanceDataFunction; factoryName: CFStringRef; getInterfaceFunction: CFPlugInInstanceGetInterfaceFunction ): CFPlugInInstanceRef; external name '_CFPlugInInstanceCreateWithInstanceDataSize';
 
 
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 89 - 9
packages/univint/src/CFPlugInCOM.pas

@@ -1,13 +1,16 @@
 {	CFPlugInCOM.h
-	Copyright (c) 1999-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1999-2009, Apple Inc.  All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +19,8 @@
 
 unit CFPlugInCOM;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFPlugIn,CFUUID;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -164,6 +241,7 @@ type
 
 { C++ specific stuff }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 implementation
 
 
@@ -206,8 +284,10 @@ end;
 
 function IUnknownUUID: CFUUIDRef; inline;
 begin
-	IUnknownUUID:= CFUUIDGetConstantUUIDWithBytes( nil, $00, $00, $00, $00, $00, $00, $00, $00, ByteParameter($C0), $00, $00, $00, $00, $00, $00, $46 )
+	IUnknownUUID:= CFUUIDGetConstantUUIDWithBytes( nil, $00, $00, $00, $00, $00, $00, $00, $00, $C0, $00, $00, $00, $00, $00, $00, $46 )
 end;
 
 
 end.
+
+{$endc} {not MACOSALLINCLUDE}

+ 89 - 8
packages/univint/src/CFPreferences.pas

@@ -1,13 +1,16 @@
 {	CFPreferences.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Gorazd Krosl, <[email protected]>, October 2009 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +19,8 @@
 
 unit CFPreferences;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +33,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +72,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +156,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +166,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFDictionary,CFBase,CFArray,CFPropertyList,CFString;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -177,6 +254,7 @@ location.  The returned value must be released by the caller;
 all arguments must be non-NULL }
 function CFPreferencesCopyKeyList( applicationID: CFStringRef; userName: CFStringRef; hostName: CFStringRef ): CFArrayRef; external name '_CFPreferencesCopyKeyList';
 
+{#ifndef CF_OPEN_SOURCE}
 {#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
 
 { Function to determine whether or not a given key has been imposed on the
@@ -185,7 +263,10 @@ callers should use this function to determine whether or not to disable UI eleme
 corresponding to those preference keys. }
 function CFPreferencesAppValueIsForced( key: CFStringRef; applicationID: CFStringRef ): Boolean; external name '_CFPreferencesAppValueIsForced';
 
+{#endif}
 {#endif}
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 133 - 19
packages/univint/src/CFPropertyList.pas

@@ -1,13 +1,15 @@
 {	CFPropertyList.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFPropertyList;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -90,12 +164,14 @@ interface
 {$setc TYPE_BOOL := FALSE}
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
-uses MacTypes,CFBase,CFData,CFString,CFStream;
+uses MacTypes,CFBase,CFData,CFError,CFString,CFStream;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 type
-	CFPropertyListMutabilityOptions = SInt32;
+	CFPropertyListMutabilityOptions = UNSIGNEDLONG;
 const
 	kCFPropertyListImmutable = 0;
 	kCFPropertyListMutableContainers = 1;
@@ -108,6 +184,8 @@ const
 	and errorString is non-NULL, a human-readable description of the failure
 	is returned in errorString. It is the caller's responsibility to release
 	either the returned object or the error string, whichever is applicable.
+
+  This function is obsolete and will be deprecated soon. See CFPropertyListCreateWithData() for a replacement.
 }
 function CFPropertyListCreateFromXMLData( allocator: CFAllocatorRef; xmlData: CFDataRef; mutabilityOption: CFOptionFlags; errorString: CFStringRefPtr ): CFPropertyListRef; external name '_CFPropertyListCreateFromXMLData';
 
@@ -120,6 +198,8 @@ function CFPropertyListCreateFromXMLData( allocator: CFAllocatorRef; xmlData: CF
 	appropriate for writing out to an XML file. Note that a data, not a
 	string, is returned because the bytes contain in them a description
 	of the string encoding used.
+
+  This function is obsolete and will be deprecated soon. See CFPropertyListCreateData() for a replacement.
 }
 function CFPropertyListCreateXMLData( allocator: CFAllocatorRef; propertyList: CFPropertyListRef ): CFDataRef; external name '_CFPropertyListCreateXMLData';
 
@@ -134,21 +214,20 @@ function CFPropertyListCreateDeepCopy( allocator: CFAllocatorRef; propertyList:
 {#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED}
 
 type
-	CFPropertyListFormat = SInt32;
+	CFPropertyListFormat = SIGNEDLONG;
+	CFPropertyListFormatPtr = ^CFPropertyListFormat;
+
 const
     kCFPropertyListOpenStepFormat = 1;
     kCFPropertyListXMLFormat_v1_0 = 100;
     kCFPropertyListBinaryFormat_v1_0 = 200;
 
-function CFPropertyListIsValid( plist: CFPropertyListRef; format: CFPropertyListFormat ): Boolean; external name '_CFPropertyListIsValid';
-
 { Returns true if the object graph rooted at plist is a valid property list
  * graph -- that is, no cycles, containing only plist objects, and dictionary
  * keys are strings. The debugging library version spits out some messages
  * to be helpful. The plist structure which is to be allowed is given by
  * the format parameter. }
-
-function CFPropertyListWriteToStream( propertyList: CFPropertyListRef; stream: CFWriteStreamRef; format: CFPropertyListFormat; var errorString: CFStringRef ): CFIndex; external name '_CFPropertyListWriteToStream';
+function CFPropertyListIsValid( plist: CFPropertyListRef; format: CFPropertyListFormat ): Boolean; external name '_CFPropertyListIsValid';
 
 { Writes the bytes of a plist serialization out to the stream.  The
  * stream must be opened and configured -- the function simply writes
@@ -157,9 +236,10 @@ function CFPropertyListWriteToStream( propertyList: CFPropertyListRef; stream: C
  * reading stream to end wherever the writing ended, so that the
  * end of the plist data can be identified. Returns the number of bytes
  * written, or 0 on error. Error messages are not currently localized, but
- * may be in the future, so they are not suitable for comparison. }
-
-function CFPropertyListCreateFromStream( allocator: CFAllocatorRef; stream: CFReadStreamRef; streamLength: CFIndex; mutabilityOption: CFOptionFlags; var format: CFPropertyListFormat; var errorString: CFStringRef ): CFPropertyListRef; external name '_CFPropertyListCreateFromStream';
+ * may be in the future, so they are not suitable for comparison.
+ *
+ * This function is obsolete and will be deprecated soon. See CFPropertyListWrite() for a replacement. }
+function CFPropertyListWriteToStream( propertyList: CFPropertyListRef; stream: CFWriteStreamRef; format: CFPropertyListFormat; var errorString: CFStringRef ): CFIndex; external name '_CFPropertyListWriteToStream';
 
 { Same as current function CFPropertyListCreateFromXMLData()
  * but takes a stream instead of data, and works on any plist file format.
@@ -169,9 +249,43 @@ function CFPropertyListCreateFromStream( allocator: CFAllocatorRef; stream: CFRe
  * of the stream, which is expected to be the end of the plist, or up to the
  * number of bytes given by the length parameter if it is not 0. Error messages
  * are not currently localized, but may be in the future, so they are not
- * suitable for comparison. }
+ * suitable for comparison.
+ *
+ * This function is obsolete and will be deprecated soon. See CFPropertyListCreateWithStream() for a replacement. }
+function CFPropertyListCreateFromStream( allocator: CFAllocatorRef; stream: CFReadStreamRef; streamLength: CFIndex; mutabilityOption: CFOptionFlags; var format: CFPropertyListFormat; var errorString: CFStringRef ): CFPropertyListRef; external name '_CFPropertyListCreateFromStream';
 
 {#endif}
 
+{#if MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+const
+	kCFPropertyListReadCorruptError = 3840; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)             // Error parsing a property list
+	kCFPropertyListReadUnknownVersionError = 3841; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)      // The version number in the property list is unknown
+	kCFPropertyListReadStreamError = 3842; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)              // Stream error reading a property list
+	kCFPropertyListWriteStreamError = 3851; (* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)             // Stream error writing a property list
+{#endif}
+
+{ Create a property list with a CFData input. If the format parameter is non-NULL, it will be set to the format of the data after parsing is complete. The options parameter is used to specify CFPropertyListMutabilityOptions. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the parse succeeds, the returned value is a reference to the new property list. It is the responsibility of the caller to release this value.
+ }
+function CFPropertyListCreateWithData( allocator: CFAllocatorRef; data: CFDataRef; options: CFOptionFlags; format: CFPropertyListFormatPtr { can be NULL };  error: CFErrorRefPtr { can be NULL } ): CFPropertyListRef; external name '_CFPropertyListCreateWithData';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+{ Create and return a property list with a CFReadStream input. TIf the format parameter is non-NULL, it will be set to the format of the data after parsing is complete. The options parameter is used to specify CFPropertyListMutabilityOptions. The streamLength parameter specifies the number of bytes to read from the stream. Set streamLength to 0 to read until the end of the stream is detected. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the parse succeeds, the returned value is a reference to the new property list. It is the responsibility of the caller to release this value.
+ }
+function CFPropertyListCreateWithStream( allocator: CFAllocatorRef; stream: CFReadStreamRef; streamLength: CFIndex; options: CFOptionFlags;  format: CFPropertyListFormatPtr { can be NULL }; error: CFErrorRefPtr { can be NULL } ): CFPropertyListRef; external name '_CFPropertyListCreateWithStream';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+{ Write the bytes of a serialized property list out to a stream. The stream must be opened and configured. The format of the property list can be chosen with the format parameter. The options parameter is currently unused and should be set to 0. The return value is the number of bytes written or 0 in the case of an error. If an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release.
+ }
+function CFPropertyListWrite( propertyList: CFPropertyListRef; stream: CFWriteStreamRef; format: CFPropertyListFormat; options: CFOptionFlags; error: CFErrorRefPtr { can be NULL } ): CFIndex; external name '_CFPropertyListWrite';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+{ Create a CFData with the bytes of a serialized property list. The format of the property list can be chosen with the format parameter. The options parameter is currently unused and should be set to 0. If an error occurs while parsing the data, the return value will be NULL. Additionally, if an error occurs and the error parameter is non-NULL, the error parameter will be set to a CFError describing the problem, which the caller must release. If the conversion succeeds, the returned value is a reference to the created data. It is the responsibility of the caller to release this value.
+ }
+function CFPropertyListCreateData( allocator: CFAllocatorRef; propertyList: CFPropertyListRef; format: CFPropertyListFormat; options: CFOptionFlags; error: CFErrorRefPtr { can be NULL } ): CFDataRef; external name '_CFPropertyListCreateData';
+(* AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER *)
+
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 538 - 166
packages/univint/src/CFProxySupport.pas

@@ -1,22 +1,25 @@
 {
-     File:       CFNetwork/CFProxySupport.h
+	 File:	   CFNetwork/CFProxySupport.h
  
-     Contains:   Support for computing which proxy applies when
+	 Contains:   Support for computing which proxy applies when
  
-     Version:    CFNetwork-219~1
+	 Copyright:  Copyright (c) 2006-2008, Apple Inc. All rights reserved.
+ 
+	 Bugs?:	  For bug reports, consult the following page on
+				 the World Wide Web:
+ 
+					 http://www.freepascal.org/bugs.html
  
-     Copyright:  © 2006 by Apple Computer, Inc., all rights reserved
-  
 }
-
 {	 Pascal Translation:  Gale R Paeper, <[email protected]>, 2008 }
-
+{  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -25,8 +28,8 @@
 
 unit CFProxySupport;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -39,16 +42,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -56,14 +81,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -89,7 +165,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -100,302 +175,599 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes, CFArray, CFBase, CFDictionary, CFURL, CFError, CFRunLoop, CFStream;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
 { 
-    These APIs return arrays of dictionaries, where each dictionary describes a single proxy. 
-    The arrays represent the order in which the proxies should be tried - try to download the URL
-    using the first entry in the array, and if that fails, try using the second entry, and so on.
-
-    The keys to the proxy dictionaries follow the function declarations; every proxy dictionary 
-    will have an entry for kCFProxyTypeKey.  If the type is anything except 
-    kCFProxyTypeAutoConfigurationURL, the dictionary will also have entries for the proxy's host
-    and port (under kCFProxyHostNameKey and kCFProxyPortNumberKey respectively).  If the type is
-    kCFProxyTypeAutoConfigurationURL, it will have an entry for kCFProxyAutoConfigurationURLKey.  
-    
-    The keys for username and password are optional and will only be present if the username 
-    or password could be extracted from the information passed in (i.e. either the URL itself
-    or the proxy dictionary supplied).  These APIs do not consult any external credential stores
-    (such as the Keychain).
+	These APIs return arrays of dictionaries, where each dictionary describes a single proxy. 
+	The arrays represent the order in which the proxies should be tried - try to download the URL
+	using the first entry in the array, and if that fails, try using the second entry, and so on.
+
+	The keys to the proxy dictionaries follow the function declarations; every proxy dictionary 
+	will have an entry for kCFProxyTypeKey.  If the type is anything except 
+	kCFProxyTypeAutoConfigurationURL, the dictionary will also have entries for the proxy's host
+	and port (under kCFProxyHostNameKey and kCFProxyPortNumberKey respectively).  If the type is
+	kCFProxyTypeAutoConfigurationURL, it will have an entry for kCFProxyAutoConfigurationURLKey.  
+	
+	The keys for username and password are optional and will only be present if the username 
+	or password could be extracted from the information passed in (i.e. either the URL itself
+	or the proxy dictionary supplied).  These APIs do not consult any external credential stores
+	(such as the Keychain).
 }
 
 
+{!
+	@function CFNetworkCopySystemProxySettings
+	@discussion Returns a CFDictionary containing the current system internet proxy settings.
+	@result Returns a dictionary containing key-value pairs that represent
+		the current internet proxy settings.  See below for definitions of the keys and
+		values.
+		NULL if no proxy settings have been defined or if an error
+		was encountered.
+		The caller is responsible for releasing the returned dictionary.
+}
+function CFNetworkCopySystemProxySettings: CFDictionaryRef; external name '_CFNetworkCopySystemProxySettings';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+
+	
 {
  *  CFNetworkCopyProxiesForURL()
  *  
  *  Discussion:
- *    Given a URL and a proxy dictionary, determines the ordered list
- *    of proxies that should be used to download the given URL.
+ *	Given a URL and a proxy dictionary, determines the ordered list
+ *	of proxies that should be used to download the given URL.
  *  
  *  Parameters:
- *    
- *    url:
- *      The URL to be accessed
- *    
- *    proxySettings:
- *      A dictionary describing the available proxy settings; the
- *      dictionary's format should match that described in and returned
- *      by SystemConfiguration.framework
+ *	
+ *	url:
+ *	  The URL to be accessed
+ *	
+ *	proxySettings:
+ *	  A dictionary describing the available proxy settings; the
+ *	  dictionary's format should match the dictionary returned
+ *	  by CFNetworkCopySystemProxySettings described below.
  *  
  *  Result:
- *    An array of dictionaries; each dictionary describes a single
- *    proxy.  See the comment at the top of this file for how to
- *    interpret the returned dictionaries.
+ *	An array of dictionaries; each dictionary describes a single
+ *	proxy.  See the comment at the top of this file for how to
+ *	interpret the returned dictionaries.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetworkCopyProxiesForURL( url: CFURLRef; proxySettings: CFDictionaryRef ): CFArrayRef; external name '_CFNetworkCopyProxiesForURL';
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 
 {
  *  CFProxyAutoConfigurationResultCallback
  *  
  *  Discussion:
- *    Callback function to be called when a PAC file computation
- *    (initiated by either CFNetworkExecuteProxyAutoConfigurationScript
- *    or CFNetworkExecuteProxyAutoConfigurationURL) has completed.
+ *	Callback function to be called when a PAC file computation
+ *	(initiated by either CFNetworkExecuteProxyAutoConfigurationScript
+ *	or CFNetworkExecuteProxyAutoConfigurationURL) has completed.
  *  
  *  Parameters:
- *    
- *    client:
- *      The client reference passed in to
- *      CFNetworkExecuteProxyAutoConfigurationScript or
- *      CFNetworkExecuteProxyAutoConfigurationURL
- *    
- *    proxyList:
- *      Upon success, the list of proxies returned by the
- *      autoconfiguration script.  The list has the same format as
- *      returned by CFProxyCopyProxiesForURL, above, except that no
- *      entry may be of type kCFProxyTypeAutoConfigurationURL.  Note
- *      that if the client wishes to keep this list, they must retain
- *      it when they receive this callback.
- *    
- *    error:
- *      Upon failure, an error object explaining the failure.
+ *	
+ *	client:
+ *	  The client reference passed in to
+ *	  CFNetworkExecuteProxyAutoConfigurationScript or
+ *	  CFNetworkExecuteProxyAutoConfigurationURL
+ *	
+ *	proxyList:
+ *	  Upon success, the list of proxies returned by the
+ *	  autoconfiguration script.  The list has the same format as
+ *	  returned by CFProxyCopyProxiesForURL, above, except that no
+ *	  entry may be of type kCFProxyTypeAutoConfigurationURL.  Note
+ *	  that if the client wishes to keep this list, they must retain
+ *	  it when they receive this callback.
+ *	
+ *	error:
+ *	  Upon failure, an error object explaining the failure.
  }
 type
 	CFProxyAutoConfigurationResultCallback = procedure( client: UnivPtr; proxyList: CFArrayRef; error: CFErrorRef );
+
 {
  *  CFNetworkCopyProxiesForAutoConfigurationScript()
  *  
  *  Discussion:
- *    Begins the process of executing proxyAutoConfigurationScript to
- *    determine the correct proxy to use to retrieve targetURL.  The
- *    caller should schedule the returned run loop source; when the
- *    results are found, the caller's callback will be called via the
- *    run loop, passing a valid proxyList and NULL error upon success,
- *    or a NULL proxyList and valid error on failure.  The caller
- *    should invalidate the returned run loop source if it wishes to
- *    terminate the request before completion.
+ *	Synchronously executes the given proxy autoconfiguration script
+ *	and returns a valid proxyList and NULL error upon success or a
+ *	NULL proxyList and valid error on failure.
+ *  
+ *  Parameters:
+ *	
+ *	proxyAutoConfigurationScript:
+ *	  A CFString containing the code of the script to be executed.
+ *	
+ *	targetURL:
+ *	  The URL that should be input in to the autoconfiguration script.
+ *	
+ *	error:
+ *	  A return argument that will contain a valid error in case of
+ *	  failure.
+ *  
+ *  Result:
+ *	An array of dictionaries describing the proxies returned by the
+ *	script or NULL on failure.
+ *  
+ *  Availability:
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
+ }
+function CFNetworkCopyProxiesForAutoConfigurationScript( proxyAutoConfigurationScript: CFStringRef; targetURL: CFURLRef; var error: CFErrorRef ): CFArrayRef; external name '_CFNetworkCopyProxiesForAutoConfigurationScript';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
+
+
+{
+ *  CFNetworkExecuteProxyAutoConfigurationScript()
+ *  
+ *  Discussion:
+ *	Begins the process of executing proxyAutoConfigurationScript to
+ *	determine the correct proxy to use to retrieve targetURL.  The
+ *	caller should schedule the returned run loop source; when the
+ *	results are found, the caller's callback will be called via the
+ *	run loop, passing a valid proxyList and NULL error upon success,
+ *	or a NULL proxyList and valid error on failure.  The caller
+ *	should invalidate the returned run loop source if it wishes to
+ *	terminate the request before completion. The returned
+ *	RunLoopSource will be removed from all run loops and modes on
+ *	which it was scheduled after the callback returns.
  *  
  *  Parameters:
- *    
- *    proxyAutoConfigurationScript:
- *      A CFString containing the code of the script to be executed.
- *    
- *    targetURL:
- *      The URL that should be input in to the autoconfiguration script
+ *	
+ *	proxyAutoConfigurationScript:
+ *	  A CFString containing the code of the script to be executed.
+ *	
+ *	targetURL:
+ *	  The URL that should be passed to the autoconfiguration script.
+ *	
+ *	cb:
+ *	  A client callback to notify the caller of completion.
+ *	
+ *	clientContext:
+ *	  a stream context containing a client info object and optionally
+ *	  retain / release callbacks for said info object.
  *  
  *  Result:
- *    An array of dictionaries describing the proxies returned by the
- *    script.
+ *	A CFRunLoopSource which the client can use to schedule execution
+ *	of the AutoConfiguration Script.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
-function CFNetworkCopyProxiesForAutoConfigurationScript( proxyAutoConfigurationScript: CFStringRef; targetURL: CFURLRef ): CFArrayRef; external name '_CFNetworkCopyProxiesForAutoConfigurationScript';
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+function CFNetworkExecuteProxyAutoConfigurationScript( proxyAutoConfigurationScript: CFStringRef; targetURL: CFURLRef; cb: CFProxyAutoConfigurationResultCallback; var clientContext: CFStreamClientContext ): CFRunLoopSourceRef; external name '_CFNetworkExecuteProxyAutoConfigurationScript';
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 
 {
  *  CFNetworkExecuteProxyAutoConfigurationURL()
  *  
  *  Discussion:
- *    As CFNetworkExecuteProxyAutoConfigurationScript(), above, except
- *    that CFNetworkExecuteProxyAutoConfigurationURL will additionally
- *    download the contents of proxyAutoConfigURL, convert it to a
- *    JavaScript string, and then execute that script.
+ *	As CFNetworkExecuteProxyAutoConfigurationScript(), above, except
+ *	that CFNetworkExecuteProxyAutoConfigurationURL will additionally
+ *	download the contents of proxyAutoConfigURL, convert it to a
+ *	JavaScript string, and then execute that script.
+ *  Ownership for the returned CFRunLoopSourceRef follows the copy rule, 
+ *  the client is responsible for releasing the object.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 function CFNetworkExecuteProxyAutoConfigurationURL( proxyAutoConfigURL: CFURLRef; targetURL: CFURLRef; cb: CFProxyAutoConfigurationResultCallback; var clientContext: CFStreamClientContext ): CFRunLoopSourceRef; external name '_CFNetworkExecuteProxyAutoConfigurationURL';
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 
 {
  *  kCFProxyTypeKey
  *  
  *  Discussion:
- *    Key for the type of proxy being represented; value will be one of
- *    the kCFProxyType constants listed below.
+ *	Key for the type of proxy being represented; value will be one of
+ *	the kCFProxyType constants listed below.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeKey: CFStringRef; external name '_kCFProxyTypeKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFProxyHostNameKey
  *  
  *  Discussion:
- *    Key for the proxy's hostname; value is a CFString.  Note that
- *    this may be an IPv4 or IPv6 dotted-IP string.
+ *	Key for the proxy's hostname; value is a CFString.  Note that
+ *	this may be an IPv4 or IPv6 dotted-IP string.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyHostNameKey: CFStringRef; external name '_kCFProxyHostNameKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFProxyPortNumberKey
  *  
  *  Discussion:
- *    Key for the proxy's port number; value is a CFNumber specifying
- *    the port on which to contact the proxy
+ *	Key for the proxy's port number; value is a CFNumber specifying
+ *	the port on which to contact the proxy
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyPortNumberKey: CFStringRef; external name '_kCFProxyPortNumberKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFProxyAutoConfigurationURLKey
  *  
  *  Discussion:
- *    Key for the proxy's PAC file location; this key is only present
- *    if the proxy's type is kCFProxyTypeAutoConfigurationURL.  Value
- *    is a CFURL specifying the location of a proxy auto-configuration
- *    file
+ *	Key for the proxy's PAC file location; this key is only present
+ *	if the proxy's type is kCFProxyTypeAutoConfigurationURL.  Value
+ *	is a CFURL specifying the location of a proxy auto-configuration
+ *	file
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyAutoConfigurationURLKey: CFStringRef; external name '_kCFProxyAutoConfigurationURLKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFProxyUsernameKey
  *  
  *  Discussion:
- *    Key for the username to be used with the proxy; value is a
- *    CFString. Note that this key will only be present if the username
- *    could be extracted from the information passed in.  No external
- *    credential stores (like the Keychain) are consulted.
+ *	Key for the username to be used with the proxy; value is a
+ *	CFString. Note that this key will only be present if the username
+ *	could be extracted from the information passed in.  No external
+ *	credential stores (like the Keychain) are consulted.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyUsernameKey: CFStringRef; external name '_kCFProxyUsernameKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 {
  *  kCFProxyPasswordKey
  *  
  *  Discussion:
- *    Key for the password to be used with the proxy; value is a
- *    CFString. Note that this key will only be present if the username
- *    could be extracted from the information passed in.  No external
- *    credential stores (like the Keychain) are consulted.
+ *	Key for the password to be used with the proxy; value is a
+ *	CFString. Note that this key will only be present if the username
+ *	could be extracted from the information passed in.  No external
+ *	credential stores (like the Keychain) are consulted.
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyPasswordKey: CFStringRef; external name '_kCFProxyPasswordKey'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 
 { 
-    Possible values for kCFProxyTypeKey:
-    kCFProxyTypeNone - no proxy should be used; contact the origin server directly
-    kCFProxyTypeHTTP - the proxy is an HTTP proxy
-    kCFProxyTypeHTTPS - the proxy is a tunneling proxy as used for HTTPS
-    kCFProxyTypeSOCKS - the proxy is a SOCKS proxy
-    kCFProxyTypeFTP - the proxy is an FTP proxy
-    kCFProxyTypeAutoConfigurationURL - the proxy is specified by a proxy autoconfiguration (PAC) file
+	Possible values for kCFProxyTypeKey:
+	kCFProxyTypeNone - no proxy should be used; contact the origin server directly
+	kCFProxyTypeHTTP - the proxy is an HTTP proxy
+	kCFProxyTypeHTTPS - the proxy is a tunneling proxy as used for HTTPS
+	kCFProxyTypeSOCKS - the proxy is a SOCKS proxy
+	kCFProxyTypeFTP - the proxy is an FTP proxy
+	kCFProxyTypeAutoConfigurationURL - the proxy is specified by a proxy autoconfiguration (PAC) file
 }
 {
  *  kCFProxyTypeNone
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeNone: CFStringRef; external name '_kCFProxyTypeNone'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 {
  *  kCFProxyTypeHTTP
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeHTTP: CFStringRef; external name '_kCFProxyTypeHTTP'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 {
  *  kCFProxyTypeHTTPS
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeHTTPS: CFStringRef; external name '_kCFProxyTypeHTTPS'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 {
  *  kCFProxyTypeSOCKS
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeSOCKS: CFStringRef; external name '_kCFProxyTypeSOCKS'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 {
  *  kCFProxyTypeFTP
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeFTP: CFStringRef; external name '_kCFProxyTypeFTP'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
 {
  *  kCFProxyTypeAutoConfigurationURL
  *  
  *  Availability:
- *    Mac OS X:         in version 10.5 and later in CoreServices.framework
- *    CarbonLib:        not available
- *    Non-Carbon CFM:   not available
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
  }
 var kCFProxyTypeAutoConfigurationURL: CFStringRef; external name '_kCFProxyTypeAutoConfigurationURL'; (* attribute const *)
-(* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
+
+{
+ *  kCFProxyAutoConfigHTTPResponse
+ *  
+ *  Availability:
+ *	Mac OS X:		 in version 10.5 and later in CoreServices.framework
+ *	CarbonLib:		not available
+ *	Non-Carbon CFM:   not available
+ }
+var kCFProxyAutoConfigurationHTTPResponseKey: CFStringRef; external name '_kCFProxyAutoConfigurationHTTPResponseKey'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0) *)
+	
+
+{$ifc TARGET_OS_MAC}
+{
+ *  kCFNetworkProxiesExceptionsList
+ *  
+ *  Discussion:
+ *	Key for the list of host name patterns that should bypass the proxy; value is a
+ *	CFArray of CFStrings.  
+ }
+var kCFNetworkProxiesExceptionsList: CFStringRef; external name '_kCFNetworkProxiesExceptionsList'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesExcludeSimpleHostnames
+ *  
+ *  Discussion:
+ *	Key whose value indicates if simple hostnames will be excluded; value is a
+ *	CFNumber.  Simple hostnames will be excluded if the key is present and has a 
+ *	non-zero value.
+ }
+var kCFNetworkProxiesExcludeSimpleHostnames: CFStringRef; external name '_kCFNetworkProxiesExcludeSimpleHostnames'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesFTPEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the ftp proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesFTPEnable: CFStringRef; external name '_kCFNetworkProxiesFTPEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesFTPPassive
+ *  
+ *  Discussion:
+ *	Key for the state of passive mode for the ftp proxy; value is a
+ *	CFNumber.  A value of one indicates that passive mode is enabled, a value
+ *	of zero indicates that passive mode is not enabled.
+ }
+var kCFNetworkProxiesFTPPassive: CFStringRef; external name '_kCFNetworkProxiesFTPPassive'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesFTPPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the ftp proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesFTPPort: CFStringRef; external name '_kCFNetworkProxiesFTPPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesFTPProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the ftp proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesFTPProxy: CFStringRef; external name '_kCFNetworkProxiesFTPProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesGopherEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the gopher proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesGopherEnable: CFStringRef; external name '_kCFNetworkProxiesGopherEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesGopherPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the gopher proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesGopherPort: CFStringRef; external name '_kCFNetworkProxiesGopherPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesGopherProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the gopher proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesGopherProxy: CFStringRef; external name '_kCFNetworkProxiesGopherProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesHTTPEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the HTTP proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesHTTPEnable: CFStringRef; external name '_kCFNetworkProxiesHTTPEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+{
+ *  kCFNetworkProxiesHTTPPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the HTTP proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesHTTPPort: CFStringRef; external name '_kCFNetworkProxiesHTTPPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+{
+ *  kCFNetworkProxiesHTTPProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the HTTP proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesHTTPProxy: CFStringRef; external name '_kCFNetworkProxiesHTTPProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+{
+ *  kCFNetworkProxiesHTTPSEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the HTTPS proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesHTTPSEnable: CFStringRef; external name '_kCFNetworkProxiesHTTPSEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesHTTPSPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the HTTPS proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesHTTPSPort: CFStringRef; external name '_kCFNetworkProxiesHTTPSPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesHTTPSProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the HTTPS proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesHTTPSProxy: CFStringRef; external name '_kCFNetworkProxiesHTTPSProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesRTSPEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the RTSP proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesRTSPEnable: CFStringRef; external name '_kCFNetworkProxiesRTSPEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesRTSPPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the RTSP proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesRTSPPort: CFStringRef; external name '_kCFNetworkProxiesRTSPPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesRTSPProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the RTSP proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesRTSPProxy: CFStringRef; external name '_kCFNetworkProxiesRTSPProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesSOCKSEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of the SOCKS proxy; value is a
+ *	CFNumber.  The proxy is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesSOCKSEnable: CFStringRef; external name '_kCFNetworkProxiesSOCKSEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesSOCKSPort
+ *  
+ *  Discussion:
+ *	Key for the port number associated with the SOCKS proxy; value is a
+ *	CFNumber which is the port number.
+ }
+var kCFNetworkProxiesSOCKSPort: CFStringRef; external name '_kCFNetworkProxiesSOCKSPort'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesSOCKSProxy
+ *  
+ *  Discussion:
+ *	Key for the host name associated with the SOCKS proxy; value is a
+ *	CFString which is the proxy host name.
+ }
+var kCFNetworkProxiesSOCKSProxy: CFStringRef; external name '_kCFNetworkProxiesSOCKSProxy'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{
+ *  kCFNetworkProxiesProxyAutoConfigEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status ProxyAutoConfig (PAC); value is a
+ *	CFNumber.  ProxyAutoConfig is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesProxyAutoConfigEnable: CFStringRef; external name '_kCFNetworkProxiesProxyAutoConfigEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+{
+ *  kCFNetworkProxiesSOCKSProxy
+ *  
+ *  Discussion:
+ *	Key for the url which indicates the location of the ProxyAutoConfig (PAC) file; value is a
+ *	CFString which is url for the PAC file.
+ }
+var kCFNetworkProxiesProxyAutoConfigURLString: CFStringRef; external name '_kCFNetworkProxiesProxyAutoConfigURLString'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0) *)
+{
+ *  kCFNetworkProxiesProxyAutoDiscoveryEnable
+ *  
+ *  Discussion:
+ *	Key for the enabled status of proxy auto discovery; value is a
+ *	CFNumber.  Proxy auto discovery is enabled if the key is present and has a non-zero value.
+ }
+var kCFNetworkProxiesProxyAutoDiscoveryEnable: CFStringRef; external name '_kCFNetworkProxiesProxyAutoDiscoveryEnable'; (* attribute const *)
+(* __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA) *)
+{$endc} {TARGET_OS_MAC}
+
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 96 - 9
packages/univint/src/CFRunLoop.pas

@@ -1,13 +1,15 @@
 {	CFRunLoop.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{	  Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFRunLoop;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
+{$elsec}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase,CFArray,CFDate,CFString,MacOSXPosix;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 
@@ -183,7 +259,7 @@ const
 
 { Run Loop Observer Activities }
 type
-	CFRunLoopActivity = UInt32;
+	CFRunLoopActivity = UNSIGNEDLONG;
 const
 	kCFRunLoopEntry = 1 shl 0;
     kCFRunLoopBeforeTimers = 1 shl 1;
@@ -209,6 +285,9 @@ function CFRunLoopGetTypeID: CFTypeID; external name '_CFRunLoopGetTypeID';
 }
 function CFRunLoopGetCurrent: CFRunLoopRef; external name '_CFRunLoopGetCurrent';
 
+function CFRunLoopGetMain: CFRunLoopRef; external name '_CFRunLoopGetMain';
+(* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
+
 {!
 	@function CFRunLoopCopyCurrentMode
 	Returns the name of the mode in which the run loop is running.
@@ -253,6 +332,12 @@ function CFRunLoopIsWaiting( rl: CFRunLoopRef ): Boolean; external name '_CFRunL
 procedure CFRunLoopWakeUp( rl: CFRunLoopRef ); external name '_CFRunLoopWakeUp';
 procedure CFRunLoopStop( rl: CFRunLoopRef ); external name '_CFRunLoopStop';
 
+{#if __BLOCKS__ && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED}
+{ requires support for blocks
+extern void CFRunLoopPerformBlock(CFRunLoopRef rl, CFTypeRef mode, void (^block)(void)) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; 
+}
+{#endif}
+
 function CFRunLoopContainsSource( rl: CFRunLoopRef; source: CFRunLoopSourceRef; mode: CFStringRef ): Boolean; external name '_CFRunLoopContainsSource';
 procedure CFRunLoopAddSource( rl: CFRunLoopRef; source: CFRunLoopSourceRef; mode: CFStringRef ); external name '_CFRunLoopAddSource';
 procedure CFRunLoopRemoveSource( rl: CFRunLoopRef; source: CFRunLoopSourceRef; mode: CFStringRef ); external name '_CFRunLoopRemoveSource';
@@ -483,5 +568,7 @@ procedure CFRunLoopTimerInvalidate( timer: CFRunLoopTimerRef ); external name '_
 function CFRunLoopTimerIsValid( timer: CFRunLoopTimerRef ): Boolean; external name '_CFRunLoopTimerIsValid';
 procedure CFRunLoopTimerGetContext( timer: CFRunLoopTimerRef; var context: CFRunLoopTimerContext ); external name '_CFRunLoopTimerGetContext';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

+ 118 - 16
packages/univint/src/CFSet.pas

@@ -1,13 +1,15 @@
 {	CFSet.h
-	Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
+	Copyright (c) 1998-2009, Apple, Inc. All rights reserved.
 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, October 2009 }
 {
     Modified for use with Free Pascal
-    Version 210
+    Version 308
     Please report any bugs to <[email protected]>
 }
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 {$mode macpas}
 {$packenum 1}
 {$macro on}
@@ -16,8 +18,8 @@
 
 unit CFSet;
 interface
-{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
-{$setc GAP_INTERFACES_VERSION := $0210}
+{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
+{$setc GAP_INTERFACES_VERSION := $0308}
 
 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
     {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
@@ -30,16 +32,38 @@ interface
 	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
 {$endc}
 
-{$ifc not defined __ppc__ and defined CPUPOWERPC}
+{$ifc not defined __ppc__ and defined CPUPOWERPC32}
 	{$setc __ppc__ := 1}
 {$elsec}
 	{$setc __ppc__ := 0}
 {$endc}
+{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
+	{$setc __ppc64__ := 1}
+{$elsec}
+	{$setc __ppc64__ := 0}
+{$endc}
 {$ifc not defined __i386__ and defined CPUI386}
 	{$setc __i386__ := 1}
 {$elsec}
 	{$setc __i386__ := 0}
 {$endc}
+{$ifc not defined __x86_64__ and defined CPUX86_64}
+	{$setc __x86_64__ := 1}
+{$elsec}
+	{$setc __x86_64__ := 0}
+{$endc}
+{$ifc not defined __arm__ and defined CPUARM}
+	{$setc __arm__ := 1}
+{$elsec}
+	{$setc __arm__ := 0}
+{$endc}
+
+{$ifc defined cpu64}
+  {$setc __LP64__ := 1}
+{$elsec}
+  {$setc __LP64__ := 0}
+{$endc}
+
 
 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
 	{$error Conflicting definitions for __ppc__ and __i386__}
@@ -47,14 +71,65 @@ interface
 
 {$ifc defined __ppc__ and __ppc__}
 	{$setc TARGET_CPU_PPC := TRUE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __ppc64__ and __ppc64__}
+	{$setc TARGET_CPU_PPC := TFALSE}
+	{$setc TARGET_CPU_PPC64 := TRUE}
 	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 {$elifc defined __i386__ and __i386__}
 	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
 	{$setc TARGET_CPU_X86 := TRUE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := FALSE}
+{$ifc defined(iphonesim)}
+ 	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 {$elsec}
-	{$error Neither __ppc__ nor __i386__ is defined.}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$endc}
+{$elifc defined __x86_64__ and __x86_64__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := TRUE}
+	{$setc TARGET_CPU_ARM := FALSE}
+	{$setc TARGET_OS_MAC := TRUE}
+	{$setc TARGET_OS_IPHONE := FALSE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elifc defined __arm__ and __arm__}
+	{$setc TARGET_CPU_PPC := FALSE}
+	{$setc TARGET_CPU_PPC64 := FALSE}
+	{$setc TARGET_CPU_X86 := FALSE}
+	{$setc TARGET_CPU_X86_64 := FALSE}
+	{$setc TARGET_CPU_ARM := TRUE}
+	{ will require compiler define when/if other Apple devices with ARM cpus ship }
+	{$setc TARGET_OS_MAC := FALSE}
+	{$setc TARGET_OS_IPHONE := TRUE}
+	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
+{$elsec}
+	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
+{$endc}
+
+{$ifc defined __LP64__ and __LP64__ }
+  {$setc TARGET_CPU_64 := TRUE}
+{$elsec}
+  {$setc TARGET_CPU_64 := FALSE}
 {$endc}
-{$setc TARGET_CPU_PPC_64 := FALSE}
 
 {$ifc defined FPC_BIG_ENDIAN}
 	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
@@ -80,7 +155,6 @@ interface
 {$setc TARGET_CPU_68K := FALSE}
 {$setc TARGET_CPU_MIPS := FALSE}
 {$setc TARGET_CPU_SPARC := FALSE}
-{$setc TARGET_OS_MAC := TRUE}
 {$setc TARGET_OS_UNIX := FALSE}
 {$setc TARGET_OS_WIN32 := FALSE}
 {$setc TARGET_RT_MAC_68881 := FALSE}
@@ -91,6 +165,8 @@ interface
 {$setc TYPE_EXTENDED := FALSE}
 {$setc TYPE_LONGLONG := TRUE}
 uses MacTypes,CFBase;
+{$endc} {not MACOSALLINCLUDE}
+
 {$ALIGN POWER}
 
 {!
@@ -214,7 +290,7 @@ type
 	This is the type of a reference to immutable CFSets.
 }
 type
-	CFSetRef = ^SInt32; { an opaque 32-bit type }
+	CFSetRef = ^SInt32; { an opaque type }
 	CFSetRefPtr = ^CFSetRef;
 
 {!
@@ -307,6 +383,7 @@ function CFSetCreateCopy( allocator: CFAllocatorRef; theSet: CFSetRef ): CFSetRe
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFSet. The set starts empty, and can grow to this
 		number of values (and it can have less). If this parameter
@@ -314,6 +391,14 @@ function CFSetCreateCopy( allocator: CFAllocatorRef; theSet: CFSetRef ): CFSetRe
 		only limited by address space and available memory
 		constraints). If this parameter is negative, the behavior is
 		undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+    by the CFSet. Pass 0 for no hint. The implementation may
+    ignore this hint, or may use it to optimize various
+    operations. A set's actual capacity is only limited by 
+    address space and available memory constraints). If this 
+    parameter is negative, the behavior is undefined.
+#endif
 	@param callBacks A C pointer to a CFSetCallBacks structure
 		initialized with the callbacks for the set to use on each
 		value in the set. A copy of the contents of the
@@ -353,14 +438,26 @@ function CFSetCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex; {cons
 		parameter may be NULL in which case the current default
 		CFAllocator is used. If this reference is not a valid
 		CFAllocator, the behavior is undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
 	@param capacity The maximum number of values that can be contained
 		by the CFSet. The set starts with the same values as the
-                set to be copied, and can grow to this number of values.
-                If this parameter is 0, the set's maximum capacity is 
-                unlimited (or rather, only limited by address space and 
-                available memory constraints). This parameter must be 
-                greater than or equal to the count of the set which is to
-                be copied, or the behavior is undefined.
+    set to be copied, and can grow to this number of values.
+    If this parameter is 0, the set's maximum capacity is 
+    unlimited (or rather, only limited by address space and 
+    available memory constraints). This parameter must be 
+    greater than or equal to the count of the set which is to
+    be copied, or the behavior is undefined.
+#else
+  @param capacity A hint about the number of values that will be held
+    by the CFSet. Pass 0 for no hint. The implementation may
+    ignore this hint, or may use it to optimize various
+    operations. A set's actual capacity is only limited by
+    address space and available memory constraints). 
+    This parameter must be greater than or equal
+    to the count of the set which is to be copied, or the
+    behavior is undefined. If this parameter is negative, the
+    behavior is undefined.
+#endif
 	@param theSet The set which is to be copied. The values from the
 		set are copied as pointers into the new set (that is,
 		the values themselves are copied, not that which the values
@@ -488,8 +585,11 @@ procedure CFSetApplyFunction( theSet: CFSetRef; applier: CFSetApplierFunction; c
 	Adds the value to the set if it is not already present.
 	@param theSet The set to which the value is to be added. If this
 		parameter is not a valid mutable CFSet, the behavior is
-		undefined. If the set is a fixed-capacity set and it
+		undefined.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+		If the set is a fixed-capacity set and it
 		is full before this operation, the behavior is undefined.
+#endif
 	@param value The value to add to the set. The value is retained by
 		the set using the retain callback provided when the set
 		was created. If the value is not of the sort expected by the
@@ -558,5 +658,7 @@ procedure CFSetRemoveValue( theSet: CFMutableSetRef; value: {const} UnivPtr ); e
 }
 procedure CFSetRemoveAllValues( theSet: CFMutableSetRef ); external name '_CFSetRemoveAllValues';
 
+{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
 
 end.
+{$endc} {not MACOSALLINCLUDE}

Some files were not shown because too many files changed in this diff