From 4f13cbd31c984957d17081ac6d59a62b04d57765 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 10 Apr 2015 16:39:23 +0100 Subject: Fixup deprication of gtk_icon_size_lookup_for_settings in gtk 3.10 --- gtk/compat.c | 15 +++++++++++++++ gtk/compat.h | 2 ++ gtk/tabs.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gtk/compat.c b/gtk/compat.c index dc9864bb9..7f6d061d8 100644 --- a/gtk/compat.c +++ b/gtk/compat.c @@ -506,6 +506,7 @@ void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window, #endif } +/* exported interface documented in gtk/compat.h */ GtkWidget *nsgtk_image_menu_item_new_with_mnemonic(const gchar *label) { #if GTK_CHECK_VERSION(3,10,0) @@ -515,9 +516,23 @@ GtkWidget *nsgtk_image_menu_item_new_with_mnemonic(const gchar *label) #endif } +/* exported interface documented in gtk/compat.h */ void nsgtk_image_menu_item_set_image(GtkWidget *image_menu_item, GtkWidget *image) { #if !GTK_CHECK_VERSION(3,10,0) gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(image_menu_item), image); #endif } + +/* exported interface documented in gtk/compat.h */ +gboolean nsgtk_icon_size_lookup_for_settings(GtkSettings *settings, + GtkIconSize size, + gint *width, + gint *height) +{ +#if GTK_CHECK_VERSION(3,10,0) + return gtk_icon_size_lookup(size, width, height); +#else + return gtk_icon_size_lookup_for_settings(settings, size, width, height); +#endif +} diff --git a/gtk/compat.h b/gtk/compat.h index 748f1b4e4..15c30ab05 100644 --- a/gtk/compat.h +++ b/gtk/compat.h @@ -182,6 +182,8 @@ gboolean nsgtk_show_uri(GdkScreen *screen, const gchar *uri, guint32 timestamp, GdkWindow *nsgtk_layout_get_bin_window(GtkLayout *layout); void nsgtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation); +gboolean nsgtk_icon_size_lookup_for_settings (GtkSettings *settings, GtkIconSize size, gint *width, gint *height); + GtkAdjustment *nsgtk_layout_get_vadjustment(GtkLayout *layout); GtkAdjustment *nsgtk_layout_get_hadjustment(GtkLayout *layout); void nsgtk_layout_set_hadjustment(GtkLayout *layout, GtkAdjustment *adj); diff --git a/gtk/tabs.c b/gtk/tabs.c index 75e3a03f2..f69966c8d 100644 --- a/gtk/tabs.c +++ b/gtk/tabs.c @@ -53,7 +53,7 @@ static void nsgtk_tab_update_size(GtkWidget *hbox, GtkStyle *previous_style, char_width = pango_font_metrics_get_approximate_digit_width(metrics); pango_font_metrics_unref(metrics); - gtk_icon_size_lookup_for_settings(gtk_widget_get_settings (hbox), + nsgtk_icon_size_lookup_for_settings(gtk_widget_get_settings (hbox), GTK_ICON_SIZE_MENU, &w, &h); gtk_widget_set_size_request(hbox, -- cgit v1.2.3