Trait zng_view::extensions::WindowExtension
source · pub trait WindowExtension: Any {
// Required methods
fn is_init_only(&self) -> bool;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
// Provided methods
fn configure(&mut self, args: &mut WindowConfigArgs<'_>) { ... }
fn window_inited(&mut self, args: &mut WindowInitedArgs<'_>) { ... }
fn command(
&mut self,
args: &mut WindowCommandArgs<'_>,
) -> ApiExtensionPayload { ... }
fn event(&mut self, args: &mut WindowEventArgs<'_>) { ... }
fn low_memory(&mut self) { ... }
fn window_deinited(&mut self, args: &mut WindowDeinitedArgs<'_>) { ... }
}
Expand description
Represents a view extension associated with a headed or headless window instance.
Required Methods§
sourcefn is_init_only(&self) -> bool
fn is_init_only(&self) -> bool
If this extension can be dropped after window creation.
sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Cast to &mut dyn Any
.
Provided Methods§
sourcefn configure(&mut self, args: &mut WindowConfigArgs<'_>)
fn configure(&mut self, args: &mut WindowConfigArgs<'_>)
Edit attributes for the new window.
sourcefn window_inited(&mut self, args: &mut WindowInitedArgs<'_>)
fn window_inited(&mut self, args: &mut WindowInitedArgs<'_>)
Called just after the window is created.
sourcefn command(&mut self, args: &mut WindowCommandArgs<'_>) -> ApiExtensionPayload
fn command(&mut self, args: &mut WindowCommandArgs<'_>) -> ApiExtensionPayload
Called when a command request is made for the extension and window (window ID).
sourcefn event(&mut self, args: &mut WindowEventArgs<'_>)
fn event(&mut self, args: &mut WindowEventArgs<'_>)
Called when the window receives an event.
sourcefn low_memory(&mut self)
fn low_memory(&mut self)
System warning low memory, release unused memory, caches.
sourcefn window_deinited(&mut self, args: &mut WindowDeinitedArgs<'_>)
fn window_deinited(&mut self, args: &mut WindowDeinitedArgs<'_>)
Called just after the window closes.