Skip to main content

WindowImpl

Struct WindowImpl 

Source
pub struct WindowImpl { /* private fields */ }
Expand description

A macOS window.

Implementations§

Source§

impl WindowImpl

Source

pub fn native(&self) -> Option<ComPtr<IFrnWindow>>

The native window; None once the window is disposed.

Source

pub fn set_title_bar_color(&self, color: Color)

Source

pub fn z_order(&self) -> Option<isize>

Source

pub fn window_state_changed_cb(&self) -> Option<Rc<dyn Fn(WindowState)>>

Source

pub fn set_window_state_changed_cb( &self, value: Option<Rc<dyn Fn(WindowState)>>, )

Source

pub fn extend_client_area_to_decorations_changed_cb( &self, ) -> Option<Rc<dyn Fn(bool)>>

Source

pub fn set_extend_client_area_to_decorations_changed_cb( &self, value: Option<Rc<dyn Fn(bool)>>, )

Source

pub fn closing_cb(&self) -> Option<Rc<dyn Fn(WindowCloseReason) -> bool>>

Source

pub fn set_closing_cb( &self, value: Option<Rc<dyn Fn(WindowCloseReason) -> bool>>, )

Source

pub fn got_input_when_disabled_cb(&self) -> Option<Rc<dyn Fn()>>

Source

pub fn set_got_input_when_disabled_cb(&self, value: Option<Rc<dyn Fn()>>)

Trait Implementations§

Source§

impl IDisposable for WindowImpl

Source§

fn dispose(&self)

Source§

impl IOptionalFeatureProvider for WindowImpl

Source§

fn try_get_feature(&self, feature_type: TypeId) -> Option<Rc<dyn Any>>

Queries for an optional feature.
Source§

impl ITopLevelImpl for WindowImpl

Source§

fn desktop_scaling(&self) -> f64

Gets the scaling factor for window positioning and sizing.
Source§

fn handle(&self) -> Option<Rc<dyn IPlatformHandle>>

Get the platform handle.
Source§

fn client_size(&self) -> Size

Gets the client size of the toplevel.
Source§

fn render_scaling(&self) -> f64

Gets the scaling factor for the toplevel. This is used for rendering.
Source§

fn surfaces(&self) -> Vec<Arc<dyn IPlatformRenderSurface>>

The list of native platform’s surfaces that can be consumed by rendering subsystems. Read more
Source§

fn render_surfaces( &self, ) -> Arc<dyn Fn() -> Vec<Arc<dyn IPlatformRenderSurface>> + Send + Sync> ⓘ

The surfaces as the thread that renders asks for them: the function is called by that thread whenever the renderer (re)creates its render target (the reference reads Surfaces of the top-level there). Read more
Source§

fn compositor(&self) -> Option<Rc<Compositor>>

Gets the compositor that is used for the toplevel, if the platform renders through one.
Source§

fn input(&self) -> Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>

Gets the method called when the toplevel receives input.
Source§

fn set_input(&self, value: Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>)

Sets a method called when the toplevel receives input.
Source§

fn paint(&self) -> Option<Rc<dyn Fn(Rect)>>

Gets the method called when the toplevel requires painting.
Source§

fn set_paint(&self, value: Option<Rc<dyn Fn(Rect)>>)

Sets a method called when the toplevel requires painting.
Source§

fn resized(&self) -> Option<Rc<dyn Fn(Size, WindowResizeReason)>>

Gets the method called when the toplevel is resized.
Source§

fn set_resized(&self, value: Option<Rc<dyn Fn(Size, WindowResizeReason)>>)

Sets a method called when the toplevel is resized.
Source§

fn scaling_changed(&self) -> Option<Rc<dyn Fn(f64)>>

Gets the method called when the toplevel’s scaling changes.
Source§

fn set_scaling_changed(&self, value: Option<Rc<dyn Fn(f64)>>)

Sets a method called when the toplevel’s scaling changes.
Source§

fn transparency_level_changed( &self, ) -> Option<Rc<dyn Fn(WindowTransparencyLevel)>>

Gets the method called when the toplevel’s transparency level changes.
Source§

fn set_transparency_level_changed( &self, value: Option<Rc<dyn Fn(WindowTransparencyLevel)>>, )

Sets a method called when the toplevel’s transparency level changes.
Source§

fn set_input_root(&self, input_root: Rc<dyn IInputRoot>)

Sets the input root for the toplevel.
Source§

fn point_to_client(&self, point: PixelPoint) -> Point

Converts a point from screen to client coordinates.
Source§

fn point_to_screen(&self, point: Point) -> PixelPoint

Converts a point from client to screen coordinates.
Source§

fn set_cursor(&self, cursor: Option<Rc<dyn ICursorImpl>>)

Sets the cursor associated with the toplevel; None stands for the default cursor.
Source§

fn closed(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when the underlying implementation is destroyed.
Source§

fn set_closed(&self, value: Option<Rc<dyn Fn()>>)

Sets a method called when the underlying implementation is destroyed.
Source§

fn lost_focus(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when the input focus is lost.
Source§

fn set_lost_focus(&self, value: Option<Rc<dyn Fn()>>)

Sets a method called when the input focus is lost.
Source§

fn create_popup(&self) -> Option<Rc<dyn IPopupImpl>>

Creates a popup that belongs to the toplevel, if the platform supports native popups.
Source§

fn set_transparency_level_hint( &self, transparency_levels: &[WindowTransparencyLevel], )

Sets the transparency level hint of the toplevel, in order of preference.
Source§

fn transparency_level(&self) -> WindowTransparencyLevel

Gets the current transparency level of the toplevel.
Source§

fn acrylic_compensation_levels(&self) -> AcrylicPlatformCompensationLevels

Gets the acrylic compensation levels for the platform.
Source§

fn set_frame_theme_variant(&self, theme_variant: Option<PlatformThemeVariant>)

Sets the theme variant on the frame if it should be dark or light. Also applies for the mica and acrylic backdrops, if they are applied; None follows the system.
Source§

fn as_any(&self) -> &dyn Any

Lets callers recover the concrete implementation type.
Source§

fn as_window_base_impl(&self) -> Option<&dyn IWindowBaseImpl>

The toplevel as a window base implementation, if it is one.
Source§

fn as_window_impl(&self) -> Option<&dyn IWindowImpl>

The toplevel as a window implementation, if it is one.
Source§

fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Sync + Send>>

Gets the platform-specific scene info, which is passed to the render target of the toplevel.
Source§

fn platform_specific_scene_info_changed( &self, ) -> Option<Rc<dyn Fn(Option<Arc<dyn Any + Sync + Send>>)>>

Gets the method called when the platform-specific scene info changes.
Source§

fn set_platform_specific_scene_info_changed( &self, _value: Option<Rc<dyn Fn(Option<Arc<dyn Any + Sync + Send>>)>>, )

Sets a method called when the platform-specific scene info changes.
Source§

fn as_popup_impl(&self) -> Option<&dyn IPopupImpl>

The toplevel as a popup implementation, if it is one.
Source§

fn as_win32_options_top_level_impl( &self, ) -> Option<&dyn IWin32OptionsTopLevelImpl>

The toplevel as the Win32-specific options of a toplevel, if it has them.
Source§

impl IWindowBaseImpl for WindowImpl

Source§

fn frame_size(&self) -> Option<Size>

Gets the total size of the toplevel, excluding shadows.
Source§

fn show(&self, activate: bool, is_dialog: bool)

Shows the window. Read more
Source§

fn hide(&self)

Hides the window.
Source§

fn position(&self) -> PixelPoint

Gets the position of the window in device pixels.
Source§

fn position_changed(&self) -> Option<Rc<dyn Fn(PixelPoint)>>

Gets the method called when the window’s position changes.
Source§

fn set_position_changed(&self, value: Option<Rc<dyn Fn(PixelPoint)>>)

Sets a method called when the window’s position changes.
Source§

fn activate(&self)

Activates the window.
Source§

fn deactivated(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when the window is deactivated (loses focus).
Source§

fn set_deactivated(&self, value: Option<Rc<dyn Fn()>>)

Sets a method called when the window is deactivated (loses focus).
Source§

fn activated(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when the window is activated (receives focus).
Source§

fn set_activated(&self, value: Option<Rc<dyn Fn()>>)

Sets a method called when the window is activated (receives focus).
Source§

fn max_auto_size_hint(&self) -> Size

Gets a maximum client size hint for an auto-sizing window, in device-independent pixels.
Source§

fn set_topmost(&self, value: bool)

Sets whether this window appears on top of all other windows.
Source§

impl IWindowImpl for WindowImpl

Source§

fn window_state(&self) -> WindowState

Gets the minimized/maximized state of the window.
Source§

fn set_window_state(&self, value: WindowState)

Sets the minimized/maximized state of the window.
Source§

fn window_state_getter_is_usable(&self) -> bool

Indicates if the window_state getter is reliable on this platform.
Source§

fn window_state_changed(&self) -> Option<Rc<dyn Fn(WindowState)>>

Gets the method called when the minimized/maximized state of the window changes.
Source§

fn set_window_state_changed(&self, value: Option<Rc<dyn Fn(WindowState)>>)

Sets a method called when the minimized/maximized state of the window changes.
Source§

fn set_title(&self, title: Option<&str>)

Sets the title of the window.
Source§

fn set_parent(&self, parent: Option<Rc<dyn IWindowImpl>>)

Sets the parent of the window.
Source§

fn set_enabled(&self, enable: bool)

Disables the window for example when a modal dialog is open.
Source§

fn got_input_when_disabled(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when a disabled window receives input. Can be used to activate child windows.
Source§

fn set_got_input_when_disabled(&self, value: Option<Rc<dyn Fn()>>)

Sets a method called when a disabled window receives input.
Source§

fn set_window_decorations(&self, enabled: WindowDecorations)

Requests the specified window decorations (title bar, borders, etc).
Source§

fn set_icon(&self, _icon: Option<Rc<dyn IWindowIconImpl>>)

Sets the icon of this window.
Source§

fn show_taskbar_icon(&self, _value: bool)

Enables or disables the taskbar icon.
Source§

fn can_resize(&self, value: bool)

Enables or disables resizing of the window.
Source§

fn set_can_minimize(&self, value: bool)

Enables or disables minimizing the window.
Source§

fn set_can_maximize(&self, value: bool)

Enables or disables maximizing the window.
Source§

fn closing(&self) -> Option<Rc<dyn Fn(WindowCloseReason) -> bool>>

Gets the method called before the underlying implementation is destroyed. Return true to prevent the underlying implementation from closing.
Source§

fn set_closing(&self, value: Option<Rc<dyn Fn(WindowCloseReason) -> bool>>)

Sets a method called before the underlying implementation is destroyed.
Source§

fn is_client_area_extended_to_decorations(&self) -> bool

Gets a value to indicate if the platform was able to extend client area to non-client area.
Source§

fn extend_client_area_to_decorations_changed(&self) -> Option<Rc<dyn Fn(bool)>>

Gets the method called when the “extend client area to decorations” state changes.
Source§

fn set_extend_client_area_to_decorations_changed( &self, value: Option<Rc<dyn Fn(bool)>>, )

Sets a method called when the “extend client area to decorations” state changes.
Source§

fn needs_managed_decorations(&self) -> bool

Gets a flag that indicates if managed decorations i.e. caption buttons are required. This property is used when the client area is extended to the decorations.
Source§

fn requested_drawn_decorations(&self) -> PlatformRequestedDrawnDecoration

Gets the decorations the platform asks the toolkit to draw.
Source§

fn extended_margins(&self) -> Thickness

Gets a thickness that describes the amount each side of the non-client area extends into the client area.
Source§

fn off_screen_margin(&self) -> Thickness

Gets a thickness that describes the margin around the window that is offscreen.
Source§

fn begin_move_drag(&self, _e: &PointerPressedEventArgs)

Starts moving a window with left button being held. Should be called from a left mouse button press event handler.
Source§

fn begin_resize_drag(&self, edge: WindowEdge, _e: &PointerPressedEventArgs)

Starts resizing a window. This function is used if an application has window resizing controls. Should be called from a left mouse button press event handler.
Source§

fn resize(&self, client_size: Size, reason: WindowResizeReason)

Sets the client size of the top level. Read more
Source§

fn move_(&self, point: PixelPoint)

Sets the position of the window, in device pixels.
Source§

fn set_min_max_size(&self, min_size: Size, max_size: Size)

Sets the minimum and maximum size of the window, in device-independent pixels.
Source§

fn set_extend_client_area_to_decorations_hint( &self, extend_into_client_area_hint: bool, )

Sets if the client area should extend into the non-client area.
Source§

fn set_extend_client_area_title_bar_height_hint(&self, title_bar_height: f64)

Sets the height of the title bar if the client area is extended; -1 stands for the system default.
Source§

fn drawn_decorations_request_changed(&self) -> Option<Rc<dyn Fn()>>

Gets the method called when the requested drawn decorations change.
Source§

fn set_drawn_decorations_request_changed(&self, _value: Option<Rc<dyn Fn()>>)

Sets a method called when the requested drawn decorations change.
Source§

fn allowed_window_actions(&self) -> PlatformAllowedWindowActions

Gets the window actions the platform currently allows.
Source§

fn allowed_window_actions_changed( &self, ) -> Option<Rc<dyn Fn(PlatformAllowedWindowActions)>>

Gets the method called when the allowed window actions change.
Source§

fn set_allowed_window_actions_changed( &self, _value: Option<Rc<dyn Fn(PlatformAllowedWindowActions)>>, )

Sets a method called when the allowed window actions change.
Source§

fn set_shadow_extents(&self, _extents: Thickness)

Sets the extents of the shadow the toolkit draws around the window.

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.