{█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
{█ █}
{█ Virtual Pascal Runtime Library. Version 1.0. █}
{█ OS/2 Presentation Manager CRT interface unit █}
{█ ─────────────────────────────────────────────────█}
{█ Copyright (C) 1995 fPrint UK Ltd █}
{█ █}
{▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
{$S-,R-,Q-,I-,Cdecl-,OrgName-,AlignRec-,PureInt+}
unit WinCrt;
interface
uses Os2Def, Os2PmApi, Strings, WinDos, Use32;
var
WindowTitle: array[0..79] of Char; { CRT window title }
InactiveTitleBuf: array[0..79] of Char; { CRT window inactive title }
const
cw_UseDefault = Integer($8000);
const
WindowOrg: PointL = { CRT window origin }
(X: cw_UseDefault; Y: cw_UseDefault);
WindowSize: PointL = { CRT window size }
(X: cw_UseDefault; Y: cw_UseDefault);
ScreenSize: PointL = (X: 80; Y: 25); { Screen buffer dimensions }
InactiveTitle: PChar = @InactiveTitleBuf; { Inactive window title }
Cursor: PointL = (X: 0; Y: 0); { Cursor location }
Origin: PointL = (X: 0; Y: 0); { Client area origin }
AutoTracking: Boolean = True; { Track cursor on Write? }
CheckEOF: Boolean = False; { Allow Ctrl-Z for EOF? }
CheckBreak: Boolean = True; { Allow Ctrl-C for break? }
FontId: ULong = 1; { Font Id }
FontAttr: FAttrs = ( { Font attributes }
usRecordLength: SizeOf(FAttrs); { Size of the record }
fsSelection: 0; { fattr_Sel_xxx }
lMatch: 1;
szFacename: 'System VIO'; { Fixed-pitch font }
idRegistry: 0;
usCodePage: 0;
lMaxBaselineExt: 16; { Font Size: 16x8 }
lAveCharWidth: 8;
fsType: 0; { fattr_Type_xxx }
fsFontUse: 0 { fattr_FontUse_xxx }
);
CrtCreateFlags: ULong = fcf_TitleBar + fcf_SysMenu + fcf_SizeBorder +
fcf_MinMax + fcf_TaskList + fcf_NoByteAlign + fcf_VertScroll + fcf_HorzScroll;
procedure InitWinCrt;
procedure DoneWinCrt;
procedure WriteBuf(Buffer: PChar; Count: Word);
procedure WriteChar(Ch: Char);
function KeyPressed: Boolean;
function ReadKey: Char;
function ReadBuf(Buffer: PChar; Count: Word): Word;
procedure GotoXY(X, Y: Integer);
function WhereX: Integer;
function WhereY: Integer;
procedure ClrScr;
procedure ClrEol;
procedure CursorTo(X, Y: Integer);
procedure ScrollTo(X, Y: Integer);
procedure TrackCursor;
procedure AssignCrt(var F: Text);
{ CRT window procedures }
function CrtWinProc(Window: HWnd; Message: ULong; Mp1, Mp2: MParam): MResult; cdecl; export;
function FrameWndProc(Window: HWnd; Message: ULong; Mp1, Mp2: MParam): MResult; cdecl; export;
implementation
begin
end.