ttx 0.1.0
Loading...
Searching...
No Matches
ttx::terminal::Screen Class Reference

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 &region)
 
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)
 

Detailed Description

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.

Member Enumeration Documentation

◆ BeginSelectionMode

Enumerator
Single 
Word 
Line 

◆ ScrollBackEnabled

Enumerator
No 
Yes 

Constructor & Destructor Documentation

◆ Screen()

ttx::terminal::Screen::Screen ( Size const & size,
ScrollBackEnabled scroll_back_enabled )
explicit

Member Function Documentation

◆ absolute_row_end()

auto ttx::terminal::Screen::absolute_row_end ( ) const -> u64
inline

◆ absolute_row_screen_start()

auto ttx::terminal::Screen::absolute_row_screen_start ( ) const -> u64
inline

◆ absolute_row_start()

auto ttx::terminal::Screen::absolute_row_start ( ) const -> u64
inline

◆ begin_selection()

void ttx::terminal::Screen::begin_selection ( SelectionPoint const & point,
BeginSelectionMode mode )

◆ clear()

void ttx::terminal::Screen::clear ( )

◆ clear_after_cursor()

void ttx::terminal::Screen::clear_after_cursor ( )

◆ clear_before_cursor()

void ttx::terminal::Screen::clear_before_cursor ( )

◆ clear_damage_tracking()

void ttx::terminal::Screen::clear_damage_tracking ( )

◆ clear_row()

void ttx::terminal::Screen::clear_row ( )

◆ clear_row_after_cursor()

void ttx::terminal::Screen::clear_row_after_cursor ( )

◆ clear_row_before_cursor()

void ttx::terminal::Screen::clear_row_before_cursor ( )

◆ clear_scroll_back()

void ttx::terminal::Screen::clear_scroll_back ( )

◆ clear_selection()

void ttx::terminal::Screen::clear_selection ( )

◆ clear_whole_screen_dirty_flag()

void ttx::terminal::Screen::clear_whole_screen_dirty_flag ( )
inline

◆ current_graphics_rendition()

auto ttx::terminal::Screen::current_graphics_rendition ( ) const -> GraphicsRendition const&

◆ current_hyperlink()

auto ttx::terminal::Screen::current_hyperlink ( ) const -> di::Optional<Hyperlink const&>

◆ cursor()

auto ttx::terminal::Screen::cursor ( ) const -> Cursor
inline

◆ delete_characters()

void ttx::terminal::Screen::delete_characters ( u32 count)

◆ delete_lines()

void ttx::terminal::Screen::delete_lines ( u32 count)

◆ erase_characters()

void ttx::terminal::Screen::erase_characters ( u32 n)

◆ find_row()

auto ttx::terminal::Screen::find_row ( u64 row) const -> di::Tuple<u32, RowGroup const&>

◆ in_selection()

auto ttx::terminal::Screen::in_selection ( SelectionPoint const & point) const -> bool

◆ insert_blank_characters()

void ttx::terminal::Screen::insert_blank_characters ( u32 count)

◆ insert_blank_lines()

void ttx::terminal::Screen::insert_blank_lines ( u32 count)

◆ invalidate_all()

void ttx::terminal::Screen::invalidate_all ( )
inline

◆ iterate_row()

auto ttx::terminal::Screen::iterate_row ( u64 row) const
inline

◆ max_height()

auto ttx::terminal::Screen::max_height ( ) const -> u32
inline

◆ max_width()

auto ttx::terminal::Screen::max_width ( ) const -> u32
inline

◆ origin_mode()

auto ttx::terminal::Screen::origin_mode ( ) const -> OriginMode
inline

◆ put_cell()

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 )

◆ put_code_point()

void ttx::terminal::Screen::put_code_point ( c32 code_point,
AutoWrapMode auto_wrap_mode )

◆ put_osc66()

void ttx::terminal::Screen::put_osc66 ( OSC66 const & sized_text,
AutoWrapMode auto_wrap_mode )

◆ resize()

void ttx::terminal::Screen::resize ( Size const & size)

◆ restore_cursor()

void ttx::terminal::Screen::restore_cursor ( SavedCursor const & cursor)

◆ save_cursor()

auto ttx::terminal::Screen::save_cursor ( ) const -> SavedCursor

◆ scroll_down()

void ttx::terminal::Screen::scroll_down ( )

◆ scroll_region()

auto ttx::terminal::Screen::scroll_region ( ) const -> ScrollRegion const&
inline

◆ selected_text()

auto ttx::terminal::Screen::selected_text ( ) const -> di::String

◆ selection()

auto ttx::terminal::Screen::selection ( ) const -> di::Optional<Selection>
inline

◆ set_current_graphics_rendition()

void ttx::terminal::Screen::set_current_graphics_rendition ( GraphicsRendition const & rendition)

◆ set_current_hyperlink()

void ttx::terminal::Screen::set_current_hyperlink ( di::Optional< Hyperlink const & > hyperlink)

◆ set_cursor() [1/2]

void ttx::terminal::Screen::set_cursor ( u32 row,
u32 col )

◆ set_cursor() [2/2]

void ttx::terminal::Screen::set_cursor ( u32 row,
u32 col,
bool overflow_pending )

◆ set_cursor_col()

void ttx::terminal::Screen::set_cursor_col ( u32 col)

◆ set_cursor_col_relative()

void ttx::terminal::Screen::set_cursor_col_relative ( u32 col)

◆ set_cursor_relative()

void ttx::terminal::Screen::set_cursor_relative ( u32 row,
u32 col )

◆ set_cursor_row()

void ttx::terminal::Screen::set_cursor_row ( u32 row)

◆ set_cursor_row_relative()

void ttx::terminal::Screen::set_cursor_row_relative ( u32 row)

◆ set_origin_mode()

void ttx::terminal::Screen::set_origin_mode ( OriginMode mode)

◆ set_scroll_region()

void ttx::terminal::Screen::set_scroll_region ( ScrollRegion const & region)

◆ size()

auto ttx::terminal::Screen::size ( ) const -> Size const&
inline

◆ state_as_escape_sequences()

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.

◆ total_rows()

auto ttx::terminal::Screen::total_rows ( ) const -> usize
inline

◆ update_selection()

void ttx::terminal::Screen::update_selection ( SelectionPoint const & point)

◆ visual_scroll_at_bottom()

auto ttx::terminal::Screen::visual_scroll_at_bottom ( ) const -> bool
inline

◆ visual_scroll_down()

void ttx::terminal::Screen::visual_scroll_down ( )

◆ visual_scroll_offset()

auto ttx::terminal::Screen::visual_scroll_offset ( ) const -> u64
inline

◆ visual_scroll_to_bottom()

void ttx::terminal::Screen::visual_scroll_to_bottom ( )

◆ visual_scroll_up()

void ttx::terminal::Screen::visual_scroll_up ( )

◆ whole_screen_dirty()

auto ttx::terminal::Screen::whole_screen_dirty ( ) const -> bool
inline

The documentation for this class was generated from the following files: