1 #ifndef TERMOX_TERMINAL_TERMINAL_HPP
2 #define TERMOX_TERMINAL_TERMINAL_HPP
5 #include <signals_light/signal.hpp>
7 #include <termox/painter/color.hpp>
8 #include <termox/painter/glyph.hpp>
9 #include <termox/system/event_fwd.hpp>
10 #include <termox/terminal/detail/screen_buffers.hpp>
11 #include <termox/terminal/dynamic_color_engine.hpp>
12 #include <termox/terminal/key_mode.hpp>
13 #include <termox/terminal/mouse_mode.hpp>
14 #include <termox/terminal/signals.hpp>
15 #include <termox/widget/area.hpp>
21 inline static sl::Signal<void(Palette
const&)> palette_changed;
51 static void initialize(Mouse_mode mouse_mode = Mouse_mode::Basic,
52 Key_mode key_mode = Key_mode::Normal,
53 Signals signals = Signals::On);
60 [[nodiscard]]
static auto area() -> Area;
95 [[nodiscard]]
static auto color_count() -> std::uint16_t;
103 [[nodiscard]]
static auto read_input() -> Event;
121 inline static Palette palette_;
123 inline static bool is_initialized_ =
false;
124 inline static bool full_repaint_ =
false;
125 inline static bool handle_sigint_ =
true;
Color numbers [0 - 180] are valid.
Definition: color.hpp:16
Event loop that manages posting of Dynamic_color_events.
Definition: dynamic_color_engine.hpp:15
Definition: terminal.hpp:19
static void repaint_color(Color c)
Repaints all Glyphs with c in their Brush to the screen.
Definition: terminal.cpp:226
static auto palette_append(Color_definition::Value_t value) -> Color
Append a Color_definition::Value_t to the current color palette.
Definition: terminal.cpp:251
static auto read_input() -> Event
Wait for user input, and return with a corresponding Event.
Definition: terminal.cpp:286
static void show_cursor(bool show=true)
Set whether or not the cursor is visible on screen.
Definition: terminal.cpp:267
static void flag_full_repaint()
Sets a flag so that the next call to refresh() will repaint every cell.
Definition: terminal.cpp:292
static void refresh()
Update the screen to reflect change made by Painter since last call.
Definition: terminal.cpp:207
static auto area() -> Area
Return the Area of the terminal screen.
Definition: terminal.cpp:205
static auto color_count() -> std::uint16_t
Return the number of colors in the terminal's built in palette.
Definition: terminal.cpp:279
static void flush_screen()
Flushes all of the staged changes to the screen and sets the cursor.
Definition: terminal.cpp:294
static void initialize(Mouse_mode mouse_mode=Mouse_mode::Basic, Key_mode key_mode=Key_mode::Normal, Signals signals=Signals::On)
Initializes the terminal screen into curses mode.
Definition: terminal.cpp:183
static void stop_dynamic_color_engine()
Send exit flag and wait for Dynamic_color_engine thread to shutdown.
Definition: terminal.cpp:306
static void uninitialize()
Reset the terminal to its state before initialize() was called.
Definition: terminal.cpp:197
static void set_palette(Palette colors)
Change Color definitions.
Definition: terminal.cpp:232
static auto current_palette() -> Palette const &
Return a copy of the currently set color palette.
Definition: terminal.cpp:265
static void move_cursor(Point point)
Moves the cursor to Point point on screen.
Definition: terminal.cpp:273
static void update_color_stores(Color c, True_color tc)
Update a Color Palette value.
Definition: terminal.cpp:220
static void handle_signint(bool x)
If set true, will properly uninitialize the screen on SIGINT.
Definition: terminal.cpp:308
static auto has_true_color() -> bool
Return true if this terminal supports true color.
Definition: terminal.cpp:284
Holds the current and next screen buffers as Canvas objects.
Definition: screen_buffers.hpp:11