summaryrefslogtreecommitdiff
path: root/gtk/gtkaccessible.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-12-18 16:41:06 +0100
committerBenjamin Otte <otte@redhat.com>2011-12-19 16:17:12 +0100
commit075cc5dd3654fafeb0bc77a9fe9aaee072e5363e (patch)
tree9173d06b855fee1680d5c94ce11debeb1d619621 /gtk/gtkaccessible.c
parent1305815bde9be3a2571ddd568911892f71b108b3 (diff)
downloadgtk+-075cc5dd3654fafeb0bc77a9fe9aaee072e5363e.tar.gz
accesible: Manage the DEFUNCT state
A GtkAccessible with a NULL widget is defunct, there's no way around it.
Diffstat (limited to 'gtk/gtkaccessible.c')
-rw-r--r--gtk/gtkaccessible.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c
index a84eddf033..bcd6cbb625 100644
--- a/gtk/gtkaccessible.c
+++ b/gtk/gtkaccessible.c
@@ -103,25 +103,43 @@ gtk_accessible_init (GtkAccessible *accessible)
GtkAccessiblePrivate);
}
+static AtkStateSet *
+gtk_accessible_ref_state_set (AtkObject *object)
+{
+ GtkAccessible *accessible = GTK_ACCESSIBLE (object);
+ AtkStateSet *state_set;
+
+ state_set = ATK_OBJECT_CLASS (gtk_accessible_parent_class)->ref_state_set (object);
+
+ if (accessible->priv->widget == NULL)
+ atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
+
+ return state_set;
+}
+
static void
gtk_accessible_real_widget_set (GtkAccessible *accessible)
{
+ atk_object_notify_state_change (ATK_OBJECT (accessible), ATK_STATE_DEFUNCT, FALSE);
}
static void
gtk_accessible_real_widget_unset (GtkAccessible *accessible)
{
+ atk_object_notify_state_change (ATK_OBJECT (accessible), ATK_STATE_DEFUNCT, TRUE);
}
static void
gtk_accessible_class_init (GtkAccessibleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ AtkObjectClass *atkobject_class = ATK_OBJECT_CLASS (klass);
klass->connect_widget_destroyed = gtk_accessible_real_connect_widget_destroyed;
klass->widget_set = gtk_accessible_real_widget_set;
klass->widget_unset = gtk_accessible_real_widget_unset;
+ atkobject_class->ref_state_set = gtk_accessible_ref_state_set;
gobject_class->get_property = gtk_accessible_get_property;
gobject_class->set_property = gtk_accessible_set_property;