Commit ecc329fa authored by Matthias Clasen's avatar Matthias Clasen
Browse files

a11y: Add change notification to GtkATContext

Emit a ::state-change signal when state changes;
this was already a vfunc, but we want to listen
to state changes from the inspector too.
parent 5fc5e52f
......@@ -49,8 +49,17 @@ enum
N_PROPS
};
enum
{
STATE_CHANGE,
LAST_SIGNAL
};
static GParamSpec *obj_props[N_PROPS];
static guint obj_signals[LAST_SIGNAL];
static void
gtk_at_context_finalize (GObject *gobject)
{
......@@ -163,6 +172,17 @@ gtk_at_context_class_init (GtkATContextClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
obj_signals[STATE_CHANGE] =
g_signal_new ("state-change",
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkATContextClass, state_change),
NULL, NULL,
NULL,
G_TYPE_NONE, 6,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);
g_object_class_install_properties (gobject_class, N_PROPS, obj_props);
}
......@@ -399,13 +419,9 @@ gtk_at_context_update (GtkATContext *self)
GtkAccessibleRelationChange changed_relations =
gtk_accessible_attribute_set_get_changed (self->relations);
GTK_AT_CONTEXT_GET_CLASS (self)->state_change (self,
changed_states,
changed_properties,
changed_relations,
self->states,
self->properties,
self->relations);
g_signal_emit (self, obj_signals[STATE_CHANGE], 0,
changed_states, changed_properties, changed_relations,
self->states, self->properties, self->relations);
}
/*< private >
......
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