Text-terminal based User Interface. More...
#include <ConsoleUI.h>
Public Member Functions | |
| ConsoleUI (GXemul *gxemul) | |
| Constructs a text console UI instance. More... | |
| virtual | ~ConsoleUI () |
| virtual void | Initialize () |
| Initializes the terminal for blocking, non-echo I/O. More... | |
| virtual void | UpdateUI () |
| Updates UI items. Not used for ConsoleUI. More... | |
| virtual void | ShowStartupBanner () |
| Prints the text console startup banner. More... | |
| virtual void | ShowDebugMessage (const string &msg) |
| Shows a debug message, by printing it to stdout. More... | |
| virtual void | ShowDebugMessage (Component *component, const string &msg) |
| Shows a debug message for a Component, by printing it to stdout. More... | |
| virtual void | ShowCommandMessage (const string &command) |
| Does nothing for the ConsoleUI. More... | |
| virtual void | FatalError (const string &msg) |
| Shows a fatal error message, by printing it to stderr. More... | |
| virtual void | RedisplayInputLine (const string &inputline, size_t cursorPosition) |
| Redisplays the interactive command input line. More... | |
| virtual void | InputLineDone () |
| Executed by the CommandInterpreter when a line has been completed (with a newline). More... | |
| virtual int | MainLoop () |
| Runs the text console main loop. More... | |
| virtual void | Shutdown () |
| Shuts down the UI. More... | |
Public Member Functions inherited from UI | |
| UI (GXemul *gxemul) | |
| Constructs a User Interface. More... | |
| virtual | ~UI () |
| void | SetIndentationMessage (const string &msg) |
| Sets an indentation message, which indents all debug output. More... | |
| string | GetIndentationMessage () const |
| Gets the indentation message. More... | |
Public Member Functions inherited from ReferenceCountable | |
| ReferenceCountable () | |
| Default constructor, which initializes the reference count to zero. More... | |
| ~ReferenceCountable () | |
Additional Inherited Members | |
Protected Attributes inherited from UI | |
| GXemul * | m_gxemul |
| string | m_indentationMsg |
Text-terminal based User Interface.
Definition at line 39 of file ConsoleUI.h.
| ConsoleUI::ConsoleUI | ( | GXemul * | gxemul | ) |
Constructs a text console UI instance.
| gxemul | Pointer to the owning GXemul instance. |
Definition at line 37 of file ConsoleUI.cc.
|
virtual |
Definition at line 44 of file ConsoleUI.cc.
|
virtual |
Shows a fatal error message, by printing it to stderr.
| msg | The error message to show. |
Implements UI.
Definition at line 215 of file ConsoleUI.cc.
Referenced by MainLoop().
|
virtual |
Initializes the terminal for blocking, non-echo I/O.
Implements UI.
Definition at line 98 of file ConsoleUI.cc.
|
virtual |
Executed by the CommandInterpreter when a line has been completed (with a newline).
For the ConsoleUI, this simply outputs a newline character.
Implements UI.
Definition at line 255 of file ConsoleUI.cc.
|
virtual |
Runs the text console main loop.
As long as the RunState is not Quitting:
Implements UI.
Definition at line 267 of file ConsoleUI.cc.
References GXemul::Execute(), FatalError(), Component::FlushCachedState(), GXemul::GetRootComponent(), GXemul::GetRunState(), UI::m_gxemul, GXemul::Paused, Component::PreRunCheck(), GXemul::Quitting, GXemul::Running, GXemul::SetRunState(), and GXemul::SingleStepping.
|
virtual |
Redisplays the interactive command input line.
For the ConsoleUI, this function displays a prompt ("GXemul> ") followed by the input line, placing the cursor position at the correct position on the input line.
| inputline | The entire input line. |
| cursorPosition | The current cursor position. 0 is at the leftmost position. |
Implements UI.
Definition at line 222 of file ConsoleUI.cc.
|
virtual |
Does nothing for the ConsoleUI.
| command | The command being executed. |
Implements UI.
Definition at line 207 of file ConsoleUI.cc.
|
virtual |
Shows a debug message for a Component, by printing it to stdout.
See UI::ShowDebugMessage(Component*,const string&) for a longer comment.
| component | A pointer to the Component. |
| msg | The message to show. |
Implements UI.
Definition at line 181 of file ConsoleUI.cc.
References Component::GenerateShortestPossiblePath(), GXemul::GetQuietMode(), and UI::m_gxemul.
|
virtual |
Shows a debug message, by printing it to stdout.
| msg | The message to show. |
Implements UI.
Definition at line 161 of file ConsoleUI.cc.
|
virtual |
Prints the text console startup banner.
Implements UI.
Definition at line 131 of file ConsoleUI.cc.
References GXemul::Version().
|
virtual |
Shuts down the UI.
Called from e.g. the "quit" command.
Implements UI.
Definition at line 262 of file ConsoleUI.cc.
|
virtual |
Updates UI items. Not used for ConsoleUI.
Implements UI.
Definition at line 125 of file ConsoleUI.cc.
1.8.17