nativeview-layout 0.1.0-rc.1

Shared NodeStore layout layer: StoreLayoutEngine / TextMeasurer traits and the default direct Taffy engine
Documentation
//! Shared `NodeStore` layout layer used by every native backend and host runtime.
//!
//! Owns the [`StoreLayoutEngine`] / [`TextMeasurer`] traits, the deterministic
//! [`HeuristicTextMeasurer`], and the default [`TaffyStoreLayout`] engine (direct Taffy 0.16
//! low-level layout over `NodeStore` word columns). `nativeview-backend-headless`, `nativeview-backend-skia`,
//! `nativeview-runtime`, and opt-in engines such as `packages/modules/layout-yoga` all depend on this
//! crate, so no core crate ever depends on a backend to lay out a tree.

#![cfg_attr(doctest, doc = include_str!("../README.md"))]

mod engine;
pub mod inspector;
pub mod interaction;
mod leaf_measure;
mod measure;
pub mod overlay;
mod paragraph;
pub mod scene;
mod taffy_store;
mod top;

pub use engine::{DynLayoutEngine, SizeConstraints, StoreLayoutEngine, SurfaceMeasure};
pub use leaf_measure::{AvailableSpace, LeafMeasureContext, LeafMeasureHook, Size};
pub use inspector::{
    CompactEdges, DEFAULT_FLASH_TTL, InspectorFlags, InspectorHeatTracker, InspectorNodeSnapshot,
    LayoutWarningFlags, MAX_FLASH_RECTS, NODE_HEAT_FLASHING, NODE_HEAT_OCCUPIED, NodeHeat,
    ResolvedBoxEdges, SceneDirtyKind, StackingReasonFlags, compute_layout_warnings,
    compute_stacking_reasons, margin_edge_bands, resolve_fallback_box_edges, ring_bands,
};
pub use measure::{
    HeuristicTextMeasurer, ResolvedFamily, ResolvedTextStyle, TextMeasurer, TextStyle,
    resolve_inherited_text,
};
pub use paragraph::{InheritedText, ParagraphStore};
pub use paragraph::measure::{
    default_measure_paragraph, heuristic_hit_test_paragraph, heuristic_measure_paragraph,
    paragraph_runs, paragraph_text_str, paragraph_wraps, run_font_family, run_line_height_points,
    run_text_slice, sanitize_run_font_size, single_run_text_style,
};
pub use nativeview_abi::FocusMove;
pub use scene::{
    CloseRequestAction, FocusTraversalCtx, FocusTraversalOutcome, FocusTraversalPolicy,
    FocusTraversalScratch, FocusTraverseFlags, FocusTraverseOutFlags, SceneGeometry,
    TabOrderPolicy, CS_CLIPS, CS_HAS_SCROLL, CS_IS_STICKY,
    CS_IS_TOP_LAYER, CS_IS_TRANSFORM, ClipScrollIdx, ClipScrollNode, CommitHooks, CommitOutcome, InteractionChange,
    InstantScrollPhysics, ItemCount, ItemPaintPhase, LaidOutScene, NoCommitHooks,
    OverlayState, PressOutcome, ResolvedOverlay, SCOPE_HAS_SCROLL, SCOPE_IS_MODAL, SCOPE_IS_STICKY, SCOPE_IS_TOP_LAYER, SceneStackingStyleSource, ScopeIdx, ScopeKind,
    ScrollAxis, ScrollBoundsLookup, ScrollChainOutcome, ScrollContainerCtx, ScrollDeltaResult,
    ScrollInputKind, ScrollOffsets, ScrollPhysicsEngine, ScrollTimestampMs, ScrollTouchPhase,
    StackingBucket, StackingItem, StackingNodeRole, StackingOverrides, StackingPlan, StackingScope,
    StackingStyleSource, StyleCascade, EffectiveBox, ResponsivePatches, NoResponsivePatches, TopLayerScope,
    PressedOverlay, TopLayerPress, ZOrder, bucket_for_sc_z, close_request_owner, hide_popovers_until,
    top_layer_press, topmost_modal_index,
    classify_node_sc_with_parent_display, compute_scroll_content_size, default_px_per_line,
    for_each_scrollbar_thumb_geom, intersect_rects, intersects_clip, layout_snapshot_of,
    normalize_shift_wheel, paragraph_content_insets, push_unique_node, resolve_node_sc_state,
    scroll_axes_allow, visual_snapshot_of,
};
pub use taffy_store::TaffyStoreLayout;
pub use taffy_store::responsive::text::ResponsiveTextEnv;
pub use top::TopLayerIndex;
pub use scene::state_rules_patch_box;
pub use scene::pointer::{
    PointerHitTest, PointerOutcomeFlags, PointerProbe, PointerResolution,
};
pub use top::display::DisplayEnv;

pub use nativeview_store::MAX_TREE_DEPTH;