pub struct MockWindowDispatcher { /* private fields */ }
Available on crate feature
test
only.Trait Implementations§
Source§impl Clone for MockWindowDispatcher
impl Clone for MockWindowDispatcher
Source§fn clone(&self) -> MockWindowDispatcher
fn clone(&self) -> MockWindowDispatcher
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MockWindowDispatcher
impl Debug for MockWindowDispatcher
Source§impl<T: UserEvent> WindowDispatch<T> for MockWindowDispatcher
impl<T: UserEvent> WindowDispatch<T> for MockWindowDispatcher
Source§type Runtime = MockRuntime
type Runtime = MockRuntime
The runtime this
WindowDispatch
runs under.Source§type WindowBuilder = MockWindowBuilder
type WindowBuilder = MockWindowBuilder
The window builder type.
Source§fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> Result<()>
Run a task on the main thread.
Source§fn on_window_event<F: Fn(&WindowEvent) + Send + 'static>(
&self,
f: F,
) -> WindowEventId
fn on_window_event<F: Fn(&WindowEvent) + Send + 'static>( &self, f: F, ) -> WindowEventId
Registers a window event handler.
Source§fn scale_factor(&self) -> Result<f64>
fn scale_factor(&self) -> Result<f64>
Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
Source§fn inner_position(&self) -> Result<PhysicalPosition<i32>>
fn inner_position(&self) -> Result<PhysicalPosition<i32>>
Returns the position of the top-left hand corner of the window’s client area relative to the top-left hand corner of the desktop.
Source§fn outer_position(&self) -> Result<PhysicalPosition<i32>>
fn outer_position(&self) -> Result<PhysicalPosition<i32>>
Returns the position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
Source§fn inner_size(&self) -> Result<PhysicalSize<u32>>
fn inner_size(&self) -> Result<PhysicalSize<u32>>
Returns the physical size of the window’s client area. Read more
Source§fn outer_size(&self) -> Result<PhysicalSize<u32>>
fn outer_size(&self) -> Result<PhysicalSize<u32>>
Returns the physical size of the entire window. Read more
Source§fn is_fullscreen(&self) -> Result<bool>
fn is_fullscreen(&self) -> Result<bool>
Gets the window’s current fullscreen state.
Source§fn is_minimized(&self) -> Result<bool>
fn is_minimized(&self) -> Result<bool>
Gets the window’s current minimized state.
Source§fn is_maximized(&self) -> Result<bool>
fn is_maximized(&self) -> Result<bool>
Gets the window’s current maximized state.
Source§fn is_focused(&self) -> Result<bool>
fn is_focused(&self) -> Result<bool>
Gets the window’s current focus state.
Source§fn is_decorated(&self) -> Result<bool>
fn is_decorated(&self) -> Result<bool>
Gets the window’s current decoration state.
Source§fn is_resizable(&self) -> Result<bool>
fn is_resizable(&self) -> Result<bool>
Gets the window’s current resizable state.
Source§fn is_maximizable(&self) -> Result<bool>
fn is_maximizable(&self) -> Result<bool>
Gets the window’s native maximize button state. Read more
Source§fn is_minimizable(&self) -> Result<bool>
fn is_minimizable(&self) -> Result<bool>
Gets the window’s native minimize button state. Read more
Source§fn is_visible(&self) -> Result<bool>
fn is_visible(&self) -> Result<bool>
Gets the window’s current visibility state.
Source§fn current_monitor(&self) -> Result<Option<Monitor>>
fn current_monitor(&self) -> Result<Option<Monitor>>
Returns the monitor on which the window currently resides. Read more
Source§fn primary_monitor(&self) -> Result<Option<Monitor>>
fn primary_monitor(&self) -> Result<Option<Monitor>>
Returns the primary monitor of the system. Read more
Source§fn monitor_from_point(&self, x: f64, y: f64) -> Result<Option<Monitor>>
fn monitor_from_point(&self, x: f64, y: f64) -> Result<Option<Monitor>>
Returns the monitor that contains the given point.
Source§fn available_monitors(&self) -> Result<Vec<Monitor>>
fn available_monitors(&self) -> Result<Vec<Monitor>>
Returns the list of all the monitors available on the system.
Source§fn gtk_window(&self) -> Result<ApplicationWindow>
fn gtk_window(&self) -> Result<ApplicationWindow>
Returns the
ApplicationWindow
from gtk crate that is used by this window.Source§fn default_vbox(&self) -> Result<Box>
fn default_vbox(&self) -> Result<Box>
Returns the vertical
gtk::Box
that is added by default as the sole child of this window.Source§fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
fn window_handle(&self) -> Result<WindowHandle<'_>, HandleError>
Raw window handle.
Source§fn request_user_attention(
&self,
request_type: Option<UserAttentionType>,
) -> Result<()>
fn request_user_attention( &self, request_type: Option<UserAttentionType>, ) -> Result<()>
Requests user attention to the window. Read more
Source§fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>(
&mut self,
pending: PendingWindow<T, Self::Runtime>,
_after_window_creation: Option<F>,
) -> Result<DetachedWindow<T, Self::Runtime>>
fn create_window<F: Fn(RawWindow<'_>) + Send + 'static>( &mut self, pending: PendingWindow<T, Self::Runtime>, _after_window_creation: Option<F>, ) -> Result<DetachedWindow<T, Self::Runtime>>
Create a new window.
Source§fn create_webview(
&mut self,
pending: PendingWebview<T, Self::Runtime>,
) -> Result<DetachedWebview<T, Self::Runtime>>
fn create_webview( &mut self, pending: PendingWebview<T, Self::Runtime>, ) -> Result<DetachedWebview<T, Self::Runtime>>
Create a new webview.
Source§fn set_maximizable(&self, maximizable: bool) -> Result<()>
fn set_maximizable(&self, maximizable: bool) -> Result<()>
Updates the window’s native maximize button state. Read more
Source§fn set_minimizable(&self, minimizable: bool) -> Result<()>
fn set_minimizable(&self, minimizable: bool) -> Result<()>
Updates the window’s native minimize button state. Read more
Source§fn set_closable(&self, closable: bool) -> Result<()>
fn set_closable(&self, closable: bool) -> Result<()>
Updates the window’s native close button state. Read more
Source§fn unmaximize(&self) -> Result<()>
fn unmaximize(&self) -> Result<()>
Unmaximizes the window.
Source§fn unminimize(&self) -> Result<()>
fn unminimize(&self) -> Result<()>
Unminimizes the window.
Source§fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()>
fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()>
Updates the window alwaysOnBottom flag.
Source§fn set_always_on_top(&self, always_on_top: bool) -> Result<()>
fn set_always_on_top(&self, always_on_top: bool) -> Result<()>
Updates the window alwaysOnTop flag.
Source§fn set_visible_on_all_workspaces(
&self,
visible_on_all_workspaces: bool,
) -> Result<()>
fn set_visible_on_all_workspaces( &self, visible_on_all_workspaces: bool, ) -> Result<()>
Updates the window visibleOnAllWorkspaces flag.
Source§fn set_content_protected(&self, protected: bool) -> Result<()>
fn set_content_protected(&self, protected: bool) -> Result<()>
Prevents the window contents from being captured by other apps.
Source§fn set_skip_taskbar(&self, skip: bool) -> Result<()>
fn set_skip_taskbar(&self, skip: bool) -> Result<()>
Whether to hide the window icon from the taskbar or not.
Source§fn set_cursor_grab(&self, grab: bool) -> Result<()>
fn set_cursor_grab(&self, grab: bool) -> Result<()>
Grabs the cursor, preventing it from leaving the window. Read more
Source§fn set_cursor_visible(&self, visible: bool) -> Result<()>
fn set_cursor_visible(&self, visible: bool) -> Result<()>
Modifies the cursor’s visibility. Read more
fn set_cursor_icon(&self, icon: CursorIcon) -> Result<()>
Source§fn set_cursor_position<Pos: Into<Position>>(&self, position: Pos) -> Result<()>
fn set_cursor_position<Pos: Into<Position>>(&self, position: Pos) -> Result<()>
Changes the position of the cursor in window coordinates.
Source§fn set_ignore_cursor_events(&self, ignore: bool) -> Result<()>
fn set_ignore_cursor_events(&self, ignore: bool) -> Result<()>
Ignores the window cursor events.
Source§fn start_dragging(&self) -> Result<()>
fn start_dragging(&self) -> Result<()>
Starts dragging the window.
Source§fn start_resize_dragging(&self, direction: ResizeDirection) -> Result<()>
fn start_resize_dragging(&self, direction: ResizeDirection) -> Result<()>
Starts resize-dragging the window.
Source§fn set_progress_bar(&self, progress_state: ProgressBarState) -> Result<()>
fn set_progress_bar(&self, progress_state: ProgressBarState) -> Result<()>
Sets the taskbar progress state. Read more
Source§fn set_title_bar_style(&self, style: TitleBarStyle) -> Result<()>
fn set_title_bar_style(&self, style: TitleBarStyle) -> Result<()>
Sets the title bar style. Available on macOS only. Read more
Source§fn set_size_constraints(&self, constraints: WindowSizeConstraints) -> Result<()>
fn set_size_constraints(&self, constraints: WindowSizeConstraints) -> Result<()>
Sets this window’s minimum inner width.
Source§fn set_theme(&self, theme: Option<Theme>) -> Result<()>
fn set_theme(&self, theme: Option<Theme>) -> Result<()>
Sets the theme for this window. Read more
Source§fn is_enabled(&self) -> Result<bool>
fn is_enabled(&self) -> Result<bool>
Whether the window is enabled or disable.
Auto Trait Implementations§
impl Freeze for MockWindowDispatcher
impl !RefUnwindSafe for MockWindowDispatcher
impl Send for MockWindowDispatcher
impl Sync for MockWindowDispatcher
impl Unpin for MockWindowDispatcher
impl !UnwindSafe for MockWindowDispatcher
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> 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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)