* Every accessible implementation is part of a tree of accessible objects.
* Normally, this tree corresponds to the widget tree, but can be customized
* by reimplementing the [vfunc@Gtk.Accessible.get_accessible_parent],
- * [vfunc@Gtk.Accessible.get_first_accessible_child] and [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions.
+ * [vfunc@Gtk.Accessible.get_first_accessible_child] and
+ * [vfunc@Gtk.Accessible.get_next_accessible_sibling] virtual functions.
* Note that you can not create a top-level accessible object as of now,
* which means that you must always have a parent accessible object.
*/
return GTK_ACCESSIBLE_GET_IFACE (self)->get_at_context (self);
}
-/*
+/**
* gtk_accessible_get_accessible_parent:
* @self: a `GtkAccessible`
*
- * Retrieves the parent `GtkAccessible` for the given `GtkAccessible`.
+ * Retrieves the accessible accessible for an accessible object
+ *
+ * This function returns `NULL` for top level widgets
+ *
+ * Returns: (transfer none) (nullable): the accessible parent
*
- * Returns: (transfer none): the parent `GtkAccessible`, which can not be %NULL
+ * Since: 4.10
*/
GtkAccessible *
gtk_accessible_get_accessible_parent (GtkAccessible *self)
return GTK_ACCESSIBLE_GET_IFACE (self)->get_accessible_parent (self);
}
-
/**
* gtk_accessible_get_first_accessible_child:
- * @self: a `GtkAccessible`
+ * @self: an accessible object
*
- * Retrieves the first child `GtkAccessible` for this `GtkAccessible`.
+ * Retrieves the first accessible child of an accessible object.
*
- * Returns: (transfer none) (nullable): the first `GtkAccessible` child of @self, if @self has accessible children, %NULL otherwise
+ * Returns: (transfer none) (nullable): the first accessible child
*
* since: 4.10
*/
/**
* gtk_accessible_get_next_accessible_sibling:
- * @self: a `GtkAccessible`
+ * @self: an accessible object
*
- * Retrieves the next `GtkAccessible` sibling of this `GtkAccessible`.
+ * Retrieves the next accessible sibling of an accessible object
*
- * Returns: (transfer none) (nullable): the next `GtkAccessible` sibling of @self, if @self has a next sibling, %NULL otherwise
+ * Returns: (transfer none) (nullable): the next accessible sibling
*
* since: 4.10
*/
}
/**
- * gtk_accessible_get_accessible_role: (attributes org.gtk.Method.get_property=accessible-role)
- * @self: a `GtkAccessible`
+ * gtk_accessible_get_accessible_role:
+ * @self: an accessible object
*
- * Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`.
+ * Retrieves the accessible role of an accessible object.
*
- * Returns: a `GtkAccessibleRole`
+ * Returns: the accessible role
*/
GtkAccessibleRole
gtk_accessible_get_accessible_role (GtkAccessible *self)
* state change must be communicated to assistive technologies.
*
* Example:
+ *
* ```c
* value = GTK_ACCESSIBLE_TRISTATE_MIXED;
* gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
return FALSE;
}
-/*<private>
+/*< private >
* gtk_accessible_platform_changed:
* @self: a `GtkAccessible`
* @change: the platform state change to report
* child widget, as is the case for `GtkText` wrappers.
*
* Returns: the value of @state for the accessible
+ *
+ * Since: 4.10
*/
gboolean
gtk_accessible_get_platform_state (GtkAccessible *self,
GtkAccessiblePlatformState state)
{
+ g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), FALSE);
+
return GTK_ACCESSIBLE_GET_IFACE (self)->get_platform_state (self, state);
}
-/**< private >
+/*< private >
* gtk_accessible_bounds_changed:
* @self: a `GtkAccessible`
*
gtk_at_context_bounds_changed (context);
}
-/*
+/**
* gtk_accessible_get_bounds:
* @self: a `GtkAccessible`
* @x: (out): the x coordinate of the top left corner of the accessible
int *width,
int *height)
{
+ g_return_val_if_fail (GTK_IS_ACCESSIBLE (self), FALSE);
+ g_return_val_if_fail (x != NULL && y != NULL, FALSE);
+ g_return_val_if_fail (width != NULL && height != NULL, FALSE);
+
return GTK_ACCESSIBLE_GET_IFACE (self)->get_bounds (self, x, y, width, height);
}
-/*<private>
+/*< private >
* gtk_accessible_should_present:
* @self: a `GtkAccessible`
*
* @GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE: whether the accessible can be focused
* @GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED: whether the accessible has focus
* @GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE: whether the accessible is active
- *
+ *
* The various platform states which can be queried
* using [method@Gtk.Accessible.get_platform_state].
*
GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE
} GtkAccessiblePlatformState;
-/** < private >
- * GtkAccessiblePlatformChange:
- * @GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE: whether the accessible has changed
- * its focusable state
- * @GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED: whether the accessible has changed its
- * focused state
- * @GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE: whether the accessible has changed its
- * active state
+/**
+ * GtkAccessibleInterface:
+ * @get_at_context: retrieve the platform-specific accessibility context
+ * for the accessible implementation
+ * @get_platform_state: retrieve the accessible state
+ *
+ * The common interface for accessible objects.
*
- * Represents the various platform changes which can occur and are communicated
- * using [method@Gtk.Accessible.platform_changed].
+ * Since: 4.10
*/
-typedef enum {
- GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE,
- GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED,
- GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE,
-} GtkAccessiblePlatformChange;
-
struct _GtkAccessibleInterface
{
GTypeInterface g_iface;
/**
* GtkAccessibleInterface::get_at_context:
- * @self: a `GtkAccessible`
- *
- * Retrieves the `GtkATContext` for this accessible implementation.
+ * @self: an accessible object
+ *
+ * Retrieves the platform-specific accessibility context for the
+ * accessible implementation.
+ *
+ * Returns: (transfer none) (nullable): the accessibility context
+ *
+ * Since: 4.10
*/
- GtkATContext * (* get_at_context) (GtkAccessible *self);
+ GtkATContext * (* get_at_context) (GtkAccessible *self);
/**
* GtkAccessibleInterface::get_platform_state:
- *
- * @self: A `GtkAccessible`
- * @state: The state to retrieve
- *
- * Returns whether @self has the given platform state.
- * @returns: %true if @state is active for @self.
- * @returns:
+ * @self: an accessible object
+ * @state: the state to query
+ *
+ * Checks if the given @state applies to the accessible object.
+ *
+ * Returns: true if the @state is set, and false otherwise
+ *
+ * Since: 4.10
*/
- gboolean (* get_platform_state) (GtkAccessible *self,
- GtkAccessiblePlatformState state);
+ gboolean (* get_platform_state) (GtkAccessible *self,
+ GtkAccessiblePlatformState state);
/**
* GtkAccessibleInterface::get_accessible_parent:
- * @self: a `GtkAccessible`
- *
- * Returns the parent `GtkAccessible` of @self.
- * A return value of %NULL implies that the accessible represents a top-level
- * accessible object, which currently also implies that the accessible
- * represents something which is in the list of top-level widgets.
+ * @self: an accessible object
+ *
+ * Retrieves the accessible parent of an accessible object.
+ *
+ * This virtual function should return `NULL` for top level objects.
+ *
+ * Returns: (nullable) (transfer none): the accessible parent
+ *
+ * Since: 4.10
*/
- GtkAccessible * (* get_accessible_parent) (GtkAccessible *self);
-
+ GtkAccessible * (* get_accessible_parent) (GtkAccessible *self);
+
/**
* GtkaccessibleInterface::get_first_accessible_child:
- * @self: a `GtkAccessible`
- *
- * Returns the first accessible child of @self, or %NULL if @self has none
+ * @self: an accessible object
+ *
+ * Retrieves the first accessible child of an accessible object.
+ *
+ * Returns: (transfer none) (nullable): an accessible object
+ *
+ * Since: 4.10
*/
- GtkAccessible * (* get_first_accessible_child) (GtkAccessible *self);
-
+ GtkAccessible * (* get_first_accessible_child) (GtkAccessible *self);
/**
* GtkaccessibleInterface::get_next_accessible_sibling:
- * @self: a `GtkAccessible`
- *
- * Returns the next accessible sibling of @self, or %NULL if @self has none
+ * @self: an accessible object
+ *
+ * Retrieves the next accessible sibling of an accessible object.
+ *
+ * Returns: (transfer none) (nullable): an accessible object
+ *
+ * Since: 4.10
*/
- GtkAccessible * (* get_next_accessible_sibling) (GtkAccessible *self);
+ GtkAccessible * (* get_next_accessible_sibling) (GtkAccessible *self);
/**
* GtkAccessibleInterface::get_bounds:
- * @self: a `GtkAccessible`
- * @x: an addres of the x coordinate
- * @y: an address of the y coordinate
- * @width: address of the width
- * @height: address of the height
- *
- * Returns the dimensions and position of @self, if this information
- * can be determined.
- * @returns: %true if the values are valid, %false otherwise
+ * @self: an accessible object
+ * @x: (out): the horizontal coordinate of a rectangle
+ * @y: (out): the vertical coordinate of a rectangle
+ * @width: (out): the width of a rectangle
+ * @height: (out): the height of a rectangle
+ *
+ * Retrieves the dimensions and position of an accessible object in its
+ * parent's coordinate space, if those values can be determined.
+ *
+ * For top level accessible objects, the X and Y coordinates are always
+ * going to be set to zero.
+ *
+ * Returns: true if the values are value, and false otherwise
*/
- gboolean (* get_bounds) (GtkAccessible *self, int *x, int *y,
- int *width, int *height);
+ gboolean (* get_bounds) (GtkAccessible *self,
+ int *x,
+ int *y,
+ int *width,
+ int *height);
};
GDK_AVAILABLE_IN_ALL
GtkATContext * gtk_accessible_get_at_context (GtkAccessible *self);
GDK_AVAILABLE_IN_4_10
-gboolean gtk_accessible_get_platform_state (GtkAccessible *self,
- GtkAccessiblePlatformState state);
+gboolean gtk_accessible_get_platform_state (GtkAccessible *self,
+ GtkAccessiblePlatformState state);
GDK_AVAILABLE_IN_4_10
-GtkAccessible * gtk_accessible_get_accessible_parent(GtkAccessible *self);
+GtkAccessible * gtk_accessible_get_accessible_parent (GtkAccessible *self);
GDK_AVAILABLE_IN_4_10
-GtkAccessible * gtk_accessible_get_first_accessible_child(GtkAccessible *self);
+GtkAccessible * gtk_accessible_get_first_accessible_child (GtkAccessible *self);
GDK_AVAILABLE_IN_4_10
-GtkAccessible * gtk_accessible_get_next_accessible_sibling(GtkAccessible *self);
+GtkAccessible * gtk_accessible_get_next_accessible_sibling (GtkAccessible *self);
GDK_AVAILABLE_IN_4_10
-gboolean gtk_accessible_get_bounds (GtkAccessible *self, int *x, int *y, int *width, int *height);
+gboolean gtk_accessible_get_bounds (GtkAccessible *self,
+ int *x,
+ int *y,
+ int *width,
+ int *height);
GDK_AVAILABLE_IN_ALL
-GtkAccessibleRole gtk_accessible_get_accessible_role (GtkAccessible *self);
+GtkAccessibleRole gtk_accessible_get_accessible_role (GtkAccessible *self);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_state (GtkAccessible *self,
- GtkAccessibleState first_state,
- ...);
+void gtk_accessible_update_state (GtkAccessible *self,
+ GtkAccessibleState first_state,
+ ...);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_property (GtkAccessible *self,
- GtkAccessibleProperty first_property,
- ...);
+void gtk_accessible_update_property (GtkAccessible *self,
+ GtkAccessibleProperty first_property,
+ ...);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_relation (GtkAccessible *self,
- GtkAccessibleRelation first_relation,
- ...);
+void gtk_accessible_update_relation (GtkAccessible *self,
+ GtkAccessibleRelation first_relation,
+ ...);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_state_value (GtkAccessible *self,
- int n_states,
- GtkAccessibleState states[],
- const GValue values[]);
+void gtk_accessible_update_state_value (GtkAccessible *self,
+ int n_states,
+ GtkAccessibleState states[],
+ const GValue values[]);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_property_value (GtkAccessible *self,
- int n_properties,
- GtkAccessibleProperty properties[],
- const GValue values[]);
+void gtk_accessible_update_property_value (GtkAccessible *self,
+ int n_properties,
+ GtkAccessibleProperty properties[],
+ const GValue values[]);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_update_relation_value (GtkAccessible *self,
- int n_relations,
- GtkAccessibleRelation relations[],
- const GValue values[]);
-
+void gtk_accessible_update_relation_value (GtkAccessible *self,
+ int n_relations,
+ GtkAccessibleRelation relations[],
+ const GValue values[]);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_reset_state (GtkAccessible *self,
- GtkAccessibleState state);
+void gtk_accessible_reset_state (GtkAccessible *self,
+ GtkAccessibleState state);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_reset_property (GtkAccessible *self,
- GtkAccessibleProperty property);
+void gtk_accessible_reset_property (GtkAccessible *self,
+ GtkAccessibleProperty property);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_reset_relation (GtkAccessible *self,
- GtkAccessibleRelation relation);
+void gtk_accessible_reset_relation (GtkAccessible *self,
+ GtkAccessibleRelation relation);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_state_init_value (GtkAccessibleState state,
- GValue *value);
+void gtk_accessible_state_init_value (GtkAccessibleState state,
+ GValue *value);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_property_init_value (GtkAccessibleProperty property,
- GValue *value);
+void gtk_accessible_property_init_value (GtkAccessibleProperty property,
+ GValue *value);
GDK_AVAILABLE_IN_ALL
-void gtk_accessible_relation_init_value (GtkAccessibleRelation relation,
- GValue *value);
+void gtk_accessible_relation_init_value (GtkAccessibleRelation relation,
+ GValue *value);
G_END_DECLS