mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Execute IWYU (#299)
This commit is contained in:
parent
358f886fab
commit
cdd6339849
@ -1,14 +1,19 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <stdio.h> // for getchar
|
||||
#include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator, shared_ptr
|
||||
#include <string> // for operator+, to_string, char_traits, string
|
||||
#include <cmath> // for sin, cos
|
||||
#include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
|
||||
#include <ftxui/screen/screen.hpp> // for Pixel
|
||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||
#include <string> // for string, basic_string
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, __alloc_traits<>::value_type
|
||||
|
||||
#include "ftxui/component/component.hpp"
|
||||
#include "ftxui/component/screen_interactive.hpp"
|
||||
#include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/event.hpp" // for Event
|
||||
#include "ftxui/component/mouse.hpp" // for Mouse
|
||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||
#include "ftxui/dom/canvas.hpp" // for Canvas
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||
|
||||
#include <cmath>
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
||||
@ -183,9 +188,9 @@ int main(int argc, const char* argv[]) {
|
||||
return canvas(std::move(c));
|
||||
});
|
||||
|
||||
|
||||
int selected_tab = 12;
|
||||
auto tab = Container::Tab({
|
||||
auto tab = Container::Tab(
|
||||
{
|
||||
renderer_line_braille,
|
||||
renderer_line_block,
|
||||
renderer_circle_braille,
|
||||
@ -202,7 +207,8 @@ int main(int argc, const char* argv[]) {
|
||||
renderer_plot_3,
|
||||
|
||||
renderer_text,
|
||||
}, &selected_tab);
|
||||
},
|
||||
&selected_tab);
|
||||
|
||||
// This capture the last mouse position.
|
||||
auto tab_with_mouse = CatchEvent(tab, [&](Event e) {
|
||||
|
@ -1,14 +1,12 @@
|
||||
#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
|
||||
#include <memory> // for shared_ptr, __shared_ptr_access
|
||||
#include <string> // for to_string, allocator
|
||||
#include <memory> // for allocator, make_shared, __shared_ptr_access
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||
#include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
|
||||
#include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/component_options.hpp" // for MenuEntryOption
|
||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
|
||||
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
|
||||
#include "ftxui/dom/elements.hpp" // for text, hbox, Element
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
|
@ -1,15 +1,13 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <memory> // for shared_ptr, __shared_ptr_access, allocator
|
||||
#include <string> // for string, basic_string, to_string, operator+, char_traits
|
||||
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
|
||||
#include <string> // for operator+, char_traits, to_string, string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||
#include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
|
||||
#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 text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Black
|
||||
#include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
|
||||
#include "ftxui/screen/color.hpp" // for Color
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <iostream> // for endl, cout, ostream
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -1,14 +1,13 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <stdio.h> // for getchar
|
||||
#include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator, shared_ptr
|
||||
#include <string> // for operator+, to_string, char_traits, string
|
||||
#include <cmath> // for cos
|
||||
#include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
|
||||
#include <ftxui/screen/screen.hpp> // for Pixel, Screen
|
||||
#include <vector> // for vector, allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/canvas.hpp" // for Canvas
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
|
||||
|
||||
#include <cmath>
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
||||
|
@ -4,9 +4,8 @@
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector, allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
|
||||
|
||||
using namespace ftxui;
|
||||
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
|
||||
|
@ -3,9 +3,8 @@
|
||||
#include <memory> // for allocator
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color
|
||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -3,9 +3,8 @@
|
||||
#include <memory> // for allocator
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color
|
||||
#include "ftxui/screen/color.hpp" // for Color, ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include <string> // for allocator, operator+, char_traits, operator<<, string, to_string, basic_string
|
||||
#include <thread> // for sleep_for
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -8,9 +8,8 @@
|
||||
#include <thread> // for sleep_for
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
|
||||
|
||||
class Graph {
|
||||
public:
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Screen
|
||||
#include <memory> // for allocator, shared_ptr
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include <memory> // for allocator, shared_ptr
|
||||
#include <string> // for operator+, to_string, char_traits, string
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -9,9 +9,8 @@
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <string> // for string, to_string
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,9 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -5,9 +5,8 @@
|
||||
#include <string> // for basic_string, allocator, string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Full, Screen
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include <memory> // for allocator, shared_ptr
|
||||
#include <string> // for operator+, to_string, char_traits, string
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
using namespace ftxui;
|
||||
|
@ -2,9 +2,8 @@
|
||||
#include <ftxui/screen/screen.hpp> // for Fixed, Screen
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::DarkBlue, Color::Green, Color::Red
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::DarkBlue, Color::Green, Color::Red, ftxui
|
||||
|
||||
int main(void) {
|
||||
using namespace ftxui;
|
||||
|
@ -1,10 +1,13 @@
|
||||
#ifndef FTXUI_DOM_CANVAS_HPP
|
||||
#define FTXUI_DOM_CANVAS_HPP
|
||||
|
||||
#include "ftxui/screen/color.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
#include <stddef.h> // for size_t
|
||||
#include <functional> // for function
|
||||
#include <string> // for string
|
||||
#include <unordered_map> // for unordered_map
|
||||
|
||||
#include "ftxui/screen/color.hpp" // for Color
|
||||
#include "ftxui/screen/screen.hpp" // for Pixel
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
@ -34,25 +37,14 @@ struct Canvas {
|
||||
void DrawPointCircle(int x, int y, int radius, const Stylizer& s);
|
||||
void DrawPointCircle(int x, int y, int radius, const Color& color);
|
||||
void DrawPointCircleFilled(int x, int y, int radius);
|
||||
void DrawPointCircleFilled(int x,
|
||||
int y,
|
||||
int radius,
|
||||
const Stylizer& s);
|
||||
void DrawPointCircleFilled(int x, int y, int radius, const Stylizer& s);
|
||||
void DrawPointCircleFilled(int x, int y, int radius, const Color& color);
|
||||
void DrawPointEllipse(int x, int y, int r1, int r2);
|
||||
void DrawPointEllipse(int x, int y, int r1, int r2, const Color& color);
|
||||
void DrawPointEllipse(int x, int y, int r1, int r2, const Stylizer& s);
|
||||
void DrawPointEllipseFilled(int x, int y, int r1, int r2);
|
||||
void DrawPointEllipseFilled(int x,
|
||||
int y,
|
||||
int r1,
|
||||
int r2,
|
||||
const Color& color);
|
||||
void DrawPointEllipseFilled(int x,
|
||||
int y,
|
||||
int r1,
|
||||
int r2,
|
||||
const Stylizer& s);
|
||||
void DrawPointEllipseFilled(int x, int y, int r1, int r2, const Color& color);
|
||||
void DrawPointEllipseFilled(int x, int y, int r1, int r2, const Stylizer& s);
|
||||
|
||||
// Draw using box characters -------------------------------------------------
|
||||
// Block are of size 1x2. y is considered to be a multiple of 2.
|
||||
@ -92,10 +84,7 @@ struct Canvas {
|
||||
// y is considered to be a multiple of 4.
|
||||
void DrawText(int x, int y, const std::string& value);
|
||||
void DrawText(int x, int y, const std::string& value, const Color& color);
|
||||
void DrawText(int x,
|
||||
int y,
|
||||
const std::string& value,
|
||||
const Stylizer& style);
|
||||
void DrawText(int x, int y, const std::string& value, const Stylizer& style);
|
||||
|
||||
// Decorator:
|
||||
// x is considered to be a multiple of 2.
|
||||
@ -124,7 +113,9 @@ struct Canvas {
|
||||
};
|
||||
|
||||
struct XYHash {
|
||||
size_t operator()(const XY& xy) const { return static_cast<size_t>(xy.x * 1024 + xy.y); }
|
||||
size_t operator()(const XY& xy) const {
|
||||
return static_cast<size_t>(xy.x * 1024 + xy.y);
|
||||
}
|
||||
};
|
||||
|
||||
int width_ = 0;
|
||||
@ -135,3 +126,7 @@ struct Canvas {
|
||||
} // namespace ftxui
|
||||
|
||||
#endif // FTXUI_DOM_CANVAS_HPP
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef FTXUI_SCREEN_STRING_HPP
|
||||
#define FTXUI_SCREEN_STRING_HPP
|
||||
|
||||
#include <stddef.h> // for size_t
|
||||
#include <string> // for string, wstring, to_string
|
||||
#include <vector> // for vector
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
#include <memory> // for make_unique, __shared_ptr_access, __shared_ptr_access<>::element_type, shared_ptr
|
||||
#include <string> // for string
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/component/component.hpp" // for Make, Collapsible
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
||||
#include "ftxui/component/event.hpp" // for Event
|
||||
#include "ftxui/dom/elements.hpp" // for Element
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/component/component.hpp" // for Checkbox, Maybe, Make, Vertical, Collapsible
|
||||
#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
|
||||
#include "ftxui/component/component_options.hpp" // for CheckboxOption
|
||||
#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
@ -26,9 +25,7 @@ namespace ftxui {
|
||||
/// ▼ Show details
|
||||
/// <details component>
|
||||
/// ```
|
||||
Component Collapsible(ConstStringRef label,
|
||||
Component child,
|
||||
Ref<bool> show) {
|
||||
Component Collapsible(ConstStringRef label, Component child, Ref<bool> show) {
|
||||
class Impl : public ComponentBase {
|
||||
public:
|
||||
Impl(ConstStringRef label, Component child, Ref<bool> show)
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include <algorithm> // for max, min
|
||||
#include <stddef.h> // for size_t
|
||||
#include <algorithm> // for clamp, max, min
|
||||
#include <functional> // for function
|
||||
#include <memory> // for shared_ptr, allocator
|
||||
#include <string> // for wstring, basic_string
|
||||
#include <string> // for string, wstring
|
||||
#include <utility> // for move
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
|
||||
#include "ftxui/component/component.hpp" // for Make, Input
|
||||
@ -12,11 +14,10 @@
|
||||
#include "ftxui/component/event.hpp" // for Event, Event::ArrowLeft, Event::ArrowRight, Event::Backspace, Event::Custom, Event::Delete, Event::End, Event::Home, Event::Return
|
||||
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed
|
||||
#include "ftxui/component/screen_interactive.hpp" // for Component
|
||||
#include "ftxui/dom/deprecated.hpp" // for text
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, reflect, text, dim, flex, focus, inverted, hbox, size, frame, select, underlined, Decorator, EQUAL, HEIGHT
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, text, Element, reflect, inverted, Decorator, flex, focus, hbox, size, bold, dim, frame, select, EQUAL, HEIGHT
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
#include "ftxui/screen/string.hpp" // for to_wstring, to_string
|
||||
#include "ftxui/util/ref.hpp" // for WideStringRef, Ref, ConstStringRef, StringRef
|
||||
#include "ftxui/screen/string.hpp" // for GlyphPosition, GlyphCount, to_string, CellToGlyphIndex, to_wstring
|
||||
#include "ftxui/util/ref.hpp" // for StringRef, Ref, WideStringRef, ConstStringRef
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
|
@ -8,9 +8,10 @@
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
|
||||
#include "ftxui/component/component_options.hpp" // for InputOption
|
||||
#include "ftxui/component/event.hpp" // for Event, Event::ArrowLeft, Event::ArrowRight, Event::Backspace, Event::Delete, Event::End, Event::Home
|
||||
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Button, Mouse::Left, Mouse::Motion, Mouse::Pressed
|
||||
#include "ftxui/dom/elements.hpp" // for Fit
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/screen.hpp" // for Screen, Pixel
|
||||
#include "ftxui/screen/screen.hpp" // for Fixed, Screen, Pixel
|
||||
#include "ftxui/util/ref.hpp" // for Ref
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for separator, gauge, operator|, text, Element, blink, inverted, hbox, vbox, border
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
|
||||
using namespace ftxui;
|
||||
|
@ -1,9 +1,20 @@
|
||||
#include "ftxui/dom/canvas.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <stdlib.h> // for abs
|
||||
#include <algorithm> // for max, min
|
||||
#include <cstdint> // for uint8_t
|
||||
#include <map> // for allocator, map
|
||||
#include <memory> // for make_shared
|
||||
#include <utility> // for move, pair
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include "ftxui/screen/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp" // for Element, canvas
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
#include "ftxui/screen/screen.hpp" // for Pixel, Screen
|
||||
#include "ftxui/screen/string.hpp" // for Utf8ToGlyphs
|
||||
#include "ftxui/util/ref.hpp" // for ConstRef
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
@ -233,10 +244,7 @@ void Canvas::DrawPointCircle(int x, int y, int radius, const Color& color) {
|
||||
/// @param y the y coordinate of the center of the circle.
|
||||
/// @param radius the radius of the circle.
|
||||
/// @param style the style of the circle.
|
||||
void Canvas::DrawPointCircle(int x,
|
||||
int y,
|
||||
int radius,
|
||||
const Stylizer& style) {
|
||||
void Canvas::DrawPointCircle(int x, int y, int radius, const Stylizer& style) {
|
||||
DrawPointEllipse(x, y, radius, radius, style);
|
||||
}
|
||||
|
||||
@ -573,10 +581,7 @@ void Canvas::DrawBlockCircle(int x, int y, int radius, const Color& color) {
|
||||
/// @param y the y coordinate of the center of the circle.
|
||||
/// @param radius the radius of the circle.
|
||||
/// @param style the style of the circle.
|
||||
void Canvas::DrawBlockCircle(int x,
|
||||
int y,
|
||||
int radius,
|
||||
const Stylizer& style) {
|
||||
void Canvas::DrawBlockCircle(int x, int y, int radius, const Stylizer& style) {
|
||||
DrawBlockEllipse(x, y, radius, radius, style);
|
||||
}
|
||||
|
||||
@ -868,3 +873,7 @@ Element canvas(std::function<void(Canvas&)> fn) {
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
||||
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be found in
|
||||
// the LICENSE file.
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include <string> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, flexbox
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::Direction::Column, FlexboxConfig::AlignItems, FlexboxConfig::JustifyContent::SpaceAround, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignContent::FlexEnd, FlexboxConfig::AlignContent::SpaceAround, FlexboxConfig::AlignContent::SpaceBetween, FlexboxConfig::AlignContent::SpaceEvenly, FlexboxConfig::AlignItems::Center, FlexboxConfig::AlignItems::FlexEnd, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Direction::Row, FlexboxConfig::Direction::RowInversed, FlexboxConfig::JustifyContent::Center, FlexboxConfig::JustifyContent::SpaceBetween, ftxui
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::Direction::Column, FlexboxConfig::AlignItems, FlexboxConfig::JustifyContent::SpaceAround, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignContent::FlexEnd, FlexboxConfig::AlignContent::SpaceAround, FlexboxConfig::AlignContent::SpaceBetween, FlexboxConfig::AlignContent::SpaceEvenly, FlexboxConfig::AlignItems::Center, FlexboxConfig::AlignItems::FlexEnd, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Direction::Row, FlexboxConfig::Direction::RowInversed, FlexboxConfig::JustifyContent::Center, FlexboxConfig::JustifyContent::SpaceBetween
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -1,18 +1,13 @@
|
||||
#include <memory> // for make_shared
|
||||
#include <utility> // for move
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for Element, bold
|
||||
#include "ftxui/dom/node.hpp" // for Node
|
||||
#include "ftxui/dom/elements.hpp" // for Decorator, Element, focusPosition, focusPositionRelative
|
||||
#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
|
||||
#include "ftxui/dom/requirement.hpp" // for Requirement, Requirement::NORMAL, Requirement::Selection
|
||||
#include "ftxui/screen/box.hpp" // for Box
|
||||
#include "ftxui/screen/screen.hpp" // for Pixel, Screen
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
namespace {
|
||||
|
||||
} // namespace
|
||||
|
||||
/// @brief Used inside a `frame`, this force the view to be scrolled toward a
|
||||
/// a given position. The position is expressed in proportion of the requested
|
||||
/// size.
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for gauge
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
#include <string> // for allocator, basic_string, string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex, flex_grow, Elements, flex_shrink, vtext, gridbox, vbox, border
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex, Elements, flex_grow, flex_shrink, vtext, gridbox, vbox, border
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, TEST, EXPECT_EQ
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, Element, flex_grow, flex_shrink, hbox
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
#include <memory> // for allocator
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for LIGHT, flex, center, EMPTY, DOUBLE
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/dom/table.hpp"
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <string> // for allocator, string
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for text, operator|, border, Element
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/elements.hpp" // for vtext, operator|, Element, flex_grow, flex_shrink, vbox
|
||||
#include "ftxui/dom/flexbox_config.hpp" // for ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for ftxui
|
||||
#include "ftxui/screen/screen.hpp" // for Screen
|
||||
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
|
||||
|
||||
|
@ -288,7 +288,9 @@ std::vector<std::string> Utf8ToGlyphs(const std::string& input) {
|
||||
return out;
|
||||
}
|
||||
|
||||
int GlyphPosition(const std::string& input, size_t glyph_to_skip, size_t start) {
|
||||
int GlyphPosition(const std::string& input,
|
||||
size_t glyph_to_skip,
|
||||
size_t start) {
|
||||
if (glyph_to_skip <= 0)
|
||||
return 0;
|
||||
size_t end = 0;
|
||||
|
@ -59,7 +59,6 @@ TEST(StringTest, GlyphCount) {
|
||||
EXPECT_EQ(GlyphCount("a\1a"), 2);
|
||||
}
|
||||
|
||||
|
||||
TEST(StringTest, GlyphPosition) {
|
||||
// Basic:
|
||||
EXPECT_EQ(GlyphPosition("", -1), 0);
|
||||
|
Loading…
Reference in New Issue
Block a user