Basic Slint accessibility support (#1294)

Implement basic accessibility (a11y) support, using the Qt backend.

_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_

Parts of this PR:

* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct 
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
This commit is contained in:
Tobias Hunger 2022-06-08 20:42:10 +02:00 committed by GitHub
parent dc7117eeb1
commit 07ad20a09c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1855 additions and 39 deletions

View file

@ -180,10 +180,12 @@ private:
};
constexpr inline ItemTreeNode make_item_node(uint32_t child_count, uint32_t child_index,
uint32_t parent_index, uint32_t item_array_index)
uint32_t parent_index, uint32_t item_array_index,
bool is_accessible)
{
return ItemTreeNode { ItemTreeNode::Item_Body { ItemTreeNode::Tag::Item, child_count,
child_index, parent_index, item_array_index } };
return ItemTreeNode { ItemTreeNode::Item_Body { ItemTreeNode::Tag::Item, is_accessible,
child_count, child_index, parent_index,
item_array_index } };
}
constexpr inline ItemTreeNode make_dyn_node(std::uintptr_t offset, std::uint32_t parent_index)