An interface for accessible objects containing formatted text.
The GtkAccessibleText interfaces is meant to be implemented by accessible objects that have text formatted with attributes, or non-trivial text contents.
You should use the [enumGtk.AccessibleProperty.LABEL] or the [enumGtk.AccessibleProperty.DESCRIPTION] properties for accessible objects containing simple, unformatted text.
function "+" (W : Gtk_Accessible_Text) return Gtk_Accessible_Text
subtype Accessible_Text_Interface_Descr is Glib.Object.Interface_Description;
function From_Object_Free
(B : not null access Gtk_Accessible_Text_Range) return Gtk_Accessible_Text_Range
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function Get_Type return Glib.GType
type Gtk_Accessible_Text is new Glib.Types.GType_Interface;
type Gtk_Accessible_Text_Granularity is (
Accessible_Text_Granularity_Character,
Accessible_Text_Granularity_Word,
Accessible_Text_Granularity_Sentence,
Accessible_Text_Granularity_Line,
Accessible_Text_Granularity_Paragraph);
The granularity for queries about the text contents of a [ifaceGtk.AccessibleText] implementation.
package Gtk_Accessible_Text_Granularity_Properties is
new Generic_Internal_Discrete_Property (Gtk_Accessible_Text_Granularity);
type Gtk_Accessible_Text_Range is record
Start : Gsize;
Length : Gsize;
end record;
A range inside the text of an accessible object.
type Gtk_Accessible_Text_Range_Array is
array (Natural range <>) of Gtk_Accessible_Text_Range;
The granularity for queries about the text contents of a [ifaceGtk.AccessibleText] implementation. A range inside the text of an accessible object.
Null_Gtk_Accessible_Text : constant Gtk_Accessible_Text;
type Property_Gtk_Accessible_Text_Granularity is new Gtk_Accessible_Text_Granularity_Properties.Property;
procedure Set_Get_Attributes
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Attributes)
procedure Set_Get_Caret_Position
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Caret_Position)
procedure Set_Get_Contents
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Contents)
procedure Set_Get_Contents_At
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Contents_At)
procedure Set_Get_Default_Attributes
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Default_Attributes)
procedure Set_Get_Extents
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Extents)
procedure Set_Get_Offset
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Offset)
procedure Set_Get_Selection
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Get_Selection)
procedure Set_Set_Caret_Position
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Set_Caret_Position)
procedure Set_Set_Selection
(Self : Accessible_Text_Interface_Descr;
Handler : Virtual_Set_Selection)
See Glib.Object.Add_Interface
procedure Update_Caret_Position (Self : Gtk_Accessible_Text)
Updates the position of the caret. Implementations of the GtkAccessibleText interface should call this function every time the caret has moved, in order to notify assistive technologies. Since: gtk+ 4.14
procedure Update_Contents
(Self : Gtk_Accessible_Text;
Change : Gtk.Enums.Gtk_Accessible_Text_Content_Change;
Start : Guint;
The_End : Guint)
Notifies assistive technologies of a change in contents. Implementations of the GtkAccessibleText interface should call this function every time their contents change as the result of an operation, like an insertion or a removal. Note: If the change is a deletion, this function must be called before removing the contents, if it is an insertion, it must be called after inserting the new contents. Since: gtk+ 4.14
the type of change in the contents
the starting offset of the change, in characters
the end offset of the change, in characters
procedure Update_Selection_Bound (Self : Gtk_Accessible_Text)
Updates the boundary of the selection. Implementations of the GtkAccessibleText interface should call this function every time the selection has moved, in order to notify assistive technologies. Since: gtk+ 4.14
type Virtual_Get_Attributes is access function
(Self : Gtk_Accessible_Text;
Offset : Guint;
N_Ranges : out Gsize;
Ranges : access Gtk_Accessible_Text_Range_Array;
Attribute_Names : access Gtkada.Types.chars_ptr_array;
Attribute_Values : access Gtkada.Types.chars_ptr_array)
return Glib.Gboolean;
Retrieves the text attributes inside the accessible object. Each attribute is composed by:
a range - a name - a value
It is left to the implementation to determine the serialization format of the value to a string. GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes. If this function returns true, n_ranges will be set to a value greater than or equal to one, Ranges will be set to a newly allocated array of [structGtk.AccessibleTextRange]. Since: gtk+ 4.14
the offset, in characters
the number of attributes
the ranges of the attributes inside the accessible object
the names of the attributes inside the accessible object
the values of the attributes inside the accessible object
true if the accessible object has at least an attribute, and false otherwise
type Virtual_Get_Caret_Position is access function (Self : Gtk_Accessible_Text) return Guint;
Retrieves the position of the caret inside the accessible object. Since: gtk+ 4.14
the position of the caret, in characters
type Virtual_Get_Contents is access function
(Self : Gtk_Accessible_Text;
Start : Guint;
The_End : Guint) return System.Address;
Retrieve the current contents of the accessible object within the given range. If End is G_MAXUINT, the end of the range is the full content of the accessible object. Since: gtk+ 4.14
the beginning of the range, in characters
the end of the range, in characters
the requested slice of the contents of the accessible object, as UTF-8. Note that the slice does not have to be NUL-terminated. Has transfer-ownership='full'.
type Virtual_Get_Contents_At is access function
(Self : Gtk_Accessible_Text;
Offset : Guint;
Granularity : Gtk_Accessible_Text_Granularity;
Start : out Guint;
The_End : out Guint) return System.Address;
Retrieve the current contents of the accessible object starting from the given offset, and using the given granularity. The Start and End values contain the boundaries of the text. Since: gtk+ 4.14
the offset, in characters
the granularity of the query
the start of the range, in characters
the end of the range, in characters
the requested slice of the contents of the accessible object, as UTF-8. Note that the slice does not have to be NUL-terminated. Has transfer-ownership='full'.
type Virtual_Get_Default_Attributes is access procedure
(Self : Gtk_Accessible_Text;
Attribute_Names : out Gtkada.Types.chars_ptr_array;
Attribute_Values : out Gtkada.Types.chars_ptr_array);
Retrieves the default text attributes inside the accessible object. Each attribute is composed by:
a name - a value
It is left to the implementation to determine the serialization format of the value to a string. GTK provides support for various text attribute names and values, but implementations of this interface are free to add their own attributes. Since: gtk+ 4.14
the names of the default attributes inside the accessible object
the values of the default attributes inside the accessible object
type Virtual_Get_Extents is access function
(Self : Gtk_Accessible_Text;
Start : Guint;
The_End : Guint;
Extents : not null access Graphene.Rect.Graphene_Rect_T)
return Glib.Gboolean;
Obtains the extents of a range of text, in widget coordinates. Since: gtk+ 4.16
the start offset, in characters
the end offset, in characters, Extents (out caller-allocates): return location for the extents
true if the extents were filled in, false otherwise
type Virtual_Get_Offset is access function
(Self : Gtk_Accessible_Text;
Point : not null access Graphene.Point.Graphene_Point_T;
Offset : out Guint) return Glib.Gboolean;
Gets the text offset at a given point. Since: gtk+ 4.16
a point in widget coordinates of Self
return location for the text offset at Point
true if the offset was set, false otherwise
type Virtual_Get_Selection is access function
(Self : Gtk_Accessible_Text;
N_Ranges : out Gsize;
Ranges : access Gtk_Accessible_Text_Range_Array)
return Glib.Gboolean;
Retrieves the selection ranges in the accessible object. If this function returns true, n_ranges will be set to a value greater than or equal to one, and Ranges will be set to a newly allocated array of [structGtk.AccessibleTextRange]. Since: gtk+ 4.14
the number of selection ranges
the selection ranges
true if there is at least a selection inside the accessible object, and false otherwise
type Virtual_Set_Caret_Position is access function
(Self : Gtk_Accessible_Text;
Offset : Guint) return Glib.Gboolean;
Sets the caret position. Since: gtk+ 4.22
the text offset in characters
true if the caret position was updated
type Virtual_Set_Selection is access function
(Self : Gtk_Accessible_Text;
I : Gsize;
GRange : Gtk_Accessible_Text_Range) return Glib.Gboolean;
Sets the caret position. Since: gtk+ 4.22
the selection to set
the range to set the selection to
true if the selection was updated