2.1 <GtkAccessible>

Interface: <GtkAccessible>

An interface for describing UI elements for Assistive Technologies.

Every accessible implementation has:

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 hidden state will also change to reflect the 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 accessible:do-get-accessible-parent, accessible:do-get-first-accessible-child and accessible:do-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 accessible:set-accessible-parent and updating the sibling by accessible:update-next-accessible-sibling.

Properties

Property: accessible:accessible-role self

The accessible role of the given <GtkAccessible> implementation.

The accessible role cannot be changed once set.

Its value is a <GtkAccessibleRole> (or, to set it, one of its symbols).

Set it with (set! (accessible:accessible-role self) value).

Procedures

Method: accessible:announce self message priority
Method: announce self message 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.

self

Passed: a <GtkAccessible>.

an accessible object

message

Passed: a string.

the string to announce

priority

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

the priority of the announcement

Method: accessible:get-accessible-id self ⇒ %return
Method: get-accessible-id self ⇒ %return

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.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a string, or #f.

the accessible identifier

Method: accessible:get-accessible-parent self ⇒ %return
Method: get-accessible-parent self ⇒ %return

Retrieves the accessible parent for an accessible object.

This function returns NULL for top level widgets.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the accessible parent

Method: accessible:get-accessible-role self ⇒ %return
Method: get-accessible-role self ⇒ %return

Retrieves the accessible role of an accessible object.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessibleRole>.

the accessible role

Method: accessible:get-at-context self ⇒ %return
Method: get-at-context self ⇒ %return

Retrieves the implementation for the given accessible object.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkATContext>.

the accessible implementation object

Method: accessible:get-bounds self ⇒ %return x y width height
Method: get-bounds self ⇒ %return x y width height

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.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a boolean.

true if the bounds are valid, and false otherwise

x

Returned: a 32-bit integer.

the x coordinate of the top left corner of the accessible

y

Returned: a 32-bit integer.

the y coordinate of the top left corner of the widget

width

Returned: a 32-bit integer.

the width of the accessible object

height

Returned: a 32-bit integer.

the height of the accessible object

Method: accessible:get-first-accessible-child self ⇒ %return
Method: get-first-accessible-child self ⇒ %return

Retrieves the first accessible child of an accessible object.

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the first accessible child

Method: accessible:get-next-accessible-sibling self ⇒ %return
Method: get-next-accessible-sibling self ⇒ %return

Retrieves the next accessible sibling of an accessible object

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the next accessible sibling

Method: accessible:get-platform-state? self state ⇒ %return
Method: get-platform-state? self state ⇒ %return

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.

self

Passed: a <GtkAccessible>.

an accessible object

state

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

platform state to query

%return

Returned: a boolean.

the value of state for the accessible

Method: accessible:reset-property self property
Method: reset-property self property

Resets the accessible property to its default value.

self

Passed: a <GtkAccessible>.

an accessible object

property

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

the accessible property

Method: accessible:reset-relation self relation
Method: reset-relation self relation

Resets the accessible relation to its default value.

self

Passed: a <GtkAccessible>.

an accessible object

relation

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

the accessible relation

Method: accessible:reset-state self state
Method: reset-state self state

Resets the accessible state to its default value.

self

Passed: a <GtkAccessible>.

an accessible object

state

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

the accessible state

Method: accessible:set-accessible-parent self [parent] [next-sibling]
Method: set-accessible-parent self [parent] [next-sibling]

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.

self

Passed: a <GtkAccessible>.

an accessible object

parent

Passed, or left out: a <GtkAccessible>, or #f.

the parent accessible object

next-sibling

Passed, or left out: a <GtkAccessible>, or #f.

the sibling accessible object

Method: accessible:update-next-accessible-sibling self [new-sibling]
Method: update-next-accessible-sibling self [new-sibling]

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.

self

Passed: a <GtkAccessible>.

an accessible object

new-sibling

Passed, or left out: a <GtkAccessible>, or #f.

the new next accessible sibling to set

Method: accessible:update-platform-state self state
Method: update-platform-state self 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.

self

Passed: a <GtkAccessible>.

an accessible object

state

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

the platform state to update

Method: accessible:update-property self properties values
Method: update-property self properties values

Updates a list of accessible properties.

See the <GtkAccessibleProperty> documentation for the value types of accessible properties.

This function should be called by <GtkWidget> types whenever an accessible property change must be communicated to assistive technologies.

Example:

value = gtk_adjustment_get_value (adjustment);
gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
                                   GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
                                   -1);
self

Passed: a <GtkAccessible>.

an accessible object

properties

Passed: a list or vector, each a <GtkAccessibleProperty> or one of its symbols.

values

Passed: a list or vector, each a <GValue>.

n-properties

Not passed: guile-gi gives the length of values.

first-property

the first accessible property

...

a list of property and value pairs, terminated by -1

Method: accessible:update-relation self relations values
Method: update-relation self relations values

Updates a list of accessible relations.

This function should be called by <GtkWidget> types whenever an accessible relation change must be communicated to assistive technologies.

If the <GtkAccessibleRelation> requires a list of references, you should pass each reference individually, followed by NULL, e.g.

gtk_accessible_update_relation (accessible,
                                GTK_ACCESSIBLE_RELATION_CONTROLS,
                                  ref1, NULL,
                                GTK_ACCESSIBLE_RELATION_LABELLED_BY,
                                  ref1, ref2, ref3, NULL,
                                -1);
self

Passed: a <GtkAccessible>.

an accessible object

relations

Passed: a list or vector, each a <GtkAccessibleRelation> or one of its symbols.

values

Passed: a list or vector, each a <GValue>.

n-relations

Not passed: guile-gi gives the length of values.

first-relation

the first accessible relation

...

a list of relation and value pairs, terminated by -1

Method: accessible:update-state self states values
Method: update-state self states values

Updates a list of accessible states.

See the <GtkAccessibleState> documentation for the value types of accessible states.

This function should be called by <GtkWidget> types whenever an accessible state change must be communicated to assistive technologies.

Example:

value = GTK_ACCESSIBLE_TRISTATE_MIXED;
gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
                             GTK_ACCESSIBLE_STATE_CHECKED, value,
                             -1);
self

Passed: a <GtkAccessible>.

an accessible object

states

Passed: a list or vector, each a <GtkAccessibleState> or one of its symbols.

values

Passed: a list or vector, each a <GValue>.

n-states

Not passed: guile-gi gives the length of values.

first-state

the first accessible state

...

a list of state and value pairs, terminated by -1

Virtual methods

Virtual method: accessible:do-get-accessible-id implementor self ⇒ %return

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.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a string, or #f.

the accessible identifier

Virtual method: accessible:do-get-accessible-parent implementor self ⇒ %return

Retrieves the accessible parent for an accessible object.

This function returns NULL for top level widgets.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the accessible parent

Virtual method: accessible:do-get-at-context implementor self ⇒ %return

Retrieves the implementation for the given accessible object.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkATContext>, or #f.

the accessible implementation object

Virtual method: accessible:do-get-bounds implementor self ⇒ %return x y width height

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.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a boolean.

true if the bounds are valid, and false otherwise

x

Returned: a 32-bit integer.

the x coordinate of the top left corner of the accessible

y

Returned: a 32-bit integer.

the y coordinate of the top left corner of the widget

width

Returned: a 32-bit integer.

the width of the accessible object

height

Returned: a 32-bit integer.

the height of the accessible object

Virtual method: accessible:do-get-first-accessible-child implementor self ⇒ %return

Retrieves the first accessible child of an accessible object.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the first accessible child

Virtual method: accessible:do-get-next-accessible-sibling implementor self ⇒ %return

Retrieves the next accessible sibling of an accessible object

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

%return

Returned: a <GtkAccessible>, or #f.

the next accessible sibling

Virtual method: accessible:do-get-platform-state implementor self state ⇒ %return

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.

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

implementor

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

self

Passed: a <GtkAccessible>.

an accessible object

state

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

platform state to query

%return

Returned: a boolean.

the value of state for the accessible