GNOME Bugzilla – Bug 615666
GTK_OBJECT_FLAGS() should be deprecated and removed from public api
Last modified: 2010-09-27 02:48:42 UTC
As it's only a macro to access the (sealed) flags public member. I guess that an internal function should be added to substitute the macro in GTK+ internal code.
ie, #define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT (obj)->flags)
Seems that the sane solution is move the macro to a private header
Created attachment 160995 [details] [review] Deprecate GTK_OBJECT_FLAGS
Created attachment 160996 [details] [review] Move GTK_OBJECT_FLAGS() to a private header
Review of attachment 160995 [details] [review]: You should add at least a short sentence after the 'Deprecated:'. Such as "Don't re-use GtkObject flags but use your own variable to store flags." with cases like GnomeCanvas in mind which uses widget-specific flags.
Review of attachment 160996 [details] [review]: ::: gtk/gtkobjectprivate.h @@ +1,1 @@ +/* gtkobjectprivate.h I wonder, should this go into the existing gtkprivate.h? The widget flags are already defined in there and there's not much in there. @@ +6,3 @@ + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This should be *Lesser* General Public License, version 2.1 as this is a new file. @@ +30,3 @@ + * is a kinda nasty break up, it does make the size of + * derived objects smaller. + */ This should be reworded. We no longer want this as a general purpose flag value. Only GtkWidget should use it.
Created attachment 163755 [details] [review] Deprecate GTK_OBJECT_FLAGS.v2
Review of attachment 163755 [details] [review]: Looks good to me.
Comment on attachment 163755 [details] [review] Deprecate GTK_OBJECT_FLAGS.v2 commit 2747f9d84d5149090ac7d02063d2d3d30aa66ecb
gtk-2-22: commit 606180b746fc647c0269262614d5cd4117de985b
As proposed in bug 629375, I think I'd like to be a bit more radical and get rid of GtkObject altogether. That means: - All the object flags should be moved to GtkWidgetPrivate instead - GtkWidget will derive directly from GInitiallyUnowned - We add a GtkWidget::destroy signal - The implementation of gtk_object_destroy replaces the current gtk_widget_destroy - gtk_widget_finalize gets the floating check from gtk_object_finalize - All the places that implement a destroy handler or connect to ::destroy need a s/GtkObject/GtkWidget/
Created attachment 170315 [details] [review] incomplete patch Here is a patch that starts to implement that program. Missing parts: - add accessors for private flags and use them - remove private_flags from GtkWidget - s/GtkObject/GtkWidget/ everywhere - Remove GtkWidgetFlags
*** Bug 629729 has been marked as a duplicate of this bug. ***
Created attachment 170340 [details] [review] Move classes that currently derive from GtkObject to GInitiallyUnowned
Created attachment 170341 [details] [review] Replace destroy handler implementations
Created attachment 170344 [details] [review] Replace destroy handler implementations.v2
Created attachment 170345 [details] [review] Convert gtkadjustment in a GObject
These patches look fine, thanks. Before going ahead with this, I wanted to bring it up for discussion in the next meeting, maybe.
Created attachment 170355 [details] [review] Do not use gtk_object_destroy()
Created attachment 170392 [details] [review] complete private flags removal Here is a patch that completes the removal of private flags started in the first patch.
I've put a complete GtkObject removal in the gtkobject-removal branch. It also gets rid of GtkWidgetFlags. I have (untested) patches for most of gnome to get rid of GtkObject uses.