FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
ftxui Namespace Reference

The FTXUI ftxui:: namespace. More...

Namespaces

namespace  animation
 
namespace  box_helper
 
namespace  Container
 
namespace  Dimension
 Define how the Screen's dimensions should look like.
 
namespace  flexbox_helper
 
namespace  literals
 
namespace  task
 
namespace  Terminal
 
namespace  util
 

Classes

class  AnimationTask
 
class  AutoReset
 Assign a value to a variable, reset its old value when going out of scope. More...
 
class  ConstRef
 An adapter. Own or reference an immutable object. More...
 
class  MultiReceiverBuffer
 
class  NodeDecorator
 
class  ReceiverImpl
 
class  Ref
 An adapter. Own or reference an mutable object. More...
 
class  SenderImpl
 
struct  SliderOption
 
class  TerminalInputParser
 

Typedefs

using Component = std::shared_ptr<ComponentBase>
 
using CapturedMouse = std::unique_ptr<CapturedMouseInterface>
 
using ComponentDecorator = std::function<Component(Component)>
 
using ElementDecorator = std::function<Element(Element)>
 
using Components = std::vector<Component>
 
template<class T >
using Sender = std::unique_ptr<SenderImpl<T>>
 
template<class T >
using Receiver = std::unique_ptr<ReceiverImpl<T>>
 
using ScreenInteractive = App
 
using Closure = std::function<void()>
 
using Task = std::variant<Event, Closure, AnimationTask>
 
using Element = std::shared_ptr<Node>
 
using Elements = std::vector<Element>
 
using Decorator = std::function<Element(Element)>
 
using GraphFunction = std::function<std::vector<int>(int, int)>
 
using Image = Surface
 
using Pixel = Cell
 

Enumerations

enum class  Direction {
  Up = 0 ,
  Down = 1 ,
  Left = 2 ,
  Right = 3
}
 Direction is an enumeration that represents the four cardinal directions. More...
 
enum  BorderStyle {
  LIGHT ,
  DASHED ,
  HEAVY ,
  DOUBLE ,
  ROUNDED ,
  EMPTY
}
 BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. More...
 
enum  WidthOrHeight {
  WIDTH ,
  HEIGHT
}
 
enum  Constraint {
  LESS_THAN ,
  EQUAL ,
  GREATER_THAN
}
 
enum class  AppDimension {
  FitComponent ,
  Fixed ,
  Fullscreen ,
  TerminalOutput
}
 
enum class  WordBreakProperty : int8_t {
  ALetter ,
  CR ,
  Double_Quote ,
  Extend ,
  ExtendNumLet ,
  Format ,
  Hebrew_Letter ,
  Katakana ,
  LF ,
  MidLetter ,
  MidNum ,
  MidNumLet ,
  Newline ,
  Numeric ,
  Regional_Indicator ,
  Single_Quote ,
  WSegSpace ,
  ZWJ
}
 

Functions

class FTXUI_EXPORT (COMPONENT) ComponentBase = {})
 It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event.
 
template<class T , class... Args>
std::shared_ptr< T > Make (Args &&... args)
 
Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 Draw checkable element.
 
Component Input (StringRef content, InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 An input box for editing text.
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 A list of text. The focused element is selected.
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Dropdown (ConstStringListRef entries, int *selected)
 A dropdown menu.
 
Component Toggle (ConstStringListRef entries, int *selected)
 An horizontal list of elements. The user can navigate through them.
 
template<typename T >
Component Slider (SliderOption< T > options)
 A slider in any direction.
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 An horizontal slider.
 
Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
 
Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
 
Component ResizableSplit (ResizableSplitOption options)
 A split in between two components.
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component Renderer (Component child, std::function< Element()> render)
 Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
 
FTXUI_EXPORT(COMPONENT) Component Renderer(std Component Renderer (std::function< Element(bool)> render)
 Return a focusable component, using |render| to render its interface.
 
Component CatchEvent (Component child, std::function< bool(Event)>)
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
FTXUI_EXPORT(COMPONENT) ComponentDecorator Maybe(std Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Collapsible (ConstStringRef label, Component child, Ref< bool > show)
 A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.
 
Component Hoverable (Component component, bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Uses callbacks.
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
template<class T >
Receiver< T > MakeReceiver ()
 
struct FTXUI_EXPORT (DOM) Canvas
 Canvas is a drawable buffer associated with drawing operations.
 
 FTXUI_EXPORT (DOM) Element &operator|
 
FTXUI_EXPORT(DOM) Element separatorCharacter(std Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
 Draw a horizontal bar, with the area in between left/right colored differently.
 
Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
 Draw an vertical bar, with the area in between up/downcolored differently.
 
Element window (Element title, Element content, BorderStyle border)
 Draw window with a title and a border around the element.
 
Element canvas (int width, int height, std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas of requested size.
 
Element flexbox (Elements children, FlexboxConfig config)
 A container displaying elements on row/columns and capable of wrapping on the next column/row when full.
 
FTXUI_EXPORT(DOM) Element gridbox(std Element hflow (Elements children)
 A container displaying elements in rows from left to right. When filled, it starts on a new row below.
 
Element vflow (Elements children)
 A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.
 
Element xflex (Element child)
 Expand/Minimize if possible/needed on the X axis.
 
Element xflex_grow (Element child)
 Expand if possible on the X axis.
 
Element xflex_shrink (Element child)
 Minimize if needed on the X axis.
 
Element yflex (Element child)
 Expand/Minimize if possible/needed on the Y axis.
 
Element yflex_grow (Element child)
 Expand if possible on the Y axis.
 
Element yflex_shrink (Element child)
 Minimize if needed on the Y axis.
 
void Render (Screen &screen, Node *node, Selection &selection)
 
std::string GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
 
struct FTXUI_EXPORT (SCREEN) Box
 Box is a structure that represents a rectangular area in a 2D space.
 
 FTXUI_EXPORT (SCREEN) Color operator""_rgb(unsigned long long int combined)
 Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
 
template<typename T >
FTXUI_EXPORT(SCREEN) std FTXUI_EXPORT(SCREEN) std std::wstring to_wstring (T s)
 
template<>
std::wstring to_wstring (const char *s)
 
FTXUI_EXPORT(SCREEN) int string_width(std std::vector< std::string > Utf8ToGlyphs (std::string_view input)
 
std::vector< int > CellToGlyphIndex (std::string_view input)
 
Component Button (ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component CatchEvent (Component child, std::function< bool(Event event)> on_event)
 Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
Component Checkbox (CheckboxOption option)
 Draw checkable element.
 
Component Dropdown (DropdownOption option)
 A dropdown menu.
 
ComponentDecorator Hoverable (bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Input (InputOption option)
 An input box for editing text.
 
Component Maybe (Component child, std::function< bool()> show)
 Decorate a component |child|. It is shown only when |show| returns true.
 
ComponentDecorator Maybe (std::function< bool()> show)
 Decorate a component. It is shown only when the |show| function returns true.
 
Component Maybe (Component child, const bool *show)
 Decorate a component |child|. It is shown only when |show| is true.
 
ComponentDecorator Maybe (const bool *show)
 Decorate a component. It is shown only when |show| is true.
 
Component Menu (MenuOption option)
 A list of text. The focused element is selected.
 
Component MenuEntry (MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Radiobox (RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Renderer (std::function< Element()> render)
 Return a component, using |render| to render its interface.
 
ComponentDecorator Renderer (ElementDecorator decorator)
 Decorate a component, by decorating what it renders.
 
Component Window (WindowOptions option)
 A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
 
Element automerge (Element child)
 Enable character to be automatically merged with others nearby.
 
Element blink (Element child)
 The text drawn alternates in between visible and hidden.
 
Element bold (Element child)
 Use a bold font, for elements with more emphasis.
 
Element border (Element child)
 Draw a border around the element.
 
Decorator borderWith (const Cell &pixel)
 Same as border but with a constant Cell around the element.
 
Decorator borderStyled (BorderStyle style)
 Same as border but with different styles.
 
Decorator borderStyled (Color foreground_color)
 Same as border but with a foreground color.
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 Same as border but with a foreground color and a different style.
 
Element borderDashed (Element child)
 Draw a dashed border around the element.
 
Element borderLight (Element child)
 Draw a light border around the element.
 
Element borderHeavy (Element child)
 Draw a heavy border around the element.
 
Element borderDouble (Element child)
 Draw a double border around the element.
 
Element borderRounded (Element child)
 Draw a rounded border around the element.
 
Element borderEmpty (Element child)
 Draw an empty border around the element.
 
Element canvas (ConstRef< Canvas > canvas)
 Produce an element from a Canvas, or a reference to a Canvas.
 
Element canvas (std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas.
 
Element clear_under (Element element)
 Before drawing |child|, clear the cells below. This is useful in combination with dbox.
 
Element color (Color color, Element child)
 Set the foreground color of an element.
 
Element bgcolor (Color color, Element child)
 Set the background color of an element.
 
Decorator color (Color c)
 Decorate using a foreground color.
 
Decorator bgcolor (Color color)
 Decorate using a background color.
 
Element hcenter (Element child)
 Center an element horizontally.
 
Element vcenter (Element child)
 Center an element vertically.
 
Element center (Element child)
 Center an element horizontally and vertically.
 
Element align_right (Element child)
 Align an element on the right side.
 
Element dbox (Elements children_)
 Stack several element on top of each other.
 
Element dim (Element child)
 Use a light font, for elements with less emphasis.
 
Element filler ()
 An element that will take expand proportionally to the space left in a container.
 
Element flex (Element child)
 Make a child element to expand proportionally to the space left in a container.
 
Element flex_grow (Element child)
 Expand if possible.
 
Element flex_shrink (Element child)
 Minimize if needed.
 
Element notflex (Element child)
 Make the element not flexible.
 
Decorator focusPositionRelative (float x, float y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
 
Decorator focusPosition (int x, int y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
 
Element focus (Element child)
 Set the child to be the one focused among its siblings.
 
Element select (Element e)
 Set the child to be the one focused among its siblings.
 
Element frame (Element child)
 Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.
 
Element xframe (Element child)
 Same as frame, but only on the x-axis.
 
Element yframe (Element child)
 Same as frame, but only on the y-axis.
 
Element focusCursorBlock (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBlockBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking block.
 
Element focusCursorBar (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBarBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking bar.
 
Element focusCursorUnderline (Element child)
 Same as focus, but set the cursor shape to be a still underline.
 
Element focusCursorUnderlineBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking underline.
 
Element gaugeDirection (float progress, Direction direction)
 Draw a high definition progress bar progressing in specified direction.
 
Element gaugeRight (float progress)
 Draw a high definition progress bar progressing from left to right.
 
Element gaugeLeft (float progress)
 Draw a high definition progress bar progressing from right to left.
 
Element gaugeUp (float progress)
 Draw a high definition progress bar progressing from bottom to top.
 
Element gaugeDown (float progress)
 Draw a high definition progress bar progressing from top to bottom.
 
Element gauge (float progress)
 Draw a high definition progress bar.
 
Element graph (GraphFunction graph_function)
 Draw a graph using a GraphFunction.
 
Element gridbox (std::vector< Elements > lines)
 A container displaying a grid of elements.
 
Element hbox (Elements children)
 A container displaying elements horizontally one by one.
 
Element hyperlink (std::string_view link, Element child)
 Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Decorator hyperlink (std::string_view link)
 Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Element inverted (Element child)
 Add a filter that will invert the foreground and the background colors.
 
Element italic (Element child)
 Apply a underlinedDouble to text.
 
Element color (const LinearGradient &gradient, Element child)
 Set the foreground color of an element with linear-gradient effect.
 
Element bgcolor (const LinearGradient &gradient, Element child)
 Set the background color of an element with linear-gradient effect.
 
Decorator color (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the foreground color.
 
Decorator bgcolor (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the background color.
 
void Render (Screen &screen, const Element &element)
 Display an element on a ftxui::Screen.
 
void Render (Screen &screen, Node *node)
 Display an element on a ftxui::Screen.
 
Element paragraph (std::string_view the_text)
 Return an element drawing the paragraph on multiple lines.
 
Element paragraphAlignLeft (std::string_view the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the left.
 
Element paragraphAlignRight (std::string_view the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the right.
 
Element paragraphAlignCenter (std::string_view the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the center.
 
Element paragraphAlignJustify (std::string_view the_text)
 Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
 
Decorator reflect (Box &box)
 
Element vscroll_indicator (Element child)
 Display a vertical scrollbar on the right. Colors follow the content.
 
Element hscroll_indicator (Element child)
 Display a horizontal scrollbar at the bottom. Colors follow the content.
 
Element selectionStyleReset (Element child)
 Reset the selection style of an element.
 
Decorator selectionBackgroundColor (Color foreground)
 Set the background color of an element when selected. Note that the style is applied on top of the existing style.
 
Decorator selectionForegroundColor (Color foreground)
 Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.
 
Decorator selectionColor (Color foreground)
 Set the color of an element when selected.
 
Decorator selectionStyle (std::function< void(Cell &)> style)
 Set the style of an element when selected.
 
Element separator ()
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorStyled (BorderStyle style)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorLight ()
 Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
 
Element separatorDashed ()
 Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
 
Element separatorHeavy ()
 Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
 
Element separatorDouble ()
 Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
 
Element separatorEmpty ()
 Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
 
Element separatorCharacter (std::string_view value)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separator (Cell pixel)
 Draw a separator in between two element filled with a given pixel.
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 Apply a constraint on the size of an element.
 
Element spinner (int charset_index, size_t image_index)
 Useful to represent the effect of time and/or events. This displays an ASCII art "video".
 
Element strikethrough (Element child)
 Apply a strikethrough to text.
 
Element text (std::string_view text)
 Display a piece of UTF8 encoded unicode text.
 
Element text (std::wstring_view text)
 Display a piece of unicode text.
 
Element vtext (std::string_view text)
 Display a piece of unicode text vertically.
 
Element vtext (std::wstring_view text)
 Display a piece unicode text vertically.
 
Element underlined (Element child)
 Underline the given element.
 
Element underlinedDouble (Element child)
 Apply a underlinedDouble to text.
 
Element nothing (Element element)
 A decoration doing absolutely nothing.
 
Decorator operator| (Decorator a, Decorator b)
 Compose two decorator into one.
 
Elements operator| (Elements elements, Decorator decorator)
 From a set of element, apply a decorator to every elements.
 
Element operator| (Element element, Decorator decorator)
 From an element, apply a decorator.
 
Elementoperator|= (Element &e, Decorator d)
 Apply a decorator to an element.
 
Element emptyElement ()
 
Element vbox (Elements children)
 A container displaying elements vertically one by one.
 
Color operator""_rgb (unsigned long long int combined)
 
ColorInfo GetColorInfo (Color::Palette256 index)
 
ColorInfo GetColorInfo (Color::Palette16 index)
 
std::vector< std::vector< ColorInfo > > ColorInfoSorted2D ()
 
bool EatCodePoint (std::string_view input, size_t start, size_t *end, uint32_t *ucs)
 
bool EatCodePoint (std::wstring_view input, size_t start, size_t *end, uint32_t *ucs)
 
bool IsCombining (uint32_t ucs)
 
bool IsFullWidth (uint32_t ucs)
 
bool IsControl (uint32_t ucs)
 
WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
 
int wchar_width (wchar_t ucs)
 
int wstring_width (const std::wstring &text)
 
int string_width (std::string_view input)
 
size_t GlyphPrevious (std::string_view input, size_t start)
 
size_t GlyphNext (std::string_view input, size_t start)
 
size_t GlyphIterate (std::string_view input, int glyph_offset, size_t start)
 
int GlyphCount (std::string_view input)
 
std::vector< WordBreakPropertyUtf8ToWordBreakProperty (std::string_view input)
 
std::string to_string (std::wstring_view s)
 Convert a std::wstring into a UTF8 std::string.
 
std::wstring to_wstring (std::string_view s)
 Convert a UTF8 std::string into a std::wstring.
 
bool IsWordBreakingCharacter (std::string_view input, size_t glyph_index)
 

Variables

const bool * show
 
Direction direction
 
 Color
 Build a transparent color.
 
size_t image_index
 
int y
 
 Constraint
 
int value
 
const Elementelement
 
Node * node
 
const std::map< std::string, std::string > g_uniformize
 
const std::array< ColorInfo, 256 > palette256
 

Detailed Description

The FTXUI ftxui:: namespace.

Typedef Documentation

◆ Component

typedef std::shared_ptr< ComponentBase > Component = std::shared_ptr<ComponentBase>

Definition at line 23 of file app.hpp.

◆ CapturedMouse

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>

Definition at line 22 of file captured_mouse.hpp.

◆ ComponentDecorator

using ComponentDecorator = std::function<Component(Component)>

Definition at line 33 of file component.hpp.

◆ ElementDecorator

using ElementDecorator = std::function<Element(Element)>

Definition at line 34 of file component.hpp.

◆ Components

using Components = std::vector<Component>

Definition at line 26 of file component_base.hpp.

◆ Sender

template<class T >
using Sender = std::unique_ptr<SenderImpl<T>>

Definition at line 52 of file receiver.hpp.

◆ Receiver

template<class T >
using Receiver = std::unique_ptr<ReceiverImpl<T>>

Definition at line 54 of file receiver.hpp.

◆ ScreenInteractive

using ScreenInteractive = App

Definition at line 10 of file screen_interactive.hpp.

◆ Closure

using Closure = std::function<void()>

Definition at line 13 of file task.hpp.

◆ Task

using Task = std::variant<Event, Closure, AnimationTask>

Definition at line 14 of file task.hpp.

◆ Element

typedef std::shared_ptr< Node > Element = std::shared_ptr<Node>

Definition at line 24 of file elements.hpp.

◆ Elements

typedef std::vector< Element > Elements = std::vector<Element>

Definition at line 25 of file elements.hpp.

◆ Decorator

Decorator = std::function<Element(Element)>

Definition at line 26 of file elements.hpp.

◆ GraphFunction

using GraphFunction = std::function<std::vector<int>(int, int)>

Definition at line 27 of file elements.hpp.

◆ Image

using Image = Surface

Definition at line 11 of file image.hpp.

◆ Pixel

using Pixel = Cell

Definition at line 10 of file pixel.hpp.

Enumeration Type Documentation

◆ WidthOrHeight

Enumerator
WIDTH 
HEIGHT 

Definition at line 176 of file elements.hpp.

◆ Constraint

enum Constraint
Enumerator
LESS_THAN 
EQUAL 
GREATER_THAN 

Definition at line 177 of file elements.hpp.

◆ AppDimension

enum class AppDimension
strong
Enumerator
FitComponent 
Fixed 
Fullscreen 
TerminalOutput 

Definition at line 65 of file app.cpp.

◆ WordBreakProperty

enum class WordBreakProperty : int8_t
strong
Enumerator
ALetter 
CR 
Double_Quote 
Extend 
ExtendNumLet 
Format 
Hebrew_Letter 
Katakana 
LF 
MidLetter 
MidNum 
MidNumLet 
Newline 
Numeric 
Regional_Indicator 
Single_Quote 
WSegSpace 
ZWJ 

Definition at line 38 of file string_internal.hpp.

Function Documentation

◆ Make()

template<class T , class... Args>
std::shared_ptr< T > Make ( Args &&... args)

Definition at line 28 of file component.hpp.

◆ operator|() [1/2]

Component operator| ( Component component,
ComponentDecorator decorator )

Definition at line 12 of file component/util.cpp.

◆ operator|() [2/2]

Component operator| ( Component component,
ElementDecorator decorator )

Definition at line 17 of file component/util.cpp.

◆ operator|=() [1/2]

Component & operator|= ( Component & component,
ComponentDecorator decorator )

Definition at line 22 of file component/util.cpp.

◆ operator|=() [2/2]

Component & operator|= ( Component & component,
ElementDecorator decorator )

Definition at line 28 of file component/util.cpp.

◆ Slider() [1/3]

template<typename T >
Component Slider ( SliderOption< T > options)

A slider in any direction.

Parameters
optionsThe options

Example

auto screen = App::TerminalOutput();
int value = 50;
auto slider = Slider({
.value = &value,
.min = 0,
.max = 100,
.increment= 20,
});
screen.Loop(slider);
Component Slider(SliderOption< T > options)
A slider in any direction.
int value
Definition elements.hpp:178

Definition at line 314 of file src/ftxui/component/slider.cpp.

◆ Slider() [2/3]

Component Slider ( ConstStringRef label,
Ref< float > value,
ConstRef< float > min = 0.f,
ConstRef< float > max = 100.f,
ConstRef< float > increment = 5.f )

Definition at line 271 of file src/ftxui/component/slider.cpp.

◆ Slider() [3/3]

Component Slider ( ConstStringRef label,
Ref< long > value,
ConstRef< long > min = 0L,
ConstRef< long > max = 100L,
ConstRef< long > increment = 5L )

Definition at line 284 of file src/ftxui/component/slider.cpp.

◆ ResizableSplit()

Component ResizableSplit ( ResizableSplitOption options)

A split in between two components.

Parameters
optionsall the parameters.

Example

auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
int left_size = 10;
auto component = ResizableSplit({
.main = left,
.back = right,
.direction = Direction::Left,
.main_size = &left_size,
.separator_func = [] { return separatorDouble(); },
});
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Element center(Element child)
Center an element horizontally and vertically.
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Component ResizableSplit(ResizableSplitOption options)
A split in between two components.
std::uint8_t left
Definition screen.cpp:142
std::uint8_t right
Definition screen.cpp:144

Output

left ║ right

Definition at line 170 of file src/ftxui/component/resizable_split.cpp.

◆ CatchEvent()

Component CatchEvent ( Component child,
std::function< bool(Event)>  )

◆ Collapsible()

Component Collapsible ( ConstStringRef label,
Component child,
Ref< bool > show )

A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.

Parameters
labelThe label of the checkbox.
childThe child to display.
showHold the state about whether the child is displayed or not.

Example

auto component = Collapsible("Show details", details);
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...

Output

▼ Show details
<details component>

Definition at line 33 of file src/ftxui/component/collapsible.cpp.

◆ MakeReceiver()

template<class T >
Receiver< T > MakeReceiver ( )

Definition at line 149 of file receiver.hpp.

◆ FTXUI_EXPORT() [1/2]

FTXUI_EXPORT ( DOM ) &

◆ separatorHSelector()

Element separatorHSelector ( float left,
float right,
Color unselected_color,
Color selected_color )

Draw a horizontal bar, with the area in between left/right colored differently.

Parameters
leftthe left limit of the active area.
rightthe right limit of the active area.
selected_colorthe color of the selected area.
unselected_colorthe color of the unselected area.

Example

Element document = separatorHSelector(2,5, Color::White, Color::Blue);
std::shared_ptr< Node > Element
Definition elements.hpp:24
FTXUI_EXPORT(DOM) Element separatorCharacter(std Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
Draw a horizontal bar, with the area in between left/right colored differently.

Definition at line 443 of file src/ftxui/dom/separator.cpp.

◆ separatorVSelector()

Element separatorVSelector ( float up,
float down,
Color unselected_color,
Color selected_color )

Draw an vertical bar, with the area in between up/downcolored differently.

Parameters
upthe left limit of the active area.
downthe right limit of the active area.
selected_colorthe color of the selected area.
unselected_colorthe color of the unselected area.

Example

Element document = separatorHSelector(2,5, Color::White, Color::Blue);

Definition at line 513 of file src/ftxui/dom/separator.cpp.

◆ canvas() [1/3]

Element canvas ( int width,
int height,
std::function< void(Canvas &)> fn )

Produce an element drawing a canvas of requested size.

Parameters
widththe width of the canvas.
heightthe height of the canvas.
fna function drawing the canvas.

Definition at line 923 of file src/ftxui/dom/canvas.cpp.

◆ flexbox()

Element flexbox ( Elements children,
FlexboxConfig config )

A container displaying elements on row/columns and capable of wrapping on the next column/row when full.

Parameters
childrenThe elements in the container
configThe option
Returns
The container.

Example

text("element 1"),
text("element 2"),
text("element 3"),
}, FlexboxConfig()
.Set(FlexboxConfig::Direction::Column)
.Set(FlexboxConfig::Wrap::WrapInversed)
.SetGapMainAxis(1)
.SetGapCrossAxis(1)
)
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:252

Definition at line 252 of file flexbox.cpp.

◆ hflow()

Element hflow ( Elements children)

A container displaying elements in rows from left to right. When filled, it starts on a new row below.

Parameters
childrenThe elements in the container
Returns
The container.

Example

text("element 1"),
text("element 2"),
text("element 3"),
});
FTXUI_EXPORT(DOM) Element gridbox(std Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:270

Definition at line 270 of file flexbox.cpp.

◆ vflow()

Element vflow ( Elements children)

A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.

Parameters
childrenThe elements in the container
Returns
The container.

Example

text("element 1"),
text("element 2"),
text("element 3"),
});
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Definition flexbox.cpp:290

Definition at line 290 of file flexbox.cpp.

◆ Render()

void Render ( Screen & screen,
Node * node,
Selection & selection )

Definition at line 105 of file node.cpp.

◆ GetNodeSelectedContent()

std::string GetNodeSelectedContent ( Screen & screen,
Node * node,
Selection & selection )

Definition at line 179 of file node.cpp.

◆ to_wstring() [1/3]

template<typename T >
FTXUI_EXPORT(SCREEN) std FTXUI_EXPORT(SCREEN) std std::wstring to_wstring ( T s)

Definition at line 18 of file string.hpp.

◆ to_wstring() [2/3]

template<>
std::wstring to_wstring ( const char * s)
inline

Definition at line 22 of file string.hpp.

◆ Utf8ToGlyphs()

std::vector< std::string > Utf8ToGlyphs ( std::string_view input)

Definition at line 1387 of file string.cpp.

◆ CellToGlyphIndex()

std::vector< int > CellToGlyphIndex ( std::string_view input)

Definition at line 1494 of file string.cpp.

◆ canvas() [2/3]

Element canvas ( ConstRef< Canvas > canvas)

Produce an element from a Canvas, or a reference to a Canvas.

Definition at line 899 of file src/ftxui/dom/canvas.cpp.

◆ canvas() [3/3]

Element canvas ( std::function< void(Canvas &)> fn)

Produce an element drawing a canvas.

Parameters
fna function drawing the canvas.

Definition at line 953 of file src/ftxui/dom/canvas.cpp.

◆ select()

Element select ( Element e)

Set the child to be the one focused among its siblings.

This is deprecated. Use focus instead.

Parameters
eThe element to be focused.

Definition at line 108 of file frame.cpp.

◆ frame()

Element frame ( Element child)

Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.

See also
frame
xframe
yframe

Definition at line 118 of file frame.cpp.

◆ xframe()

Element xframe ( Element child)

Same as frame, but only on the x-axis.

See also
frame
xframe
yframe

Definition at line 126 of file frame.cpp.

◆ yframe()

Element yframe ( Element child)

Same as frame, but only on the y-axis.

See also
frame
xframe
yframe

Definition at line 134 of file frame.cpp.

◆ graph()

Element graph ( GraphFunction graph_function)

Draw a graph using a GraphFunction.

Parameters
graph_functionthe function to be called to get the data.

Definition at line 78 of file src/ftxui/dom/graph.cpp.

◆ gridbox()

Element gridbox ( std::vector< Elements > lines)

A container displaying a grid of elements.

Parameters
linesA list of lines, each line being a list of elements.
Returns
The container.

Example

auto cell = [](const char* t) { return text(t) | border; };
auto document = gridbox({
{cell("north-west") , cell("north") , cell("north-east")} ,
{cell("west") , cell("center") , cell("east")} ,
{cell("south-west") , cell("south") , cell("south-east")} ,
});
Element border(Element child)
Draw a border around the element.
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.

Output:

╭──────────╮╭──────╮╭──────────╮
│north-west││north ││north-east│
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│west ││center││east │
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│south-west││south ││south-east│
╰──────────╯╰──────╯╰──────────╯

Definition at line 178 of file src/ftxui/dom/gridbox.cpp.

◆ hbox()

Element hbox ( Elements children)

A container displaying elements horizontally one by one.

Parameters
childrenThe elements in the container
Returns
The container.

Example

text("Left"),
text("Right"),
});
Element hbox(Elements children)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94

Definition at line 94 of file hbox.cpp.

◆ reflect()

Decorator reflect ( Box & box)

Definition at line 43 of file reflect.cpp.

◆ selectionStyleReset()

Element selectionStyleReset ( Element child)

Reset the selection style of an element.

Parameters
childThe input element.
Returns
The output element with the selection style reset.

Definition at line 55 of file selection_style.cpp.

◆ selectionBackgroundColor()

Decorator selectionBackgroundColor ( Color foreground)

Set the background color of an element when selected. Note that the style is applied on top of the existing style.

Definition at line 61 of file selection_style.cpp.

◆ selectionForegroundColor()

Decorator selectionForegroundColor ( Color foreground)

Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.

Definition at line 69 of file selection_style.cpp.

◆ selectionColor()

Decorator selectionColor ( Color foreground)

Set the color of an element when selected.

Parameters
foregroundThe color to be applied. Note that the style is applied on top of the existing style.

Definition at line 78 of file selection_style.cpp.

◆ selectionStyle()

Decorator selectionStyle ( std::function< void(Cell &)> style)

Set the style of an element when selected.

Parameters
styleThe style to be applied. Note that the style is applied on top of the existing style.

Definition at line 86 of file selection_style.cpp.

◆ GetColorInfo() [1/2]

ColorInfo GetColorInfo ( Color::Palette256 index)

Definition at line 273 of file color_info.cpp.

◆ GetColorInfo() [2/2]

ColorInfo GetColorInfo ( Color::Palette16 index)

Definition at line 277 of file color_info.cpp.

◆ ColorInfoSorted2D()

std::vector< std::vector< ColorInfo > > ColorInfoSorted2D ( )

Definition at line 282 of file color_info.cpp.

◆ EatCodePoint() [1/2]

bool EatCodePoint ( std::string_view input,
size_t start,
size_t * end,
uint32_t * ucs )

Definition at line 1175 of file string.cpp.

◆ EatCodePoint() [2/2]

bool EatCodePoint ( std::wstring_view input,
size_t start,
size_t * end,
uint32_t * ucs )

Definition at line 1245 of file string.cpp.

◆ IsCombining()

bool IsCombining ( uint32_t ucs)

Definition at line 1283 of file string.cpp.

◆ IsFullWidth()

bool IsFullWidth ( uint32_t ucs)

Definition at line 1287 of file string.cpp.

◆ IsControl()

bool IsControl ( uint32_t ucs)

Definition at line 1295 of file string.cpp.

◆ CodepointToWordBreakProperty()

WordBreakProperty CodepointToWordBreakProperty ( uint32_t codepoint)

Definition at line 1309 of file string.cpp.

◆ wchar_width()

int wchar_width ( wchar_t ucs)

Definition at line 1315 of file string.cpp.

◆ wstring_width()

int wstring_width ( const std::wstring & text)

Definition at line 1319 of file string.cpp.

◆ string_width()

int string_width ( std::string_view input)

Definition at line 1337 of file string.cpp.

◆ GlyphPrevious()

size_t GlyphPrevious ( std::string_view input,
size_t start )

Definition at line 1429 of file string.cpp.

◆ GlyphNext()

size_t GlyphNext ( std::string_view input,
size_t start )

Definition at line 1454 of file string.cpp.

◆ GlyphIterate()

size_t GlyphIterate ( std::string_view input,
int glyph_offset,
size_t start )

Definition at line 1480 of file string.cpp.

◆ GlyphCount()

int GlyphCount ( std::string_view input)

Definition at line 1535 of file string.cpp.

◆ Utf8ToWordBreakProperty()

std::vector< WordBreakProperty > Utf8ToWordBreakProperty ( std::string_view input)

Definition at line 1563 of file string.cpp.

◆ to_string()

std::string to_string ( std::wstring_view s)

Convert a std::wstring into a UTF8 std::string.

Definition at line 1594 of file string.cpp.

◆ to_wstring() [3/3]

std::wstring to_wstring ( std::string_view s)

Convert a UTF8 std::string into a std::wstring.

Definition at line 1666 of file string.cpp.

◆ IsWordBreakingCharacter()

bool IsWordBreakingCharacter ( std::string_view input,
size_t glyph_index )

Variable Documentation

◆ show

const bool* show

Definition at line 159 of file component.hpp.

◆ direction

Direction direction

Definition at line 82 of file elements.hpp.

◆ Color

Color
default

Build a transparent color.

Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.

Build a color using Palette256 colors.

Build a color using the Palette16 colors.

Parameters
redThe quantity of red [0,255]
greenThe quantity of green [0,255]
blueThe quantity of blue [0,255]
alphaThe quantity of alpha [0,255]

Definition at line 91 of file elements.hpp.

◆ image_index

size_t image_index

Definition at line 96 of file elements.hpp.

◆ y

float y

Definition at line 126 of file elements.hpp.

◆ Constraint

Definition at line 178 of file elements.hpp.

◆ value

int value

Definition at line 178 of file elements.hpp.

◆ element

const Element& element

Definition at line 95 of file node.hpp.

◆ node

Node* node

Definition at line 96 of file node.hpp.

◆ g_uniformize

const std::map<std::string, std::string> g_uniformize

Definition at line 19 of file terminal_input_parser.cpp.

◆ palette256

const std::array<ColorInfo, 256> palette256

Definition at line 14 of file color_info.cpp.