Unit console

Classes, Interfaces, Objects and Records
Variables

Description

Console - Provides Screen/Window management & drawing.

Uses

Overview

Functions and Procedures

procedure init();
procedure clear();
procedure setdefaultattribute(attribute : uint32);
procedure disable_cursor;
procedure writechar(character : char);
procedure writecharln(character : char);
procedure writecharex(character : char; attributes: uint32);
procedure writecharlnex(character : char; attributes: uint32);
procedure Output(identifier : PChar; str : PChar);
procedure Outputln(identifier : PChar; str : PChar);
procedure writestring(str: PChar);
procedure writestringln(str: PChar);
procedure writestringex(str: PChar; attributes: uint32);
procedure writestringlnex(str: PChar; attributes: uint32);
procedure writeint(i: Integer);
procedure writeintln(i: Integer);
procedure writeintex(i: Integer; attributes: uint32);
procedure writeintlnex(i: Integer; attributes: uint32);
procedure writehexpair(b : uint8);
procedure writehex(i: DWORD);
procedure writehexln(i: DWORD);
procedure writehexex(i : DWORD; attributes: uint32);
procedure writehexlnex(i: DWORD; attributes: uint32);
procedure writebin8(b : uint8);
procedure writebin8ln(b : uint8);
procedure writebin8ex(b : uint8; attributes: uint32);
procedure writebin8lnex(b : uint8; attributes: uint32);
procedure writebin16(b : uint16);
procedure writebin16ln(b : uint16);
procedure writebin16ex(b : uint16; attributes: uint32);
procedure writebin16lnex(b : uint16; attributes: uint32);
procedure writebin32(b : uint32);
procedure writebin32ln(b : uint32);
procedure writebin32ex(b : uint32; attributes: uint32);
procedure writebin32lnex(b : uint32; attributes: uint32);
procedure backspace;
function combinecolors(Foreground, Background : uint16) : uint32;
procedure _increment_x();
procedure _increment_y();
procedure _safeincrement_x();
procedure _safeincrement_y();
procedure _newline();
procedure clearWND(WND : uint32);
procedure clearWNDEx(WND : uint32; attributes : uint32);
procedure writecharWND(character : char; WND : uint32);
procedure writecharlnWND(character : char; WND : uint32);
procedure writecharexWND(character : char; attributes: uint32; WND : uint32);
procedure writecharlnexWND(character : char; attributes: uint32; WND : uint32);
procedure OutputWND(identifier : PChar; str : PChar; WND : uint32);
procedure OutputlnWND(identifier : PChar; str : PChar; WND : uint32);
procedure writestringWND(str: PChar; WND : uint32);
procedure writestringlnWND(str: PChar; WND : uint32);
procedure writestringexWND(str: PChar; attributes: uint32; WND : uint32);
procedure writestringlnexWND(str: PChar; attributes: uint32; WND : uint32);
procedure writeintWND(i: Integer; WND : uint32);
procedure writeintlnWND(i: Integer; WND : uint32);
procedure writeintexWND(i: Integer; attributes: uint32; WND : uint32);
procedure writeintlnexWND(i: Integer; attributes: uint32; WND : uint32);
procedure writehexpairWND(b : uint8; WND : uint32);
procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32);
procedure writehexWND(i: DWORD; WND : uint32);
procedure writehexlnWND(i: DWORD; WND : uint32);
procedure writehexexWND(i : DWORD; attributes: uint32; WND : uint32);
procedure writehexlnexWND(i: DWORD; attributes: uint32; WND : uint32);
procedure writebin8WND(b : uint8; WND : uint32);
procedure writebin8lnWND(b : uint8; WND : uint32);
procedure writebin8exWND(b : uint8; attributes: uint32; WND : uint32);
procedure writebin8lnexWND(b : uint8; attributes: uint32; WND : uint32);
procedure writebin16WND(b : uint16; WND : uint32);
procedure writebin16lnWND(b : uint16; WND : uint32);
procedure writebin16exWND(b : uint16; attributes: uint32; WND : uint32);
procedure writebin16lnexWND(b : uint16; attributes: uint32; WND : uint32);
procedure writebin32WND(b : uint32; WND : uint32);
procedure writebin32lnWND(b : uint32; WND : uint32);
procedure writebin32exWND(b : uint32; attributes: uint32; WND : uint32);
procedure writebin32lnexWND(b : uint32; attributes: uint32; WND : uint32);
procedure backspaceWND(WND : uint32);
procedure setCursorPosWND(x : uint32; y : uint32; WND : HWND);
procedure _increment_x_WND(WND : uint32);
procedure _increment_y_WND(WND : uint32);
procedure _safeincrement_y_WND(WND : uint32);
procedure _safeincrement_x_WND(WND : uint32);
procedure _newlineWND(WND : uint32);
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);
procedure outputCharToScreenSpace(c : char; x : uint32; y : uint32; fgcolor : uint16);
procedure outputCharTransparent(c : char; x : uint8; y : uint8; fgcolor : uint16);
function getPixel(x : uint32; y : uint32) : uint16;
procedure drawPixel(x : uint32; y : uint32; color : uint16);
function getPixel32(x : uint32; y : uint32) : uint32;
procedure drawPixel32(x : uint32; y : uint32; pixel : uint32);
function getPixel64(x : uint32; y : uint32) : uint64;
procedure drawPixel64(x : uint32; y : uint32; pixel : uint64);
procedure setMousePosition(x : uint32; y : uint32);
procedure redrawWindows;
procedure toggleWNDVisible(WND : uint32);
procedure setWNDVisible(WND : uint32; visible : boolean);
procedure closeAllWindows;
function newWindow(x : uint32; y : uint32; Width : uint32; Height : uint32; Title : PChar) : HWND;
function registerEventHandler(WND : HWND; Event : TEventType; Handler : void) : boolean;
procedure forceQuitAll;
procedure closeWindow(WND : HWND);
procedure bordersEnabled(WND : HWND; enabled : boolean);
procedure SetShellWindow(WND : HWND; b : boolean);
function getWindowName(WND : HWND) : pchar;
procedure mouseEnabled(b : boolean);
procedure _MouseDown();
procedure _MouseUp();
procedure _MouseClick(left : boolean);
procedure setWindowColors(colors : uint32);
function getWindowColorPtr : puint32;

Types

TColor = (...);
TEventType = (...);

Constants

MAX_WINDOWS = 255;
DefaultWND = 0;

Description

Functions and Procedures

procedure init();

Initialize the Frame Buffer & Window Manager ready for use.

procedure clear();

Clear the Frame Buffer.

procedure setdefaultattribute(attribute : uint32);

Set the default set of attributes to be used when drawing to the screen.

Parameters
attribute
A 32-bit value representing the Foreground & Background colors.
procedure disable_cursor;

Warning: this symbol is deprecated.

Text mode only! - Disable the cursor/text-caret.

procedure writechar(character : char);

Write a single 8-bit character to the screen.

Parameters
character
An 8-bit value representing an ASCII character.
procedure writecharln(character : char);

Write a single 8-bit character to the screen, followed by starting a new line.

Parameters
character
An 8-bit value representing an ASCII character.
procedure writecharex(character : char; attributes: uint32);

Write a single 8-bit character to the screen, specifying custom color attributes.

Parameters
character
An 8-bit value representing an ASCII character.
attributes
A 32-bit value representing the colors for the background and foreground.
procedure writecharlnex(character : char; attributes: uint32);

Write a single 8-bit character to the screen, followed by starting a new line, specifying custom color attributes.

Parameters
character
An 8-bit value representing an ASCII character.
attributes
A 32-bit value representing the colors for the background and foreground.
procedure Output(identifier : PChar; str : PChar);

Simple console write for debugging.

Parameters
identifier
A NULL terminated string with the name of the module printing the output.
str
A NULL terminated string with the debug message.
procedure Outputln(identifier : PChar; str : PChar);

Simple console writeln for debugging.

Parameters
identifier
A NULL terminated string with the name of the module printing the output.
str
A NULL terminated string with the debug message.
procedure writestring(str: PChar);

Write a NULL terminated string to the console.

Parameters
str
A NULL terminated string with the debug message.
procedure writestringln(str: PChar);

Write a NULL terminated string to the console, followed by a new-line.

Parameters
str
A NULL terminated string with the debug message.
procedure writestringex(str: PChar; attributes: uint32);

Write a NULL terminated string to the console, with the specified attributes.

Parameters
str
A NULL terminated string with the debug message.
attributes
A 32-bit representation of the background/foreground colors.
procedure writestringlnex(str: PChar; attributes: uint32);

Write a NULL terminated string + new-line to the console, with the specified attributes.

Parameters
str
A NULL terminated string with the debug message.
attributes
A 32-bit representation of the background/foreground colors.
procedure writeint(i: Integer);

Write a 32-bit value to the console.

Parameters
i
A 32-bit value.
procedure writeintln(i: Integer);

Write a 32-bit value to the console followed by a new-line.

Parameters
i
A 32-bit value.
procedure writeintex(i: Integer; attributes: uint32);

Write a 32-bit value to the console, with the specified attributes.

Parameters
i
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writeintlnex(i: Integer; attributes: uint32);

Write a 32-bit value + new-line to the console, with the specified attributes.

Parameters
i
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writehexpair(b : uint8);

Write an 8-bit Hex Pair to the console.

Parameters
b
An 8-bit value.
procedure writehex(i: DWORD);

Write a 32-bit value as Hex Pairs to the console.

Parameters
i
A 32-bit value.
procedure writehexln(i: DWORD);

Write a 32-bit value as Hex Pairs to the console, followed by a new-line.

Parameters
i
A 32-bit value.
procedure writehexex(i : DWORD; attributes: uint32);

Write a 32-bit value as Hex Pairs to the console, with the specified attributes.

Parameters
b
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writehexlnex(i: DWORD; attributes: uint32);

Write a 32-bit value as Hex Pairs + new-line to the console, with the specified attributes.

Parameters
b
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin8(b : uint8);

Write an 8-bit value as binary to the console.

Parameters
b
An 8-bit value.
procedure writebin8ln(b : uint8);

Write an 8-bit value as binary to the console, followed by a new-line.

Parameters
b
An 8-bit value.
procedure writebin8ex(b : uint8; attributes: uint32);

Write an 8-bit value as binary to the console, with the specified attributes.

Parameters
b
An 8-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin8lnex(b : uint8; attributes: uint32);

Write an 8-bit value as binary + new-line to the console, with the specified attributes.

Parameters
b
An 8-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin16(b : uint16);

Write a 16-bit value as binary to the console.

Parameters
b
A 16-bit value.
procedure writebin16ln(b : uint16);

Write an 16-bit value as binary to the console, followed by a new-line.

Parameters
b
A 16-bit value.
procedure writebin16ex(b : uint16; attributes: uint32);

Write a 16-bit value as binary to the console, with the specified attributes.

Parameters
b
A 16-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin16lnex(b : uint16; attributes: uint32);

Write a 16-bit value as binary + new-line to the console, with the specified attributes.

Parameters
b
A 16-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin32(b : uint32);

Write a 32-bit value as binary to the console.

Parameters
b
A 32-bit value.
procedure writebin32ln(b : uint32);

Write an 32-bit value as binary to the console, followed by a new-line.

Parameters
b
A 32-bit value.
procedure writebin32ex(b : uint32; attributes: uint32);

Write a 32-bit value as binary to the console, with the specified attributes.

Parameters
b
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure writebin32lnex(b : uint32; attributes: uint32);

Write a 32-bit value as binary + new-line to the console, with the specified attributes.

Parameters
b
A 32-bit value.
attributes
A 32-bit representation of the background/foreground colors.
procedure backspace;

Move the caret back 1 position and remove the character within the cell the caret occupies.

function combinecolors(Foreground, Background : uint16) : uint32;

Combine two 16-bit values representing Foreground and Background respectively, into a 32-bit value representing an attribute.

Parameters
Foreground
A 16-bit value representing the foreground color.
Background
A 16-bit value representing the background color.
Returns

A 32-bit value representing an attribute set. (uint32)

procedure _increment_x();

Increment the cursor one cell to the right (x+1).

procedure _increment_y();

Increment the cursor one cell down (y+1).

procedure _safeincrement_x();

Increment the cursor one cell to the right (x+1), wrapping to the next line and performing a Y-Axis scroll when when needed.

procedure _safeincrement_y();

Increment the cursor one cell down (y+1), performing a Y-Axis roll when when needed.

procedure _newline();

Increment the cursor one cell down and reposition it at the first X Cell (y+1, x=0),performing a Y-Axis scroll when needed.

procedure clearWND(WND : uint32);

Window Specific

procedure clearWNDEx(WND : uint32; attributes : uint32);
 
procedure writecharWND(character : char; WND : uint32);
 
procedure writecharlnWND(character : char; WND : uint32);
 
procedure writecharexWND(character : char; attributes: uint32; WND : uint32);
 
procedure writecharlnexWND(character : char; attributes: uint32; WND : uint32);
 
procedure OutputWND(identifier : PChar; str : PChar; WND : uint32);
 
procedure OutputlnWND(identifier : PChar; str : PChar; WND : uint32);
 
procedure writestringWND(str: PChar; WND : uint32);
 
procedure writestringlnWND(str: PChar; WND : uint32);
 
procedure writestringexWND(str: PChar; attributes: uint32; WND : uint32);
 
procedure writestringlnexWND(str: PChar; attributes: uint32; WND : uint32);
 
procedure writeintWND(i: Integer; WND : uint32);
 
procedure writeintlnWND(i: Integer; WND : uint32);
 
procedure writeintexWND(i: Integer; attributes: uint32; WND : uint32);
 
procedure writeintlnexWND(i: Integer; attributes: uint32; WND : uint32);
 
procedure writehexpairWND(b : uint8; WND : uint32);
 
procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32);
 
procedure writehexWND(i: DWORD; WND : uint32);
 
procedure writehexlnWND(i: DWORD; WND : uint32);
 
procedure writehexexWND(i : DWORD; attributes: uint32; WND : uint32);
 
procedure writehexlnexWND(i: DWORD; attributes: uint32; WND : uint32);
 
procedure writebin8WND(b : uint8; WND : uint32);
 
procedure writebin8lnWND(b : uint8; WND : uint32);
 
procedure writebin8exWND(b : uint8; attributes: uint32; WND : uint32);
 
procedure writebin8lnexWND(b : uint8; attributes: uint32; WND : uint32);
 
procedure writebin16WND(b : uint16; WND : uint32);
 
procedure writebin16lnWND(b : uint16; WND : uint32);
 
procedure writebin16exWND(b : uint16; attributes: uint32; WND : uint32);
 
procedure writebin16lnexWND(b : uint16; attributes: uint32; WND : uint32);
 
procedure writebin32WND(b : uint32; WND : uint32);
 
procedure writebin32lnWND(b : uint32; WND : uint32);
 
procedure writebin32exWND(b : uint32; attributes: uint32; WND : uint32);
 
procedure writebin32lnexWND(b : uint32; attributes: uint32; WND : uint32);
 
procedure backspaceWND(WND : uint32);
 
procedure setCursorPosWND(x : uint32; y : uint32; WND : HWND);
 
procedure _increment_x_WND(WND : uint32);
 
procedure _increment_y_WND(WND : uint32);
 
procedure _safeincrement_y_WND(WND : uint32);
 
procedure _safeincrement_x_WND(WND : uint32);
 
procedure _newlineWND(WND : uint32);
 
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16);

Drawing

procedure outputCharToScreenSpace(c : char; x : uint32; y : uint32; fgcolor : uint16);
 
procedure outputCharTransparent(c : char; x : uint8; y : uint8; fgcolor : uint16);
 
function getPixel(x : uint32; y : uint32) : uint16;
 
procedure drawPixel(x : uint32; y : uint32; color : uint16);
 
function getPixel32(x : uint32; y : uint32) : uint32;
 
procedure drawPixel32(x : uint32; y : uint32; pixel : uint32);
 
function getPixel64(x : uint32; y : uint32) : uint64;
 
procedure drawPixel64(x : uint32; y : uint32; pixel : uint64);
 
procedure setMousePosition(x : uint32; y : uint32);

Windows Methods

procedure redrawWindows;
 
procedure toggleWNDVisible(WND : uint32);
 
procedure setWNDVisible(WND : uint32; visible : boolean);
 
procedure closeAllWindows;
 
function newWindow(x : uint32; y : uint32; Width : uint32; Height : uint32; Title : PChar) : HWND;
 
function registerEventHandler(WND : HWND; Event : TEventType; Handler : void) : boolean;
 
procedure forceQuitAll;
 
procedure closeWindow(WND : HWND);
 
procedure bordersEnabled(WND : HWND; enabled : boolean);
 
procedure SetShellWindow(WND : HWND; b : boolean);
 
function getWindowName(WND : HWND) : pchar;
 
procedure mouseEnabled(b : boolean);
 
procedure _MouseDown();
 
procedure _MouseUp();
 
procedure _MouseClick(left : boolean);
 
procedure setWindowColors(colors : uint32);
 
function getWindowColorPtr : puint32;
 

Types

TColor = (...);

4-bit nibble representing a color.

Values
  • Black = $0
  • Blue = $1
  • Green = $2
  • Aqua = $3
  • Red = $4
  • Purple = $5
  • Yellow = $6
  • White = $7
  • Gray = $8
  • lBlue = $9
  • lGreen = $A
  • lAqua = $B
  • lRed = $C
  • lPurple = $D
  • lYellow = $E
  • lWhite = $F
TEventType = (...);

Window Manager Events.

Values
  • EVENT_DRAW
  • EVENT_MOUSE_CLICK
  • EVENT_MOUSE_MOVE
  • EVENT_MOUSE_DOWN
  • EVENT_MOUSE_UP
  • EVENT_KEY_PRESSED
  • EVENT_CLOSE
  • EVENT_MINIMIZE
  • EVENT_FOCUS
  • EVENT_LOSE_FOCUS

Constants

MAX_WINDOWS = 255;

Maximum number of Windows open.

DefaultWND = 0;

The Window assigned for output when no Window is specified. (Default).

Author


Generated by PasDoc 0.15.0.