pub struct VirtualViewCallbackInfo {
pub reason: VirtualViewCallbackReason,
pub system_fonts: *const FcFontCache,
pub image_cache: *const ImageCache,
pub window_theme: WindowTheme,
pub bounds: HidpiAdjustedBounds,
pub scroll_size: LogicalSize,
pub scroll_offset: LogicalPosition,
pub virtual_scroll_size: LogicalSize,
pub virtual_scroll_offset: LogicalPosition,
/* private fields */
}Fields§
§reason: VirtualViewCallbackReason§system_fonts: *const FcFontCache§image_cache: *const ImageCache§window_theme: WindowTheme§bounds: HidpiAdjustedBounds§scroll_size: LogicalSize§scroll_offset: LogicalPosition§virtual_scroll_size: LogicalSize§virtual_scroll_offset: LogicalPositionImplementations§
Source§impl VirtualViewCallbackInfo
impl VirtualViewCallbackInfo
pub const fn new<'a>( reason: VirtualViewCallbackReason, system_fonts: &'a FcFontCache, image_cache: &'a ImageCache, window_theme: WindowTheme, bounds: HidpiAdjustedBounds, scroll_size: LogicalSize, scroll_offset: LogicalPosition, virtual_scroll_size: LogicalSize, virtual_scroll_offset: LogicalPosition, ) -> Self
Sourcepub const fn set_callable_ptr(&mut self, callable: &OptionRefAny)
pub const fn set_callable_ptr(&mut self, callable: &OptionRefAny)
Set the callable pointer for FFI language bindings
Sourcepub fn set_measure_dom_fn(&mut self, f: MeasureDomFn, ctx: *mut c_void)
pub fn set_measure_dom_fn(&mut self, f: MeasureDomFn, ctx: *mut c_void)
Inject the headless-measure trampoline (called by the layout crate right before the user callback is invoked).
Sourcepub fn measure_dom(&self, dom: Dom, available: LogicalSize) -> LogicalSize
pub fn measure_dom(&self, dom: Dom, available: LogicalSize) -> LogicalSize
Measure a DOM headlessly: style + lay it out against available
constraints using the host window’s fonts and system style, without
touching the live layout. Returns the union of all node bounds.
Use a very tall available.height (e.g. 1_000_000.0) to obtain a
DOM’s natural height at a fixed width - the building block for
virtual-scroll sizing: measure one (or a few) item template(s), then
virtual_scroll_size.height = item_height * item_count and render
only the visible window of items. Each call is a full cold layout
pass, so cache measured sizes per item template.
Returns LogicalSize::zero() when no measure hook was injected.
Sourcepub fn get_ctx(&self) -> OptionRefAny
pub fn get_ctx(&self) -> OptionRefAny
Get the callable for FFI language bindings (Python, etc.)