kvm.pp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2006 Karoly Balogh
  4. member of the Free Pascal Development Team
  5. Keyboard/Video/Mouse helper unit for Amiga/MorphOS
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit kvm;
  13. interface
  14. uses
  15. exec, intuition, graphics;
  16. function initKVM: boolean;
  17. procedure doneKVM;
  18. implementation
  19. var
  20. kvmWindow: PWindow;
  21. const
  22. DEFAULT_WINWIDTH = 80;
  23. DEFAULT_WINHEIGHT = 25;
  24. const
  25. CHAR_XSIZE = 8;
  26. CHAR_YSIZE = 16;
  27. function initKVM: boolean;
  28. begin
  29. initKVM:=false;
  30. kvmWindow:=OpenWindowTags(nil, [
  31. WA_Left,50,
  32. WA_Top, 50,
  33. WA_InnerWidth, DEFAULT_WINWIDTH *CHAR_XSIZE,
  34. WA_InnerHeight,DEFAULT_WINHEIGHT*CHAR_YSIZE,
  35. WA_IDCMP, IDCMP_VANILLAKEY or IDCMP_RAWKEY,
  36. WA_Title,DWord(PChar('Free Pascal Video Output')),
  37. WA_Flags,(WFLG_GIMMEZEROZERO or
  38. WFLG_SMART_REFRESH or
  39. WFLG_NOCAREREFRESH or
  40. WFLG_ACTIVATE or
  41. WFLG_DRAGBAR or
  42. WFLG_DEPTHGADGET)
  43. ]);
  44. if kvmWindow<>nil then initKVM:=true;
  45. end;
  46. procedure doneKVM;
  47. begin
  48. if kvmWindow <> nil then CloseWindow(kvmWindow);
  49. end;
  50. begin
  51. InitGraphicsLibrary;
  52. InitIntuitionLibrary;
  53. end.