GNOME Bugzilla – Bug 696138
GtkWidget: some deprecation marks are missing
Last modified: 2013-11-01 16:52:59 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.
Created attachment 239252 [details] [review] GtkWidget: add missing deprecation marks
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)
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.
This has been pushed, thanks.
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.
> -Werror=c++-compat Strange, the code is surrounded by G_BEGIN_DECLS and G_END_DECLS.