mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Add missing includes for gcc
Bug:https://github.com/ArthurSonzogni/FTXUI/issues/695
This commit is contained in:
parent
e19550ae69
commit
43240a5fd4
@ -23,7 +23,6 @@ Component DummyWindowContent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
int window_1_left = 20;
|
int window_1_left = 20;
|
||||||
int window_1_top = 10;
|
int window_1_top = 10;
|
||||||
int window_1_width = 40;
|
int window_1_width = 40;
|
||||||
@ -84,3 +83,7 @@ int main() {
|
|||||||
|
|
||||||
return EXIT_SUCCESS;
|
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.
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define FTXUI_SCREEN_STRING_HPP
|
#define FTXUI_SCREEN_STRING_HPP
|
||||||
|
|
||||||
#include <stddef.h> // for size_t
|
#include <stddef.h> // for size_t
|
||||||
|
#include <cstdint> // for uint8_t
|
||||||
#include <string> // for string, wstring, to_string
|
#include <string> // for string, wstring, to_string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ class TabContainer : public ContainerBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class StackedContainer : public ContainerBase{
|
class StackedContainer : public ContainerBase {
|
||||||
public:
|
public:
|
||||||
StackedContainer(Components children)
|
StackedContainer(Components children)
|
||||||
: ContainerBase(std::move(children), nullptr) {}
|
: 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
|
// Find `child` and put it at the beginning without change the order of the
|
||||||
// other children.
|
// other children.
|
||||||
auto it = std::find_if(children_.begin(), children_.end(),
|
auto it =
|
||||||
[child](const Component& c) { return c.get() == child; });
|
std::find_if(children_.begin(), children_.end(),
|
||||||
|
[child](const Component& c) { return c.get() == child; });
|
||||||
if (it == children_.end()) {
|
if (it == children_.end()) {
|
||||||
return;
|
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
|
/// When a component take focus, it is put at the front, without changing the
|
||||||
/// relative order of the other elements.
|
/// 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.
|
/// @param children The list of components.
|
||||||
/// @ingroup component
|
/// @ingroup component
|
||||||
|
@ -70,7 +70,8 @@ void Flush() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr int timeout_milliseconds = 20;
|
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)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
void EventListener(std::atomic<bool>* quit, Sender<Task> out) {
|
void EventListener(std::atomic<bool>* quit, Sender<Task> out) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <algorithm> // for max, min
|
#include <algorithm> // for max, min
|
||||||
|
#include <cstdint> // for uint8_t, uint16_t, uint32_t, uint64_t
|
||||||
#include <ftxui/component/component_options.hpp> // for SliderOption
|
#include <ftxui/component/component_options.hpp> // for SliderOption
|
||||||
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
|
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
|
||||||
#include <string> // for allocator
|
#include <string> // for allocator
|
||||||
|
@ -91,7 +91,6 @@ Element DefaultRenderState(const WindowRenderState& state) {
|
|||||||
element = window(text(state.title), element);
|
element = window(text(state.title), element);
|
||||||
element |= clear_under;
|
element |= clear_under;
|
||||||
|
|
||||||
|
|
||||||
Color color = Color::Red;
|
Color color = Color::Red;
|
||||||
|
|
||||||
element = std::make_shared<ResizeDecorator>( //
|
element = std::make_shared<ResizeDecorator>( //
|
||||||
@ -304,3 +303,7 @@ Component Window(WindowOptions option) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace ftxui
|
}; // 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.
|
||||||
|
@ -33,11 +33,11 @@ BENCHMARK(BencharkBasic)->DenseRange(0, 256, 16);
|
|||||||
static void BencharkText(benchmark::State& state) {
|
static void BencharkText(benchmark::State& state) {
|
||||||
while (state.KeepRunning()) {
|
while (state.KeepRunning()) {
|
||||||
std::string content = "HELLO world ";
|
std::string content = "HELLO world ";
|
||||||
for(int i=0; i<state.range(0); ++i) {
|
for (int i = 0; i < state.range(0); ++i) {
|
||||||
content += content;
|
content += content;
|
||||||
}
|
}
|
||||||
auto document = paragraph(content);
|
auto document = paragraph(content);
|
||||||
Screen screen(200,200);
|
Screen screen(200, 200);
|
||||||
Render(screen, document);
|
Render(screen, document);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <array> // for array
|
#include <array> // for array
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstdint>
|
||||||
#include <string_view> // for literals
|
#include <string_view> // for literals
|
||||||
|
|
||||||
#include "ftxui/screen/color_info.hpp" // for GetColorInfo, ColorInfo
|
#include "ftxui/screen/color_info.hpp" // for GetColorInfo, ColorInfo
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef FTXUI_SCREEN_STRING_INTERNAL_HPP
|
#ifndef FTXUI_SCREEN_STRING_INTERNAL_HPP
|
||||||
#define FTXUI_SCREEN_STRING_INTERNAL_HPP
|
#define FTXUI_SCREEN_STRING_INTERNAL_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace ftxui {
|
namespace ftxui {
|
||||||
|
|
||||||
bool EatCodePoint(const std::string& input,
|
bool EatCodePoint(const std::string& input,
|
||||||
|
@ -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
|
// Use of this source code is governed by the MIT license that can be found in
|
||||||
// the LICENSE file.
|
// the LICENSE file.
|
||||||
|
Loading…
Reference in New Issue
Block a user