Skip to main content

FakeDesktop

Struct FakeDesktop 

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

Observable, cloneable fake desktop backed by a HashMap.

Implementations§

Source§

impl FakeDesktop

Source

pub fn real_icons_visible(&self) -> bool

Source

pub fn new() -> Self

Source

pub fn add_icon(&self, snap: IconSnapshot)

Add or replace an icon.

Source

pub fn remove_icon(&self, id: &IconId) -> bool

Remove an icon (simulates the user deleting it while an animation is running).

Source

pub fn icon_count(&self) -> usize

Source

pub fn position_of(&self, id: &IconId) -> Option<Point>

Look up the current position of one icon.

Source

pub fn flags(&self) -> u32

Current folder-view flags.

Source

pub fn commit_log(&self) -> Vec<Vec<(IconId, Point)>>

Take a copy of the commit log so far. Does not clear it.

Source

pub fn flag_ops(&self) -> Vec<(u32, u32)>

Take a copy of the flag-op log so far.

Source

pub fn set_next_list_error(&self, err: DesktopError)

Cause the next list_icons call to fail with this error.

Source

pub fn set_monitors(&self, monitors: Vec<MonitorInfo>)

Replace the simulated monitor layout. Useful for testing multi-monitor placement without needing a real second display.

Source

pub fn set_desktop_info(&self, desktop: DesktopInfo)

Source

pub fn set_next_overlay_error(&self, err: DesktopError)

Cause the next begin_overlay_session call to fail with this error. Used by tests to exercise the engine’s overlay-unavailable fallback path.

Source

pub fn overlay_active(&self) -> bool

Whether an overlay session is currently open.

Source

pub fn last_overlay_plans(&self) -> Vec<IconRenderPlan>

Snapshot of the plans handed to the most recent successful begin_overlay_session call.

Source

pub fn last_overlay_render_options(&self) -> OverlayRenderOptions

Snapshot of the render options handed to the most recent successful begin_overlay_session call. Defaults to all_enabled before any session has opened.

Source

pub fn overlay_frame_log(&self) -> Vec<Vec<(IconId, Point)>>

Snapshot of every commit_overlay_frame call in order.

Source

pub fn visual_frame_log(&self) -> Vec<Vec<IconFrame>>

Source

pub fn overlay_finalize_log(&self) -> Vec<Vec<(IconId, Point)>>

Snapshot of every finalize_overlay_session call in order.

Source

pub fn queue_commit_error(&self, err: DesktopError)

Queue an error to be returned from the next commit_overlay_frame call. Multiple queued errors are consumed in FIFO order.

Useful for exercising the engine’s DesktopError::OverlayCancelled path from tests.

Trait Implementations§

Source§

impl Clone for FakeDesktop

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FakeDesktop

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FakeDesktop

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DesktopBackend for FakeDesktop

Source§

fn list_icons(&mut self) -> Result<Vec<IconSnapshot>, DesktopError>

Source§

fn get_flags(&mut self) -> Result<u32, DesktopError>

Source§

fn apply_flags(&mut self, mask: u32, values: u32) -> Result<(), DesktopError>

Source§

fn set_positions( &mut self, moves: &[(IconId, Point)], ) -> Result<Vec<IconId>, DesktopError>

Commit a batch of (id, new_position) moves. Returns the ids the backend could not resolve (i.e. icons that vanished or were never on the desktop).
Source§

fn list_monitors(&mut self) -> Result<Vec<MonitorInfo>, DesktopError>

Enumerate every connected display. Bounds are reported in the same virtual-screen coordinate system used by list_icons and set_positions.
Source§

fn desktop_info( &mut self, _icons: &[IconSnapshot], ) -> Result<DesktopInfo, DesktopError>

Query live display/grid metrics using the worker’s current icon snapshot. Must not reposition icons or change folder flags.
Source§

fn begin_overlay_session( &mut self, plans: &[IconRenderPlan], render_options: OverlayRenderOptions, ) -> Result<(), DesktopError>

Prepare an overlay animation session covering the icons in plans. Read more
Source§

fn commit_overlay_frame( &mut self, positions: &[(IconId, Point)], ) -> Result<(), DesktopError>

Update the overlay’s rendered icon positions to positions. Read more
Source§

fn discard_overlay_session(&mut self)

Discard a prepared, never-started session without touching Shell positions.
Source§

fn commit_visual_frame( &mut self, frame: &[IconFrame], ) -> Result<(), DesktopError>

Commit positions and visual clocks together. Non-GPU backends ignore visuals.
Source§

fn poll_overlay_session(&mut self) -> Result<(), DesktopError>

Source§

fn set_real_icons_visible(&mut self, visible: bool) -> Result<(), DesktopError>

Source§

fn finalize_overlay_session( &mut self, final_positions: &[(IconId, Point)], ) -> Result<FinalCommitOutcome, DesktopError>

End the animation session and commit the final positions to the Shell. Read more
Source§

fn validate_prepared_session(&mut self) -> Result<(), DesktopError>

Reject a prepared snapshot invalidated by environment changes, before any Shell writes.
Source§

fn prepare_scene_renderer( &mut self, _canvas: Canvas, _plans: &[IconRenderPlan], _options: OverlayRenderOptions, ) -> Result<Box<dyn SceneRenderer>, DesktopError>

Source§

fn capture_overlay( &mut self, _seconds: f64, ) -> Result<CapturedFrame, DesktopError>

Source§

fn render_overlay_snapshot( &mut self, width_px: u32, height_px: u32, dpi_scale: f32, positions: &[(IconId, Point)], render_options: OverlayRenderOptions, ) -> Result<SnapshotFrame, DesktopError>

Render one frame of the overlay off-screen and return the raw pixels — never touches an HWND, DirectComposition target, or the real desktop. Safe to call at any time, including while a begin_overlay_session is active on another animation. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more