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// 輔助類別。
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
為元素分配繪圖位置和尺寸。
void ComputeRequirement() override
計算元素所需的空間大小。
節點是DOM樹中所有元素的基底類別。
Definition node.hpp:34
Box 是一個表示二維空間中矩形區域的結構。
Definition box.hpp:14
FTXUI 的 ftxui:: 命名空間
Definition animation.hpp:10
std::shared_ptr< Node > Element
Definition elements.hpp:22