[dia] [gtk-deprecated] Use gtk_adjustment_*() accessors
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [gtk-deprecated] Use gtk_adjustment_*() accessors
- Date: Sun, 19 Aug 2012 17:37:31 +0000 (UTC)
commit a5f51cafc77be574c7436eb5a959ac8573255047
Author: Hans Breuer <hans breuer org>
Date: Mon Jul 30 20:44:01 2012 +0200
[gtk-deprecated] Use gtk_adjustment_*() accessors
app/diapagelayout.c | 12 ++++++++----
app/disp_callbacks.c | 4 ++--
app/display.c | 24 ++++++++++++------------
app/interface.c | 6 +++---
4 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/app/diapagelayout.c b/app/diapagelayout.c
index 75b905c..a463dc8 100644
--- a/app/diapagelayout.c
+++ b/app/diapagelayout.c
@@ -469,14 +469,17 @@ dia_page_layout_set_fitto(DiaPageLayout *self, gboolean fitto)
gfloat
dia_page_layout_get_scaling(DiaPageLayout *self)
{
- return GTK_SPIN_BUTTON(self->scaling)->adjustment->value / 100.0;
+ GtkAdjustment *adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(self->scaling));
+
+ return gtk_adjustment_get_value (adj) / 100.0;
}
void
dia_page_layout_set_scaling(DiaPageLayout *self, gfloat scaling)
{
- GTK_SPIN_BUTTON(self->scaling)->adjustment->value = scaling * 100.0;
- gtk_adjustment_value_changed(GTK_SPIN_BUTTON(self->scaling)->adjustment);
+ GtkAdjustment *adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(self->scaling));
+
+ gtk_adjustment_set_value (adj, scaling * 100.0);
}
void
@@ -506,6 +509,7 @@ dia_page_layout_get_effective_area(DiaPageLayout *self, gfloat *width,
gfloat *height)
{
gfloat h, w, scaling;
+ GtkAdjustment *adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(self->scaling));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(self->orient_portrait))) {
w = get_paper_pswidth(self->papernum);
@@ -522,7 +526,7 @@ dia_page_layout_get_effective_area(DiaPageLayout *self, gfloat *width,
g_return_if_fail (w > 0.0);
w -= dia_unit_spinner_get_value(DIA_UNIT_SPINNER(self->rmargin));
g_return_if_fail (w > 0.0);
- scaling = GTK_SPIN_BUTTON(self->scaling)->adjustment->value / 100.0;
+ scaling = gtk_adjustment_get_value (adj) / 100.0;
h /= scaling;
w /= scaling;
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 46f0e45..273c131 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -968,7 +968,7 @@ gint
ddisplay_hsb_update (GtkAdjustment *adjustment,
DDisplay *ddisp)
{
- ddisplay_set_origo(ddisp, adjustment->value, ddisp->origo.y);
+ ddisplay_set_origo(ddisp, gtk_adjustment_get_value (adjustment), ddisp->origo.y);
ddisplay_add_update_all(ddisp);
ddisplay_flush(ddisp);
return FALSE;
@@ -978,7 +978,7 @@ gint
ddisplay_vsb_update (GtkAdjustment *adjustment,
DDisplay *ddisp)
{
- ddisplay_set_origo(ddisp, ddisp->origo.x, adjustment->value);
+ ddisplay_set_origo(ddisp, ddisp->origo.x, gtk_adjustment_get_value (adjustment));
ddisplay_add_update_all(ddisp);
ddisplay_flush(ddisp);
return FALSE;
diff --git a/app/display.c b/app/display.c
index 5a3e531..513c83e 100644
--- a/app/display.c
+++ b/app/display.c
@@ -718,25 +718,25 @@ ddisplay_update_scrollbars(DDisplay *ddisp)
hsbdata = ddisp->hsbdata;
/* Horizontal: */
- hsbdata->lower = MIN(extents->left, visible->left);
- hsbdata->upper = MAX(extents->right, visible->right);
- hsbdata->page_size = visible->right - visible->left - 0.0001;
+ gtk_adjustment_set_lower (hsbdata, MIN(extents->left, visible->left));
+ gtk_adjustment_set_upper (hsbdata, MAX(extents->right, visible->right));
+ gtk_adjustment_set_page_size (hsbdata, visible->right - visible->left - 0.0001);
/* remove some to fix strange behaviour in gtk_range_adjustment_changed */
- hsbdata->page_increment = (visible->right - visible->left) / 2.0;
- hsbdata->step_increment = (visible->right - visible->left) / 10.0;
- hsbdata->value = visible->left;
+ gtk_adjustment_set_page_increment (hsbdata, (visible->right - visible->left) / 2.0);
+ gtk_adjustment_set_step_increment (hsbdata, (visible->right - visible->left) / 10.0);
+ gtk_adjustment_set_value (hsbdata, visible->left);
g_signal_emit_by_name (G_OBJECT (ddisp->hsbdata), "changed");
/* Vertical: */
vsbdata = ddisp->vsbdata;
- vsbdata->lower = MIN(extents->top, visible->top);
- vsbdata->upper = MAX(extents->bottom, visible->bottom);
- vsbdata->page_size = visible->bottom - visible->top - 0.00001;
+ gtk_adjustment_set_lower (vsbdata, MIN(extents->top, visible->top));
+ gtk_adjustment_set_upper (vsbdata, MAX(extents->bottom, visible->bottom));
+ gtk_adjustment_set_page_size (vsbdata, visible->bottom - visible->top - 0.00001);
/* remove some to fix strange behaviour in gtk_range_adjustment_changed */
- vsbdata->page_increment = (visible->bottom - visible->top) / 2.0;
- vsbdata->step_increment = (visible->bottom - visible->top) / 10.0;
- vsbdata->value = visible->top;
+ gtk_adjustment_set_page_increment (vsbdata, (visible->bottom - visible->top) / 2.0);
+ gtk_adjustment_set_step_increment (vsbdata, (visible->bottom - visible->top) / 10.0);
+ gtk_adjustment_set_value (vsbdata, visible->top);
g_signal_emit_by_name (G_OBJECT (ddisp->vsbdata), "changed");
}
diff --git a/app/interface.c b/app/interface.c
index e6e7141..119de77 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -819,9 +819,9 @@ create_display_shell(DDisplay *ddisp,
width = ddisp->hrule->allocation.width;
- ddisp->hsbdata->upper = width;
- ddisp->hsbdata->page_increment = (width - 1) / 4;
- ddisp->hsbdata->page_size = width - 1;
+ gtk_adjustment_set_upper (ddisp->hsbdata, width);
+ gtk_adjustment_set_page_increment (ddisp->hsbdata, (width - 1) / 4);
+ gtk_adjustment_set_page_size (ddisp->hsbdata, width - 1);
gtk_adjustment_changed (GTK_ADJUSTMENT(ddisp->hsbdata));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]