Commit ff445e2b authored by Javier Jardón's avatar Javier Jardón

Use accessor functions to access GtkRange

parent 27ec5cd5
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment