classes.pp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. {$ifndef CPULLVM}
  18. {$if DEFINED(CPUARM) or DEFINED(CPUAARCH64)}
  19. {$define FPC_USE_INTRINSICS}
  20. {$endif}
  21. {$if defined(CPUPOWERPC) or defined(CPUPOWERPC64)}
  22. {$define FPC_USE_INTRINSICS}
  23. {$endif}
  24. {$if defined(CPURISCV32) or defined(CPURISCV64)}
  25. {$define FPC_USE_INTRINSICS}
  26. {$endif}
  27. {$endif}
  28. {$endif}
  29. { determine the type of the resource/form file }
  30. { $define Win16Res}
  31. {$IFNDEF FPC_DOTTEDUNITS}
  32. unit Classes;
  33. {$ENDIF FPC_DOTTEDUNITS}
  34. interface
  35. {$IFDEF FPC_DOTTEDUNITS}
  36. uses
  37. System.RtlConsts,
  38. System.SysUtils,
  39. System.Types,
  40. System.SortBase,
  41. {$ifdef FPC_TESTGENERICS}
  42. System.FGL,
  43. {$endif}
  44. System.TypInfo,
  45. {$ifdef FPC_USE_INTRINSICS}
  46. System.Intrinsics,
  47. {$endif}
  48. WinApi.Windows;
  49. {$ELSE FPC_DOTTEDUNITS}
  50. uses
  51. rtlconsts,
  52. sysutils,
  53. types,
  54. sortbase,
  55. {$ifdef FPC_TESTGENERICS}
  56. fgl,
  57. {$endif}
  58. typinfo,
  59. {$ifdef FPC_USE_INTRINSICS}
  60. intrinsics,
  61. {$endif}
  62. windows;
  63. {$ENDIF FPC_DOTTEDUNITS}
  64. { Also set FPC_USE_INTRINSICS for i386 and x86_64,
  65. but only after _USES clause as there
  66. is not intinsics unit for those CPUs }
  67. {$IF FPC_FULLVERSION>=30301}
  68. {$ifndef CPULLVM}
  69. {$if defined(CPUI386) or defined(CPUX86_64)}
  70. {$define FPC_USE_INTRINSICS}
  71. {$endif}
  72. {$endif}
  73. {$endif}
  74. type
  75. TWndMethod = procedure(var msg : TMessage) of object;
  76. function MakeObjectInstance(Method: TWndMethod): Pointer;
  77. procedure FreeObjectInstance(ObjectInstance: Pointer);
  78. function AllocateHWnd(Method: TWndMethod): HWND;
  79. procedure DeallocateHWnd(Wnd: HWND);
  80. {$i classesh.inc}
  81. implementation
  82. {$IFDEF FPC_DOTTEDUNITS}
  83. uses
  84. System.SysConst;
  85. {$ELSE FPC_DOTTEDUNITS}
  86. uses
  87. sysconst;
  88. {$ENDIF FPC_DOTTEDUNITS}
  89. { OS - independent class implementations are in /inc directory. }
  90. {$i classes.inc}
  91. function MakeObjectInstance(Method: TWndMethod): Pointer;
  92. begin
  93. runerror(211);
  94. MakeObjectInstance:=nil;
  95. end;
  96. procedure FreeObjectInstance(ObjectInstance: Pointer);
  97. begin
  98. runerror(211);
  99. end;
  100. function AllocateHWnd(Method: TWndMethod): HWND;
  101. begin
  102. runerror(211);
  103. AllocateHWnd:=0;
  104. end;
  105. procedure DeallocateHWnd(Wnd: HWND);
  106. begin
  107. runerror(211);
  108. end;
  109. initialization
  110. CommonInit;
  111. finalization
  112. CommonCleanup;
  113. end.