Expand description
Modifier node scaffolding for Cranpose.
This module defines the foundational pieces of the Cranpose
Modifier.Node system. It introduces traits for modifier nodes and their
contexts as well as a lightweight chain container that reconciles nodes
across updates.
Structs§
- Basic
Modifier Node Context - Lightweight
ModifierNodeContextimplementation that records invalidation requests and update signals. - Canvas
Semantics Node - A semantics node for content that is drawn rather than laid out.
- Collection
Info - How far a container has scrolled along one axis and how far it can go.
- Constraints
- Constraints used during layout measurement.
- Modifier
Chain Iter - Iterator walking a modifier chain by indexing into
ordered_nodes. - Modifier
Chain Node Ref - Modifier
Invalidation - Records an invalidation request together with the capability mask that triggered it.
- Modifier
Node Chain - Chain of modifier nodes attached to a layout node.
- Node
Capabilities - Capability flags indicating which specialized traits a modifier node implements.
- Node
State - Runtime state tracked for every
ModifierNode. - Progress
BarRange Info - The value a control holds inside a range, for a slider, a dial or a progress bar.
- Scroll
Axis Range - This is Compose’s
ScrollAxisRange(verticalScrollAxisRange,horizontalScrollAxisRange). A lazy list has no whole extent to give, so it reports the first visible item as the value and one more than that as the end while it can still scroll; a reader only needs to know whether it can page on. - Semantics
Configuration - Semantics configuration for accessibility.
- Semantics
Custom Action - A named accessibility operation, e.g. Compose’s
customActions = listOf(CustomAccessibilityAction("Pause") { … }). - Semantics
Dismiss - What a control does when a screen reader asks to send it away: a row a
sighted person swipes off, a sheet a sighted person taps outside of.
Compose’s
dismissaction. - Semantics
Expand - What a control does when a screen reader asks it to open or to close.
Compose’s
expandandcollapseactions. - Semantics
Long Click - What a control does when a screen reader asks for its long press. This is
Compose’s
SemanticsActions.OnLongClick; the answer says whether the control took the ask. - Semantics
Magic Tap - What a control does when a VoiceOver user makes the magic tap, the two
finger double tap that starts or stops the main action of a screen. On
the other platforms the action is listed by its label among the control’s
actions. SwiftUI’s
accessibilityAction(.magicTap); the answer says whether the control took the tap. - Semantics
Reach - The semantics flags that decide how a node’s semantics reach the tree:
which part of a window is live (
SemanticsConfiguration::is_modalandSemanticsConfiguration::hidden), and whether a tree update may keep what the node reported last. - Semantics
Scroll By - What a container does when a screen reader pages it, e.g. TalkBack’s scroll forward action or an accesskit scroll down. The two deltas are in layout pixels; the answer says whether anything moved.
- Semantics
Scroll ToIndex - What a list does when a screen reader asks for the row at an index, e.g. a TalkBack scroll-to-position action.
- Semantics
SetProgress - What a control does when a screen reader moves its value, e.g. a VoiceOver swipe up or a TalkBack set-progress action.
- Semantics
SetSelection - What a text field does when a screen reader moves its caret or picks a
stretch of its text: the two ends of the new selection, as byte offsets
into the field’s text, the anchor first and the end that moves second. Equal
ends are a caret. This is Compose’s
SemanticsActions.SetSelection; the answer says whether the field took the selection. - Semantics
SetText - What a text field does when a screen reader or a voice tool hands it new
text. This is Compose’s
SemanticsActions.SetText; the answer says whether the field took the text. - Size
Enums§
- Focus
State - Focus state of a focus target node.
- Invalidation
Kind - Identifies which part of the rendering pipeline should be invalidated after a modifier node changes state.
- Live
Region Mode - How urgently a screen reader reads a node whose text changed on its own.
- Semantics
Widget Role - What kind of control a node is, as screen readers announce it.
Traits§
- AnyModifier
Element - Type-erased modifier element used by the runtime to reconcile chains.
- Delegatable
Node - Provides traversal helpers that mirror Jetpack Compose’s
DelegatableNodecontract. - Draw
Modifier Node - Marker trait for draw-specific modifier nodes.
- Draw
Scope - Focus
Node - Marker trait for focus modifier nodes.
- Layout
Modifier Node - Marker trait for layout-specific modifier nodes.
- Measurable
- Object capable of measuring a layout child and exposing intrinsic sizes.
- Modifier
Node - Core trait implemented by modifier nodes.
- Modifier
Node Context - Runtime services exposed to modifier nodes while attached to a tree.
- Modifier
Node Element - Strongly typed modifier elements that can create and update nodes while exposing equality/hash/inspector contracts that mirror Jetpack Compose.
- Pointer
Input Node - Marker trait for pointer input modifier nodes.
- Semantics
Node - Marker trait for semantics modifier nodes.
Functions§
- modifier_
element - Convenience helper for callers to construct a type-erased modifier element without having to mention the internal wrapper type.
Type Aliases§
- DynModifier
Element - Boxed type-erased modifier element.
- Modifier
Invalidations - The invalidations a node’s modifier update requested: at most one per
InvalidationKind, held inline so handing them over allocates nothing. - Node
Draw Closure - A deferred draw closure returned by
DrawModifierNode::create_draw_closure: it records into a scope the renderer provides at render time, so the recording’s identity stays with the consumer rather than with a closure-owned vector. - Semantics
Spec - One value that says what a screen reader reads for a node, built up with
the methods below and handed to
Modifier::semantics_spec.