An interface for describing UI elements for Assistive Technologies.
Every accessible implementation has:
a "role", represented by a value of the [enumGtk.AccessibleRole]
enumeration - "attributes", represented by a set of [enumGtk.AccessibleState], [enumGtk.AccessibleProperty] and [enumGtk.AccessibleRelation] values
The role cannot be changed after instantiating a GtkAccessible implementation.
The attributes are updated every time a UI element's state changes in a way that should be reflected by assistive technologies. For instance, if a GtkWidget visibility changes, the Gtk.Accessible.Accessible_State_Hidden state will also change to reflect the [propertyGtk.Widget:visible] property.
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 [vfuncGtk.Accessible.get_accessible_parent], [vfuncGtk.Accessible.get_first_accessible_child] and [vfuncGtk.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.
Also note that when an accessible object does not correspond to a widget, and it has children, whose implementation you don't control, it is necessary to ensure the correct shape of the a11y tree by calling [methodGtk.Accessible.set_accessible_parent] and updating the sibling by [methodGtk.Accessible.update_next_accessible_sibling].
function "+" (W : Gtk_Accessible) return Gtk_Accessible
subtype Accessible_Interface_Descr is Glib.Object.Interface_Description;
Accessible_Role_Property : constant Gtk.Accessible.Property_Gtk_Accessible_Role;
Type: Gtk_Accessible_Role The accessible role of the given GtkAccessible implementation.
The accessible role cannot be changed once set.
procedure Announce
(Self : Gtk_Accessible;
Message : UTF8_String;
Priority : Gtk_Accessible_Announcement_Priority)
Requests the user's screen reader to announce the given message. This kind of notification is useful for messages that either have only a visual representation or that are not exposed visually at all, e.g. a notification about a successful operation. Also, by using this API, you can ensure that the message does not interrupts the user's current screen reader output. Since: gtk+ 4.14
the string to announce
the priority of the announcement
function Get_Accessible_Id (Self : Gtk_Accessible) return UTF8_String
Retrieves the accessible identifier for the accessible object. This functionality can be overridden by GtkAccessible implementations. It is left to the accessible implementation to define the scope and uniqueness of the identifier. Since: gtk+ 4.22
the accessible identifier
function Get_Accessible_Parent
(Self : Gtk_Accessible) return Gtk_Accessible
Retrieves the accessible parent for an accessible object. This function returns NULL for top level widgets. Since: gtk+ 4.10
the accessible parent
function Get_Accessible_Role
(Self : Gtk_Accessible) return Gtk_Accessible_Role
Retrieves the accessible role of an accessible object.
the accessible role
function Get_At_Context
(Self : Gtk_Accessible) return Gtk.Atcontext.Gtk_Atcontext
Retrieves the implementation for the given accessible object. Since: gtk+ 4.10
the accessible implementation object. Has transfer-ownership='full'.
function Get_Bounds
(Self : Gtk_Accessible;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
Queries the coordinates and dimensions of this accessible This functionality can be overridden by GtkAccessible implementations, e.g. to get the bounds from an ignored child widget. Since: gtk+ 4.10
the x coordinate of the top left corner of the accessible
the y coordinate of the top left corner of the widget
the width of the accessible object
the height of the accessible object
true if the bounds are valid, and false otherwise
function Get_First_Accessible_Child
(Self : Gtk_Accessible) return Gtk_Accessible
Retrieves the first accessible child of an accessible object. Since: gtk+ 4.10
the first accessible child
function Get_Next_Accessible_Sibling
(Self : Gtk_Accessible) return Gtk_Accessible
Retrieves the next accessible sibling of an accessible object Since: gtk+ 4.10
the next accessible sibling
function Get_Platform_State
(Self : Gtk_Accessible;
State : Gtk_Accessible_Platform_State) return Boolean
Queries a platform state, such as focus. This functionality can be overridden by GtkAccessible implementations, e.g. to get platform state from an ignored child widget, as is the case for GtkText wrappers. Since: gtk+ 4.10
platform state to query
the value of state for the accessible
function Get_Type return Glib.GType
type Gtk_Accessible is new Glib.Types.GType_Interface;
type Gtk_Accessible_Announcement_Priority is (
Accessible_Announcement_Priority_Low,
Accessible_Announcement_Priority_Medium,
Accessible_Announcement_Priority_High);
The priority of an accessibility announcement.
package Gtk_Accessible_Announcement_Priority_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Announcement_Priority);
type Gtk_Accessible_Platform_State is (
Accessible_Platform_State_Focusable,
Accessible_Platform_State_Focused,
Accessible_Platform_State_Active);
The various platform states which can be queried using [methodGtk.Accessible.get_platform_state].
package Gtk_Accessible_Platform_State_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Platform_State);
type Gtk_Accessible_Property is (
Accessible_Property_Autocomplete,
Accessible_Property_Description,
Accessible_Property_Has_Popup,
Accessible_Property_Key_Shortcuts,
Accessible_Property_Label,
Accessible_Property_Level,
Accessible_Property_Modal,
Accessible_Property_Multi_Line,
…,
Accessible_Property_Help_Text);
The possible accessible properties of a [ifaceAccessible].
package Gtk_Accessible_Property_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Property);
type Gtk_Accessible_Relation is (
Accessible_Relation_Active_Descendant,
Accessible_Relation_Col_Count,
Accessible_Relation_Col_Index,
Accessible_Relation_Col_Index_Text,
Accessible_Relation_Col_Span,
Accessible_Relation_Controls,
Accessible_Relation_Described_By,
Accessible_Relation_Details,
…,
Accessible_Relation_Flow_From);
The possible accessible relations of a [ifaceAccessible].
Accessible relations can be references to other widgets, integers or strings.
package Gtk_Accessible_Relation_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Relation);
type Gtk_Accessible_Role is (
Accessible_Role_Alert,
Accessible_Role_Alert_Dialog,
Accessible_Role_Banner,
Accessible_Role_Button,
Accessible_Role_Caption,
Accessible_Role_Cell,
Accessible_Role_Checkbox,
Accessible_Role_Column_Header,
…,
Accessible_Role_Terminal);
The accessible role for a [ifaceAccessible] implementation.
Abstract roles are only used as part of the ontology; application developers must not use abstract roles in their code. The priority of an accessibility announcement. The various platform states which can be queried using [methodGtk.Accessible.get_platform_state]. The possible accessible properties of a [ifaceAccessible]. The possible accessible relations of a [ifaceAccessible].
Accessible relations can be references to other widgets, integers or strings. The possible accessible states of a [ifaceAccessible]. The accessible role for a [ifaceAccessible] implementation.
Abstract roles are only used as part of the ontology; application developers must not use abstract roles in their code.
package Gtk_Accessible_Role_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Role);
type Gtk_Accessible_State is (
Accessible_State_Busy,
Accessible_State_Checked,
Accessible_State_Disabled,
Accessible_State_Expanded,
Accessible_State_Hidden,
Accessible_State_Invalid,
Accessible_State_Pressed,
Accessible_State_Selected,
Accessible_State_Visited);
The possible accessible states of a [ifaceAccessible].
package Gtk_Accessible_State_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_State);
Null_Gtk_Accessible : constant Gtk_Accessible;
type Property_Gtk_Accessible_Announcement_Priority is new Gtk_Accessible_Announcement_Priority_Properties.Property;
type Property_Gtk_Accessible_Platform_State is new Gtk_Accessible_Platform_State_Properties.Property;
type Property_Gtk_Accessible_Property is new Gtk_Accessible_Property_Properties.Property;
type Property_Gtk_Accessible_Relation is new Gtk_Accessible_Relation_Properties.Property;
type Property_Gtk_Accessible_Role is new Gtk_Accessible_Role_Properties.Property;
type Property_Gtk_Accessible_State is new Gtk_Accessible_State_Properties.Property;
procedure Reset_Property
(Self : Gtk_Accessible;
Property : Gtk_Accessible_Property)
Resets the accessible property to its default value.
the accessible property
procedure Reset_Relation
(Self : Gtk_Accessible;
Relation : Gtk_Accessible_Relation)
Resets the accessible relation to its default value.
the accessible relation
procedure Reset_State
(Self : Gtk_Accessible;
State : Gtk_Accessible_State)
Resets the accessible state to its default value.
the accessible state
procedure Set_Accessible_Parent
(Self : Gtk_Accessible;
Parent : Gtk_Accessible;
Next_Sibling : Gtk_Accessible)
Sets the parent and sibling of an accessible object. This function is meant to be used by accessible implementations that are not part of the widget hierarchy, and but act as a logical bridge between widgets. For instance, if a widget creates an object that holds metadata for each child, and you want that object to implement the GtkAccessible interface, you will use this function to ensure that the parent of each child widget is the metadata object, and the parent of each metadata object is the container widget. Since: gtk+ 4.10
the parent accessible object
the sibling accessible object
procedure Set_Get_Accessible_Id
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_Accessible_Id)
procedure Set_Get_Accessible_Parent
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_Accessible_Parent)
procedure Set_Get_At_Context
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_At_Context)
procedure Set_Get_Bounds
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_Bounds)
procedure Set_Get_First_Accessible_Child
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_First_Accessible_Child)
procedure Set_Get_Next_Accessible_Sibling
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_Next_Accessible_Sibling)
procedure Set_Get_Platform_State
(Self : Accessible_Interface_Descr;
Handler : Virtual_Get_Platform_State)
See Glib.Object.Add_Interface
procedure Update_Next_Accessible_Sibling
(Self : Gtk_Accessible;
New_Sibling : Gtk_Accessible)
Updates the next accessible sibling. That might be useful when a new child of a custom accessible is created, and it needs to be linked to a previous child. Since: gtk+ 4.10
the new next accessible sibling to set
procedure Update_Platform_State
(Self : Gtk_Accessible;
State : Gtk_Accessible_Platform_State)
Informs ATs that the platform state has changed. This function should be used by GtkAccessible implementations that have a platform state but are not widgets. Widgets handle platform states automatically. Since: gtk+ 4.18
the platform state to update
type Virtual_Get_Accessible_Id is access function (Self : Gtk_Accessible) return Gtkada.Types.Chars_Ptr;
Retrieves the accessible identifier for the accessible object. This functionality can be overridden by GtkAccessible implementations. It is left to the accessible implementation to define the scope and uniqueness of the identifier. Since: gtk+ 4.22
the accessible identifier
type Virtual_Get_Accessible_Parent is access function (Self : Gtk_Accessible) return Gtk_Accessible;
Retrieves the accessible parent for an accessible object. This function returns NULL for top level widgets. Since: gtk+ 4.10
the accessible parent
type Virtual_Get_At_Context is access function (Self : Gtk_Accessible) return System.Address;
Retrieves the implementation for the given accessible object. Since: gtk+ 4.10
the accessible implementation object. Has transfer-ownership='full'.
type Virtual_Get_Bounds is access function
(Self : Gtk_Accessible;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Glib.Gboolean;
Queries the coordinates and dimensions of this accessible This functionality can be overridden by GtkAccessible implementations, e.g. to get the bounds from an ignored child widget. Since: gtk+ 4.10
the x coordinate of the top left corner of the accessible
the y coordinate of the top left corner of the widget
the width of the accessible object
the height of the accessible object
true if the bounds are valid, and false otherwise
type Virtual_Get_First_Accessible_Child is access function (Self : Gtk_Accessible) return Gtk_Accessible;
Retrieves the first accessible child of an accessible object. Since: gtk+ 4.10
the first accessible child
type Virtual_Get_Next_Accessible_Sibling is access function (Self : Gtk_Accessible) return Gtk_Accessible;
Retrieves the next accessible sibling of an accessible object Since: gtk+ 4.10
the next accessible sibling
type Virtual_Get_Platform_State is access function
(Self : Gtk_Accessible;
State : Gtk_Accessible_Platform_State) return Glib.Gboolean;
Queries a platform state, such as focus. This functionality can be overridden by GtkAccessible implementations, e.g. to get platform state from an ignored child widget, as is the case for GtkText wrappers. Since: gtk+ 4.10
platform state to query
the value of state for the accessible