Module ftxui/screen
Classes & Structs
| Class | Description |
|---|---|
ftxui::Box | Box is a structure that represents a rectangular area in a 2D space. |
ftxui::Cell | A Unicode character and its associated style. |
ftxui::Color | Color is a class that represents a color in the terminal user interface. |
ftxui::ColorInfo | ColorInfo is a structure that contains information about the terminal color palette. |
ftxui::Dimensions | Dimensions is a structure that represents the size of the terminal. |
ftxui::Screen | A rectangular grid of Cell. |
ftxui::Screen::Cursor | Terminal cursor position and shape. |
ftxui::Surface | A rectangular grid of Cell. |
ftxui::Terminal::Quirks | Quirks is a structure that represents various terminal-specific behaviors that may require fallbacks. |
ftxui::Terminal::TerminalInfo | TerminalInfo is a structure that contains information about the terminal. |
Enumerations
Color
enum Color { Palette1, Palette16, Palette256, TrueColor };Color is an enumeration that represents the color support of the terminal.
Examples: component/button_animated, component/button_in_frame, component/button_style, component/canvas_animated, component/dropdown_custom, component/flexbox_gallery, component/focus, component/homescreen, component/input_style, component/linear_gradient_gallery, component/maybe, component/menu_entries (+22 more)
Type Aliases
Image
using Image = Surface;Pixel
using Pixel = Cell;Functions
| Symbol | Description |
|---|---|
ColorInfoSorted2D | Get the color information for the palette256, sorted in 2D. |
Fixed | A fixed dimension. |
Full | Use the terminal dimensions. |
operator""_rgb | Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb. |
ColorSupport | Get the color support of the terminal. |
ComputeColorSupport | Compute the color support based on environment variables and terminal identification. |
GetQuirks | Get the terminal quirks. |
SetColorSupport | Override terminal color support in case auto-detection fails. |
SetFallbackSize | Override terminal size in case auto-detection fails. |
SetQuirks | Override terminal quirks. |
Size | Get the terminal size. |
to_string | Convert a std::wstring into a UTF8 std::string. |
to_wstring | Convert a UTF8 std::string into a std::wstring. |
ColorInfoSorted2D
std::vector< std::vector< ColorInfo > > ColorInfoSorted2D();Get the color information for the palette256, sorted in 2D.
Returns: A 2D vector of ColorInfo.
Examples: component/homescreen, dom/color_gallery, dom/color_info_palette256
Fixed
Dimensions Fixed(int);A fixed dimension.
Full
Dimensions Full();Use the terminal dimensions.
Examples: dom/border, dom/color_gallery, dom/color_info_palette256, dom/color_truecolor_HSV, dom/color_truecolor_RGB, dom/dbox, dom/graph, dom/hflow, dom/linear_gradient, dom/package_manager, dom/paragraph, dom/separator (+15 more)
operator""_rgb
Color operator""_rgb(unsigned long long int combined);Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
ColorSupport
Color ColorSupport();Get the color support of the terminal.
Examples: component/terminal_info, dom/color_gallery
ComputeColorSupport
Color ComputeColorSupport(std::string_view term, std::string_view colorterm, std::string_view term_program, std::string_view terminal_name, std::string_view terminal_emulator_name, const std::vector< int > & capabilities);Compute the color support based on environment variables and terminal identification.
Parameters:
term: The TERM environment variable.colorterm: The COLORTERM environment variable.term_program: The TERM_PROGRAM environment variable.terminal_name: The terminal name (from DA2).terminal_emulator_name: The terminal emulator name (from XTVERSION).capabilities: The terminal capabilities (from DA1).
GetQuirks
Get the terminal quirks.
Examples: component/terminal_info
SetColorSupport
void SetColorSupport(Color color);Override terminal color support in case auto-detection fails.
Examples: component/terminal_info
SetFallbackSize
void SetFallbackSize(const Dimensions & fallbackSize);Override terminal size in case auto-detection fails.
Parameters:
fallbackSize: Terminal dimensions to fallback to
SetQuirks
Override terminal quirks.
Examples: component/terminal_info
Size
Dimensions Size();Get the terminal size.
Returns: The terminal size.
Examples: component/homescreen
to_string
std::string to_string(std::wstring_view s);Convert a std::wstring into a UTF8 std::string.
Examples: component/button, component/button_animated, component/button_in_frame, component/button_style, component/checkbox_in_frame, component/composition, component/custom_loop, component/flexbox_gallery, component/focus, component/homescreen, component/input_in_frame, component/linear_gradient_gallery (+23 more)
to_wstring
std::wstring to_wstring(std::string_view s);Convert a UTF8 std::string into a std::wstring.