Re: [Goocanvas-devel] goo_canvas_*_new() and Reference Counting
Status: Beta
Brought to you by:
dachaplin
From: Murray C. <mu...@mu...> - 2008-04-18 17:54:08
|
On Fri, 2008-04-18 at 14:48 +0100, Damon Chaplin wrote: > On Wed, 2008-04-16 at 14:14 +0200, Rodney Lorrimar wrote: > > > > > Is it possible to create another set of functions, > > > > e.g. goo_canvas_*_new_orphan(), which create items without a parent, > > > > and always return a floating reference? These functions would have the > > > > GTK+ reference semantics. floating references are themselves just another C convenience. They are something else that language bindings have to hide. > > Damon, if you think this might be a somewhat useful addition then I > > can prepare a patch. > > I wouldn't want to add a bunch of functions that just help one language > binding (unless it won't work any other way). > > But if the bindings authors agreed on an API for creating objects that > helped all/most of them I'd accept a patch. In this case I think it's fine to just pass NULL for the parent. It's not very worthwhile to add a _new() function without the parent parameter, because no real language binding is incapable of coping with this kind of thing. 100%-generated language bindings don't work. > I think the standard GTK+ thing is to add *_construct() functions to > help language bindings. These do most of the stuff currently done in the > _new() functions, but without creating the object, e.g. > > goo_canvas_rect_construct (GooCanvasRect *rect, gdouble x, gdouble y, > gdouble width, gdouble height); > > I don't really know how much that would help though. (Also, should it > include a parent argument, or the vararg list for setting properties?) > -- mu...@mu... www.murrayc.com www.openismus.com |