[Cairo] cairo API suggestion

James Henstridge james at daa.com.au
Fri Sep 12 09:11:50 PDT 2003


While going over the Cairo API, I found another area that would be good 
to change in order to make it more friendly for language bindings: it 
would be nice if the cairo_surface_create_for_image() took user data and 
destroy notify arguments (similar to APIs in GTK).

This would allow me to make the cairo_surface_t own a reference to a 
Python object.  This way, the Python binding would be able to make sure 
the Python object owning the buffer won't get destroyed before Cairo is 
finished with the surface.

I suppose this could also be useful inside Cairo to construct a surface 
that represented a smaller portion of some other image surface.  The 
smaller surface could hold a reference to the parent surface, in order 
to make sure the buffer remains alive.

James.

-- 
Email: james at daa.com.au
WWW:   http://www.daa.com.au/~james/







More information about the cairo mailing list