Could you tell us a little bit more about CairoShape? What is it conceived for? What are the differences between it and sf::Shape? Which features does it provide?
It would be nice to learn more about your project, at the moment I have no idea. And a description in words is much better than one in code...
It works similar to a sprite but instead of supplying it with an image you give it a function like this one:
void CairoShape::DefaultDrawFunc(cairo_t *cr, float Width, float Height)
{
cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 1.0);
cairo_rectangle(cr, 0, 0, 1.0, 0.33);
cairo_fill(cr);
cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0);
cairo_rectangle(cr, 0, 0.33, 1.0, 0.66);
cairo_fill(cr);
cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, 1.0);
cairo_rectangle(cr, 0, 0.66, 1.0, 1.0);
cairo_fill(cr);
// This cairo_set_source_rgba call is just to have a different color on each redraw of the image.
cairo_set_source_rgba(cr, (rand()%255)/255.0,(rand()%255)/255.0,(rand()%255)/255.0,0.75);
cairo_rectangle(cr, 0.1, 0.1, 0.8, 0.8);
cairo_set_line_width(cr, 0.05);
cairo_stroke(cr);
}
Then the CairoShape class will handle redrawing on resize mainly. It would probably be most convinient when you wish to draw gradients, lots of alpha or svg. As far as features go it doesn't have much, all my work so far has gone into handeling resizing properly, but I plan on making a sf::Shape-like interface and most likely a svg-loader of some sort, but that is just sub-classing.
The reason I've made this class at all is because I felt I needed it when I started working on a physics-simulator project and I knew that I wouldn't want to create alot of resources in GIMP or similar.
So far it has got some bugs, mainly dealing with scale when doing things that aren't square.