pub enum ViewCommand {
Create {
slot_id: u64,
view_type: String,
params_json: String,
interactive: bool,
},
Update {
slot_id: u64,
rect: Rect,
clip: Option<Rect>,
visible: bool,
shields: Vec<Rect>,
z_index: u32,
},
UpdateParams {
slot_id: u64,
params_json: String,
},
Dispose {
slot_id: u64,
},
Overlay {
overlay_id: u64,
above_slot_id: u64,
rect: Rect,
command_range: Range<usize>,
},
DisposeOverlay {
overlay_id: u64,
},
}Expand description
One native-sibling-compositor instruction — the differ’s whole output
vocabulary. Clone + PartialEq + Debug so a golden
test can assert an exact command sequence.
Variants§
Create
Create a new native view for slot_id. Always immediately followed,
in the same batch, by an ViewCommand::Update placing it.
Fields
Update
Place/resize/clip/show-or-hide an already-created slot. Logical px,
absolute window coordinates (mirroring PlatformViewFrame) — the
receiving shell scales to physical px at its own FFI boundary.
Fields
UpdateParams
params_json changed (params_generation advanced) with no
necessary rect/clip/visible change — a separate command so a shell
doesn’t have to re-place a view just to hand it new creation params.
Dispose
Tear down a slot’s native view entirely. A slot_id reused after this
(the same numeric id reappearing in a later ingest) is treated as
brand-new — see the module docs’ Widget teardown detection.
Overlay
Create or re-place the overlay carrying the frust content painted above
above_slot_id — see the module docs’ Z-order and overlays. A host
that has no overlay overlay_id yet creates one; otherwise it adopts
the new rect and range. An overlay stacks directly above its slot’s
native view and below any slot with a higher z_index.
Fields
overlay_id: u64Stable id for this overlay, allocated by the differ; never reused
within one PlatformViewState.
rect: RectWhere the overlay covers, logical px, absolute window coordinates.
v1: the whole window (the viewport the shell passed to
PlatformViewState::ingest_scene).
command_range: Range<usize>The half-open range of the frame’s command list (the slice passed
to PlatformViewState::ingest_scene) the overlay renders, in
painter order. Empty when the overlay’s content has disappeared —
it then draws nothing until it is re-sent or disposed.
DisposeOverlay
Tear an overlay down. A Dispose-style no-op for an id the host does
not have.