Commit 98affc68 authored by Matthias Clasen's avatar Matthias Clasen

GtkPaned: Implement new AtkValue interface

The AtkValue interface has been replaced in ATK 2.12.
Implement the new one in addition to the old one.
parent 987cce9e
......@@ -142,6 +142,51 @@ gtk_paned_accessible_set_current_value (AtkValue *obj,
return FALSE;
}
static void
gtk_paned_accessible_get_value_and_text (AtkValue *obj,
gdouble *value,
gchar **text)
{
GtkWidget *widget;
GtkPaned *paned;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
paned = GTK_PANED (widget);
*value = gtk_paned_get_position (paned);
*text = NULL;
}
static AtkRange *
gtk_paned_accessible_get_range (AtkValue *obj)
{
GtkWidget *widget;
gint minimum_value;
gint maximum_value;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
g_object_get (widget,
"min-position", &minimum_value,
"max-position", &maximum_value,
NULL);
return atk_range_new (minimum_value, maximum_value, NULL);
}
static void
gtk_paned_accessible_set_value (AtkValue *obj,
const gdouble value)
{
GtkWidget *widget;
GtkPaned *paned;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
paned = GTK_PANED (widget);
gtk_paned_set_position (paned, (gint)(value + 0.5));
}
static void
atk_value_interface_init (AtkValueIface *iface)
{
......@@ -149,4 +194,8 @@ atk_value_interface_init (AtkValueIface *iface)
iface->get_maximum_value = gtk_paned_accessible_get_maximum_value;
iface->get_minimum_value = gtk_paned_accessible_get_minimum_value;
iface->set_current_value = gtk_paned_accessible_set_current_value;
iface->get_value_and_text = gtk_paned_accessible_get_value_and_text;
iface->get_range = gtk_paned_accessible_get_range;
iface->set_value = gtk_paned_accessible_set_value;
}
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