[gnome-media] gnome-volume-control: compile with GSEAL
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-media] gnome-volume-control: compile with GSEAL
- Date: Mon, 19 Apr 2010 11:54:22 +0000 (UTC)
commit 603d9b5d0827cc66e7c96cf27962b9bed3730582
Author: Marc-André Lureau <marcandre lureau gmail com>
Date: Wed Mar 10 23:25:40 2010 +0000
gnome-volume-control: compile with GSEAL
https://bugzilla.gnome.org/show_bug.cgi?id=612479
gnome-volume-control/src/gvc-balance-bar.c | 9 +++--
gnome-volume-control/src/gvc-channel-bar.c | 2 +-
gnome-volume-control/src/gvc-level-bar.c | 35 ++++++++++++--------
gnome-volume-control/src/gvc-mixer-dialog.c | 2 +-
gnome-volume-control/src/gvc-stream-status-icon.c | 4 +-
5 files changed, 31 insertions(+), 21 deletions(-)
---
diff --git a/gnome-volume-control/src/gvc-balance-bar.c b/gnome-volume-control/src/gvc-balance-bar.c
index 890a8db..6f5c47f 100644
--- a/gnome-volume-control/src/gvc-balance-bar.c
+++ b/gnome-volume-control/src/gvc-balance-bar.c
@@ -85,6 +85,7 @@ _scale_box_new (GvcBalanceBar *bar)
GtkWidget *ebox;
GtkAdjustment *adjustment = bar->priv->adjustment;
char *str_lower, *str_upper;
+ gdouble lower, upper;
bar->priv->scale_box = box = gtk_hbox_new (FALSE, 6);
priv->scale = gtk_hscale_new (priv->adjustment);
@@ -120,16 +121,18 @@ _scale_box_new (GvcBalanceBar *bar)
g_assert_not_reached ();
}
- gtk_scale_add_mark (GTK_SCALE (priv->scale), adjustment->lower,
+ lower = gtk_adjustment_get_lower (adjustment);
+ gtk_scale_add_mark (GTK_SCALE (priv->scale), lower,
GTK_POS_BOTTOM, str_lower);
g_free (str_lower);
- gtk_scale_add_mark (GTK_SCALE (priv->scale), adjustment->upper,
+ upper = gtk_adjustment_get_upper (adjustment);
+ gtk_scale_add_mark (GTK_SCALE (priv->scale), upper,
GTK_POS_BOTTOM, str_upper);
g_free (str_upper);
if (bar->priv->btype != BALANCE_TYPE_LFE) {
gtk_scale_add_mark (GTK_SCALE (priv->scale),
- (adjustment->upper - adjustment->lower)/2 + adjustment->lower,
+ (upper - lower)/2 + lower,
GTK_POS_BOTTOM, NULL);
}
diff --git a/gnome-volume-control/src/gvc-channel-bar.c b/gnome-volume-control/src/gvc-channel-bar.c
index ff3a7ee..74aefe1 100644
--- a/gnome-volume-control/src/gvc-channel-bar.c
+++ b/gnome-volume-control/src/gvc-channel-bar.c
@@ -221,7 +221,7 @@ update_layout (GvcChannelBar *bar)
}
box = bar->priv->scale_box;
- frame = box->parent;
+ frame = gtk_widget_get_parent (box);
g_object_ref (bar->priv->image);
g_object_ref (bar->priv->label);
diff --git a/gnome-volume-control/src/gvc-level-bar.c b/gnome-volume-control/src/gvc-level-bar.c
index 647312f..12e2f1f 100644
--- a/gnome-volume-control/src/gvc-level-bar.c
+++ b/gnome-volume-control/src/gvc-level-bar.c
@@ -167,19 +167,23 @@ bar_calc_layout (GvcLevelBar *bar)
GdkColor color;
int peak_level;
int max_peak_level;
+ GtkAllocation allocation;
+ GtkStyle *style;
- bar->priv->layout.area.width = GTK_WIDGET (bar)->allocation.width - 2;
- bar->priv->layout.area.height = GTK_WIDGET (bar)->allocation.height - 2;
+ gtk_widget_get_allocation (GTK_WIDGET (bar), &allocation);
+ bar->priv->layout.area.width = allocation.width - 2;
+ bar->priv->layout.area.height = allocation.height - 2;
- color = GTK_WIDGET (bar)->style->bg [GTK_STATE_NORMAL];
+ style = gtk_widget_get_style (GTK_WIDGET (bar));
+ color = style->bg [GTK_STATE_NORMAL];
bar->priv->layout.bg_r = (float)color.red / 65535.0;
bar->priv->layout.bg_g = (float)color.green / 65535.0;
bar->priv->layout.bg_b = (float)color.blue / 65535.0;
- color = GTK_WIDGET (bar)->style->dark [GTK_STATE_NORMAL];
+ color = style->dark [GTK_STATE_NORMAL];
bar->priv->layout.bdr_r = (float)color.red / 65535.0;
bar->priv->layout.bdr_g = (float)color.green / 65535.0;
bar->priv->layout.bdr_b = (float)color.blue / 65535.0;
- color = GTK_WIDGET (bar)->style->bg [GTK_STATE_SELECTED];
+ color = style->bg [GTK_STATE_SELECTED];
bar->priv->layout.fl_r = (float)color.red / 65535.0;
bar->priv->layout.fl_g = (float)color.green / 65535.0;
bar->priv->layout.fl_b = (float)color.blue / 65535.0;
@@ -466,14 +470,15 @@ gvc_level_bar_size_allocate (GtkWidget *widget,
/* FIXME: add height property, labels, etc */
GTK_WIDGET_CLASS (gvc_level_bar_parent_class)->size_allocate (widget, allocation);
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
+ gtk_widget_get_allocation (widget, allocation);
if (bar->priv->orientation == GTK_ORIENTATION_VERTICAL) {
- allocation->height = MIN (widget->allocation.height, MIN_VERTICAL_BAR_HEIGHT);
- allocation->width = MAX (widget->allocation.width, VERTICAL_BAR_WIDTH);
+ allocation->height = MIN (allocation->height, MIN_VERTICAL_BAR_HEIGHT);
+ allocation->width = MAX (allocation->width, VERTICAL_BAR_WIDTH);
} else {
- allocation->width = MIN (widget->allocation.width, MIN_HORIZONTAL_BAR_WIDTH);
- allocation->height = MAX (widget->allocation.height, HORIZONTAL_BAR_HEIGHT);
+ allocation->width = MIN (allocation->width, MIN_HORIZONTAL_BAR_WIDTH);
+ allocation->height = MAX (allocation->height, HORIZONTAL_BAR_HEIGHT);
}
bar_calc_layout (bar);
@@ -542,6 +547,7 @@ gvc_level_bar_expose (GtkWidget *widget,
{
GvcLevelBar *bar;
cairo_t *cr;
+ GtkAllocation allocation;
g_return_val_if_fail (GVC_IS_LEVEL_BAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -553,11 +559,12 @@ gvc_level_bar_expose (GtkWidget *widget,
bar = GVC_LEVEL_BAR (widget);
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create (gtk_widget_get_window (widget));
+ gtk_widget_get_allocation (widget, &allocation);
cairo_translate (cr,
- widget->allocation.x,
- widget->allocation.y);
+ allocation.x,
+ allocation.y);
if (bar->priv->orientation == GTK_ORIENTATION_VERTICAL) {
int i;
@@ -714,7 +721,7 @@ gvc_level_bar_init (GvcLevelBar *bar)
G_CALLBACK (on_rms_adjustment_value_changed),
bar);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bar), GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (bar), FALSE);
}
static void
diff --git a/gnome-volume-control/src/gvc-mixer-dialog.c b/gnome-volume-control/src/gvc-mixer-dialog.c
index e21ef9e..a7181ec 100644
--- a/gnome-volume-control/src/gvc-mixer-dialog.c
+++ b/gnome-volume-control/src/gvc-mixer-dialog.c
@@ -1197,7 +1197,7 @@ remove_stream (GvcMixerDialog *dialog,
bar_set_stream (dialog, bar, NULL);
} else if (bar != NULL) {
g_hash_table_remove (dialog->priv->bars, GUINT_TO_POINTER (id));
- gtk_container_remove (GTK_CONTAINER (bar->parent),
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (bar)),
bar);
dialog->priv->num_apps--;
if (dialog->priv->num_apps == 0) {
diff --git a/gnome-volume-control/src/gvc-stream-status-icon.c b/gnome-volume-control/src/gvc-stream-status-icon.c
index 5157c0b..3254a5b 100644
--- a/gnome-volume-control/src/gvc-stream-status-icon.c
+++ b/gnome-volume-control/src/gvc-stream-status-icon.c
@@ -172,7 +172,7 @@ popup_dock (GvcStreamStatusIcon *icon,
/* grab focus */
gtk_grab_add (icon->priv->dock);
- if (gdk_pointer_grab (icon->priv->dock->window, TRUE,
+ if (gdk_pointer_grab (gtk_widget_get_window (icon->priv->dock), TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK, NULL, NULL,
time)
@@ -182,7 +182,7 @@ popup_dock (GvcStreamStatusIcon *icon,
return FALSE;
}
- if (gdk_keyboard_grab (icon->priv->dock->window, TRUE, time) != GDK_GRAB_SUCCESS) {
+ if (gdk_keyboard_grab (gtk_widget_get_window (icon->priv->dock), TRUE, time) != GDK_GRAB_SUCCESS) {
display = gtk_widget_get_display (icon->priv->dock);
gdk_display_pointer_ungrab (display, time);
gtk_grab_remove (icon->priv->dock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]