After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 305560 - GObjectClass->constructor revised, g_object_newv_with_data
GObjectClass->constructor revised, g_object_newv_with_data
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 123891 161177
 
 
Reported: 2005-05-26 17:10 UTC by Gustavo Carneiro
Modified: 2011-02-18 16:11 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch (3.15 KB, patch)
2005-05-26 17:10 UTC, Gustavo Carneiro
none Details | Review
new patch, use GData ** instead of gpointer (3.17 KB, patch)
2005-05-28 22:22 UTC, Gustavo Carneiro
none Details | Review

Description Gustavo Carneiro 2005-05-26 17:10:04 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.
Comment 1 Gustavo Carneiro 2005-05-26 17:10:36 UTC
Created attachment 46911 [details] [review]
patch
Comment 2 Gustavo Carneiro 2005-05-28 22:22:53 UTC
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
Comment 3 Gustavo Carneiro 2005-06-03 16:46:56 UTC
Ping?

There's already a patch in bug 161177 that uses this code...
Comment 4 Matthias Clasen 2005-06-07 19:28:13 UTC
Gustavo, if you hope for speedy response/patch review from Tim, it is best to
send patch+explantation to gtk-devel-list, cc timj
Comment 5 Johan (not receiving bugmail) Dahlin 2005-07-01 15:47:44 UTC
Confirming and moving to 2.8 API Freeze
Comment 6 Tim Janik 2005-07-05 00:39:28 UTC
this patch is discussed on the mailing list:
http://mail.gnome.org/archives/gtk-devel-list/2005-July/msg00017.html
Comment 7 Johan (not receiving bugmail) Dahlin 2005-07-08 16:42:08 UTC
Tim suggested an alternative way of implementing this, effectively making this
bug  obsolete.