2.4 <GtkAccessibleText>

Interface: <GtkAccessibleText>

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 Gtk.AccessibleProperty.LABEL or the Gtk.AccessibleProperty.DESCRIPTION properties for accessible objects containing simple, unformatted text.

Procedures

Method: accessible-text:update-caret-position self
Method: update-caret-position self

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.

self

Passed: a <GtkAccessibleText>.

the accessible object

Method: accessible-text:update-contents self change start end
Method: update-contents self change start end

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.

self

Passed: a <GtkAccessibleText>.

the accessible object

change

Passed: a <GtkAccessibleTextContentChange>, or one of its symbols.

the type of change in the contents

start

Passed: an unsigned 32-bit integer.

the starting offset of the change, in characters

end

Passed: an unsigned 32-bit integer.

the end offset of the change, in characters

Method: accessible-text:update-selection-bound self
Method: update-selection-bound self

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.

self

Passed: a <GtkAccessibleText>.

the accessible object

Virtual methods

Virtual method: accessible-text:do-get-caret-position implementor self ⇒ %return

Retrieves the position of the caret inside the accessible object.

To override it in a new class, give register-type #:vfuncs `((get-caret-position . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

%return

Returned: an unsigned 32-bit integer.

the position of the caret, in characters

Virtual method: accessible-text:do-get-contents implementor self start end ⇒ %return

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.

To override it in a new class, give register-type #:vfuncs `((get-contents . ,procedure)). The procedure is called as (procedure self start end) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

start

Passed: an unsigned 32-bit integer.

the beginning of the range, in characters

end

Passed: an unsigned 32-bit integer.

the end of the range, in characters

%return

Returned: a <GBytes>.

the requested slice of the contents of the accessible object, as UTF-8. Note that the slice does not have to be NUL-terminated

Virtual method: accessible-text:do-get-contents-at implementor self offset granularity ⇒ %return start end

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.

To override it in a new class, give register-type #:vfuncs `((get-contents-at . ,procedure)). The procedure is called as (procedure self offset granularity) ⇒ %return start end.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

offset

Passed: an unsigned 32-bit integer.

the offset, in characters

granularity

Passed: a <GtkAccessibleTextGranularity>, or one of its symbols.

the granularity of the query

%return

Returned: a <GBytes>.

the requested slice of the contents of the accessible object, as UTF-8. Note that the slice does not have to be NUL-terminated

start

Returned: an unsigned 32-bit integer.

the start of the range, in characters

end

Returned: an unsigned 32-bit integer.

the end of the range, in characters

Virtual method: accessible-text:do-get-default-attributes implementor self ⇒ attribute-names attribute-values

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.

To override it in a new class, give register-type #:vfuncs `((get-default-attributes . ,procedure)). The procedure is called as (procedure self) ⇒ attribute-names attribute-values.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

attribute-names

Returned: a vector, each a string.

the names of the default attributes inside the accessible object

attribute-values

Returned: a vector, each a string.

the values of the default attributes inside the accessible object

Virtual method: accessible-text:do-get-extents implementor self start end extents ⇒ %return

Obtains the extents of a range of text, in widget coordinates.

To override it in a new class, give register-type #:vfuncs `((get-extents . ,procedure)). The procedure is called as (procedure self start end extents) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

start

Passed: an unsigned 32-bit integer.

the start offset, in characters

end

Passed: an unsigned 32-bit integer.

the end offset, in characters, extents (out caller-allocates): return location for the extents

extents

Passed: a <GrapheneRect>.

%return

Returned: a boolean.

true if the extents were filled in, false otherwise

Virtual method: accessible-text:do-get-offset implementor self point ⇒ %return offset

Gets the text offset at a given point.

To override it in a new class, give register-type #:vfuncs `((get-offset . ,procedure)). The procedure is called as (procedure self point) ⇒ %return offset.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

point

Passed: a <GraphenePoint>.

a point in widget coordinates of self

%return

Returned: a boolean.

true if the offset was set, false otherwise

offset

Returned: an unsigned 32-bit integer.

return location for the text offset at point

Virtual method: accessible-text:do-set-caret-position implementor self offset ⇒ %return

Sets the caret position.

To override it in a new class, give register-type #:vfuncs `((set-caret-position . ,procedure)). The procedure is called as (procedure self offset) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GtkAccessibleText>, or its GType number.

self

Passed: a <GtkAccessibleText>.

the accessible object

offset

Passed: an unsigned 32-bit integer.

the text offset in characters

%return

Returned: a boolean.

true if the caret position was updated