pub struct LayoutNode {
pub modifier: Modifier,
pub measure_policy: Rc<dyn MeasurePolicy>,
pub children: IndexSet<NodeId>,
/* private fields */
}Fields§
§modifier: Modifier§measure_policy: Rc<dyn MeasurePolicy>§children: IndexSet<NodeId>The actual children of this node (folded view - includes virtual nodes as-is)
Implementations§
Source§impl LayoutNode
impl LayoutNode
pub fn new(modifier: Modifier, measure_policy: Rc<dyn MeasurePolicy>) -> Self
Sourcepub fn new_virtual() -> Self
pub fn new_virtual() -> Self
Create a virtual LayoutNode for subcomposition slot containers. Virtual nodes are transparent - their children are flattened into parent’s children list.
pub fn set_modifier(&mut self, modifier: Modifier)
pub fn set_measure_policy(&mut self, policy: Rc<dyn MeasurePolicy>)
Sourcepub fn mark_needs_measure(&self)
pub fn mark_needs_measure(&self)
Mark this node as needing measure. Also marks it as needing layout.
Sourcepub fn mark_needs_layout(&self)
pub fn mark_needs_layout(&self)
Mark this node as needing layout (but not necessarily measure).
Sourcepub fn mark_needs_redraw(&self)
pub fn mark_needs_redraw(&self)
Mark this node as needing redraw without forcing measure/layout.
Sourcepub fn needs_measure(&self) -> bool
pub fn needs_measure(&self) -> bool
Check if this node needs measure.
Sourcepub fn needs_layout(&self) -> bool
pub fn needs_layout(&self) -> bool
Check if this node needs layout.
Sourcepub fn mark_needs_semantics(&self)
pub fn mark_needs_semantics(&self)
Mark this node as needing semantics recomputation.
Sourcepub fn needs_semantics(&self) -> bool
pub fn needs_semantics(&self) -> bool
Returns true when semantics need to be recomputed.
Sourcepub fn needs_redraw(&self) -> bool
pub fn needs_redraw(&self) -> bool
Returns true when this node requested a redraw since the last render pass.
pub fn clear_needs_redraw(&self)
Sourcepub fn mark_needs_pointer_pass(&self)
pub fn mark_needs_pointer_pass(&self)
Marks this node as needing a fresh pointer-input pass.
Sourcepub fn needs_pointer_pass(&self) -> bool
pub fn needs_pointer_pass(&self) -> bool
Returns true when pointer-input state needs to be recomputed.
Sourcepub fn clear_needs_pointer_pass(&self)
pub fn clear_needs_pointer_pass(&self)
Clears the pointer-input dirty flag after hosts service it.
Sourcepub fn mark_needs_focus_sync(&self)
pub fn mark_needs_focus_sync(&self)
Marks this node as needing a focus synchronization.
Sourcepub fn needs_focus_sync(&self) -> bool
pub fn needs_focus_sync(&self) -> bool
Returns true when focus state needs to be synchronized.
Sourcepub fn clear_needs_focus_sync(&self)
pub fn clear_needs_focus_sync(&self)
Clears the focus dirty flag after the focus manager processes it.
Sourcepub fn set_node_id(&mut self, id: NodeId)
pub fn set_node_id(&mut self, id: NodeId)
Set this node’s ID (called by applier after creation).
Sourcepub fn set_parent(&self, parent: NodeId)
pub fn set_parent(&self, parent: NodeId)
Set this node’s parent (called when node is added as child). Sets both folded_parent (direct) and parent (first non-virtual ancestor for bubbling).
Sourcepub fn clear_parent(&self)
pub fn clear_parent(&self)
Clear this node’s parent (called when node is removed from parent).
Sourcepub fn parent(&self) -> Option<NodeId>
pub fn parent(&self) -> Option<NodeId>
Get this node’s parent for dirty flag bubbling (may skip virtual nodes).
Sourcepub fn folded_parent(&self) -> Option<NodeId>
pub fn folded_parent(&self) -> Option<NodeId>
Get this node’s direct parent (may be a virtual node).
Sourcepub fn is_virtual(&self) -> bool
pub fn is_virtual(&self) -> bool
Returns true if this is a virtual node (transparent container for subcomposition).
pub fn resolved_modifiers(&self) -> ResolvedModifiers
pub fn modifier_capabilities(&self) -> NodeCapabilities
pub fn modifier_child_capabilities(&self) -> NodeCapabilities
pub fn set_debug_modifiers(&mut self, enabled: bool)
pub fn debug_modifiers_enabled(&self) -> bool
pub fn modifier_locals_handle(&self) -> Rc<RefCell<ModifierLocalManager>>
pub fn has_layout_modifier_nodes(&self) -> bool
pub fn has_draw_modifier_nodes(&self) -> bool
pub fn has_pointer_input_modifier_nodes(&self) -> bool
pub fn has_semantics_modifier_nodes(&self) -> bool
pub fn has_focus_modifier_nodes(&self) -> bool
pub fn modifier_slices_snapshot(&self) -> Rc<ModifierNodeSlices>
Sourcepub fn layout_state(&self) -> LayoutState
pub fn layout_state(&self) -> LayoutState
Returns a clone of the current layout state.
Sourcepub fn measured_size(&self) -> Size
pub fn measured_size(&self) -> Size
Returns the measured size of this node.
Sourcepub fn is_placed(&self) -> bool
pub fn is_placed(&self) -> bool
Returns true if this node has been placed in the current layout pass.
Sourcepub fn set_measured_size(&self, size: Size)
pub fn set_measured_size(&self, size: Size)
Updates the measured size of this node. Called during measurement.
Sourcepub fn set_position(&self, position: Point)
pub fn set_position(&self, position: Point)
Updates the position of this node. Called during placement.
Sourcepub fn set_measurement_constraints(&self, constraints: Constraints)
pub fn set_measurement_constraints(&self, constraints: Constraints)
Records the constraints used for measurement. Used for relayout optimization.
Sourcepub fn set_content_offset(&self, offset: Point)
pub fn set_content_offset(&self, offset: Point)
Records the content offset (e.g. from padding).
Sourcepub fn clear_placed(&self)
pub fn clear_placed(&self)
Clears the is_placed flag. Called at the start of a layout pass.
pub fn semantics_configuration(&self) -> Option<SemanticsConfiguration>
Sourcepub fn with_text_field_modifier_mut<R>(
&mut self,
f: impl FnMut(&mut TextFieldModifierNode) -> R,
) -> Option<R>
pub fn with_text_field_modifier_mut<R>( &mut self, f: impl FnMut(&mut TextFieldModifierNode) -> R, ) -> Option<R>
Access the text field modifier node (if present) with a mutable callback.
This is used for keyboard event dispatch to text fields.
Returns None if no text field modifier is found in the chain.
Sourcepub fn layout_state_handle(&self) -> Rc<RefCell<LayoutState>>
pub fn layout_state_handle(&self) -> Rc<RefCell<LayoutState>>
Returns a handle to the shared layout state. Used by layout system to update state without borrowing the Applier.
Trait Implementations§
Source§impl Clone for LayoutNode
impl Clone for LayoutNode
Source§impl Drop for LayoutNode
impl Drop for LayoutNode
Source§impl Node for LayoutNode
impl Node for LayoutNode
Source§fn set_parent_for_bubbling(&mut self, parent: NodeId)
fn set_parent_for_bubbling(&mut self, parent: NodeId)
Minimal parent setter for dirty flag bubbling. Only sets the parent Cell without triggering registry updates. This is used during SubcomposeLayout measurement where we need parent pointers for bubble_measure_dirty but don’t want full attachment side effects.