The text retrieved using `gtk_accessible_text_get_contents`
already contains only the character at the given offset,
and so the character is at index 0 in `str`, rather than at
the same offset again, so adjust this accordingly.
With this in place, querying the character in a
LibreOffice paragraph consisting of the text
"Hello world." now gives the expected results
with a pending LibreOffice change [1] to support
the new GtkAccessibleText interface:
In [1]: text = acc.queryText()
In [2]: text.getCharacterAtOffset(0)
Out[2]: 72
In [3]: text.getCharacterAtOffset(1)
Out[3]: 101
In [4]: text.getCharacterAtOffset(2)
Out[4]: 108
In [5]: text.getCharacterAtOffset(3)
Out[5]: 108
In [6]: text.getCharacterAtOffset(4)
Out[6]: 111
Previously, this would only work correctly
for an index of 0:
In [1]: text = acc.queryText()
In [2]: text.getCharacterAtOffset(0)
Out[2]: 72
In [3]: text.getCharacterAtOffset(1)
Out[3]: 0
In [4]: text.getCharacterAtOffset(2)
Out[4]: 0
In [5]: text.getCharacterAtOffset(3)
Out[5]: 0
In [6]: text.getCharacterAtOffset(4)
Out[6]: 0
[1] https://gerrit.libreoffice.org/c/core/+/163733
This command can be used to compare the rendering of a node
to a reference image. It can also be used to compare the
renderings of two nodes, or to compare two images.
We are going to use it in the AccessibleText implementations, so there's
no need to have it under a11y.
Also, change the apis from taking a GVariantBuilder to just return
plain arrays.
The AccessibleText interface is meant to be implemented by widgets and
other accessible objects that expose selectable, navigatable, or rich
text to assistive technologies.
This kind of text is not covered by the plain accessible name and
description, as it contains things like a caret, or text attributes.
This commit adds a stub GtkAccessibleText with its basic virtual
functions; the interface will be implemented by widgets like GtkLabel,
GtkInscription, GtkText, and GtkTextView. A further commit will ensure
that the AT-SPI implementation will convert from GTK to AT-SPI through a
generic (internal API); and, finally, we'll remove the widget type
checks in the AT-SPI implementation of GtkATContext, and only check for
GtkAccessibleText.
Fixes: #5912
The use cases for and reasons of having Gtk.SearchEntries
is wide range. Thus, it makes sense to let users of it
manually set input-purpose and input-hints for improved
input method support there.
see: https://gitlab.gnome.org/GNOME/Initiatives/-/issues/50
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
gtk_editable_delete_text() takes a half-open interval, and accepts
an end_pos of -1 to mean 'all the way'. The GtkText implementation
was not handling these details correctly.
Unspecified attributes are not interpreted as "leave this feature out",
rather as "pick a default value". For depth, stencil and accum bits the
defaults may be different than 0. For example, with AMD drivers we get:
* WGL_DEPTH_BITS_ARB: 32
* WGL_STENCIL_BITS_ARB: 8
* WGL_ACCUM_BITS_ARB: 0
Set the attributes to 0 as a hint that depth, stencil and accum buffers
should not be created.
The driver may still create them (matching criteria is "minimum" [1]),
but that's outside of our control (and unlikely to happen).
References:
[1] - WGL_ARB_pixel_format specification
https://registry.khronos.org/OpenGL/extensions/ARB/WGL_ARB_pixel_format.txt
See #6401
This fixes monitor enter and leave events on X11, and probably other
things. Previously, it looks like the coordinates were relative to the
top left corner of the window shadow and so never changed.