2022-03-12 22:18:36 +08:00
|
|
|
#include <functional> // for function
|
|
|
|
|
2022-03-14 01:51:46 +08:00
|
|
|
#include "ftxui/component/component.hpp" // for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
|
|
|
|
#include "ftxui/component/component_base.hpp" // for Component
|
2022-03-12 22:18:36 +08:00
|
|
|
|
|
|
|
namespace ftxui {
|
|
|
|
|
|
|
|
Component operator|(Component component, ComponentDecorator decorator) {
|
|
|
|
return decorator(component);
|
|
|
|
}
|
|
|
|
|
|
|
|
Component operator|(Component component, ElementDecorator decorator) {
|
|
|
|
return component | Renderer(decorator);
|
|
|
|
}
|
|
|
|
|
|
|
|
Component& operator|=(Component& component, ComponentDecorator decorator) {
|
|
|
|
component = component | decorator;
|
|
|
|
return component;
|
|
|
|
}
|
|
|
|
|
|
|
|
Component& operator|=(Component& component, ElementDecorator decorator) {
|
|
|
|
component = component | decorator;
|
|
|
|
return component;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace ftxui
|
|
|
|
|
|
|
|
// Copyright 2022 Arthur Sonzogni. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
|
|
// the LICENSE file.
|