e268efd612
Implement most of the methods of the
`GtkAccessibleInterface` newly added to Gtk 4 in
Gtk commit [1]
commit 0ca8d74842837b1ad5dc42c1fcff8b1270e5750b
Author: Matthias Clasen <mclasen@redhat.com>
Date: Tue Feb 20 12:18:27 2024 -0500
a11y: Add GtkAccessibleText interface
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
and follow-up commits. The `css::accessibility::XAccessibleText`
interface provides the required functionality.
With a Writer paragraph consisting of the text
"Hello world. And another sentence."
and the word "world" selected, using some of the AT-SPI Text
interface methods via Accerciser's IPython console behaves as expected
now when the paragraph's a11y object is selected in Accerciser's
treeview:
In [9]: text = acc.queryText()
In [10]: text.get_caretOffset()
Out[10]: 11
In [11]: text.getText(0, -1)
Out[11]: 'Hello world. And another sentence.'
In [12]: text.getText(2,5)
Out[12]: 'llo'
In [13]: text.getStringAtOffset(10, pyatspi.TEXT_GRANULARITY_CHAR)
Out[13]: ('d', 10, 11)
In [14]: text.getStringAtOffset(10, pyatspi.TEXT_GRANULARITY_WORD)
Out[14]: ('world', 6, 11)
In [15]: text.getStringAtOffset(10, pyatspi.TEXT_GRANULARITY_SENTENCE)
Out[15]: ('Hello world. ', 0, 13)
In [16]: text.getStringAtOffset(10, pyatspi.TEXT_GRANULARITY_PARAGRAPH)
Out[16]: ('Hello world. And another sentence.', 0, 34)
In [17]: text.getNSelections()
Out[17]: 1
In [18]: text.getSelection(0)
Out[18]: (6, 11)
Actual handling of text attributes is left for later (s. TODO comment
in the newly added `lo_accessible_text_get_attributes`).
[1] 0ca8d74842
Change-Id: Icad236cd87285d9a336883e67b191f633e9e4413
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163733
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
118 lines
3.1 KiB
Makefile
118 lines
3.1 KiB
Makefile
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
# This file incorporates work covered by the following license notice:
|
|
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed
|
|
# with this work for additional information regarding copyright
|
|
# ownership. The ASF licenses this file to you under the Apache
|
|
# License, Version 2.0 (the "License"); you may not use this file
|
|
# except in compliance with the License. You may obtain a copy of
|
|
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
#
|
|
|
|
$(eval $(call gb_Library_Library,vclplug_gtk4))
|
|
|
|
$(eval $(call gb_Library_set_plugin_for,vclplug_gtk4,vcl))
|
|
|
|
# Silence deprecation warnings wholesale as long as vcl/unx/gtk4/*.cxx just
|
|
# forward to vcl/unx/gtk/*.cxx:
|
|
$(eval $(call gb_Library_add_cxxflags,vclplug_gtk4, \
|
|
-Wno-deprecated-declarations \
|
|
))
|
|
|
|
$(eval $(call gb_Library_set_include,vclplug_gtk4,\
|
|
$$(INCLUDE) \
|
|
$$(GTK4_CFLAGS) \
|
|
$$(GSTREAMER_1_0_CFLAGS) \
|
|
-I$(SRCDIR)/vcl/inc \
|
|
-I$(SRCDIR)/vcl/unx \
|
|
-I$(SRCDIR)/vcl/unx/gtk4 \
|
|
))
|
|
|
|
$(eval $(call gb_Library_add_defs,vclplug_gtk4,\
|
|
-DVCLPLUG_GTK_IMPLEMENTATION \
|
|
-DVCL_INTERNALS \
|
|
))
|
|
|
|
$(eval $(call gb_Library_use_custom_headers,vclplug_gtk4,\
|
|
officecfg/registry \
|
|
))
|
|
|
|
$(eval $(call gb_Library_use_sdk_api,vclplug_gtk4))
|
|
|
|
$(eval $(call gb_Library_add_libs,vclplug_gtk4,\
|
|
$(GTK4_LIBS) \
|
|
-lX11 \
|
|
-lXext \
|
|
-lSM \
|
|
-lICE \
|
|
))
|
|
|
|
$(eval $(call gb_Library_use_libraries,vclplug_gtk4,\
|
|
svl \
|
|
tl \
|
|
utl \
|
|
sot \
|
|
ucbhelper \
|
|
basegfx \
|
|
comphelper \
|
|
cppuhelper \
|
|
i18nlangtag \
|
|
i18nutil \
|
|
$(if $(ENABLE_JAVA), \
|
|
jvmaccess) \
|
|
cppu \
|
|
sal \
|
|
))
|
|
|
|
$(eval $(call gb_Library_use_externals,vclplug_gtk4,\
|
|
boost_headers \
|
|
epoxy \
|
|
dbus \
|
|
graphite \
|
|
harfbuzz \
|
|
))
|
|
|
|
$(eval $(call gb_Library_add_exception_objects,vclplug_gtk4,\
|
|
vcl/unx/gtk4/fpicker/resourceprovider \
|
|
vcl/unx/gtk4/fpicker/SalGtkFilePicker \
|
|
vcl/unx/gtk4/fpicker/SalGtkFolderPicker \
|
|
vcl/unx/gtk4/fpicker/SalGtkPicker \
|
|
vcl/unx/gtk4/a11y \
|
|
vcl/unx/gtk4/convert3to4 \
|
|
vcl/unx/gtk4/customcellrenderer \
|
|
vcl/unx/gtk4/gtkaccessibleeventlistener \
|
|
vcl/unx/gtk4/gtkaccessibleregistry \
|
|
vcl/unx/gtk4/gtkaccessibletext \
|
|
vcl/unx/gtk4/gtkdata \
|
|
vcl/unx/gtk4/gtkinst \
|
|
vcl/unx/gtk4/gtksys \
|
|
vcl/unx/gtk4/gtkcairo \
|
|
vcl/unx/gtk4/salnativewidgets-gtk \
|
|
vcl/unx/gtk4/gtkframe \
|
|
vcl/unx/gtk4/gtkobject \
|
|
vcl/unx/gtk4/gtksalmenu \
|
|
vcl/unx/gtk4/glomenu \
|
|
vcl/unx/gtk4/gloactiongroup \
|
|
vcl/unx/gtk4/hudawareness \
|
|
vcl/unx/gtk4/notifyinglayout \
|
|
vcl/unx/gtk4/surfacecellrenderer \
|
|
vcl/unx/gtk4/surfacepaintable \
|
|
vcl/unx/gtk4/transferableprovider \
|
|
))
|
|
|
|
ifeq ($(OS),LINUX)
|
|
$(eval $(call gb_Library_add_libs,vclplug_gtk4,\
|
|
-lm \
|
|
-ldl \
|
|
))
|
|
endif
|
|
|
|
# vim: set noet sw=4 ts=4:
|