Definition at line 29 of file screen_interactive.hpp.
◆ FixedSize()
◆ Fullscreen()
◆ 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.
Definition at line 379 of file screen_interactive.cpp.
◆ FullscreenAlternateScreen()
◆ FitComponent()
◆ TerminalOutput()
◆ TrackMouse()
void TrackMouse |
( |
bool |
enable = true | ) |
|
Set whether mouse is tracked and events reported. called outside of the main loop. E.g ScreenInteractive::Loop(...)
.
- Parameters
-
enable | Whether to enable mouse event tracking. |
- Note
- 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
screen.TrackMouse(false);
screen.Loop(component);
static ScreenInteractive TerminalOutput()
Definition at line 437 of file screen_interactive.cpp.
◆ Active()
◆ Loop()
◆ Exit()
◆ ExitLoopClosure()
◆ Post()
Add a task to the main loop. It will be executed later, after every other scheduled tasks.
Definition at line 444 of file screen_interactive.cpp.
◆ PostEvent()
void PostEvent |
( |
Event |
event | ) |
|
Add an event to the main loop. It will be executed later, after every other scheduled events.
Definition at line 457 of file screen_interactive.cpp.
◆ RequestAnimationFrame()
void RequestAnimationFrame |
( |
| ) |
|
Add a task to draw the screen one more time, until all the animations are done.
Definition at line 463 of file screen_interactive.cpp.
◆ CaptureMouse()
Try to get the unique lock about behing able to capture the mouse.
- Returns
- A unique lock if the mouse is not already captured, otherwise a null.
Definition at line 479 of file screen_interactive.cpp.
◆ WithRestoredIO()
Decorate a function. It executes the same way, but with the currently active screen terminal hooks temporarilly uninstalled during its execution.
- Parameters
-
fn | The function to decorate. |
Definition at line 555 of file screen_interactive.cpp.
◆ Create() [1/2]
Create a screen with the given dimension.
Definition at line 391 of file screen.cpp.
◆ Create() [2/2]
Create a screen with the given dimension along the x-axis and y-axis.
Definition at line 385 of file screen.cpp.
◆ at() [1/2]
std::string & at |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inherited |
Access a character in a cell at a given position.
- Parameters
-
x | The cell position along the x-axis. |
y | The cell position along the y-axis. |
Definition at line 456 of file screen.cpp.
◆ at() [2/2]
const std::string & at |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
|
inherited |
Access a character in a cell at a given position.
- Parameters
-
x | The cell position along the x-axis. |
y | The cell position along the y-axis. |
Definition at line 463 of file screen.cpp.
◆ PixelAt() [1/2]
Pixel & PixelAt |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inherited |
Access a cell (Pixel) at a given position.
- Parameters
-
x | The cell position along the x-axis. |
y | The cell position along the y-axis. |
Definition at line 470 of file screen.cpp.
◆ PixelAt() [2/2]
const Pixel & PixelAt |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
|
inherited |
Access a cell (Pixel) at a given position.
- Parameters
-
x | The cell position along the x-axis. |
y | The cell position along the y-axis. |
Definition at line 477 of file screen.cpp.
◆ ToString()
std::string ToString |
( |
| ) |
const |
|
inherited |
Produce a std::string that can be used to print the Screen on the terminal.
- Note
- Don't forget to flush stdout. Alternatively, you can use Screen::Print();
Definition at line 416 of file screen.cpp.
◆ Print()
◆ dimx()
◆ dimy()
◆ ResetPosition()
std::string ResetPosition |
( |
bool |
clear = false | ) |
const |
|
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();
std::cout << reset_position << screen.ToString() << std::flush;
reset_position = screen.ResetPosition();
using namespace std::chrono_literals;
std::this_thread::sleep_for(0.01s);
}
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Dimensions Fit(Element &)
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
- Returns
- The string to print in order to reset the cursor position to the beginning.
Definition at line 500 of file screen.cpp.
◆ Clear()
Clear all the pixel from the screen.
Definition at line 519 of file screen.cpp.
◆ ApplyShader()
◆ cursor()
◆ SetCursor()
void SetCursor |
( |
Cursor |
cursor | ) |
|
|
inlineinherited |
◆ RegisterHyperlink()
uint8_t RegisterHyperlink |
( |
const std::string & |
link | ) |
|
|
inherited |
◆ Hyperlink()
const std::string & Hyperlink |
( |
uint8_t |
id | ) |
const |
|
inherited |
◆ Private
◆ stencil
◆ dimx_
◆ dimy_
◆ pixels_
std::vector<std::vector<Pixel> > pixels_ |
|
protectedinherited |
◆ cursor_
◆ hyperlinks_
std::vector<std::string> hyperlinks_ = {""} |
|
protectedinherited |
The documentation for this class was generated from the following files: