Interface

Gtk-4.0GtkAccessibleTextInterface

Interface for implementing AccessibleText. Contains only the virtual methods that need to be implemented.

interface Interface {
    vfunc_get_accessible_parent(): Gtk.Accessible;
    vfunc_get_at_context(): Gtk.ATContext;
    vfunc_get_attributes(
        offset: number,
    ): [boolean, AccessibleTextRange[], string[], string[]];
    vfunc_get_bounds(): [boolean, number, number, number, number];
    vfunc_get_caret_position(): number;
    vfunc_get_contents(start: number, end: number): GLib.Bytes;
    vfunc_get_contents_at(
        offset: number,
        granularity: Gtk.AccessibleTextGranularity,
    ): [GLib.Bytes, number, number];
    vfunc_get_default_attributes(): [string[], string[]];
    vfunc_get_extents(
        start: number,
        end: number,
        extents: Graphene.Rect,
    ): boolean;
    vfunc_get_first_accessible_child(): Gtk.Accessible;
    vfunc_get_next_accessible_sibling(): Gtk.Accessible;
    vfunc_get_offset(point: Graphene.Point): [boolean, number];
    vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
    vfunc_get_selection(): [boolean, AccessibleTextRange[]];
}

Hierarchy (View Summary)

Index

Methods

  • Retrieves the text attributes inside the accessible object.

    Each attribute is composed by:

    • a range
    • 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.

    If this function returns true, n_ranges will be set to a value greater than or equal to one, ranges will be set to a newly allocated array of [struct#Gtk.AccessibleTextRange].

    Parameters

    • offset: number

      the offset, in characters

    Returns [boolean, AccessibleTextRange[], string[], string[]]

  • Retrieves the position of the caret inside the accessible object.

    Returns number

  • 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.

    Parameters

    • start: number

      the beginning of the range, in characters

    • end: number

      the end of the range, in characters

    Returns GLib.Bytes

  • 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.

    Returns [string[], string[]]

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

    Parameters

    • start: number

      the start offset, in characters

    • end: number

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

    • extents: Graphene.Rect

    Returns boolean

  • Retrieves the selection ranges in the accessible object.

    If this function returns true, n_ranges will be set to a value greater than or equal to one, and ranges will be set to a newly allocated array of [struct#Gtk.AccessibleTextRange].

    Returns [boolean, AccessibleTextRange[]]

Methods - Inherited from Gtk.Accessible.Interface

  • Queries the coordinates and dimensions of this accessible

    This functionality can be overridden by Gtk.Accessible implementations, e.g. to get the bounds from an ignored child widget.

    Returns [boolean, number, number, number, number]