17 #ifndef HEADER_SUPERTUX_SUPERTUX_CONSOLE_HPP 18 #define HEADER_SUPERTUX_SUPERTUX_CONSOLE_HPP 24 #include <simplesquirrel/vm.hpp> 26 #include "util/currenton.hpp" 27 #include "video/font_ptr.hpp" 28 #include "video/surface_ptr.hpp" 48 void addLine(
const std::string& s);
52 void set_console(
Console* console);
65 void on_buffer_change(
int line_count);
71 void scroll(
int offset);
73 void show_history(
int offset);
74 void move_cursor(
int offset);
77 void update(
float dt_sec);
84 bool hasFocus()
const;
89 std::string m_inputBuffer;
90 int m_inputBufferPosition;
92 std::list<std::string> m_history;
93 std::list<std::string>::iterator m_history_position;
95 SurfacePtr m_background;
96 SurfacePtr m_background2;
100 int m_backgroundOffset;
109 void parse(
const std::string& s);
115 void execute_script(
const std::string& s);
117 bool consoleCommand(
const std::string& command,
const std::vector<std::string>& arguments);
127 virtual int sync()
override 129 int result = std::stringbuf::sync();
130 if (ConsoleBuffer::current())
131 ConsoleBuffer::current()->
flush(*
this);
Definition: console.hpp:124
Definition: console.hpp:59
std::list< std::string > m_lines
backbuffer of lines sent to the console.
Definition: console.hpp:41
static ConsoleStreamBuffer s_outputBuffer
stream buffer used by output stream
Definition: console.hpp:38
void addLine(const std::string &s)
display a line in the console
Definition: console.cpp:60
void addLines(const std::string &s)
display a string of (potentially) multiple lines in the console
Definition: console.cpp:49
A 'Currenton' allows access to the currently active instance of a class via the static current() func...
Definition: currenton.hpp:30
void flush(ConsoleStreamBuffer &buffer)
act upon changes in a ConsoleStreamBuffer
Definition: console.cpp:89
static std::ostream output
stream of characters to output to the console.
Definition: console.hpp:37
Definition: console.hpp:34
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42