FTXUI
3.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
util.cpp
Go to the documentation of this file.
1
#include <functional>
// for function
2
3
#include "
ftxui/component/component.hpp
"
// for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
4
#include "
ftxui/component/component_base.hpp
"
// for Component
5
6
namespace
ftxui
{
7
8
// NOLINTNEXTLINE
9
Component
operator|
(
Component
component,
ComponentDecorator
decorator) {
10
return
decorator(component);
// NOLINT
11
}
12
13
// NOLINTNEXTLINE
14
Component
operator|
(
Component
component,
ElementDecorator
decorator) {
15
return
component |
Renderer
(decorator);
// NOLINT
16
}
17
18
// NOLINTNEXTLINE
19
Component
&
operator|=
(
Component
& component,
ComponentDecorator
decorator) {
20
component = component | decorator;
// NOLINT
21
return
component;
22
}
23
24
// NOLINTNEXTLINE
25
Component
&
operator|=
(
Component
& component,
ElementDecorator
decorator) {
26
component = component | decorator;
// NOLINT
27
return
component;
28
}
29
30
}
// namespace ftxui
31
32
// Copyright 2022 Arthur Sonzogni. All rights reserved.
33
// Use of this source code is governed by the MIT license that can be found in
34
// the LICENSE file.
component.hpp
component_base.hpp
ftxui
Definition
animation.hpp:9
ftxui::ElementDecorator
std::function< Element(Element)> ElementDecorator
Definition
component.hpp:31
ftxui::Renderer
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Definition
renderer.cpp:60
ftxui::operator|
Component operator|(Component component, ComponentDecorator decorator)
Definition
util.cpp:9
ftxui::operator|=
Component & operator|=(Component &component, ComponentDecorator decorator)
Definition
util.cpp:19
ftxui::ComponentDecorator
std::function< Component(Component)> ComponentDecorator
Definition
component.hpp:30
ftxui::Component
std::shared_ptr< ComponentBase > Component
Definition
component_base.hpp:21