[cells-gtk-devel] Patch to add cairo graphics

wagwilk at telusplanet.net wagwilk at telusplanet.net
Wed May 23 01:58:38 UTC 2007


I've just finished a pretty sizable patch that re-adds the drawing-widget into
cells-gtk using Cairo for drawing.

http://www3.telus.net/public/thomasw2/dl/cells-gtk-cairo-patch.diff

The above patch should be applied to a freshly checked out CVS tree. The patch
touches files in test-gtk, cells-gtk, and gtk-ffi directories. It also adds a
few new files as well.

It comes complete with a test-gtk example page that allows the user to select a
drawing to be shown from a list of 11 examples (which have been adapted from the
first 11 cairo-snippets: http://cairographics.org/samples

It works well, but theres a few hackish things in there:

   * I couldn't figure out how to generate expose events, so what I do in the
demo is have it so when you change the drawing, the widget hides/unhides itself
-- you don't even see a flicker, and the widget gets redrawn.

   * Some of the examples don't match the screenshots shown on the cairo page --
I think this is because the API has changed slightly -- most of them work.  The
problem is that when you draw things something is creating gratuitous outlines
(see curve-rectangle). Another problem is that images seem to work correctly,
but they don't show up ("imagepattern" however works as expected). Again I think
this is because the API has changed slightly.

Overall, I'm pleased with it, and will start using it to draw pretty graphs in
my own project soon.

If anybody has trouble with the patch, or applying the patch, let me know, but I
think it should be straightforward -- unless I messed up.

Cheers,
Warren Wilkinson




More information about the cells-gtk-devel mailing list