Difference between revisions of "Unit ConsoleShell"

From Ultibo.org
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
'''Ultibo Console Shell unit'''
 
'''Ultibo Console Shell unit'''
 
''To be documented''
 
  
 
=== Constants ===
 
=== Constants ===
Line 61: Line 59:
  
  
'''Console shell'''
+
'''Console shell specific classes'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
<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>
+
| [[TConsoleShell|<code>TConsoleShell = class(TShell)</code>]]
|-
+
| <code>constructor Create(AConsole:PConsoleDevice);</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FConsole:PConsoleDevice;</code>
+
| &nbsp;
+
|-
+
| <code>FThread:TConsoleShellThread;</code>
+
| &nbsp;
+
|-
+
| <code>FDefaultSession:TShellSession;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure Reset(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure MoveFirst(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure MoveLast(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure MoveLeft(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure MoveRight(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure EraseLine(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure OutputLine(ASession:TConsoleSession; const AValue:String);</code>
+
| &nbsp;
+
|-
+
| <code>function ExpandLine(ASession:TConsoleSession):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure EraseCharacter(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure DeleteCharacter(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure InsertCharacter(ASession:TConsoleSession; ACh:Char);</code>
+
| &nbsp;
+
|-
+
| <code>procedure OverwriteCharacter(ASession:TConsoleSession; ACh:Char);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure PrevHistory(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure NextHistory(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure FirstHistory(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure LastHistory(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
| <code>procedure CurrentHistory(ASession:TConsoleSession);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
+
|-
+
| <code>function CreateWindow:TShellSession;</code>
+
| &nbsp;
+
|-
+
| <code>function DestroyWindow(ASession:TShellSession):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Console:PConsoleDevice read FConsole;</code>
+
| &nbsp;
+
|-
+
| <code>property DefaultSession:TShellSession read FDefaultSession;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoClear(ASession:TShellSession):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoInput(ASession:TShellSession; var AInput:String):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoOutputEx(ASession:TShellSession; const AOutput:String; AReturn:Boolean):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetSize(ASession:TShellSession; var ARows,ACols:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetSize(ASession:TShellSession; ARows,ACols:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetCursor(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetCursor(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetColors(ASession:TShellSession; var AForecolor,ABackcolor:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetColors(ASession:TShellSession; AForecolor,ABackcolor:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetCoordinates(ASession:TShellSession; var ARow,ACol:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetCoordinates(ASession:TShellSession; ARow,ACol:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetCursorMode(ASession:TShellSession; var AMode:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetCursorMode(ASession:TShellSession; AMode:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function DoGetCursorShape(ASession:TShellSession; var AShape:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoSetCursorShape(ASession:TShellSession; AShape:LongWord):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function ConsoleChar(ASession:TShellSession; AChar:Char):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function ConsoleExtended(ASession:TShellSession; AChar:Char):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''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>
+
| [[TConsoleSession|<code>TConsoleSession = class(TShellSession)</code>]]
|-
+
| <code>constructor Create(AShell:TShell; AIdentifier:LongWord);</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>Command:String;</code>
+
| &nbsp;
+
|-
+
| <code>MaxX:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>MaxY:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>LastX:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>LastY:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FirstX:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FirstY:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>CurrentX:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>CurrentY:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>Mode:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>Shape:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>Window:TWindowHandle;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''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>
+
| [[TConsoleShellThread|<code>TConsoleShellThread = class(TThread)</code>]]
|-
+
| <code>constructor Create(AShell:TConsoleShell);</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
+
|-
+
| <code>FShell:TConsoleShell;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure Execute; override;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''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>
+
| [[TConsoleShellExit|<code>TConsoleShellExit = class(TShellCommand)</code>]]
|-
+
| <code>constructor Create;</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>function DoHelp(AShell:TShell; ASession:TShellSession):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoInfo(AShell:TShell; ASession:TShellSession):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function DoCommand(AShell:TShell; ASession:TShellSession; AParameters:TStrings):Boolean; override;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
 
 
<br />
 
<br />
  

Latest revision as of 04:19, 19 June 2021

Return to Unit Reference


Description


Ultibo Console Shell unit

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 specific classes

TConsoleShell = class(TShell)
TConsoleSession = class(TShellSession)
TConsoleShellThread = class(TThread)
TConsoleShellExit = class(TShellCommand)


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