[gtk+] Use accessor functions to access GtkRange
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use accessor functions to access GtkRange
- Date: Mon, 23 Aug 2010 18:56:37 +0000 (UTC)
commit ff445e2b7976a537b2a13772a919811eac0554c8
Author: Javier Jardón <jjardon gnome org>
Date: Fri Aug 13 02:35:49 2010 +0200
Use accessor functions to access GtkRange
gtk/gtkscrollbar.c | 4 ++--
gtk/gtkscrolledwindow.c | 2 +-
modules/other/gail/gailrange.c | 16 ++++++++++------
3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index a903e87..ce41a23 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -113,8 +113,8 @@ gtk_scrollbar_style_set (GtkWidget *widget,
"has-forward-stepper", &has_d,
NULL);
- range->min_slider_size = slider_length;
- range->slider_size_fixed = fixed_size;
+ gtk_range_set_min_slider_size (range, slider_length);
+ gtk_range_set_slider_size_fixed (range, fixed_size);
_gtk_range_set_steppers (range,
has_a, has_b, has_c, has_d);
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 910b8f5..2e26646 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1529,7 +1529,7 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget,
if (range && gtk_widget_get_visible (range))
{
- GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
+ GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (range));
gdouble delta;
delta = _gtk_range_get_wheel_delta (GTK_RANGE (range), event->direction);
diff --git a/modules/other/gail/gailrange.c b/modules/other/gail/gailrange.c
index 810baf8..a396364 100644
--- a/modules/other/gail/gailrange.c
+++ b/modules/other/gail/gailrange.c
@@ -101,6 +101,7 @@ gail_range_real_initialize (AtkObject *obj,
gpointer data)
{
GailRange *range = GAIL_RANGE (obj);
+ GtkAdjustment *adj;
GtkRange *gtk_range;
ATK_OBJECT_CLASS (gail_range_parent_class)->initialize (obj, data);
@@ -110,10 +111,11 @@ gail_range_real_initialize (AtkObject *obj,
* If a GtkAdjustment already exists for the GtkRange,
* create the GailAdjustment
*/
- if (gtk_range->adjustment)
+ adj = gtk_range_get_adjustment (gtk_range);
+ if (adj)
{
- range->adjustment = gail_adjustment_new (gtk_range->adjustment);
- g_signal_connect (gtk_range->adjustment,
+ range->adjustment = gail_adjustment_new (adj);
+ g_signal_connect (adj,
"value-changed",
G_CALLBACK (gail_range_value_changed),
range);
@@ -147,7 +149,7 @@ gail_range_ref_state_set (AtkObject *obj)
* We do not generate property change for orientation change as there
* is no interface to change the orientation which emits a notification
*/
- if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) == GTK_ORIENTATION_HORIZONTAL)
atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
else
atk_state_set_add_state (state_set, ATK_STATE_VERTICAL);
@@ -298,6 +300,7 @@ static void
gail_range_real_notify_gtk (GObject *obj,
GParamSpec *pspec)
{
+ GtkAdjustment *adj;
GtkWidget *widget = GTK_WIDGET (obj);
GailRange *range = GAIL_RANGE (gtk_widget_get_accessible (widget));
@@ -316,8 +319,9 @@ gail_range_real_notify_gtk (GObject *obj,
* Create the GailAdjustment when notify for "adjustment" property
* is received
*/
- range->adjustment = gail_adjustment_new (GTK_RANGE (widget)->adjustment);
- g_signal_connect (GTK_RANGE (widget)->adjustment,
+ adj = gtk_range_get_adjustment (GTK_RANGE (widget));
+ range->adjustment = gail_adjustment_new (adj);
+ g_signal_connect (adj,
"value-changed",
G_CALLBACK (gail_range_value_changed),
range);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]