FTXUI 6.1.9
C++ functional terminal UI.
|
Please check the tutorial of the ftxui/dom
module.
Classes | |
struct | Canvas |
Canvas is a drawable buffer associated with drawing operations. More... | |
struct | FlexboxConfig |
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container. More... | |
struct | LinearGradient |
A class representing the settings for linear-gradient color effect. More... | |
class | Node |
Node is the base class for all elements in the DOM tree. More... | |
struct | Requirement |
Requirement is a structure that defines the layout requirements for a Node in the terminal user interface. More... | |
class | Selection |
Represents a selection in a terminal user interface. More... | |
class | Table |
Table is a utility to draw tables. More... | |
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... | |
Functions | |
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 Pixel &pixel) |
Same as border but with a constant Pixel 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 | window (Element title, Element content, BorderStyle border) |
Draw window with a title and a border around the element. | |
Element | clear_under (Element element) |
Before drawing |child|, clear the pixels 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 | xflex (Element child) |
Expand/Minimize if possible/needed on the X axis. | |
Element | yflex (Element child) |
Expand/Minimize if possible/needed on the Y axis. | |
Element | flex_grow (Element child) |
Expand if possible. | |
Element | xflex_grow (Element child) |
Expand if possible on the X axis. | |
Element | yflex_grow (Element child) |
Expand if possible on the Y axis. | |
Element | flex_shrink (Element child) |
Minimize if needed. | |
Element | xflex_shrink (Element child) |
Minimize if needed on the X axis. | |
Element | yflex_shrink (Element child) |
Minimize if needed on the Y axis. | |
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 | 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 | hyperlink (std::string 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 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 (const std::string &the_text) |
Return an element drawing the paragraph on multiple lines. | |
Element | paragraphAlignLeft (const std::string &the_text) |
Return an element drawing the paragraph on multiple lines, aligned on the left. | |
Element | paragraphAlignRight (const std::string &the_text) |
Return an element drawing the paragraph on multiple lines, aligned on the right. | |
Element | paragraphAlignCenter (const std::string &the_text) |
Return an element drawing the paragraph on multiple lines, aligned on the center. | |
Element | paragraphAlignJustify (const std::string &the_text) |
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center. | |
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 | 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 value) |
Draw a vertical or horizontal separation in between two other elements. | |
Element | separator (Pixel 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 text) |
Display a piece of UTF8 encoded unicode text. | |
Element | text (std::wstring text) |
Display a piece of unicode text. | |
Element | vtext (std::string text) |
Display a piece of unicode text vertically. | |
Element | vtext (std::wstring 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. | |
Element & | operator|= (Element &e, Decorator d) |
Apply a decorator to an element. | |
Element | emptyElement () |
Element | vbox (Elements children) |
A container displaying elements vertically one by one. | |
void | SetColorSupport (Color color) |
Override terminal color support in case auto-detection fails. | |
struct ftxui::Canvas |
Canvas is a drawable buffer associated with drawing operations.
Canvas is a drawable area that can be used to create complex graphics. It supports drawing points, lines, circles, ellipses, text, and images using braille, block, or normal characters.
Note: A terminal contains cells. A cells is a unit of:
You need to multiply the x coordinate by 2 and the y coordinate by 4 to get the correct position in the terminal.
Definition at line 38 of file canvas.hpp.
Public Types | |
using | Stylizer = std::function<void(Pixel&)> |
Public Member Functions | |
Canvas ()=default | |
Canvas (int width, int height) | |
Constructor. | |
int | width () const |
int | height () const |
Pixel | GetPixel (int x, int y) const |
Get the content of a cell. | |
void | DrawPointOn (int x, int y) |
Draw a braille dot. | |
void | DrawPointOff (int x, int y) |
Erase a braille dot. | |
void | DrawPointToggle (int x, int y) |
Toggle a braille dot. A filled one will be erased, and the other will be drawn. | |
void | DrawPoint (int x, int y, bool value) |
Draw a braille dot. | |
void | DrawPoint (int x, int y, bool value, const Stylizer &s) |
Draw a braille dot. | |
void | DrawPoint (int x, int y, bool value, const Color &color) |
Draw a braille dot. | |
void | DrawPointLine (int x1, int y1, int x2, int y2) |
Draw a line made of braille dots. | |
void | DrawPointLine (int x1, int y1, int x2, int y2, const Stylizer &s) |
Draw a line made of braille dots. | |
void | DrawPointLine (int x1, int y1, int x2, int y2, const Color &color) |
Draw a line made of braille dots. | |
void | DrawPointCircle (int x, int y, int radius) |
Draw a circle made of braille dots. | |
void | DrawPointCircle (int x, int y, int radius, const Stylizer &s) |
Draw a circle made of braille dots. | |
void | DrawPointCircle (int x, int y, int radius, const Color &color) |
Draw a circle made of braille dots. | |
void | DrawPointCircleFilled (int x, int y, int radius) |
Draw a filled circle made of braille dots. | |
void | DrawPointCircleFilled (int x, int y, int radius, const Stylizer &s) |
Draw a filled circle made of braille dots. | |
void | DrawPointCircleFilled (int x, int y, int radius, const Color &color) |
Draw a filled circle made of braille dots. | |
void | DrawPointEllipse (int x, int y, int r1, int r2) |
Draw an ellipse made of braille dots. | |
void | DrawPointEllipse (int x, int y, int r1, int r2, const Color &color) |
Draw an ellipse made of braille dots. | |
void | DrawPointEllipse (int x, int y, int r1, int r2, const Stylizer &s) |
Draw an ellipse made of braille dots. | |
void | DrawPointEllipseFilled (int x, int y, int r1, int r2) |
Draw a filled ellipse made of braille dots. | |
void | DrawPointEllipseFilled (int x, int y, int r1, int r2, const Color &color) |
Draw a filled ellipse made of braille dots. | |
void | DrawPointEllipseFilled (int x, int y, int r1, int r2, const Stylizer &s) |
Draw a filled ellipse made of braille dots. | |
void | DrawBlockOn (int x, int y) |
Draw a block. | |
void | DrawBlockOff (int x, int y) |
Erase a block. | |
void | DrawBlockToggle (int x, int y) |
Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled. | |
void | DrawBlock (int x, int y, bool value) |
Draw a block. | |
void | DrawBlock (int x, int y, bool value, const Stylizer &s) |
Draw a block. | |
void | DrawBlock (int x, int y, bool value, const Color &color) |
Draw a block. | |
void | DrawBlockLine (int x1, int y1, int x2, int y2) |
Draw a line made of block characters. | |
void | DrawBlockLine (int x1, int y1, int x2, int y2, const Stylizer &s) |
Draw a line made of block characters. | |
void | DrawBlockLine (int x1, int y1, int x2, int y2, const Color &color) |
Draw a line made of block characters. | |
void | DrawBlockCircle (int x1, int y1, int radius) |
Draw a circle made of block characters. | |
void | DrawBlockCircle (int x1, int y1, int radius, const Stylizer &s) |
Draw a circle made of block characters. | |
void | DrawBlockCircle (int x1, int y1, int radius, const Color &color) |
Draw a circle made of block characters. | |
void | DrawBlockCircleFilled (int x1, int y1, int radius) |
Draw a filled circle made of block characters. | |
void | DrawBlockCircleFilled (int x1, int y1, int radius, const Stylizer &s) |
Draw a filled circle made of block characters. | |
void | DrawBlockCircleFilled (int x1, int y1, int radius, const Color &color) |
Draw a filled circle made of block characters. | |
void | DrawBlockEllipse (int x1, int y1, int r1, int r2) |
Draw an ellipse made of block characters. | |
void | DrawBlockEllipse (int x1, int y1, int r1, int r2, const Stylizer &s) |
Draw an ellipse made of block characters. | |
void | DrawBlockEllipse (int x1, int y1, int r1, int r2, const Color &color) |
Draw an ellipse made of block characters. | |
void | DrawBlockEllipseFilled (int x1, int y1, int r1, int r2) |
Draw a filled ellipse made of block characters. | |
void | DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Stylizer &s) |
Draw a filled ellipse made of block characters. | |
void | DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Color &color) |
Draw a filled ellipse made of block characters. | |
void | DrawText (int x, int y, const std::string &value) |
Draw a piece of text. | |
void | DrawText (int x, int y, const std::string &value, const Color &color) |
Draw a piece of text. | |
void | DrawText (int x, int y, const std::string &value, const Stylizer &style) |
Draw a piece of text. | |
void | DrawPixel (int x, int y, const Pixel &) |
Directly draw a predefined pixel at the given coordinate. | |
void | DrawImage (int x, int y, const Image &) |
Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordinates to align the image however you like - only the 'visible' portion will be drawn. | |
void | Style (int x, int y, const Stylizer &style) |
Modify a pixel at a given location. | |
Definition at line 48 of file canvas.hpp.
|
default |
Canvas | ( | int | width, |
int | height ) |
Constructor.
width | the width of the canvas. A cell is a 2x4 braille dot. |
height | the height of the canvas. A cell is a 2x4 braille dot. |
Definition at line 90 of file src/ftxui/dom/canvas.cpp.
|
inline |
Definition at line 44 of file canvas.hpp.
|
inline |
Definition at line 45 of file canvas.hpp.
Pixel GetPixel | ( | int | x, |
int | y ) const |
Get the content of a cell.
x | the x coordinate of the cell. |
y | the y coordinate of the cell. |
Definition at line 98 of file src/ftxui/dom/canvas.cpp.
void DrawPointOn | ( | int | x, |
int | y ) |
Draw a braille dot.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
Definition at line 137 of file src/ftxui/dom/canvas.cpp.
void DrawPointOff | ( | int | x, |
int | y ) |
Erase a braille dot.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
Definition at line 154 of file src/ftxui/dom/canvas.cpp.
void DrawPointToggle | ( | int | x, |
int | y ) |
Toggle a braille dot. A filled one will be erased, and the other will be drawn.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
Definition at line 172 of file src/ftxui/dom/canvas.cpp.
void DrawPoint | ( | int | x, |
int | y, | ||
bool | value ) |
Draw a braille dot.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
value | whether the dot is filled or not. |
Definition at line 107 of file src/ftxui/dom/canvas.cpp.
void DrawPoint | ( | int | x, |
int | y, | ||
bool | value, | ||
const Stylizer & | style ) |
Draw a braille dot.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
value | whether the dot is filled or not. |
style | the style of the cell. |
Definition at line 125 of file src/ftxui/dom/canvas.cpp.
void DrawPoint | ( | int | x, |
int | y, | ||
bool | value, | ||
const Color & | color ) |
Draw a braille dot.
x | the x coordinate of the dot. |
y | the y coordinate of the dot. |
value | whether the dot is filled or not. |
color | the color of the dot. |
Definition at line 116 of file src/ftxui/dom/canvas.cpp.
void DrawPointLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Draw a line made of braille dots.
x1 | the x coordinate of the first dot. |
y1 | the y coordinate of the first dot. |
x2 | the x coordinate of the second dot. |
y2 | the y coordinate of the second dot. |
Definition at line 191 of file src/ftxui/dom/canvas.cpp.
void DrawPointLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
const Stylizer & | style ) |
Draw a line made of braille dots.
x1 | the x coordinate of the first dot. |
y1 | the y coordinate of the first dot.o |
x2 | the x coordinate of the second dot. |
y2 | the y coordinate of the second dot. |
style | the style of the line. |
Definition at line 212 of file src/ftxui/dom/canvas.cpp.
void DrawPointLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
const Color & | color ) |
Draw a line made of braille dots.
x1 | the x coordinate of the first dot. |
y1 | the y coordinate of the first dot. |
x2 | the x coordinate of the second dot. |
y2 | the y coordinate of the second dot. |
color | the color of the line. |
Definition at line 201 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircle | ( | int | x, |
int | y, | ||
int | radius ) |
Draw a circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
Definition at line 249 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
const Stylizer & | style ) |
Draw a circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
style | the style of the circle. |
Definition at line 268 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
const Color & | color ) |
Draw a circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
color | the color of the circle. |
Definition at line 258 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircleFilled | ( | int | x, |
int | y, | ||
int | radius ) |
Draw a filled circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
Definition at line 276 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircleFilled | ( | int | x, |
int | y, | ||
int | radius, | ||
const Stylizer & | style ) |
Draw a filled circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
style | the style of the circle. |
Definition at line 298 of file src/ftxui/dom/canvas.cpp.
void DrawPointCircleFilled | ( | int | x, |
int | y, | ||
int | radius, | ||
const Color & | color ) |
Draw a filled circle made of braille dots.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
color | the color of the circle. |
Definition at line 285 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipse | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2 ) |
Draw an ellipse made of braille dots.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
Definition at line 310 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipse | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2, | ||
const Color & | color ) |
Draw an ellipse made of braille dots.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
color | the color of the ellipse. |
Definition at line 320 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipse | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2, | ||
const Stylizer & | s ) |
Draw an ellipse made of braille dots.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
s | the style of the ellipse. |
Definition at line 335 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipseFilled | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2 ) |
Draw a filled ellipse made of braille dots.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
Definition at line 374 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipseFilled | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2, | ||
const Color & | color ) |
Draw a filled ellipse made of braille dots.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
color | the color of the ellipse. |
Definition at line 384 of file src/ftxui/dom/canvas.cpp.
void DrawPointEllipseFilled | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2, | ||
const Stylizer & | s ) |
Draw a filled ellipse made of braille dots.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
s | the style of the ellipse. |
Definition at line 399 of file src/ftxui/dom/canvas.cpp.
void DrawBlockOn | ( | int | x, |
int | y ) |
Draw a block.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
Definition at line 468 of file src/ftxui/dom/canvas.cpp.
void DrawBlockOff | ( | int | x, |
int | y ) |
Erase a block.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
Definition at line 488 of file src/ftxui/dom/canvas.cpp.
void DrawBlockToggle | ( | int | x, |
int | y ) |
Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
Definition at line 509 of file src/ftxui/dom/canvas.cpp.
void DrawBlock | ( | int | x, |
int | y, | ||
bool | value ) |
Draw a block.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
value | whether the block is filled or not. |
Definition at line 438 of file src/ftxui/dom/canvas.cpp.
void DrawBlock | ( | int | x, |
int | y, | ||
bool | value, | ||
const Stylizer & | style ) |
Draw a block.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
value | whether the block is filled or not. |
style | the style of the block. |
Definition at line 456 of file src/ftxui/dom/canvas.cpp.
void DrawBlock | ( | int | x, |
int | y, | ||
bool | value, | ||
const Color & | color ) |
Draw a block.
x | the x coordinate of the block. |
y | the y coordinate of the block. |
value | whether the block is filled or not. |
color | the color of the block. |
Definition at line 447 of file src/ftxui/dom/canvas.cpp.
void DrawBlockLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 ) |
Draw a line made of block characters.
x1 | the x coordinate of the first point of the line. |
y1 | the y coordinate of the first point of the line. |
x2 | the x coordinate of the second point of the line. |
y2 | the y coordinate of the second point of the line. |
Definition at line 531 of file src/ftxui/dom/canvas.cpp.
void DrawBlockLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
const Stylizer & | style ) |
Draw a line made of block characters.
x1 | the x coordinate of the first point of the line. |
y1 | the y coordinate of the first point of the line. |
x2 | the x coordinate of the second point of the line. |
y2 | the y coordinate of the second point of the line. |
style | the style of the line. |
Definition at line 552 of file src/ftxui/dom/canvas.cpp.
void DrawBlockLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
const Color & | color ) |
Draw a line made of block characters.
x1 | the x coordinate of the first point of the line. |
y1 | the y coordinate of the first point of the line. |
x2 | the x coordinate of the second point of the line. |
y2 | the y coordinate of the second point of the line. |
color | the color of the line. |
Definition at line 541 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircle | ( | int | x, |
int | y, | ||
int | radius ) |
Draw a circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
Definition at line 592 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
const Stylizer & | style ) |
Draw a circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
style | the style of the circle. |
Definition at line 611 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
const Color & | color ) |
Draw a circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
color | the color of the circle. |
Definition at line 601 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircleFilled | ( | int | x, |
int | y, | ||
int | radius ) |
Draw a filled circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
Definition at line 619 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircleFilled | ( | int | x, |
int | y, | ||
int | radius, | ||
const Stylizer & | s ) |
Draw a filled circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
s | the style of the circle. |
Definition at line 641 of file src/ftxui/dom/canvas.cpp.
void DrawBlockCircleFilled | ( | int | x, |
int | y, | ||
int | radius, | ||
const Color & | color ) |
Draw a filled circle made of block characters.
x | the x coordinate of the center of the circle. |
y | the y coordinate of the center of the circle. |
radius | the radius of the circle. |
color | the color of the circle. |
Definition at line 628 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipse | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2 ) |
Draw an ellipse made of block characters.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
Definition at line 653 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipse | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2, | ||
const Stylizer & | s ) |
Draw an ellipse made of block characters.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
s | the style of the ellipse. |
Definition at line 678 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipse | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2, | ||
const Color & | color ) |
Draw an ellipse made of block characters.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
color | the color of the ellipse. |
Definition at line 663 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipseFilled | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2 ) |
Draw a filled ellipse made of block characters.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
Definition at line 719 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipseFilled | ( | int | x1, |
int | y1, | ||
int | r1, | ||
int | r2, | ||
const Stylizer & | s ) |
Draw a filled ellipse made of block characters.
x1 | the x coordinate of the center of the ellipse. |
y1 | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
s | the style of the ellipse. |
Definition at line 744 of file src/ftxui/dom/canvas.cpp.
void DrawBlockEllipseFilled | ( | int | x, |
int | y, | ||
int | r1, | ||
int | r2, | ||
const Color & | color ) |
Draw a filled ellipse made of block characters.
x | the x coordinate of the center of the ellipse. |
y | the y coordinate of the center of the ellipse. |
r1 | the radius of the ellipse along the x axis. |
r2 | the radius of the ellipse along the y axis. |
color | the color of the ellipse. |
Definition at line 729 of file src/ftxui/dom/canvas.cpp.
void DrawText | ( | int | x, |
int | y, | ||
const std::string & | value ) |
Draw a piece of text.
x | the x coordinate of the text. |
y | the y coordinate of the text. |
value | the text to draw. |
Definition at line 785 of file src/ftxui/dom/canvas.cpp.
void DrawText | ( | int | x, |
int | y, | ||
const std::string & | value, | ||
const Color & | color ) |
Draw a piece of text.
x | the x coordinate of the text. |
y | the y coordinate of the text. |
value | the text to draw. |
color | the color of the text. |
Definition at line 794 of file src/ftxui/dom/canvas.cpp.
void DrawText | ( | int | x, |
int | y, | ||
const std::string & | value, | ||
const Stylizer & | style ) |
Draw a piece of text.
x | the x coordinate of the text. |
y | the y coordinate of the text. |
value | the text to draw. |
style | the style of the text. |
Definition at line 806 of file src/ftxui/dom/canvas.cpp.
void DrawPixel | ( | int | x, |
int | y, | ||
const Pixel & | p ) |
Directly draw a predefined pixel at the given coordinate.
x | the x coordinate of the pixel. |
y | the y coordinate of the pixel. |
p | the pixel to draw. |
Definition at line 827 of file src/ftxui/dom/canvas.cpp.
void DrawImage | ( | int | x, |
int | y, | ||
const Image & | image ) |
Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordinates to align the image however you like - only the 'visible' portion will be drawn.
x | the x coordinate corresponding to the top-left corner of the image. |
y | the y coordinate corresponding to the top-left corner of the image. |
image | the image to draw. |
Definition at line 839 of file src/ftxui/dom/canvas.cpp.
void Style | ( | int | x, |
int | y, | ||
const Stylizer & | style ) |
Modify a pixel at a given location.
style | a function that modifies the pixel. |
Definition at line 861 of file src/ftxui/dom/canvas.cpp.
struct ftxui::FlexboxConfig |
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container.
It allows you to specify the direction of the flex items, whether they should wrap, how they should be justified along the main axis, and how they should be aligned along the cross axis. It also includes properties for gaps between flex items in both the main and cross axes. This structure is used to configure the layout behavior of flexbox containers in a terminal user interface.
Definition at line 28 of file flexbox_config.hpp.
|
strong |
This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside wrapping) single-direction layout concept. Think of flex items as primarily laying out either in horizontal rows or vertical columns.
Definition at line 33 of file flexbox_config.hpp.
|
strong |
By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
Enumerator | |
---|---|
NoWrap | Flex items will all try to fit onto one line. |
Wrap | Flex items will wrap onto multiple lines. |
WrapInversed | Flex items will wrap onto multiple lines, but in reverse order. |
Definition at line 44 of file flexbox_config.hpp.
|
strong |
This defines the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow the line.
Definition at line 57 of file flexbox_config.hpp.
|
strong |
This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).
Definition at line 84 of file flexbox_config.hpp.
|
strong |
Definition at line 95 of file flexbox_config.hpp.
FlexboxConfig & Set | ( | FlexboxConfig::Direction | d | ) |
Set the flexbox direction.
Definition at line 9 of file flexbox_config.cpp.
FlexboxConfig & Set | ( | FlexboxConfig::Wrap | w | ) |
Set the flexbox wrap.
Definition at line 15 of file flexbox_config.cpp.
FlexboxConfig & Set | ( | FlexboxConfig::JustifyContent | j | ) |
Set the flexbox justify content.
Definition at line 21 of file flexbox_config.cpp.
FlexboxConfig & Set | ( | FlexboxConfig::AlignItems | a | ) |
Set the flexbox align items.
Definition at line 27 of file flexbox_config.cpp.
FlexboxConfig & Set | ( | FlexboxConfig::AlignContent | a | ) |
Set the flexbox align content.
Definition at line 33 of file flexbox_config.cpp.
FlexboxConfig & SetGap | ( | int | gap_x, |
int | gap_y ) |
Set the flexbox flex direction.
Definition at line 39 of file flexbox_config.cpp.
Direction direction = Direction::Row |
Definition at line 40 of file flexbox_config.hpp.
Wrap wrap = Wrap::Wrap |
Definition at line 50 of file flexbox_config.hpp.
JustifyContent justify_content = JustifyContent::FlexStart |
Definition at line 79 of file flexbox_config.hpp.
AlignItems align_items = AlignItems::FlexStart |
Definition at line 90 of file flexbox_config.hpp.
AlignContent align_content = AlignContent::FlexStart |
Definition at line 106 of file flexbox_config.hpp.
int gap_x = 0 |
Definition at line 108 of file flexbox_config.hpp.
int gap_y = 0 |
Definition at line 109 of file flexbox_config.hpp.
struct ftxui::LinearGradient |
A class representing the settings for linear-gradient color effect.
Example:
There are also shorthand constructors:
Definition at line 32 of file linear_gradient.hpp.
Public Member Functions | |
LinearGradient () | |
Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGradient::Stop(). Example: | |
LinearGradient (Color begin, Color end) | |
Build a gradient with two colors. | |
LinearGradient (float angle, Color begin, Color end) | |
Build a gradient with two colors and an angle. | |
LinearGradient & | Angle (float angle) |
Set the angle of the gradient. | |
LinearGradient & | Stop (Color color, float position) |
Add a color stop to the gradient. | |
LinearGradient & | Stop (Color color) |
Add a color stop to the gradient. | |
Public Attributes | |
float | angle = 0.f |
std::vector< Stop > | stops |
|
default |
Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGradient::Stop(). Example:
LinearGradient | ( | Color | begin, |
Color | end ) |
Build a gradient with two colors.
begin | The color at the beginning of the gradient. |
end | The color at the end of the gradient. |
Definition at line 197 of file src/ftxui/dom/linear_gradient.cpp.
LinearGradient | ( | float | a, |
Color | begin, | ||
Color | end ) |
Build a gradient with two colors and an angle.
a | The angle of the gradient. |
begin | The color at the beginning of the gradient. |
end | The color at the end of the gradient. |
Definition at line 204 of file src/ftxui/dom/linear_gradient.cpp.
LinearGradient & Angle | ( | float | a | ) |
Set the angle of the gradient.
a | The angle of the gradient. |
Definition at line 212 of file src/ftxui/dom/linear_gradient.cpp.
LinearGradient & Stop | ( | Color | c, |
float | p ) |
Add a color stop to the gradient.
c | The color of the stop. |
p | The position of the stop. |
Definition at line 220 of file src/ftxui/dom/linear_gradient.cpp.
LinearGradient & Stop | ( | Color | c | ) |
Add a color stop to the gradient.
c | The color of the stop. |
Definition at line 229 of file src/ftxui/dom/linear_gradient.cpp.
float angle = 0.f |
Definition at line 33 of file linear_gradient.hpp.
std::vector<Stop> stops |
Definition at line 43 of file linear_gradient.hpp.
class ftxui::Node |
Node is the base class for all elements in the DOM tree.
It represents a single node in the document object model (DOM) and provides the basic structure for layout and rendering. It contains methods for computing layout requirements, setting the box dimensions, selecting content, rendering to the screen, and checking the layout status. It typically contains child elements, which are also instances of Node.
Users are expected to derive from this class to create custom elements.
A list of builtin elements can be found in the elements.hpp
file.
Public Member Functions | |
Node () | |
Node (Elements children) | |
Node (const Node &)=delete | |
Node (const Node &&)=delete | |
Node & | operator= (const Node &)=delete |
Node & | operator= (const Node &&)=delete |
virtual | ~Node () |
virtual void | ComputeRequirement () |
Compute how much space an element needs. | |
Requirement | requirement () |
virtual void | SetBox (Box box) |
Assign a position and a dimension to an element for drawing. | |
virtual void | Select (Selection &selection) |
Compute the selection of an element. | |
virtual void | Render (Screen &screen) |
Display an element on a ftxui::Screen. | |
virtual std::string | GetSelectedContent (Selection &selection) |
virtual void | Check (Status *status) |
Protected Attributes | |
Elements | children_ |
Requirement | requirement_ |
Box | box_ |
|
default |
|
virtualdefault |
|
virtual |
Compute how much space an element needs.
Reimplemented in NodeDecorator.
|
inline |
|
virtual |
Assign a position and a dimension to an element for drawing.
Reimplemented in NodeDecorator.
|
virtual |
|
virtual |
Display an element on a ftxui::Screen.
|
virtual |
|
protected |
struct ftxui::Requirement |
Requirement is a structure that defines the layout requirements for a Node in the terminal user interface.
It specifies the minimum size required to fully draw the element,
Definition at line 18 of file requirement.hpp.
Public Attributes | |
int | min_x = 0 |
int | min_y = 0 |
int | flex_grow_x = 0 |
int | flex_grow_y = 0 |
int | flex_shrink_x = 0 |
int | flex_shrink_y = 0 |
Focused | focused |
int min_x = 0 |
Definition at line 20 of file requirement.hpp.
int min_y = 0 |
Definition at line 21 of file requirement.hpp.
int flex_grow_x = 0 |
Definition at line 24 of file requirement.hpp.
int flex_grow_y = 0 |
Definition at line 25 of file requirement.hpp.
int flex_shrink_x = 0 |
Definition at line 26 of file requirement.hpp.
int flex_shrink_y = 0 |
Definition at line 27 of file requirement.hpp.
Focused focused |
Definition at line 51 of file requirement.hpp.
class ftxui::Selection |
Represents a selection in a terminal user interface.
Selection is a class that represents the two endpoints of a selection in a terminal user interface.
Definition at line 22 of file selection.hpp.
Public Member Functions | |
Selection () | |
Create an empty selection. | |
Selection (int start_x, int start_y, int end_x, int end_y) | |
Create a selection. | |
const Box & | GetBox () const |
Get the box of the selection. | |
Selection | SaturateHorizontal (Box box) |
Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children. | |
Selection | SaturateVertical (Box box) |
Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children. | |
bool | IsEmpty () const |
void | AddPart (const std::string &part, int y, int left, int right) |
std::string | GetParts () |
|
default |
Create an empty selection.
Selection | ( | int | start_x, |
int | start_y, | ||
int | end_x, | ||
int | end_y ) |
Create a selection.
start_x | The x coordinate of the start of the selection. |
start_y | The y coordinate of the start of the selection. |
end_x | The x coordinate of the end of the selection. |
end_y | The y coordinate of the end of the selection. |
Definition at line 34 of file src/ftxui/dom/selection.cpp.
const Box & GetBox | ( | ) | const |
Get the box of the selection.
Definition at line 67 of file src/ftxui/dom/selection.cpp.
Saturate the selection to be inside the box. This is called by hbox
to propagate the selection to its children.
box | The box to saturate the selection in. |
Definition at line 75 of file src/ftxui/dom/selection.cpp.
Saturate the selection to be inside the box. This is called by vbox
to propagate the selection to its children.
box | The box to saturate the selection in. |
Definition at line 113 of file src/ftxui/dom/selection.cpp.
|
inline |
Definition at line 31 of file selection.hpp.
void AddPart | ( | const std::string & | part, |
int | y, | ||
int | left, | ||
int | right ) |
Definition at line 146 of file src/ftxui/dom/selection.cpp.
|
inline |
Definition at line 34 of file selection.hpp.
class ftxui::Table |
Table is a utility to draw tables.
example
Public Member Functions | |
Table () | |
Create an empty table. | |
Table (std::vector< std::vector< std::string > >) | |
Create a table from a vector of vector of string. | |
Table (std::vector< std::vector< Element > >) | |
Create a table from a vector of vector of Element. | |
Table (std::initializer_list< std::vector< std::string > > init) | |
TableSelection | SelectAll () |
Select all the table. | |
TableSelection | SelectCell (int column, int row) |
Select a cell of the table. | |
TableSelection | SelectRow (int row_index) |
Select a row of the table. | |
TableSelection | SelectRows (int row_min, int row_max) |
Select a range of rows of the table. | |
TableSelection | SelectColumn (int column_index) |
Select a column of the table. | |
TableSelection | SelectColumns (int column_min, int column_max) |
Select a range of columns of the table. | |
TableSelection | SelectRectangle (int column_min, int column_max, int row_min, int row_max) |
Select a rectangle of the table. | |
Element | Render () |
Render the table. | |
Table | ( | ) |
Create an empty table.
Definition at line 47 of file src/ftxui/dom/table.cpp.
|
explicit |
Create a table from a vector of vector of string.
input | The input data. |
Definition at line 53 of file src/ftxui/dom/table.cpp.
Create a table from a vector of vector of Element.
input | The input elements. |
Definition at line 69 of file src/ftxui/dom/table.cpp.
Table | ( | std::initializer_list< std::vector< std::string > > | init | ) |
Definition at line 75 of file src/ftxui/dom/table.cpp.
TableSelection SelectAll | ( | ) |
Select all the table.
Definition at line 200 of file src/ftxui/dom/table.cpp.
TableSelection SelectCell | ( | int | column, |
int | row ) |
Select a cell of the table.
column | The column of the cell to select. |
row | The row of the cell to select. |
Definition at line 169 of file src/ftxui/dom/table.cpp.
TableSelection SelectRow | ( | int | index | ) |
Select a row of the table.
index | The index of the row to select. |
Definition at line 138 of file src/ftxui/dom/table.cpp.
TableSelection SelectRows | ( | int | row_min, |
int | row_max ) |
Select a range of rows of the table.
row_min | The first row to select. |
row_max | The last row to select. |
Definition at line 146 of file src/ftxui/dom/table.cpp.
TableSelection SelectColumn | ( | int | index | ) |
Select a column of the table.
index | The index of the column to select. |
Definition at line 153 of file src/ftxui/dom/table.cpp.
TableSelection SelectColumns | ( | int | column_min, |
int | column_max ) |
Select a range of columns of the table.
column_min | The first column to select. |
column_max | The last column to select. |
Definition at line 161 of file src/ftxui/dom/table.cpp.
TableSelection SelectRectangle | ( | int | column_min, |
int | column_max, | ||
int | row_min, | ||
int | row_max ) |
Select a rectangle of the table.
column_min | The first column to select. |
column_max | The last column to select. |
row_min | The first row to select. |
row_max | The last row to select. |
Definition at line 179 of file src/ftxui/dom/table.cpp.
Element Render | ( | ) |
Render the table.
Definition at line 212 of file src/ftxui/dom/table.cpp.
|
strong |
Direction is an enumeration that represents the four cardinal directions.
Enumerator | |
---|---|
Up | |
Down | |
Left | |
Right |
Definition at line 13 of file direction.hpp.
enum BorderStyle |
BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI.
BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. It is used to define the visual appearance of borders around elements, such as windows, frames, or separators.
Enumerator | |
---|---|
LIGHT | |
DASHED | |
HEAVY | |
DOUBLE | |
ROUNDED | |
EMPTY |
Definition at line 35 of file elements.hpp.
Enable character to be automatically merged with others nearby.
Definition at line 17 of file automerge.cpp.
Draw a border around the element.
Add a border around an element
Definition at line 227 of file src/ftxui/dom/border.cpp.
Same as border but with a constant Pixel around the element.
Definition at line 234 of file src/ftxui/dom/border.cpp.
Decorator borderStyled | ( | BorderStyle | style | ) |
Same as border but with different styles.
Definition at line 243 of file src/ftxui/dom/border.cpp.
Same as border but with a foreground color.
Definition at line 252 of file src/ftxui/dom/border.cpp.
Decorator borderStyled | ( | BorderStyle | style, |
Color | foreground_color ) |
Same as border but with a foreground color and a different style.
Definition at line 262 of file src/ftxui/dom/border.cpp.
Draw a dashed border around the element.
Add a border around an element
Definition at line 300 of file src/ftxui/dom/border.cpp.
Draw a light border around the element.
Add a border around an element
Definition at line 335 of file src/ftxui/dom/border.cpp.
Draw a heavy border around the element.
Add a border around an element
Definition at line 370 of file src/ftxui/dom/border.cpp.
Draw a double border around the element.
Add a border around an element
Definition at line 405 of file src/ftxui/dom/border.cpp.
Draw a rounded border around the element.
Add a border around an element
Definition at line 440 of file src/ftxui/dom/border.cpp.
Draw an empty border around the element.
Add a border around an element
Definition at line 475 of file src/ftxui/dom/border.cpp.
Element window | ( | Element | title, |
Element | content, | ||
BorderStyle | border ) |
Draw window with a title and a border around the element.
title | The title of the window. |
content | The element to be wrapped. |
border | The style of the border. Default is ROUNDED. |
Definition at line 507 of file src/ftxui/dom/border.cpp.
Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
Definition at line 38 of file clear_under.cpp.
Set the foreground color of an element.
color | The color of the output element. |
child | The input element. |
Definition at line 81 of file dom/color.cpp.
Set the background color of an element.
color | The color of the output element. |
child | The input element. |
Definition at line 96 of file dom/color.cpp.
Decorate using a foreground color.
c | The foreground color to be applied. |
Definition at line 110 of file dom/color.cpp.
Decorate using a background color.
color | The background color to be applied. |
Definition at line 124 of file dom/color.cpp.
Center an element horizontally.
child | The decorated element. |
Definition at line 15 of file composite_decorator.cpp.
Center an element vertically.
child | The decorated element. |
Definition at line 23 of file composite_decorator.cpp.
Center an element horizontally and vertically.
child | The decorated element. |
Definition at line 31 of file composite_decorator.cpp.
Align an element on the right side.
child | The decorated element. |
Definition at line 39 of file composite_decorator.cpp.
Stack several element on top of each other.
children_ | The input element. |
Definition at line 55 of file src/ftxui/dom/dbox.cpp.
Element filler | ( | ) |
Make a child element to expand proportionally to the space left in a container.
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.
For instance:
Definition at line 31 of file src/ftxui/dom/focus.cpp.
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.
Definition at line 69 of file src/ftxui/dom/focus.cpp.
Draw a high definition progress bar progressing in specified direction.
progress | The proportion of the area to be filled. Belong to [0,1]. |
direction | Direction of progress bars progression. |
Definition at line 169 of file src/ftxui/dom/gauge.cpp.
Element gaugeRight | ( | float | progress | ) |
Draw a high definition progress bar progressing from left to right.
progress | The proportion of the area to be filled. Belong to [0,1]. |
A gauge. It can be used to represent a progress bar.
Definition at line 191 of file src/ftxui/dom/gauge.cpp.
Element gaugeLeft | ( | float | progress | ) |
Draw a high definition progress bar progressing from right to left.
progress | The proportion of the area to be filled. Belong to [0,1]. |
A gauge. It can be used to represent a progress bar.
Definition at line 213 of file src/ftxui/dom/gauge.cpp.
Element gaugeUp | ( | float | progress | ) |
Draw a high definition progress bar progressing from bottom to top.
progress | The proportion of the area to be filled. Belong to [0,1]. |
A gauge. It can be used to represent a progress bar.
Definition at line 242 of file src/ftxui/dom/gauge.cpp.
Element gaugeDown | ( | float | progress | ) |
Draw a high definition progress bar progressing from top to bottom.
progress | The proportion of the area to be filled. Belong to [0,1]. |
A gauge. It can be used to represent a progress bar.
Definition at line 271 of file src/ftxui/dom/gauge.cpp.
Element gauge | ( | float | progress | ) |
Draw a high definition progress bar.
progress | The proportion of the area to be filled. Belong to [0,1]. |
A gauge. It can be used to represent a progress bar.
Definition at line 293 of file src/ftxui/dom/gauge.cpp.
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/.
link | The link |
child | The input element. |
Definition at line 51 of file hyperlink.cpp.
Decorator hyperlink | ( | std::string | 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/.
link | The link to redirect the users to. |
Definition at line 70 of file hyperlink.cpp.
Add a filter that will invert the foreground and the background colors.
Definition at line 34 of file inverted.cpp.
Apply a underlinedDouble to text.
Definition at line 17 of file italic.cpp.
Element color | ( | const LinearGradient & | gradient, |
Element | child ) |
Set the foreground color of an element with linear-gradient effect.
gradient | The gradient effect to be applied on the output element. |
child | The input element. |
Definition at line 245 of file src/ftxui/dom/linear_gradient.cpp.
Element bgcolor | ( | const LinearGradient & | gradient, |
Element | child ) |
Set the background color of an element with linear-gradient effect.
gradient | The gradient effect to be applied on the output element. |
child | The input element. |
Definition at line 261 of file src/ftxui/dom/linear_gradient.cpp.
Decorator color | ( | const LinearGradient & | gradient | ) |
Decorate using a linear-gradient effect on the foreground color.
gradient | The gradient effect to be applied on the output element. |
Definition at line 276 of file src/ftxui/dom/linear_gradient.cpp.
Decorator bgcolor | ( | const LinearGradient & | gradient | ) |
Decorate using a linear-gradient effect on the background color.
gradient | The gradient effect to be applied on the output element. |
Definition at line 291 of file src/ftxui/dom/linear_gradient.cpp.
Display an element on a ftxui::Screen.
Display an element on a ftxui::Screen.
Element paragraph | ( | const std::string & | the_text | ) |
Return an element drawing the paragraph on multiple lines.
Definition at line 41 of file src/ftxui/dom/paragraph.cpp.
Element paragraphAlignLeft | ( | const std::string & | the_text | ) |
Return an element drawing the paragraph on multiple lines, aligned on the left.
Definition at line 49 of file src/ftxui/dom/paragraph.cpp.
Element paragraphAlignRight | ( | const std::string & | the_text | ) |
Return an element drawing the paragraph on multiple lines, aligned on the right.
Definition at line 60 of file src/ftxui/dom/paragraph.cpp.
Element paragraphAlignCenter | ( | const std::string & | the_text | ) |
Return an element drawing the paragraph on multiple lines, aligned on the center.
Definition at line 72 of file src/ftxui/dom/paragraph.cpp.
Element paragraphAlignJustify | ( | const std::string & | the_text | ) |
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
Definition at line 85 of file src/ftxui/dom/paragraph.cpp.
Display a vertical scrollbar on the right. Colors follow the content.
Definition at line 21 of file scroll_indicator.cpp.
Display a horizontal scrollbar at the bottom. Colors follow the content.
Definition at line 76 of file scroll_indicator.cpp.
Element separator | ( | ) |
Draw a vertical or horizontal separation in between two other elements.
Add a visual separation in between two elements.
Definition at line 134 of file src/ftxui/dom/separator.cpp.
Element separatorStyled | ( | BorderStyle | style | ) |
Draw a vertical or horizontal separation in between two other elements.
style | the style of the separator. |
Add a visual separation in between two elements.
Definition at line 172 of file src/ftxui/dom/separator.cpp.
Element separatorLight | ( | ) |
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Add a visual separation in between two elements.
Definition at line 209 of file src/ftxui/dom/separator.cpp.
Element separatorDashed | ( | ) |
Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
Add a visual separation in between two elements.
Definition at line 246 of file src/ftxui/dom/separator.cpp.
Element separatorHeavy | ( | ) |
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
Add a visual separation in between two elements.
Definition at line 283 of file src/ftxui/dom/separator.cpp.
Element separatorDouble | ( | ) |
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Add a visual separation in between two elements.
Definition at line 320 of file src/ftxui/dom/separator.cpp.
Element separatorEmpty | ( | ) |
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
Add a visual separation in between two elements.
Definition at line 357 of file src/ftxui/dom/separator.cpp.
Element separatorCharacter | ( | std::string | value | ) |
Draw a vertical or horizontal separation in between two other elements.
value | the character to fill the separator area. |
Add a visual separation in between two elements.
Definition at line 395 of file src/ftxui/dom/separator.cpp.
Draw a separator in between two element filled with a given pixel.
Definition at line 426 of file src/ftxui/dom/separator.cpp.
Decorator size | ( | WidthOrHeight | direction, |
Constraint | constraint, | ||
int | value ) |
Apply a constraint on the size of an element.
direction | Whether the WIDTH of the HEIGHT of the element must be constrained. |
constraint | The type of constaint. |
value | The value. |
Definition at line 89 of file src/ftxui/dom/size.cpp.
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".
charset_index | The type of "video". |
image_index | The "frame" of the video. You need to increase this for every "step". |
Definition at line 282 of file src/ftxui/dom/spinner.cpp.
Apply a strikethrough to text.
Definition at line 17 of file strikethrough.cpp.
Element text | ( | std::string | text | ) |
Element text | ( | std::wstring | text | ) |
Element vtext | ( | std::string | text | ) |
Display a piece of unicode text vertically.
Element vtext | ( | std::wstring | text | ) |
Underline the given element.
Definition at line 33 of file underlined.cpp.
Apply a underlinedDouble to text.
Definition at line 17 of file underlined_double.cpp.
A decoration doing absolutely nothing.
Definition at line 28 of file dom/util.cpp.
Compose two decorator into one.
Definition at line 40 of file dom/util.cpp.
From a set of element, apply a decorator to every elements.
Definition at line 48 of file dom/util.cpp.
From an element, apply a decorator.
Both of these are equivalent:
Definition at line 70 of file dom/util.cpp.
Apply a decorator to an element.
Both of these are equivalent:
Definition at line 85 of file dom/util.cpp.
Element emptyElement | ( | ) |
An element of size 0x0 drawing nothing.
Definition at line 140 of file dom/util.cpp.
void SetColorSupport | ( | Color | color | ) |
Override terminal color support in case auto-detection fails.
Definition at line 140 of file terminal.cpp.