#[repr(C)]pub struct LayoutCallbackInfoRefData<'a> {
pub image_cache: &'a ImageCache,
pub gl_context: &'a OptionGlContextPtr,
pub system_fonts: &'a FcFontCache,
pub system_style: Arc<SystemStyle>,
pub active_route: Option<&'a RouteMatch>,
}Expand description
Gives the layout() function access to the RendererResources and the Window
(for querying images and fonts, as well as width / height)
Reference data container for LayoutCallbackInfo (all read-only fields)
This struct consolidates all readonly references that layout callbacks need to query state. By grouping these into a single struct, we reduce the number of parameters to LayoutCallbackInfo::new() from 6 to 2, making the API more maintainable and easier to extend.
This is pure syntax sugar - the struct lives on the stack in the caller and is passed by reference.
Fields§
§image_cache: &'a ImageCacheAllows the layout() function to reference image IDs
gl_context: &'a OptionGlContextPtrOpenGL context so that the layout() function can render textures
system_fonts: &'a FcFontCacheReference to the system font cache
system_style: Arc<SystemStyle>Platform-specific system style (colors, spacing, etc.) Used for CSD rendering and menu windows.
active_route: Option<&'a RouteMatch>Active route match (if routing is configured). Contains the matched pattern and extracted parameters.