[rhythmbox] update for recent gtk+ deprecations



commit 0f3c83c37efe9d6894cb7a6392b49c72f1c73731
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Nov 1 07:24:33 2010 +1000

    update for recent gtk+ deprecations

 lib/gseal-gtk-compat.h                             |    6 ++++++
 .../rb-audioscrobbler-profile-source.c             |   19 ++++++++++---------
 plugins/status-icon/rb-status-icon-plugin.c        |    2 +-
 plugins/visualizer/rb-vis-widget.c                 |    2 +-
 plugins/visualizer/rb-visualizer-plugin.c          |    6 +++---
 sources/rb-library-source.c                        |   13 +++++++------
 widgets/rb-query-creator-properties.c              |    5 +++--
 widgets/rb-query-creator.c                         |    9 +++++----
 widgets/rb-rating.c                                |    3 ++-
 9 files changed, 38 insertions(+), 27 deletions(-)
---
diff --git a/lib/gseal-gtk-compat.h b/lib/gseal-gtk-compat.h
index f9281a4..f4bba01 100644
--- a/lib/gseal-gtk-compat.h
+++ b/lib/gseal-gtk-compat.h
@@ -24,6 +24,12 @@
 
 G_BEGIN_DECLS
 
+#if !GTK_CHECK_VERSION (2, 23, 0)
+#define gtk_combo_box_text_new					gtk_combo_box_new_text
+#define gtk_combo_box_text_append_text(box,text)		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (box), text)
+#define gdk_window_get_display(window)				gdk_drawable_get_display(GDK_DRAWABLE (window))
+#endif
+
 #if !GTK_CHECK_VERSION (2, 21, 1)
 #define gdk_drag_context_list_targets(context)			context->targets
 #define gdk_drag_context_get_actions(context)			context->actions
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
index 0982c79..2be3bd2 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
@@ -45,6 +45,7 @@
 #include "rb-preferences.h"
 #include "rb-sourcelist.h"
 #include "rb-util.h"
+#include "gseal-gtk-compat.h"
 
 #define CONF_AUDIOSCROBBLER_ENABLE_SCROBBLING CONF_PLUGINS_PREFIX "/audioscrobbler/%s/scrobbling_enabled"
 #define AUDIOSCROBBLER_PROFILE_SOURCE_POPUP_PATH "/AudioscrobblerProfileSourcePopup"
@@ -553,11 +554,11 @@ init_profile_ui (RBAudioscrobblerProfileSource *source)
 	/* station creator */
 	source->priv->station_creator_arg_entry = GTK_WIDGET (gtk_builder_get_object (builder, "station_creator_arg_entry"));
 	combo_container = GTK_WIDGET (gtk_builder_get_object (builder, "station_creator_combo_container"));
-	source->priv->station_creator_type_combo = gtk_combo_box_new_text ();
+	source->priv->station_creator_type_combo = gtk_combo_box_text_new ();
 	gtk_container_add (GTK_CONTAINER (combo_container), source->priv->station_creator_type_combo);
 	for (i = 0; i < RB_AUDIOSCROBBLER_RADIO_TYPE_LAST; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (source->priv->station_creator_type_combo),
-		                           rb_audioscrobbler_radio_type_get_text (i));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (source->priv->station_creator_type_combo),
+						rb_audioscrobbler_radio_type_get_text (i));
 	}
 	gtk_combo_box_set_active (GTK_COMBO_BOX (source->priv->station_creator_type_combo), 0);
 	gtk_widget_show (source->priv->station_creator_type_combo);
@@ -772,7 +773,7 @@ login_status_change_cb (RBAudioscrobblerAccount *account,
 	if (show_login_bar == TRUE) {
 		gtk_widget_show_all (source->priv->login_bar);
 	} else {
-		gtk_widget_hide_all (source->priv->login_bar);
+		gtk_widget_hide (source->priv->login_bar);
 	}
 	if (show_profile == TRUE) {
 		gtk_label_set_label (GTK_LABEL (source->priv->username_label),
@@ -1390,7 +1391,7 @@ recent_tracks_updated_cb (RBAudioscrobblerUser *user,
 	if (recent_tracks != NULL && recent_tracks->len != 0) {
 		gtk_widget_show_all (source->priv->recent_tracks_area);
 	} else {
-		gtk_widget_hide_all (source->priv->recent_tracks_area);
+		gtk_widget_hide (source->priv->recent_tracks_area);
 	}
 }
 
@@ -1404,7 +1405,7 @@ top_tracks_updated_cb (RBAudioscrobblerUser *user,
 	if (top_tracks != NULL && top_tracks->len != 0) {
 		gtk_widget_show_all (source->priv->top_tracks_area);
 	} else {
-		gtk_widget_hide_all (source->priv->top_tracks_area);
+		gtk_widget_hide (source->priv->top_tracks_area);
 	}
 }
 
@@ -1418,7 +1419,7 @@ loved_tracks_updated_cb (RBAudioscrobblerUser *user,
 	if (loved_tracks != NULL && loved_tracks->len != 0) {
 		gtk_widget_show_all (source->priv->loved_tracks_area);
 	} else {
-		gtk_widget_hide_all (source->priv->loved_tracks_area);
+		gtk_widget_hide (source->priv->loved_tracks_area);
 	}
 }
 
@@ -1432,7 +1433,7 @@ top_artists_updated_cb (RBAudioscrobblerUser *user,
 	if (top_artists != NULL && top_artists->len != 0) {
 		gtk_widget_show_all (source->priv->top_artists_area);
 	} else {
-		gtk_widget_hide_all (source->priv->top_artists_area);
+		gtk_widget_hide (source->priv->top_artists_area);
 	}
 }
 
@@ -1446,7 +1447,7 @@ recommended_artists_updated_cb (RBAudioscrobblerUser *user,
 	if (recommended_artists != NULL && recommended_artists->len != 0) {
 		gtk_widget_show_all (source->priv->recommended_artists_area);
 	} else {
-		gtk_widget_hide_all (source->priv->recommended_artists_area);
+		gtk_widget_hide (source->priv->recommended_artists_area);
 	}
 }
 
diff --git a/plugins/status-icon/rb-status-icon-plugin.c b/plugins/status-icon/rb-status-icon-plugin.c
index 73472ae..0ed63ee 100644
--- a/plugins/status-icon/rb-status-icon-plugin.c
+++ b/plugins/status-icon/rb-status-icon-plugin.c
@@ -1011,7 +1011,7 @@ set_icon_geometry  (GdkWindow *window,
 
 	XChangeProperty (dpy,
 			 GDK_WINDOW_XID (window),
-			 gdk_x11_get_xatom_by_name_for_display (gdk_drawable_get_display (window),
+			 gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window),
 								"_NET_WM_ICON_GEOMETRY"),
 			 XA_CARDINAL, 32, PropModeReplace,
 			 (guchar *)&data, 4);
diff --git a/plugins/visualizer/rb-vis-widget.c b/plugins/visualizer/rb-vis-widget.c
index 0835f6a..7ad8730 100644
--- a/plugins/visualizer/rb-vis-widget.c
+++ b/plugins/visualizer/rb-vis-widget.c
@@ -136,7 +136,7 @@ rb_vis_widget_expose_event (GtkWidget *widget,
 	if (rbvw->window_xid != GDK_WINDOW_XWINDOW (window)) {
 		rbvw->window_xid = GDK_WINDOW_XWINDOW (window);
 
-		gdk_display_sync (gdk_drawable_get_display (GDK_DRAWABLE (window)));
+		gdk_display_sync (gdk_window_get_display (window));
 
 		rb_debug ("got new window ID %lu", rbvw->window_xid);
 		g_object_notify (G_OBJECT (rbvw), "window-xid");
diff --git a/plugins/visualizer/rb-visualizer-plugin.c b/plugins/visualizer/rb-visualizer-plugin.c
index 3fc4ba9..cbeacbb 100644
--- a/plugins/visualizer/rb-visualizer-plugin.c
+++ b/plugins/visualizer/rb-visualizer-plugin.c
@@ -1450,15 +1450,15 @@ disable_visualization (RBVisualizerPlugin *pi, gboolean set_action)
 
 	switch (pi->mode) {
 	case EMBEDDED:
-		gtk_widget_hide_all (pi->vis_box);
+		gtk_widget_hide (pi->vis_box);
 		rb_shell_notebook_set_page (pi->shell, NULL);
 		break;
 	case FULLSCREEN:
 		gtk_window_unfullscreen (GTK_WINDOW (pi->vis_window));
-		gtk_widget_hide_all (pi->vis_window);
+		gtk_widget_hide (pi->vis_window);
 		break;
 	case EXTERNAL_WINDOW:
-		gtk_widget_hide_all (pi->vis_window);
+		gtk_widget_hide (pi->vis_window);
 		break;
 	case DESKTOP_WINDOW:
 		gtk_widget_hide (pi->vis_box);
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index 6931f1c..ed7044e 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -68,6 +68,7 @@
 #include "rb-auto-playlist-source.h"
 #include "rb-encoder.h"
 #include "rb-missing-plugins.h"
+#include "gseal-gtk-compat.h"
 
 static void rb_library_source_class_init (RBLibrarySourceClass *klass);
 static void rb_library_source_init (RBLibrarySource *source);
@@ -504,7 +505,7 @@ impl_get_config_widget (RBSource *asource, RBShellPreferences *prefs)
 
 	tmp = gtk_builder_get_object (builder, "layout_path_menu_box");
 	label = gtk_builder_get_object (builder, "layout_path_menu_label");
-	source->priv->layout_path_menu = gtk_combo_box_new_text ();
+	source->priv->layout_path_menu = gtk_combo_box_text_new ();
 	gtk_box_pack_start (GTK_BOX (tmp), source->priv->layout_path_menu, TRUE, TRUE, 0);
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), source->priv->layout_path_menu);
 	g_signal_connect (G_OBJECT (source->priv->layout_path_menu),
@@ -512,13 +513,13 @@ impl_get_config_widget (RBSource *asource, RBShellPreferences *prefs)
 			  G_CALLBACK (rb_library_source_path_changed_cb),
 			  asource);
 	for (i = 0; i < num_library_layout_paths; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (source->priv->layout_path_menu),
-					   _(library_layout_paths[i].title));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (source->priv->layout_path_menu),
+						_(library_layout_paths[i].title));
 	}
 
 	tmp = gtk_builder_get_object (builder, "layout_filename_menu_box");
 	label = gtk_builder_get_object (builder, "layout_filename_menu_label");
-	source->priv->layout_filename_menu = gtk_combo_box_new_text ();
+	source->priv->layout_filename_menu = gtk_combo_box_text_new ();
 	gtk_box_pack_start (GTK_BOX (tmp), source->priv->layout_filename_menu, TRUE, TRUE, 0);
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), source->priv->layout_filename_menu);
 	g_signal_connect (G_OBJECT (source->priv->layout_filename_menu),
@@ -526,8 +527,8 @@ impl_get_config_widget (RBSource *asource, RBShellPreferences *prefs)
 			  G_CALLBACK (rb_library_source_filename_changed_cb),
 			  asource);
 	for (i = 0; i < num_library_layout_filenames; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (source->priv->layout_filename_menu),
-					   _(library_layout_filenames[i].title));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (source->priv->layout_filename_menu),
+						_(library_layout_filenames[i].title));
 	}
 
 	tmp = gtk_builder_get_object (builder, "edit_profile_button");
diff --git a/widgets/rb-query-creator-properties.c b/widgets/rb-query-creator-properties.c
index 38298c6..91f8526 100644
--- a/widgets/rb-query-creator-properties.c
+++ b/widgets/rb-query-creator-properties.c
@@ -35,6 +35,7 @@
 #include "rhythmdb.h"
 #include "rb-query-creator-private.h"
 #include "rb-rating.h"
+#include "gseal-gtk-compat.h"
 
 const RBQueryCreatorPropertyType string_property_type;
 const RBQueryCreatorPropertyType escaped_string_property_type;
@@ -543,9 +544,9 @@ create_time_unit_option_menu (const RBQueryCreatorTimeUnitOption *options,
 	GtkWidget *combo;
 	int i;
 
-	combo = gtk_combo_box_new_text ();
+	combo = gtk_combo_box_text_new ();
 	for (i = 0; i < length; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i].name));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(options[i].name));
 	}
 	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
 
diff --git a/widgets/rb-query-creator.c b/widgets/rb-query-creator.c
index 84a319e..5443874 100644
--- a/widgets/rb-query-creator.c
+++ b/widgets/rb-query-creator.c
@@ -41,6 +41,7 @@
 #include "rb-preferences.h"
 #include "rb-builder-helpers.h"
 #include "rb-util.h"
+#include "gseal-gtk-compat.h"
 
 static void rb_query_creator_class_init (RBQueryCreatorClass *klass);
 static void rb_query_creator_constructed (GObject *object);
@@ -914,9 +915,9 @@ create_property_option_menu (RBQueryCreator *creator,
 	GtkWidget *combo;
 	int i;
 
-	combo = gtk_combo_box_new_text ();
+	combo = gtk_combo_box_text_new ();
 	for (i = 0; i < length; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (combo), g_dpgettext2 (NULL, "query-criteria", options[i].name));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), g_dpgettext2 (NULL, "query-criteria", options[i].name));
 	}
 
 	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
@@ -936,9 +937,9 @@ create_criteria_option_menu (const RBQueryCreatorCriteriaOption *options,
 	GtkWidget *combo;
 	int i;
 
-	combo = gtk_combo_box_new_text ();
+	combo = gtk_combo_box_text_new ();
 	for (i = 0; i < length; i++) {
-		gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(options[i].name));
+		gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(options[i].name));
 	}
 	gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
 
diff --git a/widgets/rb-rating.c b/widgets/rb-rating.c
index 88f00c8..f3c5c1e 100644
--- a/widgets/rb-rating.c
+++ b/widgets/rb-rating.c
@@ -372,7 +372,8 @@ rb_rating_expose (GtkWidget *widget,
 	rating = RB_RATING (widget);
 
 	window = gtk_widget_get_window (widget);
-	gdk_drawable_get_size (window, &width, &height);
+	width = gdk_window_get_width (window);
+	height = gdk_window_get_height (window);
 
 	gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
 	if (gtk_widget_has_focus (widget)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]