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 52790 - Shouldn't GTK+ be compiled with -D(G|GTK|GDK)_DISABLE_DEPRECATED?
Shouldn't GTK+ be compiled with -D(G|GTK|GDK)_DISABLE_DEPRECATED?
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
1.3.x
Other All
: Normal trivial
: ---
Assigned To: gtk-bugs
gtk-bugs
: 51127 60865 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-04-02 16:37 UTC by Sebastian Wilhelmi
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to get rid of (GTK|GDK)_DISABLE_COMPAT_H and (gtk|gdk)compat.h in favour of (GDK|GTK)_DISABLE_DEPRECATED (31.91 KB, patch)
2001-04-19 13:12 UTC, Sebastian Wilhelmi
none Details | Review
Patch to compile atk with -DG_DISABLE_DEPRECATED (1.31 KB, patch)
2001-11-03 21:25 UTC, Sebastian Wilhelmi
none Details | Review
patch to compile pango with -DG_DISABLE_DEPRECATED (8.06 KB, patch)
2001-11-03 21:26 UTC, Sebastian Wilhelmi
none Details | Review
patch to compile gtk+/gdk-pixbuf with -DG_DISABLE_DEPRECATED and -DGDK_DISABLE_DEPRECATED (30.07 KB, patch)
2001-11-03 21:27 UTC, Sebastian Wilhelmi
none Details | Review
GtkViewport sans deprecated and with slight signal improvement. (6.51 KB, patch)
2002-01-19 21:39 UTC, Gregory Merchan
none Details | Review
patch to make GDK compile clean with G_DISABLE_DEPRECATED (4.09 KB, patch)
2002-01-22 22:55 UTC, Manish Singh
none Details | Review
TreeView and friends sans deprecated (65.95 KB, patch)
2002-01-22 23:50 UTC, Manish Singh
none Details | Review
editable widgets sans deprecated (59.41 KB, patch)
2002-01-23 01:10 UTC, Manish Singh
none Details | Review
Gtk*Dialog sans deprecated (31.75 KB, patch)
2002-01-23 02:48 UTC, Manish Singh
none Details | Review
GtkSpinButton sans deprecated (11.12 KB, patch)
2002-01-23 23:30 UTC, Manish Singh
none Details | Review
patch to compile gtk+/gtk (all the files) with -DG_DISABLE_DEPRECATED and DGDK_DISABLE_DEPRECATED flag (90.30 KB, patch)
2002-02-11 17:16 UTC, Balamurali Viswanathan
none Details | Review

Description Sebastian Wilhelmi 2001-04-02 16:37:02 UTC

Comment 1 Owen Taylor 2001-04-18 14:16:00 UTC
Probably. Though it is probably some effort, and even more
to get it going with get it going with 
GDK_DISABLE_DEPRECATED/GDK_DISABLE_COMPAT_H, which also should
be present.

So, if someone wanted to take that on, that would be great.

Comment 2 Sebastian Wilhelmi 2001-04-19 13:10:13 UTC
While doing that I noticed, that it is obviously your intention to get
rid of (gtk/gdk)compat.h and so I first did that. The patch is
attached. It simply moves the content of (gtk/gdk)compat.h to the
corresponding include files, of course guarded by
(GTK/GDK)_DISABLE_DEPRECATED. 

The versioning system of gtkcompat.h.in went to gtkversion.h.in

The GTK_HAVE_ macros are deleted, because now is a good time to get
rid of them for good.

If you approve, I'm going to check that in and try to make it compile
with -DG_DISABLE_DEPRECATED, -DGDK_DISABLE_DEPRECATED and
-DGTK_DISABLE_DEPRECATED
Comment 3 Sebastian Wilhelmi 2001-04-19 13:12:25 UTC
Created attachment 479 [details] [review]
patch to get rid of (GTK|GDK)_DISABLE_COMPAT_H and (gtk|gdk)compat.h in favour of (GDK|GTK)_DISABLE_DEPRECATED
Comment 4 Havoc Pennington 2001-04-19 14:17:26 UTC
GTK won't be buildable with -DGTK_DISABLE_DEPRECATED, you need some of
the deprecated headers to keep deprecated features working.

Instead you'll notice a few files have #define GTK_DISABLE_DEPRECATED
at the top - i.e. we are cleaning up individual files that don't need
the deprecated features. Doing that for as many files as possible
would be good.

GTK should probably use G_DISABLE_DEPRECATED and
GDK_DISABLE_DEPRECATED though.
Comment 5 Sebastian Wilhelmi 2001-04-19 14:34:55 UTC
Actually I don't notice a few files have #define
GTK_DISABLE_DEPRECATED at the top, because none has. But I see the
point. I would take a look at that. Please look at the patch removing
(gdk/gtk)compat.h first.
Comment 6 Havoc Pennington 2001-04-19 16:18:13 UTC
I guess I mean some have #define GTK_ENABLE_BROKEN, sorry.

I think the patch is right, but Owen/Tim may disagree.
Comment 7 Owen Taylor 2001-11-02 14:32:48 UTC
The patch looks very good to me; I don't know how close it is to 
applying after 6 months :-(. The #defines for GTK_TYPE_GDK_WINDOW_TYPE
etc. that have since been added to gtkcompat.h.in could go in
gtktypeutils.h for lack of a better location.
Comment 8 Sebastian Wilhelmi 2001-11-02 15:23:38 UTC
Actually most of this is commited Aug 22 by you. Seems you're working
to much ;-) Take a rest.....

Some things still missing and others just discovered:

* remove gdk/gdkcompat.h gtk/gtkcompat.h.in from CVS.
* update some non-unix makefiles.
* s/GDK_DISABLE_COMPAT_H/GDK_DISABLE_DEPRECATED/ in docs/Changes-2.0.

These are so trivial, that I'll go ahead and commit.

I'm not closing the bug though, as GTK+ is not yet compiled with
-DG_DISABLE_DEPRECATED, -DGDK_DISABLE_DEPRECATED and
-DGTK_DISABLE_DEPRECATED. 

Will have a look.

Comment 9 Sebastian Wilhelmi 2001-11-03 21:16:53 UTC
*** Bug 51127 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Wilhelmi 2001-11-03 21:23:32 UTC
I've taken a look at atk, pango and gtk+/gdk-pixbuf so far. atk and
pango were more than easy. After adding -DG_DISABLE_DEPRECATED both
still compiled fine.

gtk+/gdk-pixbuf was a bit more ugly. I hope, I havn't overreacted in
my patch. Basically I made the _ref/_unref functions (which were just
calling g_object_(un|)ref) macros guarded by GDK_DISABLE_DEPRECATED (I
wouldn't want to introduce another GDK_PIXBUF_DISABLE_DEPRECATED, and
GDK_... seemed the closest). That meant some changes to the docs to
(e.g. --scan-options).

I'll attach all three patched here.
Comment 11 Sebastian Wilhelmi 2001-11-03 21:25:00 UTC
Created attachment 5959 [details] [review]
Patch to compile atk with -DG_DISABLE_DEPRECATED
Comment 12 Sebastian Wilhelmi 2001-11-03 21:26:04 UTC
Created attachment 5960 [details] [review]
patch to compile pango with -DG_DISABLE_DEPRECATED
Comment 13 Sebastian Wilhelmi 2001-11-03 21:27:34 UTC
Created attachment 5961 [details] [review]
patch to compile gtk+/gdk-pixbuf with -DG_DISABLE_DEPRECATED and -DGDK_DISABLE_DEPRECATED
Comment 14 Sebastian Wilhelmi 2001-11-03 21:31:35 UTC
In the above gdk-pixbuf patch I also removed all G_OBJECT() casts from
g_object_(ref|unref), as those functions accept gpointer and check
themself... I agree, should have been in another patch...
Comment 15 Sebastian Wilhelmi 2001-11-03 21:40:52 UTC
*** Bug 60865 has been marked as a duplicate of this bug. ***
Comment 16 Owen Taylor 2001-12-12 22:14:02 UTC
The atk and pango patches look fine. gdk_pixbuf_ref/unref
were deprecated as of:

2001-12-05  Matthias Clasen  <matthiasc@poet.de>

	* gdk-pixbuf.h (gdk_pixbuf_ref, gdk_pixbuf_unref,
	gdk_pixbuf_animation_ref, gdk_pixbuf_animation_unref):
	Deprecate. (#66208)

The rest of the gdk-pixbuf patch looks fine.
Comment 17 Sebastian Wilhelmi 2001-12-13 21:23:14 UTC
I've committed the atk, pango and gdk-pixbuf parts.

I'll have a look at gdk/gtk soon.
Comment 18 Gregory Merchan 2002-01-19 21:39:15 UTC
Created attachment 6443 [details] [review]
GtkViewport sans deprecated and with slight signal improvement.
Comment 19 Manish Singh 2002-01-22 22:55:51 UTC
Created attachment 6475 [details] [review]
patch to make GDK compile clean with G_DISABLE_DEPRECATED
Comment 20 Manish Singh 2002-01-22 23:50:45 UTC
Created attachment 6479 [details] [review]
TreeView and friends sans deprecated
Comment 21 Manish Singh 2002-01-23 01:10:21 UTC
Created attachment 6481 [details] [review]
editable widgets sans deprecated
Comment 22 Manish Singh 2002-01-23 02:48:17 UTC
Created attachment 6482 [details] [review]
Gtk*Dialog sans deprecated
Comment 23 Manish Singh 2002-01-23 23:30:44 UTC
Created attachment 6493 [details] [review]
GtkSpinButton sans deprecated
Comment 24 Owen Taylor 2002-02-06 22:17:17 UTC
Comments on viewport patch:

 - There is a reason we didn't add
g_signal_handlers_disconnect_by_data(); (too much danger of
   disconnecting the wrong handlers) instead of emulating that 
   with g_signal_handlers_disconnect_matched(), use multiple
   calls g_signal_handlers_disconnect().

 - We should be removing (gpointer) casts as in the
   g_signal_connect() calls... they aren't necessary.




Comment 25 Balamurali Viswanathan 2002-02-11 17:16:42 UTC
Created attachment 6696 [details] [review]
patch to compile  gtk+/gtk (all the files) with -DG_DISABLE_DEPRECATED and DGDK_DISABLE_DEPRECATED flag
Comment 26 Owen Taylor 2002-02-15 04:40:42 UTC
I think we need to wait to apply these patches until afer 2.0.0 is
out; we're too close to the release to do this much code churn
(even safe code churn) for no immediate benefits; there will
be conflicts with other outstanding patches, and even pretty
automatic patches need review.

I apologize to everyone who has worked on these for not being
able to get to them sooner; not getting to these patches has
to do with outstanding work elsewhere, not with the quality
of the patches.
Comment 27 Owen Taylor 2002-03-20 22:05:26 UTC
Putting on 2.2, because there is no point in putting these
changes on the 2.0.x branch and merging.
Comment 28 Matthias Clasen 2002-08-14 12:27:08 UTC
If we wait much longer before starting to integrate these patches,
we'll be too 
close to a release again, which would be a pity.
Comment 29 Manish Singh 2002-10-14 00:22:12 UTC
This is more or less done now. There are a few places where deprecated
functions are still used, for compatibility mainly. I'm not sure how
much worth it would be to do the preprocessor contortions to get
around that.
Comment 30 Owen Taylor 2002-10-14 15:38:39 UTC
What do you mean by pre-processor contortions?
Comment 31 Manish Singh 2002-10-14 15:56:43 UTC
Adding -DGDK_DISABLE_DEPRECATED and -DGTK_DISABLE_DEPRECATED to the
Makefile means either #undefing those for the files that still need
those functions, or doing special casing to get around that (#ifdef
GTK_COMPILATION or such).
Comment 32 Owen Taylor 2002-10-14 16:00:12 UTC
What are you doing now -- adding the #undef?
Comment 33 Manish Singh 2002-10-14 16:29:06 UTC
Nothing right now. I wanted some input from others of what they think
would be the best way (or, leave as is, i.e. not worth the extra work).
Comment 34 Owen Taylor 2002-10-14 18:01:40 UTC
You mean, you aren't adding the -DGDK_DISABLE_DEPRECATED and
-DGTK_DISABLE_DEPRECATED to the Makefile?
Comment 35 Manish Singh 2002-11-20 01:15:25 UTC
Flags added to Makefiles, and some preprocessor magic finished.
Currently in CVS.