#pragma once #include "Box.hpp" #include "Point.hpp" #include "RGB.hpp" #include "cairomm/xlib_surface.h" #include #include namespace Raven { enum class PaintTextAlign { Center = 0, Left }; class Painter { private: Cairo::RefPtr m_cairo { nullptr }; PangoFontDescription *m_pango_font_description { nullptr }; public: Painter() {} Cairo::RefPtr get_cairo() { return m_cairo; } void set_cairo(Cairo::RefPtr cairo) { m_cairo = cairo; } void set_pango_font_description(PangoFontDescription *pango_font_description) { m_pango_font_description = pango_font_description; } PangoFontDescription *get_pango_font_description() { return m_pango_font_description; } void rounded_rectangle(Box &geometry, double border_radius); bool text(Point &where, std::string &text); bool text(Box &geometry, std::string &text, PaintTextAlign align, PangoEllipsizeMode ellipsize); bool can_paint() { if (m_cairo) return true; else return false; } void source_rgb(RGB &source_rgb); void fill(); void begin_paint_group(); void end_paint_group(); }; }