Skip to main content

IconRenderPlan

Struct IconRenderPlan 

Source
pub struct IconRenderPlan {
    pub effect: Option<Effect>,
    pub stationary: bool,
    pub id: IconId,
    pub source_position: Point,
    pub final_position: Point,
    pub size_px: (u32, u32),
    pub image: Option<IconBitmap>,
    pub label: Option<IconLabel>,
    pub render_offset_px: (i32, i32),
    pub shortcut_arrow_image: Option<IconBitmap>,
}
Expand description

Per-icon rendering plan the engine hands to DesktopBackend::begin_overlay_session.

See the module-level documentation for who fills which field. The engine builds the plan from an IconAnimationSpec + the current icon snapshot; the backend enriches it with platform data (icon bitmap, label text, selection state, refined size).

Fields§

§effect: Option<Effect>

Optional shader applied to all enabled artwork for this icon.

§stationary: bool

Keep this non-participating desktop icon visible at its original position.

§id: IconId

Stable icon identifier — matches IconSnapshot::id.

§source_position: Point

Where the icon is right now, in the same virtual-screen coordinate space used by the rest of the API. The overlay pre-renders its first frame at this position so the transition from real icons → overlay icons is invisible.

§final_position: Point

Where the icon will be at the end of the animation. The backend teleports the real Shell icon here on the first overlay commit, before hiding the real icons.

§size_px: (u32, u32)

Rendered icon size on the source monitor, in pixels. The engine sets this to a placeholder ((48, 48) from placeholder) and the backend may refine it in-place using IFolderView2::GetViewModeAndIconSize + per-monitor DPI.

§image: Option<IconBitmap>

Raw premultiplied BGRA icon bitmap. None when the backend could not resolve one (very rare). The renderer falls back to a solid placeholder in that case.

§label: Option<IconLabel>

Label metadata for text rendering below the icon.

§render_offset_px: (i32, i32)

Per-icon render offset in physical pixels applied at draw time by the overlay renderer. IFolderView2::GetItemPosition returns Explorer’s bitmap top-left in X but sits ~2 DIPs above the actual bitmap top in Y, so overlay icons render 1–2 DIPs high without this correction. Backend populates this from a DPI-scaled empirical constant (BITMAP_TOP_INSET_DIP × icon_scale); engine leaves it at (0, 0) and renderers that do not need the shift may ignore it.

§shortcut_arrow_image: Option<IconBitmap>

Optional shortcut-arrow overlay bitmap, kept separate from Self::image so the renderer can anchor it to the actual thumbnail’s bottom-left corner — mirrored by the same shadow-reserve offset the base bitmap uses so the arrow lives in the drop-shadow gutter below-left of the thumbnail (matches Explorer). For slot-filling icons (default shortcuts to folders / exes / anything whose shell icon fills the slot) the anchor coincides with the slot bottom-left, so nothing moves for that case.

Kept out of image because for image / video / PDF thumbnails at ≥ 150 % DPI the shell returns a bitmap smaller than the slot; an arrow blended in at extraction time co-shifts with the (aspect-fit-centered) thumbnail and never overhangs the thumbnail bottom the way Explorer’s does.

None for icons the shell reports no shortcut arrow for, for callers who disabled draw_shortcut_overlay, or for backends (stub / fake) that don’t source shell overlays. The admin-elevation shield is not split off — it is still blended into Self::image at extraction time (bottom- right, half-slot size) because its slot-relative anchor happens to coincide with the base-bitmap anchor for every icon that carries a shield today.

Implementations§

Source§

impl IconRenderPlan

Source

pub fn placeholder( id: IconId, source_position: Point, final_position: Point, ) -> Self

Convenience constructor used by the engine before the backend enriches the plan: no image, no label, hard-coded 48×48 placeholder size.

source_position is where the icon lives now; final_position is where the animation will land it. The backend uses final_position to teleport the real Shell icon to its destination on the first overlay commit (so unhiding at the end of the animation is a no-op instead of a visible jump).

Trait Implementations§

Source§

impl Clone for IconRenderPlan

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 IconRenderPlan

Source§

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

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

impl PartialEq for IconRenderPlan

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IconRenderPlan

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