classes.pp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. This file is part of the Free Component Library (FCL)
  3. Copyright (c) 1999-2000 by Michael Van Canneyt and Florian Klaempfl
  4. Classes unit for win16
  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. {$if defined(FPC_MM_TINY) or defined(FPC_MM_LARGE) or defined(FPC_MM_HUGE)}
  20. { CodePointer = Pointer; nothing to define }
  21. {$elseif defined(FPC_MM_SMALL) or defined(FPC_MM_MEDIUM) or defined(FPC_MM_COMPACT)}
  22. {$define FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
  23. {$else}
  24. {$fatal Unknown i8086 memory model.}
  25. {$endif}
  26. {$IFNDEF FPC_DOTTEDUNITS}
  27. unit Classes;
  28. {$ENDIF FPC_DOTTEDUNITS}
  29. interface
  30. {$IFDEF FPC_DOTTEDUNITS}
  31. uses
  32. System.TypInfo,
  33. System.RtlConsts,
  34. System.Types,
  35. System.SortBase,
  36. {$if defined(FPC_TESTGENERICS) or defined(FPC_CODEPOINTER_DIFFERENT_THAN_POINTER)}
  37. System.FGL,
  38. {$endif}
  39. System.SysUtils,
  40. WinApi.WinProcs,WinApi.WinTypes;
  41. {$ELSE FPC_DOTTEDUNITS}
  42. uses
  43. typinfo,
  44. rtlconsts,
  45. types,
  46. sortbase,
  47. {$if defined(FPC_TESTGENERICS) or defined(FPC_CODEPOINTER_DIFFERENT_THAN_POINTER)}
  48. fgl,
  49. {$endif}
  50. sysutils,
  51. winprocs,wintypes;
  52. {$ENDIF FPC_DOTTEDUNITS}
  53. {$i classesh.inc}
  54. implementation
  55. type
  56. {$ifdef FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
  57. TCodePtrList = specialize TFPGList<CodePointer>;
  58. {$else FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
  59. TCodePtrList = TList;
  60. {$endif FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
  61. {$if defined(FPC_MM_TINY) or defined(FPC_MM_SMALL) or defined(FPC_MM_MEDIUM)}
  62. function FindResource(hInstance: HINST; lpName, lpType: PAnsiChar): HRSRC; inline;
  63. begin
  64. Result:=WinProcs.FindResource(hInstance,FarAddr(lpName^),FarAddr(lpType^));
  65. end;
  66. {$endif}
  67. { OS - independent class implementations are in /inc directory. }
  68. {$i classes.inc}
  69. initialization
  70. CommonInit;
  71. finalization
  72. CommonCleanup;
  73. end.