AccessKit's C bindings through a C++23 module: one accessibility tree, served to every platform's assistive technology.
English · 简体中文 · Upstream · Releases · mcpp · Index
mcpplibs.mwrap.accesskit 0.23.1 exports every public name of <accesskit.h>
unchanged: accesskit_node_new, ACCESSKIT_ROLE_BUTTON,
accesskit_tree_update_push_node, the platform adapters
(accesskit_unix_adapter_* on Linux, accesskit_windows_subclassing_adapter_*
on Windows, accesskit_macos_subclassing_adapter_* on macOS) under the same
conditions the header declares them. A UI builds its tree of nodes and AccessKit
serves it to UI Automation, NSAccessibility or AT-SPI, and hands back what a
screen reader or voice control asks of it.
The library itself is compat.accesskit 0.23.1: upstream's prebuilt static
library (it is Rust) for Linux x86_64, macOS arm64 and Windows x86_64.
mcpp new hello --template mcpplibs.mwrap.accesskit@0.23.1
cd hello
mcpp runimport std;
import mcpplibs.mwrap.accesskit;
int main() {
accesskit_node* window = accesskit_node_new(ACCESSKIT_ROLE_WINDOW);
accesskit_node_set_label(window, "Settings");
accesskit_tree_update* update = accesskit_tree_update_with_focus(1);
accesskit_tree_update_set_tree_info(update, accesskit_tree_info_new(1));
accesskit_tree_update_push_node(update, 1, window);
char* debug = accesskit_tree_update_debug(update);
std::println("{}", debug);
accesskit_string_free(debug);
accesskit_tree_update_free(update);
}src/accesskit.cppm is generated from the header by tools/gen_module.py
(CI checks it is current): functions, structs, typedefs, enums and every
enumerator, nothing renamed, nothing added. The header has no macros to map.
The wrapper is Apache-2.0 (LICENSE); AccessKit is MIT or Apache-2.0 (upstream/LICENSE-MIT, upstream/LICENSE-APACHE). See NOTICE.