module Gtk::Accessible

Overview

An interface for describing UI elements for Assistive Technologies.

Every accessible implementation has:

The role cannot be changed after instantiating a Gtk::Accessible 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 Gtk::Widget visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN state will also change to reflect the Gtk::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 Gtk::Accessible#accessible_parent, Gtk::Accessible#first_accessible_child and Gtk::Accessible#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 Gtk::Accessible#accessible_parent= and updating the sibling by Gtk::Accessible#update_next_accessible_sibling.

Direct including types

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/accessible.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.cast(obj : GObject::Object) : self #

Cast a GObject::Object to self, throws a TypeCastError if the cast can't be made.


Class Method Detail

def self.cast?(obj : GObject::Object) : self | Nil #

def self.g_type : UInt64 #

Instance Method Detail

def accessible_parent : Gtk::Accessible | Nil #

def accessible_role : Gtk::AccessibleRole #

def accessible_role=(value : Gtk::AccessibleRole) : Gtk::AccessibleRole #

def announce(message : String, priority : Gtk::AccessibleAnnouncementPriority) : Nil #

def at_context : Gtk::ATContext #

def bounds(x : Int32, y : Int32, width : Int32, height : Int32) : Bool #

def first_accessible_child : Gtk::Accessible | Nil #

def next_accessible_sibling : Gtk::Accessible | Nil #

def platform_state(state : Gtk::AccessiblePlatformState) : Bool #

def reset_property(property : Gtk::AccessibleProperty) : Nil #

def reset_relation(relation : Gtk::AccessibleRelation) : Nil #

def reset_state(state : Gtk::AccessibleState) : Nil #

def set_accessible_parent(parent : Gtk::Accessible | Nil, next_sibling : Gtk::Accessible | Nil) : Nil #

abstract def to_unsafe #

def update_next_accessible_sibling(new_sibling : Gtk::Accessible | Nil) : Nil #

def update_platform_state(state : Gtk::AccessiblePlatformState) : Nil #

def update_property(properties : Enumerable(Gtk::AccessibleProperty), values : Enumerable(_)) : Nil #

def update_relation(relations : Enumerable(Gtk::AccessibleRelation), values : Enumerable(_)) : Nil #

def update_state(states : Enumerable(Gtk::AccessibleState), values : Enumerable(_)) : Nil #