diff --git a/examples/component/button.cpp b/examples/component/button.cpp index 00314a9..d38f4c1 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 c63de28..a0cb0b8 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 aa66be7..608f2d2 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 a7d0264..54f4d6c 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 33c129c..ac8fc83 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 a28afd7..2f2eb51 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 db8b96f..1fd33e3 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 82f4a68..dd422f6 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 ba72bf2..839d263 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 abdfff2..520fd78 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 46e106d..62d0f1e 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 ae40ac3..0137425 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 77e689f..a475e4b 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 c8ad689..b32a8d9 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 38fe434..ef2cd3a 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 0cceddb..7a49f3e 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 a5e745c..a9c33b3 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 74ed58b..1352877 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 5de665e..ba6ae7a 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 2bd87d9..ed1495b 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 7c59328..67561ef 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 54068e3..2d7ecd3 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 aa6b049..dbf7f1e 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 0f796a0..ef6beb2 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 b00fcad..6485cf1 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 99c129f..3875945 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 fab3826..7ed3d14 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 0833761..e575868 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 4c05745..392c62e 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 62ac410..52cfe87 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 4900256..0445add 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 4c142ee..89cb641 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 92d0d46..5c4ec50 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 44cb66f..53823a2 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 0e59a71..a180789 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 0336f08..ad930ab 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 ad6eed2..41c5fd4 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 f68a992..93bb984 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 6134e0d..7999c57 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 711490f..a92b8cd 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 7658ebe..a32b1f4 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 6ac4a76..2364122 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 842c8be..581298e 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 a40c93f..d89de45 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 31f1f39..4b55bcd 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 ea5752e..86f36ae 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 58d8c7b..24ea38b 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 82b5292..bc86b1b 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 5958b5a..184bec7 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 b5febfd..692edb0 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