Difference between revisions of "Unit ConsoleShell"
From Ultibo.org
Line 86: | Line 86: | ||
|- | |- | ||
| <code>FDefaultSession:TShellSession;</code> | | <code>FDefaultSession:TShellSession;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure Reset(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure MoveFirst(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure MoveLast(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure MoveLeft(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure MoveRight(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure EraseLine(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure OutputLine(ASession:TConsoleSession; const AValue:String);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExpandLine(ASession:TConsoleSession):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure EraseCharacter(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure DeleteCharacter(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure InsertCharacter(ASession:TConsoleSession; ACh:Char);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure OverwriteCharacter(ASession:TConsoleSession; ACh:Char);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure PrevHistory(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure NextHistory(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure FirstHistory(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure LastHistory(ASession:TConsoleSession);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure CurrentHistory(ASession:TConsoleSession);</code> | ||
| | | | ||
|- | |- | ||
Line 149: | Line 210: | ||
|- | |- | ||
| <code>function DoSetCoordinates(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code> | | <code>function DoSetCoordinates(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function DoGetCursorMode(ASession:TShellSession; var AMode:LongWord):Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function DoSetCursorMode(ASession:TShellSession; AMode:LongWord):Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function DoGetCursorShape(ASession:TShellSession; var AShape:LongWord):Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function DoSetCursorShape(ASession:TShellSession; AShape:LongWord):Boolean; override;</code> | ||
| | | | ||
|- | |- | ||
Line 180: | Line 257: | ||
| | | | ||
|- | |- | ||
− | | <code> | + | | <code>MaxX:LongWord;</code> |
+ | | | ||
+ | |- | ||
+ | | <code>MaxY:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LastX:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LastY:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FirstX:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FirstY:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CurrentX:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CurrentY:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Mode:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Shape:LongWord;</code> | ||
| | | | ||
|- | |- |
Revision as of 02:54, 28 March 2018
Return to Unit Reference
Contents
Description
Ultibo Console Shell unit
To be documented
Constants
Console shell specific constants
CONSOLE_SHELL_*
CONSOLE_SHELL_DEFAULT_WELCOME = ' (Type HELP for a list of available commands)';
|
|
CONSOLE_SHELL_THREAD_NAME = 'Console Shell Keyboard';
|
Thread name for Console shell keyboard threads |
Console shell constants
CONSOLE_SHELL_NAME*
CONSOLE_SHELL_NAME = 'Console Shell';
|
Console shell command constants
CONSOLE_SHELL_COMMAND_*
CONSOLE_SHELL_COMMAND_EXIT = 'EXIT';
|
Type definitions
None defined
Class definitions
Console shell
TConsoleShell = class(TShell)
public
| |
constructor Create(AConsole:PConsoleDevice);
|
|
destructor Destroy; override;
|
|
private
| |
FConsole:PConsoleDevice;
|
|
FThread:TConsoleShellThread;
|
|
FDefaultSession:TShellSession;
|
|
procedure Reset(ASession:TConsoleSession);
|
|
procedure MoveFirst(ASession:TConsoleSession);
|
|
procedure MoveLast(ASession:TConsoleSession);
|
|
procedure MoveLeft(ASession:TConsoleSession);
|
|
procedure MoveRight(ASession:TConsoleSession);
|
|
procedure EraseLine(ASession:TConsoleSession);
|
|
procedure OutputLine(ASession:TConsoleSession; const AValue:String);
|
|
function ExpandLine(ASession:TConsoleSession):Boolean;
|
|
procedure EraseCharacter(ASession:TConsoleSession);
|
|
procedure DeleteCharacter(ASession:TConsoleSession);
|
|
procedure InsertCharacter(ASession:TConsoleSession; ACh:Char);
|
|
procedure OverwriteCharacter(ASession:TConsoleSession; ACh:Char);
|
|
procedure PrevHistory(ASession:TConsoleSession);
|
|
procedure NextHistory(ASession:TConsoleSession);
|
|
procedure FirstHistory(ASession:TConsoleSession);
|
|
procedure LastHistory(ASession:TConsoleSession);
|
|
procedure CurrentHistory(ASession:TConsoleSession);
|
|
protected
| |
function CreateWindow:TShellSession;
|
|
function DestroyWindow(ASession:TShellSession):Boolean;
|
|
public
| |
property Console:PConsoleDevice read FConsole;
|
|
property DefaultSession:TShellSession read FDefaultSession;
|
|
function DoClear(ASession:TShellSession):Boolean; override;
|
|
function DoInput(ASession:TShellSession; var AInput:String):Boolean; override;
|
|
function DoOutputEx(ASession:TShellSession; const AOutput:String; AReturn:Boolean):Boolean; override;
|
|
function DoGetSize(ASession:TShellSession; var ARows,ACols:LongWord):Boolean; override;
|
|
function DoSetSize(ASession:TShellSession; ARows,ACols:LongWord):Boolean; override;
|
|
function DoGetCursor(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;
|
|
function DoSetCursor(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;
|
|
function DoGetColors(ASession:TShellSession; var AForecolor,ABackcolor:LongWord):Boolean; override;
|
|
function DoSetColors(ASession:TShellSession; AForecolor,ABackcolor:LongWord):Boolean; override;
|
|
function DoGetCoordinates(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;
|
|
function DoSetCoordinates(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;
|
|
function DoGetCursorMode(ASession:TShellSession; var AMode:LongWord):Boolean; override;
|
|
function DoSetCursorMode(ASession:TShellSession; AMode:LongWord):Boolean; override;
|
|
function DoGetCursorShape(ASession:TShellSession; var AShape:LongWord):Boolean; override;
|
|
function DoSetCursorShape(ASession:TShellSession; AShape:LongWord):Boolean; override;
|
|
function ConsoleChar(ASession:TShellSession; AChar:Char):Boolean;
|
|
function ConsoleExtended(ASession:TShellSession; AChar:Char):Boolean;
|
Console session
TConsoleSession = class(TShellSession)
public
| |
constructor Create(AShell:TShell; AIdentifier:LongWord);
|
|
public
| |
Command:String;
|
|
MaxX:LongWord;
|
|
MaxY:LongWord;
|
|
LastX:LongWord;
|
|
LastY:LongWord;
|
|
FirstX:LongWord;
|
|
FirstY:LongWord;
|
|
CurrentX:LongWord;
|
|
CurrentY:LongWord;
|
|
Mode:LongWord;
|
|
Shape:LongWord;
|
|
Window:TWindowHandle;
|
Console shell thread
TConsoleShellThread = class(TThread)
public
| |
constructor Create(AShell:TConsoleShell);
|
|
protected
| |
FShell:TConsoleShell;
|
|
procedure Execute; override;
|
Console shell exit
TConsoleShellExit = class(TShellCommand)
public
| |
constructor Create;
|
|
public
| |
function DoHelp(AShell:TShell; ASession:TShellSession):Boolean; override;
|
|
function DoInfo(AShell:TShell; ASession:TShellSession):Boolean; override;
|
|
function DoCommand(AShell:TShell; ASession:TShellSession; AParameters:TStrings):Boolean; override;
|
Public variables
None defined
Function declarations
Initialization functions
procedure ConsoleShellInit;
Description: To be documented
Note | None documented |
---|
Console shell functions
function ConsoleShellFindByDevice(Console:PConsoleDevice):TConsoleShell;
Description: To be documented
Note | None documented |
---|
Console shell helper functions
function ConsoleShellDeviceAdd(Console:PConsoleDevice; Force:Boolean):LongWord;
Description: To be documented
Note | None documented |
---|
function ConsoleShellDeviceRemove(Console:PConsoleDevice):LongWord;
Description: To be documented
Note | None documented |
---|
function ConsoleShellDeviceEnum(Console:PConsoleDevice; Data:Pointer):LongWord;
Description: To be documented
Note | None documented |
---|
function ConsoleShellDeviceNotify(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
Return to Unit Reference