zng_view::extensions

Trait 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§