/packages/ptc/src/dos/vga/vgaconsoled.inc

https://github.com/slibre/freepascal · Pascal · 145 lines · 97 code · 11 blank · 37 comment · 0 complexity · 75519495c431cc570986cfade9926832 MD5 · raw file

  1. {
  2. This file is part of the PTCPas framebuffer library
  3. Copyright (C) 2001-2012 Nikolay Nikolov (nickysn@users.sourceforge.net)
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version
  8. with the following modification:
  9. As a special exception, the copyright holders of this library give you
  10. permission to link this library with independent modules to produce an
  11. executable, regardless of the license terms of these independent modules,and
  12. to copy and distribute the resulting executable under terms of your choice,
  13. provided that you also meet, for each linked independent module, the terms
  14. and conditions of the license of that module. An independent module is a
  15. module which is not derived from or based on this library. If you modify
  16. this library, you may extend this exception to your version of the library,
  17. but you are not obligated to do so. If you do not wish to do so, delete this
  18. exception statement from your version.
  19. This library is distributed in the hope that it will be useful,
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  22. Lesser General Public License for more details.
  23. You should have received a copy of the GNU Lesser General Public
  24. License along with this library; if not, write to the Free Software
  25. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. }
  27. type
  28. TVGAConsole = class(TPTCOpenGLLessConsole)
  29. private
  30. { data }
  31. m_modes: array of IPTCMode;
  32. m_title: string;
  33. m_information: string;
  34. m_CurrentMode: Integer;
  35. m_faketype: Integer;
  36. m_width, m_height, m_pitch: Integer;
  37. m_primary: Pointer;
  38. { flags }
  39. m_open: Boolean;
  40. m_locked: Boolean;
  41. { option data }
  42. m_default_width: Integer;
  43. m_default_height: Integer;
  44. m_default_format: IPTCFormat;
  45. { objects }
  46. m_copy: TPTCCopy;
  47. m_area: IPTCArea;
  48. m_clip: IPTCArea;
  49. m_clear: TPTCClear;
  50. m_palette: IPTCPalette;
  51. FEventQueue: TEventQueue;
  52. { Dos objects }
  53. m_keyboard: TDosKeyboard;
  54. FMouse: TDosMouse;
  55. { internal console management routines }
  56. procedure internal_pre_open_setup(const _title: string);
  57. procedure internal_open_fullscreen_start;
  58. procedure internal_open_fullscreen(ModeType: Integer);
  59. procedure internal_open_fullscreen_finish(_pages: Integer);
  60. procedure internal_post_open_setup;
  61. procedure internal_reset;
  62. procedure internal_close;
  63. procedure internal_clear_mode_list;
  64. procedure internal_SetPalette(data: PUint32);
  65. procedure HandleEvents;
  66. procedure vga_load(data: Pointer); Register;
  67. { console debug checks }
  68. procedure check_open;
  69. procedure check_unlocked;
  70. public
  71. constructor Create; override;
  72. destructor Destroy; override;
  73. procedure Configure(const AFileName: string); override;
  74. function Option(const _option: string): Boolean; override;
  75. function modes: TPTCModeList; override;
  76. procedure open(const _title: string; _pages: Integer); overload; override;
  77. procedure open(const _title: string; _format: IPTCFormat;
  78. _pages: Integer); overload; override;
  79. procedure open(const _title: string; _width, _height: Integer;
  80. _format: IPTCFormat; _pages: Integer); overload; override;
  81. procedure open(const _title: string; _mode: IPTCMode;
  82. _pages: Integer); overload; override;
  83. procedure close; override;
  84. procedure flush; override;
  85. procedure finish; override;
  86. procedure update; override;
  87. procedure update(_area: IPTCArea); override;
  88. procedure copy(surface: IPTCSurface); override;
  89. procedure copy(surface: IPTCSurface;
  90. source, destination: IPTCArea); override;
  91. function lock: Pointer; override;
  92. procedure unlock; override;
  93. procedure load(const pixels: Pointer;
  94. _width, _height, _pitch: Integer;
  95. _format: IPTCFormat;
  96. _palette: IPTCPalette); override;
  97. procedure load(const pixels: Pointer;
  98. _width, _height, _pitch: Integer;
  99. _format: IPTCFormat;
  100. _palette: IPTCPalette;
  101. source, destination: IPTCArea); override;
  102. procedure save(pixels: Pointer;
  103. _width, _height, _pitch: Integer;
  104. _format: IPTCFormat;
  105. _palette: IPTCPalette); override;
  106. procedure save(pixels: Pointer;
  107. _width, _height, _pitch: Integer;
  108. _format: IPTCFormat;
  109. _palette: IPTCPalette;
  110. source, destination: IPTCArea); override;
  111. procedure clear; override;
  112. procedure Clear(AColor: IPTCColor); override;
  113. procedure clear(color: IPTCColor;
  114. _area: IPTCArea); override;
  115. procedure Palette(_palette: IPTCPalette); override;
  116. function Palette: IPTCPalette; override;
  117. procedure Clip(_area: IPTCArea); override;
  118. function GetWidth: Integer; override;
  119. function GetHeight: Integer; override;
  120. function GetPitch: Integer; override;
  121. function GetPages: Integer; override;
  122. function GetArea: IPTCArea; override;
  123. function Clip: IPTCArea; override;
  124. function GetFormat: IPTCFormat; override;
  125. function GetName: string; override;
  126. function GetTitle: string; override;
  127. function GetInformation: string; override;
  128. function NextEvent(out event: IPTCEvent; wait: Boolean; const EventMask: TPTCEventMask): Boolean; override;
  129. function PeekEvent(wait: Boolean; const EventMask: TPTCEventMask): IPTCEvent; override;
  130. end;