Unit console
Description
Console - Provides Screen/Window management & drawing.
Overview
Classes, Interfaces, Objects and Records
Name | Description |
---|---|
Record TConsoleProperties |
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; |
function getMaxCellW: uint32; |
function getMaxCellH: uint32; |
function getConsoleProperties: PConsoleProperties; |
Types
TColor = (...); |
TEventType = (...); |
PConsoleProperties = ˆTConsoleProperties; |
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
|
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
|
procedure writecharln(character : char); |
Write a single 8-bit character to the screen, followed by starting a new line. Parameters
|
procedure writecharex(character : char; attributes: uint32); |
Write a single 8-bit character to the screen, specifying custom color attributes. Parameters
|
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
|
procedure Output(identifier : PChar; str : PChar); |
Simple console write for debugging. Parameters
|
procedure Outputln(identifier : PChar; str : PChar); |
Simple console writeln for debugging. Parameters
|
procedure writestring(str: PChar); |
Write a NULL terminated string to the console. Parameters
|
procedure writestringln(str: PChar); |
Write a NULL terminated string to the console, followed by a new-line. Parameters
|
procedure writestringex(str: PChar; attributes: uint32); |
Write a NULL terminated string to the console, with the specified attributes. Parameters
|
procedure writestringlnex(str: PChar; attributes: uint32); |
Write a NULL terminated string + new-line to the console, with the specified attributes. Parameters
|
procedure writeint(i: Integer); |
Write a 32-bit value to the console. Parameters
|
procedure writeintln(i: Integer); |
Write a 32-bit value to the console followed by a new-line. Parameters
|
procedure writeintex(i: Integer; attributes: uint32); |
Write a 32-bit value to the console, with the specified attributes. Parameters
|
procedure writeintlnex(i: Integer; attributes: uint32); |
Write a 32-bit value + new-line to the console, with the specified attributes. Parameters
|
procedure writehexpair(b : uint8); |
Write an 8-bit Hex Pair to the console. Parameters
|
procedure writehex(i: DWORD); |
Write a 32-bit value as Hex Pairs to the console. Parameters
|
procedure writehexln(i: DWORD); |
Write a 32-bit value as Hex Pairs to the console, followed by a new-line. Parameters
|
procedure writehexex(i : DWORD; attributes: uint32); |
Write a 32-bit value as Hex Pairs to the console, with the specified attributes. Parameters
|
procedure writehexlnex(i: DWORD; attributes: uint32); |
Write a 32-bit value as Hex Pairs + new-line to the console, with the specified attributes. Parameters
|
procedure writebin8(b : uint8); |
Write an 8-bit value as binary to the console. Parameters
|
procedure writebin8ln(b : uint8); |
Write an 8-bit value as binary to the console, followed by a new-line. Parameters
|
procedure writebin8ex(b : uint8; attributes: uint32); |
Write an 8-bit value as binary to the console, with the specified attributes. Parameters
|
procedure writebin8lnex(b : uint8; attributes: uint32); |
Write an 8-bit value as binary + new-line to the console, with the specified attributes. Parameters
|
procedure writebin16(b : uint16); |
Write a 16-bit value as binary to the console. Parameters
|
procedure writebin16ln(b : uint16); |
Write an 16-bit value as binary to the console, followed by a new-line. Parameters
|
procedure writebin16ex(b : uint16; attributes: uint32); |
Write a 16-bit value as binary to the console, with the specified attributes. Parameters
|
procedure writebin16lnex(b : uint16; attributes: uint32); |
Write a 16-bit value as binary + new-line to the console, with the specified attributes. Parameters
|
procedure writebin32(b : uint32); |
Write a 32-bit value as binary to the console. Parameters
|
procedure writebin32ln(b : uint32); |
Write an 32-bit value as binary to the console, followed by a new-line. Parameters
|
procedure writebin32ex(b : uint32; attributes: uint32); |
Write a 32-bit value as binary to the console, with the specified attributes. Parameters
|
procedure writebin32lnex(b : uint32; attributes: uint32); |
Write a 32-bit value as binary + new-line to the console, with the specified attributes. Parameters
|
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
ReturnsA 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); |
Clear a Window Canvas. Parameters
|
procedure clearWNDEx(WND : uint32; attributes : uint32); |
Clear a Window Canvas, with the specified attributes. Parameters
|
procedure writecharWND(character : char; WND : uint32); |
Write an ASCII character to a specified Window. Parameters
|
procedure writecharlnWND(character : char; WND : uint32); |
Write a single 8-bit character to a Window, followed by starting a new line. Parameters
|
procedure writecharexWND(character : char; attributes: uint32; WND : uint32); |
Write a single 8-bit character to a Window, specifying custom color attributes. Parameters
|
procedure writecharlnexWND(character : char; attributes: uint32; WND : uint32); |
Write a single 8-bit character to a Window, followed by starting a new line, specifying custom color attributes. Parameters
|
procedure OutputWND(identifier : PChar; str : PChar; WND : uint32); |
Simple console write for debugging to a Window. Parameters
|
procedure OutputlnWND(identifier : PChar; str : PChar; WND : uint32); |
Simple console writeln for debugging to a Window. Parameters
|
procedure writestringWND(str: PChar; WND : uint32); |
Write a NULL terminated string to a Window. Parameters
|
procedure writestringlnWND(str: PChar; WND : uint32); |
Write a NULL terminated string to a Window, followed by a new-line. Parameters
|
procedure writestringexWND(str: PChar; attributes: uint32; WND : uint32); |
Write a NULL terminated string to a Window, with the specified attributes. Parameters
|
procedure writestringlnexWND(str: PChar; attributes: uint32; WND : uint32); |
Write a NULL terminated string + new-line to a Window, with the specified attributes. Parameters
|
procedure writeintWND(i: Integer; WND : uint32); |
Write a 32-bit value to a Window. Parameters
|
procedure writeintlnWND(i: Integer; WND : uint32); |
Write a 32-bit value to a Window followed by a new-line. Parameters
|
procedure writeintexWND(i: Integer; attributes: uint32; WND : uint32); |
Write a 32-bit value to a Window, with the specified attributes. Parameters
|
procedure writeintlnexWND(i: Integer; attributes: uint32; WND : uint32); |
Write a 32-bit value + new-line to a Window, with the specified attributes. Parameters
|
procedure writehexpairWND(b : uint8; WND : uint32); |
Write an 8-bit Hex Pair to a Window. Parameters
|
procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32); |
Write an 8-bit Hex Pair to a Window, with the specified attributes. Parameters
|
procedure writehexWND(i: DWORD; WND : uint32); |
Write a 32-bit value as Hex Pairs to a Window. Parameters
|
procedure writehexlnWND(i: DWORD; WND : uint32); |
Write a 32-bit value as Hex Pairs to a Window, followed by a new-line. Parameters
|
procedure writehexexWND(i : DWORD; attributes: uint32; WND : uint32); |
Write a 32-bit value as Hex Pairs to a Window, with the specified attributes. Parameters
|
procedure writehexlnexWND(i: DWORD; attributes: uint32; WND : uint32); |
Write a 32-bit value as Hex Pairs + new-line to a Window, with the specified attributes. Parameters
|
procedure writebin8WND(b : uint8; WND : uint32); |
Write an 8-bit value as binary to a Window. Parameters
|
procedure writebin8lnWND(b : uint8; WND : uint32); |
Write an 8-bit value as binary to a Window, followed by a new-line. Parameters
|
procedure writebin8exWND(b : uint8; attributes: uint32; WND : uint32); |
Write an 8-bit value as binary to a Window, with the specified attributes. Parameters
|
procedure writebin8lnexWND(b : uint8; attributes: uint32; WND : uint32); |
Write an 8-bit value as binary + new-line to a Window, with the specified attributes. Parameters
|
procedure writebin16WND(b : uint16; WND : uint32); |
Write a 16-bit value as binary to a Window. Parameters
|
procedure writebin16lnWND(b : uint16; WND : uint32); |
Write an 16-bit value as binary to a Window, followed by a new-line. Parameters
|
procedure writebin16exWND(b : uint16; attributes: uint32; WND : uint32); |
Write a 16-bit value as binary to a Window, with the specified attributes. Parameters
|
procedure writebin16lnexWND(b : uint16; attributes: uint32; WND : uint32); |
Write a 16-bit value as binary + new-line to a Window, with the specified attributes. Parameters
|
procedure writebin32WND(b : uint32; WND : uint32); |
Write a 32-bit value as binary to a Window. Parameters
|
procedure writebin32lnWND(b : uint32; WND : uint32); |
Write an 32-bit value as binary to a Window, followed by a new-line. Parameters
|
procedure writebin32exWND(b : uint32; attributes: uint32; WND : uint32); |
Write a 32-bit value as binary to a Window, with the specified attributes. Parameters
|
procedure writebin32lnexWND(b : uint32; attributes: uint32; WND : uint32); |
Write a 32-bit value as binary + new-line to a Window, with the specified attributes. Parameters
|
procedure backspaceWND(WND : uint32); |
Move a caret belonging to a Window back 1 position and remove the character within the cell the caret occupies. Parameters
|
procedure setCursorPosWND(x : uint32; y : uint32; WND : HWND); |
Set the caret belonging to a Window to a specified position. Parameters
|
procedure _increment_x_WND(WND : uint32); |
Increment the cursor within a Window one cell to the right (x+1). Parameters
|
procedure _increment_y_WND(WND : uint32); |
Increment the cursor within a Window one cell down (y+1). Parameters
|
procedure _safeincrement_y_WND(WND : uint32); |
Increment the cursor one cell down (y+1), performing a Y-Axis roll when when needed. Parameters
|
procedure _safeincrement_x_WND(WND : uint32); |
Increment the cursor within a Window one cell to the right (x+1), wrapping to the next line and performing a Y-Axis scroll when when needed. Parameters
|
procedure _newlineWND(WND : uint32); |
Increment the cursor within a Window one cell down and reposition it at the first X Cell (y+1, x=0),performing a Y-Axis scroll when needed. Parameters
|
procedure outputChar(c : char; x : uint8; y : uint8; fgcolor : uint16; bgcolor : uint16); |
Draw an ASCII char to raw screen space conforming to cell constraints. Parameters
|
procedure outputCharToScreenSpace(c : char; x : uint32; y : uint32; fgcolor : uint16); |
Draw an ASCII char to raw screen space. Parameters
|
procedure outputCharTransparent(c : char; x : uint8; y : uint8; fgcolor : uint16); |
Draw an ASCII char without a background to raw screen space conforming to cell constraints. Parameters
|
function getPixel(x : uint32; y : uint32) : uint16; |
Get 16-bits of pixel information from the screen position(x,y). Parameters
Returns16-bits of Pixel Information |
procedure drawPixel(x : uint32; y : uint32; color : uint16); |
Draw 16-bits of pixel information at the screen position(x,y). Parameters
|
function getPixel32(x : uint32; y : uint32) : uint32; |
Get 32-bits of pixel information from the screen position(x,y). Parameters
Returns32-bits of Pixel Information |
procedure drawPixel32(x : uint32; y : uint32; pixel : uint32); |
Draw 32-bits of pixel information at the screen position(x,y). Parameters
|
function getPixel64(x : uint32; y : uint32) : uint64; |
Get 64-bits of pixel information from the screen position(x,y). Parameters
Returns64-bits of Pixel Information |
procedure drawPixel64(x : uint32; y : uint32; pixel : uint64); |
Draw 64-bits of pixel information at the screen position(x,y). Parameters
|
procedure setMousePosition(x : uint32; y : uint32); |
Set the position of the mouse cursor relative to screen space. Parameters
|
procedure redrawWindows; |
Redraw all of the Window adhearing to Z-Order. |
procedure toggleWNDVisible(WND : uint32); |
Toggle the visibility of a Window. Parameters
|
procedure setWNDVisible(WND : uint32; visible : boolean); |
Change a Windows visibility. Parameters
|
procedure closeAllWindows; |
Close all open Windows and release handles. |
function newWindow(x : uint32; y : uint32; Width : uint32; Height : uint32; Title : PChar) : HWND; |
Spawn a new Window at cell(x,y) with specified Width, Height and Title. Parameters
ReturnsA 32-bit Handle for the new Window. |
function registerEventHandler(WND : HWND; Event : TEventType; Handler : void) : boolean; |
Register an Event Handler to a Window Parameters
Returns
|
procedure forceQuitAll; |
Forcefully close all Windows |
procedure closeWindow(WND : HWND); |
Close a Window specified by its Handle Parameters
|
procedure bordersEnabled(WND : HWND; enabled : boolean); |
Enable or disable the drawing of the borders surrounding a Window. Parameters
|
procedure SetShellWindow(WND : HWND; b : boolean); |
Set a specified Window as a Shell Window (Window cannot be moved or closed). Parameters
|
function getWindowName(WND : HWND) : pchar; |
Get the title of a specified Window. Parameters
ReturnsNULL Terminated PChar. |
procedure mouseEnabled(b : boolean); |
Enable or disable the mouse. Parameters
|
procedure _MouseDown(); |
Callback for a MouseDown event. |
procedure _MouseUp(); |
Callback for a MouseUp event. |
procedure _MouseClick(left : boolean); |
Callback for a MouseClick event. Parameters
|
procedure setWindowColors(colors : uint32); |
Set the attributes used for drawing the border around Windows. Parameters
|
function getWindowColorPtr: puint32; |
Get a Pointer to the attribute used for Window Borders. ReturnsA 32-bit pointer to the Borders Attribute. |
function getMaxCellW: uint32; |
function getMaxCellH: uint32; |
function getConsoleProperties: PConsoleProperties; |
Types
TColor = (...); |
4-bit nibble representing a color. Values
|
TEventType = (...); |
Window Manager Events. Values
|
PConsoleProperties = ˆTConsoleProperties; |
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.16.0.