Prefer std::string over std::wstring. (#179)

In the past, FTXUI switched from std::string to std::wstring to support
fullwidth characters. The reasons was that fullwidth characters can be
stored inside a single wchar_t.

Then FTXUI added support for combining characters. A single glygh
doesn't even fit a wchar_t. Instead, a glyph can be arbitrary large.

The usage of wstring doesn't really fit the new model and have several
drawbacks:
1. It doesn't simplify the implementation of FTXUI, because of combining
   characters.
2. It reduces drawing performance by 2x.
3. It increase Screen's memory allocation by 2x.

This patch converts FTXUI to use std::string internally. It now exposes
std::string based API. The std::wstring API remains, but is now
deprecated.

Tests and examples haven't been update to show the breakage is limited.
They will be updated in a second set of patches.

Bug: https://github.com/ArthurSonzogni/FTXUI/issues/153
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
This commit is contained in:
Arthur Sonzogni
2021-08-08 23:25:20 +02:00
committed by GitHub
parent 1ff894f6f5
commit 3b4ab618a3
84 changed files with 1234 additions and 996 deletions

View File

@@ -6,7 +6,8 @@
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/component_options.hpp" // for ButtonOption
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for separator, gauge, Element, operator|, vbox, border
using namespace ftxui;

View File

@@ -6,7 +6,8 @@
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/component_options.hpp" // for ButtonOption
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for separator, Element, operator|, vbox, border
using namespace ftxui;

View File

@@ -4,10 +4,12 @@
#include <vector> // for vector
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Menu, Radiobox, Toggle
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/deprecated.hpp" // for Input
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for separator, Element, operator|, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
using namespace ftxui;

View File

@@ -9,12 +9,14 @@
#include <vector> // for vector
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, Tab, Toggle
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Menu, Radiobox, Tab, Toggle
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/component_options.hpp" // for InputOption
#include "ftxui/component/deprecated.hpp" // for Input
#include "ftxui/component/event.hpp" // for Event, Event::Custom
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, operator|, color, bgcolor, filler, Element, size, vbox, flex, hbox, graph, separator, EQUAL, WIDTH, hcenter, bold, border, window, HEIGHT, Elements, hflow, flex_grow, frame, gauge, LESS_THAN, spinner, dim, GREATER_THAN
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for operator|, color, bgcolor, filler, Element, size, vbox, flex, hbox, graph, separator, EQUAL, WIDTH, hcenter, bold, border, window, HEIGHT, Elements, hflow, flex_grow, frame, gauge, LESS_THAN, spinner, dim, GREATER_THAN
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default
using namespace ftxui;

View File

@@ -1,12 +1,14 @@
#include <memory> // for allocator, __shared_ptr_access
#include <string> // for char_traits, operator+, wstring, basic_string
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Renderer, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/component_options.hpp" // for InputOption
#include "ftxui/component/deprecated.hpp" // for Input
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for hbox, separator, Element, operator|, vbox, border
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -8,7 +8,8 @@
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/component_options.hpp" // for MenuOption
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
#include "ftxui/screen/string.hpp" // for to_wstring
int main(int argc, const char* argv[]) {

View File

@@ -1,13 +1,14 @@
#include <stdlib.h> // for EXIT_SUCCESS
#include <memory> // for __shared_ptr_access
#include <string> // for wstring, allocator, operator+, basic_string, char_traits
#include <vector> // for vector, __alloc_traits<>::value_type
#include <memory> // for allocator, __shared_ptr_access
#include <string> // for wstring, operator+, basic_string, char_traits
#include <vector> // for vector, __alloc_traits<>::value_type
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for Element, operator|, window, flex, vbox
#include "ftxui/screen/string.hpp" // for to_wstring
using namespace ftxui;

View File

@@ -1,12 +1,13 @@
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
#include <string> // for wstring, operator+, basic_string, char_traits
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
#include <string> // for wstring, basic_string, char_traits, operator+
#include <vector> // for vector
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for Element, operator|, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -4,8 +4,8 @@
#include <stddef.h> // for size_t
#include <algorithm> // for max
#include <memory> // for shared_ptr
#include <string> // for allocator, char_traits, operator+, wstring, basic_string, to_wstring, string
#include <memory> // for allocator, shared_ptr
#include <string> // for char_traits, operator+, string, basic_string, to_string
#include <utility> // for move
#include <vector> // for vector
@@ -18,56 +18,56 @@
using namespace ftxui;
std::wstring Stringify(Event event) {
std::wstring out;
std::string Stringify(Event event) {
std::string out;
for (auto& it : event.input())
out += L" " + std::to_wstring((unsigned int)it);
out += " " + std::to_string((unsigned int)it);
out = L"(" + out + L" ) -> ";
out = "(" + out + " ) -> ";
if (event.is_character()) {
out += std::wstring(L"character(") + event.character() + L")";
out += "character(" + event.character() + ")";
} else if (event.is_mouse()) {
out += L"mouse";
out += "mouse";
switch (event.mouse().button) {
case Mouse::Left:
out += L"_left";
out += "_left";
break;
case Mouse::Middle:
out += L"_middle";
out += "_middle";
break;
case Mouse::Right:
out += L"_right";
out += "_right";
break;
case Mouse::None:
out += L"_none";
out += "_none";
break;
case Mouse::WheelUp:
out += L"_wheel_up";
out += "_wheel_up";
break;
case Mouse::WheelDown:
out += L"_wheel_down";
out += "_wheel_down";
break;
}
switch (event.mouse().motion) {
case Mouse::Pressed:
out += L"_pressed";
out += "_pressed";
break;
case Mouse::Released:
out += L"_released";
out += "_released";
break;
}
if (event.mouse().control)
out += L"_control";
out += "_control";
if (event.mouse().shift)
out += L"_shift";
out += "_shift";
if (event.mouse().meta)
out += L"_meta";
out += "_meta";
out += L"(" + //
std::to_wstring(event.mouse().x) + L"," +
std::to_wstring(event.mouse().y) + L")";
out += "(" + //
std::to_string(event.mouse().x) + "," +
std::to_string(event.mouse().y) + ")";
} else {
out += L"(special)";
out += "(special)";
}
return out;
}
@@ -81,7 +81,7 @@ int main(int argc, const char* argv[]) {
Elements children;
for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i)
children.push_back(text(Stringify(keys[i])));
return window(text(L"keys"), vbox(std::move(children)));
return window(text("keys"), vbox(std::move(children)));
});
component = CatchEvent(component, [&](Event event) {

View File

@@ -4,7 +4,8 @@
#include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for operator|, Element, bold, border, center, color
#include "ftxui/screen/color.hpp" // for Color, Color::Red
int main(int argc, const char* argv[]) {

View File

@@ -4,7 +4,8 @@
#include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for Element, operator|, center, border
using namespace ftxui;

View File

@@ -1,11 +1,12 @@
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
#include <string> // for operator+, to_wstring, char_traits
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
#include <string> // for char_traits, operator+, to_wstring
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include "ftxui/dom/elements.hpp" // for separator, Element, operator|, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
#include "ftxui/screen/color.hpp" // for Color
using namespace ftxui;

View File

@@ -6,7 +6,8 @@
#include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
#include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for hbox, vbox, Element
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, vbox, border, Element, hbox
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -7,7 +7,8 @@
using namespace ftxui;
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, border
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, border
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui

View File

@@ -1,17 +1,18 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/color_info.hpp>
#include <ftxui/screen/screen.hpp>
#include <string>
#include <utility>
#include <vector>
#include <ftxui/dom/elements.hpp> // for bgcolor, hbox, operator|, Elements, vbox, Element
#include <ftxui/screen/color_info.hpp> // for ColorInfo
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <string> // for allocator, string
#include <utility> // for move
#include <vector> // for vector
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/screen/color.hpp"
#include "ftxui/screen/string.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256
#include "ftxui/screen/string.hpp" // for to_wstring
using namespace ftxui;
#include "./color_info_sorted_2d.ipp" // ColorInfoSorted2D.
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
int main(int argc, const char* argv[]) {
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();

View File

@@ -1,11 +1,12 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <utility>
#include <ftxui/dom/elements.hpp> // for operator|, Elements, bgcolor, color, hbox, vbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include <utility> // for move
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/screen/color.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,11 +1,12 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <utility>
#include <ftxui/dom/elements.hpp> // for hbox, bgcolor, operator|, vbox, Elements, window, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include <utility> // for move
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/screen/color.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, border, Element, vbox, center, dbox
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,12 +1,13 @@
#include <chrono>
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <iostream>
#include <string>
#include <thread>
#include <chrono> // for operator""s, chrono_literals
#include <ftxui/dom/elements.hpp> // for gauge, operator|, flex, hbox, Element
#include <ftxui/screen/screen.hpp> // for Screen
#include <iostream> // for cout, endl, ostream
#include <string> // for allocator, operator+, char_traits, operator<<, to_wstring, basic_string, string, wstring
#include <thread> // for sleep_for
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,12 +1,13 @@
#include <stddef.h> // for size_t
#include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
#include <ftxui/dom/elements.hpp> // for operator|, size, Element, hcenter, Decorator, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <ftxui/screen/string.hpp> // for to_wstring
#include <memory> // for shared_ptr
#include <string> // for allocator, operator+, char_traits, wstring
#include <memory> // for allocator, shared_ptr
#include <string> // for operator+, char_traits, wstring
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -5,7 +5,8 @@
#include <string> // for operator<<, string
#include <thread> // for sleep_for
#include "ftxui/dom/elements.hpp" // for paragraph, text, operator|, Element, border, color, hflow, spinner, vbox, bold, dim, underlined
#include "ftxui/dom/deprecated.hpp" // for paragraph, text
#include "ftxui/dom/elements.hpp" // for operator|, Element, border, color, hflow, spinner, vbox, bold, dim, underlined
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Red

View File

@@ -1,18 +1,19 @@
#include <chrono>
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/screen/string.hpp>
#include <iostream>
#include <list>
#include <memory>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include <chrono> // for operator""s, chrono_literals
#include <ftxui/dom/elements.hpp> // for operator|, Element, hbox, bold, color, filler, separator, vbox, window, gauge, size, dim, EQUAL, WIDTH
#include <ftxui/screen/screen.hpp> // for Screen, Dimension
#include <ftxui/screen/string.hpp> // for to_wstring
#include <iostream> // for cout, endl, ostream
#include <list> // for list, operator!=, _List_iterator, _List_iterator<>::_Self
#include <memory> // for allocator, shared_ptr, allocator_traits<>::value_type
#include <string> // for wstring, operator<<, string
#include <thread> // for sleep_for
#include <utility> // for move
#include <vector> // for vector
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/screen/color.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,10 +1,11 @@
#include <stdio.h>
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <string>
#include <stdio.h> // for getchar
#include <ftxui/dom/elements.hpp> // for operator|, hflow, border, Element, hbox, flex, vbox
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <string> // for allocator, wstring
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for paragraph
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for center, separator, operator|, flex, Element, vbox, hbox, border
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,12 +1,13 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/screen/string.hpp>
#include <memory>
#include <string>
#include <utility>
#include <ftxui/dom/elements.hpp> // for operator|, Element, hcenter, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH
#include <ftxui/screen/screen.hpp> // for Screen, Dimension
#include <ftxui/screen/string.hpp> // for to_wstring
#include <memory> // for allocator, shared_ptr
#include <string> // for wstring
#include <utility> // for move
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,15 +1,16 @@
#include <chrono>
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/screen/string.hpp>
#include <iostream>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include <chrono> // for operator""s, chrono_literals
#include <ftxui/dom/elements.hpp> // for Element, operator|, separator, filler, hbox, size, spinner, vbox, bold, border, EQUAL, WIDTH
#include <ftxui/screen/screen.hpp> // for Screen, Dimension
#include <ftxui/screen/string.hpp> // for to_wstring
#include <iostream> // for cout, endl, ostream
#include <string> // for operator<<, string
#include <thread> // for sleep_for
#include <utility> // for move
#include <vector> // for vector
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, blink, hbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, bold, hbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, filler, hbox
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/elements.hpp" // for bgcolor, color, vbox, filler, hbox
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight
int main(int argc, const char* argv[]) {

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, dim, hbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,10 +1,11 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, hbox
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/screen/color.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" // for Color, Color::Blue
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, inverted, hbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,9 +1,10 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <ftxui/dom/elements.hpp> // for operator|, underlined, hbox, Element
#include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;

View File

@@ -1,10 +1,11 @@
#include <stdio.h>
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <memory>
#include <stdio.h> // for getchar
#include <ftxui/dom/elements.hpp> // for filler, hbox, vbox
#include <ftxui/screen/screen.hpp> // for Screen, Dimension
#include <memory> // for allocator
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/box.hpp"
#include "ftxui/dom/deprecated.hpp" // for text
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) {
using namespace ftxui;