[cairo] GObject

Axel Simon A.Simon at kent.ac.uk
Wed Jan 11 08:58:06 PST 2006


On Wed, 2006-01-11 at 08:41 -0800, Bill Spitzak wrote:
> It seems that Cairo itself has successfully implemented a large thing 
> (the cairo_t) without using GObject or any "base" library. I see no 
> reason that the text layout cannot do the same thing.
> 
> What exactly does GObject provide and why is it so hard to remove from 
> Pango?

What it provides is an easy way to interface to garbage-collected
languages. Every structure in Pango and (all of) Cairo that is not based
on GObject has to be copied when it is passed to such a language, to
avoid confusion as to who frees the object. The reference count in a
GObject allows an object to be accessed from C land and from the GC'd
language.

Removing GObject from Pango structures means it's unusable in language
bindings since many structures are huge (PangoLayout,
PangoFontDescription) and sometimes pointer equivalence is necessary
which forbids copying altogether.

Axel.




More information about the cairo mailing list