Difference between revisions of "Unit ConsoleShell"
From Ultibo.org
								
												
				| Line 60: | Line 60: | ||
----  | ----  | ||
| − | ''  | + | |
| + | '''Console shell'''  | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">  | ||
| + | |||
| + | <code>TConsoleShell = class(TShell)</code>  | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">  | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;"  | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>constructor Create(AConsole:PConsoleDevice);</code>  | ||
| + | | style="width: 50%;"|   | ||
| + | |-  | ||
| + | | <code>destructor Destroy; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>  | ||
| + | |-  | ||
| + | | <code>FConsole:PConsoleDevice;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>FThread:TConsoleShellThread;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>FDefaultSession:TShellSession;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>  | ||
| + | |-  | ||
| + | | <code>function CreateWindow:TShellSession;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DestroyWindow(ASession:TShellSession):Boolean;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>property Console:PConsoleDevice read FConsole;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>property DefaultSession:TShellSession read FDefaultSession;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoClear(ASession:TShellSession):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoInput(ASession:TShellSession; var AInput:String):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoOutputEx(ASession:TShellSession; const AOutput:String; AReturn:Boolean):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoGetSize(ASession:TShellSession; var ARows,ACols:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoSetSize(ASession:TShellSession; ARows,ACols:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoGetCursor(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoSetCursor(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoGetColors(ASession:TShellSession; var AForecolor,ABackcolor:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoSetColors(ASession:TShellSession; AForecolor,ABackcolor:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function DoGetCoordinates(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoSetCoordinates(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>function ConsoleChar(ASession:TShellSession; AChar:Char):Boolean;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |}  | ||
| + | </div></div>   | ||
| + | |||
| + | '''Console session'''  | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">  | ||
| + | |||
| + | <code>TConsoleSession = class(TShellSession)</code>  | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">  | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;"  | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>constructor Create(AShell:TShell; AIdentifier:LongWord);</code>  | ||
| + | | style="width: 50%;"|   | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>Command:String;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>Position:LongWord;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>Window:TWindowHandle;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |}  | ||
| + | </div></div>  | ||
| + | |||
| + | '''Console shell thread'''  | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">  | ||
| + | |||
| + | <code>TConsoleShellThread = class(TThread)</code>  | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">  | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;"  | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>constructor Create(AShell:TConsoleShell);</code>  | ||
| + | | style="width: 50%;"|   | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>  | ||
| + | |-  | ||
| + | | <code>FShell:TConsoleShell;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |colspan="2"|   | ||
| + | |-  | ||
| + | | <code>procedure Execute; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |}  | ||
| + | </div></div>  | ||
| + | |||
| + | '''Console shell exit'''  | ||
| + | |||
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">  | ||
| + | |||
| + | <code>TConsoleShellExit = class(TShellCommand)</code>  | ||
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">  | ||
| + | {| class="wikitable" style="font-size: 14px; background: white;"  | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>constructor Create;</code>  | ||
| + | | style="width: 50%;"|   | ||
| + | |-  | ||
| + | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>  | ||
| + | |-  | ||
| + | | <code>function DoHelp(AShell:TShell; ASession:TShellSession):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoInfo(AShell:TShell; ASession:TShellSession):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | | <code>function DoCommand(AShell:TShell; ASession:TShellSession; AParameters:TStrings):Boolean; override;</code>  | ||
| + | |    | ||
| + | |-  | ||
| + | |}  | ||
| + | </div></div>  | ||
| + | <br />  | ||
=== Public variables ===  | === Public variables ===  | ||
Revision as of 04:24, 9 March 2017
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;
 | 
|
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 ConsoleChar(ASession:TShellSession; AChar:Char):Boolean;
 | 
|
Console session
TConsoleSession = class(TShellSession)
public 
 | |
 constructor Create(AShell:TShell; AIdentifier:LongWord);
 | 
|
public 
 | |
 Command:String;
 | 
|
 Position: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