17 #ifndef HEADER_SUPERTUX_SUPERTUX_CONSOLE_HPP 18 #define HEADER_SUPERTUX_SUPERTUX_CONSOLE_HPP 25 #include "util/currenton.hpp" 26 #include "video/font_ptr.hpp" 27 #include "video/surface_ptr.hpp" 47 void addLine(
const std::string& s);
51 void set_console(
Console* console);
64 void on_buffer_change(
int line_count);
70 void scroll(
int offset);
72 void show_history(
int offset);
73 void move_cursor(
int offset);
76 void update(
float dt_sec);
83 bool hasFocus()
const;
88 std::string m_inputBuffer;
89 int m_inputBufferPosition;
91 std::list<std::string> m_history;
92 std::list<std::string>::iterator m_history_position;
94 SurfacePtr m_background;
95 SurfacePtr m_background2;
98 HSQOBJECT m_vm_object;
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:58
std::list< std::string > m_lines
backbuffer of lines sent to the console.
Definition: console.hpp:40
static ConsoleStreamBuffer s_outputBuffer
stream buffer used by output stream
Definition: console.hpp:37
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:36
Definition: console.hpp:33
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42