diff --git a/examples/component/button.cpp b/examples/component/button.cpp index 00314a98..d38f4c17 100644 --- a/examples/component/button.cpp +++ b/examples/component/button.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/button.hpp" #include "ftxui/component/component.hpp" @@ -46,3 +42,7 @@ int main(int argc, const char* argv[]) { screen.Loop(&component); return 0; } + +// Copyright 2020 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/examples/component/checkbox.cpp b/examples/component/checkbox.cpp index c63de283..a0cb0b86 100644 --- a/examples/component/checkbox.cpp +++ b/examples/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 "ftxui/component/component.hpp" @@ -36,3 +32,7 @@ int main(int argc, const char* argv[]) { screen.Loop(&component); return 0; } + +// Copyright 2020 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/examples/component/checkbox_in_frame.cpp b/examples/component/checkbox_in_frame.cpp index aa66be72..608f2d2f 100644 --- a/examples/component/checkbox_in_frame.cpp +++ b/examples/component/checkbox_in_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 "ftxui/component/checkbox.hpp" #include "ftxui/component/container.hpp" #include "ftxui/component/input.hpp" @@ -47,3 +43,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/component/gallery.cpp b/examples/component/gallery.cpp index a7d0264b..54f4d6cc 100644 --- a/examples/component/gallery.cpp +++ b/examples/component/gallery.cpp @@ -1,9 +1,5 @@ -// Copyright 2020 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 "ftxui/component/button.hpp" +#include "ftxui/component/checkbox.hpp" #include "ftxui/component/container.hpp" #include "ftxui/component/input.hpp" #include "ftxui/component/menu.hpp" @@ -100,3 +96,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/component/homescreen.cpp b/examples/component/homescreen.cpp index 33c129ca..ac8fc83b 100644 --- a/examples/component/homescreen.cpp +++ b/examples/component/homescreen.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 @@ -385,3 +381,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/component/input.cpp b/examples/component/input.cpp index a28afd7b..2f2eb51e 100644 --- a/examples/component/input.cpp +++ b/examples/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 @@ -48,3 +44,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/component/menu.cpp b/examples/component/menu.cpp index db8b96f4..1fd33e3e 100644 --- a/examples/component/menu.cpp +++ b/examples/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 @@ -23,3 +19,7 @@ int main(int argc, const char* argv[]) { std::cout << "Selected element = " << menu.selected << std::endl; } + +// Copyright 2020 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/examples/component/menu2.cpp b/examples/component/menu2.cpp index 82f4a68b..dd422f6f 100644 --- a/examples/component/menu2.cpp +++ b/examples/component/menu2.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 #include @@ -81,3 +77,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/component/menu_style.cpp b/examples/component/menu_style.cpp index ba72bf22..839d2630 100644 --- a/examples/component/menu_style.cpp +++ b/examples/component/menu_style.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 @@ -75,3 +71,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/component/modal_dialog.cpp b/examples/component/modal_dialog.cpp index abdfff22..520fd78f 100644 --- a/examples/component/modal_dialog.cpp +++ b/examples/component/modal_dialog.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/button.hpp" #include "ftxui/component/component.hpp" #include "ftxui/component/container.hpp" @@ -24,7 +20,7 @@ class Content : public Component { } Element Render() final { - auto button_elements= hbox({ + auto button_elements = hbox({ button_rate_ftxui.Render(), filler(), button_quit_.Render(), @@ -126,3 +122,7 @@ int main(int argc, const char* argv[]) { screen.Loop(&my_component); return 0; } + +// Copyright 2020 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/examples/component/radiobox.cpp b/examples/component/radiobox.cpp index 46e106d8..62d0f1ef 100644 --- a/examples/component/radiobox.cpp +++ b/examples/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 "ftxui/component/component.hpp" @@ -22,3 +18,7 @@ int main(int argc, const char* argv[]) { screen.Loop(&radiobox); return 0; } + +// Copyright 2020 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/examples/component/radiobox_in_frame.cpp b/examples/component/radiobox_in_frame.cpp index ae40ac36..0137425f 100644 --- a/examples/component/radiobox_in_frame.cpp +++ b/examples/component/radiobox_in_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 "ftxui/component/checkbox.hpp" #include "ftxui/component/container.hpp" #include "ftxui/component/input.hpp" @@ -36,3 +32,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/component/tab_horizontal.cpp b/examples/component/tab_horizontal.cpp index 77e689f8..a475e4bc 100644 --- a/examples/component/tab_horizontal.cpp +++ b/examples/component/tab_horizontal.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 @@ -68,3 +64,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/component/tab_vertical.cpp b/examples/component/tab_vertical.cpp index c8ad6898..b32a8d9b 100644 --- a/examples/component/tab_vertical.cpp +++ b/examples/component/tab_vertical.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/component/container.hpp" @@ -62,3 +58,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/component/toggle.cpp b/examples/component/toggle.cpp index 38fe4342..ef2cd3ab 100644 --- a/examples/component/toggle.cpp +++ b/examples/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 @@ -64,3 +60,7 @@ int main(int argc, const char* argv[]) { component.on_enter = screen.ExitLoopClosure(); screen.Loop(&component); } + +// Copyright 2020 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/examples/dom/border.cpp b/examples/dom/border.cpp index 0cceddbb..7a49f3e6 100644 --- a/examples/dom/border.cpp +++ b/examples/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 #include @@ -34,3 +30,7 @@ int main(int argc, const char* argv[]) { Render(screen, document); std::cout << screen.ToString() << std::endl; } + +// Copyright 2020 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/examples/dom/color_gallery.cpp b/examples/dom/color_gallery.cpp index a5e745cf..a9c33b38 100644 --- a/examples/dom/color_gallery.cpp +++ b/examples/dom/color_gallery.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 #include @@ -107,3 +103,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/color_info_palette256.cpp b/examples/dom/color_info_palette256.cpp index 74ed58b9..13528774 100644 --- a/examples/dom/color_info_palette256.cpp +++ b/examples/dom/color_info_palette256.cpp @@ -1,14 +1,10 @@ -// Copyright 2020 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 #include -#include +#include #include -#include "ftxui/screen/string.hpp" +#include +#include #include +#include "ftxui/screen/string.hpp" int main(int argc, const char* argv[]) { using namespace ftxui; @@ -55,29 +51,32 @@ int main(int argc, const char* argv[]) { best_index = j; } } - std::swap(column[i+1], column[best_index]); + std::swap(column[i + 1], column[best_index]); } } // Draw every columns Elements columns_elements; - for(auto& column : info_columns) { + for (auto& column : info_columns) { Elements column_elements; - for(auto& it : column) { + for (auto& it : column) { column_elements.push_back(hbox({ - text(L" ") | bgcolor(Color(Color::Palette256(it.index))), - text(to_wstring(std::string(it.name))), + text(L" ") | bgcolor(Color(Color::Palette256(it.index))), + text(to_wstring(std::string(it.name))), })); } columns_elements.push_back(vbox(std::move(column_elements))); } auto document = hbox(std::move(columns_elements)); - auto screen = - Screen::Create(Dimension::Full(), Dimension::Fit(document)); + auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document)); Render(screen, document); std::cout << screen.ToString(); return 0; } + +// Copyright 2020 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/examples/dom/color_truecolor_HSV.cpp b/examples/dom/color_truecolor_HSV.cpp index 5de665e2..ba6ae7a2 100644 --- a/examples/dom/color_truecolor_HSV.cpp +++ b/examples/dom/color_truecolor_HSV.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 #include @@ -30,3 +26,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/color_truecolor_RGB.cpp b/examples/dom/color_truecolor_RGB.cpp index 2bd87d95..ed1495ba 100644 --- a/examples/dom/color_truecolor_RGB.cpp +++ b/examples/dom/color_truecolor_RGB.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 #include @@ -53,3 +49,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/dbox.cpp b/examples/dom/dbox.cpp index 7c59328e..67561ef1 100644 --- a/examples/dom/dbox.cpp +++ b/examples/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 #include @@ -25,3 +21,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/gauge.cpp b/examples/dom/gauge.cpp index 54068e3a..2d7ecd34 100644 --- a/examples/dom/gauge.cpp +++ b/examples/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 #include #include @@ -30,3 +26,7 @@ int main(int argc, const char* argv[]) { } std::cout << std::endl; } + +// Copyright 2020 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/examples/dom/graph.cpp b/examples/dom/graph.cpp index aa6b049a..dbf7f1ef 100644 --- a/examples/dom/graph.cpp +++ b/examples/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 #include #include @@ -74,3 +70,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/hflow.cpp b/examples/dom/hflow.cpp index 0f796a0c..ef6beb22 100644 --- a/examples/dom/hflow.cpp +++ b/examples/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 #include @@ -47,3 +43,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/html_like.cpp b/examples/dom/html_like.cpp index b00fcad6..6485cf11 100644 --- a/examples/dom/html_like.cpp +++ b/examples/dom/html_like.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 #include @@ -54,3 +50,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/package_manager.cpp b/examples/dom/package_manager.cpp index 99c129fa..3875945b 100644 --- a/examples/dom/package_manager.cpp +++ b/examples/dom/package_manager.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 #include @@ -143,3 +139,7 @@ int main(int argc, const char* argv[]) { } std::cout << std::endl; } + +// Copyright 2020 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/examples/dom/paragraph.cpp b/examples/dom/paragraph.cpp index fab3826f..7ed3d149 100644 --- a/examples/dom/paragraph.cpp +++ b/examples/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 #include @@ -34,3 +30,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/separator.cpp b/examples/dom/separator.cpp index 08337610..e5758686 100644 --- a/examples/dom/separator.cpp +++ b/examples/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 #include #include @@ -27,3 +23,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/size.cpp b/examples/dom/size.cpp index 4c05745c..392c62e2 100644 --- a/examples/dom/size.cpp +++ b/examples/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 #include @@ -26,3 +22,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/spinner.cpp b/examples/dom/spinner.cpp index 62ac4105..52cfe871 100644 --- a/examples/dom/spinner.cpp +++ b/examples/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 #include #include @@ -39,3 +35,7 @@ int main(int argc, const char* argv[]) { } std::cout << std::endl; } + +// Copyright 2020 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/examples/dom/style_blink.cpp b/examples/dom/style_blink.cpp index 4900256a..0445add6 100644 --- a/examples/dom/style_blink.cpp +++ b/examples/dom/style_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 #include #include @@ -21,3 +17,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_bold.cpp b/examples/dom/style_bold.cpp index 4c142ee1..89cb6410 100644 --- a/examples/dom/style_bold.cpp +++ b/examples/dom/style_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 #include #include @@ -21,3 +17,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_color.cpp b/examples/dom/style_color.cpp index 92d0d46b..5c4ec509 100644 --- a/examples/dom/style_color.cpp +++ b/examples/dom/style_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 #include #include @@ -60,3 +56,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_dim.cpp b/examples/dom/style_dim.cpp index 44cb66fb..53823a22 100644 --- a/examples/dom/style_dim.cpp +++ b/examples/dom/style_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 #include #include @@ -21,3 +17,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_gallery.cpp b/examples/dom/style_gallery.cpp index 0e59a71f..a1807895 100644 --- a/examples/dom/style_gallery.cpp +++ b/examples/dom/style_gallery.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 #include @@ -28,3 +24,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_inverted.cpp b/examples/dom/style_inverted.cpp index 0336f082..ad930ab0 100644 --- a/examples/dom/style_inverted.cpp +++ b/examples/dom/style_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 #include #include @@ -20,3 +16,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/style_underlined.cpp b/examples/dom/style_underlined.cpp index ad6eed2c..41c5fd40 100644 --- a/examples/dom/style_underlined.cpp +++ b/examples/dom/style_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 #include #include @@ -21,3 +17,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/vbox_hbox.cpp b/examples/dom/vbox_hbox.cpp index f68a992a..93bb984a 100644 --- a/examples/dom/vbox_hbox.cpp +++ b/examples/dom/vbox_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 #include @@ -36,3 +32,7 @@ int main(int argc, const char* argv[]) { return 0; } + +// Copyright 2020 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/examples/dom/window.cpp b/examples/dom/window.cpp index 6134e0d7..7999c572 100644 --- a/examples/dom/window.cpp +++ b/examples/dom/window.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 #include @@ -13,3 +9,7 @@ int main(int argc, const char* argv[]) { Render(screen, document); std::cout << screen.ToString() << std::endl; } + +// Copyright 2020 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/checkbox.hpp b/include/ftxui/component/checkbox.hpp index 711490f3..a92b8cd3 100644 --- a/include/ftxui/component/checkbox.hpp +++ b/include/ftxui/component/checkbox.hpp @@ -7,7 +7,8 @@ namespace ftxui { -/// @brief A Checkbox. It can be checked or unchecked.Display an element on a ftxui::Screen. +/// @brief A Checkbox. It can be checked or unchecked.Display an element on a +/// ftxui::Screen. /// @ingroup dom class CheckBox : public Component { public: @@ -15,19 +16,19 @@ class CheckBox : public Component { CheckBox() = default; ~CheckBox() override = default; - bool state = false; // The current state. true=checked, false:unchecked. - std::wstring label = L"label"; // The CheckBox label. + bool state = false; // The current state. true=checked, false:unchecked. + std::wstring label = L"label"; // The CheckBox label. #if defined(_WIN32) - std::wstring checked = L"[X] "; /// Prefix for a "checked" state. - std::wstring unchecked = L"[ ] "; /// Prefix for an "unchecked" state. + std::wstring checked = L"[X] "; /// Prefix for a "checked" state. + std::wstring unchecked = L"[ ] "; /// Prefix for an "unchecked" state. #else - std::wstring checked = L"▣ "; /// Prefix for a "checked" state. - std::wstring unchecked = L"☐ "; /// Prefix for a "unchecked" state. + std::wstring checked = L"▣ "; /// Prefix for a "checked" state. + std::wstring unchecked = L"☐ "; /// Prefix for a "unchecked" state. #endif - Decorator focused_style = inverted; /// Decorator used when focused. - Decorator unfocused_style = nothing; /// Decorator used when unfocused. + Decorator focused_style = inverted; /// Decorator used when focused. + Decorator unfocused_style = nothing; /// Decorator used when unfocused. /// Called when the user change the state of the CheckBox. std::function on_change = []() {}; diff --git a/include/ftxui/screen/color.hpp b/include/ftxui/screen/color.hpp index 7658ebe6..a32b1f43 100644 --- a/include/ftxui/screen/color.hpp +++ b/include/ftxui/screen/color.hpp @@ -11,9 +11,9 @@ namespace ftxui { class Color { public: enum Palette16 : uint8_t; - enum Palette256: uint8_t; + enum Palette256 : uint8_t; - Color(); // Transparent. + Color(); // Transparent. Color(Palette16 index); // Implicit conversion from index to Color. Color(Palette256 index); // Implicit conversion from index to Color. Color(uint8_t red, uint8_t green, uint8_t blue); diff --git a/include/ftxui/screen/color_info.hpp b/include/ftxui/screen/color_info.hpp index 6ac4a76a..2364122f 100644 --- a/include/ftxui/screen/color_info.hpp +++ b/include/ftxui/screen/color_info.hpp @@ -21,3 +21,7 @@ ColorInfo GetColorInfo(Color::Palette256 index); } // namespace ftxui #endif /* end of include guard: FTXUI_SCREEN_COLOR_INFO_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/button.cpp b/src/ftxui/component/button.cpp index 842c8be3..581298ec 100644 --- a/src/ftxui/component/button.cpp +++ b/src/ftxui/component/button.cpp @@ -6,7 +6,7 @@ namespace ftxui { Element Button::Render() { if (Focused()) - return text(label) | border |inverted; + return text(label) | border | inverted; else return text(label) | border; } diff --git a/src/ftxui/component/component.cpp b/src/ftxui/component/component.cpp index a40c93ff..d89de450 100644 --- a/src/ftxui/component/component.cpp +++ b/src/ftxui/component/component.cpp @@ -13,7 +13,7 @@ Component::~Component() { /// @brief Return the parent Component, or nul if any. /// @see Attach /// @see Detach -/// @see Parent +/// @see Parent /// @ingroup component Component* Component::Parent() { return parent_; @@ -100,7 +100,7 @@ void Component::TakeFocus() { /// @brief Detach this children from its parent. /// @see Attach /// @see Detach -/// @see Parent +/// @see Parent /// @ingroup component void Component::Detach() { if (!parent_) @@ -113,7 +113,7 @@ void Component::Detach() { /// @brief Attach this element to its parent. /// @see Attach /// @see Detach -/// @see Parent +/// @see Parent /// @ingroup component void Component::Attach(Component* parent) { Detach(); @@ -121,7 +121,6 @@ void Component::Attach(Component* parent) { parent_->children_.push_back(this); } - } // namespace ftxui // Copyright 2020 Arthur Sonzogni. All rights reserved. diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index 31f1f394..4b55bcd8 100644 --- a/src/ftxui/component/container.cpp +++ b/src/ftxui/component/container.cpp @@ -48,7 +48,7 @@ Component* Container::ActiveChild() { } void Container::SetActiveChild(Component* child) { - for(size_t i = 0; i < children_.size(); ++i) { + for (size_t i = 0; i < children_.size(); ++i) { if (children_[i] == child) { (selector_ ? *selector_ : selected_) = i; return; diff --git a/src/ftxui/component/container_test.cpp b/src/ftxui/component/container_test.cpp index ea5752e7..86f36aec 100644 --- a/src/ftxui/component/container_test.cpp +++ b/src/ftxui/component/container_test.cpp @@ -199,7 +199,7 @@ TEST(ContainerTest, SetActiveChild) { } TEST(ContainerTest, TakeFocus) { - auto c= Container::Horizontal(); + auto c = Container::Horizontal(); auto c1 = Container::Vertical(); auto c2 = Container::Vertical(); auto c3 = Container::Vertical(); diff --git a/src/ftxui/dom/spinner.cpp b/src/ftxui/dom/spinner.cpp index 58d8c7b9..24ea38ba 100644 --- a/src/ftxui/dom/spinner.cpp +++ b/src/ftxui/dom/spinner.cpp @@ -245,7 +245,7 @@ static const std::vector>> elements = { /// ASCII art "video". /// @param charset_index The type of "video". /// @param image_index The "frame" of the video. You need to increase this for -///every "step". +/// every "step". /// @ingroup dom Element spinner(int charset_index, size_t image_index) { if (charset_index == 0) { diff --git a/src/ftxui/dom/util.cpp b/src/ftxui/dom/util.cpp index 82b52926..bc86b1b2 100644 --- a/src/ftxui/dom/util.cpp +++ b/src/ftxui/dom/util.cpp @@ -41,7 +41,7 @@ Elements operator|(Elements elements, Decorator decorator) { /// @brief From an element, apply a decorator. /// @return the decorated element. /// @ingroup dom -/// +/// /// ### Example /// /// Both of these are equivalent: diff --git a/src/ftxui/screen/color_info.cpp b/src/ftxui/screen/color_info.cpp index 5958b5ae..184bec7e 100644 --- a/src/ftxui/screen/color_info.cpp +++ b/src/ftxui/screen/color_info.cpp @@ -268,3 +268,7 @@ ColorInfo GetColorInfo(Color::Palette256 index) { // clang-format off } + +// Copyright 2020 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/tools/format.sh b/tools/format.sh index b5febfd7..692edb05 100755 --- a/tools/format.sh +++ b/tools/format.sh @@ -8,7 +8,7 @@ for file in $files do if ! grep -q Copyright $file then - cat $file ./other/license_headers.cpp > $file.new && mv $file.new $file + cat $file ./tools/license_headers.cpp > $file.new && mv $file.new $file fi done