20 return [a = std::move(a), b = std::move(b)](
Element element) {
21 return b(a(std::move(element)));
41 return compose(std::move(a),
50 output.reserve(elements.size());
51 for (
auto& it : elements) {
52 output.push_back(std::move(it) | decorator);
71 return decorator(std::move(element));
98 box.x_max = fullsize.dimx;
99 box.y_max = fullsize.dimy;
103 const int max_iteration = 20;
104 while (status.need_iteration && status.iteration < max_iteration) {
105 e->ComputeRequirement();
108 box.x_max = std::min(box.x_max, e->requirement().min_x);
109 box.y_max = e->requirement().min_y;
110 if (!extend_beyond_screen) {
111 box.y_max = std::min(box.y_max, fullsize.dimy);
115 status.need_iteration =
false;
119 if (!status.need_iteration) {
123 box.x_max = std::min(e->requirement().min_x, fullsize.dimx);
124 box.y_max = e->requirement().min_y;
127 if (!extend_beyond_screen) {
128 box.y_max = std::min(box.y_max, fullsize.dimy);
141 class Impl :
public Node {
142 void ComputeRequirement()
override {
143 requirement_.min_x = 0;
144 requirement_.min_y = 0;
147 return std::make_unique<Impl>();
Node is the base class for all elements in the DOM tree.
Element nothing(Element element)
A decoration doing absolutely nothing.
Dimensions Fit(Element &, bool extend_beyond_screen=false)
The FTXUI ftxui:: namespace.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element
std::vector< Element > Elements
Component operator|(Component component, ComponentDecorator decorator)
Component & operator|=(Component &component, ComponentDecorator decorator)