AppExtension

Trait AppExtension 

Source
pub trait AppExtension: 'static {
Show 13 methods // Provided methods fn register(&self, info: &mut AppExtensionsInfo) where Self: Sized { ... } fn init(&mut self) { ... } fn event_preview(&mut self, update: &mut EventUpdate) { ... } fn event_ui(&mut self, update: &mut EventUpdate) { ... } fn event(&mut self, update: &mut EventUpdate) { ... } fn info(&mut self, info_widgets: &mut InfoUpdates) { ... } fn update_preview(&mut self) { ... } fn update_ui(&mut self, update_widgets: &mut WidgetUpdates) { ... } fn update(&mut self) { ... } fn layout(&mut self, layout_widgets: &mut LayoutUpdates) { ... } fn render( &mut self, render_widgets: &mut RenderUpdates, render_update_widgets: &mut RenderUpdates, ) { ... } fn deinit(&mut self) { ... } fn boxed(self) -> Box<dyn AppExtensionBoxed> where Self: Sized { ... }
}
Expand description

An app extension.

App extensions setup and update core features such as services and events. App instances are fully composed of app extensions.

See the zng::app module level documentation for more details, including the call order of methods of this trait.

Provided Methods§

Source

fn register(&self, info: &mut AppExtensionsInfo)
where Self: Sized,

Register info abound this extension on the info list.

Source

fn init(&mut self)

Initializes this extension.

Source

fn event_preview(&mut self, update: &mut EventUpdate)

Called just before event_ui when an event notifies.

Extensions can handle this method to intercept event updates before the UI.

Note that this is not related to the on_event_preview properties, all UI events happen in event_ui.

Source

fn event_ui(&mut self, update: &mut EventUpdate)

Called just before event.

Only extensions that generate windows should handle this method. The UiNode::event method is called here.

Source

fn event(&mut self, update: &mut EventUpdate)

Called after event_ui.

This is the general extensions event handler, it gives the chance for the UI to signal stop propagation.

Source

fn info(&mut self, info_widgets: &mut InfoUpdates)

Called when info rebuild is requested for windows and widgets.

The UiNode::info method is called here.

Source

fn update_preview(&mut self)

Called just before update_ui.

Extensions can handle this method to react to updates before the UI.

Note that this is not related to the on_event_preview properties, all UI events happen in update_ui.

Source

fn update_ui(&mut self, update_widgets: &mut WidgetUpdates)

Called just before update.

Only extensions that manage windows should handle this method.

The UiNode::update method is called here.

Source

fn update(&mut self)

Called after every update_ui and info.

This is the general extensions update, it gives the chance for the UI to make service requests.

Source

fn layout(&mut self, layout_widgets: &mut LayoutUpdates)

Called when layout is requested for windows and widgets.

The UiNode::layout method is called here.

Source

fn render( &mut self, render_widgets: &mut RenderUpdates, render_update_widgets: &mut RenderUpdates, )

Called when render is requested for windows and widgets.

The UiNode::render and UiNode::render_update methods are called here.

Source

fn deinit(&mut self)

Called when the application is exiting.

Update requests and event notifications generated during this call are ignored, the extensions will be dropped after every extension received this call.

Source

fn boxed(self) -> Box<dyn AppExtensionBoxed>
where Self: Sized,

Gets the extension boxed.

Boxed app extensions also implement AppExtension, this method does not double box.

Implementations on Foreign Types§

Source§

impl AppExtension for ()

Source§

impl<A: AppExtension, B: AppExtension> AppExtension for (A, B)

Source§

fn init(&mut self)

Source§

fn register(&self, info: &mut AppExtensionsInfo)

Source§

fn update_preview(&mut self)

Source§

fn update_ui(&mut self, update_widgets: &mut WidgetUpdates)

Source§

fn update(&mut self)

Source§

fn info(&mut self, info_widgets: &mut InfoUpdates)

Source§

fn layout(&mut self, layout_widgets: &mut LayoutUpdates)

Source§

fn render( &mut self, render_widgets: &mut RenderUpdates, render_update_widgets: &mut RenderUpdates, )

Source§

fn event_preview(&mut self, update: &mut EventUpdate)

Source§

fn event_ui(&mut self, update: &mut EventUpdate)

Source§

fn event(&mut self, update: &mut EventUpdate)

Source§

fn deinit(&mut self)

Implementors§