From f2dc080a350d9f2ff576e4d03a2ea1e5a4576d22 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sun, 16 Aug 2020 00:24:18 +0200 Subject: [PATCH] Variou details: - Put the MIT copyright at the end. - Move the directory /other -> tools - Various improvements. --- .clang-format | 1 - README.md | 5 +-- doc/example_list.md | 35 ++++++++++++++++ include/ftxui/component/checkbox.hpp | 8 ++-- include/ftxui/component/component.hpp | 8 ++-- include/ftxui/component/container.hpp | 8 ++-- include/ftxui/component/event.hpp | 8 ++-- include/ftxui/component/input.hpp | 8 ++-- include/ftxui/component/menu.hpp | 8 ++-- include/ftxui/component/radiobox.hpp | 8 ++-- include/ftxui/component/receiver.hpp | 8 ++-- .../ftxui/component/screen_interactive.hpp | 8 ++-- include/ftxui/component/toggle.hpp | 10 ++--- include/ftxui/dom/elements.hpp | 8 ++-- include/ftxui/dom/node.hpp | 8 ++-- include/ftxui/dom/requirement.hpp | 8 ++-- include/ftxui/dom/take_any_args.hpp | 8 ++-- include/ftxui/screen/box.hpp | 8 ++-- include/ftxui/screen/color.hpp | 8 ++-- include/ftxui/screen/screen.hpp | 8 ++-- include/ftxui/screen/string.hpp | 8 ++-- include/ftxui/util/autoreset.hpp | 8 ++-- src/ftxui/component/checkbox.cpp | 8 ++-- src/ftxui/component/component.cpp | 8 ++-- src/ftxui/component/container.cpp | 8 ++-- src/ftxui/component/container_test.cpp | 8 ++-- src/ftxui/component/event.cpp | 8 ++-- src/ftxui/component/event_test.cpp | 8 ++-- src/ftxui/component/input.cpp | 8 ++-- src/ftxui/component/menu.cpp | 8 ++-- src/ftxui/component/radiobox.cpp | 8 ++-- src/ftxui/component/radiobox_test.cpp | 8 ++-- src/ftxui/component/receiver_test.cpp | 8 ++-- src/ftxui/component/screen_interactive.cpp | 32 +++++++------- src/ftxui/component/toggle.cpp | 8 ++-- src/ftxui/component/toggle_test.cpp | 42 +++++++++---------- src/ftxui/dom/blink.cpp | 8 ++-- src/ftxui/dom/bold.cpp | 8 ++-- src/ftxui/dom/border.cpp | 8 ++-- src/ftxui/dom/color.cpp | 8 ++-- src/ftxui/dom/composite_decorator.cpp | 8 ++-- src/ftxui/dom/dbox.cpp | 8 ++-- src/ftxui/dom/dim.cpp | 8 ++-- src/ftxui/dom/flex.cpp | 8 ++-- src/ftxui/dom/frame.cpp | 8 ++-- src/ftxui/dom/gauge.cpp | 8 ++-- src/ftxui/dom/gauge_test.cpp | 8 ++-- src/ftxui/dom/graph.cpp | 8 ++-- src/ftxui/dom/hbox.cpp | 8 ++-- src/ftxui/dom/hbox_test.cpp | 8 ++-- src/ftxui/dom/hflow.cpp | 8 ++-- src/ftxui/dom/inverted.cpp | 8 ++-- src/ftxui/dom/node.cpp | 8 ++-- src/ftxui/dom/node_decorator.cpp | 8 ++-- src/ftxui/dom/node_decorator.hpp | 8 ++-- src/ftxui/dom/paragraph.cpp | 8 ++-- src/ftxui/dom/separator.cpp | 8 ++-- src/ftxui/dom/size.cpp | 8 ++-- src/ftxui/dom/spinner.cpp | 8 ++-- src/ftxui/dom/text.cpp | 8 ++-- src/ftxui/dom/text_test.cpp | 8 ++-- src/ftxui/dom/underlined.cpp | 8 ++-- src/ftxui/dom/util.cpp | 8 ++-- src/ftxui/dom/vbox.cpp | 8 ++-- src/ftxui/dom/vbox_test.cpp | 8 ++-- src/ftxui/screen/box.cpp | 8 ++-- src/ftxui/screen/screen.cpp | 18 ++++---- src/ftxui/screen/string.cpp | 14 +++---- src/ftxui/screen/terminal.cpp | 18 ++++---- src/ftxui/screen/terminal.hpp | 8 ++-- src/ftxui/screen/wcwidth.cpp | 8 ++-- {other => tools}/format.sh | 2 +- {other => tools}/license_headers.cpp | 2 +- 73 files changed, 353 insertions(+), 322 deletions(-) create mode 100644 doc/example_list.md rename {other => tools}/format.sh (85%) rename {other => tools}/license_headers.cpp (100%) diff --git a/.clang-format b/.clang-format index 2dc5fa5..0f21d0b 100644 --- a/.clang-format +++ b/.clang-format @@ -2,4 +2,3 @@ # http://clang.llvm.org/docs/ClangFormatStyleOptions.html BasedOnStyle: Chromium Standard: Cpp11 -IndentPPDirectives: BeforeHash diff --git a/README.md b/README.md index f3ae0cb..b8d6795 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,7 @@ A simple C++ library for terminal based user interface. * Simple and elegant syntax (in my opinion). * Support for [UTF8](https://en.wikipedia.org/wiki/UTF-8) and [fullwidth chars](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) (→ 测试) * No dependencies. - * Cross platform: - - Linux (main target) - - Windows (experimental, thanks to mauve@) - - Mac (never tested, but must WORK) + * Cross platform (mostly). Linux (main target), Windows (experimental), Mac. ## Example: ~~~cpp diff --git a/doc/example_list.md b/doc/example_list.md new file mode 100644 index 0000000..483fa6b --- /dev/null +++ b/doc/example_list.md @@ -0,0 +1,35 @@ +# Examples +@example ./examples/util/print_key_press.cpp +@example ./examples/dom/dbox.cpp +@example ./examples/dom/separator.cpp +@example ./examples/dom/style_color.cpp +@example ./examples/dom/paragraph.cpp +@example ./examples/dom/style_blink.cpp +@example ./examples/dom/style_dim.cpp +@example ./examples/dom/style_inverted.cpp +@example ./examples/dom/graph.cpp +@example ./examples/dom/package_manager.cpp +@example ./examples/dom/window.cpp +@example ./examples/dom/html_like.cpp +@example ./examples/dom/border.cpp +@example ./examples/dom/style_underlined.cpp +@example ./examples/dom/gauge.cpp +@example ./examples/dom/style_bold.cpp +@example ./examples/dom/spinner.cpp +@example ./examples/dom/style_gallery.cpp +@example ./examples/dom/vbox_hbox.cpp +@example ./examples/dom/size.cpp +@example ./examples/dom/hflow.cpp +@example ./examples/component/tab_vertical.cpp +@example ./examples/component/gallery.cpp +@example ./examples/component/checkbox.cpp +@example ./examples/component/checkbox_in_frame.cpp +@example ./examples/component/menu2.cpp +@example ./examples/component/tab_horizontal.cpp +@example ./examples/component/input.cpp +@example ./examples/component/homescreen.cpp +@example ./examples/component/radiobox.cpp +@example ./examples/component/menu.cpp +@example ./examples/component/menu_style.cpp +@example ./examples/component/radiobox_in_frame.cpp +@example ./examples/component/toggle.cpp diff --git a/include/ftxui/component/checkbox.hpp b/include/ftxui/component/checkbox.hpp index ffcee32..046abaa 100644 --- a/include/ftxui/component/checkbox.hpp +++ b/include/ftxui/component/checkbox.hpp @@ -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_COMPONENT_CHECKBOX_HPP #define FTXUI_COMPONENT_CHECKBOX_HPP @@ -45,3 +41,7 @@ class CheckBox : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_CHECKBOX_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. diff --git a/include/ftxui/component/component.hpp b/include/ftxui/component/component.hpp index bd739f6..3c7129c 100644 --- a/include/ftxui/component/component.hpp +++ b/include/ftxui/component/component.hpp @@ -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_COMPONENT_COMPONENT_HPP #define FTXUI_COMPONENT_COMPONENT_HPP @@ -57,3 +53,7 @@ class Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_COMPONENT_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. diff --git a/include/ftxui/component/container.hpp b/include/ftxui/component/container.hpp index 70fde16..444fa0a 100644 --- a/include/ftxui/component/container.hpp +++ b/include/ftxui/component/container.hpp @@ -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_COMPONENT_CONTAINER_HPP #define FTXUI_COMPONENT_CONTAINER_HPP @@ -47,3 +43,7 @@ class Container : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_CONTAINER_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. diff --git a/include/ftxui/component/event.hpp b/include/ftxui/component/event.hpp index f24082e..da10938 100644 --- a/include/ftxui/component/event.hpp +++ b/include/ftxui/component/event.hpp @@ -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_COMPONENT_EVENT_HPP #define FTXUI_COMPONENT_EVENT_HPP @@ -62,3 +58,7 @@ struct Event { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_EVENT_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. diff --git a/include/ftxui/component/input.hpp b/include/ftxui/component/input.hpp index 712696f..e301eb4 100644 --- a/include/ftxui/component/input.hpp +++ b/include/ftxui/component/input.hpp @@ -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_COMPONENT_INPUT_H_ #define FTXUI_COMPONENT_INPUT_H_ @@ -36,3 +32,7 @@ class Input : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_INPUT_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. diff --git a/include/ftxui/component/menu.hpp b/include/ftxui/component/menu.hpp index 91a709b..66108e0 100644 --- a/include/ftxui/component/menu.hpp +++ b/include/ftxui/component/menu.hpp @@ -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_COMPONENT_MENU #define FTXUI_COMPONENT_MENU @@ -38,3 +34,7 @@ class Menu : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_MENU */ + +// 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. diff --git a/include/ftxui/component/radiobox.hpp b/include/ftxui/component/radiobox.hpp index 726f763..793e41d 100644 --- a/include/ftxui/component/radiobox.hpp +++ b/include/ftxui/component/radiobox.hpp @@ -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_COMPONENT_RADIOBOX_HPP #define FTXUI_COMPONENT_RADIOBOX_HPP @@ -46,3 +42,7 @@ class RadioBox : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_RADIOBOX_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. diff --git a/include/ftxui/component/receiver.hpp b/include/ftxui/component/receiver.hpp index 86874fe..ef65d81 100644 --- a/include/ftxui/component/receiver.hpp +++ b/include/ftxui/component/receiver.hpp @@ -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_COMPONENT_RECEIVER_HPP_ #define FTXUI_COMPONENT_RECEIVER_HPP_ @@ -118,3 +114,7 @@ Receiver MakeReceiver() { } // namespace ftxui #endif // FTXUI_COMPONENT_RECEIVER_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. diff --git a/include/ftxui/component/screen_interactive.hpp b/include/ftxui/component/screen_interactive.hpp index ce838f5..3327969 100644 --- a/include/ftxui/component/screen_interactive.hpp +++ b/include/ftxui/component/screen_interactive.hpp @@ -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_COMPONENT_SCREEN_INTERACTIVE_HPP #define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP @@ -61,3 +57,7 @@ class ScreenInteractive : public Screen { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_SCREEN_INTERACTIVE_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. diff --git a/include/ftxui/component/toggle.hpp b/include/ftxui/component/toggle.hpp index f0a2a65..d0f1290 100644 --- a/include/ftxui/component/toggle.hpp +++ b/include/ftxui/component/toggle.hpp @@ -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_COMPONENT_TOGGLE_H_ #define FTXUI_COMPONENT_TOGGLE_H_ @@ -28,7 +24,7 @@ class Toggle : public Component { // Callback. std::function on_change = []() {}; std::function on_enter = []() {}; - + // Component implementation. Element Render() override; bool OnEvent(Event) override; @@ -37,3 +33,7 @@ class Toggle : public Component { } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_TOGGLE_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. diff --git a/include/ftxui/dom/elements.hpp b/include/ftxui/dom/elements.hpp index d331ba5..1e20bb5 100644 --- a/include/ftxui/dom/elements.hpp +++ b/include/ftxui/dom/elements.hpp @@ -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_ELEMENTS_HPP #define FTXUI_DOM_ELEMENTS_HPP @@ -108,3 +104,7 @@ TAKE_ANY_ARGS(hflow) } // namespace ftxui #endif /* end of include guard: FTXUI_DOM_ELEMENTS_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. diff --git a/include/ftxui/dom/node.hpp b/include/ftxui/dom/node.hpp index b6868df..7998da6 100644 --- a/include/ftxui/dom/node.hpp +++ b/include/ftxui/dom/node.hpp @@ -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_HPP #define FTXUI_DOM_NODE_HPP @@ -50,3 +46,7 @@ void Render(Screen& screen, Node* node); } // namespace ftxui #endif /* end of include guard: FTXUI_DOM_NODE_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. diff --git a/include/ftxui/dom/requirement.hpp b/include/ftxui/dom/requirement.hpp index c781c80..c255423 100644 --- a/include/ftxui/dom/requirement.hpp +++ b/include/ftxui/dom/requirement.hpp @@ -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_REQUIREMENT_HPP #define FTXUI_DOM_REQUIREMENT_HPP @@ -33,3 +29,7 @@ struct Requirement { } // namespace ftxui #endif /* end of include guard: FTXUI_REQUIREMENT_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. diff --git a/include/ftxui/dom/take_any_args.hpp b/include/ftxui/dom/take_any_args.hpp index 8de009b..fecee23 100644 --- a/include/ftxui/dom/take_any_args.hpp +++ b/include/ftxui/dom/take_any_args.hpp @@ -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 template @@ -32,3 +28,7 @@ Elements unpack(Args... args) { Element container(Args... children) { \ return container(unpack(std::forward(children)...)); \ } + +// 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. diff --git a/include/ftxui/screen/box.hpp b/include/ftxui/screen/box.hpp index aaa9f45..3a64302 100644 --- a/include/ftxui/screen/box.hpp +++ b/include/ftxui/screen/box.hpp @@ -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_SCREEN_BOX_HPP #define FTXUI_SCREEN_BOX_HPP @@ -19,3 +15,7 @@ struct Box { } // namespace ftxui #endif /* end of include guard: FTXUI_SCREEN_BOX_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. diff --git a/include/ftxui/screen/color.hpp b/include/ftxui/screen/color.hpp index 1a2d058..3e46281 100644 --- a/include/ftxui/screen/color.hpp +++ b/include/ftxui/screen/color.hpp @@ -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_SCREEN_COLOR #define FTXUI_SCREEN_COLOR @@ -44,3 +40,7 @@ enum class Color : uint8_t { } // namespace ftxui #endif /* end of include guard: FTXUI_COLOR_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. diff --git a/include/ftxui/screen/screen.hpp b/include/ftxui/screen/screen.hpp index 98341f1..7caba26 100644 --- a/include/ftxui/screen/screen.hpp +++ b/include/ftxui/screen/screen.hpp @@ -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_SCREEN_SCREEN #define FTXUI_SCREEN_SCREEN @@ -91,3 +87,7 @@ class Screen { } // namespace ftxui #endif /* end of include guard: FTXUI_SCREEN_SCREEN */ + +// 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. diff --git a/include/ftxui/screen/string.hpp b/include/ftxui/screen/string.hpp index e6e5da9..86899cc 100644 --- a/include/ftxui/screen/string.hpp +++ b/include/ftxui/screen/string.hpp @@ -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_SCREEN_STRING_HPP #define FTXUI_SCREEN_STRING_HPP @@ -23,3 +19,7 @@ int wstring_width_cjk(const std::wstring&); } // namespace ftxui #endif /* end of include guard: FTXUI_SCREEN_STRING_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. diff --git a/include/ftxui/util/autoreset.hpp b/include/ftxui/util/autoreset.hpp index aa09c00..f71c5df 100644 --- a/include/ftxui/util/autoreset.hpp +++ b/include/ftxui/util/autoreset.hpp @@ -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_UTIL_AUTORESET_HPP #define FTXUI_UTIL_AUTORESET_HPP @@ -24,3 +20,7 @@ class AutoReset { } // namespace ftxui #endif /* end of include guard: FTXUI_UTIL_AUTORESET_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. diff --git a/src/ftxui/component/checkbox.cpp b/src/ftxui/component/checkbox.cpp index 86e5dfb..9f9cfd9 100644 --- a/src/ftxui/component/checkbox.cpp +++ b/src/ftxui/component/checkbox.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/component.cpp b/src/ftxui/component/component.cpp index fa07cc1..6588aee 100644 --- a/src/ftxui/component/component.cpp +++ b/src/ftxui/component/component.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index 3e05245..58abcc7 100644 --- a/src/ftxui/component/container.cpp +++ b/src/ftxui/component/container.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/container_test.cpp b/src/ftxui/component/container_test.cpp index a8c6e6b..e28646e 100644 --- a/src/ftxui/component/container_test.cpp +++ b/src/ftxui/component/container_test.cpp @@ -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. diff --git a/src/ftxui/component/event.cpp b/src/ftxui/component/event.cpp index cff815e..a523494 100644 --- a/src/ftxui/component/event.cpp +++ b/src/ftxui/component/event.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/event_test.cpp b/src/ftxui/component/event_test.cpp index d17866c..5830991 100644 --- a/src/ftxui/component/event_test.cpp +++ b/src/ftxui/component/event_test.cpp @@ -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. diff --git a/src/ftxui/component/input.cpp b/src/ftxui/component/input.cpp index f5d6f63..db04765 100644 --- a/src/ftxui/component/input.cpp +++ b/src/ftxui/component/input.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/menu.cpp b/src/ftxui/component/menu.cpp index 321edbb..12b5ee3 100644 --- a/src/ftxui/component/menu.cpp +++ b/src/ftxui/component/menu.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/radiobox.cpp b/src/ftxui/component/radiobox.cpp index 6e89d95..ff7d169 100644 --- a/src/ftxui/component/radiobox.cpp +++ b/src/ftxui/component/radiobox.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/radiobox_test.cpp b/src/ftxui/component/radiobox_test.cpp index 22a7566..8fd5c2d 100644 --- a/src/ftxui/component/radiobox_test.cpp +++ b/src/ftxui/component/radiobox_test.cpp @@ -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. diff --git a/src/ftxui/component/receiver_test.cpp b/src/ftxui/component/receiver_test.cpp index 7cdd513..8d06cc8 100644 --- a/src/ftxui/component/receiver_test.cpp +++ b/src/ftxui/component/receiver_test.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 125a82c..7f7d8e9 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -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 @@ -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 - #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 +#ifndef UNICODE +#error Must be compiled in UNICODE mode +#endif #else - #include - #include +#include +#include #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 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. diff --git a/src/ftxui/component/toggle.cpp b/src/ftxui/component/toggle.cpp index 59786a2..c7be19e 100644 --- a/src/ftxui/component/toggle.cpp +++ b/src/ftxui/component/toggle.cpp @@ -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 @@ -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. diff --git a/src/ftxui/component/toggle_test.cpp b/src/ftxui/component/toggle_test.cpp index cf376d6..acb19ef 100644 --- a/src/ftxui/component/toggle_test.cpp +++ b/src/ftxui/component/toggle_test.cpp @@ -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. diff --git a/src/ftxui/dom/blink.cpp b/src/ftxui/dom/blink.cpp index d26e451..bf07de0 100644 --- a/src/ftxui/dom/blink.cpp +++ b/src/ftxui/dom/blink.cpp @@ -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. diff --git a/src/ftxui/dom/bold.cpp b/src/ftxui/dom/bold.cpp index 4865bfd..f959e81 100644 --- a/src/ftxui/dom/bold.cpp +++ b/src/ftxui/dom/bold.cpp @@ -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. diff --git a/src/ftxui/dom/border.cpp b/src/ftxui/dom/border.cpp index 3a58d23..cd0da33 100644 --- a/src/ftxui/dom/border.cpp +++ b/src/ftxui/dom/border.cpp @@ -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 #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. diff --git a/src/ftxui/dom/color.cpp b/src/ftxui/dom/color.cpp index abf648a..c48fdc6 100644 --- a/src/ftxui/dom/color.cpp +++ b/src/ftxui/dom/color.cpp @@ -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. diff --git a/src/ftxui/dom/composite_decorator.cpp b/src/ftxui/dom/composite_decorator.cpp index d0eccdd..c818327 100644 --- a/src/ftxui/dom/composite_decorator.cpp +++ b/src/ftxui/dom/composite_decorator.cpp @@ -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. diff --git a/src/ftxui/dom/dbox.cpp b/src/ftxui/dom/dbox.cpp index e8e2dd3..f096417 100644 --- a/src/ftxui/dom/dbox.cpp +++ b/src/ftxui/dom/dbox.cpp @@ -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 #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. diff --git a/src/ftxui/dom/dim.cpp b/src/ftxui/dom/dim.cpp index 286d842..7b6b68a 100644 --- a/src/ftxui/dom/dim.cpp +++ b/src/ftxui/dom/dim.cpp @@ -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. diff --git a/src/ftxui/dom/flex.cpp b/src/ftxui/dom/flex.cpp index b6042dd..2e8705b 100644 --- a/src/ftxui/dom/flex.cpp +++ b/src/ftxui/dom/flex.cpp @@ -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. diff --git a/src/ftxui/dom/frame.cpp b/src/ftxui/dom/frame.cpp index f2d666f..537aabd 100644 --- a/src/ftxui/dom/frame.cpp +++ b/src/ftxui/dom/frame.cpp @@ -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 #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. diff --git a/src/ftxui/dom/gauge.cpp b/src/ftxui/dom/gauge.cpp index 747f1e3..d448036 100644 --- a/src/ftxui/dom/gauge.cpp +++ b/src/ftxui/dom/gauge.cpp @@ -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. diff --git a/src/ftxui/dom/gauge_test.cpp b/src/ftxui/dom/gauge_test.cpp index eca3338..1056396 100644 --- a/src/ftxui/dom/gauge_test.cpp +++ b/src/ftxui/dom/gauge_test.cpp @@ -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. diff --git a/src/ftxui/dom/graph.cpp b/src/ftxui/dom/graph.cpp index e3ecc1c..67f0cd3 100644 --- a/src/ftxui/dom/graph.cpp +++ b/src/ftxui/dom/graph.cpp @@ -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. diff --git a/src/ftxui/dom/hbox.cpp b/src/ftxui/dom/hbox.cpp index 3c51f3b..3ff91e0 100644 --- a/src/ftxui/dom/hbox.cpp +++ b/src/ftxui/dom/hbox.cpp @@ -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 #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. diff --git a/src/ftxui/dom/hbox_test.cpp b/src/ftxui/dom/hbox_test.cpp index 63ffec0..dbeac3a 100644 --- a/src/ftxui/dom/hbox_test.cpp +++ b/src/ftxui/dom/hbox_test.cpp @@ -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. diff --git a/src/ftxui/dom/hflow.cpp b/src/ftxui/dom/hflow.cpp index d2b8309..ee6ff04 100644 --- a/src/ftxui/dom/hflow.cpp +++ b/src/ftxui/dom/hflow.cpp @@ -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 #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. diff --git a/src/ftxui/dom/inverted.cpp b/src/ftxui/dom/inverted.cpp index 76badb8..4b06dad 100644 --- a/src/ftxui/dom/inverted.cpp +++ b/src/ftxui/dom/inverted.cpp @@ -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. diff --git a/src/ftxui/dom/node.cpp b/src/ftxui/dom/node.cpp index a347b11..628356d 100644 --- a/src/ftxui/dom/node.cpp +++ b/src/ftxui/dom/node.cpp @@ -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. diff --git a/src/ftxui/dom/node_decorator.cpp b/src/ftxui/dom/node_decorator.cpp index f62c918..db5c39a 100644 --- a/src/ftxui/dom/node_decorator.cpp +++ b/src/ftxui/dom/node_decorator.cpp @@ -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. diff --git a/src/ftxui/dom/node_decorator.hpp b/src/ftxui/dom/node_decorator.hpp index d26c598..0336b04 100644 --- a/src/ftxui/dom/node_decorator.hpp +++ b/src/ftxui/dom/node_decorator.hpp @@ -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. diff --git a/src/ftxui/dom/paragraph.cpp b/src/ftxui/dom/paragraph.cpp index 2c5d9cf..7b9e0e2 100644 --- a/src/ftxui/dom/paragraph.cpp +++ b/src/ftxui/dom/paragraph.cpp @@ -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 #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. diff --git a/src/ftxui/dom/separator.cpp b/src/ftxui/dom/separator.cpp index 4ae2a7a..a95701c 100644 --- a/src/ftxui/dom/separator.cpp +++ b/src/ftxui/dom/separator.cpp @@ -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. diff --git a/src/ftxui/dom/size.cpp b/src/ftxui/dom/size.cpp index e21bbe1..dc6d115 100644 --- a/src/ftxui/dom/size.cpp +++ b/src/ftxui/dom/size.cpp @@ -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 #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. diff --git a/src/ftxui/dom/spinner.cpp b/src/ftxui/dom/spinner.cpp index c9b8c2a..a534ea3 100644 --- a/src/ftxui/dom/spinner.cpp +++ b/src/ftxui/dom/spinner.cpp @@ -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. diff --git a/src/ftxui/dom/text.cpp b/src/ftxui/dom/text.cpp index 25c278d..6c90b31 100644 --- a/src/ftxui/dom/text.cpp +++ b/src/ftxui/dom/text.cpp @@ -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 #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. diff --git a/src/ftxui/dom/text_test.cpp b/src/ftxui/dom/text_test.cpp index b400462..d4f6e0e 100644 --- a/src/ftxui/dom/text_test.cpp +++ b/src/ftxui/dom/text_test.cpp @@ -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. diff --git a/src/ftxui/dom/underlined.cpp b/src/ftxui/dom/underlined.cpp index 6b5835f..ade9266 100644 --- a/src/ftxui/dom/underlined.cpp +++ b/src/ftxui/dom/underlined.cpp @@ -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. diff --git a/src/ftxui/dom/util.cpp b/src/ftxui/dom/util.cpp index d5f4672..d4c45e0 100644 --- a/src/ftxui/dom/util.cpp +++ b/src/ftxui/dom/util.cpp @@ -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. diff --git a/src/ftxui/dom/vbox.cpp b/src/ftxui/dom/vbox.cpp index 919bab4..f20951e 100644 --- a/src/ftxui/dom/vbox.cpp +++ b/src/ftxui/dom/vbox.cpp @@ -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 #include @@ -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. diff --git a/src/ftxui/dom/vbox_test.cpp b/src/ftxui/dom/vbox_test.cpp index 3afad30..cffa74a 100644 --- a/src/ftxui/dom/vbox_test.cpp +++ b/src/ftxui/dom/vbox_test.cpp @@ -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. diff --git a/src/ftxui/screen/box.cpp b/src/ftxui/screen/box.cpp index 05f5a29..85a17e0 100644 --- a/src/ftxui/screen/box.cpp +++ b/src/ftxui/screen/box.cpp @@ -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 @@ -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. diff --git a/src/ftxui/screen/screen.cpp b/src/ftxui/screen/screen.cpp index 67c3b6e..453240f 100644 --- a/src/ftxui/screen/screen.cpp +++ b/src/ftxui/screen/screen.cpp @@ -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 @@ -12,11 +8,11 @@ #include "ftxui/screen/terminal.hpp" #if defined(_WIN32) - #define WIN32_LEAN_AND_MEAN - #ifndef NOMINMAX - #define NOMINMAX - #endif - #include +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include #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. diff --git a/src/ftxui/screen/string.cpp b/src/ftxui/screen/string.cpp index e3afd56..215a78e 100644 --- a/src/ftxui/screen/string.cpp +++ b/src/ftxui/screen/string.cpp @@ -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 @@ -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. diff --git a/src/ftxui/screen/terminal.cpp b/src/ftxui/screen/terminal.cpp index 2c5f07f..549a336 100644 --- a/src/ftxui/screen/terminal.cpp +++ b/src/ftxui/screen/terminal.cpp @@ -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 #if defined(_WIN32) - #define WIN32_LEAN_AND_MEAN - #define NOMINMAX - #include +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include #else - #include - #include +#include +#include #endif #include @@ -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. diff --git a/src/ftxui/screen/terminal.hpp b/src/ftxui/screen/terminal.hpp index 8e29596..b25bec7 100644 --- a/src/ftxui/screen/terminal.hpp +++ b/src/ftxui/screen/terminal.hpp @@ -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. diff --git a/src/ftxui/screen/wcwidth.cpp b/src/ftxui/screen/wcwidth.cpp index 92e3697..6d3bcdb 100644 --- a/src/ftxui/screen/wcwidth.cpp +++ b/src/ftxui/screen/wcwidth.cpp @@ -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. diff --git a/other/format.sh b/tools/format.sh similarity index 85% rename from other/format.sh rename to tools/format.sh index b91b0d0..b5febfd 100755 --- a/other/format.sh +++ b/tools/format.sh @@ -8,7 +8,7 @@ for file in $files do if ! grep -q Copyright $file then - cat ./other/license_headers.cpp $file >$file.new && mv $file.new $file + cat $file ./other/license_headers.cpp > $file.new && mv $file.new $file fi done diff --git a/other/license_headers.cpp b/tools/license_headers.cpp similarity index 100% rename from other/license_headers.cpp rename to tools/license_headers.cpp index 81c0407..e7e7258 100644 --- a/other/license_headers.cpp +++ b/tools/license_headers.cpp @@ -1,4 +1,4 @@ + // 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. -