15#include <cairomm/context.h>
16#include <sigc++/functors/mem_fun.h>
17#include <gtkmm/drawingarea.h>
26 set_name(
"ColorPreview");
33 if (
_rgba == rgba)
return;
40 int const widget_width,
int const widget_height)
42 auto const width = widget_width / 2.0,
height = widget_height - 1.0;
45 double radius =
height / 7.5;
46 double degrees = M_PI / 180.0;
48 cairo_new_sub_path (cr->cobj());
51 cairo_arc (cr->cobj(), x + radius, y +
height - radius, radius, 90 * degrees, 180 * degrees);
52 cairo_arc (cr->cobj(), x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
53 cairo_close_path (cr->cobj());
57 cairo_set_source(cr->cobj(), checkers);
61 cairo_pattern_destroy(checkers);
65 cairo_new_sub_path (cr->cobj());
66 cairo_arc (cr->cobj(), x +
width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
67 cairo_arc (cr->cobj(), x +
width - radius, y +
height - radius, radius, 0 * degrees, 90 * degrees);
70 cairo_close_path (cr->cobj());
cairo_pattern_t * ink_cairo_pattern_create_checkerboard(guint32 rgba, bool use_alpha)
void ink_cairo_set_source_rgba32(cairo_t *ct, guint32 rgba)
Cairo integration helpers.
_cairo_pattern cairo_pattern_t
void cairo_line_to(cairo_t *cr, Geom::Point p1)