From 1efb5db8961ac308d16ed3ae7930bd0b48c0520e Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Mon, 20 Feb 2006 21:28:53 +0000 Subject: [PATCH] Make everything compile with GTK_DISABLE_DEPRECATED declared. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/private.h | 23 +++++++++++++++++++++++ src/gtk/checklst.cpp | 6 ++++++ src/gtk/choice.cpp | 8 ++++++++ src/gtk/combobox.cpp | 6 ++++++ src/gtk/listbox.cpp | 9 +++++++-- src/gtk/notebook.cpp | 6 ++++++ src/gtk/settings.cpp | 6 ++++++ src/gtk/tbargtk.cpp | 8 +++++++- src/gtk/tglbtn.cpp | 6 ++++++ src/gtk/tooltip.cpp | 7 +++++++ src/gtk/window.cpp | 6 ++++++ 11 files changed, 88 insertions(+), 3 deletions(-) diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index 7219dba13b..b754ea5178 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -30,6 +30,29 @@ #define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX( (wxConvUTF8.cMB2WC( s ) ) ) #endif +// Some deprecated GTK+ prototypes we still use often +// FIXME: Don't use them if possible. +G_BEGIN_DECLS + +// Should use gtk_image_new, but the mask seems to be handled different, +// and we need to migrate +GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap, + GdkBitmap *mask); + +// Deprecated since GTK+-1.3.7: +// Trivial wrapper around gtk_window_move, with some side effects we seem to rely on +void gtk_widget_set_uposition (GtkWidget *widget, + gint x, + gint y); + +// We rely on the allow_shrink parameter in one place +void gtk_window_set_policy (GtkWindow *window, + gint allow_shrink, + gint allow_grow, + gint auto_shrink); + +G_END_DECLS + // translate a GTK+ scroll type to a wxEventType inline wxEventType GtkScrollTypeToWx(guint scrollType) { diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp index e3eb5b9e79..95dbf3d2a8 100644 --- a/src/gtk/checklst.cpp +++ b/src/gtk/checklst.cpp @@ -15,6 +15,12 @@ #if wxUSE_CHECKLISTBOX #include "wx/checklst.h" + +// FIXME: We use GtkList to implement wxListBox +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #include diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 8765445a98..7d0df1ca0d 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -14,6 +14,14 @@ #include "wx/choice.h" #include "wx/arrstr.h" +// FIXME: We use GtkOptionMenu which has been deprecated since GTK+ 2.3.0 in +// favour of GtkComboBox. +// Later use GtkComboBox if GTK+ runtime version is new enough. +#include +#if defined(GTK_DISABLE_DEPRECATED) && GTK_CHECK_VERSION(2,3,0) +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 9bb6c7857b..fdb640143f 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -20,6 +20,12 @@ #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED +// We use GtkCombo which has been deprecated since GTK+ 2.3.0 +// in favour of GtkComboBox for +#if defined(GTK_DISABLE_DEPRECATED) && GTK_CHECK_VERSION(2,3,0) +#undef GTK_DISABLE_DEPRECATED +#endif #include "wx/gtk/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index cbff2c4f8f..efa0d15491 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -21,14 +21,19 @@ #include "wx/intl.h" #include "wx/checklst.h" #include "wx/settings.h" + +// FIXME: Use GtkTreeView/GtkListModel instead? +#include +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #if wxUSE_TOOLTIPS #include "wx/tooltip.h" #endif -#include -#include #include //----------------------------------------------------------------------------- diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 50009797eb..329ecddec5 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -22,6 +22,12 @@ #include "wx/bitmap.h" #include "wx/fontutil.h" +// FIXME: Use GtkImage instead of GtkPixmap. Don't use gtk_container_border_width +#include +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #include "wx/gtk/win_gtk.h" diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index d5391ad1e4..fc0926f439 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -17,6 +17,12 @@ #include "wx/fontutil.h" #include "wx/toplevel.h" +// Using gtk_list_new, which is deprecated since GTK2 +// Using gtk_object_sink, which is deprecated since GTK+-2.9.0 +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include #include #include diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index b46fe7af5f..70de9fd33d 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -25,7 +25,13 @@ #include "wx/frame.h" -#include +// FIXME: Use GtkImage instead of GtkPixmap. Use the new toolbar API for when gtk runtime is new enough? +// Beware that the new and old toolbar API may not be mixed in usage. +#include +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" // ---------------------------------------------------------------------------- diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index c18160f778..722d7f9659 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -18,6 +18,12 @@ #if wxUSE_TOGGLEBTN +// FIXME: Use GtkImage instead of GtkPixmap. +#include +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" extern void wxapp_install_idle_handler(); diff --git a/src/gtk/tooltip.cpp b/src/gtk/tooltip.cpp index caf2a283be..e0d3bd03fa 100644 --- a/src/gtk/tooltip.cpp +++ b/src/gtk/tooltip.cpp @@ -68,11 +68,18 @@ void wxToolTip::Enable( bool flag ) gtk_tooltips_disable( ss_tooltips ); } +G_BEGIN_DECLS +void gtk_tooltips_set_delay (GtkTooltips *tooltips, + guint delay); +G_END_DECLS + void wxToolTip::SetDelay( long msecs ) { if (!ss_tooltips) return; + // FIXME: This is a deprecated function and might not even have an effect. + // Try to not use it, after which remove the prototype above. gtk_tooltips_set_delay( ss_tooltips, (int)msecs ); } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ae4e00120e..d98386fe20 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -56,6 +56,12 @@ #include "wx/math.h" #include +// FIXME: Due to a hack we use GtkCombo in here, which is deprecated since gtk2.3.0 +#include +#if defined(GTK_DISABLE_DEPRECATED) && GTK_CHECK_VERSION(2,3,0) +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #include #include -- 2.47.2