#[non_exhaustive]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 ime_area: Option<DipRect>,
pub enabled_buttons: WindowButton,
pub system_shutdown_warn: Txt,
pub extensions: Vec<(ApiExtensionId, ApiExtensionPayload)>,
}Expand description
Configuration of a new window.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: WindowIdID that will identify the new window.
title: TxtTitle text.
state: WindowStateAllWindow state, position, size and restore rectangle.
kiosk: boolLock-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: boolIf the initial position should be provided the operating system,
if this is not possible the state.restore_rect.origin is used.
video_mode: VideoModeVideo mode used when the window is in exclusive state.
visible: boolWindow visibility.
taskbar_visible: boolWindow taskbar icon visibility.
always_on_top: boolIf the window is “top-most”.
movable: boolIf the user can move the window.
resizable: boolIf 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: boolIf the window is see-through in pixels that are not fully opaque.
capture_mode: boolIf all or most frames will be screen captured.
If false all resources for capturing frame images
are discarded after each screenshot request.
render_mode: RenderModeRender mode preference for this window.
focus_indicator: Option<FocusIndicator>Focus request indicator on init.
focus: boolEnsures 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.
ime_area: Option<DipRect>IME cursor area, if IME is enabled.
Enabled window chrome buttons.
system_shutdown_warn: TxtSystem shutdown warning associated with the window.
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.
Implementations§
Source§impl WindowRequest
impl WindowRequest
Sourcepub fn new(
id: WindowId,
title: Txt,
state: WindowStateAll,
kiosk: bool,
default_position: bool,
video_mode: VideoMode,
visible: bool,
taskbar_visible: bool,
always_on_top: bool,
movable: bool,
resizable: bool,
icon: Option<ImageId>,
cursor: Option<CursorIcon>,
cursor_image: Option<(ImageId, PxPoint)>,
transparent: bool,
capture_mode: bool,
render_mode: RenderMode,
focus_indicator: Option<FocusIndicator>,
focus: bool,
ime_area: Option<DipRect>,
enabled_buttons: WindowButton,
system_shutdown_warn: Txt,
extensions: Vec<(ApiExtensionId, ApiExtensionPayload)>,
) -> Self
pub fn new( id: WindowId, title: Txt, state: WindowStateAll, kiosk: bool, default_position: bool, video_mode: VideoMode, visible: bool, taskbar_visible: bool, always_on_top: bool, movable: bool, resizable: bool, icon: Option<ImageId>, cursor: Option<CursorIcon>, cursor_image: Option<(ImageId, PxPoint)>, transparent: bool, capture_mode: bool, render_mode: RenderMode, focus_indicator: Option<FocusIndicator>, focus: bool, ime_area: Option<DipRect>, enabled_buttons: WindowButton, system_shutdown_warn: Txt, extensions: Vec<(ApiExtensionId, ApiExtensionPayload)>, ) -> Self
New request.
Sourcepub fn enforce_kiosk(&mut self)
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
impl Clone for WindowRequest
Source§fn clone(&self) -> WindowRequest
fn clone(&self) -> WindowRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowRequest
impl Debug for WindowRequest
Source§impl<'de> Deserialize<'de> for WindowRequest
impl<'de> Deserialize<'de> for WindowRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WindowRequest
impl RefUnwindSafe for WindowRequest
impl Send for WindowRequest
impl Sync for WindowRequest
impl Unpin for WindowRequest
impl UnwindSafe for WindowRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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