Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
accessibility_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3// Cross-platform entry point for the OS-native accessibility provider.
4//
5// Each platform ships its own `accessibility_<platform>.cpp` that
6// defines `init_accessibility(View&, void* native_window)`. The header
7// keeps the call site cross-platform so widgets and WindowHost can
8// invoke a single function; the platform TU handles the OS nuance.
9//
10// The "provider" concept matches the Windows UIA / Linux AT-SPI
11// architecture: the OS asks the plugin window for a provider object,
12// which then walks the View tree and surfaces each View's access_role /
13// access_label / access_value / access_bounds to the screen reader.
14//
15// macOS / iOS use NSAccessibility / UIAccessibility on the view side
16// directly and do not route through init_accessibility().
17
18#include <cstdint>
19#include <memory>
20#include <string>
21
22namespace pulp::view {
23
24class View;
25
37void* init_accessibility(View& root, void* native_window);
38
40void shutdown_accessibility(void* handle);
41
45void accessibility_tree_changed(void* handle);
46
53 std::shared_ptr<void> owner) noexcept;
54
63 std::shared_ptr<void> owner) noexcept;
64
65namespace detail {
70void register_accessibility_provider(View& root, void* handle);
72} // namespace detail
73
82void accessibility_pump(void* handle);
83
84// ── Event-raising surface ────────────────────────────────────────────────
85//
86// Widgets call these when their accessibility-relevant state changes so
87// the platform provider can raise the matching OS event. A no-op on
88// platforms that have no provider attached (or no accessibility clients
89// listening). Safe to call from the UI thread — the implementation is
90// cheap when no assistive tech is active.
91//
92// The `handle` is the opaque returned by init_accessibility().
93
99void notify_accessibility_value_changed(void* handle, View& target);
100
104void notify_accessibility_focus_changed(void* handle, View& target);
105
109void notify_accessibility_name_changed(void* handle, View& target);
110
111#if defined(__linux__) && !defined(__ANDROID__)
121void* init_accessibility_on_session_bus_for_test(View& root,
122 std::string* out_bus_name);
123#endif
124
125} // namespace pulp::view
Definition view.hpp:73
Definition accessibility_provider.hpp:65
void register_accessibility_provider(View &root, void *handle)
Provider-backend lifecycle plumbing.
void unregister_accessibility_provider(void *handle)
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
void * init_accessibility(View &root, void *native_window)
Initialize the OS accessibility bridge for this root view.
void shutdown_accessibility(void *handle)
Release any OS-side resources acquired in init_accessibility.
void accessibility_retain_until_retired(void *handle, std::shared_ptr< void > owner) noexcept
void notify_accessibility_value_changed(void *handle, View &target)
Notify the provider that a View's access_value has changed.
void notify_accessibility_focus_changed(void *handle, View &target)
Notify the provider that focus moved to a different View.
void accessibility_pump(void *handle)
Service any pending accessibility IPC for this handle.
void notify_accessibility_name_changed(void *handle, View &target)
Notify the provider that a View's accessible name or role changed (e.g.
void accessibility_tree_will_change(void *handle)
Make every cached native node inert before a caller starts destructively editing the View tree.
void accessibility_tree_changed(void *handle)
Request the provider to re-walk the View tree.
bool accessibility_tree_retirement_ready(void *handle)