summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-01-13 17:39:10 +0100
committerBenjamin Otte <otte@redhat.com>2013-01-13 23:47:40 +0100
commit6088f59b5e031fbec1a7bb38a78b1c365cea9103 (patch)
treeb97de08f0fc40ef4926e3c2e95523b39e0374de2
parentbc907c14719d3560b9e1c2ef0b374ff0155e46ea (diff)
downloadgtk+-6088f59b5e031fbec1a7bb38a78b1c365cea9103.tar.gz
a11y: Use notify of "value" instead of adjustment
Makes the code much smaller and has the same effect.
-rw-r--r--gtk/a11y/gtkscalebuttonaccessible.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/gtk/a11y/gtkscalebuttonaccessible.c b/gtk/a11y/gtkscalebuttonaccessible.c
index 7e9253d018..6003393f93 100644
--- a/gtk/a11y/gtkscalebuttonaccessible.c
+++ b/gtk/a11y/gtkscalebuttonaccessible.c
@@ -31,27 +31,11 @@ G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible,
G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init));
static void
-gtk_scale_button_accessible_value_changed (GtkAdjustment *adjustment,
- gpointer data)
-{
- g_object_notify (G_OBJECT (data), "accessible-value");
-}
-
-static void
gtk_scale_button_accessible_initialize (AtkObject *obj,
gpointer data)
{
- GtkAdjustment *adjustment;
-
ATK_OBJECT_CLASS (gtk_scale_button_accessible_parent_class)->initialize (obj, data);
- adjustment = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (data));
- if (adjustment)
- g_signal_connect (adjustment,
- "value-changed",
- G_CALLBACK (gtk_scale_button_accessible_value_changed),
- obj);
-
obj->role = ATK_ROLE_SLIDER;
}
@@ -60,21 +44,13 @@ gtk_scale_button_accessible_notify_gtk (GObject *obj,
GParamSpec *pspec)
{
GtkScaleButton *scale_button;
- GtkScaleButtonAccessible *accessible;
+ AtkObject *accessible;
scale_button = GTK_SCALE_BUTTON (obj);
- accessible = GTK_SCALE_BUTTON_ACCESSIBLE (gtk_widget_get_accessible (GTK_WIDGET (scale_button)));
+ accessible = gtk_widget_get_accessible (GTK_WIDGET (scale_button));
- if (strcmp (pspec->name, "adjustment") == 0)
- {
- GtkAdjustment* adjustment;
-
- adjustment = gtk_scale_button_get_adjustment (scale_button);
- g_signal_connect (adjustment,
- "value-changed",
- G_CALLBACK (gtk_scale_button_accessible_value_changed),
- accessible);
- }
+ if (strcmp (pspec->name, "value") == 0)
+ g_object_notify (G_OBJECT (accessible), "accessible-value");
else
{
GTK_WIDGET_ACCESSIBLE_CLASS (gtk_scale_button_accessible_parent_class)->notify_gtk (obj, pspec);