pub struct CotisLayoutManager { /* private fields */ }Expand description
Owns the layout tree, viewport size, text measurer, and post-frame element cache.
Implement LayoutManager via crate::cotis_traits and
wire into CotisApp with a pipe (e.g.
CotisLayoutToRenderListPipeForGenerics from cotis-pipes).
The renderer initializes text measurement and viewport dimensions through
LayoutManagerCompatible.
Implementations§
Source§impl CotisLayoutManager
impl CotisLayoutManager
Sourcepub fn set_text_dim_fun(
&mut self,
fun: Box<dyn Fn(&str, &DefaultTextConfig) -> Dimensions>,
)
pub fn set_text_dim_fun( &mut self, fun: Box<dyn Fn(&str, &DefaultTextConfig) -> Dimensions>, )
Installs a function that measures text for layout.
Normally set automatically by LayoutManagerCompatible::init
from the renderer’s RendererTextMeasuringProvider.
Override only for custom measurement or testing.
Source§impl CotisLayoutManager
impl CotisLayoutManager
Sourcepub fn new(screen_dimensions: Dimensions) -> Self
pub fn new(screen_dimensions: Dimensions) -> Self
Creates a layout manager whose root element fills screen_dimensions.
Sourcepub fn set_dimensions(&mut self, screen_dimensions: Dimensions)
pub fn set_dimensions(&mut self, screen_dimensions: Dimensions)
Updates the viewport size used for the root element.
Also called from LayoutManagerCompatible::prepare
each frame.
Sourcepub fn get_cache_element(&self, id: ElementId) -> Option<&LayoutElement>
pub fn get_cache_element(&self, id: ElementId) -> Option<&LayoutElement>
Returns an element from the last completed frame layout cache.
Populated when CotisLayoutRun::finalize_layouts finishes. The returned
LayoutElement is an internal engine type — not a stable public path API; visibility
is under review. Use crate::cotis_traits::secondary_traits and
cotis_utils::element_state traits for structured inspection.
Trait Implementations§
Source§impl ElementBoundingBox for CotisLayoutManager
impl ElementBoundingBox for CotisLayoutManager
Source§fn bounding_box(&self, id: ElementId) -> Option<BoundingBox>
fn bounding_box(&self, id: ElementId) -> Option<BoundingBox>
id. Read moreSource§impl ElementsList for CotisLayoutManager
impl ElementsList for CotisLayoutManager
Source§impl<'frame, T> LayoutManager<'frame, T, RenderCommandOutput<T>> for CotisLayoutManagerwhere
T: CotisLayoutCompatible<'frame> + 'frame,
impl<'frame, T> LayoutManager<'frame, T, RenderCommandOutput<T>> for CotisLayoutManagerwhere
T: CotisLayoutCompatible<'frame> + 'frame,
Source§type ElementConfigurer<'layout> = CotisLayoutRun<'layout, T>
where
Self: 'layout
type ElementConfigurer<'layout> = CotisLayoutRun<'layout, T> where Self: 'layout
Source§fn begin_frame<'layout>(
&'layout mut self,
) -> impl LayoutFrameManager<'frame, T, RenderCommandOutput<T>, Self::ElementConfigurer<'layout>>where
T: 'frame,
RenderCommandOutput<T>: 'frame,
Self: 'layout,
fn begin_frame<'layout>(
&'layout mut self,
) -> impl LayoutFrameManager<'frame, T, RenderCommandOutput<T>, Self::ElementConfigurer<'layout>>where
T: 'frame,
RenderCommandOutput<T>: 'frame,
Self: 'layout,
Source§impl<Renderer: CotisWindowContext + RendererTextMeasuringProvider<TextConfig>> LayoutManagerCompatible<Renderer> for CotisLayoutManager
impl<Renderer: CotisWindowContext + RendererTextMeasuringProvider<TextConfig>> LayoutManagerCompatible<Renderer> for CotisLayoutManager
Source§impl LayoutTextMeasuring<TextConfig> for CotisLayoutManager
impl LayoutTextMeasuring<TextConfig> for CotisLayoutManager
Source§fn set_text_measuring_function(
&mut self,
text: Box<TextMeasurer<'_, DefaultTextConfig>>,
)
fn set_text_measuring_function( &mut self, text: Box<TextMeasurer<'_, DefaultTextConfig>>, )
Auto Trait Implementations§
impl !RefUnwindSafe for CotisLayoutManager
impl !Send for CotisLayoutManager
impl !Sync for CotisLayoutManager
impl !UnwindSafe for CotisLayoutManager
impl Freeze for CotisLayoutManager
impl Unpin for CotisLayoutManager
impl UnsafeUnpin for CotisLayoutManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
self into Target.