mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Format using iwyu.
This commit is contained in:
		| @@ -1,11 +1,12 @@ | ||||
| #include <stddef.h> | ||||
| #include <ftxui/dom/elements.hpp> | ||||
| #include <ftxui/screen/screen.hpp> | ||||
| #include <ftxui/screen/string.hpp> | ||||
| #include <string> | ||||
| #include <stddef.h>                // for size_t | ||||
| #include <ftxui/dom/elements.hpp>  // for operator|, size, Element, text, hcenter, Decorator, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN | ||||
| #include <ftxui/screen/screen.hpp>  // for Dimension, Screen | ||||
| #include <ftxui/screen/string.hpp>  // for to_wstring | ||||
| #include <memory>                   // for shared_ptr | ||||
| #include <string>  // for allocator, operator+, char_traits, wstring | ||||
|  | ||||
| #include "ftxui/dom/node.hpp" | ||||
| #include "ftxui/screen/box.hpp" | ||||
| #include "ftxui/dom/node.hpp"    // for Render | ||||
| #include "ftxui/screen/box.hpp"  // for ftxui | ||||
|  | ||||
| int main(int argc, const char* argv[]) { | ||||
|   using namespace ftxui; | ||||
|   | ||||
| @@ -1,13 +1,14 @@ | ||||
| #include <chrono> | ||||
| #include <ftxui/dom/elements.hpp> | ||||
| #include <ftxui/screen/screen.hpp> | ||||
| #include <iostream> | ||||
| #include <string> | ||||
| #include <thread> | ||||
| #include <chrono>                  // for operator""s, chrono_literals | ||||
| #include <ftxui/dom/elements.hpp>  // for paragraph, text, operator|, Element, border, color, hflow, spinner, vbox, bold, dim, underlined | ||||
| #include <ftxui/screen/screen.hpp>  // for Screen, Dimension | ||||
| #include <iostream>                 // for cout, ostream | ||||
| #include <memory>                   // for shared_ptr | ||||
| #include <string>                   // for allocator, operator<<, string | ||||
| #include <thread>                   // for sleep_for | ||||
|  | ||||
| #include "ftxui/dom/node.hpp" | ||||
| #include "ftxui/screen/box.hpp" | ||||
| #include "ftxui/screen/color.hpp" | ||||
| #include "ftxui/dom/node.hpp"      // for Render | ||||
| #include "ftxui/screen/box.hpp"    // for ftxui | ||||
| #include "ftxui/screen/color.hpp"  // for Color, Color::Red | ||||
|  | ||||
| int main(int argc, const char* argv[]) { | ||||
|   using namespace ftxui; | ||||
|   | ||||
| @@ -30,7 +30,6 @@ Component Radiobox(const std::vector<std::wstring>* entries, int* selected_); | ||||
| Component Toggle(const std::vector<std::wstring>* entries, int* selected); | ||||
| Component Renderer(Component child, std::function<Element()>); | ||||
| Component Renderer(std::function<Element()>); | ||||
|  | ||||
| template <class T>  // T = {int, float} | ||||
| Component Slider(StringRef label, T* value, T min, T max, T increment); | ||||
|  | ||||
| @@ -40,7 +39,7 @@ Component Horizontal(Components children); | ||||
| Component Tab(int* selector, Components children); | ||||
| }  // namespace Container | ||||
|  | ||||
| };  // namespace ftxui | ||||
| }  // namespace ftxui | ||||
|  | ||||
| #endif /* end of include guard: FTXUI_COMPONENT_HPP */ | ||||
|  | ||||
|   | ||||
| @@ -1,13 +1,15 @@ | ||||
| #ifndef FTXUI_COMPONENT_RECEIVER_HPP_ | ||||
| #define FTXUI_COMPONENT_RECEIVER_HPP_ | ||||
|  | ||||
| #include <atomic>              // for atomic | ||||
| #include <algorithm>           // for copy, max | ||||
| #include <atomic>              // for atomic, __atomic_base | ||||
| #include <condition_variable>  // for condition_variable | ||||
| #include <functional> | ||||
| #include <iostream> | ||||
| #include <memory>  // for unique_ptr, make_unique | ||||
| #include <mutex>   // for mutex, unique_lock | ||||
| #include <queue>   // for queue | ||||
| #include <memory>   // for unique_ptr, make_unique | ||||
| #include <mutex>    // for mutex, unique_lock | ||||
| #include <queue>    // for queue | ||||
| #include <utility>  // for move | ||||
|  | ||||
| namespace ftxui { | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| #ifndef FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP | ||||
| #define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP | ||||
|  | ||||
| #include <atomic>  // for atomic | ||||
| #include <ftxui/component/receiver.hpp> | ||||
| #include <functional>  // for function | ||||
| #include <memory>      // for unique_ptr, shared_ptr | ||||
| #include <string>      // for string | ||||
| #include <atomic>                        // for atomic | ||||
| #include <ftxui/component/receiver.hpp>  // for Receiver, Sender | ||||
| #include <functional>                    // for function | ||||
| #include <memory>                        // for shared_ptr | ||||
| #include <string>                        // for string | ||||
|  | ||||
| #include "ftxui/component/captured_mouse.hpp"  // for CapturedMouse | ||||
| #include "ftxui/component/event.hpp" | ||||
|   | ||||
							
								
								
									
										12
									
								
								iwyu.imp
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								iwyu.imp
									
									
									
									
									
								
							| @@ -1,11 +1,11 @@ | ||||
| [ | ||||
|   { symbol: [ "VMIN", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "VTIME", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "ECHO", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "ICANON", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "termios", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "TCSANOW", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "__shared_ptr_access", private, "", public ] }, | ||||
|   { symbol: [ "ftxui", private , "", public ] }, | ||||
|   { include: ["ext/alloc_traits.h", "private", "<memory>", "public"] } | ||||
|   { symbol: [ "VMIN", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "VTIME", private, "<termios.h>", public ] }, | ||||
|   { symbol: [ "__shared_ptr_access", private, "<memory>", public ] }, | ||||
|   { symbol: [ "termios", private, "<termios.h>", public ] }, | ||||
|   { symbol: ["__alloc_traits<>:value_type", private, "<vector>", public ] }, | ||||
|   { include: ["<ext/alloc_traits.h>", private, "<vector>", public] }, | ||||
| ] | ||||
|   | ||||
| @@ -35,7 +35,7 @@ Component Checkbox(ConstStringRef label, bool* checked) { | ||||
| } | ||||
|  | ||||
| // static | ||||
| CheckboxBase* From(Component component) { | ||||
| CheckboxBase* CheckboxBase::From(Component component) { | ||||
|   return static_cast<CheckboxBase*>(component.get()); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| #include <algorithm>           // for find_if | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <iterator>            // for begin, end | ||||
| #include <utility>             // for move | ||||
| #include <algorithm>  // for find_if, max | ||||
| #include <iterator>   // for begin, end | ||||
| #include <utility>    // for move | ||||
|  | ||||
| #include "ftxui/component/captured_mouse.hpp"  // for CapturedMouse, CapturedMouseInterface | ||||
| #include "ftxui/component/component.hpp" | ||||
|   | ||||
| @@ -1,9 +1,8 @@ | ||||
| #include <stddef.h>            // for size_t | ||||
| #include <algorithm>           // for max, min | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>  // for __shared_ptr_access, shared_ptr, make_shared, __shared_ptr_access<>::element_type, allocator_traits<>::value_type | ||||
| #include <stddef.h>   // for size_t | ||||
| #include <algorithm>  // for max, min | ||||
| #include <memory>  // for __shared_ptr_access, shared_ptr, make_shared, allocator, __shared_ptr_access<>::element_type, allocator_traits<>::value_type | ||||
| #include <utility>  // for move | ||||
| #include <vector>   // for vector, allocator | ||||
| #include <vector>   // for vector, __alloc_traits<>::value_type | ||||
|  | ||||
| #include "ftxui/component/container.hpp" | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,9 @@ using namespace ftxui; | ||||
|  | ||||
| TEST(ContainerTest, HorizontalEvent) { | ||||
|   auto container = ContainerBase::Horizontal(); | ||||
|   Component c0, c1, c2; | ||||
|   auto c0 = Container::Horizontal({}); | ||||
|   auto c1 = Container::Horizontal({}); | ||||
|   auto c2 = Container::Horizontal({}); | ||||
|   container->Add(c0); | ||||
|   container->Add(c1); | ||||
|   container->Add(c2); | ||||
| @@ -81,7 +83,9 @@ TEST(ContainerTest, HorizontalEvent) { | ||||
|  | ||||
| TEST(ContainerTest, VerticalEvent) { | ||||
|   auto container = ContainerBase::Vertical(); | ||||
|   Component c0, c1, c2; | ||||
|   auto c0 = Container::Horizontal({}); | ||||
|   auto c1 = Container::Horizontal({}); | ||||
|   auto c2 = Container::Horizontal({}); | ||||
|   container->Add(c0); | ||||
|   container->Add(c1); | ||||
|   container->Add(c2); | ||||
| @@ -152,7 +156,9 @@ TEST(ContainerTest, VerticalEvent) { | ||||
|  | ||||
| TEST(ContainerTest, SetActiveChild) { | ||||
|   auto container = ContainerBase::Horizontal(); | ||||
|   Component c0, c1, c2; | ||||
|   auto c0 = Container::Horizontal({}); | ||||
|   auto c1 = Container::Horizontal({}); | ||||
|   auto c2 = Container::Horizontal({}); | ||||
|   container->Add(c0); | ||||
|   container->Add(c1); | ||||
|   container->Add(c2); | ||||
|   | ||||
| @@ -1,8 +1,7 @@ | ||||
| #include <stddef.h>            // for size_t | ||||
| #include <algorithm>           // for max, min | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for shared_ptr, allocator_traits<>::value_type | ||||
| #include <utility>             // for move | ||||
| #include <stddef.h>   // for size_t | ||||
| #include <algorithm>  // for max, min | ||||
| #include <memory>     // for shared_ptr, allocator_traits<>::value_type | ||||
| #include <utility>    // for move | ||||
|  | ||||
| #include "ftxui/component/captured_mouse.hpp"  // for CapturedMouse | ||||
| #include "ftxui/component/event.hpp"  // for Event, Event::ArrowDown, Event::ArrowUp, Event::Return, Event::Tab, Event::TabReverse | ||||
|   | ||||
| @@ -31,8 +31,8 @@ | ||||
| #endif | ||||
| #else | ||||
| #include <sys/select.h>  // for select, FD_ISSET, FD_SET, FD_ZERO, fd_set | ||||
| #include <termios.h>  // for tcsetattr, termios, tcgetattr, TCSANOW, cc_t, ECHO, ICANON, VMIN, VTIME | ||||
| #include <unistd.h>  // for STDIN_FILENO, read | ||||
| #include <termios.h>     // for tcsetattr, tcgetattr, cc_t | ||||
| #include <unistd.h>      // for STDIN_FILENO, read | ||||
| #endif | ||||
|  | ||||
| // Quick exit is missing in standard CLang headers | ||||
|   | ||||
| @@ -1,7 +1,10 @@ | ||||
| #include "ftxui/component/terminal_input_parser.hpp" | ||||
|  | ||||
| #include <utility> | ||||
| #include "ftxui/component/event.hpp" | ||||
| #include <algorithm>  // for max | ||||
| #include <memory>     // for unique_ptr | ||||
| #include <utility>    // for move | ||||
|  | ||||
| #include "ftxui/component/event.hpp"  // for Event | ||||
|  | ||||
| namespace ftxui { | ||||
|  | ||||
|   | ||||
| @@ -5,11 +5,12 @@ | ||||
| #include <string>  // for string | ||||
| #include <vector>  // for vector | ||||
|  | ||||
| #include "ftxui/component/event.hpp"     // IWYU pragma: keep | ||||
| #include "ftxui/component/event.hpp"     // for Event (ptr only) | ||||
| #include "ftxui/component/mouse.hpp"     // for Mouse | ||||
| #include "ftxui/component/receiver.hpp"  // for SenderImpl | ||||
| #include "ftxui/component/receiver.hpp"  // for Sender | ||||
|  | ||||
| namespace ftxui { | ||||
| struct Event; | ||||
|  | ||||
| // Parse a sequence of |char| accross |time|. Produces |Event|. | ||||
| class TerminalInputParser { | ||||
|   | ||||
| @@ -1,9 +1,12 @@ | ||||
| #include <gtest/gtest-message.h>    // for Message | ||||
| #include <gtest/gtest-test-part.h>  // for TestPartResult | ||||
| #include <gtest/gtest-message.h>  // for Message | ||||
| #include <gtest/gtest-test-part.h>  // for TestPartResult, SuiteApiResolver, TestFactoryImpl | ||||
| #include <algorithm>                // for max | ||||
| #include <memory>                   // for unique_ptr, allocator | ||||
|  | ||||
| #include "ftxui/component/event.hpp"     // for Event, Event::Escape | ||||
| #include "ftxui/component/receiver.hpp"  // for MakeReceiver, ReceiverImpl | ||||
| #include "ftxui/component/terminal_input_parser.hpp" | ||||
| #include "gtest/gtest_pred_impl.h"  // for AssertionResult, Test, Suite... | ||||
| #include "gtest/gtest_pred_impl.h"  // for AssertionResult, Test, EXPECT_EQ, EXPECT_TRUE, EXPECT_FALSE, TEST | ||||
|  | ||||
| using namespace ftxui; | ||||
|  | ||||
|   | ||||
| @@ -1,9 +1,8 @@ | ||||
| #include <algorithm>           // for max | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <iterator>            // for begin, end | ||||
| #include <memory>              // for make_shared, __shared_ptr_access | ||||
| #include <utility>             // for move | ||||
| #include <vector>              // for vector | ||||
| #include <algorithm>  // for max | ||||
| #include <iterator>   // for begin, end | ||||
| #include <memory>     // for make_shared, __shared_ptr_access | ||||
| #include <utility>    // for move | ||||
| #include <vector>     // for vector, __alloc_traits<>::value_type | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for unpack, Element, Decorator, Elements, border, borderWith, window | ||||
| #include "ftxui/dom/node.hpp"         // for Node | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for make_shared, __shared_ptr_access | ||||
| #include <utility>             // for move | ||||
| #include <vector>              // for vector | ||||
| #include <memory>   // for make_shared, __shared_ptr_access | ||||
| #include <utility>  // for move | ||||
| #include <vector>   // for vector, __alloc_traits<>::value_type | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for Element, unpack, filler, flex, flex_grow, flex_shrink, notflex, xflex, xflex_grow, xflex_shrink, yflex, yflex_grow, yflex_shrink | ||||
| #include "ftxui/dom/node.hpp"      // for Node | ||||
|   | ||||
| @@ -1,8 +1,7 @@ | ||||
| #include <algorithm>           // for max, min | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>   // for make_shared, shared_ptr, __shared_ptr_access | ||||
| #include <utility>  // for move | ||||
| #include <vector>   // for vector | ||||
| #include <algorithm>  // for max, min | ||||
| #include <memory>     // for make_shared, shared_ptr, __shared_ptr_access | ||||
| #include <utility>    // for move | ||||
| #include <vector>     // for vector, __alloc_traits<>::value_type | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for Element, unpack, focus, frame, select, xframe, yframe | ||||
| #include "ftxui/dom/node.hpp"  // for Node | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for __shared_ptr_access | ||||
| #include <vector>              // for vector | ||||
| #include <memory>  // for __shared_ptr_access | ||||
| #include <vector>  // for __alloc_traits<>::value_type, vector | ||||
|  | ||||
| #include "ftxui/dom/node_decorator.hpp" | ||||
| #include "ftxui/dom/requirement.hpp"  // for Requirement | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for make_shared, __shared_ptr_access | ||||
| #include <utility>             // for move | ||||
| #include <vector>              // for vector | ||||
| #include <memory>   // for make_shared, __shared_ptr_access | ||||
| #include <utility>  // for move | ||||
| #include <vector>   // for __alloc_traits<>::value_type, vector | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"     // for Element, unpack, Decorator, reflect | ||||
| #include "ftxui/dom/node.hpp"         // for Node | ||||
|   | ||||
| @@ -1,9 +1,8 @@ | ||||
| #include <stddef.h>            // for size_t | ||||
| #include <algorithm>           // for min, max | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for make_shared, __shared_ptr_access | ||||
| #include <utility>             // for move | ||||
| #include <vector>              // for vector | ||||
| #include <stddef.h>   // for size_t | ||||
| #include <algorithm>  // for min, max | ||||
| #include <memory>     // for make_shared, __shared_ptr_access | ||||
| #include <utility>    // for move | ||||
| #include <vector>     // for __alloc_traits<>::value_type, vector | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for Constraint, Direction, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size | ||||
| #include "ftxui/dom/node.hpp"      // for Node | ||||
|   | ||||
| @@ -1,9 +1,8 @@ | ||||
| #include <stddef.h>            // for size_t | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <memory>              // for allocator, allocator_traits<>::value_type | ||||
| #include <string>              // for basic_string, wstring | ||||
| #include <utility>             // for move | ||||
| #include <vector>              // for vector | ||||
| #include <stddef.h>  // for size_t | ||||
| #include <memory>    // for allocator, allocator_traits<>::value_type | ||||
| #include <string>    // for basic_string, wstring | ||||
| #include <utility>   // for move | ||||
| #include <vector>    // for vector, __alloc_traits<>::value_type | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for Element, gauge, text, vbox, spinner | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| #include <functional>  // for function | ||||
| #include <utility>     // for move | ||||
| #include <vector>      // for vector | ||||
|  | ||||
| #include "ftxui/dom/elements.hpp"  // for Decorator, Element, Elements, operator|, nothing | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,4 @@ | ||||
| #include <algorithm>           // for min | ||||
| #include <ext/alloc_traits.h>  // for __alloc_traits<>::value_type | ||||
| #include <algorithm>  // for min | ||||
| #include <iostream>  // for operator<<, basic_ostream, wstringstream, stringstream, flush, cout, ostream | ||||
| #include <sstream>   // IWYU pragma: keep | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,8 @@ mkdir -p iwyu | ||||
| cd iwyu | ||||
| rm * -rf | ||||
| echo $CMAKE_CXX_INCLUDE_WHAT_YOU_USE | ||||
| cmake .. -DFTXUI_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="iwyu;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${mapping_dir}/iwyu.imp;-Xiwyu;--verbose=3" | ||||
| cmake .. -DFTXUI_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${mapping_dir}/iwyu.imp;-Xiwyu;--verbose=3" | ||||
| make -j 2>out | ||||
| fix_include --comments < out | ||||
| fix_includes.py --comments < out | ||||
|  | ||||
| ../tools/format.sh | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ArthurSonzogni
					ArthurSonzogni