FTXUI  5.0.0
C++ functional terminal UI.
util.cpp
Go to the documentation of this file.
1 // Copyright 2022 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 #include <functional> // for function
5 
6 #include "ftxui/component/component.hpp" // for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
7 #include "ftxui/component/component_base.hpp" // for Component
8 
9 namespace ftxui {
10 
11 // NOLINTNEXTLINE
13  return decorator(component); // NOLINT
14 }
15 
16 // NOLINTNEXTLINE
18  return component | Renderer(decorator); // NOLINT
19 }
20 
21 // NOLINTNEXTLINE
23  component = component | decorator; // NOLINT
24  return component;
25 }
26 
27 // NOLINTNEXTLINE
29  component = component | decorator; // NOLINT
30  return component;
31 }
32 
33 } // namespace ftxui
std::function< Element(Element)> ElementDecorator
Definition: component.hpp:32
std::shared_ptr< ComponentBase > Component
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:61
Component operator|(Component component, ComponentDecorator decorator)
Definition: util.cpp:12
Component & operator|=(Component &component, ComponentDecorator decorator)
Definition: util.cpp:22
std::function< Component(Component)> ComponentDecorator
Definition: component.hpp:31