Skip to main content

Module modifier

Module modifier 

Source
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§

BasicModifierNodeContext
Lightweight ModifierNodeContext implementation that records invalidation requests and update signals.
CanvasSemanticsNode
A semantics node for content that is drawn rather than laid out.
CollectionInfo
How far a container has scrolled along one axis and how far it can go.
Constraints
Constraints used during layout measurement.
ModifierChainIter
Iterator walking a modifier chain by indexing into ordered_nodes.
ModifierChainNodeRef
ModifierInvalidation
Records an invalidation request together with the capability mask that triggered it.
ModifierNodeChain
Chain of modifier nodes attached to a layout node.
NodeCapabilities
Capability flags indicating which specialized traits a modifier node implements.
NodeState
Runtime state tracked for every ModifierNode.
ProgressBarRangeInfo
The value a control holds inside a range, for a slider, a dial or a progress bar.
ScrollAxisRange
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.
SemanticsConfiguration
Semantics configuration for accessibility.
SemanticsCustomAction
A named accessibility operation, e.g. Compose’s customActions = listOf(CustomAccessibilityAction("Pause") { … }).
SemanticsDismiss
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 dismiss action.
SemanticsExpand
What a control does when a screen reader asks it to open or to close. Compose’s expand and collapse actions.
SemanticsLongClick
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.
SemanticsMagicTap
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.
SemanticsReach
The semantics flags that decide how a node’s semantics reach the tree: which part of a window is live (SemanticsConfiguration::is_modal and SemanticsConfiguration::hidden), and whether a tree update may keep what the node reported last.
SemanticsScrollBy
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.
SemanticsScrollToIndex
What a list does when a screen reader asks for the row at an index, e.g. a TalkBack scroll-to-position action.
SemanticsSetProgress
What a control does when a screen reader moves its value, e.g. a VoiceOver swipe up or a TalkBack set-progress action.
SemanticsSetSelection
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.
SemanticsSetText
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§

FocusState
Focus state of a focus target node.
InvalidationKind
Identifies which part of the rendering pipeline should be invalidated after a modifier node changes state.
LiveRegionMode
How urgently a screen reader reads a node whose text changed on its own.
SemanticsWidgetRole
What kind of control a node is, as screen readers announce it.

Traits§

AnyModifierElement
Type-erased modifier element used by the runtime to reconcile chains.
DelegatableNode
Provides traversal helpers that mirror Jetpack Compose’s DelegatableNode contract.
DrawModifierNode
Marker trait for draw-specific modifier nodes.
DrawScope
FocusNode
Marker trait for focus modifier nodes.
LayoutModifierNode
Marker trait for layout-specific modifier nodes.
Measurable
Object capable of measuring a layout child and exposing intrinsic sizes.
ModifierNode
Core trait implemented by modifier nodes.
ModifierNodeContext
Runtime services exposed to modifier nodes while attached to a tree.
ModifierNodeElement
Strongly typed modifier elements that can create and update nodes while exposing equality/hash/inspector contracts that mirror Jetpack Compose.
PointerInputNode
Marker trait for pointer input modifier nodes.
SemanticsNode
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§

DynModifierElement
Boxed type-erased modifier element.
ModifierInvalidations
The invalidations a node’s modifier update requested: at most one per InvalidationKind, held inline so handing them over allocates nothing.
NodeDrawClosure
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.
SemanticsSpec
One value that says what a screen reader reads for a node, built up with the methods below and handed to Modifier::semantics_spec.