FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
component/util.cpp
Go to the documentation of this file.
1// 版權所有 2022 Arthur Sonzogni。保留所有權利。
2// 本原始碼的使用受 MIT 許可證的約束,該許可證可在 LICENSE 文件中找到。
3#include <functional> // for function
4
5#include "ftxui/component/component.hpp" // for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
6#include "ftxui/component/component_base.hpp" // for Component
7
8namespace ftxui {
9
10// NOLINTNEXTLINE
12 return decorator(component); // NOLINT
13}
14
15// NOLINTNEXTLINE
17 return component | Renderer(decorator); // NOLINT
18}
19
20// NOLINTNEXTLINE
22 component = component | decorator; // NOLINT
23 return component;
24}
25
26// NOLINTNEXTLINE
28 component = component | decorator; // NOLINT
29 return component;
30}
31
32} // namespace ftxui
auto component
Definition gallery.cpp:127
Component Renderer(Component child, std::function< Element()>)
回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
FTXUI 的 ftxui:: 命名空間
Definition animation.hpp:10
std::function< Element(Element)> ElementDecorator
Definition component.hpp:32
Component operator|(Component component, ComponentDecorator decorator)
Component & operator|=(Component &component, ComponentDecorator decorator)
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:31
std::shared_ptr< ComponentBase > Component