FTXUI  0.8.1
C++ functional terminal UI.
ScreenInteractive Class Reference
+ Inheritance diagram for ScreenInteractive:

Public Member Functions

void Loop (Component)
 
std::function< void()> ExitLoopClosure ()
 
void PostEvent (Event event)
 
CapturedMouse CaptureMouse ()
 
std::string & at (int x, int y)
 Access a character a given position. More...
 
PixelPixelAt (int x, int y)
 Access a Pixel at a given position. More...
 
std::string ToString ()
 
void Print ()
 
int dimx ()
 
int dimy ()
 
std::string ResetPosition (bool clear=false)
 Return a string to be printed in order to reset the cursor position to the beginning of the screen. More...
 
void Clear ()
 Clear all the pixel from the screen. More...
 
void ApplyShader ()
 
Cursor cursor () const
 
void SetCursor (Cursor cursor)
 

Static Public Member Functions

static ScreenInteractive FixedSize (int dimx, int dimy)
 
static ScreenInteractive Fullscreen ()
 
static ScreenInteractive FitComponent ()
 
static ScreenInteractive TerminalOutput ()
 
static Screen Create (Dimensions dimension)
 Create a screen with the given dimension. More...
 
static Screen Create (Dimensions width, Dimensions height)
 Create a screen with the given dimension along the x-axis and y-axis. More...
 

Data Fields

Box stencil
 

Protected Attributes

int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 
Cursor cursor_
 

Detailed Description

Definition at line 21 of file screen_interactive.hpp.

Member Function Documentation

◆ FixedSize()

ScreenInteractive FixedSize ( int  dimx,
int  dimy 
)
static

Definition at line 245 of file screen_interactive.cpp.

◆ Fullscreen()

◆ FitComponent()

◆ TerminalOutput()

◆ Loop()

void Loop ( Component  component)

Definition at line 277 of file screen_interactive.cpp.

◆ ExitLoopClosure()

std::function< void()> ExitLoopClosure ( )

Definition at line 527 of file screen_interactive.cpp.

◆ PostEvent()

void PostEvent ( Event  event)

Definition at line 264 of file screen_interactive.cpp.

◆ CaptureMouse()

CapturedMouse CaptureMouse ( )

Definition at line 269 of file screen_interactive.cpp.

◆ Create() [1/2]

◆ Create() [2/2]

Screen Create ( Dimensions  width,
Dimensions  height 
)
staticinherited

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

Definition at line 109 of file screen.cpp.

◆ at()

std::string & at ( int  x,
int  y 
)
inherited

Access a character a given position.

Parameters
xThe character position along the x-axis.
yThe character position along the y-axis.

Definition at line 171 of file screen.cpp.

◆ PixelAt()

Pixel & PixelAt ( int  x,
int  y 
)
inherited

Access a Pixel at a given position.

Parameters
xThe pixel position along the x-axis.
yThe pixel position along the y-axis.

Definition at line 178 of file screen.cpp.

◆ ToString()

std::string ToString ( )
inherited

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();

Definition at line 138 of file screen.cpp.

◆ Print()

void Print ( )
inherited

Definition at line 164 of file screen.cpp.

◆ dimx()

int dimx ( )
inlineinherited

Definition at line 65 of file screen.hpp.

◆ dimy()

int dimy ( )
inlineinherited

Definition at line 66 of file screen.hpp.

◆ ResetPosition()

std::string ResetPosition ( bool  clear = false)
inherited

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

std::string reset_position;
while(true) {
auto document = render();
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
Render(screen, document);
std::cout << reset_position << screen.ToString() << std::flush;
reset_position = screen.ResetPosition();
using namespace std::chrono_literals;
std::this_thread::sleep_for(0.01s);
}
Returns
The string to print in order to reset the cursor position to the beginning.

Definition at line 201 of file screen.cpp.

◆ Clear()

void Clear ( )
inherited

Clear all the pixel from the screen.

Definition at line 218 of file screen.cpp.

◆ ApplyShader()

void ApplyShader ( )
inherited

Definition at line 226 of file screen.cpp.

◆ cursor()

Cursor cursor ( ) const
inlineinherited

Definition at line 81 of file screen.hpp.

◆ SetCursor()

void SetCursor ( Cursor  cursor)
inlineinherited

Definition at line 82 of file screen.hpp.

Field Documentation

◆ stencil

Box stencil
inherited

Definition at line 75 of file screen.hpp.

◆ dimx_

int dimx_
protectedinherited

Definition at line 85 of file screen.hpp.

◆ dimy_

int dimy_
protectedinherited

Definition at line 86 of file screen.hpp.

◆ pixels_

std::vector<std::vector<Pixel> > pixels_
protectedinherited

Definition at line 87 of file screen.hpp.

◆ cursor_

Cursor cursor_
protectedinherited

Definition at line 88 of file screen.hpp.


The documentation for this class was generated from the following files:
ftxui::Dimension::Fit
Dimensions Fit(Element &)
Definition: util.cpp:71
ftxui::Screen::Create
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition: screen.cpp:115
ftxui::Dimension::Full
Dimensions Full()
Definition: screen.cpp:103
ftxui::Render
void Render(Screen &screen, const Element &node)
Display an element on a ftxui::Screen.
Definition: node.cpp:34