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: boolKeep this non-participating desktop icon visible at its original position.
id: IconIdStable icon identifier — matches
IconSnapshot::id.
source_position: PointWhere 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: PointWhere 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
impl IconRenderPlan
Sourcepub fn placeholder(
id: IconId,
source_position: Point,
final_position: Point,
) -> Self
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).