GNOME Bugzilla – Bug 305560
GObjectClass->constructor revised, g_object_newv_with_data
Last modified: 2011-02-18 16:11:07 UTC
The patch I will attach adds a new GObject virtual method that intends to replace GObjectClass->constructor, which currently has two problems: 1. It is not possible to chain to parent constructor, since it is assumed that the parent type is kept static in a function or as a global variable; thus it is not possible in run-time to distinguish between types all sharing the same constructor C function; 2. It is not possible to pass arbitrary data into the constructor; In pygtk bug #161177 we need to pass to the constructor information on whether a Python wrapper for a GObject has already been created or not; And we need this in the constructor because you're not allowed to change construct-only properties outside of it, so this is also related to bug #123891. Thus, a new constructor_full virtual is proposed, to be used together with the new API g_object_newv_with_data.
Created attachment 46911 [details] [review] patch
Created attachment 46984 [details] [review] new patch, use GData ** instead of gpointer Well, in fact is way more useful and safer to pass a GData **datalist
Ping? There's already a patch in bug 161177 that uses this code...
Gustavo, if you hope for speedy response/patch review from Tim, it is best to send patch+explantation to gtk-devel-list, cc timj
Confirming and moving to 2.8 API Freeze
this patch is discussed on the mailing list: http://mail.gnome.org/archives/gtk-devel-list/2005-July/msg00017.html
Tim suggested an alternative way of implementing this, effectively making this bug obsolete.