#include <console.h>
Inherits InputAcceptor, and LogAcceptor.
Inheritance diagram for Console:


Public Member Functions | |
| Console () | |
| ~Console () | |
| virtual bool | wantKey (const SDL_keysym &keysym) |
| virtual bool | keyDown (const SDL_keysym &keysym) |
| virtual void | logLine (const std::string &line) |
| Processing one line from log. | |
| void | render () |
| Render the console. | |
| void | init () |
| Inicialize the console and plug it into the system. | |
| void | clean () |
| Clean resources allocated by console. | |
| void | addConsoleMessage (const std::string &msg) |
| Add new message to console. | |
Private Member Functions | |
| void | processCommand (const std::string &cmd) |
| Handles the command. | |
| void | registerLog () |
| Update console state as log listener. | |
Private Attributes | |
| int | mInHistory |
| Number of lines in console history. | |
| std::list< std::string > | mMessageHistory |
| Lines of history in console. | |
| Mutex | mHistoryMutex |
| Lock for history. | |
| bool | mHistoryIgnore |
| bool | mLineWrap |
| bool | mActive |
| true if console is active | |
| InputString | mInputLine |
| currently edited command | |
| FontRef | mFont |
| font for console | |
| bool | mLogForwarding |
| log messages are printed to console if true | |
| int | mTitle |
| translation index for title of console | |
Process input from keyboard and send commands to Commander. Doesn't process any command itself. TODO: commands history better visualisation? (slide down?)
Definition at line 25 of file console.h.
|
|
Definition at line 31 of file console.cpp. References g_settings, Settings::getInt(), IA_PRIORITY_CONSOLE, mActive, mFont, mHistoryIgnore, mInHistory, mLineWrap, mLogForwarding, InputAcceptor::mPriority, and mTitle. Here is the call graph for this function: ![]() |
|
|
Definition at line 49 of file console.cpp. References TIN. |
|
|
Add new message to console. Is thread safe.
Definition at line 231 of file console.cpp. References CONSOLE_LEFT, getAppClient(), ApplicationClient::getGFX(), GFX::getWidth(), Mutex::lock(), mFont, mHistoryIgnore, mHistoryMutex, mLineWrap, mMessageHistory, utf8tows(), and wstoutf8(). Referenced by CommanderClient::command_getvar(), CommanderClient::command_help(), CommanderClient::command_players(), CommanderClient::command_setvar(), logLine(), and processCommand(). Here is the call graph for this function: ![]() |
|
|
Clean resources allocated by console.
Definition at line 79 of file console.cpp. References CONSOLE_ONOFF, g_log, getAppClient(), ApplicationClient::getInputManager(), LNG_UNCACHE, mFont, mTitle, InputManager::removeInputAcceptor(), Log::setAcceptor(), InputManager::setKeyReceiver(), and TIN. Referenced by ApplicationClient::clean(). Here is the call graph for this function: ![]() |
|
|
Inicialize the console and plug it into the system. Menas loading font, textures and adding to InputManager. Definition at line 55 of file console.cpp. References InputManager::addInputAcceptor(), CONSOLE_ONOFF, DIE(), getAppClient(), ApplicationClient::getInputManager(), Singleton< T >::getRef(), LNG_CACHE_, LOGE, mFont, mTitle, registerLog(), InputManager::setKeyReceiver(), and TIN. Referenced by ApplicationClient::init(). Here is the call graph for this function: ![]() |
|
|
Inform acceptor that key was down.
Reimplemented from InputAcceptor. Definition at line 106 of file console.cpp. References InputString::clear(), CONSOLE_ONOFF, getAppClient(), ApplicationClient::getInputManager(), InputString::getLineU(), LOGD, LOGI, LOGT, mActive, mInputLine, processCommand(), InputString::processKey(), TIN, and InputManager::WantAllInput(). Here is the call graph for this function: ![]() |
|
|
Processing one line from log. The line is simply added as a message line.
Implements LogAcceptor. Definition at line 155 of file console.cpp. References addConsoleMessage(), and mLogForwarding. Here is the call graph for this function: ![]() |
|
|
Handles the command. Processing is simple forward to Commander.
Definition at line 295 of file console.cpp. References Commander::addCommand(), addConsoleMessage(), getAppClient(), ApplicationClient::getCommander(), LOGD, and TIN. Referenced by keyDown(). Here is the call graph for this function: ![]() |
|
|
Update console state as log listener. Register/unregister to log as acceptor. Depending on mLogForwarding Definition at line 162 of file console.cpp. References g_log, mLogForwarding, and Log::setAcceptor(). Referenced by init(). Here is the call graph for this function: ![]() |
|
|
Render the console. Renders nothig if console is not active. Also render FPS - but it should be removed. Definition at line 175 of file console.cpp. References assertL, CONSOLE_LEFT, CONSOLE_TOP, getAppClient(), ApplicationClient::getGFX(), LNG_GET, Mutex::lock(), mActive, mFont, mHistoryIgnore, mHistoryMutex, mInHistory, mMessageHistory, mTitle, GFX::set2DOpenGL(), TIN, and xtos(). Referenced by LayerGUI::render(). Here is the call graph for this function: ![]() |
|
|
Console takes every key when active Reimplemented from InputAcceptor. Definition at line 98 of file console.cpp. References CONSOLE_ONOFF, and mActive. |
|
|
true if console is active
Definition at line 113 of file console.h. Referenced by Console(), keyDown(), render(), and wantKey(). |
|
|
font for console
Definition at line 117 of file console.h. Referenced by addConsoleMessage(), clean(), Console(), init(), and render(). |
|
|
New messages are ignored if this is true. This exists becasue when you are rendering a history it may happen that new messages will appear and it would corrupt iterators. Definition at line 109 of file console.h. Referenced by addConsoleMessage(), Console(), and render(). |
|
|
Lock for history.
Definition at line 100 of file console.h. Referenced by addConsoleMessage(), and render(). |
|
|
Number of lines in console history.
|
|
|
currently edited command
Definition at line 115 of file console.h. Referenced by keyDown(). |
|
|
Definition at line 111 of file console.h. Referenced by addConsoleMessage(), and Console(). |
|
|
log messages are printed to console if true
Definition at line 119 of file console.h. Referenced by Console(), logLine(), and registerLog(). |
|
|
Lines of history in console.
Definition at line 99 of file console.h. Referenced by addConsoleMessage(), and render(). |
|
|
translation index for title of console
|
1.4.5