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 615666 - GTK_OBJECT_FLAGS() should be deprecated and removed from public api
GTK_OBJECT_FLAGS() should be deprecated and removed from public api
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.90.x
Other All
: Normal blocker
: 3.0
Assigned To: gtk-bugs
gtk-bugs
deprecations
: 629729 (view as bug list)
Depends on: 619671
Blocks: 614512 615613
 
 
Reported: 2010-04-13 15:35 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-09-27 02:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecate GTK_OBJECT_FLAGS (1.70 KB, patch)
2010-05-13 19:01 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Move GTK_OBJECT_FLAGS() to a private header (8.20 KB, patch)
2010-05-13 19:02 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Deprecate GTK_OBJECT_FLAGS.v2 (1.86 KB, patch)
2010-06-16 01:22 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
incomplete patch (29.62 KB, patch)
2010-09-15 05:07 UTC, Matthias Clasen
none Details | Review
Move classes that currently derive from GtkObject to GInitiallyUnowned (3.38 KB, patch)
2010-09-15 14:09 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Replace destroy handler implementations (86.93 KB, patch)
2010-09-15 14:10 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Replace destroy handler implementations.v2 (81.66 KB, patch)
2010-09-15 14:47 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Convert gtkadjustment in a GObject (8.84 KB, patch)
2010-09-15 14:47 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Do not use gtk_object_destroy() (7.16 KB, patch)
2010-09-15 16:49 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
complete private flags removal (52.84 KB, patch)
2010-09-16 05:10 UTC, Matthias Clasen
none Details | Review

Description Javier Jardón (IRC: jjardon) 2010-04-13 15:35:46 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.
Comment 1 Javier Jardón (IRC: jjardon) 2010-04-21 02:43:19 UTC
ie, #define GTK_OBJECT_FLAGS(obj)   (GTK_OBJECT (obj)->flags)
Comment 2 Javier Jardón (IRC: jjardon) 2010-05-13 16:46:52 UTC
Seems that the sane solution is move the macro to a private header
Comment 3 Javier Jardón (IRC: jjardon) 2010-05-13 19:01:27 UTC
Created attachment 160995 [details] [review]
Deprecate GTK_OBJECT_FLAGS
Comment 4 Javier Jardón (IRC: jjardon) 2010-05-13 19:02:55 UTC
Created attachment 160996 [details] [review]
Move GTK_OBJECT_FLAGS() to a private header
Comment 5 Christian Dywan 2010-05-27 17:16:45 UTC
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.
Comment 6 Christian Dywan 2010-05-27 17:22:30 UTC
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.
Comment 7 Javier Jardón (IRC: jjardon) 2010-06-16 01:22:53 UTC
Created attachment 163755 [details] [review]
Deprecate GTK_OBJECT_FLAGS.v2
Comment 8 Christian Dywan 2010-06-16 11:43:34 UTC
Review of attachment 163755 [details] [review]:

Looks good to me.
Comment 9 Javier Jardón (IRC: jjardon) 2010-06-16 18:42:36 UTC
Comment on attachment 163755 [details] [review]
Deprecate GTK_OBJECT_FLAGS.v2

commit 2747f9d84d5149090ac7d02063d2d3d30aa66ecb
Comment 10 Javier Jardón (IRC: jjardon) 2010-06-16 18:51:34 UTC
gtk-2-22: commit 606180b746fc647c0269262614d5cd4117de985b
Comment 11 Matthias Clasen 2010-09-15 04:03:16 UTC
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/
Comment 12 Matthias Clasen 2010-09-15 05:07:01 UTC
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
Comment 13 Javier Jardón (IRC: jjardon) 2010-09-15 11:39:42 UTC
*** Bug 629729 has been marked as a duplicate of this bug. ***
Comment 14 Javier Jardón (IRC: jjardon) 2010-09-15 14:09:49 UTC
Created attachment 170340 [details] [review]
Move classes that currently derive from GtkObject to GInitiallyUnowned
Comment 15 Javier Jardón (IRC: jjardon) 2010-09-15 14:10:45 UTC
Created attachment 170341 [details] [review]
Replace destroy handler implementations
Comment 16 Javier Jardón (IRC: jjardon) 2010-09-15 14:47:14 UTC
Created attachment 170344 [details] [review]
Replace destroy handler implementations.v2
Comment 17 Javier Jardón (IRC: jjardon) 2010-09-15 14:47:41 UTC
Created attachment 170345 [details] [review]
Convert gtkadjustment in a GObject
Comment 18 Matthias Clasen 2010-09-15 16:41:50 UTC
These patches look fine, thanks. Before going ahead with this, I wanted to bring it up for discussion in the next meeting, maybe.
Comment 19 Javier Jardón (IRC: jjardon) 2010-09-15 16:49:47 UTC
Created attachment 170355 [details] [review]
Do not use gtk_object_destroy()
Comment 20 Matthias Clasen 2010-09-16 05:10:16 UTC
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.
Comment 21 Matthias Clasen 2010-09-19 00:02:51 UTC
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.