[rhythmbox/gobject-introspection: 16/41] update plugins for recent gtk deprecations
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox/gobject-introspection: 16/41] update plugins for recent gtk deprecations
- Date: Sun, 12 Dec 2010 10:00:35 +0000 (UTC)
commit cdf6ddab7f177c0ab70eaeba6a8d52b25e65337b
Author: Jonathan Matthew <jonathan d14n org>
Date: Mon Nov 29 10:33:20 2010 +1000
update plugins for recent gtk deprecations
plugins/audiocd/rb-audiocd-source.c | 2 +-
.../rb-audioscrobbler-profile-page.c | 8 +++---
plugins/fmradio/rb-fm-radio-source.c | 2 +-
plugins/visualizer/rb-vis-widget.c | 8 ++---
plugins/visualizer/rb-visualizer-plugin.c | 28 ++++++++++----------
5 files changed, 23 insertions(+), 25 deletions(-)
---
diff --git a/plugins/audiocd/rb-audiocd-source.c b/plugins/audiocd/rb-audiocd-source.c
index 287535b..a0dbcaa 100644
--- a/plugins/audiocd/rb-audiocd-source.c
+++ b/plugins/audiocd/rb-audiocd-source.c
@@ -366,7 +366,7 @@ rb_audiocd_source_constructed (GObject *object)
g_signal_connect_object (renderer, "toggled", G_CALLBACK (extract_toggled_cb), source, 0);
/* set column width */
- gtk_cell_renderer_get_size (renderer, GTK_WIDGET (entry_view), NULL, NULL, NULL, &toggle_width, NULL);
+ gtk_cell_renderer_get_preferred_width (renderer, GTK_WIDGET (entry_view), NULL, &toggle_width);
gtk_tree_view_column_set_sizing (extract, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (extract, toggle_width + 10);
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c b/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
index 14ff193..70dc57b 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
@@ -1708,11 +1708,11 @@ list_table_size_allocate_cb (GtkWidget *table,
/* find the desired width of the widest child */
child_width = 1;
for (i = children; i != NULL; i = i->next) {
- GtkRequisition child_requisition;
+ int min_width;
- gtk_widget_size_request (i->data, &child_requisition);
- if (child_requisition.width > child_width) {
- child_width = child_requisition.width;
+ gtk_widget_get_preferred_width (i->data, &min_width, NULL);
+ if (min_width > child_width) {
+ child_width = min_width;
}
}
diff --git a/plugins/fmradio/rb-fm-radio-source.c b/plugins/fmradio/rb-fm-radio-source.c
index 1df9c8e..2dad6a2 100644
--- a/plugins/fmradio/rb-fm-radio-source.c
+++ b/plugins/fmradio/rb-fm-radio-source.c
@@ -369,7 +369,7 @@ rb_fm_radio_source_cmd_new_station (GtkAction *action, RBFMRadioSource *self)
G_CALLBACK (new_station_location_added),
self, 0);
gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_object_destroy (GTK_OBJECT (dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
diff --git a/plugins/visualizer/rb-vis-widget.c b/plugins/visualizer/rb-vis-widget.c
index 7ad8730..5018ea6 100644
--- a/plugins/visualizer/rb-vis-widget.c
+++ b/plugins/visualizer/rb-vis-widget.c
@@ -79,10 +79,9 @@ rb_vis_widget_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK;
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@@ -125,8 +124,7 @@ rb_vis_widget_size_allocate (GtkWidget *widget,
}
static gboolean
-rb_vis_widget_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
+rb_vis_widget_draw (GtkWidget *widget, cairo_t *cr)
{
GdkWindow *window;
RBVisWidget *rbvw = RB_VIS_WIDGET (widget);
@@ -239,7 +237,7 @@ rb_vis_widget_class_init (RBVisWidgetClass *klass)
widget_class->size_allocate = rb_vis_widget_size_allocate;
widget_class->realize = rb_vis_widget_realize;
- widget_class->expose_event = rb_vis_widget_expose_event;
+ widget_class->draw = rb_vis_widget_draw;
widget_class->hide = rb_vis_widget_hide;
widget_class->show = rb_vis_widget_show;
diff --git a/plugins/visualizer/rb-visualizer-plugin.c b/plugins/visualizer/rb-visualizer-plugin.c
index 6f9b57e..16dab05 100644
--- a/plugins/visualizer/rb-visualizer-plugin.c
+++ b/plugins/visualizer/rb-visualizer-plugin.c
@@ -916,7 +916,7 @@ rb_visualizer_plugin_key_release_cb (GtkWidget *vis_widget,
GdkEventKey *event,
RBVisualizerPlugin *plugin)
{
- if (event->keyval != GDK_Escape)
+ if (event->keyval != GDK_KEY_Escape)
return FALSE;
switch (plugin->mode) {
@@ -976,22 +976,22 @@ static void
vis_window_size_request_cb (GtkWidget *widget, GtkRequisition *req, RBVisualizerPlugin *plugin)
{
int quality;
+ int control_width;
float ratio;
- GtkRequisition control_req;
rb_debug ("handling size-request for vis window");
quality = eel_gconf_get_integer (CONF_VIS_QUALITY);
- gtk_widget_size_request (plugin->control_widget, &control_req);
+ gtk_widget_get_preferred_width (plugin->control_widget, &control_width, NULL);
req->width = vis_quality[quality].width;
req->height = vis_quality[quality].height;
ratio = ((float)vis_quality[quality].height) / ((float)vis_quality[quality].width);
- if ((req->width < control_req.width) || (req->height < (control_req.width * ratio))) {
- req->width = control_req.width;
- req->height = control_req.width * ratio;
+ if ((req->width < control_width) || (req->height < (control_width * ratio))) {
+ req->width = control_width;
+ req->height = control_width * ratio;
}
g_signal_handler_disconnect (plugin->vis_window, plugin->vis_window_size_request_id);
@@ -1003,7 +1003,7 @@ resize_vis_window (RBVisualizerPlugin *plugin, int quality, gboolean resize_down
{
int width;
int height;
- GtkRequisition req;
+ int control_width;
float ratio;
gboolean update = FALSE;
@@ -1030,7 +1030,7 @@ resize_vis_window (RBVisualizerPlugin *plugin, int quality, gboolean resize_down
ratio = ((float)vis_quality[quality].height) / ((float)vis_quality[quality].width);
gtk_window_get_size (GTK_WINDOW (plugin->vis_window), &width, &height);
- gtk_widget_size_request (plugin->control_widget, &req);
+ gtk_widget_get_preferred_width (plugin->control_widget, &control_width, NULL);
if (width < vis_quality[quality].width && height < vis_quality[quality].height) {
rb_debug ("resizing output window: [%d,%d] < [%d,%d]",
@@ -1056,15 +1056,15 @@ resize_vis_window (RBVisualizerPlugin *plugin, int quality, gboolean resize_down
}
}
- if (width < req.width) {
- rb_debug ("resizing output window %d < %d", width, req.width);
- width = req.width;
+ if (width < control_width) {
+ rb_debug ("resizing output window %d < %d", width, control_width);
+ width = control_width;
update = TRUE;
}
- if (height < (req.width * ratio)) {
+ if (height < (control_width * ratio)) {
rb_debug ("resizing output window: %d < %d (ratio %f)",
- height, (int)(req.width * ratio), ratio);
- height = (int)(req.width * ratio);
+ height, (int)(control_width * ratio), ratio);
+ height = (int)(control_width * ratio);
update = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]