zng::app

Trait AppExtension

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

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 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.

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 AppExtension for ClipboardManager

source§

fn update(&mut self)

source§

impl AppExtension for ConfigManager

source§

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

source§

impl AppExtension for FontManager

source§

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

source§

fn update(&mut self)

source§

impl AppExtension for FsWatcherManager

source§

fn init(&mut self)

source§

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

source§

fn update_preview(&mut self)

source§

fn deinit(&mut self)

source§

impl AppExtension for HotReloadManager

source§

fn init(&mut self)

source§

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

source§

fn update_preview(&mut self)

source§

impl AppExtension for ImageManager

source§

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

source§

fn update_preview(&mut self)

source§

fn update(&mut self)

source§

impl AppExtension for DragDropManager

source§

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

source§

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

source§

fn update_preview(&mut self)

source§

impl AppExtension for FocusManager

source§

fn init(&mut self)

source§

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

source§

fn render(&mut self, _: &mut RenderUpdates, _: &mut RenderUpdates)

source§

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

source§

fn update(&mut self)

source§

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

source§

impl AppExtension for GestureManager

source§

fn init(&mut self)

source§

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

source§

impl AppExtension for KeyboardManager

source§

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

source§

impl AppExtension for MouseManager

source§

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

source§

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

source§

fn update_preview(&mut self)

source§

impl AppExtension for PointerCaptureManager

source§

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

source§

fn update(&mut self)

source§

impl AppExtension for TouchManager

source§

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

source§

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

source§

fn update_preview(&mut self)

source§

impl AppExtension for L10nManager

source§

fn init(&mut self)

source§

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

source§

impl AppExtension for SingleInstanceManager

source§

fn init(&mut self)

source§

impl AppExtension for SvgManager

source§

fn init(&mut self)

source§

impl AppExtension for UndoManager

source§

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

source§

impl AppExtension for WindowManager

source§

fn init(&mut self)

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

impl AppExtension for MaterialIconsManager

source§

fn init(&mut self)

source§

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

source§

fn init(&mut self)

source§

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

source§

fn enable_device_events(&self) -> bool

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§