29void rounded_rectangle(
const Cairo::RefPtr<Cairo::Context>& cr,
double x,
double y,
double w,
double h,
double r) {
30 cr->begin_new_sub_path();
31 cr->arc(x + r, y + r, r, M_PI, 3 * M_PI / 2);
32 cr->arc(x +
w - r, y + r, r, 3 * M_PI / 2, 2 * M_PI);
33 cr->arc(x +
w - r, y + h - r, r, 0, M_PI / 2);
34 cr->arc(x + r, y + h - r, r, M_PI / 2, M_PI);
38void set_source_rgba(
const Cairo::RefPtr<Cairo::Context>& ctx,
unsigned int rgba) {
53 ctx->set_operator(Cairo::Context::Operator::SOURCE);
54 ctx->set_source(pattern);
81 double ox = std::round(x + (
width -
w) / 2);
82 double oy = std::round(y + (
height - h) / 2);
90 ctx->set_operator(Cairo::Context::Operator::SOURCE);
91 ctx->set_source(pattern);
138 ctx->set_line_width(1);
void ink_cairo_draw_drop_shadow(const Cairo::RefPtr< Cairo::Context > &ctx, const Geom::Rect &rect, double size, guint32 color, double color_alpha)
Draw drop shadow around the 'rect' with given 'size' and 'color'; shadow extends to the right and bot...
cairo_pattern_t * ink_cairo_pattern_create_checkerboard(guint32 rgba, bool use_alpha)
Cairo integration helpers.
C top() const
Return top coordinate of the rectangle (+Y is downwards).
C left() const
Return leftmost coordinate of the rectangle (+X is to the right).
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
Axis aligned, non-empty rectangle.
void draw_func(Cairo::RefPtr< Cairo::Context > const &cr, int width, int height)
void enable_drop_shadow(bool shadow)
void enable_checkerboard(bool checkerboard)
void set_border_color(unsigned int rgba)
void set_desk_color(unsigned int rgba)
void draw_border(bool border)
void set_page_color(unsigned int rgba)
unsigned int _border_color
void set_page_size(double width, double height)
constexpr double SP_RGBA32_G_F(uint32_t v)
constexpr double SP_RGBA32_R_F(uint32_t v)
constexpr double SP_RGBA32_A_F(uint32_t v)
constexpr double SP_RGBA32_B_F(uint32_t v)
Helper class to stream background task notifications as a series of messages.