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 window chrome buttons.
system_shutdown_warn: Txt
System shutdown warning associated with the window.
Implementations§
source§impl WindowRequest
impl WindowRequest
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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