Difference between revisions of "Unit Console"
Line 48: | Line 48: | ||
|- | |- | ||
| <code>CONSOLE_TYPE_LCD = 4;</code> | | <code>CONSOLE_TYPE_LCD = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>CONSOLE_TYPE_MAX = 4;</code> | ||
| | | | ||
|- | |- | ||
Line 62: | Line 67: | ||
|- | |- | ||
| <code>CONSOLE_STATE_OPEN = 1;</code> | | <code>CONSOLE_STATE_OPEN = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>CONSOLE_STATE_MAX = 1;</code> | ||
| | | | ||
|- | |- | ||
Line 194: | Line 204: | ||
|- | |- | ||
| <code>WINDOW_STATE_VISIBLE = 1;</code> | | <code>WINDOW_STATE_VISIBLE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>WINDOW_STATE_MAX = 1;</code> | ||
| | | | ||
|- | |- | ||
Line 211: | Line 226: | ||
|- | |- | ||
| <code>WINDOW_MODE_GRAPHICS = 2;</code> | | <code>WINDOW_MODE_GRAPHICS = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>WINDOW_MODE_MAX = 2;</code> | ||
| | | | ||
|- | |- |
Revision as of 05:12, 9 June 2021
Return to Unit Reference
Description
Ultibo Console interface unit
Note:
Console coordinates X,Y are based on either pixels or characters depending on the console mode (Pixel or Character)
Console coordinates begin at 0,0 and extend to Width - 1, Height - 1
Console Window coordinates X,Y are always based on characters, beginning at 1,1 and extending to Cols,Rows
Constants
CONSOLE_*
CONSOLE_NAME_PREFIX = 'Console';
|
Name prefix for Console Devices |
CONSOLE_TYPE_*
CONSOLE_TYPE_NONE = 0;
|
|
CONSOLE_TYPE_FRAMEBUFFER = 1;
|
|
CONSOLE_TYPE_SERIAL = 2;
|
|
CONSOLE_TYPE_REMOTE = 3;
|
|
CONSOLE_TYPE_LCD = 4;
|
|
CONSOLE_TYPE_MAX = 4;
|
CONSOLE_STATE_*
CONSOLE_STATE_CLOSED = 0;
|
|
CONSOLE_STATE_OPEN = 1;
|
|
CONSOLE_STATE_MAX = 1;
|
CONSOLE_FLAG_*
CONSOLE_FLAG_NONE = $00000000;
|
|
CONSOLE_FLAG_LINE_WRAP = $00000001;
|
Wrap long lines to the next line if set |
CONSOLE_FLAG_DMA_BOX = $00000002;
|
Use DMA to draw boxes (Where applicable) |
CONSOLE_FLAG_DMA_LINE = $00000004;
|
Use DMA to draw lines (Where applicable) |
CONSOLE_FLAG_DMA_FILL = $00000008;
|
Use DMA to fill blocks (Where applicable) |
CONSOLE_FLAG_DMA_CLEAR = $00000010;
|
Use DMA to clear blocks (Where applicable) |
CONSOLE_FLAG_DMA_SCROLL = $00000020;
|
Use DMA to scroll blocks (Where applicable) |
CONSOLE_FLAG_SINGLE_WINDOW = $00000040;
|
Console supports only one window (Not multiple) |
CONSOLE_FLAG_HARDWARE_CURSOR = $00000080;
|
Console supports a hardware cursor (Mouse pointer) (Character mode only) |
CONSOLE_FLAG_HARDWARE_CARET = $00000100;
|
Console supports a hardware caret (Text cursor) |
CONSOLE_FLAG_BLINK_CARET = $00000200;
|
Console supports blinking caret |
CONSOLE_FLAG_TEXT_MODE = $00000400;
|
Console supports text mode settings |
CONSOLE_FLAG_TEXT_BLINK = $00000800;
|
Console supports blinking text |
CONSOLE_FLAG_COLOR = $00001000;
|
Console supports colors |
CONSOLE_FLAG_FONT = $00002000;
|
Console supports font |
CONSOLE_FLAG_FULLSCREEN = $00004000;
|
Console supports creating a fullscreen window |
CONSOLE_FLAG_AUTO_SCROLL = $00008000;
|
Automatically scroll up on reaching the last line |
CONSOLE_FLAG_DMA_TEXT = $00010000;
|
Use DMA to draw text (Where applicable) |
CONSOLE_FLAG_COLOR_REVERSE = $00020000;
|
Console requires colors to be reversed for underlying hardware |
CONSOLE_FLAG_TEXT_CARET = $00040000;
|
Console supports a caret (Text cursor) |
CONSOLE_FLAG_FOCUS_CARET = $00080000;
|
Only show caret on the focused (active) window |
CONSOLE_FLAG_DMA_MASK = CONSOLE_FLAG_DMA_BOX or CONSOLE_FLAG_DMA_LINE or CONSOLE_FLAG_DMA_FILL or CONSOLE_FLAG_DMA_CLEAR or CONSOLE_FLAG_DMA_SCROLL or CONSOLE_FLAG_DMA_TEXT;
| |
Flags that cannot be changed by ConsoleDeviceUpdateFlag | |
CONSOLE_FLAG_INTERNAL = CONSOLE_FLAG_SINGLE_WINDOW or CONSOLE_FLAG_HARDWARE_CURSOR or CONSOLE_FLAG_HARDWARE_CARET or CONSOLE_FLAG_BLINK_CARET or CONSOLE_FLAG_TEXT_MODE or CONSOLE_FLAG_TEXT_BLINK or CONSOLE_FLAG_COLOR or CONSOLE_FLAG_FONT or CONSOLE_FLAG_FULLSCREEN or CONSOLE_FLAG_COLOR_REVERSE or CONSOLE_FLAG_TEXT_CARET;
|
CONSOLE_MODE_*
CONSOLE_MODE_NONE = 0;
|
|
CONSOLE_MODE_PIXEL = 1;
|
|
CONSOLE_MODE_CHARACTER = 2;
|
CARET_SIGNATURE*
CARET_SIGNATURE = $9A2D40E3;
|
WINDOW_SIGNATURE_*
WINDOW_SIGNATURE = $DE3A5C04;
|
WINDOW_STATE_*
WINDOW_STATE_INVISIBLE = 0;
|
|
WINDOW_STATE_VISIBLE = 1;
|
|
WINDOW_STATE_MAX = 1;
|
WINDOW_MODE_*
WINDOW_MODE_NONE = 0;
|
|
WINDOW_MODE_TEXT = 1;
|
|
WINDOW_MODE_GRAPHICS = 2;
|
|
WINDOW_MODE_MAX = 2;
|
WINDOW_FLAG_*
WINDOW_FLAG_NONE = $00000000;
|
|
WINDOW_FLAG_LINE_WRAP = $00000001;
|
Wrap long lines to the next line if set |
WINDOW_FLAG_BUFFERED = $00000002;
|
Buffer output for scroll back and redraw |
WINDOW_FLAG_FULLSCREEN = $00000004;
|
Window occupies the full screen |
WINDOW_FLAG_AUTO_SCROLL = $00000008;
|
Automatically scroll up on reaching the last line |
WINDOW_FLAG_CHARACTER = $00000010;
|
Console for this Window is character mode only |
WINDOW_FLAG_AUTO_UPDATE = $00000020;
|
Automatically update output of buffered window |
WINDOW_FLAG_FOCUS_CURSOR = $00000040;
|
Only show cursor (caret) on the focused (active) window |
Flags that cannot be changed by ConsoleWindowUpdateFlag | |
WINDOW_FLAG_INTERNAL = WINDOW_FLAG_FULLSCREEN or WINDOW_FLAG_CHARACTER;
|
WINDOW_DRAW_FLAG_*
WINDOW_DRAW_FLAG_NONE = $00000000;
|
|
WINDOW_DRAW_FLAG_BODY = $00000001;
|
Draw the Window body |
WINDOW_DRAW_FLAG_TITLE = $00000002;
|
Draw the Window title |
WINDOW_DRAW_FLAG_BORDER = $00000004;
|
Draw the Window border |
WINDOW_DRAW_FLAG_ALL = WINDOW_DRAW_FLAG_BODY or WINDOW_DRAW_FLAG_TITLE or WINDOW_DRAW_FLAG_BORDER;
|
WINDOW_HISTORY_*
WINDOW_HISTORY_MAX_COUNT = 100;
|
FRAMEBUFFER_CONSOLE_*
FRAMEBUFFER_CONSOLE_TITLE = 'Ultibo Core (Release: ' + ULTIBO_RELEASE_NAME + ' Version: ' + ULTIBO_RELEASE_VERSION + ' Date: ' + ULTIBO_RELEASE_DATE + ')';
|
|
FRAMEBUFFER_CONSOLE_DESCRIPTION = 'Framebuffer Console';
|
Description of the Framebuffer Console device |
Type definitions
Cursor state
TCursorState = (CURSORON,CURSOROFF);
|
Console char
PConsoleChar = ^TConsoleChar;
TConsoleChar = record
Ch:Char;
|
|
Forecolor:LongWord;
|
|
Backcolor:LongWord;
|
Console point
TConsolePoint = record
X:LongWord;
|
|
Y:LongWord;
|
Console rect
TConsoleRect = record
X1:LongWord;
|
|
Y1:LongWord;
|
|
X2:LongWord;
|
|
Y2:LongWord;
|
Console properties
PConsoleProperties = ^TConsoleProperties;
TConsoleProperties = record
Flags:LongWord;
|
Console device flags (eg CONSOLE_FLAG_FULLSCREEN) |
Mode:LongWord;
|
Console device mode (eg CONSOLE_MODE_PIXEL) |
Width:LongWord;
|
Console Width (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Height:LongWord;
|
Console Height (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Format:LongWord;
|
Color Format (eg COLOR_FORMAT_ARGB32)(Only applicable if CONSOLE_MODE_PIXEL) |
Console enumeration callback
TConsoleEnumerate = function(Console:PConsoleDevice; Data:Pointer):LongWord;
|
Console notification callback
TConsoleNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Console device open
TConsoleDeviceOpen = function(Console:PConsoleDevice):LongWord;
|
Console device close
TConsoleDeviceClose = function(Console:PConsoleDevice):LongWord;
|
Console device clear
TConsoleDeviceClear = function(Console:PConsoleDevice; Color:LongWord):LongWord;
|
Console device scroll
TConsoleDeviceScroll = function(Console:PConsoleDevice; X1,Y1,X2,Y2,Count,Direction:LongWord):LongWord;
|
Console device draw box
TConsoleDeviceDrawBox = function(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
|
Console device draw line
TConsoleDeviceDrawLine = function(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
|
Console device draw char
TConsoleDeviceDrawChar = function(Console:PConsoleDevice; Handle:TFontHandle; Ch:Char;X,Y,Forecolor,Backcolor:LongWord):LongWord;
|
Console device draw text
TConsoleDeviceDrawText = function(Console:PConsoleDevice; Handle:TFontHandle; const Text:String;X,Y,Forecolor,Backcolor,Len:LongWord):LongWord;
|
Console device draw pixel
TConsoleDeviceDrawPixel = function(Console:PConsoleDevice; X,Y,Color:LongWord):LongWord;
|
Console device draw block
TConsoleDeviceDrawBlock = function(Console:PConsoleDevice; X1,Y1,X2,Y2,Color:LongWord):LongWord;
|
Console device draw image
TConsoleDeviceDrawImage = function(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
|
Console device draw window
TConsoleDeviceDrawWindow = function(Console:PConsoleDevice; Handle:TWindowHandle):LongWord;
|
Console device get pixel
TConsoleDeviceGetPixel = function(Console:PConsoleDevice; X,Y:LongWord; var Color:LongWord):LongWord;
|
Console device get image
TConsoleDeviceGetImage = function(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
|
Console device put text
TConsoleDevicePutText = function(Console:PConsoleDevice; Handle:TFontHandle; const Source,Dest:TConsolePoint; Buffer:PConsoleChar; Width,Height,Skip:LongWord):LongWord;
|
Console device copy image
TConsoleDeviceCopyImage = function(Console:PConsoleDevice; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord;
|
Console device get position
TConsoleDeviceGetPosition = function(Console:PConsoleDevice; Position:LongWord; var X1,Y1,X2,Y2:LongWord):LongWord;
|
Console device get properties
TConsoleDeviceGetProperties = function(Console:PConsoleDevice; Properties:PConsoleProperties):LongWord;
|
Console device
PConsoleDevice = ^TConsoleDevice;
TConsoleDevice = record
Device Properties | |
Device:TDevice;
|
The Device entry for this Console device |
Console Properties | |
ConsoleId:LongWord;
|
Unique Id of this Console device in the Console device table |
ConsoleState:LongWord;
|
Console device state (eg CONSOLE_STATE_OPEN) |
ConsoleMode:LongWord;
|
Console device mode (eg CONSOLE_MODE_PIXEL) |
DeviceOpen:TConsoleDeviceOpen;
|
A device specific DeviceOpen method implementing a standard console device interface (Mandatory) |
DeviceClose:TConsoleDeviceClose;
|
A device specific DeviceClose method implementing a standard console device interface (Mandatory) |
DeviceClear:TConsoleDeviceClear;
|
A device specific DeviceClear method implementing a standard console device interface (Mandatory) |
DeviceScroll:TConsoleDeviceScroll;
|
A device specific DeviceScroll method implementing a standard console device interface (Mandatory) |
DeviceDrawBox:TConsoleDeviceDrawBox;
|
A device specific DeviceDrawBox method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceDrawLine:TConsoleDeviceDrawLine;
|
A device specific DeviceDrawLine method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceDrawChar:TConsoleDeviceDrawChar;
|
A device specific DeviceDrawChar method implementing a standard console device interface (Mandatory) |
DeviceDrawText:TConsoleDeviceDrawText;
|
A device specific DeviceDrawText method implementing a standard console device interface (Mandatory) |
DeviceDrawPixel:TConsoleDeviceDrawPixel;
|
A device specific DeviceDrawPixel method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceDrawBlock:TConsoleDeviceDrawBlock;
|
A device specific DeviceDrawBlock method implementing a standard console device interface (Mandatory) |
DeviceDrawImage:TConsoleDeviceDrawImage;
|
A device specific DeviceDrawImage method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceDrawWindow:TConsoleDeviceDrawWindow;
|
A device specific DeviceDrawWindow method implementing a standard console device interface (Mandatory) |
DeviceGetPixel:TConsoleDeviceGetPixel;
|
A device specific DeviceGetPixel method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceGetImage:TConsoleDeviceGetImage;
|
A device specific DeviceGetImage method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DevicePutText:TConsoleDevicePutText;
|
A device specific DevicePutText method implementing a standard console device interface (Mandatory) |
DeviceCopyImage:TConsoleDeviceCopyImage;
|
A device specific DeviceCopyImage method implementing a standard console device interface (Mandatory for CONSOLE_MODE_PIXEL) |
DeviceGetPosition:TConsoleDeviceGetPosition;
|
A device specific DeviceGetPosition method implementing a standard console device interface (Mandatory) |
DeviceGetProperties:TConsoleDeviceGetProperties;
|
A device specific DeviceGetProperties method implementing a standard console device interface (Or nil if the default method is suitable) |
Statistics Properties | |
OpenCount:LongWord;
|
|
CloseCount:LongWord;
|
|
ClearCount:LongWord;
|
|
ScrollCount:LongWord;
|
|
DrawCount:LongWord;
|
|
GetCount:LongWord;
|
|
PutCount:LongWord;
|
|
CopyCount:LongWord;
|
|
Driver Properties | |
Lock:TMutexHandle;
|
Device lock |
Width:LongWord;
|
Console Width (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Height:LongWord;
|
Console Height (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Format:LongWord;
|
Color Format (eg COLOR_FORMAT_ARGB32)(Only applicable if CONSOLE_MODE_PIXEL) |
Forecolor:LongWord;
|
Foreground Color |
Backcolor:LongWord;
|
Background Color |
Borderwidth:LongWord;
|
Border Width (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Bordercolor:LongWord;
|
Border Color |
Font Properties | |
Font:TFontHandle;
|
Console Font |
FontRatio:LongWord;
|
Font Characters to Pixels Ratio (Normally 1 for Pixel Console/0 for Character Console) |
Window Properties | |
WindowFirst:PConsoleWindow;
|
|
WindowLock:TCriticalSectionHandle;
|
|
WindowCount:LongWord;
|
|
WindowDefault:TWindowHandle;
|
|
Internal Properties | |
Prev:PConsoleDevice;
|
Previous entry in Console device table |
Next:PConsoleDevice;
|
Next entry in Console device table |
Window properties
PWindowProperties = ^TWindowProperties;
TWindowProperties = record
Position:LongWord;
|
Console Window Position (eg CONSOLE_POSITION_TOP) |
State:LongWord;
|
Console Window State (eg WINDOW_STATE_VISIBLE) |
Mode:LongWord;
|
Console Window Mode (eg WINDOW_MODE_TEXT) |
Flags:LongWord;
|
Console Window Flags (eg WINDOW_FLAG_LINE_WRAP) |
X1:LongWord;
|
(Window X1) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Y1:LongWord;
|
(Window Y1) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
X2:LongWord;
|
(Window X2)Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Y2:LongWord;
|
(Window Y2) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Width:LongWord;
|
Window Width in Columns (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
Height:LongWord;
|
Window Height in Rows (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
OffsetX:LongWord;
|
Window X Offset (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
OffsetY:LongWord;
|
Window Y Offset (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
FontWidth:LongWord;
|
Font Width (Pixels) |
FontHeight:LongWord;
|
Font Height (Pixels) |
Borderwidth:LongWord;
|
Current Border Width |
Font:TFontHandle;
|
Window Font |
Console:PConsoleDevice;
|
Window console |
Console window enumeration callback
TConsoleWindowEnumerate = function(Console:PConsoleDevice; Handle:TWindowHandle; Data:Pointer):LongWord;
|
Console window
PConsoleWindow = ^TConsoleWindow;
TConsoleWindow = record
Window Properties | |
Signature:LongWord;
|
Signature for entry validation |
Position:LongWord;
|
Console Window Position (eg CONSOLE_POSITION_TOP) |
WindowState:LongWord;
|
Console Window State (eg WINDOW_STATE_VISIBLE) |
WindowMode:LongWord;
|
Console Window Mode (eg WINDOW_MODE_TEXT) |
WindowFlags:LongWord;
|
Console Window Flags (eg WINDOW_FLAG_LINE_WRAP) |
X1:LongWord;
|
(Window X1) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Y1:LongWord;
|
(Window Y1) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
X2:LongWord;
|
(Window X2) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Y2:LongWord;
|
Window Y2) Console Relative (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Width:LongWord;
|
Window Width in Columns (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
Height:LongWord;
|
Window Height in Rows (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
OffsetX:LongWord;
|
Window X Offset (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
OffsetY:LongWord;
|
Window Y Offset (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
MinX:LongWord;
|
(Viewport X1) Window Relative (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
MinY:LongWord;
|
(Viewport Y1) Window Relative (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
MaxX:LongWord;
|
(Viewport X2) Window Relative (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
MaxY:LongWord;
|
(Viewport Y2) Window Relative (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
X:LongWord;
|
(Current X) Window Relative (Characters for WINDOW_MODE_TEXT/Not used for WINDOW_MODE_GRAPHICS) |
Y:LongWord;
|
(Current Y) Window Relative (Characters for WINDOW_MODE_TEXT/Not used for WINDOW_MODE_GRAPHICS) |
Cols:LongWord;
|
Viewport Columns (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
Rows:LongWord;
|
Viewport Rows (Characters for WINDOW_MODE_TEXT/Pixels for WINDOW_MODE_GRAPHICS) |
Format:LongWord;
|
Color Format (eg COLOR_FORMAT_ARGB32)(Only applicable if CONSOLE_MODE_PIXEL) |
Forecolor:LongWord;
|
Current Foreground Color |
Backcolor:LongWord;
|
Current Background Color |
Borderwidth:LongWord;
|
Current Border Width |
Bordercolor:LongWord;
|
Current Border Color |
Font Properties | |
Font:TFontHandle;
|
Window Font |
FontWidth:LongWord;
|
Font Width (Pixels) |
FontHeight:LongWord;
|
Font Height (Pixels) |
Cursor Properties | |
CursorX:LongWord;
|
(Cursor X) Window Relative (Characters for WINDOW_MODE_TEXT/Not used for WINDOW_MODE_GRAPHICS) |
CursorY:LongWord;
|
(Cursor Y) Window Relative (Characters for WINDOW_MODE_TEXT/Not used for WINDOW_MODE_GRAPHICS) |
CursorMode:LongWord;
|
Cursor Mode (eg CURSOR_MODE_INSERT) |
CursorBlink:Boolean;
|
Cursor Blink On/Off |
CursorState:TCursorState;
|
Cursor State On/Off |
CursorTimer:TTimerHandle;
|
Cursor Timer (or INVALID_HANDLE_VALUE) |
Driver Properties | |
Lock:TMutexHandle;
|
Window lock |
Console:PConsoleDevice;
|
Window console |
Internal Properties | |
Prev:PConsoleWindow;
|
Previous entry in Console Window table |
Next:PConsoleWindow;
|
Next entry in Console Window table |
Framebuffer console
PFramebufferConsole = ^TFramebufferConsole;
TFramebufferConsole = record
Console Properties | |
Console:TConsoleDevice;
|
|
Framebuffer Properties | |
Framebuffer:PFramebufferDevice;
|
|
DesktopX:LongWord;
|
Desktop X (Left) Console Relative (Pixels) |
DesktopY:LongWord;
|
Desktop Y (Right) Console Relative (Pixels) |
DesktopWidth:LongWord;
|
Desktop (Width) Console Relative (Pixels) |
DesktopHeight:LongWord;
|
Desktop (Height) Console Relative (Pixels) |
DesktopOffset:LongWord;
|
Desktop (Offset) |
DesktopColor:LongWord;
|
Desktop (Color) |
Buffer Properties | |
LineBuffer:Pointer;
|
Buffer for device reads and writes (Size of one line) |
Public variables
None defined
Function declarations
Initialization functions
procedure ConsoleInit;
Note | Called only during system startup |
---|
Console functions
function ConsoleDeviceOpen(Console:PConsoleDevice):LongWord;
Console | The console device to open |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceClose(Console:PConsoleDevice):LongWord;
Console | The console device to close |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceClear(Console:PConsoleDevice; Color:LongWord):LongWord;
Console | The console device to clear |
---|---|
Color | The color to use when clearing the console |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceScroll(Console:PConsoleDevice; X1,Y1,X2,Y2,Count,Direction:LongWord):LongWord;
Console | The console device to scroll |
---|---|
X1 | The left edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom edge of the area to scroll (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Count | The number of pixels or characters (depending on console mode) to scroll |
Direction | The direction to scroll (eg CONSOLE_DIRECTION_UP) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceDrawBox(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X1 | The left edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom edge of the box (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Width | The width of the box outline (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceDrawLine(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X1 | The left starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Width | The width of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDevicePlotLine(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X1 | The left starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top starting point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom ending point of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Width | The width of the line (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)
Character consoles may implement plot line but the default method only supports pixel consoles |
function ConsoleDeviceDrawChar(Console:PConsoleDevice; Handle:TFontHandle; Ch:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Console | The console device to draw on |
---|---|
Handle | The handle of the font to draw with |
Ch | The character to draw |
X | The left starting point of the character (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The top starting point of the character (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Forecolor | The foreground color for the character (eg COLOR_WHITE) |
Backcolor | The background color for the character (eg COLOR_BLACK) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Forecolor and Backcolor must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceDrawText(Console:PConsoleDevice; Handle:TFontHandle; const Text:String; X,Y,Forecolor,Backcolor,Len:LongWord):LongWord;
Console | The console device to draw on |
---|---|
Handle | The handle of the font to draw with |
Text | The text to draw |
X | The left starting point of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The top starting point of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Forecolor | The foreground color for the text (eg COLOR_WHITE) |
Backcolor | The background color for the text (eg COLOR_BLACK) |
Len | The length of the text (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Forecolor and Backcolor must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceDrawPixel(Console:PConsoleDevice; X,Y,Color:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X | The column to draw the pixel (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The row to draw the pixel (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceDrawBlock(Console:PConsoleDevice; X1,Y1,X2,Y2,Color:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X1 | The left edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom edge of the block (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceDrawCircle(Console:PConsoleDevice; X,Y,Color,Width,Radius:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X | The column center point of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The row center point of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color to draw with (eg COLOR_WHITE) |
Width | The width of the circle outline (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Radius | The radius of the circle (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color must be specified in the default color format (See COLOR_FORMAT_DEFAULT)
Character consoles may implement draw circle but the default method only supports pixel consoles |
function ConsoleDeviceDrawImage(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
Console | The console device to draw on |
---|---|
X | The starting column of the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The starting row of the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Buffer | Pointer to a block of memory containing the pixels of the image in a contiguous block of rows |
Width | The number of columns in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Height | The number of rows in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Format | The color format of the image (eg COLOR_FORMAT_RGB24) |
Skip | The number of pixels to skip in the buffer after each row (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceDrawWindow(Console:PConsoleDevice; Handle:TWindowHandle; Flags:LongWord):LongWord;
Console | The console device to draw on |
---|---|
Handle | The handle of the console window to draw |
Flags | Flags to specify what should be drawn (eg WINDOW_DRAW_FLAG_BORDER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceGetPixel(Console:PConsoleDevice; X,Y:LongWord; var Color:LongWord):LongWord;
Console | The console device to read from |
---|---|
X | The column to read the pixel from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The row to read the pixel from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Color | The color value read from the console (eg COLOR_WHITE) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Color is returned in the default color format (See COLOR_FORMAT_DEFAULT) |
function ConsoleDeviceGetImage(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
Console | The console device to read from |
---|---|
X | The starting column to read the image from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The starting row to read the image from (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Buffer | Pointer to a block of memory large enough to hold the pixels of the image in a contiguous block of rows |
Width | The number of columns to store in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Height | The number of rows to store in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Format | The color format to store the image in (eg COLOR_FORMAT_RGB24) |
Skip | The number of pixels to skip in the buffer after each row (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDevicePutText(Console:PConsoleDevice; Handle:TFontHandle; const Source,Dest:TConsolePoint; Buffer:PConsoleChar; Width,Height,Skip:LongWord):LongWord;
Console | The console device to output to |
---|---|
Source | The X and Y point in the source buffer to copy text from (Characters) |
Dest | The X and Y point on the console device to copy text to (Pixels for CONSOLE_MODE_PIXEL/Characters for CONSOLE_MODE_CHARACTER) |
Buffer | A pointer to a buffer of TConsoleChar structures which represent rows of text |
Width | The width of the area to be output (Characters) |
Height | The height of the area to be output (Characters) |
Skip | The number of characters to skip in the buffer after each row (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Source, Width, Heigth and Skip are based on character rows and columns not screen pixels. |
function ConsoleDeviceCopyImage(Console:PConsoleDevice; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord;
Console | The console device to copy on |
---|---|
Source | The starting point for the source of the copy (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Dest | The starting point for the destination of the copy (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Width | The number of columns in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Height | The number of rows in the image (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceAddCaret(Console:PConsoleDevice; Width,Height,OffsetX,OffsetY:LongWord):THandle;
Console | The console device to create the caret on |
---|---|
Width | The width of the new caret (Pixels for CONSOLE_MODE_PIXEL / Always 1 for CONSOLE_MODE_CHARACTER) |
Height | The height of the new caret (Pixels for CONSOLE_MODE_PIXEL / Always 1 for CONSOLE_MODE_CHARACTER) |
OffsetX | The X offset of the new caret (Optional)(Pixels for CONSOLE_MODE_PIXEL / Always 0 for CONSOLE_MODE_CHARACTER) |
OffsetY | The Y offset of the new caret (Optional)(Pixels for CONSOLE_MODE_PIXEL / Always 0 for CONSOLE_MODE_CHARACTER) |
Return | Handle to new caret on success or INVALID_HANDLE_VALUE on failure |
function ConsoleDeviceDeleteCaret(Console:PConsoleDevice; Handle:THandle):LongWord;
Console | The console device to delete the caret on |
---|---|
Handle | The handle of the caret to delete (as returned from ConsoleDeviceAddCaret) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceUpdateCaret(Console:PConsoleDevice; Handle:THandle; X,Y:LongWord; Visible,Blink:Boolean):LongWord;
Console | The console device to update the caret on |
---|---|
Handle | The handle of the caret to update (as returned from ConsoleDeviceAddCaret) |
X | The X position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y | The Y position of the caret (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Visible | If true then show the caret else hide it |
Blink | If true then blink the caret at the default blink rate |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceSetCursor(Console:PConsoleDevice; Width,Height:LongWord; Chars:PChar):LongWord;
Console | The console device to set the cursor |
---|---|
Width | The width of the cursor in characters |
Height | The height of the cursor in characters |
Chars | A buffer containing the cursor characters |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For devices that don't support hardware mouse cursor a software cursor will be implemented
If chars is nil then the default cursor will be used |
function ConsoleDeviceUpdateCursor(Console:PConsoleDevice; Enabled:Boolean; X,Y:LongInt; Relative:Boolean):LongWord;
Console | The console device to update the cursor |
---|---|
Enabled | If true then show the cursor else hide it |
X | The cursor X location in characters |
Y | The cursor Y location in characters |
Relative | If true then X and Y are considered relative to the current position |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For devices that don't support hardware mouse cursor a software cursor will be implemented |
function ConsoleDeviceGetPosition(Console:PConsoleDevice; Position:LongWord; var X1,Y1,X2,Y2:LongWord):LongWord;
Console | The console device to get from |
---|---|
Position | The console position to get the coordinates for (eg CONSOLE_POSITION_FULL) |
X1 | The left edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y1 | The top edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
X2 | The right edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Y2 | The bottom edge of the console position (Pixels for CONSOLE_MODE_PIXEL / Characters for CONSOLE_MODE_CHARACTER) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceGetProperties(Console:PConsoleDevice; Properties:PConsoleProperties):LongWord;
Console | The console device to get properties from |
---|---|
Properties | Pointer to a TConsoleProperties structure to return |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceCheckFlag(Console:PConsoleDevice; Flag:LongWord):Boolean;
Console | The console device to check |
---|---|
Flag | The console flag to check (eg CONSOLE_FLAG_FULLSCREEN) |
Return | True if flag is supported, False if not or on error. |
function ConsoleDeviceUpdateFlag(Console:PConsoleDevice; Flag:LongWord; Clear:Boolean):LongWord;
Console | The console device to set or clear the flag on |
---|---|
Flag | The console flag to set or clear (eg CONSOLE_FLAG_LINE_WRAP) |
Clear | If true clear the flag, else set it. |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceGetMode(Console:PConsoleDevice):LongWord;
Console | The console device to get from |
---|---|
Return | The mode of the console (eg CONSOLE_MODE_PIXEL) or CONSOLE_MODE_NONE on error |
function ConsoleDeviceGetState(Console:PConsoleDevice):LongWord;
Console | The console device to get from |
---|---|
Return | The current state of the console (eg CONSOLE_STATE_OPEN) |
function ConsoleDeviceCreate:PConsoleDevice;
Return | Pointer to new Console entry or nil if Console could not be created |
---|
function ConsoleDeviceCreateEx(Size:LongWord):PConsoleDevice;
Size | Size in bytes to allocate for new Console (Including the Console entry) |
---|---|
Return | Pointer to new Console entry or nil if Console could not be created |
function ConsoleDeviceDestroy(Console:PConsoleDevice):LongWord;
Console | The console device to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceRegister(Console:PConsoleDevice):LongWord;
Console | The console device to register |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceDeregister(Console:PConsoleDevice):LongWord;
Console | The console device to deregister |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceFind(ConsoleId:LongWord):PConsoleDevice;
ConsoleId | The ID number of the console to find |
---|---|
Return | Pointer to console device entry or nil if not found |
function ConsoleDeviceFindByDevice(Device:PDevice):PConsoleDevice;
Device | Pointer to the related device to find |
---|---|
Return | Pointer to console device entry or nil if not found |
function ConsoleDeviceFindByName(const Name:String):PConsoleDevice; inline;
Name | The name of the console to find (eg Console0) |
---|---|
Return | Pointer to console device entry or nil if not found |
function ConsoleDeviceFindByDescription(const Description:String):PConsoleDevice; inline;
Description | The description of the console to find (eg Framebuffer Console (Framebuffer0)) |
---|---|
Return | Pointer to console device entry or nil if not found |
function ConsoleDeviceEnumerate(Callback:TConsoleEnumerate; Data:Pointer):LongWord;
Callback | The callback function to call for each console in the table |
---|---|
Data | A private data pointer to pass to callback for each console in the table |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleDeviceNotification(Console:PConsoleDevice; Callback:TConsoleNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Console | The console device to notify changes for (Optional, pass nil for all console devices) |
---|---|
Callback | The function to call when a notification event occurs |
Data | A private data pointer to pass to callback when a notification event occurs |
Notification | The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER) |
Flags | The flags to control the notification (eg NOTIFIER_FLAG_WORKER) |
Text console functions
function ConsoleWindowCreate(Console:PConsoleDevice; Position:LongWord; Default:Boolean):TWindowHandle;
Console | The console device to create the new window on |
---|---|
Position | The console position to create the new window at (eg CONSOLE_POSITION_FULL) |
Default | If true allow the new window to be the default window if there is no current default |
Return | Handle to new Console window or INVALID_HANDLE_VALUE if Console window could not be created |
function ConsoleWindowCreateEx(Console:PConsoleDevice; Font:TFontHandle; Size,State,Mode,Position:LongWord; Default:Boolean):TWindowHandle;
Console | The console device to create the new window on |
---|---|
Font | The handle of the default font for the new console window |
Size | The size in bytes to allocate for the new window entry (Defaults to SizeOf(TConsoleWindow)) |
State | Handle to new Console window or INVALID_HANDLE_VALUE if Console window could not be created |
Mode | The mode of the new console window (Normally WINDOW_MODE_TEXT) |
Position | The console position to create the new window at (eg CONSOLE_POSITION_FULL) |
Default | If true allow the new window to be the default window if there is no current default |
Return | Handle to new Console window or INVALID_HANDLE_VALUE if Console window could not be created |
function ConsoleWindowDestroy(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowShow(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to show |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowHide(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to hide |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowActivate(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to activate |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowDeactivate(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to deactivate |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | On success there will be no active window set |
function ConsoleWindowNext(Console:PConsoleDevice; Visible:Boolean):TWindowHandle;
Console | The console device to change the active window on |
---|---|
Visible | If true only return windows that are visible |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowPrevious(Console:PConsoleDevice; Visible:Boolean):TWindowHandle;
Console | The console device to change the active window on |
---|---|
Visible | If true only return windows that are visible |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowAt(Console:PConsoleDevice; X,Y:LongWord; Visible:Boolean):TWindowHandle;
Console | The console device to find the window on |
---|---|
X | The X coordinate to find the window for |
Y | The Y coordinate to find the window for |
Visible | If true only return windows that are visible |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character columns not screen pixels. |
function ConsoleWindowFind(Console:PConsoleDevice; Position:LongWord):TWindowHandle;
Console | The console device to find the window on |
---|---|
Position | The window position to find (eg CONSOLE_POSITION_FULL) |
Return | The handle of the existing window or INVALID_HANDLE_VALUE if not found |
function ConsoleWindowEnumerate(Console:PConsoleDevice; Callback:TConsoleWindowEnumerate; Data:Pointer):LongWord;
Console | The console device to enumerate windows for |
---|---|
Callback | The function to call for each window enumerated |
Data | A pointer to private data to be passed to the callback (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCheckFlag(Handle:TWindowHandle; Flag:LongWord):Boolean;
Handle | The handle of the window to check |
---|---|
Flag | The window flag to check for (eg WINDOW_FLAG_LINE_WRAP) |
Return | True if the flag is set, False if not set. |
function ConsoleWindowUpdateFlag(Handle:TWindowHandle; Flag:LongWord; Clear:Boolean):LongWord;
Handle | The handle of the window to set or clear the flag on |
---|---|
Flag | The window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP) |
Clear | If true clear the flag, else set it |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetMode(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the mode for |
---|---|
Return | The window mode (eg WINDOW_MODE_TEXT) |
function ConsoleWindowGetState(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the state for |
---|---|
Return | The window state (eg WINDOW_STATE_INVISIBLE) |
function ConsoleWindowGetPosition(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the position for |
---|---|
Return | The window position (eg CONSOLE_POSITION_FULL) |
function ConsoleWindowSetPosition(Handle:TWindowHandle; Position:LongWord):LongWord;
Handle | The handle of the window to set the position for |
---|---|
Position | The new window position to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The function will return ERROR_INVALID_PARAMETER if another window exists at the position |
function ConsoleWindowGetProperties(Handle:TWindowHandle; Properties:PWindowProperties):LongWord;
Handle | The handle of the window to get the properties from |
---|---|
Properties | Pointer to a TWindowProperties structure to fill in |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetMinX(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get MinX for |
---|---|
Return | The minimum X value for the current window viewport |
Note | For Text Console functions, X is based on character columns not screen pixels. |
function ConsoleWindowGetMinY(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get MinY for |
---|---|
Return | The minimum Y value for the current window viewport |
Note | For Text Console functions, Y is based on character rows not screen pixels. |
function ConsoleWindowGetMaxX(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get MaxX for |
---|---|
Return | The maximum X value for the current window viewport |
Note | For Text Console functions, X is based on character columns not screen pixels. |
function ConsoleWindowGetMaxY(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get MaxY for |
---|---|
Return | The maximum Y value for the current window viewport |
Note | For Text Console functions, Y is based on character rows not screen pixels. |
function ConsoleWindowGetRect(Handle:TWindowHandle):TConsoleRect; inline;
Handle | The handle of the window to get the rectangle for |
---|---|
Return | The rectangle of the current window viewport |
Note | For Text Console functions, Rect is based on character rows and columns not screen pixels. |
function ConsoleWindowSetRect(Handle:TWindowHandle; const ARect:TConsoleRect):LongWord; inline;
Handle | The handle of the window to set the rectangle for |
---|---|
Rect | The rectangle to set for the window viewport |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Rect is based on character rows and columns not screen pixels. |
function ConsoleWindowResetRect(Handle:TWindowHandle):LongWord; inline;
Handle | The handle of the window to reset the viewport for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetViewport(Handle:TWindowHandle; var X1,Y1,X2,Y2:LongWord):LongWord;
Handle | The handle of the window to get the viewport for |
---|---|
X1 | The left edge of the current viewport |
Y1 | The top edge of the current viewport |
X2 | The right edge of the current viewport |
Y2 | The bottom edge of the current viewport |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Viewport is based on character rows and columns not screen pixels. |
function ConsoleWindowSetViewport(Handle:TWindowHandle; X1,Y1,X2,Y2:LongWord):LongWord;
Handle | The handle of the window to get the viewport for |
---|---|
X1 | The left edge of the window viewport |
Y1 | The top edge of the window viewport |
X2 | The right edge of the window viewport |
Y2 | The bottom edge of the window viewport |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Viewport is based on character rows and columns not screen pixels. |
function ConsoleWindowResetViewport(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to reset the viewport for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetX(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get X for |
---|---|
Return | The X value for the window |
Note | For Text Console functions, X is based on character columns not screen pixels. |
function ConsoleWindowSetX(Handle:TWindowHandle; X:LongWord):LongWord;
Handle | The handle of the window to set X for |
---|---|
X | The new X value to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X is based on character columns not screen pixels. |
function ConsoleWindowGetY(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get Y for |
---|---|
Return | The Y value for the window |
Note | For Text Console functions, Y is based on character rows not screen pixels. |
function ConsoleWindowSetY(Handle:TWindowHandle; Y:LongWord):LongWord;
Handle | The handle of the window to set Y for |
---|---|
Y | The new Y value to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Y is based on character rows not screen pixels. |
function ConsoleWindowGetXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord;
Handle | The handle of the window to get X and Y for |
---|---|
X | The returned X value |
Y | The returned Y value |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowSetXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Handle | The handle of the window to set X and Y for |
---|---|
X | The new X value |
Y | The new Y value |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowGetPoint(Handle:TWindowHandle):TConsolePoint;
Handle | The handle of the window to get the point for |
---|---|
Return | The current point of the window |
Note | For Text Console functions, Point is based on character rows and columns not screen pixels. |
function ConsoleWindowSetPoint(Handle:TWindowHandle; const APoint:TConsolePoint):LongWord;
Handle | The handle of the window to set the point for |
---|---|
Point | The new point to set for the window |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Point is based on character rows and columns not screen pixels. |
function ConsoleWindowGetCols(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get columns for |
---|---|
Return | The columns value for the current window viewport |
Note | For Text Console functions, Columns is based on character columns not screen pixels. |
function ConsoleWindowGetRows(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get rows for |
---|---|
Return | The rows value for the current window viewport |
Note | For Text Console functions, Rows is based on character rows not screen pixels. |
function ConsoleWindowGetWidth(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the width for |
---|---|
Return | The absolute width of the window |
Note | For Text Console functions, Width is based on character columns not screen pixels. |
function ConsoleWindowGetHeight(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the height for |
---|---|
Return | The absolute height of the window |
Note | For Text Console functions, Height is based on character rows not screen pixels. |
function ConsoleWindowGetFormat(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the format for |
---|---|
Return | The color format of the window (eg COLOR_FORMAT_ARGB32) |
function ConsoleWindowGetForecolor(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the foreground color for |
---|---|
Return | The foreground color of the window (eg COLOR_WHITE) |
function ConsoleWindowSetForecolor(Handle:TWindowHandle; Color:LongWord):LongWord;
Handle | The handle of the window to set the foreground color for |
---|---|
Color | The foreground color to set (eg COLOR_WHITE) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetBackcolor(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to get the background color for |
---|---|
Return | The background color of the window (eg COLOR_BLACK) |
function ConsoleWindowSetBackcolor(Handle:TWindowHandle; Color:LongWord):LongWord;
Handle | The handle of the window to set the background color for |
---|---|
Color | The background color to set (eg COLOR_BLACK) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetFont(Handle:TWindowHandle):TFontHandle;
Handle | The handle of the window to get the default font for |
---|---|
Return | The font handle of the default font or INVALID_HANDLE_VALUE on error |
function ConsoleWindowSetFont(Handle:TWindowHandle; Font:TFontHandle):LongWord;
Handle | The handle of the window to set the default font for |
---|---|
Font | The font handle of the default font to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console windows, setting the font also clears the window. |
function ConsoleWindowGetCursorXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord;
Handle | The handle of the window to get cursor X and Y for |
---|---|
X | The returned cursor X value |
Y | The returned cursor Y value |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, cursor X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowSetCursorXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Handle | The handle of the window to set cursor X and Y for |
---|---|
X | The new cursor X value |
Y | The new cursor Y value |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, cursor X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowGetCursorMode(Handle:TWindowHandle):TCursorMode;
Handle | The handle of the window to get the mode for |
---|---|
Return | The current cursor mode (eg CURSOR_MODE_INSERT) |
function ConsoleWindowSetCursorMode(Handle:TWindowHandle;CursorMode:TCursorMode):LongWord;
Handle | The handle of the window to set the mode for |
---|---|
CursorMode | The cursor mode to set (eg CURSOR_MODE_INSERT) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetCursorBlink(Handle:TWindowHandle):Boolean;
Handle | The handle of the window to get blink state for |
---|---|
Return | True if blink is enabled, False if not or on error. |
function ConsoleWindowSetCursorBlink(Handle:TWindowHandle; CursorBlink:Boolean):LongWord;
Handle | The handle of the window to set the blink state for |
---|---|
CursorBlink | True to enable blink, False to disable. |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetCursorState(Handle:TWindowHandle):TCursorState;
Handle | The handle of the window to get the state for |
---|---|
Return | The current cursor state (eg CURSOR_STATE_ON) |
function ConsoleWindowSetCursorState(Handle:TWindowHandle; CursorState:TCursorState):LongWord;
Handle | The handle of the window to set the state for |
---|---|
CursorState | The cursor state to set (eg CURSOR_STATE_ON) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowGetCursorShape(Handle:TWindowHandle):TCursorShape;
Handle | The handle of the window to get the shape for |
---|---|
Return | The current cursor shape (eg CURSOR_SHAPE_LINE) |
function ConsoleWindowSetCursorShape(Handle:TWindowHandle; CursorShape:TCursorShape):LongWord;
Handle | The handle of the window to set the shape for |
---|---|
CursorShape | The cursor shape to set (eg CURSOR_SHAPE_LINE) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorOn(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to enable the cursor for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorOff(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to disable the cursor for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorLine(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to change the cursor for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorBar(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to change the cursor for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorBlock(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to change the cursor for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCursorMove(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Handle | The handle of the window to move the cursor for |
---|---|
X | The column to move the cursor to |
Y | The row to move the cursor to |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowCursorBlink(Handle:TWindowHandle; Enabled:Boolean):LongWord;
Handle | The handle of the window to set the blink state for |
---|---|
Enabled | True if the cursor is blinking, False if not |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowAddHistory(Handle:TWindowHandle; const Value:String):LongWord;
Handle | The handle of the window to add to |
---|---|
Value | The text to add to the command history |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Window is based on screen character rows and columns not screen pixels
When the number of entries in the table reaches the maximum the first entry will be removed |
function ConsoleWindowClearHistory(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to clear |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowFirstHistory(Handle:TWindowHandle):String;
Handle | The handle of the window to get from |
---|---|
Return | The command history value or an empty string on failure |
function ConsoleWindowLastHistory(Handle:TWindowHandle):String;
Handle | The handle of the window to get from |
---|---|
Return | The command history value or an empty string on failure |
function ConsoleWindowNextHistory(Handle:TWindowHandle):String;
Handle | The handle of the window to get from |
---|---|
Return | The command history value or an empty string on failure |
function ConsoleWindowPreviousHistory(Handle:TWindowHandle):String;
Handle | The handle of the window to get from |
---|---|
Return | The command history value or an empty string on failure |
Note | If there is no current history value the last value is returned |
function ConsoleWindowCurrentHistory(Handle:TWindowHandle):String;
Handle | The handle of the window to get from |
---|---|
Return | The command history value or an empty string on failure |
Note | If there is no current history value the last value is returned |
function ConsoleWindowScrollUp(Handle:TWindowHandle; Row,Lines:LongWord):LongWord;
Handle | The handle of the window to scroll |
---|---|
Row | The starting row (Y) for the scroll up, all rows from top plus Lines down to Row will be scrolled up. |
Lines | The number of character lines to scroll up, Lines number of rows at the top will be discarded. |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Row is the starting row (Y) for the scroll up, all rows from top plus Lines down to Row will be scrolled up. Lines is the number of character lines to scroll up, Lines number of rows at the top will be discarded. The starting Row will be blanked with the background color. |
function ConsoleWindowScrollDown(Handle:TWindowHandle; Row,Lines:LongWord):LongWord;
Handle | The handle of the window to scroll |
---|---|
Row | The starting row (Y) for the scroll down, all rows from bottom minus Lines up to Row will be scrolled down. |
Lines | The number of character lines to scroll down, Lines number of rows at the bottom will be discarded. |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Row is the starting row (Y) for the scroll down, all rows from bottom minus Lines up to Row will be scrolled down. Lines is the number of character lines to scroll down, Lines number of rows at the bottom will be discarded. The starting Row will be blanked with the background color. |
function ConsoleWindowScrollLeft(Handle:TWindowHandle; Row,Col,Lines,Chars:LongWord):LongWord;
Handle | The handle of the window to scroll |
---|---|
Row | The starting row (Y) for the scroll left, all rows from Row down to Row + Lines will be scrolled left. |
Lines | The number of rows to scroll left, all rows from Row down to Row + Lines will be scrolled left. |
Col | The starting column (X) for the scroll left, all cols from left plus Chars to Col with be scrolled left. |
Char | The number of characters to scroll left, Chars number of columns at the left will be discarded. |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The starting Col will be blanked with the background color |
function ConsoleWindowScrollRight(Handle:TWindowHandle; Row,Col,Lines,Chars:LongWord):LongWord;
Handle | The handle of the window to scroll |
---|---|
Row | The starting row (Y) for the scroll right, all rows from Row down to Row + Lines will be scrolled right. |
Lines | The number of rows to scroll right, all rows from Row down to Row + Lines will be scrolled right. |
Col | The starting column (X) for the scroll right, all rows from right minus Chars to Col will be scrolled right. |
Char | The number of characters to scroll right, Chars number of columns at the right will be discarded. |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The starting Col will be blanked with the background color |
function ConsoleWindowClear(Handle:TWindowHandle):LongWord;
Handle | The handle of the window to clear |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowClearEx(Handle:TWindowHandle; X1,Y1,X2,Y2:LongWord; Cursor:Boolean):LongWord;
Handle | The handle of the window to clear |
---|---|
X1 | The left edge of the area to clear (relative to current viewport) |
Y1 | The top edge of the area to clear (relative to current viewport) |
X2 | The right edge of the area to clear (relative to current viewport) |
Y2 | The bottom edge of the area to clear (relative to current viewport) |
Cursor | If True update the cursor position after clearing |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Window is based on screen character rows and columns not screen pixels. |
function ConsoleWindowWrite(Handle:TWindowHandle; const AText:String):LongWord;
Handle | The handle of the window to write text on |
---|---|
Text | The text to write |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The window will not scroll up at the end of the line |
function ConsoleWindowWriteEx(Handle:TWindowHandle; const AText:String; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Handle | The handle of the window to write text on |
---|---|
Text | The text to write |
X | The column to start writing the text at |
Y | The row to start writing the text at |
Forecolor | The foreround color to use (eg COLOR_WHITE) |
Backcolor | The foreround color to use (eg COLOR_BLACK) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on screen character rows and columns not screen pixels.
The window will not scroll up at the end of the line |
function ConsoleWindowWriteLn(Handle:TWindowHandle; const AText:String):LongWord;
Handle | The handle of the window to write text on |
---|---|
Text | The text to write |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The window will scroll up at the end of the line |
function ConsoleWindowWriteLnEx(Handle:TWindowHandle; const AText:String; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Handle | The handle of the window to write text on |
---|---|
Text | The text to write |
X | The column to start writing the text at |
Y | The row to start writing the text at |
Forecolor | The foreround color to use (eg COLOR_WHITE) |
Backcolor | The foreround color to use (eg COLOR_BLACK) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character rows and columns not screen pixels.
The window will scroll up at the end of the line |
function ConsoleWindowWriteChr(Handle:TWindowHandle; AChr:Char):LongWord;
Handle | The handle of the window to write the character on |
---|---|
Chr | The character to write |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowWriteChrEx(Handle:TWindowHandle; AChr:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Handle | The handle of the window to write the character on |
---|---|
Chr | The character to write |
X | The column to start writing the character at |
Y | The row to start writing the character at |
Forecolor | The foreround color to use (eg COLOR_WHITE) |
Backcolor | The foreround color to use (eg COLOR_BLACK) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, X and Y are based on character rows and columns not screen pixels. |
function ConsoleWindowOutput(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Buffer:PConsoleChar; Width,Height,Skip:LongWord):LongWord;
Handle | The console window to output to |
---|---|
Source | The X and Y point in the source buffer to copy text from (Characters) |
Dest | The X and Y point on the console window to copy text to (Characters) |
Buffer | A pointer to a buffer of TConsoleChar structures which represent rows of text |
Width | The width of the area to be output (Characters) |
Height | The height of the area to be output (Characters) |
Skip | The number of characters to skip in the buffer after each row (Optional) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | For Text Console functions, Source, Dest, Width, Height and Skip are based on character rows and columns not screen pixels. |
function ConsoleWindowRead(Handle:TWindowHandle; var AText:String):LongWord;
Handle | The handle of the window to echo input to |
---|---|
Text | The text read from the console on return |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The console window will not scroll up on return |
function ConsoleWindowReadLn(Handle:TWindowHandle; var AText:String):LongWord;
Handle | The handle of the window to echo input to |
---|---|
Text | The text read from the console on return |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The console window will scroll up one line on return |
function ConsoleWindowReadLnEx(Handle:TWindowHandle; var AText:String; const Prompt:String; X,Y,Forecolor,Backcolor:LongWord; Scroll,History:Boolean; Completion:TConsoleWindowCompletion; Data:Pointer):LongWord;
Handle | The handle of the window to echo input to |
---|---|
Text | The text read from the console on return |
Prompt | An optional text prompt to display at the start of the line |
X | The starting X position for the output (0 for current position) |
Y | The starting Y position for the output (0 for current position) |
Forecolor | The text forecolor for the output (COLOR_NONE for current color) |
Backcolor | The text backcolor for the output (COLOR_NONE for current color) |
Scroll | If true then scroll up one line on return |
History | If true then support console history buffer using Up, Down and F3 keys |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Supports common line editing behaviour including Home, End, Left, Right, Up, Down, Insert, Backspace and Delete. |
function ConsoleWindowReadChr(Handle:TWindowHandle; var AChr:Char):LongWord;
Handle | The handle of the window to echo input to |
---|---|
Chr | The character read from the console on return |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The console window will not scroll up on return |
function ConsoleWindowReadChrEx(Handle:TWindowHandle; var AChr:Char; const Prompt:String; X,Y,Forecolor,Backcolor:LongWord; Echo,Scroll:Boolean):LongWord;
Handle | The handle of the window to echo input to |
---|---|
Chr | The character read from the console on return |
Prompt | An optional text prompt to display at the start of the line |
X | The starting X position for the output (0 for current position) |
Y | The starting Y position for the output (0 for current position) |
Forecolor | The text forecolor for the output (COLOR_NONE for current color) |
Backcolor | The text backcolor for the output (COLOR_NONE for current color) |
Echo | If true then echo the character to the console window |
Scroll | If true then scroll up one line on return |
Return | ERROR_SUCCESS if completed or another error code on failure |
CRT console functions
procedure ConsoleAssignCrt(var F:Text);
procedure ConsoleClrEol;
procedure ConsoleClrScr;
procedure ConsoleDelay(MS:Word);
procedure ConsoleDelLine;
procedure ConsoleGotoXY(X,Y:Integer);
See | http://www.freepascal.org/docs-html-3.0.0/rtl/crt/gotoxy.html |
---|---|
Note | For CRT Console functions, X and Y are based on character rows and columns not screen pixels. |
procedure ConsoleHighVideo;
procedure ConsoleInsLine;
function ConsoleKeypressed:Boolean;
procedure ConsoleLowVideo;
procedure ConsoleNormVideo;
procedure ConsoleNoSound;
function ConsoleReadKey:Char;
See | http://www.freepascal.org/docs-html-3.0.0/rtl/crt/readkey.html
For extended key scan codes see: http://www.freepascal.org/docs-html/rtl/keyboard/kbdscancode.html |
---|
procedure ConsoleSound(Hz:Word);
procedure ConsoleTextBackground(Color:LongWord);
procedure ConsoleTextColor(Color:LongWord);
procedure ConsoleTextMode(Mode:Integer);
function ConsoleWhereX:Integer;
See | http://www.freepascal.org/docs-html-3.0.0/rtl/crt/wherex.html |
---|---|
Note | For CRT Console functions, X is based on character columns not screen pixels. |
function ConsoleWhereY:Integer;
See | http://www.freepascal.org/docs-html-3.0.0/rtl/crt/wherey.html |
---|---|
Note | For CRT Console functions, Y is based on character row not screen pixel. |
procedure ConsoleWindow(X1,Y1,X2,Y2:Integer);
See | http://www.freepascal.org/docs-html-3.0.0/rtl/crt/window.html |
---|---|
Note | For CRT Console functions, X1, Y1, X2 and Y2 are based on character rows and columns not screen pixels. |
procedure ConsoleScrollUp(Row,Lines:Integer);
Row | The starting row (Y) for the scroll up, all rows from top plus Lines down to Row will be scrolled up. |
---|---|
Lines | The number of character lines to scroll up, Lines number of rows at the top will be discarded. |
Note | For CRT Console functions, Row and Lines are based on character rows and columns not screen pixels. |
procedure ConsoleScrollDown(Row,Lines:Integer);
Row | The starting row (Y) for the scroll down, all rows from bottom minus Lines up to Row will be scrolled down. |
---|---|
Lines | The number of character lines to scroll down, Lines number of rows at the bottom will be discarded. |
Note | For CRT Console functions, Row and Lines are based on character rows and columns not screen pixels. |
procedure ConsoleWrite(const AText:String);
Text | The text to write |
---|---|
Note | The window will not scroll up at the end of the line |
procedure ConsoleWriteLn(const AText:String);
Text | The text to write |
---|---|
Note | The window will scroll up at the end of the line |
procedure ConsoleWriteChr(AChr:Char);
Chr | The character to write |
---|
procedure ConsoleRead(var AText:String);
Text | The text read from the console input |
---|
procedure ConsoleReadLn(var AText:String);
Text | The text read from the console input |
---|
procedure ConsoleReadChr(var AChr:Char);
Chr | The character read from the console input |
---|
RTL text IO functions
function SysTextIOWriteChar(ACh:Char; AUserData:Pointer):Boolean;
Note | Not intended to be called directly by applications |
---|
RTL console functions
function SysConsoleWriteChar(ACh:Char; AUserData:Pointer):Boolean;
Note | Not intended to be called directly by applications |
---|
Framebuffer console functions
function FramebufferConsoleOpen(Console:PConsoleDevice):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceOpen instead |
---|
function FramebufferConsoleClose(Console:PConsoleDevice):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceClose instead |
---|
function FramebufferConsoleClear(Console:PConsoleDevice; Color:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceClear instead |
---|
function FramebufferConsoleScroll(Console:PConsoleDevice; X1,Y1,X2,Y2,Count,Direction:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceScroll instead |
---|
function FramebufferConsoleDrawBox(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawBox instead |
---|
function FramebufferConsoleDrawLine(Console:PConsoleDevice; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawLine instead |
---|
function FramebufferConsoleDrawChar(Console:PConsoleDevice; Handle:TFontHandle;Ch:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawChar instead |
---|
function FramebufferConsoleDrawText(Console:PConsoleDevice; Handle:TFontHandle; const Text:String; X,Y,Forecolor,Backcolor,Len:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawText instead |
---|
function FramebufferConsoleDrawPixel(Console:PConsoleDevice; X,Y,Color:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawPixel instead |
---|
function FramebufferConsoleDrawBlock(Console:PConsoleDevice; X1,Y1,X2,Y2,Color:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawBlock instead |
---|
function FramebufferConsoleDrawImage(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawImage instead |
---|
function FramebufferConsoleDrawWindow(Console:PConsoleDevice; Handle:TWindowHandle; Flags:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDrawWindow instead
Caller must hold the Window lock |
---|
function FramebufferConsoleDrawDesktop(Console:PConsoleDevice):LongWord;
Note | Not intended to be called directly by applications |
---|
function FramebufferConsoleGetPixel(Console:PConsoleDevice; X,Y:LongWord; var Color:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceGetPixel instead |
---|
function FramebufferConsoleGetImage(Console:PConsoleDevice; X,Y:LongWord; Buffer:Pointer; Width,Height,Format,Skip:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceGetImage instead |
---|
function FramebufferConsolePutText(Console:PConsoleDevice; Handle:TFontHandle; const Source,Dest:TConsolePoint; Buffer:PConsoleChar; Width,Height,Skip:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDevicePutText instead |
---|
function FramebufferConsoleCopyImage(Console:PConsoleDevice; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceCopyImage instead |
---|
procedure FramebufferConsoleCaretTimer(Caret:PConsoleCaret);
Note | Not intended to be called directly by applications |
---|
procedure FramebufferConsoleShowCaret(Console:PConsoleDevice; Caret:PConsoleCaret);
Note | Not intended to be called directly by applications
Caller must hold the console lock |
---|
procedure FramebufferConsoleHideCaret(Console:PConsoleDevice; Caret:PConsoleCaret);
Note | Not intended to be called directly by applications
Caller must hold the console lock |
---|
function FramebufferConsoleAddCaret(Console:PConsoleDevice; Width,Height,OffsetX,OffsetY:LongWord):THandle;
Note | Not intended to be called directly by applications, use ConsoleDeviceAddCaret instead |
---|
function FramebufferConsoleDeleteCaret(Console:PConsoleDevice; Handle:THandle):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceDeleteCaret instead |
---|
function FramebufferConsoleUpdateCaret(Console:PConsoleDevice; Handle:THandle; X,Y:LongWord; Visible,Blink:Boolean):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceUpdateCaret instead |
---|
function FramebufferConsoleGetPosition(Console:PConsoleDevice; Position:LongWord; var X1,Y1,X2,Y2:LongWord):LongWord;
Note | Not intended to be called directly by applications, use ConsoleDeviceGetPosition instead |
---|
Console helper functions
function ConsoleDeviceGetCount:LongWord; inline;
Note | None documented |
---|
function ConsoleDeviceGetDefault:PConsoleDevice; inline;
Note | None documented |
---|
function ConsoleDeviceSetDefault(Console:PConsoleDevice):LongWord;
Note | None documented |
---|
function ConsoleDeviceCheck(Console:PConsoleDevice):PConsoleDevice;
Note | None documented |
---|
function ConsoleDeviceCaretCheck(Console:PConsoleDevice; Caret:PConsoleCaret):PConsoleCaret;
Console | The console device to search for the caret |
---|---|
Caret | The caret entry to check for validity |
Return | The supplied caret if successful or nil on failure |
function ConsoleTypeToString(ConsoleType:LongWord):String;
Note | None documented |
---|
function ConsoleStateToString(ConsoleState:LongWord):String;
Note | None documented |
---|
function ConsoleDeviceGetDefaultFont:TFontHandle;
Note | None documented |
---|
function ConsolePositiontoString(Position:LongWord):String;
Note | None documented |
---|
function ConsoleFramebufferDeviceAdd(Framebuffer:PFramebufferDevice):LongWord;
Note | None documented |
---|
function ConsoleFramebufferDeviceRemove(Framebuffer:PFramebufferDevice):LongWord;
Note | None documented |
---|
function ConsoleFramebufferDeviceEnum(Framebuffer:PFramebufferDevice; Data:Pointer):LongWord;
Note | None documented |
---|
function ConsoleFramebufferDeviceNotify(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
Note | None documented |
---|
Text console helper functions
function ConsoleWindowGetCount(Console:PConsoleDevice):LongWord; inline;
Console | The console device to get the window count for |
---|---|
Return | The current number of console windows on the specified console device |
function ConsoleWindowGetActive(Console:PConsoleDevice):TWindowHandle; inline;
Console | The console device to get the active window for |
---|---|
Return | The window handle of the current active window or INVALID_HANDLE_VALUE on failure |
function ConsoleWindowGetDefault(Console:PConsoleDevice):TWindowHandle; inline;
Console | The console device to get the default window for |
---|---|
Return | The window handle of the current default window or INVALID_HANDLE_VALUE on failure |
function ConsoleWindowSetDefault(Console:PConsoleDevice; Handle:TWindowHandle):LongWord;
Console | The console device to set the default window for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConsoleWindowCheck(Console:PConsoleDevice; Window:PConsoleWindow):PConsoleWindow;
Console | The console device to search for the window |
---|---|
Window | The window entry to check for validity |
Return | The supplied window if successful or nil on failure |
function ConsoleWindowStateToString(WindowState:LongWord):String;
Note | None documented |
---|
function ConsoleWindowModeToString(WindowMode:LongWord):String;
Note | None documented |
---|
function ConsoleWindowGetDefaultFont:TFontHandle;
Note | None documented |
---|
function ConsoleWindowRedirectOutput(Handle:TWindowHandle):Boolean;
Handle | The window handle to redirect output to (or INVALID_HANDLE_VALUE to stop redirection) |
---|---|
Return | True if completed successfully or False if an error occurred |
Note | Redirects the output of the text files Output, ErrOutput, StdOut and StdErr which also redirects the output of Write, WriteLn and the standard C library. |
Return to Unit Reference