FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
node_decorator.hpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_DOM_NODE_DECORATOR_H_
5#define FTXUI_DOM_NODE_DECORATOR_H_
6
7#include <utility> // for move
8
9#include "ftxui/dom/elements.hpp" // for Element, unpack
10#include "ftxui/dom/node.hpp" // for Node
11
12namespace ftxui {
13struct Box;
14
15// Helper class.
16class NodeDecorator : public Node {
17 public:
18 explicit NodeDecorator(Element child) : Node(unpack(std::move(child))) {}
19 void ComputeRequirement() override;
20 void SetBox(Box box) override;
21};
22
23} // namespace ftxui
24
25#endif /* end of include guard: FTXUI_DOM_NODE_DECORATOR_H_ */
NodeDecorator(Element child)
void SetBox(Box box) override
Assign a position and a dimension to an element for drawing.
void ComputeRequirement() override
Compute how much space an element needs.
Node is the base class for all elements in the DOM tree.
Definition node.hpp:37
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
std::shared_ptr< Node > Element
Definition elements.hpp:22