#include <Console.h>
Definition at line 83 of file Console.h.
typedef Pentagram::istring Console::ArgsType |
typedef std::vector<ArgsType> Console::ArgvType |
typedef void(*) Console::Function(const ArgvType &argv) |
Console::Console | ( | ) |
Definition at line 197 of file Console.cpp.
References AddConsoleCommand(), CheckResize(), ConCmd_CmdHistory(), ConCmd_CmdList(), linewidth, PrintInternal(), and times.
Console::~Console | ( | ) |
Definition at line 220 of file Console.cpp.
References ConCmd_CmdHistory(), ConCmd_CmdList(), PrintPutchar(), and RemoveConsoleCommand().
void Console::AddCharacterToCommandBuffer | ( | int | ch | ) |
Add a character to the Queued Console command input buffer
ch | Character to add. |
'' will do command completion
'' will do backspace
Definition at line 649 of file Console.cpp.
References Backspace, commandBuffer, commandCursorPos, commandInsert, ConCmd_CmdList(), ConsoleCommands, DeleteCommandBufferChars(), Enter, ExecuteCommandBuffer(), pout, Pentagram::StringToArgv(), and Tab.
Referenced by ConsoleGump::OnKeyDown(), and ConsoleGump::OnTextInput().
void Console::AddConsoleCommand | ( | const ArgsType & | command, | |
Console::Function | function | |||
) |
Add a command to the console
command | The command to add | |
function | Function pointer for command |
Definition at line 565 of file Console.cpp.
References ConsoleCommands.
Referenced by Console(), ConsoleGump::ConsoleGump(), GUIApp::GUIApp(), MiniMapGump::loadData(), MiniMapGump::MiniMapGump(), ScalerGump::ScalerGump(), GUIApp::startupGame(), U8Game::U8Game(), and UCMachine::UCMachine().
void Console::CheckResize | ( | int | scrwidth | ) |
Definition at line 137 of file Console.cpp.
References confont, current, display, linewidth, PrintPutchar(), text, totallines, FixedWidthFont::width, and width.
Referenced by Console(), ConsoleGump::ConsoleGump(), and ConsoleGump::RenderSurfaceChanged().
void Console::Clear | ( | ) |
void Console::ClearCommandBuffer | ( | ) |
Clear the queued console command buffer.
Definition at line 643 of file Console.cpp.
References commandBuffer, and commandCursorPos.
Referenced by ConsoleGump::ConsoleGump(), ConsoleGump::HideConsole(), ConsoleGump::Run(), and ConsoleGump::ToggleConsole().
void Console::ConCmd_CmdHistory | ( | const Console::ArgvType & | argv | ) | [static] |
"CmdHistory" console command
Definition at line 805 of file Console.cpp.
References commandHistory, con, and pout.
Referenced by Console(), and ~Console().
void Console::ConCmd_CmdList | ( | const Console::ArgvType & | argv | ) | [static] |
"CmdList" console command
Definition at line 771 of file Console.cpp.
References con, ConsoleCommands, and pout.
Referenced by AddCharacterToCommandBuffer(), Console(), and ~Console().
void Console::DeleteCommandBufferChars | ( | int | num | ) |
Delete the character before or after the current cursor position
num | Number of chars to delete and direction (neg = left, pos = right) |
Definition at line 744 of file Console.cpp.
References commandBuffer, and commandCursorPos.
Referenced by AddCharacterToCommandBuffer(), and ConsoleGump::OnKeyDown().
void Console::DisableWordWrap | ( | ) | [inline] |
void Console::DrawConsole | ( | RenderSurface * | surf, | |
int | height | |||
) |
Definition at line 823 of file Console.cpp.
References commandBuffer, commandCursorPos, commandInsert, confont, current, display, RenderSurface::Fill32(), FixedWidthFont::height, linewidth, RenderSurface::PrintCharFixed(), PrintPutchar(), text, totallines, vislines, FixedWidthFont::width, x, and y.
Referenced by ConsoleGump::PaintThis().
void Console::DrawConsoleNotify | ( | RenderSurface * | surf | ) |
Definition at line 919 of file Console.cpp.
References con, confont, current, framenum, FixedWidthFont::height, linewidth, RenderSurface::PrintCharFixed(), text, time, times, totallines, FixedWidthFont::width, and x.
Referenced by ConsoleGump::PaintThis().
void Console::Dump | ( | const char * | name | ) |
Definition at line 78 of file Console.cpp.
References current, line, linewidth, Print(), Printf(), PrintPutchar(), text, totallines, and x.
void Console::EnableWordWrap | ( | ) | [inline] |
void Console::ExecuteCommandBuffer | ( | ) |
Execute the currently queued console command.
Definition at line 605 of file Console.cpp.
References commandBuffer, commandCursorPos, commandHistory, commandHistoryPos, ExecuteConsoleCommand(), and pout.
Referenced by AddCharacterToCommandBuffer().
void Console::ExecuteConsoleCommand | ( | const Console::ArgvType & | argv | ) |
Execute a specific console command
command | The command to execute with argv |
Definition at line 590 of file Console.cpp.
References ConsoleCommands, and pout.
void Console::ExecuteConsoleCommand | ( | const Console::ArgsType & | args | ) |
Execute a specific console command
command | The command to execute with args |
Definition at line 582 of file Console.cpp.
References Pentagram::StringToArgv().
Referenced by ExecuteCommandBuffer(), HIDManager::handleDelayedEvents(), and HIDManager::handleEvent().
FixedWidthFont* Console::GetConFont | ( | ) | [inline] |
uint32 Console::getOutputEnabled | ( | ) | [inline] |
void Console::Linefeed | ( | ) | [private] |
Definition at line 354 of file Console.cpp.
References auto_paint, current, display, linewidth, text, totallines, and x.
Referenced by PrintInternal(), and PrintRawInternal().
void Console::MoveCommandCursor | ( | int | num | ) |
Move the command input cursor
num | Number of chars to move by |
Definition at line 763 of file Console.cpp.
References commandBuffer, and commandCursorPos.
Referenced by ConsoleGump::OnKeyDown().
void Console::Print | ( | const MsgMask | mm, | |
const char * | txt | |||
) |
void Console::Print | ( | const char * | txt | ) |
Definition at line 401 of file Console.cpp.
References PrintInternal(), std_output_enabled, stdout_redir, and ODataSource::write().
Referenced by Pentagram::AudioMixer::AudioMixer(), Pentagram::AudioMixer::closeMidiOutput(), GUIApp::ConCmd_listGames(), ConfigFileManager::ConfigFileManager(), Dump(), FileSystem::FileSystem(), DCUnit::fold(), FontManager::FontManager(), GameData::GameData(), GUIApp::GraphicSysInit(), CoreApp::helpMe(), ConApp::helpMe(), HIDManager::HIDManager(), indent(), Kernel::Kernel(), HIDManager::loadBindings(), GUIApp::loadGame(), GUIApp::newGame(), ObjectManager::ObjectManager(), Pentagram::AudioMixer::openMidiOutput(), PaletteManager::PaletteManager(), Print(), Unit::print_extern_unk(), DCCallNode::print_extern_unk(), PopVarNode::print_unk(), LoopNode::print_unk(), IfNode::print_unk(), DCFuncNode::print_unk(), Unit::print_unk(), DCCallNode::print_unk(), World::reset(), UCMachine::reset(), PaletteManager::reset(), ObjectManager::reset(), Kernel::reset(), Pentagram::AudioMixer::reset(), GUIApp::resetEngine(), PaletteManager::resetTransforms(), GUIApp::SDLInit(), SettingManager::SettingManager(), GUIApp::setupCoreGumps(), CoreApp::setupGameList(), GUIApp::shutdownGame(), ConApp::startup(), UCMachine::UCMachine(), World::World(), Pentagram::AudioMixer::~AudioMixer(), ConfigFileManager::~ConfigFileManager(), FileSystem::~FileSystem(), FontManager::~FontManager(), GameData::~GameData(), HIDManager::~HIDManager(), Kernel::~Kernel(), ObjectManager::~ObjectManager(), PaletteManager::~PaletteManager(), SettingManager::~SettingManager(), UCMachine::~UCMachine(), and World::~World().
void Console::Print_err | ( | const MsgMask | mm, | |
const char * | txt | |||
) |
void Console::Print_err | ( | const char * | txt | ) |
Definition at line 480 of file Console.cpp.
References PrintInternal(), std_output_enabled, stderr_redir, and ODataSource::write().
Referenced by Print_err().
sint32 Console::Printf | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 415 of file Console.cpp.
References vPrintf().
Referenced by MemoryManager::_allocate(), MemoryManager::_deallocate(), GUIApp::ConCmd_listGames(), MemoryManager::ConCmd_test(), ConvertFlexes(), ConvertShp(), DCCallNode::DCCallNode(), Dump(), Folder::fold(), DCUnit::fold(), DCCallNode::fold(), ColNode::grab_p(), GUIApp::GraphicSysInit(), GUIApp::LoadConsoleFont(), main(), CompileUnit::parse(), PushVarNode::print_asm(), PopVarNode::print_asm(), BinOperatorNode::print_asm(), UniOperatorNode::print_asm(), LoopNextNode::print_asm(), LoopNode::print_asm(), LoopScriptNode::print_asm(), DCFuncNode::print_asm(), FuncMutatorNode::print_asm(), DCCallNode::print_asm(), DCCallMutatorNode::print_asm(), DCCallPostfixNode::print_asm(), PrintHelperNode::print_asm_header(), print_assert(), print_assert_nodes(), DCFuncNode::print_bin(), Unit::print_bin(), DCCallNode::print_extern_unk(), PrintHelperNode::print_mac_header(), Type::print_unk(), BinOperatorNode::print_unk(), UniOperatorNode::print_unk(), LoopNextNode::print_unk(), LoopNode::print_unk(), LoopScriptNode::print_unk(), EndNode::print_unk(), IfNode::print_unk(), DCFuncNode::print_unk(), FuncMutatorNode::print_unk(), Folder::print_unk(), DCCallNode::print_unk(), DCCallMutatorNode::print_unk(), DCCallPostfixNode::print_unk(), DCFuncNode::print_unk_funcheader(), DataType::print_value_asm(), DataType::print_value_unk(), printbytes(), ConvertUsecode::printDbgSymbols(), printglobals(), SegmentedPool::printInfo(), printoverloads(), ConvertUsecodeCrusader::readheader(), ConvertUsecode::readOpGeneric(), CoreApp::setupGameList(), CoreApp::setupGamePaths(), ScalerGump::SetupScalers(), and GUIApp::startupGame().
sint32 Console::Printf_err | ( | const char * | fmt, | |
... | ||||
) |
void Console::PrintInternal | ( | const char * | txt | ) | [private] |
Definition at line 235 of file Console.cpp.
References cr, current, framenum, Linefeed(), linewidth, PrintPutchar(), text, times, totallines, wordwrap, x, and y.
Referenced by Console(), Print(), Print_err(), PrintPutchar(), vPrintf(), and vPrintf_err().
void Console::PrintPutchar | ( | ) | [private] |
Definition at line 379 of file Console.cpp.
References PrintInternal(), putchar_buf, and putchar_count.
Referenced by CheckResize(), DrawConsole(), Dump(), PrintInternal(), PrintRawInternal(), PutcharInternal(), and ~Console().
void Console::PrintRaw | ( | const char * | txt, | |
int | n | |||
) |
Definition at line 459 of file Console.cpp.
References PrintRawInternal(), std_output_enabled, stdout_redir, and ODataSource::write().
void Console::PrintRaw_err | ( | const char * | txt, | |
int | n | |||
) |
Definition at line 538 of file Console.cpp.
References PrintRawInternal(), std_output_enabled, stderr_redir, and ODataSource::write().
void Console::PrintRawInternal | ( | const char * | txt, | |
int | n | |||
) | [private] |
Definition at line 294 of file Console.cpp.
References cr, current, framenum, Linefeed(), linewidth, PrintPutchar(), text, times, totallines, wordwrap, x, and y.
Referenced by PrintRaw(), and PrintRaw_err().
void Console::Putchar | ( | int | c | ) |
Definition at line 467 of file Console.cpp.
References PutcharInternal(), std_output_enabled, stdout_redir, and ODataSource::write1().
Referenced by console_streambuf< _E, _Tr >::overflow(), PopVarNode::print_asm(), BinOperatorNode::print_asm(), UniOperatorNode::print_asm(), LoopNode::print_asm(), IfNode::print_asm(), DCFuncNode::print_asm(), Unit::print_asm(), DCCallNode::print_asm(), DCCallMutatorNode::print_asm(), print_assert(), print_assert_nodes(), DCFuncNode::print_bin(), Unit::print_bin(), Unit::print_extern_unk(), DCCallNode::print_extern_unk(), Node::print_linenum_asm(), PushVarNode::print_unk(), PopVarNode::print_unk(), UniOperatorNode::print_unk(), LoopNode::print_unk(), IfNode::print_unk(), DCFuncNode::print_unk(), DCCallNode::print_unk(), DCCallMutatorNode::print_unk(), DCFuncNode::print_unk_funcheader(), and ConvertUsecode::readOpGeneric().
void Console::Putchar_err | ( | int | c | ) |
Definition at line 546 of file Console.cpp.
References PutcharInternal(), std_output_enabled, stderr_redir, and ODataSource::write1().
Referenced by console_err_streambuf< _E, _Tr >::overflow().
void Console::PutcharInternal | ( | int | c | ) | [private] |
Definition at line 365 of file Console.cpp.
References PrintPutchar(), putchar_buf, and putchar_count.
Referenced by Putchar(), and Putchar_err().
void Console::RedirectOutputStream | ( | uint32 | mask, | |
ODataSource * | ds | |||
) | [inline] |
void Console::RemoveConsoleCommand | ( | Console::Function | function | ) |
Remove all commands associated with a function from the console
function | Function pointer for command |
Definition at line 570 of file Console.cpp.
References ConsoleCommands.
Referenced by MiniMapGump::MiniMapGump(), GUIApp::shutdownGame(), ~Console(), ConsoleGump::~ConsoleGump(), GUIApp::~GUIApp(), MiniMapGump::~MiniMapGump(), ScalerGump::~ScalerGump(), U8Game::~U8Game(), and UCMachine::~UCMachine().
void Console::ScrollCommandHistory | ( | int | num | ) |
Scroll the command history
num | Number of commands to scroll through (neg numbers are older) |
Definition at line 621 of file Console.cpp.
References commandBuffer, commandCursorPos, commandHistory, and commandHistoryPos.
Referenced by ConsoleGump::OnKeyDown().
void Console::ScrollConsole | ( | sint32 | lines | ) |
Definition at line 553 of file Console.cpp.
References current, and display.
Referenced by ConsoleGump::OnKeyDown().
void Console::SetAutoPaint | ( | void(*)(void) | func | ) | [inline] |
Definition at line 152 of file Console.h.
References auto_paint.
Referenced by GUIApp::startup(), GUIApp::startupGame(), and GUIApp::startupPentagramMenu().
void Console::SetConFont | ( | FixedWidthFont * | cf | ) | [inline] |
Definition at line 146 of file Console.h.
References confont.
Referenced by GUIApp::LoadConsoleFont().
void Console::setFrameNum | ( | uint32 | f | ) | [inline] |
void Console::setMsgMask | ( | const MsgMask | mm | ) | [inline] |
void Console::setOutputEnabled | ( | uint32 | mask | ) | [inline] |
void Console::ToggleCommandInsert | ( | ) | [inline] |
Toggle command input insert mode.
Definition at line 292 of file Console.h.
References commandInsert.
Referenced by ConsoleGump::OnKeyDown().
void Console::unsetOutputEnabled | ( | uint32 | mask | ) | [inline] |
sint32 Console::vPrintf | ( | const char * | fmt, | |
va_list | ||||
) |
Definition at line 441 of file Console.cpp.
References msg(), PrintInternal(), std_output_enabled, stdout_redir, and ODataSource::write().
Referenced by console_ostream< _E, _Tr >::printf(), and Printf().
sint32 Console::vPrintf_err | ( | const char * | fmt, | |
va_list | ||||
) |
Definition at line 520 of file Console.cpp.
References msg(), PrintInternal(), std_output_enabled, stderr_redir, and ODataSource::write().
Referenced by console_err_ostream< _E, _Tr >::printf(), and Printf_err().
void(* Console::auto_paint)(void) [private] |
Referenced by Linefeed(), and SetAutoPaint().
ArgsType Console::commandBuffer [private] |
Definition at line 318 of file Console.h.
Referenced by AddCharacterToCommandBuffer(), ClearCommandBuffer(), DeleteCommandBufferChars(), DrawConsole(), ExecuteCommandBuffer(), MoveCommandCursor(), and ScrollCommandHistory().
int Console::commandCursorPos [private] |
Definition at line 319 of file Console.h.
Referenced by AddCharacterToCommandBuffer(), ClearCommandBuffer(), DeleteCommandBufferChars(), DrawConsole(), ExecuteCommandBuffer(), MoveCommandCursor(), and ScrollCommandHistory().
std::vector<ArgsType> Console::commandHistory [private] |
Definition at line 321 of file Console.h.
Referenced by ConCmd_CmdHistory(), ExecuteCommandBuffer(), and ScrollCommandHistory().
int Console::commandHistoryPos [private] |
Definition at line 322 of file Console.h.
Referenced by ExecuteCommandBuffer(), and ScrollCommandHistory().
bool Console::commandInsert [private] |
Definition at line 320 of file Console.h.
Referenced by AddCharacterToCommandBuffer(), DrawConsole(), and ToggleCommandInsert().
FixedWidthFont* Console::confont [private] |
Definition at line 108 of file Console.h.
Referenced by CheckResize(), DrawConsole(), DrawConsoleNotify(), GetConFont(), and SetConFont().
std::map<ArgsType,Function> Console::ConsoleCommands [private] |
Definition at line 323 of file Console.h.
Referenced by AddCharacterToCommandBuffer(), AddConsoleCommand(), ConCmd_CmdList(), ExecuteConsoleCommand(), and RemoveConsoleCommand().
bool Console::cr [private] |
sint32 Console::current [private] |
Definition at line 86 of file Console.h.
Referenced by CheckResize(), DrawConsole(), DrawConsoleNotify(), Dump(), Linefeed(), PrintInternal(), PrintRawInternal(), and ScrollConsole().
sint32 Console::display [private] |
Definition at line 88 of file Console.h.
Referenced by CheckResize(), DrawConsole(), Linefeed(), and ScrollConsole().
uint32 Console::framenum [private] |
Definition at line 115 of file Console.h.
Referenced by DrawConsoleNotify(), PrintInternal(), PrintRawInternal(), and setFrameNum().
sint32 Console::linewidth [private] |
Definition at line 90 of file Console.h.
Referenced by CheckResize(), Console(), DrawConsole(), DrawConsoleNotify(), Dump(), Linefeed(), PrintInternal(), and PrintRawInternal().
MsgMask Console::msgMask [private] |
Definition at line 112 of file Console.h.
Referenced by Print(), Print_err(), Printf(), Printf_err(), and setMsgMask().
char Console::putchar_buf[CON_PUTCHAR_SIZE] [private] |
sint32 Console::putchar_count [private] |
Definition at line 98 of file Console.h.
Referenced by Clear(), PrintPutchar(), and PutcharInternal().
uint32 Console::std_output_enabled [private] |
Definition at line 101 of file Console.h.
Referenced by getOutputEnabled(), Print(), Print_err(), PrintRaw(), PrintRaw_err(), Putchar(), Putchar_err(), setOutputEnabled(), unsetOutputEnabled(), vPrintf(), and vPrintf_err().
ODataSource* Console::stderr_redir [private] |
Definition at line 105 of file Console.h.
Referenced by Print_err(), PrintRaw_err(), Putchar_err(), RedirectOutputStream(), and vPrintf_err().
ODataSource* Console::stdout_redir [private] |
Definition at line 104 of file Console.h.
Referenced by Print(), PrintRaw(), Putchar(), RedirectOutputStream(), and vPrintf().
char Console::text[CON_TEXTSIZE] [private] |
Definition at line 85 of file Console.h.
Referenced by CheckResize(), Clear(), DrawConsole(), DrawConsoleNotify(), Dump(), Linefeed(), PrintInternal(), and PrintRawInternal().
uint32 Console::times[CON_NUM_TIMES] [private] |
Definition at line 116 of file Console.h.
Referenced by Console(), DrawConsoleNotify(), PrintInternal(), and PrintRawInternal().
sint32 Console::totallines [private] |
Definition at line 91 of file Console.h.
Referenced by CheckResize(), DrawConsole(), DrawConsoleNotify(), Dump(), Linefeed(), PrintInternal(), and PrintRawInternal().
sint32 Console::vislines [private] |
bool Console::wordwrap [private] |
Definition at line 95 of file Console.h.
Referenced by DisableWordWrap(), EnableWordWrap(), PrintInternal(), and PrintRawInternal().
sint32 Console::x [private] |
Definition at line 87 of file Console.h.
Referenced by DrawConsole(), DrawConsoleNotify(), Dump(), Linefeed(), PrintInternal(), and PrintRawInternal().