#ifndef FTXUI_DOM_ELEMENTS_HPP #define FTXUI_DOM_ELEMENTS_HPP #include "ftxui/color.hpp" #include "ftxui/dom/node.hpp" namespace ftxui { namespace dom { using Element = std::unique_ptr; using Child = std::unique_ptr; using Children = std::vector; // --- Layout ---- Element vbox(Children); Element hbox(Children); Element flex(); // --- Widget -- Element text(std::wstring text); Element separator(); Element gauge(float ratio); Element frame(Child); Element frame(Child title, Child content); // -- Decorator (Style) --- Element bold(Element); Element dim(Element); Element inverted(Element); Element underlined(Element); Element color(Color, Element); Element bgcolor(Color, Element); // --- Decorator --- Element hcenter(Element); Element vcenter(Element); Element center(Element); Element flex(Element); template Children unpack(Args... args) { Children vec; (vec.push_back(std::forward(args)), ...); return vec; } template Element vbox(Args... children) { return vbox(unpack(std::forward(children)...)); } template Element hbox(Args... children) { return hbox(unpack(std::forward(children)...)); } }; // namespace dom }; // namespace ftxui #endif /* end of include guard: FTXUI_DOM_ELEMENTS_HPP */