FTXUI  4.1.1
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
6namespace ftxui {
7
8// NOLINTNEXTLINE
10 return decorator(component); // NOLINT
11}
12
13// NOLINTNEXTLINE
15 return component | Renderer(decorator); // NOLINT
16}
17
18// NOLINTNEXTLINE
20 component = component | decorator; // NOLINT
21 return component;
22}
23
24// NOLINTNEXTLINE
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.
std::function< Element(Element)> ElementDecorator
Definition component.hpp:31
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
Component operator|(Component component, ComponentDecorator decorator)
Definition util.cpp:9
Component & operator|=(Component &component, ComponentDecorator decorator)
Definition util.cpp:19
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:30
std::shared_ptr< ComponentBase > Component