pub struct WindowImpl { /* private fields */ }Expand description
A macOS window.
Implementations§
Source§impl WindowImpl
impl WindowImpl
Sourcepub fn native(&self) -> Option<ComPtr<IFrnWindow>>
pub fn native(&self) -> Option<ComPtr<IFrnWindow>>
The native window; None once the window is disposed.
pub fn set_title_bar_color(&self, color: Color)
pub fn z_order(&self) -> Option<isize>
pub fn window_state_changed_cb(&self) -> Option<Rc<dyn Fn(WindowState)>>
pub fn set_window_state_changed_cb( &self, value: Option<Rc<dyn Fn(WindowState)>>, )
pub fn extend_client_area_to_decorations_changed_cb( &self, ) -> Option<Rc<dyn Fn(bool)>>
pub fn set_extend_client_area_to_decorations_changed_cb( &self, value: Option<Rc<dyn Fn(bool)>>, )
pub fn closing_cb(&self) -> Option<Rc<dyn Fn(WindowCloseReason) -> bool>>
pub fn set_closing_cb( &self, value: Option<Rc<dyn Fn(WindowCloseReason) -> bool>>, )
pub fn got_input_when_disabled_cb(&self) -> Option<Rc<dyn Fn()>>
pub fn set_got_input_when_disabled_cb(&self, value: Option<Rc<dyn Fn()>>)
Trait Implementations§
Source§impl IDisposable for WindowImpl
impl IDisposable for WindowImpl
Source§impl ITopLevelImpl for WindowImpl
impl ITopLevelImpl for WindowImpl
Source§fn desktop_scaling(&self) -> f64
fn desktop_scaling(&self) -> f64
Gets the scaling factor for window positioning and sizing.
Source§fn client_size(&self) -> Size
fn client_size(&self) -> Size
Gets the client size of the toplevel.
Source§fn render_scaling(&self) -> f64
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>>
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> ⓘ
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 moreSource§fn compositor(&self) -> Option<Rc<Compositor>>
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>)>>
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>)>>)
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)>>
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)>>)
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)>>
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)>>)
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)>>
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)>>)
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)>>
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)>>,
)
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>)
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
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
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>>)
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()>>
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()>>)
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()>>
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()>>)
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>>
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],
)
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
fn transparency_level(&self) -> WindowTransparencyLevel
Gets the current transparency level of the toplevel.
Source§fn acrylic_compensation_levels(&self) -> AcrylicPlatformCompensationLevels
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>)
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_window_base_impl(&self) -> Option<&dyn IWindowBaseImpl>
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>
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>>
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>>)>>
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>>)>>,
)
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>
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>
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
impl IWindowBaseImpl for WindowImpl
Source§fn frame_size(&self) -> Option<Size>
fn frame_size(&self) -> Option<Size>
Gets the total size of the toplevel, excluding shadows.
Source§fn position(&self) -> PixelPoint
fn position(&self) -> PixelPoint
Gets the position of the window in device pixels.
Source§fn position_changed(&self) -> Option<Rc<dyn Fn(PixelPoint)>>
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)>>)
fn set_position_changed(&self, value: Option<Rc<dyn Fn(PixelPoint)>>)
Sets a method called when the window’s position changes.
Source§fn deactivated(&self) -> Option<Rc<dyn Fn()>>
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()>>)
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()>>
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()>>)
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
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)
fn set_topmost(&self, value: bool)
Sets whether this window appears on top of all other windows.
Source§impl IWindowImpl for WindowImpl
impl IWindowImpl for WindowImpl
Source§fn window_state(&self) -> WindowState
fn window_state(&self) -> WindowState
Gets the minimized/maximized state of the window.
Source§fn set_window_state(&self, value: WindowState)
fn set_window_state(&self, value: WindowState)
Sets the minimized/maximized state of the window.
Source§fn window_state_getter_is_usable(&self) -> bool
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)>>
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)>>)
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_parent(&self, parent: Option<Rc<dyn IWindowImpl>>)
fn set_parent(&self, parent: Option<Rc<dyn IWindowImpl>>)
Sets the parent of the window.
Source§fn set_enabled(&self, enable: bool)
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()>>
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()>>)
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)
fn set_window_decorations(&self, enabled: WindowDecorations)
Requests the specified window decorations (title bar, borders, etc).
Source§fn show_taskbar_icon(&self, _value: bool)
fn show_taskbar_icon(&self, _value: bool)
Enables or disables the taskbar icon.
Source§fn can_resize(&self, value: bool)
fn can_resize(&self, value: bool)
Enables or disables resizing of the window.
Source§fn set_can_minimize(&self, value: bool)
fn set_can_minimize(&self, value: bool)
Enables or disables minimizing the window.
Source§fn set_can_maximize(&self, value: bool)
fn set_can_maximize(&self, value: bool)
Enables or disables maximizing the window.
Source§fn closing(&self) -> Option<Rc<dyn Fn(WindowCloseReason) -> bool>>
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>>)
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
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)>>
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)>>,
)
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
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
fn requested_drawn_decorations(&self) -> PlatformRequestedDrawnDecoration
Gets the decorations the platform asks the toolkit to draw.
Source§fn extended_margins(&self) -> Thickness
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
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)
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)
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)
fn resize(&self, client_size: Size, reason: WindowResizeReason)
Sets the client size of the top level. Read more
Source§fn move_(&self, point: PixelPoint)
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)
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,
)
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)
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()>>
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()>>)
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
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)>>
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)>>,
)
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)
fn set_shadow_extents(&self, _extents: Thickness)
Sets the extents of the shadow the toolkit draws around the window.
Auto Trait Implementations§
impl !Freeze for WindowImpl
impl !RefUnwindSafe for WindowImpl
impl !Send for WindowImpl
impl !Sync for WindowImpl
impl !UnwindSafe for WindowImpl
impl Unpin for WindowImpl
impl UnsafeUnpin for WindowImpl
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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