Commit b9a1cb74 authored by Emmanuele Bassi's avatar Emmanuele Bassi
Browse files

a11y: Add API to retrieve accessible values

We are going to use this for implementing ATContext subclasses, but also
in the testing API.
parent dc1c1e8a
......@@ -452,6 +452,24 @@ gtk_at_context_has_accessible_state (GtkATContext *self,
return gtk_accessible_attribute_set_contains (self->states, state);
}
/*< private >
* gtk_at_context_get_accessible_state:
* @self: a #GtkATContext
* @state: a #GtkAccessibleState
*
* Retrieves the value for the accessible state of a #GtkATContext.
*
* Returns: (transfer none): the value for the given state
*/
GtkAccessibleValue *
gtk_at_context_get_accessible_state (GtkATContext *self,
GtkAccessibleState state)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
return gtk_accessible_attribute_set_get_value (self->states, state);
}
/*< private >
* gtk_at_context_set_accessible_property:
* @self: a #GtkATContext
......@@ -496,6 +514,24 @@ gtk_at_context_has_accessible_property (GtkATContext *self,
return gtk_accessible_attribute_set_contains (self->properties, property);
}
/*< private >
* gtk_at_context_get_accessible_property:
* @self: a #GtkATContext
* @property: a #GtkAccessibleProperty
*
* Retrieves the value for the accessible property of a #GtkATContext.
*
* Returns: (transfer none): the value for the given property
*/
GtkAccessibleValue *
gtk_at_context_get_accessible_property (GtkATContext *self,
GtkAccessibleProperty property)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
return gtk_accessible_attribute_set_get_value (self->properties, property);
}
/*< private >
* gtk_at_context_set_accessible_relation:
* @self: a #GtkATContext
......@@ -539,3 +575,21 @@ gtk_at_context_has_accessible_relation (GtkATContext *self,
return gtk_accessible_attribute_set_contains (self->relations, relation);
}
/*< private >
* gtk_at_context_get_accessible_relation:
* @self: a #GtkATContext
* @relation: a #GtkAccessibleRelation
*
* Retrieves the value for the accessible relation of a #GtkATContext.
*
* Returns: (transfer none): the value for the given relation
*/
GtkAccessibleValue *
gtk_at_context_get_accessible_relation (GtkATContext *self,
GtkAccessibleRelation relation)
{
g_return_val_if_fail (GTK_IS_AT_CONTEXT (self), NULL);
return gtk_accessible_attribute_set_get_value (self->relations, relation);
}
......@@ -105,26 +105,32 @@ struct _GtkATContextClass
GtkAccessibleAttributeSet *relations);
};
GtkATContext * gtk_at_context_create (GtkAccessibleRole accessible_role,
GtkAccessible *accessible);
void gtk_at_context_update (GtkATContext *self);
void gtk_at_context_set_accessible_state (GtkATContext *self,
GtkAccessibleState state,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_state (GtkATContext *self,
GtkAccessibleState state);
void gtk_at_context_set_accessible_property (GtkATContext *self,
GtkAccessibleProperty property,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_property (GtkATContext *self,
GtkAccessibleProperty property);
void gtk_at_context_set_accessible_relation (GtkATContext *self,
GtkAccessibleRelation property,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_relation (GtkATContext *self,
GtkAccessibleRelation relation);
GtkATContext * gtk_at_context_create (GtkAccessibleRole accessible_role,
GtkAccessible *accessible);
void gtk_at_context_update (GtkATContext *self);
void gtk_at_context_set_accessible_state (GtkATContext *self,
GtkAccessibleState state,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_state (GtkATContext *self,
GtkAccessibleState state);
GtkAccessibleValue * gtk_at_context_get_accessible_state (GtkATContext *self,
GtkAccessibleState state);
void gtk_at_context_set_accessible_property (GtkATContext *self,
GtkAccessibleProperty property,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_property (GtkATContext *self,
GtkAccessibleProperty property);
GtkAccessibleValue * gtk_at_context_get_accessible_property (GtkATContext *self,
GtkAccessibleProperty property);
void gtk_at_context_set_accessible_relation (GtkATContext *self,
GtkAccessibleRelation property,
GtkAccessibleValue *value);
gboolean gtk_at_context_has_accessible_relation (GtkATContext *self,
GtkAccessibleRelation relation);
GtkAccessibleValue * gtk_at_context_get_accessible_relation (GtkATContext *self,
GtkAccessibleRelation relation);
const char * gtk_accessible_property_get_attribute_name (GtkAccessibleProperty property);
const char * gtk_accessible_relation_get_attribute_name (GtkAccessibleRelation relation);
......
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