classes.pp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {
  2. This file is part of the Free Component Library (FCL)
  3. Copyright (c) 1998-2006 by Michael Van Canneyt and Florian Klaempfl
  4. Classes unit for winx64
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$H+}
  13. {$IF FPC_FULLVERSION>=30301}
  14. {$modeswitch FUNCTIONREFERENCES}
  15. {$define FPC_HAS_REFERENCE_PROCEDURE}
  16. {$endif}
  17. { determine the type of the resource/form file }
  18. { $define Win16Res}
  19. {$IFNDEF FPC_DOTTEDUNITS}
  20. unit Classes;
  21. {$ENDIF FPC_DOTTEDUNITS}
  22. interface
  23. {$IFDEF FPC_DOTTEDUNITS}
  24. uses
  25. System.RtlConsts,
  26. System.SysUtils,
  27. System.Types,
  28. System.SortBase,
  29. {$ifdef FPC_TESTGENERICS}
  30. System.FGL,
  31. {$endif}
  32. System.TypInfo,
  33. WinApi.Windows;
  34. {$ELSE FPC_DOTTEDUNITS}
  35. uses
  36. rtlconsts,
  37. sysutils,
  38. types,
  39. sortbase,
  40. {$ifdef FPC_TESTGENERICS}
  41. fgl,
  42. {$endif}
  43. typinfo,
  44. windows;
  45. {$ENDIF FPC_DOTTEDUNITS}
  46. type
  47. TWndMethod = procedure(var msg : TMessage) of object;
  48. function MakeObjectInstance(Method: TWndMethod): Pointer;
  49. procedure FreeObjectInstance(ObjectInstance: Pointer);
  50. function AllocateHWnd(Method: TWndMethod): HWND;
  51. procedure DeallocateHWnd(Wnd: HWND);
  52. {$i classesh.inc}
  53. implementation
  54. {$IFDEF FPC_DOTTEDUNITS}
  55. uses
  56. System.SysConst;
  57. {$ELSE FPC_DOTTEDUNITS}
  58. uses
  59. sysconst;
  60. {$ENDIF FPC_DOTTEDUNITS}
  61. { OS - independent class implementations are in /inc directory. }
  62. {$i classes.inc}
  63. function MakeObjectInstance(Method: TWndMethod): Pointer;
  64. begin
  65. runerror(211);
  66. MakeObjectInstance:=nil;
  67. end;
  68. procedure FreeObjectInstance(ObjectInstance: Pointer);
  69. begin
  70. runerror(211);
  71. end;
  72. function AllocateHWnd(Method: TWndMethod): HWND;
  73. begin
  74. runerror(211);
  75. AllocateHWnd:=0;
  76. end;
  77. procedure DeallocateHWnd(Wnd: HWND);
  78. begin
  79. runerror(211);
  80. end;
  81. initialization
  82. CommonInit;
  83. finalization
  84. CommonCleanup;
  85. end.