ftxui::ScreenInteractive
Screen
screen_interactive.hpp
ftxui::ScreenInteractive::SelectionData
ftxui::ScreenInteractive::Private
Dimension
ftxui::ScreenInteractive::Dimension
FitComponent
Fixed
Fullscreen
TerminalOutput
ScreenInteractive * ScreenInteractive* suspended_screen_ suspended_screen_ ftxui::ScreenInteractive::suspended_screen_ = nullptr
Dimension Dimension dimension_ dimension_ ftxui::ScreenInteractive::dimension_ = Dimension::Fixed
bool bool use_alternative_screen_ use_alternative_screen_ ftxui::ScreenInteractive::use_alternative_screen_ = false
bool bool track_mouse_ track_mouse_ ftxui::ScreenInteractive::track_mouse_ = true
Sender< Task > Sender<Task> task_sender_ task_sender_ ftxui::ScreenInteractive::task_sender_
Receiver< Task > Receiver<Task> task_receiver_ task_receiver_ ftxui::ScreenInteractive::task_receiver_
std::string std::string set_cursor_position set_cursor_position ftxui::ScreenInteractive::set_cursor_position
std::string std::string reset_cursor_position reset_cursor_position ftxui::ScreenInteractive::reset_cursor_position
std::atomic< bool > std::atomic<bool> quit_ quit_ ftxui::ScreenInteractive::quit_ {false}
std::thread std::thread event_listener_ event_listener_ ftxui::ScreenInteractive::event_listener_
std::thread std::thread animation_listener_ animation_listener_ ftxui::ScreenInteractive::animation_listener_
bool bool animation_requested_ animation_requested_ ftxui::ScreenInteractive::animation_requested_ = false
animation::TimePoint animation::TimePoint previous_animation_time_ previous_animation_time_ ftxui::ScreenInteractive::previous_animation_time_
int int cursor_x_ cursor_x_ ftxui::ScreenInteractive::cursor_x_ = 1
int int cursor_y_ cursor_y_ ftxui::ScreenInteractive::cursor_y_ = 1
bool bool mouse_captured mouse_captured ftxui::ScreenInteractive::mouse_captured = false
bool bool previous_frame_resized_ previous_frame_resized_ ftxui::ScreenInteractive::previous_frame_resized_ = false
bool bool frame_valid_ frame_valid_ ftxui::ScreenInteractive::frame_valid_ = false
bool bool force_handle_ctrl_c_ force_handle_ctrl_c_ ftxui::ScreenInteractive::force_handle_ctrl_c_ = true
bool bool force_handle_ctrl_z_ force_handle_ctrl_z_ ftxui::ScreenInteractive::force_handle_ctrl_z_ = true
int int cursor_reset_shape_ cursor_reset_shape_ ftxui::ScreenInteractive::cursor_reset_shape_ = 1
CapturedMouse CapturedMouse selection_pending_ selection_pending_ ftxui::ScreenInteractive::selection_pending_
SelectionData SelectionData selection_data_ selection_data_ ftxui::ScreenInteractive::selection_data_
SelectionData SelectionData selection_data_previous_ selection_data_previous_ ftxui::ScreenInteractive::selection_data_previous_
std::unique_ptr< Selection > std::unique_ptr<Selection> selection_ selection_ ftxui::ScreenInteractive::selection_
std::function< void()> std::function<void()> selection_on_change_ selection_on_change_ ftxui::ScreenInteractive::selection_on_change_
class friend class Loop Loop ftxui::ScreenInteractive::Loop Loop
friend friend Private Private ftxui::ScreenInteractive::Private
Box Box stencil stencil ftxui::Image::stencil
ScreenInteractive ScreenInteractive FixedSize (int dimx, int dimy) FixedSize ftxui::ScreenInteractive::FixedSize int dimx int dimy
ScreenInteractive ScreenInteractive Fullscreen () Fullscreen ftxui::ScreenInteractive::Fullscreen

Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.

This is the same as `ScreenInteractive::FullscreenAlternateScreen()`

ScreenInteractive ScreenInteractive FullscreenPrimaryScreen () FullscreenPrimaryScreen ftxui::ScreenInteractive::FullscreenPrimaryScreen

Create a ScreenInteractive taking the full terminal size. The primary screen buffer is being used. It means if the terminal is resized, the previous content might mess up with the terminal content.

ScreenInteractive ScreenInteractive FullscreenAlternateScreen () FullscreenAlternateScreen ftxui::ScreenInteractive::FullscreenAlternateScreen

Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.

ScreenInteractive ScreenInteractive FitComponent () FitComponent ftxui::ScreenInteractive::FitComponent
ScreenInteractive ScreenInteractive TerminalOutput () TerminalOutput ftxui::ScreenInteractive::TerminalOutput
ScreenInteractive * ScreenInteractive * Active () Active ftxui::ScreenInteractive::Active

Return the currently active screen, or null if none.

Screen Screen Create (Dimensions dimension) Create ftxui::Screen::Create Dimensions dimension

Create a screen with the given dimension.

Screen Screen Create (Dimensions width, Dimensions height) Create ftxui::Screen::Create Dimensions width Dimensions height

Create a screen with the given dimension along the x-axis and y-axis.

void void TrackMouse (bool enable=true) TrackMouse ftxui::ScreenInteractive::TrackMouse bool enable true

Set whether mouse is tracked and events reported. called outside of the main loop. E.g `ScreenInteractive::Loop(...)`.

enable

Whether to enable mouse event tracking.

This muse be called outside of the main loop. E.g. before calling `ScreenInteractive::Loop`.

Mouse tracking is enabled by default.

Mouse tracking is only supported on terminals that supports it.

### Example

    autoscreen=ScreenInteractive::TerminalOutput();
    screen.TrackMouse(false);
    screen.Loop(component);

void void Loop (Component) Loop ftxui::ScreenInteractive::Loop Component component

Execute the main loop.

component

The component to draw.

void void Exit () Exit ftxui::ScreenInteractive::Exit

Exit the main loop.

Closure Closure ExitLoopClosure () ExitLoopClosure ftxui::ScreenInteractive::ExitLoopClosure

Return a function to exit the main loop.

void void Post (Task task) Post ftxui::ScreenInteractive::Post Task task

Add a task to the main loop. It will be executed later, after every other scheduled tasks.

void void PostEvent (Event event) PostEvent ftxui::ScreenInteractive::PostEvent Event event

Add an event to the main loop. It will be executed later, after every other scheduled events.

void void RequestAnimationFrame () RequestAnimationFrame ftxui::ScreenInteractive::RequestAnimationFrame

Add a task to draw the screen one more time, until all the animations are done.

CapturedMouse CapturedMouse CaptureMouse () CaptureMouse ftxui::ScreenInteractive::CaptureMouse

Try to get the unique lock about behing able to capture the mouse.

A unique lock if the mouse is not already captured, otherwise a null.

Closure Closure WithRestoredIO (Closure) WithRestoredIO ftxui::ScreenInteractive::WithRestoredIO Closure fn

Decorate a function. It executes the same way, but with the currently active screen terminal hooks temporarilly uninstalled during its execution.

fn

The function to decorate.

void void ForceHandleCtrlC (bool force) ForceHandleCtrlC ftxui::ScreenInteractive::ForceHandleCtrlC bool force

Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.

void void ForceHandleCtrlZ (bool force) ForceHandleCtrlZ ftxui::ScreenInteractive::ForceHandleCtrlZ bool force

Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.

std::string std::string GetSelection () GetSelection ftxui::ScreenInteractive::GetSelection

Returns the content of the current selection.

void void SelectionChange (std::function< void()> callback) SelectionChange ftxui::ScreenInteractive::SelectionChange std::function< void()> callback
std::string std::string ToString () const ToString ftxui::Screen::ToString

Produce a std::string that can be used to print the Screen on the terminal.

Don't forget to flush stdout. Alternatively, you can use Screen::Print();

void void Print () const Print ftxui::Screen::Print
void void Clear () Clear ftxui::Screen::Clear

Clear all the pixel from the screen.

std::string std::string ResetPosition (bool clear=false) const ResetPosition ftxui::Screen::ResetPosition bool clear false

Return a string to be printed in order to reset the cursor position to the beginning of the screen.

    std::stringreset_position;
    while(true){
    autodocument=render();
    autoscreen=Screen::Create(Dimension::Full(),Dimension::Fit(document));
    Render(screen,document);
    std::cout<<reset_position<<screen.ToString()<<std::flush;
    reset_position=screen.ResetPosition();

    usingnamespacestd::chrono_literals;
    std::this_thread::sleep_for(0.01s);
    }

The string to print in order to reset the cursor position to the beginning.

void void ApplyShader () ApplyShader ftxui::Screen::ApplyShader
Cursor Cursor cursor () const cursor ftxui::Screen::cursor
void void SetCursor (Cursor cursor) SetCursor ftxui::Screen::SetCursor Cursor cursor
uint8_t std::uint8_t RegisterHyperlink (const std::string &link) RegisterHyperlink ftxui::Screen::RegisterHyperlink const std::string & link
const std::string & const std::string & Hyperlink (uint8_t id) const Hyperlink ftxui::Screen::Hyperlink uint8_t id
const SelectionStyle & const Screen::SelectionStyle & GetSelectionStyle () const GetSelectionStyle ftxui::Screen::GetSelectionStyle

Return the current selection style.

SetSelectionStyle

void void SetSelectionStyle (SelectionStyle decorator) SetSelectionStyle ftxui::Screen::SetSelectionStyle SelectionStyle decorator

Set the current selection style.

GetSelectionStyle

std::string & std::string & at (int x, int y) at ftxui::Image::at int x int y

Access a character in a cell at a given position.

x

The cell position along the x-axis.

y

The cell position along the y-axis.

const std::string & const std::string & at (int x, int y) const at ftxui::Image::at int x int y

Access a character in a cell at a given position.

x

The cell position along the x-axis.

y

The cell position along the y-axis.

Pixel & Pixel & PixelAt (int x, int y) PixelAt ftxui::Image::PixelAt int x int y

Access a cell (Pixel) at a given position.

x

The cell position along the x-axis.

y

The cell position along the y-axis.

const Pixel & const Pixel & PixelAt (int x, int y) const PixelAt ftxui::Image::PixelAt int x int y

Access a cell (Pixel) at a given position.

x

The cell position along the x-axis.

y

The cell position along the y-axis.

int int dimx () const dimx ftxui::Image::dimx
int int dimy () const dimy ftxui::Image::dimy
void void ExitNow () ExitNow ftxui::ScreenInteractive::ExitNow
void void Install () Install ftxui::ScreenInteractive::Install
void void Uninstall () Uninstall ftxui::ScreenInteractive::Uninstall
void void PreMain () PreMain ftxui::ScreenInteractive::PreMain
void void PostMain () PostMain ftxui::ScreenInteractive::PostMain
bool bool HasQuitted () HasQuitted ftxui::ScreenInteractive::HasQuitted

Return whether the main loop has been quit.

void void RunOnce (Component component) RunOnce ftxui::ScreenInteractive::RunOnce Component component
void void RunOnceBlocking (Component component) RunOnceBlocking ftxui::ScreenInteractive::RunOnceBlocking Component component
void void HandleTask (Component component, Task &task) HandleTask ftxui::ScreenInteractive::HandleTask Component component Task & task
bool bool HandleSelection (bool handled, Event event) HandleSelection ftxui::ScreenInteractive::HandleSelection bool handled Event event
void void RefreshSelection () RefreshSelection ftxui::ScreenInteractive::RefreshSelection
void void Draw (Component component) Draw ftxui::ScreenInteractive::Draw Component component
void void ResetCursorPosition () ResetCursorPosition ftxui::ScreenInteractive::ResetCursorPosition
void void Signal (int signal) Signal ftxui::ScreenInteractive::Signal int signal
ScreenInteractive
(int dimx, int dimy, Dimension dimension, bool use_alternative_screen)
ScreenInteractive
ftxui::ScreenInteractive::ScreenInteractive
int dimx
int dimy
Dimension dimension
bool use_alternative_screen
std::function< void(Pixel &)> using SelectionStyle = std::function<void(Pixel&)> SelectionStyle ftxui::Screen::SelectionStyle
Cursor Cursor cursor_ cursor_ ftxui::Screen::cursor_
std::vector< std::string > std::vector<std::string> hyperlinks_ hyperlinks_ ftxui::Screen::hyperlinks_ = {""}
SelectionStyle SelectionStyle selection_style_ selection_style_ ftxui::Screen::selection_style_ = [](Pixel& pixel) { pixel.inverted ^= true; }
int int dimx_ dimx_ ftxui::Image::dimx_
int int dimy_ dimy_ ftxui::Image::dimy_
std::vector< std::vector< Pixel > > std::vector<std::vector<Pixel> > pixels_ pixels_ ftxui::Image::pixels_
ScreenInteractive
Image
Screen
ScreenInteractive
Box
Image
stencil
Screen
cursor_
Cursor
- ftxui::ScreenInteractive
  Active
- ftxui::ScreenInteractive
  animation_listener_
- ftxui::ScreenInteractive
  animation_requested_
- ftxui::ScreenInteractive
  ApplyShader
- ftxui::ScreenInteractive
  at
- ftxui::ScreenInteractive
  at
- ftxui::ScreenInteractive
  CaptureMouse
- ftxui::ScreenInteractive
  Clear
- ftxui::ScreenInteractive
  Create
- ftxui::ScreenInteractive
  Create
- ftxui::ScreenInteractive
  cursor
- ftxui::ScreenInteractive
  cursor_
- ftxui::ScreenInteractive
  cursor_reset_shape_
- ftxui::ScreenInteractive
  cursor_x_
- ftxui::ScreenInteractive
  cursor_y_
- ftxui::ScreenInteractive
  Dimension
- ftxui::ScreenInteractive
  dimension_
- ftxui::ScreenInteractive
  dimx
- ftxui::ScreenInteractive
  dimx_
- ftxui::ScreenInteractive
  dimy
- ftxui::ScreenInteractive
  dimy_
- ftxui::ScreenInteractive
  Draw
- ftxui::ScreenInteractive
  event_listener_
- ftxui::ScreenInteractive
  Exit
- ftxui::ScreenInteractive
  ExitLoopClosure
- ftxui::ScreenInteractive
  ExitNow
- ftxui::ScreenInteractive
  FitComponent
- ftxui::ScreenInteractive
  FixedSize
- ftxui::ScreenInteractive
  force_handle_ctrl_c_
- ftxui::ScreenInteractive
  force_handle_ctrl_z_
- ftxui::ScreenInteractive
  ForceHandleCtrlC
- ftxui::ScreenInteractive
  ForceHandleCtrlZ
- ftxui::ScreenInteractive
  frame_valid_
- ftxui::ScreenInteractive
  Fullscreen
- ftxui::ScreenInteractive
  FullscreenAlternateScreen
- ftxui::ScreenInteractive
  FullscreenPrimaryScreen
- ftxui::ScreenInteractive
  GetSelection
- ftxui::ScreenInteractive
  GetSelectionStyle
- ftxui::ScreenInteractive
  HandleSelection
- ftxui::ScreenInteractive
  HandleTask
- ftxui::ScreenInteractive
  HasQuitted
- ftxui::ScreenInteractive
  Hyperlink
- ftxui::ScreenInteractive
  hyperlinks_
- ftxui::ScreenInteractive
  Image
- ftxui::ScreenInteractive
  Image
- ftxui::ScreenInteractive
  Install
- ftxui::ScreenInteractive
  Loop
- ftxui::ScreenInteractive
  mouse_captured
- ftxui::ScreenInteractive
  PixelAt
- ftxui::ScreenInteractive
  PixelAt
- ftxui::ScreenInteractive
  pixels_
- ftxui::ScreenInteractive
  Post
- ftxui::ScreenInteractive
  PostEvent
- ftxui::ScreenInteractive
  PostMain
- ftxui::ScreenInteractive
  PreMain
- ftxui::ScreenInteractive
  previous_animation_time_
- ftxui::ScreenInteractive
  previous_frame_resized_
- ftxui::ScreenInteractive
  Print
- ftxui::ScreenInteractive
  Private
- ftxui::ScreenInteractive
  quit_
- ftxui::ScreenInteractive
  RefreshSelection
- ftxui::ScreenInteractive
  RegisterHyperlink
- ftxui::ScreenInteractive
  RequestAnimationFrame
- ftxui::ScreenInteractive
  reset_cursor_position
- ftxui::ScreenInteractive
  ResetCursorPosition
- ftxui::ScreenInteractive
  ResetPosition
- ftxui::ScreenInteractive
  RunOnce
- ftxui::ScreenInteractive
  RunOnceBlocking
- ftxui::ScreenInteractive
  Screen
- ftxui::ScreenInteractive
  ScreenInteractive
- ftxui::ScreenInteractive
  selection_
- ftxui::ScreenInteractive
  selection_data_
- ftxui::ScreenInteractive
  selection_data_previous_
- ftxui::ScreenInteractive
  selection_on_change_
- ftxui::ScreenInteractive
  selection_pending_
- ftxui::ScreenInteractive
  selection_style_
- ftxui::ScreenInteractive
  SelectionChange
- ftxui::ScreenInteractive
  SelectionStyle
- ftxui::ScreenInteractive
  set_cursor_position
- ftxui::ScreenInteractive
  SetCursor
- ftxui::ScreenInteractive
  SetSelectionStyle
- ftxui::ScreenInteractive
  Signal
- ftxui::ScreenInteractive
  stencil
- ftxui::ScreenInteractive
  suspended_screen_
- ftxui::ScreenInteractive
  task_receiver_
- ftxui::ScreenInteractive
  task_sender_
- ftxui::ScreenInteractive
  TerminalOutput
- ftxui::ScreenInteractive
  ToString
- ftxui::ScreenInteractive
  track_mouse_
- ftxui::ScreenInteractive
  TrackMouse
- ftxui::ScreenInteractive
  Uninstall
- ftxui::ScreenInteractive
  use_alternative_screen_
- ftxui::ScreenInteractive
  WithRestoredIO