Browse Source

* merged objc branch:
+ basic support for Objective-Pascal: objcclass, objcprotocol,
objcselector on all Darwin platforms (ppc32/64, i386, x86_64, ARM),
see http://wiki.freepascal.org/FPC_PasCocoa and
http://wiki.freepascal.org/FPC_PasCocoa/Differences for some dialect
details. Use {$modeswitch objectivec1} to activate
+ Cocoa, iPhone/UIKit and WebKit interfaces for use with the new
syntax mode

git-svn-id: trunk@14068 -

Jonas Maebe 15 năm trước cách đây
mục cha
commit
c1cdf1e087
100 tập tin đã thay đổi với 13648 bổ sung877 xóa
  1. 528 2
      .gitattributes
  2. 18 3
      compiler/aasmbase.pas
  3. 10 1
      compiler/aasmdata.pas
  4. 19 5
      compiler/aasmtai.pas
  5. 123 8
      compiler/aggas.pas
  6. 1 1
      compiler/arm/cpunode.pas
  7. 6 1
      compiler/assemble.pas
  8. 2 0
      compiler/compinnr.inc
  9. 15 0
      compiler/cutils.pas
  10. 17 0
      compiler/dbgbase.pas
  11. 126 53
      compiler/dbgdwarf.pas
  12. 53 10
      compiler/defcmp.pas
  13. 1 1
      compiler/defutil.pas
  14. 9 0
      compiler/export.pas
  15. 2 1
      compiler/expunix.pas
  16. 7 7
      compiler/htypechk.pas
  17. 13 2
      compiler/i386/ag386nsm.pas
  18. 77 9
      compiler/msg/errore.msg
  19. 18 2
      compiler/msgidx.inc
  20. 345 319
      compiler/msgtxt.inc
  21. 6 6
      compiler/nadd.pas
  22. 221 16
      compiler/ncal.pas
  23. 4 1
      compiler/ncgcal.pas
  24. 71 10
      compiler/ncgmem.pas
  25. 32 32
      compiler/ncgobjc.pas
  26. 5 1
      compiler/ncgrtti.pas
  27. 5 1
      compiler/ncgutil.pas
  28. 8 5
      compiler/ncnv.pas
  29. 23 1
      compiler/ninl.pas
  30. 35 12
      compiler/nmem.pas
  31. 162 20
      compiler/nobj.pas
  32. 65 53
      compiler/nobjc.pas
  33. 4 2
      compiler/node.pas
  34. 1 1
      compiler/nutils.pas
  35. 1448 0
      compiler/objcgutl.pas
  36. 858 0
      compiler/objcutil.pas
  37. 21 3
      compiler/ogbase.pas
  38. 11 2
      compiler/ogcoff.pas
  39. 22 4
      compiler/ogelf.pas
  40. 57 4
      compiler/pdecl.pas
  41. 128 19
      compiler/pdecobj.pas
  42. 94 18
      compiler/pdecsub.pas
  43. 21 6
      compiler/pdecvar.pas
  44. 123 99
      compiler/pexports.pas
  45. 56 29
      compiler/pexpr.pas
  46. 15 21
      compiler/pmodules.pas
  47. 34 25
      compiler/powerpc/agppcmpw.pas
  48. 1 0
      compiler/powerpc64/cpunode.pas
  49. 1 1
      compiler/ppcgen/cgppc.pas
  50. 1 1
      compiler/ppu.pas
  51. 1 1
      compiler/pstatmnt.pas
  52. 1 0
      compiler/psystem.pas
  53. 1 1
      compiler/ptconst.pas
  54. 29 9
      compiler/ptype.pas
  55. 13 4
      compiler/scanner.pas
  56. 2 0
      compiler/symbase.pas
  57. 23 5
      compiler/symconst.pas
  58. 340 23
      compiler/symdef.pas
  59. 19 0
      compiler/symsym.pas
  60. 66 1
      compiler/symtable.pas
  61. 6 0
      compiler/systems.pas
  62. 8 0
      compiler/tokens.pas
  63. 23 7
      compiler/utils/ppudump.pp
  64. 8 1
      compiler/x86/agx86att.pas
  65. 20 0
      compiler/x86/agx86int.pas
  66. 2 2
      compiler/x86/cgx86.pas
  67. 1 0
      compiler/x86_64/cpunode.pas
  68. 55 3
      packages/Makefile
  69. 8 2
      packages/Makefile.fpc
  70. 2263 0
      packages/cocoaint/Makefile
  71. 30 0
      packages/cocoaint/Makefile.fpc
  72. 101 0
      packages/cocoaint/src/CocoaAll.pas
  73. 60 0
      packages/cocoaint/src/CoreData.pas
  74. 83 0
      packages/cocoaint/src/Foundation.pas
  75. 3 0
      packages/cocoaint/src/IBMacros.pp
  76. 132 0
      packages/cocoaint/src/InlineFunctions.inc
  77. 1938 0
      packages/cocoaint/src/IvarSize.pas
  78. 658 0
      packages/cocoaint/src/NSDelegatesAll.pas
  79. 57 0
      packages/cocoaint/src/UndefinedClasses.inc
  80. 117 0
      packages/cocoaint/src/UndefinedTypes.inc
  81. 65 0
      packages/cocoaint/src/WebKit.pas
  82. 116 0
      packages/cocoaint/src/WebKitDelegatesAll.pas
  83. 181 0
      packages/cocoaint/src/appkit/AppKit.inc
  84. 0 0
      packages/cocoaint/src/appkit/CIColor.inc
  85. 118 0
      packages/cocoaint/src/appkit/NSATSTypesetter.inc
  86. 230 0
      packages/cocoaint/src/appkit/NSAccessibility.inc
  87. 78 0
      packages/cocoaint/src/appkit/NSActionCell.inc
  88. 81 0
      packages/cocoaint/src/appkit/NSAffineTransform.inc
  89. 126 0
      packages/cocoaint/src/appkit/NSAlert.inc
  90. 173 0
      packages/cocoaint/src/appkit/NSAnimation.inc
  91. 60 0
      packages/cocoaint/src/appkit/NSAnimationContext.inc
  92. 31 0
      packages/cocoaint/src/appkit/NSAppleScriptExtensions.inc
  93. 278 0
      packages/cocoaint/src/appkit/NSApplication.inc
  94. 31 0
      packages/cocoaint/src/appkit/NSApplicationScripting.inc
  95. 127 0
      packages/cocoaint/src/appkit/NSArrayController.inc
  96. 264 0
      packages/cocoaint/src/appkit/NSAttributedString.inc
  97. 167 0
      packages/cocoaint/src/appkit/NSBezierPath.inc
  98. 151 0
      packages/cocoaint/src/appkit/NSBitmapImageRep.inc
  99. 127 0
      packages/cocoaint/src/appkit/NSBox.inc
  100. 253 0
      packages/cocoaint/src/appkit/NSBrowser.inc

+ 528 - 2
.gitattributes

@@ -305,6 +305,8 @@ compiler/nopt.pas svneol=native#text/plain
 compiler/nset.pas svneol=native#text/plain
 compiler/nstate.pas svneol=native#text/plain
 compiler/nutils.pas svneol=native#text/plain
+compiler/objcgutl.pas svneol=native#text/plain
+compiler/objcutil.pas svneol=native#text/plain
 compiler/ogbase.pas svneol=native#text/plain
 compiler/ogcoff.pas svneol=native#text/plain
 compiler/ogelf.pas svneol=native#text/plain
@@ -981,6 +983,487 @@ packages/chm/src/lzxcompressthread.pas svneol=native#text/plain
 packages/chm/src/paslznonslide.pas svneol=native#text/plain
 packages/chm/src/paslzx.pas svneol=native#text/plain
 packages/chm/src/paslzxcomp.pas svneol=native#text/plain
+packages/cocoaint/Makefile svneol=native#text/plain
+packages/cocoaint/Makefile.fpc svneol=native#text/plain
+packages/cocoaint/src/CocoaAll.pas svneol=native#text/plain
+packages/cocoaint/src/CoreData.pas svneol=native#text/plain
+packages/cocoaint/src/Foundation.pas svneol=native#text/plain
+packages/cocoaint/src/IBMacros.pp svneol=native#text/plain
+packages/cocoaint/src/InlineFunctions.inc svneol=native#text/plain
+packages/cocoaint/src/IvarSize.pas svneol=native#text/plain
+packages/cocoaint/src/NSDelegatesAll.pas svneol=native#text/plain
+packages/cocoaint/src/UndefinedClasses.inc svneol=native#text/plain
+packages/cocoaint/src/UndefinedTypes.inc svneol=native#text/plain
+packages/cocoaint/src/WebKit.pas svneol=native#text/plain
+packages/cocoaint/src/WebKitDelegatesAll.pas svneol=native#text/plain
+packages/cocoaint/src/appkit/AppKit.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/CIColor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSATSTypesetter.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAccessibility.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSActionCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAffineTransform.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAlert.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAnimation.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAnimationContext.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAppleScriptExtensions.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSApplication.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSApplicationScripting.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSArrayController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSAttributedString.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSBezierPath.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSBitmapImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSBox.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSBrowser.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSBrowserCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSButton.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSButtonCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCIImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCachedImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSClipView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCollectionView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorList.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorPanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorPicker.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorPicking.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorSpace.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSColorWell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSComboBox.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSComboBoxCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSControl.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCursor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSCustomImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDatePicker.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDatePickerCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDictionaryController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDockTile.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDocument.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDocumentController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDocumentScripting.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDragging.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSDrawer.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSEPSImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSErrors.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSEvent.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFileWrapper.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFont.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFontDescriptor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFontManager.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFontPanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSForm.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSFormCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSGlyphGenerator.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSGlyphInfo.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSGradient.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSGraphics.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSGraphicsContext.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSHelpManager.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSImage.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSImageCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSImageView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSInputManager.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSInputServer.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSInterfaceStyle.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSKeyValueBinding.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSLayoutManager.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSLevelIndicator.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSLevelIndicatorCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMatrix.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMenu.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMenuItem.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMenuItemCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMenuView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMovie.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMovieView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSMoview.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSNib.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSNibLoading.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSObjectController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSOpenGL.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSOpenGLView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSOpenPanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSOutlineView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPDFImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPICTImageRep.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPageLayout.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSParagraphStyle.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPasteboard.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPathCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPathComponentCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPathControl.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPersistentDocument.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPopUpButton.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPopUpButtonCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPredicateEditor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPrintInfo.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPrintOperation.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPrintPanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSPrinter.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSProgressIndicator.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSQuickDrawView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSResponder.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSRuleEditor.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSRulerMarker.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSRulerView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSavePanel.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSScreen.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSScrollView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSScroller.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSearchField.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSearchFieldCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSecureTextField.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSegmentedControl.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSShadow.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSlider.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSliderCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSound.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSpeechRecognizer.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSpeechSynthesizer.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSpellChecker.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSpellProtocol.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSSplitView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSStatusBar.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSStatusItem.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSStepper.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSStepperCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSStringDrawing.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTabView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTabViewItem.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTableColumn.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTableHeaderCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTableHeaderView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTableView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSText.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextAttachment.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextContainer.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextField.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextFieldCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextInputClient.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextList.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextStorage.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextStorageScripting.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextTable.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTextView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTokenField.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTokenFieldCell.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSToolbar.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSToolbarItem.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSToolbarItemGroup.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTrackingArea.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTreeController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSTreeNode.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSUserDefaultsController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSValidatedUserInterfaceItem.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSView.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSViewController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSWindow.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSWindowController.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSWindowScripting.inc svneol=native#text/plain
+packages/cocoaint/src/appkit/NSWorkspace.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/CoreData.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/CoreDataDefines.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/CoreDataErrors.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSAtomicStore.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSAtomicStoreCacheNode.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSAttributeDescription.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSEntityDescription.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSEntityMapping.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSEntityMigrationPolicy.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSFetchRequest.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSFetchRequestExpression.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSFetchedPropertyDescription.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSManagedObject.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSManagedObjectContext.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSManagedObjectID.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSManagedObjectModel.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSMappingModel.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSMigrationManager.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSPersistentStore.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSPersistentStoreCoordinator.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSPropertyDescription.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSPropertyMapping.inc svneol=native#text/plain
+packages/cocoaint/src/coredata/NSRelationshipDescription.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/Foundation.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAffineTransform.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAppleEventDescriptor.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAppleEventManager.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAppleScript.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSArchiver.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSArray.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAttributedString.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSAutoreleasePool.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSBundle.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSCalendar.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSCalendarDate.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSCharacterSet.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSClassDescription.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSCoder.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSComparisonPredicate.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSCompoundPredicate.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSConnection.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSData.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDate.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDateFormatter.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDecimal.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDecimalNumber.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDelegatesAll.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDictionary.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDistantObject.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDistributedLock.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSDistributedNotificationCenter.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSEnumerator.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSError.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSException.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSExpression.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSFileHandle.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSFileManager.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSFormatter.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSGarbageCollector.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSGeometry.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSHFSFileTypes.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSHTTPCookie.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSHTTPCookieStorage.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSHashTable.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSHost.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSIndexPath.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSIndexSet.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSKeyValueCoding.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSKeyValueObserving.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSKeyedArchiver.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSLocale.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSLock.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSMapTable.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSMetadata.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSMethodSignature.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSNetServices.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSNotification.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSNotificationQueue.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSNull.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSNumberFormatter.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSObjCRuntime.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSObject.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSObjectScripting.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSOperation.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPathUtilities.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPointerArray.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPort.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPortCoder.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPortMessage.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPortNameServer.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPredicate.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSProcessInfo.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSPropertyList.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSProtocolChecker.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSProxy.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSRange.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSRunLoop.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScanner.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptClassDescription.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptCoercionHandler.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptCommand.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptCommandDescription.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptExecutionContext.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptKeyValueCoding.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptObjectSpecifiers.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptStandardSuiteCommands.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptSuiteRegistry.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSScriptWhoseTests.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSSet.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSSortDescriptor.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSSpellServer.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSStream.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSString.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSTask.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSThread.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSTimeZone.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSTimer.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURL.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLAuthenticationChallenge.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLCache.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLConnection.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLCredential.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLCredentialStorage.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLDownload.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLError.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLHandle.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLProtectionSpace.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLProtocol.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLRequest.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSURLResponse.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSUndoManager.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSUserDefaults.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSValue.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSValueTransformer.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLDTD.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLDTDNode.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLDocument.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLElement.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLNode.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLNodeOptions.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSXMLParser.inc svneol=native#text/plain
+packages/cocoaint/src/foundation/NSZone.inc svneol=native#text/plain
+packages/cocoaint/src/iPhoneAll.pas svneol=native#text/plain
+packages/cocoaint/src/patches/NSBundle.patch svneol=native#text/plain
+packages/cocoaint/src/uikit/UIKit.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMAbstractView.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMAttr.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCDATASection.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSS.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSCharsetRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSFontFaceRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSImportRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSMediaRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSPageRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSPrimitiveValue.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSRuleList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSStyleDeclaration.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSStyleRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSStyleSheet.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSUnknownRule.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSValue.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCSSValueList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCharacterData.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMComment.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCore.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMCounter.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMDocument.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMDocumentFragment.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMDocumentType.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEntity.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEntityReference.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEventException.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEventListener.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEventTarget.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMEvents.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMException.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMExtensions.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLAnchorElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLAppletElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLAreaElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLBRElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLBaseElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLBaseFontElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLBodyElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLButtonElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLCollection.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLDListElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLDirectoryElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLDivElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLDocument.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLEmbedElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLFieldSetElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLFontElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLFormElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLFrameElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLFrameSetElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLHRElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLHeadElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLHeadingElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLHtmlElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLIFrameElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLImageElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLInputElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLIsIndexElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLLIElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLLabelElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLLegendElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLLinkElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLMapElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLMarqueeElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLMenuElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLMetaElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLModElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLOListElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLObjectElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLOptGroupElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLOptionElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLOptionsCollection.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLParagraphElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLParamElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLPreElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLQuoteElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLScriptElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLSelectElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLStyleElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableCaptionElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableCellElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableColElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableRowElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTableSectionElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTextAreaElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLTitleElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMHTMLUListElement.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMImplementation.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMKeyboardEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMMediaList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMMouseEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMMutationEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMNamedNodeMap.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMNode.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMNodeIterator.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMNodeList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMNotation.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMObject.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMOverflowEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMProcessingInstruction.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMRGBColor.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMRange.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMRangeException.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMRanges.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMRect.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMStyleSheet.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMStyleSheetList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMText.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMTraversal.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMTreeWalker.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMUIEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMWheelEvent.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMXPathException.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMXPathExpression.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMXPathNSResolver.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/DOMXPathResult.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/UndefinedClasses.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/UndefinedTypes.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebArchive.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebBackForwardList.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebDOMOperations.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebDataSource.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebDocument.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebDownload.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebEditingDelegate.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebFrame.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebFrameLoadDelegate.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebFrameView.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebHistory.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebHistoryItem.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebKit.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebKitErrors.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebPlugin.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebPluginContainer.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebPluginViewFactory.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebPolicyDelegate.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebPreferences.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebResource.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebResourceLoadDelegate.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebScriptObject.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebUIDelegate.inc svneol=native#text/plain
+packages/cocoaint/src/webkit/WebView.inc svneol=native#text/plain
+packages/cocoaint/utils/Make[!!-~]Cocoa[!!-~]Headers.txt svneol=native#text/plain
+packages/cocoaint/utils/Make[!!-~]iPhone[!!-~]Headers.txt svneol=native#text/plain
+packages/cocoaint/utils/Using[!!-~]Installer[!!-~]Script.txt svneol=native#text/plain
+packages/cocoaint/utils/install_objp.sh svneol=native#text/plain
+packages/cocoaint/utils/objp_parser.php svneol=native#text/plain
+packages/cocoaint/utils/parser.php svneol=native#text/plain
+packages/cocoaint/utils/pascocoa_parser.php svneol=native#text/plain
 packages/dbus/Makefile svneol=native#text/plain
 packages/dbus/Makefile.fpc svneol=native#text/plain
 packages/dbus/examples/Makefile svneol=native#text/plain
@@ -5813,8 +6296,10 @@ rtl/inc/mmatimp.inc svneol=native#text/plain
 rtl/inc/mouse.inc svneol=native#text/plain
 rtl/inc/mouseh.inc svneol=native#text/plain
 rtl/inc/mvecimp.inc svneol=native#text/plain
-rtl/inc/objc1.pp svneol=native#text/plain
-rtl/inc/objc1h.inc svneol=native#text/plain
+rtl/inc/objc.pp svneol=native#text/plain
+rtl/inc/objc1.inc svneol=native#text/plain
+rtl/inc/objcbase.pp svneol=native#text/plain
+rtl/inc/objcnf.inc svneol=native#text/plain
 rtl/inc/objects.pp svneol=native#text/plain
 rtl/inc/objpas.inc svneol=native#text/plain
 rtl/inc/objpash.inc svneol=native#text/plain
@@ -8076,6 +8561,8 @@ tests/test/opt/twpo5.pp svneol=native#text/plain
 tests/test/opt/twpo6.pp svneol=native#text/plain
 tests/test/opt/twpo7.pp svneol=native#text/plain
 tests/test/opt/uwpo2.pp svneol=native#text/plain
+tests/test/packages/cocoaint/tobjcnh1.pp svneol=native#text/plain
+tests/test/packages/cocoaint/tvarpara.pp svneol=native#text/plain
 tests/test/packages/fcl-base/tascii85.pp svneol=native#text/plain
 tests/test/packages/fcl-base/tgettext1.pp svneol=native#text/plain
 tests/test/packages/fcl-db/assertions.pas svneol=native#text/plain
@@ -8339,6 +8826,43 @@ tests/test/tmsg2.pp svneol=native#text/plain
 tests/test/tmsg3.pp svneol=native#text/plain
 tests/test/tmsg4.pp svneol=native#text/plain
 tests/test/tmt1.pp svneol=native#text/plain
+tests/test/tobjc1.pp svneol=native#text/plain
+tests/test/tobjc10.pp svneol=native#text/plain
+tests/test/tobjc11.pp svneol=native#text/plain
+tests/test/tobjc12.pp svneol=native#text/plain
+tests/test/tobjc13.pp svneol=native#text/plain
+tests/test/tobjc13a.pp svneol=native#text/plain
+tests/test/tobjc13b.pp svneol=native#text/plain
+tests/test/tobjc14.pp svneol=native#text/plain
+tests/test/tobjc15.pp svneol=native#text/plain
+tests/test/tobjc16.pp svneol=native#text/plain
+tests/test/tobjc17.pp svneol=native#text/plain
+tests/test/tobjc18.pp svneol=native#text/plain
+tests/test/tobjc19.pp svneol=native#text/plain
+tests/test/tobjc2.pp svneol=native#text/plain
+tests/test/tobjc20.pp svneol=native#text/plain
+tests/test/tobjc21.pp svneol=native#text/plain
+tests/test/tobjc22.pp svneol=native#text/plain
+tests/test/tobjc23.pp svneol=native#text/plain
+tests/test/tobjc3.pp svneol=native#text/plain
+tests/test/tobjc4.pp svneol=native#text/plain
+tests/test/tobjc4a.pp svneol=native#text/plain
+tests/test/tobjc5.pp svneol=native#text/plain
+tests/test/tobjc5a.pp svneol=native#text/plain
+tests/test/tobjc6.pp svneol=native#text/plain
+tests/test/tobjc7.pp svneol=native#text/plain
+tests/test/tobjc7a.pp svneol=native#text/plain
+tests/test/tobjc7b.pp svneol=native#text/plain
+tests/test/tobjc7c.pp svneol=native#text/plain
+tests/test/tobjc8.pp svneol=native#text/plain
+tests/test/tobjc8a.pp svneol=native#text/plain
+tests/test/tobjc9.pp svneol=native#text/plain
+tests/test/tobjc9a.pp svneol=native#text/plain
+tests/test/tobjc9b.pp svneol=native#text/plain
+tests/test/tobjcl1.pp svneol=native#text/plain
+tests/test/tobjcl2.pp svneol=native#text/plain
+tests/test/tobjcl3.pp svneol=native#text/plain
+tests/test/tobjcl4.pp svneol=native#text/plain
 tests/test/tobject1.pp svneol=native#text/plain
 tests/test/tobject2.pp svneol=native#text/plain
 tests/test/tobject3.pp svneol=native#text/plain
@@ -8657,6 +9181,8 @@ tests/test/units/sysutils/tfloattostr.pp svneol=native#text/plain
 tests/test/units/sysutils/tlocale.pp svneol=native#text/plain
 tests/test/units/sysutils/tsscanf.pp svneol=native#text/plain
 tests/test/units/sysutils/tstrtobool.pp svneol=native#text/plain
+tests/test/uobjc7.pp svneol=native#text/plain
+tests/test/uobjcl1.pp svneol=native#text/plain
 tests/test/uprec6.pp svneol=native#text/plain
 tests/test/uprec7.pp svneol=native#text/plain
 tests/test/uprocext1.pp svneol=native#text/plain

+ 18 - 3
compiler/aasmbase.pas

@@ -37,7 +37,10 @@ interface
        ;
 
     type
-       TAsmsymbind=(AB_NONE,AB_EXTERNAL,AB_COMMON,AB_LOCAL,AB_GLOBAL,AB_WEAK_EXTERNAL);
+       TAsmsymbind=(
+         AB_NONE,AB_EXTERNAL,AB_COMMON,AB_LOCAL,AB_GLOBAL,AB_WEAK_EXTERNAL,
+         { global in the current program/library, but not visible outside it }
+         AB_PRIVATE_EXTERN);
 
        TAsmsymtype=(
          AT_NONE,AT_FUNCTION,AT_DATA,AT_SECTION,AT_LABEL,
@@ -92,6 +95,7 @@ interface
          sec_toc,
          sec_init,
          sec_fini,
+         {Objective-C common and fragile ABI }
          sec_objc_class,
          sec_objc_meta_class,
          sec_objc_cat_cls_meth,
@@ -116,7 +120,17 @@ interface
          sec_objc_property,
          sec_objc_image_info,
          sec_objc_cstring_object,
-         sec_objc_sel_fixup
+         sec_objc_sel_fixup,
+         { Objective-C non-fragile ABI }
+         sec_objc_data,
+         sec_objc_const,
+         sec_objc_sup_refs,
+         sec_data_coalesced,
+         sec_objc_classlist,
+         sec_objc_nlclasslist,
+         sec_objc_catlist,
+         sec_objc_nlcatlist,
+         sec_objc_protolist
        );
 
        TAsmSectionOrder = (secorder_begin,secorder_default,secorder_end);
@@ -390,7 +404,8 @@ implementation
         TAsmLabel(result).labeltype:=labeltype;
         TAsmLabel(result).is_set:=false;
         case bind of
-          AB_GLOBAL:
+          AB_GLOBAL,
+          AB_PRIVATE_EXTERN:
             result.increfs;
           AB_LOCAL:
             ;

+ 10 - 1
compiler/aasmdata.pas

@@ -65,6 +65,9 @@ interface
         al_resourcestrings,
         { Objective-C related sections }
         al_objc_data,
+        { keep pool data separate, so we can generate new pool entries
+          while emitting other data }
+        al_objc_pools,
         al_end
       );
 
@@ -79,7 +82,12 @@ interface
          sp_ansistr,
          sp_widestr,
          sp_unicodestr,
-         sp_objcselector
+         sp_objcclassnamerefs,
+         sp_varnamerefs,
+         sp_objcclassnames,
+         sp_objcvarnames,
+         sp_objcvartypes,
+         sp_objcprotocolrefs
       );
       
     const
@@ -103,6 +111,7 @@ interface
         'al_picdata',
         'al_resourcestrings',
         'al_objc_data',
+        'al_objc_pools',
         'al_end'
       );
 

+ 19 - 5
compiler/aasmtai.pas

@@ -265,7 +265,8 @@ interface
       TAsmDirective=(
         asd_non_lazy_symbol_pointer,asd_indirect_symbol,asd_lazy_symbol_pointer,
         asd_extern,asd_nasm_import, asd_toc_entry, asd_mod_init_func, asd_mod_term_func,
-        asd_reference,asd_no_dead_strip,asd_weak_reference
+        asd_reference,asd_no_dead_strip,asd_weak_reference,asd_lazy_reference,
+        asd_weak_definition
       );
 
     const
@@ -275,7 +276,7 @@ interface
       directivestr : array[TAsmDirective] of string[23]=(
         'non_lazy_symbol_pointer','indirect_symbol','lazy_symbol_pointer',
         'extern','nasm_import', 'tc', 'mod_init_func', 'mod_term_func', 'reference',
-        'no_dead_strip','weak_reference'
+        'no_dead_strip','weak_reference','lazy_reference','weak_definition'
       );
 
     type
@@ -324,13 +325,16 @@ interface
 
        { Generates a common label }
        tai_symbol = class(tai)
-          is_global : boolean;
           sym       : tasmsymbol;
+          value     : puint;
           size      : longint;
+          is_global,
+          has_value : boolean;
           constructor Create(_sym:tasmsymbol;siz:longint);
           constructor Create_Global(_sym:tasmsymbol;siz:longint);
           constructor Createname(const _name : string;_symtyp:Tasmsymtype;siz:longint);
           constructor Createname_global(const _name : string;_symtyp:Tasmsymtype;siz:longint);
+          constructor Createname_global_value(const _name : string;_symtyp:Tasmsymtype;siz:longint;val:ptruint);
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure derefimpl;override;
@@ -932,7 +936,9 @@ implementation
          typ:=ait_symbol;
          sym:=_sym;
          size:=siz;
-         sym.bind:=AB_GLOBAL;
+         { don't override PRIVATE_EXTERN with GLOBAL }
+         if not(sym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN]) then
+           sym.bind:=AB_GLOBAL;
          is_global:=true;
       end;
 
@@ -957,6 +963,14 @@ implementation
       end;
 
 
+    constructor tai_symbol.createname_global_value(const _name: string;_symtyp: tasmsymtype; siz: longint; val: ptruint);
+      begin
+        Createname_global(_name,_symtyp,siz);
+        value:=val;
+        has_value:=true;
+      end;
+
+
     constructor tai_symbol.ppuload(t:taitype;ppufile:tcompilerppufile);
       begin
         inherited ppuload(t,ppufile);
@@ -1518,7 +1532,7 @@ implementation
         typ:=ait_label;
         labsym:=_labsym;
         labsym.is_set:=true;
-        is_global:=(labsym.bind=AB_GLOBAL);
+        is_global:=(labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN]);
       end;
 
 

+ 123 - 8
compiler/aggas.pas

@@ -246,7 +246,7 @@ implementation
 
     function TGNUAssembler.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
       const
-        secnames : array[TAsmSectiontype] of string[length('.objc_meth_var_types')] = ('',
+        secnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           '.text',
           '.data',
 { why doesn't .rodata work? (FK) }
@@ -303,9 +303,18 @@ implementation
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
-        secnames_pic : array[TAsmSectiontype] of string[length('.objc_meth_var_types')] = ('',
+        secnames_pic : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           '.text',
           '.data.rel',
           '.data.rel',
@@ -347,7 +356,16 @@ implementation
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA, __objc_data',
+          '__DATA, __objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
       var
         sep     : string[3];
@@ -421,7 +439,7 @@ implementation
          system_x86_64_darwin,
          system_arm_darwin:
            begin
-             if (atype = sec_stub) then
+             if (atype in [sec_stub,sec_objc_data,sec_objc_const,sec_data_coalesced]) then
                AsmWrite('.section ');
            end
          else
@@ -989,7 +1007,12 @@ implementation
              begin
                if (tai_label(hp).labsym.is_used) then
                 begin
-                  if tai_label(hp).labsym.bind=AB_GLOBAL then
+                  if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then
+                    begin
+                      AsmWrite(#9'.private_extern ');
+                      AsmWriteln(tai_label(hp).labsym.name);
+                    end;
+                  if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                    begin
                      AsmWrite('.globl'#9);
                      AsmWriteLn(tai_label(hp).labsym.name);
@@ -1001,6 +1024,11 @@ implementation
 
            ait_symbol :
              begin
+               if (tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN) then
+                 begin
+                   AsmWrite(#9'.private_extern ');
+                   AsmWriteln(tai_symbol(hp).sym.name);
+                 end;
                if (target_info.system = system_powerpc64_linux) and
                  (tai_symbol(hp).sym.typ = AT_FUNCTION) and (cs_profile in current_settings.moduleswitches) then
                  begin
@@ -1041,7 +1069,10 @@ implementation
                          AsmWriteLn(',' + sepChar + 'function');
                      end;
                  end;
-               AsmWriteLn(tai_symbol(hp).sym.name + ':');
+               if not(tai_symbol(hp).has_value) then
+                 AsmWriteLn(tai_symbol(hp).sym.name + ':')
+               else
+                 AsmWriteLn(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value));
              end;
 {$ifdef arm}
            ait_thumb_func:
@@ -1296,6 +1327,81 @@ implementation
                 result:='.section __OBJC, __sel_fixup, regular, no_dead_strip';
                 exit;
               end;
+            sec_objc_message_refs:
+              begin
+                if (target_info.system in system_objc_nfabi) then
+                  begin
+                    result:='.section __DATA, __objc_selrefs, literal_pointers, no_dead_strip';
+                    exit;
+                  end;
+              end;
+            sec_objc_cls_refs:
+              begin
+                if (target_info.system in system_objc_nfabi) then
+                  begin
+                    result:='.section __DATA, __objc_clsrefs, regular, no_dead_strip';
+                    exit;
+                  end;
+              end;
+            sec_objc_meth_var_names,
+            sec_objc_class_names:
+              begin
+                if (target_info.system in system_objc_nfabi) then
+                  begin
+                    result:='.cstring';
+                    exit
+                  end;
+              end;
+            sec_objc_inst_meth,
+            sec_objc_cls_meth,
+            sec_objc_cat_inst_meth,
+            sec_objc_cat_cls_meth:
+              begin
+                if (target_info.system in system_objc_nfabi) then
+                  begin
+                    result:='.section __DATA, __objc_const';
+                    exit;
+                  end;
+              end;
+            sec_objc_meta_class,
+            sec_objc_class:
+              begin
+                if (target_info.system in system_objc_nfabi) then
+                  begin
+                    result:='.section __DATA, __objc_data';
+                    exit;
+                  end;
+              end;
+            sec_objc_sup_refs:
+              begin
+                result:='.section __DATA, __objc_superrefs, regular, no_dead_strip';
+                exit
+              end;
+            sec_objc_classlist:
+              begin
+                result:='.section __DATA, __objc_classlist, regular, no_dead_strip';
+                exit
+              end;
+            sec_objc_nlclasslist:
+              begin
+                result:='.section __DATA, __objc_nlclasslist, regular, no_dead_strip';
+                exit
+              end;
+            sec_objc_catlist:
+              begin
+                result:='.section __DATA, __objc_catlist, regular, no_dead_strip';
+                exit
+              end;
+            sec_objc_nlcatlist:
+              begin
+                result:='.section __DATA, __objc_nlcatlist, regular, no_dead_strip';
+                exit
+              end;
+            sec_objc_protolist:
+              begin
+                result:='.section __DATA, __objc_protolist, coalesced, no_dead_strip';
+                exit;
+              end;
           end;
         result := inherited sectionname(atype,aname,aorder);
       end;
@@ -1372,7 +1478,16 @@ implementation
          sec_none (* sec_objc_property *),
          sec_none (* sec_objc_image_info *),
          sec_none (* sec_objc_cstring_object *),
-         sec_none (* sec_objc_sel_fixup *)
+         sec_none (* sec_objc_sel_fixup *),
+         sec_none (* sec_objc_data *),
+         sec_none (* sec_objc_const *),
+         sec_none (* sec_objc_sup_refs *),
+         sec_none (* sec_data_coalesced *),
+         sec_none (* sec_objc_classlist *),
+         sec_none (* sec_objc_nlclasslist *),
+         sec_none (* sec_objc_catlist *),
+         sec_none (* sec_objc_nlcatlist *),
+         sec_none (* sec_objc_protlist *)
         );
       begin
         Result := inherited SectionName (SecXTable [AType], AName, AOrder);

+ 1 - 1
compiler/arm/cpunode.pas

@@ -29,7 +29,7 @@ unit cpunode;
 
     uses
        { generic nodes }
-       ncgbas,ncgld,ncgflw,ncgcnv,ncgmem,ncgcon,ncgcal,ncgset,ncginl,ncgopt,ncgmat,
+       ncgbas,ncgld,ncgflw,ncgcnv,ncgmem,ncgcon,ncgcal,ncgset,ncginl,ncgopt,ncgmat,ncgobjc,
        { to be able to only parts of the generic code,
          the processor specific nodes must be included
          after the generic one (FK)

+ 6 - 1
compiler/assemble.pas

@@ -992,7 +992,12 @@ Implementation
                  Tai_section(hp).sec:=ObjData.CurrObjSec;
                end;
              ait_symbol :
-               ObjData.SymbolDefine(Tai_symbol(hp).sym);
+               begin
+                 { needs extra support in the internal assembler }
+                 if tai_symbol(hp).has_value then
+                   internalerror(2009090804);
+                 ObjData.SymbolDefine(Tai_symbol(hp).sym);
+               end;
              ait_label :
                ObjData.SymbolDefine(Tai_label(hp).labsym);
              ait_string :

+ 2 - 0
compiler/compinnr.inc

@@ -77,6 +77,8 @@ const
    in_rol_x             = 67;
    in_rol_x_x           = 68;
    in_objc_selector_x   = 69;
+   in_objc_protocol_x   = 70;
+   in_objc_encode_x     = 71;
 
 
 { Internal constant functions }

+ 15 - 0
compiler/cutils.pas

@@ -126,6 +126,9 @@ interface
     { inverse of pchar2pshortstring }
     function pshortstring2pchar(p : pshortstring) : pchar;
 
+    { allocate a new pchar with the contents of a}
+    function ansistring2pchar(const a: ansistring) : pchar;
+
     { Ansistring (pchar+length) support }
     procedure ansistringdispose(var p : pchar;length : longint);
     function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
@@ -975,6 +978,18 @@ implementation
       end;
 
 
+    function ansistring2pchar(const a: ansistring) : pchar;
+      var
+        len: ptrint;
+      begin
+        len:=length(a);
+        getmem(result,len+1);
+        if (len<>0) then
+          move(a[1],result[0],len);
+        result[len]:=#0;
+      end;
+
+
     function lowercase(c : char) : char;
        begin
           case c of

+ 17 - 0
compiler/dbgbase.pas

@@ -28,6 +28,7 @@ interface
     uses
       cclasses,
       systems,
+      parabase,
       symconst,symbase,symdef,symtype,symsym,symtable,
       fmodule,
       aasmtai,aasmdata;
@@ -70,6 +71,7 @@ interface
         procedure appendsym_absolute(list:TAsmList;sym:tabsolutevarsym);virtual;
         procedure appendsym_property(list:TAsmList;sym:tpropertysym);virtual;
         { symtable }
+        procedure write_symtable_parasyms(list:TAsmList;paras: tparalist);
         procedure write_symtable_syms(list:TAsmList;st:TSymtable);
         procedure write_symtable_defs(list:TAsmList;st:TSymtable);
         procedure write_symtable_procdefs(list:TAsmList;st:TSymtable);
@@ -416,6 +418,21 @@ implementation
       end;
 
 
+    procedure TDebugInfo.write_symtable_parasyms(list:TAsmList;paras: tparalist);
+      var
+        i   : longint;
+        sym : tsym;
+      begin
+        for i:=0 to paras.Count-1 do
+          begin
+            sym:=tsym(paras[i]);
+            if (sym.visibility<>vis_hidden) and
+               (not sym.isdbgwritten) then
+              appendsym(list,sym);
+          end;
+      end;
+
+
     procedure TDebugInfo.write_symtable_syms(list:TAsmList;st:TSymtable);
       var
         i   : longint;

+ 126 - 53
compiler/dbgdwarf.pas

@@ -42,7 +42,7 @@ interface
     uses
       cclasses,globtype,
       aasmbase,aasmtai,aasmdata,
-      symconst,symbase,symtype,symdef,symsym,
+      symbase,symconst,symtype,symdef,symsym,
       finput,
       DbgBase;
 
@@ -176,7 +176,13 @@ interface
 
         { PGI (STMicroelectronics) extensions.   }
         DW_AT_PGI_lbase := $3a00,
-        DW_AT_PGI_soffset := $3a01,DW_AT_PGI_lstride := $3a02
+        DW_AT_PGI_soffset := $3a01,DW_AT_PGI_lstride := $3a02,
+
+        { Apple extensions }
+        DW_AT_APPLE_optimized = $3fe1,
+        DW_AT_APPLE_flags = $3fe2,
+        DW_AT_APPLE_major_runtime_vers = $3fe5,
+        DW_AT_APPLE_runtime_class = $3fe6
       );
 {$notes on}
 
@@ -198,6 +204,15 @@ interface
         Name: PChar;
       end;
 
+      { flags for emitting variables/parameters }
+      tdwarfvarsymflag =
+        { force the sym to be emitted as a local variable regardless of its
+          type; used for "absolute" local variables referring to parameters.
+        }
+        (dvf_force_local_var
+        );
+      tdwarfvarsymflags = set of tdwarfvarsymflag;
+
       { TDebugInfoDwarf }
 
       TDebugInfoDwarf = class(TDebugInfo)
@@ -268,10 +283,7 @@ interface
 
         function  get_symlist_sym_offset(symlist: ppropaccesslistitem; out sym: tabstractvarsym; out offset: pint): boolean;
         procedure appendsym_var(list:TAsmList;sym:tabstractnormalvarsym);
-        { used for global/static variables, local variables, parameters and
-          absolute variables
-        }
-        procedure appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; do_self: boolean);
+        procedure appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; const flags: tdwarfvarsymflags);
         { used for fields and properties mapped to fields }
         procedure appendsym_fieldvar_with_name_offset(list:TAsmList;sym: tfieldvarsym;const name: string; def: tdef; offset: pint);
 
@@ -380,6 +392,9 @@ implementation
         DW_LANG_C99 := $000c,DW_LANG_Ada95 := $000d,
         DW_LANG_Fortran95 := $000e,
 
+        { Objective-C }
+        DW_LANG_ObjC := $10,
+
         { MIPS.   }
         DW_LANG_Mips_Assembler := $8001,
 
@@ -710,7 +725,7 @@ implementation
                           on when the typecast is changed to 'as' }
                         current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_lab)));
                         current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_ref_lab)));
-                        if is_class_or_interface_or_dispinterface(def) then
+                        if is_class_or_interface_or_dispinterface_or_objc(def) then
                           current_asmdata.getdatalabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
                       end;
                   end;
@@ -722,7 +737,7 @@ implementation
                 { addrlabel instead of datalabel because it must be a local one }
                 current_asmdata.getaddrlabel(TAsmLabel(pointer(def.dwarf_lab)));
                 current_asmdata.getaddrlabel(TAsmLabel(pointer(def.dwarf_ref_lab)));
-                if is_class_or_interface_or_dispinterface(def) then
+                if is_class_or_interface_or_dispinterface_or_objc(def) then
                   current_asmdata.getaddrlabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
               end;
             if def.dbg_state=dbg_state_used then
@@ -1620,7 +1635,7 @@ implementation
           extract all the dwarf info from a program's object files.
           This utility however performs "smart linking" on the dwarf
           info and throws away all unreferenced dwarf entries. Since
-          variables' types always point to the dwarfino for a tdef
+          variables' types always point to the dwarfinfo for a tdef
           and never to that for a typesym, this means all debug
           entries generated for typesyms are thrown away.
 
@@ -1630,7 +1645,7 @@ implementation
           So as a result, before running dsymutil types only become
           available once you stepped into/over a function in the object
           file where they are declared, and after running dsymutil they
-          are all gone (printng variables still works because the
+          are all gone (printing variables still works because the
           tdef dwarf info is still available, but you cannot typecast
           anything outside the declaring units because the type names
           are not known there).
@@ -1646,6 +1661,25 @@ implementation
           generated and hence gdb will not be able to give a definition
           of the type.
         }
+
+        if is_objc_class_or_protocol(def) then
+          begin
+            { for Objective-C classes, the typedef must refer to the
+              struct itself, not to the pointer of the struct; Objective-C
+              classes are not implicit pointers in Objective-C itself, only
+              in FPC. So make the def label point to a pointer to the
+              typedef, which in turn refers to the actual struct (for Delphi-
+              style classes, the def points to the typedef, which refers to
+              a pointer to the actual struct) }
+
+            { implicit pointer }
+            current_asmdata.getaddrlabel(TAsmLabel(pointer(labsym)));
+            append_entry(DW_TAG_pointer_type,false,[]);
+            append_labelentry_ref(DW_AT_type,labsym);
+            finish_entry;
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
+          end;
+
         if assigned(def.typesym) and
            not(df_generic in def.defoptions) then
           begin
@@ -1656,7 +1690,7 @@ implementation
             append_labelentry_ref(DW_AT_type,labsym);
             finish_entry;
             current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
-          end;
+          end
       end;
 
 
@@ -1699,7 +1733,6 @@ implementation
         procentry      : string;
         cc             : Tdwarf_calling_convention;
         st             : tsymtable;
-        i              : longint;
         vmtindexnr     : pint;
         incurrentunit  : boolean;
       begin
@@ -1746,16 +1779,27 @@ implementation
         def.dbg_state:=dbg_state_writing;
 
         current_asmdata.asmlists[al_dwarf_info].concat(tai_comment.Create(strpnew('Procdef '+def.fullprocname(true))));
-        append_entry(DW_TAG_subprogram,true,
-          [DW_AT_name,DW_FORM_string,symname(def.procsym)+#0
-          { data continues below }
-          { problem: base reg isn't known here
-            DW_AT_frame_base,DW_FORM_block1,1
-          }
-          ]);
+        if not is_objc_class_or_protocol(def._class) then
+          append_entry(DW_TAG_subprogram,true,
+            [DW_AT_name,DW_FORM_string,symname(def.procsym)+#0
+            { data continues below }
+            { problem: base reg isn't known here
+              DW_AT_frame_base,DW_FORM_block1,1
+            }
+            ])
+        else
+          append_entry(DW_TAG_subprogram,true,
+            [DW_AT_name,DW_FORM_string,def.mangledname+#0
+            { data continues below }
+            { problem: base reg isn't known here
+              DW_AT_frame_base,DW_FORM_block1,1
+            }
+            ]);
 
         { Append optional flags. }
 
+        { All Pascal procedures are prototyped }
+        append_attribute(DW_AT_prototyped,DW_FORM_flag,[true]);
         { Calling convention.  }
         cc:=dwarf_calling_convention(def);
         if (cc<>DW_CC_normal) then
@@ -1765,7 +1809,8 @@ implementation
            (def.parast.symtablelevel<=normal_function_level) then
           append_attribute(DW_AT_external,DW_FORM_flag,[true]);
         { Abstract or virtual/overriding method.  }
-        if (([po_abstractmethod, po_virtualmethod, po_overridingmethod] * def.procoptions) <> []) then
+        if (([po_abstractmethod, po_virtualmethod, po_overridingmethod] * def.procoptions) <> []) and
+           not is_objc_class_or_protocol(def._class) then
           begin
             if not(po_abstractmethod in def.procoptions) then
               append_attribute(DW_AT_virtuality,DW_FORM_data1,[ord(DW_VIRTUALITY_virtual)])
@@ -1817,17 +1862,11 @@ implementation
               first parameter of a method is artificial to distinguish static
               from regular methods.  }
 
-            { Find the self parameter (it's usually last in the list).  }
-            for i:=def.parast.symlist.count-1 downto 0 do
-              if (tsym(def.parast.symlist[i]).typ = paravarsym) and
-                 (vo_is_self in tparavarsym(def.parast.symlist[i]).varoptions) then
-                { insert it as the first one }
-                appendsym_var_with_name_type_offset(list,
-                    tparavarsym(def.parast.symlist[i]),
-                    symname(tsym(def.parast.symlist[i])),
-                    tparavarsym(def.parast.symlist[i]).vardef,0,true);
-            { Now insert the rest (this will skip the self parameter).  }
-            write_symtable_syms(current_asmdata.asmlists[al_dwarf_info],def.parast);
+            { fortunately, self is the always the first parameter in the
+              paralist, since it has the lowest paranr. Note that this is not
+              true for Objective-C, but those methods are detected in
+              another way (by reading the ObjC run time information)  }
+            write_symtable_parasyms(current_asmdata.asmlists[al_dwarf_info],def.paras);
           end;
         { local type defs and vars should not be written
           inside the main proc }
@@ -1932,11 +1971,11 @@ implementation
 
     procedure TDebugInfoDwarf.appendsym_var(list:TAsmList;sym:tabstractnormalvarsym);
       begin
-        appendsym_var_with_name_type_offset(list,sym,symname(sym),sym.vardef,0,false);
+        appendsym_var_with_name_type_offset(list,sym,symname(sym),sym.vardef,0,[]);
       end;
 
 
-    procedure TDebugInfoDwarf.appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; do_self: boolean);
+    procedure TDebugInfoDwarf.appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; const flags: tdwarfvarsymflags);
       var
         templist : TAsmList;
         blocksize : longint;
@@ -1951,12 +1990,6 @@ implementation
         if vo_is_external in sym.varoptions then
           exit;
 
-        { Self must be the first inserted parameter, see
-          appendprocdef().  }
-        if not(do_self) and
-           (vo_is_self in sym.varoptions) then
-          exit;
-
         { There is no space allocated for not referenced locals }
         if (sym.owner.symtabletype=localsymtable) and (sym.refs=0) then
           exit;
@@ -2020,6 +2053,7 @@ implementation
            when calling the function)
         }
         if (sym.typ=paravarsym) and
+           not(dvf_force_local_var in flags) and
            not(vo_is_funcret in sym.varoptions) then
           tag:=DW_TAG_formal_parameter
         else
@@ -2314,7 +2348,7 @@ implementation
           begin
             if (tosym.typ=fieldvarsym) then
               internalerror(2009031404);
-            appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),sym.propdef,offset,false)
+            appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),sym.propdef,offset,[])
           end
         else
           appendsym_fieldvar_with_name_offset(list,tfieldvarsym(tosym),symname(sym),sym.propdef,offset)
@@ -2336,6 +2370,7 @@ implementation
         symlist : ppropaccesslistitem;
         tosym: tabstractvarsym;
         offset: pint;
+        flags: tdwarfvarsymflags;
       begin
         templist:=TAsmList.create;
         case tabsolutevarsym(sym).abstyp of
@@ -2365,7 +2400,10 @@ implementation
               get_symlist_sym_offset(symlist,tosym,offset);
               if (tosym.typ=fieldvarsym) then
                 internalerror(2009031402);
-              appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),tabstractvarsym(sym).vardef,offset,false);
+              flags:=[];
+              if (sym.owner.symtabletype=localsymtable) then
+                include(flags,dvf_force_local_var);
+              appendsym_var_with_name_type_offset(list,tabstractnormalvarsym(tosym),symname(sym),tabstractvarsym(sym).vardef,offset,flags);
               templist.free;
               exit;
             end;
@@ -2681,6 +2719,9 @@ implementation
             current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_linesection0'),
             current_asmdata.RefAsmSymbol(target_asm.labelprefix+'debug_line0'));
 
+        if (m_objectivec1 in current_settings.modeswitches) then
+          append_attribute(DW_AT_APPLE_major_runtime_vers,DW_FORM_data1,[1]);
+
         dbgname:=make_mangledname('DEBUGSTART',current_module.localsymtable,'');
         if (target_info.system in systems_darwin) then
           dbgname:='L'+dbgname;
@@ -2776,9 +2817,15 @@ implementation
       begin
         if (sym.typ=paravarsym) and
            (vo_is_self in tparavarsym(sym).varoptions) then
-          result:='this'
+          if not is_objc_class_or_protocol(tdef(sym.owner.defowner.owner.defowner)) then
+            result:='this'
+          else
+            result:='self'
+        else if (sym.typ=typesym) and
+                is_objc_class_or_protocol(ttypesym(sym).typedef) then
+          result:=tobjectdef(ttypesym(sym).typedef).objextname^
         else
-          result := sym.Name;
+          result:=sym.name;
       end;
 
 
@@ -3016,7 +3063,17 @@ implementation
     procedure TDebugInfoDwarf2.appenddef_object(list:TAsmList;def: tobjectdef);
       procedure doappend;
         begin
-          if assigned(def.objname) then
+          { Objective-C class: same as regular class, except for
+              a) Apple-specific tag that identifies it as an Objective-C class
+              b) use extname^ instead of objname
+          }
+          if (def.objecttype=odt_objcclass) then
+            append_entry(DW_TAG_structure_type,true,[
+              DW_AT_name,DW_FORM_string,def.objextname^+#0,
+              DW_AT_byte_size,DW_FORM_udata,tobjectsymtable(def.symtable).datasize,
+              DW_AT_APPLE_runtime_class,DW_FORM_data1,DW_LANG_ObjC
+              ])
+          else if assigned(def.objname) then
             append_entry(DW_TAG_structure_type,true,[
               DW_AT_name,DW_FORM_string,def.objname^+#0,
               DW_AT_byte_size,DW_FORM_udata,tobjectsymtable(def.symtable).datasize
@@ -3036,7 +3093,7 @@ implementation
               current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_uleb128bit(0));
               if (def.childof.dbg_state=dbg_state_unused) then
                 def.childof.dbg_state:=dbg_state_used;
-              if is_class_or_interface_or_dispinterface(def) then
+              if is_class_or_interface_or_dispinterface_or_objc(def) then
                 append_labelentry_ref(DW_AT_type,def_dwarf_class_struct_lab(def.childof))
               else
                 append_labelentry_ref(DW_AT_type,def_dwarf_lab(def.childof));
@@ -3063,9 +3120,15 @@ implementation
             end;
 
           def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
-          { Write the methods in the scope of the class/object.  }
-           write_symtable_procdefs(current_asmdata.asmlists[al_dwarf_info],def.symtable);
-          finish_children;
+          { Write the methods in the scope of the class/object, except for Objective-C.  }
+          if is_objc_class_or_protocol(def) then
+            finish_children;
+          { don't write procdefs of externally defined classes, gcc doesn't
+            either (info is probably gotten from ObjC runtime)  }
+          if not(oo_is_external in def.objectoptions) then
+            write_symtable_procdefs(current_asmdata.asmlists[al_dwarf_info],def.symtable);
+          if not is_objc_class_or_protocol(def) then
+            finish_children;
         end;
 
 
@@ -3077,12 +3140,16 @@ implementation
           odt_interfacecom,
           odt_interfacecorba,
           odt_dispinterface,
-          odt_class:
+          odt_class,
+          odt_objcclass:
             begin
-              { implicit pointer }
-              append_entry(DW_TAG_pointer_type,false,[]);
-              append_labelentry_ref(DW_AT_type,def_dwarf_class_struct_lab(def));
-              finish_entry;
+              if (def.objecttype<>odt_objcclass) then
+                begin
+                  { implicit pointer }
+                  append_entry(DW_TAG_pointer_type,false,[]);
+                  append_labelentry_ref(DW_AT_type,def_dwarf_class_struct_lab(def));
+                  finish_entry;
+                end;
 
               if not(tf_dwarf_only_local_labels in target_info.flags) then
                 current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create_global(def_dwarf_class_struct_lab(def),0))
@@ -3090,6 +3157,12 @@ implementation
                 current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(def_dwarf_class_struct_lab(def),0));
               doappend;
             end;
+          odt_objcprotocol:
+            begin
+              append_entry(DW_TAG_pointer_type,false,[]);
+              append_labelentry_ref(DW_AT_type,def_dwarf_lab(voidpointertype));
+              finish_entry;
+            end;
           else
             internalerror(200602041);
         end;

+ 53 - 10
compiler/defcmp.pas

@@ -277,7 +277,7 @@ implementation
                  objectdef:
                    begin
                      if (m_delphi in current_settings.modeswitches) and
-                        is_class_or_interface_or_dispinterface(def_from) and
+                        is_class_or_interface_or_dispinterface_or_objc(def_from) and
                         (cdo_explicit in cdoptions) then
                       begin
                         eq:=te_convert_l1;
@@ -1081,6 +1081,16 @@ implementation
                            eq:=te_convert_l2
                          else
                            eq:=te_convert_l1;
+                       end
+                     { id = generic class instance. metaclasses are also
+                       class instances themselves.  }
+                     else if ((def_from=objc_idtype) and
+                              (def_to=objc_metaclasstype)) or
+                             ((def_to=objc_idtype) and
+                              (def_from=objc_metaclasstype)) then
+                       begin
+                         doconv:=tc_equal;
+                         eq:=te_convert_l2;
                        end;
                    end;
                  procvardef :
@@ -1113,7 +1123,7 @@ implementation
                        can be assigned to void pointers, but it is less
                        preferred than assigning to a related objectdef }
                      if (
-                         is_class_or_interface_or_dispinterface(def_from) or
+                         is_class_or_interface_or_dispinterface_or_objc(def_from) or
                          (def_from.typ=classrefdef)
                         ) and
                         (tpointerdef(def_to).pointeddef.typ=orddef) and
@@ -1121,6 +1131,18 @@ implementation
                        begin
                          doconv:=tc_equal;
                          eq:=te_convert_l2;
+                       end
+                     else if (is_objc_class_or_protocol(def_from) and
+                              (def_to=objc_idtype)) or
+                             { classrefs are also instances in Objective-C,
+                               hence they're also assignment-cpmpatible with
+                               id }
+                             (is_objcclassref(def_from) and
+                              ((def_to=objc_metaclasstype) or
+                               (def_to=objc_idtype))) then
+                       begin
+                         doconv:=tc_equal;
+                         eq:=te_convert_l2;
                        end;
                    end;
                end;
@@ -1224,7 +1246,7 @@ implementation
                 end
                else
                { Class/interface specific }
-                if is_class_or_interface_or_dispinterface(def_to) then
+                if is_class_or_interface_or_dispinterface_or_objc(def_to) then
                  begin
                    { void pointer also for delphi mode }
                    if (m_delphi in current_settings.modeswitches) and
@@ -1241,9 +1263,19 @@ implementation
                        doconv:=tc_equal;
                        eq:=te_convert_l1;
                      end
-                   { classes can be assigned to interfaces }
-                   else if is_interface(def_to) and
-                           is_class(def_from) and
+                   { All Objective-C classes are compatible with ID }
+                   else if is_objcclass(def_to) and
+                           (def_from=objc_idtype) then
+                      begin
+                       doconv:=tc_equal;
+                       eq:=te_convert_l2;
+                     end
+                   { classes can be assigned to interfaces
+                     (same with objcclass and objcprotocol) }
+                   else if ((is_interface(def_to) and
+                             is_class(def_from)) or
+                            (is_objcprotocol(def_to) and
+                             is_objcclass(def_from))) and
                            assigned(tobjectdef(def_from).ImplementedInterfaces) then
                      begin
                         { we've to search in parent classes as well }
@@ -1252,7 +1284,11 @@ implementation
                           begin
                              if hobjdef.find_implemented_interface(tobjectdef(def_to))<>nil then
                                begin
-                                  doconv:=tc_class_2_intf;
+                                  if is_interface(def_to) then
+                                    doconv:=tc_class_2_intf
+                                  else
+                                    { for Objective-C, we don't have to do anything special }
+                                    doconv:=tc_equal;
                                   { don't prefer this over objectdef->objectdef }
                                   eq:=te_convert_l2;
                                   break;
@@ -1325,7 +1361,14 @@ implementation
                  begin
                    doconv:=tc_equal;
                    eq:=te_convert_l1;
-                 end;
+                 end
+               else
+                 { id is compatible with all classref types }
+                 if (def_from=objc_idtype) then
+                   begin
+                     doconv:=tc_equal;
+                     eq:=te_convert_l1;
+                   end;
              end;
 
            filedef :
@@ -1680,8 +1723,8 @@ implementation
           (equal_defs(parentretdef,childretdef)) or
           ((parentretdef.typ=objectdef) and
            (childretdef.typ=objectdef) and
-           is_class_or_interface(parentretdef) and
-           is_class_or_interface(childretdef) and
+           is_class_or_interface_or_objc(parentretdef) and
+           is_class_or_interface_or_objc(childretdef) and
            (tobjectdef(childretdef).is_related(tobjectdef(parentretdef))))
       end;
 

+ 1 - 1
compiler/defutil.pas

@@ -979,7 +979,7 @@ implementation
             end;
           objectdef :
             begin
-              if is_class_or_interface(def) then
+              if is_class_or_interface_or_objc(def) then
                 result := OS_ADDR
               else
                 result:=int_cgsize(def.size);

+ 9 - 0
compiler/export.pas

@@ -73,6 +73,9 @@ type
 
   procedure exportprocsym(sym: tsym; const s : string; index: longint; options: word);
   procedure exportvarsym(sym: tsym; const s : string; index: longint; options: word);
+  { to export symbols not directly related to a tsym (e.g., the Objective-C
+    rtti) }
+  procedure exportname(const s : string; options: word);
 
   procedure exportallprocdefnames(sym: tprocsym; pd: tprocdef; options: word);
   procedure exportallprocsymnames(ps: tprocsym; options: word);
@@ -122,6 +125,12 @@ procedure exportvarsym(sym: tsym; const s : string; index: longint; options: wor
   end;
 
 
+procedure exportname(const s : string; options: word);
+  begin
+    exportvarsym(nil,s,0,options);
+  end;
+
+
   procedure exportallprocdefnames(sym: tprocsym; pd: tprocdef; options: word);
     var
       item: TCmdStrListItem;

+ 2 - 1
compiler/expunix.pas

@@ -172,7 +172,8 @@ begin
       end
      else
        begin
-         if (hp2.name^<>hp2.sym.mangledname) then
+         if assigned(hp2.sym) and
+            (hp2.name^<>hp2.sym.mangledname) then
            Message2(parser_e_cant_export_var_different_name,hp2.sym.realname,hp2.sym.mangledname)
          else
            exportedsymnames.insert(hp2.name^);

+ 7 - 7
compiler/htypechk.pas

@@ -219,7 +219,7 @@ implementation
             pointerdef :
               begin
                 if ((rd.typ in [orddef,enumdef,pointerdef,classrefdef,procvardef]) or
-                    is_class_or_interface(rd)) then
+                    is_class_or_interface_or_objc(rd)) then
                  begin
                    allowed:=false;
                    exit;
@@ -281,7 +281,7 @@ implementation
               begin
                 { <> and = are defined for classes }
                 if (treetyp in [equaln,unequaln]) and
-                   is_class_or_interface(ld) then
+                   is_class_or_interface_or_objc(ld) then
                  begin
                    allowed:=false;
                    exit;
@@ -850,7 +850,7 @@ implementation
                end;
              subscriptn :
                begin
-                 if is_class_or_interface(tunarynode(p).left.resultdef) then
+                 if is_class_or_interface_or_objc(tunarynode(p).left.resultdef) then
                    newstate := vs_read;
                  p:=tunarynode(p).left;
                end;
@@ -1004,7 +1004,7 @@ implementation
                  pointerdef :
                    gotpointer:=true;
                  objectdef :
-                   gotclass:=is_class_or_interface(hp.resultdef);
+                   gotclass:=is_class_or_interface_or_objc(hp.resultdef);
                  recorddef :
                    gotrecord:=true;
                  classrefdef :
@@ -1121,7 +1121,7 @@ implementation
                    pointerdef :
                      gotpointer:=true;
                    objectdef :
-                     gotclass:=is_class_or_interface(hp.resultdef);
+                     gotclass:=is_class_or_interface_or_objc(hp.resultdef);
                    classrefdef :
                      gotclass:=true;
                    arraydef :
@@ -1218,7 +1218,7 @@ implementation
                  { a class/interface access is an implicit }
                  { dereferencing                           }
                  hp:=tsubscriptnode(hp).left;
-                 if is_class_or_interface(hp.resultdef) then
+                 if is_class_or_interface_or_objc(hp.resultdef) then
                    gotderef:=true;
                end;
              muln,
@@ -1307,7 +1307,7 @@ implementation
                    pointerdef :
                      gotpointer:=true;
                    objectdef :
-                     gotclass:=is_class_or_interface(hp.resultdef);
+                     gotclass:=is_class_or_interface_or_objc(hp.resultdef);
                    recorddef, { handle record like class it needs a subscription }
                    classrefdef :
                      gotclass:=true;

+ 13 - 2
compiler/i386/ag386nsm.pas

@@ -446,7 +446,7 @@ interface
 
     procedure T386NasmAssembler.WriteSection(atype:TAsmSectiontype;const aname:string);
       const
-        secnames : array[TAsmSectiontype] of string[length('.objc_meth_var_types')] = ('',
+        secnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           '.text',
           '.data',
           '.data',
@@ -488,7 +488,16 @@ interface
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
       begin
         AsmLn;
@@ -895,6 +904,8 @@ interface
 
            ait_symbol :
              begin
+               if tai_symbol(hp).has_value then
+                 internalerror(2009090803);
                if tai_symbol(hp).is_global then
                 begin
                   AsmWrite(#9'GLOBAL ');

+ 77 - 9
compiler/msg/errore.msg

@@ -366,7 +366,7 @@ scan_w_multiple_main_name_overrides=02086_W_Overriding name of "main" procedure
 #
 # Parser
 #
-# 03265 is the last used one
+# 03275 is the last used one
 #
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
@@ -911,12 +911,12 @@ parser_e_no_con_des_in_interfaces=03171_E_Con- and destructors aren't allowed in
 % Constructor and destructor declarations aren't allowed in interfaces.
 % In the most cases method \var{QueryInterface} of \var{IUnknown} can
 % be used to create a new interface.
-parser_e_no_access_specifier_in_interfaces=03172_E_Access specifiers can't be used in INTERFACES
+parser_e_no_access_specifier_in_interfaces=03172_E_Access specifiers can't be used in INTERFACEs and OBJCPROTOCOLs
 % The access specifiers \var{public}, \var{private}, \var{protected} and
-% \var{published} can't be used in interfaces because all methods
-% of an interface must be public.
-parser_e_no_vars_in_interfaces=03173_E_An interface can't contain fields
-% Declarations of fields aren't allowed in interfaces. An interface
+% \var{published} can't be used in interfaces and Objective-C protocols because all methods
+% of an interface/protocol must be public.
+parser_e_no_vars_in_interfaces=03173_E_An interface or Objective-C protocol cannot contain fields
+% Declarations of fields are not allowed in interfaces and Objective-C protocols. An interface/protocol
 % can contain only methods and properties with method read/write specifiers.
 parser_e_no_local_proc_external=03174_E_Can't declare local procedure as EXTERNAL
 % Declaring local procedures as external is not possible. Local procedures
@@ -1217,11 +1217,54 @@ parser_e_only_one_enumerator_current=03264_E_Only one enumerator Current propert
 % Class or Object can have only one enumerator Current declaration.
 parser_e_for_in_loop_cannot_be_used_for_the_type=03265_E_For in loop can not be used for the type "$1"
 % For in loop can be used not for all types. For example it can not be used for the enumerations with jumps.
+parser_e_objc_requires_msgstr=03266_E_Objective-C messages require their Objective-C selector name to be specified using the "message" directive.
+% Objective-C messages require their Objective-C name (selector name) to be specified using the \var{message `someName:'} procedure directive.
+% While bindings to other languages automatically generate such names based on the identifier you use (by replacing
+% all underscores with colons), this is unsafe since nothing prevents an Objective-C method name to contain actual
+% colons.
+parser_e_objc_no_constructor_destructor=03267_E_Objective-C does not have formal constructors nor destructors. Use the alloc, initXXX and dealloc messages.
+% The Objective-C language does not have any constructors or destructors. While there are some messages with a similar
+% purpose (such as \var{init} and \var{dealloc}), these cannot be identified using automatic parsers and do not
+% guarantee anything like Pascal constructors/destructors (e.g., you have to take care of only calling ``designated''
+% inherited ``constructors''). For these reasons, we have opted to follow the standard Objective-C patterns for
+% instance creation/destruction.
+parser_e_message_string_too_long=03268_E_Message name is too long (max. 255 characters)
+% Due to compiler implementation reasons, message names are currently limited to 255 characters.
+parser_e_objc_message_name_too_long=03269_E_Objective-C message symbol name for "$1" is too long
+% Due to compiler implementation reasons, mangled message names (i.e., the symbol names used in the assembler
+% code) are currently limited to 255 characters.
+parser_h_no_objc_parent=03270_H_Defining a new Objective-C root class. To derive from another root class (e.g., NSObject), specify it as the parent class.
+% If no parent class is specified for an Object Pascal class, then it automatically derives from TObject.
+% Objective-C classes however do not automatically derive from NSObject, because one can have multiple
+% root classes in Objective-C. For example, in the Cocoa framework both NSObject and NSProxy are root classes.
+% Therefore, you have to explicitly define a parent class (such as NSObject) if you want to derive your
+% Objective-C class from it.
+parser_e_no_objc_published=03271_E_Objective-C classes cannot have published sections.
+% In Object Pascal, ``published'' determines whether or not RTTI is generated. Since the Objective-C runtime always needs
+% RTTI for everything, this specified does not make sense for Objective-C classes.
+parser_f_need_objc=03272_F_This module requires an Objective-C mode switch to be compiled
+% This error indicates the use of Objective-C language features without an Objective-C mode switch
+% active. Enable one via the -M command line switch, or the {\$modeswitch x} directive.
+parser_e_must_use_override_objc=03273_E_Inherited methods can only be overridden in Objective-C, add ``override''.
+parser_h_should_use_override_objc=03274_H_Inherited methods can only be overridden in Objective-C, add ``override''.
+% It is not possible to ``reintroduce'' methods in Objective-C like in Object Pascal. Methods with the same
+% name always map to the same virtual method entry. In order to make this clear in the source code,
+% the compiler always requires the ``override'' directive to be specified when implementing overriding
+% Objective-C methods in Pascal. If the implementation is external, this rule is relaxed because Objective-C
+% does not have any ``override''-style keyword (since it's the default and only behaviour in that language),
+% which makes it hard for automated header conversion tools to include it everywhere.
+parser_e_objc_message_name_changed=03275_E_Message name "$1" in inherited class is different from message name "$2" in current class.
+% An overriding Objective-C method cannot have a different message name than an inherited method. The reason
+% is that these message names uniquely define the message to the Objective-C runtime, which means that
+% giving them a different message name breaks the ``override'' semantics.
+parser_e_no_objc_unique=03276_E_It is not yet possible to make unique copies of Objective-C types
+% Duplicating an Objective-C type using \var{type x = type y;} is not yet supported. You may be able to
+% obtain the desired effect using \var{type x = objcclass(y) end;} instead.
 % \end{description}
 #
 # Type Checking
 #
-# 04087 is the last used one
+# 04093 is the last used one
 #
 % \section{Type checking errors}
 % This section lists all errors that can occur when type checking is
@@ -1505,7 +1548,7 @@ type_w_pointer_to_signed=04082_W_Converting pointers to signed integers may resu
 type_interface_has_no_guid=04083_E_Interface type $1 has no valid GUID
 % When applying the as-operator to an interface or class, the desired interface (i.e. the right operand of the
 % as-operator) must have a valid GUID.
-type_e_invalid_objc_selector_name=04084_E_Invalid selector name
+type_e_invalid_objc_selector_name=04084_E_Invalid selector name "$1"
 % An Objective-C selector cannot be empty, must be a valid identifier or a single colon,
 % and if it contains at least one colon it must also end in one.
 type_e_expected_objc_method_but_got=04085_E_Expected Objective-C method, but got $1
@@ -1525,11 +1568,24 @@ type_e_string_expr_expected=04089_E_String expression expected
 % The expression must be a string type.
 type_w_zero_to_nil=04090_W_Converting 0 to NIL
 % Use NIL rather than 0 when initialising a pointer. 
+type_e_protocol_type_expected=04091_E_Objective-C protocol type expected, but got "$1"
+% The compiler expected a protocol type name, but found something else.
+type_e_objc_type_unsupported=04092_E_The type "$1" is not supported for interaction with the Objective-C runtime.
+% Objective-C makes extensive use of run time type information (RTTI). This format
+% is defined by the maintainers of the run time and can therefore not be adapted
+% to all possible Object Pascal types. In particular, types that depend on
+% reference counting by the compiler (such as ansistrings and certain kinds of
+% interfaces) cannot be used as fields of Objective-C classes, cannot be
+% directly passed to Objective-C methods, and cannot be encoded using \var{objc_encode}.
+type_e_class_or_objcclass_type_expected=04093_E_Class or objcclass type expected, but got "$1"
+% It is only possible to create class reference types of \var{class} and
+% \var{objcclass} types
+%
 % \end{description}
 #
 # Symtable
 #
-# 05069 is the last used one
+# 05070 is the last used one
 #
 % \section{Symbol handling}
 % This section lists all the messages that concern the handling of symbols.
@@ -1719,6 +1775,13 @@ sym_e_no_enumerator_move=05068_E_Can not find a "MoveNext" method in enumerator
 sym_e_no_enumerator_current=05069_E_Can not find a "Current" property in enumerator "$1"
 % This means that compiler can not find a public Current property in  the enumerator class or object 
 % definition.
+sym_e_objc_para_mismatch=05070_E_Mismatch between number of declared parameters and number of colons in message string.
+% In Objective-C, a message name automatically contains as many colons as parameters.
+% In order to prevent mistakes when specifying the message name in FPC, the compiler
+% checks whether this is also the case here. Note that in case of messages taking a
+% variable number of arguments translated to FPC via an \var{array of const} parameter,
+% this final \var{array of const} parameter is not counted. Neither are the hidden
+% \var{self} and \var{_cmd} parameters.
 % \end{description}
 #
 # Codegenerator
@@ -1851,6 +1914,11 @@ cg_e_goto_label_not_found=06049_E_Goto label "$1" not defined or optimized away
 % The label used in the goto definition is not defined or optimized away by the
 % unreachable code elemination.
 % \end{description}
+cg_f_unknown_type_in_unit=06050_F_Cannot find type "$1" in unit "$2". Check if you use the correct run time library.
+% The compiler expects that the runtime library contains certain type definitions. If you see this error
+% and you didn't change the runtime library code, it's very likely that the runtime library
+% you're using doesn't match the compiler in use. If you changed the runtime library this error means
+% that you removed a type which the compiler needs for internal use.
 # EndOfTeX
 
 #

+ 18 - 2
compiler/msgidx.inc

@@ -353,6 +353,17 @@ const
   parser_e_only_one_enumerator_movenext=03263;
   parser_e_only_one_enumerator_current=03264;
   parser_e_for_in_loop_cannot_be_used_for_the_type=03265;
+  parser_e_objc_requires_msgstr=03266;
+  parser_e_objc_no_constructor_destructor=03267;
+  parser_e_message_string_too_long=03268;
+  parser_e_objc_message_name_too_long=03269;
+  parser_h_no_objc_parent=03270;
+  parser_e_no_objc_published=03271;
+  parser_f_need_objc=03272;
+  parser_e_must_use_override_objc=03273;
+  parser_h_should_use_override_objc=03274;
+  parser_e_objc_message_name_changed=03275;
+  parser_e_no_objc_unique=03276;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -434,6 +445,9 @@ const
   type_e_ordinal_or_string_expr_expected=04088;
   type_e_string_expr_expected=04089;
   type_w_zero_to_nil=04090;
+  type_e_protocol_type_expected=04091;
+  type_e_objc_type_unsupported=04092;
+  type_e_class_or_objcclass_type_expected=04093;
   sym_e_id_not_found=05000;
   sym_f_internal_error_in_symtablestack=05001;
   sym_e_duplicate_id=05002;
@@ -490,6 +504,7 @@ const
   sym_e_no_enumerator=05067;
   sym_e_no_enumerator_move=05068;
   sym_e_no_enumerator_current=05069;
+  sym_e_objc_para_mismatch=05070;
   cg_e_parasize_too_big=06009;
   cg_e_file_must_call_by_reference=06012;
   cg_e_cant_use_far_pointer_there=06013;
@@ -517,6 +532,7 @@ const
   cg_f_unknown_system_type=06047;
   cg_h_inherited_ignored=06048;
   cg_e_goto_label_not_found=06049;
+  cg_f_unknown_type_in_unit=06050;
   asmr_d_start_reading=07000;
   asmr_d_finish_reading=07001;
   asmr_e_none_label_contain_at=07002;
@@ -811,9 +827,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 52817;
+  MsgTxtSize = 54197;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,87,266,91,70,50,108,22,202,62,
+    24,87,277,94,71,51,108,22,202,62,
     48,20,1,1,1,1,1,1,1,1
   );

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 345 - 319
compiler/msgtxt.inc


+ 6 - 6
compiler/nadd.pas

@@ -1564,18 +1564,18 @@ implementation
           end
 
          { class or interface equation }
-         else if is_class_or_interface(rd) or is_class_or_interface(ld) then
+         else if is_class_or_interface_or_objc(rd) or is_class_or_interface_or_objc(ld) then
           begin
             if (nodetype in [equaln,unequaln]) then
               begin
-                if is_class_or_interface(rd) and is_class_or_interface(ld) then
+                if is_class_or_interface_or_objc(rd) and is_class_or_interface_or_objc(ld) then
                  begin
                    if tobjectdef(rd).is_related(tobjectdef(ld)) then
                     inserttypeconv(right,left.resultdef)
                    else
                     inserttypeconv(left,right.resultdef);
                  end
-                else if is_class_or_interface(rd) then
+                else if is_class_or_interface_or_objc(rd) then
                   inserttypeconv(left,right.resultdef)
                 else
                   inserttypeconv(right,left.resultdef);
@@ -1599,7 +1599,7 @@ implementation
           end
 
          { allows comperasion with nil pointer }
-         else if is_class_or_interface(rd) or (rd.typ=classrefdef) then
+         else if is_class_or_interface_or_objc(rd) or (rd.typ=classrefdef) then
           begin
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(left,right.resultdef)
@@ -1607,7 +1607,7 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
 
-         else if is_class_or_interface(ld) or (ld.typ=classrefdef) then
+         else if is_class_or_interface_or_objc(ld) or (ld.typ=classrefdef) then
           begin
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(right,left.resultdef)
@@ -2675,7 +2675,7 @@ implementation
                 expectloc:=LOC_FLAGS;
            end
 
-         else if is_class_or_interface(ld) then
+         else if is_class_or_interface_or_objc(ld) then
             begin
               expectloc:=LOC_FLAGS;
             end

+ 221 - 16
compiler/ncal.pas

@@ -46,7 +46,8 @@ interface
          cnf_dispose_call,
          cnf_member_call,        { called with implicit methodpointer tree }
          cnf_uses_varargs,       { varargs are used in the declaration }
-         cnf_create_failed       { exception thrown in constructor -> don't call beforedestruction }
+         cnf_create_failed,      { exception thrown in constructor -> don't call beforedestruction }
+         cnf_objc_processed      { the procedure name has been set to the appropriate objc_msgSend* variant -> don't process again }
        );
        tcallnodeflags = set of tcallnodeflag;
 
@@ -73,7 +74,8 @@ interface
           procedure check_inlining;
           function  pass1_normal:tnode;
           procedure register_created_object_types;
-
+       protected
+          procedure objc_convert_to_message_send;virtual;
 
        private
           { inlining support }
@@ -87,6 +89,10 @@ interface
           function  pass1_inline:tnode;
        protected
           pushedparasize : longint;
+          { Objective-C support: force the call node to call the routine with
+            this name rather than the name of symtableprocentry (don't store
+            to ppu, is set while processing the node) }
+          fobjcforcedprocname: pshortstring;
        public
           { the symbol containing the definition of the procedure }
           { to call                                               }
@@ -119,7 +125,9 @@ interface
           constructor create(l:tnode; v : tprocsym;st : TSymtable; mp: tnode; callflags:tcallnodeflags);virtual;
           constructor create_procvar(l,r:tnode);
           constructor createintern(const name: string; params: tnode);
+          constructor createinternfromunit(const fromunit, procname: string; params: tnode);
           constructor createinternres(const name: string; params: tnode; res:tdef);
+          constructor createinternresfromunit(const fromunit, procname: string; params: tnode; res:tdef);
           constructor createinternreturn(const name: string; params: tnode; returnnode : tnode);
           destructor destroy;override;
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
@@ -148,6 +156,8 @@ interface
           { checks if there are any parameters which end up at the stack, i.e.
             which have LOC_REFERENCE and set pi_has_stackparameter if this applies }
           procedure check_stack_parameters;
+          { force the name of the to-be-called routine to a particular string,
+            used for Objective-C message sending.  }
           property parameters : tnode read left write left;
        private
           AbstractMethodsList : TFPHashList;
@@ -208,7 +218,8 @@ implementation
       verbose,globals,
       symconst,defutil,defcmp,
       htypechk,pass_1,
-      ncnv,nld,ninl,nadd,ncon,nmem,nset,
+      ncnv,nld,ninl,nadd,ncon,nmem,nset,nobjc,
+      objcutil,
       procinfo,cpuinfo,
       cgbase,
       wpobase
@@ -935,12 +946,40 @@ implementation
        end;
 
 
+     constructor tcallnode.createinternfromunit(const fromunit, procname: string; params: tnode);
+       var
+         srsym: tsym;
+         srsymtable: tsymtable;
+       begin
+         if not searchsym_in_named_module(fromunit,procname,srsym,srsymtable) or
+            (srsym.typ<>procsym) then
+           Message1(cg_f_unknown_compilerproc,fromunit+'.'+procname);
+         create(params,tprocsym(srsym),srsymtable,nil,[]);
+       end;
+
+
     constructor tcallnode.createinternres(const name: string; params: tnode; res:tdef);
       var
         pd : tprocdef;
       begin
         createintern(name,params);
-        typedef := res;
+        typedef:=res;
+        include(callnodeflags,cnf_typedefset);
+        pd:=tprocdef(symtableprocentry.ProcdefList[0]);
+        { both the normal and specified resultdef either have to be returned via a }
+        { parameter or not, but no mixing (JM)                                      }
+        if paramanager.ret_in_param(typedef,pd.proccalloption) xor
+          paramanager.ret_in_param(pd.returndef,pd.proccalloption) then
+          internalerror(200108291);
+      end;
+
+
+    constructor tcallnode.createinternresfromunit(const fromunit, procname: string; params: tnode; res:tdef);
+      var
+        pd : tprocdef;
+      begin
+        createinternfromunit(fromunit,procname,params);
+        typedef:=res;
         include(callnodeflags,cnf_typedefset);
         pd:=tprocdef(symtableprocentry.ProcdefList[0]);
         { both the normal and specified resultdef either have to be returned via a }
@@ -966,6 +1005,7 @@ implementation
          funcretnode.free;
          if assigned(varargsparas) then
            varargsparas.free;
+         stringdispose(fobjcforcedprocname);
          inherited destroy;
       end;
 
@@ -1245,7 +1285,7 @@ implementation
               (hp.nodetype=typeconvn) and
               (ttypeconvnode(hp).convtype=tc_equal) do
           hp:=tunarynode(hp).left;
-        result:=(hp.nodetype in [typen,loadvmtaddrn,loadn,temprefn,arrayconstructorn]);
+        result:=(hp.nodetype in [typen,loadvmtaddrn,loadn,temprefn,arrayconstructorn,addrn]);
         if result and
            not(may_be_in_reg) then
           case hp.nodetype of
@@ -1469,12 +1509,17 @@ implementation
         selftree:=nil;
 
         { When methodpointer was a callnode we must load it first into a
-          temp to prevent the processing callnode twice }
+          temp to prevent processing the callnode twice }
         if (methodpointer.nodetype=calln) then
           internalerror(200405121);
 
+        { Objective-C: objc_convert_to_message_send() already did all necessary
+          transformation on the methodpointer }
+        if (procdefinition.typ=procdef) and
+           (po_objc in tprocdef(procdefinition).procoptions) then
+          selftree:=methodpointer.getcopy
         { inherited }
-        if (cnf_inherited in callnodeflags) then
+        else if (cnf_inherited in callnodeflags) then
           begin
             selftree:=load_self_node;
            { we can call an inherited class static/method from a regular method
@@ -1640,6 +1685,146 @@ implementation
        end;
 
 
+    procedure tcallnode.objc_convert_to_message_send;
+      var
+        block,
+        selftree      : tnode;
+        statements    : tstatementnode;
+        field         : tfieldvarsym;
+        temp          : ttempcreatenode;
+        selfrestype,
+        objcsupertype : tdef;
+        srsym         : tsym;
+        srsymtable    : tsymtable;
+        msgsendname   : string;
+      begin
+        { typecheck pass must already have run on the call node,
+          because pass1 calls this method
+        }
+
+        { default behaviour: call objc_msgSend and friends;
+          64 bit targets for Mac OS X can override this as they
+          can call messages via an indirect function call similar to
+          dynamically linked functions, ARM maybe as well (not checked)
+
+          Which variant of objc_msgSend is used depends on the
+          result type, and on whether or not it's an inherited call.
+        }
+
+        { make sure we don't perform this transformation twice in case
+          firstpass would be called multiple times }
+        include(callnodeflags,cnf_objc_processed);
+
+        { A) set the appropriate objc_msgSend* variant to call }
+
+        { record returned via implicit pointer }
+        if paramanager.ret_in_param(resultdef,procdefinition.proccalloption) then
+          begin
+            if not(cnf_inherited in callnodeflags) then
+              msgsendname:='OBJC_MSGSEND_STRET'
+{$if defined(onlymacosx10_6) or defined(arm) }
+            else if (target_info.system in system_objc_nfabi) then
+              msgsendname:='OBJC_MSGSENDSUPER2_STRET'
+{$endif onlymacosx10_6 or arm}
+            else
+              msgsendname:='OBJC_MSGSENDSUPER_STRET'
+          end
+{$ifdef i386}
+        { special case for fpu results on i386 for non-inherited calls }
+        { TODO: also for x86_64 "extended" results }
+        else if (resultdef.typ=floatdef) and
+                not(cnf_inherited in callnodeflags) then
+          msgsendname:='OBJC_MSGSEND_FPRET'
+{$endif}
+        { default }
+        else if not(cnf_inherited in callnodeflags) then
+          msgsendname:='OBJC_MSGSEND'
+{$if defined(onlymacosx10_6) or defined(arm) }
+        else if (target_info.system in system_objc_nfabi) then
+          msgsendname:='OBJC_MSGSENDSUPER2'
+{$endif onlymacosx10_6 or arm}
+        else
+          msgsendname:='OBJC_MSGSENDSUPER';
+
+        { get the mangled name }
+        if not searchsym_in_named_module('OBJC',msgsendname,srsym,srsymtable) or
+           (srsym.typ<>procsym) or
+           (tprocsym(srsym).ProcdefList.count<>1) then
+          Message1(cg_f_unknown_compilerproc,'objc.'+msgsendname);
+        fobjcforcedprocname:=stringdup(tprocdef(tprocsym(srsym).ProcdefList[0]).mangledname);
+
+        { B) Handle self }
+        { 1) in case of sending a message to a superclass, self is a pointer to
+             an objc_super record
+        }
+        if (cnf_inherited in callnodeflags) then
+          begin
+             block:=internalstatements(statements);
+             objcsupertype:=search_named_unit_globaltype('OBJC','OBJC_SUPER').typedef;
+             if (objcsupertype.typ<>recorddef) then
+               internalerror(2009032901);
+             { temp for the for the objc_super record }
+             temp:=ctempcreatenode.create(objcsupertype,objcsupertype.size,tt_persistent,false);
+             addstatement(statements,temp);
+             { initialize objc_super record }
+             selftree:=load_self_node;
+
+             { we can call an inherited class static/method from a regular method
+               -> self node must change from instance pointer to vmt pointer)
+             }
+             if (po_classmethod in procdefinition.procoptions) and
+                (selftree.resultdef.typ<>classrefdef) then
+               begin
+                 selftree:=cloadvmtaddrnode.create(selftree);
+                 typecheckpass(selftree);
+               end;
+             selfrestype:=selftree.resultdef;
+             field:=tfieldvarsym(trecorddef(objcsupertype).symtable.find('RECEIVER'));
+             if not assigned(field) then
+               internalerror(2009032902);
+            { first the destination object/class instance }
+             addstatement(statements,
+               cassignmentnode.create(
+                 csubscriptnode.create(field,ctemprefnode.create(temp)),
+                 selftree
+               )
+             );
+             { and secondly, the class type in which the selector must be looked
+               up (the parent class in case of an instance method, the parent's
+               metaclass in case of a class method) }
+             field:=tfieldvarsym(trecorddef(objcsupertype).symtable.find('_CLASS'));
+             if not assigned(field) then
+               internalerror(2009032903);
+             addstatement(statements,
+               cassignmentnode.create(
+                 csubscriptnode.create(field,ctemprefnode.create(temp)),
+                 objcsuperclassnode(selftree.resultdef)
+               )
+             );
+             { result of this block is the address of this temp }
+             addstatement(statements,ctypeconvnode.create_internal(
+               caddrnode.create_internal(ctemprefnode.create(temp)),selfrestype)
+             );
+             { replace the method pointer with the address of this temp }
+             methodpointer.free;
+             methodpointer:=block;
+             typecheckpass(block);
+          end
+        else
+        { 2) regular call (not inherited) }
+          begin
+            { a) If we're calling a class method, use a class ref.  }
+            if (po_classmethod in procdefinition.procoptions) and
+               ((methodpointer.nodetype=typen) or
+                (methodpointer.resultdef.typ<>classrefdef)) then
+              begin
+                methodpointer:=cloadvmtaddrnode.create(methodpointer);
+                firstpass(methodpointer);
+              end;
+          end;
+      end;
+
+
     function tcallnode.gen_vmt_tree:tnode;
       var
         vmttree : tnode;
@@ -1999,7 +2184,12 @@ implementation
                  if vo_is_overflow_check in para.parasym.varoptions then
                    begin
                      para.left:=cordconstnode.create(Ord(cs_check_overflow in current_settings.localswitches),booltype,false);
-                   end;
+                   end
+                else
+                  if vo_is_msgsel in para.parasym.varoptions then
+                    begin
+                      para.left:=cobjcselectornode.create(cstringconstnode.createstr(tprocdef(procdefinition).messageinf.str^));
+                    end;
               end;
             if not assigned(para.left) then
               internalerror(200709084);
@@ -2815,14 +3005,29 @@ implementation
       begin
          result:=nil;
 
-         { Check if the call can be inlined, sets the cnf_do_inline flag }
-         check_inlining;
-
-         { must be called before maybe_load_in_temp(methodpointer), because
-           it converts the methodpointer into a temp in case it's a call
-           (and we want to know the original call)
-         }
-         register_created_object_types;
+         { convert Objective-C calls into a message call }
+         if (procdefinition.typ=procdef) and
+            (po_objc in tprocdef(procdefinition).procoptions) then
+           begin
+             if not(cnf_objc_processed in callnodeflags) then
+               objc_convert_to_message_send;
+           end
+         else
+           begin
+             { The following don't apply to obj-c: obj-c methods can never be
+               inlined because they're always virtual and the destination can
+               change at run, and for the same reason we also can't perform
+               WPO on them (+ they have no constructors) }
+
+             { Check if the call can be inlined, sets the cnf_do_inline flag }
+             check_inlining;
+
+             { must be called before maybe_load_in_temp(methodpointer), because
+               it converts the methodpointer into a temp in case it's a call
+               (and we want to know the original call)
+             }
+             register_created_object_types;
+           end;
 
          { Maybe optimize the loading of the methodpointer using a temp. When the methodpointer
            is a calln this is even required to not execute the calln twice.

+ 4 - 1
compiler/ncgcal.pas

@@ -1024,9 +1024,12 @@ implementation
 {$endif vtentry}
 
              name_to_call:='';
+             if assigned(fobjcforcedprocname) then
+               name_to_call:=fobjcforcedprocname^;
              { When methodpointer is typen we don't need (and can't) load
                a pointer. We can directly call the correct procdef (PFV) }
-             if (po_virtualmethod in procdefinition.procoptions) and
+             if (name_to_call='') and
+                (po_virtualmethod in procdefinition.procoptions) and
                 assigned(methodpointer) and
                 (methodpointer.nodetype<>typen) and
                 not wpoinfomanager.can_be_devirtualized(methodpointer.resultdef,procdefinition,name_to_call) then

+ 71 - 10
compiler/ncgmem.pas

@@ -79,13 +79,13 @@ implementation
 
     uses
       systems,
-      cutils,verbose,globals,constexp,
+      cutils,cclasses,verbose,globals,constexp,
       symconst,symdef,symsym,symtable,defutil,paramgr,
       aasmbase,aasmtai,aasmdata,
       procinfo,pass_2,parabase,
       pass_1,nld,ncon,nadd,nutils,
       cgutils,cgobj,
-      tgobj,ncgutil
+      tgobj,ncgutil,objcgutl
       ;
 
 
@@ -95,17 +95,42 @@ implementation
 
     procedure tcgloadvmtaddrnode.pass_generate_code;
       var
-       href : treference;
+        href    : treference;
+        pool    : THashSet;
+        entry   : PHashSetItem;
+        typename: string;
 
       begin
          location_reset(location,LOC_REGISTER,OS_ADDR);
          if (left.nodetype=typen) then
            begin
-             reference_reset_symbol(href,
-               current_asmdata.RefAsmSymbol(tobjectdef(tclassrefdef(resultdef).pointeddef).vmt_mangledname),0,
-               sizeof(pint));
              location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
-             cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,href,location.register);
+             if not is_objcclass(left.resultdef) then
+               begin
+                 reference_reset_symbol(href,
+                   current_asmdata.RefAsmSymbol(tobjectdef(tclassrefdef(resultdef).pointeddef).vmt_mangledname),0,
+                   sizeof(pint));
+                 cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,href,location.register);
+               end
+             else
+               begin
+                 if current_asmdata.ConstPools[sp_objcclassnamerefs]=nil then
+                   current_asmdata.ConstPools[sp_objcclassnamerefs]:=THashSet.Create(64, True, False);
+                 pool:=current_asmdata.ConstPools[sp_objcclassnamerefs];
+                 entry:=pool.FindOrAdd(@tobjectdef(left.resultdef).objextname^[1],length(tobjectdef(left.resultdef).objextname^));
+                 if (target_info.system in system_objc_nfabi) then
+                   begin
+                     { find/add necessary classref/classname pool entries }
+                     objcfinishclassrefnfpoolentry(entry,tobjectdef(left.resultdef));
+                   end
+                 else
+                   begin
+                     { find/add necessary classref/classname pool entries }
+                     objcfinishstringrefpoolentry(entry,sp_objcclassnames,sec_objc_cls_refs,sec_objc_class_names);
+                   end;
+                 reference_reset_symbol(href,tasmlabel(entry^.Data),0,sizeof(pint));
+                 cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,location.register);
+               end;
            end
          else
            begin
@@ -248,15 +273,18 @@ implementation
 
     procedure tcgsubscriptnode.pass_generate_code;
       var
+        sym: tasmsymbol;
         paraloc1 : tcgpara;
+        hreg  : tregister;
+        tmpref: treference;
         sref: tsubsetreference;
       begin
          secondpass(left);
          if codegenerror then
            exit;
          paraloc1.init;
-         { classes and interfaces must be dereferenced implicit }
-         if is_class_or_interface(left.resultdef) then
+         { classes and interfaces must be dereferenced implicitly }
+         if is_class_or_interface_or_objc(left.resultdef) then
            begin
              { the contents of a class are aligned to a sizeof(pointer) }
              location_reset_ref(location,LOC_REFERENCE,def_cgsize(resultdef),sizeof(pint));
@@ -281,6 +309,8 @@ implementation
                      location.reference.base:=cg.getaddressregister(current_asmdata.CurrAsmList);
                      cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_ADDR,left.location,location.reference.base);
                   end;
+                else
+                  internalerror(2009092401);
              end;
              { implicit deferencing }
              if (cs_use_heaptrc in current_settings.globalswitches) and
@@ -382,7 +412,38 @@ implementation
              end;
            end;
 
-         if (location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
+         if is_objc_class_or_protocol(left.resultdef) and
+            (target_info.system in system_objc_nfabi) then
+           begin
+             if (location.loc<>LOC_REFERENCE) or
+                (location.reference.index<>NR_NO) then
+               internalerror(2009092402);
+             { the actual field offset is stored in memory (to solve the
+               "fragile base class" problem: this way the layout of base
+               classes can be changed without breaking programs compiled against
+               earlier versions)
+             }
+             hreg:=cg.g_indirect_sym_load(current_asmdata.CurrAsmList,vs.mangledname,false);
+             { TODO: clean up. g_indirect_sym_load cannot perform
+                 a plain load for targets that don't need an indirect load
+                 because it's also used in ncgld, but this is not very nice...
+             }
+             if (hreg=NR_NO) then
+               begin
+                 sym:=current_asmdata.RefAsmSymbol(vs.mangledname);
+                 reference_reset_symbol(tmpref,sym,0,sizeof(pint));
+                 location.reference.index:=cg.getaddressregister(current_asmdata.CurrAsmList);
+               end
+             else
+               begin
+                 reference_reset_base(tmpref,hreg,0,sizeof(pint));
+                 location.reference.index:=hreg;
+               end;
+             cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,tmpref,location.reference.index);
+             { always packrecords C -> natural alignment }
+             location.reference.alignment:=vs.vardef.alignment;
+           end
+         else if (location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
            begin
              if not is_packed_record_or_object(left.resultdef) then
                begin

+ 32 - 32
compiler/ncgobjc.pas

@@ -34,13 +34,17 @@ type
     procedure pass_generate_code; override;
   end;
 
+  tcgobjcprotocolnode = class(tobjcprotocolnode)
+    procedure pass_generate_code; override;
+  end;
+
 implementation
 
 uses
     globtype,cclasses,
     aasmbase,aasmdata,aasmtai,
-    cgbase,cgutils,defutil,
-    symsym,
+    cgbase,cgutils,defutil,objcgutl,
+    symconst,symsym,symdef,
     node,nld,ncon,
     verbose;
 
@@ -54,54 +58,50 @@ procedure tcgobjcselectornode.pass_generate_code;
     strlab : tasmlabel;
     pool   : THashSet;
     entry  : PHashSetItem;
-    name   : string;
+    name   : pshortstring;
     pc     : pchar;
   begin
-    if current_asmdata.ConstPools[sp_objcselector] = nil then
-      current_asmdata.ConstPools[sp_objcselector] := THashSet.Create(64, True, False);
-    pool := current_asmdata.ConstPools[sp_objcselector];
+    if current_asmdata.ConstPools[sp_varnamerefs]=nil then
+      current_asmdata.ConstPools[sp_varnamerefs]:=THashSet.Create(64, True, False);
+    pool:=current_asmdata.ConstPools[sp_varnamerefs];
 
     case left.nodetype of
       loadn:
         begin
-          name:=tprocsym(tloadnode(left).symtableentry).mangledname;
-          entry := pool.FindOrAdd(@name[1],length(name))
+          if (tloadnode(left).symtableentry.typ<>procsym) then
+            internalerror(2009051602);
+          if (tprocsym(tloadnode(left).symtableentry).procdeflist.count<>1) then
+            internalerror(2009051701);
+          name:=tprocdef(tprocsym(tloadnode(left).symtableentry).procdeflist[0]).messageinf.str;
+          entry:=pool.FindOrAdd(@name^[1],length(name^))
         end;
       stringconstn:
         begin
-          entry := pool.FindOrAdd(tstringconstnode(left).value_str, tstringconstnode(left).len);
+          entry:=pool.FindOrAdd(tstringconstnode(left).value_str,tstringconstnode(left).len);
         end;
       else
         internalerror(2009030701);
     end;
 
-    { have we already generated this selector? }
-    if not assigned(entry^.Data) then
-      begin
-        { create new one
-          (no getdatalabel, because these labels have to be local)
-        }
-        current_asmdata.getlabel(reflab,alt_data);
-        current_asmdata.getlabel(strlab,alt_data);
-        entry^.Data := reflab;
-        getmem(pc,entry^.keylength+1);
-        move(entry^.key^,pc^,entry^.keylength);
-        pc[entry^.keylength]:=#0;
-        { add a pointer to the message name in the objc_message_refs section }
-        new_section(current_asmdata.asmlists[al_objc_data],sec_objc_message_refs,reflab.name,sizeof(pint));
-        current_asmdata.asmlists[al_objc_data].concat(Tai_label.Create(reflab));
-        current_asmdata.asmlists[al_objc_data].concat(Tai_const.Create_sym(strlab));
-
-        { and now add the message name to the meth_var_names }
-        new_section(current_asmdata.asmlists[al_objc_data],sec_objc_meth_var_names,strlab.name,1);
-        current_asmdata.asmlists[al_objc_data].concat(Tai_label.Create(strlab));
-        current_asmdata.asmlists[al_objc_data].concat(Tai_string.Create_pchar(pc,entry^.keylength+1));
-    end;
-    location_reset_ref(location, LOC_CREFERENCE, def_cgsize(resultdef), sizeof(pint));
+    objcfinishstringrefpoolentry(entry,sp_objcvarnames,sec_objc_message_refs,sec_objc_meth_var_names);
+
+    location_reset_ref(location,LOC_CREFERENCE,def_cgsize(resultdef),sizeof(pint));
     location.reference.symbol:=tasmlabel(entry^.Data);
   end;
 
 
+{*****************************************************************************
+                           TCGOBJCPROTOCOLNODE
+*****************************************************************************}
+
+procedure tcgobjcprotocolnode.pass_generate_code;
+  begin
+    { first needs support for writing class definitions }
+    internalerror(2009072601);
+  end;
+
+
 begin
   cobjcselectornode:=tcgobjcselectornode;
+  cobjcprotocolnode:=tcgobjcprotocolnode;
 end.

+ 5 - 1
compiler/ncgrtti.pas

@@ -73,7 +73,11 @@ implementation
 
 
     const
-       rttidefstate : array[trttitype] of tdefstate = (ds_rtti_table_written,ds_init_table_written);
+       rttidefstate : array[trttitype] of tdefstate =
+         (ds_rtti_table_written,ds_init_table_written,
+         { Objective-C related, does not pass here }
+         symconst.ds_none,symconst.ds_none,
+         symconst.ds_none,symconst.ds_none);
 
     type
        TPropNameListItem = class(TFPHashObject)

+ 5 - 1
compiler/ncgutil.pas

@@ -2845,6 +2845,9 @@ implementation
             end;
           end
         else
+          { This is also valid for Objective-C classes: vmt_offset is 0 there,
+            and the first "field" of an Objective-C class instance is a pointer
+            to its "meta-class".  }
           begin
             case selfloc.loc of
               LOC_REGISTER:
@@ -2876,7 +2879,8 @@ implementation
 
         { test validity of VMT }
         if not(is_interface(objdef)) and
-           not(is_cppclass(objdef)) then
+           not(is_cppclass(objdef)) and
+           not(is_objc_class_or_protocol(objdef)) then
            cg.g_maybe_testvmt(list,vmtreg,objdef);
       end;
 

+ 8 - 5
compiler/ncnv.pas

@@ -622,7 +622,8 @@ implementation
               if iscvarargs then
                 p:=ctypeconvnode.create(p,voidpointertype);
             objectdef :
-              if iscvarargs or
+              if (iscvarargs and
+                  not is_objc_class_or_protocol(p.resultdef)) or
                  is_object(p.resultdef) then
                 CGMessagePos1(p.fileinfo,type_e_wrong_type_in_array_constructor,p.resultdef.typename);
             else
@@ -1801,8 +1802,8 @@ implementation
                        make_not_regable(left,[ra_addr_regable]);
 
                      { class/interface to class/interface, with checkobject support }
-                     if is_class_or_interface(resultdef) and
-                        is_class_or_interface(left.resultdef) then
+                     if is_class_or_interface_or_objc(resultdef) and
+                        is_class_or_interface_or_objc(left.resultdef) then
                        begin
                          { check if the types are related }
                          if not(nf_internal in flags) and
@@ -1823,7 +1824,9 @@ implementation
                            end;
 
                          { Add runtime check? }
-                         if (cs_check_object in current_settings.localswitches) and
+                         if not is_objc_class_or_protocol(resultdef) and
+                            not is_objc_class_or_protocol(left.resultdef) and
+                            (cs_check_object in current_settings.localswitches) and
                             not(nf_internal in flags) then
                            begin
                              { we can translate the typeconvnode to 'as' when
@@ -1874,7 +1877,7 @@ implementation
                                    { however, there are some exceptions }
                                    (not(resultdef.typ in [arraydef,recorddef,setdef,stringdef,
                                                           filedef,variantdef,objectdef]) or
-                                   is_class_or_interface(resultdef) or
+                                   is_class_or_interface_or_objc(resultdef) or
                                    { the softfloat code generates casts <const. float> to record }
                                    (nf_internal in flags)
                                  ))

+ 23 - 1
compiler/ninl.pas

@@ -86,7 +86,8 @@ implementation
       globtype, cutils,
       symconst,symdef,symsym,symtable,paramgr,defutil,
       pass_1,
-      ncal,ncon,ncnv,nadd,nld,nbas,nflw,nmem,nmat,nutils,nobjc,
+      ncal,ncon,ncnv,nadd,nld,nbas,nflw,nmem,nmat,nutils,
+      nobjc,objcutil,
       cgbase,procinfo
       ;
 
@@ -1900,6 +1901,17 @@ implementation
         end;
 
 
+      function handle_objc_encode: tnode;
+        var
+          encodedtype: ansistring;
+          errordef: tdef;
+        begin
+          encodedtype:='';
+          if not objctryencodetype(left.resultdef,encodedtype,errordef) then
+            Message1(type_e_objc_type_unsupported,errordef.typename);
+          result:=cstringconstnode.createpchar(ansistring2pchar(encodedtype),length(encodedtype));
+        end;
+
 
       var
          hightree,
@@ -2456,6 +2468,16 @@ implementation
                   { reused }
                   left:=nil;
                 end;
+              in_objc_protocol_x:
+                begin
+                  result:=cobjcprotocolnode.create(left);
+                  { reused }
+                  left:=nil;
+                end;
+              in_objc_encode_x:
+                begin
+                  result:=handle_objc_encode;
+                end;
               else
                 internalerror(8);
             end;

+ 35 - 12
compiler/nmem.pas

@@ -167,22 +167,45 @@ implementation
 
 
     function tloadvmtaddrnode.pass_1 : tnode;
+      var
+        vs: tsym;
       begin
          result:=nil;
          expectloc:=LOC_REGISTER;
          if left.nodetype<>typen then
-           firstpass(left)
-         else if not(nf_ignore_for_wpo in flags) and
-             (not assigned(current_procinfo) or
-              (po_inline in current_procinfo.procdef.procoptions) or
-              wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname)) then
            begin
-             { keep track of which classes might be instantiated via a classrefdef }
-             if (left.resultdef.typ=classrefdef) then
-               tobjectdef(tclassrefdef(left.resultdef).pointeddef).register_maybe_created_object_type
-             else if (left.resultdef.typ=objectdef) then
-               tobjectdef(left.resultdef).register_maybe_created_object_type
+             { make sure that the isa field is loaded correctly in case
+               of the non-fragile ABI }
+             if is_objcclass(left.resultdef) and
+                (left.nodetype<>typen) then
+               begin
+                 vs:=search_class_member(tobjectdef(left.resultdef),'ISA');
+                 if not assigned(vs) or
+                    (tsym(vs).typ<>fieldvarsym) then
+                   internalerror(2009092502);
+                 result:=csubscriptnode.create(tfieldvarsym(vs),left);
+                 inserttypeconv_internal(result,resultdef);
+                 { reused }
+                 left:=nil;
+               end
+             else
+               firstpass(left)
            end
+         else if not is_objcclass(left.resultdef) and
+                 not is_objcclassref(left.resultdef) then
+           begin
+             if not(nf_ignore_for_wpo in flags) and
+                (not assigned(current_procinfo) or
+                 (po_inline in current_procinfo.procdef.procoptions) or
+                  wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname)) then
+             begin
+               { keep track of which classes might be instantiated via a classrefdef }
+               if (left.resultdef.typ=classrefdef) then
+                 tobjectdef(tclassrefdef(left.resultdef).pointeddef).register_maybe_created_object_type
+               else if (left.resultdef.typ=objectdef) then
+                 tobjectdef(left.resultdef).register_maybe_created_object_type
+             end
+           end;
       end;
 
 
@@ -625,8 +648,8 @@ implementation
          if codegenerror then
           exit;
 
-         { classes must be dereferenced implicit }
-         if is_class_or_interface(left.resultdef) then
+         { classes must be dereferenced implicitly }
+         if is_class_or_interface_or_objc(left.resultdef) then
            expectloc:=LOC_REFERENCE
          else
            begin

+ 162 - 20
compiler/nobj.pas

@@ -37,17 +37,21 @@ interface
       TVMTBuilder=class
       private
         _Class : tobjectdef;
+        handledprotocols: tfpobjectlist;
         function  is_new_vmt_entry(pd:tprocdef):boolean;
         procedure add_new_vmt_entry(pd:tprocdef);
+        function  check_msg_str(vmtpd, pd: tprocdef):boolean;
         function  intf_search_procdef_by_name(proc: tprocdef;const name: string): tprocdef;
         procedure intf_get_procdefs(ImplIntf:TImplementedInterface;IntfDef:TObjectDef);
         procedure intf_get_procdefs_recursive(ImplIntf:TImplementedInterface;IntfDef:TObjectDef);
+        procedure prot_get_procdefs_recursive(ImplProt:TImplementedInterface;ProtDef:TObjectDef);
         procedure intf_optimize_vtbls;
         procedure intf_allocate_vtbls;
       public
         constructor create(c:tobjectdef);
         destructor  destroy;override;
-        procedure generate_vmt;
+        procedure  generate_vmt;
+        procedure  build_interface_mappings;
       end;
 
     type
@@ -179,9 +183,49 @@ implementation
       end;
 
 
+      function TVMTBuilder.check_msg_str(vmtpd, pd: tprocdef): boolean;
+        begin
+          result:=true;
+          if not(is_objc_class_or_protocol(_class)) then
+            begin
+              { the only requirement for normal methods is that both either
+                have a message string or not (the value is irrelevant) }
+              if ((pd.procoptions * [po_msgstr]) <> (vmtpd.procoptions * [po_msgstr])) then
+                begin
+                  MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,pd.fullprocname(false));
+                  tprocsym(vmtpd.procsym).write_parameter_lists(pd);
+                  result:=false;
+                end
+            end
+          else
+            begin
+              { the compiler should have ensured that the protocol or parent
+                class method has a message name specified }
+              if not(po_msgstr in vmtpd.procoptions) then
+                internalerror(2009070601);
+              if not(po_msgstr in pd.procoptions) then
+                begin
+                  { copy the protocol's/parent class' message name to the one in
+                    the class if none has been specified there }
+                  include(pd.procoptions,po_msgstr);
+                  pd.messageinf.str:=stringdup(vmtpd.messageinf.str^);
+                end
+              else
+                begin
+                  { if both have a message name, make sure they are equal }
+                  if (vmtpd.messageinf.str^<>pd.messageinf.str^) then
+                    begin
+                      MessagePos2(pd.fileinfo,parser_e_objc_message_name_changed,vmtpd.messageinf.str^,pd.messageinf.str^);
+                      result:=false;
+                    end;
+                end;
+            end;
+        end;
+
+
     function TVMTBuilder.is_new_vmt_entry(pd:tprocdef):boolean;
       const
-        po_comp = [po_classmethod,po_virtualmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgstr,po_msgint,
+        po_comp = [po_classmethod,po_virtualmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgint,
                    po_exports,po_varargs,po_explicitparaloc,po_nostackframe];
       var
         i : longint;
@@ -238,7 +282,7 @@ implementation
                (
                 not(po_virtualmethod in pd.procoptions) or
                 { new one has not override }
-                (is_class_or_interface(_class) and not(po_overridingmethod in pd.procoptions))
+                (is_class_or_interface_or_objc(_class) and not(po_overridingmethod in pd.procoptions))
                ) then
               begin
                 if (
@@ -247,7 +291,31 @@ implementation
                    ) then
                   begin
                     if not(po_reintroduce in pd.procoptions) then
-                      MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false));
+                      if not(is_objc_class_or_protocol(_class)) then
+                        MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false))
+                      else
+                        begin
+                          { In Objective-C, you cannot create a new VMT entry to
+                            start a new inheritance tree. We therefore give an
+                            error when the class is implemented in Pascal, to
+                            avoid confusion due to things working differently
+                            with Object Pascal classes.
+
+                            In case of external classes, we only give a hint,
+                            because requiring override everywhere may make
+                            automated header translation tools too complex.  }
+                          if not(oo_is_external in _class.objectoptions) then
+                            MessagePos1(pd.fileinfo,parser_e_must_use_override_objc,pd.fullprocname(false))
+                          { there may be a lot of these in auto-translated
+                            heaeders, so only calculate the fullprocname if
+                            the hint will be shown  }
+                          else if CheckVerbosity(V_Hint) then
+                            MessagePos1(pd.fileinfo,parser_h_should_use_override_objc,pd.fullprocname(false));
+                          { no new entry, but copy the message name if any from
+                            the procdef in the parent class }
+                          check_msg_str(vmtpd,pd);
+                          exit;
+                        end;
                     { disable/hide old VMT entry }
                     vmtentry^.visibility:=vis_hidden;
                   end;
@@ -280,6 +348,8 @@ implementation
                          tprocsym(vmtpd.procsym).write_parameter_lists(pd);
                        end;
 
+                    check_msg_str(vmtpd,pd);
+
                     { Give a note if the new visibility is lower. For a higher
                       visibility update the vmt info }
                     if vmtentry^.visibility>pd.visibility then
@@ -306,10 +376,12 @@ implementation
                      begin
                        if not(po_reintroduce in pd.procoptions) then
                          begin
-                           if not is_object(_class) then
+                           if not is_object(_class) and
+                              not is_objc_class_or_protocol(_class) then
                              MessagePos1(pd.fileinfo,parser_w_should_use_override,pd.fullprocname(false))
                            else
-                             { objects don't allow starting a new virtual tree }
+                             { objects don't allow starting a new virtual tree
+                               and neither does Objective-C }
                              MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,vmtpd.fullprocname(false));
                          end;
                        { disable/hide old VMT entry }
@@ -325,7 +397,7 @@ implementation
 
     function TVMTBuilder.intf_search_procdef_by_name(proc: tprocdef;const name: string): tprocdef;
       const
-        po_comp = [po_classmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgstr,po_msgint,
+        po_comp = [po_classmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgint,
                    po_exports,po_varargs,po_explicitparaloc,po_nostackframe];
       var
         implprocdef : Tprocdef;
@@ -351,7 +423,8 @@ implementation
                        (compare_defs(proc.returndef,implprocdef.returndef,nothingn)>=te_equal) and
                        (proc.proccalloption=implprocdef.proccalloption) and
                        (proc.proctypeoption=implprocdef.proctypeoption) and
-                       ((proc.procoptions*po_comp)=((implprocdef.procoptions+[po_virtualmethod])*po_comp)) then
+                       ((proc.procoptions*po_comp)=((implprocdef.procoptions+[po_virtualmethod])*po_comp)) and
+                       check_msg_str(proc,implprocdef) then
                       begin
                         result:=implprocdef;
                         exit;
@@ -391,9 +464,32 @@ implementation
                   implprocdef:=intf_search_procdef_by_name(tprocdef(def),tprocdef(def).procsym.name);
                 { Add procdef to the implemented interface }
                 if assigned(implprocdef) then
-                  ImplIntf.AddImplProc(implprocdef)
+                  begin
+                    if (implprocdef._class.objecttype<>odt_objcclass) then
+                      ImplIntf.AddImplProc(implprocdef)
+                    else
+                      begin
+                        { If no message name has been specified for the method
+                          in the objcclass, copy it from the protocol
+                          definition.  }
+                        if not(po_msgstr in tprocdef(def).procoptions) then
+                          begin
+                            include(tprocdef(def).procoptions,po_msgstr);
+                            implprocdef.messageinf.str:=stringdup(tprocdef(def).messageinf.str^);
+                          end
+                        else
+                          begin
+                            { If a message name has been specified in the
+                              objcclass, it has to match the message name in the
+                              protocol definition.  }
+                            if (implprocdef.messageinf.str^<>tprocdef(def).messageinf.str^) then
+                              MessagePos2(implprocdef.fileinfo,parser_e_objc_message_name_changed,tprocdef(def).messageinf.str^,implprocdef.messageinf.str^);
+                          end;
+                      end;
+                  end
                 else
-                  if ImplIntf.IType=etStandard then
+                  if (ImplIntf.IType=etStandard) and
+                     not(po_optional in tprocdef(def).procoptions) then
                     Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
               end;
           end;
@@ -408,6 +504,20 @@ implementation
       end;
 
 
+    procedure TVMTBuilder.prot_get_procdefs_recursive(ImplProt:TImplementedInterface;ProtDef:TObjectDef);
+      var
+        i: longint;
+      begin
+        { don't check the same protocol twice }
+        if handledprotocols.IndexOf(ProtDef)<>-1 then
+          exit;
+        handledprotocols.add(ProtDef);
+        for i:=0 to ProtDef.ImplementedInterfaces.count-1 do
+          prot_get_procdefs_recursive(ImplProt,TImplementedInterface(ProtDef.ImplementedInterfaces[i]).intfdef);
+        intf_get_procdefs(ImplProt,ProtDef);
+      end;
+
+
     procedure TVMTBuilder.intf_optimize_vtbls;
       type
         tcompintfentry = record
@@ -550,7 +660,6 @@ implementation
       var
         i : longint;
         def : tdef;
-        ImplIntf : TImplementedInterface;
         old_current_objectdef : tobjectdef;
       begin
         old_current_objectdef:=current_objectdef;
@@ -579,16 +688,10 @@ implementation
                   add_new_vmt_entry(tprocdef(def));
               end;
           end;
-
-        { Find Procdefs implementing the interfaces }
-        if assigned(_class.ImplementedInterfaces) then
+        build_interface_mappings;
+        if assigned(_class.ImplementedInterfaces) and
+           not(is_objc_class_or_protocol(_class)) then
           begin
-            { Collect implementor functions into the tImplementedInterface.procdefs }
-            for i:=0 to _class.ImplementedInterfaces.count-1 do
-              begin
-                ImplIntf:=TImplementedInterface(_class.ImplementedInterfaces[i]);
-                intf_get_procdefs_recursive(ImplIntf,ImplIntf.IntfDef);
-              end;
             { Optimize interface tables to reuse wrappers }
             intf_optimize_vtbls;
             { Allocate interface tables }
@@ -599,6 +702,45 @@ implementation
       end;
 
 
+    procedure TVMTBuilder.build_interface_mappings;
+      var
+        ImplIntf : TImplementedInterface;
+        i: longint;
+      begin
+        { Find Procdefs implementing the interfaces }
+        if assigned(_class.ImplementedInterfaces) and
+           (_class.objecttype<>odt_objcprotocol) then
+          begin
+            { Collect implementor functions into the tImplementedInterface.procdefs }
+            case _class.objecttype of
+              odt_class:
+                begin
+                  for i:=0 to _class.ImplementedInterfaces.count-1 do
+                    begin
+                      ImplIntf:=TImplementedInterface(_class.ImplementedInterfaces[i]);
+                      intf_get_procdefs_recursive(ImplIntf,ImplIntf.IntfDef)
+                    end;
+                end;
+              odt_objcclass:
+                begin
+                  { Object Pascal interfaces are afterwards optimized via the
+                    intf_optimize_vtbls() method, but we can't do this for
+                    protocols -> check for duplicates here already. }
+                  handledprotocols:=tfpobjectlist.create(false);
+                  for i:=0 to _class.ImplementedInterfaces.count-1 do
+                    begin
+                      ImplIntf:=TImplementedInterface(_class.ImplementedInterfaces[i]);
+                      prot_get_procdefs_recursive(ImplIntf,ImplIntf.IntfDef);
+                    end;
+                  handledprotocols.free;
+                end
+              else
+                internalerror(2009091801);
+            end
+          end;
+      end;
+
+
 {*****************************************************************************
                                 TVMTWriter
 *****************************************************************************}

+ 65 - 53
compiler/nobjc.pas

@@ -37,22 +37,36 @@ type
   tobjcselectornode = class(tunarynode)
    public
     constructor create(formethod: tnode);
-    function pass_typecheck:tnode;override;
-    function pass_1 : tnode;override;
+    function pass_typecheck: tnode;override;
+    function pass_1: tnode;override;
   end;
   tobjcselectornodeclass = class of tobjcselectornode;
 
+  tobjcprotocolnode = class(tunarynode)
+   public
+    constructor create(forprotocol: tnode);
+    function pass_typecheck: tnode;override;
+    function pass_1: tnode;override;
+  end;
+  tobjcprotocolnodeclass = class of tobjcprotocolnode;
+
 var
   cobjcselectornode : tobjcselectornodeclass;
+  cobjcprotocolnode : tobjcprotocolnodeclass;
 
 implementation
 
 uses
   sysutils,
-  cclasses,
+  globtype,cclasses,systems,
   verbose,pass_1,
-  defutil,symtable,symdef,symconst,
-  ncnv,ncon,ncal,nmem;
+  defutil,
+  symtype,symtable,symdef,symconst,symsym,
+  paramgr,
+  nutils,
+  nbas,nld,ncnv,ncon,ncal,nmem,
+  objcutil,
+  cgbase;
 
 
 {*****************************************************************************
@@ -65,51 +79,10 @@ constructor tobjcselectornode.create(formethod: tnode);
   end;
 
 
-function validselectorname(value_str: pchar; len: longint): boolean;
-  var
-    i         : longint;
-    gotcolon  : boolean;
-begin
-  result:=false;
-  { empty name is not allowed }
-  if (len=0) then
-    exit;
-
-  gotcolon:=false;
-
-  { if the first character is a colon, all of them must be colons }
-  if (value_str[0] = ':') then
-    begin
-      for i:=1 to len-1 do
-        if (value_str[i]<>':') then
-          exit;
-    end
-  else
-    begin
-      { no special characters other than ':'
-        (already checked character 0, so start checking from 1)
-      }
-      for i:=1 to len-1 do
-        if (value_str[i] = ':') then
-          gotcolon:=true
-        else if not(value_str[i] in ['_','A'..'Z','a'..'z','0'..'9',':']) then
-          exit;
-
-      { if there is at least one colon, the final character must
-        also be a colon (in case it's only one character that is
-        a colon, this was already checked before the above loop)
-      }
-      if gotcolon and
-         (value_str[len-1] <> ':') then
-        exit;
-    end;
-
-
-  result:=true;
-end;
-
-
 function tobjcselectornode.pass_typecheck: tnode;
+  var
+    len: longint;
+    s: shortstring;
   begin
     result:=nil;
     typecheckpass(left);
@@ -130,24 +103,63 @@ function tobjcselectornode.pass_typecheck: tnode;
         end;
       stringconstn:
         begin
-          if not validselectorname(tstringconstnode(left).value_str,
-                                   tstringconstnode(left).len) then
+          if not objcvalidselectorname(tstringconstnode(left).value_str,
+                                       tstringconstnode(left).len) then
             begin
-              CGMessage(type_e_invalid_objc_selector_name);
+              len:=tstringconstnode(left).len;
+              if (len>255) then
+                len:=255;
+              setlength(s,len);
+              move(tstringconstnode(left).value_str^,s[1],len);
+              CGMessage1(type_e_invalid_objc_selector_name,s);
               exit;
             end;
         end
       else
         CGMessage(type_e_expected_objc_method);
     end;
-    resultdef:=search_system_type('SEL').typedef;
+    resultdef:=objc_seltype;
   end;
 
 
 function tobjcselectornode.pass_1: tnode;
   begin
     result:=nil;
+    expectloc:=LOC_CREFERENCE;
+  end;
+
+
+{*****************************************************************************
+                            TOBJPROTOCOLNODE
+*****************************************************************************}
+
+constructor tobjcprotocolnode.create(forprotocol: tnode);
+  begin
+    inherited create(objcprotocoln,forprotocol);
+  end;
+
+
+function tobjcprotocolnode.pass_typecheck: tnode;
+  begin
+    result:=nil;
+    typecheckpass(left);
+    if (left.nodetype<>typen) then
+      MessagePos(left.fileinfo,type_e_type_id_expected)
+    else if not is_objcprotocol(left.resultdef) then
+      MessagePos2(left.fileinfo,type_e_incompatible_types,left.resultdef.typename,'ObjCProtocol');
+    resultdef:=objc_protocoltype;
   end;
 
+
+function tobjcprotocolnode.pass_1: tnode;
+  begin
+    result:=ccallnode.createinternresfromunit('OBJC','OBJC_GETPROTOCOL',
+      ccallparanode.create(cstringconstnode.createstr(tobjectdef(left.resultdef).objextname^),nil),
+      resultdef
+    );
+    typecheckpass(result);
+  end;
+
+
 end.
 

+ 4 - 2
compiler/node.pas

@@ -110,7 +110,8 @@ interface
           rttin,            { Rtti information so they can be accessed in result/firstpass}
           loadparentfpn,    { Load the framepointer of the parent for nested procedures }
           dataconstn,       { node storing some binary data }
-          objcselectorn
+          objcselectorn,    { node for an Objective-C message selector }
+          objcprotocoln     { node for an Objective-C @protocol() expression (returns metaclass associated with protocol) }
        );
 
        tnodetypeset = set of tnodetype;
@@ -192,7 +193,8 @@ interface
           'rttin',
           'loadparentfpn',
           'dataconstn',
-          'objcselectorn');
+          'objcselectorn',
+          'objcprotocoln');
 
     type
        { all boolean field of ttree are now collected in flags }

+ 1 - 1
compiler/nutils.pas

@@ -663,7 +663,7 @@ implementation
                 end;
               subscriptn:
                 begin
-                  if is_class_or_interface(tunarynode(p).left.resultdef) then
+                  if is_class_or_interface_or_objc(tunarynode(p).left.resultdef) then
                     inc(result);
                   if (result = NODE_COMPLEXITY_INF) then
                     exit;

+ 1448 - 0
compiler/objcgutl.pas

@@ -0,0 +1,1448 @@
+{
+    Copyright (c) 2009 by Jonas Maebe
+
+    This unit implements some Objective-C helper routines at the code generator
+    level.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License,or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+
+{$i fpcdefs.inc}
+
+unit objcgutl;
+
+interface
+
+  uses
+    cclasses,
+    aasmbase,aasmdata,
+    symbase,symdef;
+
+  procedure objcfinishstringrefpoolentry(entry: phashsetitem; stringpool: tconstpooltype; refsec, stringsec: tasmsectiontype);
+  procedure objcfinishclassrefnfpoolentry(entry: phashsetitem; classdef: tobjectdef);
+
+  procedure MaybeGenerateObjectiveCImageInfo(globalst, localst: tsymtable);
+
+
+implementation
+
+  uses
+    globtype,globals,fmodule,
+    systems,
+    aasmtai,
+    cgbase,
+    objcutil,
+    symconst,symtype,symsym,symtable,
+    verbose;
+
+  type
+    tobjcabi = (oa_fragile, oa_nonfragile);
+(*    tivarlayouttype = (il_weak,il_strong); *)
+
+    tobjcrttiwriter = class
+     protected
+      fabi: tobjcabi;
+      classdefs: tfpobjectlist;
+      classsyms: tfpobjectlist;
+      procedure gen_objc_methods(list: tasmlist; objccls: tobjectdef; out methodslabel: tasmlabel; classmethods, iscategory: Boolean);
+      procedure gen_objc_protocol_list(list:TAsmList; protolist: TFPObjectList; out protolistsym: TAsmLabel);
+      procedure gen_objc_cat_methods(list:TAsmList; items: TFPObjectList; section: tasmsectiontype;const sectname: string; out listsym: TAsmLabel);
+
+      procedure gen_objc_protocol(list:TAsmList; protocol: tobjectdef; out protocollabel: TAsmSymbol);virtual;abstract;
+      procedure gen_objc_classes_sections(list:TAsmList; objclss: tobjectdef; out classlabel: TAsmSymbol);virtual;abstract;
+      procedure gen_objc_info_sections(list: tasmlist);virtual;abstract;
+     public
+      constructor create(_abi: tobjcabi);
+      destructor destroy;override;
+      procedure gen_objc_rtti_sections(list:TAsmList; st:TSymtable);
+      property abi: tobjcabi read fabi;
+    end;
+
+
+    { Used by by PowerPC/32 and i386 }
+    tobjcrttiwriter_fragile = class(tobjcrttiwriter)
+     protected
+      procedure gen_objc_ivars(list: TAsmList; objccls: tobjectdef; out ivarslabel: TAsmLabel);
+      procedure gen_objc_protocol(list:TAsmList; protocol: tobjectdef; out protocollabel: TAsmSymbol);override;
+      procedure gen_objc_classes_sections(list:TAsmList; objclss: tobjectdef; out classlabel: TAsmSymbol);override;
+      procedure gen_objc_info_sections(list: tasmlist);override;
+     public
+      constructor create;
+    end;
+
+
+    { Used by PowerPC/64, ARM, and x86_64 }
+    tobjcrttiwriter_nonfragile = class(tobjcrttiwriter)
+     protected
+      ObjCEmptyCacheVar,
+      ObjCEmptyVtableVar: TAsmSymbol;
+
+      procedure gen_objc_class_ro_part(list: TAsmList; objclss: tobjectdef; protolistsym: TAsmSymbol; out classrolabel: TAsmSymbol; metaclass: boolean);
+      procedure addclasslist(list: tasmlist; section: tasmsectiontype; const symname: string; classes: tfpobjectlist);
+
+      procedure gen_objc_ivars(list: TAsmList; objccls: tobjectdef; out ivarslabel: TAsmLabel);
+      procedure gen_objc_protocol(list:TAsmList; protocol: tobjectdef; out protocollabel: TAsmSymbol);override;
+      procedure gen_objc_classes_sections(list:TAsmList; objclss: tobjectdef; out classlabel: TAsmSymbol);override;
+      procedure gen_objc_info_sections(list: tasmlist);override;
+     public
+      constructor create;
+    end;
+
+
+
+{******************************************************************
+                    Protocol declaration helpers
+*******************************************************************}
+
+function objcfindprotocolentry(const p: shortstring): TAsmSymbol;
+  var
+    item  : PHashSetItem;
+  begin
+    result:=nil;
+    if not assigned(current_asmdata.ConstPools[sp_objcprotocolrefs]) then
+      exit;
+    item:=current_asmdata.constpools[sp_objcprotocolrefs].Find(@p[1], length(p));
+    if not assigned(item) then
+      exit;
+    result:=TAsmSymbol(item^.Data);
+  end;
+
+
+function objcaddprotocolentry(const p: shortstring; ref: TAsmSymbol): Boolean;
+  var
+    item  : PHashSetItem;
+  begin
+    if current_asmdata.ConstPools[sp_objcprotocolrefs]=nil then
+      current_asmdata.ConstPools[sp_objcprotocolrefs]:=THashSet.Create(64, True, False);
+
+    item:=current_asmdata.constpools[sp_objcprotocolrefs].FindOrAdd(@p[1], length(p));
+    Result:=(item^.Data=nil);
+    if Result then
+      item^.Data:=ref;
+  end;
+
+{******************************************************************
+                       Pool section helpers
+*******************************************************************}
+
+function objcreatestringpoolentryintern(p: pchar; len: longint; pooltype: tconstpooltype; stringsec: tasmsectiontype): TAsmSymbol;
+  var
+    entry  : PHashSetItem;
+    strlab : tasmlabel;
+    pc     : pchar;
+    pool   : THashSet;
+  begin
+    if current_asmdata.ConstPools[pooltype]=nil then
+       current_asmdata.ConstPools[pooltype]:=THashSet.Create(64, True, False);
+    pool := current_asmdata.constpools[pooltype];
+
+    entry:=pool.FindOrAdd(p,len);
+    if not assigned(entry^.data) then
+      begin
+        { create new entry }
+        current_asmdata.getlabel(strlab,alt_data);
+        entry^.Data:=strlab;
+        getmem(pc,entry^.keylength+1);
+        move(entry^.key^,pc^,entry^.keylength);
+        pc[entry^.keylength]:=#0;
+
+        { add the string to the approriate section }
+        new_section(current_asmdata.asmlists[al_objc_pools],stringsec,strlab.name,sizeof(pint));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_label.Create(strlab));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_string.Create_pchar(pc,entry^.keylength+1));
+        Result := strlab;
+      end
+    else
+      Result := TAsmLabel(Entry^.Data);
+  end;
+
+
+procedure objcfinishstringrefpoolentry(entry: phashsetitem; stringpool: tconstpooltype; refsec, stringsec: tasmsectiontype);
+  var
+    reflab : tasmlabel;
+    strlab : tasmsymbol;
+    classname: string;
+  begin
+    { have we already generated a reference for this string entry? }
+    if not assigned(entry^.Data) then
+      begin
+        { no, add the string to the associated strings section }
+        strlab:=objcreatestringpoolentryintern(pchar(entry^.key),entry^.keylength,stringpool,stringsec);
+
+        { and now finish the reference }
+        current_asmdata.getlabel(reflab,alt_data);
+        entry^.Data:=reflab;
+
+        { add a pointer to the string in the string references section }
+        new_section(current_asmdata.asmlists[al_objc_pools],refsec,reflab.name,sizeof(pint));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_label.Create(reflab));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_const.Create_sym(strlab));
+
+        { in case of a class reference, also add a lazy symbol reference for
+          the class (the linker requires this for the fragile ABI). }
+        if (refsec=sec_objc_cls_refs) and
+           not(target_info.system in system_objc_nfabi) then
+          begin
+            setlength(classname,entry^.keylength);
+            move(entry^.key^,classname[1],entry^.keylength);
+            current_asmdata.asmlists[al_objc_pools].concat(tai_directive.Create(asd_lazy_reference,'.objc_class_name_'+classname));
+          end;
+      end;
+  end;
+
+
+function objcreatestringpoolentry(const s: string; pooltype: tconstpooltype; stringsec: tasmsectiontype): TAsmSymbol;
+  begin
+    result:=objcreatestringpoolentryintern(@s[1],length(s),pooltype,stringsec);
+  end;
+
+
+procedure objcfinishclassrefnfpoolentry(entry: phashsetitem; classdef: tobjectdef);
+  var
+    reflab: TAsmLabel;
+    classym: TasmSymbol;
+  begin
+    { have we already generated a reference for this class ref entry? }
+    if not assigned(entry^.Data) then
+      begin
+        { no, add the classref to the sec_objc_cls_refs section }
+        current_asmdata.getlabel(reflab,alt_data);
+        entry^.Data:=reflab;
+
+        { add a pointer to the class }
+        new_section(current_asmdata.asmlists[al_objc_pools],sec_objc_cls_refs,reflab.name,sizeof(pint));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_label.Create(reflab));
+        classym:=current_asmdata.RefAsmSymbol(classdef.rtti_mangledname(objcclassrtti));
+        current_asmdata.asmlists[al_objc_pools].concat(Tai_const.Create_sym(classym));
+      end;
+  end;
+
+{******************************************************************
+                    RTTI generation -- Helpers
+*******************************************************************}
+
+procedure ConcatSymOrNil(list: tasmlist; sym: TAsmSymbol); inline;
+begin
+  if Assigned(sym) then
+    list.Concat(tai_const.Create_sym(sym))
+  else
+    list.Concat(tai_const.Create_pint(0));
+end;
+
+
+{******************************************************************
+                 RTTI generation -- Common
+*******************************************************************}
+
+{ generate a method list, either of class methods or of instance methods,
+  and both for obj-c classes and categories. }
+procedure tobjcrttiwriter.gen_objc_methods(list: tasmlist; objccls: tobjectdef; out methodslabel: tasmlabel; classmethods, iscategory: Boolean);
+  const
+    clsSectType : array [Boolean] of tasmsectiontype = (sec_objc_inst_meth, sec_objc_cls_meth);
+    clsSectName : array [Boolean] of string = ('_OBJC_INST_METH','_OBJC_CLS_METH');
+    catSectType : array [Boolean] of tasmsectiontype = (sec_objc_cat_inst_meth, sec_objc_cat_cls_meth);
+    catSectName : array [Boolean] of string = ('_OBJC_CAT_INST_METH','_OBJC_CAT_CLS_METH');
+  type
+    method_data = record
+      def     : tprocdef;
+      selsym  : TAsmSymbol;
+      encsym  : TAsmSymbol;
+    end;
+  var
+    i     : Integer;
+    def   : tprocdef;
+    defs  : array of method_data;
+    mcnt  : integer;
+    sym   : tasmsymbol;
+    mtype : tdef;
+  begin
+    methodslabel:=nil;
+    mcnt:=0;
+    { collect all instance/class methods }
+    SetLength(defs,objccls.vmtentries.count);
+    for i:=0 to objccls.vmtentries.count-1 do
+      begin
+        def:=pvmtentry(objccls.vmtentries[i])^.procdef;
+        if Assigned(def.procstarttai) and
+           (classmethods = (po_classmethod in def.procoptions)) then
+          begin
+            defs[mcnt].def:=def;
+            defs[mcnt].selsym:=objcreatestringpoolentry(def.messageinf.str^,sp_objcvarnames,sec_objc_meth_var_names);
+            defs[mcnt].encsym:=objcreatestringpoolentry(objcencodemethod(def),sp_objcvartypes,sec_objc_meth_var_types);
+            inc(mcnt);
+          end;
+      end;
+    if mcnt=0 then
+      exit;
+
+    if iscategory then
+      new_section(list,clsSectType[classmethods],clsSectName[classmethods],sizeof(ptrint))
+    else
+      new_section(list,catSectType[classmethods],catSectName[classmethods],sizeof(ptrint));
+
+    current_asmdata.getlabel(methodslabel,alt_data);
+    list.Concat(tai_label.Create(methodslabel));
+
+    if (abi=oa_fragile) then
+      { not used, always zero }
+      list.Concat(tai_const.Create_32bit(0))
+    else
+      begin
+        { size of each entry -- always 32 bit value }
+        mtype:=search_named_unit_globaltype('OBJC','OBJC_METHOD').typedef;
+        list.Concat(tai_const.Create_32bit(mtype.size));
+      end;
+    { number of objc_method entries in the method_list array -- always 32 bit}
+    list.Concat(tai_const.Create_32bit(mcnt));
+    for i:=0 to mcnt-1 do
+      begin
+        { reference to the selector name }
+        list.Concat(tai_const.Create_sym(defs[i].selsym));
+        { reference to the obj-c encoded function parameters (signature) }
+        list.Concat(tai_const.Create_sym(defs[i].encsym));
+        { mangled name of the method }
+        sym:=current_asmdata.GetAsmSymbol(defs[i].def.mangledname);
+        if not assigned(sym) then
+          internalerror(2009091601);
+        list.Concat(tai_const.Create_sym(sym));
+      end;
+  end;
+
+
+(*
+From CLang:
+
+  struct objc_protocol_list
+  {
+#ifdef FRAGILE_ABI
+      struct objc_protocol_list *next;
+      int count;
+#else
+      long count;
+#endif
+      Protocol *list[1];
+  };
+*)
+procedure tobjcrttiwriter.gen_objc_protocol_list(list: tasmlist; protolist: tfpobjectlist; out protolistsym: tasmlabel);
+  var
+    i         : Integer;
+    protosym  : TAsmSymbol;
+    protodef  : tobjectdef;
+  begin
+    if not Assigned(protolist) or
+       (protolist.Count=0) then
+      begin
+        protolistsym:=nil;
+        Exit;
+      end;
+
+    for i:=0 to protolist.Count-1 do
+      begin
+        protodef:=TImplementedInterface(protolist[i]).IntfDef;
+        protosym:=objcfindprotocolentry(protodef.objextname^);
+        if not assigned(protosym) then
+          begin
+            gen_objc_protocol(list,protodef,protosym);
+            objcaddprotocolentry(protodef.objextname^,protosym);
+          end;
+      end;
+
+    { protocol lists are stored in .objc_cat_cls_meth section }
+    new_section(list,sec_objc_cat_cls_meth,'_OBJC_PROTOCOLLIST',sizeof(pint));
+    current_asmdata.getlabel(protolistsym, alt_data);
+    list.Concat(tai_label.Create(protolistsym));
+
+    if (abi=oa_fragile) then
+      { From Clang: next, always nil}
+      list.Concat(tai_const.Create_pint(0));
+    { From Clang: protocols count}
+    list.Concat(Tai_const.Create_pint(protolist.Count));
+    for i:=0 to protolist.Count-1 do
+      begin
+        protodef:=(protolist[i] as TImplementedInterface).IntfDef;
+        protosym:=objcfindprotocolentry(protodef.objextname^);
+        if not Assigned(protosym) then
+          begin
+            { For some reason protosym is not declared, though must be!
+              Probably gen_obcj1_protocol returned wrong protosym
+            }
+            InternalError(2009091602);
+          end;
+        list.Concat(tai_const.Create_sym(protosym));
+      end;
+  end;
+
+
+{ Generate rtti for an Objective-C methods (methods without implementation) }
+{ items : TFPObjectList of Tprocdef }
+procedure tobjcrttiwriter.gen_objc_cat_methods(list:TAsmList; items: TFPObjectList; section: tasmsectiontype;
+  const sectname: string; out listsym: TAsmLabel);
+var
+  i     : integer;
+  m     : tprocdef;
+  mtype : tdef;
+begin
+  if not assigned(items) or
+     (items.count=0) then
+    exit;
+
+  new_section(list, section, sectname, sizeof(pint));
+  current_asmdata.getlabel(listsym,alt_data);
+  list.Concat(tai_label.Create(listsym));
+  if (abi=oa_nonfragile) then
+    begin
+      { size of each entry -- always 32 bit value }
+      mtype:=search_named_unit_globaltype('OBJC','OBJC_METHOD').typedef;
+      list.Concat(tai_const.Create_32bit(mtype.size));
+    end;
+  list.Concat(Tai_const.Create_32bit(items.count));
+  for i:=0 to items.Count-1 do
+    begin
+      m:=tprocdef(items[i]);
+      list.Concat(Tai_const.Create_sym(
+        objcreatestringpoolentry(m.messageinf.str^,sp_objcvarnames,sec_objc_meth_var_names)));
+      list.Concat(Tai_const.Create_sym(
+        objcreatestringpoolentry(objcencodemethod(m),sp_objcvartypes,sec_objc_meth_var_types)));
+      { placeholder for address of implementation? }
+      if (abi=oa_nonfragile) then
+        list.Concat(Tai_const.Create_pint(0));
+    end;
+end;
+
+
+{ Generate the rtti sections for all obj-c classes defined in st, and return
+  these classes in the classes list. }
+procedure tobjcrttiwriter.gen_objc_rtti_sections(list:TAsmList; st:TSymtable);
+  var
+    i: longint;
+    def: tdef;
+    sym : TAsmSymbol;
+  begin
+    if not Assigned(st) then
+      exit;
+
+    for i:=0 to st.DefList.Count-1 do
+      begin
+        def:=tdef(st.DefList[i]);
+        if is_objcclass(def) and
+           not(oo_is_external in tobjectdef(def).objectoptions) then
+          begin
+            gen_objc_classes_sections(list,tobjectdef(def),sym);
+            classsyms.add(sym);
+            classdefs.add(def);
+          end;
+      end;
+  end;
+
+
+constructor tobjcrttiwriter.create(_abi: tobjcabi);
+  begin
+    fabi:=_abi;
+    classdefs:=tfpobjectlist.create(false);
+    classsyms:=tfpobjectlist.create(false);
+  end;
+
+
+destructor tobjcrttiwriter.destroy;
+  begin
+    classdefs.free;
+    classsyms.free;
+    inherited destroy;
+  end;
+
+{******************************************************************
+                 RTTI generation -- Fragile ABI
+*******************************************************************}
+
+{ generate an instance variables list for an obj-c class. }
+procedure tobjcrttiwriter_fragile.gen_objc_ivars(list: TAsmList; objccls: tobjectdef; out ivarslabel: TAsmLabel);
+  type
+    ivar_data = record
+      vf      : tfieldvarsym;
+      namesym : TAsmSymbol;
+      typesym : TAsmSymbol;
+    end;
+  var
+    i     : integer;
+    vf    : tfieldvarsym;
+    vars  : array of ivar_data;
+    vcnt  : Integer;
+    enctype : ansistring;
+    encerr  : tdef;
+  begin
+    ivarslabel:=nil;
+
+    vcnt:=0;
+    setLength(vars,objccls.symtable.SymList.Count);
+
+    for i:=0 to objccls.symtable.SymList.Count-1 do
+      if tsym(objccls.symtable.SymList[i]).typ=fieldvarsym then
+        begin
+          vf:=tfieldvarsym(objccls.symtable.SymList[i]);
+          if objctryencodetype(vf.vardef,enctype,encerr) then
+            begin
+              vars[vcnt].vf:=vf;
+              vars[vcnt].namesym:=objcreatestringpoolentry(vf.RealName,sp_objcvarnames,sec_objc_meth_var_names);
+              vars[vcnt].typesym:=objcreatestringpoolentry(enctype,sp_objcvartypes,sec_objc_meth_var_types);
+              inc(vcnt);
+            end
+          else
+            { must be caught during parsing }
+            internalerror(2009090601);
+        end;
+    if vcnt=0 then
+      exit;
+
+    new_section(list,sec_objc_instance_vars,'_OBJC_INSTANCE_VARS',sizeof(pint));
+
+    current_asmdata.getlabel(ivarslabel,alt_data);
+    list.Concat(tai_label.Create(ivarslabel));
+
+    { objc_ivar_list: first the number of elements }
+    list.Concat(tai_const.Create_32bit(vcnt));
+
+    for i:=0 to vcnt-1 do
+      begin
+        { reference to the instance variable name }
+        list.Concat(tai_const.Create_sym(vars[i].namesym));
+        { reference to the encoded type }
+        list.Concat(tai_const.Create_sym(vars[i].typesym));
+        { and the offset of the field }
+        list.Concat(tai_const.Create_32bit(vars[i].vf.fieldoffset));
+      end;
+  end;
+
+
+{ Generate rtti for an Objective-C protocol  }
+procedure tobjcrttiwriter_fragile.gen_objc_protocol(list:TAsmList; protocol: tobjectdef; out protocollabel: TAsmSymbol);
+  var
+    namesym     : TAsmSymbol;
+    i           : Integer;
+    protolist   : TAsmLabel;
+    proc        : tprocdef;
+    instmlist,
+    clsmlist    : TFPObjectList;
+    instsym,
+    clssym,
+    lbl          : TAsmLabel;
+  begin
+    instmlist:=TFPObjectList.Create(false);
+    clsmlist:=TFPObjectList.Create(false);
+    for i:=0 to protocol.vmtentries.Count-1 do
+      begin
+        proc:=pvmtentry(protocol.vmtentries[i])^.procdef;
+        if (po_classmethod in proc.procoptions) then
+          clsmlist.Add(proc)
+        else
+          instmlist.Add(proc);
+      end;
+      if instmlist.Count > 0 then
+        gen_objc_cat_methods(list,instmlist,sec_objc_cat_inst_meth,'_OBJC_CAT_INST_METH',instsym)
+      else
+        instsym:=nil;
+
+      if clsmlist.Count>0 then
+        gen_objc_cat_methods(list,clsmlist,sec_objc_cat_cls_meth,'_OBJC_CAT_CLS_METH',clssym)
+      else
+        clssym:=nil;
+
+    instmlist.Free;
+    clsmlist.Free;
+
+    gen_objc_protocol_list(list,protocol.ImplementedInterfaces,protolist);
+
+    new_section(list, sec_objc_protocol,'_OBJC_PROTOCOL',sizeof(pint));
+    current_asmdata.getlabel(lbl,alt_data);
+    list.Concat(tai_label.Create(lbl));
+    protocollabel:=lbl;
+
+    { protocol's isa - always nil }
+    list.Concat(Tai_const.Create_pint(0));
+    { name }
+    namesym:=objcreatestringpoolentry(protocol.objextname^,sp_objcclassnames,sec_objc_class_names);
+    list.Concat(Tai_const.Create_sym(namesym));
+    { protocol's list }
+    ConcatSymOrNil(list,protolist);
+    { instance methods, in __cat_inst_meth }
+    ConcatSymOrNil(list,instsym);
+    { class methods, in __cat_cls_meth }
+    ConcatSymOrNil(list,clssym);
+  end;
+
+
+(*
+From Clang:
+
+  struct _objc_class {
+    Class isa;
+    Class super_class;
+    const char *name;
+    long version;
+    long info;
+    long instance_size;
+    struct _objc_ivar_list *ivars;
+    struct _objc_method_list *methods;
+    struct _objc_cache *cache;
+    struct _objc_protocol_list *protocols;
+    // Objective-C 1.0 extensions (<rdr://4585769>) -- for garbage collection
+    const char *ivar_layout;
+    struct _objc_class_ext *ext;
+  };
+*)
+
+{ Generate rtti for an Objective-C class and its meta-class. }
+procedure tobjcrttiwriter_fragile.gen_objc_classes_sections(list:TAsmList; objclss: tobjectdef; out classlabel: TAsmSymbol);
+  const
+    CLS_CLASS  = 1;
+    CLS_META   = 2;
+    CLS_HIDDEN = $20000;
+    META_INST_SIZE = 40+8; // sizeof(objc_class) + 8
+  var
+    root          : tobjectdef;
+    superStrSym,
+    classStrSym,
+    metaisaStrSym,
+    metasym,
+    clssym        : TAsmSymbol;
+    mthdlist,
+    ivarslist,
+    protolistsym  : TAsmLabel;
+    hiddenflag    : cardinal;
+  begin
+    { generate the class methods list }
+    gen_objc_methods(list,objclss,mthdlist,true,false);
+
+    { generate implemented protocols list }
+    gen_objc_protocol_list(list,objclss.ImplementedInterfaces,protolistsym);
+
+    { register necessary names }
+    { 1) the superclass }
+    if assigned(objclss.childof) then
+      superStrSym:=objcreatestringpoolentry(objclss.childof.objextname^,sp_objcclassnames,sec_objc_class_names)
+    else
+      { not empty string, but nil! }
+      superStrSym:=nil;
+
+    { 2) the current class }
+    classStrSym:=objcreatestringpoolentry(objclss.objextname^,sp_objcclassnames,sec_objc_class_names);
+    { 3) the isa }
+    { From Clang: The isa for the meta-class is the root of the hierarchy. }
+    root:=objclss;
+    while assigned(root.childof) do
+      root:=root.childof;
+    metaisaStrSym:=objcreatestringpoolentry(root.objextname^,sp_objcclassnames,sec_objc_class_names);
+
+    { 4) the flags }
+    { consider every class declared in the implementation section of a unit
+      as "hidden"
+    }
+    hiddenflag:=0;
+    if (objclss.owner.symtabletype=staticsymtable) and
+       current_module.is_unit then
+      hiddenflag:=CLS_HIDDEN;
+
+    { class declaration section }
+    new_section(list,sec_objc_meta_class,'_OBJC_META_CLASS',sizeof(pint));
+
+    { 1) meta-class declaration  }
+    metasym:=current_asmdata.DefineAsmSymbol(objclss.rtti_mangledname(objcmetartti),AB_LOCAL,AT_DATA);
+    list.Concat(tai_symbol.Create(metasym,0));
+
+    list.Concat(Tai_const.Create_sym(metaisaStrSym));
+    { pointer to the superclass name if any, otherwise nil }
+    if assigned(superstrsym) then
+      list.Concat(Tai_const.Create_sym(superStrSym))
+    else
+      list.concat(tai_const.create_32bit(0));
+    { pointer to the class name }
+    list.Concat(Tai_const.Create_sym(classStrSym));
+
+    { version is always 0 currently }
+    list.Concat(Tai_const.Create_32bit(0));
+    { CLS_META for meta-classes }
+    list.Concat(Tai_const.Create_32bit(hiddenflag or CLS_META));
+    { size of the meta-class instance: sizeof(objc_class) + 8 bytes }
+    list.Concat(Tai_const.Create_32bit(META_INST_SIZE) );
+    { meta-classes don't have ivars list (=0) }
+    list.Concat(Tai_const.Create_32bit(0));
+    { class methods list (stored in "__cls_meth" section) }
+    if Assigned(mthdlist) then
+      list.Concat(Tai_const.Create_sym(mthdlist))
+    else
+      list.Concat(Tai_const.Create_32bit(0));
+    { From Clang: cache is always nil }
+    list.Concat(Tai_const.Create_32bit(0));
+    { protocols }
+    ConcatSymOrNil(list, protolistsym);
+    { From Clang: ivar_layout for meta-class is always NULL. }
+    list.Concat(Tai_const.Create_32bit(0));
+    { From Clang: The class extension is always unused for meta-classes. }
+    list.Concat(Tai_const.Create_32bit(0));
+
+    { 2) regular class declaration }
+
+    { generate the instance methods list }
+    gen_objc_methods(list,objclss,mthdlist,false,false);
+    { generate the instance variables list }
+    gen_objc_ivars(list,objclss,ivarslist);
+
+    new_section(list,sec_objc_class,'_OBJC_CLASS',sizeof(pint));
+
+    clssym:=current_asmdata.DefineAsmSymbol(objclss.rtti_mangledname(objcclassrtti),AB_LOCAL,AT_DATA);
+    list.Concat(tai_symbol.Create(clssym,0));
+
+    { for class declaration: the is points to the meta-class declaration }
+    list.Concat(Tai_const.Create_sym(metasym));
+    { pointer to the super_class name if any, nil otherwise }
+    if assigned(superStrSym) then
+      list.Concat(Tai_const.Create_sym(superStrSym))
+    else
+      list.Concat(Tai_const.Create_32bit(0));
+    { pointer to the class name }
+    list.Concat(Tai_const.Create_sym(classStrSym));
+    { version is always 0 currently }
+    list.Concat(Tai_const.Create_32bit(0));
+    { CLS_CLASS for classes }
+    list.Concat(Tai_const.Create_32bit(hiddenflag or CLS_CLASS));
+    { size of instance: total size of instance variables }
+    list.Concat(Tai_const.Create_32bit(tobjectsymtable(objclss.symtable).datasize));
+    { objc_ivar_list (stored in "__instance_vars" section) }
+    if assigned(ivarslist) then
+      list.Concat(Tai_const.Create_sym(ivarslist))
+    else
+      list.Concat(tai_const.create_32bit(0));
+    { instance methods list (stored in "__inst_meth" section) }
+    if Assigned(mthdlist) then
+      list.Concat(Tai_const.Create_sym(mthdlist))
+    else
+      list.Concat(Tai_const.Create_32bit(0));
+    { From Clang: cache is always NULL }
+    list.Concat(Tai_const.Create_32bit(0));
+    { protocols, protolistsym has been created for meta-class, no need to create another one}
+    ConcatSymOrNil(list, protolistsym);
+    { TODO: From Clang: strong ivar_layout, necessary for garbage collection support }
+    list.Concat(Tai_const.Create_32bit(0));
+    { TODO: From Clang: weak ivar_layout, necessary for garbage collection support }
+    list.Concat(Tai_const.Create_32bit(0));
+
+    classlabel:=clssym;
+  end;
+
+
+{ Generate the global information sections (objc_symbols and objc_module_info)
+  for this module. }
+procedure tobjcrttiwriter_fragile.gen_objc_info_sections(list: tasmlist);
+  var
+    i: longint;
+    sym : TAsmSymbol;
+    parent: tobjectdef;
+    superclasses: tfpobjectlist;
+  begin
+    if (classsyms.count<>0) then
+      begin
+        new_section(list,sec_objc_symbols,'_OBJC_SYMBOLS',sizeof(pint));
+        sym := current_asmdata.DefineAsmSymbol(target_asm.labelprefix+'_OBJC_SYMBOLS_$',AB_LOCAL,AT_DATA);
+
+        { symbol to refer to this information }
+        list.Concat(tai_symbol.Create(sym,0));
+        { ??? (always 0 in Clang) }
+        list.Concat(Tai_const.Create_pint(0));
+        { ??? (From Clang: always 0, pointer to some selector) }
+        list.Concat(Tai_const.Create_pint(0));
+        { From Clang: number of defined classes }
+        list.Concat(Tai_const.Create_16bit(classsyms.count));
+        { From Clang: number of defined categories }
+        list.Concat(Tai_const.Create_16bit(0));
+        { first all classes }
+        for i:=0 to classsyms.count-1 do
+          list.Concat(Tai_const.Create_sym(tasmsymbol(classsyms[i])));
+        { then all categories }
+     end
+    else
+      sym:=nil;
+
+    new_section(list,sec_objc_module_info,'_OBJC_MODULE_INFO',4);
+    { version number = 7 (always, both for gcc and clang) }
+    list.Concat(Tai_const.Create_pint(7));
+    { sizeof(objc_module): 4 pointer-size entities }
+    list.Concat(Tai_const.Create_pint(sizeof(pint)*4));
+    { used to be file name, now unused (points to empty string) }
+    list.Concat(Tai_const.Create_sym(objcreatestringpoolentry('',sp_objcclassnames,sec_objc_class_names)));
+    { pointer to classes/categories list declared in this module }
+    if assigned(sym) then
+      list.Concat(Tai_const.Create_sym(sym))
+    else
+      list.concat(tai_const.create_pint(0));
+
+    { Add lazy references to parent classes of all classes defined in this unit }
+    superclasses:=tfpobjectlist.create(false);
+    for i:=0 to classdefs.count-1 do
+      begin
+        parent:=tobjectdef(classdefs[i]).childof;
+        { warning: linear search, performance hazard if large number of subclasses }
+        if assigned(parent) and
+           (superclasses.indexof(parent)=-1) then
+          begin
+            list.concat(tai_directive.create(asd_lazy_reference,'.objc_class_name_'+parent.objextname^));
+            superclasses.add(parent);
+          end;
+      end;
+    superclasses.free;
+    { reference symbols for all classes defined in this unit }
+    for i:=0 to classdefs.count-1 do
+      list.concat(tai_symbol.Createname_global_value('.objc_class_name_'+tobjectdef(classdefs[i]).objextname^,AT_DATA,0,0));
+  end;
+
+
+constructor tobjcrttiwriter_fragile.create;
+  begin
+    inherited create(oa_fragile);
+  end;
+
+
+{******************************************************************
+                 RTTI generation -- Non-Fragile ABI
+*******************************************************************}
+
+(*
+From Clang:
+/// EmitIvarList - Emit the ivar list for the given
+/// implementation. The return value has type
+/// IvarListnfABIPtrTy.
+///  struct _ivar_t {
+///   unsigned long int *offset;  // pointer to ivar offset location
+///   char *name;
+///   char *type;
+///   uint32_t alignment;
+///   uint32_t size;
+/// }
+/// struct _ivar_list_t {
+///   uint32 entsize;  // sizeof(struct _ivar_t)
+///   uint32 count;
+///   struct _iver_t list[count];
+/// }
+///
+*)
+procedure tobjcrttiwriter_nonfragile.gen_objc_ivars(list: tasmlist; objccls: tobjectdef; out ivarslabel: tasmlabel);
+  type
+    ivar_data = record
+      vf      : tfieldvarsym;
+      namesym : TAsmSymbol;
+      typesym : TAsmSymbol;
+      offssym : TAsmSymbol;
+    end;
+  var
+    ivtype: tdef;
+    vf    : tfieldvarsym;
+    vars  : array of ivar_data;
+    i     : integer;
+    vcnt  : integer;
+    enctype : ansistring;
+    encerr  : tdef;
+    prefix  : shortstring;
+    vis     : TAsmsymbind;
+  begin
+    ivarslabel:=nil;
+
+    vcnt:=0;
+    setLength(vars,objccls.symtable.SymList.Count);
+
+    for i:=0 to objccls.symtable.SymList.Count-1 do
+      if tsym(objccls.symtable.SymList[i]).typ=fieldvarsym then
+        begin
+          vf:=tfieldvarsym(objccls.symtable.SymList[i]);
+          if objctryencodetype(vf.vardef,enctype,encerr) then
+            begin
+              vars[vcnt].vf:=vf;
+              vars[vcnt].namesym:=objcreatestringpoolentry(vf.RealName,sp_objcvarnames,sec_objc_meth_var_names);
+              vars[vcnt].typesym:=objcreatestringpoolentry(enctype,sp_objcvartypes,sec_objc_meth_var_types);
+              if (vcnt=0) then
+                begin
+                  new_section(list,sec_objc_const,'_OBJC_IVAR_OFFSETS',sizeof(pint));
+                  prefix:=target_info.cprefix+'OBJC_IVAR_$_'+objccls.objextname^+'.';
+                end;
+              { This matches gcc/Clang, but is strange: I would expect private
+                fields to be local symbols rather than private_extern (which
+                is "package-global") (JM)
+              }
+              if not(vf.visibility in [vis_public,vis_protected,vis_strictprotected]) then
+                vis:=AB_PRIVATE_EXTERN
+              else
+                vis:=AB_GLOBAL;
+              vars[vcnt].offssym:=current_asmdata.DefineAsmSymbol(prefix+vf.RealName,vis,AT_DATA);
+              list.concat(tai_symbol.Create_Global(vars[vcnt].offssym,0));
+              list.concat(tai_const.create_pint(vf.fieldoffset));
+              inc(vcnt);
+            end
+          else
+            { must be caught during parsing }
+            internalerror(2009092301);
+        end;
+    if vcnt=0 then
+      exit;
+
+    new_section(list,sec_objc_instance_vars,'_OBJC_INSTANCE_VARS',sizeof(pint));
+
+    current_asmdata.getlabel(ivarslabel,alt_data);
+    list.Concat(tai_label.Create(ivarslabel));
+
+    { size of each entry -- always 32 bit value }
+    ivtype:=search_named_unit_globaltype('OBJC','OBJC_IVAR').typedef;
+    list.concat(tai_const.Create_32bit(ivtype.size));
+    { number of entries -- always 32 bit value }
+    list.Concat(tai_const.Create_32bit(vcnt));
+
+    for i:=0 to vcnt-1 do
+      begin
+        { reference to the offset }
+        list.Concat(tai_const.Create_sym(vars[i].offssym));
+        { reference to the instance variable name }
+        list.Concat(tai_const.Create_sym(vars[i].namesym));
+        { reference to the encoded type }
+        list.Concat(tai_const.Create_sym(vars[i].typesym));
+        { alignment -- always 32 bit value }
+        list.Concat(tai_const.create_32bit(vars[i].vf.vardef.alignment));
+        { size -- always 32 bit value }
+        list.Concat(tai_const.Create_32bit(vars[i].vf.vardef.size));
+      end;
+  end;
+
+
+(*
+From Clang:
+/// GetOrEmitProtocol - Generate the protocol meta-data:
+/// @code
+/// struct _protocol_t {
+///   id isa;  // NULL
+///   const char * const protocol_name;
+///   const struct _protocol_list_t * protocol_list; // super protocols
+///   const struct method_list_t * const instance_methods;
+///   const struct method_list_t * const class_methods;
+///   const struct method_list_t *optionalInstanceMethods;
+///   const struct method_list_t *optionalClassMethods;
+///   const struct _prop_list_t * properties;
+///   const uint32_t size;  // sizeof(struct _protocol_t)
+///   const uint32_t flags;  // = 0
+/// }
+/// @endcode
+*)
+procedure tobjcrttiwriter_nonfragile.gen_objc_protocol(list: tasmlist; protocol: tobjectdef; out protocollabel: tasmsymbol);
+  var
+    lbl,
+    namesym,
+    listsym       : TAsmSymbol;
+    protolist     : TAsmLabel;
+    proc          : tprocdef;
+    reqinstmlist,
+    reqclsmlist,
+    optinstmlist,
+    optclsmlist   : TFPObjectList;
+    reqinstsym,
+    reqclssym,
+    optinstsym,
+    optclssym     : TAsmLabel;
+    prottype      : tdef;
+    i             : Integer;
+  begin
+    reqinstmlist:=TFPObjectList.Create(false);
+    reqclsmlist:=TFPObjectList.Create(false);
+    optinstmlist:=TFPObjectList.Create(false);
+    optclsmlist:=TFPObjectList.Create(false);
+    for i:=0 to protocol.vmtentries.Count-1 do
+      begin
+        proc:=pvmtentry(protocol.vmtentries[i])^.procdef;
+        if (po_classmethod in proc.procoptions) then
+          if not(po_optional in proc.procoptions) then
+            reqclsmlist.Add(proc)
+          else
+            optclsmlist.Add(proc)
+        else if not(po_optional in proc.procoptions) then
+          reqinstmlist.Add(proc)
+        else
+          optinstmlist.Add(proc);
+      end;
+    if reqinstmlist.Count > 0 then
+      gen_objc_cat_methods(list,reqinstmlist,sec_objc_cat_inst_meth,'_OBJC_CAT_INST_METH',reqinstsym)
+    else
+      reqinstsym:=nil;
+    if optinstmlist.Count > 0 then
+      gen_objc_cat_methods(list,optinstmlist,sec_objc_cat_inst_meth,'_OBJC_CAT_INST_METH',optinstsym)
+    else
+      optinstsym:=nil;
+
+    if reqclsmlist.Count>0 then
+      gen_objc_cat_methods(list,reqclsmlist,sec_objc_cat_cls_meth,'_OBJC_CAT_CLS_METH',reqclssym)
+    else
+      reqclssym:=nil;
+    if optclsmlist.Count>0 then
+      gen_objc_cat_methods(list,optclsmlist,sec_objc_cat_cls_meth,'_OBJC_CAT_CLS_METH',optclssym)
+    else
+      optclssym:=nil;
+
+    reqinstmlist.Free;
+    reqclsmlist.Free;
+    optinstmlist.Free;
+    optclsmlist.Free;
+
+    gen_objc_protocol_list(list,protocol.ImplementedInterfaces,protolist);
+
+    new_section(list, sec_data_coalesced,'_OBJC_PROTOCOL',sizeof(pint));
+    { label for the protocol needs to be
+        a) in a coalesced section (so multiple definitions of the same protocol
+           can be merged by the linker)
+        b) private_extern (should only be merged within the same module)
+        c) weakly defined (so multiple definitions don't cause errors)
+    }
+    lbl:=current_asmdata.DefineAsmSymbol(protocol.rtti_mangledname(objcclassrtti),AB_PRIVATE_EXTERN,AT_DATA);
+    list.Concat(tai_symbol.Create_Global(lbl,0));
+    protocollabel:=lbl;
+
+    { protocol's isa - always nil }
+    list.Concat(Tai_const.Create_pint(0));
+    { name }
+    namesym:=objcreatestringpoolentry(protocol.objextname^,sp_objcclassnames,sec_objc_class_names);
+    list.Concat(Tai_const.Create_sym(namesym));
+    { parent protocols list }
+    ConcatSymOrNil(list,protolist);
+    { required instance methods }
+    ConcatSymOrNil(list,reqinstsym);
+    { required class methods }
+    ConcatSymOrNil(list,reqclssym);
+    { optional instance methods }
+    ConcatSymOrNil(list,optinstsym);
+    { optional class methods }
+    ConcatSymOrNil(list,optclssym);
+    { TODO: properties }
+    list.Concat(Tai_const.Create_pint(0));
+    { size of this type }
+    prottype:=search_named_unit_globaltype('OBJC','OBJC_PROTOCOL').typedef;
+    list.concat(tai_const.Create_32bit(prottype.size));
+    { flags }
+    list.concat(tai_const.Create_32bit(0));
+
+    { also add an entry to the __DATA, __objc_protolist section, required to
+      register the protocol with the runtime }
+    new_section(list, sec_objc_protolist,'_OBJC_PROTOLIST',sizeof(pint));
+    listsym:=current_asmdata.DefineAsmSymbol(protocol.rtti_mangledname(objcmetartti),AB_PRIVATE_EXTERN,AT_DATA);
+    list.Concat(tai_symbol.Create_Global(listsym,0));
+    list.Concat(tai_const.Create_sym(lbl));
+    list.Concat(tai_directive.Create(asd_weak_definition,listsym.name));
+  end;
+
+
+(*
+From Clang:
+/// BuildIvarLayout - Builds ivar layout bitmap for the class
+/// implementation for the __strong or __weak case.
+/// The layout map displays which words in ivar list must be skipped
+/// and which must be scanned by GC (see below). String is built of bytes.
+/// Each byte is divided up in two nibbles (4-bit each). Left nibble is count
+/// of words to skip and right nibble is count of words to scan. So, each
+/// nibble represents up to 15 workds to skip or scan. Skipping the rest is
+/// represented by a 0x00 byte which also ends the string.
+/// 1. when ForStrongLayout is true, following ivars are scanned:
+/// - id, Class
+/// - object *  // note: this "object" means "Objective-C object" (JM)
+/// - __strong anything
+///
+/// 2. When ForStrongLayout is false, following ivars are scanned:
+/// - __weak anything
+*)
+(*
+
+Only required when supporting garbage collection
+
+procedure tobjcrttiwriter_nonfragile.gen_objc_ivargc_recursive(st: tabstractrecordsymtable; ptrbset: tbitset; startoffset: puint; il: tivarlayouttype);
+var
+  i: longint;
+  fs: tfieldvarsym;
+  includelen: longint;
+begin
+  for i:=0 to st.SymList.count-1 do
+    if (tsym(st.symlist[i]).typ=fieldvarsym) then
+      begin
+        fs:=tfieldvarsym(st.symlist[i]);
+        includelen:=0;
+        case fs.vardef.typ of
+          pointerdef,
+          classrefdef:
+            if (fs.vardef=objc_idtype) or
+               (fs.vardef=objc_metaclasstype) then
+              includelen:=1;
+          recorddef:
+            TODO: bitpacking -> offset differences
+            gen_objc_ivargc_recursive(tabstractrecordsymtable(trecorddef(fs.vardef).symtable),ptrbset,startoffset+fs.fieldoffset,il);
+          arraydef:
+            begin
+              if not is_special_
+            end;
+          objectdef :
+            begin
+              case tobjectdef(fs.vardef).objecttype of
+                odt_objcclass,
+                odt_objcprotocol:
+                  includelen:=1;
+                odt_object:
+                  gen_objc_ivargc_recursive(tabstractrecordsymtable(tobjectdef(fs.vardef).symtable),ptrbset,startoffset+fs.fieldoffset,il);
+              end;
+            end;
+        end;
+      end;
+end;
+
+
+function tobjcrttiwriter_nonfragile.gen_objc_ivargcstring(objclss: tobjectdef; il: tivarlayouttype): ansistring;
+  var
+    ptrbset: tbitset;
+    parent: tobjectdef;
+    size,
+    startoffset: puint;
+    i: longint;
+  begin
+    size:=tObjectSymtable(objclss.symtable).datasize;
+    if assigned(objclss.childof) then
+      startoffset:=tObjectSymtable(objclss.childof.symtable).datasize
+    else
+      startoffset:=0;
+    size:=size-startoffset;
+    ptrbset:=tbitset.create_bytesize((size+sizeof(ptruint)-1) div sizeof(ptruint));
+    { has to include info for this class' fields and those of all parent
+      classes as well
+    }
+    parent:=obclss;
+    repeat
+      gen_objc_ivargc_recursive(parent.symtable,ptrbset,0,il);
+      parent:=parent.childof;
+    until not assigned(parent);
+    { convert bits set to encoded string }
+  end;
+*)
+
+(*
+From Clang:
+/// struct _class_ro_t {
+///   uint32_t const flags;
+///   uint32_t const instanceStart;
+///   uint32_t const instanceSize;
+///   uint32_t const reserved;  // only when building for 64bit targets
+///   const uint8_t * const ivarLayout;
+///   const char *const name;
+///   const struct _method_list_t * const baseMethods;
+///   const struct _protocol_list_t *const baseProtocols;
+///   const struct _ivar_list_t *const ivars;
+///   const uint8_t * const weakIvarLayout;
+///   const struct _prop_list_t * const properties;
+/// }
+*)
+
+procedure tobjcrttiwriter_nonfragile.gen_objc_class_ro_part(list: tasmlist; objclss: tobjectdef; protolistsym: TAsmSymbol; out classrolabel: tasmsymbol; metaclass: boolean);
+  const
+    CLS_CLASS        = 0;
+    CLS_META         = 1;
+    CLS_ROOT         = 2;
+    OBJC2_CLS_HIDDEN = $10;
+    CLS_EXCEPTION    = $20;
+  var
+    classStrSym,
+    rosym        : TAsmSymbol;
+    methodslab,
+    ivarslab     : TAsmLabel;
+    class_type   : tdef;
+    start,
+    size,
+    flags        : cardinal;
+    rttitype     : trttitype;
+    firstfield   : tfieldvarsym;
+    i            : longint;
+  begin
+    { consider every class declared in the implementation section of a unit
+      as "hidden"
+    }
+    flags:=0;
+    if (objclss.owner.symtabletype=staticsymtable) and
+       current_module.is_unit then
+      flags:=OBJC2_CLS_HIDDEN;
+    if metaclass then
+      begin
+        flags:=flags or CLS_META;
+        rttitype:=objcmetarortti;
+        { metaclass size/start: always size of objc_object }
+        class_type:=search_named_unit_globaltype('OBJC','OBJC_OBJECT').typedef;
+        start:=class_type.size;
+        size:=start;
+      end
+    else
+      begin
+        flags:=flags or CLS_CLASS;
+        rttitype:=objcclassrortti;
+        size:=tObjectSymtable(objclss.symtable).datasize;
+        { can't simply use childof's datasize, because alignment may cause the
+          first field to skip a couple of bytes after the previous end }
+        firstfield:=nil;
+        for i:=0 to objclss.symtable.SymList.Count-1 do
+          if (tsym(objclss.symtable.SymList[i]).typ=fieldvarsym) then
+            begin
+              firstfield:=tfieldvarsym(objclss.symtable.SymList[i]);
+              break;
+            end;
+        if assigned(firstfield) then
+          start:=firstfield.fieldoffset
+        else
+          { no extra fields -> start = size }
+          start:=size;
+      end;
+    if not assigned(objclss.childof) then
+      flags:=flags or CLS_ROOT;
+
+    classStrSym:=objcreatestringpoolentry(objclss.objextname^,sp_objcclassnames,sec_objc_class_names);
+    { generate methods list }
+    gen_objc_methods(list,objclss,methodslab,metaclass,false);
+    { generate ivars (nil for metaclass) }
+    if metaclass then
+      ivarslab:=nil
+    else
+      gen_objc_ivars(list,objclss,ivarslab);
+
+    { class declaration section }
+    new_section(list,sec_objc_const,'_OBJC_META_CLASS',sizeof(pint));
+
+    rosym:=current_asmdata.DefineAsmSymbol(objclss.rtti_mangledname(rttitype),AB_LOCAL,AT_DATA);
+    classrolabel:=rosym;
+    list.Concat(tai_symbol.create(rosym,0));
+    list.Concat(tai_const.Create_32bit(longint(flags)));
+    list.Concat(tai_const.Create_32bit(longint(start)));
+    list.Concat(tai_const.Create_32bit(longint(size)));
+{$ifdef cpu64bitaddr}
+    { alignment }
+    list.Concat(tai_const.Create_32bit(0));
+{$endif}
+    { TODO: strong ivar layout for garbage collection }
+    list.concat(tai_const.Create_pint(0));
+    list.concat(tai_const.Create_sym(classStrSym));
+    ConcatSymOrNil(list,methodslab);
+    ConcatSymOrNil(list,protolistsym);
+    ConcatSymOrNil(list,ivarslab);
+    { TODO: weak ivar layout for garbage collection }
+    list.concat(tai_const.Create_pint(0));
+    { TODO: properties }
+    list.concat(tai_const.Create_pint(0));
+  end;
+
+
+(*
+From Clang:
+
+/// struct _class_t {
+///   struct _class_t *isa;
+///   struct _class_t * const superclass;
+///   void *cache;
+///   IMP *vtable;
+///   struct class_ro_t *ro;
+/// }
+///
+*)
+
+{ Generate rtti for an Objective-C class and its meta-class. }
+procedure tobjcrttiwriter_nonfragile.gen_objc_classes_sections(list:TAsmList; objclss: tobjectdef; out classlabel: TAsmSymbol);
+  var
+    root          : tobjectdef;
+    superSym,
+    superMetaSym,
+    metaisaSym,
+    metasym,
+    clssym,
+    metarosym,
+    rosym         : TAsmSymbol;
+    protolistsym  : TAsmLabel;
+    vis           : TAsmsymbind;
+  begin
+    { A) Register necessary names }
+
+    { 1) the current class and metaclass }
+    if (objclss.owner.symtabletype=globalsymtable) then
+      vis:=AB_GLOBAL
+    else
+      vis:=AB_PRIVATE_EXTERN;
+    clssym:=current_asmdata.DefineAsmSymbol(objclss.rtti_mangledname(objcclassrtti),vis,AT_DATA);
+    metasym:=current_asmdata.DefineAsmSymbol(objclss.rtti_mangledname(objcmetartti),vis,AT_DATA);
+    { 2) the superclass and meta superclass }
+    if assigned(objclss.childof) then
+      begin
+        superSym:=current_asmdata.RefAsmSymbol(objclss.childof.rtti_mangledname(objcclassrtti));
+        superMetaSym:=current_asmdata.RefAsmSymbol(objclss.childof.rtti_mangledname(objcmetartti));
+      end
+    else
+      begin
+        superSym:=nil;
+        { the class itself }
+        superMetaSym:=clssym;
+      end;
+
+    { 3) the isa }
+    { From Clang: The isa for the meta-class is the root of the hierarchy. }
+    root:=objclss;
+    while assigned(root.childof) do
+      root:=root.childof;
+    metaisaSym:=current_asmdata.RefAsmSymbol(root.rtti_mangledname(objcmetartti));
+
+    { 4) the implemented protocols (same for metaclass and regular class) }
+    gen_objc_protocol_list(list,objclss.ImplementedInterfaces,protolistsym);
+
+    { 5) the read-only parts of the class definitions }
+    gen_objc_class_ro_part(list,objclss,protolistsym,metarosym,true);
+    gen_objc_class_ro_part(list,objclss,protolistsym,rosym,false);
+
+    { B) Class declaration section }
+    { both class and metaclass are in the objc_data section for obj-c 2 }
+    new_section(list,sec_objc_data,'_OBJC_CLASS',sizeof(pint));
+
+    { 1) meta-class declaration }
+    list.Concat(tai_symbol.Create_Global(metasym,0));
+
+    { the isa }
+    list.Concat(Tai_const.Create_sym(metaisaSym));
+    { the superclass }
+    list.Concat(Tai_const.Create_sym(superMetaSym));
+    { pointer to cache }
+    if not assigned(ObjCEmptyCacheVar) then
+      ObjCEmptyCacheVar:=current_asmdata.RefAsmSymbol(target_info.Cprefix+'_objc_empty_cache');
+    list.Concat(Tai_const.Create_sym(ObjCEmptyCacheVar));
+    { pointer to vtable }
+    if not assigned(ObjCEmptyVtableVar) then
+      ObjCEmptyVtableVar:=current_asmdata.RefAsmSymbol(target_info.Cprefix+'_objc_empty_vtable');
+    list.Concat(Tai_const.Create_sym(ObjCEmptyVtableVar));
+    { the read-only part }
+    list.Concat(Tai_const.Create_sym(metarosym));
+
+    { 2) regular class declaration }
+    list.Concat(tai_symbol.Create_Global(clssym,0));
+
+    { the isa }
+    list.Concat(Tai_const.Create_sym(metasym));
+    { the superclass }
+    list.Concat(Tai_const.Create_sym(superSym));
+    { pointer to cache }
+    list.Concat(Tai_const.Create_sym(ObjCEmptyCacheVar));
+    { pointer to vtable }
+    list.Concat(Tai_const.Create_sym(ObjCEmptyVtableVar));
+    { the read-only part }
+    list.Concat(Tai_const.Create_sym(rosym));
+
+    classlabel:=clssym;
+  end;
+
+
+procedure tobjcrttiwriter_nonfragile.addclasslist(list: tasmlist; section: tasmsectiontype; const symname: string; classes: tfpobjectlist);
+  var
+    i: longint;
+    sym: TAsmSymbol;
+  begin
+    if classes.count=0 then
+      exit;
+    new_section(list,section,symname,sizeof(pint));
+    sym:=current_asmdata.DefineAsmSymbol(symname,AB_LOCAL,AT_DATA);
+    list.concat(tai_symbol.Create(sym,0));
+    for i:=0 to classes.count-1 do
+      list.concat(tai_const.Create_sym(current_asmdata.RefAsmSymbol(tobjectdef(classes[i]).rtti_mangledname(objcclassrtti))));
+  end;
+
+
+procedure tobjcrttiwriter_nonfragile.gen_objc_info_sections(list: tasmlist);
+
+  var
+    i,j            : longint;
+    symentry       : tsym;
+    procdef        : tprocdef;
+    nonlazyclasses : tfpobjectlist;
+  begin
+    if (classsyms.count=0) then
+      exit;
+
+    { non-lazy classes are all classes that define a class method with the
+      selector called "load" (simply inheriting this class method is not enough,
+      they have to implement it themselves)
+
+      -- TODO: this currently only works if the Pascal identifier is also 'load'! }
+    nonlazyclasses:=tfpobjectlist.create(false);
+    for i:=0 to classdefs.count-1 do
+      begin
+        symentry:=tsym(tobjectsymtable(tobjectdef(classdefs[i]).symtable).find('LOAD'));
+        if assigned(symentry) and
+           (symentry.typ=procsym) then
+          begin
+            for j:=0 to tprocsym(symentry).ProcdefList.count do
+              begin
+                procdef:=tprocdef(tprocsym(symentry).ProcdefList[0]);
+                if ((po_classmethod in procdef.procoptions) and
+                    (procdef.messageinf.str^='load')) then
+                  begin
+                    nonlazyclasses.add(classdefs[i]);
+                    break;
+                  end;
+              end;
+          end;
+      end;
+
+    { this list has to include all classes, also the non-lazy ones }
+    addclasslist(list,sec_objc_classlist,target_asm.labelprefix+'_OBJC_LABEL_CLASS_$',classdefs);
+    addclasslist(list,sec_objc_nlclasslist,target_asm.labelprefix+'_OBJC_LABEL_NONLAZY_CLASS_$',nonlazyclasses);
+    { TODO: category and non-lazy category lists }
+
+    { the non-fragile abi doesn't have any module info, nor lazy references
+      to used classes or to parent classes }
+  end;
+
+
+constructor tobjcrttiwriter_nonfragile.create;
+  begin
+    inherited create(oa_nonfragile);
+  end;
+
+
+{******************************************************************
+                 RTTI generation -- Main function
+*******************************************************************}
+
+procedure MaybeGenerateObjectiveCImageInfo(globalst, localst: tsymtable);
+  var
+    objcrttiwriter: tobjcrttiwriter;
+  begin
+    if (m_objectivec1 in current_settings.modeswitches) then
+      begin
+        { first 4 bytes contain version information about this section (currently version 0),
+          next 4 bytes contain flags (currently only regarding whether the code in the object
+          file supports or requires garbage collection)
+        }
+        new_section(current_asmdata.asmlists[al_objc_data],sec_objc_image_info,'_OBJC_IMAGE_INFO',sizeof(pint));
+        current_asmdata.asmlists[al_objc_data].concat(Tai_symbol.Createname(target_asm.labelprefix+'_OBJC_IMAGE_INFO',AT_LABEL,sizeof(pint)));
+        current_asmdata.asmlists[al_objc_data].concat(Tai_const.Create_64bit(0));
+
+        { generate rtti for all obj-c classes, protocols and categories (todo)
+          defined in this module. }
+        if not(target_info.system in system_objc_nfabi) then
+          objcrttiwriter:=tobjcrttiwriter_fragile.create
+        else
+          objcrttiwriter:=tobjcrttiwriter_nonfragile.create;
+        objcrttiwriter.gen_objc_rtti_sections(current_asmdata.asmlists[al_objc_data],globalst);
+        objcrttiwriter.gen_objc_rtti_sections(current_asmdata.asmlists[al_objc_data],localst);
+        objcrttiwriter.gen_objc_info_sections(current_asmdata.asmlists[al_objc_data]);
+        objcrttiwriter.free;
+      end;
+  end;
+
+
+end.

+ 858 - 0
compiler/objcutil.pas

@@ -0,0 +1,858 @@
+{
+    Copyright (c) 2009 by Jonas Maebe
+
+    This unit implements some Objective-C helper routines at the node tree
+    level.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+
+{$i fpcdefs.inc}
+
+unit objcutil;
+
+interface
+
+    uses
+      node,
+      symtype,symdef;
+
+    { Check whether a string contains a syntactically valid selector name.  }
+    function objcvalidselectorname(value_str: pchar; len: longint): boolean;
+
+    { Generate a node loading the superclass structure necessary to call
+      an inherited Objective-C method.  }
+    function objcsuperclassnode(def: tdef): tnode;
+
+    { The internals of Objective-C's @encode() functionality: encode a
+      type into the internal format used by the run time. Returns false
+      if a type is not representable by the Objective-C run time, and in
+      that case also the failing definition.  }
+    function objctryencodetype(def: tdef; out encodedtype: ansistring; out founderror: tdef): boolean;
+
+    { Encode a method's parameters and result type into the format used by the
+      run time (for generating protocol and class rtti).  }
+    function objcencodemethod(pd: tprocdef): ansistring;
+
+    { Check whether a type can be used in an Objective-C method
+      signature or field declaration.  }
+    function objcchecktype(def: tdef; out founderror: tdef): boolean;
+
+    { Exports all assembler symbols related to the obj-c class }
+    procedure exportobjcclass(def: tobjectdef);
+
+implementation
+
+    uses
+      globtype,
+      cutils,cclasses,
+      pass_1,
+      verbose,systems,
+      symtable,symconst,symsym,
+      defutil,paramgr,
+      nbas,nmem,ncal,nld,ncon,ncnv,
+      export;
+
+
+{******************************************************************
+                       validselectorname
+*******************************************************************}
+
+function objcvalidselectorname(value_str: pchar; len: longint): boolean;
+  var
+    i         : longint;
+    gotcolon  : boolean;
+begin
+  result:=false;
+  { empty name is not allowed }
+  if (len=0) then
+    exit;
+
+  gotcolon:=false;
+
+  { if the first character is a colon, all of them must be colons }
+  if (value_str[0] = ':') then
+    begin
+      for i:=1 to len-1 do
+        if (value_str[i]<>':') then
+          exit;
+    end
+  else
+    begin
+      { no special characters other than ':'
+      }
+      for i:=0 to len-1 do
+        if (value_str[i] = ':') then
+          gotcolon:=true
+        else if not(value_str[i] in ['_','A'..'Z','a'..'z','0'..'9',':']) then
+          exit;
+
+      { if there is at least one colon, the final character must
+        also be a colon (in case it's only one character that is
+        a colon, this was already checked before the above loop)
+      }
+      if gotcolon and
+         (value_str[len-1] <> ':') then
+        exit;
+    end;
+
+  result:=true;
+end;
+
+{******************************************************************
+                       objcsuperclassnode
+*******************************************************************}
+
+    function objcsuperclassnode(def: tdef): tnode;
+      var
+        para       : tcallparanode;
+        class_type : tdef;
+        vs         : tsym;
+      begin
+        { only valid for Objective-C classes and classrefs }
+        if not is_objcclass(def) and
+           not is_objcclassref(def) then
+          internalerror(2009090901);
+        { Can be done a lot more efficiently with direct symbol accesses, but
+          requires extra node types. Maybe later. }
+        if is_objcclassref(def) then
+          begin
+            para:=ccallparanode.create(cstringconstnode.createstr(tobjectdef(tclassrefdef(def).pointeddef).objextname^),nil);
+            result:=ccallnode.createinternfromunit('OBJC','OBJC_GETMETACLASS',para);
+          end
+        else
+          result:=cloadvmtaddrnode.create(ctypenode.create(def));
+
+{$if defined(onlymacosx10_6) or defined(arm) }
+        { For the non-fragile ABI, the superclass send2 method itself loads the
+          superclass. For the fragile ABI, we have to do this ourselves.
+
+          NOTE: those send2 methods are only available on Mac OS X 10.6 and later!
+            (but also on all iPhone SDK revisions we support) }
+        if not(target_info.system in system_objc_nfabi) then
+{$endif onlymacosx10_6 or arm}
+          begin
+            class_type:=search_named_unit_globaltype('OBJC','OBJC_OBJECT').typedef;
+            result:=ctypeconvnode.create_internal(cderefnode.create(ctypeconvnode.create_internal(result,voidpointertype)),class_type);
+            vs:=tsym(tabstractrecorddef(class_type).symtable.Find('SUPERCLASS'));
+            if not assigned(vs) or
+               (vs.typ<>fieldvarsym) then
+              internalerror(200909301);
+            result:=csubscriptnode.create(vs,result);
+          end;
+        typecheckpass(result);
+      end;
+
+
+{******************************************************************
+                          Type encoding
+*******************************************************************}
+
+    type
+      trecordinfostate = (ris_initial, ris_afterpointer, ris_dontprint);
+
+    function objcparasize(vs: tparavarsym): ptrint;
+      begin
+        result:=vs.paraloc[callerside].intsize;
+        { In Objective-C, all ordinal types are widened to at least the
+          size of the C "int" type. Assume __LP64__/4 byte ints for now. }
+        if is_ordinal(vs.vardef) and
+           (result<4) then
+          result:=4;
+      end;
+
+
+    function addencodedtype(def: tdef; recordinfostate: trecordinfostate; bpacked: boolean; var encodedstr: ansistring; out founderror: tdef): boolean; forward;
+
+    function encoderecst(const recname: ansistring; recst: tabstractrecordsymtable; var encodedstr: ansistring; out founderror: tdef): boolean;
+      var
+        variantstarts: tfplist;
+        i, varindex: longint;
+        field,
+        firstfield: tfieldvarsym;
+        firstfieldvariant,
+        bpacked: boolean;
+      begin
+        result:=false;
+        bpacked:=recst.fieldalignment=bit_alignment;
+        { Is the first field already the start of a variant?  }
+        firstfield:=nil;
+        firstfieldvariant:=false;
+        for i:=0 to recst.symlist.count-1 do
+          begin
+            if (tsym(recst.symlist[i]).typ<>fieldvarsym) then
+              continue;
+            field:=tfieldvarsym(recst.symlist[i]);
+            if not assigned(firstfield) then
+              firstfield:=field
+            else if (vo_is_first_field in field.varoptions) then
+              begin
+                if (field.fieldoffset=firstfield.fieldoffset) then
+                  firstfieldvariant:=true;
+              end;
+          end;
+        variantstarts:=tfplist.create;
+        encodedstr:=encodedstr+'{'+recname+'=';
+        for i:=0 to recst.symlist.count-1 do
+          begin
+            if (tsym(recst.symlist[i]).typ<>fieldvarsym) then
+              continue;
+
+            field:=tfieldvarsym(recst.symlist[i]);
+            { start of a variant part? }
+            if ((field=firstfield) and
+                firstfieldvariant) or
+               ((field<>firstfield) and
+                (vo_is_first_field in field.varoptions)) then
+              begin
+                varindex:=variantstarts.count-1;
+                if (varindex=-1) or
+                   (tfieldvarsym(variantstarts[varindex]).fieldoffset<field.fieldoffset) then
+                  begin
+                    { new, more deeply nested variant }
+                    encodedstr:=encodedstr+'(?={?=';
+                    variantstarts.add(field);
+                  end
+                else
+                  begin
+                    { close existing nested variants if any }
+                    while (varindex>=0) and
+                          (tfieldvarsym(variantstarts[varindex]).fieldoffset>field.fieldoffset) do
+                      begin
+                        { close more deeply nested variants }
+                        encodedstr:=encodedstr+'})';
+                        dec(varindex);
+                      end;
+                    if (varindex<0) then
+                      internalerror(2009081805);
+                    if (tfieldvarsym(variantstarts[varindex]).fieldoffset<>field.fieldoffset) then
+                      internalerror(2009081804);
+
+                    { variant at the same level as a previous one }
+                    variantstarts.count:=varindex+1;
+                    { No need to add this field, it has the same offset as the
+                      previous one at this position.  }
+                    if tfieldvarsym(variantstarts[varindex]).fieldoffset<>field.fieldoffset then
+                      internalerror(2009081601);
+                    { close previous variant sub-part and start new one }
+                    encodedstr:=encodedstr+'}{?=';
+                  end
+              end;
+            if not addencodedtype(field.vardef,ris_afterpointer,bpacked,encodedstr,founderror) then
+              exit;
+          end;
+        for i:=0 to variantstarts.count-1 do
+          encodedstr:=encodedstr+'})';
+        variantstarts.free;
+        encodedstr:=encodedstr+'}';
+        result:=true
+      end;
+
+
+    function addencodedtype(def: tdef; recordinfostate: trecordinfostate; bpacked: boolean; var encodedstr: ansistring; out founderror: tdef): boolean;
+      var
+        recname: ansistring;
+        recdef: trecorddef;
+        objdef: tobjectdef;
+        len: aint;
+        c: char;
+        newstate: trecordinfostate;
+        addrpara: boolean;
+      begin
+        result:=true;
+        case def.typ of
+          stringdef :
+            begin
+              case tstringdef(def).stringtype of
+                st_shortstring:
+                  { include length byte }
+                  encodedstr:=encodedstr+'['+tostr(tstringdef(def).len+1)+'C]';
+                else
+                  { While we could handle refcounted Pascal strings correctly
+                    when such methods are called from Pascal code, things would
+                    completely break down if they were called from Objective-C
+                    code/reflection since the necessary refcount helper calls
+                    would be missing on the caller side (unless we'd
+                    automatically generate wrappers).  }
+                  result:=false;
+              end;
+            end;
+          enumdef,
+          orddef :
+            begin
+              if bpacked and
+                 not is_void(def) then
+                encodedstr:=encodedstr+'b'+tostr(def.packedbitsize)
+              else
+                begin
+                  if is_void(def) then
+                    c:='v'
+                  { in gcc, sizeof(_Bool) = sizeof(char) }
+                  else if is_boolean(def) and
+                          (def.size=1) then
+                    c:='B'
+                  else
+                    begin
+                      case def.size of
+                        1:
+                          c:='c';
+                        2:
+                          c:='s';
+                        4:
+                          c:='i';
+                        8:
+                          c:='q';
+                        else
+                          internalerror(2009081502);
+                      end;
+                      if not is_signed(def) then
+                        c:=upcase(c);
+                    end;
+                  encodedstr:=encodedstr+c;
+                end;
+            end;
+          pointerdef :
+            begin
+              if is_pchar(def) then
+                encodedstr:=encodedstr+'*'
+              else if (def=objc_idtype) then
+                encodedstr:=encodedstr+'@'
+              else if (def=objc_seltype) then
+                encodedstr:=encodedstr+':'
+              else if (def=objc_metaclasstype) then
+                encodedstr:=encodedstr+'#'
+              else
+                begin
+                  encodedstr:=encodedstr+'^';
+                  newstate:=recordinfostate;
+                  if (recordinfostate<ris_dontprint) then
+                    newstate:=succ(newstate);
+                  if not addencodedtype(tpointerdef(def).pointeddef,newstate,false,encodedstr,founderror) then
+                    begin
+                      result:=false;
+                      { report the exact (nested) error defintion }
+                      exit;
+                    end;
+                end;
+            end;
+          floatdef :
+            begin
+              case tfloatdef(def).floattype of
+                s32real:
+                  c:='f';
+                s64real:
+                  c:='d';
+                else
+                  begin
+                    c:='!';
+                    result:=false;
+                  end;
+              end;
+              encodedstr:=encodedstr+c;
+            end;
+          filedef :
+            result:=false;
+          recorddef :
+            begin
+              if assigned(def.typesym) then
+                recname:=def.typename
+              else
+                recname:='?';
+
+              if (recordinfostate<>ris_dontprint) then
+                begin
+                  if not encoderecst(recname,tabstractrecordsymtable(trecorddef(def).symtable),encodedstr,founderror) then
+                    begin
+                      result:=false;
+                      { report the exact (nested) error defintion }
+                      exit;
+                    end
+                end
+              else
+                encodedstr:=encodedstr+'{'+recname+'}'
+            end;
+          variantdef :
+            begin
+              recdef:=trecorddef(search_system_type('TVARDATA').typedef);
+              if (recordinfostate<>ris_dontprint) then
+                begin
+                  if not encoderecst(recdef.typename,tabstractrecordsymtable(recdef.symtable),encodedstr,founderror) then
+                    begin
+                      result:=false;
+                      { report the exact (nested) error defintion }
+                      exit;
+                    end
+                end
+              else
+                encodedstr:=encodedstr+'{'+recdef.typename+'}';
+            end;
+          classrefdef :
+            begin
+              encodedstr:=encodedstr+'^';
+              newstate:=recordinfostate;
+              if (recordinfostate<>ris_dontprint) then
+                newstate:=succ(newstate);
+              if is_objcclassref(def) then
+                begin
+                  objdef:=tobjectdef(tclassrefdef(def).pointeddef);
+                  if (newstate<>ris_dontprint) then
+                    { anonymous (objc)class definitions do not exist }
+                    begin
+                      if not encoderecst(objdef.objextname^,tabstractrecordsymtable(objdef.symtable),encodedstr,founderror) then
+                        { The fields of an Objective-C class should always be
+                          encodeable.  }
+                        internalerror(2009081702);
+                    end
+                  else
+                    encodedstr:=encodedstr+'{'+objdef.objextname^+'}'
+                end
+              { Object Pascal classrefdefs point to a vmt, not really useful
+                to completely write those here.  I'm not even sure what the
+                Objective-C run time uses this information for, since in C you
+                can have forward struct definitions so not all structs passed
+                to functions can be written out here either -> treat
+                classrefdefs the same as such forward-defined structs.  }
+              else
+                begin
+                  if assigned(def.typesym) then
+                    recname:=def.typename
+                  else
+                    recname:='?';
+                  encodedstr:=encodedstr+'{'+recname;
+                  if (newstate<>ris_dontprint) then
+                    encodedstr:=encodedstr+'=';
+                  encodedstr:=encodedstr+'}'
+                end;
+            end;
+          setdef :
+            begin
+              addrpara:=paramanager.push_addr_param(vs_value,def,pocall_cdecl);
+              if not addrpara then
+                { encode as an record, they are always passed by value in C.  }
+                encodedstr:=encodedstr+'{?=';
+              { Encode the set itself as an array. Without an encompassing
+                record, these are always passed by reference in C.  }
+              encodedstr:=encodedstr+'['+tostr(def.size)+'C]';
+              if not addrpara then
+                encodedstr:=encodedstr+'}';
+            end;
+          formaldef :
+            begin
+              encodedstr:=encodedstr+'^v';
+            end;
+          arraydef :
+            begin
+              if is_array_of_const(def) then
+                { do nothing, varargs are ignored in signatures }
+              else if is_special_array(def) then
+                result:=false
+              else
+                begin
+                  len:=tarraydef(def).highrange-tarraydef(def).lowrange+1;
+                  if is_packed_array(def) then
+                    begin
+                      { convert from bits to bytes for bitpacked arrays }
+                      len:=(len+7) div 8;
+                      { and encode as plain array of bytes }
+                      encodedstr:=encodedstr+'['+tostr(len)+'C]';
+                    end
+                  else
+                    begin
+                      encodedstr:=encodedstr+'['+tostr(len);
+                      { Embedded structured types in the array are printed
+                        in full regardless of the current recordinfostate.  }
+                      if not addencodedtype(tarraydef(def).elementdef,ris_initial,false,encodedstr,founderror) then
+                        begin
+                          result:=false;
+                          { report the exact (nested) error defintion }
+                          exit;
+                        end;
+                      encodedstr:=encodedstr+']';
+                    end;
+                end;
+            end;
+          procvardef :
+            encodedstr:=encodedstr+'^?';
+          objectdef :
+            case tobjectdef(def).objecttype of
+              odt_class,
+              odt_object,
+              odt_cppclass:
+                begin
+                  newstate:=recordinfostate;
+                  { implicit pointer for classes }
+                  if (tobjectdef(def).objecttype=odt_class) then
+                    begin
+                      encodedstr:=encodedstr+'^';
+                      if (recordinfostate<ris_dontprint) then
+                        newstate:=succ(newstate);
+                    end;
+                  if newstate<>ris_dontprint then
+                    begin
+                      if not encoderecst(def.typename,tabstractrecordsymtable(tobjectdef(def).symtable),encodedstr,founderror) then
+                        begin
+                          result:=false;
+                          { report the exact (nested) error defintion }
+                          exit;
+                        end
+                    end
+                  else
+                    encodedstr:=encodedstr+'{'+def.typename+'}'
+                end;
+              odt_interfacecom,
+              odt_interfacecom_property,
+              odt_interfacecom_function,
+              odt_dispinterface:
+                result:=false;
+              odt_interfacecorba:
+                encodedstr:=encodedstr+'^{'+def.typename+'=}';
+              { In Objective-C, the actual types of class instances are
+                NSObject* etc, and those are encoded as "@". In FPC, to keep
+                the similarity with Delphi-style Object Pascal, the type is
+                NSObject and the pointer is implicit. Objective-C's "NSObject"
+                has "class of NSObject" as equivalent here.  }
+              odt_objcclass,
+              odt_objcprotocol:
+                encodedstr:=encodedstr+'@';
+              else
+                internalerror(2009081509);
+            end;
+          undefineddef,
+          errordef :
+            result:=false;
+          procdef :
+            { must be done via objcencodemethod() }
+            internalerror(2009081511);
+        else
+          internalerror(2009150812);
+        end;
+        if not result then
+          founderror:=def;
+      end;
+
+
+    function objctryencodetype(def: tdef; out encodedtype: ansistring; out founderror: tdef): boolean;
+      begin
+        result:=addencodedtype(def,ris_initial,false,encodedtype,founderror);
+      end;
+
+
+    function objcencodemethod(pd: tprocdef): ansistring;
+      var
+        parasize,
+        totalsize: aint;
+        vs: tparavarsym;
+        i: longint;
+        temp: ansistring;
+        founderror: tdef;
+      begin
+        result:='';
+        totalsize:=0;
+        if not pd.has_paraloc_info then
+          begin
+            pd.requiredargarea:=paramanager.create_paraloc_info(pd,callerside);
+            pd.has_paraloc_info:=true;
+          end;
+{$if defined(powerpc) and defined(dummy)}
+        { Disabled, because neither Clang nor gcc does this, and the ObjC
+          runtime contains an explicit fix to detect this error.  }
+
+        { On ppc, the callee is responsible for removing the hidden function
+          result parameter from the stack, so it has to know. On i386, it's
+          the caller that does this.  }
+        if (pd.returndef<>voidtype) and
+            paramgr.ret_in_param(pd.returndef,pocall_cdecl) then
+          inc(totalsize,sizeof(pint));
+{$endif}
+        for i:=0 to pd.paras.count-1 do
+          begin
+            vs:=tparavarsym(pd.paras[i]);
+            if (vo_is_funcret in vs.varoptions) then
+              continue;
+            { addencodedtype always assumes a value parameter, so add
+              a pointer indirection for var/out parameters.  }
+            if not paramanager.push_addr_param(vs_value,vs.vardef,pocall_cdecl) and
+               (vs.varspez in [vs_var,vs_out]) then
+              result:=result+'^';
+            { Add the parameter type.  }
+            if not addencodedtype(vs.vardef,ris_initial,false,result,founderror) then
+              { should be checked earlier on }
+              internalerror(2009081701);
+            { And the total size of the parameters coming before this one
+              (i.e., the "offset" of this parameter).  }
+            result:=result+tostr(totalsize);
+            { Update the total parameter size }
+            parasize:=objcparasize(vs);
+            inc(totalsize,parasize);
+          end;
+        { Prepend the total parameter size.  }
+        result:=tostr(totalsize)+result;
+        { And the type of the function result (void in case of a procedure).  }
+        temp:='';
+        if not addencodedtype(pd.returndef,ris_initial,false,temp,founderror) then
+          internalerror(2009081801);
+        result:=temp+result;
+      end;
+
+
+{******************************************************************
+                    ObjC type validity checking
+*******************************************************************}
+
+    function objcdochecktype(def: tdef; recordinfostate: trecordinfostate; out founderror: tdef): boolean; forward;
+
+    function checkrecsttype(recst: tabstractrecordsymtable; recordinfostate: trecordinfostate; out founderror: tdef): boolean;
+      var
+        i: longint;
+        field: tfieldvarsym;
+        newstate: trecordinfostate;
+      begin
+        result:=false;
+        newstate:=recordinfostate;
+        { Although we never have to print the type info for nested
+          records, check them anyway in case we're not after a pointer
+          since if such records contain refcounted types then they
+          can cause just as much trouble as if they were a simple
+          refcounted field.  }
+        if (newstate=ris_afterpointer) then
+          newstate:=ris_dontprint;
+        for i:=0 to recst.symlist.count-1 do
+          begin
+            if (tsym(recst.symlist[i]).typ<>fieldvarsym) then
+              continue;
+
+            field:=tfieldvarsym(recst.symlist[i]);
+            if not objcdochecktype(field.vardef,newstate,founderror) then
+              exit;
+          end;
+        result:=true
+      end;
+
+
+    function objcdochecktype(def: tdef; recordinfostate: trecordinfostate; out founderror: tdef): boolean;
+      var
+        recdef: trecorddef;
+        objdef: tobjectdef;
+        newstate: trecordinfostate;
+      begin
+        result:=true;
+        case def.typ of
+          stringdef :
+            begin
+              case tstringdef(def).stringtype of
+                st_shortstring:
+                  ;
+                else
+                  { While we could handle refcounted Pascal strings correctly
+                    when such methods are called from Pascal code, things would
+                    completely break down if they were called from Objective-C
+                    code/reflection since the necessary refcount helper calls
+                    would be missing on the caller side (unless we'd
+                    automatically generate wrappers).  }
+                  result:=false;
+              end;
+            end;
+          enumdef,
+          orddef :
+            ;
+          pointerdef :
+            begin
+              newstate:=recordinfostate;
+              if (recordinfostate<ris_dontprint) then
+                newstate:=succ(newstate);
+              if not objcdochecktype(tpointerdef(def).pointeddef,newstate,founderror) then
+                begin
+                  result:=false;
+                  { report the exact (nested) error defintion }
+                  exit;
+                end;
+            end;
+          floatdef :
+            begin
+              case tfloatdef(def).floattype of
+                s32real,
+                s64real:
+                  ;
+                else
+                  result:=false;
+              end;
+            end;
+          filedef :
+            result:=false;
+          recorddef :
+            begin
+              if (recordinfostate<>ris_dontprint) then
+                begin
+                  if not checkrecsttype(tabstractrecordsymtable(trecorddef(def).symtable),recordinfostate,founderror) then
+                    begin
+                      result:=false;
+                      { report the exact (nested) error defintion }
+                      exit;
+                    end
+                end
+            end;
+          variantdef :
+            begin
+              recdef:=trecorddef(search_system_type('TVARDATA').typedef);
+              if (recordinfostate<>ris_dontprint) then
+                begin
+                  if not checkrecsttype(tabstractrecordsymtable(recdef.symtable),recordinfostate,founderror) then
+                    begin
+                      result:=false;
+                      { report the exact (nested) error defintion }
+                      exit;
+                    end
+                end;
+            end;
+          classrefdef:
+            begin
+              if is_objcclassref(def) then
+                begin
+                  objdef:=tobjectdef(tclassrefdef(def).pointeddef);
+                  newstate:=recordinfostate;
+                  if (recordinfostate<ris_dontprint) then
+                    newstate:=succ(newstate);
+                  if (newstate<>ris_dontprint) then
+                    begin
+                      if not checkrecsttype(tabstractrecordsymtable(objdef.symtable),recordinfostate,founderror) then
+                        begin
+                          result:=false;
+                          { report the exact (nested) error defintion }
+                          exit;
+                        end
+                    end
+                end
+            end;
+          setdef,
+          formaldef :
+            ;
+          arraydef :
+            begin
+              if is_array_of_const(def) then
+                { ok, varargs are ignored in signatures }
+              else if is_special_array(def) then
+                result:=false
+              else
+                begin
+                  if not is_packed_array(def) then
+                    begin
+                      if not objcdochecktype(tarraydef(def).elementdef,ris_initial,founderror) then
+                        begin
+                          result:=false;
+                          { report the exact (nested) error defintion }
+                          exit;
+                        end;
+                    end;
+                end;
+            end;
+          procvardef :
+            ;
+          objectdef :
+            case tobjectdef(def).objecttype of
+              odt_class,
+              odt_object,
+              odt_cppclass:
+                begin
+                  newstate:=recordinfostate;
+                  { implicit pointer for classes }
+                  if (tobjectdef(def).objecttype=odt_class) then
+                    begin
+                      if (recordinfostate<ris_dontprint) then
+                        newstate:=succ(newstate);
+                    end;
+                  if newstate<>ris_dontprint then
+                    begin
+                      if not checkrecsttype(tabstractrecordsymtable(tobjectdef(def).symtable),newstate,founderror) then
+                        begin
+                          result:=false;
+                          { report the exact (nested) error defintion }
+                          exit;
+                        end
+                    end
+                end;
+              odt_interfacecom,
+              odt_interfacecom_property,
+              odt_interfacecom_function,
+              odt_dispinterface:
+                result:=false;
+              odt_interfacecorba,
+              odt_objcclass,
+              odt_objcprotocol:
+                ;
+              else
+                internalerror(2009081709);
+            end;
+          undefineddef,
+          errordef :
+            result:=false;
+          procdef :
+            result:=false;
+        else
+          internalerror(2009170812);
+        end;
+        if not result then
+          founderror:=def;
+      end;
+
+
+    function objcchecktype(def: tdef; out founderror: tdef): boolean;
+      begin
+        result:=objcdochecktype(def,ris_initial,founderror);
+      end;
+
+
+{******************************************************************
+                    ObjC class exporting
+*******************************************************************}
+
+    procedure exportobjcclassfields(objccls: tobjectdef);
+    var
+      i: longint;
+      vf: tfieldvarsym;
+      prefix: string;
+    begin
+      prefix:=target_info.cprefix+'OBJC_IVAR_$_'+objccls.objextname^+'.';
+      for i:=0 to objccls.symtable.SymList.Count-1 do
+        if tsym(objccls.symtable.SymList[i]).typ=fieldvarsym then
+          begin
+            vf:=tfieldvarsym(objccls.symtable.SymList[i]);
+            { TODO: package visibility (private_extern) -- must not be exported
+               either}
+            if not(vf.visibility in [vis_private,vis_strictprivate]) then
+              exportname(prefix+vf.RealName,0);
+          end;
+    end;
+
+
+    procedure exportobjcclass(def: tobjectdef);
+      begin
+        if (target_info.system in system_objc_nfabi) then
+          begin
+            { export class and metaclass symbols }
+            exportname(def.rtti_mangledname(objcclassrtti),0);
+            exportname(def.rtti_mangledname(objcmetartti),0);
+            { export public/protected instance variable offset symbols }
+            exportobjcclassfields(def);
+          end
+        else
+          begin
+             { export the class symbol }
+             exportname('.objc_class_name_'+def.objextname^,0);
+          end;
+      end;
+
+end.

+ 21 - 3
compiler/ogbase.pas

@@ -811,7 +811,7 @@ implementation
 
     function TObjData.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
       const
-        secnames : array[TAsmSectiontype] of string[length('objc_meth_var_names')] = ('',
+        secnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           'code',
           'Data',
           'Data',
@@ -852,7 +852,16 @@ implementation
           'objc_property',
           'objc_image_info',
           'objc_cstring_object',
-          'objc_sel_fixup'
+          'objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
       var
         sep : string[3];
@@ -928,7 +937,16 @@ implementation
           {objc_property} [oso_data,oso_load],
           {objc_image_info} [oso_data,oso_load],
           {objc_cstring_object} [oso_data,oso_load],
-          {objc_sel_fixup} [oso_data,oso_load]
+          {objc_sel_fixup} [oso_data,oso_load],
+          {sec_objc_data} [oso_data,oso_load],
+          {sec_objc_const} [oso_data,oso_load],
+          {sec_objc_sup_refs} [oso_data,oso_load],
+          {sec_data_coalesced} [oso_data,oso_load],
+          {sec_objc_classlist} [oso_data,oso_load],
+          {sec_objc_nlclasslist} [oso_data,oso_load],
+          {sec_objc_catlist} [oso_data,oso_load],
+          {sec_objc_nlcatlist} [oso_data,oso_load],
+          {sec_objc_protolist'} [oso_data,oso_load]
         );
       begin
         result:=secoptions[atype];

+ 11 - 2
compiler/ogcoff.pas

@@ -479,7 +479,7 @@ implementation
        SymbolMaxGrow = 200*sizeof(coffsymbol);
        StrsMaxGrow   = 8192;
 
-       coffsecnames : array[TAsmSectiontype] of string[20] = ('',
+       coffsecnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           '.text','.data','.data','.data','.bss','.tls',
           '.text',
           '.pdata',
@@ -515,7 +515,16 @@ implementation
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
 
 const go32v2stub : array[0..2047] of byte=(

+ 22 - 4
compiler/ogelf.pas

@@ -569,7 +569,7 @@ implementation
 
     function TElfObjData.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
       const
-        secnames : array[TAsmSectiontype] of string[length('.objc_meth_var_types')] = ('',
+        secnames : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
 {$ifdef userodata}
           '.text','.data','.data','.rodata','.bss','.threadvar',
 {$else userodata}
@@ -609,9 +609,18 @@ implementation
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
-        secnames_pic : array[TAsmSectiontype] of string[length('.objc_meth_var_types')] = ('',
+        secnames_pic : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('',
           '.text',
           '.data.rel',
           '.data.rel',
@@ -653,7 +662,16 @@ implementation
           '.objc_property',
           '.objc_image_info',
           '.objc_cstring_object',
-          '.objc_sel_fixup'
+          '.objc_sel_fixup',
+          '__DATA,__objc_data',
+          '__DATA,__objc_const',
+          '.objc_superrefs',
+          '__DATA, __datacoal_nt,coalesced',
+          '.objc_classlist',
+          '.objc_nlclasslist',
+          '.objc_catlist',
+          '.obcj_nlcatlist',
+          '.objc_protolist'
         );
       var
         sep : string[3];

+ 57 - 4
compiler/pdecl.pas

@@ -283,6 +283,33 @@ implementation
 
     procedure types_dec;
 
+      procedure get_objc_class_or_protocol_external_status(od: tobjectdef);
+        begin
+          { Objective-C classes can be external -> all messages inside are
+            external (defined at the class level instead of per method, so
+            that you cannot define some methods as external and some not)
+          }
+          if (token=_ID) and
+             (idtoken=_EXTERNAL) then
+            begin
+              consume(_EXTERNAL);
+              if (token=_ID) and
+                 (idtoken=_NAME) then
+                begin
+                  consume(_NAME);
+                  od.objextname:=stringdup(get_stringconst);
+                end
+              else
+                od.objextname:=stringdup(od.objrealname^);
+              consume(_SEMICOLON);
+              od.make_all_methods_external;
+              include(od.objectoptions,oo_is_external);
+            end
+          else { or also allow "public name 'x'"? }
+            od.objextname:=stringdup(od.objrealname^);
+        end;
+
+
         function parse_generic_parameters:TFPObjectList;
         var
           generictype : ttypesym;
@@ -366,9 +393,11 @@ implementation
                begin
                  if ((token=_CLASS) or
                      (token=_INTERFACE) or
-                     (token=_DISPINTERFACE)) and
+                     (token=_DISPINTERFACE) or
+                     (token=_OBJCCLASS) or
+                     (token=_OBJCPROTOCOL)) and
                     (assigned(ttypesym(sym).typedef)) and
-                    is_class_or_interface_or_dispinterface(ttypesym(sym).typedef) and
+                    is_class_or_interface_or_dispinterface_or_objc(ttypesym(sym).typedef) and
                     (oo_is_forward in tobjectdef(ttypesym(sym).typedef).objectoptions) then
                   begin
                     case token of
@@ -381,6 +410,10 @@ implementation
                           objecttype:=odt_interfacecorba;
                       _DISPINTERFACE :
                         objecttype:=odt_dispinterface;
+                      _OBJCCLASS :
+                        objecttype:=odt_objcclass;
+                      _OBJCPROTOCOL :
+                        objecttype:=odt_objcprotocol;
                       else
                         internalerror(200811072);
                     end;
@@ -415,6 +448,9 @@ implementation
                     istyperenaming:=true;
                   if isunique then
                     begin
+                      if is_objc_class_or_protocol(hdef) then
+                        Message(parser_e_no_objc_unique);
+
                       hdef:=tstoreddef(hdef).getcopy;
 
                       { fix name, it is used e.g. for tables }
@@ -475,6 +511,15 @@ implementation
                   end;
                 objectdef :
                   begin
+                    try_consume_hintdirective(newtype.symoptions,newtype.deprecatedmsg);
+                    consume(_SEMICOLON);
+
+                    { we have to know whether the class or protocol is
+                      external before the vmt is built, because some errors/
+                      hints depend on this  }
+                    if is_objc_class_or_protocol(hdef) then
+                      get_objc_class_or_protocol_external_status(tobjectdef(hdef));
+
                     { Build VMT indexes, skip for type renaming and forward classes }
                     if (hdef.typesym=newtype) and
                        not(oo_is_forward in tobjectdef(hdef).objectoptions) and
@@ -484,8 +529,16 @@ implementation
                         vmtbuilder.generate_vmt;
                         vmtbuilder.free;
                       end;
-                    try_consume_hintdirective(newtype.symoptions,newtype.deprecatedmsg);
-                    consume(_SEMICOLON);
+
+                    { In case of an objcclass, verify that all methods have a message
+                      name set. We only check this now, because message names can be set
+                      during the protocol (interface) mapping. At the same time, set the
+                      mangled names (these depend on the "external" name of the class),
+                      and mark private fields of external classes as "used" (to avoid
+                      bogus notes about them being unused)
+                    }
+                    if is_objc_class_or_protocol(hdef) then
+                      tobjectdef(hdef).finish_objc_data;
                   end;
                 recorddef :
                   begin

+ 128 - 19
compiler/pdecobj.pas

@@ -185,6 +185,23 @@ implementation
       end;
 
 
+    procedure setobjcclassmethodoptions;
+      var
+        i   : longint;
+        def : tdef;
+      begin
+        for i:=0 to current_objectdef.symtable.DefList.count-1 do
+          begin
+            def:=tdef(current_objectdef.symtable.DefList[i]);
+            if assigned(def) and
+               (def.typ=procdef) then
+              begin
+                include(tprocdef(def).procoptions,po_virtualmethod);
+              end;
+          end;
+      end;
+
+
     procedure handleImplementedInterface(intfdef : tobjectdef);
       begin
         if not is_interface(intfdef) then
@@ -205,7 +222,23 @@ implementation
       end;
 
 
-    procedure readImplementedInterfaces;
+    procedure handleImplementedProtocol(intfdef : tobjectdef);
+      begin
+        if not is_objcprotocol(intfdef) then
+          begin
+             Message1(type_e_protocol_type_expected,intfdef.typename);
+             exit;
+          end;
+        if current_objectdef.find_implemented_interface(intfdef)<>nil then
+          Message1(sym_e_duplicate_id,intfdef.objname^)
+        else
+          begin
+            current_objectdef.ImplementedInterfaces.Add(TImplementedInterface.Create(intfdef));
+          end;
+      end;
+
+
+    procedure readImplementedInterfacesAndProtocols(intf: boolean);
       var
         hdef : tdef;
       begin
@@ -214,10 +247,16 @@ implementation
              id_type(hdef,false);
              if (hdef.typ<>objectdef) then
                begin
-                  Message1(type_e_interface_type_expected,hdef.typename);
+                  if intf then
+                    Message1(type_e_interface_type_expected,hdef.typename)
+                  else
+                    Message1(type_e_protocol_type_expected,hdef.typename);
                   continue;
                end;
-             handleImplementedInterface(tobjectdef(hdef));
+             if intf then
+               handleImplementedInterface(tobjectdef(hdef))
+             else
+               handleImplementedProtocol(tobjectdef(hdef));
           end;
       end;
 
@@ -318,6 +357,25 @@ implementation
                    odt_cppclass:
                      if not(is_cppclass(childof)) then
                        Message(parser_e_mix_of_classes_and_objects);
+                   odt_objcclass:
+                     if not(is_objcclass(childof)) then
+                       begin
+                         if is_objcprotocol(childof) then
+                           begin
+                             intfchildof:=childof;
+                             childof:=nil;
+                             CGMessage(parser_h_no_objc_parent);
+                           end
+                         else
+                           Message(parser_e_mix_of_classes_and_objects);
+                       end;
+                   odt_objcprotocol:
+                     begin
+                       if not(is_objcprotocol(childof)) then
+                         Message(parser_e_mix_of_classes_and_objects);
+                       intfchildof:=childof;
+                       childof:=nil;
+                     end;
                    odt_object:
                      if not(is_object(childof)) then
                        Message(parser_e_mix_of_classes_and_objects);
@@ -346,6 +404,8 @@ implementation
               odt_interfacecom:
                 if current_objectdef<>interface_iunknown then
                   childof:=interface_iunknown;
+              odt_objcclass:
+                CGMessage(parser_h_no_objc_parent);
             end;
           end;
 
@@ -366,11 +426,14 @@ implementation
 
         if hasparentdefined then
           begin
-            if current_objectdef.objecttype=odt_class then
+            if current_objectdef.objecttype in [odt_class,odt_objcclass,odt_objcprotocol] then
               begin
                 if assigned(intfchildof) then
-                  handleImplementedInterface(intfchildof);
-                readImplementedInterfaces;
+                  if current_objectdef.objecttype=odt_class then
+                    handleImplementedInterface(intfchildof)
+                  else
+                    handleImplementedProtocol(intfchildof);
+                readImplementedInterfacesAndProtocols(current_objectdef.objecttype=odt_class);
               end;
             consume(_RKLAMMER);
           end;
@@ -413,11 +476,19 @@ implementation
 
     procedure parse_object_members;
 
+      procedure chkobjc(pd: tprocdef);
+        begin
+          if is_objc_class_or_protocol(pd._class) then
+            begin
+              include(pd.procoptions,po_objc);
+            end;
+        end;
+
+
         procedure chkcpp(pd:tprocdef);
         begin
            if is_cppclass(pd._class) then
             begin
-              pd.proccalloption:=pocall_cppdecl;
               pd.setmangledname(target_info.Cprefix+pd.cplusplusmangledname);
             end;
         end;
@@ -449,7 +520,7 @@ implementation
         fields_allowed: boolean;
       begin
         { empty class declaration ? }
-        if (current_objectdef.objecttype=odt_class) and
+        if (current_objectdef.objecttype in [odt_class,odt_objcclass]) and
            (token=_SEMICOLON) then
           exit;
 
@@ -483,11 +554,19 @@ implementation
               end;
             _ID :
               begin
-                case idtoken of
+                if is_objcprotocol(current_objectdef) and
+                   ((idtoken=_REQUIRED) or
+                    (idtoken=_OPTIONAL)) then
+                  begin
+                    current_objectdef.symtable.currentlyoptional:=(idtoken=_OPTIONAL);
+                    consume(idtoken)
+                  end
+                else case idtoken of
                   _PRIVATE :
                     begin
-                      if is_interface(current_objectdef) then
-                         Message(parser_e_no_access_specifier_in_interfaces);
+                      if is_interface(current_objectdef) or
+                         is_objcprotocol(current_objectdef) then
+                        Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PRIVATE);
                        current_objectdef.symtable.currentvisibility:=vis_private;
                        include(current_objectdef.objectoptions,oo_has_private);
@@ -495,7 +574,8 @@ implementation
                      end;
                    _PROTECTED :
                      begin
-                       if is_interface(current_objectdef) then
+                       if is_interface(current_objectdef) or
+                          is_objcprotocol(current_objectdef) then
                          Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PROTECTED);
                        current_objectdef.symtable.currentvisibility:=vis_protected;
@@ -504,7 +584,8 @@ implementation
                      end;
                    _PUBLIC :
                      begin
-                       if is_interface(current_objectdef) then
+                       if is_interface(current_objectdef) or
+                          is_objcprotocol(current_objectdef) then
                          Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PUBLIC);
                        current_objectdef.symtable.currentvisibility:=vis_public;
@@ -515,15 +596,21 @@ implementation
                        { we've to check for a pushlished section in non-  }
                        { publishable classes later, if a real declaration }
                        { this is the way, delphi does it                  }
-                       if is_interface(current_objectdef) then
+                       if is_interface(current_objectdef) or
+                          is_objcprotocol(current_objectdef) then
                          Message(parser_e_no_access_specifier_in_interfaces);
+                       { Objective-C classes do not support "published",
+                         as basically everything is published.  }
+                       if is_objc_class_or_protocol(current_objectdef) then
+                         Message(parser_e_no_objc_published);
                        consume(_PUBLISHED);
                        current_objectdef.symtable.currentvisibility:=vis_published;
                        fields_allowed:=true;
                      end;
                    _STRICT :
                      begin
-                       if is_interface(current_objectdef) then
+                       if is_interface(current_objectdef) or
+                          is_objcprotocol(current_objectdef) then
                           Message(parser_e_no_access_specifier_in_interfaces);
                         consume(_STRICT);
                         if token=_ID then
@@ -553,7 +640,8 @@ implementation
                       begin
                         if object_member_blocktype=bt_general then
                           begin
-                            if is_interface(current_objectdef) then
+                            if is_interface(current_objectdef) or
+                               is_objcprotocol(current_objectdef) then
                               Message(parser_e_no_vars_in_interfaces);
 
                             if (current_objectdef.symtable.currentvisibility=vis_published) and
@@ -613,6 +701,7 @@ implementation
                       include(current_objectdef.objectoptions,oo_has_virtual);
 
                     chkcpp(pd);
+                    chkobjc(pd);
                   end;
 
                 maybe_parse_hint_directives(pd);
@@ -632,6 +721,10 @@ implementation
                 if is_interface(current_objectdef) then
                   Message(parser_e_no_con_des_in_interfaces);
 
+                { Objective-C does not know the concept of a constructor }
+                if is_objc_class_or_protocol(current_objectdef) then
+                  Message(parser_e_objc_no_constructor_destructor);
+
                 oldparse_only:=parse_only;
                 parse_only:=true;
                 pd:=constructor_head;
@@ -666,6 +759,10 @@ implementation
                 if (current_objectdef.symtable.currentvisibility<>vis_public) then
                   Message(parser_w_destructor_should_be_public);
 
+                { Objective-C does not know the concept of a destructor }
+                if is_objc_class_or_protocol(current_objectdef) then
+                  Message(parser_e_objc_no_constructor_destructor);
+
                 oldparse_only:=parse_only;
                 parse_only:=true;
                 pd:=destructor_head;
@@ -751,6 +848,14 @@ implementation
                       class_tobject:=current_objectdef;
                 end;
               end;
+            if (current_module.modulename^='OBJCBASE') then
+              begin
+                case current_objectdef.objecttype of
+                  odt_objcclass:
+                    if (current_objectdef.objname^='Protocol') then
+                      objc_protocoltype:=current_objectdef;
+                end;
+              end;
           end;
 
         { set published flag in $M+ mode, it can also be inherited and will
@@ -796,11 +901,15 @@ implementation
         { for implemented classes with a vmt check if there is a constructor }
         if (oo_has_vmt in current_objectdef.objectoptions) and
            not(oo_is_forward in current_objectdef.objectoptions) and
-           not(oo_has_constructor in current_objectdef.objectoptions) then
+           not(oo_has_constructor in current_objectdef.objectoptions) and
+           not is_objc_class_or_protocol(current_objectdef) then
           Message1(parser_w_virtual_without_constructor,current_objectdef.objrealname^);
 
-        if is_interface(current_objectdef) then
-          setinterfacemethodoptions;
+        if is_interface(current_objectdef) or
+           is_objcprotocol(current_objectdef) then
+          setinterfacemethodoptions
+        else if is_objcclass(current_objectdef) then
+          setobjcclassmethodoptions;
 
         { return defined objectdef }
         result:=current_objectdef;

+ 94 - 18
compiler/pdecsub.pas

@@ -39,7 +39,9 @@ interface
         pd_notobjintf,   { directive can not be used interface declaration }
         pd_notprocvar,   { directive can not be used procvar declaration }
         pd_dispinterface,{ directive can be used with dispinterface methods }
-        pd_cppobject     { directive can be used with cppclass }
+        pd_cppobject,    { directive can be used with cppclass }
+        pd_objcclass,    { directive can be used with objcclass }
+        pd_objcprot      { directive can be used with objcprotocol }
       );
       tpdflags=set of tpdflag;
 
@@ -75,6 +77,7 @@ implementation
        { pass 1 }
        fmodule,node,htypechk,
        nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,
+       objcutil,
        { parser }
        scanner,
        pbase,pexpr,ptype,pdecl
@@ -159,8 +162,32 @@ implementation
         vs       : tparavarsym;
         hdef     : tdef;
         vsp      : tvarspez;
+        aliasvs  : tabsolutevarsym;
+        sl       : tpropaccesslist;
       begin
-        if (pd.typ=procvardef) and
+        if (pd.typ=procdef) and
+           is_objc_class_or_protocol(tprocdef(pd)._class) then
+          begin
+            { insert Objective-C self and selector parameters }
+            vs:=tparavarsym.create('$_cmd',paranr_objc_cmd,vs_value,objc_seltype,[vo_is_msgsel,vo_is_hidden_para]);
+            pd.parast.insert(vs);
+            { make accessible to code }
+            sl:=tpropaccesslist.create;
+            sl.addsym(sl_load,vs);
+            aliasvs:=tabsolutevarsym.create_ref('_CMD',objc_seltype,sl);
+            include(aliasvs.varoptions,vo_is_msgsel);
+            tlocalsymtable(tprocdef(pd).localst).insert(aliasvs);
+
+            if (po_classmethod in pd.procoptions) then
+              { compatible with what gcc does }
+              hdef:=objc_idtype
+            else
+              hdef:=tprocdef(pd)._class;
+
+            vs:=tparavarsym.create('$self',paranr_objc_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para]);
+            pd.parast.insert(vs);
+          end
+        else if (pd.typ=procvardef) and
            pd.is_methodpointer then
           begin
             { Generate self variable }
@@ -301,7 +328,8 @@ implementation
                  if is_open_string(vardef) then
                     MessagePos(fileinfo,parser_w_cdecl_no_openstring);
                  if not(po_external in pd.procoptions) and
-                    (pd.typ<>procvardef) then
+                    (pd.typ<>procvardef) and
+                    not is_objc_class_or_protocol(tprocdef(pd)._class) then
                    if is_array_of_const(vardef) then
                      MessagePos(fileinfo,parser_e_varargs_need_cdecl_and_external)
                    else
@@ -889,6 +917,8 @@ implementation
         { symbol options that need to be kept per procdef }
         pd.fileinfo:=procstartfilepos;
         pd.visibility:=symtablestack.top.currentvisibility;
+        if symtablestack.top.currentlyoptional then
+          include(pd.procoptions,po_optional);
 
         { parse parameters }
         if token=_LKLAMMER then
@@ -938,6 +968,7 @@ implementation
            if is_interface(aclass) then
              Message(parser_e_no_static_method_in_interfaces)
            else
+             { class methods are also allowed for Objective-C protocols }
              isclassmethod:=true;
          end;
         case token of
@@ -1381,7 +1412,7 @@ procedure pd_override(pd:tabstractprocdef);
 begin
   if pd.typ<>procdef then
     internalerror(2003042611);
-  if not(is_class_or_interface(tprocdef(pd)._class)) then
+  if not(is_class_or_interface_or_objc(tprocdef(pd)._class)) then
     Message(parser_e_no_object_override);
 end;
 
@@ -1399,23 +1430,36 @@ var
 begin
   if pd.typ<>procdef then
     internalerror(2003042613);
-  if not is_class(tprocdef(pd)._class) then
+  if not is_class(tprocdef(pd)._class) and
+     not is_objc_class_or_protocol(tprocdef(pd)._class) then
     Message(parser_e_msg_only_for_classes);
   if ([po_msgstr,po_msgint]*pd.procoptions)<>[] then
     Message(parser_e_multiple_messages);
   { check parameter type }
-  paracnt:=0;
-  pd.parast.SymList.ForEachCall(@check_msg_para,@paracnt);
-  if paracnt<>1 then
-    Message(parser_e_ill_msg_param);
+  if not is_objc_class_or_protocol(tprocdef(pd)._class) then
+    begin
+      paracnt:=0;
+      pd.parast.SymList.ForEachCall(@check_msg_para,@paracnt);
+      if paracnt<>1 then
+        Message(parser_e_ill_msg_param);
+    end;
   pt:=comp_expr(true);
-  if pt.nodetype=stringconstn then
+  { message is 1-character long }
+  if is_constcharnode(pt) then 
+    begin
+      include(pd.procoptions,po_msgstr);
+      tprocdef(pd).messageinf.str:=stringdup(chr(byte(tordconstnode(pt).value.uvalue and $FF)));
+    end
+  else if pt.nodetype=stringconstn then
     begin
       include(pd.procoptions,po_msgstr);
+      if (tstringconstnode(pt).len>255) then
+        Message(parser_e_message_string_too_long);
       tprocdef(pd).messageinf.str:=stringdup(tstringconstnode(pt).value_str);
     end
   else
-   if is_constintnode(pt) then
+   if is_constintnode(pt) and
+      is_class(tprocdef(pd)._class) then
     begin
       include(pd.procoptions,po_msgint);
       if (Tordconstnode(pt).value<int64(low(Tprocdef(pd).messageinf.i))) or
@@ -1426,6 +1470,11 @@ begin
     end
   else
     Message(parser_e_ill_msg_expr);
+  { check whether the selector name is valid in case of Objective-C }
+  if (po_msgstr in pd.procoptions) and
+     is_objc_class_or_protocol(tprocdef(pd)._class) and
+     not objcvalidselectorname(@tprocdef(pd).messageinf.str^[1],length(tprocdef(pd).messageinf.str^)) then
+    Message1(type_e_invalid_objc_selector_name,tprocdef(pd).messageinf.str^);
   pt.free;
 end;
 
@@ -1906,7 +1955,7 @@ const
       mutexclpo     : [po_external,po_exports]
     ),(
       idtok:_MESSAGE;
-      pd_flags : [pd_interface,pd_object,pd_notobjintf];
+      pd_flags : [pd_interface,pd_object,pd_notobjintf,pd_objcclass, pd_objcprot];
       handler  : @pd_message;
       pocall   : pocall_none;
       pooption : []; { can be po_msgstr or po_msgint }
@@ -1951,7 +2000,7 @@ const
       mutexclpo     : []
     ),(
       idtok:_OVERRIDE;
-      pd_flags : [pd_interface,pd_object,pd_notobjintf];
+      pd_flags : [pd_interface,pd_object,pd_notobjintf,pd_objcclass];
       handler  : @pd_override;
       pocall   : pocall_none;
       pooption : [po_overridingmethod,po_virtualmethod];
@@ -2064,7 +2113,7 @@ const
       mutexclpo     : [po_assembler,po_external,po_virtualmethod]
     ),(
       idtok:_VARARGS;
-      pd_flags : [pd_interface,pd_implemen,pd_procvar];
+      pd_flags : [pd_interface,pd_implemen,pd_procvar,pd_objcclass, pd_objcprot];
       handler  : nil;
       pocall   : pocall_none;
       pooption : [po_varargs];
@@ -2151,7 +2200,7 @@ const
            end;
          end;
 
-        { C directive is MAC only, because it breaks too much existing code
+        { C directive is MacPas only, because it breaks too much existing code
           on other platforms (PFV) }
         if (idtoken=_C) and
            not(m_mac in current_settings.modeswitches) then
@@ -2170,7 +2219,7 @@ const
          begin
             { parsing a procvar type the name can be any
               next variable !! }
-            if ((pdflags * [pd_procvar,pd_object])=[]) and
+            if ((pdflags * [pd_procvar,pd_object,pd_objcclass,pd_objcprot])=[]) and
                not(idtoken=_PROPERTY) then
               Message1(parser_w_unknown_proc_directive_ignored,name);
             exit;
@@ -2228,10 +2277,22 @@ const
            if (pd_notobjintf in proc_direcdata[p].pd_flags) and
               is_interface(tprocdef(pd)._class) then
             exit;
+
            { check if method and directive not for interface }
            if is_dispinterface(tprocdef(pd)._class) and
              not(pd_dispinterface in proc_direcdata[p].pd_flags) then
             exit;
+
+           { check if method and directive not for objcclass }
+           if is_objcclass(tprocdef(pd)._class) and
+             not(pd_objcclass in proc_direcdata[p].pd_flags) then
+            exit;
+
+           { check if method and directive not for objcprotocol }
+           if is_objcprotocol(tprocdef(pd)._class) and
+             not(pd_objcprot in proc_direcdata[p].pd_flags) then
+            exit;
+
          end;
 
         { consume directive, and turn flag on }
@@ -2422,7 +2483,19 @@ const
     procedure handle_calling_convention(pd:tabstractprocdef);
       begin
         { set the default calling convention if none provided }
-        if not(po_hascallingconvention in pd.procoptions) then
+        if (pd.typ=procdef) and
+           (is_objc_class_or_protocol(tprocdef(pd)._class) or
+            is_cppclass(tprocdef(pd)._class)) then
+          begin
+            { none of the explicit calling conventions should be allowed }
+            if (po_hascallingconvention in pd.procoptions) then
+              internalerror(2009032501);
+            if is_cppclass(tprocdef(pd)._class) then
+              pd.proccalloption:=pocall_cppdecl
+            else
+              pd.proccalloption:=pocall_cdecl;
+          end
+        else if not(po_hascallingconvention in pd.procoptions) then
           pd.proccalloption:=current_settings.defproccall
         else
           begin
@@ -2469,7 +2542,10 @@ const
               { if external is available, then cdecl must also be available,
                 procvars don't need external }
               if not((po_external in pd.procoptions) or
-                     (pd.typ=procvardef)) and
+                     (pd.typ=procvardef) or
+                     { for objcclasses this is checked later, because the entire
+                       class may be external.  }
+                     is_objc_class_or_protocol(tprocdef(pd)._class)) and
                  not(pd.proccalloption in [pocall_cdecl,pocall_cppdecl,pocall_mwpascal]) then
                 Message(parser_e_varargs_need_cdecl_and_external);
             end

+ 21 - 6
compiler/pdecvar.pas

@@ -1325,15 +1325,17 @@ implementation
          hintsymoptions : tsymoptions;
          deprecatedmsg : pshortstring;
          semicoloneaten: boolean;
+         is_first_field: boolean;
 {$if defined(powerpc) or defined(powerpc64)}
          tempdef: tdef;
-         is_first_field: boolean;
+         is_first_type: boolean;
 {$endif powerpc or powerpc64}
          sl       : tpropaccesslist;
       begin
          recst:=tabstractrecordsymtable(symtablestack.top);
+         is_first_field:=true;
 {$if defined(powerpc) or defined(powerpc64)}
-         is_first_field := true;
+         is_first_type:=true;
 {$endif powerpc or powerpc64}
          { Force an expected ID error message }
          if not (token in [_ID,_CASE,_END]) then
@@ -1382,7 +1384,7 @@ implementation
                  the alignment of the first field.  */
              }
              if (target_info.system in [system_powerpc_darwin, system_powerpc_macos, system_powerpc64_darwin]) and
-                is_first_field and
+                is_first_type and
                 (symtablestack.top.symtabletype=recordsymtable) and
                 (trecordsymtable(symtablestack.top).usefieldalignment=C_alignment) then
                begin
@@ -1397,7 +1399,7 @@ implementation
                  if (maxpadalign>4) and
                     (maxpadalign>trecordsymtable(symtablestack.top).padalignment) then
                    trecordsymtable(symtablestack.top).padalignment:=maxpadalign;
-                 is_first_field:=false;
+                 is_first_type:=false;
                end;
 {$endif powerpc or powerpc64}
 
@@ -1412,6 +1414,13 @@ implementation
              deprecatedmsg:=nil;
              try_consume_hintdirective(hintsymoptions,deprecatedmsg);
 
+             { mark first field }
+             if (is_first_field) then
+               begin
+                 include(tfieldvarsym(sc[0]).varoptions,vo_is_first_field);
+                 is_first_field:=false;
+               end;
+
              { update variable type and hints }
              for i:=0 to sc.count-1 do
                begin
@@ -1507,6 +1516,12 @@ implementation
               read_anon_type(casetype,true);
               if assigned(fieldvs) then
                 begin
+                 { mark first field if not yet marked }
+                 if (is_first_field) then
+                   begin
+                     include(fieldvs.varoptions,vo_is_first_field);
+                     is_first_field:=false;
+                   end;
                   fieldvs.vardef:=casetype;
                   recst.addfield(fieldvs,recst.currentvisibility);
                 end;
@@ -1569,7 +1584,7 @@ implementation
 {$if defined(powerpc) or defined(powerpc64)}
               { parent inherits the alignment padding if the variant is the first "field" of the parent record/variant }
               if (target_info.system in [system_powerpc_darwin, system_powerpc_macos, system_powerpc64_darwin]) and
-                 is_first_field and
+                 is_first_type and
                  (recst.usefieldalignment=C_alignment) and
                  (maxpadalign>recst.padalignment) then
                 recst.padalignment:=maxpadalign;
@@ -1601,7 +1616,7 @@ implementation
          { free the list }
          sc.free;
 {$ifdef powerpc}
-         is_first_field := false;
+         is_first_type := false;
 {$endif powerpc}
       end;
 

+ 123 - 99
compiler/pexports.pas

@@ -45,6 +45,8 @@ implementation
        { parser }
        scanner,
        pbase,pexpr,
+       { obj-c }
+       objcutil,
        { link }
        gendef,export
        ;
@@ -107,114 +109,136 @@ implementation
                       else
                         InternalProcName:=pd.mangledname;
                     end;
+                  typesym :
+                    begin
+                      if not is_objcclass(ttypesym(srsym).typedef) then
+                        Message(parser_e_illegal_symbol_exported)
+                    end;
                   else
                     Message(parser_e_illegal_symbol_exported)
                 end;
-                if InternalProcName<>'' then
-                 begin
-                   { This is wrong if the first is not
-                     an underline }
-                   if InternalProcName[1]='_' then
-                     delete(InternalProcName,1,1)
-                   else if (target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince]) and UseDeffileForExports then
+                if (srsym.typ<>typesym) then
+                  begin
+                    if InternalProcName<>'' then
+                     begin
+                       { This is wrong if the first is not
+                         an underline }
+                       if InternalProcName[1]='_' then
+                         delete(InternalProcName,1,1)
+                       else if (target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince]) and UseDeffileForExports then
+                         begin
+                           Message(parser_e_dlltool_unit_var_problem);
+                           Message(parser_e_dlltool_unit_var_problem2);
+                         end;
+                       if length(InternalProcName)<2 then
+                        Message(parser_e_procname_to_short_for_export);
+                       DefString:=srsym.realname+'='+InternalProcName;
+                     end;
+                    if try_to_consume(_INDEX) then
+                     begin
+                       pt:=comp_expr(true);
+                       if pt.nodetype=ordconstn then
+                        if (Tordconstnode(pt).value<int64(low(index))) or
+                           (Tordconstnode(pt).value>int64(high(index))) then
+                          begin
+                            index:=0;
+                            message(parser_e_range_check_error)
+                          end
+                        else
+                          index:=Tordconstnode(pt).value.svalue
+                       else
+                        begin
+                          index:=0;
+                          consume(_INTCONST);
+                        end;
+                       options:=options or eo_index;
+                       pt.free;
+                       if target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince] then
+                        DefString:=srsym.realname+'='+InternalProcName+' @ '+tostr(index)
+                       else
+                        DefString:=srsym.realname+'='+InternalProcName; {Index ignored!}
+                     end;
+                    if try_to_consume(_NAME) then
+                     begin
+                       pt:=comp_expr(true);
+                       if pt.nodetype=stringconstn then
+                        hpname:=strpas(tstringconstnode(pt).value_str)
+                       else
+                        begin
+                          consume(_CSTRING);
+                        end;
+                       options:=options or eo_name;
+                       pt.free;
+                       DefString:=hpname+'='+InternalProcName;
+                     end;
+                    if try_to_consume(_RESIDENT) then
                      begin
-                       Message(parser_e_dlltool_unit_var_problem);
-                       Message(parser_e_dlltool_unit_var_problem2);
+                       options:=options or eo_resident;
+                       DefString:=srsym.realname+'='+InternalProcName;{Resident ignored!}
                      end;
-                   if length(InternalProcName)<2 then
-                    Message(parser_e_procname_to_short_for_export);
-                   DefString:=srsym.realname+'='+InternalProcName;
-                 end;
-                if try_to_consume(_INDEX) then
-                 begin
-                   pt:=comp_expr(true);
-                   if pt.nodetype=ordconstn then
-                    if (Tordconstnode(pt).value<int64(low(index))) or
-                       (Tordconstnode(pt).value>int64(high(index))) then
-                      begin
-                        index:=0;
-                        message(parser_e_range_check_error)
-                      end
-                    else
-                      index:=Tordconstnode(pt).value.svalue
-                   else
+                    if (DefString<>'') and UseDeffileForExports then
+                     DefFile.AddExport(DefString);
+                  end;
+                case srsym.typ of
+                  procsym:
                     begin
-                      index:=0;
-                      consume(_INTCONST);
+                      { if no specific name or index was given, then if }
+                      { the procedure has aliases defined export those, }
+                      { otherwise export the name as it appears in the  }
+                      { export section (it doesn't make sense to export }
+                      { the generic mangled name, because the name of   }
+                      { the parent unit is used in that)                }
+                      if ((options and (eo_name or eo_index))=0) and
+                         (tprocdef(tprocsym(srsym).procdeflist[0]).aliasnames.count>1) then
+                        exportallprocsymnames(tprocsym(srsym),options)
+                      else
+                        begin
+                          { there's a name or an index -> export only one name   }
+                          { correct? Or can you export multiple names with the   }
+                          { same index? And/or should we also export the aliases }
+                          { if a name is specified? (JM)                         }
+
+                          if ((options and eo_name)=0) then
+                            { Export names are not mangled on Windows and OS/2 }
+                            if (target_info.system in (system_all_windows+[system_i386_emx, system_i386_os2])) then
+                              hpname:=orgs
+                            { Use set mangled name in case of cdecl/cppdecl/mwpascal }
+                            { and no name specified                                  }
+                            else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cdecl,pocall_mwpascal]) then
+                              hpname:=target_info.cprefix+tprocsym(srsym).realname
+                            else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cppdecl]) then
+                              hpname:=target_info.cprefix+tprocdef(tprocsym(srsym).procdeflist[0]).cplusplusmangledname
+                            else
+                              hpname:=orgs;
+
+                          exportprocsym(srsym,hpname,index,options);
+                        end
                     end;
-                   options:=options or eo_index;
-                   pt.free;
-                   if target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince] then
-                    DefString:=srsym.realname+'='+InternalProcName+' @ '+tostr(index)
-                   else
-                    DefString:=srsym.realname+'='+InternalProcName; {Index ignored!}
-                 end;
-                if try_to_consume(_NAME) then
-                 begin
-                   pt:=comp_expr(true);
-                   if pt.nodetype=stringconstn then
-                    hpname:=strpas(tstringconstnode(pt).value_str)
-                   else
+                  staticvarsym:
                     begin
-                      consume(_CSTRING);
+                      if ((options and eo_name)=0) then
+                        { for "cvar" }
+                        if (vo_has_mangledname in tstaticvarsym(srsym).varoptions) then
+                          hpname:=srsym.mangledname
+                        else
+                          hpname:=orgs;
+                      exportvarsym(srsym,hpname,index,options);
                     end;
-                   options:=options or eo_name;
-                   pt.free;
-                   DefString:=hpname+'='+InternalProcName;
-                 end;
-                if try_to_consume(_RESIDENT) then
-                 begin
-                   options:=options or eo_resident;
-                   DefString:=srsym.realname+'='+InternalProcName;{Resident ignored!}
-                 end;
-                if (DefString<>'') and UseDeffileForExports then
-                 DefFile.AddExport(DefString);
-
-                if srsym.typ=procsym then
-                  begin
-                    { if no specific name or index was given, then if }
-                    { the procedure has aliases defined export those, }
-                    { otherwise export the name as it appears in the  }
-                    { export section (it doesn't make sense to export }
-                    { the generic mangled name, because the name of   }
-                    { the parent unit is used in that)                }
-                    if ((options and (eo_name or eo_index))=0) and
-                       (tprocdef(tprocsym(srsym).procdeflist[0]).aliasnames.count>1) then
-                      exportallprocsymnames(tprocsym(srsym),options)
-                    else
-                      begin
-                        { there's a name or an index -> export only one name   }
-                        { correct? Or can you export multiple names with the   }
-                        { same index? And/or should we also export the aliases }
-                        { if a name is specified? (JM)                         }
-
-                        if ((options and eo_name)=0) then
-                          { Export names are not mangled on Windows and OS/2 }
-                          if (target_info.system in (system_all_windows+[system_i386_emx, system_i386_os2])) then
-                            hpname:=orgs
-                          { Use set mangled name in case of cdecl/cppdecl/mwpascal }
-                          { and no name specified                                  }
-                          else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cdecl,pocall_mwpascal]) then
-                            hpname:=target_info.cprefix+tprocsym(srsym).realname
-                          else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cppdecl]) then
-                            hpname:=target_info.cprefix+tprocdef(tprocsym(srsym).procdeflist[0]).cplusplusmangledname
-                          else
-                            hpname:=orgs;
-
-                        exportprocsym(srsym,hpname,index,options);
-                      end
-                  end
-                { can also be errorsym }
-                else if (srsym.typ=staticvarsym) then
-                  begin
-                    if ((options and eo_name)=0) then
-                      { for "cvar" }
-                      if (vo_has_mangledname in tstaticvarsym(srsym).varoptions) then
-                        hpname:=srsym.mangledname
-                      else
-                        hpname:=orgs;
-                    exportvarsym(srsym,hpname,index,options);
-                  end;
+                  typesym:
+                    begin
+                      case ttypesym(srsym).typedef.typ of
+                        objectdef:
+                          case tobjectdef(ttypesym(srsym).typedef).objecttype of
+                            odt_objcclass:
+                              exportobjcclass(tobjectdef(ttypesym(srsym).typedef));
+                            else
+                              internalerror(2009092601);
+                          end;
+                        else
+                          internalerror(2009092602);
+                      end;
+                    end;
+                end
              end
            else
              consume(_ID);

+ 56 - 29
compiler/pexpr.pas

@@ -373,11 +373,12 @@ implementation
                 ttypenode(p1).allowed:=true;
               { Allow classrefdef, which is required for
                 Typeof(self) in static class methods }
-              if (p1.resultdef.typ = objectdef) or
-                 (assigned(current_procinfo) and
-                  ((po_classmethod in current_procinfo.procdef.procoptions) or
-                   (po_staticmethod in current_procinfo.procdef.procoptions)) and
-                  (p1.resultdef.typ=classrefdef)) then
+              if not(is_objc_class_or_protocol(p1.resultdef)) and
+                 ((p1.resultdef.typ = objectdef) or
+                  (assigned(current_procinfo) and
+                   ((po_classmethod in current_procinfo.procdef.procoptions) or
+                    (po_staticmethod in current_procinfo.procdef.procoptions)) and
+                   (p1.resultdef.typ=classrefdef))) then
                statement_syssym:=geninlinenode(in_typeof_x,false,p1)
               else
                begin
@@ -427,31 +428,41 @@ implementation
                end;
             end;
 
-          in_typeinfo_x :
+          in_typeinfo_x,
+          in_objc_encode_x :
             begin
-              consume(_LKLAMMER);
-              in_args:=true;
-              p1:=comp_expr(true);
-              { When reading a class type it is parsed as loadvmtaddrn,
-                typeinfo only needs the type so we remove the loadvmtaddrn }
-              if p1.nodetype=loadvmtaddrn then
+              if (l=in_typeinfo_x) or
+                 (m_objectivec1 in current_settings.modeswitches) then
                 begin
-                  p2:=tloadvmtaddrnode(p1).left;
-                  tloadvmtaddrnode(p1).left:=nil;
-                  p1.free;
-                  p1:=p2;
-                end;
-              if p1.nodetype=typen then
-                ttypenode(p1).allowed:=true;
-{              else
+                  consume(_LKLAMMER);
+                  in_args:=true;
+                  p1:=comp_expr(true);
+                  { When reading a class type it is parsed as loadvmtaddrn,
+                    typeinfo only needs the type so we remove the loadvmtaddrn }
+                  if p1.nodetype=loadvmtaddrn then
+                    begin
+                      p2:=tloadvmtaddrnode(p1).left;
+                      tloadvmtaddrnode(p1).left:=nil;
+                      p1.free;
+                      p1:=p2;
+                    end;
+                  if p1.nodetype=typen then
+                    ttypenode(p1).allowed:=true;
+    {              else
+                    begin
+                       p1.destroy;
+                       p1:=cerrornode.create;
+                       Message(parser_e_illegal_parameter_list);
+                    end;}
+                  consume(_RKLAMMER);
+                  p2:=geninlinenode(l,false,p1);
+                  statement_syssym:=p2;
+                end
+              else
                 begin
-                   p1.destroy;
-                   p1:=cerrornode.create;
-                   Message(parser_e_illegal_parameter_list);
-                end;}
-              consume(_RKLAMMER);
-              p2:=geninlinenode(in_typeinfo_x,false,p1);
-              statement_syssym:=p2;
+                  Message1(sym_e_id_not_found, orgpattern);
+                  statement_syssym:=cerrornode.create;
+                end;
             end;
 
           in_unaligned_x :
@@ -489,7 +500,7 @@ implementation
                    procvardef,
                    classrefdef : ;
                    objectdef :
-                     if not is_class_or_interface(p1.resultdef) then
+                     if not is_class_or_interface_or_objc(p1.resultdef) then
                        begin
                          Message(parser_e_illegal_parameter_list);
                          err:=true;
@@ -1463,7 +1474,8 @@ implementation
                        else
                         begin
                           { class reference ? }
-                          if is_class(hdef) then
+                          if is_class(hdef) or
+                             is_objcclass(hdef) then
                            begin
                              if getaddr and (token=_POINT) then
                               begin
@@ -2575,6 +2587,21 @@ implementation
                     postfixoperators(p1,again);
                   end;
                end;
+           _OBJCPROTOCOL:
+             begin
+               { The @protocol keyword is used in two ways in Objective-C:
+                   1) to declare protocols (~ Object Pascal interfaces)
+                   2) to obtain the metaclass (~ Object Pascal) "class of")
+                      of a declared protocol
+                 This code is for handling the second case. Because of 1),
+                 we cannot simply use a system unit symbol.
+               }
+               consume(_OBJCPROTOCOL);
+               consume(_LKLAMMER);
+               p1:=factor(false);
+               consume(_RKLAMMER);
+               p1:=cinlinenode.create(in_objc_protocol_x,false,p1);
+             end;
 
              else
                begin

+ 15 - 21
compiler/pmodules.pas

@@ -45,6 +45,7 @@ implementation
        link,assemble,import,export,gendef,ppu,comprsrc,dbgbase,
        cresstr,procinfo,
        pexports,
+       objcgutl,
        wpobase,
        scanner,pbase,pexpr,psystem,psub,pdecsub,ptype
        ,cpuinfo
@@ -236,21 +237,6 @@ implementation
       end;
 
 
-    procedure MaybeGenerateObjectiveCImageInfo;
-      begin
-        if (m_objectivec1 in current_settings.modeswitches) then
-          begin
-            { first 4 bytes contain version information about this section (currently version 0),
-              next 4 bytes contain flags (currently only regarding whether the code in the object
-              file supports or requires garbage collection)
-            }
-            new_section(current_asmdata.asmlists[al_objc_data],sec_objc_image_info,'_OBJC_IMAGE_INFO',4);
-            current_asmdata.asmlists[al_objc_data].concat(Tai_symbol.Createname(target_asm.labelprefix+'_OBJC_IMAGE_INFO',AT_LABEL,8));
-            current_asmdata.asmlists[al_objc_data].concat(Tai_const.Create_64bit(0));
-          end;
-      end;
-
-
     Function CheckResourcesUsed : boolean;
     var
       hp           : tused_unit;
@@ -602,7 +588,15 @@ implementation
           AddUnit('macpas');
         { Objective-C 1.0 support unit? }
         if (m_objectivec1 in current_settings.modeswitches) then
-          AddUnit('objc1');
+          begin
+            { interface to Objective-C run time }
+            AddUnit('objc');
+            loadobjctypes;
+            { NSObject }
+            if not(current_module.is_unit) or
+               (current_module.modulename^<>'OBJCBASE') then
+              AddUnit('objcbase');
+          end;
         { Profile unit? Needed for go32v2 only }
         if (cs_profile in current_settings.moduleswitches) and
            (target_info.system in [system_i386_go32v2,system_i386_watcom]) then
@@ -1208,8 +1202,8 @@ implementation
             exit;
           end;
 
-         { if an Objective-C module, generate objc_image_info section }
-         MaybeGenerateObjectiveCImageInfo;
+         { if an Objective-C module, generate rtti and module info }
+         MaybeGenerateObjectiveCImageInfo(current_module.globalsymtable,current_module.localsymtable);
 
          { do we need to add the variants unit? }
          maybeloadvariantsunit;
@@ -2146,9 +2140,6 @@ implementation
                 end;
           end;
 
-         { if an Objective-C module, generate objc_image_info section }
-         MaybeGenerateObjectiveCImageInfo;
-
          { do we need to add the variants unit? }
          maybeloadvariantsunit;
 
@@ -2178,6 +2169,9 @@ implementation
          { generate rtti/init tables }
          write_persistent_type_info(current_module.localsymtable);
 
+         { if an Objective-C module, generate rtti and module info }
+         MaybeGenerateObjectiveCImageInfo(nil,current_module.localsymtable);
+
          { generate wrappers for interfaces }
          gen_intf_wrappers(current_asmdata.asmlists[al_procedures],current_module.localsymtable);
 

+ 34 - 25
compiler/powerpc/agppcmpw.pas

@@ -77,31 +77,40 @@ interface
         'csect', {bss} 'csect', '',
         'csect','csect','csect','csect',
          '','','','','','','','','','','','','','',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         '',
-         ''
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        ''
       );
 
     type

+ 1 - 0
compiler/powerpc64/cpunode.pas

@@ -30,6 +30,7 @@ implementation
 uses
   { generic nodes }
   ncgbas, ncgld, ncgflw, ncgcnv, ncgmem, ncgcon, ncgcal, ncgset, ncginl, ncgopt,
+  ncgobjc,
   { to be able to only parts of the generic code,
     the processor specific nodes must be included
     after the generic one (FK)

+ 1 - 1
compiler/ppcgen/cgppc.pas

@@ -785,7 +785,7 @@ unit cgppc;
           begin
             if (ref.symbol.bind in [AB_EXTERNAL,AB_WEAK_EXTERNAL]) or
                ((cs_create_pic in current_settings.moduleswitches) and
-                (ref.symbol.bind in [AB_COMMON,AB_GLOBAL])) then
+                (ref.symbol.bind in [AB_COMMON,AB_GLOBAL,AB_PRIVATE_EXTERN])) then
               begin
                 tmpreg := g_indirect_sym_load(list,ref.symbol.name,ref.symbol.bind=AB_WEAK_EXTERNAL);
                 ref.symbol:=nil;

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 103;
+  CurrentPPUVersion = 104;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 1 - 1
compiler/pstatmnt.pas

@@ -629,7 +629,7 @@ implementation
                     typecheckpass(p);
                   end;
                 { classes and interfaces have implicit dereferencing }
-                hasimplicitderef:=is_class_or_interface(p.resultdef) or
+                hasimplicitderef:=is_class_or_interface_or_objc(p.resultdef) or
                                   (p.resultdef.typ = classrefdef);
                 if hasimplicitderef then
                   hdef:=p.resultdef

+ 1 - 0
compiler/psystem.pas

@@ -101,6 +101,7 @@ implementation
 {$endif defined(x86) or defined(arm)}
         systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x));
         systemunit.insert(tsyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
+        systemunit.insert(tsyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
       end;
 
 

+ 1 - 1
compiler/ptconst.pas

@@ -1231,7 +1231,7 @@ implementation
             end;
 
           { only allow nil for class and interface }
-          if is_class_or_interface(def) then
+          if is_class_or_interface_or_objc(def) then
             begin
               n:=comp_expr(true);
               if n.nodetype<>niln then

+ 29 - 9
compiler/ptype.pas

@@ -113,7 +113,8 @@ implementation
                         inc(ttypesym(srsym).refs);
                         { we need a class type for classrefdef }
                         if (def.typ=classrefdef) and
-                           not(is_class(ttypesym(srsym).typedef)) then
+                           not(is_class(ttypesym(srsym).typedef)) and
+                           not(is_objcclass(ttypesym(srsym).typedef)) then
                           MessagePos1(def.typesym.fileinfo,type_e_class_type_expected,ttypesym(srsym).typedef.typename);
                       end
                      else
@@ -302,7 +303,7 @@ implementation
             { Reparse the original type definition }
             if not err then
               begin
-                { Firsta new typesym so we can reuse this specialization and
+                { First a new typesym so we can reuse this specialization and
                   references to this specialization can be handled }
                 srsym:=ttypesym.create(specializename,generrordef);
                 specializest.insert(srsym);
@@ -357,7 +358,7 @@ implementation
             (current_objectdef.objname^=pattern) and
             (
              (testcurobject=2) or
-             is_class_or_interface(current_objectdef)
+             is_class_or_interface_or_objc(current_objectdef)
             )then
            begin
              consume(_ID);
@@ -545,7 +546,7 @@ implementation
               (current_objectdef.objname^=pattern) and
               (
                (testcurobject=2) or
-               is_class_or_interface(current_objectdef)
+               is_class_or_interface_or_objc(current_objectdef)
               )then
              begin
                consume(_ID);
@@ -971,7 +972,8 @@ implementation
                   begin
                     consume(_OF);
                     single_type(hdef,(block_type=bt_type),false);
-                    if is_class(hdef) then
+                    if is_class(hdef) or
+                       is_objcclass(hdef) then
                       def:=tclassrefdef.create(hdef)
                     else
                       if hdef.typ=forwarddef then
@@ -980,7 +982,7 @@ implementation
                           current_module.checkforwarddefs.add(def);
                         end
                     else
-                      Message1(type_e_class_type_expected,hdef.typename);
+                      Message1(type_e_class_or_objcclass_type_expected,hdef.typename);
                   end
                 else
                   def:=object_dec(odt_class,name,genericdef,genericlist,nil);
@@ -990,6 +992,14 @@ implementation
                 consume(token);
                 def:=object_dec(odt_cppclass,name,genericdef,genericlist,nil);
               end;
+            _OBJCCLASS :
+              begin
+                if not(m_objectivec1 in current_settings.modeswitches) then
+                  Message(parser_f_need_objc);
+
+                consume(token);
+                def:=object_dec(odt_objcclass,name,genericdef,genericlist,nil);
+              end;
             _INTERFACE :
               begin
                 { need extra check here since interface is a keyword
@@ -1002,6 +1012,14 @@ implementation
                 else {it_interfacecorba}
                   def:=object_dec(odt_interfacecorba,name,genericdef,genericlist,nil);
               end;
+            _OBJCPROTOCOL :
+               begin
+                if not(m_objectivec1 in current_settings.modeswitches) then
+                  Message(parser_f_need_objc);
+
+                consume(token);
+                def:=object_dec(odt_objcprotocol,name,genericdef,genericlist,nil);
+               end;
             _OBJECT :
               begin
                 consume(token);
@@ -1102,15 +1120,17 @@ implementation
             { Init }
             if (
                 assigned(def.typesym) and
-                (st.symtabletype=globalsymtable)
+                (st.symtabletype=globalsymtable) and
+                not is_objc_class_or_protocol(def)
                ) or
                def.needs_inittable or
                (ds_init_table_used in def.defstates) then
               RTTIWriter.write_rtti(def,initrtti);
             { RTTI }
             if (
-                  assigned(def.typesym) and
-                  (st.symtabletype=globalsymtable)
+                assigned(def.typesym) and
+                (st.symtabletype=globalsymtable) and
+                not is_objc_class_or_protocol(def)
                ) or
                (ds_rtti_table_used in def.defstates) then
               RTTIWriter.write_rtti(def,fullrtti);

+ 13 - 4
compiler/scanner.pas

@@ -461,9 +461,9 @@ implementation
               }
               if doinclude and
                  (i=m_objectivec1) and
-                 not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
+                 not(target_info.system in system_objc_supported) then
                 begin
-                  Message1(option_unsupported_target_for_feature,'Objective-C 1.0');
+                  Message1(option_unsupported_target_for_feature,'Objective-C');
                   break;
                 end;
 
@@ -471,9 +471,18 @@ implementation
                 current_settings.modeswitches:=init_settings.modeswitches;
               Result:=true;
               if doinclude then
-                include(current_settings.modeswitches,i)
+                begin
+                  include(current_settings.modeswitches,i);
+                  if (i=m_objectivec1) then
+                    include(current_settings.modeswitches,m_class);
+                end
               else
-                exclude(current_settings.modeswitches,i);
+                begin
+                  exclude(current_settings.modeswitches,i);
+                  if (i=m_objectivec1) and
+                     ([m_delphi,m_objfpc]*current_settings.modeswitches=[]) then
+                    exclude(current_settings.modeswitches,m_class);
+                end;
 
               { set other switches depending on changed mode switch }
               HandleModeSwitches(changeinit);

+ 2 - 0
compiler/symbase.pas

@@ -96,6 +96,7 @@ interface
           moduleid  : longint;
           refcount  : smallint;
           currentvisibility : tvisibility;
+          currentlyoptional : boolean;
           { level of symtable, used for nested procedures }
           symtablelevel : byte;
           symtabletype  : TSymtabletype;
@@ -222,6 +223,7 @@ implementation
          SymList:=TFPHashObjectList.Create(true);
          refcount:=1;
          currentvisibility:=vis_public;
+         currentlyoptional:=false;
       end;
 
 

+ 23 - 5
compiler/symconst.pas

@@ -105,6 +105,11 @@ const
   paranr_self = 2;
   paranr_result = 3;
   paranr_vmt = 4;
+
+  { the implicit parameters for Objective-C methods need to come
+    after the hidden result parameter }
+  paranr_objc_self = 4;
+  paranr_objc_cmd = 5;
   { Required to support variations of syscalls on MorphOS }
   paranr_syscall_basesysv = 9;
   paranr_syscall_sysvbase = high(word)-4;
@@ -280,7 +285,9 @@ type
     { Objective-C method }
     po_objc,
     { enumerator support }
-    po_enumerator_movenext
+    po_enumerator_movenext,
+    { optional Objective-C protocol method }
+    po_optional
   );
   tprocoptions=set of tprocoption;
 
@@ -293,7 +300,9 @@ type
     odt_interfacecom_function,
     odt_interfacecorba,
     odt_cppclass,
-    odt_dispinterface
+    odt_dispinterface,
+    odt_objcclass,
+    odt_objcprotocol
   );
 
   { Variations in interfaces implementation }
@@ -324,7 +333,9 @@ type
     oo_has_default_property,
     oo_has_valid_guid,
     oo_has_enumerator_movenext,
-    oo_has_enumerator_current
+    oo_has_enumerator_current,
+    oo_is_external,       { the class is externally implemented (objcclass, cppclass) }
+    oo_is_anonymous       { the class is only formally defined in this module (objcclass x = class; external;) }
   );
   tobjectoptions=set of tobjectoption;
 
@@ -373,7 +384,11 @@ type
     vo_is_range_check,
     vo_is_overflow_check,
     vo_is_typinfo_para,
-    vo_is_weak_external
+    vo_is_weak_external,
+    { Objective-C message selector parameter }
+    vo_is_msgsel,
+    { first field of a record or variant part of a record }
+    vo_is_first_field
   );
   tvaroptions=set of tvaroption;
 
@@ -448,7 +463,10 @@ type
 
   { RTTI information to store }
   trttitype = (
-    fullrtti,initrtti
+    fullrtti,initrtti,
+    { Objective-C }
+    objcmetartti,objcmetarortti,
+    objcclassrtti,objcclassrortti
   );
 
   { The order is from low priority to high priority,

+ 340 - 23
compiler/symdef.pas

@@ -241,7 +241,9 @@ interface
           childofderef   : tderef;
 
           objname,
-          objrealname    : pshortstring;
+          objrealname,
+          { for Objective-C: protocols and classes can have the same name there }
+          objextname     : pshortstring;
           objectoptions  : tobjectoptions;
           { to be able to have a variable vmt position }
           { and no vmt field for objects without virtuals }
@@ -288,6 +290,7 @@ interface
           procedure prepareguid;
           function  is_publishable : boolean;override;
           function  needs_inittable : boolean;override;
+          function  rtti_mangledname(rt:trttitype):string;override;
           function  vmt_mangledname : string;
           procedure check_forwards;
           function  is_related(d : tdef) : boolean;override;
@@ -305,6 +308,9 @@ interface
           procedure register_maybe_created_object_type;
           procedure register_created_classref_type;
           procedure register_vmt_call(index:longint);
+          { ObjC }
+          procedure make_all_methods_external;
+          procedure finish_objc_data;
        end;
 
        tclassrefdef = class(tabstractpointerdef)
@@ -313,6 +319,7 @@ interface
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  is_publishable : boolean;override;
+          function  rtti_mangledname(rt:trttitype):string;override;
           procedure register_created_object_type;override;
           procedure reset;override;
        end;
@@ -457,7 +464,6 @@ interface
        public
           messageinf : tmessageinf;
           dispid : longint;
-          extnumber      : word;
 {$ifndef EXTDEBUG}
           { where is this function defined and what were the symbol
             flags, needed here because there
@@ -465,7 +471,6 @@ interface
             EXTDEBUG has fileinfo in tdef (PFV) }
           fileinfo : tfileposinfo;
 {$endif}
-          visibility : tvisibility;
           symoptions : tsymoptions;
           deprecatedmsg : pshortstring;
           { symbol owning this definition }
@@ -486,29 +491,31 @@ interface
 {$endif powerpc or m68k}
           { name of the result variable to insert in the localsymtable }
           resultname : pshortstring;
-          { true, if the procedure is only declared
-            (forward procedure) }
-          forwarddef,
-          { true if the procedure is declared in the interface }
-          interfacedef : boolean;
-          { true if the procedure has a forward declaration }
-          hasforward : boolean;
           { import info }
           import_dll,
           import_name : pshortstring;
-          import_nr   : word;
           { info for inlining the subroutine, if this pointer is nil,
             the procedure can't be inlined }
           inlininginfo : pinlininginfo;
 {$ifdef oldregvars}
           regvarinfo: pregvarinfo;
 {$endif oldregvars}
-{$ifdef i386}
-          fpu_used     : byte;
-{$endif i386}
           { position in aasmoutput list }
           procstarttai,
           procendtai   : tai;
+          import_nr    : word;
+          extnumber    : word;
+{$ifdef i386}
+          fpu_used     : byte;
+{$endif i386}
+          visibility   : tvisibility;
+          { true, if the procedure is only declared
+            (forward procedure) }
+          forwarddef,
+          { true if the procedure is declared in the interface }
+          interfacedef : boolean;
+          { true if the procedure has a forward declaration }
+          hasforward  : boolean;
           constructor create(level:byte);
           constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
@@ -524,6 +531,7 @@ interface
           procedure setmangledname(const s : string);
           function  fullprocname(showhidden:boolean):string;
           function  cplusplusmangledname : string;
+          function  objcmangledname : string;
           function  is_methodpointer:boolean;override;
           function  is_addressonly:boolean;override;
        end;
@@ -667,6 +675,14 @@ interface
          of all interfaces         }
        rec_tguid : trecorddef;
 
+       { Objective-C base types }
+       objc_metaclasstype,
+       objc_superclasstype,
+       objc_idtype,
+       objc_seltype         : tpointerdef;
+       { base type of @protocol(protocolname) Objective-C statements }
+       objc_protocoltype    : tobjectdef;
+
     const
 {$ifdef i386}
        pbestrealtype : ^tdef = @s80floattype;
@@ -715,10 +731,17 @@ interface
     function is_object(def: tdef): boolean;
     function is_class(def: tdef): boolean;
     function is_cppclass(def: tdef): boolean;
+    function is_objcclass(def: tdef): boolean;
+    function is_objcclassref(def: tdef): boolean;
+    function is_objcprotocol(def: tdef): boolean;
+    function is_objc_class_or_protocol(def: tdef): boolean;
     function is_class_or_interface(def: tdef): boolean;
+    function is_class_or_interface_or_objc(def: tdef): boolean;
     function is_class_or_interface_or_object(def: tdef): boolean;
     function is_class_or_interface_or_dispinterface(def: tdef): boolean;
+    function is_class_or_interface_or_dispinterface_or_objc(def: tdef): boolean;
 
+    procedure loadobjctypes;
 
 {$ifdef x86}
     function use_sse(def : tdef) : boolean;
@@ -1112,7 +1135,7 @@ implementation
           procvardef :
             is_intregable:=not(po_methodpointer in tprocvardef(self).procoptions);
           objectdef:
-            is_intregable:=(is_class(self) or is_interface(self)) and not needs_inittable;
+            is_intregable:=(is_class_or_interface_or_objc(self)) and not needs_inittable;
           setdef:
             is_intregable:=is_smallset(self);
           recorddef:
@@ -2078,6 +2101,15 @@ implementation
       end;
 
 
+    function tclassrefdef.rtti_mangledname(rt: trttitype): string;
+      begin
+        if (tobjectdef(pointeddef).objecttype<>odt_objcclass) then
+          result:=inherited rtti_mangledname(rt)
+        else
+          result:=tobjectdef(pointeddef).rtti_mangledname(objcmetartti);
+      end;
+
+
     procedure tclassrefdef.reset;
       begin
         tobjectdef(pointeddef).classref_created_in_current_module:=false;
@@ -3513,6 +3545,27 @@ implementation
       end;
 
 
+    function  tprocdef.objcmangledname : string;
+      begin
+        if not (po_msgstr in procoptions) then
+          internalerror(2009030901);
+        { we may very well need longer strings to handle these... }
+        if ((255-length(tobjectdef(procsym.owner.defowner).objextname^)
+             -length('+"[ ]"')-length(messageinf.str^)) < 0) then
+          Message1(parser_e_objc_message_name_too_long,messageinf.str^);
+        if not(po_classmethod in procoptions) then
+          result:='"-['
+        else
+          result:='"+[';
+        { quotes are necessary because the +/- otherwise confuse the assembler
+          into expecting a number
+        }
+        result:=
+          result+tobjectdef(procsym.owner.defowner).objextname^+' '+
+          messageinf.str^+']"';
+      end;
+
+
     procedure tprocdef.setmangledname(const s : string);
       begin
         { This is not allowed anymore, the forward declaration
@@ -3695,7 +3748,7 @@ implementation
         if objecttype in [odt_interfacecorba,odt_interfacecom,odt_dispinterface] then
           prepareguid;
         { setup implemented interfaces }
-        if objecttype in [odt_class,odt_interfacecorba] then
+        if objecttype in [odt_class,odt_objcclass,odt_objcprotocol] then
           ImplementedInterfaces:=TFPObjectList.Create(true)
         else
           ImplementedInterfaces:=nil;
@@ -3715,6 +3768,10 @@ implementation
          objecttype:=tobjecttyp(ppufile.getbyte);
          objrealname:=stringdup(ppufile.getstring);
          objname:=stringdup(upper(objrealname^));
+         objextname:=stringdup(ppufile.getstring);
+         { only used for external Objective-C classes/protocols }
+         if (objextname^='') then
+           stringdispose(objextname);
          symtable:=tObjectSymtable.create(self,objrealname^,0);
          tObjectSymtable(symtable).datasize:=ppufile.getaint;
          tObjectSymtable(symtable).fieldalignment:=ppufile.getbyte;
@@ -3745,7 +3802,7 @@ implementation
            end;
 
          { load implemented interfaces }
-         if objecttype in [odt_class,odt_interfacecorba] then
+         if objecttype in [odt_class,odt_objcclass,odt_objcprotocol] then
            begin
              ImplementedInterfaces:=TFPObjectList.Create(true);
              implintfcount:=ppufile.getlongint;
@@ -3776,6 +3833,10 @@ implementation
             (objecttype=odt_interfacecom) and
             (objname^='IUNKNOWN') then
            interface_iunknown:=self;
+         if (childof=nil) and
+            (objecttype=odt_objcclass) and
+            (objname^='PROTOCOL') then
+           objc_protocoltype:=self;
          writing_class_record_dbginfo:=false;
        end;
 
@@ -3789,6 +3850,7 @@ implementation
            end;
          stringdispose(objname);
          stringdispose(objrealname);
+         stringdispose(objextname);
          stringdispose(iidstr);
          if assigned(ImplementedInterfaces) then
            begin
@@ -3827,6 +3889,8 @@ implementation
           tobjectdef(result).objname:=stringdup(objname^);
         if assigned(objrealname) then
           tobjectdef(result).objrealname:=stringdup(objrealname^);
+        if assigned(objextname) then
+          tobjectdef(result).objextname:=stringdup(objextname^);
         tobjectdef(result).objectoptions:=objectoptions;
         include(tobjectdef(result).defoptions,df_copied_def);
         tobjectdef(result).vmt_offset:=vmt_offset;
@@ -3859,6 +3923,10 @@ implementation
          inherited ppuwrite(ppufile);
          ppufile.putbyte(byte(objecttype));
          ppufile.putstring(objrealname^);
+         if assigned(objextname) then
+           ppufile.putstring(objextname^)
+         else
+           ppufile.putstring('');
          ppufile.putaint(tObjectSymtable(symtable).datasize);
          ppufile.putbyte(tObjectSymtable(symtable).fieldalignment);
          ppufile.putbyte(tObjectSymtable(symtable).recordalignment);
@@ -4046,7 +4114,7 @@ implementation
         { inherit options and status }
         objectoptions:=objectoptions+(c.objectoptions*inherited_objectoptions);
         { add the data of the anchestor class/object }
-        if (objecttype in [odt_class,odt_object]) then
+        if (objecttype in [odt_class,odt_object,odt_objcclass]) then
           begin
             tObjectSymtable(symtable).datasize:=tObjectSymtable(symtable).datasize+tObjectSymtable(c.symtable).datasize;
             { inherit recordalignment }
@@ -4068,7 +4136,7 @@ implementation
      var
        vs: tfieldvarsym;
      begin
-        if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
+        if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol] then
           exit;
         if (oo_has_vmt in objectoptions) then
           internalerror(12345)
@@ -4097,7 +4165,7 @@ implementation
 
    procedure tobjectdef.check_forwards;
      begin
-        if not(objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface]) then
+        if not(objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcprotocol]) then
           tstoredsymtable(symtable).check_forwards;
         if (oo_is_forward in objectoptions) then
           begin
@@ -4108,11 +4176,36 @@ implementation
      end;
 
 
+   { true if prot implements d (or if they are equal) }
+   function is_related_protocol(prot: tobjectdef; d : tdef) : boolean;
+     var
+       i  : longint;
+     begin
+       { objcprotocols have multiple inheritance, all protocols from which
+         the current protocol inherits are stored in implementedinterfaces }
+       result:=prot=d;
+       if result then
+         exit;
+
+       for i:=0 to prot.ImplementedInterfaces.count-1 do
+         begin
+           result:=is_related_protocol(tobjectdef(prot.ImplementedInterfaces[i]),d);
+           if result then
+             exit;
+         end;
+     end;
+
+
    { true, if self inherits from d (or if they are equal) }
    function tobjectdef.is_related(d : tdef) : boolean;
      var
         hp : tobjectdef;
      begin
+        if (objecttype=odt_objcprotocol) then
+          begin
+            is_related:=is_related_protocol(self,d);
+            exit
+          end;
         hp:=self;
         while assigned(hp) do
           begin
@@ -4163,7 +4256,7 @@ implementation
 
     function tobjectdef.size : aint;
       begin
-        if objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
+        if objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol] then
           result:=sizeof(pint)
         else
           result:=tObjectSymtable(symtable).datasize;
@@ -4172,7 +4265,7 @@ implementation
 
     function tobjectdef.alignment:shortint;
       begin
-        if objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
+        if objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol] then
           alignment:=sizeof(pint)
         else
           alignment:=tObjectSymtable(symtable).recordalignment;
@@ -4186,6 +4279,9 @@ implementation
         odt_class:
           { the +2*sizeof(pint) is size and -size }
           vmtmethodoffset:=(index+10)*sizeof(pint)+2*sizeof(pint);
+        odt_objcclass,
+        odt_objcprotocol:
+          vmtmethodoffset:=0;
         odt_interfacecom,odt_interfacecorba:
           vmtmethodoffset:=index*sizeof(pint);
         else
@@ -4218,7 +4314,9 @@ implementation
               needs_inittable:=is_related(interface_iunknown);
             odt_object:
               needs_inittable:=tObjectSymtable(symtable).needs_init_final;
-            odt_cppclass:
+            odt_cppclass,
+            odt_objcclass,
+            odt_objcprotocol:
               needs_inittable:=false;
             else
               internalerror(200108267);
@@ -4226,6 +4324,68 @@ implementation
       end;
 
 
+    function tobjectdef.rtti_mangledname(rt: trttitype): string;
+      begin
+        if not(objecttype in [odt_objcclass,odt_objcprotocol]) then
+          result:=inherited rtti_mangledname(rt)
+        else
+          begin
+            if not(target_info.system in system_objc_nfabi) then
+              begin
+                result:=target_asm.labelprefix;
+                case objecttype of
+                  odt_objcclass:
+                    begin
+                      case rt of
+                        objcclassrtti:
+                          result:=result+'_OBJC_CLASS_';
+                        objcmetartti:
+                          result:=result+'_OBJC_METACLASS_';
+                        else
+                         internalerror(2009092302);
+                      end;
+                    end;
+                  odt_objcprotocol:
+                    result:=result+'_OBJC_PROTOCOL_';
+                end;
+              end
+            else
+              begin
+                case objecttype of
+                  odt_objcclass:
+                    begin
+                      case rt of
+                        objcclassrtti:
+                          result:='_OBJC_CLASS_$_';
+                        objcmetartti:
+                          result:='_OBJC_METACLASS_$_';
+                        objcclassrortti:
+                          result:=lower(target_asm.labelprefix)+'_OBJC_CLASS_RO_$_';
+                        objcmetarortti:
+                          result:=lower(target_asm.labelprefix)+'_OBJC_METACLASS_RO_$_';
+                        else
+                         internalerror(2009092303);
+                      end;
+                    end;
+                  odt_objcprotocol:
+                    begin
+                      result:=lower(target_asm.labelprefix);
+                      case rt of
+                        objcclassrtti:
+                          result:=result+'_OBJC_PROTOCOL_$_';
+                        objcmetartti:
+                          result:=result+'_OBJC_LABEL_PROTOCOL_$_';
+                        else
+                          internalerror(2009092501);
+                      end;
+                    end;
+                end;
+              end;
+            result:=result+objextname^;
+          end;
+      end;
+
+
     function tobjectdef.members_need_inittable : boolean;
       begin
         members_need_inittable:=tObjectSymtable(symtable).needs_init_final;
@@ -4422,6 +4582,99 @@ implementation
       end;
 
 
+    procedure make_procdef_external(data: tobject; arg: pointer);
+      var
+        def: tdef absolute data;
+      begin
+        if (def.typ = procdef) then
+          begin
+            include(tprocdef(def).procoptions,po_external);
+            tprocdef(def).forwarddef:=false;
+          end;
+      end;
+
+
+    procedure tobjectdef.make_all_methods_external;
+      begin
+         self.symtable.deflist.foreachcall(@make_procdef_external,nil);
+      end;
+
+
+    procedure check_and_finish_msg(data: tobject; arg: pointer);
+      var
+        def: tdef absolute data;
+        pd: tprocdef absolute data;
+        i,
+        paracount: longint;
+      begin
+        if (def.typ=procdef) then
+          begin
+            { we have to wait until now to set the mangled name because it
+              depends on the (possibly external) class name, which is defined
+              at the very end.  }
+            if (po_msgstr in pd.procoptions) then
+              begin
+                { Mangled name is already set in case this is a copy of
+                  another type.  }
+                if not(po_has_mangledname in pd.procoptions) then
+                  begin
+                    { check whether the number of formal parameters is correct }
+                    paracount:=0;
+                    for i:=1 to length(pd.messageinf.str^) do
+                      if pd.messageinf.str^[i]=':' then
+                        inc(paracount);
+                    for i:=0 to pd.paras.count-1 do
+                      if not(vo_is_hidden_para in tparavarsym(pd.paras[i]).varoptions) and
+                         not is_array_of_const(tparavarsym(pd.paras[i]).vardef) then
+                        dec(paracount);
+                    if (paracount<>0) then
+                      MessagePos(pd.fileinfo,sym_e_objc_para_mismatch);
+
+                    pd.setmangledname(pd.objcmangledname);
+                  end
+                else
+                  { all checks already done }
+                  exit;
+              end
+            else
+              MessagePos(pd.fileinfo,parser_e_objc_requires_msgstr);
+            if not(oo_is_external in pd._class.objectoptions) then
+              begin
+                if (po_varargs in pd.procoptions) then
+                  MessagePos(pd.fileinfo,parser_e_varargs_need_cdecl_and_external)
+                else
+                  begin
+                    { check for "array of const" parameters }
+                    for i:=0 to pd.parast.symlist.count-1 do
+                      begin
+                        if (tsym(pd.parast.symlist[i]).typ=paravarsym) and
+                           is_array_of_const(tparavarsym(pd.parast.symlist[i]).vardef) then
+                          MessagePos(pd.fileinfo,parser_e_varargs_need_cdecl_and_external);
+                      end;
+                  end;
+              end;
+          end;
+      end;
+
+
+    procedure mark_private_fields_used(data: tobject; arg: pointer);
+      var
+        sym: tsym absolute data;
+      begin
+        if (sym.typ=fieldvarsym) and
+           (tfieldvarsym(sym).visibility in [vis_private,vis_strictprivate]) then
+          sym.IncRefCount;
+      end;
+
+
+    procedure tobjectdef.finish_objc_data;
+      begin
+        self.symtable.DefList.foreachcall(@check_and_finish_msg,nil);
+        if (oo_is_external in objectoptions) then
+          self.symtable.SymList.ForEachCall(@mark_private_fields_used,nil);
+      end;
+
+
 {****************************************************************************
                              TImplementedInterface
 ****************************************************************************}
@@ -4707,6 +4960,42 @@ implementation
       end;
 
 
+    function is_objcclass(def: tdef): boolean;
+      begin
+        is_objcclass:=
+          assigned(def) and
+          (def.typ=objectdef) and
+          (tobjectdef(def).objecttype=odt_objcclass);
+      end;
+
+
+    function is_objcclassref(def: tdef): boolean;
+      begin
+        is_objcclassref:=
+          assigned(def) and
+          (def.typ=classrefdef) and
+          is_objcclass(tclassrefdef(def).pointeddef);
+      end;
+
+
+    function is_objcprotocol(def: tdef): boolean;
+      begin
+        result:=
+          assigned(def) and
+          (def.typ=objectdef) and
+          (tobjectdef(def).objecttype=odt_objcprotocol);
+      end;
+
+
+    function is_objc_class_or_protocol(def: tdef): boolean;
+      begin
+         result:=
+           assigned(def) and
+           (def.typ=objectdef) and
+           (tobjectdef(def).objecttype in [odt_objcclass,odt_objcprotocol]);
+      end;
+
+
     function is_class_or_interface(def: tdef): boolean;
       begin
         result:=
@@ -4716,6 +5005,15 @@ implementation
       end;
 
 
+    function is_class_or_interface_or_objc(def: tdef): boolean;
+      begin
+        result:=
+          assigned(def) and
+          (def.typ=objectdef) and
+          (tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_objcclass,odt_objcprotocol]);
+      end;
+
+
     function is_class_or_interface_or_object(def: tdef): boolean;
       begin
         result:=
@@ -4734,7 +5032,26 @@ implementation
       end;
 
 
+    function is_class_or_interface_or_dispinterface_or_objc(def: tdef): boolean;
+      begin
+        result:=
+          assigned(def) and
+          (def.typ=objectdef) and
+          (tobjectdef(def).objecttype in [odt_class,odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcclass,odt_objcprotocol]);
+      end;
+
+
+    procedure loadobjctypes;
+      begin
+        objc_metaclasstype:=tpointerdef(search_named_unit_globaltype('OBJC','POBJC_CLASS').typedef);
+        objc_superclasstype:=tpointerdef(search_named_unit_globaltype('OBJC','POBJC_SUPER').typedef);
+        objc_idtype:=tpointerdef(search_named_unit_globaltype('OBJC','ID').typedef);
+        objc_seltype:=tpointerdef(search_named_unit_globaltype('OBJC','SEL').typedef);
+      end;
+
+
 {$ifdef x86}
+
     function use_sse(def : tdef) : boolean;
       begin
         use_sse:=(is_single(def) and (current_settings.fputype in sse_singlescalar)) or

+ 19 - 0
compiler/symsym.pas

@@ -151,10 +151,12 @@ interface
 
       tfieldvarsym = class(tabstractvarsym)
           fieldoffset   : aint;   { offset in record/object }
+          objcoffsetmangledname: pshortstring; { mangled name of offset, calculated as needed }
           constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
           constructor ppuload(ppufile:tcompilerppufile);
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function mangledname:string;override;
+          destructor destroy;override;
       end;
 
       tabstractnormalvarsym = class(tabstractvarsym)
@@ -1189,11 +1191,28 @@ implementation
             else
               internalerror(2007012501);
           end
+        else if is_objcclass(tdef(owner.defowner)) then
+          begin
+            if assigned(objcoffsetmangledname) then
+              result:=objcoffsetmangledname^
+            else
+              begin
+                result:=target_info.cprefix+'OBJC_IVAR_$_'+tobjectdef(owner.defowner).objextname^+'.'+RealName;
+                objcoffsetmangledname:=stringdup(result);
+              end;
+          end
         else
           result:=inherited mangledname;
       end;
 
 
+    destructor tfieldvarsym.destroy;
+      begin
+        stringdispose(objcoffsetmangledname);
+        inherited destroy;
+      end;
+
+
 {****************************************************************************
                         TABSTRACTNORMALVARSYM
 ****************************************************************************}

+ 66 - 1
compiler/symtable.pas

@@ -195,10 +195,12 @@ interface
     function  searchsym(const s : TIDString;out srsym:tsym;out srsymtable:TSymtable):boolean;
     function  searchsym_type(const s : TIDString;out srsym:tsym;out srsymtable:TSymtable):boolean;
     function  searchsym_in_module(pm:pointer;const s : TIDString;out srsym:tsym;out srsymtable:TSymtable):boolean;
+    function  searchsym_in_named_module(const unitname, symname: TIDString; out srsym: tsym; out srsymtable: tsymtable): boolean;
     function  searchsym_in_class(classh,contextclassh:tobjectdef;const s : TIDString;out srsym:tsym;out srsymtable:TSymtable):boolean;
     function  searchsym_in_class_by_msgint(classh:tobjectdef;msgid:longint;out srdef : tdef;out srsym:tsym;out srsymtable:TSymtable):boolean;
     function  searchsym_in_class_by_msgstr(classh:tobjectdef;const s:string;out srsym:tsym;out srsymtable:TSymtable):boolean;
     function  search_system_type(const s: TIDString): ttypesym;
+    function  search_named_unit_globaltype(const unitname, typename: TIDString): ttypesym;
     function  search_class_member(pd : tobjectdef;const s : string):tsym;
     function  search_assignment_operator(from_def,to_def:Tdef):Tprocdef;
     function  search_enumerator_operator(type_def:Tdef):Tprocdef;
@@ -629,7 +631,11 @@ implementation
                   (tsym(sym).typ<>procsym) or
                   ((tsym(sym).owner.symtabletype=staticsymtable) and
                    not current_module.is_unit)
-                 ) then
+                 ) and
+                 { don't complain about alias for hidden _cmd parameter to
+                   obj-c methods }
+                 not((tsym(sym).typ in [localvarsym,paravarsym,absolutevarsym]) and
+                     (vo_is_msgsel in tabstractvarsym(sym).varoptions)) then
                 MessagePos2(tsym(sym).fileinfo,sym_h_local_symbol_not_used,SymTypeName[tsym(sym).typ],tsym(sym).prettyname);
             end;
           end;
@@ -1764,6 +1770,43 @@ implementation
       end;
 
 
+    function searchsym_in_named_module(const unitname, symname: TIDString; out srsym: tsym; out srsymtable: tsymtable): boolean;
+      var
+        stackitem  : psymtablestackitem;
+      begin
+        result:=false;
+        stackitem:=symtablestack.stack;
+        while assigned(stackitem) do
+          begin
+            srsymtable:=stackitem^.symtable;
+            if (srsymtable.symtabletype=globalsymtable) and
+               (srsymtable.name^=unitname) then
+              begin
+                srsym:=tsym(srsymtable.find(symname));
+                if not assigned(srsym) then
+                  break;
+                result:=true;
+                exit;
+              end;
+            stackitem:=stackitem^.next;
+          end;
+
+        { If the module is the current unit we also need
+          to search the local symtable }
+        if (current_module.globalsymtable=srsymtable) and
+           assigned(current_module.localsymtable) then
+          begin
+            srsymtable:=current_module.localsymtable;
+            srsym:=tsym(srsymtable.find(symname));
+            if assigned(srsym) then
+              begin
+                result:=true;
+                exit;
+              end;
+          end;
+      end;
+
+
     function searchsym_in_class(classh,contextclassh:tobjectdef;const s : TIDString;out srsym:tsym;out srsymtable:TSymtable):boolean;
       var
         hashedid : THashedIDString;
@@ -1948,6 +1991,28 @@ implementation
       end;
 
 
+    function search_named_unit_globaltype(const unitname, typename: TIDString): ttypesym;
+      var
+        contextobjdef : tobjectdef;
+        stackitem  : psymtablestackitem;
+        srsymtable: tsymtable;
+        sym: tsym;
+      begin
+        if searchsym_in_named_module(unitname,typename,sym,srsymtable) and
+           (sym.typ=typesym) then
+          begin
+            result:=ttypesym(sym);
+            exit;
+          end
+        else
+          begin
+            cgmessage2(cg_f_unknown_type_in_unit,typename,unitname);
+            result:=nil;
+          end;
+      end;
+
+
+
     function search_class_member(pd : tobjectdef;const s : string):tsym;
     { searches n in symtable of pd and all anchestors }
       var

+ 6 - 0
compiler/systems.pas

@@ -403,6 +403,12 @@ interface
                          system_powerpc64_darwin,system_x86_64_darwin,
                          system_arm_darwin];
 
+       { systems supporting Objective-C }
+       system_objc_supported = systems_darwin;
+
+       { systems using the non-fragile Objective-C ABI }
+       system_objc_nfabi = [system_powerpc64_darwin,system_x86_64_darwin,system_arm_darwin];
+
        { all embedded systems }
        systems_embedded = [system_i386_embedded,system_m68k_embedded,
                            system_alpha_embedded,system_powerpc_embedded,

+ 8 - 0
compiler/tokens.pas

@@ -208,12 +208,14 @@ type
     _LOCATION,
     _MWPASCAL,
     _OPERATOR,
+    _OPTIONAL,
     _OVERLOAD,
     _OVERRIDE,
     _PLATFORM,
     _PROPERTY,
     _READONLY,
     _REGISTER,
+    _REQUIRED,
     _REQUIRES,
     _RESIDENT,
     _SAFECALL,
@@ -224,6 +226,7 @@ type
     _INTERFACE,
     _INTERRUPT,
     _NODEFAULT,
+    _OBJCCLASS,
     _OTHERWISE,
     _PROCEDURE,
     _PROTECTED,
@@ -247,6 +250,7 @@ type
     _EXPERIMENTAL,
     _FINALIZATION,
     _NOSTACKFRAME,
+    _OBJCPROTOCOL,
     _WEAKEXTERNAL,
     _DISPINTERFACE,
     _UNIMPLEMENTED,
@@ -464,12 +468,14 @@ const
       (str:'LOCATION'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'MWPASCAL'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'OPERATOR'      ;special:false;keyword:m_fpc;op:NOTOKEN),
+      (str:'OPTIONAL'      ;special:false;keyword:m_none;op:NOTOKEN), { optional methods in an Objective-C protocol }
       (str:'OVERLOAD'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'OVERRIDE'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'PLATFORM'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'PROPERTY'      ;special:false;keyword:m_property;op:NOTOKEN),
       (str:'READONLY'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'REGISTER'      ;special:false;keyword:m_none;op:NOTOKEN),
+      (str:'REQUIRED'      ;special:false;keyword:m_none;op:NOTOKEN), { required methods in an Objective-C protocol }
       (str:'REQUIRES'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'RESIDENT'      ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'SAFECALL'      ;special:false;keyword:m_none;op:NOTOKEN),
@@ -480,6 +486,7 @@ const
       (str:'INTERFACE'     ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'INTERRUPT'     ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'NODEFAULT'     ;special:false;keyword:m_none;op:NOTOKEN),
+      (str:'OBJCCLASS'     ;special:false;keyword:m_objectivec1;op:NOTOKEN),
       (str:'OTHERWISE'     ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'PROCEDURE'     ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'PROTECTED'     ;special:false;keyword:m_none;op:NOTOKEN),
@@ -503,6 +510,7 @@ const
       (str:'EXPERIMENTAL'  ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'FINALIZATION'  ;special:false;keyword:m_initfinal;op:NOTOKEN),
       (str:'NOSTACKFRAME'  ;special:false;keyword:m_none;op:NOTOKEN),
+      (str:'OBJCPROTOCOL'  ;special:false;keyword:m_objectivec1;op:NOTOKEN), { Objective-C protocol }
       (str:'WEAKEXTERNAL'  ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'DISPINTERFACE' ;special:false;keyword:m_class;op:NOTOKEN),
       (str:'UNIMPLEMENTED' ;special:false;keyword:m_all;op:NOTOKEN),

+ 23 - 7
compiler/utils/ppudump.pp

@@ -1128,8 +1128,12 @@ type
     po_dispid,
     { weakly linked (i.e., may or may not exist at run time) }
     po_weakexternal,
+    { Objective-C method }
     po_objc,
-    po_enumerator_movenext
+    { enumerator support }
+    po_enumerator_movenext,
+    { optional Objective-C protocol method }
+    po_optional
   );
   tprocoptions=set of tprocoption;
 
@@ -1215,7 +1219,8 @@ const
      (mask:po_dispid;          str:'DispId'),
      (mask:po_weakexternal;    str:'WeakExternal'),
      (mask:po_objc;            str:'ObjC'),
-     (mask:po_enumerator_movenext; str:'EnumeratorMoveNext')
+     (mask:po_enumerator_movenext; str:'EnumeratorMoveNext'),
+     (mask:po_optional;        str: 'Optional')
   );
 var
   proctypeoption  : tproctypeoption;
@@ -1380,7 +1385,9 @@ type
     oo_has_default_property,
     oo_has_valid_guid,
     oo_has_enumerator_movenext,
-    oo_has_enumerator_current
+    oo_has_enumerator_current,
+    oo_is_external,       { the class is externally implemented (objcclass, cppclass) }
+    oo_is_anonymous       { the class is only formally defined in this module (objcclass x = class; external;) }
   );
   tobjectoptions=set of tobjectoption;
   tsymopt=record
@@ -1406,8 +1413,9 @@ const
      (mask:oo_has_default_property;str:'HasDefaultProperty'),
      (mask:oo_has_valid_guid;     str:'HasValidGUID'),
      (mask:oo_has_enumerator_movenext; str:'HasEnumeratorMoveNext'),
-     (mask:oo_has_enumerator_current;  str:'HasEnumeratorCurrent')
-  );
+     (mask:oo_has_enumerator_current;  str:'HasEnumeratorCurrent'),
+     (mask:oo_is_external;        str:'External'),
+     (mask:oo_is_anonymous;       str:'Anonymous'));
 var
   symoptions : tobjectoptions;
   i      : longint;
@@ -1785,9 +1793,13 @@ type
     odt_class,
     odt_object,
     odt_interfacecom,
+    odt_interfacecom_property,
+    odt_interfacecom_function,
     odt_interfacecorba,
     odt_cppclass,
-    odt_dispinterface
+    odt_dispinterface,
+    odt_objcclass,
+    odt_objcprotocol
   );
   tvarianttype = (
     vt_normalvariant,vt_olevariant
@@ -1997,9 +2009,13 @@ begin
                odt_interfacecom   : writeln('interfacecom');
                odt_interfacecorba : writeln('interfacecorba');
                odt_cppclass       : writeln('cppclass');
+               odt_dispinterface  : writeln('dispinterface');
+               odt_objcclass      : writeln('objcclass');
+               odt_objcprotocol   : writeln('objcprotocol');
                else                 writeln('!! Warning: Invalid object type ',b);
              end;
              writeln(space,'    Name of Class : ',getstring);
+             writeln(space,'    External name : ',getstring);
              writeln(space,'         DataSize : ',getaint);
              writeln(space,'       FieldAlign : ',getbyte);
              writeln(space,'      RecordAlign : ',getbyte);
@@ -2027,7 +2043,7 @@ begin
                  writeln(space,'      Visibility: ',Visibility2Str(getbyte));
                end;
 
-             if tobjecttyp(b) in [odt_class,odt_interfacecorba] then
+             if tobjecttyp(b) in [odt_class,odt_interfacecorba,odt_objcclass,odt_objcprotocol] then
               begin
                 l:=getlongint;
                 writeln(space,'  Impl Intf Count : ',l);

+ 8 - 1
compiler/x86/agx86att.pas

@@ -117,7 +117,14 @@ interface
              owner.AsmWrite('-'+relsymbol.name);
            if ref.refaddr=addr_pic then
 {$ifdef x86_64}
-             owner.AsmWrite('@GOTPCREL');
+             begin
+               { local symbols don't have to (and in case of Mac OS X: cannot)
+                 be accessed via the GOT
+               }
+               if not assigned(ref.symbol) or
+                  (ref.symbol.bind<>AB_LOCAL) then
+                 owner.AsmWrite('@GOTPCREL');
+             end;
 {$else x86_64}
              owner.AsmWrite('@GOT');
 {$endif x86_64}

+ 20 - 0
compiler/x86/agx86int.pas

@@ -93,6 +93,15 @@ implementation
         '',
         '',
         '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
         ''
       );
 
@@ -130,6 +139,15 @@ implementation
         '',
         '',
         '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
+        '',
         ''
       );
 
@@ -705,6 +723,8 @@ implementation
              end;
            ait_symbol :
              begin
+               if tai_symbol(hp).has_value then
+                 internalerror(2009090802);
                if tai_symbol(hp).is_global then
                  AsmWriteLn(#9'PUBLIC'#9+tai_symbol(hp).sym.name);
                AsmWrite(tai_symbol(hp).sym.name);

+ 2 - 2
compiler/x86/cgx86.pas

@@ -486,7 +486,7 @@ unit cgx86;
              begin
                if (ref.symbol.bind in [AB_EXTERNAL,AB_WEAK_EXTERNAL]) or
                   ((cs_create_pic in current_settings.moduleswitches) and
-                   (ref.symbol.bind in [AB_COMMON,AB_GLOBAL])) then
+                   (ref.symbol.bind in [AB_COMMON,AB_GLOBAL,AB_PRIVATE_EXTERN])) then
                  begin
                    hreg:=g_indirect_sym_load(list,ref.symbol.name,ref.symbol.bind=AB_WEAK_EXTERNAL);
                    ref.symbol:=nil;
@@ -895,7 +895,7 @@ unit cgx86;
                       begin
                         if (ref.symbol.bind in [AB_EXTERNAL,AB_WEAK_EXTERNAL]) or
                            ((cs_create_pic in current_settings.moduleswitches) and
-                            (ref.symbol.bind in [AB_COMMON,AB_GLOBAL])) then
+                            (ref.symbol.bind in [AB_COMMON,AB_GLOBAL,AB_PRIVATE_EXTERN])) then
                           begin
                              reference_reset_base(tmpref,
                                g_indirect_sym_load(list,ref.symbol.name,ref.symbol.bind=AB_WEAK_EXTERNAL),

+ 1 - 0
compiler/x86_64/cpunode.pas

@@ -42,6 +42,7 @@ unit cpunode;
        ncgcal,
        ncgset,
        ncgopt,
+       ncgobjc,
        // n386con,n386flw,n386mat,n386mem,
        // n386set,n386inl,n386opt,
        { the cpu specific node units must be used after the generic ones to

+ 55 - 3
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/10/30]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/08/20]
 #
 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 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 graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
 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 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 graph univint cocoaint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
 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
@@ -2285,6 +2285,7 @@ TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
 TARGET_DIRS_GRAPH=1
 TARGET_DIRS_UNIVINT=1
+TARGET_DIRS_COCOAINT=1
 TARGET_DIRS_SDL=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
@@ -3113,6 +3114,7 @@ TARGET_DIRS_GMP=1
 TARGET_DIRS_FCL-EXTRA=1
 TARGET_DIRS_GRAPH=1
 TARGET_DIRS_UNIVINT=1
+TARGET_DIRS_COCOAINT=1
 TARGET_DIRS_SDL=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_X11=1
@@ -8461,6 +8463,51 @@ 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
@@ -8696,6 +8743,11 @@ 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

+ 8 - 2
packages/Makefile.fpc

@@ -27,8 +27,8 @@ dirs_freebsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc p
                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 sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
-dirs_powerpc_darwin=graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
+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
 dirs_arm_darwin= httpd13 httpd20 httpd22 opengles objcrtl
@@ -101,6 +101,12 @@ 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

+ 2263 - 0
packages/cocoaint/Makefile

@@ -0,0 +1,2263 @@
+#
+# 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
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifndef RUNBATCH
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=cocoaint
+override PACKAGE_VERSION=2.5.1
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_UNITS+=CocoaAll WebKit CoreData
+endif
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl univint
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_UNIVINT=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifdef REQUIRE_PACKAGES_UNIVINT
+PACKAGEDIR_UNIVINT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /univint/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_UNIVINT),)
+ifneq ($(wildcard $(PACKAGEDIR_UNIVINT)/units/$(TARGETSUFFIX)),)
+UNITDIR_UNIVINT=$(PACKAGEDIR_UNIVINT)/units/$(TARGETSUFFIX)
+else
+UNITDIR_UNIVINT=$(PACKAGEDIR_UNIVINT)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_UNIVINT)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_UNIVINT) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_UNIVINT)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_UNIVINT=
+UNITDIR_UNIVINT:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /univint/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_UNIVINT),)
+UNITDIR_UNIVINT:=$(firstword $(UNITDIR_UNIVINT))
+else
+UNITDIR_UNIVINT=
+endif
+endif
+ifdef UNITDIR_UNIVINT
+override COMPILER_UNITDIR+=$(UNITDIR_UNIVINT)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) $(ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+all: fpc_all
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+WebKit$(PPUEXT): CocoaAll$(PPUEXT)
+CoreData$(PPUEXT): CocoaAll$(PPUEXT)

+ 30 - 0
packages/cocoaint/Makefile.fpc

@@ -0,0 +1,30 @@
+#
+#   Makefile.fpc for Apple Universal Interfaces for Free Pascal
+#
+
+[package]
+name=cocoaint
+version=2.5.1
+
+[target]
+units=CocoaAll WebKit CoreData
+
+[libs]
+libversion=2.5.1
+
+[install]
+fpcpackage=y
+
+[compiler]
+sourcedir=src
+
+[default]
+fpcdir=../..
+
+[require]
+packages=univint
+
+[rules]
+WebKit$(PPUEXT): CocoaAll$(PPUEXT)
+
+CoreData$(PPUEXT): CocoaAll$(PPUEXT)

+ 101 - 0
packages/cocoaint/src/CocoaAll.pas

@@ -0,0 +1,101 @@
+unit CocoaAll;
+
+{$mode objfpc}
+{$modeswitch objectivec1}
+
+interface
+
+uses 
+  ctypes, MacOSAll;
+  
+{$linkframework Cocoa}
+{$define INTERFACE}
+
+{$include UndefinedTypes.inc}
+
+{$define HEADER}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef HEADER}
+
+{$define TYPES}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef TYPES}
+
+{$define RECORDS}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef RECORDS}
+
+type
+{$define FORWARD}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef FORWARD}
+
+{$include UndefinedClasses.inc}
+
+{$define CLASSES}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef CLASSES}
+ 
+{$define PROTOCOLS}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef PROTOCOLS}
+
+{$define FUNCTIONS}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef FUNCTIONS}
+
+{$define EXTERNAL_SYMBOLS}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef EXTERNAL_SYMBOLS}
+
+{$define USER_PATCHES}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef USER_PATCHES}
+
+{ Inline functions }
+function NSSTR (inString: PChar): NSString;
+function NSMakeRange (loc: NSUInteger; len: NSUInteger): NSRange;
+function NSMaxRange (range: NSRange): NSUInteger;
+function NSLocationInRange (loc: NSUInteger; range: NSRange): boolean;
+function NSEqualRanges (range1, range2: NSRange): boolean;
+function NSMakePoint (x: CGFloat; y: CGFloat): NSPoint;
+function NSMakeSize(w: CGFloat; h: CGFloat): NSSize;
+function NSMakeRect(x, y: CGFloat; w, h: CGFloat): NSRect;
+function NSMaxX (aRect: NSRect): CGFloat;
+function NSMaxY (aRect: NSRect): CGFloat;
+function NSMidX (aRect: NSRect): CGFloat;
+function NSMidY (aRect: NSRect): CGFloat;
+function NSMinX (aRect: NSRect): CGFloat;
+function NSMinY (aRect: NSRect): CGFloat;
+function NSWidth (aRect: NSRect): CGFloat;
+function NSHeight (aRect: NSRect): CGFloat;
+function NSRectFromCGRect (aRect: CGRect): NSRect;
+function NSRectToCGRect (aRect: NSRect): CGRect;
+function NSPointFromCGPoint (aPoint: CGPoint): NSPoint;
+function NSPointToCGPoint (aPoint: NSPoint): CGPoint;
+function NSSizeFromCGSize(aSize: CGSize): NSSize;
+function NSSizeToCGSize(aSize: NSSize): CGSize;
+
+{$undef INTERFACE}
+
+implementation
+{$define IMPLEMENTATION}
+
+{$include InlineFunctions.inc}
+
+{$define USER_PATCHES}
+{$include foundation/Foundation.inc}
+{$include appkit/AppKit.inc}
+{$undef USER_PATCHES}
+
+{$undef IMPLEMENTATION}
+end.

+ 60 - 0
packages/cocoaint/src/CoreData.pas

@@ -0,0 +1,60 @@
+{$mode objfpc}
+{$modeswitch objectivec1}
+unit CoreData;
+interface
+uses
+	ctypes, CocoaAll;
+{$linkframework Cocoa}	{ Cocoa is "umbrella" fremework, includes CoreData }
+{$define INTERFACE}
+
+{$define HEADER}
+{$include coredata/CoreData.inc}
+{$undef HEADER}
+
+{$define TYPES}
+{$include coredata/CoreData.inc}
+{$undef TYPES}
+
+{$define RECORDS}
+{$include coredata/CoreData.inc}
+{$undef RECORDS}
+
+type
+	{GK: ctypes don't define it... }
+	uintptr_t	= ptruint;
+{$define FORWARD}
+{$include coredata/CoreData.inc}
+{$undef FORWARD}
+
+{$define CLASSES}
+	{ Internal class in NSMigrationManager.h }
+	NSMigrationContext = id;
+{$include coredata/CoreData.inc}
+{$undef CLASSES}
+
+{$define PROTOCOLS}
+{$include coredata/CoreData.inc}
+{$undef PROTOCOLS}
+
+{$define FUNCTIONS}
+{$include coredata/CoreData.inc}
+{$undef FUNCTIONS}
+
+{$define EXTERNAL_SYMBOLS}
+{$include coredata/CoreData.inc}
+{$undef EXTERNAL_SYMBOLS}
+
+{$define USER_PATCHES}
+{$include coredata/CoreData.inc}
+{$undef USER_PATCHES}
+
+
+{$undef INTERFACE}
+
+implementation
+
+{$define IMPLEMENTATION}
+
+{$undef IMPLEMENTATION}
+
+end.

+ 83 - 0
packages/cocoaint/src/Foundation.pas

@@ -0,0 +1,83 @@
+unit Foundation;
+
+{$mode objfpc}
+{$modeswitch objectivec1}
+{$define NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES}
+
+interface
+
+uses 
+  ctypes, MacOSAll;
+  
+{$linkframework Foundation}
+
+{$include UndefinedTypes.inc}
+
+{$define HEADER}
+{$include foundation/Foundation.inc}
+{$undef HEADER}
+
+{$define TYPES}
+{$include foundation/Foundation.inc}
+{$undef TYPES}
+
+{$define RECORDS}
+{$include foundation/Foundation.inc}
+{$undef RECORDS}
+
+type
+{$define FORWARD}
+{$include foundation/Foundation.inc}
+{$undef FORWARD}
+
+{$include UndefinedClasses.inc}
+
+{$define CLASSES}
+{$include foundation/Foundation.inc}
+{$undef CLASSES}
+ 
+{$define PROTOCOLS}
+{$include foundation/Foundation.inc}
+{$undef PROTOCOLS}
+
+{$define FUNCTIONS}
+{$include foundation/Foundation.inc}
+{$undef FUNCTIONS}
+
+{$define EXTERNAL_SYMBOLS}
+{$include foundation/Foundation.inc}
+{$undef EXTERNAL_SYMBOLS}
+
+{$define USER_PATCHES}
+{$include foundation/Foundation.inc}
+{$undef USER_PATCHES}
+
+{ Inline functions }
+function NSSTR (inString: PChar): NSString;
+function NSMakeRange (loc: NSUInteger; len: NSUInteger): NSRange;
+function NSMaxRange (range: NSRange): NSUInteger;
+function NSLocationInRange (loc: NSUInteger; range: NSRange): boolean;
+function NSEqualRanges (range1, range2: NSRange): boolean;
+function NSMakePoint (x: CGFloat; y: CGFloat): NSPoint;
+function NSMakeSize(w: CGFloat; h: CGFloat): NSSize;
+function NSMakeRect(x, y: CGFloat; w, h: CGFloat): NSRect;
+function NSMaxX (aRect: NSRect): CGFloat;
+function NSMaxY (aRect: NSRect): CGFloat;
+function NSMidX (aRect: NSRect): CGFloat;
+function NSMidY (aRect: NSRect): CGFloat;
+function NSMinX (aRect: NSRect): CGFloat;
+function NSMinY (aRect: NSRect): CGFloat;
+function NSWidth (aRect: NSRect): CGFloat;
+function NSHeight (aRect: NSRect): CGFloat;
+function NSRectFromCGRect (aRect: CGRect): NSRect;
+function NSRectToCGRect (aRect: NSRect): CGRect;
+function NSPointFromCGPoint (aPoint: CGPoint): NSPoint;
+function NSPointToCGPoint (aPoint: NSPoint): CGPoint;
+function NSSizeFromCGSize(aSize: CGSize): NSSize;
+function NSSizeToCGSize(aSize: NSSize): CGSize;
+
+implementation
+
+{$include InlineFunctions.inc}
+
+end.

+ 3 - 0
packages/cocoaint/src/IBMacros.pp

@@ -0,0 +1,3 @@
+{$macro on}
+{$define IBOutlet := }
+{$define IBAction := }

+ 132 - 0
packages/cocoaint/src/InlineFunctions.inc

@@ -0,0 +1,132 @@
+
+function NSMakeRange (loc: NSUInteger; len: NSUInteger): NSRange;
+begin
+ result.location := loc;
+ result.length := len;
+end;
+
+function NSMaxRange (range: NSRange): NSUInteger;
+begin
+ result := range.location + range.length;
+end;
+
+function NSLocationInRange (loc: NSUInteger; range: NSRange): boolean;
+begin
+ if (loc <= range.location + range.length) and (loc >= range.location) then
+  result := true
+ else
+  result := false;
+end;
+
+function NSEqualRanges (range1, range2: NSRange): boolean;
+begin
+ if (range1.location = range2.location) and (range1.length = range2.length) then
+  result := true
+ else
+  result := false;
+end;
+
+function NSMakePoint (x: CGFloat; y: CGFloat): NSPoint;
+begin
+  result.y := y;
+  result.x := x;
+end;
+
+function NSMakeSize(w: CGFloat; h: CGFloat): NSSize;
+begin
+  result.width := w;
+  result.height := h;
+end;
+
+function NSMakeRect(x, y: CGFloat; w, h: CGFloat): NSRect;
+begin
+  result.origin.x := x;
+  result.origin.y := y;
+  result.size.width := w;
+  result.size.height := h;
+end;
+
+function NSMaxX (aRect: NSRect): CGFloat;
+begin
+  result := aRect.origin.x + aRect.size.width;
+end;
+
+function NSMaxY (aRect: NSRect): CGFloat;
+begin
+  result := aRect.origin.y + aRect.size.height;
+end;
+
+function NSMidX (aRect: NSRect): CGFloat;
+begin
+  result := (aRect.origin.x + aRect.size.width) * 0.5 ;
+end;
+
+function NSMidY (aRect: NSRect): CGFloat;
+begin
+  result := (aRect.origin.y + aRect.size.height) * 0.5 ;
+end;
+
+function NSMinX (aRect: NSRect): CGFloat;
+begin
+  result := aRect.origin.x;
+end;
+
+function NSMinY (aRect: NSRect): CGFloat;
+begin
+  result := aRect.origin.y;
+end;
+
+function NSWidth (aRect: NSRect): CGFloat;
+begin
+  result := aRect.size.width;
+end;
+
+function NSHeight (aRect: NSRect): CGFloat;
+begin
+  result := aRect.size.height;
+end;
+
+function NSRectFromCGRect (aRect: CGRect): NSRect;
+begin
+  result.origin.x := aRect.origin.x;
+  result.origin.y := aRect.origin.y;
+  result.size.width := aRect.size.width;
+  result.size.height := aRect.size.height;
+end;
+
+function NSRectToCGRect (aRect: NSRect): CGRect;
+begin
+  result.origin.x := aRect.origin.x;
+  result.origin.y := aRect.origin.y;
+  result.size.width := aRect.size.width;
+  result.size.height := aRect.size.height;
+end;
+
+function NSPointFromCGPoint (aPoint: CGPoint): NSPoint;
+begin
+  result.y := aPoint.y;
+  result.x := aPoint.x;
+end;
+
+function NSPointToCGPoint (aPoint: NSPoint): CGPoint;
+begin
+  result.y := aPoint.y;
+  result.x := aPoint.x;
+end;
+
+function NSSizeFromCGSize(aSize: CGSize): NSSize;
+begin
+  result.width := aSize.width;
+  result.height := aSize.height;
+end;
+
+function NSSizeToCGSize(aSize: NSSize): CGSize;
+begin
+  result.width := aSize.width;
+  result.height := aSize.height;
+end;
+
+function NSSTR (inString: PChar): NSString;
+begin
+  Result := NSString(CFSTR(inString));
+end;

+ 1938 - 0
packages/cocoaint/src/IvarSize.pas

@@ -0,0 +1,1938 @@
+{$mode objfpc}
+{$modeswitch objectivec1}
+program IvarSize;
+uses
+ objp,objcrtl,objcrtlmacosx;
+type
+ TDerivedNSAffineTransform = objcclass (NSAffineTransform)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAppleEventDescriptor = objcclass (NSAppleEventDescriptor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAppleEventManager = objcclass (NSAppleEventManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAppleScript = objcclass (NSAppleScript)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSArchiver = objcclass (NSArchiver)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSUnarchiver = objcclass (NSUnarchiver)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSArray = objcclass (NSArray)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableArray = objcclass (NSMutableArray)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAttributedString = objcclass (NSAttributedString)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableAttributedString = objcclass (NSMutableAttributedString)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAutoreleasePool = objcclass (NSAutoreleasePool)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBundle = objcclass (NSBundle)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCalendar = objcclass (NSCalendar)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDateComponents = objcclass (NSDateComponents)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCalendarDate = objcclass (NSCalendarDate)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCharacterSet = objcclass (NSCharacterSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableCharacterSet = objcclass (NSMutableCharacterSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSClassDescription = objcclass (NSClassDescription)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCoder = objcclass (NSCoder)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSComparisonPredicate = objcclass (NSComparisonPredicate)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCompoundPredicate = objcclass (NSCompoundPredicate)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSConnection = objcclass (NSConnection)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDistantObjectRequest = objcclass (NSDistantObjectRequest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSData = objcclass (NSData)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableData = objcclass (NSMutableData)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDate = objcclass (NSDate)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDateFormatter = objcclass (NSDateFormatter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDecimalNumber = objcclass (NSDecimalNumber)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDecimalNumberHandler = objcclass (NSDecimalNumberHandler)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDictionary = objcclass (NSDictionary)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableDictionary = objcclass (NSMutableDictionary)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDistantObject = objcclass (NSDistantObject)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDistributedLock = objcclass (NSDistributedLock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDistributedNotificationCenter = objcclass (NSDistributedNotificationCenter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSEnumerator = objcclass (NSEnumerator)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSError = objcclass (NSError)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSException = objcclass (NSException)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAssertionHandler = objcclass (NSAssertionHandler)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSExpression = objcclass (NSExpression)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFileHandle = objcclass (NSFileHandle)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPipe = objcclass (NSPipe)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFileManager = objcclass (NSFileManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDirectoryEnumerator = objcclass (NSDirectoryEnumerator)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFormatter = objcclass (NSFormatter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGarbageCollector = objcclass (NSGarbageCollector)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHashTable = objcclass (NSHashTable)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHost = objcclass (NSHost)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHTTPCookie = objcclass (NSHTTPCookie)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHTTPCookieStorage = objcclass (NSHTTPCookieStorage)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSIndexPath = objcclass (NSIndexPath)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSIndexSet = objcclass (NSIndexSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableIndexSet = objcclass (NSMutableIndexSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSKeyedArchiver = objcclass (NSKeyedArchiver)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSKeyedUnarchiver = objcclass (NSKeyedUnarchiver)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLocale = objcclass (NSLocale)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLock = objcclass (NSLock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSConditionLock = objcclass (NSConditionLock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRecursiveLock = objcclass (NSRecursiveLock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCondition = objcclass (NSCondition)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMapTable = objcclass (NSMapTable)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMetadataQuery = objcclass (NSMetadataQuery)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMetadataItem = objcclass (NSMetadataItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMetadataQueryAttributeValueTuple = objcclass (NSMetadataQueryAttributeValueTuple)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMetadataQueryResultGroup = objcclass (NSMetadataQueryResultGroup)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMethodSignature = objcclass (NSMethodSignature)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNetService = objcclass (NSNetService)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNetServiceBrowser = objcclass (NSNetServiceBrowser)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNotification = objcclass (NSNotification)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNotificationCenter = objcclass (NSNotificationCenter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNotificationQueue = objcclass (NSNotificationQueue)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNull = objcclass (NSNull)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNumberFormatter = objcclass (NSNumberFormatter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSObject = objcclass (NSObject)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOperation = objcclass (NSOperation)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSInvocationOperation = objcclass (NSInvocationOperation)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOperationQueue = objcclass (NSOperationQueue)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPointerArray = objcclass (NSPointerArray)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPort = objcclass (NSPort)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMachPort = objcclass (NSMachPort)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMessagePort = objcclass (NSMessagePort)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSocketPort = objcclass (NSSocketPort)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPortCoder = objcclass (NSPortCoder)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPortMessage = objcclass (NSPortMessage)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPortNameServer = objcclass (NSPortNameServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMachBootstrapServer = objcclass (NSMachBootstrapServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMessagePortNameServer = objcclass (NSMessagePortNameServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSocketPortNameServer = objcclass (NSSocketPortNameServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPredicate = objcclass (NSPredicate)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSProcessInfo = objcclass (NSProcessInfo)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPropertyListSerialization = objcclass (NSPropertyListSerialization)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSProtocolChecker = objcclass (NSProtocolChecker)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSProxy = objcclass (NSProxy)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRunLoop = objcclass (NSRunLoop)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScanner = objcclass (NSScanner)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptClassDescription = objcclass (NSScriptClassDescription)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptCoercionHandler = objcclass (NSScriptCoercionHandler)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptCommand = objcclass (NSScriptCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptCommandDescription = objcclass (NSScriptCommandDescription)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptExecutionContext = objcclass (NSScriptExecutionContext)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptObjectSpecifier = objcclass (NSScriptObjectSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSIndexSpecifier = objcclass (NSIndexSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMiddleSpecifier = objcclass (NSMiddleSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNameSpecifier = objcclass (NSNameSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPositionalSpecifier = objcclass (NSPositionalSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPropertySpecifier = objcclass (NSPropertySpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRandomSpecifier = objcclass (NSRandomSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRangeSpecifier = objcclass (NSRangeSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRelativeSpecifier = objcclass (NSRelativeSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSUniqueIDSpecifier = objcclass (NSUniqueIDSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSWhoseSpecifier = objcclass (NSWhoseSpecifier)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCloneCommand = objcclass (NSCloneCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCloseCommand = objcclass (NSCloseCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCountCommand = objcclass (NSCountCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCreateCommand = objcclass (NSCreateCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDeleteCommand = objcclass (NSDeleteCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSExistsCommand = objcclass (NSExistsCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGetCommand = objcclass (NSGetCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMoveCommand = objcclass (NSMoveCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSQuitCommand = objcclass (NSQuitCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSetCommand = objcclass (NSSetCommand)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptSuiteRegistry = objcclass (NSScriptSuiteRegistry)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScriptWhoseTest = objcclass (NSScriptWhoseTest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLogicalTest = objcclass (NSLogicalTest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSpecifierTest = objcclass (NSSpecifierTest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSet = objcclass (NSSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableSet = objcclass (NSMutableSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCountedSet = objcclass (NSCountedSet)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSortDescriptor = objcclass (NSSortDescriptor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSpellServer = objcclass (NSSpellServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSStream = objcclass (NSStream)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSInputStream = objcclass (NSInputStream)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOutputStream = objcclass (NSOutputStream)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSString = objcclass (NSString)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableString = objcclass (NSMutableString)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSimpleCString = objcclass (NSSimpleCString)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTask = objcclass (NSTask)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSThread = objcclass (NSThread)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTimer = objcclass (NSTimer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTimeZone = objcclass (NSTimeZone)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSUndoManager = objcclass (NSUndoManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURL = objcclass (NSURL)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLAuthenticationChallenge = objcclass (NSURLAuthenticationChallenge)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCachedURLResponse = objcclass (NSCachedURLResponse)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLCache = objcclass (NSURLCache)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLConnection = objcclass (NSURLConnection)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLCredential = objcclass (NSURLCredential)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLCredentialStorage = objcclass (NSURLCredentialStorage)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLDownload = objcclass (NSURLDownload)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLHandle = objcclass (NSURLHandle)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLProtectionSpace = objcclass (NSURLProtectionSpace)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLProtocol = objcclass (NSURLProtocol)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLRequest = objcclass (NSURLRequest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableURLRequest = objcclass (NSMutableURLRequest)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSURLResponse = objcclass (NSURLResponse)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHTTPURLResponse = objcclass (NSHTTPURLResponse)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSUserDefaults = objcclass (NSUserDefaults)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSValue = objcclass (NSValue)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNumber = objcclass (NSNumber)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSValueTransformer = objcclass (NSValueTransformer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLDocument = objcclass (NSXMLDocument)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLDTD = objcclass (NSXMLDTD)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLDTDNode = objcclass (NSXMLDTDNode)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLElement = objcclass (NSXMLElement)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLNode = objcclass (NSXMLNode)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSXMLParser = objcclass (NSXMLParser)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSActionCell = objcclass (NSActionCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAlert = objcclass (NSAlert)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAnimation = objcclass (NSAnimation)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSViewAnimation = objcclass (NSViewAnimation)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSAnimationContext = objcclass (NSAnimationContext)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSApplication = objcclass (NSApplication)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSArrayController = objcclass (NSArrayController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSATSTypesetter = objcclass (NSATSTypesetter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBezierPath = objcclass (NSBezierPath)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBitmapImageRep = objcclass (NSBitmapImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBox = objcclass (NSBox)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBrowser = objcclass (NSBrowser)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSBrowserCell = objcclass (NSBrowserCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSButton = objcclass (NSButton)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSButtonCell = objcclass (NSButtonCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCachedImageRep = objcclass (NSCachedImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCell = objcclass (NSCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCIImageRep = objcclass (NSCIImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSClipView = objcclass (NSClipView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCollectionViewItem = objcclass (NSCollectionViewItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCollectionView = objcclass (NSCollectionView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColor = objcclass (NSColor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColorList = objcclass (NSColorList)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColorPanel = objcclass (NSColorPanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColorPicker = objcclass (NSColorPicker)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColorSpace = objcclass (NSColorSpace)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSColorWell = objcclass (NSColorWell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSComboBox = objcclass (NSComboBox)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSComboBoxCell = objcclass (NSComboBoxCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSControl = objcclass (NSControl)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSController = objcclass (NSController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCursor = objcclass (NSCursor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSCustomImageRep = objcclass (NSCustomImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDatePicker = objcclass (NSDatePicker)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDatePickerCell = objcclass (NSDatePickerCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDictionaryController = objcclass (NSDictionaryController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDockTile = objcclass (NSDockTile)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDocument = objcclass (NSDocument)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDocumentController = objcclass (NSDocumentController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSDrawer = objcclass (NSDrawer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSEPSImageRep = objcclass (NSEPSImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSEvent = objcclass (NSEvent)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFileWrapper = objcclass (NSFileWrapper)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFont = objcclass (NSFont)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFontDescriptor = objcclass (NSFontDescriptor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFontManager = objcclass (NSFontManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFontPanel = objcclass (NSFontPanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSFormCell = objcclass (NSFormCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGlyphGenerator = objcclass (NSGlyphGenerator)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGlyphInfo = objcclass (NSGlyphInfo)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGradient = objcclass (NSGradient)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSGraphicsContext = objcclass (NSGraphicsContext)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSHelpManager = objcclass (NSHelpManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSImage = objcclass (NSImage)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSImageCell = objcclass (NSImageCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSImageRep = objcclass (NSImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSImageView = objcclass (NSImageView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSInputManager = objcclass (NSInputManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSInputServer = objcclass (NSInputServer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLayoutManager = objcclass (NSLayoutManager)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLevelIndicator = objcclass (NSLevelIndicator)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSLevelIndicatorCell = objcclass (NSLevelIndicatorCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMatrix = objcclass (NSMatrix)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMenu = objcclass (NSMenu)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMenuItem = objcclass (NSMenuItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMenuItemCell = objcclass (NSMenuItemCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMenuView = objcclass (NSMenuView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMovie = objcclass (NSMovie)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMovieView = objcclass (NSMovieView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSNib = objcclass (NSNib)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSObjectController = objcclass (NSObjectController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOpenGLPixelFormat = objcclass (NSOpenGLPixelFormat)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOpenGLPixelBuffer = objcclass (NSOpenGLPixelBuffer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOpenGLContext = objcclass (NSOpenGLContext)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOpenGLView = objcclass (NSOpenGLView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOpenPanel = objcclass (NSOpenPanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSOutlineView = objcclass (NSOutlineView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPageLayout = objcclass (NSPageLayout)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPanel = objcclass (NSPanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextTab = objcclass (NSTextTab)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSParagraphStyle = objcclass (NSParagraphStyle)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSMutableParagraphStyle = objcclass (NSMutableParagraphStyle)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPasteboard = objcclass (NSPasteboard)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPathCell = objcclass (NSPathCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPathComponentCell = objcclass (NSPathComponentCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPathControl = objcclass (NSPathControl)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPDFImageRep = objcclass (NSPDFImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPersistentDocument = objcclass (NSPersistentDocument)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPICTImageRep = objcclass (NSPICTImageRep)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPopUpButton = objcclass (NSPopUpButton)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPopUpButtonCell = objcclass (NSPopUpButtonCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPredicateEditor = objcclass (NSPredicateEditor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPrinter = objcclass (NSPrinter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPrintInfo = objcclass (NSPrintInfo)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPrintOperation = objcclass (NSPrintOperation)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSPrintPanel = objcclass (NSPrintPanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSProgressIndicator = objcclass (NSProgressIndicator)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSQuickDrawView = objcclass (NSQuickDrawView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSResponder = objcclass (NSResponder)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRuleEditor = objcclass (NSRuleEditor)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRulerMarker = objcclass (NSRulerMarker)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSRulerView = objcclass (NSRulerView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSavePanel = objcclass (NSSavePanel)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScreen = objcclass (NSScreen)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScroller = objcclass (NSScroller)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSScrollView = objcclass (NSScrollView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSearchField = objcclass (NSSearchField)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSearchFieldCell = objcclass (NSSearchFieldCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSecureTextField = objcclass (NSSecureTextField)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSecureTextFieldCell = objcclass (NSSecureTextFieldCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSegmentedControl = objcclass (NSSegmentedControl)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSShadow = objcclass (NSShadow)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSlider = objcclass (NSSlider)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSliderCell = objcclass (NSSliderCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSound = objcclass (NSSound)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSpeechRecognizer = objcclass (NSSpeechRecognizer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSpeechSynthesizer = objcclass (NSSpeechSynthesizer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSpellChecker = objcclass (NSSpellChecker)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSSplitView = objcclass (NSSplitView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSStatusBar = objcclass (NSStatusBar)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSStatusItem = objcclass (NSStatusItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSStepper = objcclass (NSStepper)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSStepperCell = objcclass (NSStepperCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTableColumn = objcclass (NSTableColumn)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTableHeaderCell = objcclass (NSTableHeaderCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTableHeaderView = objcclass (NSTableHeaderView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTableView = objcclass (NSTableView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTabView = objcclass (NSTabView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTabViewItem = objcclass (NSTabViewItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSText = objcclass (NSText)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextAttachmentCell = objcclass (NSTextAttachmentCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextAttachment = objcclass (NSTextAttachment)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextContainer = objcclass (NSTextContainer)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextField = objcclass (NSTextField)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextFieldCell = objcclass (NSTextFieldCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextList = objcclass (NSTextList)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextStorage = objcclass (NSTextStorage)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextBlock = objcclass (NSTextBlock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextTableBlock = objcclass (NSTextTableBlock)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextTable = objcclass (NSTextTable)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTextView = objcclass (NSTextView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTokenField = objcclass (NSTokenField)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTokenFieldCell = objcclass (NSTokenFieldCell)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSToolbar = objcclass (NSToolbar)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSToolbarItem = objcclass (NSToolbarItem)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSToolbarItemGroup = objcclass (NSToolbarItemGroup)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTrackingArea = objcclass (NSTrackingArea)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTreeController = objcclass (NSTreeController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTreeNode = objcclass (NSTreeNode)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSTypesetter = objcclass (NSTypesetter)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSUserDefaultsController = objcclass (NSUserDefaultsController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSView = objcclass (NSView)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSViewController = objcclass (NSViewController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSWindow = objcclass (NSWindow)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSWindowController = objcclass (NSWindowController)
+ extrabyte: byte;
+end;
+type
+ TDerivedNSWorkspace = objcclass (NSWorkspace)
+ extrabyte: byte;
+end;
+
+procedure PrintGlue1;
+begin
+ if class_getInstanceSize(TDerivedNSAffineTransform) <> (class_getInstanceSize(NSAffineTransform)+1) then
+ writeln('size of NSAffineTransform is wrong: ',class_getInstanceSize(TDerivedNSAffineTransform),' <> ',class_getInstanceSize(NSAffineTransform)+1);
+ if class_getInstanceSize(TDerivedNSAppleEventDescriptor) <> (class_getInstanceSize(NSAppleEventDescriptor)+1) then
+ writeln('size of NSAppleEventDescriptor is wrong: ',class_getInstanceSize(TDerivedNSAppleEventDescriptor),' <> ',class_getInstanceSize(NSAppleEventDescriptor)+1);
+ if class_getInstanceSize(TDerivedNSAppleEventManager) <> (class_getInstanceSize(NSAppleEventManager)+1) then
+ writeln('size of NSAppleEventManager is wrong: ',class_getInstanceSize(TDerivedNSAppleEventManager),' <> ',class_getInstanceSize(NSAppleEventManager)+1);
+ if class_getInstanceSize(TDerivedNSAppleScript) <> (class_getInstanceSize(NSAppleScript)+1) then
+ writeln('size of NSAppleScript is wrong: ',class_getInstanceSize(TDerivedNSAppleScript),' <> ',class_getInstanceSize(NSAppleScript)+1);
+ if class_getInstanceSize(TDerivedNSArchiver) <> (class_getInstanceSize(NSArchiver)+1) then
+ writeln('size of NSArchiver is wrong: ',class_getInstanceSize(TDerivedNSArchiver),' <> ',class_getInstanceSize(NSArchiver)+1);
+ if class_getInstanceSize(TDerivedNSUnarchiver) <> (class_getInstanceSize(NSUnarchiver)+1) then
+ writeln('size of NSUnarchiver is wrong: ',class_getInstanceSize(TDerivedNSUnarchiver),' <> ',class_getInstanceSize(NSUnarchiver)+1);
+ if class_getInstanceSize(TDerivedNSArray) <> (class_getInstanceSize(NSArray)+1) then
+ writeln('size of NSArray is wrong: ',class_getInstanceSize(TDerivedNSArray),' <> ',class_getInstanceSize(NSArray)+1);
+ if class_getInstanceSize(TDerivedNSMutableArray) <> (class_getInstanceSize(NSMutableArray)+1) then
+ writeln('size of NSMutableArray is wrong: ',class_getInstanceSize(TDerivedNSMutableArray),' <> ',class_getInstanceSize(NSMutableArray)+1);
+ if class_getInstanceSize(TDerivedNSAttributedString) <> (class_getInstanceSize(NSAttributedString)+1) then
+ writeln('size of NSAttributedString is wrong: ',class_getInstanceSize(TDerivedNSAttributedString),' <> ',class_getInstanceSize(NSAttributedString)+1);
+ if class_getInstanceSize(TDerivedNSMutableAttributedString) <> (class_getInstanceSize(NSMutableAttributedString)+1) then
+ writeln('size of NSMutableAttributedString is wrong: ',class_getInstanceSize(TDerivedNSMutableAttributedString),' <> ',class_getInstanceSize(NSMutableAttributedString)+1);
+ if class_getInstanceSize(TDerivedNSAutoreleasePool) <> (class_getInstanceSize(NSAutoreleasePool)+1) then
+ writeln('size of NSAutoreleasePool is wrong: ',class_getInstanceSize(TDerivedNSAutoreleasePool),' <> ',class_getInstanceSize(NSAutoreleasePool)+1);
+ if class_getInstanceSize(TDerivedNSBundle) <> (class_getInstanceSize(NSBundle)+1) then
+ writeln('size of NSBundle is wrong: ',class_getInstanceSize(TDerivedNSBundle),' <> ',class_getInstanceSize(NSBundle)+1);
+ if class_getInstanceSize(TDerivedNSCalendar) <> (class_getInstanceSize(NSCalendar)+1) then
+ writeln('size of NSCalendar is wrong: ',class_getInstanceSize(TDerivedNSCalendar),' <> ',class_getInstanceSize(NSCalendar)+1);
+ if class_getInstanceSize(TDerivedNSDateComponents) <> (class_getInstanceSize(NSDateComponents)+1) then
+ writeln('size of NSDateComponents is wrong: ',class_getInstanceSize(TDerivedNSDateComponents),' <> ',class_getInstanceSize(NSDateComponents)+1);
+ if class_getInstanceSize(TDerivedNSCalendarDate) <> (class_getInstanceSize(NSCalendarDate)+1) then
+ writeln('size of NSCalendarDate is wrong: ',class_getInstanceSize(TDerivedNSCalendarDate),' <> ',class_getInstanceSize(NSCalendarDate)+1);
+ if class_getInstanceSize(TDerivedNSCharacterSet) <> (class_getInstanceSize(NSCharacterSet)+1) then
+ writeln('size of NSCharacterSet is wrong: ',class_getInstanceSize(TDerivedNSCharacterSet),' <> ',class_getInstanceSize(NSCharacterSet)+1);
+ if class_getInstanceSize(TDerivedNSMutableCharacterSet) <> (class_getInstanceSize(NSMutableCharacterSet)+1) then
+ writeln('size of NSMutableCharacterSet is wrong: ',class_getInstanceSize(TDerivedNSMutableCharacterSet),' <> ',class_getInstanceSize(NSMutableCharacterSet)+1);
+ if class_getInstanceSize(TDerivedNSClassDescription) <> (class_getInstanceSize(NSClassDescription)+1) then
+ writeln('size of NSClassDescription is wrong: ',class_getInstanceSize(TDerivedNSClassDescription),' <> ',class_getInstanceSize(NSClassDescription)+1);
+ if class_getInstanceSize(TDerivedNSCoder) <> (class_getInstanceSize(NSCoder)+1) then
+ writeln('size of NSCoder is wrong: ',class_getInstanceSize(TDerivedNSCoder),' <> ',class_getInstanceSize(NSCoder)+1);
+ if class_getInstanceSize(TDerivedNSComparisonPredicate) <> (class_getInstanceSize(NSComparisonPredicate)+1) then
+ writeln('size of NSComparisonPredicate is wrong: ',class_getInstanceSize(TDerivedNSComparisonPredicate),' <> ',class_getInstanceSize(NSComparisonPredicate)+1);
+ if class_getInstanceSize(TDerivedNSCompoundPredicate) <> (class_getInstanceSize(NSCompoundPredicate)+1) then
+ writeln('size of NSCompoundPredicate is wrong: ',class_getInstanceSize(TDerivedNSCompoundPredicate),' <> ',class_getInstanceSize(NSCompoundPredicate)+1);
+ if class_getInstanceSize(TDerivedNSConnection) <> (class_getInstanceSize(NSConnection)+1) then
+ writeln('size of NSConnection is wrong: ',class_getInstanceSize(TDerivedNSConnection),' <> ',class_getInstanceSize(NSConnection)+1);
+ if class_getInstanceSize(TDerivedNSDistantObjectRequest) <> (class_getInstanceSize(NSDistantObjectRequest)+1) then
+ writeln('size of NSDistantObjectRequest is wrong: ',class_getInstanceSize(TDerivedNSDistantObjectRequest),' <> ',class_getInstanceSize(NSDistantObjectRequest)+1);
+ if class_getInstanceSize(TDerivedNSData) <> (class_getInstanceSize(NSData)+1) then
+ writeln('size of NSData is wrong: ',class_getInstanceSize(TDerivedNSData),' <> ',class_getInstanceSize(NSData)+1);
+ if class_getInstanceSize(TDerivedNSMutableData) <> (class_getInstanceSize(NSMutableData)+1) then
+ writeln('size of NSMutableData is wrong: ',class_getInstanceSize(TDerivedNSMutableData),' <> ',class_getInstanceSize(NSMutableData)+1);
+ if class_getInstanceSize(TDerivedNSDate) <> (class_getInstanceSize(NSDate)+1) then
+ writeln('size of NSDate is wrong: ',class_getInstanceSize(TDerivedNSDate),' <> ',class_getInstanceSize(NSDate)+1);
+ if class_getInstanceSize(TDerivedNSDateFormatter) <> (class_getInstanceSize(NSDateFormatter)+1) then
+ writeln('size of NSDateFormatter is wrong: ',class_getInstanceSize(TDerivedNSDateFormatter),' <> ',class_getInstanceSize(NSDateFormatter)+1);
+ if class_getInstanceSize(TDerivedNSDecimalNumber) <> (class_getInstanceSize(NSDecimalNumber)+1) then
+ writeln('size of NSDecimalNumber is wrong: ',class_getInstanceSize(TDerivedNSDecimalNumber),' <> ',class_getInstanceSize(NSDecimalNumber)+1);
+ if class_getInstanceSize(TDerivedNSDecimalNumberHandler) <> (class_getInstanceSize(NSDecimalNumberHandler)+1) then
+ writeln('size of NSDecimalNumberHandler is wrong: ',class_getInstanceSize(TDerivedNSDecimalNumberHandler),' <> ',class_getInstanceSize(NSDecimalNumberHandler)+1);
+ if class_getInstanceSize(TDerivedNSDictionary) <> (class_getInstanceSize(NSDictionary)+1) then
+ writeln('size of NSDictionary is wrong: ',class_getInstanceSize(TDerivedNSDictionary),' <> ',class_getInstanceSize(NSDictionary)+1);
+ if class_getInstanceSize(TDerivedNSMutableDictionary) <> (class_getInstanceSize(NSMutableDictionary)+1) then
+ writeln('size of NSMutableDictionary is wrong: ',class_getInstanceSize(TDerivedNSMutableDictionary),' <> ',class_getInstanceSize(NSMutableDictionary)+1);
+ if class_getInstanceSize(TDerivedNSDistantObject) <> (class_getInstanceSize(NSDistantObject)+1) then
+ writeln('size of NSDistantObject is wrong: ',class_getInstanceSize(TDerivedNSDistantObject),' <> ',class_getInstanceSize(NSDistantObject)+1);
+ if class_getInstanceSize(TDerivedNSDistributedLock) <> (class_getInstanceSize(NSDistributedLock)+1) then
+ writeln('size of NSDistributedLock is wrong: ',class_getInstanceSize(TDerivedNSDistributedLock),' <> ',class_getInstanceSize(NSDistributedLock)+1);
+ if class_getInstanceSize(TDerivedNSDistributedNotificationCenter) <> (class_getInstanceSize(NSDistributedNotificationCenter)+1) then
+ writeln('size of NSDistributedNotificationCenter is wrong: ',class_getInstanceSize(TDerivedNSDistributedNotificationCenter),' <> ',class_getInstanceSize(NSDistributedNotificationCenter)+1);
+ if class_getInstanceSize(TDerivedNSEnumerator) <> (class_getInstanceSize(NSEnumerator)+1) then
+ writeln('size of NSEnumerator is wrong: ',class_getInstanceSize(TDerivedNSEnumerator),' <> ',class_getInstanceSize(NSEnumerator)+1);
+ if class_getInstanceSize(TDerivedNSError) <> (class_getInstanceSize(NSError)+1) then
+ writeln('size of NSError is wrong: ',class_getInstanceSize(TDerivedNSError),' <> ',class_getInstanceSize(NSError)+1);
+ if class_getInstanceSize(TDerivedNSException) <> (class_getInstanceSize(NSException)+1) then
+ writeln('size of NSException is wrong: ',class_getInstanceSize(TDerivedNSException),' <> ',class_getInstanceSize(NSException)+1);
+ if class_getInstanceSize(TDerivedNSAssertionHandler) <> (class_getInstanceSize(NSAssertionHandler)+1) then
+ writeln('size of NSAssertionHandler is wrong: ',class_getInstanceSize(TDerivedNSAssertionHandler),' <> ',class_getInstanceSize(NSAssertionHandler)+1);
+ if class_getInstanceSize(TDerivedNSExpression) <> (class_getInstanceSize(NSExpression)+1) then
+ writeln('size of NSExpression is wrong: ',class_getInstanceSize(TDerivedNSExpression),' <> ',class_getInstanceSize(NSExpression)+1);
+ if class_getInstanceSize(TDerivedNSFileHandle) <> (class_getInstanceSize(NSFileHandle)+1) then
+ writeln('size of NSFileHandle is wrong: ',class_getInstanceSize(TDerivedNSFileHandle),' <> ',class_getInstanceSize(NSFileHandle)+1);
+ if class_getInstanceSize(TDerivedNSPipe) <> (class_getInstanceSize(NSPipe)+1) then
+ writeln('size of NSPipe is wrong: ',class_getInstanceSize(TDerivedNSPipe),' <> ',class_getInstanceSize(NSPipe)+1);
+ if class_getInstanceSize(TDerivedNSFileManager) <> (class_getInstanceSize(NSFileManager)+1) then
+ writeln('size of NSFileManager is wrong: ',class_getInstanceSize(TDerivedNSFileManager),' <> ',class_getInstanceSize(NSFileManager)+1);
+ if class_getInstanceSize(TDerivedNSDirectoryEnumerator) <> (class_getInstanceSize(NSDirectoryEnumerator)+1) then
+ writeln('size of NSDirectoryEnumerator is wrong: ',class_getInstanceSize(TDerivedNSDirectoryEnumerator),' <> ',class_getInstanceSize(NSDirectoryEnumerator)+1);
+ if class_getInstanceSize(TDerivedNSFormatter) <> (class_getInstanceSize(NSFormatter)+1) then
+ writeln('size of NSFormatter is wrong: ',class_getInstanceSize(TDerivedNSFormatter),' <> ',class_getInstanceSize(NSFormatter)+1);
+ if class_getInstanceSize(TDerivedNSGarbageCollector) <> (class_getInstanceSize(NSGarbageCollector)+1) then
+ writeln('size of NSGarbageCollector is wrong: ',class_getInstanceSize(TDerivedNSGarbageCollector),' <> ',class_getInstanceSize(NSGarbageCollector)+1);
+ if class_getInstanceSize(TDerivedNSHashTable) <> (class_getInstanceSize(NSHashTable)+1) then
+ writeln('size of NSHashTable is wrong: ',class_getInstanceSize(TDerivedNSHashTable),' <> ',class_getInstanceSize(NSHashTable)+1);
+ if class_getInstanceSize(TDerivedNSHost) <> (class_getInstanceSize(NSHost)+1) then
+ writeln('size of NSHost is wrong: ',class_getInstanceSize(TDerivedNSHost),' <> ',class_getInstanceSize(NSHost)+1);
+ if class_getInstanceSize(TDerivedNSHTTPCookie) <> (class_getInstanceSize(NSHTTPCookie)+1) then
+ writeln('size of NSHTTPCookie is wrong: ',class_getInstanceSize(TDerivedNSHTTPCookie),' <> ',class_getInstanceSize(NSHTTPCookie)+1);
+ if class_getInstanceSize(TDerivedNSHTTPCookieStorage) <> (class_getInstanceSize(NSHTTPCookieStorage)+1) then
+ writeln('size of NSHTTPCookieStorage is wrong: ',class_getInstanceSize(TDerivedNSHTTPCookieStorage),' <> ',class_getInstanceSize(NSHTTPCookieStorage)+1);
+ if class_getInstanceSize(TDerivedNSIndexPath) <> (class_getInstanceSize(NSIndexPath)+1) then
+ writeln('size of NSIndexPath is wrong: ',class_getInstanceSize(TDerivedNSIndexPath),' <> ',class_getInstanceSize(NSIndexPath)+1);
+ if class_getInstanceSize(TDerivedNSIndexSet) <> (class_getInstanceSize(NSIndexSet)+1) then
+ writeln('size of NSIndexSet is wrong: ',class_getInstanceSize(TDerivedNSIndexSet),' <> ',class_getInstanceSize(NSIndexSet)+1);
+ if class_getInstanceSize(TDerivedNSMutableIndexSet) <> (class_getInstanceSize(NSMutableIndexSet)+1) then
+ writeln('size of NSMutableIndexSet is wrong: ',class_getInstanceSize(TDerivedNSMutableIndexSet),' <> ',class_getInstanceSize(NSMutableIndexSet)+1);
+ if class_getInstanceSize(TDerivedNSKeyedArchiver) <> (class_getInstanceSize(NSKeyedArchiver)+1) then
+ writeln('size of NSKeyedArchiver is wrong: ',class_getInstanceSize(TDerivedNSKeyedArchiver),' <> ',class_getInstanceSize(NSKeyedArchiver)+1);
+ if class_getInstanceSize(TDerivedNSKeyedUnarchiver) <> (class_getInstanceSize(NSKeyedUnarchiver)+1) then
+ writeln('size of NSKeyedUnarchiver is wrong: ',class_getInstanceSize(TDerivedNSKeyedUnarchiver),' <> ',class_getInstanceSize(NSKeyedUnarchiver)+1);
+ if class_getInstanceSize(TDerivedNSLocale) <> (class_getInstanceSize(NSLocale)+1) then
+ writeln('size of NSLocale is wrong: ',class_getInstanceSize(TDerivedNSLocale),' <> ',class_getInstanceSize(NSLocale)+1);
+ if class_getInstanceSize(TDerivedNSLock) <> (class_getInstanceSize(NSLock)+1) then
+ writeln('size of NSLock is wrong: ',class_getInstanceSize(TDerivedNSLock),' <> ',class_getInstanceSize(NSLock)+1);
+ if class_getInstanceSize(TDerivedNSConditionLock) <> (class_getInstanceSize(NSConditionLock)+1) then
+ writeln('size of NSConditionLock is wrong: ',class_getInstanceSize(TDerivedNSConditionLock),' <> ',class_getInstanceSize(NSConditionLock)+1);
+ if class_getInstanceSize(TDerivedNSRecursiveLock) <> (class_getInstanceSize(NSRecursiveLock)+1) then
+ writeln('size of NSRecursiveLock is wrong: ',class_getInstanceSize(TDerivedNSRecursiveLock),' <> ',class_getInstanceSize(NSRecursiveLock)+1);
+ if class_getInstanceSize(TDerivedNSCondition) <> (class_getInstanceSize(NSCondition)+1) then
+ writeln('size of NSCondition is wrong: ',class_getInstanceSize(TDerivedNSCondition),' <> ',class_getInstanceSize(NSCondition)+1);
+ if class_getInstanceSize(TDerivedNSMapTable) <> (class_getInstanceSize(NSMapTable)+1) then
+ writeln('size of NSMapTable is wrong: ',class_getInstanceSize(TDerivedNSMapTable),' <> ',class_getInstanceSize(NSMapTable)+1);
+ if class_getInstanceSize(TDerivedNSMetadataQuery) <> (class_getInstanceSize(NSMetadataQuery)+1) then
+ writeln('size of NSMetadataQuery is wrong: ',class_getInstanceSize(TDerivedNSMetadataQuery),' <> ',class_getInstanceSize(NSMetadataQuery)+1);
+ if class_getInstanceSize(TDerivedNSMetadataItem) <> (class_getInstanceSize(NSMetadataItem)+1) then
+ writeln('size of NSMetadataItem is wrong: ',class_getInstanceSize(TDerivedNSMetadataItem),' <> ',class_getInstanceSize(NSMetadataItem)+1);
+ if class_getInstanceSize(TDerivedNSMetadataQueryAttributeValueTuple) <> (class_getInstanceSize(NSMetadataQueryAttributeValueTuple)+1) then
+ writeln('size of NSMetadataQueryAttributeValueTuple is wrong: ',class_getInstanceSize(TDerivedNSMetadataQueryAttributeValueTuple),' <> ',class_getInstanceSize(NSMetadataQueryAttributeValueTuple)+1);
+ if class_getInstanceSize(TDerivedNSMetadataQueryResultGroup) <> (class_getInstanceSize(NSMetadataQueryResultGroup)+1) then
+ writeln('size of NSMetadataQueryResultGroup is wrong: ',class_getInstanceSize(TDerivedNSMetadataQueryResultGroup),' <> ',class_getInstanceSize(NSMetadataQueryResultGroup)+1);
+ if class_getInstanceSize(TDerivedNSMethodSignature) <> (class_getInstanceSize(NSMethodSignature)+1) then
+ writeln('size of NSMethodSignature is wrong: ',class_getInstanceSize(TDerivedNSMethodSignature),' <> ',class_getInstanceSize(NSMethodSignature)+1);
+ if class_getInstanceSize(TDerivedNSNetService) <> (class_getInstanceSize(NSNetService)+1) then
+ writeln('size of NSNetService is wrong: ',class_getInstanceSize(TDerivedNSNetService),' <> ',class_getInstanceSize(NSNetService)+1);
+ if class_getInstanceSize(TDerivedNSNetServiceBrowser) <> (class_getInstanceSize(NSNetServiceBrowser)+1) then
+ writeln('size of NSNetServiceBrowser is wrong: ',class_getInstanceSize(TDerivedNSNetServiceBrowser),' <> ',class_getInstanceSize(NSNetServiceBrowser)+1);
+ if class_getInstanceSize(TDerivedNSNotification) <> (class_getInstanceSize(NSNotification)+1) then
+ writeln('size of NSNotification is wrong: ',class_getInstanceSize(TDerivedNSNotification),' <> ',class_getInstanceSize(NSNotification)+1);
+ if class_getInstanceSize(TDerivedNSNotificationCenter) <> (class_getInstanceSize(NSNotificationCenter)+1) then
+ writeln('size of NSNotificationCenter is wrong: ',class_getInstanceSize(TDerivedNSNotificationCenter),' <> ',class_getInstanceSize(NSNotificationCenter)+1);
+ if class_getInstanceSize(TDerivedNSNotificationQueue) <> (class_getInstanceSize(NSNotificationQueue)+1) then
+ writeln('size of NSNotificationQueue is wrong: ',class_getInstanceSize(TDerivedNSNotificationQueue),' <> ',class_getInstanceSize(NSNotificationQueue)+1);
+ if class_getInstanceSize(TDerivedNSNull) <> (class_getInstanceSize(NSNull)+1) then
+ writeln('size of NSNull is wrong: ',class_getInstanceSize(TDerivedNSNull),' <> ',class_getInstanceSize(NSNull)+1);
+ if class_getInstanceSize(TDerivedNSNumberFormatter) <> (class_getInstanceSize(NSNumberFormatter)+1) then
+ writeln('size of NSNumberFormatter is wrong: ',class_getInstanceSize(TDerivedNSNumberFormatter),' <> ',class_getInstanceSize(NSNumberFormatter)+1);
+ if class_getInstanceSize(TDerivedNSObject) <> (class_getInstanceSize(NSObject)+1) then
+ writeln('size of NSObject is wrong: ',class_getInstanceSize(TDerivedNSObject),' <> ',class_getInstanceSize(NSObject)+1);
+ if class_getInstanceSize(TDerivedNSOperation) <> (class_getInstanceSize(NSOperation)+1) then
+ writeln('size of NSOperation is wrong: ',class_getInstanceSize(TDerivedNSOperation),' <> ',class_getInstanceSize(NSOperation)+1);
+ if class_getInstanceSize(TDerivedNSInvocationOperation) <> (class_getInstanceSize(NSInvocationOperation)+1) then
+ writeln('size of NSInvocationOperation is wrong: ',class_getInstanceSize(TDerivedNSInvocationOperation),' <> ',class_getInstanceSize(NSInvocationOperation)+1);
+ if class_getInstanceSize(TDerivedNSOperationQueue) <> (class_getInstanceSize(NSOperationQueue)+1) then
+ writeln('size of NSOperationQueue is wrong: ',class_getInstanceSize(TDerivedNSOperationQueue),' <> ',class_getInstanceSize(NSOperationQueue)+1);
+ if class_getInstanceSize(TDerivedNSPointerArray) <> (class_getInstanceSize(NSPointerArray)+1) then
+ writeln('size of NSPointerArray is wrong: ',class_getInstanceSize(TDerivedNSPointerArray),' <> ',class_getInstanceSize(NSPointerArray)+1);
+ if class_getInstanceSize(TDerivedNSPort) <> (class_getInstanceSize(NSPort)+1) then
+ writeln('size of NSPort is wrong: ',class_getInstanceSize(TDerivedNSPort),' <> ',class_getInstanceSize(NSPort)+1);
+ if class_getInstanceSize(TDerivedNSMachPort) <> (class_getInstanceSize(NSMachPort)+1) then
+ writeln('size of NSMachPort is wrong: ',class_getInstanceSize(TDerivedNSMachPort),' <> ',class_getInstanceSize(NSMachPort)+1);
+ if class_getInstanceSize(TDerivedNSMessagePort) <> (class_getInstanceSize(NSMessagePort)+1) then
+ writeln('size of NSMessagePort is wrong: ',class_getInstanceSize(TDerivedNSMessagePort),' <> ',class_getInstanceSize(NSMessagePort)+1);
+ if class_getInstanceSize(TDerivedNSSocketPort) <> (class_getInstanceSize(NSSocketPort)+1) then
+ writeln('size of NSSocketPort is wrong: ',class_getInstanceSize(TDerivedNSSocketPort),' <> ',class_getInstanceSize(NSSocketPort)+1);
+ if class_getInstanceSize(TDerivedNSPortCoder) <> (class_getInstanceSize(NSPortCoder)+1) then
+ writeln('size of NSPortCoder is wrong: ',class_getInstanceSize(TDerivedNSPortCoder),' <> ',class_getInstanceSize(NSPortCoder)+1);
+ if class_getInstanceSize(TDerivedNSPortMessage) <> (class_getInstanceSize(NSPortMessage)+1) then
+ writeln('size of NSPortMessage is wrong: ',class_getInstanceSize(TDerivedNSPortMessage),' <> ',class_getInstanceSize(NSPortMessage)+1);
+ if class_getInstanceSize(TDerivedNSPortNameServer) <> (class_getInstanceSize(NSPortNameServer)+1) then
+ writeln('size of NSPortNameServer is wrong: ',class_getInstanceSize(TDerivedNSPortNameServer),' <> ',class_getInstanceSize(NSPortNameServer)+1);
+ if class_getInstanceSize(TDerivedNSMachBootstrapServer) <> (class_getInstanceSize(NSMachBootstrapServer)+1) then
+ writeln('size of NSMachBootstrapServer is wrong: ',class_getInstanceSize(TDerivedNSMachBootstrapServer),' <> ',class_getInstanceSize(NSMachBootstrapServer)+1);
+ if class_getInstanceSize(TDerivedNSMessagePortNameServer) <> (class_getInstanceSize(NSMessagePortNameServer)+1) then
+ writeln('size of NSMessagePortNameServer is wrong: ',class_getInstanceSize(TDerivedNSMessagePortNameServer),' <> ',class_getInstanceSize(NSMessagePortNameServer)+1);
+ if class_getInstanceSize(TDerivedNSSocketPortNameServer) <> (class_getInstanceSize(NSSocketPortNameServer)+1) then
+ writeln('size of NSSocketPortNameServer is wrong: ',class_getInstanceSize(TDerivedNSSocketPortNameServer),' <> ',class_getInstanceSize(NSSocketPortNameServer)+1);
+ if class_getInstanceSize(TDerivedNSPredicate) <> (class_getInstanceSize(NSPredicate)+1) then
+ writeln('size of NSPredicate is wrong: ',class_getInstanceSize(TDerivedNSPredicate),' <> ',class_getInstanceSize(NSPredicate)+1);
+ if class_getInstanceSize(TDerivedNSProcessInfo) <> (class_getInstanceSize(NSProcessInfo)+1) then
+ writeln('size of NSProcessInfo is wrong: ',class_getInstanceSize(TDerivedNSProcessInfo),' <> ',class_getInstanceSize(NSProcessInfo)+1);
+ if class_getInstanceSize(TDerivedNSPropertyListSerialization) <> (class_getInstanceSize(NSPropertyListSerialization)+1) then
+ writeln('size of NSPropertyListSerialization is wrong: ',class_getInstanceSize(TDerivedNSPropertyListSerialization),' <> ',class_getInstanceSize(NSPropertyListSerialization)+1);
+ if class_getInstanceSize(TDerivedNSProtocolChecker) <> (class_getInstanceSize(NSProtocolChecker)+1) then
+ writeln('size of NSProtocolChecker is wrong: ',class_getInstanceSize(TDerivedNSProtocolChecker),' <> ',class_getInstanceSize(NSProtocolChecker)+1);
+ if class_getInstanceSize(TDerivedNSProxy) <> (class_getInstanceSize(NSProxy)+1) then
+ writeln('size of NSProxy is wrong: ',class_getInstanceSize(TDerivedNSProxy),' <> ',class_getInstanceSize(NSProxy)+1);
+ if class_getInstanceSize(TDerivedNSRunLoop) <> (class_getInstanceSize(NSRunLoop)+1) then
+ writeln('size of NSRunLoop is wrong: ',class_getInstanceSize(TDerivedNSRunLoop),' <> ',class_getInstanceSize(NSRunLoop)+1);
+ if class_getInstanceSize(TDerivedNSScanner) <> (class_getInstanceSize(NSScanner)+1) then
+ writeln('size of NSScanner is wrong: ',class_getInstanceSize(TDerivedNSScanner),' <> ',class_getInstanceSize(NSScanner)+1);
+ if class_getInstanceSize(TDerivedNSScriptClassDescription) <> (class_getInstanceSize(NSScriptClassDescription)+1) then
+ writeln('size of NSScriptClassDescription is wrong: ',class_getInstanceSize(TDerivedNSScriptClassDescription),' <> ',class_getInstanceSize(NSScriptClassDescription)+1);
+ if class_getInstanceSize(TDerivedNSScriptCoercionHandler) <> (class_getInstanceSize(NSScriptCoercionHandler)+1) then
+ writeln('size of NSScriptCoercionHandler is wrong: ',class_getInstanceSize(TDerivedNSScriptCoercionHandler),' <> ',class_getInstanceSize(NSScriptCoercionHandler)+1);
+ if class_getInstanceSize(TDerivedNSScriptCommand) <> (class_getInstanceSize(NSScriptCommand)+1) then
+ writeln('size of NSScriptCommand is wrong: ',class_getInstanceSize(TDerivedNSScriptCommand),' <> ',class_getInstanceSize(NSScriptCommand)+1);
+ if class_getInstanceSize(TDerivedNSScriptCommandDescription) <> (class_getInstanceSize(NSScriptCommandDescription)+1) then
+ writeln('size of NSScriptCommandDescription is wrong: ',class_getInstanceSize(TDerivedNSScriptCommandDescription),' <> ',class_getInstanceSize(NSScriptCommandDescription)+1);
+ if class_getInstanceSize(TDerivedNSScriptExecutionContext) <> (class_getInstanceSize(NSScriptExecutionContext)+1) then
+ writeln('size of NSScriptExecutionContext is wrong: ',class_getInstanceSize(TDerivedNSScriptExecutionContext),' <> ',class_getInstanceSize(NSScriptExecutionContext)+1);
+ if class_getInstanceSize(TDerivedNSScriptObjectSpecifier) <> (class_getInstanceSize(NSScriptObjectSpecifier)+1) then
+ writeln('size of NSScriptObjectSpecifier is wrong: ',class_getInstanceSize(TDerivedNSScriptObjectSpecifier),' <> ',class_getInstanceSize(NSScriptObjectSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSIndexSpecifier) <> (class_getInstanceSize(NSIndexSpecifier)+1) then
+ writeln('size of NSIndexSpecifier is wrong: ',class_getInstanceSize(TDerivedNSIndexSpecifier),' <> ',class_getInstanceSize(NSIndexSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSMiddleSpecifier) <> (class_getInstanceSize(NSMiddleSpecifier)+1) then
+ writeln('size of NSMiddleSpecifier is wrong: ',class_getInstanceSize(TDerivedNSMiddleSpecifier),' <> ',class_getInstanceSize(NSMiddleSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSNameSpecifier) <> (class_getInstanceSize(NSNameSpecifier)+1) then
+ writeln('size of NSNameSpecifier is wrong: ',class_getInstanceSize(TDerivedNSNameSpecifier),' <> ',class_getInstanceSize(NSNameSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSPositionalSpecifier) <> (class_getInstanceSize(NSPositionalSpecifier)+1) then
+ writeln('size of NSPositionalSpecifier is wrong: ',class_getInstanceSize(TDerivedNSPositionalSpecifier),' <> ',class_getInstanceSize(NSPositionalSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSPropertySpecifier) <> (class_getInstanceSize(NSPropertySpecifier)+1) then
+ writeln('size of NSPropertySpecifier is wrong: ',class_getInstanceSize(TDerivedNSPropertySpecifier),' <> ',class_getInstanceSize(NSPropertySpecifier)+1);
+ if class_getInstanceSize(TDerivedNSRandomSpecifier) <> (class_getInstanceSize(NSRandomSpecifier)+1) then
+ writeln('size of NSRandomSpecifier is wrong: ',class_getInstanceSize(TDerivedNSRandomSpecifier),' <> ',class_getInstanceSize(NSRandomSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSRangeSpecifier) <> (class_getInstanceSize(NSRangeSpecifier)+1) then
+ writeln('size of NSRangeSpecifier is wrong: ',class_getInstanceSize(TDerivedNSRangeSpecifier),' <> ',class_getInstanceSize(NSRangeSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSRelativeSpecifier) <> (class_getInstanceSize(NSRelativeSpecifier)+1) then
+ writeln('size of NSRelativeSpecifier is wrong: ',class_getInstanceSize(TDerivedNSRelativeSpecifier),' <> ',class_getInstanceSize(NSRelativeSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSUniqueIDSpecifier) <> (class_getInstanceSize(NSUniqueIDSpecifier)+1) then
+ writeln('size of NSUniqueIDSpecifier is wrong: ',class_getInstanceSize(TDerivedNSUniqueIDSpecifier),' <> ',class_getInstanceSize(NSUniqueIDSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSWhoseSpecifier) <> (class_getInstanceSize(NSWhoseSpecifier)+1) then
+ writeln('size of NSWhoseSpecifier is wrong: ',class_getInstanceSize(TDerivedNSWhoseSpecifier),' <> ',class_getInstanceSize(NSWhoseSpecifier)+1);
+ if class_getInstanceSize(TDerivedNSCloneCommand) <> (class_getInstanceSize(NSCloneCommand)+1) then
+ writeln('size of NSCloneCommand is wrong: ',class_getInstanceSize(TDerivedNSCloneCommand),' <> ',class_getInstanceSize(NSCloneCommand)+1);
+ if class_getInstanceSize(TDerivedNSCloseCommand) <> (class_getInstanceSize(NSCloseCommand)+1) then
+ writeln('size of NSCloseCommand is wrong: ',class_getInstanceSize(TDerivedNSCloseCommand),' <> ',class_getInstanceSize(NSCloseCommand)+1);
+ if class_getInstanceSize(TDerivedNSCountCommand) <> (class_getInstanceSize(NSCountCommand)+1) then
+ writeln('size of NSCountCommand is wrong: ',class_getInstanceSize(TDerivedNSCountCommand),' <> ',class_getInstanceSize(NSCountCommand)+1);
+ if class_getInstanceSize(TDerivedNSCreateCommand) <> (class_getInstanceSize(NSCreateCommand)+1) then
+ writeln('size of NSCreateCommand is wrong: ',class_getInstanceSize(TDerivedNSCreateCommand),' <> ',class_getInstanceSize(NSCreateCommand)+1);
+ if class_getInstanceSize(TDerivedNSDeleteCommand) <> (class_getInstanceSize(NSDeleteCommand)+1) then
+ writeln('size of NSDeleteCommand is wrong: ',class_getInstanceSize(TDerivedNSDeleteCommand),' <> ',class_getInstanceSize(NSDeleteCommand)+1);
+ if class_getInstanceSize(TDerivedNSExistsCommand) <> (class_getInstanceSize(NSExistsCommand)+1) then
+ writeln('size of NSExistsCommand is wrong: ',class_getInstanceSize(TDerivedNSExistsCommand),' <> ',class_getInstanceSize(NSExistsCommand)+1);
+ if class_getInstanceSize(TDerivedNSGetCommand) <> (class_getInstanceSize(NSGetCommand)+1) then
+ writeln('size of NSGetCommand is wrong: ',class_getInstanceSize(TDerivedNSGetCommand),' <> ',class_getInstanceSize(NSGetCommand)+1);
+ if class_getInstanceSize(TDerivedNSMoveCommand) <> (class_getInstanceSize(NSMoveCommand)+1) then
+ writeln('size of NSMoveCommand is wrong: ',class_getInstanceSize(TDerivedNSMoveCommand),' <> ',class_getInstanceSize(NSMoveCommand)+1);
+ if class_getInstanceSize(TDerivedNSQuitCommand) <> (class_getInstanceSize(NSQuitCommand)+1) then
+ writeln('size of NSQuitCommand is wrong: ',class_getInstanceSize(TDerivedNSQuitCommand),' <> ',class_getInstanceSize(NSQuitCommand)+1);
+ if class_getInstanceSize(TDerivedNSSetCommand) <> (class_getInstanceSize(NSSetCommand)+1) then
+ writeln('size of NSSetCommand is wrong: ',class_getInstanceSize(TDerivedNSSetCommand),' <> ',class_getInstanceSize(NSSetCommand)+1);
+ if class_getInstanceSize(TDerivedNSScriptSuiteRegistry) <> (class_getInstanceSize(NSScriptSuiteRegistry)+1) then
+ writeln('size of NSScriptSuiteRegistry is wrong: ',class_getInstanceSize(TDerivedNSScriptSuiteRegistry),' <> ',class_getInstanceSize(NSScriptSuiteRegistry)+1);
+ if class_getInstanceSize(TDerivedNSScriptWhoseTest) <> (class_getInstanceSize(NSScriptWhoseTest)+1) then
+ writeln('size of NSScriptWhoseTest is wrong: ',class_getInstanceSize(TDerivedNSScriptWhoseTest),' <> ',class_getInstanceSize(NSScriptWhoseTest)+1);
+ if class_getInstanceSize(TDerivedNSLogicalTest) <> (class_getInstanceSize(NSLogicalTest)+1) then
+ writeln('size of NSLogicalTest is wrong: ',class_getInstanceSize(TDerivedNSLogicalTest),' <> ',class_getInstanceSize(NSLogicalTest)+1);
+ if class_getInstanceSize(TDerivedNSSpecifierTest) <> (class_getInstanceSize(NSSpecifierTest)+1) then
+ writeln('size of NSSpecifierTest is wrong: ',class_getInstanceSize(TDerivedNSSpecifierTest),' <> ',class_getInstanceSize(NSSpecifierTest)+1);
+ if class_getInstanceSize(TDerivedNSSet) <> (class_getInstanceSize(NSSet)+1) then
+ writeln('size of NSSet is wrong: ',class_getInstanceSize(TDerivedNSSet),' <> ',class_getInstanceSize(NSSet)+1);
+ if class_getInstanceSize(TDerivedNSMutableSet) <> (class_getInstanceSize(NSMutableSet)+1) then
+ writeln('size of NSMutableSet is wrong: ',class_getInstanceSize(TDerivedNSMutableSet),' <> ',class_getInstanceSize(NSMutableSet)+1);
+ if class_getInstanceSize(TDerivedNSCountedSet) <> (class_getInstanceSize(NSCountedSet)+1) then
+ writeln('size of NSCountedSet is wrong: ',class_getInstanceSize(TDerivedNSCountedSet),' <> ',class_getInstanceSize(NSCountedSet)+1);
+ if class_getInstanceSize(TDerivedNSSortDescriptor) <> (class_getInstanceSize(NSSortDescriptor)+1) then
+ writeln('size of NSSortDescriptor is wrong: ',class_getInstanceSize(TDerivedNSSortDescriptor),' <> ',class_getInstanceSize(NSSortDescriptor)+1);
+ if class_getInstanceSize(TDerivedNSSpellServer) <> (class_getInstanceSize(NSSpellServer)+1) then
+ writeln('size of NSSpellServer is wrong: ',class_getInstanceSize(TDerivedNSSpellServer),' <> ',class_getInstanceSize(NSSpellServer)+1);
+ if class_getInstanceSize(TDerivedNSStream) <> (class_getInstanceSize(NSStream)+1) then
+ writeln('size of NSStream is wrong: ',class_getInstanceSize(TDerivedNSStream),' <> ',class_getInstanceSize(NSStream)+1);
+ if class_getInstanceSize(TDerivedNSInputStream) <> (class_getInstanceSize(NSInputStream)+1) then
+ writeln('size of NSInputStream is wrong: ',class_getInstanceSize(TDerivedNSInputStream),' <> ',class_getInstanceSize(NSInputStream)+1);
+ if class_getInstanceSize(TDerivedNSOutputStream) <> (class_getInstanceSize(NSOutputStream)+1) then
+ writeln('size of NSOutputStream is wrong: ',class_getInstanceSize(TDerivedNSOutputStream),' <> ',class_getInstanceSize(NSOutputStream)+1);
+ if class_getInstanceSize(TDerivedNSString) <> (class_getInstanceSize(NSString)+1) then
+ writeln('size of NSString is wrong: ',class_getInstanceSize(TDerivedNSString),' <> ',class_getInstanceSize(NSString)+1);
+ if class_getInstanceSize(TDerivedNSMutableString) <> (class_getInstanceSize(NSMutableString)+1) then
+ writeln('size of NSMutableString is wrong: ',class_getInstanceSize(TDerivedNSMutableString),' <> ',class_getInstanceSize(NSMutableString)+1);
+ if class_getInstanceSize(TDerivedNSSimpleCString) <> (class_getInstanceSize(NSSimpleCString)+1) then
+ writeln('size of NSSimpleCString is wrong: ',class_getInstanceSize(TDerivedNSSimpleCString),' <> ',class_getInstanceSize(NSSimpleCString)+1);
+ if class_getInstanceSize(TDerivedNSTask) <> (class_getInstanceSize(NSTask)+1) then
+ writeln('size of NSTask is wrong: ',class_getInstanceSize(TDerivedNSTask),' <> ',class_getInstanceSize(NSTask)+1);
+ if class_getInstanceSize(TDerivedNSThread) <> (class_getInstanceSize(NSThread)+1) then
+ writeln('size of NSThread is wrong: ',class_getInstanceSize(TDerivedNSThread),' <> ',class_getInstanceSize(NSThread)+1);
+ if class_getInstanceSize(TDerivedNSTimer) <> (class_getInstanceSize(NSTimer)+1) then
+ writeln('size of NSTimer is wrong: ',class_getInstanceSize(TDerivedNSTimer),' <> ',class_getInstanceSize(NSTimer)+1);
+ if class_getInstanceSize(TDerivedNSTimeZone) <> (class_getInstanceSize(NSTimeZone)+1) then
+ writeln('size of NSTimeZone is wrong: ',class_getInstanceSize(TDerivedNSTimeZone),' <> ',class_getInstanceSize(NSTimeZone)+1);
+ if class_getInstanceSize(TDerivedNSUndoManager) <> (class_getInstanceSize(NSUndoManager)+1) then
+ writeln('size of NSUndoManager is wrong: ',class_getInstanceSize(TDerivedNSUndoManager),' <> ',class_getInstanceSize(NSUndoManager)+1);
+ if class_getInstanceSize(TDerivedNSURL) <> (class_getInstanceSize(NSURL)+1) then
+ writeln('size of NSURL is wrong: ',class_getInstanceSize(TDerivedNSURL),' <> ',class_getInstanceSize(NSURL)+1);
+ if class_getInstanceSize(TDerivedNSURLAuthenticationChallenge) <> (class_getInstanceSize(NSURLAuthenticationChallenge)+1) then
+ writeln('size of NSURLAuthenticationChallenge is wrong: ',class_getInstanceSize(TDerivedNSURLAuthenticationChallenge),' <> ',class_getInstanceSize(NSURLAuthenticationChallenge)+1);
+ if class_getInstanceSize(TDerivedNSCachedURLResponse) <> (class_getInstanceSize(NSCachedURLResponse)+1) then
+ writeln('size of NSCachedURLResponse is wrong: ',class_getInstanceSize(TDerivedNSCachedURLResponse),' <> ',class_getInstanceSize(NSCachedURLResponse)+1);
+ if class_getInstanceSize(TDerivedNSURLCache) <> (class_getInstanceSize(NSURLCache)+1) then
+ writeln('size of NSURLCache is wrong: ',class_getInstanceSize(TDerivedNSURLCache),' <> ',class_getInstanceSize(NSURLCache)+1);
+ if class_getInstanceSize(TDerivedNSURLConnection) <> (class_getInstanceSize(NSURLConnection)+1) then
+ writeln('size of NSURLConnection is wrong: ',class_getInstanceSize(TDerivedNSURLConnection),' <> ',class_getInstanceSize(NSURLConnection)+1);
+ if class_getInstanceSize(TDerivedNSURLCredential) <> (class_getInstanceSize(NSURLCredential)+1) then
+ writeln('size of NSURLCredential is wrong: ',class_getInstanceSize(TDerivedNSURLCredential),' <> ',class_getInstanceSize(NSURLCredential)+1);
+ if class_getInstanceSize(TDerivedNSURLCredentialStorage) <> (class_getInstanceSize(NSURLCredentialStorage)+1) then
+ writeln('size of NSURLCredentialStorage is wrong: ',class_getInstanceSize(TDerivedNSURLCredentialStorage),' <> ',class_getInstanceSize(NSURLCredentialStorage)+1);
+ if class_getInstanceSize(TDerivedNSURLDownload) <> (class_getInstanceSize(NSURLDownload)+1) then
+ writeln('size of NSURLDownload is wrong: ',class_getInstanceSize(TDerivedNSURLDownload),' <> ',class_getInstanceSize(NSURLDownload)+1);
+ if class_getInstanceSize(TDerivedNSURLHandle) <> (class_getInstanceSize(NSURLHandle)+1) then
+ writeln('size of NSURLHandle is wrong: ',class_getInstanceSize(TDerivedNSURLHandle),' <> ',class_getInstanceSize(NSURLHandle)+1);
+ if class_getInstanceSize(TDerivedNSURLProtectionSpace) <> (class_getInstanceSize(NSURLProtectionSpace)+1) then
+ writeln('size of NSURLProtectionSpace is wrong: ',class_getInstanceSize(TDerivedNSURLProtectionSpace),' <> ',class_getInstanceSize(NSURLProtectionSpace)+1);
+ if class_getInstanceSize(TDerivedNSURLProtocol) <> (class_getInstanceSize(NSURLProtocol)+1) then
+ writeln('size of NSURLProtocol is wrong: ',class_getInstanceSize(TDerivedNSURLProtocol),' <> ',class_getInstanceSize(NSURLProtocol)+1);
+ if class_getInstanceSize(TDerivedNSURLRequest) <> (class_getInstanceSize(NSURLRequest)+1) then
+ writeln('size of NSURLRequest is wrong: ',class_getInstanceSize(TDerivedNSURLRequest),' <> ',class_getInstanceSize(NSURLRequest)+1);
+ if class_getInstanceSize(TDerivedNSMutableURLRequest) <> (class_getInstanceSize(NSMutableURLRequest)+1) then
+ writeln('size of NSMutableURLRequest is wrong: ',class_getInstanceSize(TDerivedNSMutableURLRequest),' <> ',class_getInstanceSize(NSMutableURLRequest)+1);
+ if class_getInstanceSize(TDerivedNSURLResponse) <> (class_getInstanceSize(NSURLResponse)+1) then
+ writeln('size of NSURLResponse is wrong: ',class_getInstanceSize(TDerivedNSURLResponse),' <> ',class_getInstanceSize(NSURLResponse)+1);
+ if class_getInstanceSize(TDerivedNSHTTPURLResponse) <> (class_getInstanceSize(NSHTTPURLResponse)+1) then
+ writeln('size of NSHTTPURLResponse is wrong: ',class_getInstanceSize(TDerivedNSHTTPURLResponse),' <> ',class_getInstanceSize(NSHTTPURLResponse)+1);
+ if class_getInstanceSize(TDerivedNSUserDefaults) <> (class_getInstanceSize(NSUserDefaults)+1) then
+ writeln('size of NSUserDefaults is wrong: ',class_getInstanceSize(TDerivedNSUserDefaults),' <> ',class_getInstanceSize(NSUserDefaults)+1);
+ if class_getInstanceSize(TDerivedNSValue) <> (class_getInstanceSize(NSValue)+1) then
+ writeln('size of NSValue is wrong: ',class_getInstanceSize(TDerivedNSValue),' <> ',class_getInstanceSize(NSValue)+1);
+ if class_getInstanceSize(TDerivedNSNumber) <> (class_getInstanceSize(NSNumber)+1) then
+ writeln('size of NSNumber is wrong: ',class_getInstanceSize(TDerivedNSNumber),' <> ',class_getInstanceSize(NSNumber)+1);
+ if class_getInstanceSize(TDerivedNSValueTransformer) <> (class_getInstanceSize(NSValueTransformer)+1) then
+ writeln('size of NSValueTransformer is wrong: ',class_getInstanceSize(TDerivedNSValueTransformer),' <> ',class_getInstanceSize(NSValueTransformer)+1);
+ if class_getInstanceSize(TDerivedNSXMLDocument) <> (class_getInstanceSize(NSXMLDocument)+1) then
+ writeln('size of NSXMLDocument is wrong: ',class_getInstanceSize(TDerivedNSXMLDocument),' <> ',class_getInstanceSize(NSXMLDocument)+1);
+ if class_getInstanceSize(TDerivedNSXMLDTD) <> (class_getInstanceSize(NSXMLDTD)+1) then
+ writeln('size of NSXMLDTD is wrong: ',class_getInstanceSize(TDerivedNSXMLDTD),' <> ',class_getInstanceSize(NSXMLDTD)+1);
+ if class_getInstanceSize(TDerivedNSXMLDTDNode) <> (class_getInstanceSize(NSXMLDTDNode)+1) then
+ writeln('size of NSXMLDTDNode is wrong: ',class_getInstanceSize(TDerivedNSXMLDTDNode),' <> ',class_getInstanceSize(NSXMLDTDNode)+1);
+ if class_getInstanceSize(TDerivedNSXMLElement) <> (class_getInstanceSize(NSXMLElement)+1) then
+ writeln('size of NSXMLElement is wrong: ',class_getInstanceSize(TDerivedNSXMLElement),' <> ',class_getInstanceSize(NSXMLElement)+1);
+ if class_getInstanceSize(TDerivedNSXMLNode) <> (class_getInstanceSize(NSXMLNode)+1) then
+ writeln('size of NSXMLNode is wrong: ',class_getInstanceSize(TDerivedNSXMLNode),' <> ',class_getInstanceSize(NSXMLNode)+1);
+ if class_getInstanceSize(TDerivedNSXMLParser) <> (class_getInstanceSize(NSXMLParser)+1) then
+ writeln('size of NSXMLParser is wrong: ',class_getInstanceSize(TDerivedNSXMLParser),' <> ',class_getInstanceSize(NSXMLParser)+1);
+ if class_getInstanceSize(TDerivedNSActionCell) <> (class_getInstanceSize(NSActionCell)+1) then
+ writeln('size of NSActionCell is wrong: ',class_getInstanceSize(TDerivedNSActionCell),' <> ',class_getInstanceSize(NSActionCell)+1);
+ if class_getInstanceSize(TDerivedNSAlert) <> (class_getInstanceSize(NSAlert)+1) then
+ writeln('size of NSAlert is wrong: ',class_getInstanceSize(TDerivedNSAlert),' <> ',class_getInstanceSize(NSAlert)+1);
+ if class_getInstanceSize(TDerivedNSAnimation) <> (class_getInstanceSize(NSAnimation)+1) then
+ writeln('size of NSAnimation is wrong: ',class_getInstanceSize(TDerivedNSAnimation),' <> ',class_getInstanceSize(NSAnimation)+1);
+ if class_getInstanceSize(TDerivedNSViewAnimation) <> (class_getInstanceSize(NSViewAnimation)+1) then
+ writeln('size of NSViewAnimation is wrong: ',class_getInstanceSize(TDerivedNSViewAnimation),' <> ',class_getInstanceSize(NSViewAnimation)+1);
+ if class_getInstanceSize(TDerivedNSAnimationContext) <> (class_getInstanceSize(NSAnimationContext)+1) then
+ writeln('size of NSAnimationContext is wrong: ',class_getInstanceSize(TDerivedNSAnimationContext),' <> ',class_getInstanceSize(NSAnimationContext)+1);
+ if class_getInstanceSize(TDerivedNSApplication) <> (class_getInstanceSize(NSApplication)+1) then
+ writeln('size of NSApplication is wrong: ',class_getInstanceSize(TDerivedNSApplication),' <> ',class_getInstanceSize(NSApplication)+1);
+ if class_getInstanceSize(TDerivedNSArrayController) <> (class_getInstanceSize(NSArrayController)+1) then
+ writeln('size of NSArrayController is wrong: ',class_getInstanceSize(TDerivedNSArrayController),' <> ',class_getInstanceSize(NSArrayController)+1);
+ if class_getInstanceSize(TDerivedNSATSTypesetter) <> (class_getInstanceSize(NSATSTypesetter)+1) then
+ writeln('size of NSATSTypesetter is wrong: ',class_getInstanceSize(TDerivedNSATSTypesetter),' <> ',class_getInstanceSize(NSATSTypesetter)+1);
+ if class_getInstanceSize(TDerivedNSBezierPath) <> (class_getInstanceSize(NSBezierPath)+1) then
+ writeln('size of NSBezierPath is wrong: ',class_getInstanceSize(TDerivedNSBezierPath),' <> ',class_getInstanceSize(NSBezierPath)+1);
+ if class_getInstanceSize(TDerivedNSBitmapImageRep) <> (class_getInstanceSize(NSBitmapImageRep)+1) then
+ writeln('size of NSBitmapImageRep is wrong: ',class_getInstanceSize(TDerivedNSBitmapImageRep),' <> ',class_getInstanceSize(NSBitmapImageRep)+1);
+ if class_getInstanceSize(TDerivedNSBox) <> (class_getInstanceSize(NSBox)+1) then
+ writeln('size of NSBox is wrong: ',class_getInstanceSize(TDerivedNSBox),' <> ',class_getInstanceSize(NSBox)+1);
+ if class_getInstanceSize(TDerivedNSBrowser) <> (class_getInstanceSize(NSBrowser)+1) then
+ writeln('size of NSBrowser is wrong: ',class_getInstanceSize(TDerivedNSBrowser),' <> ',class_getInstanceSize(NSBrowser)+1);
+ if class_getInstanceSize(TDerivedNSBrowserCell) <> (class_getInstanceSize(NSBrowserCell)+1) then
+ writeln('size of NSBrowserCell is wrong: ',class_getInstanceSize(TDerivedNSBrowserCell),' <> ',class_getInstanceSize(NSBrowserCell)+1);
+ if class_getInstanceSize(TDerivedNSButton) <> (class_getInstanceSize(NSButton)+1) then
+ writeln('size of NSButton is wrong: ',class_getInstanceSize(TDerivedNSButton),' <> ',class_getInstanceSize(NSButton)+1);
+ if class_getInstanceSize(TDerivedNSButtonCell) <> (class_getInstanceSize(NSButtonCell)+1) then
+ writeln('size of NSButtonCell is wrong: ',class_getInstanceSize(TDerivedNSButtonCell),' <> ',class_getInstanceSize(NSButtonCell)+1);
+ if class_getInstanceSize(TDerivedNSCachedImageRep) <> (class_getInstanceSize(NSCachedImageRep)+1) then
+ writeln('size of NSCachedImageRep is wrong: ',class_getInstanceSize(TDerivedNSCachedImageRep),' <> ',class_getInstanceSize(NSCachedImageRep)+1);
+ if class_getInstanceSize(TDerivedNSCell) <> (class_getInstanceSize(NSCell)+1) then
+ writeln('size of NSCell is wrong: ',class_getInstanceSize(TDerivedNSCell),' <> ',class_getInstanceSize(NSCell)+1);
+ if class_getInstanceSize(TDerivedNSCIImageRep) <> (class_getInstanceSize(NSCIImageRep)+1) then
+ writeln('size of NSCIImageRep is wrong: ',class_getInstanceSize(TDerivedNSCIImageRep),' <> ',class_getInstanceSize(NSCIImageRep)+1);
+ if class_getInstanceSize(TDerivedNSClipView) <> (class_getInstanceSize(NSClipView)+1) then
+ writeln('size of NSClipView is wrong: ',class_getInstanceSize(TDerivedNSClipView),' <> ',class_getInstanceSize(NSClipView)+1);
+ if class_getInstanceSize(TDerivedNSCollectionViewItem) <> (class_getInstanceSize(NSCollectionViewItem)+1) then
+ writeln('size of NSCollectionViewItem is wrong: ',class_getInstanceSize(TDerivedNSCollectionViewItem),' <> ',class_getInstanceSize(NSCollectionViewItem)+1);
+ if class_getInstanceSize(TDerivedNSCollectionView) <> (class_getInstanceSize(NSCollectionView)+1) then
+ writeln('size of NSCollectionView is wrong: ',class_getInstanceSize(TDerivedNSCollectionView),' <> ',class_getInstanceSize(NSCollectionView)+1);
+ if class_getInstanceSize(TDerivedNSColor) <> (class_getInstanceSize(NSColor)+1) then
+ writeln('size of NSColor is wrong: ',class_getInstanceSize(TDerivedNSColor),' <> ',class_getInstanceSize(NSColor)+1);
+ if class_getInstanceSize(TDerivedNSColorList) <> (class_getInstanceSize(NSColorList)+1) then
+ writeln('size of NSColorList is wrong: ',class_getInstanceSize(TDerivedNSColorList),' <> ',class_getInstanceSize(NSColorList)+1);
+ if class_getInstanceSize(TDerivedNSColorPanel) <> (class_getInstanceSize(NSColorPanel)+1) then
+ writeln('size of NSColorPanel is wrong: ',class_getInstanceSize(TDerivedNSColorPanel),' <> ',class_getInstanceSize(NSColorPanel)+1);
+ if class_getInstanceSize(TDerivedNSColorPicker) <> (class_getInstanceSize(NSColorPicker)+1) then
+ writeln('size of NSColorPicker is wrong: ',class_getInstanceSize(TDerivedNSColorPicker),' <> ',class_getInstanceSize(NSColorPicker)+1);
+ if class_getInstanceSize(TDerivedNSColorSpace) <> (class_getInstanceSize(NSColorSpace)+1) then
+ writeln('size of NSColorSpace is wrong: ',class_getInstanceSize(TDerivedNSColorSpace),' <> ',class_getInstanceSize(NSColorSpace)+1);
+ if class_getInstanceSize(TDerivedNSColorWell) <> (class_getInstanceSize(NSColorWell)+1) then
+ writeln('size of NSColorWell is wrong: ',class_getInstanceSize(TDerivedNSColorWell),' <> ',class_getInstanceSize(NSColorWell)+1);
+ if class_getInstanceSize(TDerivedNSComboBox) <> (class_getInstanceSize(NSComboBox)+1) then
+ writeln('size of NSComboBox is wrong: ',class_getInstanceSize(TDerivedNSComboBox),' <> ',class_getInstanceSize(NSComboBox)+1);
+ if class_getInstanceSize(TDerivedNSComboBoxCell) <> (class_getInstanceSize(NSComboBoxCell)+1) then
+ writeln('size of NSComboBoxCell is wrong: ',class_getInstanceSize(TDerivedNSComboBoxCell),' <> ',class_getInstanceSize(NSComboBoxCell)+1);
+ if class_getInstanceSize(TDerivedNSControl) <> (class_getInstanceSize(NSControl)+1) then
+ writeln('size of NSControl is wrong: ',class_getInstanceSize(TDerivedNSControl),' <> ',class_getInstanceSize(NSControl)+1);
+ if class_getInstanceSize(TDerivedNSController) <> (class_getInstanceSize(NSController)+1) then
+ writeln('size of NSController is wrong: ',class_getInstanceSize(TDerivedNSController),' <> ',class_getInstanceSize(NSController)+1);
+ if class_getInstanceSize(TDerivedNSCursor) <> (class_getInstanceSize(NSCursor)+1) then
+ writeln('size of NSCursor is wrong: ',class_getInstanceSize(TDerivedNSCursor),' <> ',class_getInstanceSize(NSCursor)+1);
+ if class_getInstanceSize(TDerivedNSCustomImageRep) <> (class_getInstanceSize(NSCustomImageRep)+1) then
+ writeln('size of NSCustomImageRep is wrong: ',class_getInstanceSize(TDerivedNSCustomImageRep),' <> ',class_getInstanceSize(NSCustomImageRep)+1);
+ if class_getInstanceSize(TDerivedNSDatePicker) <> (class_getInstanceSize(NSDatePicker)+1) then
+ writeln('size of NSDatePicker is wrong: ',class_getInstanceSize(TDerivedNSDatePicker),' <> ',class_getInstanceSize(NSDatePicker)+1);
+ if class_getInstanceSize(TDerivedNSDatePickerCell) <> (class_getInstanceSize(NSDatePickerCell)+1) then
+ writeln('size of NSDatePickerCell is wrong: ',class_getInstanceSize(TDerivedNSDatePickerCell),' <> ',class_getInstanceSize(NSDatePickerCell)+1);
+ if class_getInstanceSize(TDerivedNSDictionaryController) <> (class_getInstanceSize(NSDictionaryController)+1) then
+ writeln('size of NSDictionaryController is wrong: ',class_getInstanceSize(TDerivedNSDictionaryController),' <> ',class_getInstanceSize(NSDictionaryController)+1);
+ if class_getInstanceSize(TDerivedNSDockTile) <> (class_getInstanceSize(NSDockTile)+1) then
+ writeln('size of NSDockTile is wrong: ',class_getInstanceSize(TDerivedNSDockTile),' <> ',class_getInstanceSize(NSDockTile)+1);
+ if class_getInstanceSize(TDerivedNSDocument) <> (class_getInstanceSize(NSDocument)+1) then
+ writeln('size of NSDocument is wrong: ',class_getInstanceSize(TDerivedNSDocument),' <> ',class_getInstanceSize(NSDocument)+1);
+ if class_getInstanceSize(TDerivedNSDocumentController) <> (class_getInstanceSize(NSDocumentController)+1) then
+ writeln('size of NSDocumentController is wrong: ',class_getInstanceSize(TDerivedNSDocumentController),' <> ',class_getInstanceSize(NSDocumentController)+1);
+ if class_getInstanceSize(TDerivedNSDrawer) <> (class_getInstanceSize(NSDrawer)+1) then
+ writeln('size of NSDrawer is wrong: ',class_getInstanceSize(TDerivedNSDrawer),' <> ',class_getInstanceSize(NSDrawer)+1);
+ if class_getInstanceSize(TDerivedNSEPSImageRep) <> (class_getInstanceSize(NSEPSImageRep)+1) then
+ writeln('size of NSEPSImageRep is wrong: ',class_getInstanceSize(TDerivedNSEPSImageRep),' <> ',class_getInstanceSize(NSEPSImageRep)+1);
+ if class_getInstanceSize(TDerivedNSEvent) <> (class_getInstanceSize(NSEvent)+1) then
+ writeln('size of NSEvent is wrong: ',class_getInstanceSize(TDerivedNSEvent),' <> ',class_getInstanceSize(NSEvent)+1);
+ if class_getInstanceSize(TDerivedNSFileWrapper) <> (class_getInstanceSize(NSFileWrapper)+1) then
+ writeln('size of NSFileWrapper is wrong: ',class_getInstanceSize(TDerivedNSFileWrapper),' <> ',class_getInstanceSize(NSFileWrapper)+1);
+ if class_getInstanceSize(TDerivedNSFont) <> (class_getInstanceSize(NSFont)+1) then
+ writeln('size of NSFont is wrong: ',class_getInstanceSize(TDerivedNSFont),' <> ',class_getInstanceSize(NSFont)+1);
+ if class_getInstanceSize(TDerivedNSFontDescriptor) <> (class_getInstanceSize(NSFontDescriptor)+1) then
+ writeln('size of NSFontDescriptor is wrong: ',class_getInstanceSize(TDerivedNSFontDescriptor),' <> ',class_getInstanceSize(NSFontDescriptor)+1);
+ if class_getInstanceSize(TDerivedNSFontManager) <> (class_getInstanceSize(NSFontManager)+1) then
+ writeln('size of NSFontManager is wrong: ',class_getInstanceSize(TDerivedNSFontManager),' <> ',class_getInstanceSize(NSFontManager)+1);
+ if class_getInstanceSize(TDerivedNSFontPanel) <> (class_getInstanceSize(NSFontPanel)+1) then
+ writeln('size of NSFontPanel is wrong: ',class_getInstanceSize(TDerivedNSFontPanel),' <> ',class_getInstanceSize(NSFontPanel)+1);
+ if class_getInstanceSize(TDerivedNSFormCell) <> (class_getInstanceSize(NSFormCell)+1) then
+ writeln('size of NSFormCell is wrong: ',class_getInstanceSize(TDerivedNSFormCell),' <> ',class_getInstanceSize(NSFormCell)+1);
+ if class_getInstanceSize(TDerivedNSGlyphGenerator) <> (class_getInstanceSize(NSGlyphGenerator)+1) then
+ writeln('size of NSGlyphGenerator is wrong: ',class_getInstanceSize(TDerivedNSGlyphGenerator),' <> ',class_getInstanceSize(NSGlyphGenerator)+1);
+ if class_getInstanceSize(TDerivedNSGlyphInfo) <> (class_getInstanceSize(NSGlyphInfo)+1) then
+ writeln('size of NSGlyphInfo is wrong: ',class_getInstanceSize(TDerivedNSGlyphInfo),' <> ',class_getInstanceSize(NSGlyphInfo)+1);
+ if class_getInstanceSize(TDerivedNSGradient) <> (class_getInstanceSize(NSGradient)+1) then
+ writeln('size of NSGradient is wrong: ',class_getInstanceSize(TDerivedNSGradient),' <> ',class_getInstanceSize(NSGradient)+1);
+ if class_getInstanceSize(TDerivedNSGraphicsContext) <> (class_getInstanceSize(NSGraphicsContext)+1) then
+ writeln('size of NSGraphicsContext is wrong: ',class_getInstanceSize(TDerivedNSGraphicsContext),' <> ',class_getInstanceSize(NSGraphicsContext)+1);
+ if class_getInstanceSize(TDerivedNSHelpManager) <> (class_getInstanceSize(NSHelpManager)+1) then
+ writeln('size of NSHelpManager is wrong: ',class_getInstanceSize(TDerivedNSHelpManager),' <> ',class_getInstanceSize(NSHelpManager)+1);
+ if class_getInstanceSize(TDerivedNSImage) <> (class_getInstanceSize(NSImage)+1) then
+ writeln('size of NSImage is wrong: ',class_getInstanceSize(TDerivedNSImage),' <> ',class_getInstanceSize(NSImage)+1);
+ if class_getInstanceSize(TDerivedNSImageCell) <> (class_getInstanceSize(NSImageCell)+1) then
+ writeln('size of NSImageCell is wrong: ',class_getInstanceSize(TDerivedNSImageCell),' <> ',class_getInstanceSize(NSImageCell)+1);
+ if class_getInstanceSize(TDerivedNSImageRep) <> (class_getInstanceSize(NSImageRep)+1) then
+ writeln('size of NSImageRep is wrong: ',class_getInstanceSize(TDerivedNSImageRep),' <> ',class_getInstanceSize(NSImageRep)+1);
+ if class_getInstanceSize(TDerivedNSImageView) <> (class_getInstanceSize(NSImageView)+1) then
+ writeln('size of NSImageView is wrong: ',class_getInstanceSize(TDerivedNSImageView),' <> ',class_getInstanceSize(NSImageView)+1);
+ if class_getInstanceSize(TDerivedNSInputManager) <> (class_getInstanceSize(NSInputManager)+1) then
+ writeln('size of NSInputManager is wrong: ',class_getInstanceSize(TDerivedNSInputManager),' <> ',class_getInstanceSize(NSInputManager)+1);
+ if class_getInstanceSize(TDerivedNSInputServer) <> (class_getInstanceSize(NSInputServer)+1) then
+ writeln('size of NSInputServer is wrong: ',class_getInstanceSize(TDerivedNSInputServer),' <> ',class_getInstanceSize(NSInputServer)+1);
+ if class_getInstanceSize(TDerivedNSLayoutManager) <> (class_getInstanceSize(NSLayoutManager)+1) then
+ writeln('size of NSLayoutManager is wrong: ',class_getInstanceSize(TDerivedNSLayoutManager),' <> ',class_getInstanceSize(NSLayoutManager)+1);
+ if class_getInstanceSize(TDerivedNSLevelIndicator) <> (class_getInstanceSize(NSLevelIndicator)+1) then
+ writeln('size of NSLevelIndicator is wrong: ',class_getInstanceSize(TDerivedNSLevelIndicator),' <> ',class_getInstanceSize(NSLevelIndicator)+1);
+ if class_getInstanceSize(TDerivedNSLevelIndicatorCell) <> (class_getInstanceSize(NSLevelIndicatorCell)+1) then
+ writeln('size of NSLevelIndicatorCell is wrong: ',class_getInstanceSize(TDerivedNSLevelIndicatorCell),' <> ',class_getInstanceSize(NSLevelIndicatorCell)+1);
+ if class_getInstanceSize(TDerivedNSMatrix) <> (class_getInstanceSize(NSMatrix)+1) then
+ writeln('size of NSMatrix is wrong: ',class_getInstanceSize(TDerivedNSMatrix),' <> ',class_getInstanceSize(NSMatrix)+1);
+ if class_getInstanceSize(TDerivedNSMenu) <> (class_getInstanceSize(NSMenu)+1) then
+ writeln('size of NSMenu is wrong: ',class_getInstanceSize(TDerivedNSMenu),' <> ',class_getInstanceSize(NSMenu)+1);
+ if class_getInstanceSize(TDerivedNSMenuItem) <> (class_getInstanceSize(NSMenuItem)+1) then
+ writeln('size of NSMenuItem is wrong: ',class_getInstanceSize(TDerivedNSMenuItem),' <> ',class_getInstanceSize(NSMenuItem)+1);
+ if class_getInstanceSize(TDerivedNSMenuItemCell) <> (class_getInstanceSize(NSMenuItemCell)+1) then
+ writeln('size of NSMenuItemCell is wrong: ',class_getInstanceSize(TDerivedNSMenuItemCell),' <> ',class_getInstanceSize(NSMenuItemCell)+1);
+ if class_getInstanceSize(TDerivedNSMenuView) <> (class_getInstanceSize(NSMenuView)+1) then
+ writeln('size of NSMenuView is wrong: ',class_getInstanceSize(TDerivedNSMenuView),' <> ',class_getInstanceSize(NSMenuView)+1);
+ if class_getInstanceSize(TDerivedNSMovie) <> (class_getInstanceSize(NSMovie)+1) then
+ writeln('size of NSMovie is wrong: ',class_getInstanceSize(TDerivedNSMovie),' <> ',class_getInstanceSize(NSMovie)+1);
+ if class_getInstanceSize(TDerivedNSMovieView) <> (class_getInstanceSize(NSMovieView)+1) then
+ writeln('size of NSMovieView is wrong: ',class_getInstanceSize(TDerivedNSMovieView),' <> ',class_getInstanceSize(NSMovieView)+1);
+ if class_getInstanceSize(TDerivedNSNib) <> (class_getInstanceSize(NSNib)+1) then
+ writeln('size of NSNib is wrong: ',class_getInstanceSize(TDerivedNSNib),' <> ',class_getInstanceSize(NSNib)+1);
+ if class_getInstanceSize(TDerivedNSObjectController) <> (class_getInstanceSize(NSObjectController)+1) then
+ writeln('size of NSObjectController is wrong: ',class_getInstanceSize(TDerivedNSObjectController),' <> ',class_getInstanceSize(NSObjectController)+1);
+ if class_getInstanceSize(TDerivedNSOpenGLPixelFormat) <> (class_getInstanceSize(NSOpenGLPixelFormat)+1) then
+ writeln('size of NSOpenGLPixelFormat is wrong: ',class_getInstanceSize(TDerivedNSOpenGLPixelFormat),' <> ',class_getInstanceSize(NSOpenGLPixelFormat)+1);
+ if class_getInstanceSize(TDerivedNSOpenGLPixelBuffer) <> (class_getInstanceSize(NSOpenGLPixelBuffer)+1) then
+ writeln('size of NSOpenGLPixelBuffer is wrong: ',class_getInstanceSize(TDerivedNSOpenGLPixelBuffer),' <> ',class_getInstanceSize(NSOpenGLPixelBuffer)+1);
+ if class_getInstanceSize(TDerivedNSOpenGLContext) <> (class_getInstanceSize(NSOpenGLContext)+1) then
+ writeln('size of NSOpenGLContext is wrong: ',class_getInstanceSize(TDerivedNSOpenGLContext),' <> ',class_getInstanceSize(NSOpenGLContext)+1);
+ if class_getInstanceSize(TDerivedNSOpenGLView) <> (class_getInstanceSize(NSOpenGLView)+1) then
+ writeln('size of NSOpenGLView is wrong: ',class_getInstanceSize(TDerivedNSOpenGLView),' <> ',class_getInstanceSize(NSOpenGLView)+1);
+ if class_getInstanceSize(TDerivedNSOpenPanel) <> (class_getInstanceSize(NSOpenPanel)+1) then
+ writeln('size of NSOpenPanel is wrong: ',class_getInstanceSize(TDerivedNSOpenPanel),' <> ',class_getInstanceSize(NSOpenPanel)+1);
+ if class_getInstanceSize(TDerivedNSOutlineView) <> (class_getInstanceSize(NSOutlineView)+1) then
+ writeln('size of NSOutlineView is wrong: ',class_getInstanceSize(TDerivedNSOutlineView),' <> ',class_getInstanceSize(NSOutlineView)+1);
+ if class_getInstanceSize(TDerivedNSPageLayout) <> (class_getInstanceSize(NSPageLayout)+1) then
+ writeln('size of NSPageLayout is wrong: ',class_getInstanceSize(TDerivedNSPageLayout),' <> ',class_getInstanceSize(NSPageLayout)+1);
+ if class_getInstanceSize(TDerivedNSPanel) <> (class_getInstanceSize(NSPanel)+1) then
+ writeln('size of NSPanel is wrong: ',class_getInstanceSize(TDerivedNSPanel),' <> ',class_getInstanceSize(NSPanel)+1);
+ if class_getInstanceSize(TDerivedNSTextTab) <> (class_getInstanceSize(NSTextTab)+1) then
+ writeln('size of NSTextTab is wrong: ',class_getInstanceSize(TDerivedNSTextTab),' <> ',class_getInstanceSize(NSTextTab)+1);
+ if class_getInstanceSize(TDerivedNSParagraphStyle) <> (class_getInstanceSize(NSParagraphStyle)+1) then
+ writeln('size of NSParagraphStyle is wrong: ',class_getInstanceSize(TDerivedNSParagraphStyle),' <> ',class_getInstanceSize(NSParagraphStyle)+1);
+ if class_getInstanceSize(TDerivedNSMutableParagraphStyle) <> (class_getInstanceSize(NSMutableParagraphStyle)+1) then
+ writeln('size of NSMutableParagraphStyle is wrong: ',class_getInstanceSize(TDerivedNSMutableParagraphStyle),' <> ',class_getInstanceSize(NSMutableParagraphStyle)+1);
+ if class_getInstanceSize(TDerivedNSPasteboard) <> (class_getInstanceSize(NSPasteboard)+1) then
+ writeln('size of NSPasteboard is wrong: ',class_getInstanceSize(TDerivedNSPasteboard),' <> ',class_getInstanceSize(NSPasteboard)+1);
+ if class_getInstanceSize(TDerivedNSPathCell) <> (class_getInstanceSize(NSPathCell)+1) then
+ writeln('size of NSPathCell is wrong: ',class_getInstanceSize(TDerivedNSPathCell),' <> ',class_getInstanceSize(NSPathCell)+1);
+ if class_getInstanceSize(TDerivedNSPathComponentCell) <> (class_getInstanceSize(NSPathComponentCell)+1) then
+ writeln('size of NSPathComponentCell is wrong: ',class_getInstanceSize(TDerivedNSPathComponentCell),' <> ',class_getInstanceSize(NSPathComponentCell)+1);
+ if class_getInstanceSize(TDerivedNSPathControl) <> (class_getInstanceSize(NSPathControl)+1) then
+ writeln('size of NSPathControl is wrong: ',class_getInstanceSize(TDerivedNSPathControl),' <> ',class_getInstanceSize(NSPathControl)+1);
+ if class_getInstanceSize(TDerivedNSPDFImageRep) <> (class_getInstanceSize(NSPDFImageRep)+1) then
+ writeln('size of NSPDFImageRep is wrong: ',class_getInstanceSize(TDerivedNSPDFImageRep),' <> ',class_getInstanceSize(NSPDFImageRep)+1);
+ if class_getInstanceSize(TDerivedNSPersistentDocument) <> (class_getInstanceSize(NSPersistentDocument)+1) then
+ writeln('size of NSPersistentDocument is wrong: ',class_getInstanceSize(TDerivedNSPersistentDocument),' <> ',class_getInstanceSize(NSPersistentDocument)+1);
+ if class_getInstanceSize(TDerivedNSPICTImageRep) <> (class_getInstanceSize(NSPICTImageRep)+1) then
+ writeln('size of NSPICTImageRep is wrong: ',class_getInstanceSize(TDerivedNSPICTImageRep),' <> ',class_getInstanceSize(NSPICTImageRep)+1);
+ if class_getInstanceSize(TDerivedNSPopUpButton) <> (class_getInstanceSize(NSPopUpButton)+1) then
+ writeln('size of NSPopUpButton is wrong: ',class_getInstanceSize(TDerivedNSPopUpButton),' <> ',class_getInstanceSize(NSPopUpButton)+1);
+ if class_getInstanceSize(TDerivedNSPopUpButtonCell) <> (class_getInstanceSize(NSPopUpButtonCell)+1) then
+ writeln('size of NSPopUpButtonCell is wrong: ',class_getInstanceSize(TDerivedNSPopUpButtonCell),' <> ',class_getInstanceSize(NSPopUpButtonCell)+1);
+ if class_getInstanceSize(TDerivedNSPredicateEditor) <> (class_getInstanceSize(NSPredicateEditor)+1) then
+ writeln('size of NSPredicateEditor is wrong: ',class_getInstanceSize(TDerivedNSPredicateEditor),' <> ',class_getInstanceSize(NSPredicateEditor)+1);
+ if class_getInstanceSize(TDerivedNSPrinter) <> (class_getInstanceSize(NSPrinter)+1) then
+ writeln('size of NSPrinter is wrong: ',class_getInstanceSize(TDerivedNSPrinter),' <> ',class_getInstanceSize(NSPrinter)+1);
+ if class_getInstanceSize(TDerivedNSPrintInfo) <> (class_getInstanceSize(NSPrintInfo)+1) then
+ writeln('size of NSPrintInfo is wrong: ',class_getInstanceSize(TDerivedNSPrintInfo),' <> ',class_getInstanceSize(NSPrintInfo)+1);
+ if class_getInstanceSize(TDerivedNSPrintOperation) <> (class_getInstanceSize(NSPrintOperation)+1) then
+ writeln('size of NSPrintOperation is wrong: ',class_getInstanceSize(TDerivedNSPrintOperation),' <> ',class_getInstanceSize(NSPrintOperation)+1);
+ if class_getInstanceSize(TDerivedNSPrintPanel) <> (class_getInstanceSize(NSPrintPanel)+1) then
+ writeln('size of NSPrintPanel is wrong: ',class_getInstanceSize(TDerivedNSPrintPanel),' <> ',class_getInstanceSize(NSPrintPanel)+1);
+ if class_getInstanceSize(TDerivedNSProgressIndicator) <> (class_getInstanceSize(NSProgressIndicator)+1) then
+ writeln('size of NSProgressIndicator is wrong: ',class_getInstanceSize(TDerivedNSProgressIndicator),' <> ',class_getInstanceSize(NSProgressIndicator)+1);
+ if class_getInstanceSize(TDerivedNSQuickDrawView) <> (class_getInstanceSize(NSQuickDrawView)+1) then
+ writeln('size of NSQuickDrawView is wrong: ',class_getInstanceSize(TDerivedNSQuickDrawView),' <> ',class_getInstanceSize(NSQuickDrawView)+1);
+ if class_getInstanceSize(TDerivedNSResponder) <> (class_getInstanceSize(NSResponder)+1) then
+ writeln('size of NSResponder is wrong: ',class_getInstanceSize(TDerivedNSResponder),' <> ',class_getInstanceSize(NSResponder)+1);
+ if class_getInstanceSize(TDerivedNSRuleEditor) <> (class_getInstanceSize(NSRuleEditor)+1) then
+ writeln('size of NSRuleEditor is wrong: ',class_getInstanceSize(TDerivedNSRuleEditor),' <> ',class_getInstanceSize(NSRuleEditor)+1);
+ if class_getInstanceSize(TDerivedNSRulerMarker) <> (class_getInstanceSize(NSRulerMarker)+1) then
+ writeln('size of NSRulerMarker is wrong: ',class_getInstanceSize(TDerivedNSRulerMarker),' <> ',class_getInstanceSize(NSRulerMarker)+1);
+ if class_getInstanceSize(TDerivedNSRulerView) <> (class_getInstanceSize(NSRulerView)+1) then
+ writeln('size of NSRulerView is wrong: ',class_getInstanceSize(TDerivedNSRulerView),' <> ',class_getInstanceSize(NSRulerView)+1);
+ if class_getInstanceSize(TDerivedNSSavePanel) <> (class_getInstanceSize(NSSavePanel)+1) then
+ writeln('size of NSSavePanel is wrong: ',class_getInstanceSize(TDerivedNSSavePanel),' <> ',class_getInstanceSize(NSSavePanel)+1);
+ if class_getInstanceSize(TDerivedNSScreen) <> (class_getInstanceSize(NSScreen)+1) then
+ writeln('size of NSScreen is wrong: ',class_getInstanceSize(TDerivedNSScreen),' <> ',class_getInstanceSize(NSScreen)+1);
+ if class_getInstanceSize(TDerivedNSScroller) <> (class_getInstanceSize(NSScroller)+1) then
+ writeln('size of NSScroller is wrong: ',class_getInstanceSize(TDerivedNSScroller),' <> ',class_getInstanceSize(NSScroller)+1);
+ if class_getInstanceSize(TDerivedNSScrollView) <> (class_getInstanceSize(NSScrollView)+1) then
+ writeln('size of NSScrollView is wrong: ',class_getInstanceSize(TDerivedNSScrollView),' <> ',class_getInstanceSize(NSScrollView)+1);
+ if class_getInstanceSize(TDerivedNSSearchField) <> (class_getInstanceSize(NSSearchField)+1) then
+ writeln('size of NSSearchField is wrong: ',class_getInstanceSize(TDerivedNSSearchField),' <> ',class_getInstanceSize(NSSearchField)+1);
+ if class_getInstanceSize(TDerivedNSSearchFieldCell) <> (class_getInstanceSize(NSSearchFieldCell)+1) then
+ writeln('size of NSSearchFieldCell is wrong: ',class_getInstanceSize(TDerivedNSSearchFieldCell),' <> ',class_getInstanceSize(NSSearchFieldCell)+1);
+ if class_getInstanceSize(TDerivedNSSecureTextField) <> (class_getInstanceSize(NSSecureTextField)+1) then
+ writeln('size of NSSecureTextField is wrong: ',class_getInstanceSize(TDerivedNSSecureTextField),' <> ',class_getInstanceSize(NSSecureTextField)+1);
+ if class_getInstanceSize(TDerivedNSSecureTextFieldCell) <> (class_getInstanceSize(NSSecureTextFieldCell)+1) then
+ writeln('size of NSSecureTextFieldCell is wrong: ',class_getInstanceSize(TDerivedNSSecureTextFieldCell),' <> ',class_getInstanceSize(NSSecureTextFieldCell)+1);
+ if class_getInstanceSize(TDerivedNSSegmentedControl) <> (class_getInstanceSize(NSSegmentedControl)+1) then
+ writeln('size of NSSegmentedControl is wrong: ',class_getInstanceSize(TDerivedNSSegmentedControl),' <> ',class_getInstanceSize(NSSegmentedControl)+1);
+ if class_getInstanceSize(TDerivedNSShadow) <> (class_getInstanceSize(NSShadow)+1) then
+ writeln('size of NSShadow is wrong: ',class_getInstanceSize(TDerivedNSShadow),' <> ',class_getInstanceSize(NSShadow)+1);
+ if class_getInstanceSize(TDerivedNSSlider) <> (class_getInstanceSize(NSSlider)+1) then
+ writeln('size of NSSlider is wrong: ',class_getInstanceSize(TDerivedNSSlider),' <> ',class_getInstanceSize(NSSlider)+1);
+ if class_getInstanceSize(TDerivedNSSliderCell) <> (class_getInstanceSize(NSSliderCell)+1) then
+ writeln('size of NSSliderCell is wrong: ',class_getInstanceSize(TDerivedNSSliderCell),' <> ',class_getInstanceSize(NSSliderCell)+1);
+ if class_getInstanceSize(TDerivedNSSound) <> (class_getInstanceSize(NSSound)+1) then
+ writeln('size of NSSound is wrong: ',class_getInstanceSize(TDerivedNSSound),' <> ',class_getInstanceSize(NSSound)+1);
+ if class_getInstanceSize(TDerivedNSSpeechRecognizer) <> (class_getInstanceSize(NSSpeechRecognizer)+1) then
+ writeln('size of NSSpeechRecognizer is wrong: ',class_getInstanceSize(TDerivedNSSpeechRecognizer),' <> ',class_getInstanceSize(NSSpeechRecognizer)+1);
+ if class_getInstanceSize(TDerivedNSSpeechSynthesizer) <> (class_getInstanceSize(NSSpeechSynthesizer)+1) then
+ writeln('size of NSSpeechSynthesizer is wrong: ',class_getInstanceSize(TDerivedNSSpeechSynthesizer),' <> ',class_getInstanceSize(NSSpeechSynthesizer)+1);
+ if class_getInstanceSize(TDerivedNSSpellChecker) <> (class_getInstanceSize(NSSpellChecker)+1) then
+ writeln('size of NSSpellChecker is wrong: ',class_getInstanceSize(TDerivedNSSpellChecker),' <> ',class_getInstanceSize(NSSpellChecker)+1);
+ if class_getInstanceSize(TDerivedNSSplitView) <> (class_getInstanceSize(NSSplitView)+1) then
+ writeln('size of NSSplitView is wrong: ',class_getInstanceSize(TDerivedNSSplitView),' <> ',class_getInstanceSize(NSSplitView)+1);
+ if class_getInstanceSize(TDerivedNSStatusBar) <> (class_getInstanceSize(NSStatusBar)+1) then
+ writeln('size of NSStatusBar is wrong: ',class_getInstanceSize(TDerivedNSStatusBar),' <> ',class_getInstanceSize(NSStatusBar)+1);
+ if class_getInstanceSize(TDerivedNSStatusItem) <> (class_getInstanceSize(NSStatusItem)+1) then
+ writeln('size of NSStatusItem is wrong: ',class_getInstanceSize(TDerivedNSStatusItem),' <> ',class_getInstanceSize(NSStatusItem)+1);
+ if class_getInstanceSize(TDerivedNSStepper) <> (class_getInstanceSize(NSStepper)+1) then
+ writeln('size of NSStepper is wrong: ',class_getInstanceSize(TDerivedNSStepper),' <> ',class_getInstanceSize(NSStepper)+1);
+ if class_getInstanceSize(TDerivedNSStepperCell) <> (class_getInstanceSize(NSStepperCell)+1) then
+ writeln('size of NSStepperCell is wrong: ',class_getInstanceSize(TDerivedNSStepperCell),' <> ',class_getInstanceSize(NSStepperCell)+1);
+ if class_getInstanceSize(TDerivedNSTableColumn) <> (class_getInstanceSize(NSTableColumn)+1) then
+ writeln('size of NSTableColumn is wrong: ',class_getInstanceSize(TDerivedNSTableColumn),' <> ',class_getInstanceSize(NSTableColumn)+1);
+ if class_getInstanceSize(TDerivedNSTableHeaderCell) <> (class_getInstanceSize(NSTableHeaderCell)+1) then
+ writeln('size of NSTableHeaderCell is wrong: ',class_getInstanceSize(TDerivedNSTableHeaderCell),' <> ',class_getInstanceSize(NSTableHeaderCell)+1);
+ if class_getInstanceSize(TDerivedNSTableHeaderView) <> (class_getInstanceSize(NSTableHeaderView)+1) then
+ writeln('size of NSTableHeaderView is wrong: ',class_getInstanceSize(TDerivedNSTableHeaderView),' <> ',class_getInstanceSize(NSTableHeaderView)+1);
+ if class_getInstanceSize(TDerivedNSTableView) <> (class_getInstanceSize(NSTableView)+1) then
+ writeln('size of NSTableView is wrong: ',class_getInstanceSize(TDerivedNSTableView),' <> ',class_getInstanceSize(NSTableView)+1);
+ if class_getInstanceSize(TDerivedNSTabView) <> (class_getInstanceSize(NSTabView)+1) then
+ writeln('size of NSTabView is wrong: ',class_getInstanceSize(TDerivedNSTabView),' <> ',class_getInstanceSize(NSTabView)+1);
+ if class_getInstanceSize(TDerivedNSTabViewItem) <> (class_getInstanceSize(NSTabViewItem)+1) then
+ writeln('size of NSTabViewItem is wrong: ',class_getInstanceSize(TDerivedNSTabViewItem),' <> ',class_getInstanceSize(NSTabViewItem)+1);
+ if class_getInstanceSize(TDerivedNSText) <> (class_getInstanceSize(NSText)+1) then
+ writeln('size of NSText is wrong: ',class_getInstanceSize(TDerivedNSText),' <> ',class_getInstanceSize(NSText)+1);
+ if class_getInstanceSize(TDerivedNSTextAttachmentCell) <> (class_getInstanceSize(NSTextAttachmentCell)+1) then
+ writeln('size of NSTextAttachmentCell is wrong: ',class_getInstanceSize(TDerivedNSTextAttachmentCell),' <> ',class_getInstanceSize(NSTextAttachmentCell)+1);
+ if class_getInstanceSize(TDerivedNSTextAttachment) <> (class_getInstanceSize(NSTextAttachment)+1) then
+ writeln('size of NSTextAttachment is wrong: ',class_getInstanceSize(TDerivedNSTextAttachment),' <> ',class_getInstanceSize(NSTextAttachment)+1);
+ if class_getInstanceSize(TDerivedNSTextContainer) <> (class_getInstanceSize(NSTextContainer)+1) then
+ writeln('size of NSTextContainer is wrong: ',class_getInstanceSize(TDerivedNSTextContainer),' <> ',class_getInstanceSize(NSTextContainer)+1);
+ if class_getInstanceSize(TDerivedNSTextField) <> (class_getInstanceSize(NSTextField)+1) then
+ writeln('size of NSTextField is wrong: ',class_getInstanceSize(TDerivedNSTextField),' <> ',class_getInstanceSize(NSTextField)+1);
+ if class_getInstanceSize(TDerivedNSTextFieldCell) <> (class_getInstanceSize(NSTextFieldCell)+1) then
+ writeln('size of NSTextFieldCell is wrong: ',class_getInstanceSize(TDerivedNSTextFieldCell),' <> ',class_getInstanceSize(NSTextFieldCell)+1);
+ if class_getInstanceSize(TDerivedNSTextList) <> (class_getInstanceSize(NSTextList)+1) then
+ writeln('size of NSTextList is wrong: ',class_getInstanceSize(TDerivedNSTextList),' <> ',class_getInstanceSize(NSTextList)+1);
+ if class_getInstanceSize(TDerivedNSTextStorage) <> (class_getInstanceSize(NSTextStorage)+1) then
+ writeln('size of NSTextStorage is wrong: ',class_getInstanceSize(TDerivedNSTextStorage),' <> ',class_getInstanceSize(NSTextStorage)+1);
+ if class_getInstanceSize(TDerivedNSTextBlock) <> (class_getInstanceSize(NSTextBlock)+1) then
+ writeln('size of NSTextBlock is wrong: ',class_getInstanceSize(TDerivedNSTextBlock),' <> ',class_getInstanceSize(NSTextBlock)+1);
+ if class_getInstanceSize(TDerivedNSTextTableBlock) <> (class_getInstanceSize(NSTextTableBlock)+1) then
+ writeln('size of NSTextTableBlock is wrong: ',class_getInstanceSize(TDerivedNSTextTableBlock),' <> ',class_getInstanceSize(NSTextTableBlock)+1);
+ if class_getInstanceSize(TDerivedNSTextTable) <> (class_getInstanceSize(NSTextTable)+1) then
+ writeln('size of NSTextTable is wrong: ',class_getInstanceSize(TDerivedNSTextTable),' <> ',class_getInstanceSize(NSTextTable)+1);
+ if class_getInstanceSize(TDerivedNSTextView) <> (class_getInstanceSize(NSTextView)+1) then
+ writeln('size of NSTextView is wrong: ',class_getInstanceSize(TDerivedNSTextView),' <> ',class_getInstanceSize(NSTextView)+1);
+ if class_getInstanceSize(TDerivedNSTokenField) <> (class_getInstanceSize(NSTokenField)+1) then
+ writeln('size of NSTokenField is wrong: ',class_getInstanceSize(TDerivedNSTokenField),' <> ',class_getInstanceSize(NSTokenField)+1);
+ if class_getInstanceSize(TDerivedNSTokenFieldCell) <> (class_getInstanceSize(NSTokenFieldCell)+1) then
+ writeln('size of NSTokenFieldCell is wrong: ',class_getInstanceSize(TDerivedNSTokenFieldCell),' <> ',class_getInstanceSize(NSTokenFieldCell)+1);
+ if class_getInstanceSize(TDerivedNSToolbar) <> (class_getInstanceSize(NSToolbar)+1) then
+ writeln('size of NSToolbar is wrong: ',class_getInstanceSize(TDerivedNSToolbar),' <> ',class_getInstanceSize(NSToolbar)+1);
+ if class_getInstanceSize(TDerivedNSToolbarItem) <> (class_getInstanceSize(NSToolbarItem)+1) then
+ writeln('size of NSToolbarItem is wrong: ',class_getInstanceSize(TDerivedNSToolbarItem),' <> ',class_getInstanceSize(NSToolbarItem)+1);
+ if class_getInstanceSize(TDerivedNSToolbarItemGroup) <> (class_getInstanceSize(NSToolbarItemGroup)+1) then
+ writeln('size of NSToolbarItemGroup is wrong: ',class_getInstanceSize(TDerivedNSToolbarItemGroup),' <> ',class_getInstanceSize(NSToolbarItemGroup)+1);
+ if class_getInstanceSize(TDerivedNSTrackingArea) <> (class_getInstanceSize(NSTrackingArea)+1) then
+ writeln('size of NSTrackingArea is wrong: ',class_getInstanceSize(TDerivedNSTrackingArea),' <> ',class_getInstanceSize(NSTrackingArea)+1);
+ if class_getInstanceSize(TDerivedNSTreeController) <> (class_getInstanceSize(NSTreeController)+1) then
+ writeln('size of NSTreeController is wrong: ',class_getInstanceSize(TDerivedNSTreeController),' <> ',class_getInstanceSize(NSTreeController)+1);
+ if class_getInstanceSize(TDerivedNSTreeNode) <> (class_getInstanceSize(NSTreeNode)+1) then
+ writeln('size of NSTreeNode is wrong: ',class_getInstanceSize(TDerivedNSTreeNode),' <> ',class_getInstanceSize(NSTreeNode)+1);
+ if class_getInstanceSize(TDerivedNSTypesetter) <> (class_getInstanceSize(NSTypesetter)+1) then
+ writeln('size of NSTypesetter is wrong: ',class_getInstanceSize(TDerivedNSTypesetter),' <> ',class_getInstanceSize(NSTypesetter)+1);
+ if class_getInstanceSize(TDerivedNSUserDefaultsController) <> (class_getInstanceSize(NSUserDefaultsController)+1) then
+ writeln('size of NSUserDefaultsController is wrong: ',class_getInstanceSize(TDerivedNSUserDefaultsController),' <> ',class_getInstanceSize(NSUserDefaultsController)+1);
+ if class_getInstanceSize(TDerivedNSView) <> (class_getInstanceSize(NSView)+1) then
+ writeln('size of NSView is wrong: ',class_getInstanceSize(TDerivedNSView),' <> ',class_getInstanceSize(NSView)+1);
+ if class_getInstanceSize(TDerivedNSViewController) <> (class_getInstanceSize(NSViewController)+1) then
+ writeln('size of NSViewController is wrong: ',class_getInstanceSize(TDerivedNSViewController),' <> ',class_getInstanceSize(NSViewController)+1);
+ if class_getInstanceSize(TDerivedNSWindow) <> (class_getInstanceSize(NSWindow)+1) then
+ writeln('size of NSWindow is wrong: ',class_getInstanceSize(TDerivedNSWindow),' <> ',class_getInstanceSize(NSWindow)+1);
+ if class_getInstanceSize(TDerivedNSWindowController) <> (class_getInstanceSize(NSWindowController)+1) then
+ writeln('size of NSWindowController is wrong: ',class_getInstanceSize(TDerivedNSWindowController),' <> ',class_getInstanceSize(NSWindowController)+1);
+ if class_getInstanceSize(TDerivedNSWorkspace) <> (class_getInstanceSize(NSWorkspace)+1) then
+ writeln('size of NSWorkspace is wrong: ',class_getInstanceSize(TDerivedNSWorkspace),' <> ',class_getInstanceSize(NSWorkspace)+1);
+end;
+begin
+ PrintGlue1;
+end.

+ 658 - 0
packages/cocoaint/src/NSDelegatesAll.pas

@@ -0,0 +1,658 @@
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.2 - Tue Sep 8 9:10:40 ICT 2009 }
+
+unit NSDelegatesAll;
+interface
+
+{ Copy and paste these delegate methods into your real classes. }
+
+type
+  NSAlertDelegate = objccategory
+    function alertShowHelp(alert: NSAlert): Boolean; message 'alertShowHelp:';
+  end;
+
+type
+  NSAnimationDelegate = objccategory
+    procedure animation_didReachProgressMark(animation: NSAnimation; progress: NSAnimationProgress); message 'animation:didReachProgressMark:';
+    function animation_valueForProgress(animation: NSAnimation; progress: NSAnimationProgress): single; message 'animation:valueForProgress:';
+    procedure animationDidEnd(animation: NSAnimation); message 'animationDidEnd:';
+    procedure animationDidStop(animation: NSAnimation); message 'animationDidStop:';
+    function animationShouldStart(animation: NSAnimation): Boolean; message 'animationShouldStart:';
+  end;
+
+type
+  NSApplicationDelegate = objccategory
+    function application_openFile(sender: NSApplication; filename: NSString): Boolean; message 'application:openFile:';
+    function application_openFileWithoutUI(sender: id; filename: NSString): Boolean; message 'application:openFileWithoutUI:';
+    procedure application_openFiles(sender: NSApplication; filenames: NSArray); message 'application:openFiles:';
+    function application_openTempFile(sender: NSApplication; filename: NSString): Boolean; message 'application:openTempFile:';
+    function application_printFile(sender: NSApplication; filename: NSString): Boolean; message 'application:printFile:';
+    procedure application_printFiles(sender: NSApplication; filenames: NSArray); message 'application:printFiles:';
+    function application_printFiles_withSettings_showPrintPanels(application: NSApplication; fileNames: NSArray; printSettings: NSDictionary; showPrintPanels: Boolean): NSApplicationPrintReply; message 'application:printFiles:withSettings:showPrintPanels:';
+    function application_willPresentError(application: NSApplication; error: NSError): NSError; message 'application:willPresentError:';
+    function applicationDockMenu(sender: NSApplication): NSMenu; message 'applicationDockMenu:';
+    function applicationOpenUntitledFile(sender: NSApplication): Boolean; message 'applicationOpenUntitledFile:';
+    function applicationShouldHandleReopen_hasVisibleWindows(sender: NSApplication; flag: Boolean): Boolean; message 'applicationShouldHandleReopen:hasVisibleWindows:';
+    function applicationShouldOpenUntitledFile(sender: NSApplication): Boolean; message 'applicationShouldOpenUntitledFile:';
+    function applicationShouldTerminate(sender: NSApplication): NSApplicationTerminateReply; message 'applicationShouldTerminate:';
+    function applicationShouldTerminateAfterLastWindowClosed(sender: NSApplication): Boolean; message 'applicationShouldTerminateAfterLastWindowClosed:';
+  end;
+
+type
+  NSApplicationNotifications = objccategory
+    procedure applicationDidBecomeActive(notification: NSNotification); message 'applicationDidBecomeActive:';
+    procedure applicationDidChangeScreenParameters(notification: NSNotification); message 'applicationDidChangeScreenParameters:';
+    procedure applicationDidFinishLaunching(notification: NSNotification); message 'applicationDidFinishLaunching:';
+    procedure applicationDidHide(notification: NSNotification); message 'applicationDidHide:';
+    procedure applicationDidResignActive(notification: NSNotification); message 'applicationDidResignActive:';
+    procedure applicationDidUnhide(notification: NSNotification); message 'applicationDidUnhide:';
+    procedure applicationDidUpdate(notification: NSNotification); message 'applicationDidUpdate:';
+    procedure applicationWillBecomeActive(notification: NSNotification); message 'applicationWillBecomeActive:';
+    procedure applicationWillFinishLaunching(notification: NSNotification); message 'applicationWillFinishLaunching:';
+    procedure applicationWillHide(notification: NSNotification); message 'applicationWillHide:';
+    procedure applicationWillResignActive(notification: NSNotification); message 'applicationWillResignActive:';
+    procedure applicationWillTerminate(notification: NSNotification); message 'applicationWillTerminate:';
+    procedure applicationWillUnhide(notification: NSNotification); message 'applicationWillUnhide:';
+    procedure applicationWillUpdate(notification: NSNotification); message 'applicationWillUpdate:';
+  end;
+
+type
+  NSApplicationScriptingDelegation = objccategory
+    function application_delegateHandlesKey(sender: NSApplication; key: NSString): Boolean; message 'application:delegateHandlesKey:';
+  end;
+
+type
+  NSBrowserDelegate = objccategory
+    function browser_acceptDrop_atRow_column_dropOperation(browser: NSBrowser; info: id; row: clong; column: clong; dropOperation: NSBrowserDropOperation): Boolean; message 'browser:acceptDrop:atRow:column:dropOperation:';
+    function browser_canDragRowsWithIndexes_inColumn_withEvent(browser: NSBrowser; rowIndexes: NSIndexSet; column: clong; event: NSEvent): Boolean; message 'browser:canDragRowsWithIndexes:inColumn:withEvent:';
+    procedure browser_createRowsForColumn_inMatrix(sender: NSBrowser; column: clong; matrix: NSMatrix); message 'browser:createRowsForColumn:inMatrix:';
+    function browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset(browser: NSBrowser; rowIndexes: NSIndexSet; column: clong; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:';
+    function browser_isColumnValid(sender: NSBrowser; column: clong): Boolean; message 'browser:isColumnValid:';
+    function browser_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_inColumn(browser: NSBrowser; dropDestination: NSURL; rowIndexes: NSIndexSet; column: clong): NSArray; message 'browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn:';
+    function browser_nextTypeSelectMatchFromRow_toRow_inColumn_forString(browser: NSBrowser; startRow: clong; endRow: clong; column: clong; searchString: NSString): clong; message 'browser:nextTypeSelectMatchFromRow:toRow:inColumn:forString:';
+    function browser_numberOfRowsInColumn(sender: NSBrowser; column: clong): clong; message 'browser:numberOfRowsInColumn:';
+    function browser_selectCellWithString_inColumn(sender: NSBrowser; title: NSString; column: clong): Boolean; message 'browser:selectCellWithString:inColumn:';
+    function browser_selectRow_inColumn(sender: NSBrowser; row: clong; column: clong): Boolean; message 'browser:selectRow:inColumn:';
+    function browser_shouldShowCellExpansionForRow_column(browser: NSBrowser; row: clong; column: clong): Boolean; message 'browser:shouldShowCellExpansionForRow:column:';
+    function browser_shouldSizeColumn_forUserResize_toWidth(browser: NSBrowser; columnIndex: clong; forUserResize: Boolean; suggestedWidth: CGFloat): CGFloat; message 'browser:shouldSizeColumn:forUserResize:toWidth:';
+    function browser_shouldTypeSelectForEvent_withCurrentSearchString(browser: NSBrowser; event: NSEvent; searchString: NSString): Boolean; message 'browser:shouldTypeSelectForEvent:withCurrentSearchString:';
+    function browser_sizeToFitWidthOfColumn(browser: NSBrowser; columnIndex: clong): CGFloat; message 'browser:sizeToFitWidthOfColumn:';
+    function browser_titleOfColumn(sender: NSBrowser; column: clong): NSString; message 'browser:titleOfColumn:';
+    function browser_typeSelectStringForRow_inColumn(browser: NSBrowser; row: clong; column: clong): NSString; message 'browser:typeSelectStringForRow:inColumn:';
+    function browser_validateDrop_proposedRow_column_dropOperation(browser: NSBrowser; info: id; row: clong; column: clong; dropOperation: NSBrowserDropOperation): NSDragOperation; message 'browser:validateDrop:proposedRow:column:dropOperation:';
+    procedure browser_willDisplayCell_atRow_column(sender: NSBrowser; cell_: id; row: clong; column: clong); message 'browser:willDisplayCell:atRow:column:';
+    function browser_writeRowsWithIndexes_inColumn_toPasteboard(browser: NSBrowser; rowIndexes: NSIndexSet; column: clong; pasteboard: NSPasteboard): Boolean; message 'browser:writeRowsWithIndexes:inColumn:toPasteboard:';
+    procedure browserColumnConfigurationDidChange(notification: NSNotification); message 'browserColumnConfigurationDidChange:';
+    procedure browserDidScroll(sender: NSBrowser); message 'browserDidScroll:';
+    procedure browserWillScroll(sender: NSBrowser); message 'browserWillScroll:';
+  end;
+
+type
+  NSComboBoxCellDataSource = objccategory
+    function comboBoxCell_completedString(aComboBoxCell: NSComboBoxCell; uncompletedString: NSString): NSString; message 'comboBoxCell:completedString:';
+    function comboBoxCell_indexOfItemWithStringValue(aComboBoxCell: NSComboBoxCell; string_: NSString): culong; message 'comboBoxCell:indexOfItemWithStringValue:';
+    function comboBoxCell_objectValueForItemAtIndex(aComboBoxCell: NSComboBoxCell; index: clong): id; message 'comboBoxCell:objectValueForItemAtIndex:';
+    function numberOfItemsInComboBoxCell(comboBoxCell: NSComboBoxCell): clong; message 'numberOfItemsInComboBoxCell:';
+  end;
+
+type
+  NSComboBoxDataSource = objccategory
+    function comboBox_completedString(aComboBox: NSComboBox; string_: NSString): NSString; message 'comboBox:completedString:';
+    function comboBox_indexOfItemWithStringValue(aComboBox: NSComboBox; string_: NSString): culong; message 'comboBox:indexOfItemWithStringValue:';
+    function comboBox_objectValueForItemAtIndex(aComboBox: NSComboBox; index: clong): id; message 'comboBox:objectValueForItemAtIndex:';
+    function numberOfItemsInComboBox(aComboBox: NSComboBox): clong; message 'numberOfItemsInComboBox:';
+  end;
+
+type
+  NSComboBoxNotifications = objccategory
+    procedure comboBoxSelectionDidChange(notification: NSNotification); message 'comboBoxSelectionDidChange:';
+    procedure comboBoxSelectionIsChanging(notification: NSNotification); message 'comboBoxSelectionIsChanging:';
+    procedure comboBoxWillDismiss(notification: NSNotification); message 'comboBoxWillDismiss:';
+    procedure comboBoxWillPopUp(notification: NSNotification); message 'comboBoxWillPopUp:';
+  end;
+
+type
+  NSConnectionDelegateMethods = objccategory
+    function authenticateComponents_withData(components: NSArray; signature: NSData): Boolean; message 'authenticateComponents:withData:';
+    function authenticationDataForComponents(components: NSArray): NSData; message 'authenticationDataForComponents:';
+    function connection_shouldMakeNewConnection(ancestor: NSConnection; conn: NSConnection): Boolean; message 'connection:shouldMakeNewConnection:';
+    function createConversationForConnection(conn: NSConnection): id; message 'createConversationForConnection:';
+    function makeNewConnection_sender(conn: NSConnection; ancestor: NSConnection): Boolean; message 'makeNewConnection:sender:';
+  end;
+
+type
+  NSControlSubclassDelegate = objccategory
+    function control_didFailToFormatString_errorDescription(control: NSControl; string_: NSString; error: NSString): Boolean; message 'control:didFailToFormatString:errorDescription:';
+    procedure control_didFailToValidatePartialString_errorDescription(control: NSControl; string_: NSString; error: NSString); message 'control:didFailToValidatePartialString:errorDescription:';
+    function control_isValidObject(control: NSControl; obj: id): Boolean; message 'control:isValidObject:';
+    function control_textShouldBeginEditing(control: NSControl; fieldEditor: NSText): Boolean; message 'control:textShouldBeginEditing:';
+    function control_textShouldEndEditing(control: NSControl; fieldEditor: NSText): Boolean; message 'control:textShouldEndEditing:';
+    function control_textView_completions_forPartialWordRange_indexOfSelectedItem(control: NSControl; textView: NSTextView; words: NSArray; charRange: NSRange; index: clong): NSArray; message 'control:textView:completions:forPartialWordRange:indexOfSelectedItem:';
+    function control_textView_doCommandBySelector(control: NSControl; textView: NSTextView; commandSelector: SEL): Boolean; message 'control:textView:doCommandBySelector:';
+  end;
+
+type
+  NSControlSubclassNotifications = objccategory
+    procedure controlTextDidBeginEditing(obj: NSNotification); message 'controlTextDidBeginEditing:';
+    procedure controlTextDidChange(obj: NSNotification); message 'controlTextDidChange:';
+    procedure controlTextDidEndEditing(obj: NSNotification); message 'controlTextDidEndEditing:';
+  end;
+
+type
+  NSCopyLinkMoveHandler = objccategory
+    function fileManager_shouldProceedAfterError(fm: NSFileManager; errorInfo: NSDictionary): Boolean; message 'fileManager:shouldProceedAfterError:';
+    procedure fileManager_willProcessPath(fm: NSFileManager; path: NSString); message 'fileManager:willProcessPath:';
+  end;
+
+type
+  NSDatePickerCellDelegate = objccategory
+    procedure datePickerCell_validateProposedDateValue_timeInterval(aDatePickerCell: NSDatePickerCell; proposedDateValue: NSDate; proposedTimeInterval: NSTimeInterval); message 'datePickerCell:validateProposedDateValue:timeInterval:';
+  end;
+
+type
+  NSDistantObjectRequestMethods = objccategory
+    function connection_handleRequest(connection_: NSConnection; doreq: NSDistantObjectRequest): Boolean; message 'connection:handleRequest:';
+  end;
+
+type
+  NSDraggingDestination = objccategory
+    procedure concludeDragOperation(sender: id); message 'concludeDragOperation:';
+    procedure draggingEnded(sender: id); message 'draggingEnded:';
+    function draggingEntered(sender: id): NSDragOperation; message 'draggingEntered:';
+    procedure draggingExited(sender: id); message 'draggingExited:';
+    function draggingUpdated(sender: id): NSDragOperation; message 'draggingUpdated:';
+    function performDragOperation(sender: id): Boolean; message 'performDragOperation:';
+    function prepareForDragOperation(sender: id): Boolean; message 'prepareForDragOperation:';
+    function wantsPeriodicDraggingUpdates: Boolean; message 'wantsPeriodicDraggingUpdates';
+  end;
+
+type
+  NSDraggingSource = objccategory
+    procedure draggedImage_beganAt(image: NSImage; screenPoint: NSPoint); message 'draggedImage:beganAt:';
+    procedure draggedImage_endedAt_deposited(image: NSImage; screenPoint: NSPoint; flag: Boolean); message 'draggedImage:endedAt:deposited:';
+    procedure draggedImage_endedAt_operation(image: NSImage; screenPoint: NSPoint; operation: NSDragOperation); message 'draggedImage:endedAt:operation:';
+    procedure draggedImage_movedTo(image: NSImage; screenPoint: NSPoint); message 'draggedImage:movedTo:';
+    function draggingSourceOperationMaskForLocal(flag: Boolean): NSDragOperation; message 'draggingSourceOperationMaskForLocal:';
+    function ignoreModifierKeysWhileDragging: Boolean; message 'ignoreModifierKeysWhileDragging';
+    function namesOfPromisedFilesDroppedAtDestination(dropDestination: NSURL): NSArray; message 'namesOfPromisedFilesDroppedAtDestination:';
+  end;
+
+type
+  NSDrawerDelegate = objccategory
+    function drawerShouldClose(sender: NSDrawer): Boolean; message 'drawerShouldClose:';
+    function drawerShouldOpen(sender: NSDrawer): Boolean; message 'drawerShouldOpen:';
+    function drawerWillResizeContents_toSize(sender: NSDrawer; contentSize: NSSize): NSSize; message 'drawerWillResizeContents:toSize:';
+  end;
+
+type
+  NSDrawerNotifications = objccategory
+    procedure drawerDidClose(notification: NSNotification); message 'drawerDidClose:';
+    procedure drawerDidOpen(notification: NSNotification); message 'drawerDidOpen:';
+    procedure drawerWillClose(notification: NSNotification); message 'drawerWillClose:';
+    procedure drawerWillOpen(notification: NSNotification); message 'drawerWillOpen:';
+  end;
+
+type
+  NSEditorRegistration = objccategory
+    procedure objectDidBeginEditing(editor: id); message 'objectDidBeginEditing:';
+    procedure objectDidEndEditing(editor: id); message 'objectDidEndEditing:';
+  end;
+
+type
+  NSFileManagerFileOperationAdditions = objccategory
+    function fileManager_shouldCopyItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldCopyItemAtPath:toPath:';
+    function fileManager_shouldLinkItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldLinkItemAtPath:toPath:';
+    function fileManager_shouldMoveItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldMoveItemAtPath:toPath:';
+    function fileManager_shouldProceedAfterError_copyingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:';
+    function fileManager_shouldProceedAfterError_linkingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:';
+    function fileManager_shouldProceedAfterError_movingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:movingItemAtPath:toPath:';
+    function fileManager_shouldProceedAfterError_removingItemAtPath(fileManager: NSFileManager; error: NSError; path: NSString): Boolean; message 'fileManager:shouldProceedAfterError:removingItemAtPath:';
+    function fileManager_shouldRemoveItemAtPath(fileManager: NSFileManager; path: NSString): Boolean; message 'fileManager:shouldRemoveItemAtPath:';
+  end;
+
+type
+  NSFontManagerDelegate = objccategory
+    function fontManager_willIncludeFont(sender: id; fontName: NSString): Boolean; message 'fontManager:willIncludeFont:';
+  end;
+
+type
+  NSImageDelegate = objccategory
+    procedure image_didLoadPartOfRepresentation_withValidRows(image: NSImage; rep: NSImageRep; rows: clong); message 'image:didLoadPartOfRepresentation:withValidRows:';
+    procedure image_didLoadRepresentation_withStatus(image: NSImage; rep: NSImageRep; status: NSImageLoadStatus); message 'image:didLoadRepresentation:withStatus:';
+    procedure image_didLoadRepresentationHeader(image: NSImage; rep: NSImageRep); message 'image:didLoadRepresentationHeader:';
+    procedure image_willLoadRepresentation(image: NSImage; rep: NSImageRep); message 'image:willLoadRepresentation:';
+    function imageDidNotDraw_inRect(sender: id; aRect: NSRect): NSImage; message 'imageDidNotDraw:inRect:';
+  end;
+
+type
+  NSKeyValueObserverNotification = objccategory
+    procedure didChange_valuesAtIndexes_forKey(changeKind: NSKeyValueChange; indexes: NSIndexSet; key: NSString); message 'didChange:valuesAtIndexes:forKey:';
+    procedure didChangeValueForKey(key: NSString); message 'didChangeValueForKey:';
+    procedure didChangeValueForKey_withSetMutation_usingObjects(key: NSString; mutationKind: NSKeyValueSetMutationKind; objects: NSSet); message 'didChangeValueForKey:withSetMutation:usingObjects:';
+    procedure willChange_valuesAtIndexes_forKey(changeKind: NSKeyValueChange; indexes: NSIndexSet; key: NSString); message 'willChange:valuesAtIndexes:forKey:';
+    procedure willChangeValueForKey(key: NSString); message 'willChangeValueForKey:';
+    procedure willChangeValueForKey_withSetMutation_usingObjects(key: NSString; mutationKind: NSKeyValueSetMutationKind; objects: NSSet); message 'willChangeValueForKey:withSetMutation:usingObjects:';
+  end;
+
+type
+  NSKeyedArchiverDelegate = objccategory
+    procedure archiver_didEncodeObject(archiver: NSKeyedArchiver; object_: id); message 'archiver:didEncodeObject:';
+    function archiver_willEncodeObject(archiver: NSKeyedArchiver; object_: id): id; message 'archiver:willEncodeObject:';
+    procedure archiver_willReplaceObject_withObject(archiver: NSKeyedArchiver; object_: id; newObject: id); message 'archiver:willReplaceObject:withObject:';
+    procedure archiverDidFinish(archiver: NSKeyedArchiver); message 'archiverDidFinish:';
+    procedure archiverWillFinish(archiver: NSKeyedArchiver); message 'archiverWillFinish:';
+  end;
+
+type
+  NSKeyedUnarchiverDelegate = objccategory
+    function unarchiver_cannotDecodeObjectOfClassName_originalClasses(unarchiver: NSKeyedUnarchiver; name: NSString; classNames: NSArray): Pobjc_class; message 'unarchiver:cannotDecodeObjectOfClassName:originalClasses:';
+    function unarchiver_didDecodeObject(unarchiver: NSKeyedUnarchiver; object_: id): id; message 'unarchiver:didDecodeObject:';
+    procedure unarchiver_willReplaceObject_withObject(unarchiver: NSKeyedUnarchiver; object_: id; newObject: id); message 'unarchiver:willReplaceObject:withObject:';
+    procedure unarchiverDidFinish(unarchiver: NSKeyedUnarchiver); message 'unarchiverDidFinish:';
+    procedure unarchiverWillFinish(unarchiver: NSKeyedUnarchiver); message 'unarchiverWillFinish:';
+  end;
+
+type
+  NSLayoutManagerDelegate = objccategory
+    procedure layoutManager_didCompleteLayoutForTextContainer_atEnd(layoutManager: NSLayoutManager; textContainer: NSTextContainer; layoutFinishedFlag: Boolean); message 'layoutManager:didCompleteLayoutForTextContainer:atEnd:';
+    function layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange(layoutManager: NSLayoutManager; attrs: NSDictionary; toScreen: Boolean; charIndex: culong; effectiveCharRange: NSRangePointer): NSDictionary; message 'layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:';
+    procedure layoutManagerDidInvalidateLayout(sender: NSLayoutManager); message 'layoutManagerDidInvalidateLayout:';
+  end;
+
+type
+  NSMachPortDelegateMethods = objccategory
+    procedure handleMachMessage(msg: Pointer); message 'handleMachMessage:';
+  end;
+
+type
+  NSMenuDelegate = objccategory
+    function menu_updateItem_atIndex_shouldCancel(menu: NSMenu; item: NSMenuItem; index: clong; shouldCancel: Boolean): Boolean; message 'menu:updateItem:atIndex:shouldCancel:';
+    procedure menu_willHighlightItem(menu: NSMenu; item: NSMenuItem); message 'menu:willHighlightItem:';
+    procedure menuDidClose(menu: NSMenu); message 'menuDidClose:';
+    function menuHasKeyEquivalent_forEvent_target_action(menu: NSMenu; event: NSEvent; target: id; action: SEL): Boolean; message 'menuHasKeyEquivalent:forEvent:target:action:';
+    procedure menuNeedsUpdate(menu: NSMenu); message 'menuNeedsUpdate:';
+    procedure menuWillOpen(menu: NSMenu); message 'menuWillOpen:';
+    function numberOfItemsInMenu(menu: NSMenu): clong; message 'numberOfItemsInMenu:';
+  end;
+
+type
+  NSMetadataQueryDelegate = objccategory
+    function metadataQuery_replacementObjectForResultObject(query: NSMetadataQuery; result_: NSMetadataItem): id; message 'metadataQuery:replacementObjectForResultObject:';
+    function metadataQuery_replacementValueForAttribute_value(query: NSMetadataQuery; attrName: NSString; attrValue: id): id; message 'metadataQuery:replacementValueForAttribute:value:';
+  end;
+
+type
+  NSNetServiceBrowserDelegateMethods = objccategory
+    procedure netServiceBrowser_didFindDomain_moreComing(aNetServiceBrowser: NSNetServiceBrowser; domainString: NSString; moreComing: Boolean); message 'netServiceBrowser:didFindDomain:moreComing:';
+    procedure netServiceBrowser_didFindService_moreComing(aNetServiceBrowser: NSNetServiceBrowser; aNetService: NSNetService; moreComing: Boolean); message 'netServiceBrowser:didFindService:moreComing:';
+    procedure netServiceBrowser_didNotSearch(aNetServiceBrowser: NSNetServiceBrowser; errorDict: NSDictionary); message 'netServiceBrowser:didNotSearch:';
+    procedure netServiceBrowser_didRemoveDomain_moreComing(aNetServiceBrowser: NSNetServiceBrowser; domainString: NSString; moreComing: Boolean); message 'netServiceBrowser:didRemoveDomain:moreComing:';
+    procedure netServiceBrowser_didRemoveService_moreComing(aNetServiceBrowser: NSNetServiceBrowser; aNetService: NSNetService; moreComing: Boolean); message 'netServiceBrowser:didRemoveService:moreComing:';
+    procedure netServiceBrowserDidStopSearch(aNetServiceBrowser: NSNetServiceBrowser); message 'netServiceBrowserDidStopSearch:';
+    procedure netServiceBrowserWillSearch(aNetServiceBrowser: NSNetServiceBrowser); message 'netServiceBrowserWillSearch:';
+  end;
+
+type
+  NSNetServiceDelegateMethods = objccategory
+    procedure netService_didNotPublish(sender: NSNetService; errorDict: NSDictionary); message 'netService:didNotPublish:';
+    procedure netService_didNotResolve(sender: NSNetService; errorDict: NSDictionary); message 'netService:didNotResolve:';
+    procedure netService_didUpdateTXTRecordData(sender: NSNetService; data: NSData); message 'netService:didUpdateTXTRecordData:';
+    procedure netServiceDidPublish(sender: NSNetService); message 'netServiceDidPublish:';
+    procedure netServiceDidResolveAddress(sender: NSNetService); message 'netServiceDidResolveAddress:';
+    procedure netServiceDidStop(sender: NSNetService); message 'netServiceDidStop:';
+    procedure netServiceWillPublish(sender: NSNetService); message 'netServiceWillPublish:';
+    procedure netServiceWillResolve(sender: NSNetService); message 'netServiceWillResolve:';
+  end;
+
+type
+  NSOutlineViewDataSource = objccategory
+    function outlineView_acceptDrop_item_childIndex(outlineView: NSOutlineView; info: id; item: id; index: clong): Boolean; message 'outlineView:acceptDrop:item:childIndex:';
+    function outlineView_child_ofItem(outlineView: NSOutlineView; index: clong; item: id): id; message 'outlineView:child:ofItem:';
+    function outlineView_isItemExpandable(outlineView: NSOutlineView; item: id): Boolean; message 'outlineView:isItemExpandable:';
+    function outlineView_itemForPersistentObject(outlineView: NSOutlineView; object_: id): id; message 'outlineView:itemForPersistentObject:';
+    function outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems(outlineView: NSOutlineView; dropDestination: NSURL; items: NSArray): NSArray; message 'outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:';
+    function outlineView_numberOfChildrenOfItem(outlineView: NSOutlineView; item: id): clong; message 'outlineView:numberOfChildrenOfItem:';
+    function outlineView_objectValueForTableColumn_byItem(outlineView: NSOutlineView; tableColumn: NSTableColumn; item: id): id; message 'outlineView:objectValueForTableColumn:byItem:';
+    function outlineView_persistentObjectForItem(outlineView: NSOutlineView; item: id): id; message 'outlineView:persistentObjectForItem:';
+    procedure outlineView_setObjectValue_forTableColumn_byItem(outlineView: NSOutlineView; object_: id; tableColumn: NSTableColumn; item: id); message 'outlineView:setObjectValue:forTableColumn:byItem:';
+    procedure outlineView_sortDescriptorsDidChange(outlineView: NSOutlineView; oldDescriptors: NSArray); message 'outlineView:sortDescriptorsDidChange:';
+    function outlineView_validateDrop_proposedItem_proposedChildIndex(outlineView: NSOutlineView; info: id; item: id; index: clong): NSDragOperation; message 'outlineView:validateDrop:proposedItem:proposedChildIndex:';
+    function outlineView_writeItems_toPasteboard(outlineView: NSOutlineView; items: NSArray; pasteboard: NSPasteboard): Boolean; message 'outlineView:writeItems:toPasteboard:';
+  end;
+
+type
+  NSOutlineViewDelegate = objccategory
+    function outlineView_dataCellForTableColumn_item(outlineView: NSOutlineView; tableColumn: NSTableColumn; item: id): NSCell; message 'outlineView:dataCellForTableColumn:item:';
+    procedure outlineView_didClickTableColumn(outlineView: NSOutlineView; tableColumn: NSTableColumn); message 'outlineView:didClickTableColumn:';
+    procedure outlineView_didDragTableColumn(outlineView: NSOutlineView; tableColumn: NSTableColumn); message 'outlineView:didDragTableColumn:';
+    function outlineView_heightOfRowByItem(outlineView: NSOutlineView; item: id): CGFloat; message 'outlineView:heightOfRowByItem:';
+    function outlineView_isGroupItem(outlineView: NSOutlineView; item: id): Boolean; message 'outlineView:isGroupItem:';
+    procedure outlineView_mouseDownInHeaderOfTableColumn(outlineView: NSOutlineView; tableColumn: NSTableColumn); message 'outlineView:mouseDownInHeaderOfTableColumn:';
+    function outlineView_nextTypeSelectMatchFromItem_toItem_forString(outlineView: NSOutlineView; startItem: id; endItem: id; searchString: NSString): id; message 'outlineView:nextTypeSelectMatchFromItem:toItem:forString:';
+    function outlineView_selectionIndexesForProposedSelection(outlineView: NSOutlineView; proposedSelectionIndexes: NSIndexSet): NSIndexSet; message 'outlineView:selectionIndexesForProposedSelection:';
+    function outlineView_shouldCollapseItem(outlineView: NSOutlineView; item: id): Boolean; message 'outlineView:shouldCollapseItem:';
+    function outlineView_shouldEditTableColumn_item(outlineView: NSOutlineView; tableColumn: NSTableColumn; item: id): Boolean; message 'outlineView:shouldEditTableColumn:item:';
+    function outlineView_shouldExpandItem(outlineView: NSOutlineView; item: id): Boolean; message 'outlineView:shouldExpandItem:';
+    function outlineView_shouldSelectItem(outlineView: NSOutlineView; item: id): Boolean; message 'outlineView:shouldSelectItem:';
+    function outlineView_shouldSelectTableColumn(outlineView: NSOutlineView; tableColumn: NSTableColumn): Boolean; message 'outlineView:shouldSelectTableColumn:';
+    function outlineView_shouldShowCellExpansionForTableColumn_item(outlineView: NSOutlineView; tableColumn: NSTableColumn; item: id): Boolean; message 'outlineView:shouldShowCellExpansionForTableColumn:item:';
+    function outlineView_shouldTrackCell_forTableColumn_item(outlineView: NSOutlineView; cell_: NSCell; tableColumn: NSTableColumn; item: id): Boolean; message 'outlineView:shouldTrackCell:forTableColumn:item:';
+    function outlineView_shouldTypeSelectForEvent_withCurrentSearchString(outlineView: NSOutlineView; event: NSEvent; searchString: NSString): Boolean; message 'outlineView:shouldTypeSelectForEvent:withCurrentSearchString:';
+    function outlineView_toolTipForCell_rect_tableColumn_item_mouseLocation(outlineView: NSOutlineView; cell_: NSCell; rect: NSRectPointer; tableColumn: NSTableColumn; item: id; mouseLocation: NSPoint): NSString; message 'outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:';
+    function outlineView_typeSelectStringForTableColumn_item(outlineView: NSOutlineView; tableColumn: NSTableColumn; item: id): NSString; message 'outlineView:typeSelectStringForTableColumn:item:';
+    procedure outlineView_willDisplayCell_forTableColumn_item(outlineView: NSOutlineView; cell_: id; tableColumn: NSTableColumn; item: id); message 'outlineView:willDisplayCell:forTableColumn:item:';
+    procedure outlineView_willDisplayOutlineCell_forTableColumn_item(outlineView: NSOutlineView; cell_: id; tableColumn: NSTableColumn; item: id); message 'outlineView:willDisplayOutlineCell:forTableColumn:item:';
+    function selectionShouldChangeInOutlineView(outlineView: NSOutlineView): Boolean; message 'selectionShouldChangeInOutlineView:';
+  end;
+
+type
+  NSOutlineViewNotifications = objccategory
+    procedure outlineViewColumnDidMove(notification: NSNotification); message 'outlineViewColumnDidMove:';
+    procedure outlineViewColumnDidResize(notification: NSNotification); message 'outlineViewColumnDidResize:';
+    procedure outlineViewItemDidCollapse(notification: NSNotification); message 'outlineViewItemDidCollapse:';
+    procedure outlineViewItemDidExpand(notification: NSNotification); message 'outlineViewItemDidExpand:';
+    procedure outlineViewItemWillCollapse(notification: NSNotification); message 'outlineViewItemWillCollapse:';
+    procedure outlineViewItemWillExpand(notification: NSNotification); message 'outlineViewItemWillExpand:';
+    procedure outlineViewSelectionDidChange(notification: NSNotification); message 'outlineViewSelectionDidChange:';
+    procedure outlineViewSelectionIsChanging(notification: NSNotification); message 'outlineViewSelectionIsChanging:';
+  end;
+
+type
+  NSPasteboardOwner = objccategory
+    procedure pasteboard_provideDataForType(sender: NSPasteboard; type_: NSString); message 'pasteboard:provideDataForType:';
+    procedure pasteboardChangedOwner(sender: NSPasteboard); message 'pasteboardChangedOwner:';
+  end;
+
+type
+  NSPortDelegateMethods = objccategory
+    procedure handlePortMessage(message: NSPortMessage); message 'handlePortMessage:';
+  end;
+
+type
+  NSRuleEditorDelegateMethods = objccategory
+    function ruleEditor_child_forCriterion_withRowType(editor: NSRuleEditor; index: clong; criterion: id; rowType: NSRuleEditorRowType): id; message 'ruleEditor:child:forCriterion:withRowType:';
+    function ruleEditor_displayValueForCriterion_inRow(editor: NSRuleEditor; criterion: id; row: clong): id; message 'ruleEditor:displayValueForCriterion:inRow:';
+    function ruleEditor_numberOfChildrenForCriterion_withRowType(editor: NSRuleEditor; criterion: id; rowType: NSRuleEditorRowType): clong; message 'ruleEditor:numberOfChildrenForCriterion:withRowType:';
+    function ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow(editor: NSRuleEditor; criterion: id; value: id; row: clong): NSDictionary; message 'ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:';
+    procedure ruleEditorRowsDidChange(notification: NSNotification); message 'ruleEditorRowsDidChange:';
+  end;
+
+type
+  NSSavePanelDelegate = objccategory
+    function panel_compareFilename_with_caseSensitive(sender: id; name: NSString; name1: NSString; caseSensitive: Boolean): NSComparisonResult; message 'panel:compareFilename:with:caseSensitive:';
+    procedure panel_directoryDidChange(sender: id; path: NSString); message 'panel:directoryDidChange:';
+    function panel_isValidFilename(sender: id; filename_: NSString): Boolean; message 'panel:isValidFilename:';
+    function panel_shouldShowFilename(sender: id; filename_: NSString): Boolean; message 'panel:shouldShowFilename:';
+    function panel_userEnteredFilename_confirmed(sender: id; filename_: NSString; okFlag: Boolean): NSString; message 'panel:userEnteredFilename:confirmed:';
+    procedure panel_willExpand(sender: id; expanding: Boolean); message 'panel:willExpand:';
+    procedure panelSelectionDidChange(sender: id); message 'panelSelectionDidChange:';
+  end;
+
+type
+  NSSoundDelegateMethods = objccategory
+    procedure sound_didFinishPlaying(sound: NSSound; aBool: Boolean); message 'sound:didFinishPlaying:';
+  end;
+
+type
+  NSSpeechRecognizerDelegate = objccategory
+    procedure speechRecognizer_didRecognizeCommand(sender: NSSpeechRecognizer; command: id); message 'speechRecognizer:didRecognizeCommand:';
+  end;
+
+type
+  NSSpeechSynthesizerDelegate = objccategory
+    procedure speechSynthesizer_didEncounterErrorAtIndex_ofString_message(sender: NSSpeechSynthesizer; characterIndex: culong; string_: NSString; message: NSString); message 'speechSynthesizer:didEncounterErrorAtIndex:ofString:message:';
+    procedure speechSynthesizer_didEncounterSyncMessage(sender: NSSpeechSynthesizer; message: NSString); message 'speechSynthesizer:didEncounterSyncMessage:';
+    procedure speechSynthesizer_didFinishSpeaking(sender: NSSpeechSynthesizer; finishedSpeaking: Boolean); message 'speechSynthesizer:didFinishSpeaking:';
+    procedure speechSynthesizer_willSpeakPhoneme(sender: NSSpeechSynthesizer; phonemeOpcode: cshort); message 'speechSynthesizer:willSpeakPhoneme:';
+    procedure speechSynthesizer_willSpeakWord_ofString(sender: NSSpeechSynthesizer; characterRange: NSRange; string_: NSString); message 'speechSynthesizer:willSpeakWord:ofString:';
+  end;
+
+type
+  NSSpellServerDelegate = objccategory
+    function spellServer_checkGrammarInString_language_details(sender: NSSpellServer; stringToCheck: NSString; language: NSString; details: NSArray): NSRange; message 'spellServer:checkGrammarInString:language:details:';
+    procedure spellServer_didForgetWord_inLanguage(sender: NSSpellServer; word: NSString; language: NSString); message 'spellServer:didForgetWord:inLanguage:';
+    procedure spellServer_didLearnWord_inLanguage(sender: NSSpellServer; word: NSString; language: NSString); message 'spellServer:didLearnWord:inLanguage:';
+    function spellServer_findMisspelledWordInString_language_wordCount_countOnly(sender: NSSpellServer; stringToCheck: NSString; language: NSString; wordCount: clong; countOnly: Boolean): NSRange; message 'spellServer:findMisspelledWordInString:language:wordCount:countOnly:';
+    function spellServer_suggestCompletionsForPartialWordRange_inString_language(sender: NSSpellServer; range: NSRange; string_: NSString; language: NSString): NSArray; message 'spellServer:suggestCompletionsForPartialWordRange:inString:language:';
+    function spellServer_suggestGuessesForWord_inLanguage(sender: NSSpellServer; word: NSString; language: NSString): NSArray; message 'spellServer:suggestGuessesForWord:inLanguage:';
+  end;
+
+type
+  NSSplitViewDelegate = objccategory
+    function splitView_additionalEffectiveRectOfDividerAtIndex(splitView: NSSplitView; dividerIndex: clong): NSRect; message 'splitView:additionalEffectiveRectOfDividerAtIndex:';
+    function splitView_canCollapseSubview(splitView: NSSplitView; subview: NSView): Boolean; message 'splitView:canCollapseSubview:';
+    function splitView_constrainMaxCoordinate_ofSubviewAt(splitView: NSSplitView; proposedMaximumPosition: CGFloat; dividerIndex: clong): CGFloat; message 'splitView:constrainMaxCoordinate:ofSubviewAt:';
+    function splitView_constrainMinCoordinate_ofSubviewAt(splitView: NSSplitView; proposedMinimumPosition: CGFloat; dividerIndex: clong): CGFloat; message 'splitView:constrainMinCoordinate:ofSubviewAt:';
+    function splitView_constrainSplitPosition_ofSubviewAt(splitView: NSSplitView; proposedPosition: CGFloat; dividerIndex: clong): CGFloat; message 'splitView:constrainSplitPosition:ofSubviewAt:';
+    function splitView_effectiveRect_forDrawnRect_ofDividerAtIndex(splitView: NSSplitView; proposedEffectiveRect: NSRect; drawnRect: NSRect; dividerIndex: clong): NSRect; message 'splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:';
+    procedure splitView_resizeSubviewsWithOldSize(splitView: NSSplitView; oldSize: NSSize); message 'splitView:resizeSubviewsWithOldSize:';
+    function splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex(splitView: NSSplitView; subview: NSView; dividerIndex: clong): Boolean; message 'splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:';
+    function splitView_shouldHideDividerAtIndex(splitView: NSSplitView; dividerIndex: clong): Boolean; message 'splitView:shouldHideDividerAtIndex:';
+    procedure splitViewDidResizeSubviews(notification: NSNotification); message 'splitViewDidResizeSubviews:';
+    procedure splitViewWillResizeSubviews(notification: NSNotification); message 'splitViewWillResizeSubviews:';
+  end;
+
+type
+  NSStreamDelegateEventExtensions = objccategory
+    procedure stream_handleEvent(aStream: NSStream; eventCode: NSStreamEvent); message 'stream:handleEvent:';
+  end;
+
+type
+  NSTabViewDelegate = objccategory
+    procedure tabView_didSelectTabViewItem(tabView: NSTabView; tabViewItem: NSTabViewItem); message 'tabView:didSelectTabViewItem:';
+    function tabView_shouldSelectTabViewItem(tabView: NSTabView; tabViewItem: NSTabViewItem): Boolean; message 'tabView:shouldSelectTabViewItem:';
+    procedure tabView_willSelectTabViewItem(tabView: NSTabView; tabViewItem: NSTabViewItem); message 'tabView:willSelectTabViewItem:';
+    procedure tabViewDidChangeNumberOfTabViewItems(TabView: NSTabView); message 'tabViewDidChangeNumberOfTabViewItems:';
+  end;
+
+type
+  NSTableDataSource = objccategory
+    function numberOfRowsInTableView(tableView: NSTableView): clong; message 'numberOfRowsInTableView:';
+    function tableView_acceptDrop_row_dropOperation(tableView: NSTableView; info: id; row: clong; dropOperation: NSTableViewDropOperation): Boolean; message 'tableView:acceptDrop:row:dropOperation:';
+    function tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes(tableView: NSTableView; dropDestination: NSURL; indexSet: NSIndexSet): NSArray; message 'tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:';
+    function tableView_objectValueForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: clong): id; message 'tableView:objectValueForTableColumn:row:';
+    procedure tableView_setObjectValue_forTableColumn_row(tableView: NSTableView; object_: id; tableColumn: NSTableColumn; row: clong); message 'tableView:setObjectValue:forTableColumn:row:';
+    procedure tableView_sortDescriptorsDidChange(tableView: NSTableView; oldDescriptors: NSArray); message 'tableView:sortDescriptorsDidChange:';
+    function tableView_validateDrop_proposedRow_proposedDropOperation(tableView: NSTableView; info: id; row: clong; dropOperation: NSTableViewDropOperation): NSDragOperation; message 'tableView:validateDrop:proposedRow:proposedDropOperation:';
+    function tableView_writeRows_toPasteboard(tableView: NSTableView; rows: NSArray; pboard: NSPasteboard): Boolean; message 'tableView:writeRows:toPasteboard:';
+    function tableView_writeRowsWithIndexes_toPasteboard(tableView: NSTableView; rowIndexes: NSIndexSet; pboard: NSPasteboard): Boolean; message 'tableView:writeRowsWithIndexes:toPasteboard:';
+  end;
+
+type
+  NSTableViewDelegate = objccategory
+    function selectionShouldChangeInTableView(tableView: NSTableView): Boolean; message 'selectionShouldChangeInTableView:';
+    function tableView_dataCellForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: clong): NSCell; message 'tableView:dataCellForTableColumn:row:';
+    procedure tableView_didClickTableColumn(tableView: NSTableView; tableColumn: NSTableColumn); message 'tableView:didClickTableColumn:';
+    procedure tableView_didDragTableColumn(tableView: NSTableView; tableColumn: NSTableColumn); message 'tableView:didDragTableColumn:';
+    function tableView_heightOfRow(tableView: NSTableView; row: clong): CGFloat; message 'tableView:heightOfRow:';
+    function tableView_isGroupRow(tableView: NSTableView; row: clong): Boolean; message 'tableView:isGroupRow:';
+    procedure tableView_mouseDownInHeaderOfTableColumn(tableView: NSTableView; tableColumn: NSTableColumn); message 'tableView:mouseDownInHeaderOfTableColumn:';
+    function tableView_nextTypeSelectMatchFromRow_toRow_forString(tableView: NSTableView; startRow: clong; endRow: clong; searchString: NSString): clong; message 'tableView:nextTypeSelectMatchFromRow:toRow:forString:';
+    function tableView_selectionIndexesForProposedSelection(tableView: NSTableView; proposedSelectionIndexes: NSIndexSet): NSIndexSet; message 'tableView:selectionIndexesForProposedSelection:';
+    function tableView_shouldEditTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: clong): Boolean; message 'tableView:shouldEditTableColumn:row:';
+    function tableView_shouldSelectRow(tableView: NSTableView; row: clong): Boolean; message 'tableView:shouldSelectRow:';
+    function tableView_shouldSelectTableColumn(tableView: NSTableView; tableColumn: NSTableColumn): Boolean; message 'tableView:shouldSelectTableColumn:';
+    function tableView_shouldShowCellExpansionForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: clong): Boolean; message 'tableView:shouldShowCellExpansionForTableColumn:row:';
+    function tableView_shouldTrackCell_forTableColumn_row(tableView: NSTableView; cell_: NSCell; tableColumn: NSTableColumn; row: clong): Boolean; message 'tableView:shouldTrackCell:forTableColumn:row:';
+    function tableView_shouldTypeSelectForEvent_withCurrentSearchString(tableView: NSTableView; event: NSEvent; searchString: NSString): Boolean; message 'tableView:shouldTypeSelectForEvent:withCurrentSearchString:';
+    function tableView_toolTipForCell_rect_tableColumn_row_mouseLocation(tableView: NSTableView; cell_: NSCell; rect: NSRectPointer; tableColumn: NSTableColumn; row: clong; mouseLocation: NSPoint): NSString; message 'tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:';
+    function tableView_typeSelectStringForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: clong): NSString; message 'tableView:typeSelectStringForTableColumn:row:';
+    procedure tableView_willDisplayCell_forTableColumn_row(tableView: NSTableView; cell_: id; tableColumn: NSTableColumn; row: clong); message 'tableView:willDisplayCell:forTableColumn:row:';
+  end;
+
+type
+  NSTableViewNotifications = objccategory
+    procedure tableViewColumnDidMove(notification: NSNotification); message 'tableViewColumnDidMove:';
+    procedure tableViewColumnDidResize(notification: NSNotification); message 'tableViewColumnDidResize:';
+    procedure tableViewSelectionDidChange(notification: NSNotification); message 'tableViewSelectionDidChange:';
+    procedure tableViewSelectionIsChanging(notification: NSNotification); message 'tableViewSelectionIsChanging:';
+  end;
+
+type
+  NSTextDelegate = objccategory
+    procedure textDidBeginEditing(notification: NSNotification); message 'textDidBeginEditing:';
+    procedure textDidChange(notification: NSNotification); message 'textDidChange:';
+    procedure textDidEndEditing(notification: NSNotification); message 'textDidEndEditing:';
+    function textShouldBeginEditing(textObject: NSText): Boolean; message 'textShouldBeginEditing:';
+    function textShouldEndEditing(textObject: NSText): Boolean; message 'textShouldEndEditing:';
+  end;
+
+type
+  NSTextStorageDelegate = objccategory
+    procedure textStorageDidProcessEditing(notification: NSNotification); message 'textStorageDidProcessEditing:';
+    procedure textStorageWillProcessEditing(notification: NSNotification); message 'textStorageWillProcessEditing:';
+  end;
+
+type
+  NSTextViewDelegate = objccategory
+    procedure textView_clickedOnCell_inRect(textView: NSTextView; cell: id; cellFrame: NSRect); message 'textView:clickedOnCell:inRect:';
+    procedure textView_clickedOnCell_inRect_atIndex(textView: NSTextView; cell: id; cellFrame: NSRect; charIndex: culong); message 'textView:clickedOnCell:inRect:atIndex:';
+    function textView_clickedOnLink(textView: NSTextView; link: id): Boolean; message 'textView:clickedOnLink:';
+    function textView_clickedOnLink_atIndex(textView: NSTextView; link: id; charIndex: culong): Boolean; message 'textView:clickedOnLink:atIndex:';
+    function textView_completions_forPartialWordRange_indexOfSelectedItem(textView: NSTextView; words: NSArray; charRange: NSRange; index: clong): NSArray; message 'textView:completions:forPartialWordRange:indexOfSelectedItem:';
+    function textView_doCommandBySelector(textView: NSTextView; commandSelector: SEL): Boolean; message 'textView:doCommandBySelector:';
+    procedure textView_doubleClickedOnCell_inRect(textView: NSTextView; cell: id; cellFrame: NSRect); message 'textView:doubleClickedOnCell:inRect:';
+    procedure textView_doubleClickedOnCell_inRect_atIndex(textView: NSTextView; cell: id; cellFrame: NSRect; charIndex: culong); message 'textView:doubleClickedOnCell:inRect:atIndex:';
+    procedure textView_draggedCell_inRect_event(view: NSTextView; cell: id; rect: NSRect; event: NSEvent); message 'textView:draggedCell:inRect:event:';
+    procedure textView_draggedCell_inRect_event_atIndex(view: NSTextView; cell: id; rect: NSRect; event: NSEvent; charIndex: culong); message 'textView:draggedCell:inRect:event:atIndex:';
+    function textView_menu_forEvent_atIndex(view: NSTextView; menu_: NSMenu; event: NSEvent; charIndex: culong): NSMenu; message 'textView:menu:forEvent:atIndex:';
+    function textView_shouldChangeTextInRange_replacementString(textView: NSTextView; affectedCharRange: NSRange; replacementString: NSString): Boolean; message 'textView:shouldChangeTextInRange:replacementString:';
+    function textView_shouldChangeTextInRanges_replacementStrings(textView: NSTextView; affectedRanges: NSArray; replacementStrings: NSArray): Boolean; message 'textView:shouldChangeTextInRanges:replacementStrings:';
+    function textView_shouldChangeTypingAttributes_toAttributes(textView: NSTextView; oldTypingAttributes: NSDictionary; newTypingAttributes: NSDictionary): NSDictionary; message 'textView:shouldChangeTypingAttributes:toAttributes:';
+    function textView_shouldSetSpellingState_range(textView: NSTextView; value: clong; affectedCharRange: NSRange): clong; message 'textView:shouldSetSpellingState:range:';
+    function textView_willChangeSelectionFromCharacterRange_toCharacterRange(textView: NSTextView; oldSelectedCharRange: NSRange; newSelectedCharRange: NSRange): NSRange; message 'textView:willChangeSelectionFromCharacterRange:toCharacterRange:';
+    function textView_willChangeSelectionFromCharacterRanges_toCharacterRanges(textView: NSTextView; oldSelectedCharRanges: NSArray; newSelectedCharRanges: NSArray): NSArray; message 'textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:';
+    function textView_willDisplayToolTip_forCharacterAtIndex(textView: NSTextView; toolTip_: NSString; characterIndex: culong): NSString; message 'textView:willDisplayToolTip:forCharacterAtIndex:';
+    function textView_writablePasteboardTypesForCell_atIndex(view: NSTextView; cell: id; charIndex: culong): NSArray; message 'textView:writablePasteboardTypesForCell:atIndex:';
+    function textView_writeCell_atIndex_toPasteboard_type(view: NSTextView; cell: id; charIndex: culong; pboard: NSPasteboard; type_: NSString): Boolean; message 'textView:writeCell:atIndex:toPasteboard:type:';
+    procedure textViewDidChangeSelection(notification: NSNotification); message 'textViewDidChangeSelection:';
+    procedure textViewDidChangeTypingAttributes(notification: NSNotification); message 'textViewDidChangeTypingAttributes:';
+    function undoManagerForTextView(view: NSTextView): NSUndoManager; message 'undoManagerForTextView:';
+  end;
+
+type
+  NSTokenFieldCellDelegate = objccategory
+    function tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem(tokenFieldCell: NSTokenFieldCell; substring: NSString; tokenIndex: clong; selectedIndex: clong): NSArray; message 'tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:';
+    function tokenFieldCell_displayStringForRepresentedObject(tokenFieldCell: NSTokenFieldCell; representedObject_: id): NSString; message 'tokenFieldCell:displayStringForRepresentedObject:';
+    function tokenFieldCell_editingStringForRepresentedObject(tokenFieldCell: NSTokenFieldCell; representedObject_: id): NSString; message 'tokenFieldCell:editingStringForRepresentedObject:';
+    function tokenFieldCell_hasMenuForRepresentedObject(tokenFieldCell: NSTokenFieldCell; representedObject_: id): Boolean; message 'tokenFieldCell:hasMenuForRepresentedObject:';
+    function tokenFieldCell_menuForRepresentedObject(tokenFieldCell: NSTokenFieldCell; representedObject_: id): NSMenu; message 'tokenFieldCell:menuForRepresentedObject:';
+    function tokenFieldCell_readFromPasteboard(tokenFieldCell: NSTokenFieldCell; pboard: NSPasteboard): NSArray; message 'tokenFieldCell:readFromPasteboard:';
+    function tokenFieldCell_representedObjectForEditingString(tokenFieldCell: NSTokenFieldCell; editingString: NSString): id; message 'tokenFieldCell:representedObjectForEditingString:';
+    function tokenFieldCell_shouldAddObjects_atIndex(tokenFieldCell: NSTokenFieldCell; tokens: NSArray; index: culong): NSArray; message 'tokenFieldCell:shouldAddObjects:atIndex:';
+    function tokenFieldCell_styleForRepresentedObject(tokenFieldCell: NSTokenFieldCell; representedObject_: id): NSTokenStyle; message 'tokenFieldCell:styleForRepresentedObject:';
+    function tokenFieldCell_writeRepresentedObjects_toPasteboard(tokenFieldCell: NSTokenFieldCell; objects: NSArray; pboard: NSPasteboard): Boolean; message 'tokenFieldCell:writeRepresentedObjects:toPasteboard:';
+  end;
+
+type
+  NSTokenFieldDelegate = objccategory
+    function tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem(tokenField: NSTokenField; substring: NSString; tokenIndex: clong; selectedIndex: clong): NSArray; message 'tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:';
+    function tokenField_displayStringForRepresentedObject(tokenField: NSTokenField; representedObject: id): NSString; message 'tokenField:displayStringForRepresentedObject:';
+    function tokenField_editingStringForRepresentedObject(tokenField: NSTokenField; representedObject: id): NSString; message 'tokenField:editingStringForRepresentedObject:';
+    function tokenField_hasMenuForRepresentedObject(tokenField: NSTokenField; representedObject: id): Boolean; message 'tokenField:hasMenuForRepresentedObject:';
+    function tokenField_menuForRepresentedObject(tokenField: NSTokenField; representedObject: id): NSMenu; message 'tokenField:menuForRepresentedObject:';
+    function tokenField_readFromPasteboard(tokenField: NSTokenField; pboard: NSPasteboard): NSArray; message 'tokenField:readFromPasteboard:';
+    function tokenField_representedObjectForEditingString(tokenField: NSTokenField; editingString: NSString): id; message 'tokenField:representedObjectForEditingString:';
+    function tokenField_shouldAddObjects_atIndex(tokenField: NSTokenField; tokens: NSArray; index: culong): NSArray; message 'tokenField:shouldAddObjects:atIndex:';
+    function tokenField_styleForRepresentedObject(tokenField: NSTokenField; representedObject: id): NSTokenStyle; message 'tokenField:styleForRepresentedObject:';
+    function tokenField_writeRepresentedObjects_toPasteboard(tokenField: NSTokenField; objects: NSArray; pboard: NSPasteboard): Boolean; message 'tokenField:writeRepresentedObjects:toPasteboard:';
+  end;
+
+type
+  NSToolbarDelegate = objccategory
+    function toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(toolbar: NSToolbar; itemIdentifier: NSString; flag: Boolean): NSToolbarItem; message 'toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:';
+    function toolbarAllowedItemIdentifiers(toolbar: NSToolbar): NSArray; message 'toolbarAllowedItemIdentifiers:';
+    function toolbarDefaultItemIdentifiers(toolbar: NSToolbar): NSArray; message 'toolbarDefaultItemIdentifiers:';
+    function toolbarSelectableItemIdentifiers(toolbar: NSToolbar): NSArray; message 'toolbarSelectableItemIdentifiers:';
+  end;
+
+type
+  NSToolbarNotifications = objccategory
+    procedure toolbarDidRemoveItem(notification: NSNotification); message 'toolbarDidRemoveItem:';
+    procedure toolbarWillAddItem(notification: NSNotification); message 'toolbarWillAddItem:';
+  end;
+
+type
+  NSURLConnectionDelegate = objccategory
+    procedure connection_didCancelAuthenticationChallenge(connection: NSURLConnection; challenge: NSURLAuthenticationChallenge); message 'connection:didCancelAuthenticationChallenge:';
+    procedure connection_didFailWithError(connection: NSURLConnection; error: NSError); message 'connection:didFailWithError:';
+    procedure connection_didReceiveAuthenticationChallenge(connection: NSURLConnection; challenge: NSURLAuthenticationChallenge); message 'connection:didReceiveAuthenticationChallenge:';
+    procedure connection_didReceiveData(connection: NSURLConnection; data: NSData); message 'connection:didReceiveData:';
+    procedure connection_didReceiveResponse(connection: NSURLConnection; response: NSURLResponse); message 'connection:didReceiveResponse:';
+    function connection_willCacheResponse(connection: NSURLConnection; cachedResponse: NSCachedURLResponse): NSCachedURLResponse; message 'connection:willCacheResponse:';
+    function connection_willSendRequest_redirectResponse(connection: NSURLConnection; request: NSURLRequest; response: NSURLResponse): NSURLRequest; message 'connection:willSendRequest:redirectResponse:';
+    procedure connectionDidFinishLoading(connection: NSURLConnection); message 'connectionDidFinishLoading:';
+  end;
+
+type
+  NSURLDownloadDelegate = objccategory
+    procedure download_decideDestinationWithSuggestedFilename(download: NSURLDownload; filename: NSString); message 'download:decideDestinationWithSuggestedFilename:';
+    procedure download_didCancelAuthenticationChallenge(download: NSURLDownload; challenge: NSURLAuthenticationChallenge); message 'download:didCancelAuthenticationChallenge:';
+    procedure download_didCreateDestination(download: NSURLDownload; path: NSString); message 'download:didCreateDestination:';
+    procedure download_didFailWithError(download: NSURLDownload; error: NSError); message 'download:didFailWithError:';
+    procedure download_didReceiveAuthenticationChallenge(download: NSURLDownload; challenge: NSURLAuthenticationChallenge); message 'download:didReceiveAuthenticationChallenge:';
+    procedure download_didReceiveDataOfLength(download: NSURLDownload; length: culong); message 'download:didReceiveDataOfLength:';
+    procedure download_didReceiveResponse(download: NSURLDownload; response: NSURLResponse); message 'download:didReceiveResponse:';
+    function download_shouldDecodeSourceDataOfMIMEType(download: NSURLDownload; encodingType: NSString): Boolean; message 'download:shouldDecodeSourceDataOfMIMEType:';
+    procedure download_willResumeWithResponse_fromByte(download: NSURLDownload; response: NSURLResponse; startingByte: clonglong); message 'download:willResumeWithResponse:fromByte:';
+    function download_willSendRequest_redirectResponse(download: NSURLDownload; request_: NSURLRequest; redirectResponse: NSURLResponse): NSURLRequest; message 'download:willSendRequest:redirectResponse:';
+    procedure downloadDidBegin(download: NSURLDownload); message 'downloadDidBegin:';
+    procedure downloadDidFinish(download: NSURLDownload); message 'downloadDidFinish:';
+  end;
+
+type
+  NSWindowDelegate = objccategory
+    function window_shouldDragDocumentWithEvent_from_withPasteboard(window: NSWindow; event: NSEvent; dragImageLocation: NSPoint; pasteboard: NSPasteboard): Boolean; message 'window:shouldDragDocumentWithEvent:from:withPasteboard:';
+    function window_shouldPopUpDocumentPathMenu(window: NSWindow; menu_: NSMenu): Boolean; message 'window:shouldPopUpDocumentPathMenu:';
+    function window_willPositionSheet_usingRect(window: NSWindow; sheet: NSWindow; rect: NSRect): NSRect; message 'window:willPositionSheet:usingRect:';
+    function windowShouldClose(sender: id): Boolean; message 'windowShouldClose:';
+    function windowShouldZoom_toFrame(window: NSWindow; newFrame: NSRect): Boolean; message 'windowShouldZoom:toFrame:';
+    function windowWillResize_toSize(sender: NSWindow; frameSize: NSSize): NSSize; message 'windowWillResize:toSize:';
+    function windowWillReturnFieldEditor_toObject(sender: NSWindow; client: id): id; message 'windowWillReturnFieldEditor:toObject:';
+    function windowWillReturnUndoManager(window: NSWindow): NSUndoManager; message 'windowWillReturnUndoManager:';
+    function windowWillUseStandardFrame_defaultFrame(window: NSWindow; newFrame: NSRect): NSRect; message 'windowWillUseStandardFrame:defaultFrame:';
+  end;
+
+type
+  NSWindowNotifications = objccategory
+    procedure windowDidBecomeKey(notification: NSNotification); message 'windowDidBecomeKey:';
+    procedure windowDidBecomeMain(notification: NSNotification); message 'windowDidBecomeMain:';
+    procedure windowDidChangeScreen(notification: NSNotification); message 'windowDidChangeScreen:';
+    procedure windowDidChangeScreenProfile(notification: NSNotification); message 'windowDidChangeScreenProfile:';
+    procedure windowDidDeminiaturize(notification: NSNotification); message 'windowDidDeminiaturize:';
+    procedure windowDidEndSheet(notification: NSNotification); message 'windowDidEndSheet:';
+    procedure windowDidExpose(notification: NSNotification); message 'windowDidExpose:';
+    procedure windowDidMiniaturize(notification: NSNotification); message 'windowDidMiniaturize:';
+    procedure windowDidMove(notification: NSNotification); message 'windowDidMove:';
+    procedure windowDidResignKey(notification: NSNotification); message 'windowDidResignKey:';
+    procedure windowDidResignMain(notification: NSNotification); message 'windowDidResignMain:';
+    procedure windowDidResize(notification: NSNotification); message 'windowDidResize:';
+    procedure windowDidUpdate(notification: NSNotification); message 'windowDidUpdate:';
+    procedure windowWillBeginSheet(notification: NSNotification); message 'windowWillBeginSheet:';
+    procedure windowWillClose(notification: NSNotification); message 'windowWillClose:';
+    procedure windowWillMiniaturize(notification: NSNotification); message 'windowWillMiniaturize:';
+    procedure windowWillMove(notification: NSNotification); message 'windowWillMove:';
+  end;
+
+type
+  NSXMLParserDelegateEventAdditions = objccategory
+    procedure parser_didEndElement_namespaceURI_qualifiedName(parser: NSXMLParser; elementName: NSString; namespaceURI: NSString; qName: NSString); message 'parser:didEndElement:namespaceURI:qualifiedName:';
+    procedure parser_didEndMappingPrefix(parser: NSXMLParser; prefix: NSString); message 'parser:didEndMappingPrefix:';
+    procedure parser_didStartElement_namespaceURI_qualifiedName_attributes(parser: NSXMLParser; elementName: NSString; namespaceURI: NSString; qName: NSString; attributeDict: NSDictionary); message 'parser:didStartElement:namespaceURI:qualifiedName:attributes:';
+    procedure parser_didStartMappingPrefix_toURI(parser: NSXMLParser; prefix: NSString; namespaceURI: NSString); message 'parser:didStartMappingPrefix:toURI:';
+    procedure parser_foundAttributeDeclarationWithName_forElement_type_defaultValue(parser: NSXMLParser; attributeName: NSString; elementName: NSString; type_: NSString; defaultValue: NSString); message 'parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:';
+    procedure parser_foundCDATA(parser: NSXMLParser; CDATABlock: NSData); message 'parser:foundCDATA:';
+    procedure parser_foundCharacters(parser: NSXMLParser; string_: NSString); message 'parser:foundCharacters:';
+    procedure parser_foundComment(parser: NSXMLParser; comment: NSString); message 'parser:foundComment:';
+    procedure parser_foundElementDeclarationWithName_model(parser: NSXMLParser; elementName: NSString; model: NSString); message 'parser:foundElementDeclarationWithName:model:';
+    procedure parser_foundExternalEntityDeclarationWithName_publicID_systemID(parser: NSXMLParser; name: NSString; publicID_: NSString; systemID_: NSString); message 'parser:foundExternalEntityDeclarationWithName:publicID:systemID:';
+    procedure parser_foundIgnorableWhitespace(parser: NSXMLParser; whitespaceString: NSString); message 'parser:foundIgnorableWhitespace:';
+    procedure parser_foundInternalEntityDeclarationWithName_value(parser: NSXMLParser; name: NSString; value: NSString); message 'parser:foundInternalEntityDeclarationWithName:value:';
+    procedure parser_foundNotationDeclarationWithName_publicID_systemID(parser: NSXMLParser; name: NSString; publicID_: NSString; systemID_: NSString); message 'parser:foundNotationDeclarationWithName:publicID:systemID:';
+    procedure parser_foundProcessingInstructionWithTarget_data(parser: NSXMLParser; target: NSString; data: NSString); message 'parser:foundProcessingInstructionWithTarget:data:';
+    procedure parser_foundUnparsedEntityDeclarationWithName_publicID_systemID_notationName(parser: NSXMLParser; name: NSString; publicID_: NSString; systemID_: NSString; notationName: NSString); message 'parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:';
+    procedure parser_parseErrorOccurred(parser: NSXMLParser; parseError: NSError); message 'parser:parseErrorOccurred:';
+    function parser_resolveExternalEntityName_systemID(parser: NSXMLParser; name: NSString; systemID_: NSString): NSData; message 'parser:resolveExternalEntityName:systemID:';
+    procedure parser_validationErrorOccurred(parser: NSXMLParser; validationError: NSError); message 'parser:validationErrorOccurred:';
+    procedure parserDidEndDocument(parser: NSXMLParser); message 'parserDidEndDocument:';
+    procedure parserDidStartDocument(parser: NSXMLParser); message 'parserDidStartDocument:';
+  end;

+ 57 - 0
packages/cocoaint/src/UndefinedClasses.inc

@@ -0,0 +1,57 @@
+{MISSING CLASSES}
+NSTypesetter = NSObject;
+NSInvocation = id;
+NSPointerFunctions = id;
+NSManagedObjectContext = id;
+NSFetchRequest = id;
+CIColor = id;
+NSPredicateOperator = id;
+
+{"internal" classes that appeared in instance variables - declare as external?}
+NSURLAuthenticationChallengeInternal = id;
+NSURLCredentialInternal = id;
+NSURLCredentialStorageInternal = id;
+NSURLProtectionSpaceInternal = id;
+NSCachedURLResponseInternal = id;
+NSURLCacheInternal = id;
+NSURLConnectionInternal = id;
+NSURLProtocolInternal = id;
+NSURLRequestInternal = id;
+NSURLResponseInternal = id;
+NSHTTPURLResponseInternal = id;
+NSHTTPCookieInternal = id;
+NSHTTPCookieStorageInternal = id;
+NSURLDownloadInternal = id;
+
+{"auxiliary" instance variable classes - external?}
+_NSImageAuxiliary = id;
+_NSViewAuxiliary = id;
+NSWindowAuxiliary = id;
+NSSavePanelAuxiliary = id;
+
+{private instance variable classes - external?}
+NSNavView = id;
+NSMouseTracker = id;
+__NSOVRowEntry = id;
+NSStorage = id;
+NSRunStorage = id;
+NSSortedArray = id;
+NSTabWell = id;
+NSManagedObjectModel = id;
+
+{MISSING PROTOCOLS}
+NSCopyingProtocol = objcprotocol
+end; external;
+
+NSMutableCopyingProtocol = objcprotocol
+end; external;
+
+NSCodingProtocol = objcprotocol
+end; external;
+
+NSValidatedUserInterfaceItemProtocol = objcprotocol
+end; external;
+
+NSUserInterfaceValidationsProtocol = objcprotocol
+end; external;
+

+ 117 - 0
packages/cocoaint/src/UndefinedTypes.inc

@@ -0,0 +1,117 @@
+type
+  __NSAppleEventManagerSuspension = Pointer;
+ {$ifdef cpu64}
+  CGFloat = double;
+ {$else}
+  CGFloat = single;
+ {$endif}
+  UTF = UInt32;
+  NSPointerFunctionsOptions = UInt16;
+  URefCon = UInt32;
+  SRefCon = SInt32;
+  IBAction = Pointer;
+  CIContext = id;
+  CIFilter = id;
+  CIImage = id;
+  CALayer = id;
+  QTMovie = Pointer;
+  GLint = integer;
+  GLenum = integer;
+  GLsizei = integer;
+  GLbitfield = integer;
+  objc_protocol = protocol;
+
+{ Variable argument list - disabled for Pascal }
+type
+ va_list_rec = record
+ end;
+ va_list = ^va_list_rec;
+
+{ Private instance variable types }
+type
+ _NSImageCellAnimationState = Pointer;
+ _CGLPBufferObject = Pointer;
+ PATHSEGMENT = Pointer;		{from NSBezierPath.h what is this???}
+ 
+{ Pointer C-Types }
+type
+ NSIntegerPointer = pclong;
+ NSUIntegerPointer = pculong;
+ NSZonePointer = ^NSZone;
+ NSTimeIntervalPointer = ^double;
+
+{ An array of objects }
+type
+  NSObjectArrayOfObjects = array[0..(high(longint) div sizeof(id))-1] of id;
+  NSObjectArrayOfObjectsPtr = ^NSObjectArrayOfObjects;
+
+{ Cocoa types }
+const
+  NSIntegerMax = high(clong);
+  NSIntegerMin = low(clong);
+  NSUIntegerMax = high(culong);
+  NSNotFound = NSIntegerMax;
+
+const
+ UINT_MAX = high(culong);
+
+const
+ NX_TABLET_POINTER_UNKNOWN = 0;
+ NX_TABLET_POINTER_PEN = 1;
+ NX_TABLET_POINTER_CURSOR = 2;
+ NX_TABLET_POINTER_ERASER = 3;
+ 
+ NX_SUBTYPE_DEFAULT = 0;
+ NX_SUBTYPE_TABLET_POINT = 1;
+ NX_SUBTYPE_TABLET_PROXIMITY = 2;
+ 
+ NX_TABLET_BUTTON_PENTIPMASK = $0001;
+ NX_TABLET_BUTTON_PENLOWERSIDEMASK = $0002;
+ NX_TABLET_BUTTON_PENUPPERSIDEMASK = $0004;
+  
+{ The CFError API is not in MacOSAll! we need to port this for PasCocoa... } 
+type
+  CFErrorRef = Pointer;
+ 
+{ Parser hacks - these types should never exist }
+type
+  char_ = Pointer;
+  aeDesc_ = AEDesc;
+  CIContext_ = id;
+  CIImage_ = id;
+  NSRangePointerPointer = Pointer;
+  aeDesc_Pointer = Pointer;
+  __NSAppleEventManagerSuspensionPointer = Pointer;
+  
+{ Extra pointers for pass by reference arguments }
+{ NOTE: many of these were from records parsed that do not contain a pointer pair. Fix this later instead of declaring them here. }
+type
+ NSPropertyListFormatPointer = Pointer;
+ NSStringEncodingPointer = Pointer;
+ AppleEventPointer = ^AppleEvent;
+ NSGlyphPointer = Pointer;
+ CIColorPointer = Pointer;
+ NSDecimalPointer = Pointer;
+ CIImagePointer = Pointer;
+ NSTIFFCompressionPointer = Pointer;
+ CIImage_Pointer = Pointer;
+ CALayerPointer = Pointer;
+ CIFilterPointer = Pointer;
+ NSGlyphInscriptionPointer = Pointer;
+ NSOpenGLPixelFormatAttributePointer = Pointer;
+ GLintPointer = Pointer;
+ NSManagedObjectContextPointer = Pointer;
+ NSFetchRequestPointer = Pointer;
+ NSFastEnumerationStatePointer = Pointer;
+ 
+{ Parse bugs - these should have been parsed but were not due to errors }
+type
+  NSHashEnumerator = Pointer; {struct}
+  NSMapEnumerator = Pointer; {struct}
+  NSUncaughtExceptionHandler = Pointer; {function?}
+ 
+{ NSPointerFunctions - missing from where?? }
+const
+  NSPointerFunctionsZeroingWeakMemory = 1 shl 0;
+  NSPointerFunctionsCopyIn = 1 shl 16;
+  NSPointerFunctionsObjectPointerPersonality = 2 shl 8;

+ 65 - 0
packages/cocoaint/src/WebKit.pas

@@ -0,0 +1,65 @@
+unit WebKit;
+
+{$mode objfpc}
+{$modeswitch objectivec1}
+
+interface
+
+{$linkframework WebKit}
+
+uses
+  ctypes, CocoaAll, MacOSAll;
+  
+{$define INTERFACE}
+
+{$include webkit/UndefinedTypes.inc}
+
+{$define HEADER}
+{$include webkit/WebKit.inc}
+{$undef HEADER}
+
+{$define TYPES}
+{$include webkit/WebKit.inc}
+{$undef TYPES}
+
+{$define RECORDS}
+{$include webkit/WebKit.inc}
+{$undef RECORDS}
+
+type
+{$define FORWARD}
+{$include webkit/WebKit.inc}
+{$undef FORWARD}
+
+{$include webkit/UndefinedClasses.inc}
+
+{$define CLASSES}
+{$include webkit/WebKit.inc}
+{$undef CLASSES}
+ 
+{$define PROTOCOLS}
+{$include webkit/WebKit.inc}
+{$undef PROTOCOLS}
+
+{$define FUNCTIONS}
+{$include webkit/WebKit.inc}
+{$undef FUNCTIONS}
+
+{$define EXTERNAL_SYMBOLS}
+{$include webkit/WebKit.inc}
+{$undef EXTERNAL_SYMBOLS}
+
+{$define USER_PATCHES}
+{$include webkit/WebKit.inc}
+{$undef USER_PATCHES}
+
+{$undef INTERFACE}
+implementation
+{$define IMPLEMENTATION}
+
+{$define USER_PATCHES}
+{$include webkit/WebKit.inc}
+{$undef USER_PATCHES}
+
+{$undef IMPLEMENTATION}
+end.

+ 116 - 0
packages/cocoaint/src/WebKitDelegatesAll.pas

@@ -0,0 +1,116 @@
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Sat Oct 3 15:45:10 ICT 2009 }
+
+unit WebKitDelegatesAll;
+interface
+
+{ Copy and paste these delegate methods into your real classes. }
+
+type
+  WebDownloadDelegate = objccategory (NSObject)
+    function downloadWindowForAuthenticationSheet(download: WebDownload): NSWindow; message 'downloadWindowForAuthenticationSheet:';
+  end;
+
+type
+  WebFrameLoadDelegate = objccategory (NSObject)
+    procedure webView_didCancelClientRedirectForFrame(sender: WebView; frame: WebFrame); message 'webView:didCancelClientRedirectForFrame:';
+    procedure webView_didChangeLocationWithinPageForFrame(sender: WebView; frame: WebFrame); message 'webView:didChangeLocationWithinPageForFrame:';
+    procedure webView_didClearWindowObject_forFrame(webView_: WebView; windowObject_: WebScriptObject; frame: WebFrame); message 'webView:didClearWindowObject:forFrame:';
+    procedure webView_didCommitLoadForFrame(sender: WebView; frame: WebFrame); message 'webView:didCommitLoadForFrame:';
+    procedure webView_didFailLoadWithError_forFrame(sender: WebView; error: NSError; frame: WebFrame); message 'webView:didFailLoadWithError:forFrame:';
+    procedure webView_didFailProvisionalLoadWithError_forFrame(sender: WebView; error: NSError; frame: WebFrame); message 'webView:didFailProvisionalLoadWithError:forFrame:';
+    procedure webView_didFinishLoadForFrame(sender: WebView; frame: WebFrame); message 'webView:didFinishLoadForFrame:';
+    procedure webView_didReceiveIcon_forFrame(sender: WebView; image: NSImagePointer; frame: WebFrame); message 'webView:didReceiveIcon:forFrame:';
+    procedure webView_didReceiveServerRedirectForProvisionalLoadForFrame(sender: WebView; frame: WebFrame); message 'webView:didReceiveServerRedirectForProvisionalLoadForFrame:';
+    procedure webView_didReceiveTitle_forFrame(sender: WebView; title: NSString; frame: WebFrame); message 'webView:didReceiveTitle:forFrame:';
+    procedure webView_didStartProvisionalLoadForFrame(sender: WebView; frame: WebFrame); message 'webView:didStartProvisionalLoadForFrame:';
+    procedure webView_willCloseFrame(sender: WebView; frame: WebFrame); message 'webView:willCloseFrame:';
+    procedure webView_willPerformClientRedirectToURL_delay_fireDate_forFrame(sender: WebView; URL: NSURL; seconds: NSTimeInterval; date: NSDate; frame: WebFrame); message 'webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:';
+    procedure webView_windowScriptObjectAvailable(webView_: WebView; windowScriptObject: WebScriptObject); message 'webView:windowScriptObjectAvailable:';
+  end;
+
+type
+  WebPolicyDelegate = objccategory (NSObject)
+    procedure webView_decidePolicyForMIMEType_request_frame_decisionListener; message 'webView:decidePolicyForMIMEType:request:frame:decisionListener:';
+    procedure webView_decidePolicyForNavigationAction_request_frame_decisionListener; message 'webView:decidePolicyForNavigationAction:request:frame:decisionListener:';
+    procedure webView_decidePolicyForNewWindowAction_request_newFrameName_decisionListener; message 'webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:';
+    procedure webView_unableToImplementPolicyWithError_frame(webView: WebView; error: NSError; frame: WebFrame); message 'webView:unableToImplementPolicyWithError:frame:';
+  end;
+
+type
+  WebResourceLoadDelegate = objccategory (NSObject)
+    function webView_identifierForInitialRequest_fromDataSource(sender: WebView; request: NSURLRequest; dataSource: WebDataSource): id; message 'webView:identifierForInitialRequest:fromDataSource:';
+    procedure webView_plugInFailedWithError_dataSource(sender: WebView; error: NSError; dataSource: WebDataSource); message 'webView:plugInFailedWithError:dataSource:';
+    procedure webView_resource_didCancelAuthenticationChallenge_fromDataSource(sender: WebView; identifier: id; challenge: NSURLAuthenticationChallenge; dataSource: WebDataSource); message 'webView:resource:didCancelAuthenticationChallenge:fromDataSource:';
+    procedure webView_resource_didFailLoadingWithError_fromDataSource(sender: WebView; identifier: id; error: NSError; dataSource: WebDataSource); message 'webView:resource:didFailLoadingWithError:fromDataSource:';
+    procedure webView_resource_didFinishLoadingFromDataSource(sender: WebView; identifier: id; dataSource: WebDataSource); message 'webView:resource:didFinishLoadingFromDataSource:';
+    procedure webView_resource_didReceiveAuthenticationChallenge_fromDataSource(sender: WebView; identifier: id; challenge: NSURLAuthenticationChallenge; dataSource: WebDataSource); message 'webView:resource:didReceiveAuthenticationChallenge:fromDataSource:';
+    procedure webView_resource_didReceiveContentLength_fromDataSource(sender: WebView; identifier: id; length: WebNSInteger; dataSource: WebDataSource); message 'webView:resource:didReceiveContentLength:fromDataSource:';
+    procedure webView_resource_didReceiveResponse_fromDataSource(sender: WebView; identifier: id; response: NSURLResponse; dataSource: WebDataSource); message 'webView:resource:didReceiveResponse:fromDataSource:';
+    function webView_resource_willSendRequest_redirectResponse_fromDataSource(sender: WebView; identifier: id; request: NSURLRequest; redirectResponse: NSURLResponse; dataSource: WebDataSource): NSURLRequest; message 'webView:resource:willSendRequest:redirectResponse:fromDataSource:';
+  end;
+
+type
+  WebUIDelegate = objccategory (NSObject)
+    function webView_contextMenuItemsForElement_defaultMenuItems(sender: WebView; element: NSDictionary; defaultMenuItems: NSArray): NSArray; message 'webView:contextMenuItemsForElement:defaultMenuItems:';
+    function webView_createWebViewModalDialogWithRequest(sender: WebView; request: NSURLRequest): WebView; message 'webView:createWebViewModalDialogWithRequest:';
+    function webView_createWebViewWithRequest(sender: WebView; request: NSURLRequest): WebView; message 'webView:createWebViewWithRequest:';
+    function webView_dragDestinationActionMaskForDraggingInfo(webView: WebView; draggingInfo: id): WebNSUInteger; message 'webView:dragDestinationActionMaskForDraggingInfo:';
+    function webView_dragSourceActionMaskForPoint(webView: WebView; point: NSPoint): WebNSUInteger; message 'webView:dragSourceActionMaskForPoint:';
+    procedure webView_drawFooterInRect(sender: WebView; rect: NSRect); message 'webView:drawFooterInRect:';
+    procedure webView_drawHeaderInRect(sender: WebView; rect: NSRect); message 'webView:drawHeaderInRect:';
+    procedure webView_makeFirstResponder(sender: WebView; responder: NSResponderPointer); message 'webView:makeFirstResponder:';
+    procedure webView_mouseDidMoveOverElement_modifierFlags(sender: WebView; elementInformation: NSDictionary; modifierFlags: WebNSUInteger); message 'webView:mouseDidMoveOverElement:modifierFlags:';
+    procedure webView_printFrameView(sender: WebView; frameView: WebFrameView); message 'webView:printFrameView:';
+    function webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame(sender: WebView; message: NSString; frame: WebFrame): Boolean; message 'webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:';
+    procedure webView_runJavaScriptAlertPanelWithMessage(sender: WebView; message: NSString); message 'webView:runJavaScriptAlertPanelWithMessage:';
+    procedure webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame(sender: WebView; message: NSString; frame: WebFrame); message 'webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:';
+    function webView_runJavaScriptConfirmPanelWithMessage(sender: WebView; message: NSString): Boolean; message 'webView:runJavaScriptConfirmPanelWithMessage:';
+    function webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame(sender: WebView; message: NSString; frame: WebFrame): Boolean; message 'webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:';
+    function webView_runJavaScriptTextInputPanelWithPrompt_defaultText(sender: WebView; prompt: NSString; defaultText: NSString): NSString; message 'webView:runJavaScriptTextInputPanelWithPrompt:defaultText:';
+    function webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame(sender: WebView; prompt: NSString; defaultText: NSString; frame: WebFrame): NSString; message 'webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:';
+    procedure webView_runOpenPanelForFileButtonWithResultListener(sender: WebView; resultListener: id); message 'webView:runOpenPanelForFileButtonWithResultListener:';
+    procedure webView_setContentRect(sender: WebView; frame: NSRect); message 'webView:setContentRect:';
+    procedure webView_setFrame(sender: WebView; frame: NSRect); message 'webView:setFrame:';
+    procedure webView_setResizable(sender: WebView; resizable: Boolean); message 'webView:setResizable:';
+    procedure webView_setStatusBarVisible(sender: WebView; visible: Boolean); message 'webView:setStatusBarVisible:';
+    procedure webView_setStatusText(sender: WebView; text: NSString); message 'webView:setStatusText:';
+    procedure webView_setToolbarsVisible(sender: WebView; visible: Boolean); message 'webView:setToolbarsVisible:';
+    function webView_shouldPerformAction_fromSender(webView: WebView; action: SEL; sender: id): Boolean; message 'webView:shouldPerformAction:fromSender:';
+    function webView_validateUserInterfaceItem_defaultValidation(webView: WebView; item: id; defaultValidation: Boolean): Boolean; message 'webView:validateUserInterfaceItem:defaultValidation:';
+    procedure webView_willPerformDragDestinationAction_forDraggingInfo(webView: WebView; action: WebDragDestinationAction; draggingInfo: id); message 'webView:willPerformDragDestinationAction:forDraggingInfo:';
+    procedure webView_willPerformDragSourceAction_fromPoint_withPasteboard(webView: WebView; action: WebDragSourceAction; point: NSPoint; pasteboard: NSPasteboardPointer); message 'webView:willPerformDragSourceAction:fromPoint:withPasteboard:';
+    function webViewAreToolbarsVisible(sender: WebView): Boolean; message 'webViewAreToolbarsVisible:';
+    procedure webViewClose(sender: WebView); message 'webViewClose:';
+    function webViewContentRect(sender: WebView): NSRect; message 'webViewContentRect:';
+    function webViewFirstResponder(sender: WebView): NSResponder; message 'webViewFirstResponder:';
+    procedure webViewFocus(sender: WebView); message 'webViewFocus:';
+    function webViewFooterHeight(sender: WebView): single; message 'webViewFooterHeight:';
+    function webViewFrame(sender: WebView): NSRect; message 'webViewFrame:';
+    function webViewHeaderHeight(sender: WebView): single; message 'webViewHeaderHeight:';
+    function webViewIsResizable(sender: WebView): Boolean; message 'webViewIsResizable:';
+    function webViewIsStatusBarVisible(sender: WebView): Boolean; message 'webViewIsStatusBarVisible:';
+    procedure webViewRunModal(sender: WebView); message 'webViewRunModal:';
+    procedure webViewShow(sender: WebView); message 'webViewShow:';
+    function webViewStatusText(sender: WebView): NSString; message 'webViewStatusText:';
+    procedure webViewUnfocus(sender: WebView); message 'webViewUnfocus:';
+  end;
+
+type
+  WebViewEditingDelegate = objccategory (NSObject)
+    function undoManagerForWebView(webView: WebView): NSUndoManager; message 'undoManagerForWebView:';
+    function webView_doCommandBySelector(webView: WebView; selector: SEL): Boolean; message 'webView:doCommandBySelector:';
+    function webView_shouldApplyStyle_toElementsInDOMRange(webView: WebView; style: DOMCSSStyleDeclaration; range: DOMRange): Boolean; message 'webView:shouldApplyStyle:toElementsInDOMRange:';
+    function webView_shouldBeginEditingInDOMRange(webView: WebView; range: DOMRange): Boolean; message 'webView:shouldBeginEditingInDOMRange:';
+    function webView_shouldChangeSelectedDOMRange_toDOMRange_affinity_stillSelecting(webView: WebView; currentRange: DOMRange; proposedRange: DOMRange; selectionAffinity: NSSelectionAffinity; flag: Boolean): Boolean; message 'webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:';
+    function webView_shouldChangeTypingStyle_toStyle(webView: WebView; currentStyle: DOMCSSStyleDeclaration; proposedStyle: DOMCSSStyleDeclaration): Boolean; message 'webView:shouldChangeTypingStyle:toStyle:';
+    function webView_shouldDeleteDOMRange(webView: WebView; range: DOMRange): Boolean; message 'webView:shouldDeleteDOMRange:';
+    function webView_shouldEndEditingInDOMRange(webView: WebView; range: DOMRange): Boolean; message 'webView:shouldEndEditingInDOMRange:';
+    function webView_shouldInsertNode_replacingDOMRange_givenAction(webView: WebView; node: DOMNode; range: DOMRange; action: WebViewInsertAction): Boolean; message 'webView:shouldInsertNode:replacingDOMRange:givenAction:';
+    function webView_shouldInsertText_replacingDOMRange_givenAction(webView: WebView; text: NSString; range: DOMRange; action: WebViewInsertAction): Boolean; message 'webView:shouldInsertText:replacingDOMRange:givenAction:';
+    procedure webViewDidBeginEditing(notification: NSNotification); message 'webViewDidBeginEditing:';
+    procedure webViewDidChange(notification: NSNotification); message 'webViewDidChange:';
+    procedure webViewDidChangeSelection(notification: NSNotification); message 'webViewDidChangeSelection:';
+    procedure webViewDidChangeTypingStyle(notification: NSNotification); message 'webViewDidChangeTypingStyle:';
+    procedure webViewDidEndEditing(notification: NSNotification); message 'webViewDidEndEditing:';
+  end;
+

+ 181 - 0
packages/cocoaint/src/appkit/AppKit.inc

@@ -0,0 +1,181 @@
+{
+	AppKit.h
+	Application Kit
+	Copyright (c) 1994-2007, Apple Inc.
+	All rights reserved.
+
+	This file is included by all AppKit application source files for easy building.  Using this file is preferred over importing individual files because it will use a precompiled version.
+}
+
+
+{NOTE: These headers were added for compatibility}
+{$include CIColor.inc}
+{include NSValidatedUserInterfaceItem.inc}	// ??? NSValidatedUserInterfaceItem.h is not located in the current version in AppKit.framework.
+
+{From AppKit.h}
+{$include NSResponder.inc} 
+{$include NSGraphicsContext.inc} 
+{$include NSAccessibility.inc} 
+{$include NSAlert.inc} 
+{$include NSAnimationContext.inc} 
+{$include NSAppleScriptExtensions.inc} 
+{$include NSApplication.inc} 
+{$include NSParagraphStyle.inc} 
+{$include NSCell.inc} 
+{$include NSActionCell.inc} 
+{$include NSButtonCell.inc} 
+{$include NSDockTile.inc} 
+{$include NSFont.inc} 
+{$include NSFontDescriptor.inc} 
+{$include NSFontManager.inc} 
+{$include NSFormCell.inc} 
+{$include NSMenu.inc} 
+{$include NSMenuItem.inc} 
+{$include NSColor.inc} 
+{$include NSColorSpace.inc} 
+{$include NSBrowserCell.inc} 
+{$include NSColorList.inc} 
+{$include NSColorPicking.inc} 
+{$include NSColorPicker.inc} 
+{$include NSCursor.inc} 
+{$include NSDocument.inc} 
+{$include NSDocumentController.inc} 
+{$include NSDragging.inc} 
+{$include NSErrors.inc} 
+{$include NSEvent.inc} 
+{$include NSFileWrapper.inc} 
+{$include NSHelpManager.inc} 
+{$include NSGradient.inc} 
+{$include NSGraphics.inc} 
+{$include NSImage.inc} 
+{$include NSImageCell.inc} 
+{$include NSImageRep.inc} 
+{$include NSBitmapImageRep.inc} 
+{$include NSCachedImageRep.inc} 
+{$include NSCIImageRep.inc} 
+{$include NSCustomImageRep.inc} 
+{$include NSEPSImageRep.inc} 
+{$include NSNib.inc} 
+{$include NSNibLoading.inc} 
+{$include NSPrinter.inc} 
+{$include NSSpeechRecognizer.inc} 
+{$include NSSpeechSynthesizer.inc} 
+{$include NSSpellChecker.inc} 
+{$include NSPageLayout.inc} 
+{$include NSPasteboard.inc} 
+{$include NSPrintInfo.inc} 
+{$include NSPrintOperation.inc} 
+{$include NSScreen.inc} 
+{$include NSSliderCell.inc} 
+{$include NSSpellProtocol.inc} 
+{$include NSTextFieldCell.inc} 
+{$include NSTokenFieldCell.inc} 
+{$include NSTrackingArea.inc} 
+{$include NSView.inc} 
+{$include NSScrollView.inc} 
+{$include NSSplitView.inc} 
+{$include NSClipView.inc} 
+{$include NSText.inc} 
+{$include NSViewController.inc} 
+{$include NSControl.inc} 
+{$include NSButton.inc}
+{$include NSPopUpButton.inc} 
+{$include NSImageView.inc} 
+{$include NSColorWell.inc} 
+{$include NSBrowser.inc} 
+{$include NSMatrix.inc}
+{$include NSForm.inc} 
+{$include NSBox.inc}
+{$include NSScroller.inc} 
+{$include NSSegmentedControl.inc} 
+{$include NSSlider.inc} 
+{$include NSTextField.inc} 
+{$include NSTokenField.inc} 
+{$include NSWindow.inc}
+{$include NSPanel.inc} 
+{$include NSColorPanel.inc} 
+{$include NSFontPanel.inc}
+{$include NSPrintPanel.inc} 
+{$include NSSavePanel.inc} 
+{$include NSOpenPanel.inc} 
+{$include NSWindowController.inc} 
+{$include NSWorkspace.inc} 
+{$include NSComboBox.inc} 
+{$include NSComboBoxCell.inc} 
+{$include NSTableColumn.inc} 
+{$include NSTableHeaderCell.inc} 
+{$include NSTableHeaderView.inc} 
+{$include NSTableView.inc} 
+{$include NSOutlineView.inc} 
+{$include NSAttributedString.inc} 
+{$include NSLayoutManager.inc} 
+{$include NSTextStorage.inc} 
+{$include NSTextView.inc} 
+{$include NSTextContainer.inc} 
+{$include NSTextAttachment.inc} 
+{$include NSInputManager.inc} 
+{$include NSInputServer.inc} 
+{$include NSStringDrawing.inc} 
+{$include NSRulerMarker.inc} 
+{$include NSRulerView.inc} 
+{$include NSSecureTextField.inc} 
+{$include NSInterfaceStyle.inc} 
+{------------> NOT FOUND!}{include NSNibDeclarations.inc} 
+{$include NSProgressIndicator.inc} 
+{$include NSTabView.inc} 
+{$include NSTabViewItem.inc} 
+{$include NSMenuView.inc} 
+{$include NSMenuItemCell.inc} 
+{$include NSPopUpButtonCell.inc} 
+{$include NSAffineTransform.inc} 
+{$include NSBezierPath.inc} 
+{$include NSPICTImageRep.inc} 
+{$include NSStatusBar.inc} 
+{$include NSStatusItem.inc} 
+{$include NSSound.inc} 
+{$include NSMovie.inc} 
+{$include NSMovieView.inc} 
+{$include NSPDFImageRep.inc} 
+{$include NSQuickDrawView.inc} 
+{$include NSDrawer.inc} 
+{$include NSOpenGL.inc} 
+{$include NSOpenGLView.inc} 
+{$include NSApplicationScripting.inc} 
+{$include NSDocumentScripting.inc} 
+{$include NSTextStorageScripting.inc} 
+{$include NSToolbar.inc} 
+{$include NSToolbarItem.inc} 
+{$include NSToolbarItemGroup.inc} 
+{$include NSWindowScripting.inc} 
+{$include NSStepper.inc} 
+{$include NSStepperCell.inc} 
+{$include NSGlyphInfo.inc} 
+{$include NSShadow.inc} 
+{$include NSATSTypesetter.inc} 
+{$include NSGlyphGenerator.inc} 
+{$include NSSearchField.inc} 
+{$include NSSearchFieldCell.inc} 
+{$include NSController.inc} 
+{$include NSObjectController.inc} 
+{$include NSArrayController.inc} 
+{$include NSDictionaryController.inc} 
+{$include NSTreeNode.inc} 
+{$include NSTreeController.inc} 
+{$include NSUserDefaultsController.inc} 
+{$include NSKeyValueBinding.inc} 
+{$include NSTextList.inc} 
+{$include NSTextTable.inc} 
+{$include NSDatePickerCell.inc} 
+{$include NSDatePicker.inc} 
+{$include NSLevelIndicatorCell.inc} 
+{$include NSLevelIndicator.inc} 
+{$include NSAnimation.inc} 
+{$include NSPersistentDocument.inc} 
+{$include NSRuleEditor.inc} 
+{$include NSPredicateEditor.inc} 
+{include NSPredicateEditorRowTemplate.inc} 	// ??? this is missing from I don't know where
+{$include NSPathCell.inc} 
+{$include NSPathControl.inc} 
+{$include NSPathComponentCell.inc} 
+{$include NSCollectionView.inc} 
+{$include NSTextInputClient.inc} 

+ 0 - 0
packages/cocoaint/src/appkit/CIColor.inc


+ 118 - 0
packages/cocoaint/src/appkit/NSATSTypesetter.inc

@@ -0,0 +1,118 @@
+{ Parsed from Appkit.framework NSATSTypesetter.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSATSTYPESETTER_PAS_T}
+{$define NSATSTYPESETTER_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSATSTYPESETTER_PAS_R}
+{$define NSATSTYPESETTER_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSATSTYPESETTER_PAS_F}
+{$define NSATSTYPESETTER_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSATSTYPESETTER_PAS_S}
+{$define NSATSTYPESETTER_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSATSTypesetter = objcclass;
+  NSATSTypesetterPointer = ^NSATSTypesetter;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSATSTYPESETTER_PAS_C}
+{$define NSATSTYPESETTER_PAS_C}
+
+{ NSATSTypesetter }
+  NSATSTypesetter = objcclass(NSTypesetter)
+  private
+    _attributedString: NSAttributedString;
+    _paragraphGlyphRange: NSRange;
+    _paragraphSeparatorGlyphRange: NSRange;
+    _lineFragmentPadding: CGFloat;
+    _layoutManager: NSLayoutManager;
+    _textContainers: NSArray;
+    _currentTextContainer: NSTextContainer;
+    _currentTextContainerIndex: NSUInteger;
+    _currentTextContainerSize: NSSize;
+    _currentParagraphStyle: NSParagraphStyle;
+        _atsReserved: array[0..7] of Pointer;
+    __private: id;
+    
+  public
+    class function alloc: NSATSTypesetter; message 'alloc';
+
+    class function sharedTypesetter: id; message 'sharedTypesetter';
+
+    { Category: NSPantherCompatibility }
+    function lineFragmentRectForProposedRect_remainingRect(proposedRect: NSRect; remainingRect: NSRectPointer): NSRect; message 'lineFragmentRectForProposedRect:remainingRect:';
+
+    { Category: NSPrimitiveInterface }
+    function usesFontLeading: Boolean; message 'usesFontLeading';
+    procedure setUsesFontLeading(flag: Boolean); message 'setUsesFontLeading:';
+    function typesetterBehavior: NSTypesetterBehavior; message 'typesetterBehavior';
+    procedure setTypesetterBehavior(behavior: NSTypesetterBehavior); message 'setTypesetterBehavior:';
+    function hyphenationFactor: single; message 'hyphenationFactor';
+    procedure setHyphenationFactor(factor: single); message 'setHyphenationFactor:';
+    function lineFragmentPadding: CGFloat; message 'lineFragmentPadding';
+    procedure setLineFragmentPadding(padding: CGFloat); message 'setLineFragmentPadding:';
+    function substituteFontForFont(originalFont: NSFont): NSFont; message 'substituteFontForFont:';
+    function textTabForGlyphLocation_writingDirection_maxLocation(glyphLocation: CGFloat; direction: NSWritingDirection; maxLocation: CGFloat): NSTextTab; message 'textTabForGlyphLocation:writingDirection:maxLocation:';
+    function bidiProcessingEnabled: Boolean; message 'bidiProcessingEnabled';
+    procedure setBidiProcessingEnabled(flag: Boolean); message 'setBidiProcessingEnabled:';
+    procedure setAttributedString(attrString: NSAttributedString); message 'setAttributedString:';
+    function attributedString: NSAttributedString; message 'attributedString';
+    procedure setParagraphGlyphRange_separatorGlyphRange(paragraphRange: NSRange; paragraphSeparatorRange: NSRange); message 'setParagraphGlyphRange:separatorGlyphRange:';
+    function paragraphGlyphRange: NSRange; message 'paragraphGlyphRange';
+    function paragraphSeparatorGlyphRange: NSRange; message 'paragraphSeparatorGlyphRange';
+    function layoutParagraphAtPoint(lineFragmentOrigin: NSPointPointer): NSUInteger; message 'layoutParagraphAtPoint:';
+    function lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(glyphIndex: NSUInteger; rect: NSRect): CGFloat; message 'lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:';
+    function paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect(glyphIndex: NSUInteger; rect: NSRect): CGFloat; message 'paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:';
+    function paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(glyphIndex: NSUInteger; rect: NSRect): CGFloat; message 'paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:';
+    function layoutManager: NSLayoutManager; message 'layoutManager';
+    function currentTextContainer: NSTextContainer; message 'currentTextContainer';
+    procedure setHardInvalidation_forGlyphRange(flag: Boolean; glyphRange: NSRange); message 'setHardInvalidation:forGlyphRange:';
+    procedure getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin(lineFragmentRect: NSRectPointer; lineFragmentUsedRect: NSRectPointer; paragraphSeparatorGlyphRange_: NSRange; lineOrigin: NSPoint); message 'getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:';
+
+    { Category: NSLayoutPhaseInterface }
+    procedure willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset(lineRect: NSRectPointer; glyphRange: NSRange; usedRect: NSRectPointer; baselineOffset: psingle); message 'willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:';
+    function shouldBreakLineByWordBeforeCharacterAtIndex(charIndex: NSUInteger): Boolean; message 'shouldBreakLineByWordBeforeCharacterAtIndex:';
+    function shouldBreakLineByHyphenatingBeforeCharacterAtIndex(charIndex: NSUInteger): Boolean; message 'shouldBreakLineByHyphenatingBeforeCharacterAtIndex:';
+    function hyphenationFactorForGlyphAtIndex(glyphIndex: NSUInteger): single; message 'hyphenationFactorForGlyphAtIndex:';
+    function hyphenCharacterForGlyphAtIndex(glyphIndex: NSUInteger): UTF32Char; message 'hyphenCharacterForGlyphAtIndex:';
+    function boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex(glyphIndex: NSUInteger; textContainer: NSTextContainer; proposedRect: NSRect; glyphPosition: NSPoint; charIndex: NSUInteger): NSRect; message 'boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:';
+
+    { Category: NSGlyphStorageInterface }
+    function characterRangeForGlyphRange_actualGlyphRange(glyphRange: NSRange; actualGlyphRange: NSRangePointer): NSRange; message 'characterRangeForGlyphRange:actualGlyphRange:';
+    function glyphRangeForCharacterRange_actualCharacterRange(charRange: NSRange; actualCharRange: NSRangePointer): NSRange; message 'glyphRangeForCharacterRange:actualCharacterRange:';
+    function getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits(glyphsRange: NSRange; glyphBuffer: NSGlyphPointer; charIndexBuffer: NSUIntegerPointer; inscribeBuffer: NSGlyphInscriptionPointer; elasticBuffer: pboolean): NSUInteger; message 'getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:';
+    procedure setLineFragmentRect_forGlyphRange_usedRect_baselineOffset(fragmentRect: NSRect; glyphRange: NSRange; usedRect: NSRect; baselineOffset: CGFloat); message 'setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:';
+    procedure substituteGlyphsInRange_withGlyphs(glyphRange: NSRange; glyphs: NSGlyphPointer); message 'substituteGlyphsInRange:withGlyphs:';
+    procedure insertGlyph_atGlyphIndex_characterIndex(glyph: NSGlyph; glyphIndex: NSUInteger; characterIndex: NSUInteger); message 'insertGlyph:atGlyphIndex:characterIndex:';
+    procedure deleteGlyphsInRange(glyphRange: NSRange); message 'deleteGlyphsInRange:';
+    procedure setNotShownAttribute_forGlyphRange(flag: Boolean; glyphRange: NSRange); message 'setNotShownAttribute:forGlyphRange:';
+    procedure setDrawsOutsideLineFragment_forGlyphRange(flag: Boolean; glyphRange: NSRange); message 'setDrawsOutsideLineFragment:forGlyphRange:';
+    procedure setLocation_withAdvancements_forStartOfGlyphRange(location: NSPoint; advancements: psingle; glyphRange: NSRange); message 'setLocation:withAdvancements:forStartOfGlyphRange:';
+    procedure setAttachmentSize_forGlyphRange(attachmentSize: NSSize; glyphRange: NSRange); message 'setAttachmentSize:forGlyphRange:';
+    procedure setBidiLevels_forGlyphRange(levels: pbyte; glyphRange: NSRange); message 'setBidiLevels:forGlyphRange:';
+  end; external;
+
+{$endif}
+{$endif}

+ 230 - 0
packages/cocoaint/src/appkit/NSAccessibility.inc

@@ -0,0 +1,230 @@
+{ Parsed from Appkit.framework NSAccessibility.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSACCESSIBILITY_PAS_T}
+{$define NSACCESSIBILITY_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSACCESSIBILITY_PAS_R}
+{$define NSACCESSIBILITY_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSACCESSIBILITY_PAS_F}
+{$define NSACCESSIBILITY_PAS_F}
+
+{ Functions }
+function NSAccessibilityRoleDescription(rolePointer: NSString; subrolePointer: NSString): NSString; cdecl; external name 'NSAccessibilityRoleDescription';
+function NSAccessibilityRoleDescriptionForUIElement(element: id): NSString; cdecl; external name 'NSAccessibilityRoleDescriptionForUIElement';
+function NSAccessibilityActionDescription(actionPointer: NSString): NSString; cdecl; external name 'NSAccessibilityActionDescription';
+procedure NSAccessibilityRaiseBadArgumentException(element: id; attributePointer: NSString; value: id); cdecl; external name 'NSAccessibilityRaiseBadArgumentException';
+function NSAccessibilityUnignoredAncestor(element: id): id; cdecl; external name 'NSAccessibilityUnignoredAncestor';
+function NSAccessibilityUnignoredDescendant(element: id): id; cdecl; external name 'NSAccessibilityUnignoredDescendant';
+function NSAccessibilityUnignoredChildren(originalChildrenPointer: NSArray): NSArray; cdecl; external name 'NSAccessibilityUnignoredChildren';
+function NSAccessibilityUnignoredChildrenForOnlyChild(originalChild: id): NSArray; cdecl; external name 'NSAccessibilityUnignoredChildrenForOnlyChild';
+procedure NSAccessibilityPostNotification(element: id; notificationPointer: NSString); cdecl; external name 'NSAccessibilityPostNotification';
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSACCESSIBILITY_PAS_S}
+{$define NSACCESSIBILITY_PAS_S}
+
+{ External string constants }
+var
+  NSAccessibilityErrorCodeExceptionInfo: NSString; external name '_NSAccessibilityErrorCodeExceptionInfo';
+  NSAccessibilityRoleAttribute: NSString; external name '_NSAccessibilityRoleAttribute';
+  NSAccessibilityRoleDescriptionAttribute: NSString; external name '_NSAccessibilityRoleDescriptionAttribute';
+  NSAccessibilitySubroleAttribute: NSString; external name '_NSAccessibilitySubroleAttribute';
+  NSAccessibilityHelpAttribute: NSString; external name '_NSAccessibilityHelpAttribute';
+  NSAccessibilityValueAttribute: NSString; external name '_NSAccessibilityValueAttribute';
+  NSAccessibilityMinValueAttribute: NSString; external name '_NSAccessibilityMinValueAttribute';
+  NSAccessibilityMaxValueAttribute: NSString; external name '_NSAccessibilityMaxValueAttribute';
+  NSAccessibilityEnabledAttribute: NSString; external name '_NSAccessibilityEnabledAttribute';
+  NSAccessibilityFocusedAttribute: NSString; external name '_NSAccessibilityFocusedAttribute';
+  NSAccessibilityParentAttribute: NSString; external name '_NSAccessibilityParentAttribute';
+  NSAccessibilityChildrenAttribute: NSString; external name '_NSAccessibilityChildrenAttribute';
+  NSAccessibilityWindowAttribute: NSString; external name '_NSAccessibilityWindowAttribute';
+  NSAccessibilitySelectedChildrenAttribute: NSString; external name '_NSAccessibilitySelectedChildrenAttribute';
+  NSAccessibilityVisibleChildrenAttribute: NSString; external name '_NSAccessibilityVisibleChildrenAttribute';
+  NSAccessibilityPositionAttribute: NSString; external name '_NSAccessibilityPositionAttribute';
+  NSAccessibilitySizeAttribute: NSString; external name '_NSAccessibilitySizeAttribute';
+  NSAccessibilityContentsAttribute: NSString; external name '_NSAccessibilityContentsAttribute';
+  NSAccessibilityTitleAttribute: NSString; external name '_NSAccessibilityTitleAttribute';
+  NSAccessibilityPreviousContentsAttribute: NSString; external name '_NSAccessibilityPreviousContentsAttribute';
+  NSAccessibilityNextContentsAttribute: NSString; external name '_NSAccessibilityNextContentsAttribute';
+  NSAccessibilityHeaderAttribute: NSString; external name '_NSAccessibilityHeaderAttribute';
+  NSAccessibilityEditedAttribute: NSString; external name '_NSAccessibilityEditedAttribute';
+  NSAccessibilityTabsAttribute: NSString; external name '_NSAccessibilityTabsAttribute';
+  NSAccessibilityHorizontalScrollBarAttribute: NSString; external name '_NSAccessibilityHorizontalScrollBarAttribute';
+  NSAccessibilityVerticalScrollBarAttribute: NSString; external name '_NSAccessibilityVerticalScrollBarAttribute';
+  NSAccessibilityOverflowButtonAttribute: NSString; external name '_NSAccessibilityOverflowButtonAttribute';
+  NSAccessibilityIncrementButtonAttribute: NSString; external name '_NSAccessibilityIncrementButtonAttribute';
+  NSAccessibilityDecrementButtonAttribute: NSString; external name '_NSAccessibilityDecrementButtonAttribute';
+  NSAccessibilityFilenameAttribute: NSString; external name '_NSAccessibilityFilenameAttribute';
+  NSAccessibilityExpandedAttribute: NSString; external name '_NSAccessibilityExpandedAttribute';
+  NSAccessibilitySelectedAttribute: NSString; external name '_NSAccessibilitySelectedAttribute';
+  NSAccessibilitySplittersAttribute: NSString; external name '_NSAccessibilitySplittersAttribute';
+  NSAccessibilityDocumentAttribute: NSString; external name '_NSAccessibilityDocumentAttribute';
+  NSAccessibilityTitleUIElementAttribute: NSString; external name '_NSAccessibilityTitleUIElementAttribute';
+  NSAccessibilitySelectedTextAttribute: NSString; external name '_NSAccessibilitySelectedTextAttribute';
+  NSAccessibilitySelectedTextRangeAttribute: NSString; external name '_NSAccessibilitySelectedTextRangeAttribute';
+  NSAccessibilityMainAttribute: NSString; external name '_NSAccessibilityMainAttribute';
+  NSAccessibilityMinimizedAttribute: NSString; external name '_NSAccessibilityMinimizedAttribute';
+  NSAccessibilityCloseButtonAttribute: NSString; external name '_NSAccessibilityCloseButtonAttribute';
+  NSAccessibilityZoomButtonAttribute: NSString; external name '_NSAccessibilityZoomButtonAttribute';
+  NSAccessibilityMinimizeButtonAttribute: NSString; external name '_NSAccessibilityMinimizeButtonAttribute';
+  NSAccessibilityToolbarButtonAttribute: NSString; external name '_NSAccessibilityToolbarButtonAttribute';
+  NSAccessibilityProxyAttribute: NSString; external name '_NSAccessibilityProxyAttribute';
+  NSAccessibilityGrowAreaAttribute: NSString; external name '_NSAccessibilityGrowAreaAttribute';
+  NSAccessibilityMenuBarAttribute: NSString; external name '_NSAccessibilityMenuBarAttribute';
+  NSAccessibilityWindowsAttribute: NSString; external name '_NSAccessibilityWindowsAttribute';
+  NSAccessibilityFrontmostAttribute: NSString; external name '_NSAccessibilityFrontmostAttribute';
+  NSAccessibilityHiddenAttribute: NSString; external name '_NSAccessibilityHiddenAttribute';
+  NSAccessibilityMainWindowAttribute: NSString; external name '_NSAccessibilityMainWindowAttribute';
+  NSAccessibilityFocusedWindowAttribute: NSString; external name '_NSAccessibilityFocusedWindowAttribute';
+  NSAccessibilityFocusedUIElementAttribute: NSString; external name '_NSAccessibilityFocusedUIElementAttribute';
+  NSAccessibilityOrientationAttribute: NSString; external name '_NSAccessibilityOrientationAttribute';
+  NSAccessibilityVerticalOrientationValue: NSString; external name '_NSAccessibilityVerticalOrientationValue';
+  NSAccessibilityHorizontalOrientationValue: NSString; external name '_NSAccessibilityHorizontalOrientationValue';
+  NSAccessibilityColumnTitlesAttribute: NSString; external name '_NSAccessibilityColumnTitlesAttribute';
+  NSAccessibilityRowsAttribute: NSString; external name '_NSAccessibilityRowsAttribute';
+  NSAccessibilityVisibleRowsAttribute: NSString; external name '_NSAccessibilityVisibleRowsAttribute';
+  NSAccessibilitySelectedRowsAttribute: NSString; external name '_NSAccessibilitySelectedRowsAttribute';
+  NSAccessibilityColumnsAttribute: NSString; external name '_NSAccessibilityColumnsAttribute';
+  NSAccessibilityVisibleColumnsAttribute: NSString; external name '_NSAccessibilityVisibleColumnsAttribute';
+  NSAccessibilitySelectedColumnsAttribute: NSString; external name '_NSAccessibilitySelectedColumnsAttribute';
+  NSAccessibilityAscendingSortDirectionValue: NSString; external name '_NSAccessibilityAscendingSortDirectionValue';
+  NSAccessibilityDescendingSortDirectionValue: NSString; external name '_NSAccessibilityDescendingSortDirectionValue';
+  NSAccessibilityUnknownSortDirectionValue: NSString; external name '_NSAccessibilityUnknownSortDirectionValue';
+  NSAccessibilityDisclosingAttribute: NSString; external name '_NSAccessibilityDisclosingAttribute';
+  NSAccessibilityDisclosedRowsAttribute: NSString; external name '_NSAccessibilityDisclosedRowsAttribute';
+  NSAccessibilityDisclosedByRowAttribute: NSString; external name '_NSAccessibilityDisclosedByRowAttribute';
+  NSAccessibilityLeftTabStopMarkerTypeValue: NSString; external name '_NSAccessibilityLeftTabStopMarkerTypeValue';
+  NSAccessibilityRightTabStopMarkerTypeValue: NSString; external name '_NSAccessibilityRightTabStopMarkerTypeValue';
+  NSAccessibilityCenterTabStopMarkerTypeValue: NSString; external name '_NSAccessibilityCenterTabStopMarkerTypeValue';
+  NSAccessibilityDecimalTabStopMarkerTypeValue: NSString; external name '_NSAccessibilityDecimalTabStopMarkerTypeValue';
+  NSAccessibilityHeadIndentMarkerTypeValue: NSString; external name '_NSAccessibilityHeadIndentMarkerTypeValue';
+  NSAccessibilityTailIndentMarkerTypeValue: NSString; external name '_NSAccessibilityTailIndentMarkerTypeValue';
+  NSAccessibilityFirstLineIndentMarkerTypeValue: NSString; external name '_NSAccessibilityFirstLineIndentMarkerTypeValue';
+  NSAccessibilityUnknownMarkerTypeValue: NSString; external name '_NSAccessibilityUnknownMarkerTypeValue';
+  NSAccessibilityInchesUnitValue: NSString; external name '_NSAccessibilityInchesUnitValue';
+  NSAccessibilityCentimetersUnitValue: NSString; external name '_NSAccessibilityCentimetersUnitValue';
+  NSAccessibilityPointsUnitValue: NSString; external name '_NSAccessibilityPointsUnitValue';
+  NSAccessibilityPicasUnitValue: NSString; external name '_NSAccessibilityPicasUnitValue';
+  NSAccessibilityUnknownUnitValue: NSString; external name '_NSAccessibilityUnknownUnitValue';
+  NSAccessibilityPressAction: NSString; external name '_NSAccessibilityPressAction';
+  NSAccessibilityIncrementAction: NSString; external name '_NSAccessibilityIncrementAction';
+  NSAccessibilityDecrementAction: NSString; external name '_NSAccessibilityDecrementAction';
+  NSAccessibilityConfirmAction: NSString; external name '_NSAccessibilityConfirmAction';
+  NSAccessibilityPickAction: NSString; external name '_NSAccessibilityPickAction';
+  NSAccessibilityCancelAction: NSString; external name '_NSAccessibilityCancelAction';
+  NSAccessibilityRaiseAction: NSString; external name '_NSAccessibilityRaiseAction';
+  NSAccessibilityShowMenuAction: NSString; external name '_NSAccessibilityShowMenuAction';
+  NSAccessibilityDeleteAction: NSString; external name '_NSAccessibilityDeleteAction';
+  NSAccessibilityMainWindowChangedNotification: NSString; external name '_NSAccessibilityMainWindowChangedNotification';
+  NSAccessibilityFocusedWindowChangedNotification: NSString; external name '_NSAccessibilityFocusedWindowChangedNotification';
+  NSAccessibilityFocusedUIElementChangedNotification: NSString; external name '_NSAccessibilityFocusedUIElementChangedNotification';
+  NSAccessibilityApplicationActivatedNotification: NSString; external name '_NSAccessibilityApplicationActivatedNotification';
+  NSAccessibilityApplicationDeactivatedNotification: NSString; external name '_NSAccessibilityApplicationDeactivatedNotification';
+  NSAccessibilityApplicationHiddenNotification: NSString; external name '_NSAccessibilityApplicationHiddenNotification';
+  NSAccessibilityApplicationShownNotification: NSString; external name '_NSAccessibilityApplicationShownNotification';
+  NSAccessibilityWindowCreatedNotification: NSString; external name '_NSAccessibilityWindowCreatedNotification';
+  NSAccessibilityWindowMovedNotification: NSString; external name '_NSAccessibilityWindowMovedNotification';
+  NSAccessibilityWindowResizedNotification: NSString; external name '_NSAccessibilityWindowResizedNotification';
+  NSAccessibilityWindowMiniaturizedNotification: NSString; external name '_NSAccessibilityWindowMiniaturizedNotification';
+  NSAccessibilityWindowDeminiaturizedNotification: NSString; external name '_NSAccessibilityWindowDeminiaturizedNotification';
+  NSAccessibilityDrawerCreatedNotification: NSString; external name '_NSAccessibilityDrawerCreatedNotification';
+  NSAccessibilitySheetCreatedNotification: NSString; external name '_NSAccessibilitySheetCreatedNotification';
+  NSAccessibilityUIElementDestroyedNotification: NSString; external name '_NSAccessibilityUIElementDestroyedNotification';
+  NSAccessibilityValueChangedNotification: NSString; external name '_NSAccessibilityValueChangedNotification';
+  NSAccessibilityTitleChangedNotification: NSString; external name '_NSAccessibilityTitleChangedNotification';
+  NSAccessibilityResizedNotification: NSString; external name '_NSAccessibilityResizedNotification';
+  NSAccessibilityMovedNotification: NSString; external name '_NSAccessibilityMovedNotification';
+  NSAccessibilityCreatedNotification: NSString; external name '_NSAccessibilityCreatedNotification';
+  NSAccessibilityHelpTagCreatedNotification: NSString; external name '_NSAccessibilityHelpTagCreatedNotification';
+  NSAccessibilitySelectedTextChangedNotification: NSString; external name '_NSAccessibilitySelectedTextChangedNotification';
+  NSAccessibilityRowCountChangedNotification: NSString; external name '_NSAccessibilityRowCountChangedNotification';
+  NSAccessibilitySelectedChildrenChangedNotification: NSString; external name '_NSAccessibilitySelectedChildrenChangedNotification';
+  NSAccessibilitySelectedRowsChangedNotification: NSString; external name '_NSAccessibilitySelectedRowsChangedNotification';
+  NSAccessibilitySelectedColumnsChangedNotification: NSString; external name '_NSAccessibilitySelectedColumnsChangedNotification';
+  NSAccessibilityUnknownRole: NSString; external name '_NSAccessibilityUnknownRole';
+  NSAccessibilityButtonRole: NSString; external name '_NSAccessibilityButtonRole';
+  NSAccessibilityRadioButtonRole: NSString; external name '_NSAccessibilityRadioButtonRole';
+  NSAccessibilityCheckBoxRole: NSString; external name '_NSAccessibilityCheckBoxRole';
+  NSAccessibilitySliderRole: NSString; external name '_NSAccessibilitySliderRole';
+  NSAccessibilityTabGroupRole: NSString; external name '_NSAccessibilityTabGroupRole';
+  NSAccessibilityTextFieldRole: NSString; external name '_NSAccessibilityTextFieldRole';
+  NSAccessibilityStaticTextRole: NSString; external name '_NSAccessibilityStaticTextRole';
+  NSAccessibilityTextAreaRole: NSString; external name '_NSAccessibilityTextAreaRole';
+  NSAccessibilityScrollAreaRole: NSString; external name '_NSAccessibilityScrollAreaRole';
+  NSAccessibilityPopUpButtonRole: NSString; external name '_NSAccessibilityPopUpButtonRole';
+  NSAccessibilityMenuButtonRole: NSString; external name '_NSAccessibilityMenuButtonRole';
+  NSAccessibilityTableRole: NSString; external name '_NSAccessibilityTableRole';
+  NSAccessibilityApplicationRole: NSString; external name '_NSAccessibilityApplicationRole';
+  NSAccessibilityGroupRole: NSString; external name '_NSAccessibilityGroupRole';
+  NSAccessibilityRadioGroupRole: NSString; external name '_NSAccessibilityRadioGroupRole';
+  NSAccessibilityListRole: NSString; external name '_NSAccessibilityListRole';
+  NSAccessibilityScrollBarRole: NSString; external name '_NSAccessibilityScrollBarRole';
+  NSAccessibilityValueIndicatorRole: NSString; external name '_NSAccessibilityValueIndicatorRole';
+  NSAccessibilityImageRole: NSString; external name '_NSAccessibilityImageRole';
+  NSAccessibilityMenuBarRole: NSString; external name '_NSAccessibilityMenuBarRole';
+  NSAccessibilityMenuRole: NSString; external name '_NSAccessibilityMenuRole';
+  NSAccessibilityMenuItemRole: NSString; external name '_NSAccessibilityMenuItemRole';
+  NSAccessibilityColumnRole: NSString; external name '_NSAccessibilityColumnRole';
+  NSAccessibilityRowRole: NSString; external name '_NSAccessibilityRowRole';
+  NSAccessibilityToolbarRole: NSString; external name '_NSAccessibilityToolbarRole';
+  NSAccessibilityBusyIndicatorRole: NSString; external name '_NSAccessibilityBusyIndicatorRole';
+  NSAccessibilityProgressIndicatorRole: NSString; external name '_NSAccessibilityProgressIndicatorRole';
+  NSAccessibilityWindowRole: NSString; external name '_NSAccessibilityWindowRole';
+  NSAccessibilityDrawerRole: NSString; external name '_NSAccessibilityDrawerRole';
+  NSAccessibilitySystemWideRole: NSString; external name '_NSAccessibilitySystemWideRole';
+  NSAccessibilityOutlineRole: NSString; external name '_NSAccessibilityOutlineRole';
+  NSAccessibilityIncrementorRole: NSString; external name '_NSAccessibilityIncrementorRole';
+  NSAccessibilityBrowserRole: NSString; external name '_NSAccessibilityBrowserRole';
+  NSAccessibilityComboBoxRole: NSString; external name '_NSAccessibilityComboBoxRole';
+  NSAccessibilitySplitGroupRole: NSString; external name '_NSAccessibilitySplitGroupRole';
+  NSAccessibilitySplitterRole: NSString; external name '_NSAccessibilitySplitterRole';
+  NSAccessibilityColorWellRole: NSString; external name '_NSAccessibilityColorWellRole';
+  NSAccessibilityGrowAreaRole: NSString; external name '_NSAccessibilityGrowAreaRole';
+  NSAccessibilitySheetRole: NSString; external name '_NSAccessibilitySheetRole';
+  NSAccessibilityHelpTagRole: NSString; external name '_NSAccessibilityHelpTagRole';
+  NSAccessibilityMatteRole: NSString; external name '_NSAccessibilityMatteRole';
+  NSAccessibilityRulerRole: NSString; external name '_NSAccessibilityRulerRole';
+  NSAccessibilityRulerMarkerRole: NSString; external name '_NSAccessibilityRulerMarkerRole';
+  NSAccessibilitySortButtonRole: NSString; external name '_NSAccessibilitySortButtonRole';
+  NSAccessibilityLinkRole: NSString; external name '_NSAccessibilityLinkRole';
+  NSAccessibilityDisclosureTriangleRole: NSString; external name '_NSAccessibilityDisclosureTriangleRole';
+  NSAccessibilityGridRole: NSString; external name '_NSAccessibilityGridRole';
+  NSAccessibilityUnknownSubrole: NSString; external name '_NSAccessibilityUnknownSubrole';
+  NSAccessibilityCloseButtonSubrole: NSString; external name '_NSAccessibilityCloseButtonSubrole';
+  NSAccessibilityZoomButtonSubrole: NSString; external name '_NSAccessibilityZoomButtonSubrole';
+  NSAccessibilityMinimizeButtonSubrole: NSString; external name '_NSAccessibilityMinimizeButtonSubrole';
+  NSAccessibilityToolbarButtonSubrole: NSString; external name '_NSAccessibilityToolbarButtonSubrole';
+  NSAccessibilityTableRowSubrole: NSString; external name '_NSAccessibilityTableRowSubrole';
+  NSAccessibilityOutlineRowSubrole: NSString; external name '_NSAccessibilityOutlineRowSubrole';
+  NSAccessibilitySecureTextFieldSubrole: NSString; external name '_NSAccessibilitySecureTextFieldSubrole';
+  NSAccessibilityStandardWindowSubrole: NSString; external name '_NSAccessibilityStandardWindowSubrole';
+  NSAccessibilityDialogSubrole: NSString; external name '_NSAccessibilityDialogSubrole';
+  NSAccessibilitySystemDialogSubrole: NSString; external name '_NSAccessibilitySystemDialogSubrole';
+  NSAccessibilityFloatingWindowSubrole: NSString; external name '_NSAccessibilityFloatingWindowSubrole';
+  NSAccessibilitySystemFloatingWindowSubrole: NSString; external name '_NSAccessibilitySystemFloatingWindowSubrole';
+  NSAccessibilityIncrementArrowSubrole: NSString; external name '_NSAccessibilityIncrementArrowSubrole';
+  NSAccessibilityDecrementArrowSubrole: NSString; external name '_NSAccessibilityDecrementArrowSubrole';
+  NSAccessibilityIncrementPageSubrole: NSString; external name '_NSAccessibilityIncrementPageSubrole';
+  NSAccessibilityDecrementPageSubrole: NSString; external name '_NSAccessibilityDecrementPageSubrole';
+  NSAccessibilitySearchFieldSubrole: NSString; external name '_NSAccessibilitySearchFieldSubrole';
+  NSAccessibilityTextAttachmentSubrole: NSString; external name '_NSAccessibilityTextAttachmentSubrole';
+  NSAccessibilityTextLinkSubrole: NSString; external name '_NSAccessibilityTextLinkSubrole';
+  NSAccessibilityTimelineSubrole: NSString; external name '_NSAccessibilityTimelineSubrole';
+
+{$endif}
+{$endif}

+ 78 - 0
packages/cocoaint/src/appkit/NSActionCell.inc

@@ -0,0 +1,78 @@
+{ Parsed from Appkit.framework NSActionCell.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSACTIONCELL_PAS_T}
+{$define NSACTIONCELL_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSACTIONCELL_PAS_R}
+{$define NSACTIONCELL_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSACTIONCELL_PAS_F}
+{$define NSACTIONCELL_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSACTIONCELL_PAS_S}
+{$define NSACTIONCELL_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSActionCell = objcclass;
+  NSActionCellPointer = ^NSActionCell;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSACTIONCELL_PAS_C}
+{$define NSACTIONCELL_PAS_C}
+
+{ NSActionCell }
+  NSActionCell = objcclass(NSCell)
+  private
+    __tag: NSInteger;
+    __target: id;
+    __action: SEL;
+    __controlView: id;
+    
+  public
+    class function alloc: NSActionCell; message 'alloc';
+
+    function controlView: NSView; message 'controlView';
+    procedure setControlView(view: NSView); message 'setControlView:';
+    procedure setFont(fontObj: NSFont); message 'setFont:';
+    procedure setAlignment(mode: NSTextAlignment); message 'setAlignment:';
+    procedure setBordered(flag: Boolean); message 'setBordered:';
+    procedure setBezeled(flag: Boolean); message 'setBezeled:';
+    procedure setEnabled(flag: Boolean); message 'setEnabled:';
+    procedure setFloatingPointFormat_left_right(autoRange: Boolean; leftDigits: NSUInteger; rightDigits: NSUInteger); message 'setFloatingPointFormat:left:right:';
+    procedure setImage(image_: NSImage); message 'setImage:';
+    function target: id; message 'target';
+    procedure setTarget(anObject: id); message 'setTarget:';
+    function action: SEL; message 'action';
+    procedure setAction(aSelector: SEL); message 'setAction:';
+    function tag: NSInteger; message 'tag';
+    procedure setTag(anInt: NSInteger); message 'setTag:';
+    function stringValue: NSString; message 'stringValue';
+    function intValue: cint; message 'intValue';
+    function floatValue: single; message 'floatValue';
+    function doubleValue: double; message 'doubleValue';
+    procedure setObjectValue(obj: id); message 'setObjectValue:';
+    function integerValue: NSInteger; message 'integerValue';
+  end; external;
+
+{$endif}
+{$endif}

+ 81 - 0
packages/cocoaint/src/appkit/NSAffineTransform.inc

@@ -0,0 +1,81 @@
+{ Parsed from Appkit.framework NSAffineTransform.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:06 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSAFFINETRANSFORM_PAS_T}
+{$define NSAFFINETRANSFORM_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSAFFINETRANSFORM_PAS_R}
+{$define NSAFFINETRANSFORM_PAS_R}
+
+{ Records }
+type
+  NSAffineTransformStruct = record
+    m11, m12, m21, m22: CGFloat;
+    tX, tY: CGFloat;
+  end;
+
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSAFFINETRANSFORM_PAS_F}
+{$define NSAFFINETRANSFORM_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSAFFINETRANSFORM_PAS_S}
+{$define NSAFFINETRANSFORM_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSAffineTransform = objcclass;
+  NSAffineTransformPointer = ^NSAffineTransform;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSAFFINETRANSFORM_PAS_C}
+{$define NSAFFINETRANSFORM_PAS_C}
+
+{ NSAffineTransform }
+  NSAffineTransform = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  private
+    __transformStruct: NSAffineTransformStruct;
+    
+  public
+    class function alloc: NSAffineTransform; message 'alloc';
+
+    class function transform: NSAffineTransform; message 'transform';
+    function initWithTransform(transform_: NSAffineTransform): id; message 'initWithTransform:';
+    procedure translateXBy_yBy(deltaX: CGFloat; deltaY: CGFloat); message 'translateXBy:yBy:';
+    procedure rotateByDegrees(angle: CGFloat); message 'rotateByDegrees:';
+    procedure rotateByRadians(angle: CGFloat); message 'rotateByRadians:';
+    procedure scaleBy(scale: CGFloat); message 'scaleBy:';
+    procedure scaleXBy_yBy(scaleX: CGFloat; scaleY: CGFloat); message 'scaleXBy:yBy:';
+    procedure invert; message 'invert';
+    procedure appendTransform(transform_: NSAffineTransform); message 'appendTransform:';
+    procedure prependTransform(transform_: NSAffineTransform); message 'prependTransform:';
+    function transformPoint(aPoint: NSPoint): NSPoint; message 'transformPoint:';
+    function transformSize(aSize: NSSize): NSSize; message 'transformSize:';
+    function transformStruct: NSAffineTransformStruct; message 'transformStruct';
+    procedure setTransformStruct(transformStruct_: NSAffineTransformStruct); message 'setTransformStruct:';
+
+    { Category: NSAppKitAdditons }
+    function transformBezierPath(aPath: NSBezierPath): NSBezierPath; message 'transformBezierPath:';
+    procedure set_; message 'set';
+    procedure concat; message 'concat';
+  end; external;
+
+{$endif}
+{$endif}

+ 126 - 0
packages/cocoaint/src/appkit/NSAlert.inc

@@ -0,0 +1,126 @@
+{ Parsed from Appkit.framework NSAlert.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSALERT_PAS_T}
+{$define NSALERT_PAS_T}
+
+{ Constants }
+
+const
+  NSWarningAlertStyle = 0;
+  NSInformationalAlertStyle = 1;
+  NSCriticalAlertStyle = 2;
+
+const
+  NSAlertFirstButtonReturn = 1000;
+  NSAlertSecondButtonReturn = 1001;
+  NSAlertThirdButtonReturn = 1002;
+
+{ Types }
+type
+  NSAlertStyle = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSALERT_PAS_R}
+{$define NSALERT_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSALERT_PAS_F}
+{$define NSALERT_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSALERT_PAS_S}
+{$define NSALERT_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSAlert = objcclass;
+  NSAlertPointer = ^NSAlert;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSALERT_PAS_C}
+{$define NSALERT_PAS_C}
+
+{ NSAlert }
+  NSAlert = objcclass(NSObject)
+  private
+    __informationField: NSTextField;
+    __first: id;
+    __second: id;
+    __third: id;
+    __buttons: NSArray;
+    __panel: NSPanel;
+    __messageField: id;
+    __imageView: id;
+    __minButtonSize: NSSize;
+    __buttonSpacing: CGFloat;
+    __buttonPadding: CGFloat;
+    __messagePadding: CGFloat;
+    __buttonSpacingMaxX: CGFloat;
+    __buttonSpacingY: CGFloat;
+    __modalDelegate: id;
+    __docWindow: NSWindow;
+    __didEndSelector: SEL;
+    __didDismissSelector: SEL;
+    __unbadgedImage: NSImage;
+    __defaultPanelSize: NSSize;
+    __helpButton: id;
+    __delegate: id;
+    __alertStyle: NSAlertStyle;
+    __helpAnchor: id;
+    __layoutDone: Boolean;
+    __showsHelp: Boolean;
+    __showsSuppressionButton: Boolean;
+    _reserved: Boolean;
+    __suppressionButton: id;
+    __accessoryView: id;
+    
+  public
+    class function alloc: NSAlert; message 'alloc';
+
+    class function alertWithError(error: NSError): NSAlert; message 'alertWithError:';
+    class function alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat(message: NSString; defaultButton: NSString; alternateButton: NSString; otherButton: NSString; format: NSString): NSAlert; varargs; message 'alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:';
+    procedure setMessageText(messageText_: NSString); message 'setMessageText:';
+    procedure setInformativeText(informativeText_: NSString); message 'setInformativeText:';
+    function messageText: NSString; message 'messageText';
+    function informativeText: NSString; message 'informativeText';
+    procedure setIcon(icon_: NSImage); message 'setIcon:';
+    function icon: NSImage; message 'icon';
+    function addButtonWithTitle(title: NSString): NSButton; message 'addButtonWithTitle:';
+    function buttons: NSArray; message 'buttons';
+    procedure setShowsHelp(showsHelp_: Boolean); message 'setShowsHelp:';
+    function showsHelp: Boolean; message 'showsHelp';
+    procedure setHelpAnchor(anchor: NSString); message 'setHelpAnchor:';
+    function helpAnchor: NSString; message 'helpAnchor';
+    procedure setAlertStyle(style: NSAlertStyle); message 'setAlertStyle:';
+    function alertStyle: NSAlertStyle; message 'alertStyle';
+    procedure setDelegate(delegate_: id); message 'setDelegate:';
+    function delegate: id; message 'delegate';
+    procedure setShowsSuppressionButton(flag: Boolean); message 'setShowsSuppressionButton:';
+    function showsSuppressionButton: Boolean; message 'showsSuppressionButton';
+    function suppressionButton: NSButton; message 'suppressionButton';
+    procedure setAccessoryView(view: NSView); message 'setAccessoryView:';
+    function accessoryView: NSView; message 'accessoryView';
+    procedure layout; message 'layout';
+    function runModal: NSInteger; message 'runModal';
+    procedure beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo(window_: NSWindow; delegate_: id; didEndSelector: SEL; contextInfo: Pointer); message 'beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:';
+    function window: id; message 'window';
+  end; external;
+
+{$endif}
+{$endif}

+ 173 - 0
packages/cocoaint/src/appkit/NSAnimation.inc

@@ -0,0 +1,173 @@
+{ Parsed from Appkit.framework NSAnimation.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:08 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSANIMATION_PAS_T}
+{$define NSANIMATION_PAS_T}
+
+{ Constants }
+
+const
+  NSAnimationEaseInOut = 0;
+  NSAnimationEaseIn = 1;
+  NSAnimationEaseOut = 2;
+  NSAnimationLinear = 3;
+
+const
+  NSAnimationBlocking = 0;
+  NSAnimationNonblocking = 1;
+  NSAnimationNonblockingThreaded = 2;
+
+{ Types }
+type
+  NSAnimationCurve = NSUInteger;
+  NSAnimationBlockingMode = NSUInteger;
+  NSAnimationProgress = single;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSANIMATION_PAS_R}
+{$define NSANIMATION_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSANIMATION_PAS_F}
+{$define NSANIMATION_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSANIMATION_PAS_S}
+{$define NSANIMATION_PAS_S}
+
+{ External string constants }
+var
+  NSAnimationTriggerOrderIn: NSString; external name '_NSAnimationTriggerOrderIn';
+  NSAnimationTriggerOrderOut: NSString; external name '_NSAnimationTriggerOrderOut';
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSAnimatablePropertyContainerProtocol = objcprotocol;
+  NSAnimation = objcclass;
+  NSAnimationPointer = ^NSAnimation;
+  NSViewAnimation = objcclass;
+  NSViewAnimationPointer = ^NSViewAnimation;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSANIMATION_PAS_C}
+{$define NSANIMATION_PAS_C}
+
+{ NSAnimation }
+  NSAnimation = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  private
+    __duration: NSTimeInterval;
+    __currentProgress: NSAnimationProgress;
+    __framesPerSecond: single;
+    __delegate: id;
+    __timer: NSTimer;
+    __startTime: NSTimeInterval;
+    __progressMarks: NSMutableArray;
+    __startAnimation: NSAnimation;
+    __stopAnimation: NSAnimation;
+    __nextProgressMark: cint;
+    __aFlags: bitpacked record
+        delegateAnimationShouldStart: 0..1;
+        delegateAnimationDidStop: 0..1;
+        delegateAnimationDidEnd: 0..1;
+        delegateAnimationValueForProgress: 0..1;
+        delegateAnimationDidReachProgressMark: 0..1;
+        animating: 0..1;
+        blocking: 0..1;
+        reserved: 0..((1 shl 25)-1);
+      end;
+    __aSettings: bitpacked record
+        animationCurve: 0..((1 shl 8)-1);
+        animationBlockingMode: 0..((1 shl 2)-1);
+        reserved: 0..((1 shl 22)-1);
+      end;
+    __reserved1: NSInteger;
+    __reserved2: NSInteger;
+    __reserved3: NSInteger;
+    __reserved4: NSInteger;
+    
+  public
+    class function alloc: NSAnimation; message 'alloc';
+
+    function initWithDuration_animationCurve(duration_: NSTimeInterval; animationCurve_: NSAnimationCurve): id; message 'initWithDuration:animationCurve:';
+    procedure startAnimation; message 'startAnimation';
+    procedure stopAnimation; message 'stopAnimation';
+    function isAnimating: Boolean; message 'isAnimating';
+    function currentProgress: NSAnimationProgress; message 'currentProgress';
+    procedure setCurrentProgress(progress: NSAnimationProgress); message 'setCurrentProgress:';
+    procedure setDuration(duration_: NSTimeInterval); message 'setDuration:';
+    function duration: NSTimeInterval; message 'duration';
+    function animationBlockingMode: NSAnimationBlockingMode; message 'animationBlockingMode';
+    procedure setAnimationBlockingMode(animationBlockingMode_: NSAnimationBlockingMode); message 'setAnimationBlockingMode:';
+    procedure setFrameRate(framesPerSecond: single); message 'setFrameRate:';
+    function frameRate: single; message 'frameRate';
+    procedure setAnimationCurve(curve: NSAnimationCurve); message 'setAnimationCurve:';
+    function animationCurve: NSAnimationCurve; message 'animationCurve';
+    function currentValue: single; message 'currentValue';
+    procedure setDelegate(delegate_: id); message 'setDelegate:';
+    function delegate: id; message 'delegate';
+    function progressMarks: NSArray; message 'progressMarks';
+    procedure setProgressMarks(progressMarks_: NSArray); message 'setProgressMarks:';
+    procedure addProgressMark(progressMark: NSAnimationProgress); message 'addProgressMark:';
+    procedure removeProgressMark(progressMark: NSAnimationProgress); message 'removeProgressMark:';
+    procedure startWhenAnimation_reachesProgress(animation: NSAnimation; startProgress: NSAnimationProgress); message 'startWhenAnimation:reachesProgress:';
+    procedure stopWhenAnimation_reachesProgress(animation: NSAnimation; stopProgress: NSAnimationProgress); message 'stopWhenAnimation:reachesProgress:';
+    procedure clearStartAnimation; message 'clearStartAnimation';
+    procedure clearStopAnimation; message 'clearStopAnimation';
+    function runLoopModesForAnimating: NSArray; message 'runLoopModesForAnimating';
+  end; external;
+
+{ NSViewAnimation }
+  NSViewAnimation = objcclass(NSAnimation)
+  private
+    __viewAnimations: NSArray;
+    __viewAnimationInfo: CFMutableDictionaryRef;
+    __windowAnimationInfo: CFMutableDictionaryRef;
+    __reserved4a: NSUInteger;
+    __reserved4b: NSUInteger;
+    __reserved4c: NSUInteger;
+    __vaFlags: bitpacked record
+        reserved: 0..((1 shl 32)-1);
+      end;
+    __reserved5: NSUInteger;
+    __reserved6: NSUInteger;
+    __reserved7: NSUInteger;
+    __reserved8: NSUInteger;
+    
+  public
+    class function alloc: NSViewAnimation; message 'alloc';
+
+    function initWithViewAnimations(viewAnimations_: NSArray): id; message 'initWithViewAnimations:';
+    function viewAnimations: NSArray; message 'viewAnimations';
+    procedure setViewAnimations(viewAnimations_: NSArray); message 'setViewAnimations:';
+  end; external;
+
+{$endif}
+{$endif}
+{$ifdef PROTOCOLS}
+{$ifndef NSANIMATION_PAS_P}
+{$define NSANIMATION_PAS_P}
+  
+{ NSAnimatablePropertyContainer Protocol }
+  NSAnimatablePropertyContainerProtocol = objcprotocol
+    function animator: id; message 'animator';
+    function animations: NSDictionary; message 'animations';
+    procedure setAnimations(dict: NSDictionary); message 'setAnimations:';
+    function animationForKey(key: NSString): id; message 'animationForKey:';
+  end; external name 'NSAnimatablePropertyContainer';
+{$endif}
+{$endif}

+ 60 - 0
packages/cocoaint/src/appkit/NSAnimationContext.inc

@@ -0,0 +1,60 @@
+{ Parsed from Appkit.framework NSAnimationContext.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSANIMATIONCONTEXT_PAS_T}
+{$define NSANIMATIONCONTEXT_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSANIMATIONCONTEXT_PAS_R}
+{$define NSANIMATIONCONTEXT_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSANIMATIONCONTEXT_PAS_F}
+{$define NSANIMATIONCONTEXT_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSANIMATIONCONTEXT_PAS_S}
+{$define NSANIMATIONCONTEXT_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSAnimationContext = objcclass;
+  NSAnimationContextPointer = ^NSAnimationContext;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSANIMATIONCONTEXT_PAS_C}
+{$define NSANIMATIONCONTEXT_PAS_C}
+
+{ NSAnimationContext }
+  NSAnimationContext = objcclass(NSObject)
+  private
+    __duration: NSTimeInterval;
+        _reserved: array[0..4] of id;
+    
+  public
+    class function alloc: NSAnimationContext; message 'alloc';
+
+    class procedure beginGrouping; message 'beginGrouping';
+    class procedure endGrouping; message 'endGrouping';
+    class function currentContext: NSAnimationContext; message 'currentContext';
+    procedure setDuration(duration_: NSTimeInterval); message 'setDuration:';
+    function duration: NSTimeInterval; message 'duration';
+  end; external;
+
+{$endif}
+{$endif}

+ 31 - 0
packages/cocoaint/src/appkit/NSAppleScriptExtensions.inc

@@ -0,0 +1,31 @@
+{ Parsed from Appkit.framework NSAppleScriptExtensions.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSAPPLESCRIPTEXTENSIONS_PAS_T}
+{$define NSAPPLESCRIPTEXTENSIONS_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSAPPLESCRIPTEXTENSIONS_PAS_R}
+{$define NSAPPLESCRIPTEXTENSIONS_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSAPPLESCRIPTEXTENSIONS_PAS_F}
+{$define NSAPPLESCRIPTEXTENSIONS_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSAPPLESCRIPTEXTENSIONS_PAS_S}
+{$define NSAPPLESCRIPTEXTENSIONS_PAS_S}
+
+{$endif}
+{$endif}

+ 278 - 0
packages/cocoaint/src/appkit/NSApplication.inc

@@ -0,0 +1,278 @@
+{ Parsed from Appkit.framework NSApplication.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSAPPLICATION_PAS_T}
+{$define NSAPPLICATION_PAS_T}
+
+{ Defines }
+const
+  NSAppKitVersionNumber10_0 = 577;
+  NSAppKitVersionNumber10_1 = 620;
+  NSAppKitVersionNumber10_2 = 663;
+  NSAppKitVersionNumber10_2_3 = 663.6;
+  NSAppKitVersionNumber10_3 = 743;
+  NSAppKitVersionNumber10_3_2 = 743.14;
+  NSAppKitVersionNumber10_3_3 = 743.2;
+  NSAppKitVersionNumber10_3_5 = 743.24;
+  NSAppKitVersionNumber10_3_7 = 743.33;
+  NSAppKitVersionNumber10_3_9 = 743.36;
+  NSAppKitVersionNumber10_4 = 824;
+
+{ Constants }
+
+const
+  NSUpdateWindowsRunLoopOrdering = 500000;
+
+const
+  NSCriticalRequest = 0;
+  NSInformationalRequest = 10;
+
+const
+  NSApplicationDelegateReplySuccess = 0;
+  NSApplicationDelegateReplyCancel = 1;
+  NSApplicationDelegateReplyFailure = 2;
+
+const
+  NSTerminateCancel = 0;
+  NSTerminateNow = 1;
+  NSTerminateLater = 2;
+
+const
+  NSPrintingCancelled = 0;
+  NSPrintingSuccess = 1;
+  NSPrintingFailure = 3;
+  NSPrintingReplyLater = 2;
+
+{ Types }
+type
+  NSModalSession = Pointer;
+  NSThreadPrivate = Pointer;
+  _NSThreadPrivate = NSThreadPrivate;
+  NSRequestUserAttentionType = NSUInteger;
+  NSApplicationDelegateReply = NSUInteger;
+  NSApplicationTerminateReply = NSUInteger;
+  NSApplicationPrintReply = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSAPPLICATION_PAS_R}
+{$define NSAPPLICATION_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSAPPLICATION_PAS_F}
+{$define NSAPPLICATION_PAS_F}
+
+{ Functions }
+function NSApplicationMain(argc: cint; argvPointer: Pointer {array of char}): cint; cdecl; external name 'NSApplicationMain';
+function NSApplicationLoad: Boolean; cdecl; external name 'NSApplicationLoad';
+function NSShowsServicesMenuItem(Pointer_: NSString): Boolean; cdecl; external name 'NSShowsServicesMenuItem';
+function NSSetShowsServicesMenuItem(Pointer_: NSString; enabled: Boolean): NSInteger; cdecl; external name 'NSSetShowsServicesMenuItem';
+procedure NSUpdateDynamicServices; cdecl; external name 'NSUpdateDynamicServices';
+function NSPerformService(itemNamePointer: NSString; pboardPointer: NSPasteboard): Boolean; cdecl; external name 'NSPerformService';
+procedure NSRegisterServicesProvider(provider: id; namePointer: NSString); cdecl; external name 'NSRegisterServicesProvider';
+procedure NSUnregisterServicesProvider(namePointer: NSString); cdecl; external name 'NSUnregisterServicesProvider';
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSAPPLICATION_PAS_S}
+{$define NSAPPLICATION_PAS_S}
+
+{ External symbols }
+var
+  NSAppKitVersionNumber: double; external name '_NSAppKitVersionNumber';
+
+{ External string constants }
+var
+  NSModalPanelRunLoopMode: NSString; external name '_NSModalPanelRunLoopMode';
+  NSEventTrackingRunLoopMode: NSString; external name '_NSEventTrackingRunLoopMode';
+  NSApplicationDidBecomeActiveNotification: NSString; external name '_NSApplicationDidBecomeActiveNotification';
+  NSApplicationDidHideNotification: NSString; external name '_NSApplicationDidHideNotification';
+  NSApplicationDidFinishLaunchingNotification: NSString; external name '_NSApplicationDidFinishLaunchingNotification';
+  NSApplicationDidResignActiveNotification: NSString; external name '_NSApplicationDidResignActiveNotification';
+  NSApplicationDidUnhideNotification: NSString; external name '_NSApplicationDidUnhideNotification';
+  NSApplicationDidUpdateNotification: NSString; external name '_NSApplicationDidUpdateNotification';
+  NSApplicationWillBecomeActiveNotification: NSString; external name '_NSApplicationWillBecomeActiveNotification';
+  NSApplicationWillHideNotification: NSString; external name '_NSApplicationWillHideNotification';
+  NSApplicationWillFinishLaunchingNotification: NSString; external name '_NSApplicationWillFinishLaunchingNotification';
+  NSApplicationWillResignActiveNotification: NSString; external name '_NSApplicationWillResignActiveNotification';
+  NSApplicationWillUnhideNotification: NSString; external name '_NSApplicationWillUnhideNotification';
+  NSApplicationWillUpdateNotification: NSString; external name '_NSApplicationWillUpdateNotification';
+  NSApplicationWillTerminateNotification: NSString; external name '_NSApplicationWillTerminateNotification';
+  NSApplicationDidChangeScreenParametersNotification: NSString; external name '_NSApplicationDidChangeScreenParametersNotification';
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSApplication = objcclass;
+  NSApplicationPointer = ^NSApplication;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSAPPLICATION_PAS_C}
+{$define NSAPPLICATION_PAS_C}
+
+{ NSApplication }
+  NSApplication = objcclass(NSResponder, NSUserInterfaceValidationsProtocol)
+  private
+    __currentEvent: NSEvent;
+    __windowList: id;
+    __keyWindow: id;
+    __mainWindow: id;
+    __delegate: id;
+    __hiddenList: id;
+    __hiddenCount: cint;
+    __context: NSInteger;
+    __appleEventSuspensionID: Pointer;
+    __previousKeyWindow: id; {garbage collector: __weak }
+    __unusedApp: cshort;
+    __running: cshort;
+    __appFlags: bitpacked record
+        _hidden: 0..1;
+        _RESERVED1: 0..1;
+        _active: 0..1;
+        _hasBeenRun: 0..1;
+        _doingUnhide: 0..1;
+        _delegateReturnsValidRequestor: 0..1;
+        _deactPending: 0..1;
+        _invalidState: 0..1;
+        _invalidEvent: 0..1;
+        _postedWindowsNeedUpdateNote: 0..1;
+        _wantsToActivate: 0..1;
+        _doingHide: 0..1;
+        _dontSendShouldTerminate: 0..1;
+        _skipWin32DelayedRestoreKeyWindowAfterHide: 0..1;
+        _finishedLaunching: 0..1;
+        _hasEventDelegate: 0..1;
+        _appDying: 0..1;
+        _didNSOpenOrPrint: 0..1;
+        _inDealloc: 0..1;
+        _pendingDidFinish: 0..1;
+        _hasKeyFocus: 0..1;
+        _panelsNonactivating: 0..1;
+        _hiddenOnLaunch: 0..1;
+        _openStatus: 0..((1 shl 2)-1);
+        _batchOrdering: 0..1;
+        _reserved: 0..((1 shl 6)-1);
+      end;
+    __mainMenu: id;
+    __appIcon: id;
+    __nameTable: id;
+    __eventDelegate: id;
+    __threadingSupport: _NSThreadPrivate;
+    
+  public
+    class function alloc: NSApplication; message 'alloc';
+
+    class function sharedApplication: NSApplication; message 'sharedApplication';
+    procedure setDelegate(anObject: id); message 'setDelegate:';
+    function delegate: id; message 'delegate';
+    function context: NSGraphicsContext; message 'context';
+    procedure hide(sender: id); message 'hide:';
+    procedure unhide(sender: id); message 'unhide:';
+    procedure unhideWithoutActivation; message 'unhideWithoutActivation';
+    function windowWithWindowNumber(windowNum: NSInteger): NSWindow; message 'windowWithWindowNumber:';
+    function mainWindow: NSWindow; message 'mainWindow';
+    function keyWindow: NSWindow; message 'keyWindow';
+    function isActive: Boolean; message 'isActive';
+    function isHidden: Boolean; message 'isHidden';
+    function isRunning: Boolean; message 'isRunning';
+    procedure deactivate; message 'deactivate';
+    procedure activateIgnoringOtherApps(flag: Boolean); message 'activateIgnoringOtherApps:';
+    procedure hideOtherApplications(sender: id); message 'hideOtherApplications:';
+    procedure unhideAllApplications(sender: id); message 'unhideAllApplications:';
+    procedure finishLaunching; message 'finishLaunching';
+    procedure run; message 'run';
+    function runModalForWindow(theWindow: NSWindow): NSInteger; message 'runModalForWindow:';
+    procedure stop(sender: id); message 'stop:';
+    procedure stopModal; message 'stopModal';
+    procedure stopModalWithCode(returnCode: NSInteger); message 'stopModalWithCode:';
+    procedure abortModal; message 'abortModal';
+    function modalWindow: NSWindow; message 'modalWindow';
+    function beginModalSessionForWindow(theWindow: NSWindow): NSModalSession; message 'beginModalSessionForWindow:';
+    function runModalSession(session: NSModalSession): NSInteger; message 'runModalSession:';
+    procedure endModalSession(session: NSModalSession); message 'endModalSession:';
+    procedure terminate(sender: id); message 'terminate:';
+    function requestUserAttention(requestType: NSRequestUserAttentionType): NSInteger; message 'requestUserAttention:';
+    procedure cancelUserAttentionRequest(request: NSInteger); message 'cancelUserAttentionRequest:';
+    procedure beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo(sheet: NSWindow; docWindow: NSWindow; modalDelegate: id; didEndSelector: SEL; contextInfo: Pointer); message 'beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:';
+    procedure endSheet(sheet: NSWindow); message 'endSheet:';
+    procedure endSheet_returnCode(sheet: NSWindow; returnCode: NSInteger); message 'endSheet:returnCode:';
+    function runModalForWindow_relativeToWindow(theWindow: NSWindow; docWindow: NSWindow): NSInteger; message 'runModalForWindow:relativeToWindow:';
+    function beginModalSessionForWindow_relativeToWindow(theWindow: NSWindow; docWindow: NSWindow): NSModalSession; message 'beginModalSessionForWindow:relativeToWindow:';
+    function nextEventMatchingMask_untilDate_inMode_dequeue(mask: NSUInteger; expiration: NSDate; mode: NSString; deqFlag: Boolean): NSEvent; message 'nextEventMatchingMask:untilDate:inMode:dequeue:';
+    procedure discardEventsMatchingMask_beforeEvent(mask: NSUInteger; lastEvent: NSEvent); message 'discardEventsMatchingMask:beforeEvent:';
+    procedure postEvent_atStart(event: NSEvent; flag: Boolean); message 'postEvent:atStart:';
+    function currentEvent: NSEvent; message 'currentEvent';
+    procedure sendEvent(theEvent: NSEvent); message 'sendEvent:';
+    procedure preventWindowOrdering; message 'preventWindowOrdering';
+    function makeWindowsPerform_inOrder(aSelector: SEL; flag: Boolean): NSWindow; message 'makeWindowsPerform:inOrder:';
+    function windows: NSArray; message 'windows';
+    procedure setWindowsNeedUpdate(needUpdate: Boolean); message 'setWindowsNeedUpdate:';
+    procedure updateWindows; message 'updateWindows';
+    procedure setMainMenu(aMenu: NSMenu); message 'setMainMenu:';
+    function mainMenu: NSMenu; message 'mainMenu';
+    procedure setApplicationIconImage(image: NSImage); message 'setApplicationIconImage:';
+    function applicationIconImage: NSImage; message 'applicationIconImage';
+    function dockTile: NSDockTile; message 'dockTile';
+    function sendAction_to_from(theAction: SEL; theTarget: id; sender: id): Boolean; message 'sendAction:to:from:';
+    function targetForAction(theAction: SEL): id; message 'targetForAction:';
+    function targetForAction_to_from(theAction: SEL; theTarget: id; sender: id): id; message 'targetForAction:to:from:';
+    function tryToPerform_with(anAction: SEL; anObject: id): Boolean; message 'tryToPerform:with:';
+    function validRequestorForSendType_returnType(sendType: NSString; returnType: NSString): id; message 'validRequestorForSendType:returnType:';
+    procedure reportException(theException: NSException); message 'reportException:';
+    class procedure detachDrawingThread_toTarget_withObject(selector: SEL; target: id; argument: id); message 'detachDrawingThread:toTarget:withObject:';
+    procedure replyToApplicationShouldTerminate(shouldTerminate: Boolean); message 'replyToApplicationShouldTerminate:';
+    procedure replyToOpenOrPrint(reply: NSApplicationDelegateReply); message 'replyToOpenOrPrint:';
+    procedure orderFrontCharacterPalette(sender: id); message 'orderFrontCharacterPalette:';
+
+    { Category: NSWindowsMenu }
+    procedure setWindowsMenu(aMenu: NSMenu); message 'setWindowsMenu:';
+    function windowsMenu: NSMenu; message 'windowsMenu';
+    procedure arrangeInFront(sender: id); message 'arrangeInFront:';
+    procedure removeWindowsItem(win: NSWindow); message 'removeWindowsItem:';
+    procedure addWindowsItem_title_filename(win: NSWindow; aString: NSString; isFilename: Boolean); message 'addWindowsItem:title:filename:';
+    procedure changeWindowsItem_title_filename(win: NSWindow; aString: NSString; isFilename: Boolean); message 'changeWindowsItem:title:filename:';
+    procedure updateWindowsItem(win: NSWindow); message 'updateWindowsItem:';
+    procedure miniaturizeAll(sender: id); message 'miniaturizeAll:';
+
+    { Category: NSServicesMenu }
+    procedure setServicesMenu(aMenu: NSMenu); message 'setServicesMenu:';
+    function servicesMenu: NSMenu; message 'servicesMenu';
+    procedure registerServicesMenuSendTypes_returnTypes(sendTypes: NSArray; returnTypes: NSArray); message 'registerServicesMenuSendTypes:returnTypes:';
+
+    { Category: NSServicesHandling }
+    procedure setServicesProvider(provider: id); message 'setServicesProvider:';
+    function servicesProvider: id; message 'servicesProvider';
+
+    { Category: NSStandardAboutPanel }
+    procedure orderFrontStandardAboutPanel(sender: id); message 'orderFrontStandardAboutPanel:';
+    procedure orderFrontStandardAboutPanelWithOptions(optionsDictionary: NSDictionary); message 'orderFrontStandardAboutPanelWithOptions:';
+
+    { Category: NSApplicationHelpExtension }
+    procedure activateContextHelpMode(sender: id); message 'activateContextHelpMode:';
+    procedure showHelp(sender: id); message 'showHelp:';
+
+    { Category: NSPageLayoutPanel }
+    procedure runPageLayout(sender: id); message 'runPageLayout:';
+
+    { Category: NSColorPanel }
+    procedure orderFrontColorPanel(sender: id); message 'orderFrontColorPanel:';
+
+    { Category: NSScripting }
+    function orderedDocuments: NSArray; message 'orderedDocuments';
+    function orderedWindows: NSArray; message 'orderedWindows';
+  end; external;
+
+{$endif}
+{$endif}

+ 31 - 0
packages/cocoaint/src/appkit/NSApplicationScripting.inc

@@ -0,0 +1,31 @@
+{ Parsed from Appkit.framework NSApplicationScripting.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSAPPLICATIONSCRIPTING_PAS_T}
+{$define NSAPPLICATIONSCRIPTING_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSAPPLICATIONSCRIPTING_PAS_R}
+{$define NSAPPLICATIONSCRIPTING_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSAPPLICATIONSCRIPTING_PAS_F}
+{$define NSAPPLICATIONSCRIPTING_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSAPPLICATIONSCRIPTING_PAS_S}
+{$define NSAPPLICATIONSCRIPTING_PAS_S}
+
+{$endif}
+{$endif}

+ 127 - 0
packages/cocoaint/src/appkit/NSArrayController.inc

@@ -0,0 +1,127 @@
+{ Parsed from Appkit.framework NSArrayController.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSARRAYCONTROLLER_PAS_T}
+{$define NSARRAYCONTROLLER_PAS_T}
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSARRAYCONTROLLER_PAS_R}
+{$define NSARRAYCONTROLLER_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSARRAYCONTROLLER_PAS_F}
+{$define NSARRAYCONTROLLER_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSARRAYCONTROLLER_PAS_S}
+{$define NSARRAYCONTROLLER_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSArrayController = objcclass;
+  NSArrayControllerPointer = ^NSArrayController;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSARRAYCONTROLLER_PAS_C}
+{$define NSARRAYCONTROLLER_PAS_C}
+
+{ NSArrayController }
+  NSArrayController = objcclass(NSObjectController)
+  private
+    __reserved4: Pointer;
+    __rearrangementExtensions: id;
+    __temporaryWorkObjects: NSMutableArray;
+    __arrayControllerFlags: bitpacked record
+        _avoidsEmptySelection: 0..1;
+        _preservesSelection: 0..1;
+        _selectsInsertedObjects: 0..1;
+        _alwaysUsesMultipleValuesMarker: 0..1;
+        _refreshesAllModelObjects: 0..1;
+        _filterRestrictsInsertion: 0..1;
+        _overridesArrangeObjects: 0..1;
+        _overridesDidChangeArrangementCriteria: 0..1;
+        _explicitlyCannotInsert: 0..1;
+        _generatedEmptyArray: 0..1;
+        _isObservingKeyPathsThroughArrangedObjects: 0..1;
+        _arrangedObjectsIsMutable: 0..1;
+        _clearsFilterPredicateOnInsertion: 0..1;
+        _skipSortingAfterFetch: 0..1;
+        _automaticallyRearrangesObjects: 0..1;
+        _reservedArrayController: 0..((1 shl 17)-1);
+      end;
+    __observedIndexHint: NSUInteger;
+    __selectionIndexes: NSMutableIndexSet;
+    __objects: NSMutableArray;
+    __cachedSelectedIndexes: NSIndexSet;
+    __cachedSelectedObjects: NSArray;
+    __arrangedObjects: NSArray;
+    
+  public
+    class function alloc: NSArrayController; message 'alloc';
+
+    procedure rearrangeObjects; message 'rearrangeObjects';
+    procedure setAutomaticallyRearrangesObjects(flag: Boolean); message 'setAutomaticallyRearrangesObjects:';
+    function automaticallyRearrangesObjects: Boolean; message 'automaticallyRearrangesObjects';
+    function automaticRearrangementKeyPaths: NSArray; message 'automaticRearrangementKeyPaths';
+    procedure didChangeArrangementCriteria; message 'didChangeArrangementCriteria';
+    procedure setSortDescriptors(sortDescriptors_: NSArray); message 'setSortDescriptors:';
+    function sortDescriptors: NSArray; message 'sortDescriptors';
+    procedure setFilterPredicate(filterPredicate_: NSPredicate); message 'setFilterPredicate:';
+    function filterPredicate: NSPredicate; message 'filterPredicate';
+    procedure setClearsFilterPredicateOnInsertion(flag: Boolean); message 'setClearsFilterPredicateOnInsertion:';
+    function clearsFilterPredicateOnInsertion: Boolean; message 'clearsFilterPredicateOnInsertion';
+    function arrangeObjects(objects: NSArray): NSArray; message 'arrangeObjects:';
+    function arrangedObjects: id; message 'arrangedObjects';
+    procedure setAvoidsEmptySelection(flag: Boolean); message 'setAvoidsEmptySelection:';
+    function avoidsEmptySelection: Boolean; message 'avoidsEmptySelection';
+    procedure setPreservesSelection(flag: Boolean); message 'setPreservesSelection:';
+    function preservesSelection: Boolean; message 'preservesSelection';
+    procedure setSelectsInsertedObjects(flag: Boolean); message 'setSelectsInsertedObjects:';
+    function selectsInsertedObjects: Boolean; message 'selectsInsertedObjects';
+    procedure setAlwaysUsesMultipleValuesMarker(flag: Boolean); message 'setAlwaysUsesMultipleValuesMarker:';
+    function alwaysUsesMultipleValuesMarker: Boolean; message 'alwaysUsesMultipleValuesMarker';
+    function setSelectionIndexes(indexes: NSIndexSet): Boolean; message 'setSelectionIndexes:';
+    function selectionIndexes: NSIndexSet; message 'selectionIndexes';
+    function setSelectionIndex(index: NSUInteger): Boolean; message 'setSelectionIndex:';
+    function selectionIndex: NSUInteger; message 'selectionIndex';
+    function addSelectionIndexes(indexes: NSIndexSet): Boolean; message 'addSelectionIndexes:';
+    function removeSelectionIndexes(indexes: NSIndexSet): Boolean; message 'removeSelectionIndexes:';
+    function setSelectedObjects(objects: NSArray): Boolean; message 'setSelectedObjects:';
+    function selectedObjects: NSArray; message 'selectedObjects';
+    function addSelectedObjects(objects: NSArray): Boolean; message 'addSelectedObjects:';
+    function removeSelectedObjects(objects: NSArray): Boolean; message 'removeSelectedObjects:';
+    procedure add(sender: id); message 'add:';
+    procedure remove(sender: id); message 'remove:';
+    procedure insert(sender: id); message 'insert:';
+    function canInsert: Boolean; message 'canInsert';
+    procedure selectNext(sender: id); message 'selectNext:';
+    procedure selectPrevious(sender: id); message 'selectPrevious:';
+    function canSelectNext: Boolean; message 'canSelectNext';
+    function canSelectPrevious: Boolean; message 'canSelectPrevious';
+    procedure addObject(object_: id); message 'addObject:';
+    procedure addObjects(objects: NSArray); message 'addObjects:';
+    procedure insertObject_atArrangedObjectIndex(object_: id; index: NSUInteger); message 'insertObject:atArrangedObjectIndex:';
+    procedure insertObjects_atArrangedObjectIndexes(objects: NSArray; indexes: NSIndexSet); message 'insertObjects:atArrangedObjectIndexes:';
+    procedure removeObjectAtArrangedObjectIndex(index: NSUInteger); message 'removeObjectAtArrangedObjectIndex:';
+    procedure removeObjectsAtArrangedObjectIndexes(indexes: NSIndexSet); message 'removeObjectsAtArrangedObjectIndexes:';
+    procedure removeObject(object_: id); message 'removeObject:';
+    procedure removeObjects(objects: NSArray); message 'removeObjects:';
+  end; external;
+
+{$endif}
+{$endif}

+ 264 - 0
packages/cocoaint/src/appkit/NSAttributedString.inc

@@ -0,0 +1,264 @@
+{ Parsed from Appkit.framework NSAttributedString.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:06 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSATTRIBUTEDSTRING_PAS_T}
+{$define NSATTRIBUTEDSTRING_PAS_T}
+
+{ Constants }
+
+const
+  NSUnderlineStyleNone = $00;
+  NSUnderlineStyleSingle = $01;
+  NSUnderlineStyleThick = $02;
+  NSUnderlineStyleDouble = $09;
+
+const
+  NSUnderlinePatternSolid = $0000;
+  NSUnderlinePatternDot = $0100;
+  NSUnderlinePatternDash = $0200;
+  NSUnderlinePatternDashDot = $0300;
+  NSUnderlinePatternDashDotDot = $0400;
+
+const
+  NSSpellingStateSpellingFlag = 1  shl  0;
+  NSSpellingStateGrammarFlag = 1  shl  1;
+
+const
+  NSNoUnderlineStyle = 0;
+  NSSingleUnderlineStyle = 0;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSATTRIBUTEDSTRING_PAS_R}
+{$define NSATTRIBUTEDSTRING_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSATTRIBUTEDSTRING_PAS_F}
+{$define NSATTRIBUTEDSTRING_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSATTRIBUTEDSTRING_PAS_S}
+{$define NSATTRIBUTEDSTRING_PAS_S}
+
+{ External string constants }
+var
+  NSFontAttributeName: NSString; external name '_NSFontAttributeName';
+  NSParagraphStyleAttributeName: NSString; external name '_NSParagraphStyleAttributeName';
+  NSForegroundColorAttributeName: NSString; external name '_NSForegroundColorAttributeName';
+  NSUnderlineStyleAttributeName: NSString; external name '_NSUnderlineStyleAttributeName';
+  NSSuperscriptAttributeName: NSString; external name '_NSSuperscriptAttributeName';
+  NSBackgroundColorAttributeName: NSString; external name '_NSBackgroundColorAttributeName';
+  NSAttachmentAttributeName: NSString; external name '_NSAttachmentAttributeName';
+  NSLigatureAttributeName: NSString; external name '_NSLigatureAttributeName';
+  NSBaselineOffsetAttributeName: NSString; external name '_NSBaselineOffsetAttributeName';
+  NSKernAttributeName: NSString; external name '_NSKernAttributeName';
+  NSLinkAttributeName: NSString; external name '_NSLinkAttributeName';
+  NSStrokeWidthAttributeName: NSString; external name '_NSStrokeWidthAttributeName';
+  NSStrokeColorAttributeName: NSString; external name '_NSStrokeColorAttributeName';
+  NSUnderlineColorAttributeName: NSString; external name '_NSUnderlineColorAttributeName';
+  NSStrikethroughStyleAttributeName: NSString; external name '_NSStrikethroughStyleAttributeName';
+  NSStrikethroughColorAttributeName: NSString; external name '_NSStrikethroughColorAttributeName';
+  NSShadowAttributeName: NSString; external name '_NSShadowAttributeName';
+  NSObliquenessAttributeName: NSString; external name '_NSObliquenessAttributeName';
+  NSExpansionAttributeName: NSString; external name '_NSExpansionAttributeName';
+  NSCursorAttributeName: NSString; external name '_NSCursorAttributeName';
+  NSToolTipAttributeName: NSString; external name '_NSToolTipAttributeName';
+  NSCharacterShapeAttributeName: NSString; external name '_NSCharacterShapeAttributeName';
+  NSGlyphInfoAttributeName: NSString; external name '_NSGlyphInfoAttributeName';
+  NSMarkedClauseSegmentAttributeName: NSString; external name '_NSMarkedClauseSegmentAttributeName';
+  NSSpellingStateAttributeName: NSString; external name '_NSSpellingStateAttributeName';
+  NSPlainTextDocumentType: NSString; external name '_NSPlainTextDocumentType';
+  NSRTFTextDocumentType: NSString; external name '_NSRTFTextDocumentType';
+  NSRTFDTextDocumentType: NSString; external name '_NSRTFDTextDocumentType';
+  NSMacSimpleTextDocumentType: NSString; external name '_NSMacSimpleTextDocumentType';
+  NSHTMLTextDocumentType: NSString; external name '_NSHTMLTextDocumentType';
+  NSDocFormatTextDocumentType: NSString; external name '_NSDocFormatTextDocumentType';
+  NSWordMLTextDocumentType: NSString; external name '_NSWordMLTextDocumentType';
+  NSWebArchiveTextDocumentType: NSString; external name '_NSWebArchiveTextDocumentType';
+  NSOfficeOpenXMLTextDocumentType: NSString; external name '_NSOfficeOpenXMLTextDocumentType';
+  NSOpenDocumentTextDocumentType: NSString; external name '_NSOpenDocumentTextDocumentType';
+  NSPaperSizeDocumentAttribute: NSString; external name '_NSPaperSizeDocumentAttribute';
+  NSLeftMarginDocumentAttribute: NSString; external name '_NSLeftMarginDocumentAttribute';
+  NSRightMarginDocumentAttribute: NSString; external name '_NSRightMarginDocumentAttribute';
+  NSTopMarginDocumentAttribute: NSString; external name '_NSTopMarginDocumentAttribute';
+  NSBottomMarginDocumentAttribute: NSString; external name '_NSBottomMarginDocumentAttribute';
+  NSViewSizeDocumentAttribute: NSString; external name '_NSViewSizeDocumentAttribute';
+  NSViewZoomDocumentAttribute: NSString; external name '_NSViewZoomDocumentAttribute';
+  NSViewModeDocumentAttribute: NSString; external name '_NSViewModeDocumentAttribute';
+  NSDocumentTypeDocumentAttribute: NSString; external name '_NSDocumentTypeDocumentAttribute';
+  NSReadOnlyDocumentAttribute: NSString; external name '_NSReadOnlyDocumentAttribute';
+  NSConvertedDocumentAttribute: NSString; external name '_NSConvertedDocumentAttribute';
+  NSCocoaVersionDocumentAttribute: NSString; external name '_NSCocoaVersionDocumentAttribute';
+  NSBackgroundColorDocumentAttribute: NSString; external name '_NSBackgroundColorDocumentAttribute';
+  NSHyphenationFactorDocumentAttribute: NSString; external name '_NSHyphenationFactorDocumentAttribute';
+  NSDefaultTabIntervalDocumentAttribute: NSString; external name '_NSDefaultTabIntervalDocumentAttribute';
+  NSCharacterEncodingDocumentAttribute: NSString; external name '_NSCharacterEncodingDocumentAttribute';
+  NSTitleDocumentAttribute: NSString; external name '_NSTitleDocumentAttribute';
+  NSCompanyDocumentAttribute: NSString; external name '_NSCompanyDocumentAttribute';
+  NSCopyrightDocumentAttribute: NSString; external name '_NSCopyrightDocumentAttribute';
+  NSSubjectDocumentAttribute: NSString; external name '_NSSubjectDocumentAttribute';
+  NSAuthorDocumentAttribute: NSString; external name '_NSAuthorDocumentAttribute';
+  NSKeywordsDocumentAttribute: NSString; external name '_NSKeywordsDocumentAttribute';
+  NSCommentDocumentAttribute: NSString; external name '_NSCommentDocumentAttribute';
+  NSEditorDocumentAttribute: NSString; external name '_NSEditorDocumentAttribute';
+  NSCreationTimeDocumentAttribute: NSString; external name '_NSCreationTimeDocumentAttribute';
+  NSModificationTimeDocumentAttribute: NSString; external name '_NSModificationTimeDocumentAttribute';
+  NSExcludedElementsDocumentAttribute: NSString; external name '_NSExcludedElementsDocumentAttribute';
+  NSTextEncodingNameDocumentAttribute: NSString; external name '_NSTextEncodingNameDocumentAttribute';
+  NSPrefixSpacesDocumentAttribute: NSString; external name '_NSPrefixSpacesDocumentAttribute';
+  NSDocumentTypeDocumentOption: NSString; external name '_NSDocumentTypeDocumentOption';
+  NSDefaultAttributesDocumentOption: NSString; external name '_NSDefaultAttributesDocumentOption';
+  NSCharacterEncodingDocumentOption: NSString; external name '_NSCharacterEncodingDocumentOption';
+  NSTextEncodingNameDocumentOption: NSString; external name '_NSTextEncodingNameDocumentOption';
+  NSBaseURLDocumentOption: NSString; external name '_NSBaseURLDocumentOption';
+  NSTimeoutDocumentOption: NSString; external name '_NSTimeoutDocumentOption';
+  NSWebPreferencesDocumentOption: NSString; external name '_NSWebPreferencesDocumentOption';
+  NSWebResourceLoadDelegateDocumentOption: NSString; external name '_NSWebResourceLoadDelegateDocumentOption';
+  NSTextSizeMultiplierDocumentOption: NSString; external name '_NSTextSizeMultiplierDocumentOption';
+
+{ External symbols }
+var
+  NSUnderlineByWordMask: NSUInteger; external name '_NSUnderlineByWordMask';
+  NSUnderlineStrikethroughMask: NSUInteger; external name '_NSUnderlineStrikethroughMask';
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSAttributedString = objcclass;
+  NSAttributedStringPointer = ^NSAttributedString;
+  NSMutableAttributedString = objcclass;
+  NSMutableAttributedStringPointer = ^NSMutableAttributedString;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSATTRIBUTEDSTRING_PAS_C}
+{$define NSATTRIBUTEDSTRING_PAS_C}
+
+{ NSAttributedString }
+  NSAttributedString = objcclass(NSObject, NSCopyingProtocol, NSMutableCopyingProtocol, NSCodingProtocol)
+    
+  public
+    class function alloc: NSAttributedString; message 'alloc';
+
+    function string_: NSString; message 'string';
+    function attributesAtIndex_effectiveRange(location: NSUInteger; range: NSRangePointer): NSDictionary; message 'attributesAtIndex:effectiveRange:';
+
+    { Category: NSExtendedAttributedString }
+    function length: NSUInteger; message 'length';
+    function attribute_atIndex_effectiveRange(attrName: NSString; location: NSUInteger; range: NSRangePointer): id; message 'attribute:atIndex:effectiveRange:';
+    function attributedSubstringFromRange(range: NSRange): NSAttributedString; message 'attributedSubstringFromRange:';
+    function attributesAtIndex_longestEffectiveRange_inRange(location: NSUInteger; range: NSRangePointer; rangeLimit: NSRange): NSDictionary; message 'attributesAtIndex:longestEffectiveRange:inRange:';
+    function attribute_atIndex_longestEffectiveRange_inRange(attrName: NSString; location: NSUInteger; range: NSRangePointer; rangeLimit: NSRange): id; message 'attribute:atIndex:longestEffectiveRange:inRange:';
+    function isEqualToAttributedString(other: NSAttributedString): Boolean; message 'isEqualToAttributedString:';
+    function initWithString(str: NSString): id; message 'initWithString:';
+    function initWithString_attributes(str: NSString; attrs: NSDictionary): id; message 'initWithString:attributes:';
+    function initWithAttributedString(attrStr: NSAttributedString): id; message 'initWithAttributedString:';
+
+    { Category: NSAttributedStringKitAdditions }
+    function fontAttributesInRange(range: NSRange): NSDictionary; message 'fontAttributesInRange:';
+    function rulerAttributesInRange(range: NSRange): NSDictionary; message 'rulerAttributesInRange:';
+    function containsAttachments: Boolean; message 'containsAttachments';
+    function lineBreakBeforeIndex_withinRange(location: NSUInteger; aRange: NSRange): NSUInteger; message 'lineBreakBeforeIndex:withinRange:';
+    function lineBreakByHyphenatingBeforeIndex_withinRange(location: NSUInteger; aRange: NSRange): NSUInteger; message 'lineBreakByHyphenatingBeforeIndex:withinRange:';
+    function doubleClickAtIndex(location: NSUInteger): NSRange; message 'doubleClickAtIndex:';
+    function nextWordFromIndex_forward(location: NSUInteger; isForward: Boolean): NSUInteger; message 'nextWordFromIndex:forward:';
+    function URLAtIndex_effectiveRange(location: NSUInteger; effectiveRange: NSRangePointer): NSURL; message 'URLAtIndex:effectiveRange:';
+    class function textTypes: NSArray; message 'textTypes';
+    class function textUnfilteredTypes: NSArray; message 'textUnfilteredTypes';
+    function rangeOfTextBlock_atIndex(block: NSTextBlock; location: NSUInteger): NSRange; message 'rangeOfTextBlock:atIndex:';
+    function rangeOfTextTable_atIndex(table: NSTextTable; location: NSUInteger): NSRange; message 'rangeOfTextTable:atIndex:';
+    function rangeOfTextList_atIndex(list: NSTextList; location: NSUInteger): NSRange; message 'rangeOfTextList:atIndex:';
+    function itemNumberInTextList_atIndex(list: NSTextList; location: NSUInteger): NSInteger; message 'itemNumberInTextList:atIndex:';
+    function initWithURL_options_documentAttributes_error(url: NSURL; options: NSDictionary; dict: NSDictionaryPointer; error: NSErrorPointer): id; message 'initWithURL:options:documentAttributes:error:';
+    function initWithData_options_documentAttributes_error(data: NSData; options: NSDictionary; dict: NSDictionaryPointer; error: NSErrorPointer): id; message 'initWithData:options:documentAttributes:error:';
+    function initWithPath_documentAttributes(path: NSString; dict: NSDictionaryPointer): id; message 'initWithPath:documentAttributes:';
+    function initWithURL_documentAttributes(url: NSURL; dict: NSDictionaryPointer): id; message 'initWithURL:documentAttributes:';
+    function initWithRTF_documentAttributes(data: NSData; dict: NSDictionaryPointer): id; message 'initWithRTF:documentAttributes:';
+    function initWithRTFD_documentAttributes(data: NSData; dict: NSDictionaryPointer): id; message 'initWithRTFD:documentAttributes:';
+    function initWithHTML_documentAttributes(data: NSData; dict: NSDictionaryPointer): id; message 'initWithHTML:documentAttributes:';
+    function initWithHTML_baseURL_documentAttributes(data: NSData; base: NSURL; dict: NSDictionaryPointer): id; message 'initWithHTML:baseURL:documentAttributes:';
+    function initWithDocFormat_documentAttributes(data: NSData; dict: NSDictionaryPointer): id; message 'initWithDocFormat:documentAttributes:';
+    function initWithHTML_options_documentAttributes(data: NSData; options: NSDictionary; dict: NSDictionaryPointer): id; message 'initWithHTML:options:documentAttributes:';
+    function initWithRTFDFileWrapper_documentAttributes(wrapper: NSFileWrapper; dict: NSDictionaryPointer): id; message 'initWithRTFDFileWrapper:documentAttributes:';
+    function dataFromRange_documentAttributes_error(range: NSRange; dict: NSDictionary; error: NSErrorPointer): NSData; message 'dataFromRange:documentAttributes:error:';
+    function fileWrapperFromRange_documentAttributes_error(range: NSRange; dict: NSDictionary; error: NSErrorPointer): NSFileWrapper; message 'fileWrapperFromRange:documentAttributes:error:';
+    function RTFFromRange_documentAttributes(range: NSRange; dict: NSDictionary): NSData; message 'RTFFromRange:documentAttributes:';
+    function RTFDFromRange_documentAttributes(range: NSRange; dict: NSDictionary): NSData; message 'RTFDFromRange:documentAttributes:';
+    function RTFDFileWrapperFromRange_documentAttributes(range: NSRange; dict: NSDictionary): NSFileWrapper; message 'RTFDFileWrapperFromRange:documentAttributes:';
+    function docFormatFromRange_documentAttributes(range: NSRange; dict: NSDictionary): NSData; message 'docFormatFromRange:documentAttributes:';
+
+    { Category: NSDeprecatedKitAdditions }
+    class function textFileTypes: NSArray; message 'textFileTypes';
+    class function textPasteboardTypes: NSArray; message 'textPasteboardTypes';
+    class function textUnfilteredFileTypes: NSArray; message 'textUnfilteredFileTypes';
+    class function textUnfilteredPasteboardTypes: NSArray; message 'textUnfilteredPasteboardTypes';
+
+    { Category: NSAttributedStringAttachmentConveniences }
+    class function attributedStringWithAttachment(attachment: NSTextAttachment): NSAttributedString; message 'attributedStringWithAttachment:';
+
+    { Category: NSStringDrawing }
+    function size: NSSize; message 'size';
+    procedure drawAtPoint(point: NSPoint); message 'drawAtPoint:';
+    procedure drawInRect(rect: NSRect); message 'drawInRect:';
+
+    { Category: NSExtendedStringDrawing }
+    procedure drawWithRect_options(rect: NSRect; options: NSStringDrawingOptions); message 'drawWithRect:options:';
+    function boundingRectWithSize_options(size_: NSSize; options: NSStringDrawingOptions): NSRect; message 'boundingRectWithSize:options:';
+  end; external;
+
+{ NSMutableAttributedString }
+  NSMutableAttributedString = objcclass(NSAttributedString)
+    
+  public
+    class function alloc: NSMutableAttributedString; message 'alloc';
+
+    procedure replaceCharactersInRange_withString(range: NSRange; str: NSString); message 'replaceCharactersInRange:withString:';
+    procedure setAttributes_range(attrs: NSDictionary; range: NSRange); message 'setAttributes:range:';
+
+    { Category: NSExtendedMutableAttributedString }
+    function mutableString: NSMutableString; message 'mutableString';
+    procedure addAttribute_value_range(name: NSString; value: id; range: NSRange); message 'addAttribute:value:range:';
+    procedure addAttributes_range(attrs: NSDictionary; range: NSRange); message 'addAttributes:range:';
+    procedure removeAttribute_range(name: NSString; range: NSRange); message 'removeAttribute:range:';
+    procedure replaceCharactersInRange_withAttributedString(range: NSRange; attrString: NSAttributedString); message 'replaceCharactersInRange:withAttributedString:';
+    procedure insertAttributedString_atIndex(attrString: NSAttributedString; loc: NSUInteger); message 'insertAttributedString:atIndex:';
+    procedure appendAttributedString(attrString: NSAttributedString); message 'appendAttributedString:';
+    procedure deleteCharactersInRange(range: NSRange); message 'deleteCharactersInRange:';
+    procedure setAttributedString(attrString: NSAttributedString); message 'setAttributedString:';
+    procedure beginEditing; message 'beginEditing';
+    procedure endEditing; message 'endEditing';
+
+    { Category: NSMutableAttributedStringKitAdditions }
+    function readFromURL_options_documentAttributes_error(url: NSURL; opts: NSDictionary; dict: NSDictionaryPointer; error: NSErrorPointer): Boolean; message 'readFromURL:options:documentAttributes:error:';
+    function readFromData_options_documentAttributes_error(data: NSData; opts: NSDictionary; dict: NSDictionaryPointer; error: NSErrorPointer): Boolean; message 'readFromData:options:documentAttributes:error:';
+    function readFromURL_options_documentAttributes(url: NSURL; options: NSDictionary; dict: NSDictionaryPointer): Boolean; message 'readFromURL:options:documentAttributes:';
+    function readFromData_options_documentAttributes(data: NSData; options: NSDictionary; dict: NSDictionaryPointer): Boolean; message 'readFromData:options:documentAttributes:';
+    procedure superscriptRange(range: NSRange); message 'superscriptRange:';
+    procedure subscriptRange(range: NSRange); message 'subscriptRange:';
+    procedure unscriptRange(range: NSRange); message 'unscriptRange:';
+    procedure applyFontTraits_range(traitMask: NSFontTraitMask; range: NSRange); message 'applyFontTraits:range:';
+    procedure setAlignment_range(alignment: NSTextAlignment; range: NSRange); message 'setAlignment:range:';
+    procedure setBaseWritingDirection_range(writingDirection: NSWritingDirection; range: NSRange); message 'setBaseWritingDirection:range:';
+    procedure fixAttributesInRange(range: NSRange); message 'fixAttributesInRange:';
+    procedure fixFontAttributeInRange(range: NSRange); message 'fixFontAttributeInRange:';
+    procedure fixParagraphStyleAttributeInRange(range: NSRange); message 'fixParagraphStyleAttributeInRange:';
+    procedure fixAttachmentAttributeInRange(range: NSRange); message 'fixAttachmentAttributeInRange:';
+
+    { Category: NSMutableAttributedStringAttachmentConveniences }
+    procedure updateAttachmentsFromPath(path: NSString); message 'updateAttachmentsFromPath:';
+  end; external;
+
+{$endif}
+{$endif}

+ 167 - 0
packages/cocoaint/src/appkit/NSBezierPath.inc

@@ -0,0 +1,167 @@
+{ Parsed from Appkit.framework NSBezierPath.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSBEZIERPATH_PAS_T}
+{$define NSBEZIERPATH_PAS_T}
+
+{ Constants }
+
+const
+  NSButtLineCapStyle = 0;
+  NSRoundLineCapStyle = 1;
+  NSSquareLineCapStyle = 2;
+
+const
+  NSMiterLineJoinStyle = 0;
+  NSRoundLineJoinStyle = 1;
+  NSBevelLineJoinStyle = 2;
+
+const
+  NSNonZeroWindingRule = 0;
+  NSEvenOddWindingRule = 1;
+
+const
+  NSMoveToBezierPathElement = 0;
+  NSLineToBezierPathElement = 1;
+  NSCurveToBezierPathElement = 2;
+  NSClosePathBezierPathElement = 3;
+
+{ Types }
+type
+  NSLineCapStyle = NSUInteger;
+  NSLineJoinStyle = NSUInteger;
+  NSWindingRule = NSUInteger;
+  NSBezierPathElement = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSBEZIERPATH_PAS_R}
+{$define NSBEZIERPATH_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSBEZIERPATH_PAS_F}
+{$define NSBEZIERPATH_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSBEZIERPATH_PAS_S}
+{$define NSBEZIERPATH_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSBezierPath = objcclass;
+  NSBezierPathPointer = ^NSBezierPath;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSBEZIERPATH_PAS_C}
+{$define NSBEZIERPATH_PAS_C}
+
+{ NSBezierPath }
+  NSBezierPath = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  private
+    __segmentCount: NSInteger;
+    __segmentMax: NSInteger;
+    __head: PATHSEGMENT;
+    __lastSubpathIndex: NSInteger;
+    __elementCount: NSInteger;
+    __lineWidth: CGFloat;
+    __controlPointBounds: NSRect;
+    __miterLimit: CGFloat;
+    __flatness: CGFloat;
+    __dashedLinePattern: CGFloat;
+    __dashedLineCount: NSUInteger;
+    __dashedLinePhase: CGFloat;
+    __path: Pointer;
+        _private: array[0..3] of id;
+    __bpFlags: bitpacked record
+        _flags: 0..((1 shl 8)-1);
+        _pathState: 0..((1 shl 2)-1);
+        
+        _unused: 0..((1 shl 22)-1);
+      end;
+    
+  public
+    class function alloc: NSBezierPath; message 'alloc';
+
+    class function bezierPath: NSBezierPath; message 'bezierPath';
+    class function bezierPathWithRect(rect: NSRect): NSBezierPath; message 'bezierPathWithRect:';
+    class function bezierPathWithOvalInRect(rect: NSRect): NSBezierPath; message 'bezierPathWithOvalInRect:';
+    class function bezierPathWithRoundedRect_xRadius_yRadius(rect: NSRect; xRadius: CGFloat; yRadius: CGFloat): NSBezierPath; message 'bezierPathWithRoundedRect:xRadius:yRadius:';
+    class procedure fillRect(rect: NSRect); message 'fillRect:';
+    class procedure strokeRect(rect: NSRect); message 'strokeRect:';
+    class procedure clipRect(rect: NSRect); message 'clipRect:';
+    class procedure strokeLineFromPoint_toPoint(point: NSPoint; point1: NSPoint); message 'strokeLineFromPoint:toPoint:';
+    class procedure drawPackedGlyphs_atPoint(packedGlyphs: PChar; point: NSPoint); message 'drawPackedGlyphs:atPoint:';
+    class procedure setDefaultMiterLimit(limit: CGFloat); message 'setDefaultMiterLimit:';
+    class function defaultMiterLimit: CGFloat; message 'defaultMiterLimit';
+    class procedure setDefaultFlatness(flatness_: CGFloat); message 'setDefaultFlatness:';
+    class function defaultFlatness: CGFloat; message 'defaultFlatness';
+    class procedure setDefaultWindingRule(windingRule_: NSWindingRule); message 'setDefaultWindingRule:';
+    class function defaultWindingRule: NSWindingRule; message 'defaultWindingRule';
+    class procedure setDefaultLineCapStyle(lineCapStyle_: NSLineCapStyle); message 'setDefaultLineCapStyle:';
+    class function defaultLineCapStyle: NSLineCapStyle; message 'defaultLineCapStyle';
+    class procedure setDefaultLineJoinStyle(lineJoinStyle_: NSLineJoinStyle); message 'setDefaultLineJoinStyle:';
+    class function defaultLineJoinStyle: NSLineJoinStyle; message 'defaultLineJoinStyle';
+    class procedure setDefaultLineWidth(lineWidth_: CGFloat); message 'setDefaultLineWidth:';
+    class function defaultLineWidth: CGFloat; message 'defaultLineWidth';
+    procedure moveToPoint(point: NSPoint); message 'moveToPoint:';
+    procedure lineToPoint(point: NSPoint); message 'lineToPoint:';
+    procedure closePath; message 'closePath';
+    procedure removeAllPoints; message 'removeAllPoints';
+    procedure relativeMoveToPoint(point: NSPoint); message 'relativeMoveToPoint:';
+    procedure relativeLineToPoint(point: NSPoint); message 'relativeLineToPoint:';
+    function lineWidth: CGFloat; message 'lineWidth';
+    procedure setLineWidth(lineWidth_: CGFloat); message 'setLineWidth:';
+    function lineCapStyle: NSLineCapStyle; message 'lineCapStyle';
+    procedure setLineCapStyle(lineCapStyle_: NSLineCapStyle); message 'setLineCapStyle:';
+    function lineJoinStyle: NSLineJoinStyle; message 'lineJoinStyle';
+    procedure setLineJoinStyle(lineJoinStyle_: NSLineJoinStyle); message 'setLineJoinStyle:';
+    function windingRule: NSWindingRule; message 'windingRule';
+    procedure setWindingRule(windingRule_: NSWindingRule); message 'setWindingRule:';
+    function miterLimit: CGFloat; message 'miterLimit';
+    procedure setMiterLimit(miterLimit_: CGFloat); message 'setMiterLimit:';
+    function flatness: CGFloat; message 'flatness';
+    procedure setFlatness(flatness_: CGFloat); message 'setFlatness:';
+    procedure getLineDash_count_phase(pattern: psingle; count: NSIntegerPointer; phase: psingle); message 'getLineDash:count:phase:';
+    procedure setLineDash_count_phase(pattern: psingle; count: NSInteger; phase: CGFloat); message 'setLineDash:count:phase:';
+    procedure stroke; message 'stroke';
+    procedure fill; message 'fill';
+    procedure addClip; message 'addClip';
+    procedure setClip; message 'setClip';
+    function bezierPathByFlatteningPath: NSBezierPath; message 'bezierPathByFlatteningPath';
+    function bezierPathByReversingPath: NSBezierPath; message 'bezierPathByReversingPath';
+    procedure transformUsingAffineTransform(transform: NSAffineTransform); message 'transformUsingAffineTransform:';
+    function isEmpty: Boolean; message 'isEmpty';
+    function currentPoint: NSPoint; message 'currentPoint';
+    function controlPointBounds: NSRect; message 'controlPointBounds';
+    function bounds: NSRect; message 'bounds';
+    function elementCount: NSInteger; message 'elementCount';
+    function elementAtIndex(index: NSInteger): NSBezierPathElement; message 'elementAtIndex:';
+    procedure setAssociatedPoints_atIndex(points: NSPointArray; index: NSInteger); message 'setAssociatedPoints:atIndex:';
+    procedure appendBezierPath(path: NSBezierPath); message 'appendBezierPath:';
+    procedure appendBezierPathWithRect(rect: NSRect); message 'appendBezierPathWithRect:';
+    procedure appendBezierPathWithPoints_count(points: NSPointArray; count: NSInteger); message 'appendBezierPathWithPoints:count:';
+    procedure appendBezierPathWithOvalInRect(rect: NSRect); message 'appendBezierPathWithOvalInRect:';
+    procedure appendBezierPathWithGlyph_inFont(glyph: NSGlyph; font: NSFont); message 'appendBezierPathWithGlyph:inFont:';
+    procedure appendBezierPathWithPackedGlyphs(packedGlyphs: PChar); message 'appendBezierPathWithPackedGlyphs:';
+    procedure appendBezierPathWithRoundedRect_xRadius_yRadius(rect: NSRect; xRadius: CGFloat; yRadius: CGFloat); message 'appendBezierPathWithRoundedRect:xRadius:yRadius:';
+    function containsPoint(point: NSPoint): Boolean; message 'containsPoint:';
+    function cachesBezierPath: Boolean; message 'cachesBezierPath';
+    procedure setCachesBezierPath(flag: Boolean); message 'setCachesBezierPath:';
+  end; external;
+
+{$endif}
+{$endif}

+ 151 - 0
packages/cocoaint/src/appkit/NSBitmapImageRep.inc

@@ -0,0 +1,151 @@
+{ Parsed from Appkit.framework NSBitmapImageRep.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSBITMAPIMAGEREP_PAS_T}
+{$define NSBITMAPIMAGEREP_PAS_T}
+
+{ Constants }
+
+const
+  NSTIFFCompressionNone = 1;
+  NSTIFFCompressionCCITTFAX3 = 3;
+  NSTIFFCompressionCCITTFAX4 = 4;
+  NSTIFFCompressionLZW = 5;
+  NSTIFFCompressionJPEG = 6;
+  NSTIFFCompressionNEXT = 32766;
+  NSTIFFCompressionPackBits = 32773;
+  NSTIFFCompressionOldJPEG = 32865;
+
+const
+  NSTIFFFileType = 0;
+  NSBMPFileType = 1;
+  NSGIFFileType = 2;
+  NSJPEGFileType = 3;
+  NSPNGFileType = 4;
+  NSJPEG2000FileType = 5;
+
+const
+  NSImageRepLoadStatusUnknownType = -1;
+  NSImageRepLoadStatusReadingHeader = -2;
+  NSImageRepLoadStatusWillNeedAllData = -3;
+  NSImageRepLoadStatusInvalidData = -4;
+  NSImageRepLoadStatusUnexpectedEOF = -5;
+  NSImageRepLoadStatusCompleted = -6;
+
+const
+  NSAlphaFirstBitmapFormat = 1  shl  0;
+  NSAlphaNonpremultipliedBitmapFormat = 1  shl  1;
+  NSFloatingPointSamplesBitmapFormat = 1  shl  2;
+
+{ Types }
+type
+  NSTIFFCompression = NSUInteger;
+  NSBitmapImageFileType = NSUInteger;
+  NSImageRepLoadStatus = NSInteger;
+  NSBitmapFormat = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSBITMAPIMAGEREP_PAS_R}
+{$define NSBITMAPIMAGEREP_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSBITMAPIMAGEREP_PAS_F}
+{$define NSBITMAPIMAGEREP_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSBITMAPIMAGEREP_PAS_S}
+{$define NSBITMAPIMAGEREP_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSBitmapImageRep = objcclass;
+  NSBitmapImageRepPointer = ^NSBitmapImageRep;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSBITMAPIMAGEREP_PAS_C}
+{$define NSBITMAPIMAGEREP_PAS_C}
+
+{ NSBitmapImageRep }
+  NSBitmapImageRep = objcclass(NSImageRep)
+  private
+    __moreRepFlags: bitpacked record
+        bitsPerPixel: cuint;
+        isPlanar: 0..1;
+        explicitPlanes: 0..1;
+        isUnpacked: 0..1;
+        dataLoaded: 0..1;
+        numColors: cuint;
+        memory: 0..((1 shl 2)-1);
+        compressionFactor: 0..((1 shl 14)-1);
+        imageNumber: 0..((1 shl 8)-1);
+        bitmapFormat: 0..((1 shl 3)-1);
+        cgImageIsPrimary: 0..1;
+        compression: 0..((1 shl 20)-1);
+      end;
+    __bytesPerRow: cuint;
+    __data: char;
+    __tiffData: NSData;
+    __properties: id;
+    
+  public
+    class function alloc: NSBitmapImageRep; message 'alloc';
+
+    function initWithFocusedViewRect(rect: NSRect): id; message 'initWithFocusedViewRect:';
+    function initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel(planes: pchar; width: NSInteger; height: NSInteger; bps: NSInteger; spp: NSInteger; alpha: Boolean; isPlanar_: Boolean; colorSpaceName_: NSString; rBytes: NSInteger; pBits: NSInteger): id; message 'initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:';
+    function initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel(planes: pchar; width: NSInteger; height: NSInteger; bps: NSInteger; spp: NSInteger; alpha: Boolean; isPlanar_: Boolean; colorSpaceName_: NSString; bitmapFormat_: NSBitmapFormat; rBytes: NSInteger; pBits: NSInteger): id; message 'initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:';
+    function initWithCGImage(CGImage_: CGImageRef): id; message 'initWithCGImage:';
+    function initWithCIImage(ciImage: CIImagePointer): id; message 'initWithCIImage:';
+    class function imageRepsWithData(data: NSData): NSArray; message 'imageRepsWithData:';
+    class function imageRepWithData(data: NSData): id; message 'imageRepWithData:';
+    function initWithData(data: NSData): id; message 'initWithData:';
+    function bitmapData: Pointer; message 'bitmapData';
+    procedure getBitmapDataPlanes(data: pchar); message 'getBitmapDataPlanes:';
+    function isPlanar: Boolean; message 'isPlanar';
+    function samplesPerPixel: NSInteger; message 'samplesPerPixel';
+    function bitsPerPixel: NSInteger; message 'bitsPerPixel';
+    function bytesPerRow: NSInteger; message 'bytesPerRow';
+    function bytesPerPlane: NSInteger; message 'bytesPerPlane';
+    function numberOfPlanes: NSInteger; message 'numberOfPlanes';
+    function bitmapFormat: NSBitmapFormat; message 'bitmapFormat';
+    procedure getCompression_factor(compression: NSTIFFCompressionPointer; factor: psingle); message 'getCompression:factor:';
+    procedure setCompression_factor(compression: NSTIFFCompression; factor: single); message 'setCompression:factor:';
+    function TIFFRepresentation: NSData; message 'TIFFRepresentation';
+    function TIFFRepresentationUsingCompression_factor(comp: NSTIFFCompression; factor: single): NSData; message 'TIFFRepresentationUsingCompression:factor:';
+    class function TIFFRepresentationOfImageRepsInArray(array_: NSArray): NSData; message 'TIFFRepresentationOfImageRepsInArray:';
+    class function TIFFRepresentationOfImageRepsInArray_usingCompression_factor(array_: NSArray; comp: NSTIFFCompression; factor: single): NSData; message 'TIFFRepresentationOfImageRepsInArray:usingCompression:factor:';
+    class procedure getTIFFCompressionTypes_count(list: NSTIFFCompressionPointer; numTypes: NSIntegerPointer); message 'getTIFFCompressionTypes:count:';
+    class function localizedNameForTIFFCompressionType(compression: NSTIFFCompression): NSString; message 'localizedNameForTIFFCompressionType:';
+    function canBeCompressedUsing(compression: NSTIFFCompression): Boolean; message 'canBeCompressedUsing:';
+    procedure colorizeByMappingGray_toColor_blackMapping_whiteMapping(midPoint: CGFloat; midPointColor: NSColor; shadowColor: NSColor; lightColor: NSColor); message 'colorizeByMappingGray:toColor:blackMapping:whiteMapping:';
+    function initForIncrementalLoad: id; message 'initForIncrementalLoad';
+    function incrementalLoadFromData_complete(data: NSData; complete: Boolean): NSInteger; message 'incrementalLoadFromData:complete:';
+    procedure setColor_atX_y(color: NSColor; x: NSInteger; y: NSInteger); message 'setColor:atX:y:';
+    function colorAtX_y(x: NSInteger; y: NSInteger): NSColor; message 'colorAtX:y:';
+    procedure getPixel_atX_y(p: NSUInteger; x: NSInteger; y: NSInteger); message 'getPixel:atX:y:';
+    procedure setPixel_atX_y(p: NSUInteger; x: NSInteger; y: NSInteger); message 'setPixel:atX:y:';
+    function CGImage: CGImageRef; message 'CGImage';
+
+    { Category: NSBitmapImageFileTypeExtensions }
+    class function representationOfImageRepsInArray_usingType_properties(imageReps: NSArray; storageType: NSBitmapImageFileType; properties: NSDictionary): NSData; message 'representationOfImageRepsInArray:usingType:properties:';
+    function representationUsingType_properties(storageType: NSBitmapImageFileType; properties: NSDictionary): NSData; message 'representationUsingType:properties:';
+    procedure setProperty_withValue(property_: NSString; value: id); message 'setProperty:withValue:';
+    function valueForProperty(property_: NSString): id; message 'valueForProperty:';
+  end; external;
+
+{$endif}
+{$endif}

+ 127 - 0
packages/cocoaint/src/appkit/NSBox.inc

@@ -0,0 +1,127 @@
+{ Parsed from Appkit.framework NSBox.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSBOX_PAS_T}
+{$define NSBOX_PAS_T}
+
+{ Constants }
+
+const
+  NSNoTitle = 0;
+  NSAboveTop = 1;
+  NSAtTop = 2;
+  NSBelowTop = 3;
+  NSAboveBottom = 4;
+  NSAtBottom = 5;
+  NSBelowBottom = 6;
+
+const
+  NSBoxPrimary = 0;
+  NSBoxSecondary = 1;
+  NSBoxSeparator = 2;
+  NSBoxOldStyle = 3;
+  NSBoxCustom = 4;
+
+{ Types }
+type
+  NSTitlePosition = NSUInteger;
+  NSBoxType = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSBOX_PAS_R}
+{$define NSBOX_PAS_R}
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSBOX_PAS_F}
+{$define NSBOX_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSBOX_PAS_S}
+{$define NSBOX_PAS_S}
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSBox = objcclass;
+  NSBoxPointer = ^NSBox;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSBOX_PAS_C}
+{$define NSBOX_PAS_C}
+
+{ NSBox }
+  NSBox = objcclass(NSView)
+  private
+    __titleCell: id;
+    __contentView: id;
+    __offsets: NSSize;
+    __borderRect: NSRect;
+    __titleRect: NSRect;
+    __bFlags: bitpacked record
+        borderType: 0..((1 shl 2)-1);
+        titlePosition: 0..((1 shl 3)-1);
+        backgroundTransparent: 0..1;
+        reserved: 0..((1 shl 2)-1);
+        needsTile: 0..1;
+        transparent: 0..1;
+        colorAltInterpretation: 0..1;
+        boxType: 0..((1 shl 3)-1);
+        _RESERVED: 0..((1 shl 18)-1);
+      end;
+    __unused: id;
+    
+  public
+    class function alloc: NSBox; message 'alloc';
+
+    function borderType: NSBorderType; message 'borderType';
+    function titlePosition: NSTitlePosition; message 'titlePosition';
+    procedure setBorderType(aType: NSBorderType); message 'setBorderType:';
+    procedure setBoxType(boxType_: NSBoxType); message 'setBoxType:';
+    function boxType: NSBoxType; message 'boxType';
+    procedure setTitlePosition(aPosition: NSTitlePosition); message 'setTitlePosition:';
+    function title: NSString; message 'title';
+    procedure setTitle(aString: NSString); message 'setTitle:';
+    function titleFont: NSFont; message 'titleFont';
+    procedure setTitleFont(fontObj: NSFont); message 'setTitleFont:';
+    function borderRect: NSRect; message 'borderRect';
+    function titleRect: NSRect; message 'titleRect';
+    function titleCell: id; message 'titleCell';
+    procedure sizeToFit; message 'sizeToFit';
+    function contentViewMargins: NSSize; message 'contentViewMargins';
+    procedure setContentViewMargins(offsetSize: NSSize); message 'setContentViewMargins:';
+    procedure setFrameFromContentFrame(contentFrame: NSRect); message 'setFrameFromContentFrame:';
+    function contentView: id; message 'contentView';
+    procedure setContentView(aView: NSView); message 'setContentView:';
+    function isTransparent: Boolean; message 'isTransparent';
+    procedure setTransparent(flag: Boolean); message 'setTransparent:';
+
+    { Category: NSKeyboardUI }
+    procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
+
+    { Category: NSCustomBoxTypeProperties }
+    function borderWidth: CGFloat; message 'borderWidth';
+    procedure setBorderWidth(borderWidth_: CGFloat); message 'setBorderWidth:';
+    function cornerRadius: CGFloat; message 'cornerRadius';
+    procedure setCornerRadius(cornerRadius_: CGFloat); message 'setCornerRadius:';
+    function borderColor: NSColor; message 'borderColor';
+    procedure setBorderColor(borderColor_: NSColor); message 'setBorderColor:';
+    function fillColor: NSColor; message 'fillColor';
+    procedure setFillColor(fillColor_: NSColor); message 'setFillColor:';
+  end; external;
+
+{$endif}
+{$endif}

+ 253 - 0
packages/cocoaint/src/appkit/NSBrowser.inc

@@ -0,0 +1,253 @@
+{ Parsed from Appkit.framework NSBrowser.h }
+{ Version FrameworkParser: 1.3. PasCocoa 0.3, Objective-P 0.4 - Thu Oct 1 18:54:07 ICT 2009 }
+
+
+{$ifdef TYPES}
+{$ifndef NSBROWSER_PAS_T}
+{$define NSBROWSER_PAS_T}
+
+{ Defines }
+const
+  NSAppKitVersionNumberWithContinuousScrollingBrowser = 680.0;
+  NSAppKitVersionNumberWithColumnResizingBrowser = 685.0;
+
+{ Constants }
+
+const
+  NSBrowserNoColumnResizing = 0;
+  NSBrowserAutoColumnResizing = 1;
+  NSBrowserUserColumnResizing = 2;
+
+{ Types }
+type
+  NSBrowserColumnResizingType = NSUInteger;
+  NSBrowserDropOperation = NSUInteger;
+
+{$endif}
+{$endif}
+
+{$ifdef RECORDS}
+{$ifndef NSBROWSER_PAS_R}
+{$define NSBROWSER_PAS_R}
+
+{ Records }
+type
+  __Brflags = bitpacked record
+{$ifdef fpc_big_endian}
+    allowsMultipleSelection: 0..1;
+    allowsBranchSelection: 0..1;
+    reuseColumns: 0..1;
+    isTitled: 0..1;
+    titleFromPrevious: 0..1;
+    separateColumns: 0..1;
+    delegateImplementsWillDisplayCell: 0..1;
+    delegateSetsTitles: 0..1;
+    delegateSelectsCellsByString: 0..1;
+    delegateDoesNotCreateRowsInMatrix: 0..1;
+    delegateValidatesColumns: 0..1;
+    acceptArrowKeys: 0..1;
+    dontDrawTitles: 0..1;
+    sendActionOnArrowKeys: 0..1;
+    prohibitEmptySel: 0..1;
+    hasHorizontalScroller: 0..1;
+    time: 0..1;
+    allowsIncrementalSearching: 0..1;
+    delegateSelectsCellsByRow: 0..1;
+    disableCompositing: 0..((1 shl 6)-1);
+    refusesFirstResponder: 0..1;
+    acceptsFirstMouse: 0..1;
+    actionNeedsToBeSent: 0..1;
+    usesSmallSizeTitleFont: 0..1;
+    usesSmallScrollers: 0..1;
+    prefersAllColumnUserResizing: 0..1;
+    firstVisibleCalculationDisabled: 0..1;
+{$else}
+    firstVisibleCalculationDisabled: 0..1;
+    prefersAllColumnUserResizing: 0..1;
+    usesSmallScrollers: 0..1;
+    usesSmallSizeTitleFont: 0..1;
+    actionNeedsToBeSent: 0..1;
+    acceptsFirstMouse: 0..1;
+    refusesFirstResponder: 0..1;
+    disableCompositing: 0..((1 shl 6)-1);
+    delegateSelectsCellsByRow: 0..1;
+    allowsIncrementalSearching: 0..1;
+    time: 0..1;
+    hasHorizontalScroller: 0..1;
+    prohibitEmptySel: 0..1;
+    sendActionOnArrowKeys: 0..1;
+    dontDrawTitles: 0..1;
+    acceptArrowKeys: 0..1;
+    delegateValidatesColumns: 0..1;
+    delegateDoesNotCreateRowsInMatrix: 0..1;
+    delegateSelectsCellsByString: 0..1;
+    delegateSetsTitles: 0..1;
+    delegateImplementsWillDisplayCell: 0..1;
+    separateColumns: 0..1;
+    titleFromPrevious: 0..1;
+    isTitled: 0..1;
+    reuseColumns: 0..1;
+    allowsBranchSelection: 0..1;
+    allowsMultipleSelection: 0..1;
+{$endif}
+  end;
+_Brflags = __Brflags;
+
+
+{$endif}
+{$endif}
+
+{$ifdef FUNCTIONS}
+{$ifndef NSBROWSER_PAS_F}
+{$define NSBROWSER_PAS_F}
+
+{$endif}
+{$endif}
+
+{$ifdef EXTERNAL_SYMBOLS}
+{$ifndef NSBROWSER_PAS_S}
+{$define NSBROWSER_PAS_S}
+
+{ External string constants }
+var
+  NSBrowserColumnConfigurationDidChangeNotification: NSString; external name '_NSBrowserColumnConfigurationDidChangeNotification';
+
+{$endif}
+{$endif}
+
+{$ifdef FORWARD}
+  NSBrowser = objcclass;
+  NSBrowserPointer = ^NSBrowser;
+
+{$endif}
+
+{$ifdef CLASSES}
+{$ifndef NSBROWSER_PAS_C}
+{$define NSBROWSER_PAS_C}
+
+{ NSBrowser }
+  NSBrowser = objcclass(NSControl)
+  private
+    __target: id;
+    __action: SEL;
+    __delegate: id;
+    __doubleAction: SEL;
+    __matrixClass: Pobjc_class;
+    __cellPrototype: id;
+    __columnSize: NSSize;
+    __numberOfVisibleColumns: cshort;
+    __minColumnWidth: cshort;
+    __firstVisibleColumn: cshort;
+    __maxVisibleColumns: cshort;
+    __titles: NSMutableArray;
+    __pathSeparator: NSString;
+    __columns: NSMutableArray;
+    __brAuxiliaryStorage: id;
+    __firstColumnTitle: NSString;
+    __scroller: NSScroller;
+    __brflags: _Brflags;
+    
+  public
+    class function alloc: NSBrowser; message 'alloc';
+
+    class function cellClass: Pobjc_class; message 'cellClass';
+    procedure loadColumnZero; message 'loadColumnZero';
+    function isLoaded: Boolean; message 'isLoaded';
+    procedure setDoubleAction(aSelector: SEL); message 'setDoubleAction:';
+    function doubleAction: SEL; message 'doubleAction';
+    procedure setMatrixClass(factoryId: Pobjc_class); message 'setMatrixClass:';
+    function matrixClass: Pobjc_class; message 'matrixClass';
+    procedure setCellClass(factoryId: Pobjc_class); message 'setCellClass:';
+    procedure setCellPrototype(aCell: NSCell); message 'setCellPrototype:';
+    function cellPrototype: id; message 'cellPrototype';
+    procedure setDelegate(anObject: id); message 'setDelegate:';
+    function delegate: id; message 'delegate';
+    procedure setReusesColumns(flag: Boolean); message 'setReusesColumns:';
+    function reusesColumns: Boolean; message 'reusesColumns';
+    procedure setHasHorizontalScroller(flag: Boolean); message 'setHasHorizontalScroller:';
+    function hasHorizontalScroller: Boolean; message 'hasHorizontalScroller';
+    procedure setSeparatesColumns(flag: Boolean); message 'setSeparatesColumns:';
+    function separatesColumns: Boolean; message 'separatesColumns';
+    procedure setTitled(flag: Boolean); message 'setTitled:';
+    function isTitled: Boolean; message 'isTitled';
+    procedure setMinColumnWidth(columnWidth: CGFloat); message 'setMinColumnWidth:';
+    function minColumnWidth: CGFloat; message 'minColumnWidth';
+    procedure setMaxVisibleColumns(columnCount: NSInteger); message 'setMaxVisibleColumns:';
+    function maxVisibleColumns: NSInteger; message 'maxVisibleColumns';
+    procedure setAllowsMultipleSelection(flag: Boolean); message 'setAllowsMultipleSelection:';
+    function allowsMultipleSelection: Boolean; message 'allowsMultipleSelection';
+    procedure setAllowsBranchSelection(flag: Boolean); message 'setAllowsBranchSelection:';
+    function allowsBranchSelection: Boolean; message 'allowsBranchSelection';
+    procedure setAllowsEmptySelection(flag: Boolean); message 'setAllowsEmptySelection:';
+    function allowsEmptySelection: Boolean; message 'allowsEmptySelection';
+    procedure setTakesTitleFromPreviousColumn(flag: Boolean); message 'setTakesTitleFromPreviousColumn:';
+    function takesTitleFromPreviousColumn: Boolean; message 'takesTitleFromPreviousColumn';
+    procedure setAcceptsArrowKeys(flag: Boolean); message 'setAcceptsArrowKeys:';
+    function acceptsArrowKeys: Boolean; message 'acceptsArrowKeys';
+    procedure setSendsActionOnArrowKeys(flag: Boolean); message 'setSendsActionOnArrowKeys:';
+    function sendsActionOnArrowKeys: Boolean; message 'sendsActionOnArrowKeys';
+    procedure setTitle_ofColumn(aString: NSString; column: NSInteger); message 'setTitle:ofColumn:';
+    function titleOfColumn(column: NSInteger): NSString; message 'titleOfColumn:';
+    procedure setPathSeparator(newString: NSString); message 'setPathSeparator:';
+    function pathSeparator: NSString; message 'pathSeparator';
+    function setPath(path_: NSString): Boolean; message 'setPath:';
+    function path: NSString; message 'path';
+    function pathToColumn(column: NSInteger): NSString; message 'pathToColumn:';
+    function selectedColumn: NSInteger; message 'selectedColumn';
+    function selectedCell: id; message 'selectedCell';
+    function selectedCellInColumn(column: NSInteger): id; message 'selectedCellInColumn:';
+    function selectedCells: NSArray; message 'selectedCells';
+    procedure selectRow_inColumn(row: NSInteger; column: NSInteger); message 'selectRow:inColumn:';
+    function selectedRowInColumn(column: NSInteger): NSInteger; message 'selectedRowInColumn:';
+    procedure selectRowIndexes_inColumn(indexes: NSIndexSet; column: NSInteger); message 'selectRowIndexes:inColumn:';
+    function selectedRowIndexesInColumn(column: NSInteger): NSIndexSet; message 'selectedRowIndexesInColumn:';
+    procedure reloadColumn(column: NSInteger); message 'reloadColumn:';
+    procedure validateVisibleColumns; message 'validateVisibleColumns';
+    procedure scrollColumnsRightBy(shiftAmount: NSInteger); message 'scrollColumnsRightBy:';
+    procedure scrollColumnsLeftBy(shiftAmount: NSInteger); message 'scrollColumnsLeftBy:';
+    procedure scrollColumnToVisible(column: NSInteger); message 'scrollColumnToVisible:';
+    procedure setLastColumn(column: NSInteger); message 'setLastColumn:';
+    function lastColumn: NSInteger; message 'lastColumn';
+    procedure addColumn; message 'addColumn';
+    function numberOfVisibleColumns: NSInteger; message 'numberOfVisibleColumns';
+    function firstVisibleColumn: NSInteger; message 'firstVisibleColumn';
+    function lastVisibleColumn: NSInteger; message 'lastVisibleColumn';
+    function columnOfMatrix(matrix: NSMatrix): NSInteger; message 'columnOfMatrix:';
+    function matrixInColumn(column: NSInteger): NSMatrix; message 'matrixInColumn:';
+    function loadedCellAtRow_column(row: NSInteger; col: NSInteger): id; message 'loadedCellAtRow:column:';
+    procedure selectAll(sender: id); message 'selectAll:';
+    procedure tile; message 'tile';
+    procedure doClick(sender: id); message 'doClick:';
+    procedure doDoubleClick(sender: id); message 'doDoubleClick:';
+    function sendAction: Boolean; message 'sendAction';
+    function titleFrameOfColumn(column: NSInteger): NSRect; message 'titleFrameOfColumn:';
+    procedure drawTitleOfColumn_inRect(column: NSInteger; aRect: NSRect); message 'drawTitleOfColumn:inRect:';
+    function titleHeight: CGFloat; message 'titleHeight';
+    function frameOfColumn(column: NSInteger): NSRect; message 'frameOfColumn:';
+    function frameOfInsideOfColumn(column: NSInteger): NSRect; message 'frameOfInsideOfColumn:';
+    function columnWidthForColumnContentWidth(columnContentWidth: CGFloat): CGFloat; message 'columnWidthForColumnContentWidth:';
+    function columnContentWidthForColumnWidth(columnWidth: CGFloat): CGFloat; message 'columnContentWidthForColumnWidth:';
+    procedure setColumnResizingType(columnResizingType_: NSBrowserColumnResizingType); message 'setColumnResizingType:';
+    function columnResizingType: NSBrowserColumnResizingType; message 'columnResizingType';
+    procedure setPrefersAllColumnUserResizing(prefersAllColumnResizing: Boolean); message 'setPrefersAllColumnUserResizing:';
+    function prefersAllColumnUserResizing: Boolean; message 'prefersAllColumnUserResizing';
+    procedure setWidth_ofColumn(columnWidth: CGFloat; columnIndex: NSInteger); message 'setWidth:ofColumn:';
+    function widthOfColumn(column: NSInteger): CGFloat; message 'widthOfColumn:';
+    procedure setColumnsAutosaveName(name: NSString); message 'setColumnsAutosaveName:';
+    function columnsAutosaveName: NSString; message 'columnsAutosaveName';
+    class procedure removeSavedColumnsWithAutosaveName(name: NSString); message 'removeSavedColumnsWithAutosaveName:';
+    function canDragRowsWithIndexes_inColumn_withEvent(rowIndexes: NSIndexSet; column: NSInteger; event: NSEvent): Boolean; message 'canDragRowsWithIndexes:inColumn:withEvent:';
+    function draggingImageForRowsWithIndexes_inColumn_withEvent_offset(rowIndexes: NSIndexSet; column: NSInteger; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'draggingImageForRowsWithIndexes:inColumn:withEvent:offset:';
+    procedure setDraggingSourceOperationMask_forLocal(mask: NSDragOperation; isLocal: Boolean); message 'setDraggingSourceOperationMask:forLocal:';
+    function allowsTypeSelect: Boolean; message 'allowsTypeSelect';
+    procedure setAllowsTypeSelect(value: Boolean); message 'setAllowsTypeSelect:';
+    procedure setBackgroundColor(color: NSColor); message 'setBackgroundColor:';
+    function backgroundColor: NSColor; message 'backgroundColor';
+    procedure displayColumn(column: NSInteger); message 'displayColumn:';
+    procedure displayAllColumns; message 'displayAllColumns';
+    procedure scrollViaScroller(sender: NSScroller); message 'scrollViaScroller:';
+    procedure updateScroller; message 'updateScroller';
+  end; external;
+
+{$endif}
+{$endif}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác