Base class for a User Interface. More...
#include <UI.h>
Classes | |
class | SetIndentationMessageHelper |
Public Member Functions | |
UI (GXemul *gxemul) | |
Constructs a User Interface. More... | |
virtual | ~UI () |
virtual void | Initialize ()=0 |
Initializes the UI. More... | |
virtual void | ShowStartupBanner ()=0 |
Shows a startup banner. More... | |
virtual void | UpdateUI ()=0 |
Updates various UI elements. More... | |
void | SetIndentationMessage (const string &msg) |
Sets an indentation message, which indents all debug output. More... | |
string | GetIndentationMessage () const |
Gets the indentation message. More... | |
virtual void | ShowDebugMessage (const string &msg)=0 |
Shows a debug message. More... | |
virtual void | ShowDebugMessage (Component *component, const string &msg)=0 |
Shows a debug message for a Component. More... | |
virtual void | ShowCommandMessage (const string &command)=0 |
Shows a command being executed. More... | |
virtual void | FatalError (const string &msg)=0 |
Shows a fatal error message. More... | |
virtual void | RedisplayInputLine (const string &inputline, size_t cursorPosition)=0 |
Redisplays the interactive command input line. More... | |
virtual void | InputLineDone ()=0 |
Executed by the CommandInterpreter when a line has been completed (with a newline). More... | |
virtual int | MainLoop ()=0 |
Runs the UI's main loop. More... | |
virtual void | Shutdown ()=0 |
Shuts down the UI. More... | |
![]() | |
ReferenceCountable () | |
Default constructor, which initializes the reference count to zero. More... | |
~ReferenceCountable () | |
Protected Attributes | |
GXemul * | m_gxemul |
string | m_indentationMsg |
|
inline |
|
pure virtual |
Shows a fatal error message.
After showing the fatal error message, the application is expected to terminate. In a GUI implementation, it is therefore good to wait for the user to acknowledge the error message before returning.
msg | The message to show. |
Implemented in ConsoleUI, and NullUI.
Referenced by GXemul::Run().
|
inline |
Gets the indentation message.
Definition at line 121 of file UI.h.
References m_indentationMsg.
Referenced by UI::SetIndentationMessageHelper::SetIndentationMessageHelper().
|
pure virtual |
|
pure virtual |
Executed by the CommandInterpreter when a line has been completed (with a newline).
Usually this clears the current line, and (if possible) moves down to a new line.
Implemented in ConsoleUI, and NullUI.
Referenced by CommandInterpreter::AddKey().
|
pure virtual |
Runs the UI's main loop.
The return code should be the exit code that the gxemul binary should return.
Implemented in ConsoleUI, and NullUI.
Referenced by GXemul::Run().
|
pure virtual |
Redisplays the interactive command input line.
This function generally displays a prompt (e.g. "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. |
Implemented in ConsoleUI, and NullUI.
Referenced by CommandInterpreter::ReshowCurrentCommandBuffer().
|
inline |
Sets an indentation message, which indents all debug output.
Note: An UI implementation may change the indentation string. E.g. from "step X: " to " ".
msg | The indentation message. If the message is an empty string, indentation is not used. |
Definition at line 110 of file UI.h.
References m_indentationMsg.
Referenced by UI::SetIndentationMessageHelper::SetIndentationMessageHelper(), and UI::SetIndentationMessageHelper::~SetIndentationMessageHelper().
|
pure virtual |
|
pure virtual |
Shows a debug message for a Component.
Usually, this involves formatting the debug message using Component::GenerateShortestPossiblePath().
If the runstate is GXemul::Running, the debug message is encapsulated by "[ ]" brackets, making the debug message very similar to pre-0.6.0 debug output style.
component | A pointer to the Component. |
msg | The message to show. |
|
pure virtual |
Shows a debug message.
msg | The message to show. |
Implemented in ConsoleUI, and NullUI.
Referenced by CommandInterpreter::AddKey(), RootComponent::CheckVariableWrite(), MIPS_CPUComponent::CheckVariableWrite(), M88K_CPUComponent::CheckVariableWrite(), Component::CheckVariableWrite(), SGI_IP30_Machine::Create(), TestM88KMachine::Create(), TestMIPSMachine::Create(), ComponentFactory::CreateComponent(), DYNTRANS_INSTR(), CPUDyntransComponent::DyntransReadInstruction(), CPUDyntransComponent::DyntransToBeTranslatedDone(), ContinueBackwardsCommand::Execute(), StepCommand::Execute(), VersionCommand::Execute(), HelpCommand::Execute(), ListComponentsCommand::Execute(), BackwardStepCommand::Execute(), StatusCommand::Execute(), CPUDyntransComponent::Execute(), CPUComponent::ExecuteMethod(), CacheComponent::ExecuteMethod(), RAMComponent::ExecuteMethod(), CPUComponent::FunctionTraceCall(), CPUComponent::FunctionTraceReturn(), ComponentFactory::GetCreationArgOverrides(), GXemul::ModifyStep(), RootComponent::PreRunCheckForComponent(), I960_CPUComponent::PreRunCheckForComponent(), MainbusComponent::PreRunCheckForComponent(), CPUComponent::PreRunCheckForComponent(), MIPS_CPUComponent::PreRunCheckForComponent(), M88K_CPUComponent::PreRunCheckForComponent(), GXemul::Reset(), GXemul::Run(), GXemul::SetSnapshottingEnabled(), Component::SetVariableValue(), and CPUComponent::ShowRegisters().
|
pure virtual |
|
pure virtual |
Shuts down the UI.
Called from e.g. the "quit" command.
Implemented in ConsoleUI, and NullUI.
Referenced by QuitCommand::Execute().
|
pure virtual |
Updates various UI elements.
Called whenever:
Implemented in ConsoleUI, and NullUI.
Referenced by GXemul::ClearEmulation(), GXemul::SetEmulationFilename(), GXemul::SetRootComponent(), and GXemul::SetRunState().
|
protected |
Definition at line 208 of file UI.h.
Referenced by ConsoleUI::MainLoop(), and ConsoleUI::ShowDebugMessage().
|
protected |
Definition at line 209 of file UI.h.
Referenced by GetIndentationMessage(), and SetIndentationMessage().