diff --git a/inc/basic_widgets/w/caption_impl.hpp b/inc/basic_widgets/w/caption_impl.hpp new file mode 100644 index 0000000..45abd9f --- /dev/null +++ b/inc/basic_widgets/w/caption_impl.hpp @@ -0,0 +1,35 @@ +#ifndef BWIDGETS_CAPTION_IMPL_HPP +#define BWIDGETS_CAPTION_IMPL_HPP + +#include +#include + +namespace bwidgets +{ + class CaptionImpl : public virtual Caption, + public virtual WidgetImpl + { + public: + CaptionImpl(Widget* p = nullptr) noexcept; + + void render_mode(Font::RenderMode) override; + [[nodiscard]] auto size() const noexcept -> Size override; + [[nodiscard]] auto text() const noexcept -> const std::string& override; + void text(const std::string&) override; + + protected: + Font::RenderMode _render_mode {Font::RenderMode::SHADED}; + std::string _text; + std::shared_ptr _text_texture {nullptr}; + + void _handle_font_change(const std::shared_ptr&) override; + void _handle_font_color_change(Color, Color) + override; + void _handle_geometry_change(const SDL_Rect&) override; + void _handle_renderer_change(const std::shared_ptr&) override; + void _handle_rendering() override; + void _handle_texture_update() override; + }; +} + +#endif