Atk.Object

g Atk.Object Atk.Object GObject.Object GObject.Object GObject.Object->Atk.Object

Subclasses:

Atk.GObjectAccessible, Atk.NoOpObject, Atk.Plug, Atk.Socket

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add_relationship (relationship, target)

get_accessible_id ()

get_attributes ()

get_description ()

get_index_in_parent ()

get_layer ()

get_mdi_zorder ()

get_n_accessible_children ()

get_name ()

get_object_locale ()

get_parent ()

get_role ()

initialize (data)

notify_state_change (state, value)

peek_parent ()

ref_accessible_child (i)

ref_relation_set ()

ref_state_set ()

remove_property_change_handler (handler_id)

remove_relationship (relationship, target)

set_accessible_id (name)

set_description (description)

set_name (name)

set_parent (parent)

set_role (role)

Virtual Methods

Inherited:

GObject.Object (7)

do_active_descendant_changed (child)

do_children_changed (change_index, changed_child)

do_focus_event (focus_in)

do_get_attributes ()

do_get_description ()

do_get_index_in_parent ()

do_get_layer ()

do_get_mdi_zorder ()

do_get_n_children ()

do_get_name ()

do_get_object_locale ()

do_get_parent ()

do_get_role ()

do_initialize (data)

do_property_change (values)

do_ref_relation_set ()

do_ref_state_set ()

do_remove_property_change_handler (handler_id)

do_set_description (description)

do_set_name (name)

do_set_parent (parent)

do_set_role (role)

do_state_change (name, state_set)

do_visible_data_changed ()

Properties

Name

Type

Flags

Short Description

accessible-component-layer

int

r

The accessible layer of this object

accessible-component-mdi-zorder

int

r

The accessible MDI value of this object

accessible-description

str

r/w

Description of an object, formatted for assistive technology access

accessible-hypertext-nlinks

int

r

The number of links which the current Atk.Hypertext has

accessible-name

str

r/w

Object instance’s name formatted for assistive technology access

accessible-parent

Atk.Object

r/w

Parent of the current accessible as returned by Atk.Object.get_parent()

accessible-role

Atk.Role

r/w

The accessible role of this object

accessible-table-caption

str

r/w

Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead deprecated

accessible-table-caption-object

Atk.Object

r/w

Is used to notify that the table caption has changed

accessible-table-column-description

str

r/w

Is used to notify that the table column description has changed deprecated

accessible-table-column-header

Atk.Object

r/w

Is used to notify that the table column header has changed deprecated

accessible-table-row-description

str

r/w

Is used to notify that the table row description has changed deprecated

accessible-table-row-header

Atk.Object

r/w

Is used to notify that the table row header has changed deprecated

accessible-table-summary

Atk.Object

r/w

Is used to notify that the table summary has changed

accessible-value

float

r/w

Is used to notify that the value has changed deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

active-descendant-changed

The “active-descendant-changed” signal is emitted by an object which has the state Atk.StateType.MANAGES_DESCENDANTS when the focus object in the object changes.

announcement

The “announcement” signal can be emitted to pass an announcement on to be read by a screen reader.

children-changed

The signal “children-changed” is emitted when a child is added or removed form an object.

focus-event

The signal “focus-event” is emitted when an object gained or lost focus. deprecated

notification

The “notification” signal can be emitted to pass an announcement on to be read by a screen reader.

property-change

The signal “property-change” is emitted when an object’s property value changes.

state-change

The “state-change” signal is emitted when an object’s state changes.

visible-data-changed

The “visible-data-changed” signal is emitted when the visual appearance of the object changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

accessible_parent

Atk.Object

r

description

str

r

layer

Atk.Layer

r

name

str

r

parent

GObject.Object

r

relation_set

Atk.RelationSet

r

role

Atk.Role

r

Class Details

class Atk.Object(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Atk.ObjectClass

The base object class for the Accessibility Toolkit API.

This class is the primary class for accessibility support via the Accessibility ToolKit (ATK). Objects which are instances of Atk.Object (or instances of Atk.Object-derived types) are queried for properties which relate basic (and generic) properties of a UI component such as name and description. Instances of Atk.Object may also be queried as to whether they implement other ATK interfaces (e.g. Atk.Action, Atk.Component, etc.), as appropriate to the role which a given UI component plays in a user interface.

All UI components in an application which provide useful information or services to the user must provide corresponding Atk.Object instances on request (in GTK+, for instance, usually on a call to #gtk_widget_get_accessible ()), either via ATK support built into the toolkit for the widget class or ancestor class, or in the case of custom widgets, if the inherited Atk.Object implementation is insufficient, via instances of a new Atk.Object subclass.

See [class`AtkObjectFactory`], [class`AtkRegistry`]. (GTK+ users see also #GtkAccessible).

add_relationship(relationship, target)[source]
Parameters:
Returns:

True if the relationship is added.

Return type:

bool

Adds a relationship of the specified type with the specified target.

get_accessible_id()[source]
Returns:

a character string representing the accessible id of the object, or None if no such string was set.

Return type:

str

Gets the accessible id of the accessible.

New in version 2.34.

get_attributes()[source]
Returns:

an #AtkAttributeSet consisting of all explicit properties/annotations applied to the object, or an empty set if the object has no name-value pair attributes assigned to it. This #atkattributeset should be freed by a call to Atk.Attribute.set_free().

Return type:

[object]

Get a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of name-value pairs. As such these attributes may be considered weakly-typed properties or annotations, as distinct from strongly-typed object data available via other get/set methods. Not all objects have explicit “name-value pair” #AtkAttributeSet properties.

New in version 1.12.

get_description()[source]
Returns:

a character string representing the accessible description of the accessible.

Return type:

str

Gets the accessible description of the accessible.

get_index_in_parent()[source]
Returns:

an integer which is the index of the accessible in its parent

Return type:

int

Gets the 0-based index of this accessible in its parent; returns -1 if the accessible does not have an accessible parent.

get_layer()[source]
Returns:

an Atk.Layer which is the layer of the accessible

Return type:

Atk.Layer

Gets the layer of the accessible.

Deprecated since version ???: Use Atk.Component.get_layer instead.

get_mdi_zorder()[source]
Returns:

a int which is the zorder of the accessible, i.e. the depth at which the component is shown in relation to other components in the same container.

Return type:

int

Gets the zorder of the accessible. The value GObject.G_MININT will be returned if the layer of the accessible is not Atk.Layer.MDI.

Deprecated since version ???: Use Atk.Component.get_mdi_zorder instead.

get_n_accessible_children()[source]
Returns:

an integer representing the number of accessible children of the accessible.

Return type:

int

Gets the number of accessible children of the accessible.

get_name()[source]
Returns:

a character string representing the accessible name of the object.

Return type:

str

Gets the accessible name of the accessible.

get_object_locale()[source]
Returns:

a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of self.

Return type:

str

Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of self.

New in version 2.8.

get_parent()[source]
Returns:

an Atk.Object representing the accessible parent of the accessible

Return type:

Atk.Object

Gets the accessible parent of the accessible. By default this is the one assigned with Atk.Object.set_parent(), but it is assumed that ATK implementors have ways to get the parent of the object without the need of assigning it manually with Atk.Object.set_parent(), and will return it with this method.

If you are only interested on the parent assigned with Atk.Object.set_parent(), use Atk.Object.peek_parent().

get_role()[source]
Returns:

an Atk.Role which is the role of the accessible

Return type:

Atk.Role

Gets the role of the accessible.

initialize(data)[source]
Parameters:

data (object or None) – a object which identifies the object for which the Atk.Object was created.

This function is called when implementing subclasses of Atk.Object. It does initialization required for the new object. It is intended that this function should called only in the …_new() functions used to create an instance of a subclass of Atk.Object

notify_state_change(state, value)[source]
Parameters:
  • state (int) – an #AtkState whose state is changed

  • value (bool) – a bool which indicates whether the state is being set on or off

Emits a state-change signal for the specified state.

Note that as a general rule when the state of an existing object changes, emitting a notification is expected.

peek_parent()[source]
Returns:

an Atk.Object representing the accessible parent of the accessible if assigned

Return type:

Atk.Object

Gets the accessible parent of the accessible, if it has been manually assigned with Atk.Object.set_parent. Otherwise, this function returns None.

This method is intended as an utility for ATK implementors, and not to be exposed to accessible tools. See Atk.Object.get_parent() for further reference.

ref_accessible_child(i)[source]
Parameters:

i (int) – a int representing the position of the child, starting from 0

Returns:

an Atk.Object representing the specified accessible child of the accessible.

Return type:

Atk.Object

Gets a reference to the specified accessible child of the object. The accessible children are 0-based so the first accessible child is at index 0, the second at index 1 and so on.

ref_relation_set()[source]
Returns:

an Atk.RelationSet representing the relation set of the object.

Return type:

Atk.RelationSet

Gets the Atk.RelationSet associated with the object.

ref_state_set()[source]
Returns:

a reference to an Atk.StateSet which is the state set of the accessible

Return type:

Atk.StateSet

Gets a reference to the state set of the accessible; the caller must unreference it when it is no longer needed.

remove_property_change_handler(handler_id)[source]
Parameters:

handler_id (int) – a int which identifies the handler to be removed.

Removes a property change handler.

Deprecated since version 2.12: See atk_object_connect_property_change_handler()

remove_relationship(relationship, target)[source]
Parameters:
Returns:

True if the relationship is removed.

Return type:

bool

Removes a relationship of the specified type with the specified target.

set_accessible_id(name)[source]
Parameters:

name (str) – a character string to be set as the accessible id

Sets the accessible ID of the accessible. This is not meant to be presented to the user, but to be an ID which is stable over application development. Typically, this is the gtkbuilder ID. Such an ID will be available for instance to identify a given well-known accessible object for tailored screen reading, or for automatic regression testing.

New in version 2.34.

set_description(description)[source]
Parameters:

description (str) – a character string to be set as the accessible description

Sets the accessible description of the accessible. You can’t set the description to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.

set_name(name)[source]
Parameters:

name (str) – a character string to be set as the accessible name

Sets the accessible name of the accessible. You can’t set the name to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.

set_parent(parent)[source]
Parameters:

parent (Atk.Object) – an Atk.Object to be set as the accessible parent

Sets the accessible parent of the accessible. parent can be None.

set_role(role)[source]
Parameters:

role (Atk.Role) – an Atk.Role to be set as the role

Sets the role of the accessible.

do_active_descendant_changed(child) virtual
Parameters:

child (object or None) –

do_children_changed(change_index, changed_child) virtual
Parameters:
do_focus_event(focus_in) virtual
Parameters:

focus_in (bool) –

do_get_attributes() virtual
Returns:

an #AtkAttributeSet consisting of all explicit properties/annotations applied to the object, or an empty set if the object has no name-value pair attributes assigned to it. This #atkattributeset should be freed by a call to Atk.Attribute.set_free().

Return type:

[object]

Get a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of name-value pairs. As such these attributes may be considered weakly-typed properties or annotations, as distinct from strongly-typed object data available via other get/set methods. Not all objects have explicit “name-value pair” #AtkAttributeSet properties.

New in version 1.12.

do_get_description() virtual
Returns:

a character string representing the accessible description of the accessible.

Return type:

str

Gets the accessible description of the accessible.

do_get_index_in_parent() virtual
Returns:

an integer which is the index of the accessible in its parent

Return type:

int

Gets the 0-based index of this accessible in its parent; returns -1 if the accessible does not have an accessible parent.

do_get_layer() virtual
Returns:

an Atk.Layer which is the layer of the accessible

Return type:

Atk.Layer

Gets the layer of the accessible.

Deprecated since version ???: Use Atk.Component.get_layer instead.

do_get_mdi_zorder() virtual
Returns:

a int which is the zorder of the accessible, i.e. the depth at which the component is shown in relation to other components in the same container.

Return type:

int

Gets the zorder of the accessible. The value GObject.G_MININT will be returned if the layer of the accessible is not Atk.Layer.MDI.

Deprecated since version ???: Use Atk.Component.get_mdi_zorder instead.

do_get_n_children() virtual
Return type:

int

do_get_name() virtual
Returns:

a character string representing the accessible name of the object.

Return type:

str

Gets the accessible name of the accessible.

do_get_object_locale() virtual
Returns:

a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of accessible.

Return type:

str

Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale of accessible.

New in version 2.8.

do_get_parent() virtual
Returns:

an Atk.Object representing the accessible parent of the accessible

Return type:

Atk.Object

Gets the accessible parent of the accessible. By default this is the one assigned with Atk.Object.set_parent(), but it is assumed that ATK implementors have ways to get the parent of the object without the need of assigning it manually with Atk.Object.set_parent(), and will return it with this method.

If you are only interested on the parent assigned with Atk.Object.set_parent(), use Atk.Object.peek_parent().

do_get_role() virtual
Returns:

an Atk.Role which is the role of the accessible

Return type:

Atk.Role

Gets the role of the accessible.

do_initialize(data) virtual
Parameters:

data (object or None) – a object which identifies the object for which the Atk.Object was created.

This function is called when implementing subclasses of Atk.Object. It does initialization required for the new object. It is intended that this function should called only in the …_new() functions used to create an instance of a subclass of Atk.Object

do_property_change(values) virtual
Parameters:

values (Atk.PropertyValues) –

do_ref_relation_set() virtual
Returns:

an Atk.RelationSet representing the relation set of the object.

Return type:

Atk.RelationSet

Gets the Atk.RelationSet associated with the object.

do_ref_state_set() virtual
Returns:

a reference to an Atk.StateSet which is the state set of the accessible

Return type:

Atk.StateSet

Gets a reference to the state set of the accessible; the caller must unreference it when it is no longer needed.

do_remove_property_change_handler(handler_id) virtual
Parameters:

handler_id (int) – a int which identifies the handler to be removed.

Removes a property change handler.

Deprecated since version 2.12: See atk_object_connect_property_change_handler()

do_set_description(description) virtual
Parameters:

description (str) – a character string to be set as the accessible description

Sets the accessible description of the accessible. You can’t set the description to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.

do_set_name(name) virtual
Parameters:

name (str) – a character string to be set as the accessible name

Sets the accessible name of the accessible. You can’t set the name to None. This is reserved for the initial value. In this aspect None is similar to Atk.Role.UNKNOWN. If you want to set the name to a empty value you can use “”.

do_set_parent(parent) virtual
Parameters:

parent (Atk.Object) – an Atk.Object to be set as the accessible parent

Sets the accessible parent of the accessible. parent can be None.

do_set_role(role) virtual
Parameters:

role (Atk.Role) – an Atk.Role to be set as the role

Sets the role of the accessible.

do_state_change(name, state_set) virtual
Parameters:
  • name (str) –

  • state_set (bool) –

do_visible_data_changed() virtual

Signal Details

Atk.Object.signals.active_descendant_changed(object, arg1)
Signal Name:

active-descendant-changed

Flags:

RUN_LAST, DETAILED

Parameters:
  • object (Atk.Object) – The object which received the signal

  • arg1 (Atk.Object) – the newly focused object.

The “active-descendant-changed” signal is emitted by an object which has the state Atk.StateType.MANAGES_DESCENDANTS when the focus object in the object changes. For instance, a table will emit the signal when the cell in the table which has focus changes.

Atk.Object.signals.announcement(object, arg1)
Signal Name:

announcement

Flags:

RUN_LAST

Parameters:
  • object (Atk.Object) – The object which received the signal

  • arg1 (str) – the text to be announced.

The “announcement” signal can be emitted to pass an announcement on to be read by a screen reader.

Depcrecated (2.50): Use Atk.Object ::notification instead.

New in version 2.46.

Atk.Object.signals.children_changed(object, arg1, arg2)
Signal Name:

children-changed

Flags:

RUN_LAST, DETAILED

Parameters:
  • object (Atk.Object) – The object which received the signal

  • arg1 (int) – The index of the added or removed child. The value can be -1. This is used if the value is not known by the implementor when the child is added/removed or irrelevant.

  • arg2 (Atk.Object) – A object to the child Atk.Object which was added or removed. If the child was removed, it is possible that it is not available for the implementor. In that case this pointer can be None.

The signal “children-changed” is emitted when a child is added or removed form an object. It supports two details: “add” and “remove”

Atk.Object.signals.focus_event(object, arg1)
Signal Name:

focus-event

Flags:

RUN_LAST

Parameters:
  • object (Atk.Object) – The object which received the signal

  • arg1 (bool) – a boolean value which indicates whether the object gained or lost focus.

The signal “focus-event” is emitted when an object gained or lost focus.

Deprecated since version 2.9.4: Use the Atk.Object ::state-change signal instead.

Atk.Object.signals.notification(object, arg1, arg2)
Signal Name:

notification

Flags:

RUN_LAST

Parameters:

The “notification” signal can be emitted to pass an announcement on to be read by a screen reader.

New in version 2.50.

Atk.Object.signals.property_change(object, arg1)
Signal Name:

property-change

Flags:

RUN_LAST, DETAILED

Parameters:

The signal “property-change” is emitted when an object’s property value changes. arg1 contains an Atk.PropertyValues with the name and the new value of the property whose value has changed. Note that, as with GObject.Object notify, getting this signal does not guarantee that the value of the property has actually changed; it may also be emitted when the setter of the property is called to reinstate the previous value.

Toolkit implementor note: ATK implementors should use GObject.Object.notify() to emit property-changed notifications. Atk.Object ::property-changed is needed by the implementation of atk_add_global_event_listener() because GObject.Object notify doesn’t support emission hooks.

Atk.Object.signals.state_change(object, arg1, arg2)
Signal Name:

state-change

Flags:

RUN_LAST, DETAILED

Parameters:
  • object (Atk.Object) – The object which received the signal

  • arg1 (str) – The name of the state which has changed

  • arg2 (bool) – A boolean which indicates whether the state has been set or unset.

The “state-change” signal is emitted when an object’s state changes. The detail value identifies the state type which has changed.

Atk.Object.signals.visible_data_changed(object)
Signal Name:

visible-data-changed

Flags:

RUN_LAST

Parameters:

object (Atk.Object) – The object which received the signal

The “visible-data-changed” signal is emitted when the visual appearance of the object changed.

Property Details

Atk.Object.props.accessible_component_layer
Name:

accessible-component-layer

Type:

int

Default Value:

0

Flags:

READABLE

The accessible layer of this object

Atk.Object.props.accessible_component_mdi_zorder
Name:

accessible-component-mdi-zorder

Type:

int

Default Value:

-2147483648

Flags:

READABLE

The accessible MDI value of this object

Atk.Object.props.accessible_description
Name:

accessible-description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Description of an object, formatted for assistive technology access

Name:

accessible-hypertext-nlinks

Type:

int

Default Value:

0

Flags:

READABLE

The number of links which the current Atk.Hypertext has

Atk.Object.props.accessible_name
Name:

accessible-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Object instance’s name formatted for assistive technology access

Atk.Object.props.accessible_parent
Name:

accessible-parent

Type:

Atk.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Parent of the current accessible as returned by Atk.Object.get_parent()

Atk.Object.props.accessible_role
Name:

accessible-role

Type:

Atk.Role

Default Value:

Atk.Role.UNKNOWN

Flags:

READABLE, WRITABLE

The accessible role of this object

Atk.Object.props.accessible_table_caption
Name:

accessible-table-caption

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Table caption.

Deprecated since version 1.3: Use table-caption-object instead.

Atk.Object.props.accessible_table_caption_object
Name:

accessible-table-caption-object

Type:

Atk.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Is used to notify that the table caption has changed

Atk.Object.props.accessible_table_column_description
Name:

accessible-table-column-description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Accessible table column description.

Deprecated since version 2.12: Use Atk.Table.get_column_description() and Atk.Table.set_column_description() instead.

Atk.Object.props.accessible_table_column_header
Name:

accessible-table-column-header

Type:

Atk.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Accessible table column header.

Deprecated since version 2.12: Use Atk.Table.get_column_header() and Atk.Table.set_column_header() instead.

Atk.Object.props.accessible_table_row_description
Name:

accessible-table-row-description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Accessible table row description.

Deprecated since version 2.12: Use Atk.Table.get_row_description() and Atk.Table.set_row_description() instead.

Atk.Object.props.accessible_table_row_header
Name:

accessible-table-row-header

Type:

Atk.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Accessible table row header.

Deprecated since version 2.12: Use Atk.Table.get_row_header() and Atk.Table.set_row_header() instead.

Atk.Object.props.accessible_table_summary
Name:

accessible-table-summary

Type:

Atk.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Is used to notify that the table summary has changed

Atk.Object.props.accessible_value
Name:

accessible-value

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

Numeric value of this object, in case being and Atk.Value.

Deprecated since version 2.12: Use Atk.Value.get_value_and_text() to get the value, and value-changed signal to be notified on their value changes.