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 696138 - GtkWidget: some deprecation marks are missing
GtkWidget: some deprecation marks are missing
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.7.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-19 13:48 UTC by Sébastien Wilmet
Modified: 2013-11-01 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkWidget: add missing deprecation marks (2.35 KB, patch)
2013-03-19 13:49 UTC, Sébastien Wilmet
reviewed Details | Review

Description Sébastien Wilmet 2013-03-19 13:48:28 UTC
The following GtkWidget symbols are deprecated, but don't have the associated deprecation macro/flag (so there is no warnings when still using them):

::state-changed
::style-set
gtk_widget_set_state()
gtk_widget_get_state()
gtk_widget_get_requisition()

A patch is coming soon.
Comment 1 Sébastien Wilmet 2013-03-19 13:49:07 UTC
Created attachment 239252 [details] [review]
GtkWidget: add missing deprecation marks
Comment 2 Emmanuele Bassi (:ebassi) 2013-03-19 13:55:21 UTC
Review of attachment 239252 [details] [review]:

looks generally okay to me.

::: gtk/gtkwidget.h
@@ +669,3 @@
                                                          const GtkAllocation *allocation);
 
+GDK_DEPRECATED_IN_3_0

this should probably be:

  GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width and gtk_widget_get_preferred_height)
Comment 3 Sébastien Wilmet 2013-03-19 14:35:58 UTC
The doc for gtk_widget_get_requisition() doesn't mention gtk_widget_get_preferred_width() or gtk_widget_get_preferred_height():

> gtk_widget_get_requisition has been deprecated since version 3.0 and should
> not be used in newly-written code. The GtkRequisition cache on the widget was
> removed, If you need to cache sizes across requests and allocations, add an
> explicit cache to the widget in question instead.

That's why I've used GDK_DEPRECATED_IN_3_0. But I don't have lots of experience in widget implementation, so maybe the documentation should be updated too.
Comment 4 Sébastien Wilmet 2013-03-26 18:23:28 UTC
This has been pushed, thanks.
Comment 5 Peter Wu 2013-10-28 15:25:19 UTC
After this patch, GCC throws a warning:
In file included from /usr/include/gtk-3.0/gtk/gtkapplication.h:27:0,
                 from /usr/include/gtk-3.0/gtk/gtkwindow.h:33,
                 from /usr/include/gtk-3.0/gtk/gtkdialog.h:33,
                 from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from ../../../ui/gtk/bytes_view.c:34:
/usr/include/gtk-3.0/gtk/gtkwidget.h:787:58: error: identifier "and" is a special operator name in C++ [-Werror=c++-compat]
 GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width and gtk_widget_get_preferred_height)
                                                          ^
This is GTK 3.10.2.
Comment 6 Sébastien Wilmet 2013-11-01 16:52:59 UTC
> -Werror=c++-compat

Strange, the code is surrounded by G_BEGIN_DECLS and G_END_DECLS.