diff --git a/examples/example_widget.hpp b/examples/example_widget.hpp index cb7af49..5503e89 100644 --- a/examples/example_widget.hpp +++ b/examples/example_widget.hpp @@ -22,10 +22,12 @@ private: void _handle_rendering() override { - const auto now = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); - const uint8_t r = 255 * (now % cycle_r / (float)cycle_r); // NOLINT - const uint8_t g = 255 * (now % cycle_g / (float)cycle_g); // NOLINT - const uint8_t b = 255 * (now % cycle_b / (float)cycle_b); // NOLINT + const auto now = std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch()) + .count(); + const uint8_t r = 255 * (now % cycle_r / (float)cycle_r); // NOLINT + const uint8_t g = 255 * (now % cycle_g / (float)cycle_g); // NOLINT + const uint8_t b = 255 * (now % cycle_b / (float)cycle_b); // NOLINT // NOLINTNEXTLINE(readability-magic-numbers) const Color base_color {r, g, b, 255}; @@ -54,7 +56,7 @@ public: Example(const Example&) = delete; auto operator=(Example&&) = delete; auto operator=(const Example&) = delete; - ~Example() noexcept override = default; + ~Example() noexcept override = default; [[nodiscard]] auto size() const noexcept -> Size override { diff --git a/examples/run.hpp b/examples/run.hpp index 1296bed..86f4dfc 100644 --- a/examples/run.hpp +++ b/examples/run.hpp @@ -26,8 +26,7 @@ concept WidgetType = std::derived_from; template void run_example( - const std::function, - int, int)>& setup, + const std::function, int, int)>& setup, int w = 3, int h = 3) { std::atexit(lib_exit); diff --git a/inc/basic_widgets/core/draw.hpp b/inc/basic_widgets/core/draw.hpp index 6a3aaa9..13f966a 100644 --- a/inc/basic_widgets/core/draw.hpp +++ b/inc/basic_widgets/core/draw.hpp @@ -15,12 +15,11 @@ namespace bwidgets class Texture; [[nodiscard]] auto aa(const Color&, int, float) noexcept -> Color; - [[nodiscard]] auto filled_circle(const Color&, int resolution, - Renderer*, int aa_pixels = 3) - -> std::shared_ptr; - void set_pixels_color( - Texture*, - const std::function&); + [[nodiscard]] auto filled_circle(const Color&, int resolution, Renderer*, + int aa_pixels = 3) -> std::shared_ptr; + void set_pixels_color( + Texture*, + const std::function&); } #endif diff --git a/inc/basic_widgets/core/type/color.hpp b/inc/basic_widgets/core/type/color.hpp index 8c41430..adc450b 100644 --- a/inc/basic_widgets/core/type/color.hpp +++ b/inc/basic_widgets/core/type/color.hpp @@ -30,8 +30,7 @@ namespace bwidgets bool _operate_on_colors; template - auto _operate(N operand, - const std::function& operator_) const noexcept + auto _operate(N operand, const std::function& operator_) const noexcept { Color c(sdl_type, _operate_on_alpha, _operate_on_colors); if (_operate_on_alpha) { @@ -56,8 +55,8 @@ namespace bwidgets public: SDL_Color sdl_type; - Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a, - bool op_on_alpha = false, bool op_on_colors = true) noexcept + Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool op_on_alpha = false, + bool op_on_colors = true) noexcept : _operate_on_alpha(op_on_alpha), _operate_on_colors(op_on_colors), sdl_type({r, g, b, a}) @@ -68,7 +67,7 @@ namespace bwidgets {} Color(const Color&) noexcept = default; Color(Color&&) noexcept = default; - ~Color() = default; + ~Color() = default; [[nodiscard]] auto alpha() const noexcept -> Color { diff --git a/inc/basic_widgets/w/aligned_layout.hpp b/inc/basic_widgets/w/aligned_layout.hpp index 10ec7b5..96f102d 100644 --- a/inc/basic_widgets/w/aligned_layout.hpp +++ b/inc/basic_widgets/w/aligned_layout.hpp @@ -22,8 +22,8 @@ namespace bwidgets {} AlignedLayout(const AlignedLayout&) = delete; - AlignedLayout(AlignedLayout&&) = delete; - ~AlignedLayout() override = default; + AlignedLayout(AlignedLayout&&) = delete; + ~AlignedLayout() override = default; auto operator=(const AlignedLayout&) = delete; auto operator=(AlignedLayout&&) = delete; diff --git a/inc/basic_widgets/w/base/input.hpp b/inc/basic_widgets/w/base/input.hpp index 43c5030..a80b141 100644 --- a/inc/basic_widgets/w/base/input.hpp +++ b/inc/basic_widgets/w/base/input.hpp @@ -135,8 +135,8 @@ namespace bwidgets T value {}; Input(const Input&) = delete; - Input(Input&&) = delete; - ~Input() override = default; + Input(Input&&) = delete; + ~Input() override = default; auto operator=(const Input&) = delete; auto operator=(Input&&) = delete; diff --git a/inc/basic_widgets/w/base/layout.hpp b/inc/basic_widgets/w/base/layout.hpp index 419ad05..9a4b6b4 100644 --- a/inc/basic_widgets/w/base/layout.hpp +++ b/inc/basic_widgets/w/base/layout.hpp @@ -33,8 +33,8 @@ namespace bwidgets Layout(Widget* p = nullptr) : Widget(p) {} Layout(const Layout&) = delete; - Layout(Layout&&) = delete; - ~Layout() override = default; + Layout(Layout&&) = delete; + ~Layout() override = default; auto operator=(const Layout&) = delete; auto operator=(Layout&&) = delete; diff --git a/inc/basic_widgets/w/base/widget.hpp b/inc/basic_widgets/w/base/widget.hpp index 33b56cb..f7aa335 100644 --- a/inc/basic_widgets/w/base/widget.hpp +++ b/inc/basic_widgets/w/base/widget.hpp @@ -29,8 +29,8 @@ namespace bwidgets Widget(Widget* p = nullptr) noexcept : parent(p) {} Widget(const Widget&) noexcept = default; - Widget(Widget&&) noexcept = default; - virtual ~Widget() noexcept = default; + Widget(Widget&&) noexcept = default; + virtual ~Widget() noexcept = default; auto operator=(const Widget&) = delete; auto operator=(Widget&&) = delete; @@ -38,9 +38,9 @@ namespace bwidgets virtual auto handle_event(const SDL_Event&) -> Widget*; [[nodiscard]] virtual auto size() const noexcept -> Size = 0; - virtual auto render() -> Widget* final; - virtual auto renderer(std::shared_ptr) -> Widget* final; - virtual auto viewport(const SDL_Rect&) -> Widget* final; + virtual auto render() -> Widget* final; + virtual auto renderer(std::shared_ptr) -> Widget* final; + virtual auto viewport(const SDL_Rect&) -> Widget* final; [[nodiscard]] virtual auto viewport() const -> const SDL_Rect& final; }; } diff --git a/inc/basic_widgets/w/button.hpp b/inc/basic_widgets/w/button.hpp index fbed63b..9a460b2 100644 --- a/inc/basic_widgets/w/button.hpp +++ b/inc/basic_widgets/w/button.hpp @@ -40,8 +40,8 @@ namespace bwidgets Button(Widget* parent = nullptr) noexcept; Button(const Button&) = delete; - Button(Button&&) = delete; - ~Button() override = default; + Button(Button&&) = delete; + ~Button() override = default; auto operator=(const Button&) = delete; auto operator=(Button&&) = delete; diff --git a/inc/basic_widgets/w/caption.hpp b/inc/basic_widgets/w/caption.hpp index 1aebcfe..0ce59e6 100644 --- a/inc/basic_widgets/w/caption.hpp +++ b/inc/basic_widgets/w/caption.hpp @@ -44,8 +44,8 @@ namespace bwidgets Caption(Widget* parent = nullptr) noexcept; Caption(const Caption&) = delete; - Caption(Caption&&) = delete; - ~Caption() override = default; + Caption(Caption&&) = delete; + ~Caption() override = default; auto operator=(const Caption&) = delete; auto operator=(Caption&&) = delete; diff --git a/inc/basic_widgets/w/feat/font_handler.hpp b/inc/basic_widgets/w/feat/font_handler.hpp index 45fd0e1..6ab1a2a 100644 --- a/inc/basic_widgets/w/feat/font_handler.hpp +++ b/inc/basic_widgets/w/feat/font_handler.hpp @@ -23,11 +23,11 @@ namespace bwidgets SDL_ALPHA_OPAQUE}; inline static const Color default_font_color_fg {0, 0, 0, SDL_ALPHA_OPAQUE}; - FontHandler() noexcept = default; + FontHandler() noexcept = default; FontHandler(const FontHandler&) = delete; - FontHandler(FontHandler&&) = delete; + FontHandler(FontHandler&&) = delete; auto operator=(const FontHandler&) = delete; - auto operator=(FontHandler&&) = delete; + auto operator=(FontHandler&&) = delete; virtual ~FontHandler() noexcept = default; virtual auto font(std::shared_ptr f) -> FontHandler* final diff --git a/inc/basic_widgets/w/feat/keyboard_handler.hpp b/inc/basic_widgets/w/feat/keyboard_handler.hpp index a500ee1..d56b0a4 100644 --- a/inc/basic_widgets/w/feat/keyboard_handler.hpp +++ b/inc/basic_widgets/w/feat/keyboard_handler.hpp @@ -18,8 +18,8 @@ namespace bwidgets using FocusHandler::FocusHandler; KeyboardHandler(const KeyboardHandler&) = delete; - KeyboardHandler(KeyboardHandler&&) = delete; - ~KeyboardHandler() override = default; + KeyboardHandler(KeyboardHandler&&) = delete; + ~KeyboardHandler() override = default; auto operator=(const KeyboardHandler&) = delete; auto operator=(KeyboardHandler&&) = delete; diff --git a/inc/basic_widgets/w/feat/mouse_handler.hpp b/inc/basic_widgets/w/feat/mouse_handler.hpp index dfa80cd..90b0c74 100644 --- a/inc/basic_widgets/w/feat/mouse_handler.hpp +++ b/inc/basic_widgets/w/feat/mouse_handler.hpp @@ -29,8 +29,8 @@ namespace bwidgets using FocusHandler::FocusHandler; MouseHandler(const MouseHandler&) = delete; - MouseHandler(MouseHandler&&) = delete; - ~MouseHandler() override = default; + MouseHandler(MouseHandler&&) = delete; + ~MouseHandler() override = default; auto operator=(const MouseHandler&) = delete; auto operator=(MouseHandler&&) = delete; diff --git a/inc/basic_widgets/w/feat/texture_handler.hpp b/inc/basic_widgets/w/feat/texture_handler.hpp index ea38b08..e41a780 100644 --- a/inc/basic_widgets/w/feat/texture_handler.hpp +++ b/inc/basic_widgets/w/feat/texture_handler.hpp @@ -14,10 +14,10 @@ namespace bwidgets virtual void _handle_texture_update() = 0; public: - TextureHandler() noexcept = default; + TextureHandler() noexcept = default; TextureHandler(const TextureHandler&) = delete; - TextureHandler(TextureHandler&&) = delete; - virtual ~TextureHandler() noexcept = default; + TextureHandler(TextureHandler&&) = delete; + virtual ~TextureHandler() noexcept = default; auto operator=(const TextureHandler&) = delete; auto operator=(TextureHandler&&) = delete; diff --git a/inc/basic_widgets/w/numeric_input.hpp b/inc/basic_widgets/w/numeric_input.hpp index 65592d9..0e6cd50 100644 --- a/inc/basic_widgets/w/numeric_input.hpp +++ b/inc/basic_widgets/w/numeric_input.hpp @@ -116,8 +116,8 @@ namespace bwidgets } NumericInput(const NumericInput&) = delete; - NumericInput(NumericInput&&) = delete; - ~NumericInput() override = default; + NumericInput(NumericInput&&) = delete; + ~NumericInput() override = default; auto operator=(const NumericInput&) = delete; auto operator=(NumericInput&&) = delete;