diff --git a/.clang-format b/.clang-format index 2dc5fa5e6b0f7cc8e16df1322bf28dfd40f58087..0f21d0bb9e4a31e91f24f624dec27a85be72a64c 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 f3ae0cbc209876fc5bedd777e09e677f0c792a0a..b8d6795c8c3bcec8462cae92a849dec3dfb80c44 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 0000000000000000000000000000000000000000..483fa6b106dbca4bb1c046271ecedc997a996a6e --- /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 ffcee327af45656a661132294f062258efb8107e..046abaaa5d20c3c0b721cf4cfaeb6c190ce62587 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 bd739f61db00e83f86de6d92b7b0487aea74f12e..3c7129c8821055b05765a543608cd43af36b1252 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 70fde164458e704815f2c8a706a2eaee9724c811..444fa0a6c711242e9869119da5bc0c94478558eb 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 f24082eea044c8f34e754ed4cb81784d77bf7fd5..da10938071252b3817a7655f87968212fd054ab5 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 712696f893cc11e6bd25ae677c50525f43a0af71..e301eb4d9cc64f1f2a9438ee639a24cecff1b28d 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 91a709b9e070260e6dee7dfb3f644af949f8cc7e..66108e018a7a42920103c142221f5132eddf9a62 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 726f7631393c83cf0e960ba3cd7b1bb638f9721d..793e41d8ac819f7f64a4a34563fa463b09162690 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 86874fe6b3077381f79939520457e72e015c129c..ef65d81473a67570a48ec624c409b79c17e71501 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<T> 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 ce838f55e69a01593d2d89dda57bd3da3f63a8d0..3327969789c6cecdc8fd0caae9e01e85dce102c4 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 f0a2a653bb628ac129a5ff0e70b373949292cc53..d0f129039b828d86ecc02e467624bd01973ff847 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<void()> on_change = []() {}; std::function<void()> 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 d331ba5863f236688afb2a23e8935a16cfea2e5b..1e20bb56e05f484961231d5b6a55f0f0b57ea92d 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 b6868dfe6794dca54c71978cb45e445b46bc2d40..7998da6b66e1021953d82237e17d6e3e82b47d7e 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 c781c808da6a69faf8ceb1d69a964285083c802c..c2554232055c2b6dc6d33a6190e0cbbf6b18de65 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 8de009b5fb13e1f78d107adba3b1ca5379c547d0..fecee2389b355efbdb44c2f71fd411288e385217 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 <type_traits> template <class T> @@ -32,3 +28,7 @@ Elements unpack(Args... args) { Element container(Args... children) { \ return container(unpack(std::forward<Args>(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 aaa9f4562e7bd8b78970f156052c663fe343bb69..3a643027a5559728d375fe5c3c86fc2d43acf5a6 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 1a2d0588c3f73d56b0e8fb9c91fa20385c9ff143..3e46281b017f487117be50348ab51ccbc249b8d7 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 98341f18c23cb9bebf34313d8bdd05755247803d..7caba267acfccbc9bdd48280000e98b37a37a218 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 e6e5da9a514938967b51cfa7827953fe91c1c926..86899cc5f93a278e59c6c553911f7e179db24182 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 aa09c000ef2c99fb8f0193fda0e7cd03dabc9b59..f71c5df9e964257142f2dab77504b902bd84c566 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 86e5dfb9fd1c789a39ef3a91b2a87ab737a78cd7..9f9cfd96b83aaea2d0a2853e575974c204d50ef7 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 <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. diff --git a/src/ftxui/component/component.cpp b/src/ftxui/component/component.cpp index fa07cc14c0efff424bb74613ee8e38a30d588579..6588aee2463cfebda1f82ff696289894ed264f01 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 <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. diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index 3e0524574822c718a02b9086dfcaeaa9fbf44e41..58abcc749f1c6ef2ff7f45ec4f0af6d7cbacb9c4 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 <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. diff --git a/src/ftxui/component/container_test.cpp b/src/ftxui/component/container_test.cpp index a8c6e6b3667e93748073515047ade9c322495b30..e28646e2773ed36b32893c801968fc6d61925650 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 cff815eed83780368549b9da0272bff670b8fff8..a523494ceeb9dc21500b62e0e001dc9c58579a32 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 <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. diff --git a/src/ftxui/component/event_test.cpp b/src/ftxui/component/event_test.cpp index d17866ca2dadab0847d75c88ebc63fca3dcc398f..5830991d62eae44fb3db15fb92b3b40c41340636 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 f5d6f63b79a7d5e9e8f46aa6f4ac4bdeeb45177a..db04765c1cdc7c6906c5c847c7a59fba87b3c77e 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 <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. diff --git a/src/ftxui/component/menu.cpp b/src/ftxui/component/menu.cpp index 321edbb7975b12f5fbd5ba662852c49b2714f957..12b5ee3470b9d2d0fce12eca4e6803e33334978a 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 <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. diff --git a/src/ftxui/component/radiobox.cpp b/src/ftxui/component/radiobox.cpp index 6e89d956c4df2791c9145b4e0149ad7e87d35c23..ff7d169f82747cb33fa6e3ee1201eecebac74390 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 <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. diff --git a/src/ftxui/component/radiobox_test.cpp b/src/ftxui/component/radiobox_test.cpp index 22a75660eac7d5456912dfb8e7c9686b00ae731f..8fd5c2d36afbb326afe244f9bfdebf7b36d549f6 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 7cdd513fe47d617a9f7f0773cc550050e202b59d..8d06cc8eb9aeed1bd488040102a136766a29b66f 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 <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. diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 125a82c2b3d7773c4e5acd20f5a5437e849425f4..7f7d8e9985d374f5d03b966017b984ad1bdc7cae 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 <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. diff --git a/src/ftxui/component/toggle.cpp b/src/ftxui/component/toggle.cpp index 59786a2881bfdf6b1e364b043340a3d68d20f2a9..c7be19e28ffc9be77da25542b8da323bb7476576 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 <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. diff --git a/src/ftxui/component/toggle_test.cpp b/src/ftxui/component/toggle_test.cpp index cf376d603dffc83519ac0fb0e5ab5a771525982b..acb19ef3e430f9bfef28aeb8b8e34865ea6d25c0 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_TRUE(toggle.OnEvent(Event::ArrowRight)); // [1] -> [2] EXPECT_EQ(counter, 2); - - EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right. + + EXPECT_FALSE(toggle.OnEvent(Event::ArrowRight)); // Reached far right. EXPECT_EQ(counter, 2); - EXPECT_TRUE(toggle.OnEvent(Event::ArrowLeft)); // [2] -> [1] + 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 d26e451a91bd42a414cf0f86acc28af28851328d..bf07de03e7f31a464139d8eb7fbdf7fe811b2cd7 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 4865bfd22b45e03327fc52f18eca6715434a083e..f959e814bdf7fa569a0d5ab52f2f90615c038f07 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 3a58d233e460a54bc05d4005138d7704fb07d681..cd0da33782767ed64bb399361d78e3cc4a0125bd 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 <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. diff --git a/src/ftxui/dom/color.cpp b/src/ftxui/dom/color.cpp index abf648a5bfc9270bec6f05d37ec791520d3c1ecb..c48fdc63650c1ea4dd2140c43f680012b5b53432 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 d0eccdd4d038dd1d1e024af470526132d5d1d5a4..c8183276218ed136eda50d9b2566d5cf6d1eeff6 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 e8e2dd3530f68203c698ac3b6837d41f9e75d2b4..f09641717307919f8c22fa7dd243444bbc2f62cb 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 <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. diff --git a/src/ftxui/dom/dim.cpp b/src/ftxui/dom/dim.cpp index 286d84242ba7d5aa3de75f8865d60d83a5fc7202..7b6b68ad6cece50dede44507387b35a06adb4553 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 b6042dd6cc1d93aaaa13680dd432cd2f8c88c1b3..2e8705b20c72c8844a3366c8d88edb1db73f2231 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 f2d666f9c022f055ae1bc20da49735d424e3c5a4..537aabd7239380760d57434c3e87d8099c64b609 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 <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. diff --git a/src/ftxui/dom/gauge.cpp b/src/ftxui/dom/gauge.cpp index 747f1e39d91649ae50505231954518fa7089625d..d448036a3c49afe72939d79589240a92efd48295 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 eca33388065255b1e530c5d965e8c303591c3346..10563967268329f5d057d034dcb1e3036995309a 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 e3ecc1c3a33b327b150d093fdb2680af572b865f..67f0cd36a826c50b4564b816b08ebdeb78342b05 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 3c51f3ba0fea067e3bcb40bfd5817a246147f7b0..3ff91e008e327a2b0c05dd2305d396e86595e686 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 <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. diff --git a/src/ftxui/dom/hbox_test.cpp b/src/ftxui/dom/hbox_test.cpp index 63ffec02348af67b3a75075233dd2885676601a6..dbeac3a65b07187172c36226bc4dd6318d9a4f4a 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 d2b8309b413fd847275ada923e32f80e38a778fa..ee6ff0470fd53ce9a873f5a0b4fef90cb3c3119a 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 <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. diff --git a/src/ftxui/dom/inverted.cpp b/src/ftxui/dom/inverted.cpp index 76badb82f64c6f6f8ad56daaa59df902630cca73..4b06dad434f3adce98f7d462069d23fc7c7cabe8 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 a347b11baa4d5320a830d702807c1f7b46150981..628356d47424c352b2b850a9fd20798e7a65b458 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 f62c918703dd7ead84217b8b409168bd77af34d7..db5c39a58a852723a009a3d3ee45d3a0a7c5c2ac 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 d26c5984a4fb01eb1fdc7564c51eee5722494104..0336b04c823e3677fd80b2ca9510d87e3006efa1 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 2c5d9cf3c3c56a389b3d668e98908477b6019e4e..7b9e0e23dbda6ba6b794db138547c511327330af 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 <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. diff --git a/src/ftxui/dom/separator.cpp b/src/ftxui/dom/separator.cpp index 4ae2a7abe618f38cff8beb7b3eca8c6e576333b5..a95701c8063231921246cc6213b440f7e9980307 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 e21bbe1fc2999957a6e6eb7906637ec7dc980baf..dc6d1157b3bbf87578388e2d82b69458814a88e2 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 <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. diff --git a/src/ftxui/dom/spinner.cpp b/src/ftxui/dom/spinner.cpp index c9b8c2af1e2816c4202d6d9a4e21458347a422e5..a534ea30ac1a7b34e2a3cb1ae5ab5e8ddf689c35 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 25c278d45bbed2f38d0bdc3e201cac114f5721c0..6c90b318b101e5c4a789178601032afc97534900 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 <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. diff --git a/src/ftxui/dom/text_test.cpp b/src/ftxui/dom/text_test.cpp index b4004624ea727046870ea2743f3c1a973cceedc9..d4f6e0e0b0b3455f1f288ab75317126062f3ce56 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 6b5835f21f997b32c8301b785bafc57d743680bd..ade9266ebf8da579c546e6f320178010206f2743 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 d5f46725241f70f18fb88e7a97e56666967df1c0..d4c45e0d489c8fc6ee63c6705f7b8c368e8cad51 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 919bab4215832359acd84b7d3d63bd7c83fafabc..f20951eb1563ea8f70988378389507ab8b2ce950 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 <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. diff --git a/src/ftxui/dom/vbox_test.cpp b/src/ftxui/dom/vbox_test.cpp index 3afad305fc19fd4796afd5b8007c00bb4072dadc..cffa74aaf7af7aad6c76154e267474969b29baf6 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 05f5a2930d013e52b89800f6b7afcdc5da2eefc4..85a17e00370ecc3a759426f5033c9d93c7c07511 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 <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. diff --git a/src/ftxui/screen/screen.cpp b/src/ftxui/screen/screen.cpp index 67c3b6e53ae4140494e73597a9f492a69c45a579..453240f04fbbfd796bfebcde4dde682108707b2f 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 <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. diff --git a/src/ftxui/screen/string.cpp b/src/ftxui/screen/string.cpp index e3afd5680e18e2488e48bef04f1b3736c9e06f0b..215a78e9a12dda434faa82d1e5733823c468b0e1 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 <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. diff --git a/src/ftxui/screen/terminal.cpp b/src/ftxui/screen/terminal.cpp index 2c5f07f15cfc87f07e67cf522cfca24c26b1c2e9..549a336aaaf23a0e083d9a29b0ac16377fb59719 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 <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. diff --git a/src/ftxui/screen/terminal.hpp b/src/ftxui/screen/terminal.hpp index 8e295963755834449126d0a8e014d4b10bcc8003..b25bec75f936007b012c86f8f41bacef90714ab3 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 92e3697acf6dcdfdef44e1cb0fa9aeb363279a73..6d3bcdbc7511ca9b6f30ea82e9806911f1aa2f01 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 b91b0d0ed9c47cd881892b223d6d12190175fc62..b5febfd77ccdafd27fd992532e7d05961e2afc41 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 81c04074f48ddc0123004ce4c80df8558add5d35..e7e7258f36a09f32d30cf82854b1f2d8123c99d5 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. -