Module: Atk

Defined in:
atk/lib/atk.rb

Overview

Version:

  • 1.0

Defined Under Namespace

Modules: Action, Component, CoordType, Document, EditableText, HyperlinkImpl, HyperlinkStateFlags, Hypertext, Image, ImplementorIface, KeyEventType, Layer, RelationType, Role, ScrollType, Selection, StateType, StreamableContent, Table, TableCell, Text, TextAttribute, TextBoundary, TextClipType, TextGranularity, Value, ValueType, Version, Window Classes: GObjectAccessible, Hyperlink, Loader, Misc, NoOpObject, NoOpObjectFactory, Object, ObjectFactory, Plug, Registry, Relation, RelationSet, Socket, StateSet, TextRectangle, Util

Constant Summary collapse

BINARY_AGE =

Like atk_get_binary_age(), but from the headers used at application compile time, rather than from the library linked against at application run time.

23511
INTERFACE_AGE =

Like atk_get_interface_age(), but from the headers used at application compile time, rather than from the library linked against at application run time.

1
MAJOR_VERSION =

Like atk_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

2
MICRO_VERSION =

Like atk_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

1
MINOR_VERSION =

Like atk_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

35
VERSION_MIN_REQUIRED =

A macro that should be defined by the user prior to including the atk/atk.h header. The definition should be one of the predefined ATK version macros: %ATK_VERSION_2_12, %ATK_VERSION_2_14,…

This macro defines the earliest version of ATK that the package is required to be able to compile against.

If the compiler is configured to warn about the use of deprecated functions, then using functions that were deprecated in version %ATK_VERSION_MIN_REQUIRED or earlier will cause warnings (but using functions deprecated in later releases will not).

2
LOG_DOMAIN =
"Atk"

Instance Method Summary collapse

Instance Method Details

#add_focus_tracker(focus_tracker) ⇒ Integer

Adds the specified function to the list of functions to be called when an object receives focus. when an object receives focus.

Parameters:

  • focus_tracker (Atk::EventListener)

    Function to be added to the list of functions to be called

Returns:

  • (Integer)

    added focus tracker id, or 0 on failure.

#add_global_event_listener(listener, event_type) ⇒ Integer

Adds the specified function to the list of functions to be called when an ATK event of type event_type occurs.

The format of event_type is the following:

"ATK:<atk_type>:<atk_event>:<atk_event_detail>

Where “ATK” works as the namespace, <atk_interface> is the name of the ATK type (interface or object), <atk_event> is the name of the signal defined on that interface and <atk_event_detail> is the gsignal detail of that signal. You can find more info about gsignal details here: developer.gnome.org/gobject/stable/gobject-Signals.html

The first three parameters are mandatory. The last one is optional.

For example:

ATK:AtkObject:state-change
ATK:AtkText:text-selection-changed
ATK:AtkText:text-insert:system

Toolkit implementor note: ATK provides a default implementation for this virtual method. ATK implementors are discouraged from reimplementing this method.

Toolkit implementor note: this method is not intended to be used by ATK implementors but by ATK consumers.

ATK consumers note: as this method adds a listener for a given ATK type, that type should be already registered on the GType system before calling this method. A simple way to do that is creating an instance of Atk::NoOpObject. This class implements all ATK interfaces, so creating the instance will register all ATK types as a collateral effect.

Parameters:

  • listener (GObject::SignalEmissionHook)

    the listener to notify

  • event_type (String)

    the type of event for which notification is requested

Returns:

  • (Integer)

    added event listener id, or 0 on failure.

#add_key_event_listener(listener, data) ⇒ Integer

Adds the specified function to the list of functions to be called

when a key event occurs.  The <b>data</b> element will be passed to the
Atk::KeySnoopFunc (<b>listener</b>) as the <b>func_data</b> param, on notification.

Parameters:

  • listener (Atk::KeySnoopFunc)

    the listener to notify

  • data (GObject)

    a #gpointer that points to a block of data that should be sent to the registered listeners, along with the event notification, when it occurs.

Returns:

  • (Integer)

    added event listener id, or 0 on failure.

#attribute_set_free(attrib_set) ⇒ nil

Frees the memory used by an Atk::AttributeSet, including all its Atk::Attributes.

Parameters:

  • attrib_set (Atk::AttributeSet)

    The Atk::AttributeSet to free

Returns:

  • (nil)

#binary_ageInteger

Returns the binary age as passed to libtool when building the ATK library the process is running against.

Returns:

  • (Integer)

    the binary age of the ATK library

#default_registryAtk::Registry

Gets a default implementation of the Atk::ObjectFactory/type registry. Note: For most toolkit maintainers, this will be the correct registry for registering new Atk::Object factories. Following a call to this function, maintainers may call atk_registry_set_factory_type() to associate an Atk::ObjectFactory subclass with the GType of objects for whom accessibility information will be provided. Atk::ObjectFactory/type registry

Returns:

#focus_objectAtk::Object

Gets the currently focused object. application

Returns:

  • (Atk::Object)

    the currently focused object for the current

#focus_tracker_init(init) ⇒ nil

Specifies the function to be called for focus tracker initialization. This function should be called by an implementation of the ATK interface if any specific work needs to be done to enable focus tracking.

Parameters:

  • init (Atk::EventListenerInit)

    Function to be called for focus tracker initialization

Returns:

  • (nil)

#focus_tracker_notify(object) ⇒ nil

Cause the focus tracker functions which have been specified to be executed for the object.

Parameters:

Returns:

  • (nil)

#interface_ageInteger

Returns the interface age as passed to libtool when building the ATK library the process is running against.

Returns:

  • (Integer)

    the interface age of the ATK library

#major_versionInteger

Returns the major version number of the ATK library. (e.g. in ATK version 2.7.4 this is 2.)

This function is in the library, so it represents the ATK library your code is running against. In contrast, the #ATK_MAJOR_VERSION macro represents the major version of the ATK headers you have included when compiling your code.

Returns:

  • (Integer)

    the major version number of the ATK library

#micro_versionInteger

Returns the micro version number of the ATK library. (e.g. in ATK version 2.7.4 this is 4.)

This function is in the library, so it represents the ATK library your code is are running against. In contrast, the #ATK_MICRO_VERSION macro represents the micro version of the ATK headers you have included when compiling your code.

Returns:

  • (Integer)

    the micro version number of the ATK library

#minor_versionInteger

Returns the minor version number of the ATK library. (e.g. in ATK version 2.7.4 this is 7.)

This function is in the library, so it represents the ATK library your code is are running against. In contrast, the #ATK_MINOR_VERSION macro represents the minor version of the ATK headers you have included when compiling your code.

Returns:

  • (Integer)

    the minor version number of the ATK library

#relation_type_for_name(name) ⇒ Atk::RelationType

Get the Atk::RelationType type corresponding to a relation name.

Parameters:

  • name (String)

    a string which is the (non-localized) name of an ATK relation type.

Returns:

  • (Atk::RelationType)

    the Atk::RelationType enumerated type corresponding to the specified name, or #ATK_RELATION_NULL if no matching relation type is found.

#relation_type_get_name(type) ⇒ String

Gets the description string describing the Atk::RelationType type.

Parameters:

Returns:

  • (String)

    the string describing the AtkRelationType

#relation_type_register(name) ⇒ Atk::RelationType

Associate name with a new Atk::RelationType

Parameters:

  • name (String)

    a name string

Returns:

#remove_focus_tracker(tracker_id) ⇒ nil

Removes the specified focus tracker from the list of functions to be called when any object receives focus.

Parameters:

  • tracker_id (Integer)

    the id of the focus tracker to remove

Returns:

  • (nil)

#remove_global_event_listener(listener_id) ⇒ nil

listener_id is the value returned by #atk_add_global_event_listener when you registered that event listener.

Toolkit implementor note: ATK provides a default implementation for this virtual method. ATK implementors are discouraged from reimplementing this method.

Toolkit implementor note: this method is not intended to be used by ATK implementors but by ATK consumers.

Removes the specified event listener

Parameters:

  • listener_id (Integer)

    the id of the event listener to remove

Returns:

  • (nil)

#remove_key_event_listener(listener_id) ⇒ nil

listener_id is the value returned by #atk_add_key_event_listener when you registered that event listener.

Removes the specified event listener.

Parameters:

  • listener_id (Integer)

    the id of the event listener to remove

Returns:

  • (nil)

#role_for_name(name) ⇒ Atk::Role

Get the Atk::Role type corresponding to a rolew name.

Parameters:

  • name (String)

    a string which is the (non-localized) name of an ATK role.

Returns:

  • (Atk::Role)

    the Atk::Role enumerated type corresponding to the specified name, or #ATK_ROLE_INVALID if no matching role is found.

#role_get_localized_name(role) ⇒ String

Gets the localized description string describing the Atk::Role role.

Parameters:

  • role (Atk::Role)

    The Atk::Role whose localized name is required

Returns:

  • (String)

    the localized string describing the AtkRole

#role_get_name(role) ⇒ String

Gets the description string describing the Atk::Role role.

Parameters:

  • role (Atk::Role)

    The Atk::Role whose name is required

Returns:

  • (String)

    the string describing the AtkRole

#role_register(name) ⇒ Atk::Role

Registers the role specified by name. name must be a meaningful name. So it should not be empty, or consisting on whitespaces. properly. ATK_ROLE_INVALID in case of error.

Parameters:

  • name (String)

    a character string describing the new role.

Returns:

  • (Atk::Role)

    an Atk::Role for the new role if added

#rootAtk::Object

Gets the root accessible container for the current application. application

Returns:

  • (Atk::Object)

    the root accessible container for the current

#state_type_for_name(name) ⇒ Atk::StateType

Gets the Atk::StateType corresponding to the description string name.

Parameters:

  • name (String)

    a character string state name

Returns:

#state_type_get_name(type) ⇒ String

Gets the description string describing the Atk::StateType type.

Parameters:

Returns:

  • (String)

    the string describing the AtkStateType

#state_type_register(name) ⇒ Atk::StateType

Register a new object state.

Parameters:

  • name (String)

    a character string describing the new state.

Returns:

#text_attribute_for_name(name) ⇒ Atk::TextAttribute

Get the Atk::TextAttribute type corresponding to a text attribute name.

Parameters:

  • name (String)

    a string which is the (non-localized) name of an ATK text attribute.

Returns:

  • (Atk::TextAttribute)

    the Atk::TextAttribute enumerated type corresponding to the specified name, or #ATK_TEXT_ATTRIBUTE_INVALID if no matching text attribute is found.

#text_attribute_get_name(attr) ⇒ String

Gets the name corresponding to the Atk::TextAttribute

Parameters:

Returns:

  • (String)

    a string containing the name; this string should not be freed

#text_attribute_get_value(attr, index_) ⇒ String

Gets the value for the index of the Atk::TextAttribute should not be freed; nil is returned if there are no values maintained for the attr value.

Parameters:

  • attr (Atk::TextAttribute)

    The Atk::TextAttribute for which a value is required

  • index_ (Integer)

    The index of the required value

Returns:

  • (String)

    a string containing the value; this string

#text_attribute_register(name) ⇒ Atk::TextAttribute

Associate name with a new Atk::TextAttribute

Parameters:

  • name (String)

    a name string

Returns:

#text_free_ranges(ranges) ⇒ nil

Frees the memory associated with an array of AtkTextRange. It is assumed that the array was returned by the function atk_text_get_bounded_ranges and is NULL terminated.

Parameters:

  • ranges (Array<Atk::TextRange>)

    A pointer to an array of Atk::TextRange which is to be freed.

Returns:

  • (nil)

#toolkit_nameString

Gets name string for the GUI toolkit implementing ATK for this application.

Returns:

  • (String)

    name string for the GUI toolkit implementing ATK for this application

#toolkit_versionString

Gets version string for the GUI toolkit implementing ATK for this application.

Returns:

  • (String)

    version string for the GUI toolkit implementing ATK for this application

#value_type_get_localized_name(value_type) ⇒ String

Gets the localized description string describing the Atk::ValueType value_type.

Parameters:

  • value_type (Atk::ValueType)

    The Atk::ValueType whose localized name is required

Returns:

  • (String)

    the localized string describing the Atk::ValueType

#value_type_get_name(value_type) ⇒ String

Gets the description string describing the Atk::ValueType value_type.

Parameters:

  • value_type (Atk::ValueType)

    The Atk::ValueType whose name is required

Returns:

  • (String)

    the string describing the Atk::ValueType

#versionString

Gets the current version for ATK.

Returns:

  • (String)

    version string for ATK