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