Просмотр исходного кода

Rebase to revision 16728

git-svn-id: branches/svenbarth/classhelpers@16732 -
svenbarth 14 лет назад
Родитель
Сommit
a9b64c80ad
100 измененных файлов с 2766 добавлено и 2366 удалено
  1. 34 7
      .gitattributes
  2. 9 9
      .gitignore
  3. 1 1
      compiler/cfileutl.pas
  4. 30 21
      compiler/dbgdwarf.pas
  5. 5 5
      compiler/defcmp.pas
  6. 1 1
      compiler/defutil.pas
  7. 2 2
      compiler/fmodule.pas
  8. 5 5
      compiler/globals.pas
  9. 3 5
      compiler/globtype.pas
  10. 13 10
      compiler/htypechk.pas
  11. 2 2
      compiler/msg/errord.msg
  12. 2 2
      compiler/msg/errordu.msg
  13. 18 3
      compiler/msg/errore.msg
  14. 9 3
      compiler/msgidx.inc
  15. 318 308
      compiler/msgtxt.inc
  16. 14 10
      compiler/nadd.pas
  17. 3 4
      compiler/ncal.pas
  18. 8 14
      compiler/ncgadd.pas
  19. 2 2
      compiler/ncgmem.pas
  20. 1 0
      compiler/ncgrtti.pas
  21. 76 0
      compiler/nmat.pas
  22. 8 7
      compiler/nmem.pas
  23. 4 4
      compiler/nobj.pas
  24. 2 0
      compiler/node.pas
  25. 3 3
      compiler/nutils.pas
  26. 1 0
      compiler/options.pas
  27. 3 7
      compiler/parser.pas
  28. 1 0
      compiler/pass_2.pas
  29. 70 107
      compiler/pdecl.pas
  30. 200 163
      compiler/pdecobj.pas
  31. 132 49
      compiler/pdecsub.pas
  32. 26 22
      compiler/pdecvar.pas
  33. 13 10
      compiler/pexpr.pas
  34. 2 0
      compiler/powerpc/nppcmat.pas
  35. 2 0
      compiler/powerpc64/nppcmat.pas
  36. 1 1
      compiler/ppu.pas
  37. 2 2
      compiler/pstatmnt.pas
  38. 18 18
      compiler/psub.pas
  39. 1 0
      compiler/psystem.pas
  40. 2 2
      compiler/ptconst.pas
  41. 266 128
      compiler/ptype.pas
  42. 2 2
      compiler/rautils.pas
  43. 6 0
      compiler/scandir.pas
  44. 33 17
      compiler/scanner.pas
  45. 18 10
      compiler/symconst.pas
  46. 47 39
      compiler/symdef.pas
  47. 70 19
      compiler/symtable.pas
  48. 1 0
      compiler/symtype.pas
  49. 17 12
      compiler/utils/ppudump.pp
  50. 6 6
      compiler/utils/samplecfg
  51. 6 0
      compiler/x86/aasmcpu.pas
  52. 3 8
      compiler/x86/cgx86.pas
  53. 5 0
      ide/fpdebug.pas
  54. 15 9
      installer/install.pas
  55. 211 211
      packages/cocoaint/src/AnonClassDefinitionsCoredata.pas
  56. 409 409
      packages/cocoaint/src/AnonClassDefinitionsQuartzcore.pas
  57. 329 329
      packages/cocoaint/src/AnonClassDefinitionsWebkit.pas
  58. 11 13
      packages/cocoaint/src/appkit/NSATSTypesetter.inc
  59. 5 5
      packages/cocoaint/src/appkit/NSAccessibility.inc
  60. 3 5
      packages/cocoaint/src/appkit/NSActionCell.inc
  61. 5 7
      packages/cocoaint/src/appkit/NSAffineTransform.inc
  62. 5 7
      packages/cocoaint/src/appkit/NSAlert.inc
  63. 9 13
      packages/cocoaint/src/appkit/NSAnimation.inc
  64. 3 5
      packages/cocoaint/src/appkit/NSAnimationContext.inc
  65. 3 3
      packages/cocoaint/src/appkit/NSAppleScriptExtensions.inc
  66. 21 23
      packages/cocoaint/src/appkit/NSApplication.inc
  67. 5 5
      packages/cocoaint/src/appkit/NSApplicationScripting.inc
  68. 3 5
      packages/cocoaint/src/appkit/NSArrayController.inc
  69. 15 19
      packages/cocoaint/src/appkit/NSAttributedString.inc
  70. 5 7
      packages/cocoaint/src/appkit/NSBezierPath.inc
  71. 5 7
      packages/cocoaint/src/appkit/NSBitmapImageRep.inc
  72. 7 9
      packages/cocoaint/src/appkit/NSBox.inc
  73. 7 9
      packages/cocoaint/src/appkit/NSBrowser.inc
  74. 3 5
      packages/cocoaint/src/appkit/NSBrowserCell.inc
  75. 15 17
      packages/cocoaint/src/appkit/NSButton.inc
  76. 13 15
      packages/cocoaint/src/appkit/NSButtonCell.inc
  77. 5 7
      packages/cocoaint/src/appkit/NSCIImageRep.inc
  78. 3 5
      packages/cocoaint/src/appkit/NSCachedImageRep.inc
  79. 17 19
      packages/cocoaint/src/appkit/NSCell.inc
  80. 5 7
      packages/cocoaint/src/appkit/NSClipView.inc
  81. 7 11
      packages/cocoaint/src/appkit/NSCollectionView.inc
  82. 9 11
      packages/cocoaint/src/appkit/NSColor.inc
  83. 3 5
      packages/cocoaint/src/appkit/NSColorList.inc
  84. 7 9
      packages/cocoaint/src/appkit/NSColorPanel.inc
  85. 3 5
      packages/cocoaint/src/appkit/NSColorPicker.inc
  86. 5 5
      packages/cocoaint/src/appkit/NSColorPicking.inc
  87. 3 5
      packages/cocoaint/src/appkit/NSColorSpace.inc
  88. 3 5
      packages/cocoaint/src/appkit/NSColorWell.inc
  89. 7 9
      packages/cocoaint/src/appkit/NSComboBox.inc
  90. 5 6
      packages/cocoaint/src/appkit/NSComboBoxCell.inc
  91. 13 15
      packages/cocoaint/src/appkit/NSControl.inc
  92. 3 5
      packages/cocoaint/src/appkit/NSController.inc
  93. 3 5
      packages/cocoaint/src/appkit/NSCursor.inc
  94. 3 5
      packages/cocoaint/src/appkit/NSCustomImageRep.inc
  95. 3 5
      packages/cocoaint/src/appkit/NSDatePicker.inc
  96. 5 7
      packages/cocoaint/src/appkit/NSDatePickerCell.inc
  97. 5 7
      packages/cocoaint/src/appkit/NSDictionaryController.inc
  98. 5 7
      packages/cocoaint/src/appkit/NSDockTile.inc
  99. 5 7
      packages/cocoaint/src/appkit/NSDocument.inc
  100. 5 7
      packages/cocoaint/src/appkit/NSDocumentController.inc

+ 34 - 7
.gitattributes

@@ -1343,8 +1343,6 @@ 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/patches/NSObjCRuntime.patch svneol=native#text/plain
 packages/cocoaint/src/quartzcore/AnonIncludeClassDefinitionsQuartzcore.inc svneol=native#text/plain
 packages/cocoaint/src/quartzcore/CAAnimation.inc svneol=native#text/plain
 packages/cocoaint/src/quartzcore/CABase.inc svneol=native#text/plain
@@ -1559,6 +1557,8 @@ 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/cocoa-skel/patches/NSBundle.patch svneol=native#text/plain
+packages/cocoaint/utils/cocoa-skel/patches/NSObjCRuntime.patch svneol=native#text/plain
 packages/cocoaint/utils/cocoa-skel/src/CocoaAll.pas svneol=native#text/plain
 packages/cocoaint/utils/cocoa-skel/src/CoreData.pas svneol=native#text/plain
 packages/cocoaint/utils/cocoa-skel/src/InlineFunctions.inc svneol=native#text/plain
@@ -1578,8 +1578,9 @@ packages/cocoaint/utils/make-ios-headers.sh svneol=native#text/plain
 packages/cocoaint/utils/parser.php svneol=native#text/plain
 packages/cocoaint/utils/patches/cocoa-coredata-webkit.patch svneol=native#text/plain
 packages/cocoaint/utils/patches/uikit.patch svneol=native#text/plain
-packages/cocoaint/utils/source/objp_parser.php svneol=native#text/plain
-packages/cocoaint/utils/source/pascocoa_parser.php svneol=native#text/plain
+packages/cocoaint/utils/source/objp.php svneol=native#text/plain
+packages/cocoaint/utils/source/objp_base.php svneol=native#text/plain
+packages/cocoaint/utils/source/utilities.php svneol=native#text/plain
 packages/cocoaint/utils/uikit-skel/src/InlineFunctions.inc svneol=native#text/plain
 packages/cocoaint/utils/uikit-skel/src/UndefinedTypes.inc svneol=native#text/plain
 packages/cocoaint/utils/uikit-skel/src/foundation/Foundation.inc svneol=native#text/plain
@@ -2111,6 +2112,7 @@ packages/fcl-json/Makefile.fpc svneol=native#text/plain
 packages/fcl-json/examples/confdemo.lpi svneol=native#text/plain
 packages/fcl-json/examples/confdemo.pp svneol=native#text/plain
 packages/fcl-json/examples/demoformat.pp svneol=native#text/plain
+packages/fcl-json/examples/demortti.pp svneol=native#text/plain
 packages/fcl-json/examples/parsedemo.lpi svneol=native#text/plain
 packages/fcl-json/examples/parsedemo.pp svneol=native#text/plain
 packages/fcl-json/examples/simpledemo.lpi svneol=native#text/plain
@@ -2118,6 +2120,7 @@ packages/fcl-json/examples/simpledemo.pp svneol=native#text/plain
 packages/fcl-json/fpmake.pp svneol=native#text/plain
 packages/fcl-json/src/README.txt svneol=native#text/plain
 packages/fcl-json/src/fpjson.pp svneol=native#text/plain
+packages/fcl-json/src/fpjsonrtti.pp svneol=native#text/plain
 packages/fcl-json/src/jsonconf.pp svneol=native#text/plain
 packages/fcl-json/src/jsonparser.pp svneol=native#text/plain
 packages/fcl-json/src/jsonscanner.pp svneol=native#text/plain
@@ -2128,6 +2131,7 @@ packages/fcl-json/tests/testjsonconf.lpi svneol=native#text/plain
 packages/fcl-json/tests/testjsonconf.pp svneol=native#text/plain
 packages/fcl-json/tests/testjsondata.pp svneol=native#text/plain
 packages/fcl-json/tests/testjsonparser.pp svneol=native#text/plain
+packages/fcl-json/tests/testjsonrtti.pp svneol=native#text/plain
 packages/fcl-net/Makefile svneol=native#text/plain
 packages/fcl-net/Makefile.fpc svneol=native#text/plain
 packages/fcl-net/README.txt svneol=native#text/plain
@@ -7316,6 +7320,7 @@ rtl/openbsd/Makefile svneol=native#text/plain
 rtl/openbsd/Makefile.fpc svneol=native#text/plain
 rtl/openbsd/classes.pp svneol=native#text/plain
 rtl/openbsd/errno.inc svneol=native#text/plain
+rtl/openbsd/errnostr.inc svneol=native#text/plain
 rtl/openbsd/i386/cprt0.as svneol=native#text/plain
 rtl/openbsd/i386/prt0.as svneol=native#text/plain
 rtl/openbsd/i386/sighnd.inc svneol=native#text/plain
@@ -7890,7 +7895,6 @@ tests/tbf/tb0066.pp svneol=native#text/plain
 tests/tbf/tb0067.pp svneol=native#text/plain
 tests/tbf/tb0068.pp svneol=native#text/plain
 tests/tbf/tb0069.pp svneol=native#text/plain
-tests/tbf/tb0070.pp svneol=native#text/plain
 tests/tbf/tb0071.pp svneol=native#text/plain
 tests/tbf/tb0072.pp svneol=native#text/plain
 tests/tbf/tb0073.pp svneol=native#text/plain
@@ -8009,7 +8013,6 @@ tests/tbf/tb0184.pp svneol=native#text/plain
 tests/tbf/tb0185.pp svneol=native#text/plain
 tests/tbf/tb0186.pp svneol=native#text/plain
 tests/tbf/tb0187.pp svneol=native#text/plain
-tests/tbf/tb0188.pp svneol=native#text/plain
 tests/tbf/tb0189.pp svneol=native#text/plain
 tests/tbf/tb0190.pp svneol=native#text/plain
 tests/tbf/tb0191.pp svneol=native#text/plain
@@ -8123,6 +8126,7 @@ tests/tbs/tb0066.pp svneol=native#text/plain
 tests/tbs/tb0067.pp svneol=native#text/plain
 tests/tbs/tb0068.pp svneol=native#text/plain
 tests/tbs/tb0069.pp svneol=native#text/plain
+tests/tbs/tb0070.pp svneol=native#text/plain
 tests/tbs/tb0071.pp svneol=native#text/plain
 tests/tbs/tb0072.pp svneol=native#text/plain
 tests/tbs/tb0073.pp svneol=native#text/plain
@@ -8238,6 +8242,7 @@ tests/tbs/tb0185.pp svneol=native#text/plain
 tests/tbs/tb0186.pp svneol=native#text/plain
 tests/tbs/tb0187.pp svneol=native#text/plain
 tests/tbs/tb0188.pp svneol=native#text/plain
+tests/tbs/tb0188a.pp svneol=native#text/plain
 tests/tbs/tb0189.pp svneol=native#text/plain
 tests/tbs/tb0190.pp svneol=native#text/plain
 tests/tbs/tb0191.pp svneol=native#text/plain
@@ -9365,6 +9370,9 @@ tests/test/terecs3.pp svneol=native#text/pascal
 tests/test/terecs4.pp svneol=native#text/pascal
 tests/test/terecs5.pp svneol=native#text/pascal
 tests/test/terecs6.pp svneol=native#text/pascal
+tests/test/terecs7.pp svneol=native#text/pascal
+tests/test/terecs8.pp svneol=native#text/pascal
+tests/test/terecs9.pp svneol=native#text/pascal
 tests/test/terecs_u1.pp svneol=native#text/pascal
 tests/test/testcmem.pp svneol=native#text/plain
 tests/test/testda1.pp svneol=native#text/plain
@@ -9444,7 +9452,18 @@ tests/test/tgeneric20.pp svneol=native#text/pascal
 tests/test/tgeneric21.pp svneol=native#text/pascal
 tests/test/tgeneric22.pp svneol=native#text/pascal
 tests/test/tgeneric23.pp svneol=native#text/pascal
+tests/test/tgeneric24.pp svneol=native#text/pascal
+tests/test/tgeneric25.pp svneol=native#text/pascal
+tests/test/tgeneric26.pp svneol=native#text/pascal
+tests/test/tgeneric27.pp svneol=native#text/pascal
+tests/test/tgeneric28.pp svneol=native#text/pascal
+tests/test/tgeneric29.pp svneol=native#text/pascal
 tests/test/tgeneric3.pp svneol=native#text/plain
+tests/test/tgeneric30.pp svneol=native#text/pascal
+tests/test/tgeneric31.pp svneol=native#text/pascal
+tests/test/tgeneric32.pp svneol=native#text/pascal
+tests/test/tgeneric33.pp svneol=native#text/pascal
+tests/test/tgeneric34.pp svneol=native#text/pascal
 tests/test/tgeneric4.pp svneol=native#text/plain
 tests/test/tgeneric5.pp svneol=native#text/plain
 tests/test/tgeneric6.pp svneol=native#text/plain
@@ -9674,6 +9693,9 @@ tests/test/tparray7.pp svneol=native#text/plain
 tests/test/tparray8.pp svneol=native#text/plain
 tests/test/tparray9.pp svneol=native#text/plain
 tests/test/tpftch1.pp svneol=native#text/plain
+tests/test/tpointermath1.pp svneol=native#text/pascal
+tests/test/tpointermath2.pp svneol=native#text/pascal
+tests/test/tpointermath3.pp svneol=native#text/pascal
 tests/test/tpoll.pp svneol=native#text/plain
 tests/test/tprec1.pp svneol=native#text/plain
 tests/test/tprec10.pp svneol=native#text/plain
@@ -9997,6 +10019,7 @@ tests/test/uobjc30c.pp svneol=native#text/plain
 tests/test/uobjc35d.pp svneol=native#text/plain
 tests/test/uobjc35e.pp svneol=native#text/plain
 tests/test/uobjc35f.pp svneol=native#text/plain
+tests/test/uobjc35g.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
@@ -10362,6 +10385,7 @@ tests/webtbf/tw9225.pp svneol=native#text/plain
 tests/webtbf/tw9306c.pp svneol=native#text/plain
 tests/webtbf/tw9499.pp svneol=native#text/plain
 tests/webtbf/tw9499a.pp svneol=native#text/plain
+tests/webtbf/tw9509.pp svneol=native#text/plain
 tests/webtbf/tw9522.pp svneol=native#text/plain
 tests/webtbf/tw9522a.pp svneol=native#text/plain
 tests/webtbf/tw9522b.pp svneol=native#text/plain
@@ -11771,7 +11795,6 @@ tests/webtbs/tw9419.pp svneol=native#text/plain
 tests/webtbs/tw9450.pp svneol=native#text/plain
 tests/webtbs/tw9450a.pp svneol=native#text/plain
 tests/webtbs/tw9461.pp svneol=native#text/plain
-tests/webtbs/tw9509.pp svneol=native#text/plain
 tests/webtbs/tw9551a.pp svneol=native#text/plain
 tests/webtbs/tw9601.pp svneol=native#text/plain
 tests/webtbs/tw9667.pp svneol=native#text/plain
@@ -11995,6 +12018,8 @@ utils/fpdoc/fpde/xpms.pp svneol=native#text/plain
 utils/fpdoc/fpdoc.css -text
 utils/fpdoc/fpdoc.lpi svneol=native#text/plain
 utils/fpdoc/fpdoc.pp svneol=native#text/plain
+utils/fpdoc/fpdocproj.pas svneol=native#text/plain
+utils/fpdoc/fpdocxmlopts.pas svneol=native#text/plain
 utils/fpdoc/intl/Makefile svneol=native#text/plain
 utils/fpdoc/intl/dglobals.de.po svneol=native#text/plain
 utils/fpdoc/intl/dglobals.sk.po svneol=native#text/plain
@@ -12005,6 +12030,7 @@ utils/fpdoc/intl/fpdocstr.de.po svneol=native#text/plain
 utils/fpdoc/intl/makeskel.de.po svneol=native#text/plain
 utils/fpdoc/makeskel.lpi svneol=native#text/plain
 utils/fpdoc/makeskel.pp svneol=native#text/plain
+utils/fpdoc/sample-project.xml svneol=native#text/plain
 utils/fpdoc/sh_pas.pp svneol=native#text/plain
 utils/fpdoc/testunit.pp svneol=native#text/plain
 utils/fpdoc/testunit.xml svneol=native#text/plain
@@ -12124,6 +12150,7 @@ utils/ppdep.pp svneol=native#text/plain
 utils/ptop.pp svneol=native#text/plain
 utils/ptopu.pp svneol=native#text/plain
 utils/rmcvsdir.pp svneol=native#text/plain
+utils/rmwait/Makefile svneol=native#text/plain
 utils/rmwait/Makefile.fpc svneol=native#text/plain
 utils/rmwait/rmwait.pas svneol=native#text/plain
 utils/rstconv.pp svneol=native#text/plain

+ 9 - 9
.gitignore

@@ -658,15 +658,6 @@ packages/cocoaint/src/foundation/build-stamp.*
 packages/cocoaint/src/foundation/fpcmade.*
 packages/cocoaint/src/foundation/units
 packages/cocoaint/src/fpcmade.*
-packages/cocoaint/src/patches/*.bak
-packages/cocoaint/src/patches/*.exe
-packages/cocoaint/src/patches/*.o
-packages/cocoaint/src/patches/*.ppu
-packages/cocoaint/src/patches/*.s
-packages/cocoaint/src/patches/Package.fpc
-packages/cocoaint/src/patches/build-stamp.*
-packages/cocoaint/src/patches/fpcmade.*
-packages/cocoaint/src/patches/units
 packages/cocoaint/src/uikit/*.bak
 packages/cocoaint/src/uikit/*.exe
 packages/cocoaint/src/uikit/*.o
@@ -694,6 +685,15 @@ packages/cocoaint/utils/*.ppu
 packages/cocoaint/utils/*.s
 packages/cocoaint/utils/Package.fpc
 packages/cocoaint/utils/build-stamp.*
+packages/cocoaint/utils/cocoa-skel/patches/*.bak
+packages/cocoaint/utils/cocoa-skel/patches/*.exe
+packages/cocoaint/utils/cocoa-skel/patches/*.o
+packages/cocoaint/utils/cocoa-skel/patches/*.ppu
+packages/cocoaint/utils/cocoa-skel/patches/*.s
+packages/cocoaint/utils/cocoa-skel/patches/Package.fpc
+packages/cocoaint/utils/cocoa-skel/patches/build-stamp.*
+packages/cocoaint/utils/cocoa-skel/patches/fpcmade.*
+packages/cocoaint/utils/cocoa-skel/patches/units
 packages/cocoaint/utils/fpcmade.*
 packages/cocoaint/utils/units
 packages/dbus/*.bak

+ 1 - 1
compiler/cfileutl.pas

@@ -1238,7 +1238,7 @@ end;
        Path : TCmdStr;
        found : boolean;
      begin
-       found:=FindFile(FixFileName(ChangeFileExt(bin,source_info.exeext)),'.;'+exepath,allowcache,foundfile);
+       found:=FindFile(FixFileName(ChangeFileExt(bin,source_info.exeext)),exepath,allowcache,foundfile);
        if not found then
         begin
 {$ifdef macos}

+ 30 - 21
compiler/dbgdwarf.pas

@@ -941,7 +941,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_or_objc(def) then
+                        if is_implicit_pointer_object_type(def) then
                           current_asmdata.getdatalabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
                       end;
                   end;
@@ -953,7 +953,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_or_objc(def) then
+                if is_implicit_pointer_object_type(def) then
                   current_asmdata.getaddrlabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
               end;
             if def.dbg_state=dbg_state_used then
@@ -2310,6 +2310,20 @@ implementation
                         templist.concat(tai_const.create_8bit(ord(DW_OP_breg0)+dreg));
                         templist.concat(tai_const.create_sleb128bit(sym.localloc.reference.offset+offset));
                         blocksize:=1+Lengthsleb128(sym.localloc.reference.offset);
+{$ifndef gdb_supports_DW_AT_variable_parameter}
+                        { Parameters which are passed by reference. (var and the like)
+                          Hide the reference-pointer and dereference the pointer
+                          in the DW_AT_location block.
+                        }
+                        if (sym.typ=paravarsym) and
+                            paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and
+                            not(vo_has_local_copy in sym.varoptions) and
+                            not is_open_string(sym.vardef) then
+                          begin
+                            templist.concat(tai_const.create_8bit(ord(DW_OP_deref)));
+                            inc(blocksize);
+                          end
+{$endif not gdb_supports_DW_AT_variable_parameter}
                       end;
                   end
                 else
@@ -2396,15 +2410,7 @@ implementation
           that).  }
         if (vo_is_self in sym.varoptions) then
           append_attribute(DW_AT_artificial,DW_FORM_flag,[true]);
-{$ifndef gdb_supports_DW_AT_variable_parameter}
-        if (sym.typ=paravarsym) and
-            paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and
-            not(vo_has_local_copy in sym.varoptions) and
-            not is_open_string(sym.vardef) then
-          append_labelentry_ref(DW_AT_type,def_dwarf_ref_lab(def))
-        else
-{$endif not gdb_supports_DW_AT_variable_parameter}
-          append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
+        append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
 
         templist.free;
 
@@ -3419,7 +3425,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_or_objc(def) then
+              if is_implicit_pointer_object_type(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));
@@ -3801,13 +3807,20 @@ implementation
         begin
           if assigned(def.objname) then
             append_entry(tag,true,[
-              DW_AT_name,DW_FORM_string,def.objrealname^+#0,
-              DW_AT_byte_size,DW_FORM_udata,def.size
+              DW_AT_name,DW_FORM_string,def.objrealname^+#0
               ])
           else
-            append_entry(DW_TAG_structure_type,true,[
-              DW_AT_byte_size,DW_FORM_udata,def.size
-              ]);
+            append_entry(DW_TAG_structure_type,true,[]);
+          append_attribute(DW_AT_byte_size,DW_FORM_udata,[tobjectsymtable(def.symtable).datasize]);
+          // The pointer to the class-structure is hidden. The debug-information
+          // does not contain an implicit pointer, but the data-adress is dereferenced here.
+          // In case of a nil-pointer, report the class as being unallocated.
+          append_block1(DW_AT_allocated,2);
+          current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
+          current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
+          append_block1(DW_AT_data_location,2);
+          current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
+          current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
           finish_entry;
         end;
 
@@ -3869,10 +3882,6 @@ implementation
             end;
           odt_class:
             begin
-              { not sure if the implicit pointer is needed for tag_class (MWE)}
-              {
-              doimplicitpointer;
-              }
               dostruct(DW_TAG_class_type);
               doparent(false);
             end;

+ 5 - 5
compiler/defcmp.pas

@@ -282,7 +282,7 @@ implementation
                  objectdef:
                    begin
                      if (m_delphi in current_settings.modeswitches) and
-                        is_class_or_interface_or_dispinterface_or_objc(def_from) and
+                        is_implicit_pointer_object_type(def_from) and
                         (cdo_explicit in cdoptions) then
                       begin
                         eq:=te_convert_l1;
@@ -1131,11 +1131,11 @@ implementation
                  classrefdef,
                  objectdef :
                    begin
-                     { class types and class reference type
+                     { implicit pointer object and class reference types
                        can be assigned to void pointers, but it is less
                        preferred than assigning to a related objectdef }
                      if (
-                         is_class_or_interface_or_dispinterface_or_objc(def_from) or
+                         is_implicit_pointer_object_type(def_from) or
                          (def_from.typ=classrefdef)
                         ) and
                         (tpointerdef(def_to).pointeddef.typ=orddef) and
@@ -1268,8 +1268,8 @@ implementation
                   eq:=te_convert_l1;
                 end
                else
-               { Class/interface specific }
-                if is_class_or_interface_or_dispinterface_or_objc(def_to) then
+               { specific to implicit pointer object types }
+                if is_implicit_pointer_object_type(def_to) then
                  begin
                    { void pointer also for delphi mode }
                    if (m_delphi in current_settings.modeswitches) and

+ 1 - 1
compiler/defutil.pas

@@ -1003,7 +1003,7 @@ implementation
             end;
           objectdef :
             begin
-              if is_class_or_interface_or_dispinterface_or_objc(def) then
+              if is_implicit_pointer_object_type(def) then
                 result := OS_ADDR
               else
                 result:=int_cgsize(def.size);

+ 2 - 2
compiler/fmodule.pas

@@ -577,7 +577,7 @@ implementation
             if current_procinfo=tprocinfo(procinfo) then
               begin
                 current_procinfo:=nil;
-                current_objectdef:=nil;
+                current_structdef:=nil;
                 current_genericdef:=nil;
                 current_specializedef:=nil;
               end;
@@ -659,7 +659,7 @@ implementation
             if current_procinfo=tprocinfo(procinfo) then
               begin
                 current_procinfo:=nil;
-                current_objectdef:=nil;
+                current_structdef:=nil;
                 current_genericdef:=nil;
                 current_specializedef:=nil;
               end;

+ 5 - 5
compiler/globals.pas

@@ -51,15 +51,15 @@ interface
        delphimodeswitches =
          [m_delphi,m_all,m_class,m_objpas,m_result,m_string_pchar,
           m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
-          m_out,m_default_para,m_duplicate_names,m_hintdirective,m_add_pointer,
-          m_property,m_default_inline,m_except,m_extended_records];
+          m_out,m_default_para,m_duplicate_names,m_hintdirective,
+          m_property,m_default_inline,m_except,m_advanced_records];
        fpcmodeswitches =
          [m_fpc,m_all,m_string_pchar,m_nested_comment,m_repeat_forward,
-          m_cvar_support,m_initfinal,m_add_pointer,m_hintdirective,
+          m_cvar_support,m_initfinal,m_hintdirective,
           m_property,m_default_inline];
        objfpcmodeswitches =
          [m_objfpc,m_fpc,m_all,m_class,m_objpas,m_result,m_string_pchar,m_nested_comment,
-          m_repeat_forward,m_cvar_support,m_initfinal,m_add_pointer,m_out,m_default_para,m_hintdirective,
+          m_repeat_forward,m_cvar_support,m_initfinal,m_out,m_default_para,m_hintdirective,
           m_property,m_default_inline,m_except];
        tpmodeswitches =
          [m_tp7,m_all,m_tp_procvar,m_duplicate_names];
@@ -350,7 +350,7 @@ interface
         );
         globalswitches : [cs_check_unit_name,cs_link_static];
         moduleswitches : [cs_extsyntax,cs_implicit_exceptions];
-        localswitches : [cs_check_io,cs_typed_const_writable];
+        localswitches : [cs_check_io,cs_typed_const_writable,cs_pointermath];
         modeswitches : fpcmodeswitches;
         optimizerswitches : [];
         genwpoptimizerswitches : [];

+ 3 - 5
compiler/globtype.pas

@@ -110,7 +110,7 @@ interface
          cs_mmx,cs_mmx_saturation,
          { parser }
          cs_typed_addresses,cs_strict_var_strings,cs_ansistrings,cs_bitpacking,
-         cs_varpropsetter,cs_scopedenums,
+         cs_varpropsetter,cs_scopedenums,cs_pointermath,
          { macpas specific}
          cs_external_var, cs_externally_visible
        );
@@ -261,7 +261,6 @@ interface
                                   procedure variables                     }
          m_autoderef,           { does auto dereferencing of struct. vars }
          m_initfinal,           { initialization/finalization for units }
-         m_add_pointer,         { allow pointer add/sub operations }
          m_default_ansistring,  { ansistring turned on by default }
          m_out,                 { support the calling convention OUT }
          m_default_para,        { support default parameters }
@@ -274,7 +273,7 @@ interface
          m_objectivec2,         { support interfacing with Objective-C (2.0) }
          m_nested_procvars,     { support nested procedural variables }
          m_non_local_goto,      { support non local gotos (like iso pascal) }
-         m_extended_records     { extended record syntax with visibility sections, methods and properties }
+         m_advanced_records     { advanced record syntax with visibility sections, methods and properties }
        );
        tmodeswitches = set of tmodeswitch;
 
@@ -382,7 +381,6 @@ interface
          'POINTERTOPROCVAR',
          'AUTODEREF',
          'INITFINAL',
-         'POINTERARITHMETICS',
          'ANSISTRINGS',
          'OUT',
          'DEFAULTPARAMETERS',
@@ -395,7 +393,7 @@ interface
          'OBJECTIVEC2',
          'NESTEDPROCVARS',
          'NONLOCALGOTO',
-         'EXTENDEDRECORDS');
+         'ADVANCEDRECORDS');
 
 
      type

+ 13 - 10
compiler/htypechk.pas

@@ -229,7 +229,7 @@ implementation
             pointerdef :
               begin
                 if ((rd.typ in [orddef,enumdef,pointerdef,classrefdef,procvardef]) or
-                    is_class_or_interface_or_dispinterface_or_objc(rd)) then
+                    is_implicit_pointer_object_type(rd)) then
                  begin
                    allowed:=false;
                    exit;
@@ -289,9 +289,9 @@ implementation
               end;
             objectdef :
               begin
-                { <> and = are defined for classes }
+                { <> and = are defined for implicit pointer object types }
                 if (treetyp in [equaln,unequaln]) and
-                   is_class_or_interface_or_dispinterface_or_objc(ld) then
+                   is_implicit_pointer_object_type(ld) then
                  begin
                    allowed:=false;
                    exit;
@@ -341,7 +341,9 @@ implementation
         result:=false;
         case treetyp of
           subn,
+          addn,
           unaryminusn,
+          unaryplusn,
           inlinen:
             begin
               { only Inc, Dec inline functions are supported for now, so skip check inlinenumber }
@@ -506,6 +508,8 @@ implementation
              optoken:=_OP_NOT;
            unaryminusn:
              optoken:=_MINUS;
+           unaryplusn:
+             optoken:=_PLUS;
            inlinen:
              case inlinenumber of
                 in_inc_x:
@@ -940,7 +944,7 @@ implementation
                end;
              subscriptn :
                begin
-                 if is_class_or_interface_or_dispinterface_or_objc(tunarynode(p).left.resultdef) then
+                 if is_implicit_pointer_object_type(tunarynode(p).left.resultdef) then
                    newstate := vs_read;
                  p:=tunarynode(p).left;
                end;
@@ -1094,7 +1098,7 @@ implementation
                  pointerdef :
                    gotpointer:=true;
                  objectdef :
-                   gotclass:=is_class_or_interface_or_dispinterface_or_objc(hp.resultdef);
+                   gotclass:=is_implicit_pointer_object_type(hp.resultdef);
                  recorddef :
                    gotrecord:=true;
                  classrefdef :
@@ -1211,7 +1215,7 @@ implementation
                    pointerdef :
                      gotpointer:=true;
                    objectdef :
-                     gotclass:=is_class_or_interface_or_dispinterface_or_objc(hp.resultdef);
+                     gotclass:=is_implicit_pointer_object_type(hp.resultdef);
                    classrefdef :
                      gotclass:=true;
                    arraydef :
@@ -1305,10 +1309,9 @@ implementation
                      else
                        exit;
                    end;
-                 { a class/interface access is an implicit }
-                 { dereferencing                           }
+                 { implicit pointer object types result in dereferencing }
                  hp:=tsubscriptnode(hp).left;
-                 if is_class_or_interface_or_dispinterface_or_objc(hp.resultdef) then
+                 if is_implicit_pointer_object_type(hp.resultdef) then
                    gotderef:=true;
                end;
              muln,
@@ -1397,7 +1400,7 @@ implementation
                    pointerdef :
                      gotpointer:=true;
                    objectdef :
-                     gotclass:=is_class_or_interface_or_dispinterface_or_objc(hp.resultdef);
+                     gotclass:=is_implicit_pointer_object_type(hp.resultdef);
                    recorddef, { handle record like class it needs a subscription }
                    classrefdef :
                      gotclass:=true;

+ 2 - 2
compiler/msg/errord.msg

@@ -1117,9 +1117,9 @@ parser_e_packed_element_no_loop=03223_E_Bit packed Array-Elemente und Record-Fel
 % (or as \var{packed} in any mode with \var{\{\$bitpacking on\}}), it will
 % be packed at the bit level. For performance reasons, they cannot be
 % used as loop variables.
-parser_e_type_var_const_only_in_generics_and_classes=03224_E_VAR, TYPE und CONST sind nur innerhalb "generics" und Klassen erlaubt
+parser_e_type_var_const_only_in_records_and_classes=03224_E_VAR, TYPE und CONST sind nur innerhalb records, objects und Klassen erlaubt
 % The usage of VAR, TYPE and CONST to declare new types inside an object is allowed only inside
-% generics and classes.
+% records, objects and classes.
 parser_e_cant_create_generics_of_this_type=03225_E_Dieser Typ kann nicht "generic" sein
 % Only Classes, Objects, Interfaces and Records are allowed to be used as generic.
 parser_w_no_lineinfo_use_switch=03226_W_Die LINEINFO Unit nicht manuell laden. Verwende statt dessen den Compilerschalter -gl

+ 2 - 2
compiler/msg/errordu.msg

@@ -1117,9 +1117,9 @@ parser_e_packed_element_no_loop=03223_E_Bit packed Array-Elemente und Record-Fel
 % (or as \var{packed} in any mode with \var{\{\$bitpacking on\}}), it will
 % be packed at the bit level. For performance reasons, they cannot be
 % used as loop variables.
-parser_e_type_var_const_only_in_generics_and_classes=03224_E_VAR, TYPE und CONST sind nur innerhalb "generics" und Klassen erlaubt
+parser_e_type_var_const_only_in_records_and_classes=03224_E_VAR, TYPE und CONST sind nur innerhalb records, objects und Klassen erlaubt
 % The usage of VAR, TYPE and CONST to declare new types inside an object is allowed only inside
-% generics and classes.
+% records, objects and classes.
 parser_e_cant_create_generics_of_this_type=03225_E_Dieser Typ kann nicht "generic" sein
 % Only Classes, Objects, Interfaces and Records are allowed to be used as generic.
 parser_w_no_lineinfo_use_switch=03226_W_Die LINEINFO Unit nicht manuell laden. Verwende statt dessen den Compilerschalter -gl

+ 18 - 3
compiler/msg/errore.msg

@@ -368,7 +368,7 @@ scanner_w_illegal_warn_identifier=02087_W_Illegal identifier "$1" for $WARN dire
 #
 # Parser
 #
-# 03302 is the last used one
+# 03304 is the last used one
 #
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
@@ -1106,9 +1106,9 @@ parser_e_packed_element_no_loop=03223_E_Bit packed array elements and record fie
 % (or as \var{packed} in any mode with \var{\{\$bitpacking on\}}), it will
 % be packed at the bit level. For performance reasons, they cannot be
 % used as loop variables.
-parser_e_type_var_const_only_in_generics_and_classes=03224_E_VAR, TYPE and CONST are allowed only in generics and classes
+parser_e_type_var_const_only_in_records_and_classes=03224_E_VAR, TYPE and CONST are allowed only in records, objects and classes
 % The usage of VAR, TYPE and CONST to declare new types inside an object is allowed only inside
-% generics and classes.
+% records, objects and classes.
 parser_e_cant_create_generics_of_this_type=03225_E_This type can't be a generic
 % Only Classes, Objects, Interfaces and Records are allowed to be used as generic.
 parser_w_no_lineinfo_use_switch=03226_W_Don't load LINEINFO unit manually, Use the -gl compiler switch instead
@@ -1360,6 +1360,12 @@ parser_e_class_methods_only_static_in_records=03301_E_Class methods must be stat
 parser_e_no_constructor_in_records=03302_E_Constructors aren't allowed in records
 % Constructor declarations aren't allowed in records.
 % \end{description}
+parser_e_at_least_one_argument_must_be_of_type=03303_E_At least one argument must be of type "$1"
+% It is required that at least one argument be of type of structure where this method is defined.
+% For example class operators must contain at least one argument of the structure where they are defined.
+parser_e_cant_use_type_parameters_here=03304_E_Type parameters may require initialization/finalization - can't be used in variant records
+% Type parameters may be specialized with types which (e.g. \var{ansistring}) need initialization/finalization
+% code which is implicitly generated by the compiler. 
 #
 # Type Checking
 #
@@ -1707,6 +1713,10 @@ type_w_procvar_univ_conflicting_para=04095_W_Coerced univ parameter type in proc
 % when \var{test} returns.
 type_e_generics_cannot_reference_itself=04096_E_Type parameters of specializations of generics cannot reference the currently specialized type
 % Recursive specializations of generics like \var{Type MyType = specialize MyGeneric<MyType>;} are not possible.
+type_e_type_parameters_are_not_allowed_here=04097_E_Type parameters are not allowed on non-generic class/record/object procedure or function
+% Type parameters are only allowed for methods of generic classes, records or objects
+type_e_generic_declaration_does_not_match=04098_E_Generic declaration of "$1" differs from previous declaration
+% Generic declaration does not match the previous declaration
 %
 % \end{description}
 #
@@ -1951,6 +1961,11 @@ sym_e_objc_formal_class_not_resolved=05080_E_No complete definition of the forma
 % of the class to be in scope.
 sym_e_interprocgoto_into_init_final_code_not_allowed=05081_E_Gotos into initialization or finalization blocks of units are not allowed
 % Gotos into initialization or finalization blockse of units are not allowed.
+sym_e_external_class_name_mismatch1=05082=E_Invalid external name "$1" for formal class "$2"
+sym_e_external_class_name_mismatch2=05083=E_Complete class definition with external name "$1" here
+% When a class is declared using a formal external definition, the actual external
+% definition (if any) must specify the same external name as the formal definition
+% (since both definitions refer to the same actual class type).
 %
 % \end{description}
 #

+ 9 - 3
compiler/msgidx.inc

@@ -313,7 +313,7 @@ const
   parser_e_packed_element_no_var_addr=03221;
   parser_e_packed_dynamic_open_array=03222;
   parser_e_packed_element_no_loop=03223;
-  parser_e_type_var_const_only_in_generics_and_classes=03224;
+  parser_e_type_var_const_only_in_records_and_classes=03224;
   parser_e_cant_create_generics_of_this_type=03225;
   parser_w_no_lineinfo_use_switch=03226;
   parser_e_no_funcret_specified=03227;
@@ -391,6 +391,8 @@ const
   parser_e_no_destructor_in_records=03300;
   parser_e_class_methods_only_static_in_records=03301;
   parser_e_no_constructor_in_records=03302;
+  parser_e_at_least_one_argument_must_be_of_type=03303;
+  parser_e_cant_use_type_parameters_here=03304;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -478,6 +480,8 @@ const
   type_e_objcclass_type_expected=04094;
   type_w_procvar_univ_conflicting_para=04095;
   type_e_generics_cannot_reference_itself=04096;
+  type_e_type_parameters_are_not_allowed_here=04097;
+  type_e_generic_declaration_does_not_match=04098;
   sym_e_id_not_found=05000;
   sym_f_internal_error_in_symtablestack=05001;
   sym_e_duplicate_id=05002;
@@ -546,6 +550,8 @@ const
   sym_w_experimental_unit=05079;
   sym_e_objc_formal_class_not_resolved=05080;
   sym_e_interprocgoto_into_init_final_code_not_allowed=05081;
+  sym_e_external_class_name_mismatch1=05082;
+  sym_e_external_class_name_mismatch2=05083;
   cg_e_parasize_too_big=06009;
   cg_e_file_must_call_by_reference=06012;
   cg_e_cant_use_far_pointer_there=06013;
@@ -876,9 +882,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 58219;
+  MsgTxtSize = 58664;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,88,303,97,82,54,111,22,202,63,
+    24,88,305,99,84,54,111,22,202,63,
     49,20,1,1,1,1,1,1,1,1
   );

Разница между файлами не показана из-за своего большого размера
+ 318 - 308
compiler/msgtxt.inc


+ 14 - 10
compiler/nadd.pas

@@ -1598,19 +1598,19 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
 
-         { class or interface equation }
-         else if is_class_or_interface_or_dispinterface_or_objc(rd) or is_class_or_interface_or_dispinterface_or_objc(ld) then
+         { implicit pointer object type comparison }
+         else if is_implicit_pointer_object_type(rd) or is_implicit_pointer_object_type(ld) then
           begin
             if (nodetype in [equaln,unequaln]) then
               begin
-                if is_class_or_interface_or_dispinterface_or_objc(rd) and is_class_or_interface_or_dispinterface_or_objc(ld) then
+                if is_implicit_pointer_object_type(rd) and is_implicit_pointer_object_type(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_or_dispinterface_or_objc(rd) then
+                else if is_implicit_pointer_object_type(rd) then
                   inserttypeconv(left,right.resultdef)
                 else
                   inserttypeconv(right,left.resultdef);
@@ -1633,8 +1633,8 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
 
-         { allows comperasion with nil pointer }
-         else if is_class_or_interface_or_dispinterface_or_objc(rd) or (rd.typ=classrefdef) then
+         { allow comparison with nil pointer }
+         else if is_implicit_pointer_object_type(rd) or (rd.typ=classrefdef) then
           begin
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(left,right.resultdef)
@@ -1642,7 +1642,7 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
 
-         else if is_class_or_interface_or_dispinterface_or_objc(ld) or (ld.typ=classrefdef) then
+         else if is_implicit_pointer_object_type(ld) or (ld.typ=classrefdef) then
           begin
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(right,left.resultdef)
@@ -1737,7 +1737,9 @@ implementation
             if nodetype=addn then
               begin
                 if not(cs_extsyntax in current_settings.moduleswitches) or
-                   (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
+                   (not (is_pchar(ld) or is_chararray(ld) or is_open_chararray(ld) or is_widechar(ld) or is_widechararray(ld) or is_open_widechararray(ld)) and
+                    not(cs_pointermath in current_settings.localswitches) and
+                    not((ld.typ=pointerdef) and tpointerdef(ld).has_pointer_math)) then
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                 if (rd.typ=pointerdef) and
                    (tpointerdef(rd).pointeddef.size>1) then
@@ -1768,7 +1770,9 @@ implementation
                  if (lt=niln) then
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),'NIL',rd.typename);
                  if not(cs_extsyntax in current_settings.moduleswitches) or
-                    (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
+                   (not (is_pchar(ld) or is_chararray(ld) or is_open_chararray(ld) or is_widechar(ld) or is_widechararray(ld) or is_open_widechararray(ld)) and
+                    not(cs_pointermath in current_settings.localswitches) and
+                    not((ld.typ=pointerdef) and tpointerdef(ld).has_pointer_math)) then
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                  if (ld.typ=pointerdef) then
                  begin
@@ -2710,7 +2714,7 @@ implementation
                 expectloc:=LOC_FLAGS;
            end
 
-         else if is_class_or_interface_or_dispinterface_or_objc(ld) then
+         else if is_implicit_pointer_object_type(ld) then
             begin
               expectloc:=LOC_FLAGS;
             end

+ 3 - 4
compiler/ncal.pas

@@ -1671,8 +1671,7 @@ implementation
             begin
               if (procdefinition.typ<>procdef) then
                 internalerror(200305062);
-              if (tprocdef(procdefinition).struct.typ=objectdef) and
-                 (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) then
+              if (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) then
                 begin
                   { we only need the vmt, loading self is not required and there is no
                     need to check for typen, because that will always get the
@@ -2876,8 +2875,8 @@ implementation
                  assigned(methodpointer) and
                  (nf_is_self in methodpointer.flags) then
                 resultdef:=voidtype
-            else
-              resultdef:=procdefinition.returndef;
+              else
+                resultdef:=procdefinition.returndef;
            end
          else
            resultdef:=typedef;

+ 8 - 14
compiler/ncgadd.pas

@@ -269,7 +269,6 @@ interface
 
     procedure tcgaddnode.second_addsmallset;
       var
-        tmpreg : tregister;
         cgop    : TOpCg;
         opdone  : boolean;
       begin
@@ -301,21 +300,16 @@ interface
                  end;
               if opdone then
                 begin
+                  if (right.location.size<>left.location.size) or
+                     (location.size<>left.location.size) then
+                    internalerror(2010123001);
+                  { make sure we don't modify left/right.location, because we told
+                    force_reg_left_right above that they can be constant }
+                  cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,location.size,right.location.register,location.register);
                   if left.location.loc = LOC_CONSTANT then
-                    begin
-                      tmpreg := cg.getintregister(current_asmdata.CurrAsmList,location.size);
-                      cg.a_load_const_reg(current_asmdata.CurrAsmList,location.size,
-                        left.location.value,tmpreg);
-                      cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,location.size,right.location.register,right.location.register);
-                      cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_AND,location.size,right.location.register,tmpreg);
-                      cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_INT,location.size,tmpreg,location.register);
-                    end
+                    cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_AND,location.size,left.location.value,location.register)
                   else
-                    begin
-                      cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,right.location.size,right.location.register,right.location.register);
-                      cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_AND,left.location.size,right.location.register,left.location.register);
-                      cg.a_load_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register);
-                    end;
+                    cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_AND,location.size,left.location.register,location.register);
                 end;
             end;
           else

+ 2 - 2
compiler/ncgmem.pas

@@ -291,8 +291,8 @@ implementation
          if codegenerror then
            exit;
          paraloc1.init;
-         { classes and interfaces must be dereferenced implicitly }
-         if is_class_or_interface_or_dispinterface_or_objc(left.resultdef) then
+         { several object types must be dereferenced implicitly }
+         if is_implicit_pointer_object_type(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));

+ 1 - 0
compiler/ncgrtti.pas

@@ -693,6 +693,7 @@ implementation
                  potype_destructor: methodkind:=mkDestructor;
                  potype_class_constructor: methodkind:=mkClassConstructor;
                  potype_class_destructor: methodkind:=mkClassDestructor;
+                 potype_operator: methodkind:=mkOperatorOverload;
                  potype_procedure: 
                    if po_classmethod in def.procoptions then 
                      methodkind:=mkClassProcedure

+ 76 - 0
compiler/nmat.pas

@@ -67,6 +67,13 @@ interface
        end;
        tunaryminusnodeclass = class of tunaryminusnode;
 
+       tunaryplusnode = class(tunarynode)
+         constructor create(expr : tnode);virtual;
+         function pass_1 : tnode;override;
+         function pass_typecheck:tnode;override;
+       end;
+       tunaryplusnodeclass = class of tunaryplusnode;
+
        tnotnode = class(tunarynode)
           constructor create(expr : tnode);virtual;
           function pass_1 : tnode;override;
@@ -82,6 +89,7 @@ interface
        cmoddivnode : tmoddivnodeclass = tmoddivnode;
        cshlshrnode : tshlshrnodeclass = tshlshrnode;
        cunaryminusnode : tunaryminusnodeclass = tunaryminusnode;
+       cunaryplusnode : tunaryplusnodeclass = tunaryplusnode;
        cnotnode : tnotnodeclass = tnotnode;
 
 implementation
@@ -730,6 +738,74 @@ implementation
           end;
       end;
 
+{****************************************************************************
+                             TUNARYPLUSNODE
+ ****************************************************************************}
+
+    constructor tunaryplusnode.create(expr: tnode);
+      begin
+        inherited create(unaryplusn,expr);
+      end;
+
+    function tunaryplusnode.pass_1: tnode;
+      begin
+        result:=nil;
+        { can never happen because all the conversions happen
+          in pass_typecheck }
+        internalerror(201012250);
+      end;
+
+    function tunaryplusnode.pass_typecheck: tnode;
+      var
+        t:tnode;
+      begin
+        result:=nil;
+        typecheckpass(left);
+        set_varstate(left,vs_read,[vsf_must_be_valid]);
+        if codegenerror then
+          exit;
+
+        if is_constintnode(left) or
+           is_constrealnode(left) or
+           (left.resultdef.typ=floatdef) or
+           is_currency(left.resultdef)
+{$ifdef SUPPORT_MMX}
+           or ((cs_mmx in current_settings.localswitches) and
+                is_mmx_able_array(left.resultdef))
+{$endif SUPPORT_MMX}
+        then
+          begin
+            result:=left;
+            left:=nil;
+          end
+{$ifndef cpu64bitaddr}
+        else if is_64bit(left.resultdef) then
+          begin
+            inserttypeconv(left,s64inttype);
+            result:=left;
+            left:=nil;
+          end
+{$endif not cpu64bitaddr}
+        else if (left.resultdef.typ=orddef) then
+          begin
+            inserttypeconv(left,sinttype);
+            result:=left;
+            left:=nil;
+          end
+        else
+          begin
+            { allow operator overloading }
+            t:=self;
+            if isunaryoverloaded(t) then
+              begin
+                result:=t;
+                exit;
+             end;
+
+             CGMessage(type_e_mismatch);
+           end;
+      end;
+
 
 {****************************************************************************
                                TNOTNODE

+ 8 - 7
compiler/nmem.pas

@@ -166,12 +166,12 @@ implementation
             if (df_generic in left.resultdef.defoptions) then
               begin
                 defaultresultdef:=true;
-                if assigned(current_objectdef) then
+                if assigned(current_structdef) then
                   begin
-                    if assigned(current_objectdef.genericdef) then
-                      if current_objectdef.genericdef=left.resultdef then
+                    if assigned(current_structdef.genericdef) then
+                      if current_structdef.genericdef=left.resultdef then
                         begin
-                          resultdef:=tclassrefdef.create(current_objectdef);
+                          resultdef:=tclassrefdef.create(current_structdef);
                           defaultresultdef:=false;
                         end
                       else
@@ -687,8 +687,8 @@ implementation
          if codegenerror then
           exit;
 
-         { classes must be dereferenced implicitly }
-         if is_class_or_interface_or_dispinterface_or_objc(left.resultdef) then
+         { several object types must be dereferenced implicitly }
+         if is_implicit_pointer_object_type(left.resultdef) then
            expectloc:=LOC_REFERENCE
          else
            begin
@@ -863,7 +863,8 @@ implementation
                  (except voidpointer) in delphi/tp7 it's only allowed for pchars. }
                if not is_voidpointer(left.resultdef) and
                   (
-                   (m_fpc in current_settings.modeswitches) or
+                   (cs_pointermath in current_settings.localswitches) or
+                   tpointerdef(left.resultdef).has_pointer_math or
                    is_pchar(left.resultdef) or
                    is_pwidechar(left.resultdef)
                   ) then

+ 4 - 4
compiler/nobj.pas

@@ -731,11 +731,11 @@ implementation
       var
         i : longint;
         def : tdef;
-        old_current_objectdef : tobjectdef;
+        old_current_structdef : tabstractrecorddef;
         overridesclasshelper : boolean;
       begin
-        old_current_objectdef:=current_objectdef;
-        current_objectdef:=_class;
+        old_current_structdef:=current_structdef;
+        current_structdef:=_class;
 
         _class.resetvmtentries;
 
@@ -770,7 +770,7 @@ implementation
             intf_allocate_vtbls;
           end;
 
-        current_objectdef:=old_current_objectdef;
+        current_structdef:=old_current_structdef;
       end;
 
 

+ 2 - 0
compiler/node.pas

@@ -67,6 +67,7 @@ interface
           callparan,        {Represents a parameter}
           realconstn,       {Represents a real value}
           unaryminusn,      {Represents a sign change (i.e. -2)}
+          unaryplusn,       {Represents a check for +Value}
           asmn,             {Represents an assembler node }
           vecn,             {Represents array indexing}
           pointerconstn,    {Represents a pointer constant}
@@ -151,6 +152,7 @@ interface
           'callparan',
           'realconstn',
           'unaryminusn',
+          'unaryplusn',
           'asmn',
           'vecn',
           'pointerconstn',

+ 3 - 3
compiler/nutils.pas

@@ -536,7 +536,7 @@ implementation
         { call fail helper and exit normal }
         if is_class(current_structdef) then
           begin
-            srsym:=search_struct_member(current_objectdef,'FREEINSTANCE');
+            srsym:=search_struct_member(current_structdef,'FREEINSTANCE');
             if assigned(srsym) and
                (srsym.typ=procsym) then
               begin
@@ -562,7 +562,7 @@ implementation
               { parameter 2 : pointer to vmt }
               { parameter 1 : self pointer }
               para:=ccallparanode.create(
-                        cordconstnode.create(current_objectdef.vmt_offset,s32inttype,false),
+                        cordconstnode.create(tobjectdef(current_structdef).vmt_offset,s32inttype,false),
                     ccallparanode.create(
                         ctypeconvnode.create_internal(
                             load_vmt_pointer_node,
@@ -725,7 +725,7 @@ implementation
                 end;
               subscriptn:
                 begin
-                  if is_class_or_interface_or_dispinterface_or_objc(tunarynode(p).left.resultdef) then
+                  if is_implicit_pointer_object_type(tunarynode(p).left.resultdef) then
                     inc(result,2);
                   if (result = NODE_COMPLEXITY_INF) then
                     exit;

+ 1 - 0
compiler/options.pas

@@ -2413,6 +2413,7 @@ begin
   def_system_macro('FPC_OBJFPC_EXTENDED_IF');
   def_system_macro('FPC_HAS_OPERATOR_ENUMERATOR');
   def_system_macro('FPC_HAS_CONSTREF');
+  def_system_macro('FPC_STATICRIPFIXED');
 {$if defined(x86) or defined(powerpc) or defined(powerpc64)}
   def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
 {$endif}

+ 3 - 7
compiler/parser.pas

@@ -55,16 +55,12 @@ implementation
 
     procedure initparser;
       begin
-         { we didn't parse a object or class declaration }
-         { and no function header                        }
-         testcurobject:=0;
-
          { Current compiled module/proc }
          set_current_module(nil);
          current_module:=nil;
          current_asmdata:=nil;
          current_procinfo:=nil;
-         current_objectdef:=nil;
+         current_structdef:=nil;
          current_genericdef:=nil;
          current_specializedef:=nil;
 
@@ -138,7 +134,7 @@ implementation
          current_module:=nil;
          current_procinfo:=nil;
          current_asmdata:=nil;
-         current_objectdef:=nil;
+         current_structdef:=nil;
          current_genericdef:=nil;
          current_specializedef:=nil;
 
@@ -297,7 +293,7 @@ implementation
          { parsing a procedure or declaration should be finished }
          if assigned(current_procinfo) then
            internalerror(200811121);
-         if assigned(current_objectdef) then
+         if assigned(current_structdef) then
            internalerror(200811122);
          inc(compile_level);
          parser_current_file:=filename;

+ 1 - 0
compiler/pass_2.pas

@@ -105,6 +105,7 @@ implementation
              'noth-callpar',{callparan}
              'realconst',   {realconstn}
              'unaryminus',  {unaryminusn}
+             'unaryplus',   {unaryplusn}
              'asm',         {asmn}
              'vecn',        {vecn}
              'pointerconst',{pointerconstn}

+ 70 - 107
compiler/pdecl.pas

@@ -26,10 +26,12 @@ unit pdecl;
 interface
 
     uses
+      { common }
+      cclasses,
       { global }
       globtype,
       { symtable }
-      symsym,
+      symsym,symdef,
       { pass_1 }
       node;
 
@@ -45,19 +47,23 @@ interface
     procedure property_dec(is_classpropery: boolean);
     procedure resourcestring_dec;
 
+    { generics support }
+    function parse_generic_parameters:TFPObjectList;
+    procedure insert_generic_parameter_types(def:tstoreddef;genericdef:tstoreddef;genericlist:TFPObjectList);
+
 implementation
 
     uses
        SysUtils,
        { common }
-       cutils,cclasses,
+       cutils,
        { global }
        globals,tokens,verbose,widestr,constexp,
        systems,
        { aasm }
        aasmbase,aasmtai,aasmdata,fmodule,
        { symtable }
-       symconst,symbase,symtype,symdef,symtable,paramgr,defutil,
+       symconst,symbase,symtype,symtable,paramgr,defutil,
        { pass 1 }
        nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,nobj,
        { codegen }
@@ -330,105 +336,61 @@ implementation
          consume(_SEMICOLON);
       end;
 
-
-    procedure types_dec(in_structure: boolean);
-
-      procedure get_cpp_class_external_status(od: tobjectdef);
-        var
-          hs: string;
-
-        begin
-          { C++ classes can be external -> all methods 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);
-              { copied from pdecsub.pd_external }
-              if not(token=_SEMICOLON) and not(idtoken=_NAME) then
-                begin
-                  { Always add library prefix and suffix to create an uniform name }
-                  hs:=get_stringconst;
-                  if ExtractFileExt(hs)='' then
-                    hs:=ChangeFileExt(hs,target_info.sharedlibext);
-                  if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
-                    hs:=target_info.sharedlibprefix+hs;
-                  od.import_lib:=stringdup(hs);
-                end;
-              include(od.objectoptions, oo_is_external);
-              { check if we shall use another name for the class }
-              if (token=_ID) and
-                 (idtoken=_NAME) then
-                begin
-                  consume(_NAME);
-                  od.objextname:=stringdup(get_stringconst);
-                end
-              else
-                od.objextname:=stringdup(od.objrealname^);
-              consume(_SEMICOLON);
-              { now all methods need to be external }
-              od.make_all_methods_external;
-              include(od.objectoptions,oo_is_external);
-            end
+    function parse_generic_parameters:TFPObjectList;
+    var
+      generictype : ttypesym;
+    begin
+      result:=TFPObjectList.Create(false);
+      repeat
+        if token=_ID then
+          begin
+            generictype:=ttypesym.create(orgpattern,cundefinedtype);
+            include(generictype.symoptions,sp_generic_para);
+            result.add(generictype);
+          end;
+        consume(_ID);
+      until not try_to_consume(_COMMA) ;
+    end;
+
+    procedure insert_generic_parameter_types(def:tstoreddef;genericdef:tstoreddef;genericlist:TFPObjectList);
+      var
+        i: longint;
+        generictype: ttypesym;
+        st: tsymtable;
+      begin
+        def.genericdef:=genericdef;
+        if not assigned(genericlist) then
+          exit;
+
+        case def.typ of
+          recorddef,objectdef: st:=tabstractrecorddef(def).symtable;
+          arraydef: st:=tarraydef(def).symtable;
+          procvardef,procdef: st:=tabstractprocdef(def).parast;
           else
-            od.objextname:=stringdup(od.objrealname^);
-          { ToDo: read the namespace of the class (influences the mangled name)}
+            internalerror(201101020);
         end;
 
-      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) and
-                 not(oo_is_forward in od.objectoptions) then
-                begin
-                  consume(_NAME);
-                  od.objextname:=stringdup(get_stringconst);
-                end
-              else
-                { the external name doesn't matter for formally declared
-                  classes, and allowing to specify one would mean that we would
-                  have to check it for consistency with the actual definition
-                  later on }
-                od.objextname:=stringdup(od.objrealname^);
-              consume(_SEMICOLON);
-              od.make_all_methods_external;
-              include(od.objectoptions,oo_is_external);
-              if (oo_is_forward in od.objectoptions) then
-                begin
-                  { formal definition: x = objcclass; external; }
-                  exclude(od.objectoptions,oo_is_forward);
-                  include(od.objectoptions,oo_is_formal);
-                end;
-            end
-          else { or also allow "public name 'x'"? }
-            od.objextname:=stringdup(od.objrealname^);
-        end;
+        for i:=0 to genericlist.count-1 do
+          begin
+            generictype:=ttypesym(genericlist[i]);
+            if generictype.typedef.typ=undefineddef then
+              include(def.defoptions,df_generic)
+            else
+              include(def.defoptions,df_specialization);
+            st.insert(generictype);
+          end;
+       end;
 
+    procedure types_dec(in_structure: boolean);
 
-        function parse_generic_parameters:TFPObjectList;
-        var
-          generictype : ttypesym;
+      procedure finalize_objc_class_or_protocol_external_status(od: tobjectdef);
         begin
-          result:=TFPObjectList.Create(false);
-          repeat
-            if token=_ID then
-              begin
-                generictype:=ttypesym.create(orgpattern,cundefinedtype);
-                include(generictype.symoptions,sp_generic_para);
-                result.add(generictype);
-              end;
-            consume(_ID);
-          until not try_to_consume(_COMMA) ;
+          if  [oo_is_external,oo_is_forward] <= od.objectoptions then
+            begin
+              { formal definition: x = objcclass external; }
+              exclude(od.objectoptions,oo_is_forward);
+              include(od.objectoptions,oo_is_formal);
+            end;
         end;
 
       var
@@ -460,13 +422,17 @@ implementation
            generictypelist:=nil;
            generictokenbuf:=nil;
 
-           { generic declaration? }
-           isgeneric:=try_to_consume(_GENERIC);
+           { fpc generic declaration? }
+           isgeneric:=not(m_delphi in current_settings.modeswitches) and try_to_consume(_GENERIC);
 
            typename:=pattern;
            orgtypename:=orgpattern;
            consume(_ID);
 
+           { delphi generic declaration? }
+           if (m_delphi in current_settings.modeswitches) then
+             isgeneric:=token=_LSHARPBRACKET;
+
            { Generic type declaration? }
            if isgeneric then
              begin
@@ -511,7 +477,7 @@ implementation
                      (token=_OBJCPROTOCOL) or
                      (token=_OBJCCATEGORY)) and
                     (assigned(ttypesym(sym).typedef)) and
-                    is_class_or_interface_or_dispinterface_or_objc(ttypesym(sym).typedef) and
+                    is_implicit_pointer_object_type(ttypesym(sym).typedef) and
                     (oo_is_forward in tobjectdef(ttypesym(sym).typedef).objectoptions) then
                   begin
                     case token of
@@ -633,14 +599,11 @@ implementation
                     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  }
+                    { change a forward and external objcclass declaration into
+                      formal external definition, so the compiler does not
+                      expect an real definition later }
                     if is_objc_class_or_protocol(hdef) then
-                      get_objc_class_or_protocol_external_status(tobjectdef(hdef));
-
-                    if is_cppclass(hdef) then
-                      get_cpp_class_external_status(tobjectdef(hdef));
+                      finalize_objc_class_or_protocol_external_status(tobjectdef(hdef));
 
                     { Build VMT indexes, skip for type renaming and forward classes }
                     if (hdef.typesym=newtype) and
@@ -684,7 +647,7 @@ implementation
               end;
             end;
 
-           if isgeneric and not(hdef.typ in [objectdef,recorddef]) then
+           if isgeneric and not(hdef.typ in [objectdef,recorddef,arraydef,procvardef]) then
              message(parser_e_cant_create_generics_of_this_type);
 
            { Stop recording a generic template }

+ 200 - 163
compiler/pdecobj.pas

@@ -41,7 +41,7 @@ interface
 implementation
 
     uses
-      cutils,
+      sysutils,cutils,
       globals,verbose,systems,tokens,
       symbase,symsym,symtable,
       node,nld,nmem,ncon,ncnv,ncal,
@@ -55,6 +55,8 @@ implementation
         Declaring it as string here results in an error when compiling (PFV) }
       current_procinfo = 'error';
 
+    var
+      current_objectdef : tobjectdef absolute current_structdef;
 
     function class_constructor_head:tprocdef;
       var
@@ -225,10 +227,10 @@ implementation
         i   : longint;
         def : tdef;
       begin
-        include(current_objectdef.objectoptions,oo_has_virtual);
-        for i:=0 to current_objectdef.symtable.DefList.count-1 do
+        include(current_structdef.objectoptions,oo_has_virtual);
+        for i:=0 to current_structdef.symtable.DefList.count-1 do
           begin
-            def:=tdef(current_objectdef.symtable.DefList[i]);
+            def:=tdef(current_structdef.symtable.DefList[i]);
             if assigned(def) and
                (def.typ=procdef) then
               begin
@@ -244,9 +246,9 @@ implementation
         i   : longint;
         def : tdef;
       begin
-        for i:=0 to current_objectdef.symtable.DefList.count-1 do
+        for i:=0 to current_structdef.symtable.DefList.count-1 do
           begin
-            def:=tdef(current_objectdef.symtable.DefList[i]);
+            def:=tdef(current_structdef.symtable.DefList[i]);
             if assigned(def) and
                (def.typ=procdef) then
               begin
@@ -303,7 +305,8 @@ implementation
       begin
         while try_to_consume(_COMMA) do
           begin
-             id_type(hdef,false);
+             { use single_type instead of id_type for specialize support }
+             single_type(hdef,[stoAllowTypeDef,stoParseClassParent]);
              if (hdef.typ<>objectdef) then
                begin
                   if intf then
@@ -334,30 +337,92 @@ implementation
             if (current_objectdef.objecttype in [odt_interfacecom,odt_dispinterface]) and
                not valid then
               Message(parser_e_improper_guid_syntax);
-            include(current_objectdef.objectoptions,oo_has_valid_guid);
+            include(current_structdef.objectoptions,oo_has_valid_guid);
           end
         else
           Message(parser_e_illegal_expression);
         p.free;
       end;
 
-    procedure parse_object_options;
+    procedure get_cpp_class_external_status(od: tobjectdef);
+      var
+        hs: string;
       begin
-        if current_objectdef.objecttype in [odt_object,odt_class] then
+        { C++ classes can be external -> all methods 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 try_to_consume(_EXTERNAL) then
           begin
-            while true do
+            if token in [_CSTRING,_CWSTRING,_CCHAR,_CWCHAR] then
               begin
-                if try_to_consume(_ABSTRACT) then
-                  include(current_objectdef.objectoptions,oo_is_abstract)
-                else
-                if try_to_consume(_SEALED) then
-                  include(current_objectdef.objectoptions,oo_is_sealed)
-                else
-                  break;
+                { Always add library prefix and suffix to create an uniform name }
+                hs:=get_stringconst;
+                if ExtractFileExt(hs)='' then
+                  hs:=ChangeFileExt(hs,target_info.sharedlibext);
+                if Copy(hs,1,length(target_info.sharedlibprefix))<>target_info.sharedlibprefix then
+                  hs:=target_info.sharedlibprefix+hs;
+                od.import_lib:=stringdup(hs);
               end;
-            if [oo_is_abstract, oo_is_sealed] * current_objectdef.objectoptions = [oo_is_abstract, oo_is_sealed] then
-              Message(parser_e_abstract_and_sealed_conflict);
-          end;
+            include(od.objectoptions, oo_is_external);
+            { check if we shall use another name for the class }
+            if try_to_consume(_NAME) then
+              od.objextname:=stringdup(get_stringconst)
+            else
+              od.objextname:=stringdup(od.objrealname^);
+            include(od.objectoptions,oo_is_external);
+          end
+        else
+          od.objextname:=stringdup(od.objrealname^);
+        { ToDo: read the namespace of the class (influences the mangled name)}
+      end;
+
+    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 try_to_consume(_EXTERNAL) then
+          begin
+            if try_to_consume(_NAME) then
+              od.objextname:=stringdup(get_stringconst)
+            else
+              { the external name doesn't matter for formally declared
+                classes, and allowing to specify one would mean that we would
+                have to check it for consistency with the actual definition
+                later on }
+              od.objextname:=stringdup(od.objrealname^);
+            include(od.objectoptions,oo_is_external);
+          end
+        else
+          od.objextname:=stringdup(od.objrealname^);
+      end;
+
+
+    procedure parse_object_options;
+      begin
+        case current_objectdef.objecttype of
+          odt_object,odt_class:
+            begin
+              while true do
+                begin
+                  if try_to_consume(_ABSTRACT) then
+                    include(current_structdef.objectoptions,oo_is_abstract)
+                  else
+                  if try_to_consume(_SEALED) then
+                    include(current_structdef.objectoptions,oo_is_sealed)
+                  else
+                    break;
+                end;
+              if [oo_is_abstract, oo_is_sealed] * current_structdef.objectoptions = [oo_is_abstract, oo_is_sealed] then
+                Message(parser_e_abstract_and_sealed_conflict);
+            end;
+          odt_cppclass:
+            get_cpp_class_external_status(current_objectdef);
+          odt_objcclass,odt_objcprotocol,odt_objccategory:
+            get_objc_class_or_protocol_external_status(current_objectdef);
+        end;
       end;
 
     procedure parse_parent_classes;
@@ -373,19 +438,19 @@ implementation
 
         { reads the parent class }
         if (token=_LKLAMMER) or
-           is_objccategory(current_objectdef) or
-           is_objectpascal_classhelper(current_objectdef) then
+           is_objccategory(current_structdef) or
+           is_objectpascal_classhelper(current_structdef) then
           begin
             if not is_objectpascal_classhelper(current_objectdef) then
               consume(_LKLAMMER);
             { use single_type instead of id_type for specialize support }
-            single_type(hdef,false,false);
+            single_type(hdef,[stoAllowTypeDef, stoParseClassParent]);
             if (not assigned(hdef)) or
                (hdef.typ<>objectdef) then
               begin
                 if assigned(hdef) then
                   Message1(type_e_class_type_expected,hdef.typename)
-                else if is_objccategory(current_objectdef) then
+                else if is_objccategory(current_structdef) then
                   { a category must specify the class to extend }
                   Message(type_e_objcclass_type_expected)
                 else if is_objectpascal_classhelper(current_objectdef) then
@@ -432,7 +497,7 @@ implementation
                        begin
                          if is_objcprotocol(childof) then
                            begin
-                             if not(oo_is_classhelper in current_objectdef.objectoptions) then
+                             if not(oo_is_classhelper in current_structdef.objectoptions) then
                                begin
                                  intfchildof:=childof;
                                  childof:=nil;
@@ -467,14 +532,6 @@ implementation
             hasparentdefined:=true;
           end;
 
-        { no generic as parents }
-        if assigned(childof) and
-           (df_generic in childof.defoptions) then
-          begin
-            Message(parser_e_no_generics_as_types);
-            childof:=nil;
-          end;
-
         { if no parent class, then a class get tobject as parent }
         if not assigned(childof) then
           begin
@@ -505,7 +562,7 @@ implementation
           end;
 
         { remove forward flag, is resolved }
-        exclude(current_objectdef.objectoptions,oo_is_forward);
+        exclude(current_structdef.objectoptions,oo_is_forward);
 
         if hasparentdefined then
           begin
@@ -537,27 +594,6 @@ implementation
           message(parser_e_dispinterface_needs_a_guid);
       end;
 
-
-    procedure insert_generic_parameter_types(genericdef:tstoreddef;genericlist:TFPObjectList);
-      var
-        i : longint;
-        generictype : ttypesym;
-      begin
-        current_objectdef.genericdef:=genericdef;
-        if not assigned(genericlist) then
-          exit;
-        for i:=0 to genericlist.count-1 do
-          begin
-            generictype:=ttypesym(genericlist[i]);
-            if generictype.typedef.typ=undefineddef then
-              include(current_objectdef.defoptions,df_generic)
-            else
-              include(current_objectdef.defoptions,df_specialization);
-            symtablestack.top.insert(generictype);
-          end;
-       end;
-
-
     procedure parse_object_members;
 
       procedure chkobjc(pd: tprocdef);
@@ -595,8 +631,7 @@ implementation
       var
         pd : tprocdef;
         has_destructor,
-        oldparse_only,
-        old_parse_generic : boolean;
+        oldparse_only: boolean;
         object_member_blocktype : tblock_type;
         fields_allowed, is_classdef, classfields: boolean;
         vdoptions: tvar_dec_options;
@@ -606,15 +641,11 @@ implementation
            (token=_SEMICOLON) then
           exit;
 
-        old_parse_generic:=parse_generic;
-
-        parse_generic:=(df_generic in current_objectdef.defoptions);
         { in "publishable" classes the default access type is published }
-        if (oo_can_have_published in current_objectdef.objectoptions) then
-          current_objectdef.symtable.currentvisibility:=vis_published
+        if (oo_can_have_published in current_structdef.objectoptions) then
+          current_structdef.symtable.currentvisibility:=vis_published
         else
-          current_objectdef.symtable.currentvisibility:=vis_public;
-        testcurobject:=1;
+          current_structdef.symtable.currentvisibility:=vis_public;
         has_destructor:=false;
         fields_allowed:=true;
         is_classdef:=false;
@@ -624,17 +655,15 @@ implementation
           case token of
             _TYPE :
               begin
-                if (([df_generic,df_specialization]*current_objectdef.defoptions)=[]) and
-                   not(current_objectdef.objecttype in [odt_class,odt_object]) then
-                  Message(parser_e_type_var_const_only_in_generics_and_classes);
-                 consume(_TYPE);
-                 object_member_blocktype:=bt_type;
+                if not(current_objectdef.objecttype in [odt_class,odt_object]) then
+                  Message(parser_e_type_var_const_only_in_records_and_classes);
+                consume(_TYPE);
+                object_member_blocktype:=bt_type;
               end;
             _VAR :
               begin
-                if (([df_generic,df_specialization]*current_objectdef.defoptions)=[]) and
-                   not(current_objectdef.objecttype in [odt_class,odt_object]) then
-                  Message(parser_e_type_var_const_only_in_generics_and_classes);
+                if not(current_objectdef.objecttype in [odt_class,odt_object]) then
+                  Message(parser_e_type_var_const_only_in_records_and_classes);
                 consume(_VAR);
                 fields_allowed:=true;
                 object_member_blocktype:=bt_general;
@@ -643,30 +672,29 @@ implementation
               end;
             _CONST:
               begin
-                if (([df_generic,df_specialization]*current_objectdef.defoptions)=[]) and
-                   not(current_objectdef.objecttype in [odt_class,odt_object]) then
-                  Message(parser_e_type_var_const_only_in_generics_and_classes);
+                if not(current_objectdef.objecttype in [odt_class,odt_object]) then
+                  Message(parser_e_type_var_const_only_in_records_and_classes);
                 consume(_CONST);
                 object_member_blocktype:=bt_const;
               end;
             _ID :
               begin
-                if is_objcprotocol(current_objectdef) and
+                if is_objcprotocol(current_structdef) and
                    ((idtoken=_REQUIRED) or
                     (idtoken=_OPTIONAL)) then
                   begin
-                    current_objectdef.symtable.currentlyoptional:=(idtoken=_OPTIONAL);
+                    current_structdef.symtable.currentlyoptional:=(idtoken=_OPTIONAL);
                     consume(idtoken)
                   end
                 else case idtoken of
                   _PRIVATE :
                     begin
-                      if is_interface(current_objectdef) or
-                         is_objc_protocol_or_category(current_objectdef) then
+                      if is_interface(current_structdef) or
+                         is_objc_protocol_or_category(current_structdef) then
                         Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PRIVATE);
-                       current_objectdef.symtable.currentvisibility:=vis_private;
-                       include(current_objectdef.objectoptions,oo_has_private);
+                       current_structdef.symtable.currentvisibility:=vis_private;
+                       include(current_structdef.objectoptions,oo_has_private);
                        fields_allowed:=true;
                        is_classdef:=false;
                        classfields:=false;
@@ -674,12 +702,12 @@ implementation
                      end;
                    _PROTECTED :
                      begin
-                       if is_interface(current_objectdef) or
-                          is_objc_protocol_or_category(current_objectdef) then
+                       if is_interface(current_structdef) or
+                          is_objc_protocol_or_category(current_structdef) then
                          Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PROTECTED);
-                       current_objectdef.symtable.currentvisibility:=vis_protected;
-                       include(current_objectdef.objectoptions,oo_has_protected);
+                       current_structdef.symtable.currentvisibility:=vis_protected;
+                       include(current_structdef.objectoptions,oo_has_protected);
                        fields_allowed:=true;
                        is_classdef:=false;
                        classfields:=false;
@@ -687,11 +715,11 @@ implementation
                      end;
                    _PUBLIC :
                      begin
-                       if is_interface(current_objectdef) or
-                          is_objc_protocol_or_category(current_objectdef) then
+                       if is_interface(current_structdef) or
+                          is_objc_protocol_or_category(current_structdef) then
                          Message(parser_e_no_access_specifier_in_interfaces);
                        consume(_PUBLIC);
-                       current_objectdef.symtable.currentvisibility:=vis_public;
+                       current_structdef.symtable.currentvisibility:=vis_public;
                        fields_allowed:=true;
                        is_classdef:=false;
                        classfields:=false;
@@ -702,14 +730,14 @@ 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_structdef) 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
+                       if is_objc_class_or_protocol(current_structdef) then
                          Message(parser_e_no_objc_published);
                        consume(_PUBLISHED);
-                       current_objectdef.symtable.currentvisibility:=vis_published;
+                       current_structdef.symtable.currentvisibility:=vis_published;
                        fields_allowed:=true;
                        is_classdef:=false;
                        classfields:=false;
@@ -717,8 +745,8 @@ implementation
                      end;
                    _STRICT :
                      begin
-                       if is_interface(current_objectdef) or
-                          is_objc_protocol_or_category(current_objectdef) then
+                       if is_interface(current_structdef) or
+                          is_objc_protocol_or_category(current_structdef) then
                           Message(parser_e_no_access_specifier_in_interfaces);
                         consume(_STRICT);
                         if token=_ID then
@@ -727,14 +755,14 @@ implementation
                               _PRIVATE:
                                 begin
                                   consume(_PRIVATE);
-                                  current_objectdef.symtable.currentvisibility:=vis_strictprivate;
-                                  include(current_objectdef.objectoptions,oo_has_strictprivate);
+                                  current_structdef.symtable.currentvisibility:=vis_strictprivate;
+                                  include(current_structdef.objectoptions,oo_has_strictprivate);
                                 end;
                               _PROTECTED:
                                 begin
                                   consume(_PROTECTED);
-                                  current_objectdef.symtable.currentvisibility:=vis_strictprotected;
-                                  include(current_objectdef.objectoptions,oo_has_strictprotected);
+                                  current_structdef.symtable.currentvisibility:=vis_strictprotected;
+                                  include(current_structdef.objectoptions,oo_has_strictprotected);
                                 end;
                               else
                                 message(parser_e_protected_or_private_expected);
@@ -751,12 +779,12 @@ implementation
                       begin
                         if object_member_blocktype=bt_general then
                           begin
-                            if is_interface(current_objectdef) or
-                               is_objc_protocol_or_category(current_objectdef) then
+                            if is_interface(current_structdef) or
+                               is_objc_protocol_or_category(current_structdef) then
                               Message(parser_e_no_vars_in_interfaces);
 
-                            if (current_objectdef.symtable.currentvisibility=vis_published) and
-                               not(oo_can_have_published in current_objectdef.objectoptions) then
+                            if (current_structdef.symtable.currentvisibility=vis_published) and
+                               not(oo_can_have_published in current_structdef.objectoptions) then
                               Message(parser_e_cant_have_published);
                             if (not fields_allowed) then
                               Message(parser_e_field_not_allowed_here);
@@ -792,7 +820,7 @@ implementation
                    if not(token in [_FUNCTION,_PROCEDURE,_PROPERTY,_VAR,_CONSTRUCTOR,_DESTRUCTOR]) then
                      Message(parser_e_procedure_or_function_expected);
 
-                   if is_interface(current_objectdef) then
+                   if is_interface(current_structdef) then
                      Message(parser_e_no_static_method_in_interfaces)
                    else
                      { class methods are also allowed for Objective-C protocols }
@@ -802,13 +830,13 @@ implementation
             _PROCEDURE,
             _FUNCTION:
               begin
-                if (current_objectdef.symtable.currentvisibility=vis_published) and
-                   not(oo_can_have_published in current_objectdef.objectoptions) then
+                if (current_structdef.symtable.currentvisibility=vis_published) and
+                   not(oo_can_have_published in current_structdef.objectoptions) then
                   Message(parser_e_cant_have_published);
 
                 oldparse_only:=parse_only;
                 parse_only:=true;
-                pd:=parse_proc_dec(is_classdef,current_objectdef);
+                pd:=parse_proc_dec(is_classdef,current_structdef);
 
                 { this is for error recovery as well as forward }
                 { interface mappings, i.e. mapping to a method  }
@@ -837,11 +865,11 @@ implementation
 
                     { add procdef options to objectdef options }
                     if (po_msgint in pd.procoptions) then
-                      include(current_objectdef.objectoptions,oo_has_msgint);
+                      include(current_structdef.objectoptions,oo_has_msgint);
                     if (po_msgstr in pd.procoptions) then
-                      include(current_objectdef.objectoptions,oo_has_msgstr);
+                      include(current_structdef.objectoptions,oo_has_msgstr);
                     if (po_virtualmethod in pd.procoptions) then
-                      include(current_objectdef.objectoptions,oo_has_virtual);
+                      include(current_structdef.objectoptions,oo_has_virtual);
 
                     chkcpp(pd);
                     chkobjc(pd);
@@ -855,23 +883,23 @@ implementation
               end;
             _CONSTRUCTOR :
               begin
-                if (current_objectdef.symtable.currentvisibility=vis_published) and
-                  not(oo_can_have_published in current_objectdef.objectoptions) then
+                if (current_structdef.symtable.currentvisibility=vis_published) and
+                  not(oo_can_have_published in current_structdef.objectoptions) then
                   Message(parser_e_cant_have_published);
 
-                if not is_classdef and not(current_objectdef.symtable.currentvisibility in [vis_public,vis_published]) then
+                if not is_classdef and not(current_structdef.symtable.currentvisibility in [vis_public,vis_published]) then
                   Message(parser_w_constructor_should_be_public);
 
-                if is_interface(current_objectdef) then
+                if is_interface(current_structdef) 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
+                if is_objc_class_or_protocol(current_structdef) then
                   Message(parser_e_objc_no_constructor_destructor);
 
                 { only 1 class constructor is allowed }
-                if is_classdef and (oo_has_class_constructor in current_objectdef.objectoptions) then
-                  Message1(parser_e_only_one_class_constructor_allowed, current_objectdef.objrealname^);
+                if is_classdef and (oo_has_class_constructor in current_structdef.objectoptions) then
+                  Message1(parser_e_only_one_class_constructor_allowed, current_structdef.objrealname^);
 
                 oldparse_only:=parse_only;
                 parse_only:=true;
@@ -887,7 +915,7 @@ implementation
 
                 { add procdef options to objectdef options }
                 if (po_virtualmethod in pd.procoptions) then
-                  include(current_objectdef.objectoptions,oo_has_virtual);
+                  include(current_structdef.objectoptions,oo_has_virtual);
                 chkcpp(pd);
                 maybe_parse_hint_directives(pd);
 
@@ -897,8 +925,8 @@ implementation
               end;
             _DESTRUCTOR :
               begin
-                if (current_objectdef.symtable.currentvisibility=vis_published) and
-                   not(oo_can_have_published in current_objectdef.objectoptions) then
+                if (current_structdef.symtable.currentvisibility=vis_published) and
+                   not(oo_can_have_published in current_structdef.objectoptions) then
                   Message(parser_e_cant_have_published);
 
                 if not is_classdef then
@@ -907,19 +935,19 @@ implementation
                   else
                     has_destructor:=true;
 
-                if is_interface(current_objectdef) then
+                if is_interface(current_structdef) then
                   Message(parser_e_no_con_des_in_interfaces);
 
-                if not is_classdef and (current_objectdef.symtable.currentvisibility<>vis_public) then
+                if not is_classdef and (current_structdef.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
+                if is_objc_class_or_protocol(current_structdef) then
                   Message(parser_e_objc_no_constructor_destructor);
 
                 { only 1 class destructor is allowed }
-                if is_classdef and (oo_has_class_destructor in current_objectdef.objectoptions) then
-                  Message1(parser_e_only_one_class_destructor_allowed, current_objectdef.objrealname^);
+                if is_classdef and (oo_has_class_destructor in current_structdef.objectoptions) then
+                  Message1(parser_e_only_one_class_destructor_allowed, current_structdef.objrealname^);
 
                 oldparse_only:=parse_only;
                 parse_only:=true;
@@ -935,7 +963,7 @@ implementation
 
                 { add procdef options to objectdef options }
                 if (po_virtualmethod in pd.procoptions) then
-                  include(current_objectdef.objectoptions,oo_has_virtual);
+                  include(current_structdef.objectoptions,oo_has_virtual);
 
                 chkcpp(pd);
                 maybe_parse_hint_directives(pd);
@@ -953,24 +981,22 @@ implementation
               consume(_ID); { Give a ident expected message, like tp7 }
           end;
         until false;
-
-        { restore }
-        testcurobject:=0;
-        parse_generic:=old_parse_generic;
       end;
 
 
     function object_dec(objecttype:tobjecttyp;const n:tidstring;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tobjectdef;
       var
-        old_current_objectdef : tobjectdef;
-        old_current_genericdef : tobjectdef;
-        old_current_specializedef : tobjectdef;
+        old_current_structdef: tabstractrecorddef;
+        old_current_genericdef,
+        old_current_specializedef: tstoreddef;
+        old_parse_generic: boolean;
       begin
-        old_current_objectdef:=current_objectdef;
+        old_current_structdef:=current_structdef;
         old_current_genericdef:=current_genericdef;
         old_current_specializedef:=current_specializedef;
+        old_parse_generic:=parse_generic;
 
-        current_objectdef:=nil;
+        current_structdef:=nil;
         current_genericdef:=nil;
         current_specializedef:=nil;
 
@@ -986,11 +1012,11 @@ implementation
               begin
                 Message(parser_e_forward_mismatch);
                 { recover }
-                current_objectdef:=tobjectdef.create(current_objectdef.objecttype,n,nil);
-                include(current_objectdef.objectoptions,oo_is_forward);
+                current_structdef:=tobjectdef.create(current_objectdef.objecttype,n,nil);
+                include(current_structdef.objectoptions,oo_is_forward);
               end
             else
-              current_objectdef:=fd
+              current_structdef:=fd
           end
         else
           begin
@@ -999,20 +1025,20 @@ implementation
               Message(parser_f_no_anonym_objects);
 
             { create new class }
-            current_objectdef:=tobjectdef.create(objecttype,n,nil);
+            current_structdef:=tobjectdef.create(objecttype,n,nil);
 
             { include always the forward flag, it'll be removed after the parent class have been
               added. This is to prevent circular childof loops }
-            include(current_objectdef.objectoptions,oo_is_forward);
+            include(current_structdef.objectoptions,oo_is_forward);
 
             if (cs_compilesystem in current_settings.moduleswitches) then
               begin
                 case current_objectdef.objecttype of
                   odt_interfacecom :
-                    if (current_objectdef.objname^='IUNKNOWN') then
+                    if (current_structdef.objname^='IUNKNOWN') then
                       interface_iunknown:=current_objectdef;
                   odt_class :
-                    if (current_objectdef.objname^='TOBJECT') then
+                    if (current_structdef.objname^='TOBJECT') then
                       class_tobject:=current_objectdef;
                 end;
               end;
@@ -1028,16 +1054,23 @@ implementation
 
         { usage of specialized type inside its generic template }
         if assigned(genericdef) then
-          current_specializedef:=current_objectdef
+          current_specializedef:=current_structdef
         { reject declaration of generic class inside generic class }
         else if assigned(genericlist) then
-          current_genericdef:=current_objectdef;
+          current_genericdef:=current_structdef;
 
         { set published flag in $M+ mode, it can also be inherited and will
           be added when the parent class set with tobjectdef.set_parent (PFV) }
         if (cs_generate_rtti in current_settings.localswitches) and
            (current_objectdef.objecttype in [odt_interfacecom,odt_class]) then
-          include(current_objectdef.objectoptions,oo_can_have_published);
+          include(current_structdef.objectoptions,oo_can_have_published);
+
+        { Objective-C objectdefs can be "formal definitions", in which case
+          the syntax is "type tc = objcclass external;" -> we have to parse
+          its object options (external) already here, to make sure that such
+          definitions are recognised as formal defs }
+        if objecttype in [odt_objcclass,odt_objcprotocol,odt_objccategory] then
+          parse_object_options;
 
         { forward def? }
         if not assigned(fd) and
@@ -1045,7 +1078,7 @@ implementation
           begin
             { add to the list of definitions to check that the forward
               is resolved. this is required for delphi mode }
-            current_module.checkforwarddefs.add(current_objectdef);
+            current_module.checkforwarddefs.add(current_structdef);
           end
         else
           begin
@@ -1053,7 +1086,7 @@ implementation
             if (objecttype=odt_objccategory) then
               begin
                 current_objectdef.objecttype:=odt_objcclass;
-                include(current_objectdef.objectoptions,oo_is_classhelper);
+                include(current_structdef.objectoptions,oo_is_classhelper);
               end;
 
             { change classhepers into Delphi type class helpers }
@@ -1064,7 +1097,12 @@ implementation
               end;
 
             { parse list of options (abstract / sealed) }
-            parse_object_options;
+            if not(objecttype in [odt_objcclass,odt_objcprotocol,odt_objccategory]) then
+              parse_object_options;
+
+            symtablestack.push(current_structdef.symtable);
+            insert_generic_parameter_types(current_structdef,genericdef,genericlist);
+            parse_generic:=(df_generic in current_structdef.defoptions);
 
             { parse list of parent classes }
             parse_parent_classes;
@@ -1072,42 +1110,41 @@ implementation
             { parse optional GUID for interfaces }
             parse_guid;
 
-            symtablestack.push(current_objectdef.symtable);
-            insert_generic_parameter_types(genericdef,genericlist);
             { parse and insert object members }
             parse_object_members;
-            symtablestack.pop(current_objectdef.symtable);
+            symtablestack.pop(current_structdef.symtable);
           end;
 
         { generate vmt space if needed }
-        if not(oo_has_vmt in current_objectdef.objectoptions) and
-           not(oo_is_forward in current_objectdef.objectoptions) and
+        if not(oo_has_vmt in current_structdef.objectoptions) and
+           not(oo_is_forward in current_structdef.objectoptions) and
            (
-            ([oo_has_virtual,oo_has_constructor,oo_has_destructor]*current_objectdef.objectoptions<>[]) or
+            ([oo_has_virtual,oo_has_constructor,oo_has_destructor]*current_structdef.objectoptions<>[]) or
             (current_objectdef.objecttype in [odt_class])
            ) then
           current_objectdef.insertvmt;
 
         { 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) and
-           not is_objc_class_or_protocol(current_objectdef) then
-          Message1(parser_w_virtual_without_constructor,current_objectdef.objrealname^);
-
-        if is_interface(current_objectdef) or
-           is_objcprotocol(current_objectdef) then
+        if (oo_has_vmt in current_structdef.objectoptions) and
+           not(oo_is_forward in current_structdef.objectoptions) and
+           not(oo_has_constructor in current_structdef.objectoptions) and
+           not is_objc_class_or_protocol(current_structdef) then
+          Message1(parser_w_virtual_without_constructor,current_structdef.objrealname^);
+
+        if is_interface(current_structdef) or
+           is_objcprotocol(current_structdef) then
           setinterfacemethodoptions
-        else if is_objcclass(current_objectdef) then
+        else if is_objcclass(current_structdef) then
           setobjcclassmethodoptions;
 
         { return defined objectdef }
         result:=current_objectdef;
 
         { restore old state }
-        current_objectdef:=old_current_objectdef;
+        current_structdef:=old_current_structdef;
         current_genericdef:=old_current_genericdef;
         current_specializedef:=old_current_specializedef;
+        parse_generic:=old_parse_generic;
       end;
 
 end.

+ 132 - 49
compiler/pdecsub.pas

@@ -62,7 +62,7 @@ interface
     procedure parse_var_proc_directives(sym:tsym);
     procedure parse_object_proc_directives(pd:tabstractprocdef);
     procedure parse_record_proc_directives(pd:tabstractprocdef);
-    function  parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;var pd:tprocdef):boolean;
+    function  parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;out pd:tprocdef):boolean;
     function  parse_proc_dec(isclassmethod:boolean;astruct:tabstractrecorddef):tprocdef;
 
     { helper functions - they insert nested objects hierarcy to the symtablestack
@@ -528,7 +528,6 @@ implementation
         sc:=TFPObjectList.create(false);
         defaultrequired:=false;
         paranr:=0;
-        inc(testcurobject);
         block_type:=bt_var;
         is_univ:=false;
         repeat
@@ -594,7 +593,7 @@ implementation
               begin
                 block_type:=bt_var_type;
                 consume(_COLON);
-                single_type(pv.returndef,false,false);
+                single_type(pv.returndef,[]);
                 block_type:=bt_var;
               end;
              hdef:=pv;
@@ -642,7 +641,7 @@ implementation
                 else
                  begin
                    { define field type }
-                   single_type(arrayelementdef,false,false);
+                   single_type(arrayelementdef,[]);
                    tarraydef(hdef).elementdef:=arrayelementdef;
                  end;
               end
@@ -656,7 +655,7 @@ implementation
                 else
                   begin
                     block_type:=bt_var_type;
-                    single_type(hdef,false,false);
+                    single_type(hdef,[]);
                     block_type:=bt_var;
                   end;
 
@@ -782,20 +781,17 @@ implementation
         { remove parasymtable from stack }
         sc.free;
         { reset object options }
-        dec(testcurobject);
         block_type:=old_block_type;
         consume(_RKLAMMER);
       end;
 
 
-    function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;var pd:tprocdef):boolean;
+    function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;out pd:tprocdef):boolean;
       var
         hs       : string;
         orgsp,sp : TIDString;
         srsym : tsym;
-        srsymtable : TSymtable;
         checkstack : psymtablestackitem;
-        storepos,
         procstartfilepos : tfileposinfo;
         searchagain : boolean;
         st,
@@ -806,7 +802,7 @@ implementation
         old_parse_generic : boolean;
         old_current_structdef: tabstractrecorddef;
         old_current_genericdef,
-        old_current_specializedef : tobjectdef;
+        old_current_specializedef: tstoreddef;
         lasttoken,lastidtoken: ttoken;
 
         procedure parse_operator_name;
@@ -831,7 +827,7 @@ implementation
                       case lastidtoken of
                         _IMPLICIT:optoken:=_ASSIGNMENT;
                         _NEGATIVE:optoken:=_MINUS;
-  //                         _POSITIVE:optoken:=_PLUS;
+                        _POSITIVE:optoken:=_PLUS;
                         _LOGICALNOT:optoken:=_OP_NOT;
                         _IN:optoken:=_OP_IN;
                         _EQUAL:optoken:=_EQ;
@@ -887,6 +883,89 @@ implementation
               end;
           end;
 
+        function search_object_name(sp:TIDString;gen_error:boolean):tsym;
+          var
+            storepos:tfileposinfo;
+            srsymtable:TSymtable;
+          begin
+            storepos:=current_tokenpos;
+            current_tokenpos:=procstartfilepos;
+            searchsym(sp,result,srsymtable);
+            if not assigned(result) then
+              begin
+                if gen_error then
+                  identifier_not_found(orgsp);
+                result:=generrorsym;
+              end;
+            current_tokenpos:=storepos;
+          end;
+
+        function consume_generic_type_parameter:boolean;
+          var
+            i:integer;
+            ok:boolean;
+            sym:tsym;
+          begin
+            result:=not assigned(astruct)and(m_delphi in current_settings.modeswitches);
+            if result then
+              begin
+                { a generic type parameter? }
+                srsym:=search_object_name(sp,false);
+                if (srsym.typ=typesym) and
+                   (ttypesym(srsym).typedef.typ in [objectdef,recorddef]) then
+                begin
+                  astruct:=tabstractrecorddef(ttypesym(srsym).typedef);
+                  if (df_generic in astruct.defoptions) then
+                    begin
+                      consume(_LT);
+                      ok:=true;
+                      i:=0;
+                      repeat
+                        if ok and (token=_ID)  then
+                          begin
+                            ok:=false;
+                            while i<astruct.symtable.SymList.Count-1 do
+                              begin
+                                sym:=tsym(astruct.symtable.SymList[i]);
+                                if sp_generic_para in sym.symoptions then
+                                  begin
+                                    ok:=sym.Name=pattern;
+                                    inc(i);
+                                    break;
+                                  end;
+                                inc(i);
+                              end;
+                            if not ok then
+                              Message1(type_e_generic_declaration_does_not_match,astruct.RttiName);
+                          end;
+                        consume(_ID);
+                      until not try_to_consume(_COMMA);
+                      if ok then
+                        while i<astruct.symtable.SymList.Count-1 do
+                          begin
+                            sym:=tsym(astruct.symtable.SymList[i]);
+                            if sp_generic_para in sym.symoptions then
+                              begin
+                                Message1(type_e_generic_declaration_does_not_match,astruct.RttiName);
+                                break;
+                              end;
+                            inc(i);
+                          end;
+                      consume(_GT);
+                    end
+                  else
+                  if try_to_consume(_LT) then
+                    begin
+                      Message(type_e_type_parameters_are_not_allowed_here);
+                      repeat
+                        consume(_ID);
+                      until not try_to_consume(_COMMA);
+                      consume(_GT);
+                    end;
+                end;
+              end;
+          end;
+
       begin
         { Save the position where this procedure really starts }
         procstartfilepos:=current_tokenpos;
@@ -905,16 +984,7 @@ implementation
            (tobjectdef(astruct).ImplementedInterfaces.count>0) and
            try_to_consume(_POINT) then
          begin
-           storepos:=current_tokenpos;
-           current_tokenpos:=procstartfilepos;
-           { get interface syms}
-           searchsym(sp,srsym,srsymtable);
-           if not assigned(srsym) then
-            begin
-              identifier_not_found(orgsp);
-              srsym:=generrorsym;
-            end;
-           current_tokenpos:=storepos;
+           srsym:=search_object_name(sp,true);
            { qualifier is interface? }
            ImplIntf:=nil;
            if (srsym.typ=typesym) and
@@ -935,25 +1005,14 @@ implementation
          end;
 
         { method  ? }
-        if not assigned(astruct) and
+        if (consume_generic_type_parameter or not assigned(astruct)) and
            (symtablestack.top.symtablelevel=main_program_level) and
            try_to_consume(_POINT) then
          begin
            repeat
              searchagain:=false;
              if not assigned(astruct) then
-               begin
-                 { search for object name }
-                 storepos:=current_tokenpos;
-                 current_tokenpos:=procstartfilepos;
-                 searchsym(sp,srsym,srsymtable);
-                 if not assigned(srsym) then
-                  begin
-                    identifier_not_found(orgsp);
-                    srsym:=generrorsym;
-                  end;
-                 current_tokenpos:=storepos;
-               end;
+               srsym:=search_object_name(sp,true);
              { consume proc name }
              procstartfilepos:=current_tokenpos;
              consume_proc_name;
@@ -1019,14 +1078,13 @@ implementation
              if (potype=potype_operator)and(optoken=NOTOKEN) then
                parse_operator_name;
 
-             srsymtable:=symtablestack.top;
-             srsym:=tsym(srsymtable.Find(sp));
+             srsym:=tsym(symtablestack.top.Find(sp));
 
              { Also look in the globalsymtable if we didn't found
                the symbol in the localsymtable }
              if not assigned(srsym) and
                 not(parse_only) and
-                (srsymtable=current_module.localsymtable) and
+                (symtablestack.top=current_module.localsymtable) and
                 assigned(current_module.globalsymtable) then
                srsym:=tsym(current_module.globalsymtable.Find(sp));
 
@@ -1154,9 +1212,9 @@ implementation
                 old_current_specializedef:=current_specializedef;
                 current_structdef:=pd.struct;
                 if assigned(current_structdef) and (df_generic in current_structdef.defoptions) then
-                  current_genericdef:=tobjectdef(current_structdef);
+                  current_genericdef:=current_structdef;
                 if assigned(current_structdef) and (df_specialization in current_structdef.defoptions) then
-                  current_specializedef:=tobjectdef(current_structdef);
+                  current_specializedef:=current_structdef;
               end;
             { Add parameter symtable }
             if pd.parast.symtabletype<>staticsymtable then
@@ -1182,8 +1240,10 @@ implementation
 
     function parse_proc_dec(isclassmethod:boolean;astruct:tabstractrecorddef):tprocdef;
       var
-        pd : tprocdef;
+        pd: tprocdef;
         locationstr: string;
+        i: integer;
+        found: boolean;
 
         procedure read_returndef(pd: tprocdef);
           var
@@ -1191,10 +1251,9 @@ implementation
             old_parse_generic: boolean;
             old_current_structdef: tabstractrecorddef;
             old_current_genericdef,
-            old_current_specializedef: tobjectdef;
+            old_current_specializedef: tstoreddef;
           begin
             old_parse_generic:=parse_generic;
-            inc(testcurobject);
             { Add ObjectSymtable to be able to find generic type definitions }
             popclass:=0;
             if assigned(pd.struct) and
@@ -1208,11 +1267,11 @@ implementation
                 old_current_specializedef:=current_specializedef;
                 current_structdef:=pd.struct;
                 if assigned(current_structdef) and (df_generic in current_structdef.defoptions) then
-                  current_genericdef:=tobjectdef(current_structdef);
+                  current_genericdef:=current_structdef;
                 if assigned(current_structdef) and (df_specialization in current_structdef.defoptions) then
-                  current_specializedef:=tobjectdef(current_structdef);
+                  current_specializedef:=current_structdef;
               end;
-            single_type(pd.returndef,false,false);
+            single_type(pd.returndef,[]);
 
             if is_dispinterface(pd.struct) and not is_automatable(pd.returndef) then
               Message1(type_e_not_automatable,pd.returndef.typename);
@@ -1226,7 +1285,6 @@ implementation
                 if popclass<>0 then
                   internalerror(201012020);
               end;
-            dec(testcurobject);
             parse_generic:=old_parse_generic;
           end;
 
@@ -1377,6 +1435,18 @@ implementation
                   else
                    begin
                      read_returndef(pd);
+                     if (po_classmethod in pd.procoptions) then
+                       begin
+                         found:=false;
+                         for i := 0 to pd.parast.SymList.Count - 1 do
+                           if tparavarsym(pd.parast.SymList[i]).vardef=pd.struct then
+                             begin
+                               found:=true;
+                               break;
+                             end;
+                         if not found then
+                           Message1(parser_e_at_least_one_argument_must_be_of_type,pd.struct.RttiName);
+                       end;
                      if (optoken in [_EQ,_NE,_GT,_LT,_GTE,_LTE,_OP_IN]) and
                         ((pd.returndef.typ<>orddef) or
                          (torddef(pd.returndef).ordtype<>pasbool)) then
@@ -1651,7 +1721,11 @@ begin
   if not(is_class_or_interface_or_objc(tprocdef(pd).struct)) then
     Message(parser_e_no_object_override)
   else if is_objccategory(tprocdef(pd).struct) then
-    Message(parser_e_no_category_override);
+    Message(parser_e_no_category_override)
+  else if not is_objc_class_or_protocol(tprocdef(pd).struct) and
+          not is_cppclass(tprocdef(pd).struct) and
+          (po_external in pd.procoptions) then
+    Message1(parser_e_proc_dir_conflict,'OVERRIDE');
 end;
 
 procedure pd_overload(pd:tabstractprocdef);
@@ -1676,6 +1750,8 @@ begin
   { check parameter type }
   if not is_objc_class_or_protocol(tprocdef(pd).struct) then
     begin
+      if po_external in pd.procoptions then
+        Message1(parser_e_proc_dir_conflict,'MESSAGE');
       paracnt:=0;
       pd.parast.SymList.ForEachCall(@check_msg_para,@paracnt);
       if paracnt<>1 then
@@ -2200,7 +2276,7 @@ const
       pooption : []; { can be po_msgstr or po_msgint }
       mutexclpocall : [pocall_internproc];
       mutexclpotype : [potype_constructor,potype_destructor,potype_operator,potype_class_constructor,potype_class_destructor];
-      mutexclpo     : [po_interrupt,po_external,po_inline]
+      mutexclpo     : [po_interrupt,po_inline]
     ),(
       idtok:_MWPASCAL;
       pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
@@ -2245,7 +2321,7 @@ const
       pooption : [po_overridingmethod,po_virtualmethod];
       mutexclpocall : [pocall_internproc];
       mutexclpotype : [];
-      mutexclpo     : [po_exports,po_external,po_interrupt,po_virtualmethod,po_inline]
+      mutexclpo     : [po_exports,po_interrupt,po_virtualmethod,po_inline]
     ),(
       idtok:_PASCAL;
       pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
@@ -2845,6 +2921,13 @@ const
             include(pd.procoptions,po_global);
           end;
 
+        { methods from external class definitions are all external themselves }
+        if (pd.typ=procdef) and
+           assigned(tprocdef(pd).struct) and
+           (tprocdef(pd).struct.typ=objectdef) and
+           (oo_is_external in tobjectdef(tprocdef(pd).struct).objectoptions) then
+          tprocdef(pd).make_external;
+
         { Class constructors and destructor are static class methods in real. }
         { There are many places in the compiler where either class or static  }
         { method flag changes the behavior. It is simplier to add them to     }

+ 26 - 22
compiler/pdecvar.pas

@@ -357,7 +357,6 @@ implementation
               { create a list of the parameters }
               symtablestack.push(readprocdef.parast);
               sc:=TFPObjectList.create(false);
-              inc(testcurobject);
               repeat
                 if try_to_consume(_VAR) then
                   varspez:=vs_var
@@ -385,11 +384,11 @@ implementation
                         { define range and type of range }
                         hdef:=tarraydef.create(0,-1,s32inttype);
                         { define field type }
-                        single_type(arraytype,false,false);
+                        single_type(arraytype,[]);
                         tarraydef(hdef).elementdef:=arraytype;
                       end
                     else
-                      single_type(hdef,false,false);
+                      single_type(hdef,[]);
                   end
                 else
                   hdef:=cformaltype;
@@ -403,7 +402,6 @@ implementation
                   end;
               until not try_to_consume(_SEMICOLON);
               sc.free;
-              dec(testcurobject);
               symtablestack.pop(readprocdef.parast);
               consume(_RECKKLAMMER);
 
@@ -419,7 +417,7 @@ implementation
          if (token=_COLON) or (paranr>0) or (astruct=nil) then
            begin
               consume(_COLON);
-              single_type(p.propdef,false,false);
+              single_type(p.propdef,[]);
 
               if is_dispinterface(astruct) and not is_automatable(p.propdef) then
                 Message1(type_e_not_automatable,p.propdef.typename);
@@ -730,7 +728,7 @@ implementation
          { Parse possible "implements" keyword }
          if not is_record(astruct) and try_to_consume(_IMPLEMENTS) then
            begin
-             single_type(def,false,false);
+             single_type(def,[]);
 
              if not(is_interface(def)) then
                message(parser_e_class_implements_must_be_interface);
@@ -1406,13 +1404,13 @@ implementation
 {$endif powerpc or powerpc64}
          { Force an expected ID error message }
          if not (token in [_ID,_CASE,_END]) then
-          consume(_ID);
+           consume(_ID);
          { read vars }
          sc:=TFPObjectList.create(false);
          recstlist:=TFPObjectList.create(false);;
          while (token=_ID) and
             not(((vd_object in options) or
-                 ((vd_record in options) and (m_extended_records in current_settings.modeswitches))) and
+                 ((vd_record in options) and (m_advanced_records in current_settings.modeswitches))) and
                 (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED,_STRICT])) do
            begin
              visibility:=symtablestack.top.currentvisibility;
@@ -1430,23 +1428,26 @@ implementation
              until not try_to_consume(_COMMA);
              consume(_COLON);
 
-             { Don't search in the recordsymtable for types (can be nested!) }
+             { Don't search for types where they can't be:
+               types can be only in objects, classes and records.
+               This just speedup the search a bit. }
              recstlist.count:=0;
-             if ([df_generic,df_specialization]*tdef(recst.defowner).defoptions=[]) and
-                 not is_class_or_object(tdef(recst.defowner)) and
-                 not is_record(tdef(recst.defowner)) then
+             if not is_class_or_object(tdef(recst.defowner)) and
+                not is_record(tdef(recst.defowner)) then
                begin
                  recstlist.add(recst);
                  symtablestack.pop(recst);
-                 while (symtablestack.top.symtabletype=recordsymtable) and
-                       ([df_generic,df_specialization]*tdef(symtablestack.top.defowner).defoptions=[]) do
-                   begin
-                     recst:=tabstractrecordsymtable(symtablestack.top);
-                     recstlist.add(recst);
-                     symtablestack.pop(recst);
-                   end;
                end;
              read_anon_type(hdef,false);
+             { allow only static fields reference to struct where they are declared }
+             if not (vd_class in options) and
+               (is_object(hdef) or is_record(hdef)) and
+               is_owned_by(tabstractrecorddef(recst.defowner),tabstractrecorddef(hdef)) then
+               begin
+                 Message1(type_e_type_is_not_completly_defined, tabstractrecorddef(hdef).RttiName);
+                 { for error recovery or compiler will crash later }
+                 hdef:=generrordef;
+               end;
              { restore stack }
              for i:=recstlist.count-1 downto 0 do
                begin
@@ -1491,9 +1492,12 @@ implementation
 
              { types that use init/final are not allowed in variant parts, but
                classes are allowed }
-             if (variantrecordlevel>0) and
-                is_managed_type(hdef) then
-               Message(parser_e_cant_use_inittable_here);
+             if (variantrecordlevel>0) then
+               if is_managed_type(hdef) then
+                 Message(parser_e_cant_use_inittable_here)
+               else
+               if hdef.typ=undefineddef then
+                 Message(parser_e_cant_use_type_parameters_here);
 
              { try to parse the hint directives }
              hintsymoptions:=[];

+ 13 - 10
compiler/pexpr.pas

@@ -495,7 +495,7 @@ implementation
                    procvardef,
                    classrefdef : ;
                    objectdef :
-                     if not is_class_or_interface_or_dispinterface_or_objc(p1.resultdef) then
+                     if not is_implicit_pointer_object_type(p1.resultdef) then
                        begin
                          Message(parser_e_illegal_parameter_list);
                          err:=true;
@@ -1395,7 +1395,7 @@ implementation
                if typeonly then
                  searchsym_type(pattern,srsym,srsymtable)
                else
-               searchsym(pattern,srsym,srsymtable);
+                 searchsym(pattern,srsym,srsymtable);
 
                { handle unit specification like System.Writeln }
                unit_found:=try_consume_unitsym(srsym,srsymtable,t);
@@ -1522,6 +1522,11 @@ implementation
                        if (hdef=cvarianttype) and
                           not(cs_compilesystem in current_settings.moduleswitches) then
                          current_module.flags:=current_module.flags or uf_uses_variants;
+                       { if we get a generic then check that it is not an inline specialization }
+                       if (df_generic in hdef.defoptions) and
+                          (token=_LT) and
+                          (m_delphi in current_settings.modeswitches) then
+                          generate_specialization(hdef,false);
                        if try_to_consume(_LKLAMMER) then
                         begin
                           p1:=comp_expr(true,false);
@@ -1541,7 +1546,7 @@ implementation
                              begin
                                p1:=ctypenode.create(hdef);
                                { search also in inherited methods }
-                               searchsym_in_class(tobjectdef(hdef),current_objectdef,pattern,srsym,srsymtable);
+                               searchsym_in_class(tobjectdef(hdef),tobjectdef(current_structdef),pattern,srsym,srsymtable);
                                if assigned(srsym) then
                                  check_hints(srsym,srsym.symoptions,srsym.deprecatedmsg);
                                consume(_ID);
@@ -2369,12 +2374,12 @@ implementation
                     assigned(current_structdef) and
                     (current_structdef.typ=objectdef) then
                   begin
-                    hclassdef:=current_objectdef.childof;
+                    hclassdef:=tobjectdef(current_structdef).childof;
                     { Objective-C categories *replace* methods in the class
                       they extend, or add methods to it. So calling an
                       inherited method always calls the method inherited from
                       the parent of the extended class }
-                    if is_objccategory(current_objectdef) then
+                    if is_objccategory(current_structdef) then
                       hclassdef:=hclassdef.childof;
                     { if inherited; only then we need the method with
                       the same name }
@@ -2393,7 +2398,7 @@ implementation
                         if (po_msgstr in pd.procoptions) then
                           searchsym_in_class_by_msgstr(hclassdef,pd.messageinf.str^,srsym,srsymtable)
                        else
-                         searchsym_in_class(hclassdef,current_objectdef,hs,srsym,srsymtable);
+                         searchsym_in_class(hclassdef,tobjectdef(current_structdef),hs,srsym,srsymtable);
                      end
                     else
                      begin
@@ -2401,7 +2406,7 @@ implementation
                        hsorg:=orgpattern;
                        consume(_ID);
                        anon_inherited:=false;
-                       searchsym_in_class(hclassdef,current_objectdef,hs,srsym,srsymtable);
+                       searchsym_in_class(hclassdef,tobjectdef(current_structdef),hs,srsym,srsymtable);
                      end;
                     if assigned(srsym) then
                      begin
@@ -2660,9 +2665,7 @@ implementation
                begin
                  consume(_PLUS);
                  p1:=factor(false,false);
-                 { we must generate a new node to do 0+<p1> otherwise the + will
-                   not be checked }
-                 p1:=caddnode.create(addn,genintconstnode(0),p1);
+                 p1:=cunaryplusnode.create(p1);
                end;
 
              _MINUS :

+ 2 - 0
compiler/powerpc/nppcmat.pas

@@ -576,6 +576,8 @@ end;
            end
          else
            begin
+              if left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF] then
+                location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
               location_copy(location,left.location);
               location.loc:=LOC_REGISTER;
               case left.location.loc of

+ 2 - 0
compiler/powerpc64/nppcmat.pas

@@ -316,6 +316,8 @@ var
 begin
   secondpass(left);
   begin
+    if left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF] then
+      location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
     location_copy(location, left.location);
     location.loc := LOC_REGISTER;
     case left.location.loc of

+ 1 - 1
compiler/ppu.pas

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

+ 2 - 2
compiler/pstatmnt.pas

@@ -597,8 +597,8 @@ implementation
                     p:=ctemprefnode.create(calltempnode);
                     typecheckpass(p);
                   end;
-                { classes and interfaces have implicit dereferencing }
-                hasimplicitderef:=is_class_or_interface_or_dispinterface_or_objc(p.resultdef) or
+                { several object types have implicit dereferencing }
+                hasimplicitderef:=is_implicit_pointer_object_type(p.resultdef) or
                                   (p.resultdef.typ = classrefdef);
                 if hasimplicitderef then
                   hdef:=p.resultdef

+ 18 - 18
compiler/psub.pas

@@ -298,7 +298,7 @@ implementation
                 if is_class(current_structdef) then
                   begin
                     include(current_procinfo.flags,pi_needs_implicit_finally);
-                    srsym:=search_struct_member(current_objectdef,'NEWINSTANCE');
+                    srsym:=search_struct_member(current_structdef,'NEWINSTANCE');
                     if assigned(srsym) and
                        (srsym.typ=procsym) then
                       begin
@@ -328,7 +328,7 @@ implementation
                         that memory was allocated }
                       { parameter 1 : self pointer }
                       para:=ccallparanode.create(
-                                cordconstnode.create(current_objectdef.vmt_offset,s32inttype,false),
+                                cordconstnode.create(tobjectdef(current_structdef).vmt_offset,s32inttype,false),
                             ccallparanode.create(
                                 ctypeconvnode.create_internal(
                                     load_vmt_pointer_node,
@@ -363,7 +363,7 @@ implementation
             if (current_procinfo.procdef.proctypeoption=potype_destructor) and
                is_class(current_structdef) then
               begin
-                srsym:=search_struct_member(current_objectdef,'BEFOREDESTRUCTION');
+                srsym:=search_struct_member(current_structdef,'BEFOREDESTRUCTION');
                 if assigned(srsym) and
                    (srsym.typ=procsym) then
                   begin
@@ -410,7 +410,7 @@ implementation
               begin
                 if is_class(current_structdef) then
                   begin
-                    srsym:=search_struct_member(current_objectdef,'FREEINSTANCE');
+                    srsym:=search_struct_member(current_structdef,'FREEINSTANCE');
                     if assigned(srsym) and
                        (srsym.typ=procsym) then
                       begin
@@ -435,7 +435,7 @@ implementation
                   if is_object(current_structdef) then
                     begin
                       { finalize object data, but only if not in inherited call }
-                      if is_managed_type(current_objectdef) then
+                      if is_managed_type(current_structdef) then
                         begin
                           addstatement(newstatement,cifnode.create(
                             caddnode.create(unequaln,
@@ -448,7 +448,7 @@ implementation
                       { parameter 2 : pointer to vmt }
                       { parameter 1 : self pointer }
                       para:=ccallparanode.create(
-                                cordconstnode.create(current_objectdef.vmt_offset,s32inttype,false),
+                                cordconstnode.create(tobjectdef(current_structdef).vmt_offset,s32inttype,false),
                             ccallparanode.create(
                                 ctypeconvnode.create_internal(
                                     load_vmt_pointer_node,
@@ -615,7 +615,7 @@ implementation
             { call AfterConstruction for classes }
             if is_class(current_structdef) then
               begin
-                srsym:=search_struct_member(current_objectdef,'AFTERCONSTRUCTION');
+                srsym:=search_struct_member(current_structdef,'AFTERCONSTRUCTION');
                 if assigned(srsym) and
                    (srsym.typ=procsym) then
                   begin
@@ -643,11 +643,11 @@ implementation
                   internalerror(200305106);
               end;
 
-            if withexceptblock then
+            if withexceptblock and (current_structdef.typ=objectdef) then
               begin
                 { Generate the implicit "fail" code for a constructor (destroy
                   in case an exception happened) }
-                pd:=current_objectdef.find_destructor;
+                pd:=tobjectdef(current_structdef).find_destructor;
                 { this will always be the case for classes, since tobject has
                   a destructor }
                 if assigned(pd) then
@@ -1390,7 +1390,7 @@ implementation
          st : TSymtable;
          old_current_structdef: tabstractrecorddef;
          old_current_genericdef,
-         old_current_specializedef : tobjectdef;
+         old_current_specializedef: tstoreddef;
       begin
          old_current_procinfo:=current_procinfo;
          old_block_type:=block_type;
@@ -1401,9 +1401,9 @@ implementation
          current_procinfo:=self;
          current_structdef:=procdef.struct;
          if assigned(current_structdef) and (df_generic in current_structdef.defoptions) then
-           current_genericdef:=tobjectdef(current_structdef);
+           current_genericdef:=current_structdef;
          if assigned(current_structdef) and (df_specialization in current_structdef.defoptions) then
-           current_specializedef:=tobjectdef(current_structdef);
+           current_specializedef:=current_structdef;
 
          { calculate the lexical level }
          if procdef.parast.symtablelevel>maxnesting then
@@ -1657,7 +1657,7 @@ implementation
         old_current_procinfo : tprocinfo;
         old_current_structdef: tabstractrecorddef;
         old_current_genericdef,
-        old_current_specializedef : tobjectdef;
+        old_current_specializedef: tstoreddef;
         pdflags    : tpdflags;
         pd,firstpd : tprocdef;
         s          : string;
@@ -1984,20 +1984,20 @@ implementation
         oldsymtablestack   : tsymtablestack;
         pu : tused_unit;
         hmodule : tmodule;
-        specobj : tobjectdef;
+        specobj : tabstractrecorddef;
       begin
         if not((tsym(p).typ=typesym) and
                (ttypesym(p).typedef.typesym=tsym(p)) and
-               (ttypesym(p).typedef.typ=objectdef) and
+               (ttypesym(p).typedef.typ in [objectdef,recorddef]) and
                (df_specialization in ttypesym(p).typedef.defoptions)
               ) then
           exit;
 
         { Setup symtablestack a definition time }
-        specobj:=tobjectdef(ttypesym(p).typedef);
+        specobj:=tabstractrecorddef(ttypesym(p).typedef);
         oldsymtablestack:=symtablestack;
         symtablestack:=tsymtablestack.create;
-        if not assigned(tobjectdef(ttypesym(p).typedef).genericdef) then
+        if not assigned(specobj.genericdef) then
           internalerror(200705151);
         hmodule:=find_module_from_symtable(specobj.genericdef.owner);
         if hmodule=nil then
@@ -2016,7 +2016,7 @@ implementation
           symtablestack.push(hmodule.localsymtable);
 
         { procedure definitions for classes or objects }
-        if is_class_or_object(specobj) then
+        if is_class_or_object(specobj) or is_record(specobj) then
           begin
             for i:=0 to specobj.symtable.DefList.Count-1 do
               begin

+ 1 - 0
compiler/psystem.pas

@@ -506,6 +506,7 @@ implementation
         nodeclass[callparan]:=ccallparanode;
         nodeclass[realconstn]:=crealconstnode;
         nodeclass[unaryminusn]:=cunaryminusnode;
+        nodeclass[unaryplusn]:=cunaryplusnode;
         nodeclass[asmn]:=casmnode;
         nodeclass[vecn]:=cvecnode;
         nodeclass[pointerconstn]:=cpointerconstnode;

+ 2 - 2
compiler/ptconst.pas

@@ -1275,8 +1275,8 @@ implementation
               exit;
             end;
 
-          { only allow nil for class and interface }
-          if is_class_or_interface_or_dispinterface_or_objc(def) then
+          { only allow nil for implicit pointer object types }
+          if is_implicit_pointer_object_type(def) then
             begin
               n:=comp_expr(true,false);
               if n.nodetype<>niln then

+ 266 - 128
compiler/ptype.pas

@@ -29,10 +29,9 @@ interface
        globtype,cclasses,
        symtype,symdef,symbase;
 
-    var
-       { hack, which allows to use the current parsed }
-       { object type as function argument type  }
-       testcurobject : byte;
+    type
+      TSingleTypeOption=(stoIsForwardDef,stoAllowTypeDef,stoParseClassParent);
+      TSingleTypeOptions=set of TSingleTypeOption;
 
     procedure resolve_forward_types;
 
@@ -40,7 +39,7 @@ interface
     procedure id_type(var def : tdef;isforwarddef:boolean);
 
     { reads a string, file type or a type identifier }
-    procedure single_type(var def:tdef;isforwarddef,allowtypedef:boolean);
+    procedure single_type(var def:tdef;options:TSingleTypeOptions);
 
     { reads any type declaration, where the resulting type will get name as type identifier }
     procedure read_named_type(var def:tdef;const name : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
@@ -51,6 +50,7 @@ interface
     { generate persistent type information like VMT, RTTI and inittables }
     procedure write_persistent_type_info(st:tsymtable);
 
+    procedure generate_specialization(var tt:tdef;parse_class_parent:boolean);
 
 implementation
 
@@ -141,7 +141,7 @@ implementation
       end;
 
 
-    procedure generate_specialization(var tt:tdef);
+    procedure generate_specialization(var tt:tdef;parse_class_parent:boolean);
       var
         st  : TSymtable;
         srsym : tsym;
@@ -182,6 +182,8 @@ implementation
               of generic and specialization might not be equally sized which
               is later assumed }
             tt:=tundefineddef.create;
+            if parse_class_parent then
+              tt:=genericdef;
             onlyparsepara:=true;
           end;
 
@@ -198,21 +200,26 @@ implementation
             exit;
           end;
 
-        consume(_LSHARPBRACKET);
+        if not try_to_consume(_LT) then
+          consume(_LSHARPBRACKET);
         { Parse generic parameters, for each undefineddef in the symtable of
           the genericdef we need to have a new def }
         err:=false;
         first:=true;
         generictypelist:=TFPObjectList.create(false);
         case genericdef.typ of
-          procdef :
+          procdef:
             st:=genericdef.GetSymtable(gs_para);
           objectdef,
-          recorddef :
+          recorddef:
             st:=genericdef.GetSymtable(gs_record);
+          arraydef:
+            st:=tarraydef(genericdef).symtable;
+          procvardef:
+            st:=genericdef.GetSymtable(gs_para);
+          else
+            internalerror(200511182);
         end;
-        if not assigned(st) then
-          internalerror(200511182);
 
         { Parse type parameters }
         if not assigned(genericdef.typesym) then
@@ -249,7 +256,7 @@ implementation
           end;
         uspecializename:=upper(specializename);
         { force correct error location if too much type parameters are passed }
-        if token<>_RSHARPBRACKET then
+        if not (token in [_RSHARPBRACKET,_GT]) then
           consume(_RSHARPBRACKET);
 
         { Special case if we are referencing the current defined object }
@@ -322,17 +329,31 @@ implementation
                 read_named_type(tt,specializename,genericdef,generictypelist,false);
                 ttypesym(srsym).typedef:=tt;
                 tt.typesym:=srsym;
+
+                case tt.typ of
+                  { Build VMT indexes for classes }
+                  objectdef:
+                    begin
+                      vmtbuilder:=TVMTBuilder.Create(tobjectdef(tt));
+                      vmtbuilder.generate_vmt;
+                      vmtbuilder.free;
+                    end;
+                  { handle params, calling convention, etc }
+                  procvardef:
+                    begin
+                      if not check_proc_directive(true) then
+                        begin
+                          try_consume_hintdirective(ttypesym(srsym).symoptions,ttypesym(srsym).deprecatedmsg);
+                          consume(_SEMICOLON);
+                        end;
+                      parse_var_proc_directives(ttypesym(srsym));
+                      handle_calling_convention(tprocvardef(tt));
+                      if try_consume_hintdirective(ttypesym(srsym).symoptions,ttypesym(srsym).deprecatedmsg) then
+                        consume(_SEMICOLON);
+                    end;
+                end;
                 { Consume the semicolon if it is also recorded }
                 try_to_consume(_SEMICOLON);
-
-
-                { Build VMT indexes for classes }
-                if (tt.typ=objectdef) then
-                  begin
-                    vmtbuilder:=TVMTBuilder.Create(tobjectdef(tt));
-                    vmtbuilder.generate_vmt;
-                    vmtbuilder.free;
-                  end;
               end;
 
             { Restore symtablestack }
@@ -358,7 +379,8 @@ implementation
           end;
 
         generictypelist.free;
-        consume(_RSHARPBRACKET);
+        if not try_to_consume(_GT) then
+          consume(_RSHARPBRACKET);
       end;
 
 
@@ -382,18 +404,14 @@ implementation
             - classes can be used also in classes
             - objects can be parameters }
          structdef:=current_structdef;
-         while Assigned(structdef) and (structdef.typ in [objectdef,recorddef]) do
+         while assigned(structdef) and (structdef.typ in [objectdef,recorddef]) do
            begin
-             if (structdef.objname^=pattern) and
-                (
-                  (testcurobject=2) or
-                  is_class_or_interface_or_objc(structdef)
-                ) then
-                begin
-                  consume(_ID);
-                  def:=structdef;
-                  exit;
-                end;
+             if (structdef.objname^=pattern) then
+               begin
+                 consume(_ID);
+                 def:=structdef;
+                 exit;
+               end;
              structdef:=tabstractrecorddef(structdef.owner.defowner);
            end;
          { Use the special searchsym_type that ignores records and parameters }
@@ -445,7 +463,7 @@ implementation
       end;
 
 
-    procedure single_type(var def:tdef;isforwarddef,allowtypedef:boolean);
+    procedure single_type(var def:tdef;options:TSingleTypeOptions);
        var
          t2 : tdef;
          dospecialize,
@@ -456,17 +474,17 @@ implementation
            again:=false;
              case token of
                _STRING:
-                 string_dec(def,allowtypedef);
+                 string_dec(def,stoAllowTypeDef in options);
 
                _FILE:
                  begin
                     consume(_FILE);
                     if (token=_OF) then
                       begin
-                         if not(allowtypedef) then
+                         if not(stoAllowTypeDef in options) then
                            Message(parser_e_no_local_para_def);
                          consume(_OF);
-                         single_type(t2,false,false);
+                         single_type(t2,[]);
                          if is_managed_type(t2) then
                            Message(parser_e_no_refcounted_typed_file);
                          def:=tfiledef.createtyped(t2);
@@ -479,7 +497,7 @@ implementation
                  begin
                    if try_to_consume(_SPECIALIZE) then
                      begin
-                       if not(allowtypedef) then
+                       if not(stoAllowTypeDef in options) then
                          begin
                            Message(parser_e_no_local_para_def);
 
@@ -496,7 +514,7 @@ implementation
                      end
                    else
                      begin
-                       id_type(def,isforwarddef);
+                       id_type(def,stoIsForwardDef in options);
                        { handle types inside classes, e.g. TNode.TLongint }
                        while (token=_POINT) do
                          begin
@@ -509,7 +527,7 @@ implementation
                               begin
                                 symtablestack.push(tabstractrecorddef(def).symtable);
                                 consume(_POINT);
-                                id_type(t2,isforwarddef);
+                                id_type(t2,stoIsForwardDef in options);
                                 symtablestack.pop(tabstractrecorddef(def).symtable);
                                 def:=t2;
                               end
@@ -526,8 +544,10 @@ implementation
                  end;
             end;
         until not again;
+        if (stoAllowTypeDef in options)and(m_delphi in current_settings.modeswitches) then
+          dospecialize:=token=_LSHARPBRACKET;
         if dospecialize then
-          generate_specialization(def)
+          generate_specialization(def,stoParseClassParent in options)
         else
           begin
             if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
@@ -583,7 +603,6 @@ implementation
           Exit;
 
         current_structdef.symtable.currentvisibility:=vis_public;
-        testcurobject:=1;
         fields_allowed:=true;
         is_classdef:=false;
         classfields:=false;
@@ -842,17 +861,24 @@ implementation
               consume(_ID); { Give a ident expected message, like tp7 }
           end;
         until false;
-
-        testcurobject:=0;
       end;
 
     { reads a record declaration }
-    function record_dec(const n:tidstring):tdef;
+    function record_dec(const n:tidstring;genericdef:tstoreddef;genericlist:TFPObjectList):tdef;
       var
-         old_current_structdef : tabstractrecorddef;
-         recst : trecordsymtable;
+         old_current_structdef: tabstractrecorddef;
+         old_current_genericdef,
+         old_current_specializedef: tstoreddef;
+         old_parse_generic: boolean;
+         recst: trecordsymtable;
       begin
          old_current_structdef:=current_structdef;
+         old_current_genericdef:=current_genericdef;
+         old_current_specializedef:=current_specializedef;
+         old_parse_generic:=parse_generic;
+
+         current_genericdef:=nil;
+         current_specializedef:=nil;
          { create recdef }
          recst:=trecordsymtable.create(n,current_settings.packrecords);
          current_structdef:=trecorddef.create(n,recst);
@@ -861,20 +887,34 @@ implementation
          symtablestack.push(recst);
          { parse record }
          consume(_RECORD);
-         if m_extended_records in current_settings.modeswitches then
+
+         { usage of specialized type inside its generic template }
+         if assigned(genericdef) then
+           current_specializedef:=current_structdef
+         { reject declaration of generic class inside generic class }
+         else if assigned(genericlist) then
+           current_genericdef:=current_structdef;
+
+         insert_generic_parameter_types(current_structdef,genericdef,genericlist);
+         parse_generic:=(df_generic in current_structdef.defoptions);
+         if m_advanced_records in current_settings.modeswitches then
            parse_record_members
          else
            begin
-         read_record_fields([vd_record]);
-         consume(_END);
-           end;
+             read_record_fields([vd_record]);
+             consume(_END);
+            end;
          { make the record size aligned }
          recst.addalignmentpadding;
          { restore symtable stack }
          symtablestack.pop(recst);
          if trecorddef(current_structdef).is_packed and is_managed_type(current_structdef) then
            Message(type_e_no_packed_inittable);
+         { restore old state }
+         parse_generic:=old_parse_generic;
          current_structdef:=old_current_structdef;
+         current_genericdef:=old_current_genericdef;
+         current_specializedef:=old_current_specializedef;
       end;
 
 
@@ -895,7 +935,7 @@ implementation
            lv,hv   : TConstExprInt;
            old_block_type : tblock_type;
            dospecialize : boolean;
-           structdef: TDef;
+           structdef: tabstractrecorddef;
         begin
            old_block_type:=block_type;
            dospecialize:=false;
@@ -905,24 +945,19 @@ implementation
            if (token=_ID) then
              begin
                structdef:=current_structdef;
-               while Assigned(structdef) and (structdef.typ in [objectdef,recorddef]) do
+               while assigned(structdef) and (structdef.typ in [objectdef,recorddef]) do
                  begin
-                   if (tabstractrecorddef(structdef).objname^=pattern) and
-                      (
-                        (testcurobject=2) or
-                        is_class_or_interface_or_objc(structdef)
-                      ) then
-                      begin
-                        consume(_ID);
-                        def:=structdef;
-                        exit;
-                      end;
-                   structdef:=tdef(tabstractrecorddef(structdef).owner.defowner);
+                   if (structdef.objname^=pattern) then
+                     begin
+                       consume(_ID);
+                       def:=structdef;
+                       exit;
+                     end;
+                   structdef:=tabstractrecorddef(structdef.owner.defowner);
                  end;
              end;
-           { Generate a specialization? }
-           if try_to_consume(_SPECIALIZE) then
-             dospecialize:=true;
+           { Generate a specialization in FPC mode? }
+           dospecialize:=not(m_delphi in current_settings.modeswitches) and try_to_consume(_SPECIALIZE);
            { we can't accept a equal in type }
            pt1:=comp_expr(false,true);
            if not dospecialize and
@@ -978,8 +1013,11 @@ implementation
                if (pt1.nodetype=typen) then
                  begin
                    def:=ttypenode(pt1).resultdef;
+                   { Delphi mode specialization? }
+                   if (m_delphi in current_settings.modeswitches) then
+                     dospecialize:=token=_LSHARPBRACKET;
                    if dospecialize then
-                     generate_specialization(def)
+                     generate_specialization(def,false)
                    else
                      begin
                        if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
@@ -1048,7 +1086,7 @@ implementation
         end;
 
 
-      procedure array_dec(is_packed: boolean);
+      procedure array_dec(is_packed:boolean;genericdef:tstoreddef;genericlist:TFPObjectList);
         var
           lowval,
           highval   : TConstExprInt;
@@ -1091,7 +1129,17 @@ implementation
             end;
           end;
 
+        var
+          old_current_genericdef,
+          old_current_specializedef: tstoreddef;
+          old_parse_generic: boolean;
         begin
+           old_current_genericdef:=current_genericdef;
+           old_current_specializedef:=current_specializedef;
+           old_parse_generic:=parse_generic;
+
+           current_genericdef:=nil;
+           current_specializedef:=nil;
            arrdef:=nil;
            consume(_ARRAY);
            { open array? }
@@ -1187,43 +1235,165 @@ implementation
                 include(arrdef.arrayoptions,ado_IsDynamicArray);
                 def:=arrdef;
              end;
+           if assigned(arrdef) then
+             begin
+               { usage of specialized type inside its generic template }
+               if assigned(genericdef) then
+                 current_specializedef:=arrdef
+               { reject declaration of generic class inside generic class }
+               else if assigned(genericlist) then
+                 current_genericdef:=arrdef;
+               symtablestack.push(arrdef.symtable);
+               insert_generic_parameter_types(arrdef,genericdef,genericlist);
+               parse_generic:=(df_generic in arrdef.defoptions);
+             end;
            consume(_OF);
            read_anon_type(tt2,true);
            { set element type of the last array definition }
            if assigned(arrdef) then
              begin
+               symtablestack.pop(arrdef.symtable);
                arrdef.elementdef:=tt2;
                if is_packed and
                   is_managed_type(tt2) then
                  Message(type_e_no_packed_inittable);
              end;
+           { restore old state }
+           parse_generic:=old_parse_generic;
+           current_genericdef:=old_current_genericdef;
+           current_specializedef:=old_current_specializedef;
         end;
 
+        function procvar_dec(genericdef:tstoreddef;genericlist:TFPObjectList):tdef;
+          var
+            is_func:boolean;
+            pd:tabstractprocdef;
+            newtype:ttypesym;
+            old_current_genericdef,
+            old_current_specializedef: tstoreddef;
+            old_parse_generic: boolean;
+          begin
+            old_current_genericdef:=current_genericdef;
+            old_current_specializedef:=current_specializedef;
+            old_parse_generic:=parse_generic;
+
+            current_genericdef:=nil;
+            current_specializedef:=nil;
+
+            is_func:=(token=_FUNCTION);
+            consume(token);
+            pd:=tprocvardef.create(normal_function_level);
+
+            { usage of specialized type inside its generic template }
+            if assigned(genericdef) then
+              current_specializedef:=pd
+            { reject declaration of generic class inside generic class }
+            else if assigned(genericlist) then
+              current_genericdef:=pd;
+            symtablestack.push(pd.parast);
+            insert_generic_parameter_types(pd,genericdef,genericlist);
+            parse_generic:=(df_generic in pd.defoptions);
+            { don't allow to add defs to the symtable - use it for type param search only }
+            tparasymtable(pd.parast).readonly:=true;
+
+            if token=_LKLAMMER then
+              parse_parameter_dec(pd);
+            if is_func then
+              begin
+                consume(_COLON);
+                single_type(pd.returndef,[]);
+              end;
+            if try_to_consume(_OF) then
+              begin
+                consume(_OBJECT);
+                include(pd.procoptions,po_methodpointer);
+              end
+            else if (m_nested_procvars in current_settings.modeswitches) and
+                    try_to_consume(_IS) then
+              begin
+                consume(_NESTED);
+                pd.parast.symtablelevel:=normal_function_level+1;
+                pd.check_mark_as_nested;
+              end;
+            symtablestack.pop(pd.parast);
+            tparasymtable(pd.parast).readonly:=false;
+            result:=pd;
+            { possible proc directives }
+            if parseprocvardir then
+              begin
+                if check_proc_directive(true) then
+                  begin
+                    newtype:=ttypesym.create('unnamed',result);
+                    parse_var_proc_directives(tsym(newtype));
+                    newtype.typedef:=nil;
+                    result.typesym:=nil;
+                    newtype.free;
+                  end;
+                { Add implicit hidden parameters and function result }
+                handle_calling_convention(pd);
+              end;
+            { restore old state }
+            parse_generic:=old_parse_generic;
+            current_genericdef:=old_current_genericdef;
+            current_specializedef:=old_current_specializedef;
+          end;
+
+      const
+        SingleTypeOptionsInTypeBlock:array[Boolean] of TSingleTypeOptions = ([],[stoIsForwardDef]);
       var
         p  : tnode;
         hdef : tdef;
-        pd : tabstractprocdef;
-        is_func,
-        enumdupmsg, first : boolean;
-        newtype : ttypesym;
+        enumdupmsg, first, is_specialize : boolean;
         oldlocalswitches : tlocalswitches;
         bitpacking: boolean;
+        stitem: psymtablestackitem;
+        sym: tsym;
+        st: tsymtable;
       begin
          def:=nil;
          case token of
             _STRING,_FILE:
               begin
-                single_type(def,false,true);
+                single_type(def,[stoAllowTypeDef]);
               end;
            _LKLAMMER:
               begin
                 consume(_LKLAMMER);
-                first := true;
+                first:=true;
                 { allow negativ value_str }
                 l:=int64(-1);
                 enumdupmsg:=false;
-                aktenumdef:=tenumdef.create;
+                { check that we are not adding an enum from specialization
+                  we can't just use current_specializedef because of inner types
+                  like specialize array of record }
+                is_specialize:=false;
+                stitem:=symtablestack.stack;
+                while assigned(stitem) do
+                  begin
+                    { check records, classes and arrays because they can be specialized }
+                    if stitem^.symtable.symtabletype in [recordsymtable,ObjectSymtable,arraysymtable] then
+                      begin
+                        is_specialize:=is_specialize or (df_specialization in tstoreddef(stitem^.symtable.defowner).defoptions);
+                        stitem:=stitem^.next;
+                      end
+                    else
+                      break;
+                  end;
+                if not is_specialize then
+                  aktenumdef:=tenumdef.create
+                else
+                  aktenumdef:=nil;
                 repeat
+                  { if it is a specialization then search the first enum member
+                    and get the member owner instead of just created enumdef }
+                  if not assigned(aktenumdef) then
+                    begin
+                      searchsym(pattern,sym,st);
+                      if sym.typ=enumsym then
+                        aktenumdef:=tenumsym(sym).definition
+                      else
+                        internalerror(201101021);
+                    end;
                   s:=orgpattern;
                   defpos:=current_tokenpos;
                   consume(_ID);
@@ -1266,20 +1436,24 @@ implementation
                     end
                   else
                     inc(l.svalue);
-                  first := false;
-                  storepos:=current_tokenpos;
-                  current_tokenpos:=defpos;
-                  tenumsymtable(aktenumdef.symtable).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
-                  if not (cs_scopedenums in current_settings.localswitches) then
-                    tstoredsymtable(aktenumdef.owner).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
-                  current_tokenpos:=storepos;
+                  first:=false;
+                  { don't generate enum members is this is a specialization because aktenumdef is copied from the generic type }
+                  if not is_specialize then
+                    begin
+                      storepos:=current_tokenpos;
+                      current_tokenpos:=defpos;
+                      tenumsymtable(aktenumdef.symtable).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
+                      if not (cs_scopedenums in current_settings.localswitches) then
+                        tstoredsymtable(aktenumdef.owner).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
+                      current_tokenpos:=storepos;
+                    end;
                 until not try_to_consume(_COMMA);
                 def:=aktenumdef;
                 consume(_RKLAMMER);
               end;
             _ARRAY:
               begin
-                array_dec(false);
+                array_dec(false,genericdef,genericlist);
               end;
             _SET:
               begin
@@ -1288,14 +1462,14 @@ implementation
            _CARET:
               begin
                 consume(_CARET);
-                single_type(tt2,(block_type=bt_type),false);
+                single_type(tt2,SingleTypeOptionsInTypeBlock[block_type=bt_type]);
                 def:=tpointerdef.create(tt2);
                 if tt2.typ=forwarddef then
                   current_module.checkforwarddefs.add(def);
               end;
             _RECORD:
               begin
-                def:=record_dec(name);
+                def:=record_dec(name,genericdef,genericlist);
               end;
             _PACKED,
             _BITPACKED:
@@ -1305,11 +1479,11 @@ implementation
                   (token = _BITPACKED);
                 consume(token);
                 if token=_ARRAY then
-                  array_dec(bitpacking)
+                  array_dec(bitpacking,genericdef,genericlist)
                 else if token=_SET then
                   set_dec
                 else if token=_FILE then
-                  single_type(def,false,true)
+                  single_type(def,[stoAllowTypeDef])
                 else
                   begin
                     oldpackrecords:=current_settings.packrecords;
@@ -1330,7 +1504,7 @@ implementation
                           def:=object_dec(odt_object,name,genericdef,genericlist,nil);
                         end;
                       else
-                        def:=record_dec(name);
+                        def:=record_dec(name,genericdef,genericlist);
                     end;
                     current_settings.packrecords:=oldpackrecords;
                   end;
@@ -1355,7 +1529,7 @@ implementation
                    ) then
                   begin
                     consume(_OF);
-                    single_type(hdef,(block_type=bt_type),false);
+                    single_type(hdef,SingleTypeOptionsInTypeBlock[block_type=bt_type]);
                     if is_class(hdef) or
                        is_objcclass(hdef) then
                       def:=tclassrefdef.create(hdef)
@@ -1427,49 +1601,13 @@ implementation
             _PROCEDURE,
             _FUNCTION:
               begin
-                is_func:=(token=_FUNCTION);
-                consume(token);
-                pd:=tprocvardef.create(normal_function_level);
-                if token=_LKLAMMER then
-                  parse_parameter_dec(pd);
-                if is_func then
-                 begin
-                   consume(_COLON);
-                   single_type(pd.returndef,false,false);
-                 end;
-                if try_to_consume(_OF) then
-                  begin
-                    consume(_OBJECT);
-                    include(pd.procoptions,po_methodpointer);
-                  end
-                else if (m_nested_procvars in current_settings.modeswitches) and
-                        try_to_consume(_IS) then
-                  begin
-                    consume(_NESTED);
-                    pd.parast.symtablelevel:=normal_function_level+1;
-                    pd.check_mark_as_nested;
-                  end;
-                def:=pd;
-                { possible proc directives }
-                if parseprocvardir then
-                  begin
-                    if check_proc_directive(true) then
-                      begin
-                         newtype:=ttypesym.create('unnamed',def);
-                         parse_var_proc_directives(tsym(newtype));
-                         newtype.typedef:=nil;
-                         def.typesym:=nil;
-                         newtype.free;
-                      end;
-                    { Add implicit hidden parameters and function result }
-                    handle_calling_convention(pd);
-                  end;
+                def:=procvar_dec(genericdef,genericlist);
               end;
             else
               if (token=_KLAMMERAFFE) and (m_iso in current_settings.modeswitches) then
                 begin
                   consume(_KLAMMERAFFE);
-                  single_type(tt2,(block_type=bt_type),false);
+                  single_type(tt2,SingleTypeOptionsInTypeBlock[block_type=bt_type]);
                   def:=tpointerdef.create(tt2);
                   if tt2.typ=forwarddef then
                     current_module.checkforwarddefs.add(def);

+ 2 - 2
compiler/rautils.pas

@@ -696,7 +696,7 @@ end;
 Function TOperand.SetupSelf:boolean;
 Begin
   SetupSelf:=false;
-  if assigned(current_objectdef) then
+  if assigned(current_structdef) then
     SetupSelf:=setupvar('self',false)
   else
     Message(asmr_e_cannot_use_SELF_outside_a_method);
@@ -1307,7 +1307,7 @@ Begin
   base:=Copy(s,1,i-1);
   delete(s,1,i);
   if base='SELF' then
-   st:=current_objectdef.symtable
+   st:=current_structdef.symtable
   else
    begin
      asmsearchsym(base,sym,srsymtable);

+ 6 - 0
compiler/scandir.pas

@@ -946,6 +946,11 @@ unit scandir;
       recordpendingverbosityfullswitch(switchesstatestack[switchesstatestackpos].verbosity);
     end;
 
+    procedure dir_pointermath;
+      begin
+        do_localswitch(cs_pointermath);
+      end;
+
     procedure dir_profile;
       begin
         do_moduleswitch(cs_profile);
@@ -1450,6 +1455,7 @@ unit scandir;
         AddDirective('PACKSET',directive_all, @dir_packset);
         AddDirective('PASCALMAINNAME',directive_all, @dir_pascalmainname);
         AddDirective('PIC',directive_all, @dir_pic);
+        AddDirective('POINTERMATH',directive_all, @dir_pointermath);
         AddDirective('POP',directive_all, @dir_pop);
         AddDirective('PROFILE',directive_all, @dir_profile);
         AddDirective('PUSH',directive_all, @dir_push);

+ 33 - 17
compiler/scanner.pas

@@ -378,6 +378,20 @@ implementation
                  include(init_settings.moduleswitches,cs_support_goto);
              end;
 
+           { support pointer math by default in fpc/objfpc modes }
+           if ([m_fpc,m_objfpc] * current_settings.modeswitches <> []) then
+             begin
+               include(current_settings.localswitches,cs_pointermath);
+               if changeinit then
+                 include(init_settings.localswitches,cs_pointermath);
+             end
+           else
+             begin
+               exclude(current_settings.localswitches,cs_pointermath);
+               if changeinit then
+                 exclude(init_settings.localswitches,cs_pointermath);
+             end;
+
            { Default enum and set packing for delphi/tp7 }
            if (m_tp7 in current_settings.modeswitches) or
               (m_delphi in current_settings.modeswitches) then
@@ -2045,18 +2059,20 @@ In case not, the value returned can be arbitrary.
 
     procedure tscannerfile.recordtoken;
       var
-        a : array[0..1] of byte;
+        t : ttoken;
+        s : tspecialgenerictoken;
         len : sizeint;
       begin
         if not assigned(recordtokenbuf) then
           internalerror(200511176);
+        t:=_GENERICSPECIALTOKEN;
         { settings changed? }
         if CompareByte(current_settings,last_settings,sizeof(current_settings))<>0 then
           begin
             { use a special token to record it }
-            a[0]:=byte(_GENERICSPECIALTOKEN);
-            a[1]:=byte(ST_LOADSETTINGS);
-            recordtokenbuf.write(a,2);
+            s:=ST_LOADSETTINGS;
+            recordtokenbuf.write(t,SizeOf(t));
+            recordtokenbuf.write(s,1);
             recordtokenbuf.write(current_settings,sizeof(current_settings));
             last_settings:=current_settings;
           end;
@@ -2064,32 +2080,32 @@ In case not, the value returned can be arbitrary.
         { file pos changes? }
         if current_tokenpos.line<>last_filepos.line then
           begin
-            a[0]:=byte(_GENERICSPECIALTOKEN);
-            a[1]:=byte(ST_LINE);
-            recordtokenbuf.write(a,2);
+            s:=ST_LINE;
+            recordtokenbuf.write(t,SizeOf(t));
+            recordtokenbuf.write(s,1);
             recordtokenbuf.write(current_tokenpos.line,sizeof(current_tokenpos.line));
             last_filepos.line:=current_tokenpos.line;
           end;
         if current_tokenpos.column<>last_filepos.column then
           begin
-            a[0]:=byte(_GENERICSPECIALTOKEN);
-            a[1]:=byte(ST_COLUMN);
-            recordtokenbuf.write(a,2);
+            s:=ST_COLUMN;
+            recordtokenbuf.write(t,SizeOf(t));
+            recordtokenbuf.write(s,1);
             recordtokenbuf.write(current_tokenpos.column,sizeof(current_tokenpos.column));
             last_filepos.column:=current_tokenpos.column;
           end;
         if current_tokenpos.fileindex<>last_filepos.fileindex then
           begin
-            a[0]:=byte(_GENERICSPECIALTOKEN);
-            a[1]:=byte(ST_FILEINDEX);
-            recordtokenbuf.write(a,2);
+            s:=ST_FILEINDEX;
+            recordtokenbuf.write(t,SizeOf(t));
+            recordtokenbuf.write(s,1);
             recordtokenbuf.write(current_tokenpos.fileindex,sizeof(current_tokenpos.fileindex));
             last_filepos.fileindex:=current_tokenpos.fileindex;
           end;
 
-        recordtokenbuf.write(token,1);
+        recordtokenbuf.write(token,SizeOf(token));
         if token=_ID then
-          recordtokenbuf.write(idtoken,1);
+          recordtokenbuf.write(idtoken,SizeOf(idtoken));
         case token of
           _CWCHAR,
           _CWSTRING :
@@ -2168,9 +2184,9 @@ In case not, the value returned can be arbitrary.
           end;
         repeat
           { load token from the buffer }
-          replaytokenbuf.read(token,1);
+          replaytokenbuf.read(token,SizeOf(token));
           if token=_ID then
-            replaytokenbuf.read(idtoken,1)
+            replaytokenbuf.read(idtoken,SizeOf(idtoken))
           else
             idtoken:=_NOID;
           case token of

+ 18 - 10
compiler/symconst.pas

@@ -90,8 +90,8 @@ const
   mkClassFunction    = 5;
   mkClassConstructor = 6;
   mkClassDestructor  = 7;
+  mkOperatorOverload = 8;
 // delphi has the next too:
-//mkOperatorOverload = 8;
 //mkSafeProcedure    = 9;
 //mkSafeFunction     = 10;
 
@@ -156,13 +156,13 @@ type
 
   { symbol options }
   tsymoption=(sp_none,
-    sp_static,
+    sp_static,              { static symbol in class/object/record }
     sp_hint_deprecated,
     sp_hint_platform,
     sp_hint_library,
     sp_hint_unimplemented,
     sp_has_overloaded,
-    sp_internal,  { internal symbol, not reported as unused }
+    sp_internal,            { internal symbol, not reported as unused }
     sp_implicitrename,
     sp_hint_experimental,
     sp_generic_para,
@@ -436,13 +436,21 @@ type
   );
 
   { types of the symtables }
-  TSymtabletype = (abstracTSymtable,
-    globalsymtable,staticsymtable,
-    ObjectSymtable,recordsymtable,
-    localsymtable,parasymtable,
-    withsymtable,stt_excepTSymtable,
-    exportedmacrosymtable, localmacrosymtable,
-    enumsymtable
+  TSymtabletype = (
+    abstractsymtable,      { not a real symtable             }
+    globalsymtable,        { unit interface symtable         }
+    staticsymtable,        { unit implementation symtable    }
+    ObjectSymtable,        { object symtable                 }
+    recordsymtable,        { record symtable                 }
+    localsymtable,         { subroutine symtable             }
+    parasymtable,          { arguments symtable              }
+    withsymtable,          { with operator symtable          }
+    stt_excepTSymtable,    { try/except symtable             }
+    exportedmacrosymtable, { }
+    localmacrosymtable,    { }
+    enumsymtable,          { symtable for enum members       }
+    arraysymtable          { used to store parameterised type
+                             in array                        }
   );
 
 

+ 47 - 39
compiler/symdef.pas

@@ -161,6 +161,7 @@ interface
 
        tpointerdef = class(tabstractpointerdef)
           is_far : boolean;
+          has_pointer_math : boolean;
           constructor create(def:tdef);
           constructor createfar(def:tdef);
           function getcopy:tstoreddef;override;
@@ -174,8 +175,8 @@ interface
 
        tabstractrecorddef= class(tstoreddef)
           objname,
-          objrealname: PShortString;
-          symtable : TSymtable;
+          objrealname    : PShortString;
+          symtable       : TSymtable;
           cloneddef      : tabstractrecorddef;
           cloneddefderef : tderef;
           objectoptions  : tobjectoptions;
@@ -323,8 +324,6 @@ interface
           procedure register_maybe_created_object_type;
           procedure register_created_classref_type;
           procedure register_vmt_call(index:longint);
-          { ObjC & C++ }
-          procedure make_all_methods_external;
           { ObjC }
           procedure finish_objc_data;
           function check_objc_types: boolean;
@@ -345,12 +344,13 @@ interface
 
        tarraydef = class(tstoreddef)
           lowrange,
-          highrange  : aint;
-          rangedef   : tdef;
+          highrange     : aint;
+          rangedef      : tdef;
           rangedefderef : tderef;
-          arrayoptions : tarraydefoptions;
+          arrayoptions  : tarraydefoptions;
+          symtable      : TSymtable;
        protected
-          _elementdef : tdef;
+          _elementdef      : tdef;
           _elementdefderef : tderef;
           procedure setelementdef(def:tdef);
        public
@@ -358,8 +358,9 @@ interface
           function elepackedbitsize : aint;
           function elecount : aword;
           constructor create_from_pointer(def:tdef);
-          constructor create(l,h : aint;def:tdef);
+          constructor create(l,h:aint;def:tdef);
           constructor ppuload(ppufile:tcompilerppufile);
+          destructor destroy; override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
@@ -563,6 +564,7 @@ interface
           function  objcmangledname : string;
           function  is_methodpointer:boolean;override;
           function  is_addressonly:boolean;override;
+          procedure make_external;
        end;
 
        { single linked list of overloaded procs }
@@ -641,13 +643,12 @@ interface
        end;
 
     var
-       current_structdef: tabstractrecorddef;
-       current_objectdef : tobjectdef absolute current_structdef;  { used for private functions check !! }
-       current_genericdef : tobjectdef; { used to reject declaration of generic class inside generic class }
-       current_specializedef : tobjectdef; { used to implement usage of generic class in itself }
+       current_structdef: tabstractrecorddef; { used for private functions check !! }
+       current_genericdef: tstoreddef;        { used to reject declaration of generic class inside generic class }
+       current_specializedef: tstoreddef;     { used to implement usage of generic class in itself }
 
     { default types }
-       generrordef,              { error in definition }
+       generrordef,               { error in definition }
        voidpointertype,           { pointer for Void-pointeddef }
        charpointertype,           { pointer for Char-pointeddef }
        widecharpointertype,       { pointer for WideChar-pointeddef }
@@ -786,7 +787,7 @@ interface
     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;
+    function is_implicit_pointer_object_type(def: tdef): boolean;
     function is_class_or_object(def: tdef): boolean;
     function is_record(def: tdef): boolean;
 
@@ -1158,7 +1159,7 @@ implementation
           procvardef :
             is_intregable:=tprocvardef(self).is_addressonly;
           objectdef:
-            is_intregable:=(is_class_or_interface_or_dispinterface_or_objc(self)) and not needs_inittable;
+            is_intregable:=(is_implicit_pointer_object_type(self)) and not needs_inittable;
           setdef:
             is_intregable:=is_smallset(self);
           recorddef:
@@ -2088,6 +2089,7 @@ implementation
       begin
         inherited create(pointerdef,def);
         is_far:=false;
+        has_pointer_math:=cs_pointermath in current_settings.localswitches;
       end;
 
 
@@ -2095,6 +2097,7 @@ implementation
       begin
         inherited create(pointerdef,def);
         is_far:=true;
+        has_pointer_math:=cs_pointermath in current_settings.localswitches;
       end;
 
 
@@ -2102,6 +2105,7 @@ implementation
       begin
          inherited ppuload(pointerdef,ppufile);
          is_far:=(ppufile.getbyte<>0);
+         has_pointer_math:=(ppufile.getbyte<>0);
       end;
 
 
@@ -2115,6 +2119,7 @@ implementation
         else
           result:=tpointerdef.create(pointeddef);
         tpointerdef(result).is_far:=is_far;
+        tpointerdef(result).has_pointer_math:=has_pointer_math;
         tpointerdef(result).savesize:=savesize;
       end;
 
@@ -2123,6 +2128,7 @@ implementation
       begin
          inherited ppuwrite(ppufile);
          ppufile.putbyte(byte(is_far));
+         ppufile.putbyte(byte(has_pointer_math));
          ppufile.writeentry(ibpointerdef);
       end;
 
@@ -2328,7 +2334,7 @@ implementation
                            TARRAYDEF
 ***************************************************************************}
 
-    constructor tarraydef.create(l,h : aint;def:tdef);
+    constructor tarraydef.create(l,h:aint;def:tdef);
       begin
          inherited create(arraydef);
          lowrange:=l;
@@ -2336,8 +2342,15 @@ implementation
          rangedef:=def;
          _elementdef:=nil;
          arrayoptions:=[];
+         symtable:=tarraysymtable.create(self);
       end;
 
+    destructor tarraydef.destroy;
+      begin
+        symtable.free;
+        symtable:=nil;
+        inherited;
+      end;
 
     constructor tarraydef.create_from_pointer(def:tdef);
       begin
@@ -2357,6 +2370,8 @@ implementation
          lowrange:=ppufile.getaint;
          highrange:=ppufile.getaint;
          ppufile.getsmallset(arrayoptions);
+         symtable:=tarraysymtable.create(self);
+         tarraysymtable(symtable).ppuload(ppufile)
       end;
 
 
@@ -2371,6 +2386,7 @@ implementation
     procedure tarraydef.buildderef;
       begin
         inherited buildderef;
+        tarraysymtable(symtable).buildderef;
         _elementdefderef.build(_elementdef);
         rangedefderef.build(rangedef);
       end;
@@ -2379,6 +2395,7 @@ implementation
     procedure tarraydef.deref;
       begin
         inherited deref;
+        tarraysymtable(symtable).deref;
         _elementdef:=tdef(_elementdefderef.resolve);
         rangedef:=tdef(rangedefderef.resolve);
       end;
@@ -2393,6 +2410,7 @@ implementation
          ppufile.putaint(highrange);
          ppufile.putsmallset(arrayoptions);
          ppufile.writeentry(ibarraydef);
+         tarraysymtable(symtable).ppuwrite(ppufile);
       end;
 
 
@@ -2636,10 +2654,10 @@ implementation
 
     function tabstractrecorddef.GetSymtable(t:tGetSymtable):TSymtable;
       begin
-         if t=gs_record then
-         GetSymtable:=symtable
+        if t=gs_record then
+          GetSymtable:=symtable
         else
-         GetSymtable:=nil;
+          GetSymtable:=nil;
       end;
 
 
@@ -3499,6 +3517,14 @@ implementation
                  not is_nested_pd(self));
       end;
 
+
+    procedure tprocdef.make_external;
+      begin
+        include(procoptions,po_external);
+        forwarddef:=false;
+      end;
+
+
     function tprocdef.GetSymtable(t:tGetSymtable):TSymtable;
       begin
         case t of
@@ -4946,24 +4972,6 @@ 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;
@@ -5531,7 +5539,7 @@ implementation
       end;
 
 
-    function is_class_or_interface_or_dispinterface_or_objc(def: tdef): boolean;
+    function is_implicit_pointer_object_type(def: tdef): boolean;
       begin
         result:=
           assigned(def) and

+ 70 - 19
compiler/symtable.pas

@@ -125,13 +125,17 @@ interface
        tlocalsymtable = class(tabstractlocalsymtable)
        public
           constructor create(adefowner:tdef;level:byte);
-          function  checkduplicate(var hashedid:THashedIDString;sym:TSymEntry):boolean;override;
+          function checkduplicate(var hashedid:THashedIDString;sym:TSymEntry):boolean;override;
        end;
 
+       { tparasymtable }
+
        tparasymtable = class(tabstractlocalsymtable)
        public
+          readonly: boolean;
           constructor create(adefowner:tdef;level:byte);
-          function  checkduplicate(var hashedid:THashedIDString;sym:TSymEntry):boolean;override;
+          function checkduplicate(var hashedid:THashedIDString;sym:TSymEntry):boolean;override;
+          procedure insertdef(def:TDefEntry);override;
        end;
 
        tabstractuniTSymtable = class(tstoredsymtable)
@@ -183,6 +187,14 @@ interface
           constructor create(adefowner:tdef);
        end;
 
+       { tarraysymtable }
+
+       tarraysymtable = class(tstoredsymtable)
+       public
+          procedure insertdef(def:TDefEntry);override;
+          constructor create(adefowner:tdef);
+       end;
+
     var
        systemunit     : tglobalsymtable; { pointer to the system unit }
 
@@ -200,6 +212,7 @@ interface
 
 {*** Search ***}
     procedure addsymref(sym:tsym);
+    function  is_owned_by(childdef,ownerdef:tabstractrecorddef):boolean;
     function  is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
     function  is_visible_for_object(pd:tprocdef;contextobjdef:tabstractrecorddef):boolean;
     function  is_visible_for_object(sym:tsym;contextobjdef:tabstractrecorddef):boolean;
@@ -747,7 +760,11 @@ implementation
     procedure TStoredSymtable._needs_init_final(sym:TObject;arg:pointer);
       begin
          if b_needs_init_final then
-          exit;
+           exit;
+         { don't check static symbols - they can be present in structures only and 
+           always have a reference to a symbol defined on unit level }
+         if sp_static in tsym(sym).symoptions then
+           exit;
          case tsym(sym).typ of
            fieldvarsym,
            staticvarsym,
@@ -1360,6 +1377,7 @@ implementation
     constructor tparasymtable.create(adefowner:tdef;level:byte);
       begin
         inherited create('');
+        readonly:=false;
         defowner:=adefowner;
         symtabletype:=parasymtable;
         symtablelevel:=level;
@@ -1382,6 +1400,14 @@ implementation
           result:=tprocdef(defowner).struct.symtable.checkduplicate(hashedid,sym);
       end;
 
+    procedure tparasymtable.insertdef(def: TDefEntry);
+      begin
+        if readonly then
+          defowner.owner.insertdef(def)
+        else
+          inherited insertdef(def);
+      end;
+
 
 {****************************************************************************
                          TAbstractUniTSymtable
@@ -1617,6 +1643,27 @@ implementation
         defowner:=adefowner;
       end;
 
+{****************************************************************************
+                          TArraySymtable
+****************************************************************************}
+
+    procedure tarraysymtable.insertdef(def: TDefEntry);
+      begin
+        { Enums must also be available outside the record scope,
+          insert in the owner of this symtable }
+        if def.typ=enumdef then
+          defowner.owner.insertdef(def)
+        else
+          inherited insertdef(def);
+      end;
+
+    constructor tarraysymtable.create(adefowner: tdef);
+      begin
+        inherited Create('');
+        symtabletype:=arraysymtable;
+        defowner:=adefowner;
+      end;
+
 {*****************************************************************************
                              Helper Routines
 *****************************************************************************}
@@ -1714,15 +1761,14 @@ implementation
        end;
 
 
-    function is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
-
-      function is_holded_by(childdef,ownerdef: tabstractrecorddef): boolean;
-        begin
-          result:=childdef=ownerdef;
-          if not result and (childdef.owner.symtabletype in [ObjectSymtable,recordsymtable]) then
-            result:=is_holded_by(tabstractrecorddef(childdef.owner.defowner),ownerdef);
-        end;
+    function is_owned_by(childdef,ownerdef:tabstractrecorddef):boolean;
+      begin
+        result:=childdef=ownerdef;
+        if not result and (childdef.owner.symtabletype in [ObjectSymtable,recordsymtable]) then
+          result:=is_owned_by(tabstractrecorddef(childdef.owner.defowner),ownerdef);
+      end;
 
+    function is_visible_for_object(symst:tsymtable;symvisibility:tvisibility;contextobjdef:tabstractrecorddef):boolean;
       var
         symownerdef : tabstractrecorddef;
       begin
@@ -1760,13 +1806,13 @@ implementation
           vis_strictprivate :
             begin
               result:=assigned(current_structdef) and
-                      is_holded_by(current_structdef,symownerdef);
+                      is_owned_by(current_structdef,symownerdef);
             end;
           vis_strictprotected :
             begin
                result:=assigned(current_structdef) and
                        (current_structdef.is_related(symownerdef) or
-                        is_holded_by(current_structdef,symownerdef));
+                        is_owned_by(current_structdef,symownerdef));
             end;
           vis_protected :
             begin
@@ -1919,11 +1965,11 @@ implementation
                 while assigned(classh) do
                   begin
                     srsymtable:=classh.symtable;
-                srsym:=tsym(srsymtable.FindWithHash(hashedid));
-                if assigned(srsym) and
-                       not(srsym.typ in [fieldvarsym,paravarsym,propertysym,procsym,labelsym]) and
-                       is_visible_for_object(srsym,current_structdef) then
-                  begin
+                    srsym:=tsym(srsymtable.FindWithHash(hashedid));
+                     if assigned(srsym) and
+                        not(srsym.typ in [fieldvarsym,paravarsym,propertysym,procsym,labelsym]) and
+                        is_visible_for_object(srsym,current_structdef) then
+                       begin
                         addsymref(srsym);
                         result:=true;
                         exit;
@@ -1932,7 +1978,6 @@ implementation
                   end;
               end
             else
-            if srsymtable.symtabletype<>parasymtable then
               begin
                 srsym:=tsym(srsymtable.FindWithHash(hashedid));
                 if assigned(srsym) and 
@@ -2059,6 +2104,12 @@ implementation
                    is_objcclass(ttypesym(srsym).typedef) and
                    not(oo_is_formal in tobjectdef(ttypesym(srsym).typedef).objectoptions) then
                   begin
+                    { the external name for the formal and the real definition must match }
+                    if tobjectdef(ttypesym(srsym).typedef).objextname^<>pd.objextname^ then
+                      begin
+                        Message2(sym_e_external_class_name_mismatch1,pd.objextname^,pd.typename);
+                        MessagePos1(srsym.fileinfo,sym_e_external_class_name_mismatch2,tobjectdef(ttypesym(srsym).typedef).objextname^);
+                      end;
                     result:=tobjectdef(ttypesym(srsym).typedef);
                     if assigned(current_procinfo) and
                        (srsym.owner.symtabletype=staticsymtable) then

+ 1 - 0
compiler/symtype.pas

@@ -228,6 +228,7 @@ implementation
               end;
             recordsymtable,
             enumsymtable,
+            arraysymtable,
             localsymtable,
             parasymtable,
             ObjectSymtable :

+ 17 - 12
compiler/utils/ppudump.pp

@@ -871,6 +871,7 @@ type
     mask : tdefstate;
     str  : string[30];
   end;
+  ptoken=^ttoken;
 const
   defopt : array[1..ord(high(tdefoption))] of tdefopt=(
      (mask:df_unique;         str:'Unique Type'),
@@ -893,6 +894,7 @@ var
   first  : boolean;
   tokenbufsize : longint;
   tokenbuf : pbyte;
+  token : ttoken;
   len : sizeint;
   wstring : widestring;
   astring : ansistring;
@@ -945,13 +947,14 @@ begin
       write(space,' Tokens: ');
       while i<tokenbufsize do
         begin
-          if ttoken(tokenbuf[i])<>_GENERICSPECIALTOKEN then
-            write(arraytokeninfo[ttoken(tokenbuf[i])].str);
-          case ttoken(tokenbuf[i]) of
+          token:=ptoken(@tokenbuf[i])^;
+          if token<>_GENERICSPECIALTOKEN then
+            write(arraytokeninfo[token].str);
+          inc(i,SizeOf(token));
+          case token of
             _CWCHAR,
             _CWSTRING :
               begin
-                inc(i);
                 len:=psizeint(@tokenbuf[i])^;
                 inc(i,sizeof(sizeint));
                 setlength(wstring,len);
@@ -961,7 +964,6 @@ begin
               end;
             _CSTRING:
               begin
-                inc(i);
                 len:=psizeint(@tokenbuf[i])^;
                 inc(i,sizeof(sizeint));
                 setlength(astring,len);
@@ -973,14 +975,12 @@ begin
             _INTCONST,
             _REALNUMBER :
               begin
-                inc(i);
                 write(' ',pshortstring(@tokenbuf[i])^);
                 inc(i,tokenbuf[i]+1);
               end;
             _ID :
               begin
-                inc(i);
-                inc(i);
+                inc(i,SizeOf(ttoken)); // idtoken
                 write(' ',pshortstring(@tokenbuf[i])^);
                 inc(i,tokenbuf[i]+1);
               {
@@ -991,7 +991,6 @@ begin
               end;
             _GENERICSPECIALTOKEN:
               begin
-                inc(i);
                 case tspecialgenerictoken(tokenbuf[i]) of
                   ST_LOADSETTINGS:
                     begin
@@ -1031,8 +1030,6 @@ begin
                 continue;
               }
               end;
-            else
-              inc(i);
           end;
 
           if i<tokenbufsize then
@@ -1933,6 +1930,7 @@ begin
              write  (space,'     Pointed Type : ');
              readderef('');
              writeln(space,'           Is Far : ',(getbyte<>0));
+             writeln(space,' Has Pointer Math : ',(getbyte<>0));
            end;
 
          iborddef :
@@ -1978,6 +1976,8 @@ begin
              writeln(space,'            Range : ',getaint,' to ',getaint);
              write  (space,'          Options : ');
              readarraydefoptions;
+             readdefinitions('symbols');
+             readsymbols('symbols');
            end;
 
          ibprocdef :
@@ -2075,6 +2075,12 @@ begin
              readcommondef('WideString definition',defoptions);
              writeln(space,'           Length : ',getlongint);
            end;
+         
+         ibunicodestringdef :
+           begin
+             readcommondef('UnicodeString definition',defoptions);
+             writeln(space,'           Length : ',getlongint);
+           end;
 
          ibansistringdef :
            begin
@@ -2142,7 +2148,6 @@ begin
                   for j:=1to 16 do
                    getbyte;
                   writeln(space,'       IID String : ',getstring);
-                  writeln(space,'  Last VTable idx : ',getlongint);
                end;
 
              l:=getlongint;

+ 6 - 6
compiler/utils/samplecfg

@@ -374,6 +374,12 @@ $CPUCROSSIFDEF2
 #-Fr$FPCPATH/msg/errore.msg
 #-Fr$FPCPATH/msg/errorn.msg
 
+# searchpath for units and other system dependent things
+-Fu$FPCPATH/units/\$fpctarget
+-Fu$FPCPATH/units/\$fpctarget/*
+-Fu$FPCPATH/units/\$fpctarget/rtl
+#-Fu~/fpc/packages/base/*/units/$fpctarget;~/fpc/fcl/units/$fpctarget;~/fpc/rtl/units/$fpctarget
+
 #IFDEF FPCAPACHE_1_3
 -Fu$FPCPATH/units/\$fpctarget/httpd13/
 #ELSE
@@ -384,12 +390,6 @@ $CPUCROSSIFDEF2
 #ENDIF
 #ENDIF
 
-# searchpath for units and other system dependent things
--Fu$FPCPATH/units/\$fpctarget
--Fu$FPCPATH/units/\$fpctarget/*
--Fu$FPCPATH/units/\$fpctarget/rtl
-#-Fu~/fpc/packages/base/*/units/$fpctarget;~/fpc/fcl/units/$fpctarget;~/fpc/rtl/units/$fpctarget
-
 # searchpath for libraries
 $GCCDIR
 $GCCDIR2

+ 6 - 0
compiler/x86/aasmcpu.pas

@@ -1946,6 +1946,12 @@ implementation
                       currabsreloc:=RELOC_GOTPCREL;
                       currabsreloc32:=RELOC_GOTPCREL;
                     end
+                  else if oper[opidx]^.ref^.refaddr=addr_pic_no_got then
+                    begin
+                      currrelreloc:=RELOC_RELATIVE;
+                      currabsreloc:=RELOC_RELATIVE;
+                      currabsreloc32:=RELOC_RELATIVE;
+                    end
                   else
 {$endif x86_64}
                     begin

+ 3 - 8
compiler/x86/cgx86.pas

@@ -408,9 +408,7 @@ unit cgx86;
                   safety reasons
                 }
                 if (ref.symbol.bind=AB_LOCAL) and
-                   (ref.symbol.typ=AT_DATA) and
-                   ((target_info.system=system_x86_64_darwin) or
-                    (target_info.system=system_x86_64_solaris)) then
+                   (ref.symbol.typ=AT_DATA) then
                   begin
                     { unfortunately, RIP-based addresses don't support an index }
                     if (ref.base<>NR_NO) or
@@ -937,9 +935,7 @@ unit cgx86;
                     else if (cs_create_pic in current_settings.moduleswitches)
 {$ifdef x86_64}
                              and not((ref.symbol.bind=AB_LOCAL) and
-                                     (ref.symbol.typ=AT_DATA) and
-                                     ((target_info.system=system_x86_64_darwin) or 
-                                     (target_info.system=system_x86_64_solaris)))
+                                     (ref.symbol.typ=AT_DATA))
 {$endif x86_64}
                             then
                       begin
@@ -960,8 +956,7 @@ unit cgx86;
                       end
 {$ifdef x86_64}
                     else if (target_info.system in (systems_all_windows+[system_x86_64_darwin]))
-			 or ((target_info.system = system_x86_64_solaris) and
-                             (cs_create_pic in current_settings.moduleswitches))
+			 or (cs_create_pic in current_settings.moduleswitches)
 			 then
                       begin
                         { Win64 and Darwin/x86_64 always require RIP-relative addressing }

+ 5 - 0
ide/fpdebug.pas

@@ -517,6 +517,11 @@ const
   FrameName = '$ebp';
 {$define FrameNameKnown}
 {$endif i386}
+{$ifdef x86_64}
+const
+  FrameName = '$rbp';
+{$define FrameNameKnown}
+{$endif x86_64}
 {$ifdef m68k}
 const
   FrameName = '$fp';

+ 15 - 9
installer/install.pas

@@ -872,12 +872,16 @@ program install;
        begin
          WLibPath := false;
          DosFreeModule (Handle);
-       end
-      else
-       if DosLoadModule (@ErrPath, SizeOf (ErrPath), @BFD2EName, Handle) = 0 then
-        begin
-         WLibPath := false;
-         DosFreeModule (Handle);
+         if DosLoadModule (@ErrPath, SizeOf (ErrPath), @BFD2EName, Handle) = 0 then
+          begin
+           WLibPath := false;
+           DosFreeModule (Handle);
+          end
+         else
+          begin
+           WLibPath := true;
+           Inc (YB, 2);
+          end;
         end
        else
         begin
@@ -903,9 +907,11 @@ program install;
       if WLibPath then
        begin
          if WPath then
-          S := 'and your LIBPATH with ''' + S + '\dll'''
+          S := 'and your LIBPATH with ''' + S
          else
-          S := 'Extend your LIBPATH with ''' + S + '\dll''';
+          S := 'Extend your LIBPATH with ''' + S;
+         System.Delete (S, Length (S) - 3, 4);
+         S := S + '\dll''';
          R.Assign (2, YB - 14, 64, YB - 12);
          P := New (PStaticText, Init (R, S));
          Insert (P);
@@ -921,7 +927,7 @@ program install;
 {$ENDIF}
 
       R.Assign(2, YB - 13, 64, YB - 12);
-      P:=new(pstatictext,init(r,'To compile files enter fpc [file]'''));
+      P:=new(pstatictext,init(r,'To compile files enter ''fpc [file]'''));
       insert(P);
 
       if haside then

+ 211 - 211
packages/cocoaint/src/AnonClassDefinitionsCoredata.pas

@@ -9,217 +9,217 @@ unit AnonClassDefinitionsCoredata;
 interface
 
 type
-  Protocol = objcclass; external;
-  NSAffineTransform = objcclass; external;
-  NSData = objcclass; external;
-  NSAppleEventDescriptor = objcclass; external;
-  NSAppleEventManager = objcclass; external;
-  NSDictionary = objcclass; external;
-  NSString = objcclass; external;
-  NSURL = objcclass; external;
-  NSAppleScript = objcclass; external;
-  NSMutableData = objcclass; external;
-  NSMutableDictionary = objcclass; external;
-  NSMutableArray = objcclass; external;
-  NSArchiver = objcclass; external;
-  NSUnarchiver = objcclass; external;
-  NSIndexSet = objcclass; external;
-  NSArray = objcclass; external;
-  NSAttributedString = objcclass; external;
-  NSMutableAttributedString = objcclass; external;
-  NSAutoreleasePool = objcclass; external;
-  NSError = objcclass; external;
-  NSBundle = objcclass; external;
-  NSCache = objcclass; external;
-  NSDateComponents = objcclass; external;
-  NSLocale = objcclass; external;
-  NSTimeZone = objcclass; external;
-  NSCalendar = objcclass; external;
-  NSCalendarDate = objcclass; external;
-  NSCharacterSet = objcclass; external;
-  NSMutableCharacterSet = objcclass; external;
-  NSClassDescription = objcclass; external;
-  NSCoder = objcclass; external;
-  NSPredicateOperator = objcclass; external;
-  NSExpression = objcclass; external;
-  NSComparisonPredicate = objcclass; external;
-  NSCompoundPredicate = objcclass; external;
-  NSDistantObject = objcclass; external;
-  NSException = objcclass; external;
-  NSPort = objcclass; external;
-  NSRunLoop = objcclass; external;
-  NSPortNameServer = objcclass; external;
-  NSDistantObjectRequest = objcclass; external;
-  NSConnection = objcclass; external;
-  NSPurgeableData = objcclass; external;
-  NSDate = objcclass; external;
-  NSDateFormatter = objcclass; external;
-  NSDecimalNumber = objcclass; external;
-  NSDecimalNumberHandler = objcclass; external;
-  NSSet = objcclass; external;
-  NSDistributedLock = objcclass; external;
-  NSDistributedNotificationCenter = objcclass; external;
-  NSEnumerator = objcclass; external;
-  NSAssertionHandler = objcclass; external;
-  NSPredicate = objcclass; external;
-  NSFileHandle = objcclass; external;
-  NSPipe = objcclass; external;
-  NSDirectoryEnumerator = objcclass; external;
-  NSNumber = objcclass; external;
-  NSFileManager = objcclass; external;
-  NSFormatter = objcclass; external;
-  NSGarbageCollector = objcclass; external;
-  NSHashTable = objcclass; external;
-  NSHost = objcclass; external;
-  NSHTTPCookieInternal = objcclass; external;
-  NSHTTPCookie = objcclass; external;
-  NSHTTPCookieStorageInternal = objcclass; external;
-  NSHTTPCookieStorage = objcclass; external;
-  NSIndexPath = objcclass; external;
-  NSMutableIndexSet = objcclass; external;
-  NSMethodSignature = objcclass; external;
-  NSInvocation = objcclass; external;
-  NSKeyedArchiver = objcclass; external;
-  NSKeyedUnarchiver = objcclass; external;
-  NSLock = objcclass; external;
-  NSConditionLock = objcclass; external;
-  NSRecursiveLock = objcclass; external;
-  NSCondition = objcclass; external;
-  NSMapTable = objcclass; external;
-  NSMetadataItem = objcclass; external;
-  NSMetadataQueryAttributeValueTuple = objcclass; external;
-  NSMetadataQueryResultGroup = objcclass; external;
-  NSMetadataQuery = objcclass; external;
-  NSInputStream = objcclass; external;
-  NSOutputStream = objcclass; external;
-  NSNetService = objcclass; external;
-  NSNetServiceBrowser = objcclass; external;
-  NSOperationQueue = objcclass; external;
-  NSNotification = objcclass; external;
-  NSNotificationCenter = objcclass; external;
-  NSNotificationQueue = objcclass; external;
-  NSNull = objcclass; external;
-  NSNumberFormatter = objcclass; external;
-  NSObject = objcclass; external;
-  NSScriptObjectSpecifier = objcclass; external;
-  NSOperation = objcclass; external;
-  NSBlockOperation = objcclass; external;
-  NSInvocationOperation = objcclass; external;
-  NSOrthography = objcclass; external;
-  NSPointerArray = objcclass; external;
-  NSPointerFunctions = objcclass; external;
-  NSPortMessage = objcclass; external;
-  NSMachPort = objcclass; external;
-  NSMessagePort = objcclass; external;
-  NSSocketPort = objcclass; external;
-  NSPortCoder = objcclass; external;
-  NSMachBootstrapServer = objcclass; external;
-  NSMessagePortNameServer = objcclass; external;
-  NSSocketPortNameServer = objcclass; external;
-  NSProcessInfo = objcclass; external;
-  NSPropertyListSerialization = objcclass; external;
-  NSProtocolChecker = objcclass; external;
-  NSProxy = objcclass; external;
-  NSTimer = objcclass; external;
-  NSScanner = objcclass; external;
-  NSScriptCommandDescription = objcclass; external;
-  NSScriptClassDescription = objcclass; external;
-  NSScriptCoercionHandler = objcclass; external;
-  NSScriptCommand = objcclass; external;
-  NSScriptExecutionContext = objcclass; external;
-  NSScriptWhoseTest = objcclass; external;
-  NSIndexSpecifier = objcclass; external;
-  NSMiddleSpecifier = objcclass; external;
-  NSNameSpecifier = objcclass; external;
-  NSPositionalSpecifier = objcclass; external;
-  NSPropertySpecifier = objcclass; external;
-  NSRandomSpecifier = objcclass; external;
-  NSRangeSpecifier = objcclass; external;
-  NSRelativeSpecifier = objcclass; external;
-  NSUniqueIDSpecifier = objcclass; external;
-  NSWhoseSpecifier = objcclass; external;
-  NSCloneCommand = objcclass; external;
-  NSCloseCommand = objcclass; external;
-  NSCountCommand = objcclass; external;
-  NSCreateCommand = objcclass; external;
-  NSDeleteCommand = objcclass; external;
-  NSExistsCommand = objcclass; external;
-  NSGetCommand = objcclass; external;
-  NSMoveCommand = objcclass; external;
-  NSQuitCommand = objcclass; external;
-  NSSetCommand = objcclass; external;
-  NSMutableSet = objcclass; external;
-  NSScriptSuiteRegistry = objcclass; external;
-  NSLogicalTest = objcclass; external;
-  NSSpecifierTest = objcclass; external;
-  NSCountedSet = objcclass; external;
-  NSSortDescriptor = objcclass; external;
-  NSSpellServer = objcclass; external;
-  NSStream = objcclass; external;
-  NSMutableString = objcclass; external;
-  NSSimpleCString = objcclass; external;
-  NSConstantString = objcclass; external;
-  NSTask = objcclass; external;
-  NSTextCheckingResult = objcclass; external;
-  NSThread = objcclass; external;
-  NSUndoManager = objcclass; external;
-  NSURLAuthenticationChallenge = objcclass; external;
-  NSURLCredential = objcclass; external;
-  NSURLProtectionSpace = objcclass; external;
-  NSURLResponse = objcclass; external;
-  NSURLAuthenticationChallengeInternal = objcclass; external;
-  NSCachedURLResponseInternal = objcclass; external;
-  NSURLRequest = objcclass; external;
-  NSCachedURLResponse = objcclass; external;
-  NSURLCacheInternal = objcclass; external;
-  NSURLCache = objcclass; external;
-  NSURLConnectionInternal = objcclass; external;
-  NSURLConnection = objcclass; external;
-  NSURLCredentialInternal = objcclass; external;
-  NSURLCredentialStorageInternal = objcclass; external;
-  NSURLCredentialStorage = objcclass; external;
-  NSURLDownloadInternal = objcclass; external;
-  NSURLDownload = objcclass; external;
-  NSURLHandle = objcclass; external;
-  NSURLProtectionSpaceInternal = objcclass; external;
-  NSMutableURLRequest = objcclass; external;
-  NSURLProtocol = objcclass; external;
-  NSURLProtocolInternal = objcclass; external;
-  NSURLRequestInternal = objcclass; external;
-  NSURLResponseInternal = objcclass; external;
-  NSHTTPURLResponseInternal = objcclass; external;
-  NSHTTPURLResponse = objcclass; external;
-  NSUserDefaults = objcclass; external;
-  NSValue = objcclass; external;
-  NSValueTransformer = objcclass; external;
-  NSXMLDTD = objcclass; external;
-  NSXMLDocument = objcclass; external;
-  NSXMLDTDNode = objcclass; external;
-  NSXMLElement = objcclass; external;
-  NSXMLNode = objcclass; external;
-  NSXMLParser = objcclass; external;
-  NSAtomicStore = objcclass; external;
-  NSAtomicStoreCacheNode = objcclass; external;
-  NSEntityDescription = objcclass; external;
-  NSAttributeDescription = objcclass; external;
-  NSManagedObjectModel = objcclass; external;
-  NSManagedObjectContext = objcclass; external;
-  NSManagedObject = objcclass; external;
-  NSEntityMapping = objcclass; external;
-  NSMigrationManager = objcclass; external;
-  NSEntityMigrationPolicy = objcclass; external;
-  NSExpressionDescription = objcclass; external;
-  NSFetchRequest = objcclass; external;
-  NSFetchedPropertyDescription = objcclass; external;
-  NSFetchRequestExpression = objcclass; external;
-  NSManagedObjectID = objcclass; external;
-  NSPersistentStore = objcclass; external;
-  NSPersistentStoreCoordinator = objcclass; external;
-  NSMappingModel = objcclass; external;
-  NSMigrationContext = objcclass; external;
-  NSPropertyDescription = objcclass; external;
-  NSPropertyMapping = objcclass; external;
-  NSRelationshipDescription = objcclass; external;
+  Protocol = objcclass external;
+  NSAffineTransform = objcclass external;
+  NSData = objcclass external;
+  NSAppleEventDescriptor = objcclass external;
+  NSAppleEventManager = objcclass external;
+  NSDictionary = objcclass external;
+  NSString = objcclass external;
+  NSURL = objcclass external;
+  NSAppleScript = objcclass external;
+  NSMutableData = objcclass external;
+  NSMutableDictionary = objcclass external;
+  NSMutableArray = objcclass external;
+  NSArchiver = objcclass external;
+  NSUnarchiver = objcclass external;
+  NSIndexSet = objcclass external;
+  NSArray = objcclass external;
+  NSAttributedString = objcclass external;
+  NSMutableAttributedString = objcclass external;
+  NSAutoreleasePool = objcclass external;
+  NSError = objcclass external;
+  NSBundle = objcclass external;
+  NSCache = objcclass external;
+  NSDateComponents = objcclass external;
+  NSLocale = objcclass external;
+  NSTimeZone = objcclass external;
+  NSCalendar = objcclass external;
+  NSCalendarDate = objcclass external;
+  NSCharacterSet = objcclass external;
+  NSMutableCharacterSet = objcclass external;
+  NSClassDescription = objcclass external;
+  NSCoder = objcclass external;
+  NSPredicateOperator = objcclass external;
+  NSExpression = objcclass external;
+  NSComparisonPredicate = objcclass external;
+  NSCompoundPredicate = objcclass external;
+  NSDistantObject = objcclass external;
+  NSException = objcclass external;
+  NSPort = objcclass external;
+  NSRunLoop = objcclass external;
+  NSPortNameServer = objcclass external;
+  NSDistantObjectRequest = objcclass external;
+  NSConnection = objcclass external;
+  NSPurgeableData = objcclass external;
+  NSDate = objcclass external;
+  NSDateFormatter = objcclass external;
+  NSDecimalNumber = objcclass external;
+  NSDecimalNumberHandler = objcclass external;
+  NSSet = objcclass external;
+  NSDistributedLock = objcclass external;
+  NSDistributedNotificationCenter = objcclass external;
+  NSEnumerator = objcclass external;
+  NSAssertionHandler = objcclass external;
+  NSPredicate = objcclass external;
+  NSFileHandle = objcclass external;
+  NSPipe = objcclass external;
+  NSDirectoryEnumerator = objcclass external;
+  NSNumber = objcclass external;
+  NSFileManager = objcclass external;
+  NSFormatter = objcclass external;
+  NSGarbageCollector = objcclass external;
+  NSHashTable = objcclass external;
+  NSHost = objcclass external;
+  NSHTTPCookieInternal = objcclass external;
+  NSHTTPCookie = objcclass external;
+  NSHTTPCookieStorageInternal = objcclass external;
+  NSHTTPCookieStorage = objcclass external;
+  NSIndexPath = objcclass external;
+  NSMutableIndexSet = objcclass external;
+  NSMethodSignature = objcclass external;
+  NSInvocation = objcclass external;
+  NSKeyedArchiver = objcclass external;
+  NSKeyedUnarchiver = objcclass external;
+  NSLock = objcclass external;
+  NSConditionLock = objcclass external;
+  NSRecursiveLock = objcclass external;
+  NSCondition = objcclass external;
+  NSMapTable = objcclass external;
+  NSMetadataItem = objcclass external;
+  NSMetadataQueryAttributeValueTuple = objcclass external;
+  NSMetadataQueryResultGroup = objcclass external;
+  NSMetadataQuery = objcclass external;
+  NSInputStream = objcclass external;
+  NSOutputStream = objcclass external;
+  NSNetService = objcclass external;
+  NSNetServiceBrowser = objcclass external;
+  NSOperationQueue = objcclass external;
+  NSNotification = objcclass external;
+  NSNotificationCenter = objcclass external;
+  NSNotificationQueue = objcclass external;
+  NSNull = objcclass external;
+  NSNumberFormatter = objcclass external;
+  NSObject = objcclass external;
+  NSScriptObjectSpecifier = objcclass external;
+  NSOperation = objcclass external;
+  NSBlockOperation = objcclass external;
+  NSInvocationOperation = objcclass external;
+  NSOrthography = objcclass external;
+  NSPointerArray = objcclass external;
+  NSPointerFunctions = objcclass external;
+  NSPortMessage = objcclass external;
+  NSMachPort = objcclass external;
+  NSMessagePort = objcclass external;
+  NSSocketPort = objcclass external;
+  NSPortCoder = objcclass external;
+  NSMachBootstrapServer = objcclass external;
+  NSMessagePortNameServer = objcclass external;
+  NSSocketPortNameServer = objcclass external;
+  NSProcessInfo = objcclass external;
+  NSPropertyListSerialization = objcclass external;
+  NSProtocolChecker = objcclass external;
+  NSProxy = objcclass external;
+  NSTimer = objcclass external;
+  NSScanner = objcclass external;
+  NSScriptCommandDescription = objcclass external;
+  NSScriptClassDescription = objcclass external;
+  NSScriptCoercionHandler = objcclass external;
+  NSScriptCommand = objcclass external;
+  NSScriptExecutionContext = objcclass external;
+  NSScriptWhoseTest = objcclass external;
+  NSIndexSpecifier = objcclass external;
+  NSMiddleSpecifier = objcclass external;
+  NSNameSpecifier = objcclass external;
+  NSPositionalSpecifier = objcclass external;
+  NSPropertySpecifier = objcclass external;
+  NSRandomSpecifier = objcclass external;
+  NSRangeSpecifier = objcclass external;
+  NSRelativeSpecifier = objcclass external;
+  NSUniqueIDSpecifier = objcclass external;
+  NSWhoseSpecifier = objcclass external;
+  NSCloneCommand = objcclass external;
+  NSCloseCommand = objcclass external;
+  NSCountCommand = objcclass external;
+  NSCreateCommand = objcclass external;
+  NSDeleteCommand = objcclass external;
+  NSExistsCommand = objcclass external;
+  NSGetCommand = objcclass external;
+  NSMoveCommand = objcclass external;
+  NSQuitCommand = objcclass external;
+  NSSetCommand = objcclass external;
+  NSMutableSet = objcclass external;
+  NSScriptSuiteRegistry = objcclass external;
+  NSLogicalTest = objcclass external;
+  NSSpecifierTest = objcclass external;
+  NSCountedSet = objcclass external;
+  NSSortDescriptor = objcclass external;
+  NSSpellServer = objcclass external;
+  NSStream = objcclass external;
+  NSMutableString = objcclass external;
+  NSSimpleCString = objcclass external;
+  NSConstantString = objcclass external;
+  NSTask = objcclass external;
+  NSTextCheckingResult = objcclass external;
+  NSThread = objcclass external;
+  NSUndoManager = objcclass external;
+  NSURLAuthenticationChallenge = objcclass external;
+  NSURLCredential = objcclass external;
+  NSURLProtectionSpace = objcclass external;
+  NSURLResponse = objcclass external;
+  NSURLAuthenticationChallengeInternal = objcclass external;
+  NSCachedURLResponseInternal = objcclass external;
+  NSURLRequest = objcclass external;
+  NSCachedURLResponse = objcclass external;
+  NSURLCacheInternal = objcclass external;
+  NSURLCache = objcclass external;
+  NSURLConnectionInternal = objcclass external;
+  NSURLConnection = objcclass external;
+  NSURLCredentialInternal = objcclass external;
+  NSURLCredentialStorageInternal = objcclass external;
+  NSURLCredentialStorage = objcclass external;
+  NSURLDownloadInternal = objcclass external;
+  NSURLDownload = objcclass external;
+  NSURLHandle = objcclass external;
+  NSURLProtectionSpaceInternal = objcclass external;
+  NSMutableURLRequest = objcclass external;
+  NSURLProtocol = objcclass external;
+  NSURLProtocolInternal = objcclass external;
+  NSURLRequestInternal = objcclass external;
+  NSURLResponseInternal = objcclass external;
+  NSHTTPURLResponseInternal = objcclass external;
+  NSHTTPURLResponse = objcclass external;
+  NSUserDefaults = objcclass external;
+  NSValue = objcclass external;
+  NSValueTransformer = objcclass external;
+  NSXMLDTD = objcclass external;
+  NSXMLDocument = objcclass external;
+  NSXMLDTDNode = objcclass external;
+  NSXMLElement = objcclass external;
+  NSXMLNode = objcclass external;
+  NSXMLParser = objcclass external;
+  NSAtomicStore = objcclass external;
+  NSAtomicStoreCacheNode = objcclass external;
+  NSEntityDescription = objcclass external;
+  NSAttributeDescription = objcclass external;
+  NSManagedObjectModel = objcclass external;
+  NSManagedObjectContext = objcclass external;
+  NSManagedObject = objcclass external;
+  NSEntityMapping = objcclass external;
+  NSMigrationManager = objcclass external;
+  NSEntityMigrationPolicy = objcclass external;
+  NSExpressionDescription = objcclass external;
+  NSFetchRequest = objcclass external;
+  NSFetchedPropertyDescription = objcclass external;
+  NSFetchRequestExpression = objcclass external;
+  NSManagedObjectID = objcclass external;
+  NSPersistentStore = objcclass external;
+  NSPersistentStoreCoordinator = objcclass external;
+  NSMappingModel = objcclass external;
+  NSMigrationContext = objcclass external;
+  NSPropertyDescription = objcclass external;
+  NSPropertyMapping = objcclass external;
+  NSRelationshipDescription = objcclass external;
 
 implementation
 

+ 409 - 409
packages/cocoaint/src/AnonClassDefinitionsQuartzcore.pas

@@ -9,415 +9,415 @@ unit AnonClassDefinitionsQuartzcore;
 interface
 
 type
-  Protocol = objcclass; external;
-  NSAffineTransform = objcclass; external;
-  NSData = objcclass; external;
-  NSAppleEventDescriptor = objcclass; external;
-  NSAppleEventManager = objcclass; external;
-  NSDictionary = objcclass; external;
-  NSString = objcclass; external;
-  NSURL = objcclass; external;
-  NSAppleScript = objcclass; external;
-  NSMutableData = objcclass; external;
-  NSMutableDictionary = objcclass; external;
-  NSMutableArray = objcclass; external;
-  NSArchiver = objcclass; external;
-  NSUnarchiver = objcclass; external;
-  NSIndexSet = objcclass; external;
-  NSArray = objcclass; external;
-  NSAttributedString = objcclass; external;
-  NSMutableAttributedString = objcclass; external;
-  NSAutoreleasePool = objcclass; external;
-  NSError = objcclass; external;
-  NSBundle = objcclass; external;
-  NSCache = objcclass; external;
-  NSDateComponents = objcclass; external;
-  NSLocale = objcclass; external;
-  NSTimeZone = objcclass; external;
-  NSCalendar = objcclass; external;
-  NSCalendarDate = objcclass; external;
-  NSCharacterSet = objcclass; external;
-  NSMutableCharacterSet = objcclass; external;
-  NSClassDescription = objcclass; external;
-  NSCoder = objcclass; external;
-  NSPredicateOperator = objcclass; external;
-  NSExpression = objcclass; external;
-  NSComparisonPredicate = objcclass; external;
-  NSCompoundPredicate = objcclass; external;
-  NSDistantObject = objcclass; external;
-  NSException = objcclass; external;
-  NSPort = objcclass; external;
-  NSRunLoop = objcclass; external;
-  NSPortNameServer = objcclass; external;
-  NSDistantObjectRequest = objcclass; external;
-  NSConnection = objcclass; external;
-  NSPurgeableData = objcclass; external;
-  NSDate = objcclass; external;
-  NSDateFormatter = objcclass; external;
-  NSDecimalNumber = objcclass; external;
-  NSDecimalNumberHandler = objcclass; external;
-  NSSet = objcclass; external;
-  NSDistributedLock = objcclass; external;
-  NSDistributedNotificationCenter = objcclass; external;
-  NSEnumerator = objcclass; external;
-  NSAssertionHandler = objcclass; external;
-  NSPredicate = objcclass; external;
-  NSFileHandle = objcclass; external;
-  NSPipe = objcclass; external;
-  NSDirectoryEnumerator = objcclass; external;
-  NSNumber = objcclass; external;
-  NSFileManager = objcclass; external;
-  NSFormatter = objcclass; external;
-  NSGarbageCollector = objcclass; external;
-  NSHashTable = objcclass; external;
-  NSHost = objcclass; external;
-  NSHTTPCookieInternal = objcclass; external;
-  NSHTTPCookie = objcclass; external;
-  NSHTTPCookieStorageInternal = objcclass; external;
-  NSHTTPCookieStorage = objcclass; external;
-  NSIndexPath = objcclass; external;
-  NSMutableIndexSet = objcclass; external;
-  NSMethodSignature = objcclass; external;
-  NSInvocation = objcclass; external;
-  NSKeyedArchiver = objcclass; external;
-  NSKeyedUnarchiver = objcclass; external;
-  NSLock = objcclass; external;
-  NSConditionLock = objcclass; external;
-  NSRecursiveLock = objcclass; external;
-  NSCondition = objcclass; external;
-  NSMapTable = objcclass; external;
-  NSMetadataItem = objcclass; external;
-  NSMetadataQueryAttributeValueTuple = objcclass; external;
-  NSMetadataQueryResultGroup = objcclass; external;
-  NSMetadataQuery = objcclass; external;
-  NSInputStream = objcclass; external;
-  NSOutputStream = objcclass; external;
-  NSNetService = objcclass; external;
-  NSNetServiceBrowser = objcclass; external;
-  NSOperationQueue = objcclass; external;
-  NSNotification = objcclass; external;
-  NSNotificationCenter = objcclass; external;
-  NSNotificationQueue = objcclass; external;
-  NSNull = objcclass; external;
-  NSNumberFormatter = objcclass; external;
-  NSObject = objcclass; external;
-  NSScriptObjectSpecifier = objcclass; external;
-  NSOperation = objcclass; external;
-  NSBlockOperation = objcclass; external;
-  NSInvocationOperation = objcclass; external;
-  NSOrthography = objcclass; external;
-  NSPointerArray = objcclass; external;
-  NSPointerFunctions = objcclass; external;
-  NSPortMessage = objcclass; external;
-  NSMachPort = objcclass; external;
-  NSMessagePort = objcclass; external;
-  NSSocketPort = objcclass; external;
-  NSPortCoder = objcclass; external;
-  NSMachBootstrapServer = objcclass; external;
-  NSMessagePortNameServer = objcclass; external;
-  NSSocketPortNameServer = objcclass; external;
-  NSProcessInfo = objcclass; external;
-  NSPropertyListSerialization = objcclass; external;
-  NSProtocolChecker = objcclass; external;
-  NSProxy = objcclass; external;
-  NSTimer = objcclass; external;
-  NSScanner = objcclass; external;
-  NSScriptCommandDescription = objcclass; external;
-  NSScriptClassDescription = objcclass; external;
-  NSScriptCoercionHandler = objcclass; external;
-  NSScriptCommand = objcclass; external;
-  NSScriptExecutionContext = objcclass; external;
-  NSScriptWhoseTest = objcclass; external;
-  NSIndexSpecifier = objcclass; external;
-  NSMiddleSpecifier = objcclass; external;
-  NSNameSpecifier = objcclass; external;
-  NSPositionalSpecifier = objcclass; external;
-  NSPropertySpecifier = objcclass; external;
-  NSRandomSpecifier = objcclass; external;
-  NSRangeSpecifier = objcclass; external;
-  NSRelativeSpecifier = objcclass; external;
-  NSUniqueIDSpecifier = objcclass; external;
-  NSWhoseSpecifier = objcclass; external;
-  NSCloneCommand = objcclass; external;
-  NSCloseCommand = objcclass; external;
-  NSCountCommand = objcclass; external;
-  NSCreateCommand = objcclass; external;
-  NSDeleteCommand = objcclass; external;
-  NSExistsCommand = objcclass; external;
-  NSGetCommand = objcclass; external;
-  NSMoveCommand = objcclass; external;
-  NSQuitCommand = objcclass; external;
-  NSSetCommand = objcclass; external;
-  NSMutableSet = objcclass; external;
-  NSScriptSuiteRegistry = objcclass; external;
-  NSLogicalTest = objcclass; external;
-  NSSpecifierTest = objcclass; external;
-  NSCountedSet = objcclass; external;
-  NSSortDescriptor = objcclass; external;
-  NSSpellServer = objcclass; external;
-  NSStream = objcclass; external;
-  NSMutableString = objcclass; external;
-  NSSimpleCString = objcclass; external;
-  NSConstantString = objcclass; external;
-  NSTask = objcclass; external;
-  NSTextCheckingResult = objcclass; external;
-  NSThread = objcclass; external;
-  NSUndoManager = objcclass; external;
-  NSURLAuthenticationChallenge = objcclass; external;
-  NSURLCredential = objcclass; external;
-  NSURLProtectionSpace = objcclass; external;
-  NSURLResponse = objcclass; external;
-  NSURLAuthenticationChallengeInternal = objcclass; external;
-  NSCachedURLResponseInternal = objcclass; external;
-  NSURLRequest = objcclass; external;
-  NSCachedURLResponse = objcclass; external;
-  NSURLCacheInternal = objcclass; external;
-  NSURLCache = objcclass; external;
-  NSURLConnectionInternal = objcclass; external;
-  NSURLConnection = objcclass; external;
-  NSURLCredentialInternal = objcclass; external;
-  NSURLCredentialStorageInternal = objcclass; external;
-  NSURLCredentialStorage = objcclass; external;
-  NSURLDownloadInternal = objcclass; external;
-  NSURLDownload = objcclass; external;
-  NSURLHandle = objcclass; external;
-  NSURLProtectionSpaceInternal = objcclass; external;
-  NSMutableURLRequest = objcclass; external;
-  NSURLProtocol = objcclass; external;
-  NSURLProtocolInternal = objcclass; external;
-  NSURLRequestInternal = objcclass; external;
-  NSURLResponseInternal = objcclass; external;
-  NSHTTPURLResponseInternal = objcclass; external;
-  NSHTTPURLResponse = objcclass; external;
-  NSUserDefaults = objcclass; external;
-  NSValue = objcclass; external;
-  NSValueTransformer = objcclass; external;
-  NSXMLDTD = objcclass; external;
-  NSXMLDocument = objcclass; external;
-  NSXMLDTDNode = objcclass; external;
-  NSXMLElement = objcclass; external;
-  NSXMLNode = objcclass; external;
-  NSXMLParser = objcclass; external;
-  NSActionCell = objcclass; external;
-  NSBezierPath = objcclass; external;
-  NSTextField = objcclass; external;
-  NSPanel = objcclass; external;
-  NSWindow = objcclass; external;
-  NSImage = objcclass; external;
-  NSButton = objcclass; external;
-  NSAlert = objcclass; external;
-  NSGraphicsContext = objcclass; external;
-  NSAnimation = objcclass; external;
-  NSViewAnimation = objcclass; external;
-  NSAnimationContext = objcclass; external;
-  NSPasteboard = objcclass; external;
-  NSDockTile = objcclass; external;
-  NSApplication = objcclass; external;
-  NSArrayController = objcclass; external;
-  NSATSTypesetter = objcclass; external;
-  NSFileWrapper = objcclass; external;
-  NSTextBlock = objcclass; external;
-  NSTextTable = objcclass; external;
-  NSTextList = objcclass; external;
-  CIImage = objcclass; external;
-  NSColor = objcclass; external;
-  NSColorSpace = objcclass; external;
-  NSBitmapImageRep = objcclass; external;
-  NSFont = objcclass; external;
-  NSBox = objcclass; external;
-  NSMatrix = objcclass; external;
-  NSScroller = objcclass; external;
-  NSBrowser = objcclass; external;
-  NSBrowserCell = objcclass; external;
-  NSSound = objcclass; external;
-  NSButtonCell = objcclass; external;
-  NSCachedImageRep = objcclass; external;
-  NSEvent = objcclass; external;
-  NSMenu = objcclass; external;
-  NSText = objcclass; external;
-  NSView = objcclass; external;
-  NSTextView = objcclass; external;
-  NSCell = objcclass; external;
-  NSCIImageRep = objcclass; external;
-  NSClipView = objcclass; external;
-  NSCollectionView = objcclass; external;
-  NSNib = objcclass; external;
-  NSCollectionViewItem = objcclass; external;
-  NSColorList = objcclass; external;
-  NSColorPanel = objcclass; external;
-  NSColorPicker = objcclass; external;
-  NSColorWell = objcclass; external;
-  NSComboBox = objcclass; external;
-  NSTableView = objcclass; external;
-  NSComboBoxCell = objcclass; external;
-  NSControl = objcclass; external;
-  NSController = objcclass; external;
-  NSCursor = objcclass; external;
-  NSCustomImageRep = objcclass; external;
-  NSDatePicker = objcclass; external;
-  NSDatePickerCell = objcclass; external;
-  NSDictionaryController = objcclass; external;
-  NSMenuItem = objcclass; external;
-  NSPageLayout = objcclass; external;
-  NSPrintInfo = objcclass; external;
-  NSPrintOperation = objcclass; external;
-  NSSavePanel = objcclass; external;
-  NSWindowController = objcclass; external;
-  NSDocument = objcclass; external;
-  NSOpenPanel = objcclass; external;
-  NSDocumentController = objcclass; external;
-  NSDrawer = objcclass; external;
-  NSPDFImageRep = objcclass; external;
-  NSEPSImageRep = objcclass; external;
-  NSTrackingArea = objcclass; external;
-  NSFontDescriptor = objcclass; external;
-  NSFontPanel = objcclass; external;
-  NSFontManager = objcclass; external;
-  NSFormCell = objcclass; external;
-  NSGlyphGenerator = objcclass; external;
-  NSGlyphInfo = objcclass; external;
-  NSGradient = objcclass; external;
-  CIContext = objcclass; external;
-  NSHelpManager = objcclass; external;
-  NSImageRep = objcclass; external;
-  _NSImageAuxiliary = objcclass; external;
-  NSImageCell = objcclass; external;
-  NSImageView = objcclass; external;
-  NSInputServer = objcclass; external;
-  NSInputManager = objcclass; external;
-  NSTextStorage = objcclass; external;
-  NSTypesetter = objcclass; external;
-  NSTextContainer = objcclass; external;
-  NSRulerView = objcclass; external;
-  NSParagraphStyle = objcclass; external;
-  NSRulerMarker = objcclass; external;
-  NSTabWell = objcclass; external;
-  NSStorage = objcclass; external;
-  NSRunStorage = objcclass; external;
-  NSSortedArray = objcclass; external;
-  NSLayoutManager = objcclass; external;
-  NSLevelIndicator = objcclass; external;
-  NSLevelIndicatorCell = objcclass; external;
-  NSMenuView = objcclass; external;
-  NSMenuItemCell = objcclass; external;
-  NSScreen = objcclass; external;
-  QTMovie = objcclass; external;
-  NSMovie = objcclass; external;
-  NSMovieView = objcclass; external;
-  NSIBObjectData = objcclass; external;
-  NSNibConnector = objcclass; external;
-  NSNibControlConnector = objcclass; external;
-  NSNibOutletConnector = objcclass; external;
-  NSManagedObjectContext = objcclass; external;
-  NSFetchRequest = objcclass; external;
-  NSObjectController = objcclass; external;
-  NSOpenGLPixelFormat = objcclass; external;
-  NSOpenGLPixelBuffer = objcclass; external;
-  NSOpenGLContext = objcclass; external;
-  NSOpenGLLayer = objcclass; external;
-  NSOpenGLView = objcclass; external;
-  NSTableHeaderView = objcclass; external;
-  NSTableColumn = objcclass; external;
-  NSMouseTracker = objcclass; external;
-  NSOutlineView = objcclass; external;
-  NSViewController = objcclass; external;
-  NSTextTab = objcclass; external;
-  NSMutableParagraphStyle = objcclass; external;
-  NSPasteboardItem = objcclass; external;
-  NSPathComponentCell = objcclass; external;
-  NSPopUpButtonCell = objcclass; external;
-  NSPathCell = objcclass; external;
-  NSPathControl = objcclass; external;
-  NSManagedObjectModel = objcclass; external;
-  NSPersistentDocument = objcclass; external;
-  NSPICTImageRep = objcclass; external;
-  NSPopUpButton = objcclass; external;
-  NSPredicateTemplate = objcclass; external;
-  NSPredicateEditor = objcclass; external;
-  NSEntityDescription = objcclass; external;
-  NSPredicateEditorRowTemplate = objcclass; external;
-  NSPrinter = objcclass; external;
-  NSPrintPanel = objcclass; external;
-  NSProgressIndicator = objcclass; external;
-  NSQuickDrawView = objcclass; external;
-  NSResponder = objcclass; external;
-  NSRuleEditor = objcclass; external;
-  NSScrollView = objcclass; external;
-  NSRunningApplication = objcclass; external;
-  NSNavView = objcclass; external;
-  NSSavePanelAuxiliary = objcclass; external;
-  NSSearchField = objcclass; external;
-  NSSearchFieldCell = objcclass; external;
-  NSSecureTextField = objcclass; external;
-  NSSecureTextFieldCell = objcclass; external;
-  NSSegmentedCell = objcclass; external;
-  NSSegmentedControl = objcclass; external;
-  NSShadow = objcclass; external;
-  NSSimpleHorizontalTypesetter = objcclass; external;
-  NSSlider = objcclass; external;
-  NSSliderCell = objcclass; external;
-  NSSpeechRecognizer = objcclass; external;
-  NSSpeechSynthesizer = objcclass; external;
-  NSSpellChecker = objcclass; external;
-  NSSplitView = objcclass; external;
-  NSStatusItem = objcclass; external;
-  NSStatusBar = objcclass; external;
-  NSStepper = objcclass; external;
-  NSStepperCell = objcclass; external;
-  NSTableHeaderCell = objcclass; external;
-  NSTabViewItem = objcclass; external;
-  NSTabView = objcclass; external;
-  NSTextAttachment = objcclass; external;
-  NSTextAttachmentCell = objcclass; external;
-  NSTextFieldCell = objcclass; external;
-  NSTextInputContext = objcclass; external;
-  NSTextTableBlock = objcclass; external;
-  NSTokenField = objcclass; external;
-  NSTokenFieldCell = objcclass; external;
-  NSToolbarItem = objcclass; external;
-  NSToolbar = objcclass; external;
-  NSToolbarItemViewer = objcclass; external;
-  NSToolbarItemGroup = objcclass; external;
-  NSTouch = objcclass; external;
-  NSTreeNode = objcclass; external;
-  NSTreeController = objcclass; external;
-  NSUserDefaultsController = objcclass; external;
-  CIFilter = objcclass; external;
-  CALayer = objcclass; external;
-  _NSViewAuxiliary = objcclass; external;
-  NSWindowAuxiliary = objcclass; external;
-  NSWorkspace = objcclass; external;
-  CAMediaTimingFunction = objcclass; external;
-  CAValueFunction = objcclass; external;
-  CAAnimation = objcclass; external;
-  CAPropertyAnimation = objcclass; external;
-  CABasicAnimation = objcclass; external;
-  CAKeyframeAnimation = objcclass; external;
-  CATransition = objcclass; external;
-  CAAnimationGroup = objcclass; external;
-  CAConstraint = objcclass; external;
-  CAConstraintLayoutManager = objcclass; external;
-  CAEmitterCell = objcclass; external;
-  CAEmitterLayer = objcclass; external;
-  CAGradientLayer = objcclass; external;
-  CALayerArray = objcclass; external;
-  CAOpenGLLayer = objcclass; external;
-  CARenderer = objcclass; external;
-  CAReplicatorLayer = objcclass; external;
-  CAScrollLayer = objcclass; external;
-  CAShapeLayer = objcclass; external;
-  CATextLayer = objcclass; external;
-  CATiledLayer = objcclass; external;
-  CATransaction = objcclass; external;
-  CATransformLayer = objcclass; external;
-  CIColor = objcclass; external;
-  CIKernel = objcclass; external;
-  CIFilterGenerator = objcclass; external;
-  CIFilterShape = objcclass; external;
-  CIImageAccumulator = objcclass; external;
-  CIPlugIn = objcclass; external;
-  CISampler = objcclass; external;
-  CIVector = objcclass; external;
+  Protocol = objcclass external;
+  NSAffineTransform = objcclass external;
+  NSData = objcclass external;
+  NSAppleEventDescriptor = objcclass external;
+  NSAppleEventManager = objcclass external;
+  NSDictionary = objcclass external;
+  NSString = objcclass external;
+  NSURL = objcclass external;
+  NSAppleScript = objcclass external;
+  NSMutableData = objcclass external;
+  NSMutableDictionary = objcclass external;
+  NSMutableArray = objcclass external;
+  NSArchiver = objcclass external;
+  NSUnarchiver = objcclass external;
+  NSIndexSet = objcclass external;
+  NSArray = objcclass external;
+  NSAttributedString = objcclass external;
+  NSMutableAttributedString = objcclass external;
+  NSAutoreleasePool = objcclass external;
+  NSError = objcclass external;
+  NSBundle = objcclass external;
+  NSCache = objcclass external;
+  NSDateComponents = objcclass external;
+  NSLocale = objcclass external;
+  NSTimeZone = objcclass external;
+  NSCalendar = objcclass external;
+  NSCalendarDate = objcclass external;
+  NSCharacterSet = objcclass external;
+  NSMutableCharacterSet = objcclass external;
+  NSClassDescription = objcclass external;
+  NSCoder = objcclass external;
+  NSPredicateOperator = objcclass external;
+  NSExpression = objcclass external;
+  NSComparisonPredicate = objcclass external;
+  NSCompoundPredicate = objcclass external;
+  NSDistantObject = objcclass external;
+  NSException = objcclass external;
+  NSPort = objcclass external;
+  NSRunLoop = objcclass external;
+  NSPortNameServer = objcclass external;
+  NSDistantObjectRequest = objcclass external;
+  NSConnection = objcclass external;
+  NSPurgeableData = objcclass external;
+  NSDate = objcclass external;
+  NSDateFormatter = objcclass external;
+  NSDecimalNumber = objcclass external;
+  NSDecimalNumberHandler = objcclass external;
+  NSSet = objcclass external;
+  NSDistributedLock = objcclass external;
+  NSDistributedNotificationCenter = objcclass external;
+  NSEnumerator = objcclass external;
+  NSAssertionHandler = objcclass external;
+  NSPredicate = objcclass external;
+  NSFileHandle = objcclass external;
+  NSPipe = objcclass external;
+  NSDirectoryEnumerator = objcclass external;
+  NSNumber = objcclass external;
+  NSFileManager = objcclass external;
+  NSFormatter = objcclass external;
+  NSGarbageCollector = objcclass external;
+  NSHashTable = objcclass external;
+  NSHost = objcclass external;
+  NSHTTPCookieInternal = objcclass external;
+  NSHTTPCookie = objcclass external;
+  NSHTTPCookieStorageInternal = objcclass external;
+  NSHTTPCookieStorage = objcclass external;
+  NSIndexPath = objcclass external;
+  NSMutableIndexSet = objcclass external;
+  NSMethodSignature = objcclass external;
+  NSInvocation = objcclass external;
+  NSKeyedArchiver = objcclass external;
+  NSKeyedUnarchiver = objcclass external;
+  NSLock = objcclass external;
+  NSConditionLock = objcclass external;
+  NSRecursiveLock = objcclass external;
+  NSCondition = objcclass external;
+  NSMapTable = objcclass external;
+  NSMetadataItem = objcclass external;
+  NSMetadataQueryAttributeValueTuple = objcclass external;
+  NSMetadataQueryResultGroup = objcclass external;
+  NSMetadataQuery = objcclass external;
+  NSInputStream = objcclass external;
+  NSOutputStream = objcclass external;
+  NSNetService = objcclass external;
+  NSNetServiceBrowser = objcclass external;
+  NSOperationQueue = objcclass external;
+  NSNotification = objcclass external;
+  NSNotificationCenter = objcclass external;
+  NSNotificationQueue = objcclass external;
+  NSNull = objcclass external;
+  NSNumberFormatter = objcclass external;
+  NSObject = objcclass external;
+  NSScriptObjectSpecifier = objcclass external;
+  NSOperation = objcclass external;
+  NSBlockOperation = objcclass external;
+  NSInvocationOperation = objcclass external;
+  NSOrthography = objcclass external;
+  NSPointerArray = objcclass external;
+  NSPointerFunctions = objcclass external;
+  NSPortMessage = objcclass external;
+  NSMachPort = objcclass external;
+  NSMessagePort = objcclass external;
+  NSSocketPort = objcclass external;
+  NSPortCoder = objcclass external;
+  NSMachBootstrapServer = objcclass external;
+  NSMessagePortNameServer = objcclass external;
+  NSSocketPortNameServer = objcclass external;
+  NSProcessInfo = objcclass external;
+  NSPropertyListSerialization = objcclass external;
+  NSProtocolChecker = objcclass external;
+  NSProxy = objcclass external;
+  NSTimer = objcclass external;
+  NSScanner = objcclass external;
+  NSScriptCommandDescription = objcclass external;
+  NSScriptClassDescription = objcclass external;
+  NSScriptCoercionHandler = objcclass external;
+  NSScriptCommand = objcclass external;
+  NSScriptExecutionContext = objcclass external;
+  NSScriptWhoseTest = objcclass external;
+  NSIndexSpecifier = objcclass external;
+  NSMiddleSpecifier = objcclass external;
+  NSNameSpecifier = objcclass external;
+  NSPositionalSpecifier = objcclass external;
+  NSPropertySpecifier = objcclass external;
+  NSRandomSpecifier = objcclass external;
+  NSRangeSpecifier = objcclass external;
+  NSRelativeSpecifier = objcclass external;
+  NSUniqueIDSpecifier = objcclass external;
+  NSWhoseSpecifier = objcclass external;
+  NSCloneCommand = objcclass external;
+  NSCloseCommand = objcclass external;
+  NSCountCommand = objcclass external;
+  NSCreateCommand = objcclass external;
+  NSDeleteCommand = objcclass external;
+  NSExistsCommand = objcclass external;
+  NSGetCommand = objcclass external;
+  NSMoveCommand = objcclass external;
+  NSQuitCommand = objcclass external;
+  NSSetCommand = objcclass external;
+  NSMutableSet = objcclass external;
+  NSScriptSuiteRegistry = objcclass external;
+  NSLogicalTest = objcclass external;
+  NSSpecifierTest = objcclass external;
+  NSCountedSet = objcclass external;
+  NSSortDescriptor = objcclass external;
+  NSSpellServer = objcclass external;
+  NSStream = objcclass external;
+  NSMutableString = objcclass external;
+  NSSimpleCString = objcclass external;
+  NSConstantString = objcclass external;
+  NSTask = objcclass external;
+  NSTextCheckingResult = objcclass external;
+  NSThread = objcclass external;
+  NSUndoManager = objcclass external;
+  NSURLAuthenticationChallenge = objcclass external;
+  NSURLCredential = objcclass external;
+  NSURLProtectionSpace = objcclass external;
+  NSURLResponse = objcclass external;
+  NSURLAuthenticationChallengeInternal = objcclass external;
+  NSCachedURLResponseInternal = objcclass external;
+  NSURLRequest = objcclass external;
+  NSCachedURLResponse = objcclass external;
+  NSURLCacheInternal = objcclass external;
+  NSURLCache = objcclass external;
+  NSURLConnectionInternal = objcclass external;
+  NSURLConnection = objcclass external;
+  NSURLCredentialInternal = objcclass external;
+  NSURLCredentialStorageInternal = objcclass external;
+  NSURLCredentialStorage = objcclass external;
+  NSURLDownloadInternal = objcclass external;
+  NSURLDownload = objcclass external;
+  NSURLHandle = objcclass external;
+  NSURLProtectionSpaceInternal = objcclass external;
+  NSMutableURLRequest = objcclass external;
+  NSURLProtocol = objcclass external;
+  NSURLProtocolInternal = objcclass external;
+  NSURLRequestInternal = objcclass external;
+  NSURLResponseInternal = objcclass external;
+  NSHTTPURLResponseInternal = objcclass external;
+  NSHTTPURLResponse = objcclass external;
+  NSUserDefaults = objcclass external;
+  NSValue = objcclass external;
+  NSValueTransformer = objcclass external;
+  NSXMLDTD = objcclass external;
+  NSXMLDocument = objcclass external;
+  NSXMLDTDNode = objcclass external;
+  NSXMLElement = objcclass external;
+  NSXMLNode = objcclass external;
+  NSXMLParser = objcclass external;
+  NSActionCell = objcclass external;
+  NSBezierPath = objcclass external;
+  NSTextField = objcclass external;
+  NSPanel = objcclass external;
+  NSWindow = objcclass external;
+  NSImage = objcclass external;
+  NSButton = objcclass external;
+  NSAlert = objcclass external;
+  NSGraphicsContext = objcclass external;
+  NSAnimation = objcclass external;
+  NSViewAnimation = objcclass external;
+  NSAnimationContext = objcclass external;
+  NSPasteboard = objcclass external;
+  NSDockTile = objcclass external;
+  NSApplication = objcclass external;
+  NSArrayController = objcclass external;
+  NSATSTypesetter = objcclass external;
+  NSFileWrapper = objcclass external;
+  NSTextBlock = objcclass external;
+  NSTextTable = objcclass external;
+  NSTextList = objcclass external;
+  CIImage = objcclass external;
+  NSColor = objcclass external;
+  NSColorSpace = objcclass external;
+  NSBitmapImageRep = objcclass external;
+  NSFont = objcclass external;
+  NSBox = objcclass external;
+  NSMatrix = objcclass external;
+  NSScroller = objcclass external;
+  NSBrowser = objcclass external;
+  NSBrowserCell = objcclass external;
+  NSSound = objcclass external;
+  NSButtonCell = objcclass external;
+  NSCachedImageRep = objcclass external;
+  NSEvent = objcclass external;
+  NSMenu = objcclass external;
+  NSText = objcclass external;
+  NSView = objcclass external;
+  NSTextView = objcclass external;
+  NSCell = objcclass external;
+  NSCIImageRep = objcclass external;
+  NSClipView = objcclass external;
+  NSCollectionView = objcclass external;
+  NSNib = objcclass external;
+  NSCollectionViewItem = objcclass external;
+  NSColorList = objcclass external;
+  NSColorPanel = objcclass external;
+  NSColorPicker = objcclass external;
+  NSColorWell = objcclass external;
+  NSComboBox = objcclass external;
+  NSTableView = objcclass external;
+  NSComboBoxCell = objcclass external;
+  NSControl = objcclass external;
+  NSController = objcclass external;
+  NSCursor = objcclass external;
+  NSCustomImageRep = objcclass external;
+  NSDatePicker = objcclass external;
+  NSDatePickerCell = objcclass external;
+  NSDictionaryController = objcclass external;
+  NSMenuItem = objcclass external;
+  NSPageLayout = objcclass external;
+  NSPrintInfo = objcclass external;
+  NSPrintOperation = objcclass external;
+  NSSavePanel = objcclass external;
+  NSWindowController = objcclass external;
+  NSDocument = objcclass external;
+  NSOpenPanel = objcclass external;
+  NSDocumentController = objcclass external;
+  NSDrawer = objcclass external;
+  NSPDFImageRep = objcclass external;
+  NSEPSImageRep = objcclass external;
+  NSTrackingArea = objcclass external;
+  NSFontDescriptor = objcclass external;
+  NSFontPanel = objcclass external;
+  NSFontManager = objcclass external;
+  NSFormCell = objcclass external;
+  NSGlyphGenerator = objcclass external;
+  NSGlyphInfo = objcclass external;
+  NSGradient = objcclass external;
+  CIContext = objcclass external;
+  NSHelpManager = objcclass external;
+  NSImageRep = objcclass external;
+  _NSImageAuxiliary = objcclass external;
+  NSImageCell = objcclass external;
+  NSImageView = objcclass external;
+  NSInputServer = objcclass external;
+  NSInputManager = objcclass external;
+  NSTextStorage = objcclass external;
+  NSTypesetter = objcclass external;
+  NSTextContainer = objcclass external;
+  NSRulerView = objcclass external;
+  NSParagraphStyle = objcclass external;
+  NSRulerMarker = objcclass external;
+  NSTabWell = objcclass external;
+  NSStorage = objcclass external;
+  NSRunStorage = objcclass external;
+  NSSortedArray = objcclass external;
+  NSLayoutManager = objcclass external;
+  NSLevelIndicator = objcclass external;
+  NSLevelIndicatorCell = objcclass external;
+  NSMenuView = objcclass external;
+  NSMenuItemCell = objcclass external;
+  NSScreen = objcclass external;
+  QTMovie = objcclass external;
+  NSMovie = objcclass external;
+  NSMovieView = objcclass external;
+  NSIBObjectData = objcclass external;
+  NSNibConnector = objcclass external;
+  NSNibControlConnector = objcclass external;
+  NSNibOutletConnector = objcclass external;
+  NSManagedObjectContext = objcclass external;
+  NSFetchRequest = objcclass external;
+  NSObjectController = objcclass external;
+  NSOpenGLPixelFormat = objcclass external;
+  NSOpenGLPixelBuffer = objcclass external;
+  NSOpenGLContext = objcclass external;
+  NSOpenGLLayer = objcclass external;
+  NSOpenGLView = objcclass external;
+  NSTableHeaderView = objcclass external;
+  NSTableColumn = objcclass external;
+  NSMouseTracker = objcclass external;
+  NSOutlineView = objcclass external;
+  NSViewController = objcclass external;
+  NSTextTab = objcclass external;
+  NSMutableParagraphStyle = objcclass external;
+  NSPasteboardItem = objcclass external;
+  NSPathComponentCell = objcclass external;
+  NSPopUpButtonCell = objcclass external;
+  NSPathCell = objcclass external;
+  NSPathControl = objcclass external;
+  NSManagedObjectModel = objcclass external;
+  NSPersistentDocument = objcclass external;
+  NSPICTImageRep = objcclass external;
+  NSPopUpButton = objcclass external;
+  NSPredicateTemplate = objcclass external;
+  NSPredicateEditor = objcclass external;
+  NSEntityDescription = objcclass external;
+  NSPredicateEditorRowTemplate = objcclass external;
+  NSPrinter = objcclass external;
+  NSPrintPanel = objcclass external;
+  NSProgressIndicator = objcclass external;
+  NSQuickDrawView = objcclass external;
+  NSResponder = objcclass external;
+  NSRuleEditor = objcclass external;
+  NSScrollView = objcclass external;
+  NSRunningApplication = objcclass external;
+  NSNavView = objcclass external;
+  NSSavePanelAuxiliary = objcclass external;
+  NSSearchField = objcclass external;
+  NSSearchFieldCell = objcclass external;
+  NSSecureTextField = objcclass external;
+  NSSecureTextFieldCell = objcclass external;
+  NSSegmentedCell = objcclass external;
+  NSSegmentedControl = objcclass external;
+  NSShadow = objcclass external;
+  NSSimpleHorizontalTypesetter = objcclass external;
+  NSSlider = objcclass external;
+  NSSliderCell = objcclass external;
+  NSSpeechRecognizer = objcclass external;
+  NSSpeechSynthesizer = objcclass external;
+  NSSpellChecker = objcclass external;
+  NSSplitView = objcclass external;
+  NSStatusItem = objcclass external;
+  NSStatusBar = objcclass external;
+  NSStepper = objcclass external;
+  NSStepperCell = objcclass external;
+  NSTableHeaderCell = objcclass external;
+  NSTabViewItem = objcclass external;
+  NSTabView = objcclass external;
+  NSTextAttachment = objcclass external;
+  NSTextAttachmentCell = objcclass external;
+  NSTextFieldCell = objcclass external;
+  NSTextInputContext = objcclass external;
+  NSTextTableBlock = objcclass external;
+  NSTokenField = objcclass external;
+  NSTokenFieldCell = objcclass external;
+  NSToolbarItem = objcclass external;
+  NSToolbar = objcclass external;
+  NSToolbarItemViewer = objcclass external;
+  NSToolbarItemGroup = objcclass external;
+  NSTouch = objcclass external;
+  NSTreeNode = objcclass external;
+  NSTreeController = objcclass external;
+  NSUserDefaultsController = objcclass external;
+  CIFilter = objcclass external;
+  CALayer = objcclass external;
+  _NSViewAuxiliary = objcclass external;
+  NSWindowAuxiliary = objcclass external;
+  NSWorkspace = objcclass external;
+  CAMediaTimingFunction = objcclass external;
+  CAValueFunction = objcclass external;
+  CAAnimation = objcclass external;
+  CAPropertyAnimation = objcclass external;
+  CABasicAnimation = objcclass external;
+  CAKeyframeAnimation = objcclass external;
+  CATransition = objcclass external;
+  CAAnimationGroup = objcclass external;
+  CAConstraint = objcclass external;
+  CAConstraintLayoutManager = objcclass external;
+  CAEmitterCell = objcclass external;
+  CAEmitterLayer = objcclass external;
+  CAGradientLayer = objcclass external;
+  CALayerArray = objcclass external;
+  CAOpenGLLayer = objcclass external;
+  CARenderer = objcclass external;
+  CAReplicatorLayer = objcclass external;
+  CAScrollLayer = objcclass external;
+  CAShapeLayer = objcclass external;
+  CATextLayer = objcclass external;
+  CATiledLayer = objcclass external;
+  CATransaction = objcclass external;
+  CATransformLayer = objcclass external;
+  CIColor = objcclass external;
+  CIKernel = objcclass external;
+  CIFilterGenerator = objcclass external;
+  CIFilterShape = objcclass external;
+  CIImageAccumulator = objcclass external;
+  CIPlugIn = objcclass external;
+  CISampler = objcclass external;
+  CIVector = objcclass external;
 
 implementation
 

+ 329 - 329
packages/cocoaint/src/AnonClassDefinitionsWebkit.pas

@@ -9,335 +9,335 @@ unit AnonClassDefinitionsWebkit;
 interface
 
 type
-  Protocol = objcclass; external;
-  NSAffineTransform = objcclass; external;
-  NSData = objcclass; external;
-  NSAppleEventDescriptor = objcclass; external;
-  NSAppleEventManager = objcclass; external;
-  NSDictionary = objcclass; external;
-  NSString = objcclass; external;
-  NSURL = objcclass; external;
-  NSAppleScript = objcclass; external;
-  NSMutableData = objcclass; external;
-  NSMutableDictionary = objcclass; external;
-  NSMutableArray = objcclass; external;
-  NSArchiver = objcclass; external;
-  NSUnarchiver = objcclass; external;
-  NSIndexSet = objcclass; external;
-  NSArray = objcclass; external;
-  NSAttributedString = objcclass; external;
-  NSMutableAttributedString = objcclass; external;
-  NSAutoreleasePool = objcclass; external;
-  NSError = objcclass; external;
-  NSBundle = objcclass; external;
-  NSCache = objcclass; external;
-  NSDateComponents = objcclass; external;
-  NSLocale = objcclass; external;
-  NSTimeZone = objcclass; external;
-  NSCalendar = objcclass; external;
-  NSCalendarDate = objcclass; external;
-  NSCharacterSet = objcclass; external;
-  NSMutableCharacterSet = objcclass; external;
-  NSClassDescription = objcclass; external;
-  NSCoder = objcclass; external;
-  NSPredicateOperator = objcclass; external;
-  NSExpression = objcclass; external;
-  NSComparisonPredicate = objcclass; external;
-  NSCompoundPredicate = objcclass; external;
-  NSDistantObject = objcclass; external;
-  NSException = objcclass; external;
-  NSPort = objcclass; external;
-  NSRunLoop = objcclass; external;
-  NSPortNameServer = objcclass; external;
-  NSDistantObjectRequest = objcclass; external;
-  NSConnection = objcclass; external;
-  NSPurgeableData = objcclass; external;
-  NSDate = objcclass; external;
-  NSDateFormatter = objcclass; external;
-  NSDecimalNumber = objcclass; external;
-  NSDecimalNumberHandler = objcclass; external;
-  NSSet = objcclass; external;
-  NSDistributedLock = objcclass; external;
-  NSDistributedNotificationCenter = objcclass; external;
-  NSEnumerator = objcclass; external;
-  NSAssertionHandler = objcclass; external;
-  NSPredicate = objcclass; external;
-  NSFileHandle = objcclass; external;
-  NSPipe = objcclass; external;
-  NSDirectoryEnumerator = objcclass; external;
-  NSNumber = objcclass; external;
-  NSFileManager = objcclass; external;
-  NSFormatter = objcclass; external;
-  NSGarbageCollector = objcclass; external;
-  NSHashTable = objcclass; external;
-  NSHost = objcclass; external;
-  NSHTTPCookieInternal = objcclass; external;
-  NSHTTPCookie = objcclass; external;
-  NSHTTPCookieStorageInternal = objcclass; external;
-  NSHTTPCookieStorage = objcclass; external;
-  NSIndexPath = objcclass; external;
-  NSMutableIndexSet = objcclass; external;
-  NSMethodSignature = objcclass; external;
-  NSInvocation = objcclass; external;
-  NSKeyedArchiver = objcclass; external;
-  NSKeyedUnarchiver = objcclass; external;
-  NSLock = objcclass; external;
-  NSConditionLock = objcclass; external;
-  NSRecursiveLock = objcclass; external;
-  NSCondition = objcclass; external;
-  NSMapTable = objcclass; external;
-  NSMetadataItem = objcclass; external;
-  NSMetadataQueryAttributeValueTuple = objcclass; external;
-  NSMetadataQueryResultGroup = objcclass; external;
-  NSMetadataQuery = objcclass; external;
-  NSInputStream = objcclass; external;
-  NSOutputStream = objcclass; external;
-  NSNetService = objcclass; external;
-  NSNetServiceBrowser = objcclass; external;
-  NSOperationQueue = objcclass; external;
-  NSNotification = objcclass; external;
-  NSNotificationCenter = objcclass; external;
-  NSNotificationQueue = objcclass; external;
-  NSNull = objcclass; external;
-  NSNumberFormatter = objcclass; external;
-  NSObject = objcclass; external;
-  NSScriptObjectSpecifier = objcclass; external;
-  NSOperation = objcclass; external;
-  NSBlockOperation = objcclass; external;
-  NSInvocationOperation = objcclass; external;
-  NSOrthography = objcclass; external;
-  NSPointerArray = objcclass; external;
-  NSPointerFunctions = objcclass; external;
-  NSPortMessage = objcclass; external;
-  NSMachPort = objcclass; external;
-  NSMessagePort = objcclass; external;
-  NSSocketPort = objcclass; external;
-  NSPortCoder = objcclass; external;
-  NSMachBootstrapServer = objcclass; external;
-  NSMessagePortNameServer = objcclass; external;
-  NSSocketPortNameServer = objcclass; external;
-  NSProcessInfo = objcclass; external;
-  NSPropertyListSerialization = objcclass; external;
-  NSProtocolChecker = objcclass; external;
-  NSProxy = objcclass; external;
-  NSTimer = objcclass; external;
-  NSScanner = objcclass; external;
-  NSScriptCommandDescription = objcclass; external;
-  NSScriptClassDescription = objcclass; external;
-  NSScriptCoercionHandler = objcclass; external;
-  NSScriptCommand = objcclass; external;
-  NSScriptExecutionContext = objcclass; external;
-  NSScriptWhoseTest = objcclass; external;
-  NSIndexSpecifier = objcclass; external;
-  NSMiddleSpecifier = objcclass; external;
-  NSNameSpecifier = objcclass; external;
-  NSPositionalSpecifier = objcclass; external;
-  NSPropertySpecifier = objcclass; external;
-  NSRandomSpecifier = objcclass; external;
-  NSRangeSpecifier = objcclass; external;
-  NSRelativeSpecifier = objcclass; external;
-  NSUniqueIDSpecifier = objcclass; external;
-  NSWhoseSpecifier = objcclass; external;
-  NSCloneCommand = objcclass; external;
-  NSCloseCommand = objcclass; external;
-  NSCountCommand = objcclass; external;
-  NSCreateCommand = objcclass; external;
-  NSDeleteCommand = objcclass; external;
-  NSExistsCommand = objcclass; external;
-  NSGetCommand = objcclass; external;
-  NSMoveCommand = objcclass; external;
-  NSQuitCommand = objcclass; external;
-  NSSetCommand = objcclass; external;
-  NSMutableSet = objcclass; external;
-  NSScriptSuiteRegistry = objcclass; external;
-  NSLogicalTest = objcclass; external;
-  NSSpecifierTest = objcclass; external;
-  NSCountedSet = objcclass; external;
-  NSSortDescriptor = objcclass; external;
-  NSSpellServer = objcclass; external;
-  NSStream = objcclass; external;
-  NSMutableString = objcclass; external;
-  NSSimpleCString = objcclass; external;
-  NSConstantString = objcclass; external;
-  NSTask = objcclass; external;
-  NSTextCheckingResult = objcclass; external;
-  NSThread = objcclass; external;
-  NSUndoManager = objcclass; external;
-  NSURLAuthenticationChallenge = objcclass; external;
-  NSURLCredential = objcclass; external;
-  NSURLProtectionSpace = objcclass; external;
-  NSURLResponse = objcclass; external;
-  NSURLAuthenticationChallengeInternal = objcclass; external;
-  NSCachedURLResponseInternal = objcclass; external;
-  NSURLRequest = objcclass; external;
-  NSCachedURLResponse = objcclass; external;
-  NSURLCacheInternal = objcclass; external;
-  NSURLCache = objcclass; external;
-  NSURLConnectionInternal = objcclass; external;
-  NSURLConnection = objcclass; external;
-  NSURLCredentialInternal = objcclass; external;
-  NSURLCredentialStorageInternal = objcclass; external;
-  NSURLCredentialStorage = objcclass; external;
-  NSURLDownloadInternal = objcclass; external;
-  NSURLDownload = objcclass; external;
-  NSURLHandle = objcclass; external;
-  NSURLProtectionSpaceInternal = objcclass; external;
-  NSMutableURLRequest = objcclass; external;
-  NSURLProtocol = objcclass; external;
-  NSURLProtocolInternal = objcclass; external;
-  NSURLRequestInternal = objcclass; external;
-  NSURLResponseInternal = objcclass; external;
-  NSHTTPURLResponseInternal = objcclass; external;
-  NSHTTPURLResponse = objcclass; external;
-  NSUserDefaults = objcclass; external;
-  NSValue = objcclass; external;
-  NSValueTransformer = objcclass; external;
-  NSXMLDTD = objcclass; external;
-  NSXMLDocument = objcclass; external;
-  NSXMLDTDNode = objcclass; external;
-  NSXMLElement = objcclass; external;
-  NSXMLNode = objcclass; external;
-  NSXMLParser = objcclass; external;
-  NSImage = objcclass; external;
-  DOMDocument = objcclass; external;
-  DOMAbstractView = objcclass; external;
-  DOMCSSStyleDeclaration = objcclass; external;
-  DOMElement = objcclass; external;
-  DOMAttr = objcclass; external;
-  DOMCDATASection = objcclass; external;
-  DOMCharacterData = objcclass; external;
-  DOMComment = objcclass; external;
-  DOMCounter = objcclass; external;
-  DOMCSSCharsetRule = objcclass; external;
-  DOMCSSFontFaceRule = objcclass; external;
-  DOMCSSStyleSheet = objcclass; external;
-  DOMMediaList = objcclass; external;
-  DOMCSSImportRule = objcclass; external;
-  DOMCSSRuleList = objcclass; external;
-  DOMCSSMediaRule = objcclass; external;
-  DOMCSSPageRule = objcclass; external;
-  DOMRGBColor = objcclass; external;
-  DOMRect = objcclass; external;
-  DOMCSSPrimitiveValue = objcclass; external;
-  DOMCSSRule = objcclass; external;
-  DOMCSSValue = objcclass; external;
-  DOMCSSStyleRule = objcclass; external;
-  DOMCSSUnknownRule = objcclass; external;
-  DOMCSSValueList = objcclass; external;
-  DOMDocumentFragment = objcclass; external;
-  DOMDocumentType = objcclass; external;
-  DOMEntityReference = objcclass; external;
-  DOMEvent = objcclass; external;
-  DOMHTMLCollection = objcclass; external;
-  DOMHTMLElement = objcclass; external;
-  DOMImplementation = objcclass; external;
-  DOMNode = objcclass; external;
-  DOMNodeIterator = objcclass; external;
-  DOMNodeList = objcclass; external;
-  DOMProcessingInstruction = objcclass; external;
-  DOMRange = objcclass; external;
-  DOMStyleSheetList = objcclass; external;
-  DOMText = objcclass; external;
-  DOMTreeWalker = objcclass; external;
-  DOMXPathExpression = objcclass; external;
-  DOMXPathResult = objcclass; external;
-  DOMNamedNodeMap = objcclass; external;
-  DOMEntity = objcclass; external;
-  DOMFile = objcclass; external;
-  DOMFileList = objcclass; external;
-  DOMHTMLAnchorElement = objcclass; external;
-  DOMHTMLAppletElement = objcclass; external;
-  DOMHTMLAreaElement = objcclass; external;
-  DOMHTMLBaseElement = objcclass; external;
-  DOMHTMLBaseFontElement = objcclass; external;
-  DOMHTMLBodyElement = objcclass; external;
-  DOMHTMLBRElement = objcclass; external;
-  DOMHTMLFormElement = objcclass; external;
-  DOMHTMLButtonElement = objcclass; external;
-  DOMHTMLDirectoryElement = objcclass; external;
-  DOMHTMLDivElement = objcclass; external;
-  DOMHTMLDListElement = objcclass; external;
-  DOMHTMLDocument = objcclass; external;
-  DOMHTMLEmbedElement = objcclass; external;
-  DOMHTMLFieldSetElement = objcclass; external;
-  DOMHTMLFontElement = objcclass; external;
-  DOMHTMLFrameElement = objcclass; external;
-  DOMHTMLFrameSetElement = objcclass; external;
-  DOMHTMLHeadElement = objcclass; external;
-  DOMHTMLHeadingElement = objcclass; external;
-  DOMHTMLHRElement = objcclass; external;
-  DOMHTMLHtmlElement = objcclass; external;
-  DOMHTMLIFrameElement = objcclass; external;
-  DOMHTMLImageElement = objcclass; external;
-  DOMHTMLInputElement = objcclass; external;
-  DOMHTMLIsIndexElement = objcclass; external;
-  DOMHTMLLabelElement = objcclass; external;
-  DOMHTMLLegendElement = objcclass; external;
-  DOMHTMLLIElement = objcclass; external;
-  DOMStyleSheet = objcclass; external;
-  DOMHTMLLinkElement = objcclass; external;
-  DOMHTMLMapElement = objcclass; external;
-  DOMHTMLMarqueeElement = objcclass; external;
-  DOMHTMLMenuElement = objcclass; external;
-  DOMHTMLMetaElement = objcclass; external;
-  DOMHTMLModElement = objcclass; external;
-  DOMHTMLObjectElement = objcclass; external;
-  DOMHTMLOListElement = objcclass; external;
-  DOMHTMLOptGroupElement = objcclass; external;
-  DOMHTMLOptionElement = objcclass; external;
-  DOMHTMLOptionsCollection = objcclass; external;
-  DOMHTMLParagraphElement = objcclass; external;
-  DOMHTMLParamElement = objcclass; external;
-  DOMHTMLPreElement = objcclass; external;
-  DOMHTMLQuoteElement = objcclass; external;
-  DOMHTMLScriptElement = objcclass; external;
-  DOMHTMLSelectElement = objcclass; external;
-  DOMHTMLStyleElement = objcclass; external;
-  DOMHTMLTableCaptionElement = objcclass; external;
-  DOMHTMLTableCellElement = objcclass; external;
-  DOMHTMLTableColElement = objcclass; external;
-  DOMHTMLTableSectionElement = objcclass; external;
-  DOMHTMLTableElement = objcclass; external;
-  DOMHTMLTableRowElement = objcclass; external;
-  DOMHTMLTextAreaElement = objcclass; external;
-  DOMHTMLTitleElement = objcclass; external;
-  DOMHTMLUListElement = objcclass; external;
-  DOMKeyboardEvent = objcclass; external;
-  DOMMouseEvent = objcclass; external;
-  DOMMutationEvent = objcclass; external;
-  DOMNotation = objcclass; external;
-  DOMObject = objcclass; external;
-  DOMOverflowEvent = objcclass; external;
-  DOMProgressEvent = objcclass; external;
-  NSColor = objcclass; external;
-  DOMUIEvent = objcclass; external;
-  DOMWheelEvent = objcclass; external;
-  WebView = objcclass; external;
-  WebArchivePrivate = objcclass; external;
-  WebResource = objcclass; external;
-  WebArchive = objcclass; external;
-  WebHistoryItem = objcclass; external;
-  WebBackForwardListPrivate = objcclass; external;
-  WebBackForwardList = objcclass; external;
-  WebDataSourcePrivate = objcclass; external;
-  WebFrame = objcclass; external;
-  WebDataSource = objcclass; external;
-  WebDownloadInternal = objcclass; external;
-  WebDownload = objcclass; external;
-  WebFramePrivate = objcclass; external;
-  WebFrameView = objcclass; external;
-  WebScriptObject = objcclass; external;
-  WebFrameViewPrivate = objcclass; external;
-  WebHistoryPrivate = objcclass; external;
-  WebHistory = objcclass; external;
-  WebHistoryItemPrivate = objcclass; external;
-  WebPolicyPrivate = objcclass; external;
-  WebPreferencesPrivate = objcclass; external;
-  WebPreferences = objcclass; external;
-  WebResourcePrivate = objcclass; external;
-  WebScriptObjectPrivate = objcclass; external;
-  WebUndefined = objcclass; external;
-  WebViewPrivate = objcclass; external;
+  Protocol = objcclass external;
+  NSAffineTransform = objcclass external;
+  NSData = objcclass external;
+  NSAppleEventDescriptor = objcclass external;
+  NSAppleEventManager = objcclass external;
+  NSDictionary = objcclass external;
+  NSString = objcclass external;
+  NSURL = objcclass external;
+  NSAppleScript = objcclass external;
+  NSMutableData = objcclass external;
+  NSMutableDictionary = objcclass external;
+  NSMutableArray = objcclass external;
+  NSArchiver = objcclass external;
+  NSUnarchiver = objcclass external;
+  NSIndexSet = objcclass external;
+  NSArray = objcclass external;
+  NSAttributedString = objcclass external;
+  NSMutableAttributedString = objcclass external;
+  NSAutoreleasePool = objcclass external;
+  NSError = objcclass external;
+  NSBundle = objcclass external;
+  NSCache = objcclass external;
+  NSDateComponents = objcclass external;
+  NSLocale = objcclass external;
+  NSTimeZone = objcclass external;
+  NSCalendar = objcclass external;
+  NSCalendarDate = objcclass external;
+  NSCharacterSet = objcclass external;
+  NSMutableCharacterSet = objcclass external;
+  NSClassDescription = objcclass external;
+  NSCoder = objcclass external;
+  NSPredicateOperator = objcclass external;
+  NSExpression = objcclass external;
+  NSComparisonPredicate = objcclass external;
+  NSCompoundPredicate = objcclass external;
+  NSDistantObject = objcclass external;
+  NSException = objcclass external;
+  NSPort = objcclass external;
+  NSRunLoop = objcclass external;
+  NSPortNameServer = objcclass external;
+  NSDistantObjectRequest = objcclass external;
+  NSConnection = objcclass external;
+  NSPurgeableData = objcclass external;
+  NSDate = objcclass external;
+  NSDateFormatter = objcclass external;
+  NSDecimalNumber = objcclass external;
+  NSDecimalNumberHandler = objcclass external;
+  NSSet = objcclass external;
+  NSDistributedLock = objcclass external;
+  NSDistributedNotificationCenter = objcclass external;
+  NSEnumerator = objcclass external;
+  NSAssertionHandler = objcclass external;
+  NSPredicate = objcclass external;
+  NSFileHandle = objcclass external;
+  NSPipe = objcclass external;
+  NSDirectoryEnumerator = objcclass external;
+  NSNumber = objcclass external;
+  NSFileManager = objcclass external;
+  NSFormatter = objcclass external;
+  NSGarbageCollector = objcclass external;
+  NSHashTable = objcclass external;
+  NSHost = objcclass external;
+  NSHTTPCookieInternal = objcclass external;
+  NSHTTPCookie = objcclass external;
+  NSHTTPCookieStorageInternal = objcclass external;
+  NSHTTPCookieStorage = objcclass external;
+  NSIndexPath = objcclass external;
+  NSMutableIndexSet = objcclass external;
+  NSMethodSignature = objcclass external;
+  NSInvocation = objcclass external;
+  NSKeyedArchiver = objcclass external;
+  NSKeyedUnarchiver = objcclass external;
+  NSLock = objcclass external;
+  NSConditionLock = objcclass external;
+  NSRecursiveLock = objcclass external;
+  NSCondition = objcclass external;
+  NSMapTable = objcclass external;
+  NSMetadataItem = objcclass external;
+  NSMetadataQueryAttributeValueTuple = objcclass external;
+  NSMetadataQueryResultGroup = objcclass external;
+  NSMetadataQuery = objcclass external;
+  NSInputStream = objcclass external;
+  NSOutputStream = objcclass external;
+  NSNetService = objcclass external;
+  NSNetServiceBrowser = objcclass external;
+  NSOperationQueue = objcclass external;
+  NSNotification = objcclass external;
+  NSNotificationCenter = objcclass external;
+  NSNotificationQueue = objcclass external;
+  NSNull = objcclass external;
+  NSNumberFormatter = objcclass external;
+  NSObject = objcclass external;
+  NSScriptObjectSpecifier = objcclass external;
+  NSOperation = objcclass external;
+  NSBlockOperation = objcclass external;
+  NSInvocationOperation = objcclass external;
+  NSOrthography = objcclass external;
+  NSPointerArray = objcclass external;
+  NSPointerFunctions = objcclass external;
+  NSPortMessage = objcclass external;
+  NSMachPort = objcclass external;
+  NSMessagePort = objcclass external;
+  NSSocketPort = objcclass external;
+  NSPortCoder = objcclass external;
+  NSMachBootstrapServer = objcclass external;
+  NSMessagePortNameServer = objcclass external;
+  NSSocketPortNameServer = objcclass external;
+  NSProcessInfo = objcclass external;
+  NSPropertyListSerialization = objcclass external;
+  NSProtocolChecker = objcclass external;
+  NSProxy = objcclass external;
+  NSTimer = objcclass external;
+  NSScanner = objcclass external;
+  NSScriptCommandDescription = objcclass external;
+  NSScriptClassDescription = objcclass external;
+  NSScriptCoercionHandler = objcclass external;
+  NSScriptCommand = objcclass external;
+  NSScriptExecutionContext = objcclass external;
+  NSScriptWhoseTest = objcclass external;
+  NSIndexSpecifier = objcclass external;
+  NSMiddleSpecifier = objcclass external;
+  NSNameSpecifier = objcclass external;
+  NSPositionalSpecifier = objcclass external;
+  NSPropertySpecifier = objcclass external;
+  NSRandomSpecifier = objcclass external;
+  NSRangeSpecifier = objcclass external;
+  NSRelativeSpecifier = objcclass external;
+  NSUniqueIDSpecifier = objcclass external;
+  NSWhoseSpecifier = objcclass external;
+  NSCloneCommand = objcclass external;
+  NSCloseCommand = objcclass external;
+  NSCountCommand = objcclass external;
+  NSCreateCommand = objcclass external;
+  NSDeleteCommand = objcclass external;
+  NSExistsCommand = objcclass external;
+  NSGetCommand = objcclass external;
+  NSMoveCommand = objcclass external;
+  NSQuitCommand = objcclass external;
+  NSSetCommand = objcclass external;
+  NSMutableSet = objcclass external;
+  NSScriptSuiteRegistry = objcclass external;
+  NSLogicalTest = objcclass external;
+  NSSpecifierTest = objcclass external;
+  NSCountedSet = objcclass external;
+  NSSortDescriptor = objcclass external;
+  NSSpellServer = objcclass external;
+  NSStream = objcclass external;
+  NSMutableString = objcclass external;
+  NSSimpleCString = objcclass external;
+  NSConstantString = objcclass external;
+  NSTask = objcclass external;
+  NSTextCheckingResult = objcclass external;
+  NSThread = objcclass external;
+  NSUndoManager = objcclass external;
+  NSURLAuthenticationChallenge = objcclass external;
+  NSURLCredential = objcclass external;
+  NSURLProtectionSpace = objcclass external;
+  NSURLResponse = objcclass external;
+  NSURLAuthenticationChallengeInternal = objcclass external;
+  NSCachedURLResponseInternal = objcclass external;
+  NSURLRequest = objcclass external;
+  NSCachedURLResponse = objcclass external;
+  NSURLCacheInternal = objcclass external;
+  NSURLCache = objcclass external;
+  NSURLConnectionInternal = objcclass external;
+  NSURLConnection = objcclass external;
+  NSURLCredentialInternal = objcclass external;
+  NSURLCredentialStorageInternal = objcclass external;
+  NSURLCredentialStorage = objcclass external;
+  NSURLDownloadInternal = objcclass external;
+  NSURLDownload = objcclass external;
+  NSURLHandle = objcclass external;
+  NSURLProtectionSpaceInternal = objcclass external;
+  NSMutableURLRequest = objcclass external;
+  NSURLProtocol = objcclass external;
+  NSURLProtocolInternal = objcclass external;
+  NSURLRequestInternal = objcclass external;
+  NSURLResponseInternal = objcclass external;
+  NSHTTPURLResponseInternal = objcclass external;
+  NSHTTPURLResponse = objcclass external;
+  NSUserDefaults = objcclass external;
+  NSValue = objcclass external;
+  NSValueTransformer = objcclass external;
+  NSXMLDTD = objcclass external;
+  NSXMLDocument = objcclass external;
+  NSXMLDTDNode = objcclass external;
+  NSXMLElement = objcclass external;
+  NSXMLNode = objcclass external;
+  NSXMLParser = objcclass external;
+  NSImage = objcclass external;
+  DOMDocument = objcclass external;
+  DOMAbstractView = objcclass external;
+  DOMCSSStyleDeclaration = objcclass external;
+  DOMElement = objcclass external;
+  DOMAttr = objcclass external;
+  DOMCDATASection = objcclass external;
+  DOMCharacterData = objcclass external;
+  DOMComment = objcclass external;
+  DOMCounter = objcclass external;
+  DOMCSSCharsetRule = objcclass external;
+  DOMCSSFontFaceRule = objcclass external;
+  DOMCSSStyleSheet = objcclass external;
+  DOMMediaList = objcclass external;
+  DOMCSSImportRule = objcclass external;
+  DOMCSSRuleList = objcclass external;
+  DOMCSSMediaRule = objcclass external;
+  DOMCSSPageRule = objcclass external;
+  DOMRGBColor = objcclass external;
+  DOMRect = objcclass external;
+  DOMCSSPrimitiveValue = objcclass external;
+  DOMCSSRule = objcclass external;
+  DOMCSSValue = objcclass external;
+  DOMCSSStyleRule = objcclass external;
+  DOMCSSUnknownRule = objcclass external;
+  DOMCSSValueList = objcclass external;
+  DOMDocumentFragment = objcclass external;
+  DOMDocumentType = objcclass external;
+  DOMEntityReference = objcclass external;
+  DOMEvent = objcclass external;
+  DOMHTMLCollection = objcclass external;
+  DOMHTMLElement = objcclass external;
+  DOMImplementation = objcclass external;
+  DOMNode = objcclass external;
+  DOMNodeIterator = objcclass external;
+  DOMNodeList = objcclass external;
+  DOMProcessingInstruction = objcclass external;
+  DOMRange = objcclass external;
+  DOMStyleSheetList = objcclass external;
+  DOMText = objcclass external;
+  DOMTreeWalker = objcclass external;
+  DOMXPathExpression = objcclass external;
+  DOMXPathResult = objcclass external;
+  DOMNamedNodeMap = objcclass external;
+  DOMEntity = objcclass external;
+  DOMFile = objcclass external;
+  DOMFileList = objcclass external;
+  DOMHTMLAnchorElement = objcclass external;
+  DOMHTMLAppletElement = objcclass external;
+  DOMHTMLAreaElement = objcclass external;
+  DOMHTMLBaseElement = objcclass external;
+  DOMHTMLBaseFontElement = objcclass external;
+  DOMHTMLBodyElement = objcclass external;
+  DOMHTMLBRElement = objcclass external;
+  DOMHTMLFormElement = objcclass external;
+  DOMHTMLButtonElement = objcclass external;
+  DOMHTMLDirectoryElement = objcclass external;
+  DOMHTMLDivElement = objcclass external;
+  DOMHTMLDListElement = objcclass external;
+  DOMHTMLDocument = objcclass external;
+  DOMHTMLEmbedElement = objcclass external;
+  DOMHTMLFieldSetElement = objcclass external;
+  DOMHTMLFontElement = objcclass external;
+  DOMHTMLFrameElement = objcclass external;
+  DOMHTMLFrameSetElement = objcclass external;
+  DOMHTMLHeadElement = objcclass external;
+  DOMHTMLHeadingElement = objcclass external;
+  DOMHTMLHRElement = objcclass external;
+  DOMHTMLHtmlElement = objcclass external;
+  DOMHTMLIFrameElement = objcclass external;
+  DOMHTMLImageElement = objcclass external;
+  DOMHTMLInputElement = objcclass external;
+  DOMHTMLIsIndexElement = objcclass external;
+  DOMHTMLLabelElement = objcclass external;
+  DOMHTMLLegendElement = objcclass external;
+  DOMHTMLLIElement = objcclass external;
+  DOMStyleSheet = objcclass external;
+  DOMHTMLLinkElement = objcclass external;
+  DOMHTMLMapElement = objcclass external;
+  DOMHTMLMarqueeElement = objcclass external;
+  DOMHTMLMenuElement = objcclass external;
+  DOMHTMLMetaElement = objcclass external;
+  DOMHTMLModElement = objcclass external;
+  DOMHTMLObjectElement = objcclass external;
+  DOMHTMLOListElement = objcclass external;
+  DOMHTMLOptGroupElement = objcclass external;
+  DOMHTMLOptionElement = objcclass external;
+  DOMHTMLOptionsCollection = objcclass external;
+  DOMHTMLParagraphElement = objcclass external;
+  DOMHTMLParamElement = objcclass external;
+  DOMHTMLPreElement = objcclass external;
+  DOMHTMLQuoteElement = objcclass external;
+  DOMHTMLScriptElement = objcclass external;
+  DOMHTMLSelectElement = objcclass external;
+  DOMHTMLStyleElement = objcclass external;
+  DOMHTMLTableCaptionElement = objcclass external;
+  DOMHTMLTableCellElement = objcclass external;
+  DOMHTMLTableColElement = objcclass external;
+  DOMHTMLTableSectionElement = objcclass external;
+  DOMHTMLTableElement = objcclass external;
+  DOMHTMLTableRowElement = objcclass external;
+  DOMHTMLTextAreaElement = objcclass external;
+  DOMHTMLTitleElement = objcclass external;
+  DOMHTMLUListElement = objcclass external;
+  DOMKeyboardEvent = objcclass external;
+  DOMMouseEvent = objcclass external;
+  DOMMutationEvent = objcclass external;
+  DOMNotation = objcclass external;
+  DOMObject = objcclass external;
+  DOMOverflowEvent = objcclass external;
+  DOMProgressEvent = objcclass external;
+  NSColor = objcclass external;
+  DOMUIEvent = objcclass external;
+  DOMWheelEvent = objcclass external;
+  WebView = objcclass external;
+  WebArchivePrivate = objcclass external;
+  WebResource = objcclass external;
+  WebArchive = objcclass external;
+  WebHistoryItem = objcclass external;
+  WebBackForwardListPrivate = objcclass external;
+  WebBackForwardList = objcclass external;
+  WebDataSourcePrivate = objcclass external;
+  WebFrame = objcclass external;
+  WebDataSource = objcclass external;
+  WebDownloadInternal = objcclass external;
+  WebDownload = objcclass external;
+  WebFramePrivate = objcclass external;
+  WebFrameView = objcclass external;
+  WebScriptObject = objcclass external;
+  WebFrameViewPrivate = objcclass external;
+  WebHistoryPrivate = objcclass external;
+  WebHistory = objcclass external;
+  WebHistoryItemPrivate = objcclass external;
+  WebPolicyPrivate = objcclass external;
+  WebPreferencesPrivate = objcclass external;
+  WebPreferences = objcclass external;
+  WebResourcePrivate = objcclass external;
+  WebScriptObjectPrivate = objcclass external;
+  WebUndefined = objcclass external;
+  WebViewPrivate = objcclass external;
 
 implementation
 

+ 11 - 13
packages/cocoaint/src/appkit/NSATSTypesetter.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSATSTypesetter.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSATSTYPESETTER_PAS_C}
 
 { NSATSTypesetter }
-  NSATSTypesetter = objcclass(NSTypesetter)
+  NSATSTypesetter = objcclass external (NSTypesetter)
   private
     _attributedString: NSAttributedString;
     _paragraphGlyphRange: NSRange;
@@ -58,18 +58,16 @@
     _private: id;
     
   public
-    class function alloc: NSATSTypesetter; message 'alloc';
-
     class function sharedTypesetter: id; message 'sharedTypesetter';
-  end; external;
+  end;
 
 { NSPantherCompatibilityCategory }
-  NSPantherCompatibilityCategory = objccategory(NSATSTypesetter)
+  NSPantherCompatibilityCategory = objccategory external (NSATSTypesetter)
     function lineFragmentRectForProposedRect_remainingRect(proposedRect: NSRect; remainingRect: NSRectPointer): NSRect; message 'lineFragmentRectForProposedRect:remainingRect:'; deprecated 'in Mac OS X 10.4 and later';
-  end; external;
+  end;
 
 { NSPrimitiveInterfaceCategory }
-  NSPrimitiveInterfaceCategory = objccategory(NSATSTypesetter)
+  NSPrimitiveInterfaceCategory = objccategory external (NSATSTypesetter)
     function usesFontLeading: Boolean; message 'usesFontLeading';
     procedure setUsesFontLeading(flag: Boolean); message 'setUsesFontLeading:';
     function typesetterBehavior: NSTypesetterBehavior; message 'typesetterBehavior';
@@ -95,20 +93,20 @@
     function currentTextContainer: NSTextContainer; message 'currentTextContainer';
     procedure setHardInvalidation_forGlyphRange(flag: Boolean; glyphRange: NSRange); message 'setHardInvalidation:forGlyphRange:';
     procedure getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin(lineFragmentRect: NSRectPtr; lineFragmentUsedRect: NSRectPtr; paragraphSeparatorGlyphRange_: NSRange; lineOrigin: NSPoint); message 'getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:';
-  end; external;
+  end;
 
 { NSLayoutPhaseInterface_NSATSTypesetterCategory }
-  NSLayoutPhaseInterface_NSATSTypesetterCategory = objccategory(NSATSTypesetter)
+  NSLayoutPhaseInterface_NSATSTypesetterCategory = objccategory external name 'NSLayoutPhaseInterface' (NSATSTypesetter)
     procedure willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset(lineRect: NSRectPtr; glyphRange: NSRange; usedRect: NSRectPtr; baselineOffset: CGFloatPtr); 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:';
-  end; external name 'NSLayoutPhaseInterface';
+  end;
 
 { NSGlyphStorageInterface_NSATSTypesetterCategory }
-  NSGlyphStorageInterface_NSATSTypesetterCategory = objccategory(NSATSTypesetter)
+  NSGlyphStorageInterface_NSATSTypesetterCategory = objccategory external name 'NSGlyphStorageInterface' (NSATSTypesetter)
     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: NSGlyphPtr; charIndexBuffer: NSUIntegerPtr; inscribeBuffer: NSGlyphInscriptionPtr; elasticBuffer: pboolean): NSUInteger; message 'getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:';
@@ -121,7 +119,7 @@
     procedure setLocation_withAdvancements_forStartOfGlyphRange(location: NSPoint; advancements: CGFloatPtr; 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 name 'NSGlyphStorageInterface';
+  end;
 
 {$endif}
 {$endif}

+ 5 - 5
packages/cocoaint/src/appkit/NSAccessibility.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAccessibility.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -337,7 +337,7 @@ var
 {$define NSACCESSIBILITY_PAS_C}
 
 { NSAccessibilityCategory }
-  NSAccessibilityCategory = objccategory(NSObject)
+  NSAccessibilityCategory = objccategory external (NSObject)
     function accessibilityAttributeNames: NSArray; message 'accessibilityAttributeNames';
     function accessibilityAttributeValue(attribute: NSString): id; message 'accessibilityAttributeValue:';
     function accessibilityIsAttributeSettable(attribute: NSString): Boolean; message 'accessibilityIsAttributeSettable:';
@@ -353,12 +353,12 @@ var
     function accessibilityIndexOfChild(child: id): NSUInteger; message 'accessibilityIndexOfChild:';
     function accessibilityArrayAttributeCount(attribute: NSString): NSUInteger; message 'accessibilityArrayAttributeCount:';
     function accessibilityArrayAttributeValues_index_maxCount(attribute: NSString; index: NSUInteger; maxCount: NSUInteger): NSArray; message 'accessibilityArrayAttributeValues:index:maxCount:';
-  end; external;
+  end;
 
 { NSAccessibilityAdditionsCategory }
-  NSAccessibilityAdditionsCategory = objccategory(NSObject)
+  NSAccessibilityAdditionsCategory = objccategory external (NSObject)
     function accessibilitySetOverrideValue_forAttribute(value: id; attribute: NSString): Boolean; message 'accessibilitySetOverrideValue:forAttribute:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSActionCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSActionCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSACTIONCELL_PAS_C}
 
 { NSActionCell }
-  NSActionCell = objcclass(NSCell)
+  NSActionCell = objcclass external (NSCell)
   private
     _tag: NSInteger;
     _target: id;
@@ -50,15 +50,13 @@
     _controlView: id;
     
   public
-    class function alloc: NSActionCell; message 'alloc';
-
     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:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSAffineTransform.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAffineTransform.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -51,13 +51,11 @@ NSAffineTransformStructPtr = ^NSAffineTransformStruct;
 {$define NSAFFINETRANSFORM_PAS_C}
 
 { NSAffineTransform }
-  NSAffineTransform = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  NSAffineTransform = objcclass external (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:';
@@ -77,14 +75,14 @@ NSAffineTransformStructPtr = ^NSAffineTransformStruct;
     function copyWithZone(zone_: NSZonePtr): id;
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSAppKitAdditonsCategory }
-  NSAppKitAdditonsCategory = objccategory(NSAffineTransform)
+  NSAppKitAdditonsCategory = objccategory external (NSAffineTransform)
     function transformBezierPath(aPath: NSBezierPath): NSBezierPath; message 'transformBezierPath:';
     procedure set_; message 'set';
     procedure concat; message 'concat';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSAlert.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAlert.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -60,7 +60,7 @@ type
 {$define NSALERT_PAS_C}
 
 { NSAlert }
-  NSAlert = objcclass(NSObject)
+  NSAlert = objcclass external (NSObject)
   private
     _informationField: NSTextField;
     _first: id;
@@ -94,8 +94,6 @@ type
     _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; firstKey: id): NSAlert; varargs; message 'alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:';
     procedure setMessageText(messageText_: NSString); message 'setMessageText:';
@@ -124,7 +122,7 @@ type
     procedure alertDidEnd_returnCode_contextInfo(alert: NSAlert; returnCode: NSInteger; contextInfo: Pointer); message 'alertDidEnd:returnCode:contextInfo:';
     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;
+  end;
 
 {$endif}
 {$endif}
@@ -133,8 +131,8 @@ type
 {$define NSALERT_PAS_P}
   
 { NSAlertDelegate Protocol }
-  NSAlertDelegateProtocol = objcprotocol
+  NSAlertDelegateProtocol = objcprotocol external name 'NSAlertDelegate'
     function alertShowHelp(alert: NSAlert): Boolean; message 'alertShowHelp:';
-  end; external name 'NSAlertDelegate';
+  end;
 {$endif}
 {$endif}

+ 9 - 13
packages/cocoaint/src/appkit/NSAnimation.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAnimation.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:07 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -82,7 +82,7 @@ var
 {$define NSANIMATION_PAS_C}
 
 { NSAnimation }
-  NSAnimation = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  NSAnimation = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
   private
     _duration: NSTimeInterval;
     _currentProgress: NSAnimationProgress;
@@ -123,8 +123,6 @@ var
     _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';
@@ -156,10 +154,10 @@ var
     function copyWithZone(zone_: NSZonePtr): id;
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSViewAnimation }
-  NSViewAnimation = objcclass(NSAnimation)
+  NSViewAnimation = objcclass external (NSAnimation)
   private
     _viewAnimations: NSArray;
     _viewAnimationInfo: CFMutableDictionaryRef;
@@ -180,12 +178,10 @@ var
     _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;
+  end;
 
 {$endif}
 {$endif}
@@ -194,20 +190,20 @@ var
 {$define NSANIMATION_PAS_P}
   
 { NSAnimationDelegate Protocol }
-  NSAnimationDelegateProtocol = objcprotocol
+  NSAnimationDelegateProtocol = objcprotocol external name 'NSAnimationDelegate'
     function animationShouldStart(animation: NSAnimation): Boolean; message 'animationShouldStart:';
     procedure animationDidStop(animation: NSAnimation); message 'animationDidStop:';
     procedure animationDidEnd(animation: NSAnimation); message 'animationDidEnd:';
     function animation_valueForProgress(animation: NSAnimation; progress: NSAnimationProgress): single; message 'animation:valueForProgress:';
     procedure animation_didReachProgressMark(animation: NSAnimation; progress: NSAnimationProgress); message 'animation:didReachProgressMark:';
-  end; external name 'NSAnimationDelegate';
+  end;
   
 { NSAnimatablePropertyContainer Protocol }
-  NSAnimatablePropertyContainerProtocol = objcprotocol
+  NSAnimatablePropertyContainerProtocol = objcprotocol external name 'NSAnimatablePropertyContainer'
     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';
+  end;
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSAnimationContext.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAnimationContext.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,20 +42,18 @@
 {$define NSANIMATIONCONTEXT_PAS_C}
 
 { NSAnimationContext }
-  NSAnimationContext = objcclass(NSObject)
+  NSAnimationContext = objcclass external (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;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 3
packages/cocoaint/src/appkit/NSAppleScriptExtensions.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAppleScriptExtensions.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -39,9 +39,9 @@
 {$define NSAPPLESCRIPTEXTENSIONS_PAS_C}
 
 { NSExtensionsCategory }
-  NSExtensionsCategory = objccategory(NSAppleScript)
+  NSExtensionsCategory = objccategory external (NSAppleScript)
     function richTextSource: NSAttributedString; message 'richTextSource';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 21 - 23
packages/cocoaint/src/appkit/NSApplication.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSApplication.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -165,7 +165,7 @@ var
 {$define NSAPPLICATION_PAS_C}
 
 { NSApplication }
-  NSApplication = objcclass(NSResponder, NSUserInterfaceValidationsProtocol)
+  NSApplication = objcclass external (NSResponder, NSUserInterfaceValidationsProtocol)
   private
     _currentEvent: NSEvent;
     _windowList: id;
@@ -220,8 +220,6 @@ var
     _threadingSupport: _NSThreadPrivatePtr;
     
   public
-    class function alloc: NSApplication; message 'alloc';
-
     class function sharedApplication: NSApplication; message 'sharedApplication';
     procedure setDelegate(anObject: id); message 'setDelegate:';
     function delegate: id; message 'delegate';
@@ -291,10 +289,10 @@ var
 
     { Adopted Protocols }
     function validateUserInterfaceItem(anItem: id): Boolean;
-  end; external;
+  end;
 
 { NSWindowsMenuCategory }
-  NSWindowsMenuCategory = objccategory(NSApplication)
+  NSWindowsMenuCategory = objccategory external (NSApplication)
     procedure setWindowsMenu(aMenu: NSMenu); message 'setWindowsMenu:';
     function windowsMenu: NSMenu; message 'windowsMenu';
     procedure arrangeInFront(sender: id); message 'arrangeInFront:';
@@ -303,49 +301,49 @@ var
     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:';
-  end; external;
+  end;
 
 { NSFullKeyboardAccessCategory }
-  NSFullKeyboardAccessCategory = objccategory(NSApplication)
+  NSFullKeyboardAccessCategory = objccategory external (NSApplication)
     function isFullKeyboardAccessEnabled: Boolean; message 'isFullKeyboardAccessEnabled';
-  end; external;
+  end;
 
 { NSServicesMenuCategory }
-  NSServicesMenuCategory = objccategory(NSApplication)
+  NSServicesMenuCategory = objccategory external (NSApplication)
     procedure setServicesMenu(aMenu: NSMenu); message 'setServicesMenu:';
     function servicesMenu: NSMenu; message 'servicesMenu';
     procedure registerServicesMenuSendTypes_returnTypes(sendTypes: NSArray; returnTypes: NSArray); message 'registerServicesMenuSendTypes:returnTypes:';
-  end; external;
+  end;
 
 { NSServicesRequestsCategory }
-  NSServicesRequestsCategory = objccategory(NSObject)
+  NSServicesRequestsCategory = objccategory external (NSObject)
     function writeSelectionToPasteboard_types(pboard: NSPasteboard; types: NSArray): Boolean; message 'writeSelectionToPasteboard:types:';
     function readSelectionFromPasteboard(pboard: NSPasteboard): Boolean; message 'readSelectionFromPasteboard:';
-  end; external;
+  end;
 
 { NSServicesHandlingCategory }
-  NSServicesHandlingCategory = objccategory(NSApplication)
+  NSServicesHandlingCategory = objccategory external (NSApplication)
     procedure setServicesProvider(provider: id); message 'setServicesProvider:';
     function servicesProvider: id; message 'servicesProvider';
-  end; external;
+  end;
 
 { NSStandardAboutPanelCategory }
-  NSStandardAboutPanelCategory = objccategory(NSApplication)
+  NSStandardAboutPanelCategory = objccategory external (NSApplication)
     procedure orderFrontStandardAboutPanel(sender: id); message 'orderFrontStandardAboutPanel:';
     procedure orderFrontStandardAboutPanelWithOptions(optionsDictionary: NSDictionary); message 'orderFrontStandardAboutPanelWithOptions:';
-  end; external;
+  end;
 
 { NSApplicationLayoutDirectionCategory }
-  NSApplicationLayoutDirectionCategory = objccategory(NSApplication)
+  NSApplicationLayoutDirectionCategory = objccategory external (NSApplication)
     function userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection; message 'userInterfaceLayoutDirection';
-  end; external;
+  end;
 
 { NSDeprecated_NSApplicationCategory }
-  NSDeprecated_NSApplicationCategory = objccategory(NSApplication)
+  NSDeprecated_NSApplicationCategory = objccategory external name 'NSDeprecated' (NSApplication)
     function runModalForWindow_relativeToWindow(theWindow: NSWindow; docWindow: NSWindow): NSInteger; message 'runModalForWindow:relativeToWindow:'; deprecated 'in Mac OS X 10 and later';
     function beginModalSessionForWindow_relativeToWindow(theWindow: NSWindow; docWindow: NSWindow): NSModalSession; message 'beginModalSessionForWindow:relativeToWindow:'; deprecated 'in Mac OS X 10 and later';
     procedure application_printFiles(sender: NSApplication; filenames: NSArray); message 'application:printFiles:';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}
@@ -354,7 +352,7 @@ var
 {$define NSAPPLICATION_PAS_P}
   
 { NSApplicationDelegate Protocol }
-  NSApplicationDelegateProtocol = objcprotocol
+  NSApplicationDelegateProtocol = objcprotocol external name 'NSApplicationDelegate'
     function applicationShouldTerminate(sender: NSApplication): NSApplicationTerminateReply; message 'applicationShouldTerminate:';
     function application_openFile(sender: NSApplication; filename: NSString): Boolean; message 'application:openFile:';
     procedure application_openFiles(sender: NSApplication; filenames: NSArray); message 'application:openFiles:';
@@ -382,6 +380,6 @@ var
     procedure applicationDidUpdate(notification: NSNotification); message 'applicationDidUpdate:';
     procedure applicationWillTerminate(notification: NSNotification); message 'applicationWillTerminate:';
     procedure applicationDidChangeScreenParameters(notification: NSNotification); message 'applicationDidChangeScreenParameters:';
-  end; external name 'NSApplicationDelegate';
+  end;
 {$endif}
 {$endif}

+ 5 - 5
packages/cocoaint/src/appkit/NSApplicationScripting.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSApplicationScripting.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -39,15 +39,15 @@
 {$define NSAPPLICATIONSCRIPTING_PAS_C}
 
 { NSScripting_NSApplicationCategory }
-  NSScripting_NSApplicationCategory = objccategory(NSApplication)
+  NSScripting_NSApplicationCategory = objccategory external name 'NSScripting' (NSApplication)
     function orderedDocuments: NSArray; message 'orderedDocuments';
     function orderedWindows: NSArray; message 'orderedWindows';
-  end; external name 'NSScripting';
+  end;
 
 { NSApplicationScriptingDelegationCategory }
-  NSApplicationScriptingDelegationCategory = objccategory(NSObject)
+  NSApplicationScriptingDelegationCategory = objccategory external (NSObject)
     function application_delegateHandlesKey(sender: NSApplication; key: NSString): Boolean; message 'application:delegateHandlesKey:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSArrayController.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSArrayController.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSARRAYCONTROLLER_PAS_C}
 
 { NSArrayController }
-  NSArrayController = objcclass(NSObjectController)
+  NSArrayController = objcclass external (NSObjectController)
   private
     _reserved4: Pointer;
     _rearrangementExtensions: id;
@@ -77,8 +77,6 @@
     _arrangedObjects: NSArray;
     
   public
-    class function alloc: NSArrayController; message 'alloc';
-
     procedure rearrangeObjects; message 'rearrangeObjects';
     procedure setAutomaticallyRearrangesObjects(flag: Boolean); message 'setAutomaticallyRearrangesObjects:';
     function automaticallyRearrangesObjects: Boolean; message 'automaticallyRearrangesObjects';
@@ -126,7 +124,7 @@
     procedure removeObjectsAtArrangedObjectIndexes(indexes: NSIndexSet); message 'removeObjectsAtArrangedObjectIndexes:';
     procedure removeObject(object_: id); message 'removeObject:';
     procedure removeObjects(objects: NSArray); message 'removeObjects:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 15 - 19
packages/cocoaint/src/appkit/NSAttributedString.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSAttributedString.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -154,11 +154,9 @@ var
 {$define NSATTRIBUTEDSTRING_PAS_C}
 
 { NSAttributedString }
-  NSAttributedString = objcclass(NSObject, NSCopyingProtocol, NSMutableCopyingProtocol, NSCodingProtocol)
+  NSAttributedString = objcclass external (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:';
 
@@ -167,20 +165,18 @@ var
     function mutableCopyWithZone(zone_: NSZonePtr): id;
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSMutableAttributedString }
-  NSMutableAttributedString = objcclass(NSAttributedString)
+  NSMutableAttributedString = objcclass external (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:';
-  end; external;
+  end;
 
 { NSExtendedAttributedStringCategory }
-  NSExtendedAttributedStringCategory = objccategory(NSAttributedString)
+  NSExtendedAttributedStringCategory = objccategory external (NSAttributedString)
     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:';
@@ -190,10 +186,10 @@ var
     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:';
-  end; external;
+  end;
 
 { NSExtendedMutableAttributedStringCategory }
-  NSExtendedMutableAttributedStringCategory = objccategory(NSMutableAttributedString)
+  NSExtendedMutableAttributedStringCategory = objccategory external (NSMutableAttributedString)
     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:';
@@ -205,10 +201,10 @@ var
     procedure setAttributedString(attrString: NSAttributedString); message 'setAttributedString:';
     procedure beginEditing; message 'beginEditing';
     procedure endEditing; message 'endEditing';
-  end; external;
+  end;
 
 { NSAttributedStringKitAdditionsCategory }
-  NSAttributedStringKitAdditionsCategory = objccategory(NSAttributedString)
+  NSAttributedStringKitAdditionsCategory = objccategory external (NSAttributedString)
     function fontAttributesInRange(range: NSRange): NSDictionary; message 'fontAttributesInRange:';
     function rulerAttributesInRange(range: NSRange): NSDictionary; message 'rulerAttributesInRange:';
     function containsAttachments: Boolean; message 'containsAttachments';
@@ -240,18 +236,18 @@ var
     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:';
-  end; external;
+  end;
 
 { NSDeprecatedKitAdditionsCategory }
-  NSDeprecatedKitAdditionsCategory = objccategory(NSAttributedString)
+  NSDeprecatedKitAdditionsCategory = objccategory external (NSAttributedString)
     class function textFileTypes: NSArray; message 'textFileTypes';
     class function textPasteboardTypes: NSArray; message 'textPasteboardTypes';
     class function textUnfilteredFileTypes: NSArray; message 'textUnfilteredFileTypes';
     class function textUnfilteredPasteboardTypes: NSArray; message 'textUnfilteredPasteboardTypes';
-  end; external;
+  end;
 
 { NSMutableAttributedStringKitAdditionsCategory }
-  NSMutableAttributedStringKitAdditionsCategory = objccategory(NSMutableAttributedString)
+  NSMutableAttributedStringKitAdditionsCategory = objccategory external (NSMutableAttributedString)
     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:';
@@ -266,7 +262,7 @@ var
     procedure fixFontAttributeInRange(range: NSRange); message 'fixFontAttributeInRange:';
     procedure fixParagraphStyleAttributeInRange(range: NSRange); message 'fixParagraphStyleAttributeInRange:';
     procedure fixAttachmentAttributeInRange(range: NSRange); message 'fixAttachmentAttributeInRange:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSBezierPath.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSBezierPath.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -75,7 +75,7 @@ type
 {$define NSBEZIERPATH_PAS_C}
 
 { NSBezierPath }
-  NSBezierPath = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  NSBezierPath = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
   private
     _elementCount: NSInteger;
     _elementMax: NSInteger;
@@ -105,8 +105,6 @@ type
       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:';
@@ -182,13 +180,13 @@ type
     function copyWithZone(zone_: NSZonePtr): id;
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSBezierPathDeprecatedCategory }
-  NSBezierPathDeprecatedCategory = objccategory(NSBezierPath)
+  NSBezierPathDeprecatedCategory = objccategory external (NSBezierPath)
     function cachesBezierPath: Boolean; message 'cachesBezierPath'; deprecated 'in Mac OS X 10 and later';
     procedure setCachesBezierPath(flag: Boolean); message 'setCachesBezierPath:'; deprecated 'in Mac OS X 10 and later';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSBitmapImageRep.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSBitmapImageRep.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -103,7 +103,7 @@ var
 {$define NSBITMAPIMAGEREP_PAS_C}
 
 { NSBitmapImageRep }
-  NSBitmapImageRep = objcclass(NSImageRep)
+  NSBitmapImageRep = objcclass external (NSImageRep)
   private
     __moreRepFlags: bitpacked record
       case byte of
@@ -130,8 +130,6 @@ var
     _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:';
@@ -169,15 +167,15 @@ var
     function colorSpace: NSColorSpace; message 'colorSpace';
     function bitmapImageRepByConvertingToColorSpace_renderingIntent(targetSpace: NSColorSpace; renderingIntent: NSColorRenderingIntent): NSBitmapImageRep; message 'bitmapImageRepByConvertingToColorSpace:renderingIntent:';
     function bitmapImageRepByRetaggingWithColorSpace(newSpace: NSColorSpace): NSBitmapImageRep; message 'bitmapImageRepByRetaggingWithColorSpace:';
-  end; external;
+  end;
 
 { NSBitmapImageFileTypeExtensionsCategory }
-  NSBitmapImageFileTypeExtensionsCategory = objccategory(NSBitmapImageRep)
+  NSBitmapImageFileTypeExtensionsCategory = objccategory external (NSBitmapImageRep)
     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;
+  end;
 
 {$endif}
 {$endif}

+ 7 - 9
packages/cocoaint/src/appkit/NSBox.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSBox.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -67,7 +67,7 @@ type
 {$define NSBOX_PAS_C}
 
 { NSBox }
-  NSBox = objcclass(NSView)
+  NSBox = objcclass external (NSView)
   private
     _titleCell: id;
     _contentView: id;
@@ -92,8 +92,6 @@ type
     _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:';
@@ -115,15 +113,15 @@ type
     procedure setContentView(aView: NSView); message 'setContentView:';
     function isTransparent: Boolean; message 'isTransparent';
     procedure setTransparent(flag: Boolean); message 'setTransparent:';
-  end; external;
+  end;
 
 { NSKeyboardUI_NSBoxCategory }
-  NSKeyboardUI_NSBoxCategory = objccategory(NSBox)
+  NSKeyboardUI_NSBoxCategory = objccategory external name 'NSKeyboardUI' (NSBox)
     procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
-  end; external name 'NSKeyboardUI';
+  end;
 
 { NSCustomBoxTypePropertiesCategory }
-  NSCustomBoxTypePropertiesCategory = objccategory(NSBox)
+  NSCustomBoxTypePropertiesCategory = objccategory external (NSBox)
     function borderWidth: CGFloat; message 'borderWidth';
     procedure setBorderWidth(borderWidth_: CGFloat); message 'setBorderWidth:';
     function cornerRadius: CGFloat; message 'cornerRadius';
@@ -132,7 +130,7 @@ type
     procedure setBorderColor(borderColor_: NSColor); message 'setBorderColor:';
     function fillColor: NSColor; message 'fillColor';
     procedure setFillColor(fillColor_: NSColor); message 'setFillColor:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 7 - 9
packages/cocoaint/src/appkit/NSBrowser.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSBrowser.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -135,7 +135,7 @@ var
 {$define NSBROWSER_PAS_C}
 
 { NSBrowser }
-  NSBrowser = objcclass(NSControl)
+  NSBrowser = objcclass external (NSControl)
   private
     _target: id;
     _action: SEL;
@@ -157,8 +157,6 @@ var
     _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';
@@ -273,17 +271,17 @@ var
     procedure setBackgroundColor(color: NSColor); message 'setBackgroundColor:';
     function backgroundColor: NSColor; message 'backgroundColor';
     procedure editItemAtIndexPath_withEvent_select(indexPath: NSIndexPath; theEvent: NSEvent; select: Boolean); message 'editItemAtIndexPath:withEvent:select:';
-  end; external;
+  end;
 
 { NSDeprecated_NSBrowserCategory }
-  NSDeprecated_NSBrowserCategory = objccategory(NSBrowser)
+  NSDeprecated_NSBrowserCategory = objccategory external name 'NSDeprecated' (NSBrowser)
     procedure setAcceptsArrowKeys(flag: Boolean); message 'setAcceptsArrowKeys:'; deprecated 'in Mac OS X 10.6 and later';
     function acceptsArrowKeys: Boolean; message 'acceptsArrowKeys'; deprecated 'in Mac OS X 10.6 and later';
     procedure displayColumn(column: NSInteger); message 'displayColumn:'; deprecated 'in Mac OS X 10.3 and later';
     procedure displayAllColumns; message 'displayAllColumns'; deprecated 'in Mac OS X 10.3 and later';
     procedure scrollViaScroller(sender: NSScroller); message 'scrollViaScroller:'; deprecated 'in Mac OS X 10.3 and later';
     procedure updateScroller; message 'updateScroller'; deprecated 'in Mac OS X 10.3 and later';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}
@@ -292,7 +290,7 @@ var
 {$define NSBROWSER_PAS_P}
   
 { NSBrowserDelegate Protocol }
-  NSBrowserDelegateProtocol = objcprotocol
+  NSBrowserDelegateProtocol = objcprotocol external name 'NSBrowserDelegate'
     function browser_numberOfRowsInColumn(sender: NSBrowser; column: NSInteger): NSInteger; message 'browser:numberOfRowsInColumn:';
     procedure browser_createRowsForColumn_inMatrix(sender: NSBrowser; column: NSInteger; matrix: NSMatrix); message 'browser:createRowsForColumn:inMatrix:';
     function browser_numberOfChildrenOfItem(browser: NSBrowser; item: id): NSInteger; message 'browser:numberOfChildrenOfItem:';
@@ -327,6 +325,6 @@ var
     function browser_headerViewControllerForItem(browser: NSBrowser; item: id): NSViewController; message 'browser:headerViewControllerForItem:';
     procedure browser_didChangeLastColumn_toColumn(browser: NSBrowser; oldLastColumn: NSInteger; column: NSInteger); message 'browser:didChangeLastColumn:toColumn:';
     function browser_selectionIndexesForProposedSelection_inColumn(browser: NSBrowser; proposedSelectionIndexes: NSIndexSet; column: NSInteger): NSIndexSet; message 'browser:selectionIndexesForProposedSelection:inColumn:';
-  end; external name 'NSBrowserDelegate';
+  end;
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSBrowserCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSBrowserCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,11 +42,9 @@
 {$define NSBROWSERCELL_PAS_C}
 
 { NSBrowserCell }
-  NSBrowserCell = objcclass(NSCell)
+  NSBrowserCell = objcclass external (NSCell)
     
   public
-    class function alloc: NSBrowserCell; message 'alloc';
-
     class function branchImage: NSImage; message 'branchImage';
     class function highlightedBranchImage: NSImage; message 'highlightedBranchImage';
     function highlightColorInView(controlView_: NSView): NSColor; message 'highlightColorInView:';
@@ -60,7 +58,7 @@
     function image: NSImage; message 'image';
     procedure setAlternateImage(newAltImage: NSImage); message 'setAlternateImage:';
     function alternateImage: NSImage; message 'alternateImage';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 15 - 17
packages/cocoaint/src/appkit/NSButton.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSButton.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,11 +42,9 @@
 {$define NSBUTTON_PAS_C}
 
 { NSButton }
-  NSButton = objcclass(NSControl, NSUserInterfaceValidationsProtocol)
+  NSButton = objcclass external (NSControl, NSUserInterfaceValidationsProtocol)
     
   public
-    class function alloc: NSButton; message 'alloc';
-
     function title: NSString; message 'title';
     procedure setTitle(aString: NSString); message 'setTitle:';
     function alternateTitle: NSString; message 'alternateTitle';
@@ -75,45 +73,45 @@
 
     { Adopted Protocols }
     function validateUserInterfaceItem(anItem: id): Boolean;
-  end; external;
+  end;
 
 { NSKeyboardUI_NSButtonCategory }
-  NSKeyboardUI_NSButtonCategory = objccategory(NSButton)
+  NSKeyboardUI_NSButtonCategory = objccategory external name 'NSKeyboardUI' (NSButton)
     procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
-  end; external name 'NSKeyboardUI';
+  end;
 
 { NSButtonAttributedStringMethodsCategory }
-  NSButtonAttributedStringMethodsCategory = objccategory(NSButton)
+  NSButtonAttributedStringMethodsCategory = objccategory external (NSButton)
     function attributedTitle: NSAttributedString; message 'attributedTitle';
     procedure setAttributedTitle(aString: NSAttributedString); message 'setAttributedTitle:';
     function attributedAlternateTitle: NSAttributedString; message 'attributedAlternateTitle';
     procedure setAttributedAlternateTitle(obj: NSAttributedString); message 'setAttributedAlternateTitle:';
-  end; external;
+  end;
 
 { NSButtonBezelStylesCategory }
-  NSButtonBezelStylesCategory = objccategory(NSButton)
+  NSButtonBezelStylesCategory = objccategory external (NSButton)
     procedure setBezelStyle(bezelStyle_: NSBezelStyle); message 'setBezelStyle:';
     function bezelStyle: NSBezelStyle; message 'bezelStyle';
-  end; external;
+  end;
 
 { NSButtonMixedStateCategory }
-  NSButtonMixedStateCategory = objccategory(NSButton)
+  NSButtonMixedStateCategory = objccategory external (NSButton)
     procedure setAllowsMixedState(flag: Boolean); message 'setAllowsMixedState:';
     function allowsMixedState: Boolean; message 'allowsMixedState';
     procedure setNextState; message 'setNextState';
-  end; external;
+  end;
 
 { NSButtonBorderCategory }
-  NSButtonBorderCategory = objccategory(NSButton)
+  NSButtonBorderCategory = objccategory external (NSButton)
     procedure setShowsBorderOnlyWhileMouseInside(show: Boolean); message 'setShowsBorderOnlyWhileMouseInside:';
     function showsBorderOnlyWhileMouseInside: Boolean; message 'showsBorderOnlyWhileMouseInside';
-  end; external;
+  end;
 
 { NSButtonSoundExtensionsCategory }
-  NSButtonSoundExtensionsCategory = objccategory(NSButton)
+  NSButtonSoundExtensionsCategory = objccategory external (NSButton)
     procedure setSound(aSound: NSSound); message 'setSound:';
     function sound: NSSound; message 'sound';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 13 - 15
packages/cocoaint/src/appkit/NSButtonCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSButtonCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -167,7 +167,7 @@ __BCFlags2Ptr = ^__BCFlags2;
 {$define NSBUTTONCELL_PAS_C}
 
 { NSButtonCell }
-  NSButtonCell = objcclass(NSActionCell)
+  NSButtonCell = objcclass external (NSActionCell)
   private
     _altContents: NSString;
     _sound: id;
@@ -180,8 +180,6 @@ __BCFlags2Ptr = ^__BCFlags2;
     _alternateImageOrKeyEquivalentFont: id;
     
   public
-    class function alloc: NSButtonCell; message 'alloc';
-
     function title: NSString; message 'title';
     procedure setTitle(aString: NSString); message 'setTitle:';
     function alternateTitle: NSString; message 'alternateTitle';
@@ -214,19 +212,19 @@ __BCFlags2Ptr = ^__BCFlags2;
     procedure drawImage_withFrame_inView(image_: NSImage; frame: NSRect; controlView_: NSView); message 'drawImage:withFrame:inView:';
     function drawTitle_withFrame_inView(title_: NSAttributedString; frame: NSRect; controlView_: NSView): NSRect; message 'drawTitle:withFrame:inView:';
     procedure drawBezelWithFrame_inView(frame: NSRect; controlView_: NSView); message 'drawBezelWithFrame:inView:';
-  end; external;
+  end;
 
 { NSKeyboardUI_NSButtonCellCategory }
-  NSKeyboardUI_NSButtonCellCategory = objccategory(NSButtonCell)
+  NSKeyboardUI_NSButtonCellCategory = objccategory external name 'NSKeyboardUI' (NSButtonCell)
     procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
     procedure setAlternateTitleWithMnemonic(stringWithAmpersand: NSString); message 'setAlternateTitleWithMnemonic:';
     procedure setAlternateMnemonicLocation(location: NSUInteger); message 'setAlternateMnemonicLocation:';
     function alternateMnemonicLocation: NSUInteger; message 'alternateMnemonicLocation';
     function alternateMnemonic: NSString; message 'alternateMnemonic';
-  end; external name 'NSKeyboardUI';
+  end;
 
 { NSButtonCellExtensionsCategory }
-  NSButtonCellExtensionsCategory = objccategory(NSButtonCell)
+  NSButtonCellExtensionsCategory = objccategory external (NSButtonCell)
     function gradientType: NSGradientType; message 'gradientType';
     procedure setGradientType(type__: NSGradientType); message 'setGradientType:';
     procedure setImageDimsWhenDisabled(flag: Boolean); message 'setImageDimsWhenDisabled:';
@@ -237,27 +235,27 @@ __BCFlags2Ptr = ^__BCFlags2;
     procedure mouseExited(event: NSEvent); message 'mouseExited:';
     function backgroundColor: NSColor; message 'backgroundColor';
     procedure setBackgroundColor(color: NSColor); message 'setBackgroundColor:';
-  end; external;
+  end;
 
 { NSButtonCellAttributedStringMethodsCategory }
-  NSButtonCellAttributedStringMethodsCategory = objccategory(NSButtonCell)
+  NSButtonCellAttributedStringMethodsCategory = objccategory external (NSButtonCell)
     function attributedTitle: NSAttributedString; message 'attributedTitle';
     procedure setAttributedTitle(obj: NSAttributedString); message 'setAttributedTitle:';
     function attributedAlternateTitle: NSAttributedString; message 'attributedAlternateTitle';
     procedure setAttributedAlternateTitle(obj: NSAttributedString); message 'setAttributedAlternateTitle:';
-  end; external;
+  end;
 
 { NSButtonCellBezelStylesCategory }
-  NSButtonCellBezelStylesCategory = objccategory(NSButtonCell)
+  NSButtonCellBezelStylesCategory = objccategory external (NSButtonCell)
     procedure setBezelStyle(bezelStyle_: NSBezelStyle); message 'setBezelStyle:';
     function bezelStyle: NSBezelStyle; message 'bezelStyle';
-  end; external;
+  end;
 
 { NSButtonCellSoundExtensionsCategory }
-  NSButtonCellSoundExtensionsCategory = objccategory(NSButtonCell)
+  NSButtonCellSoundExtensionsCategory = objccategory external (NSButtonCell)
     procedure setSound(aSound: NSSound); message 'setSound:';
     function sound: NSSound; message 'sound';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSCIImageRep.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCIImageRep.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,24 +42,22 @@
 {$define NSCIIMAGEREP_PAS_C}
 
 { NSCIImageRep }
-  NSCIImageRep = objcclass(NSImageRep)
+  NSCIImageRep = objcclass external (NSImageRep)
   private
     _ciImage: CIImage;
     
   public
-    class function alloc: NSCIImageRep; message 'alloc';
-
     class function imageRepWithCIImage(image: CIImage): id; message 'imageRepWithCIImage:';
     function initWithCIImage(image: CIImage): id; message 'initWithCIImage:';
     function CIImage: CIImage; message 'CIImage';
-  end; external;
+  end;
 
 { NSAppKitAdditions_CIImageCategory }
-  NSAppKitAdditions_CIImageCategory = objccategory(CIImage)
+  NSAppKitAdditions_CIImageCategory = objccategory external name 'NSAppKitAdditions' (CIImage)
     function initWithBitmapImageRep(bitmapImageRep: NSBitmapImageRep): id; message 'initWithBitmapImageRep:';
     procedure drawInRect_fromRect_operation_fraction(rect: NSRect; fromRect: NSRect; op: NSCompositingOperation; delta: CGFloat); message 'drawInRect:fromRect:operation:fraction:';
     procedure drawAtPoint_fromRect_operation_fraction(point: NSPoint; fromRect: NSRect; op: NSCompositingOperation; delta: CGFloat); message 'drawAtPoint:fromRect:operation:fraction:';
-  end; external name 'NSAppKitAdditions';
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSCachedImageRep.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCachedImageRep.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,20 +42,18 @@
 {$define NSCACHEDIMAGEREP_PAS_C}
 
 { NSCachedImageRep }
-  NSCachedImageRep = objcclass(NSImageRep)
+  NSCachedImageRep = objcclass external (NSImageRep)
   private
     _origin: NSPoint;
     _window: NSWindow;
     _cache: Pointer; {garbage collector: __strong }
     
   public
-    class function alloc: NSCachedImageRep; message 'alloc';
-
     function initWithWindow_rect(win: NSWindow; rect: NSRect): id; message 'initWithWindow:rect:';
     function initWithSize_depth_separate_alpha(size_: NSSize; depth: NSWindowDepth; flag: Boolean; alpha: Boolean): id; message 'initWithSize:depth:separate:alpha:';
     function window: NSWindow; message 'window';
     function rect: NSRect; message 'rect';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 17 - 19
packages/cocoaint/src/appkit/NSCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -220,15 +220,13 @@ var
 {$define NSCELL_PAS_C}
 
 { NSCell }
-  NSCell = objcclass(NSObject, NSCopyingProtocol, NSCodingProtocol)
+  NSCell = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
   private
     _contents: id;
     _cFlags: _CFlags;
     _support: id;
     
   public
-    class function alloc: NSCell; message 'alloc';
-
     class function prefersTrackingUntilMouseUp: Boolean; message 'prefersTrackingUntilMouseUp';
     function initTextCell(aString: NSString): id; message 'initTextCell:';
     function initImageCell(image_: NSImage): id; message 'initImageCell:';
@@ -349,10 +347,10 @@ var
     function copyWithZone(zone_: NSZonePtr): id;
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSKeyboardUI_NSCellCategory }
-  NSKeyboardUI_NSCellCategory = objccategory(NSCell)
+  NSKeyboardUI_NSCellCategory = objccategory external name 'NSKeyboardUI' (NSCell)
     procedure setRefusesFirstResponder(flag: Boolean); message 'setRefusesFirstResponder:';
     function refusesFirstResponder: Boolean; message 'refusesFirstResponder';
     function acceptsFirstResponder: Boolean; message 'acceptsFirstResponder';
@@ -367,50 +365,50 @@ var
     function focusRingType: NSFocusRingType; message 'focusRingType';
     class function defaultFocusRingType: NSFocusRingType; message 'defaultFocusRingType';
     function wantsNotificationForMarkedText: Boolean; message 'wantsNotificationForMarkedText';
-  end; external name 'NSKeyboardUI';
+  end;
 
 { NSCellAttributedStringMethodsCategory }
-  NSCellAttributedStringMethodsCategory = objccategory(NSCell)
+  NSCellAttributedStringMethodsCategory = objccategory external (NSCell)
     function attributedStringValue: NSAttributedString; message 'attributedStringValue';
     procedure setAttributedStringValue(obj: NSAttributedString); message 'setAttributedStringValue:';
     function allowsEditingTextAttributes: Boolean; message 'allowsEditingTextAttributes';
     procedure setAllowsEditingTextAttributes(flag: Boolean); message 'setAllowsEditingTextAttributes:';
     function importsGraphics: Boolean; message 'importsGraphics';
     procedure setImportsGraphics(flag: Boolean); message 'setImportsGraphics:';
-  end; external;
+  end;
 
 { NSCellMixedStateCategory }
-  NSCellMixedStateCategory = objccategory(NSCell)
+  NSCellMixedStateCategory = objccategory external (NSCell)
     procedure setAllowsMixedState(flag: Boolean); message 'setAllowsMixedState:';
     function allowsMixedState: Boolean; message 'allowsMixedState';
     function nextState: NSInteger; message 'nextState';
     procedure setNextState; message 'setNextState';
-  end; external;
+  end;
 
 { NSCellHitTestCategory }
-  NSCellHitTestCategory = objccategory(NSCell)
+  NSCellHitTestCategory = objccategory external (NSCell)
     function hitTestForEvent_inRect_ofView(event: NSEvent; cellFrame: NSRect; controlView_: NSView): NSUInteger; message 'hitTestForEvent:inRect:ofView:';
-  end; external;
+  end;
 
 { NSCellExpansionCategory }
-  NSCellExpansionCategory = objccategory(NSCell)
+  NSCellExpansionCategory = objccategory external (NSCell)
     function expansionFrameWithFrame_inView(cellFrame: NSRect; view: NSView): NSRect; message 'expansionFrameWithFrame:inView:';
     procedure drawWithExpansionFrame_inView(cellFrame: NSRect; view: NSView); message 'drawWithExpansionFrame:inView:';
-  end; external;
+  end;
 
 { NSCellBackgroundStyleCategory }
-  NSCellBackgroundStyleCategory = objccategory(NSCell)
+  NSCellBackgroundStyleCategory = objccategory external (NSCell)
     function backgroundStyle: NSBackgroundStyle; message 'backgroundStyle';
     procedure setBackgroundStyle(style: NSBackgroundStyle); message 'setBackgroundStyle:';
     function interiorBackgroundStyle: NSBackgroundStyle; message 'interiorBackgroundStyle';
-  end; external;
+  end;
 
 { NSDeprecated_NSCellCategory }
-  NSDeprecated_NSCellCategory = objccategory(NSCell)
+  NSDeprecated_NSCellCategory = objccategory external name 'NSDeprecated' (NSCell)
     function entryType: NSInteger; message 'entryType'; deprecated 'in Mac OS X 10 and later';
     procedure setEntryType(aType: NSInteger); message 'setEntryType:'; deprecated 'in Mac OS X 10 and later';
     procedure setFloatingPointFormat_left_right(autoRange: Boolean; leftDigits: NSUInteger; rightDigits: NSUInteger); message 'setFloatingPointFormat:left:right:'; deprecated 'in Mac OS X 10 and later';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSClipView.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSClipView.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSCLIPVIEW_PAS_C}
 
 { NSClipView }
-  NSClipView = objcclass(NSView)
+  NSClipView = objcclass external (NSView)
   private
     _backgroundColor: NSColor;
     _docView: NSView;
@@ -75,8 +75,6 @@
       end;
     
   public
-    class function alloc: NSClipView; message 'alloc';
-
     procedure setBackgroundColor(color: NSColor); message 'setBackgroundColor:';
     function backgroundColor: NSColor; message 'backgroundColor';
     procedure setDrawsBackground(flag: Boolean); message 'setDrawsBackground:';
@@ -94,13 +92,13 @@
     function autoscroll(theEvent: NSEvent): Boolean; message 'autoscroll:';
     function constrainScrollPoint(newOrigin: NSPoint): NSPoint; message 'constrainScrollPoint:';
     procedure scrollToPoint(newOrigin: NSPoint); message 'scrollToPoint:';
-  end; external;
+  end;
 
 { NSClipViewSuperviewCategory }
-  NSClipViewSuperviewCategory = objccategory(NSView)
+  NSClipViewSuperviewCategory = objccategory external (NSView)
     procedure reflectScrolledClipView(aClipView: NSClipView); message 'reflectScrolledClipView:';
     procedure scrollClipView_toPoint(aClipView: NSClipView; aPoint: NSPoint); message 'scrollClipView:toPoint:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 7 - 11
packages/cocoaint/src/appkit/NSCollectionView.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCollectionView.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:07 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -57,7 +57,7 @@ const
 {$define NSCOLLECTIONVIEW_PAS_C}
 
 { NSCollectionViewItem }
-  NSCollectionViewItem = objcclass(NSViewController, NSCopyingProtocol)
+  NSCollectionViewItem = objcclass external (NSViewController, NSCopyingProtocol)
   private
     _collectionView: NSCollectionView;
     __cviFlags: bitpacked record
@@ -74,18 +74,16 @@ const
     _reserved2: Pointer;
     
   public
-    class function alloc: NSCollectionViewItem; message 'alloc';
-
     function collectionView: NSCollectionView; message 'collectionView';
     procedure setSelected(flag: Boolean); message 'setSelected:';
     function isSelected: Boolean; message 'isSelected';
 
     { Adopted Protocols }
     function copyWithZone(zone_: NSZonePtr): id;
-  end; external;
+  end;
 
 { NSCollectionView }
-  NSCollectionView = objcclass(NSView)
+  NSCollectionView = objcclass external (NSView)
   private
     _content: NSArray;
     _selectionIndexes: NSMutableIndexSet;
@@ -137,8 +135,6 @@ const
         _reserved: array[0..15] of Pointer;
     
   public
-    class function alloc: NSCollectionView; message 'alloc';
-
     procedure setDelegate(aDelegate: id); message 'setDelegate:';
     function delegate: id; message 'delegate';
     function isFirstResponder: Boolean; message 'isFirstResponder';
@@ -167,7 +163,7 @@ const
     function frameForItemAtIndex(index: NSUInteger): NSRect; message 'frameForItemAtIndex:';
     procedure setDraggingSourceOperationMask_forLocal(dragOperationMask: NSDragOperation; localDestination: Boolean); message 'setDraggingSourceOperationMask:forLocal:';
     function draggingImageForItemsAtIndexes_withEvent_offset(indexes: NSIndexSet; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'draggingImageForItemsAtIndexes:withEvent:offset:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}
@@ -176,13 +172,13 @@ const
 {$define NSCOLLECTIONVIEW_PAS_P}
   
 { NSCollectionViewDelegate Protocol }
-  NSCollectionViewDelegateProtocol = objcprotocol
+  NSCollectionViewDelegateProtocol = objcprotocol external name 'NSCollectionViewDelegate'
     function collectionView_canDragItemsAtIndexes_withEvent(collectionView: NSCollectionView; indexes: NSIndexSet; event: NSEvent): Boolean; message 'collectionView:canDragItemsAtIndexes:withEvent:';
     function collectionView_writeItemsAtIndexes_toPasteboard(collectionView: NSCollectionView; indexes: NSIndexSet; pasteboard: NSPasteboard): Boolean; message 'collectionView:writeItemsAtIndexes:toPasteboard:';
     function collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexes(collectionView: NSCollectionView; dropURL: NSURL; indexes: NSIndexSet): NSArray; message 'collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexes:';
     function collectionView_draggingImageForItemsAtIndexes_withEvent_offset(collectionView: NSCollectionView; indexes: NSIndexSet; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'collectionView:draggingImageForItemsAtIndexes:withEvent:offset:';
     function collectionView_validateDrop_proposedIndex_dropOperation(collectionView: NSCollectionView; draggingInfo: id; proposedDropIndex: NSIntegerPtr; proposedDropOperation: NSCollectionViewDropOperationPtr): NSDragOperation; message 'collectionView:validateDrop:proposedIndex:dropOperation:';
     function collectionView_acceptDrop_index_dropOperation(collectionView: NSCollectionView; draggingInfo: id; index: NSInteger; dropOperation: NSCollectionViewDropOperation): Boolean; message 'collectionView:acceptDrop:index:dropOperation:';
-  end; external name 'NSCollectionViewDelegate';
+  end;
 {$endif}
 {$endif}

+ 9 - 11
packages/cocoaint/src/appkit/NSColor.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColor.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -50,11 +50,9 @@ var
 {$define NSCOLOR_PAS_C}
 
 { NSColor }
-  NSColor = objcclass(NSObject)
+  NSColor = objcclass external (NSObject)
     
   public
-    class function alloc: NSColor; message 'alloc';
-
     class function colorWithCalibratedWhite_alpha(white: CGFloat; alpha: CGFloat): NSColor; message 'colorWithCalibratedWhite:alpha:';
     class function colorWithCalibratedHue_saturation_brightness_alpha(hue: CGFloat; saturation: CGFloat; brightness: CGFloat; alpha: CGFloat): NSColor; message 'colorWithCalibratedHue:saturation:brightness:alpha:';
     class function colorWithCalibratedRed_green_blue_alpha(red: CGFloat; green: CGFloat; blue: CGFloat; alpha: CGFloat): NSColor; message 'colorWithCalibratedRed:green:blue:alpha:';
@@ -154,22 +152,22 @@ var
     procedure drawSwatchInRect(rect: NSRect); message 'drawSwatchInRect:';
     class procedure setIgnoresAlpha(flag: Boolean); message 'setIgnoresAlpha:';
     class function ignoresAlpha: Boolean; message 'ignoresAlpha';
-  end; external;
+  end;
 
 { NSQuartzCoreAdditions_NSColorCategory }
-  NSQuartzCoreAdditions_NSColorCategory = objccategory(NSColor)
+  NSQuartzCoreAdditions_NSColorCategory = objccategory external name 'NSQuartzCoreAdditions' (NSColor)
     class function colorWithCIColor(color: CIColor): NSColor; message 'colorWithCIColor:';
-  end; external name 'NSQuartzCoreAdditions';
+  end;
 
 { NSAppKitAdditionsCategory }
-  NSAppKitAdditionsCategory = objccategory(CIColor)
+  NSAppKitAdditionsCategory = objccategory external (CIColor)
     function initWithColor(color: NSColor): id; message 'initWithColor:';
-  end; external;
+  end;
 
 { NSAppKitColorExtensionsCategory }
-  NSAppKitColorExtensionsCategory = objccategory(NSCoder)
+  NSAppKitColorExtensionsCategory = objccategory external (NSCoder)
     function decodeNXColor: NSColor; message 'decodeNXColor';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSColorList.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorList.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -46,7 +46,7 @@ var
 {$define NSCOLORLIST_PAS_C}
 
 { NSColorList }
-  NSColorList = objcclass(NSObject, NSCodingProtocol)
+  NSColorList = objcclass external (NSObject, NSCodingProtocol)
   private
     _keyArray: NSMutableArray;
     _colorArray: NSMutableArray;
@@ -75,8 +75,6 @@ var
     _clAuxiliaryStorage: id;
     
   public
-    class function alloc: NSColorList; message 'alloc';
-
     class function availableColorLists: NSArray; message 'availableColorLists';
     class function colorListNamed(name_: NSString): NSColorList; message 'colorListNamed:';
     function initWithName(name_: NSString): id; message 'initWithName:';
@@ -94,7 +92,7 @@ var
     { Adopted Protocols }
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 7 - 9
packages/cocoaint/src/appkit/NSColorPanel.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorPanel.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -75,7 +75,7 @@ var
 {$define NSCOLORPANEL_PAS_C}
 
 { NSColorPanel }
-  NSColorPanel = objcclass(NSPanel)
+  NSColorPanel = objcclass external (NSPanel)
   private
     _colorSwatch: id;
     _reserved1: id;
@@ -110,8 +110,6 @@ var
     _opacityTextController: id;
     
   public
-    class function alloc: NSColorPanel; message 'alloc';
-
     class function sharedColorPanel: NSColorPanel; message 'sharedColorPanel';
     class function sharedColorPanelExists: Boolean; message 'sharedColorPanelExists';
     class function dragColor_withEvent_fromView(color_: NSColor; theEvent: NSEvent; sourceView: NSView): Boolean; message 'dragColor:withEvent:fromView:';
@@ -132,17 +130,17 @@ var
     procedure setTarget(anObject: id); message 'setTarget:';
     procedure attachColorList(colorList: NSColorList); message 'attachColorList:';
     procedure detachColorList(colorList: NSColorList); message 'detachColorList:';
-  end; external;
+  end;
 
 { NSColorPanel_NSApplicationCategory }
-  NSColorPanel_NSApplicationCategory = objccategory(NSApplication)
+  NSColorPanel_NSApplicationCategory = objccategory external name 'NSColorPanel' (NSApplication)
     procedure orderFrontColorPanel(sender: id); message 'orderFrontColorPanel:';
-  end; external name 'NSColorPanel';
+  end;
 
 { NSColorPanelResponderMethodCategory }
-  NSColorPanelResponderMethodCategory = objccategory(NSObject)
+  NSColorPanelResponderMethodCategory = objccategory external (NSObject)
     procedure changeColor(sender: id); message 'changeColor:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSColorPicker.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorPicker.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,15 +42,13 @@
 {$define NSCOLORPICKER_PAS_C}
 
 { NSColorPicker }
-  NSColorPicker = objcclass(NSObject, NSColorPickingDefaultProtocol)
+  NSColorPicker = objcclass external (NSObject, NSColorPickingDefaultProtocol)
   private
     _imageObject: id;
     _colorPanel: NSColorPanel;
     _buttonToolTip: NSString;
     
   public
-    class function alloc: NSColorPicker; message 'alloc';
-
     function initWithPickerMask_colorPanel(mask: NSUInteger; owningColorPanel: NSColorPanel): id; message 'initWithPickerMask:colorPanel:';
     function colorPanel: NSColorPanel; message 'colorPanel';
     function provideNewButtonImage: NSImage; message 'provideNewButtonImage';
@@ -64,7 +62,7 @@
 
     { Adopted Protocols }
     procedure alphaControlAddedOrRemoved(sender: id);
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 5
packages/cocoaint/src/appkit/NSColorPicking.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorPicking.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -40,7 +40,7 @@
 {$define NSCOLORPICKING_PAS_P}
   
 { NSColorPickingDefault Protocol }
-  NSColorPickingDefaultProtocol = objcprotocol
+  NSColorPickingDefaultProtocol = objcprotocol external name 'NSColorPickingDefault'
     function initWithPickerMask_colorPanel(mask: NSUInteger; owningColorPanel: NSColorPanel): id; message 'initWithPickerMask:colorPanel:';
     function provideNewButtonImage: NSImage; message 'provideNewButtonImage';
     procedure insertNewButtonImage_in(newButtonImage: NSImage; buttonCell: NSButtonCell); message 'insertNewButtonImage:in:';
@@ -51,14 +51,14 @@
     procedure setMode(mode: NSColorPanelMode); message 'setMode:';
     function buttonToolTip: NSString; message 'buttonToolTip';
     function minContentSize: NSSize; message 'minContentSize';
-  end; external name 'NSColorPickingDefault';
+  end;
   
 { NSColorPickingCustom Protocol }
-  NSColorPickingCustomProtocol = objcprotocol
+  NSColorPickingCustomProtocol = objcprotocol external name 'NSColorPickingCustom'
     function supportsMode(mode: NSColorPanelMode): Boolean; message 'supportsMode:';
     function currentMode: NSColorPanelMode; message 'currentMode';
     function provideNewView(initialRequest: Boolean): NSView; message 'provideNewView:';
     procedure setColor(newColor: NSColor); message 'setColor:';
-  end; external name 'NSColorPickingCustom';
+  end;
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSColorSpace.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorSpace.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -59,7 +59,7 @@ type
 {$define NSCOLORSPACE_PAS_C}
 
 { NSColorSpace }
-  NSColorSpace = objcclass(NSObject, NSCodingProtocol)
+  NSColorSpace = objcclass external (NSObject, NSCodingProtocol)
   private
     _profile: id;
     __flags: bitpacked record
@@ -79,8 +79,6 @@ type
         _reserved: array[0..4] of Pointer;
     
   public
-    class function alloc: NSColorSpace; message 'alloc';
-
     function initWithICCProfileData(iccData: NSData): id; message 'initWithICCProfileData:';
     function ICCProfileData: NSData; message 'ICCProfileData';
     function initWithColorSyncProfile(prof: Pointer): id; message 'initWithColorSyncProfile:';
@@ -104,7 +102,7 @@ type
     { Adopted Protocols }
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSColorWell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSColorWell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSCOLORWELL_PAS_C}
 
 { NSColorWell }
-  NSColorWell = objcclass(NSControl)
+  NSColorWell = objcclass external (NSControl)
   private
     _color: NSColor;
     _target: id;
@@ -60,8 +60,6 @@
       end;
     
   public
-    class function alloc: NSColorWell; message 'alloc';
-
     procedure deactivate; message 'deactivate';
     procedure activate(exclusive: Boolean); message 'activate:';
     function isActive: Boolean; message 'isActive';
@@ -71,7 +69,7 @@
     procedure takeColorFrom(sender: id); message 'takeColorFrom:';
     procedure setColor(color_: NSColor); message 'setColor:';
     function color: NSColor; message 'color';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 7 - 9
packages/cocoaint/src/appkit/NSComboBox.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSComboBox.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -51,13 +51,11 @@ var
 {$define NSCOMBOBOX_PAS_C}
 
 { NSComboBox }
-  NSComboBox = objcclass(NSTextField)
+  NSComboBox = objcclass external (NSTextField)
   private
     _dataSource: id;
     
   public
-    class function alloc: NSComboBox; message 'alloc';
-
     function hasVerticalScroller: Boolean; message 'hasVerticalScroller';
     procedure setHasVerticalScroller(flag: Boolean); message 'setHasVerticalScroller:';
     function intercellSpacing: NSSize; message 'intercellSpacing';
@@ -95,7 +93,7 @@ var
     function objectValueOfSelectedItem: id; message 'objectValueOfSelectedItem';
     function indexOfItemWithObjectValue(object_: id): NSInteger; message 'indexOfItemWithObjectValue:';
     function objectValues: NSArray; message 'objectValues';
-  end; external;
+  end;
 
 {$endif}
 {$endif}
@@ -104,19 +102,19 @@ var
 {$define NSCOMBOBOX_PAS_P}
   
 { NSComboBoxDataSource Protocol }
-  NSComboBoxDataSourceProtocol = objcprotocol
+  NSComboBoxDataSourceProtocol = objcprotocol external name 'NSComboBoxDataSource'
     function numberOfItemsInComboBox(aComboBox: NSComboBox): NSInteger; message 'numberOfItemsInComboBox:';
     function comboBox_objectValueForItemAtIndex(aComboBox: NSComboBox; index: NSInteger): id; message 'comboBox:objectValueForItemAtIndex:';
     function comboBox_indexOfItemWithStringValue(aComboBox: NSComboBox; string_: NSString): NSUInteger; message 'comboBox:indexOfItemWithStringValue:';
     function comboBox_completedString(aComboBox: NSComboBox; string_: NSString): NSString; message 'comboBox:completedString:';
-  end; external name 'NSComboBoxDataSource';
+  end;
   
 { NSComboBoxDelegate Protocol }
-  NSComboBoxDelegateProtocol = objcprotocol
+  NSComboBoxDelegateProtocol = objcprotocol external name 'NSComboBoxDelegate'
     procedure comboBoxWillPopUp(notification: NSNotification); message 'comboBoxWillPopUp:';
     procedure comboBoxWillDismiss(notification: NSNotification); message 'comboBoxWillDismiss:';
     procedure comboBoxSelectionDidChange(notification: NSNotification); message 'comboBoxSelectionDidChange:';
     procedure comboBoxSelectionIsChanging(notification: NSNotification); message 'comboBoxSelectionIsChanging:';
-  end; external name 'NSComboBoxDelegate';
+  end;
 {$endif}
 {$endif}

+ 5 - 6
packages/cocoaint/src/appkit/NSComboBoxCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSComboBoxCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -43,7 +43,7 @@
 {$define NSCOMBOBOXCELL_PAS_C}
 
 { NSComboBoxCell }
-  NSComboBoxCell = objcclass(NSTextFieldCell)
+  NSComboBoxCell = objcclass external (NSTextFieldCell)
   private
     _delegate: id;
     _dataSource: id;
@@ -71,8 +71,7 @@
     _reserved: Pointer;
     
   public
-    class function alloc: NSComboBoxCell; message 'alloc';
-  end; external;
+  end;
 
 {$endif}
 {$endif}
@@ -81,11 +80,11 @@
 {$define NSCOMBOBOXCELL_PAS_P}
   
 { NSComboBoxCellDataSource Protocol }
-  NSComboBoxCellDataSourceProtocol = objcprotocol
+  NSComboBoxCellDataSourceProtocol = objcprotocol external name 'NSComboBoxCellDataSource'
     function numberOfItemsInComboBoxCell(comboBoxCell: NSComboBoxCell): NSInteger; message 'numberOfItemsInComboBoxCell:';
     function comboBoxCell_objectValueForItemAtIndex(aComboBoxCell: NSComboBoxCell; index: NSInteger): id; message 'comboBoxCell:objectValueForItemAtIndex:';
     function comboBoxCell_indexOfItemWithStringValue(aComboBoxCell: NSComboBoxCell; string_: NSString): NSUInteger; message 'comboBoxCell:indexOfItemWithStringValue:';
     function comboBoxCell_completedString(aComboBoxCell: NSComboBoxCell; uncompletedString: NSString): NSString; message 'comboBoxCell:completedString:';
-  end; external name 'NSComboBoxCellDataSource';
+  end;
 {$endif}
 {$endif}

+ 13 - 15
packages/cocoaint/src/appkit/NSControl.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSControl.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -49,7 +49,7 @@ var
 {$define NSCONTROL_PAS_C}
 
 { NSControl }
-  NSControl = objcclass(NSView)
+  NSControl = objcclass external (NSView)
   private
     _tag: NSInteger;
     _cell: id;
@@ -68,8 +68,6 @@ var
       end;
     
   public
-    class function alloc: NSControl; message 'alloc';
-
     class procedure setCellClass(factoryId: Pobjc_class); message 'setCellClass:';
     class function cellClass: Pobjc_class; message 'cellClass';
     function initWithFrame(frameRect: NSRect): id; message 'initWithFrame:';
@@ -129,32 +127,32 @@ var
     function integerValue: NSInteger; message 'integerValue';
     procedure setIntegerValue(anInteger: NSInteger); message 'setIntegerValue:';
     procedure takeIntegerValueFrom(sender: id); message 'takeIntegerValueFrom:';
-  end; external;
+  end;
 
 { NSKeyboardUI_NSControlCategory }
-  NSKeyboardUI_NSControlCategory = objccategory(NSControl)
+  NSKeyboardUI_NSControlCategory = objccategory external name 'NSKeyboardUI' (NSControl)
     procedure performClick(sender: id); message 'performClick:';
     procedure setRefusesFirstResponder(flag: Boolean); message 'setRefusesFirstResponder:';
     function refusesFirstResponder: Boolean; message 'refusesFirstResponder';
-  end; external name 'NSKeyboardUI';
+  end;
 
 { NSControlSubclassNotificationsCategory }
-  NSControlSubclassNotificationsCategory = objccategory(NSObject)
+  NSControlSubclassNotificationsCategory = objccategory external (NSObject)
     procedure controlTextDidBeginEditing(obj: NSNotification); message 'controlTextDidBeginEditing:';
     procedure controlTextDidEndEditing(obj: NSNotification); message 'controlTextDidEndEditing:';
     procedure controlTextDidChange(obj: NSNotification); message 'controlTextDidChange:';
-  end; external;
+  end;
 
 { NSControlAttributedStringMethodsCategory }
-  NSControlAttributedStringMethodsCategory = objccategory(NSControl)
+  NSControlAttributedStringMethodsCategory = objccategory external (NSControl)
     function attributedStringValue: NSAttributedString; message 'attributedStringValue';
     procedure setAttributedStringValue(obj: NSAttributedString); message 'setAttributedStringValue:';
-  end; external;
+  end;
 
 { NSDeprecated_NSControlCategory }
-  NSDeprecated_NSControlCategory = objccategory(NSControl)
+  NSDeprecated_NSControlCategory = objccategory external name 'NSDeprecated' (NSControl)
     procedure setFloatingPointFormat_left_right(autoRange: Boolean; leftDigits: NSUInteger; rightDigits: NSUInteger); message 'setFloatingPointFormat:left:right:'; deprecated 'in Mac OS X 10 and later';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}
@@ -163,7 +161,7 @@ var
 {$define NSCONTROL_PAS_P}
   
 { NSControlTextEditingDelegate Protocol }
-  NSControlTextEditingDelegateProtocol = objcprotocol
+  NSControlTextEditingDelegateProtocol = objcprotocol external name 'NSControlTextEditingDelegate'
     function control_textShouldBeginEditing(control: NSControl; fieldEditor: NSText): Boolean; message 'control:textShouldBeginEditing:';
     function control_textShouldEndEditing(control: NSControl; fieldEditor: NSText): Boolean; message 'control:textShouldEndEditing:';
     function control_didFailToFormatString_errorDescription(control: NSControl; string_: NSString; error: NSString): Boolean; message 'control:didFailToFormatString:errorDescription:';
@@ -171,6 +169,6 @@ var
     function control_isValidObject(control: NSControl; obj: id): Boolean; message 'control:isValidObject:';
     function control_textView_doCommandBySelector(control: NSControl; textView: NSTextView; commandSelector: SEL): Boolean; message 'control:textView:doCommandBySelector:';
     function control_textView_completions_forPartialWordRange_indexOfSelectedItem(control: NSControl; textView: NSTextView; words: NSArray; charRange: NSRange; index: NSIntegerPtr): NSArray; message 'control:textView:completions:forPartialWordRange:indexOfSelectedItem:';
-  end; external name 'NSControlTextEditingDelegate';
+  end;
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSController.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSController.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSCONTROLLER_PAS_C}
 
 { NSController }
-  NSController = objcclass(NSObject, NSCodingProtocol)
+  NSController = objcclass external (NSObject, NSCodingProtocol)
   private
     _reserved: Pointer;
     _reserved2: Pointer;
@@ -70,8 +70,6 @@
     _singleValueAccessor: id;
     
   public
-    class function alloc: NSController; message 'alloc';
-
     procedure objectDidBeginEditing(editor: id); message 'objectDidBeginEditing:';
     procedure objectDidEndEditing(editor: id); message 'objectDidEndEditing:';
     procedure discardEditing; message 'discardEditing';
@@ -82,7 +80,7 @@
     { Adopted Protocols }
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSCursor.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCursor.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -46,7 +46,7 @@ const
 {$define NSCURSOR_PAS_C}
 
 { NSCursor }
-  NSCursor = objcclass(NSObject, NSCodingProtocol)
+  NSCursor = objcclass external (NSObject, NSCodingProtocol)
   private
     _hotSpot: NSPoint;
     __flags: bitpacked record
@@ -62,8 +62,6 @@ const
     _image: id;
     
   public
-    class function alloc: NSCursor; message 'alloc';
-
     class function currentCursor: NSCursor; message 'currentCursor';
     class function currentSystemCursor: NSCursor; message 'currentSystemCursor';
     class function arrowCursor: NSCursor; message 'arrowCursor';
@@ -103,7 +101,7 @@ const
     { Adopted Protocols }
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSCustomImageRep.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSCustomImageRep.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,19 +42,17 @@
 {$define NSCUSTOMIMAGEREP_PAS_C}
 
 { NSCustomImageRep }
-  NSCustomImageRep = objcclass(NSImageRep)
+  NSCustomImageRep = objcclass external (NSImageRep)
   private
     _drawMethod: SEL;
     _drawObject: id;
     _reserved: cuint;
     
   public
-    class function alloc: NSCustomImageRep; message 'alloc';
-
     function initWithDrawSelector_delegate(aMethod: SEL; anObject: id): id; message 'initWithDrawSelector:delegate:';
     function drawSelector: SEL; message 'drawSelector';
     function delegate: id; message 'delegate';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 3 - 5
packages/cocoaint/src/appkit/NSDatePicker.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDatePicker.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,11 +42,9 @@
 {$define NSDATEPICKER_PAS_C}
 
 { NSDatePicker }
-  NSDatePicker = objcclass(NSControl)
+  NSDatePicker = objcclass external (NSControl)
     
   public
-    class function alloc: NSDatePicker; message 'alloc';
-
     function datePickerStyle: NSDatePickerStyle; message 'datePickerStyle';
     procedure setDatePickerStyle(newStyle: NSDatePickerStyle); message 'setDatePickerStyle:';
     function isBezeled: Boolean; message 'isBezeled';
@@ -79,7 +77,7 @@
     procedure setMaxDate(date: NSDate); message 'setMaxDate:';
     function delegate: id; message 'delegate';
     procedure setDelegate(anObject: id); message 'setDelegate:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSDatePickerCell.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDatePickerCell.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -71,7 +71,7 @@ type
 {$define NSDATEPICKERCELL_PAS_C}
 
 { NSDatePickerCell }
-  NSDatePickerCell = objcclass(NSActionCell)
+  NSDatePickerCell = objcclass external (NSActionCell)
   private
     _timeInterval: NSTimeInterval;
     _minDate: NSDate;
@@ -105,8 +105,6 @@ type
     _reserved4: id;
     
   public
-    class function alloc: NSDatePickerCell; message 'alloc';
-
     function datePickerStyle: NSDatePickerStyle; message 'datePickerStyle';
     procedure setDatePickerStyle(newStyle: NSDatePickerStyle); message 'setDatePickerStyle:';
     function drawsBackground: Boolean; message 'drawsBackground';
@@ -135,7 +133,7 @@ type
     procedure setMaxDate(date: NSDate); message 'setMaxDate:';
     function delegate: id; message 'delegate';
     procedure setDelegate(anObject: id); message 'setDelegate:';
-  end; external;
+  end;
 
 {$endif}
 {$endif}
@@ -144,8 +142,8 @@ type
 {$define NSDATEPICKERCELL_PAS_P}
   
 { NSDatePickerCellDelegate Protocol }
-  NSDatePickerCellDelegateProtocol = objcprotocol
+  NSDatePickerCellDelegateProtocol = objcprotocol external name 'NSDatePickerCellDelegate'
     procedure datePickerCell_validateProposedDateValue_timeInterval(aDatePickerCell: NSDatePickerCell; proposedDateValue: NSDatePointer; proposedTimeInterval: NSTimeIntervalPtr); message 'datePickerCell:validateProposedDateValue:timeInterval:';
-  end; external name 'NSDatePickerCellDelegate';
+  end;
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSDictionaryController.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDictionaryController.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:20 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSDICTIONARYCONTROLLER_PAS_C}
 
 { NSDictionaryController }
-  NSDictionaryController = objcclass(NSArrayController)
+  NSDictionaryController = objcclass external (NSArrayController)
   private
     _reserved5: Pointer;
     _reserved6: Pointer;
@@ -67,8 +67,6 @@
       end;
     
   public
-    class function alloc: NSDictionaryController; message 'alloc';
-
     function newObject: id; message 'newObject';
     procedure setInitialKey(key: NSString); message 'setInitialKey:';
     function initialKey: NSString; message 'initialKey';
@@ -82,10 +80,10 @@
     function localizedKeyDictionary: NSDictionary; message 'localizedKeyDictionary';
     procedure setLocalizedKeyTable(stringsFileName: NSString); message 'setLocalizedKeyTable:';
     function localizedKeyTable: NSString; message 'localizedKeyTable';
-  end; external;
+  end;
 
 { NSDictionaryControllerKeyValuePairCategory }
-  NSDictionaryControllerKeyValuePairCategory = objccategory(NSObject)
+  NSDictionaryControllerKeyValuePairCategory = objccategory external (NSObject)
     procedure setLocalizedKey(localizedKey: NSString); message 'setLocalizedKey:';
     function localizedKey: NSString; message 'localizedKey';
     procedure setKey(key: NSString); message 'setKey:';
@@ -93,7 +91,7 @@
     procedure setValue(value: id); message 'setValue:';
     function value: id; message 'value';
     function isExplicitlyIncluded: Boolean; message 'isExplicitlyIncluded';
-  end; external;
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSDockTile.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDockTile.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -47,7 +47,7 @@ const
 {$define NSDOCKTILE_PAS_C}
 
 { NSDockTile }
-  NSDockTile = objcclass(NSObject)
+  NSDockTile = objcclass external (NSObject)
   private
     _owner: id;
     _dockContextRef: Pointer;
@@ -67,8 +67,6 @@ const
         reserved: array[0..4] of id;
     
   public
-    class function alloc: NSDockTile; message 'alloc';
-
     function size: NSSize; message 'size';
     procedure setContentView(view: NSView); message 'setContentView:';
     function contentView: NSView; message 'contentView';
@@ -78,7 +76,7 @@ const
     procedure setBadgeLabel(string_: NSString); message 'setBadgeLabel:';
     function badgeLabel: NSString; message 'badgeLabel';
     function owner: id; message 'owner';
-  end; external;
+  end;
 
 {$endif}
 {$endif}
@@ -87,9 +85,9 @@ const
 {$define NSDOCKTILE_PAS_P}
   
 { NSDockTilePlugIn Protocol }
-  NSDockTilePlugInProtocol = objcprotocol
+  NSDockTilePlugInProtocol = objcprotocol external name 'NSDockTilePlugIn'
     procedure setDockTile(dockTile: NSDockTile); message 'setDockTile:';
     function dockMenu: NSMenu; message 'dockMenu';
-  end; external name 'NSDockTilePlugIn';
+  end;
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSDocument.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDocument.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -65,7 +65,7 @@ type
 {$define NSDOCUMENT_PAS_C}
 
 { NSDocument }
-  NSDocument = objcclass(NSObject, NSUserInterfaceValidationsProtocol)
+  NSDocument = objcclass external (NSObject, NSUserInterfaceValidationsProtocol)
   private
     _window: NSWindow;
     _windowControllers: id;
@@ -96,8 +96,6 @@ type
     _savePanelSaveType: NSString;
     
   public
-    class function alloc: NSDocument; message 'alloc';
-
     function init: id; message 'init';
     function initWithType_error(typeName: NSString; outError: NSErrorPointer): id; message 'initWithType:error:';
     class function canConcurrentlyReadDocumentsOfType(typeName: NSString): Boolean; message 'canConcurrentlyReadDocumentsOfType:';
@@ -178,10 +176,10 @@ type
     function validateUserInterfaceItem(anItem: id): Boolean; message 'validateUserInterfaceItem:';
 
     { Adopted Protocols }
-  end; external;
+  end;
 
 { NSDeprecated_NSDocumentCategory }
-  NSDeprecated_NSDocumentCategory = objccategory(NSDocument)
+  NSDeprecated_NSDocumentCategory = objccategory external name 'NSDeprecated' (NSDocument)
     function dataRepresentationOfType(type_: NSString): NSData; message 'dataRepresentationOfType:'; deprecated 'in Mac OS X 10.4 and later';
     function fileAttributesToWriteToFile_ofType_saveOperation(fullDocumentPath: NSString; documentTypeName: NSString; saveOperationType: NSSaveOperationType): NSDictionary; message 'fileAttributesToWriteToFile:ofType:saveOperation:';
     function fileName: NSString; message 'fileName'; deprecated 'in Mac OS X 10.4 and later';
@@ -202,7 +200,7 @@ type
     function writeToFile_ofType_originalFile_saveOperation(fullDocumentPath: NSString; documentTypeName: NSString; fullOriginalDocumentPath: NSString; saveOperationType: NSSaveOperationType): Boolean; message 'writeToFile:ofType:originalFile:saveOperation:'; deprecated 'in Mac OS X 10.4 and later';
     function writeToURL_ofType(url: NSURL; type_: NSString): Boolean; message 'writeToURL:ofType:'; deprecated 'in Mac OS X 10.4 and later';
     function writeWithBackupToFile_ofType_saveOperation(fullDocumentPath: NSString; documentTypeName: NSString; saveOperationType: NSSaveOperationType): Boolean; message 'writeWithBackupToFile:ofType:saveOperation:'; deprecated 'in Mac OS X 10.4 and later';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}

+ 5 - 7
packages/cocoaint/src/appkit/NSDocumentController.inc

@@ -1,5 +1,5 @@
 { Parsed from Appkit.framework NSDocumentController.h }
-{ Version: 2.1.2 - Wed Dec 8 10:06:06 CET 2010 }
+{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }
 
 
 {$ifdef TYPES}
@@ -42,7 +42,7 @@
 {$define NSDOCUMENTCONTROLLER_PAS_C}
 
 { NSDocumentController }
-  NSDocumentController = objcclass(NSObject, NSCodingProtocol, NSUserInterfaceValidationsProtocol)
+  NSDocumentController = objcclass external (NSObject, NSCodingProtocol, NSUserInterfaceValidationsProtocol)
   private
     _documents: id;
     _moreVars: id;
@@ -51,8 +51,6 @@
     _recentsLimit: cint;
     
   public
-    class function alloc: NSDocumentController; message 'alloc';
-
     class function sharedDocumentController: id; message 'sharedDocumentController';
     function init: id; message 'init';
     function documents: NSArray; message 'documents';
@@ -96,10 +94,10 @@
     { Adopted Protocols }
     procedure encodeWithCoder(aCoder: NSCoder);
     function initWithCoder(aDecoder: NSCoder): id;
-  end; external;
+  end;
 
 { NSDeprecated_NSDocumentControllerCategory }
-  NSDeprecated_NSDocumentControllerCategory = objccategory(NSDocumentController)
+  NSDeprecated_NSDocumentControllerCategory = objccategory external name 'NSDeprecated' (NSDocumentController)
     function fileExtensionsFromType(typeName: NSString): NSArray; message 'fileExtensionsFromType:'; deprecated 'in Mac OS X 10.5 and later';
     function typeFromFileExtension(fileNameExtensionOrHFSFileType: NSString): NSString; message 'typeFromFileExtension:'; deprecated 'in Mac OS X 10.5 and later';
     function documentForFileName(fileName: NSString): id; message 'documentForFileName:'; deprecated 'in Mac OS X 10.4 and later';
@@ -112,7 +110,7 @@
     function openUntitledDocumentOfType_display(type_: NSString; display: Boolean): id; message 'openUntitledDocumentOfType:display:'; deprecated 'in Mac OS X 10.4 and later';
     procedure setShouldCreateUI(flag: Boolean); message 'setShouldCreateUI:'; deprecated 'in Mac OS X 10.4 and later';
     function shouldCreateUI: Boolean; message 'shouldCreateUI'; deprecated 'in Mac OS X 10.4 and later';
-  end; external name 'NSDeprecated';
+  end;
 
 {$endif}
 {$endif}

Некоторые файлы не были показаны из-за большого количества измененных файлов