mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-07 01:41:12 +08:00
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#include <functional> // for function
|
|
|
|
#include "ftxui/component/component.hpp" // for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
|
|
#include "ftxui/component/component_base.hpp" // for Component
|
|
|
|
namespace ftxui {
|
|
|
|
// NOLINTNEXTLINE
|
|
Component operator|(Component component, ComponentDecorator decorator) {
|
|
return decorator(component); // NOLINT
|
|
}
|
|
|
|
// NOLINTNEXTLINE
|
|
Component operator|(Component component, ElementDecorator decorator) {
|
|
return component | Renderer(decorator); // NOLINT
|
|
}
|
|
|
|
// NOLINTNEXTLINE
|
|
Component& operator|=(Component& component, ComponentDecorator decorator) {
|
|
component = component | decorator; // NOLINT
|
|
return component;
|
|
}
|
|
|
|
// NOLINTNEXTLINE
|
|
Component& operator|=(Component& component, ElementDecorator decorator) {
|
|
component = component | decorator; // NOLINT
|
|
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.
|