Variou details:

- Put the MIT copyright at the end.
- Move the directory /other -> tools
- Various improvements.
This commit is contained in:
ArthurSonzogni
2020-08-16 00:24:18 +02:00
committed by Arthur Sonzogni
parent 5a4afba66f
commit f2dc080a35
73 changed files with 353 additions and 322 deletions

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/checkbox.hpp"
#include <functional>
@@ -26,3 +22,7 @@ bool CheckBox::OnEvent(Event event) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/component.hpp"
#include <assert.h>
@@ -63,3 +59,7 @@ bool Component::Focused() {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/container.hpp"
#include <algorithm>
@@ -111,3 +107,7 @@ Element Container::TabRender() {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/container.hpp"
#include "gtest/gtest.h"
@@ -78,3 +74,7 @@ TEST(ContainerTest, HorizontalEvent) {
EXPECT_EQ(container.ActiveChild(), &c1);
container.OnEvent(Event::TabReverse);
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/event.hpp"
#include <iostream>
@@ -189,3 +185,7 @@ Event Event::F12 = Event::Special("\x1B[24~");
Event Event::Custom = Event::Special({0});
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/event.hpp"
#include "ftxui/component/receiver.hpp"
@@ -47,3 +43,7 @@ TEST(Event, Character) {
}
EXPECT_FALSE(event_receiver->Receive(&received));
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/input.hpp"
#include <algorithm>
@@ -97,3 +93,7 @@ bool Input::OnEvent(Event event) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/menu.hpp"
#include <algorithm>
@@ -53,3 +49,7 @@ bool Menu::OnEvent(Event event) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/radiobox.hpp"
#include <algorithm>
@@ -55,3 +51,7 @@ bool RadioBox::OnEvent(Event event) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/radiobox.hpp"
#include "gtest/gtest.h"
@@ -80,3 +76,7 @@ TEST(RadioboxTest, Navigation) {
EXPECT_EQ(radiobox.focused, 1);
radiobox.OnEvent(Event::TabReverse);
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/receiver.hpp"
#include <thread>
@@ -76,3 +72,7 @@ TEST(Receiver, BasicWithThread) {
t12.join();
t23.join();
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/screen_interactive.hpp"
#include <stdio.h>
@@ -18,23 +14,23 @@
#include "ftxui/screen/terminal.hpp"
#if defined(_WIN32)
#define DEFINE_CONSOLEV2_PROPERTIES
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#ifndef UNICODE
#error Must be compiled in UNICODE mode
#endif
#define DEFINE_CONSOLEV2_PROPERTIES
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#ifndef UNICODE
#error Must be compiled in UNICODE mode
#endif
#else
#include <termios.h>
#include <unistd.h>
#include <termios.h>
#include <unistd.h>
#endif
// Quick exit is missing in standard CLang headers
#if defined(__clang__) && defined(__APPLE__)
#define quick_exit(a) exit(a)
#define quick_exit(a) exit(a)
#endif
namespace ftxui {
@@ -365,3 +361,7 @@ std::function<void()> ScreenInteractive::ExitLoopClosure() {
}
} // namespace ftxui.
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/toggle.hpp"
#include <algorithm>
@@ -54,3 +50,7 @@ bool Toggle::OnEvent(Event event) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/component/toggle.hpp"
#include "gtest/gtest.h"
@@ -83,23 +79,23 @@ TEST(ToggleTest, OnChange) {
int counter = 0;
toggle.on_change = [&] { counter++; };
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_EQ(counter, 0);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [0] -> [1]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [0] -> [1]
EXPECT_EQ(counter, 1);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [1] -> [2]
EXPECT_EQ(counter, 2);
EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right.
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [1] -> [2]
EXPECT_EQ(counter, 2);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [2] -> [1]
EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right.
EXPECT_EQ(counter, 2);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [2] -> [1]
EXPECT_EQ(counter, 3);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [1] -> [0]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [1] -> [0]
EXPECT_EQ(counter, 4);
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_EQ(counter, 4);
}
@@ -110,29 +106,33 @@ TEST(ToggleTest, OnEnter) {
int counter = 0;
toggle.on_enter = [&] { counter++; };
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 1);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [0] -> [1]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [0] -> [1]
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 2);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [1] -> [2]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowRight)); // [1] -> [2]
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 3);
EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right.
EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right.
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 4);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [2] -> [1]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [2] -> [1]
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 5);
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [1] -> [0]
EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [1] -> [0]
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 6);
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_FALSE(toggle.OnEvent(Event::ArrowLeft)); // Reached far left.
EXPECT_TRUE(toggle.OnEvent(Event::Return));
EXPECT_EQ(counter, 7);
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -29,3 +25,7 @@ Element blink(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -29,3 +25,7 @@ Element bold(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node.hpp"
@@ -164,3 +160,7 @@ Decorator borderWith(Pixel pixel) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -101,3 +97,7 @@ Decorator bgcolor(Color c) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node.hpp"
@@ -40,3 +36,7 @@ Element align_right(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
@@ -52,3 +48,7 @@ Element dbox(Elements children) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -31,3 +27,7 @@ Element dim(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node.hpp"
@@ -155,3 +151,7 @@ Element notflex(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
@@ -127,3 +123,7 @@ Element yframe(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node.hpp"
@@ -62,3 +58,7 @@ Element gauge(float progress) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include "gtest/gtest.h"
@@ -33,3 +29,7 @@ TEST(GaugeTest, one) {
EXPECT_EQ("███████████", screen.ToString());
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
namespace ftxui {
@@ -51,3 +47,7 @@ Element graph(GraphFunction graph_function) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
@@ -145,3 +141,7 @@ Element hbox(Elements children) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include "gtest/gtest.h"
@@ -353,3 +349,7 @@ TEST(HBoxTest, FlexGrow_NoFlex_FlewShrink) {
EXPECT_EQ(expectations[i], screen.ToString());
}
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
@@ -77,3 +73,7 @@ Element hflow(Elements children) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -29,3 +25,7 @@ Element inverted(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/node.hpp"
namespace ftxui {
@@ -52,3 +48,7 @@ void Render(Screen& screen, Node* node) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/node_decorator.hpp"
namespace ftxui {
@@ -17,3 +13,7 @@ void NodeDecorator::SetBox(Box box) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef FTXUI_DOM_NODE_DECORATOR_H_
#define FTXUI_DOM_NODE_DECORATOR_H_
@@ -21,3 +17,7 @@ class NodeDecorator : public Node {
} // namespace ftxui
#endif /* end of include guard: FTXUI_DOM_NODE_DECORATOR_H_ */
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <sstream>
#include "ftxui/dom/elements.hpp"
@@ -19,3 +15,7 @@ Elements paragraph(std::wstring the_text) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/node.hpp"
namespace ftxui {
@@ -58,3 +54,7 @@ Element separator(Pixel pixel) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/elements.hpp"
@@ -84,3 +80,7 @@ Decorator size(Direction direction, Constraint constraint, int value) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node.hpp"
@@ -261,3 +257,7 @@ Element spinner(int c, size_t index) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include "ftxui/dom/node.hpp"
#include "ftxui/screen/string.hpp"
@@ -77,3 +73,7 @@ Element vtext(std::wstring text) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include "gtest/gtest.h"
@@ -84,3 +80,7 @@ TEST(TextTest, CJK_3) {
"└──┘",
screen.ToString());
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/dom/node_decorator.hpp"
@@ -29,3 +25,7 @@ Element underlined(Element child) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
namespace ftxui {
@@ -32,3 +28,7 @@ Element operator|(Element e, Decorator d) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include <algorithm>
#include <iostream>
@@ -146,3 +142,7 @@ Element vbox(Elements children) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
#include "ftxui/screen/screen.hpp"
#include "gtest/gtest.h"
@@ -358,3 +354,7 @@ TEST(VBoxText, FlexGrow_NoFlex_FlewShrink) {
EXPECT_EQ(expectations[i], rotate(screen.ToString()));
}
}
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/screen/box.hpp"
#include <algorithm>
@@ -17,3 +13,7 @@ Box Box::Intersection(Box a, Box b) {
};
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/screen/screen.hpp"
#include <algorithm>
@@ -12,11 +8,11 @@
#include "ftxui/screen/terminal.hpp"
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#endif
namespace ftxui {
@@ -249,3 +245,7 @@ void Screen::ApplyShader() {
// clang-format on
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/screen/string.hpp"
#include <codecvt>
@@ -9,8 +5,8 @@
namespace ftxui {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996) // codecvt_utf8_utf16 is deprecated
#pragma warning(push)
#pragma warning(disable : 4996) // codecvt_utf8_utf16 is deprecated
#endif
std::string to_string(const std::wstring& s) {
@@ -24,7 +20,11 @@ std::wstring to_wstring(const std::string& s) {
}
#ifdef _MSC_VER
#pragma warning(pop)
#pragma warning(pop)
#endif
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,18 +1,14 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/screen/terminal.hpp"
#include <stdio.h>
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#else
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#include <iostream>
@@ -38,3 +34,7 @@ Terminal::Dimensions Terminal::Size() {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef FTXUI_CORE_TERMINAL_HPP
#define FTXUI_CORE_TERMINAL_HPP
@@ -20,3 +16,7 @@ class Terminal {
} // namespace ftxui
#endif /* end of include guard: FTXUI_CORE_TERMINAL_HPP */
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.

View File

@@ -1,7 +1,3 @@
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
/*
* This is an implementation of wcwidth() and wcswidth() (defined in
* IEEE Std 1002.1-2001) for Unicode.
@@ -307,3 +303,7 @@ int wstring_width_cjk(const std::wstring& text) {
}
} // namespace ftxui
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.