Re: .defs Issues From Java-Gnome



On Wednesday, December 13, 2000 at 15:44, Ariel Rios wrote:
> 
> > boxed was introduced to let language bindings deal with plain C structures,
> > such as
> > struct _GtkRequisition
> > {
> >   gint width;
> >   gint height;
> > };
> > 
> This is not completely true. Boxed means a pointer to some structure.  You
> have to explicitely manage the  lifetime of those structures by invoking
> some functions at the
> right times.

It seems to me that there's much confusion around the "boxed" concept.
Someone said boxed was a structure with "copy" and "free" methods.
Looking at the gtk sources there's _ref and _unref for many boxed types.
(To me, copy is more like "deep clone" rather than ref, and free
more like "delete" than unref. But maybe they are the same thing?)

But a boxed is also a named structure, with a unique GType value.
This attributes is important to language bindings because it
allows signal/function arguments to be specified in more detail.
(I.e. GTK_TYPE_REQUISITION instead of G_TYPE_POINER/G_TYPE_BOXED.)

Anyway, about "copy" and "free" for a boxed type. What point is
there in providing them? Most language bindings cannot make use
of them. I think this is true for garbage collecting/reference
counting languages, including perl and java (and python?).
Why? Because the language need to be informed by gtk when the boxed
obj is deleted. A delete_notify, in other words. It is either
this or a pointer slot for a foreign reference.

Oskar Liljeblad (osk hem passagen se)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]