# Unit console

Description
Uses
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
Variables

## Description

`Console` - Provides Screen/Window management & drawing.

## Uses

- util
- bios_data_area
- multiboot
- fonts
- tracer

## 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);`

Clear a Window Canvas.

###### Parameters

WND
  A Window Handle.

`procedure clearWNDEx(WND : uint32; attributes : uint32);`

Clear a Window Canvas, with the specified attributes.

###### Parameters

WND
  A Window Handle.
Attributes
  A 32-bit value representing an attribute set.

`procedure writecharWND(character : char; WND : uint32);`

Write an ASCII character to a specified Window.

###### Parameters

Character
  An 8-bit value representing an ASCII character.
WND
  A 32-bit handle to a Window.

`procedure writecharlnWND(character : char; WND : uint32);`

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

###### Parameters

character
  An 8-bit value representing an ASCII character.
WND
  A 32-bit handle to a Window.

`procedure writecharexWND(character : char; attributes: uint32; WND : uint32);`

Write a single 8-bit character to a Window, 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.
WND
  A 32-bit handle to a Window.

`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

character
  An 8-bit value representing an ASCII character.
attributes
  A 32-bit value representing the colors for the background and foreground.
WND
  A 32-bit handle to a Window.

`procedure OutputWND(identifier : PChar; str : PChar; WND : uint32);`

Simple console write for debugging to a Window.

###### Parameters

identifier
  A NULL terminated string with the name of the module printing the output.
str
  A NULL terminated string with the debug message.
WND
  A 32-bit handle to a Window.

`procedure OutputlnWND(identifier : PChar; str : PChar; WND : uint32);`

Simple console writeln for debugging to a Window.

###### Parameters

identifier
  A NULL terminated string with the name of the module printing the output.
str
  A NULL terminated string with the debug message.
WND
  A 32-bit handle to a Window.

`procedure writestringWND(str: PChar; WND : uint32);`

Write a NULL terminated string to a Window.

###### Parameters

str
  A NULL terminated string with the debug message.
WND
  A 32-bit handle to a Window.

`procedure writestringlnWND(str: PChar; WND : uint32);`

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

###### Parameters

str
  A NULL terminated string with the debug message.
WND
  A 32-bit handle to a Window.

`procedure writestringexWND(str: PChar; attributes: uint32; WND : uint32);`

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

###### Parameters

str
  A NULL terminated string with the debug message.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writestringlnexWND(str: PChar; attributes: uint32; WND : uint32);`

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

###### Parameters

str
  A NULL terminated string with the debug message.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writeintWND(i: Integer; WND : uint32);`

Write a 32-bit value to a Window.

###### Parameters

i
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writeintlnWND(i: Integer; WND : uint32);`

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

###### Parameters

i
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writeintexWND(i: Integer; attributes: uint32; WND : uint32);`

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

###### Parameters

i
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writeintlnexWND(i: Integer; attributes: uint32; WND : uint32);`

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

###### Parameters

i
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writehexpairWND(b : uint8; WND : uint32);`

Write an 8-bit Hex Pair to a Window.

###### Parameters

b
  An 8-bit value.
WND
  A 32-bit handle to a Window.

`procedure writehexpairExWND(b : uint8; Attributes : uint32; WND : uint32);`

Write an 8-bit Hex Pair to a Window, with the specified attributes.

###### Parameters

b
  An 8-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writehexWND(i: DWORD; WND : uint32);`

Write a 32-bit value as Hex Pairs to a Window.

###### Parameters

i
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writehexlnWND(i: DWORD; WND : uint32);`

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

###### Parameters

i
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writehexexWND(i : DWORD; attributes: uint32; WND : uint32);`

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

###### Parameters

b
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`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

b
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writebin8WND(b : uint8; WND : uint32);`

Write an 8-bit value as binary to a Window.

###### Parameters

b
  An 8-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin8lnWND(b : uint8; WND : uint32);`

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

###### Parameters

b
  An 8-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin8exWND(b : uint8; attributes: uint32; WND : uint32);`

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

###### Parameters

b
  An 8-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`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

b
  An 8-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writebin16WND(b : uint16; WND : uint32);`

Write a 16-bit value as binary to a Window.

###### Parameters

b
  A 16-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin16lnWND(b : uint16; WND : uint32);`

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

###### Parameters

b
  A 16-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin16exWND(b : uint16; attributes: uint32; WND : uint32);`

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

###### Parameters

b
  A 16-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`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

b
  A 16-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`procedure writebin32WND(b : uint32; WND : uint32);`

Write a 32-bit value as binary to a Window.

###### Parameters

b
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin32lnWND(b : uint32; WND : uint32);`

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

###### Parameters

b
  A 32-bit value.
WND
  A 32-bit handle to a Window.

`procedure writebin32exWND(b : uint32; attributes: uint32; WND : uint32);`

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

###### Parameters

b
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`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

b
  A 32-bit value.
attributes
  A 32-bit representation of the background/foreground colors.
WND
  A 32-bit handle to a Window.

`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

WND
  A 32-bit handle to a Window.

`procedure setCursorPosWND(x : uint32; y : uint32; WND : HWND);`

Set the caret belonging to a Window to a specified position.

###### Parameters

X
  The new Horizontal position.
Y
  The new Vertical postion.
WND
  A 32-bit handle to a Window.

`procedure _increment_x_WND(WND : uint32);`

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

###### Parameters

WND
  A 32-bit handle to a Window.

`procedure _increment_y_WND(WND : uint32);`

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

###### Parameters

WND
  A 32-bit handle to a Window.

`procedure _safeincrement_y_WND(WND : uint32);`

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

###### Parameters

WND
  A 32-bit handle to a Window.

`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

WND
  A 32-bit handle to a Window.

`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

WND
  A 32-bit handle to a Window.

`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

C
  An 8-bit ASCII Character.
X
  An 8-bit Horizontal Cell position.
Y
  An 8-bit Vertical Cell Position.
fgcolor
  The 16-bit color of the Character.
bgcolor
  The 16-bit background color of the cell.

`procedure outputCharToScreenSpace(c : char; x : uint32; y : uint32; fgcolor : uint16);`

Draw an ASCII char to raw screen space.

###### Parameters

C
  An 8-bit ASCII Character.
X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.
fgcolor
  The 16-bit color of the Character.
bgcolor
  The 16-bit background color of the cell.

`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

C
  An 8-bit ASCII Character.
X
  An 8-bit Horizontal Cell position.
Y
  An 8-bit Vertical Cell Position.
fgcolor
  The 16-bit color of the Character.

`function getPixel(x : uint32; y : uint32) : uint16;`

Get 16-bits of pixel information from the screen position(x,y).

###### Parameters

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.

###### Returns

16-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

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.
color
  16-bits of Pixel Information

`function getPixel32(x : uint32; y : uint32) : uint32;`

Get 32-bits of pixel information from the screen position(x,y).

###### Parameters

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.

###### Returns

32-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

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.
color
  32-bits of Pixel Information

`function getPixel64(x : uint32; y : uint32) : uint64;`

Get 64-bits of pixel information from the screen position(x,y).

###### Parameters

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.

###### Returns

64-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

X
  A 32-bit Horizontal Screen position.
Y
  A 32-bit Vertical Screen Position.
color
  64-bits of Pixel Information

`procedure setMousePosition(x : uint32; y : uint32);`

Set the position of the mouse cursor relative to screen space.

###### Parameters

X
  A 32-bit Horizontal Screen Position.
Y
  A 32-bit Vertical Screen Position.

`procedure redrawWindows;`
Redraw all of the Window adhearing to Z-Order.

`procedure toggleWNDVisible(WND : uint32);`

Toggle the visibility of a Window.

###### Parameters

WND
  A 32-bit handle to a Window.

`procedure setWNDVisible(WND : uint32; visible : boolean);`

Change a Windows visibility.

###### Parameters

WND
  A 32-bit handle to a Window.
Visible
  `True` or `False`.

`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. @retruns(A 32-bit Handle for the new Window.)

###### Parameters

X
  32-bit Horizontal Cell for the top-left corner of the Window.
Y
  32-bit Vertical Cell for the top-left corner of the Window.
Width
  32-bit Width of the Window in Cells.
Height
  32-bit Height of the Window in Cells.
Title
  NULL Terminated String used as the Title for the Window.

`function registerEventHandler(WND : HWND; Event : TEventType; Handler : void) : boolean;`

Register an Event Handler to a Window

###### Parameters

WND
  Handle for the Window the event should be registered against.
Event
  Type of event to register.
Handler
  Procedure to be called upon the event firing.

###### Returns

`True` for success `False` for failure.

`procedure forceQuitAll;`
Forcefully close all Windows

`procedure closeWindow(WND : HWND);`

Close a Window specified by its Handle

###### Parameters

WND
  The handle to the target Window.

`procedure bordersEnabled(WND : HWND; enabled : boolean);`

Enable or disable the drawing of the borders surrounding a Window.

###### Parameters

WND
  A 32-bit Handle to the target Window.
Enabled
  `True` for borders to be shown, `False` for borders to be hidden.

`procedure SetShellWindow(WND : HWND; b : boolean);`

Set a specified Window as a Shell Window (Window cannot be moved or closed).

###### Parameters

WND
  32-bit Handle for the target Window.
b
  `True` to set Target as a Shell Window, `False` to set Target as a normal Window.

`function getWindowName(WND : HWND) : pchar;`

Get the title of a specified Window.

###### Parameters

WND
  32-bit Handle for the target Window.

###### Returns

NULL Terminated PChar.

`procedure mouseEnabled(b : boolean);`

Enable or disable the mouse.

###### Parameters

b
  `True` for mouse enabled, `False` for mouse disabled.

`procedure _MouseDown();`
Callback for a MouseDown event.

`procedure _MouseUp();`
Callback for a MouseUp event.

`procedure _MouseClick(left : boolean);`

Callback for a MouseClick event.

###### Parameters

Left
  `True` for a Left-Click, `False` for a Right-Click.

`procedure setWindowColors(colors : uint32);`

Set the attributes used for drawing the border around Windows.

###### Parameters

Colors
  A 32-bit value representing the attributes (background/foreground).

`function getWindowColorPtr : puint32;`

Get a Pointer to the attribute used for Window Borders.

###### Returns

A 32-bit pointer to the Borders Attribute.

### 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

- Kieron Morris <kjm@kieronmorris.me>

Generated by PasDoc 0.15.0.