pub struct LayoutCallbackInfo {
pub window_size: WindowSize,
pub theme: WindowTheme,
pub gl_context: *const OptionGlContextPtr,
/* private fields */
}Expand description
Gives the layout() function access to the RendererResources and the Window
(for querying images and fonts, as well as width / height)
Fields§
§window_size: WindowSizeWindow size (so that apps can return a different UI depending on the window size - mobile / desktop view). Should be later removed in favor of “resize” handlers and @media queries.
theme: WindowThemeRegisters whether the UI is dependent on the window theme
gl_context: *const OptionGlContextPtrOpenGL context so that the layout() function can render textures
Implementations§
Source§impl LayoutCallbackInfo
impl LayoutCallbackInfo
pub fn new<'a>( window_size: WindowSize, theme: WindowTheme, image_cache: &'a ImageCache, gl_context: &'a OptionGlContextPtr, fc_cache: &'a FcFontCache, ) -> Self
pub fn get_gl_context(&self) -> OptionGlContextPtr
pub fn get_system_fonts(&self) -> Vec<AzStringPair>
pub fn get_image(&self, image_id: &AzString) -> Option<ImageRef>
Trait Implementations§
Source§impl Clone for LayoutCallbackInfo
impl Clone for LayoutCallbackInfo
Auto Trait Implementations§
impl Freeze for LayoutCallbackInfo
impl RefUnwindSafe for LayoutCallbackInfo
impl !Send for LayoutCallbackInfo
impl !Sync for LayoutCallbackInfo
impl Unpin for LayoutCallbackInfo
impl UnwindSafe for LayoutCallbackInfo
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more