ttx 0.1.0
|
Represents the visible contents of the terminal (with no scroll back) More...
#include <ttx/terminal/screen.h>
Public Types | |
enum class | ScrollBackEnabled { No , Yes } |
enum class | BeginSelectionMode { Single , Word , Line } |
Public Member Functions | |
Screen (Size const &size, ScrollBackEnabled scroll_back_enabled) | |
void | resize (Size const &size) |
void | set_scroll_region (ScrollRegion const ®ion) |
auto | max_height () const -> u32 |
auto | max_width () const -> u32 |
auto | size () const -> Size const & |
auto | scroll_region () const -> ScrollRegion const & |
auto | current_graphics_rendition () const -> GraphicsRendition const & |
auto | current_hyperlink () const -> di::Optional< Hyperlink const & > |
void | set_current_graphics_rendition (GraphicsRendition const &rendition) |
void | set_current_hyperlink (di::Optional< Hyperlink const & > hyperlink) |
auto | cursor () const -> Cursor |
auto | origin_mode () const -> OriginMode |
auto | save_cursor () const -> SavedCursor |
void | restore_cursor (SavedCursor const &cursor) |
void | set_origin_mode (OriginMode mode) |
void | set_cursor_relative (u32 row, u32 col) |
void | set_cursor (u32 row, u32 col) |
void | set_cursor (u32 row, u32 col, bool overflow_pending) |
void | set_cursor_row_relative (u32 row) |
void | set_cursor_row (u32 row) |
void | set_cursor_col_relative (u32 col) |
void | set_cursor_col (u32 col) |
void | insert_blank_characters (u32 count) |
void | insert_blank_lines (u32 count) |
void | delete_characters (u32 count) |
void | delete_lines (u32 count) |
void | clear () |
void | clear_after_cursor () |
void | clear_before_cursor () |
void | clear_row () |
void | clear_row_after_cursor () |
void | clear_row_before_cursor () |
void | erase_characters (u32 n) |
void | scroll_down () |
void | put_code_point (c32 code_point, AutoWrapMode auto_wrap_mode) |
void | put_osc66 (OSC66 const &sized_text, AutoWrapMode auto_wrap_mode) |
void | invalidate_all () |
auto | whole_screen_dirty () const -> bool |
void | clear_whole_screen_dirty_flag () |
void | clear_damage_tracking () |
auto | absolute_row_start () const -> u64 |
auto | absolute_row_screen_start () const -> u64 |
auto | absolute_row_end () const -> u64 |
auto | total_rows () const -> usize |
void | clear_scroll_back () |
auto | visual_scroll_offset () const -> u64 |
auto | visual_scroll_at_bottom () const -> bool |
void | visual_scroll_up () |
void | visual_scroll_down () |
void | visual_scroll_to_bottom () |
auto | selection () const -> di::Optional< Selection > |
void | clear_selection () |
void | begin_selection (SelectionPoint const &point, BeginSelectionMode mode) |
void | update_selection (SelectionPoint const &point) |
auto | in_selection (SelectionPoint const &point) const -> bool |
auto | selected_text () const -> di::String |
auto | find_row (u64 row) const -> di::Tuple< u32, RowGroup const & > |
auto | iterate_row (u64 row) const |
auto | state_as_escape_sequences () const -> di::String |
Serialize screen contents to terminal escape sequences. | |
void | put_cell (di::StringView text, MultiCellInfo const &multi_cell_info, AutoWrapMode auto_wrap_mode, bool explicitly_sized, bool complex_grapheme_cluster) |
Represents the visible contents of the terminal (with no scroll back)
The screen class internally maintains a vector of terminal rows, as well as the graphics rendition, hyperlink, and multi cell info indirectly referenced by the Cell class.
When the screen scrolls due to autowrapping, and scroll back is enabled, scrolled rows will be moved to the internal scroll back object.
|
strong |
|
strong |
|
explicit |
|
inline |
|
inline |
|
inline |
void ttx::terminal::Screen::begin_selection | ( | SelectionPoint const & | point, |
BeginSelectionMode | mode ) |
void ttx::terminal::Screen::clear | ( | ) |
void ttx::terminal::Screen::clear_after_cursor | ( | ) |
void ttx::terminal::Screen::clear_before_cursor | ( | ) |
void ttx::terminal::Screen::clear_damage_tracking | ( | ) |
void ttx::terminal::Screen::clear_row | ( | ) |
void ttx::terminal::Screen::clear_row_after_cursor | ( | ) |
void ttx::terminal::Screen::clear_row_before_cursor | ( | ) |
void ttx::terminal::Screen::clear_scroll_back | ( | ) |
void ttx::terminal::Screen::clear_selection | ( | ) |
|
inline |
auto ttx::terminal::Screen::current_graphics_rendition | ( | ) | const -> GraphicsRendition const& |
auto ttx::terminal::Screen::current_hyperlink | ( | ) | const -> di::Optional<Hyperlink const&> |
|
inline |
void ttx::terminal::Screen::delete_characters | ( | u32 | count | ) |
void ttx::terminal::Screen::delete_lines | ( | u32 | count | ) |
void ttx::terminal::Screen::erase_characters | ( | u32 | n | ) |
auto ttx::terminal::Screen::find_row | ( | u64 | row | ) | const -> di::Tuple<u32, RowGroup const&> |
auto ttx::terminal::Screen::in_selection | ( | SelectionPoint const & | point | ) | const -> bool |
void ttx::terminal::Screen::insert_blank_characters | ( | u32 | count | ) |
void ttx::terminal::Screen::insert_blank_lines | ( | u32 | count | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void ttx::terminal::Screen::put_cell | ( | di::StringView | text, |
MultiCellInfo const & | multi_cell_info, | ||
AutoWrapMode | auto_wrap_mode, | ||
bool | explicitly_sized, | ||
bool | complex_grapheme_cluster ) |
void ttx::terminal::Screen::put_code_point | ( | c32 | code_point, |
AutoWrapMode | auto_wrap_mode ) |
void ttx::terminal::Screen::put_osc66 | ( | OSC66 const & | sized_text, |
AutoWrapMode | auto_wrap_mode ) |
void ttx::terminal::Screen::resize | ( | Size const & | size | ) |
void ttx::terminal::Screen::restore_cursor | ( | SavedCursor const & | cursor | ) |
auto ttx::terminal::Screen::save_cursor | ( | ) | const -> SavedCursor |
void ttx::terminal::Screen::scroll_down | ( | ) |
|
inline |
auto ttx::terminal::Screen::selected_text | ( | ) | const -> di::String |
|
inline |
void ttx::terminal::Screen::set_current_graphics_rendition | ( | GraphicsRendition const & | rendition | ) |
void ttx::terminal::Screen::set_current_hyperlink | ( | di::Optional< Hyperlink const & > | hyperlink | ) |
void ttx::terminal::Screen::set_cursor | ( | u32 | row, |
u32 | col ) |
void ttx::terminal::Screen::set_cursor | ( | u32 | row, |
u32 | col, | ||
bool | overflow_pending ) |
void ttx::terminal::Screen::set_cursor_col | ( | u32 | col | ) |
void ttx::terminal::Screen::set_cursor_col_relative | ( | u32 | col | ) |
void ttx::terminal::Screen::set_cursor_relative | ( | u32 | row, |
u32 | col ) |
void ttx::terminal::Screen::set_cursor_row | ( | u32 | row | ) |
void ttx::terminal::Screen::set_cursor_row_relative | ( | u32 | row | ) |
void ttx::terminal::Screen::set_origin_mode | ( | OriginMode | mode | ) |
void ttx::terminal::Screen::set_scroll_region | ( | ScrollRegion const & | region | ) |
|
inline |
auto ttx::terminal::Screen::state_as_escape_sequences | ( | ) | const -> di::String |
Serialize screen contents to terminal escape sequences.
This function does not preserve attributes like the visual scroll offset and current selection. Additionally, the terminal size is not embedded in the returned escape sequences. The Terminal::state_as_escape_sequences() includes a superset of information, including the size and dec modes.
|
inline |
void ttx::terminal::Screen::update_selection | ( | SelectionPoint const & | point | ) |
|
inline |
void ttx::terminal::Screen::visual_scroll_down | ( | ) |
|
inline |
void ttx::terminal::Screen::visual_scroll_to_bottom | ( | ) |
void ttx::terminal::Screen::visual_scroll_up | ( | ) |
|
inline |