From 43240a5fd4c068425425dcfb2cce6bea5d5dd7f0 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sat, 15 Jul 2023 16:37:50 +0200 Subject: [PATCH] Add missing includes for gcc Bug:https://github.com/ArthurSonzogni/FTXUI/issues/695 --- examples/component/window.cpp | 5 ++++- include/ftxui/screen/string.hpp | 1 + src/ftxui/component/container.cpp | 9 +++++---- src/ftxui/component/screen_interactive.cpp | 3 ++- src/ftxui/component/slider.cpp | 3 ++- src/ftxui/component/window.cpp | 5 ++++- src/ftxui/dom/benchmark_test.cpp | 4 ++-- src/ftxui/screen/color.cpp | 1 + src/ftxui/screen/string_internal.hpp | 2 ++ tools/license_headers.cpp | 2 +- 10 files changed, 24 insertions(+), 11 deletions(-) diff --git a/examples/component/window.cpp b/examples/component/window.cpp index efd9ec0..64c4cfe 100644 --- a/examples/component/window.cpp +++ b/examples/component/window.cpp @@ -23,7 +23,6 @@ Component DummyWindowContent() { } int main() { - int window_1_left = 20; int window_1_top = 10; int window_1_width = 40; @@ -84,3 +83,7 @@ int main() { return EXIT_SUCCESS; } + +// Copyright 2023 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/screen/string.hpp b/include/ftxui/screen/string.hpp index 9657330..25fcb82 100644 --- a/include/ftxui/screen/string.hpp +++ b/include/ftxui/screen/string.hpp @@ -2,6 +2,7 @@ #define FTXUI_SCREEN_STRING_HPP #include // for size_t +#include // for uint8_t #include // for string, wstring, to_string #include // for vector diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index a4facdb..8ee6b29 100644 --- a/src/ftxui/component/container.cpp +++ b/src/ftxui/component/container.cpp @@ -235,7 +235,7 @@ class TabContainer : public ContainerBase { } }; -class StackedContainer : public ContainerBase{ +class StackedContainer : public ContainerBase { public: StackedContainer(Components children) : ContainerBase(std::move(children), nullptr) {} @@ -273,8 +273,9 @@ class StackedContainer : public ContainerBase{ // Find `child` and put it at the beginning without change the order of the // other children. - auto it = std::find_if(children_.begin(), children_.end(), - [child](const Component& c) { return c.get() == child; }); + auto it = + std::find_if(children_.begin(), children_.end(), + [child](const Component& c) { return c.get() == child; }); if (it == children_.end()) { return; } @@ -408,7 +409,7 @@ Component Tab(Components children, int* selector) { /// When a component take focus, it is put at the front, without changing the /// relative order of the other elements. /// -/// This should be used with the `Window` component. +/// This should be used with the `Window` component. /// /// @param children The list of components. /// @ingroup component diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 7d8af41..2900771 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -70,7 +70,8 @@ void Flush() { } constexpr int timeout_milliseconds = 20; -[[maybe_unused]] constexpr int timeout_microseconds = timeout_milliseconds * 1000; +[[maybe_unused]] constexpr int timeout_microseconds = + timeout_milliseconds * 1000; #if defined(_WIN32) void EventListener(std::atomic* quit, Sender out) { diff --git a/src/ftxui/component/slider.cpp b/src/ftxui/component/slider.cpp index 3a38aa8..85c1bf9 100644 --- a/src/ftxui/component/slider.cpp +++ b/src/ftxui/component/slider.cpp @@ -1,4 +1,5 @@ -#include // for max, min +#include // for max, min +#include // for uint8_t, uint16_t, uint32_t, uint64_t #include // for SliderOption #include // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up #include // for allocator diff --git a/src/ftxui/component/window.cpp b/src/ftxui/component/window.cpp index a8022a6..36bdd47 100644 --- a/src/ftxui/component/window.cpp +++ b/src/ftxui/component/window.cpp @@ -91,7 +91,6 @@ Element DefaultRenderState(const WindowRenderState& state) { element = window(text(state.title), element); element |= clear_under; - Color color = Color::Red; element = std::make_shared( // @@ -304,3 +303,7 @@ Component Window(WindowOptions option) { } }; // namespace ftxui + +// Copyright 2023 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/src/ftxui/dom/benchmark_test.cpp b/src/ftxui/dom/benchmark_test.cpp index bf8ca9f..a46d9f9 100644 --- a/src/ftxui/dom/benchmark_test.cpp +++ b/src/ftxui/dom/benchmark_test.cpp @@ -33,11 +33,11 @@ BENCHMARK(BencharkBasic)->DenseRange(0, 256, 16); static void BencharkText(benchmark::State& state) { while (state.KeepRunning()) { std::string content = "HELLO world "; - for(int i=0; i // for array #include +#include #include // for literals #include "ftxui/screen/color_info.hpp" // for GetColorInfo, ColorInfo diff --git a/src/ftxui/screen/string_internal.hpp b/src/ftxui/screen/string_internal.hpp index eab4aa2..1d85b3e 100644 --- a/src/ftxui/screen/string_internal.hpp +++ b/src/ftxui/screen/string_internal.hpp @@ -1,6 +1,8 @@ #ifndef FTXUI_SCREEN_STRING_INTERNAL_HPP #define FTXUI_SCREEN_STRING_INTERNAL_HPP +#include + namespace ftxui { bool EatCodePoint(const std::string& input, diff --git a/tools/license_headers.cpp b/tools/license_headers.cpp index 2986cb9..fa07c0e 100644 --- a/tools/license_headers.cpp +++ b/tools/license_headers.cpp @@ -1,4 +1,4 @@ -// Copyright 2022 Arthur Sonzogni. All rights reserved. +// Copyright 2023 Arthur Sonzogni. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file.