Update document WIP.

This commit is contained in:
ArthurSonzogni
2020-05-25 01:34:13 +02:00
committed by Arthur Sonzogni
parent 177df31d41
commit 75c424cea9
55 changed files with 3244 additions and 152 deletions

View File

@@ -21,7 +21,7 @@ using GraphFunction = std::function<std::vector<int>(int, int)>;
// Pipe elements into decorator togethers.
// For instance the next lines are equivalents:
// -> text("ftxui") | bold | underlined
// -> text("ftxui") | bold | underlined
// -> underlined(bold(text(L"FTXUI")))
Element operator|(Element, Decorator);
Elements operator|(Elements, Decorator);
@@ -61,9 +61,9 @@ Element hflow(Elements);
// -- Flexibility ---
// Define how to share the remaining space when not all of it is used inside a
// container.
Element flex(Element); // Expand/Minimize if possible/needed.
Element flex_grow(Element); // Expand element if possible.
Element flex_shrink(Element); // Minimize element if needed.
Element flex(Element); // Expand/Minimize if possible/needed.
Element flex_grow(Element); // Expand element if possible.
Element flex_shrink(Element); // Minimize element if needed.
Element xflex(Element); // Expand/Minimize if possible/needed.
Element xflex_grow(Element); // Expand element if possible.
@@ -73,8 +73,8 @@ Element yflex(Element); // Expand/Minimize if possible/needed.
Element yflex_grow(Element); // Expand element if possible.
Element yflex_shrink(Element); // Minimize element if needed.
Element notflex(Element); // Reset the flex attribute.
Element filler(); // A blank expandable element.
Element notflex(Element); // Reset the flex attribute.
Element filler(); // A blank expandable element.
// -- Size override;
enum Direction { WIDTH, HEIGHT };

View File

@@ -14,6 +14,7 @@
namespace ftxui {
class Node;
using Element = std::shared_ptr<Node>;
using Elements = std::vector<std::shared_ptr<Node>>;

View File

@@ -9,6 +9,8 @@
namespace ftxui {
/// @brief The set of supported terminal colors.
/// @ingroup screen
enum class Color : uint8_t {
// --- Transparent -----
Default = 39,

View File

@@ -17,7 +17,10 @@ class Node;
}
namespace ftxui {
using Element = std::shared_ptr<Node>;
/// @brief A unicode character and its associated style.
/// @ingroup screen
struct Pixel {
wchar_t character = U' ';
bool blink = false;
@@ -29,18 +32,24 @@ struct Pixel {
Color foreground_color = Color::Default;
};
/// @brief Define how the Screen's dimensions should look like.
/// @ingroup screen
struct Dimension {
/// coucou
static Dimension Fixed(int);
static Dimension Fit(std::shared_ptr<Node>&);
/// @brief coucou
static Dimension Fit(Element&);
static Dimension Full();
int dimx;
int dimy;
};
/// @brief A rectangular grid of Pixel.
/// @ingroup screen
class Screen {
public:
// Constructor.
// Constructors:
Screen(int dimx, int dimy);
static Screen Create(Dimension dimension);
static Screen Create(Dimension width, Dimension height);