Add support for nxxm.

[nxxm](https://nxxm.github.io)
This commit is contained in:
ArthurSonzogni
2019-02-02 01:59:48 +01:00
parent 2eddd0fa17
commit ef0de8d873
72 changed files with 309 additions and 165 deletions

33
src/ftxui/dom/util.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include "ftxui/dom/elements.hpp"
namespace ftxui {
Element nothing(Element element) {
return element;
}
Decorator compose(Decorator a, Decorator b) {
return [
a = std::move(a),
b = std::move(b)
](Element element) {
return b(a(std::move(element)));
};
}
Decorator operator|(Decorator a, Decorator b) {
return compose(a, b);
}
Elements operator|(Elements es, Decorator d) {
Elements output;
for (auto& it : es)
output.push_back(std::move(it) | d);
return output;
}
Element operator|(Element e, Decorator d) {
return d(std::move(e));
}
} // namespace ftxui