[Cairo] another set of Python bindings

Bill Spitzak spitzak at d2.com
Fri Sep 12 11:43:03 PDT 2003

On Thursday 11 September 2003 06:26 pm, James Henstridge wrote:

> By exposing reference counting operations on cairo_t objects, this
> particular case would be easy to handle, so that neither the Python code
> or C code destroy the cairo_t object until both are finished with it.

Are we talking about cairo "state" objects? Has it been decided that 
reference-counting the states is necessary?

If not, it seems that the solution is trivial: have 2 python objects, one 
which destroys the state on destruction, and the other that doesn't. Have the 
various calls return the correct type.

If there is reference counts, my recommendation is that there be a "increment 
reference count" call and a "destroy" call. But there should not be any way 
to find out what the reference count is, or decrement it without possibly 
destroying it. This will allow the object to be stored remotely, with only an 
id number transmitted, and allow them to be shared between connections.

                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com

More information about the cairo mailing list