2
This file is part of the Free Pascal run time library.
3
Copyright (c) 1999-2000 by the Free Pascal development team
5
See the file COPYING.FPC, included in this distribution,
6
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.
12
**********************************************************************}
15
PVideoMode = ^TVideoMode;
20
TVideoModeSelector = function (const VideoMode: TVideoMode; Params: Longint): Boolean;
23
PVideoCell = ^TVideoCell;
25
TVideoBuf = array[0..32759] of TVideoCell;
26
PVideoBuf = ^TVideoBuf;
29
InitDriver : Procedure;
30
DoneDriver : Procedure;
31
UpdateScreen : Procedure(Force : Boolean);
32
ClearScreen : Procedure;
33
SetVideoMode : Function (Const Mode : TVideoMode) : Boolean;
34
GetVideoModeCount : Function : Word;
35
GetVideoModeData : Function(Index : Word; Var Data : TVideoMode) : Boolean;
36
SetCursorPos : procedure (NewCursorX, NewCursorY: Word);
37
GetCursorType : function : Word;
38
SetCursorType : procedure (NewType: Word);
39
GetCapabilities : Function : Word;
43
{ Foreground and background color constants }
53
{ Foreground color constants }
63
{ Add-in for blinking }
66
{ Capabilities bitmask }
72
cpChangeCursor = $0020;
74
{ Possible cursor types }
80
{ Possible error codes }
83
errVioInit = errVioBase + 1; { Initialization error, shouldn't occur on DOS, but may
85
errVioNotSupported = errVioBase + 2; { call to an unsupported function }
86
errVioNoSuchMode = errVioBase + 3; { No such video mode }
89
ScreenWidth : Word = 0;
90
ScreenHeight : Word = 0;
93
ScreenColor : Boolean;
97
OldVideoBuf : PVideoBuf;
98
VideoBufSize : Longint;
101
const {The following constants were variables in the past.
102
- Lowascii was set to true if ASCII characters < 32 were available
103
- NoExtendedFrame was set to true if the double with line drawing
104
characters were set to true.
106
These variables did exist because of VT100 limitations on Unix. However,
107
only part of the character set problem was solved this way. Nowadays, the
108
video unit converts characters to the output character set (which might be
109
VT100) automatically, so the user does not need to worry about it anymore.}
111
NoExtendedFrame = false;
115
Procedure LockScreenUpdate;
116
{ Increments the screen update lock count with one.}
117
Procedure UnlockScreenUpdate;
118
{ Decrements the screen update lock count with one.}
119
Function GetLockScreenCount : integer;
120
{ Gets the current lock level }
121
Function SetVideoDriver (Const Driver : TVideoDriver) : Boolean;
122
{ Sets the videodriver to be used }
123
Procedure GetVideoDriver (Var Driver : TVideoDriver);
124
{ Retrieves the current videodriver }
127
{ Initializes the video subsystem }
129
{ Deinitializes the video subsystem }
130
function GetCapabilities: Word;
131
{ Return the capabilities of the current environment }
132
procedure ClearScreen;
133
{ Clears the screen }
134
procedure UpdateScreen(Force: Boolean);
135
{ Force specifies whether the whole screen has to be redrawn, or (if target
136
platform supports it) its parts only }
137
procedure SetCursorPos(NewCursorX, NewCursorY: Word);
138
{ Position the cursor to the given position }
139
function GetCursorType: Word;
140
{ Return the cursor type: Hidden, UnderLine or Block }
141
procedure SetCursorType(NewType: Word);
142
{ Set the cursor to the given type }
144
procedure GetVideoMode(var Mode: TVideoMode);
145
{ Return dimensions of the current video mode }
146
Function SetVideoMode(Const Mode: TVideoMode) : Boolean;
147
{ Set video-mode to have Mode dimensions, may return errVioNoSuchMode }
148
Function GetVideoModeCount : Word;
149
{ Get the number of video modes supported by this driver }
150
Function GetVideoModeData(Index : Word; Var Data: TVideoMode) : Boolean;
151
{ Get the data for Video mode Index. Index is zero based. }
154
TErrorHandlerReturnValue = (errRetry, errAbort, errContinue);
155
{ errRetry = retry the operation,
156
errAbort = abort, return error code,
157
errContinue = abort, without returning errorcode }
159
TErrorHandler = function (Code: Longint; Info: Pointer): TErrorHandlerReturnValue;
160
{ ErrorHandler is the standard procedural interface for all error functions.
161
Info may contain any data type specific to the error code passed to the
164
function DefaultErrorHandler(AErrorCode: Longint; AErrorInfo: Pointer): TErrorHandlerReturnValue;
165
{ Default error handler, simply sets error code, and returns errContinue }
169
ErrorCode: Longint = ErrOK;
170
ErrorInfo: Pointer = nil;
171
ErrorHandler: TErrorHandler = @DefaultErrorHandler;