|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
Core text-console widget backed by an SDL_Surface. More...
#include <console.hpp>
Classes | |
| struct | TextLine |
Public Member Functions | |
| Console () | |
| ~Console () | |
| Console (const Console &)=delete | |
| Console & | operator= (const Console &)=delete |
| Console (Console &&)=delete | |
| Console & | operator= (Console &&)=delete |
| void | create (int x, int y, int w, int h) |
| Set position and size of the console rectangle. | |
| void | load (const std::string &fnt, int size, const SDL_Color &col) |
| Load font and rebuild the glyph cache. | |
| void | clear () |
| Clear the output buffer and reset scroll. | |
| void | print (const std::string &str) |
| Append text to the output buffer. | |
| void | thread_safe_print (const std::string &str) |
| Append text from any thread (uses the internal message queue). | |
| void | keypress (char c) |
| Handle a single character key press for the input line. | |
| SDL_Surface * | drawText () |
| Render the console contents to an internal SDL_Surface. | |
| std::string | getText () const |
| Return the current input-line text. | |
| void | setText (const std::string &text) |
| Replace the input-line text. | |
| size_t | getCursorPos () const |
| void | setCursorPos (size_t pos) |
Move the caret to pos within the input line. | |
| void | procCmd (const std::string &cmd) |
| Tokenise and dispatch a command string. | |
| void | setPrompt (const std::string &text) |
| Change the prompt prefix (default: "$ "). | |
| void | scrollToBottom () |
| Jump the scroll view to the most recent output. | |
| void | setCallback (gl::GLWindow *window, std::function< bool(gl::GLWindow *win, const std::vector< std::string > &)> callback) |
| Register a command callback invoked when the user presses Enter. | |
| void | moveCursorLeft () |
| Move caret one character to the left. | |
| void | moveCursorRight () |
| Move caret one character to the right. | |
| void | moveCursorHome () |
| Move caret to start of input line. | |
| void | moveCursorEnd () |
| Move caret to end of input line. | |
| void | moveHistoryUp () |
| Recall the previous command from history. | |
| void | moveHistoryDown () |
| Move forward through command history. | |
| void | updateInputScrollOffset () |
| Recalculate horizontal scroll for long input lines. | |
| int | getHeight () const |
| int | getWidth () const |
| void | startFadeIn () |
| Begin a fade-in animation. | |
| void | startFadeOut () |
| Begin a fade-out animation. | |
| bool | isFading () const |
| bool | isVisible () const |
| void | show () |
| Make the console fully visible immediately. | |
| void | hide () |
| Make the console invisible immediately. | |
| void | reload () |
| Reload the glyph cache with the current font settings. | |
| bool | loaded () const |
| bool | isScrollDragging () const |
| void | setTextAttrib (const int size, const SDL_Color &col) |
| Change font size and colour without reloading the widget. | |
| std::ostringstream & | bufferData () |
| Access the internal output buffer directly as an ostream. | |
| void | setInputCallback (std::function< int(gl::GLWindow *win, const std::string &)> callback) |
| Register a callback for raw input-line submission (Enter key). | |
| void | process_message_queue () |
| Process pending messages from the thread-safe print queue (call each frame). | |
| void | scrollUp () |
| Scroll output up by one line. | |
| void | scrollDown () |
| Scroll output down by one line. | |
| void | resetScroll () |
| Reset scroll to the bottom. | |
| void | scrollPageUp () |
| Scroll up by one page. | |
| void | scrollPageDown () |
| Scroll down by one page. | |
| void | handleMouseScroll (int mouseX, int mouseY, int wheelY) |
| Handle a mouse-wheel scroll event. | |
| bool | isMouseOverScrollbar (int mouseX, int mouseY) const |
| Test whether the mouse is over the scrollbar thumb. | |
| void | beginScrollDrag (int mouseY) |
| Start a scrollbar thumb drag. | |
| void | updateScrollDrag (int mouseY) |
| Continue a scrollbar thumb drag. | |
| void | endScrollDrag () |
| Release the scrollbar thumb. | |
Public Attributes | |
| mx::mxUtil * | util |
| Pointer to asset-path utilities (not owned). | |
| std::string | promptText = "$ " |
| Prompt string displayed before the input line. | |
| Uint32 | cursorBlinkTime = 0 |
| SDL_GetTicks() value of the last cursor blink toggle. | |
| bool | cursorVisible = true |
| Whether the cursor is currently shown. | |
| gl::GLWindow * | window = nullptr |
| Owning GL window (weak reference). | |
| std::string | inputBuffer |
| Current content of the input line (mirrors internal state). | |
| bool | needsRedraw = true |
| Set to trigger an SDL_Surface redraw. | |
| bool | needsReflow = true |
| Set to trigger line-wrapping recalculation. | |
| FadeState | fadeState = FADE_NONE |
| Current fade animation state. | |
Protected Member Functions | |
| void | checkScroll () |
| void | updateCursorPosition () |
| void | checkForLineWrap () |
| void | processMultilineInput (const std::string &cmd) |
| bool | checkBraceBalance (const std::string &text) |
| void | calculateLines () |
| void | worker_thread_func () |
| void | clearText () |
Protected Attributes | |
| std::recursive_mutex | console_mutex |
| std::queue< std::string > | message_queue |
| ConsoleChars | c_chars |
| bool | userScrolling = false |
| std::string | font |
| int | font_size = 16 |
| SDL_Color | color = {255, 255, 255, 255} |
| std::ostringstream | data |
| std::string | input_text |
| SDL_Surface * | surface = nullptr |
| SDL_Rect | console_rect |
| size_t | cursorPos = 0 |
| size_t | stopPosition = 0 |
| size_t | inputCursorPos = 0 |
| int | cursorX = 0 |
| int | cursorY = 0 |
| bool | showInput = true |
| std::function< bool(gl::GLWindow *win, const std::vector< std::string > &)> | callback = nullptr |
| std::function< int(gl::GLWindow *window, const std::string &)> | callbackEnter = nullptr |
| bool | callbackSet = false |
| std::vector< std::string > | commandHistory |
| int | historyIndex = -1 |
| std::string | tempBuffer |
| unsigned char | alpha = 188 |
| Uint32 | fadeStartTime = 0 |
| unsigned int | fadeDuration = 500 |
| int | inputScrollOffset = 0 |
| std::vector< TextLine > | lines |
| bool | inMultilineMode |
| int | braceCount |
| std::string | multilineBuffer |
| std::string | originalPrompt |
| std::string | continuationPrompt |
| std::unique_ptr< std::thread > | worker_thread |
| CommandQueue | command_queue |
| std::atomic< bool > | worker_active {true} |
| bool | enterCallbackSet = false |
| int | visibleLineCount = 0 |
| int | scrollOffset = 0 |
| bool | scrollDragging = false |
| int | scrollDragStartY = 0 |
| int | scrollDragStartOffset = 0 |
| SDL_Rect | scrollbarRect = {0, 0, 0, 0} |
Friends | |
| class | GLConsole |
Core text-console widget backed by an SDL_Surface.
Manages an output buffer, an editable input line, command history, optional fade-in/out animation, and a thread-safe message queue. Rendered to an SDL_Surface by drawText(); GLConsole uploads that surface to a GL texture each frame.
Definition at line 154 of file console.hpp.
| console::Console::Console | ( | ) |
Definition at line 113 of file console.cpp.
References braceCount, inMultilineMode, multilineBuffer, originalPrompt, worker_active, worker_thread, and worker_thread_func().
Referenced by Console(), Console(), operator=(), and operator=().
| console::Console::~Console | ( | ) |
Definition at line 125 of file console.cpp.
References clear(), command_queue, surface, worker_active, and worker_thread.
|
delete |
References Console().
|
delete |
References Console().
| void console::Console::beginScrollDrag | ( | int | mouseY | ) |
Start a scrollbar thumb drag.
Definition at line 1397 of file console.cpp.
References console_mutex, scrollDragging, scrollDragStartOffset, scrollDragStartY, scrollOffset, and THREAD_GUARD.
| std::ostringstream & console::Console::bufferData | ( | ) |
Access the internal output buffer directly as an ostream.
Definition at line 916 of file console.cpp.
References data.
|
protected |
Definition at line 550 of file console.cpp.
References c_chars, console_mutex, console_rect, data, lines, needsReflow, surface, THREAD_GUARD, and visibleLineCount.
Referenced by checkScroll(), and drawText().
|
protected |
|
protected |
Definition at line 424 of file console.cpp.
References c_chars, console_mutex, console_rect, cursorPos, data, and THREAD_GUARD.
|
protected |
Definition at line 517 of file console.cpp.
References c_chars, calculateLines(), console_mutex, console_rect, cursorPos, data, lines, needsReflow, surface, and THREAD_GUARD.
Referenced by procCmd(), and scrollToBottom().
| void console::Console::clear | ( | ) |
Clear the output buffer and reset scroll.
Definition at line 171 of file console.cpp.
References c_chars.
Referenced by ~Console().
|
protected |
Definition at line 1049 of file console.cpp.
References console_mutex, data, lines, needsRedraw, needsReflow, and THREAD_GUARD.
| void console::Console::create | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h ) |
Set position and size of the console rectangle.
| x,y | Top-left corner in pixels. |
| w,h | Width and height in pixels. |
Definition at line 142 of file console.cpp.
References console_rect, and surface.
| SDL_Surface * console::Console::drawText | ( | ) |
Render the console contents to an internal SDL_Surface.
Definition at line 622 of file console.cpp.
References alpha, c_chars, calculateLines(), console_mutex, console_rect, cursorVisible, console::FADE_IN, console::FADE_NONE, console::FADE_OUT, fadeDuration, fadeStartTime, fadeState, console::flipSurface(), inputBuffer, inputCursorPos, inputScrollOffset, lines, needsRedraw, needsReflow, promptText, scrollbarRect, scrollOffset, surface, THREAD_GUARD, and visibleLineCount.
| void console::Console::endScrollDrag | ( | ) |
Release the scrollbar thumb.
Definition at line 1429 of file console.cpp.
References console_mutex, scrollDragging, and THREAD_GUARD.
| size_t console::Console::getCursorPos | ( | ) | const |
|
inline |
Definition at line 249 of file console.hpp.
References console_rect.
| std::string console::Console::getText | ( | ) | const |
Return the current input-line text.
|
inline |
Definition at line 250 of file console.hpp.
References console_rect.
| void console::Console::handleMouseScroll | ( | int | mouseX, |
| int | mouseY, | ||
| int | wheelY ) |
Handle a mouse-wheel scroll event.
| mouseX,mouseY | Cursor position. |
| wheelY | Scroll delta (positive = up). |
Definition at line 1434 of file console.cpp.
References console_mutex, scrollDown(), scrollUp(), and THREAD_GUARD.
| void console::Console::hide | ( | ) |
Make the console invisible immediately.
Definition at line 1067 of file console.cpp.
References startFadeOut().
|
inline |
true while animating. Definition at line 259 of file console.hpp.
References console::FADE_NONE, and fadeState.
| bool console::Console::isMouseOverScrollbar | ( | int | mouseX, |
| int | mouseY ) const |
Test whether the mouse is over the scrollbar thumb.
true if the cursor is inside the scrollbar rectangle. Definition at line 1389 of file console.cpp.
References scrollbarRect.
|
inline |
Definition at line 271 of file console.hpp.
References scrollDragging.
|
inline |
true if at least partially visible. Definition at line 260 of file console.hpp.
References alpha.
| void console::Console::keypress | ( | char | c | ) |
Handle a single character key press for the input line.
| c | Character received from SDL_TEXTINPUT or SDL_KEYDOWN. |
Definition at line 279 of file console.cpp.
References braceCount, console_mutex, inMultilineMode, inputBuffer, inputCursorPos, inputScrollOffset, multilineBuffer, needsRedraw, needsReflow, originalPrompt, procCmd(), process_message_queue(), promptText, scrollOffset, scrollToBottom(), THREAD_GUARD, thread_safe_print(), updateInputScrollOffset(), and userScrolling.
| void console::Console::load | ( | const std::string & | fnt, |
| int | size, | ||
| const SDL_Color & | col ) |
Load font and rebuild the glyph cache.
| fnt | Path to a TTF font file. |
| size | Point size. |
| col | Glyph render colour. |
Definition at line 163 of file console.cpp.
References c_chars, color, font, font_size, and scrollToBottom().
|
inline |
true if the glyph cache has been populated. Definition at line 266 of file console.hpp.
References c_chars, console_mutex, and THREAD_GUARD.
| void console::Console::moveCursorEnd | ( | ) |
Move caret to end of input line.
Definition at line 849 of file console.cpp.
References console_mutex, inputBuffer, inputCursorPos, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::moveCursorHome | ( | ) |
Move caret to start of input line.
Definition at line 843 of file console.cpp.
References console_mutex, inputCursorPos, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::moveCursorLeft | ( | ) |
Move caret one character to the left.
Definition at line 821 of file console.cpp.
References console_mutex, inputCursorPos, inputScrollOffset, needsRedraw, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::moveCursorRight | ( | ) |
Move caret one character to the right.
Definition at line 835 of file console.cpp.
References console_mutex, inputBuffer, inputCursorPos, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::moveHistoryDown | ( | ) |
Move forward through command history.
Definition at line 869 of file console.cpp.
References commandHistory, console_mutex, historyIndex, inputBuffer, inputCursorPos, inputScrollOffset, tempBuffer, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::moveHistoryUp | ( | ) |
Recall the previous command from history.
Definition at line 855 of file console.cpp.
References commandHistory, console_mutex, historyIndex, inputBuffer, inputCursorPos, inputScrollOffset, tempBuffer, THREAD_GUARD, and updateInputScrollOffset().
| void console::Console::print | ( | const std::string & | str | ) |
Append text to the output buffer.
| str | String to append (may contain newlines). |
Definition at line 205 of file console.cpp.
References console_mutex, cursorPos, data, needsRedraw, needsReflow, scrollToBottom(), and THREAD_GUARD.
| void console::Console::procCmd | ( | const std::string & | cmd | ) |
Tokenise and dispatch a command string.
| cmd | Raw command text (may include arguments). |
Definition at line 975 of file console.cpp.
References braceCount, callback, callbackEnter, callbackSet, checkScroll(), command_queue, commandHistory, enterCallbackSet, historyIndex, inMultilineMode, needsReflow, tempBuffer, console::tokenize(), updateCursorPosition(), and window.
Referenced by keypress().
| void console::Console::process_message_queue | ( | ) |
Process pending messages from the thread-safe print queue (call each frame).
Definition at line 952 of file console.cpp.
References console_mutex, data, message_queue, needsRedraw, needsReflow, scrollToBottom(), and THREAD_GUARD.
Referenced by keypress().
|
protected |
| void console::Console::reload | ( | ) |
Reload the glyph cache with the current font settings.
Definition at line 159 of file console.cpp.
References c_chars, color, font, and font_size.
Referenced by setTextAttrib().
| void console::Console::resetScroll | ( | ) |
Reset scroll to the bottom.
Definition at line 195 of file console.cpp.
References needsRedraw, scrollOffset, and userScrolling.
| void console::Console::scrollDown | ( | ) |
Scroll output down by one line.
Definition at line 186 of file console.cpp.
References console_mutex, needsRedraw, scrollOffset, THREAD_GUARD, and userScrolling.
Referenced by handleMouseScroll().
| void console::Console::scrollPageDown | ( | ) |
Scroll down by one page.
Definition at line 1382 of file console.cpp.
References console_mutex, needsRedraw, scrollOffset, THREAD_GUARD, and visibleLineCount.
| void console::Console::scrollPageUp | ( | ) |
Scroll up by one page.
Definition at line 1374 of file console.cpp.
References console_mutex, lines, needsRedraw, scrollOffset, THREAD_GUARD, and visibleLineCount.
| void console::Console::scrollToBottom | ( | ) |
Jump the scroll view to the most recent output.
Definition at line 810 of file console.cpp.
References checkScroll(), console_mutex, cursorPos, data, inputBuffer, inputCursorPos, needsRedraw, scrollOffset, THREAD_GUARD, updateCursorPosition(), and userScrolling.
Referenced by keypress(), load(), print(), and process_message_queue().
| void console::Console::scrollUp | ( | ) |
Scroll output up by one line.
Definition at line 175 of file console.cpp.
References console_mutex, lines, needsRedraw, scrollOffset, THREAD_GUARD, userScrolling, and visibleLineCount.
Referenced by handleMouseScroll().
| void console::Console::setCallback | ( | gl::GLWindow * | window, |
| std::function< bool(gl::GLWindow *win, const std::vector< std::string > &)> | callback ) |
Register a command callback invoked when the user presses Enter.
| window | Parent GL window. |
| callback | Handler receives tokenised arguments; return true to suppress default handling. |
Definition at line 214 of file console.cpp.
References callback, callbackSet, and window.
| void console::Console::setCursorPos | ( | size_t | pos | ) |
Move the caret to pos within the input line.
| void console::Console::setInputCallback | ( | std::function< int(gl::GLWindow *win, const std::string &)> | callback | ) |
Register a callback for raw input-line submission (Enter key).
| callback | Handler receives the raw input string; return value is unused. |
Definition at line 969 of file console.cpp.
References callback, callbackEnter, console_mutex, enterCallbackSet, and THREAD_GUARD.
| void console::Console::setPrompt | ( | const std::string & | text | ) |
| void console::Console::setText | ( | const std::string & | text | ) |
Replace the input-line text.
| void console::Console::setTextAttrib | ( | const int | size, |
| const SDL_Color & | col ) |
Change font size and colour without reloading the widget.
| size | New point size. |
| col | New colour. |
Definition at line 1071 of file console.cpp.
References color, console_mutex, font_size, reload(), and THREAD_GUARD.
| void console::Console::show | ( | ) |
Make the console fully visible immediately.
Definition at line 1063 of file console.cpp.
References startFadeIn().
| void console::Console::startFadeIn | ( | ) |
Begin a fade-in animation.
Definition at line 1042 of file console.cpp.
References alpha, console::FADE_IN, fadeStartTime, and fadeState.
Referenced by show().
| void console::Console::startFadeOut | ( | ) |
Begin a fade-out animation.
Definition at line 1058 of file console.cpp.
References console::FADE_OUT, fadeStartTime, and fadeState.
Referenced by hide().
| void console::Console::thread_safe_print | ( | const std::string & | str | ) |
Append text from any thread (uses the internal message queue).
| str | String to append. |
Definition at line 920 of file console.cpp.
References console_mutex, message_queue, needsRedraw, needsReflow, and THREAD_GUARD.
Referenced by keypress(), and worker_thread_func().
|
protected |
Definition at line 464 of file console.cpp.
References c_chars, console_mutex, console_rect, cursorPos, cursorX, cursorY, data, surface, and THREAD_GUARD.
Referenced by procCmd(), and scrollToBottom().
| void console::Console::updateInputScrollOffset | ( | ) |
Recalculate horizontal scroll for long input lines.
Definition at line 219 of file console.cpp.
References c_chars, console_rect, inputBuffer, inputCursorPos, inputScrollOffset, and promptText.
Referenced by keypress(), moveCursorEnd(), moveCursorHome(), moveCursorLeft(), moveCursorRight(), moveHistoryDown(), and moveHistoryUp().
| void console::Console::updateScrollDrag | ( | int | mouseY | ) |
Continue a scrollbar thumb drag.
Definition at line 1404 of file console.cpp.
References console_mutex, lines, needsRedraw, scrollbarRect, scrollDragging, scrollOffset, THREAD_GUARD, and visibleLineCount.
|
protected |
Definition at line 927 of file console.cpp.
References console::CommandQueue::Command::callback, command_queue, console::CommandQueue::Command::text, thread_safe_print(), window, and worker_active.
Referenced by Console().
|
friend |
|
protected |
Definition at line 354 of file console.hpp.
Referenced by drawText(), isVisible(), and startFadeIn().
|
protected |
Definition at line 365 of file console.hpp.
Referenced by Console(), keypress(), and procCmd().
|
protected |
Definition at line 330 of file console.hpp.
Referenced by calculateLines(), checkForLineWrap(), checkScroll(), clear(), drawText(), load(), loaded(), reload(), updateCursorPosition(), and updateInputScrollOffset().
|
protected |
Definition at line 348 of file console.hpp.
Referenced by procCmd(), setCallback(), setInputCallback(), and setPrompt().
|
protected |
Definition at line 349 of file console.hpp.
Referenced by procCmd(), and setInputCallback().
|
protected |
Definition at line 350 of file console.hpp.
Referenced by procCmd(), and setCallback().
|
protected |
Definition at line 334 of file console.hpp.
Referenced by load(), reload(), and setTextAttrib().
|
protected |
Definition at line 373 of file console.hpp.
Referenced by procCmd(), worker_thread_func(), and ~Console().
|
protected |
Definition at line 351 of file console.hpp.
Referenced by moveHistoryDown(), moveHistoryUp(), and procCmd().
|
mutableprotected |
Definition at line 328 of file console.hpp.
Referenced by beginScrollDrag(), calculateLines(), checkForLineWrap(), checkScroll(), clearText(), drawText(), endScrollDrag(), handleMouseScroll(), keypress(), loaded(), moveCursorEnd(), moveCursorHome(), moveCursorLeft(), moveCursorRight(), moveHistoryDown(), moveHistoryUp(), print(), process_message_queue(), scrollDown(), scrollPageDown(), scrollPageUp(), scrollToBottom(), scrollUp(), setInputCallback(), setTextAttrib(), thread_safe_print(), updateCursorPosition(), and updateScrollDrag().
|
protected |
Definition at line 338 of file console.hpp.
Referenced by calculateLines(), checkForLineWrap(), checkScroll(), create(), drawText(), getHeight(), getWidth(), updateCursorPosition(), and updateInputScrollOffset().
|
protected |
Definition at line 368 of file console.hpp.
| Uint32 console::Console::cursorBlinkTime = 0 |
SDL_GetTicks() value of the last cursor blink toggle.
Definition at line 253 of file console.hpp.
|
protected |
Definition at line 339 of file console.hpp.
Referenced by checkForLineWrap(), checkScroll(), print(), scrollToBottom(), and updateCursorPosition().
| bool console::Console::cursorVisible = true |
Whether the cursor is currently shown.
Definition at line 254 of file console.hpp.
Referenced by drawText().
|
protected |
Definition at line 342 of file console.hpp.
Referenced by updateCursorPosition().
|
protected |
Definition at line 343 of file console.hpp.
Referenced by updateCursorPosition().
|
protected |
Definition at line 335 of file console.hpp.
Referenced by bufferData(), calculateLines(), checkForLineWrap(), checkScroll(), clearText(), print(), process_message_queue(), scrollToBottom(), and updateCursorPosition().
|
protected |
Definition at line 376 of file console.hpp.
Referenced by procCmd(), and setInputCallback().
|
protected |
Definition at line 356 of file console.hpp.
Referenced by drawText().
|
protected |
Definition at line 355 of file console.hpp.
Referenced by drawText(), startFadeIn(), and startFadeOut().
Current fade animation state.
Definition at line 295 of file console.hpp.
Referenced by drawText(), isFading(), startFadeIn(), and startFadeOut().
|
protected |
Definition at line 332 of file console.hpp.
|
protected |
Definition at line 333 of file console.hpp.
Referenced by load(), reload(), and setTextAttrib().
|
protected |
Definition at line 352 of file console.hpp.
Referenced by moveHistoryDown(), moveHistoryUp(), and procCmd().
|
protected |
Definition at line 364 of file console.hpp.
Referenced by Console(), keypress(), and procCmd().
|
protected |
Definition at line 336 of file console.hpp.
| std::string console::Console::inputBuffer |
Current content of the input line (mirrors internal state).
Definition at line 292 of file console.hpp.
Referenced by drawText(), keypress(), moveCursorEnd(), moveCursorRight(), moveHistoryDown(), moveHistoryUp(), scrollToBottom(), and updateInputScrollOffset().
|
protected |
Definition at line 341 of file console.hpp.
Referenced by drawText(), keypress(), moveCursorEnd(), moveCursorHome(), moveCursorLeft(), moveCursorRight(), moveHistoryDown(), moveHistoryUp(), scrollToBottom(), and updateInputScrollOffset().
|
protected |
Definition at line 357 of file console.hpp.
Referenced by drawText(), keypress(), moveCursorLeft(), moveHistoryDown(), moveHistoryUp(), and updateInputScrollOffset().
|
protected |
Definition at line 363 of file console.hpp.
Referenced by calculateLines(), checkScroll(), clearText(), drawText(), scrollPageUp(), scrollUp(), and updateScrollDrag().
|
protected |
Definition at line 329 of file console.hpp.
Referenced by process_message_queue(), and thread_safe_print().
|
protected |
Definition at line 366 of file console.hpp.
Referenced by Console(), and keypress().
| bool console::Console::needsRedraw = true |
Set to trigger an SDL_Surface redraw.
Definition at line 293 of file console.hpp.
Referenced by clearText(), drawText(), keypress(), moveCursorLeft(), print(), process_message_queue(), resetScroll(), scrollDown(), scrollPageDown(), scrollPageUp(), scrollToBottom(), scrollUp(), thread_safe_print(), and updateScrollDrag().
| bool console::Console::needsReflow = true |
Set to trigger line-wrapping recalculation.
Definition at line 294 of file console.hpp.
Referenced by calculateLines(), checkScroll(), clearText(), drawText(), keypress(), print(), procCmd(), process_message_queue(), and thread_safe_print().
|
protected |
Definition at line 367 of file console.hpp.
Referenced by Console(), and keypress().
| std::string console::Console::promptText = "$ " |
Prompt string displayed before the input line.
Definition at line 252 of file console.hpp.
Referenced by drawText(), keypress(), and updateInputScrollOffset().
|
protected |
Definition at line 384 of file console.hpp.
Referenced by drawText(), isMouseOverScrollbar(), and updateScrollDrag().
|
protected |
Definition at line 381 of file console.hpp.
Referenced by beginScrollDrag(), endScrollDrag(), isScrollDragging(), and updateScrollDrag().
|
protected |
Definition at line 383 of file console.hpp.
Referenced by beginScrollDrag().
|
protected |
Definition at line 382 of file console.hpp.
Referenced by beginScrollDrag().
|
protected |
Definition at line 380 of file console.hpp.
Referenced by beginScrollDrag(), drawText(), keypress(), resetScroll(), scrollDown(), scrollPageDown(), scrollPageUp(), scrollToBottom(), scrollUp(), and updateScrollDrag().
|
protected |
Definition at line 344 of file console.hpp.
|
protected |
Definition at line 340 of file console.hpp.
|
protected |
Definition at line 337 of file console.hpp.
Referenced by calculateLines(), checkScroll(), create(), drawText(), updateCursorPosition(), and ~Console().
|
protected |
Definition at line 353 of file console.hpp.
Referenced by moveHistoryDown(), moveHistoryUp(), and procCmd().
|
protected |
Definition at line 331 of file console.hpp.
Referenced by keypress(), resetScroll(), scrollDown(), scrollToBottom(), and scrollUp().
| mx::mxUtil* console::Console::util |
Pointer to asset-path utilities (not owned).
Definition at line 165 of file console.hpp.
|
protected |
Definition at line 379 of file console.hpp.
Referenced by calculateLines(), drawText(), scrollPageDown(), scrollPageUp(), scrollUp(), and updateScrollDrag().
| gl::GLWindow* console::Console::window = nullptr |
Owning GL window (weak reference).
Definition at line 255 of file console.hpp.
Referenced by procCmd(), setCallback(), setPrompt(), and worker_thread_func().
|
protected |
Definition at line 374 of file console.hpp.
Referenced by Console(), worker_thread_func(), and ~Console().
|
protected |
Definition at line 372 of file console.hpp.
Referenced by Console(), and ~Console().