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 396157 - GInitiallyUnowned-support in glibmm
GInitiallyUnowned-support in glibmm
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: object
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2007-01-13 16:50 UTC by 28872d13
Modified: 2007-11-09 10:36 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch for glibmm with InitiallyUnowned-support (6.38 KB, patch)
2007-01-13 16:53 UTC, 28872d13
none Details | Review

Description 28872d13 2007-01-13 16:50:14 UTC
glibmm actually lacks support for GInitiallyUnowned.
Implementing this shouldn´t be too difficult, as almost the same functionality already exists in Gtk::Object of gtkmm.
I´ve attached my implementation, but I´m not sure I´ve got everything right.
Comment 1 28872d13 2007-01-13 16:53:11 UTC
Created attachment 80185 [details] [review]
Patch for glibmm with InitiallyUnowned-support
Comment 2 Murray Cumming 2007-01-17 19:21:30 UTC
This needs more comments to explain what is happening. And the class needs doxygen documentation to explain when you might want to use this class, and how to use it. I believe there might be some special considerations due to initialization of base classes with virtual inheritance, but I guess that you have experience of that enough to describe it.

Is this use of referenced_ just similar to the use in GtkObject? Is there anything in GtkObject that you needed to remove in this class?

Minor whitespace errors:
- There should be indenting in the .h file, as in the other files.
- The indenting in the .cc file should be 2 spaces per indent.
Comment 3 28872d13 2007-01-17 19:41:56 UTC
Sorry for submitting the code this way. I´ll document it when I get time to do that.

GtkObject is very similiar to GInitiallyUnowned, and so most of the code is similar. For me, the main difference is, if I got that right, the destruction system of GtkObject (using destruct-notifies etc.), which doesn´t exist for GInitiallyUnowned. This also was the only thing I removed.
Comment 4 Murray Cumming 2007-06-10 15:25:29 UTC
An update would be nice.
Comment 5 28872d13 2007-06-10 17:28:12 UTC
Well, I don't really know if this is completely right or not, and it has been some time since I wrote this, so I should take another look at this. Basically it's just about moving some stuff of Gtk::Object to where it belongs: Glib::InitiallyUnowned. Then Gtk::Object should no longer derive from Glib::Object but Glib::InitiallyUnowned, as it does in the original libraries  anyway.
I think some serious testing is required to make sure this thing works well.
Comment 6 Murray Cumming 2007-11-09 10:36:46 UTC
I think this is better dealt with by the new _DERIVES_INITIALLY_UNOWNED and  _INITIALLY_UNOWNED_SINK macros:
http://mail.gnome.org/archives/gtkmm-list/2007-November/msg00081.html

I prefer not to make any dangerous changes to Gtk::Object.