Struct zng_view_api::window::WindowRequest

source ·
pub struct WindowRequest {
Show 23 fields pub id: WindowId, pub title: Txt, pub state: WindowStateAll, pub kiosk: bool, pub default_position: bool, pub video_mode: VideoMode, pub visible: bool, pub taskbar_visible: bool, pub always_on_top: bool, pub movable: bool, pub resizable: bool, pub icon: Option<ImageId>, pub cursor: Option<CursorIcon>, pub cursor_image: Option<(ImageId, PxPoint)>, pub transparent: bool, pub capture_mode: bool, pub render_mode: RenderMode, pub focus_indicator: Option<FocusIndicator>, pub focus: bool, pub extensions: Vec<(ApiExtensionId, ApiExtensionPayload)>, pub ime_area: Option<DipRect>, pub enabled_buttons: WindowButton, pub system_shutdown_warn: Txt,
}
Expand description

Configuration of a new window.

Fields§

§id: WindowId

ID that will identify the new window.

§title: Txt

Title text.

§state: WindowStateAll

Window state, position, size and restore rectangle.

§kiosk: bool

Lock-in kiosk mode.

If true the app-process will only set fullscreen states, never hide or minimize the window, never make the window chrome visible and only request an opaque window. The view-process implementer is expected to also never exit the fullscreen state, even temporally.

The app-process does not expect the view-process to configure the operating system to run in kiosk mode, but if possible to detect the view-process can assert that it is running in kiosk mode, logging an error if the assert fails.

§default_position: bool

If the initial position should be provided the operating system, if this is not possible the state.restore_rect.origin is used.

§video_mode: VideoMode

Video mode used when the window is in exclusive state.

§visible: bool

Window visibility.

§taskbar_visible: bool

Window taskbar icon visibility.

§always_on_top: bool

If the window is “top-most”.

§movable: bool

If the user can move the window.

§resizable: bool

If the user can resize the window.

§icon: Option<ImageId>

Window icon.

§cursor: Option<CursorIcon>

Window cursor icon and visibility.

§cursor_image: Option<(ImageId, PxPoint)>

Window custom cursor with hotspot.

§transparent: bool

If the window is see-through in pixels that are not fully opaque.

§capture_mode: bool

If all or most frames will be screen captured.

If false all resources for capturing frame images are discarded after each screenshot request.

§render_mode: RenderMode

Render mode preference for this window.

§focus_indicator: Option<FocusIndicator>

Focus request indicator on init.

§focus: bool

Ensures the window is focused after open, if not set the initial focus is decided by the windows manager, usually focusing the new window only if the process that causes the window has focus.

§extensions: Vec<(ApiExtensionId, ApiExtensionPayload)>

Initial payload for API extensions.

The zng-view crate implements this by calling WindowExtension::configure and RendererExtension::configure with the payload.

§ime_area: Option<DipRect>

IME cursor area, if IME is enabled.

§enabled_buttons: WindowButton

Enabled window chrome buttons.

§system_shutdown_warn: Txt

System shutdown warning associated with the window.

Implementations§

source§

impl WindowRequest

source

pub fn enforce_kiosk(&mut self)

Corrects invalid values if kiosk is true.

An error is logged for each invalid value.

Trait Implementations§

source§

impl Clone for WindowRequest

source§

fn clone(&self) -> WindowRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WindowRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for WindowRequest

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for WindowRequest

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,