Interface AccessibilityBridge.Host
- Enclosing interface:
AccessibilityBridge
Inbound calls go platform to bridge to host; outbound calls go scene to bridge. A bridge holds exactly one object, and it is the host it was handed.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanperform(long nodeId, Accessible.Action action, Accessible.Argument arg) Performs one action on one node.Rebuilds and publishes now, and returns the tree.voidAsks for a fresh tree on the next frame, and buys the frame.voidAsks for the published tree to be re-stamped with the window's current origin, scale and positioning support, and buys the frame.
-
Method Details
-
requestRepublish
void requestRepublish()Asks for a fresh tree on the next frame, and buys the frame. Safe from any thread; for a client attaching while the scene is idle. -
requestRestamp
void requestRestamp()Asks for the published tree to be re-stamped with the window's current origin, scale and positioning support, and buys the frame. Safe from any thread.Two methods and not one, because they set different flags and the difference is the whole saving: a republish costs a walk and a comparison, a re-stamp costs four numbers. Every node's box is scene-local, so a window that moved has not moved one of them, and a drag that asked for a republish would re-walk the entire tree on every callback the compositor sends to discover exactly that.
-
republishNow
AccessibleTree republishNow()Rebuilds and publishes now, and returns the tree.User-interface thread only, and only from inside the platform's own pump: the two points where a platform asks a question that cannot wait for a frame. It walks and describes; it never lays out and never renders, so it is safe from inside a native callback.
It publishes reentrantly, so the bridge defers every registry obligation — and it therefore asks for a frame whenever it published anything, whatever the layout was doing, because a deferred obligation needs a frame that is going to happen. The only call that asks for nothing is the one that published nothing because nothing was dirty, and that call defers nothing either.
On a scene that has never laid out it publishes nothing and asks for a frame, rather than describing geometry that does not exist: a window whose every control is a zero-size rectangle in the corner is worse than a window with nothing in it, because it looks like an answer. What it returns there is whatever is currently published, which is the empty tree — or, for a bridge that answered
AccessibilityBridge.needsRootBeforeTheFirstFrame(), the window's own node, which is the one thing about a window that is true before it lays out.- Returns:
- the currently published tree
-
perform
Performs one action on one node. Safe from any thread, and the only path from a platform into toolkit state.It resolves nothing itself. It checks that the identifier is in the currently published tree — an immutable read, safe from anywhere, and the one refusal that can honestly be immediate — posts the identifier, and returns. The map from an identifier to the widget that owns it is the scene's and is read only on the user-interface thread, which is also where every real precondition is re-checked: that the node still exists, that its widget is still attached, enabled with every ancestor, showing, and not behind a modal.
There is no bounded wait anywhere here, and that is a decision rather than caution. On one platform the calling thread is the user-interface thread, so a wait would be an instant self-deadlock; and nothing could bound such a wait honestly in any case, since that thread parks with no drain for the whole life of a native file chooser.
- Parameters:
nodeId- the node to act onaction- what to doarg- the argument, orAccessible.Argument.NONE- Returns:
- whether the action was accepted — never whether it is done
-