WINDOWS_EXTENSIONS

Struct WINDOWS_EXTENSIONS 

Source
pub struct WINDOWS_EXTENSIONS;
Expand description

Windows extensions hooks.

Implementations§

Source§

impl WINDOWS_EXTENSIONS

Source

pub fn register_root_extender( &self, extender: impl FnMut(WindowRootExtenderArgs) -> UiNode + Send + 'static, )

Register the closure extender to be called with the root of every new window starting on the next update.

The closure returns the new root node that will be passed to any other root extender until the actual final root node is created. The closure is called in the WINDOW context of the new window, so it can be used to modify the window context too.

This is an advanced API that enables app wide features, like themes, to inject context in every new window. The extender is called in the context of the window, after the window creation future has completed.

Note that the root node passed to the extender is the child node of the WindowRoot widget, not the widget itself. The extended root will be wrapped in the root widget node, that is, the final root widget will be root(extender_nodes(CONTEXT(EVENT(..)))), so extension nodes should operate as CONTEXT properties.

Note that for themes the zng-wgt-window crate provides a register_style_fn API that is built over this method and more oriented for theming.

Source

pub fn register_open_nested_handler( &self, handler: impl FnMut(&mut OpenNestedHandlerArgs) + Send + 'static, )

Register the closure handler to be called for every new window starting on the next update.

The closure is called in the new WINDOW context and can optionally call OpenNestedHandlerArgs::nest to convert to a nested window. Nested windows can be manipulated using the WINDOWS API just like other windows, but are layout and rendered inside another window.

This is primarily an adapter for mobile platforms that only support one real window, it accelerates cross platform support from projects originally desktop only.

Note that this API is not recommended for implementing features such as window docking or tabbing, for that you probably need to model tabs as objects that can outlive their host windows and use ArcNode to transfer the content between host windows.

Source

pub fn view_extensions_init( &self, window_id: impl Into<WindowId>, extension_id: ApiExtensionId, request: ApiExtensionPayload, ) -> Result<(), ViewExtensionError>

Add a view-process extension payload to the window request for the view-process.

This will only work if called on the first UiNode::init and at most the first UiNode::layout of the window.

The payload is dropped after it is send, this method must be called again on VIEW_PROCESS_INITED_EVENT to reinitialize the extensions after view-process respawn.

Source

pub fn view_window_extension_raw( &self, window_id: impl Into<WindowId>, extension_id: ApiExtensionId, request: ApiExtensionPayload, ) -> Result<ApiExtensionPayload, ViewExtensionError>

Call a view-process headed window extension with custom encoded payload.

Note that unlike most service methods this calls happens immediately.

Source

pub fn view_window_extension<I, O>( &self, window_id: impl Into<WindowId>, extension_id: ApiExtensionId, request: &I, ) -> Result<O, ViewExtensionError>

Call a headed window extension with serialized payload.

Note that unlike most service methods this call happens immediately.

Source

pub fn view_render_extension_raw( &self, window_id: impl Into<WindowId>, extension_id: ApiExtensionId, request: ApiExtensionPayload, ) -> Result<ApiExtensionPayload, ViewExtensionError>

Call a view-process render extension with custom encoded payload for the renderer associated with the window.

Note that unlike most service methods this call happens immediately.

Source

pub fn view_render_extension<I, O>( &self, window_id: impl Into<WindowId>, extension_id: ApiExtensionId, request: &I, ) -> Result<O, ViewExtensionError>

Call a render extension with serialized payload for the renderer associated with the window.

Note that unlike most service methods this call happens immediately.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> StateValue for T
where T: Any + Send + Sync,