|
FTXUI 6.1.9
C++ functional terminal UI.
|
#include <screen_interactive.hpp>
Inheritance diagram for ScreenInteractive:
Collaboration diagram for ScreenInteractive:Data Structures | |
| class | Private |
Public Types | |
| using | SelectionStyle = std::function<void(Pixel&)> |
Public Member Functions | |
| void | TrackMouse (bool enable=true) |
Set whether mouse is tracked and events reported. called outside of the main loop. E.g ScreenInteractive::Loop(...). | |
| void | Loop (Component) |
| Execute the main loop. | |
| void | Exit () |
| Exit the main loop. | |
| Closure | ExitLoopClosure () |
| Return a function to exit the main loop. | |
| void | Post (Task task) |
| Add a task to the main loop. It will be executed later, after every other scheduled tasks. | |
| void | PostEvent (Event event) |
| Add an event to the main loop. It will be executed later, after every other scheduled events. | |
| void | RequestAnimationFrame () |
| Add a task to draw the screen one more time, until all the animations are done. | |
| CapturedMouse | CaptureMouse () |
| Try to get the unique lock about behing able to capture the mouse. | |
| Closure | WithRestoredIO (Closure) |
| Decorate a function. It executes the same way, but with the currently active screen terminal hooks temporarilly uninstalled during its execution. | |
| void | ForceHandleCtrlC (bool force) |
| Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC. | |
| void | ForceHandleCtrlZ (bool force) |
| Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ. | |
| std::string | GetSelection () |
| Returns the content of the current selection. | |
| void | SelectionChange (std::function< void()> callback) |
| std::string | ToString () const |
| void | Print () const |
| void | Clear () |
| Clear all the pixel from the screen. | |
| std::string | ResetPosition (bool clear=false) const |
| Return a string to be printed in order to reset the cursor position to the beginning of the screen. | |
| void | ApplyShader () |
| Cursor | cursor () const |
| void | SetCursor (Cursor cursor) |
| uint8_t | RegisterHyperlink (const std::string &link) |
| const std::string & | Hyperlink (uint8_t id) const |
| const SelectionStyle & | GetSelectionStyle () const |
| Return the current selection style. | |
| void | SetSelectionStyle (SelectionStyle decorator) |
| Set the current selection style. | |
| std::string & | at (int x, int y) |
| Access a character in a cell at a given position. | |
| const std::string & | at (int x, int y) const |
| Access a character in a cell at a given position. | |
| Pixel & | PixelAt (int x, int y) |
| Access a cell (Pixel) at a given position. | |
| const Pixel & | PixelAt (int x, int y) const |
| Access a cell (Pixel) at a given position. | |
| int | dimx () const |
| int | dimy () const |
Static Public Member Functions | |
| static ScreenInteractive | FixedSize (int dimx, int dimy) |
| static ScreenInteractive | Fullscreen () |
| static ScreenInteractive | FullscreenPrimaryScreen () |
| static ScreenInteractive | FullscreenAlternateScreen () |
| static ScreenInteractive | FitComponent () |
| static ScreenInteractive | TerminalOutput () |
| static ScreenInteractive * | Active () |
| Return the currently active screen, or null if none. | |
| static Screen | Create (Dimensions dimension) |
| Create a screen with the given dimension. | |
| static Screen | Create (Dimensions width, Dimensions height) |
| Create a screen with the given dimension along the x-axis and y-axis. | |
Data Fields | |
| friend | Private |
| Box | stencil |
Protected Attributes | |
| Cursor | cursor_ |
| std::vector< std::string > | hyperlinks_ = {""} |
| SelectionStyle | selection_style_ |
| int | dimx_ |
| int | dimy_ |
| std::vector< std::vector< Pixel > > | pixels_ |
Definition at line 30 of file screen_interactive.hpp.
|
inherited |
Definition at line 72 of file screen.hpp.
|
static |
Definition at line 360 of file screen_interactive.cpp.
|
static |
Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.
ScreenInteractive::FullscreenAlternateScreen() Definition at line 374 of file screen_interactive.cpp.
|
static |
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 383 of file screen_interactive.cpp.
|
static |
Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.
Definition at line 396 of file screen_interactive.cpp.
|
static |
Definition at line 416 of file screen_interactive.cpp.
|
static |
Definition at line 406 of file screen_interactive.cpp.
| void 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. |
ScreenInteractive::Loop. Definition at line 441 of file screen_interactive.cpp.
|
static |
Return the currently active screen, or null if none.
Definition at line 594 of file screen_interactive.cpp.
Execute the main loop.
| component | The component to draw. |
Definition at line 495 of file screen_interactive.cpp.
| void Exit | ( | ) |
Exit the main loop.
Definition at line 1032 of file screen_interactive.cpp.
| Closure ExitLoopClosure | ( | ) |
Return a function to exit the main loop.
Definition at line 1026 of file screen_interactive.cpp.
| void Post | ( | Task | task | ) |
Add a task to the main loop. It will be executed later, after every other scheduled tasks.
Definition at line 448 of file screen_interactive.cpp.
| void PostEvent | ( | Event | event | ) |
Add an event to the main loop. It will be executed later, after every other scheduled events.
Definition at line 461 of file screen_interactive.cpp.
| void RequestAnimationFrame | ( | ) |
Add a task to draw the screen one more time, until all the animations are done.
Definition at line 467 of file screen_interactive.cpp.
| CapturedMouse CaptureMouse | ( | ) |
Try to get the unique lock about behing able to capture the mouse.
Definition at line 483 of file screen_interactive.cpp.
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. |
Definition at line 560 of file screen_interactive.cpp.
| void ForceHandleCtrlC | ( | bool | force | ) |
Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.
Definition at line 570 of file screen_interactive.cpp.
| void ForceHandleCtrlZ | ( | bool | force | ) |
Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.
Definition at line 576 of file screen_interactive.cpp.
| std::string GetSelection | ( | ) |
Returns the content of the current selection.
Definition at line 581 of file screen_interactive.cpp.
| void SelectionChange | ( | std::function< void()> | callback | ) |
Definition at line 588 of file screen_interactive.cpp.
|
staticinherited |
Create a screen with the given dimension.
Definition at line 394 of file screen.cpp.
|
staticinherited |
Create a screen with the given dimension along the x-axis and y-axis.
Definition at line 388 of file screen.cpp.
|
inherited |
Produce a std::string that can be used to print the Screen on the terminal.
Definition at line 415 of file screen.cpp.
|
inherited |
Definition at line 452 of file screen.cpp.
|
inherited |
Clear all the pixel from the screen.
Definition at line 494 of file screen.cpp.
|
inherited |
Return a string to be printed in order to reset the cursor position to the beginning of the screen.
Definition at line 475 of file screen.cpp.
|
inherited |
Definition at line 506 of file screen.cpp.
|
inlineinherited |
Definition at line 64 of file screen.hpp.
|
inlineinherited |
Definition at line 65 of file screen.hpp.
|
inherited |
Definition at line 533 of file screen.cpp.
|
inherited |
Definition at line 546 of file screen.cpp.
|
inherited |
Return the current selection style.
Definition at line 555 of file screen.cpp.
|
inherited |
Set the current selection style.
Definition at line 561 of file screen.cpp.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| friend Private |
Definition at line 162 of file screen_interactive.hpp.
|
protectedinherited |
Definition at line 77 of file screen.hpp.
|
protectedinherited |
Definition at line 78 of file screen.hpp.
|
protectedinherited |
Definition at line 81 of file screen.hpp.
|
protectedinherited |