37 lines
1.4 KiB
C++
37 lines
1.4 KiB
C++
#ifndef BWIDGETS_FONT_HANDLER_HPP
|
|
#define BWIDGETS_FONT_HANDLER_HPP
|
|
|
|
#include <basic_widgets/core/font.hpp>
|
|
|
|
namespace bwidgets
|
|
{
|
|
class FontHandler
|
|
{
|
|
public:
|
|
inline static const Color default_font_color_bg {255, 255, 255,
|
|
SDL_ALPHA_OPAQUE};
|
|
inline static const Color default_font_color_fg {0, 0, 0, SDL_ALPHA_OPAQUE};
|
|
|
|
FontHandler(const FontHandler&) = delete;
|
|
FontHandler(FontHandler&&) = delete;
|
|
auto operator=(const FontHandler&) = delete;
|
|
auto operator=(FontHandler&&) = delete;
|
|
virtual ~FontHandler() noexcept = default;
|
|
|
|
[[nodiscard]] virtual auto font() const -> const std::shared_ptr<Font>& = 0;
|
|
// Set the used font.
|
|
virtual void font(std::shared_ptr<Font>) = 0;
|
|
[[nodiscard]] virtual auto font_color_bg() const -> const Color& = 0;
|
|
// Set background color used for shaded text rendering
|
|
// mode.
|
|
virtual void font_color_bg(const Color&) = 0;
|
|
[[nodiscard]] virtual auto font_color_fg() const -> const Color& = 0;
|
|
// Set foreground (glyphs) color.
|
|
virtual void font_color_fg(const Color&) = 0;
|
|
|
|
protected:
|
|
FontHandler() noexcept = default;
|
|
};
|
|
}
|
|
|
|
#endif
|