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§

source

fn is_init_only(&self) -> bool

If this extension can be dropped after window creation.

source

fn as_any(&self) -> &dyn Any

Cast to &dyn Any.

source

fn as_any_mut(&mut self) -> &mut dyn Any

Cast to &mut dyn Any.

Provided Methods§

source

fn configure(&mut self, args: &mut WindowConfigArgs<'_>)

Edit attributes for the new window.

source

fn window_inited(&mut self, args: &mut WindowInitedArgs<'_>)

Called just after the window is created.

source

fn command(&mut self, args: &mut WindowCommandArgs<'_>) -> ApiExtensionPayload

Called when a command request is made for the extension and window (window ID).

source

fn event(&mut self, args: &mut WindowEventArgs<'_>)

Called when the window receives an event.

source

fn low_memory(&mut self)

System warning low memory, release unused memory, caches.

source

fn window_deinited(&mut self, args: &mut WindowDeinitedArgs<'_>)

Called just after the window closes.

Implementors§