classes.pp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. {$modeswitch advancedrecords}
  14. {$IF FPC_FULLVERSION>=30301}
  15. {$modeswitch FUNCTIONREFERENCES}
  16. {$define FPC_HAS_REFERENCE_PROCEDURE}
  17. {$endif}
  18. { determine the type of the resource/form file }
  19. { $define Win16Res}
  20. {$IFNDEF FPC_DOTTEDUNITS}
  21. unit Classes;
  22. {$ENDIF FPC_DOTTEDUNITS}
  23. interface
  24. {$IFDEF FPC_DOTTEDUNITS}
  25. uses
  26. System.RtlConsts,
  27. System.SysUtils,
  28. System.Types,
  29. System.SortBase,
  30. {$ifdef FPC_TESTGENERICS}
  31. System.FGL,
  32. {$endif}
  33. System.TypInfo,
  34. WinApi.Windows;
  35. {$ELSE FPC_DOTTEDUNITS}
  36. uses
  37. rtlconsts,
  38. sysutils,
  39. types,
  40. sortbase,
  41. {$ifdef FPC_TESTGENERICS}
  42. fgl,
  43. {$endif}
  44. typinfo,
  45. {$IF DEFINED(CPUARM) or DEFINED(CPUAARCH64) }
  46. intrinsics,
  47. {$ENDIF}
  48. windows;
  49. {$ENDIF FPC_DOTTEDUNITS}
  50. type
  51. TWndMethod = procedure(var msg : TMessage) of object;
  52. function MakeObjectInstance(Method: TWndMethod): Pointer;
  53. procedure FreeObjectInstance(ObjectInstance: Pointer);
  54. function AllocateHWnd(Method: TWndMethod): HWND;
  55. procedure DeallocateHWnd(Wnd: HWND);
  56. {$i classesh.inc}
  57. implementation
  58. {$IFDEF FPC_DOTTEDUNITS}
  59. uses
  60. System.SysConst;
  61. {$ELSE FPC_DOTTEDUNITS}
  62. uses
  63. sysconst;
  64. {$ENDIF FPC_DOTTEDUNITS}
  65. { OS - independent class implementations are in /inc directory. }
  66. {$i classes.inc}
  67. function MakeObjectInstance(Method: TWndMethod): Pointer;
  68. begin
  69. runerror(211);
  70. MakeObjectInstance:=nil;
  71. end;
  72. procedure FreeObjectInstance(ObjectInstance: Pointer);
  73. begin
  74. runerror(211);
  75. end;
  76. function AllocateHWnd(Method: TWndMethod): HWND;
  77. begin
  78. runerror(211);
  79. AllocateHWnd:=0;
  80. end;
  81. procedure DeallocateHWnd(Wnd: HWND);
  82. begin
  83. runerror(211);
  84. end;
  85. initialization
  86. CommonInit;
  87. finalization
  88. CommonCleanup;
  89. end.