pub trait AppExtension: 'static {
Show 14 methods
// Provided methods
fn register(&self, info: &mut AppExtensionsInfo)
where Self: Sized { ... }
fn init(&mut self) { ... }
fn enable_device_events(&self) -> bool { ... }
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§
sourcefn register(&self, info: &mut AppExtensionsInfo)where
Self: Sized,
fn register(&self, info: &mut AppExtensionsInfo)where
Self: Sized,
Register info abound this extension on the info list.
sourcefn enable_device_events(&self) -> bool
fn enable_device_events(&self) -> bool
If the application should notify raw device events.
Device events are raw events not targeting any window, like a mouse move on any part of the screen.
They tend to be high-volume events so there is a performance cost to activating this. Note that if
this is false
you still get the mouse move over windows of the app.
This is called zero or one times before init
.
Returns false
by default.
sourcefn event_preview(&mut self, update: &mut EventUpdate)
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
.
sourcefn event_ui(&mut self, update: &mut EventUpdate)
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.
sourcefn event(&mut self, update: &mut EventUpdate)
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.
sourcefn info(&mut self, info_widgets: &mut InfoUpdates)
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.
sourcefn update_preview(&mut self)
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
.
sourcefn update_ui(&mut self, update_widgets: &mut WidgetUpdates)
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.
sourcefn layout(&mut self, layout_widgets: &mut LayoutUpdates)
fn layout(&mut self, layout_widgets: &mut LayoutUpdates)
Called when layout is requested for windows and widgets.
The UiNode::layout
method is called here.
sourcefn render(
&mut self,
render_widgets: &mut RenderUpdates,
render_update_widgets: &mut RenderUpdates,
)
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.