From 5c4cd1add1bca2e947b5b65dd32642baf8244520 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sat, 10 Jul 2021 13:20:43 +0200 Subject: [PATCH] Execute IWYU --- examples/component/button.cpp | 5 ++-- examples/component/homescreen.cpp | 15 ++++++------ examples/component/menu.cpp | 3 ++- examples/component/menu2.cpp | 3 ++- examples/component/menu_style.cpp | 14 +++++------ include/ftxui/component/component.hpp | 10 ++++++-- include/ftxui/component/component_options.hpp | 4 ++++ include/ftxui/util/ref.hpp | 2 +- src/ftxui/component/button.cpp | 14 +++++++---- src/ftxui/component/checkbox.cpp | 23 ++++++++----------- src/ftxui/component/component_test.cpp | 2 +- src/ftxui/component/container.cpp | 9 ++++---- src/ftxui/component/container_test.cpp | 5 ++-- src/ftxui/component/input.cpp | 19 +++++++++------ src/ftxui/component/input_test.cpp | 12 ++++++---- src/ftxui/component/menu.cpp | 21 +++++++++++------ src/ftxui/component/radiobox.cpp | 12 +++++++--- src/ftxui/component/radiobox_test.cpp | 9 +++++--- src/ftxui/component/slider.cpp | 4 ++-- src/ftxui/component/toggle.cpp | 22 ++++++++++++------ src/ftxui/component/toggle_test.cpp | 11 ++++++--- src/ftxui/screen/string.cpp | 1 - 22 files changed, 136 insertions(+), 84 deletions(-) diff --git a/examples/component/button.cpp b/examples/component/button.cpp index 675c912..f8bc4f3 100644 --- a/examples/component/button.cpp +++ b/examples/component/button.cpp @@ -1,11 +1,12 @@ -#include // for __shared_ptr_access, shared_ptr +#include // for shared_ptr, __shared_ptr_access #include // for operator+, to_wstring #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer #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, Element, gauge, text, operator|, vbox, border +#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border using namespace ftxui; diff --git a/examples/component/homescreen.cpp b/examples/component/homescreen.cpp index a05d30c..bd599c5 100644 --- a/examples/component/homescreen.cpp +++ b/examples/component/homescreen.cpp @@ -3,17 +3,18 @@ #include // for sin #include // for ref, reference_wrapper, function #include // for allocator, shared_ptr, __shared_ptr_access -#include // for wstring, basic_string, operator+, to_wstring -#include // for sleep_for, thread -#include // for move -#include // for vector +#include // for wstring, basic_string, operator+, char_traits, to_wstring +#include // for sleep_for, thread +#include // for move +#include // 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_base.hpp" // for ComponentBase -#include "ftxui/component/event.hpp" // for Event, Event::Custom +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for InputOption +#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, Element, filler, 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/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/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; diff --git a/examples/component/menu.cpp b/examples/component/menu.cpp index fa71547..04371f6 100644 --- a/examples/component/menu.cpp +++ b/examples/component/menu.cpp @@ -1,10 +1,11 @@ #include // for function #include // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream -#include // for wstring, allocator, basic_string +#include // for wstring, basic_string, allocator #include // for vector #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu +#include "ftxui/component/component_options.hpp" // for MenuOption #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive int main(int argc, const char* argv[]) { diff --git a/examples/component/menu2.cpp b/examples/component/menu2.cpp index dbf4122..28c51a0 100644 --- a/examples/component/menu2.cpp +++ b/examples/component/menu2.cpp @@ -1,11 +1,12 @@ #include // for function #include // for allocator, __shared_ptr_access -#include // for wstring, operator+, to_string, basic_string +#include // for wstring, basic_string, operator+, to_string #include // for vector #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer #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/screen/string.hpp" // for to_wstring diff --git a/examples/component/menu_style.cpp b/examples/component/menu_style.cpp index 24cf2cf..de509e6 100644 --- a/examples/component/menu_style.cpp +++ b/examples/component/menu_style.cpp @@ -1,14 +1,14 @@ -#include // for function -#include // for initializer_list -#include // for __shared_ptr_access, shared_ptr, allocator -#include // for wstring, basic_string -#include // for vector +#include // for function +#include // for shared_ptr, __shared_ptr_access, allocator +#include // for wstring, basic_string +#include // for vector #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer #include "ftxui/component/component_base.hpp" // for ComponentBase -#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component -#include "ftxui/dom/elements.hpp" // for operator|, Element, separator, bgcolor, color, flex, Decorator, bold, hbox, border, dim +#include "ftxui/component/component_options.hpp" // for MenuOption +#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#include "ftxui/dom/elements.hpp" // for operator|, color, separator, Decorator, bgcolor, flex, Element, bold, hbox, border, dim #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::BlueLight, Color::Red, Color::Yellow int main(int argc, const char* argv[]) { diff --git a/include/ftxui/component/component.hpp b/include/ftxui/component/component.hpp index c202280..0348717 100644 --- a/include/ftxui/component/component.hpp +++ b/include/ftxui/component/component.hpp @@ -8,13 +8,19 @@ #include "ftxui/component/component_base.hpp" #include "ftxui/component/component_options.hpp" -#include "ftxui/dom/elements.hpp" // for Element -#include "ftxui/util/ref.hpp" // for ConstStringRef, StringRef +#include "ftxui/dom/elements.hpp" // for Element +#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef, StringRef namespace ftxui { class ComponentBase; struct Event; +struct ButtonOption; +struct CheckboxOption; +struct InputOption; +struct MenuOption; +struct RadioboxOption; +struct ToggleOption; using Component = std::shared_ptr; using Components = std::vector; diff --git a/include/ftxui/component/component_options.hpp b/include/ftxui/component/component_options.hpp index c71327b..9948b49 100644 --- a/include/ftxui/component/component_options.hpp +++ b/include/ftxui/component/component_options.hpp @@ -81,3 +81,7 @@ struct ToggleOption { }; // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_COMPONENT_OPTIONS_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. diff --git a/include/ftxui/util/ref.hpp b/include/ftxui/util/ref.hpp index 513a66e..e1cfe65 100644 --- a/include/ftxui/util/ref.hpp +++ b/include/ftxui/util/ref.hpp @@ -24,7 +24,7 @@ class ConstRef { /// @brief An adapter. Own or reference an mutable object. template -class Ref{ +class Ref { public: Ref() {} Ref(T t) : owned_(t) {} diff --git a/src/ftxui/component/button.cpp b/src/ftxui/component/button.cpp index 3c81b20..2423e19 100644 --- a/src/ftxui/component/button.cpp +++ b/src/ftxui/component/button.cpp @@ -1,11 +1,17 @@ #include // for function #include // for shared_ptr +#include // for move -#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for CapturedMouse -#include "ftxui/component/event.hpp" // for Event, Event::Return +#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse +#include "ftxui/component/component.hpp" // for Make, Button +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for ButtonOption +#include "ftxui/component/event.hpp" // for Event, Event::Return #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed -#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive +#include "ftxui/component/screen_interactive.hpp" // for Component +#include "ftxui/dom/elements.hpp" // for operator|, Element, nothing, reflect, text, border, inverted +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for ConstStringRef, Ref namespace ftxui { diff --git a/src/ftxui/component/checkbox.cpp b/src/ftxui/component/checkbox.cpp index b241974..6ef80b8 100644 --- a/src/ftxui/component/checkbox.cpp +++ b/src/ftxui/component/checkbox.cpp @@ -1,19 +1,16 @@ #include // for function #include // for shared_ptr +#include // for move #include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/event.hpp" // for Event, Event::Return -#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed -#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive - -#include // for function -#include // for allocator, wstring - -#include "ftxui/component/component.hpp" // for Component +#include "ftxui/component/component.hpp" // for Make, Component, Checkbox #include "ftxui/component/component_base.hpp" // for ComponentBase -#include "ftxui/dom/elements.hpp" // for Element, Decorator, inverted, nothing -#include "ftxui/screen/box.hpp" // for Box -#include "ftxui/screen/string.hpp" // for ConstStringRef +#include "ftxui/component/component_options.hpp" // for CheckboxOption +#include "ftxui/component/event.hpp" // for Event, Event::Return +#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed +#include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, reflect, focus, nothing, select +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef namespace ftxui { @@ -23,9 +20,7 @@ namespace { /// @ingroup dom class CheckboxBase : public ComponentBase { public: - CheckboxBase(ConstStringRef label, - bool* state, - Ref option) + CheckboxBase(ConstStringRef label, bool* state, Ref option) : label_(label), state_(state), option_(std::move(option)) { #if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK) // Microsoft terminal do not use fonts able to render properly the default diff --git a/src/ftxui/component/component_test.cpp b/src/ftxui/component/component_test.cpp index 5e1813c..cfa46d7 100644 --- a/src/ftxui/component/component_test.cpp +++ b/src/ftxui/component/component_test.cpp @@ -1,8 +1,8 @@ +#include // for Test, SuiteApiResolver, TestInfo (ptr only), TEST, TestFactoryImpl #include // for shared_ptr, allocator, make_shared, __shared_ptr_access #include "ftxui/component/captured_mouse.hpp" // for ftxui #include "ftxui/component/component_base.hpp" // for ComponentBase, Component -#include "gtest/gtest_pred_impl.h" // for Test, SuiteApiResolver, TEST, TestFactoryImpl using namespace ftxui; diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index 297e055..c3dd4bc 100644 --- a/src/ftxui/component/container.cpp +++ b/src/ftxui/component/container.cpp @@ -1,12 +1,13 @@ -#include // for size_t - +#include // for size_t #include // for max, min #include // for __shared_ptr_access, shared_ptr, make_shared, allocator, __shared_ptr_access<>::element_type, allocator_traits<>::value_type #include // for move #include // for vector, __alloc_traits<>::value_type -#include "ftxui/component/component.hpp" -#include "ftxui/component/event.hpp" +#include "ftxui/component/component.hpp" // for Component, Components, Horizontal, Vertical, Tab +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/event.hpp" // for Event, Event::Tab, Event::TabReverse, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp +#include "ftxui/dom/elements.hpp" // for text, Elements, Element, hbox, vbox namespace ftxui { diff --git a/src/ftxui/component/container_test.cpp b/src/ftxui/component/container_test.cpp index 7f50102..04d6f95 100644 --- a/src/ftxui/component/container_test.cpp +++ b/src/ftxui/component/container_test.cpp @@ -3,8 +3,9 @@ #include // for __shared_ptr_access, shared_ptr, allocator #include "ftxui/component/captured_mouse.hpp" // for ftxui -#include "ftxui/component/component.hpp" // for AssertionResult, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, Test, TEST -#include "ftxui/component/event.hpp" // for AssertionResult, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, Test, TEST +#include "ftxui/component/component.hpp" // for Horizontal, Vertical +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/event.hpp" // for Event, Event::Tab, Event::TabReverse, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp #include "gtest/gtest_pred_impl.h" // for AssertionResult, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, Test, TEST using namespace ftxui; diff --git a/src/ftxui/component/input.cpp b/src/ftxui/component/input.cpp index 5897a5e..fb1af3d 100644 --- a/src/ftxui/component/input.cpp +++ b/src/ftxui/component/input.cpp @@ -1,14 +1,19 @@ -#include // for max, min -#include // for shared_ptr -#include // for wstring, allocator, basic_string +#include // for max, min +#include // for function +#include // for shared_ptr, allocator +#include // for wstring, basic_string +#include // for move -#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for Component -#include "ftxui/component/component_base.hpp" // for Component +#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse +#include "ftxui/component/component.hpp" // for Make, Input +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for InputOption #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/util/ref.hpp" // for Component +#include "ftxui/dom/elements.hpp" // for operator|, Element, text, reflect, dim, flex, focus, inverted, hbox, size, frame, select, underlined, Decorator, EQUAL, HEIGHT +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for StringRef, Ref, ConstStringRef namespace ftxui { diff --git a/src/ftxui/component/input_test.cpp b/src/ftxui/component/input_test.cpp index 490228f..f9d4037 100644 --- a/src/ftxui/component/input_test.cpp +++ b/src/ftxui/component/input_test.cpp @@ -1,12 +1,14 @@ #include // for Message #include // for TestPartResult, SuiteApiResolver, TestFactoryImpl -#include // for __shared_ptr_access -#include // for wstring, allocator +#include // for __shared_ptr_access, shared_ptr, allocator +#include // for wstring -#include "ftxui/component/captured_mouse.hpp" // for ftxui -#include "ftxui/component/component.hpp" -#include "ftxui/component/component_options.hpp" +#include "ftxui/component/captured_mouse.hpp" // for ftxui +#include "ftxui/component/component.hpp" // for Input, Component +#include "ftxui/component/component_base.hpp" // for ComponentBase +#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/util/ref.hpp" // for Ref #include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST using namespace ftxui; diff --git a/src/ftxui/component/menu.cpp b/src/ftxui/component/menu.cpp index c4b0495..dd66363 100644 --- a/src/ftxui/component/menu.cpp +++ b/src/ftxui/component/menu.cpp @@ -1,14 +1,21 @@ -#include // for size_t -#include // for max, min -#include // for shared_ptr, allocator_traits<>::value_type -#include // for move +#include // for size_t +#include // for max, min +#include // for function +#include // for shared_ptr, allocator_traits<>::value_type +#include // for operator+, wstring +#include // for move +#include // for vector, __alloc_traits<>::value_type -#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for Component +#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse +#include "ftxui/component/component.hpp" // for Make, Menu +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for MenuOption #include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowUp, Event::Return, Event::Tab, Event::TabReverse #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Released #include "ftxui/component/screen_interactive.hpp" // for Component +#include "ftxui/dom/elements.hpp" // for operator|, Element, reflect, text, vbox, Elements, focus, nothing, select +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for Ref namespace ftxui { diff --git a/src/ftxui/component/radiobox.cpp b/src/ftxui/component/radiobox.cpp index b928d12..85f8b9e 100644 --- a/src/ftxui/component/radiobox.cpp +++ b/src/ftxui/component/radiobox.cpp @@ -2,13 +2,20 @@ #include // for max, min #include // for function #include // for shared_ptr, allocator_traits<>::value_type +#include // for wstring #include // for move +#include // for vector -#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for Component +#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse +#include "ftxui/component/component.hpp" // for Make, Radiobox +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for RadioboxOption #include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowUp, Event::Return, Event::Tab, Event::TabReverse #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed #include "ftxui/component/screen_interactive.hpp" // for Component +#include "ftxui/dom/elements.hpp" // for Element, operator|, text, hbox, reflect, vbox, focus, nothing, select +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for Ref namespace ftxui { @@ -34,7 +41,6 @@ class RadioboxBase : public ComponentBase { ~RadioboxBase() override = default; private: - Element Render() override { std::vector elements; bool is_focused = Focused(); diff --git a/src/ftxui/component/radiobox_test.cpp b/src/ftxui/component/radiobox_test.cpp index 8900e98..1014af1 100644 --- a/src/ftxui/component/radiobox_test.cpp +++ b/src/ftxui/component/radiobox_test.cpp @@ -1,10 +1,13 @@ #include // for Message #include // for TestPartResult, SuiteApiResolver, TestFactoryImpl -#include // for __shared_ptr_access, shared_ptr +#include // for __shared_ptr_access, shared_ptr, allocator +#include // for wstring, basic_string +#include // for vector -#include "ftxui/component/component.hpp" +#include "ftxui/component/captured_mouse.hpp" // for ftxui +#include "ftxui/component/component.hpp" // for Radiobox +#include "ftxui/component/component_base.hpp" // for ComponentBase #include "ftxui/component/event.hpp" // for Event, Event::Return, Event::ArrowDown, Event::ArrowUp, Event::Tab, Event::TabReverse -#include "ftxui/component/mouse.hpp" // for ftxui #include "gtest/gtest_pred_impl.h" // for EXPECT_EQ, Test, TEST using namespace ftxui; diff --git a/src/ftxui/component/slider.cpp b/src/ftxui/component/slider.cpp index ff50c16..0f61567 100644 --- a/src/ftxui/component/slider.cpp +++ b/src/ftxui/component/slider.cpp @@ -7,10 +7,10 @@ #include "ftxui/component/event.hpp" // for Event, Event::ArrowLeft, Event::ArrowRight #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed, Mouse::Released #include "ftxui/component/screen_interactive.hpp" // for Component -#include "ftxui/dom/elements.hpp" // for Element, text, color, operator|, xflex, gauge, dim, hbox, reflect, underlined, vcenter +#include "ftxui/dom/elements.hpp" // for operator|, text, Element, reflect, xflex, gauge, hbox, underlined, color, dim, vcenter #include "ftxui/screen/box.hpp" // for Box #include "ftxui/screen/color.hpp" // for Color, Color::GrayDark, Color::GrayLight -#include "ftxui/screen/string.hpp" // for StringRef +#include "ftxui/util/ref.hpp" // for StringRef namespace ftxui { diff --git a/src/ftxui/component/toggle.cpp b/src/ftxui/component/toggle.cpp index 8a26ba4..74ffed6 100644 --- a/src/ftxui/component/toggle.cpp +++ b/src/ftxui/component/toggle.cpp @@ -1,12 +1,20 @@ -#include // for size_t -#include // for max, min -#include // for shared_ptr, allocator_traits<>::value_type -#include // for move +#include // for size_t +#include // for max, min +#include // for function +#include // for shared_ptr, allocator_traits<>::value_type +#include // for wstring +#include // for move +#include // for vector -#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse -#include "ftxui/component/component.hpp" // for Mouse, Mouse::Left, Mouse::Pressed +#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse +#include "ftxui/component/component.hpp" // for Make, Component, Toggle +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for ToggleOption #include "ftxui/component/event.hpp" // for Event, Event::ArrowLeft, Event::ArrowRight, Event::Return, Event::Tab, Event::TabReverse #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed +#include "ftxui/dom/elements.hpp" // for operator|, Element, Elements, hbox, reflect, separator, text, focus, nothing, select +#include "ftxui/screen/box.hpp" // for Box +#include "ftxui/util/ref.hpp" // for Ref namespace ftxui { @@ -49,7 +57,7 @@ class ToggleBase : public ComponentBase { return hbox(std::move(children)); } - bool OnEvent(Event event) override{ + bool OnEvent(Event event) override { if (event.is_mouse()) return OnMouseEvent(event); diff --git a/src/ftxui/component/toggle_test.cpp b/src/ftxui/component/toggle_test.cpp index a88bd38..1939044 100644 --- a/src/ftxui/component/toggle_test.cpp +++ b/src/ftxui/component/toggle_test.cpp @@ -1,10 +1,15 @@ #include // for Message #include // for TestPartResult, SuiteApiResolver, TestFactoryImpl -#include // for __shared_ptr_access, shared_ptr +#include // for function +#include // for __shared_ptr_access, shared_ptr, allocator +#include // for wstring, basic_string +#include // for vector -#include "ftxui/component/component.hpp" +#include "ftxui/component/captured_mouse.hpp" // for ftxui +#include "ftxui/component/component.hpp" // for Toggle +#include "ftxui/component/component_base.hpp" // for ComponentBase +#include "ftxui/component/component_options.hpp" // for ToggleOption #include "ftxui/component/event.hpp" // for Event, Event::ArrowLeft, Event::ArrowRight, Event::Return, Event::Tab, Event::TabReverse -#include "ftxui/component/mouse.hpp" // for ftxui #include "gtest/gtest_pred_impl.h" // for AssertionResult, EXPECT_EQ, Test, EXPECT_TRUE, EXPECT_FALSE, TEST using namespace ftxui; diff --git a/src/ftxui/screen/string.cpp b/src/ftxui/screen/string.cpp index 1c54c4c..693ca02 100644 --- a/src/ftxui/screen/string.cpp +++ b/src/ftxui/screen/string.cpp @@ -2,7 +2,6 @@ #include // for codecvt_utf8_utf16 #include // for wstring_convert -#include // for move namespace ftxui { #ifdef _MSC_VER