Guarded native editor lifecycle¶
PluginEditor exclusively borrows a live Clack instance on its plugin/OS main
thread. create negotiates explicit API/floating configuration and owns successful
GUI creation. Embedded default and negotiated sizes must be 1..16384 per dimension.
A missing extension/unsupported API rejects before native creation; invalid initial
size after creation is paired with immediate destroy. Embedded show requires a
successful parent attachment. resize checks resize support and asks the plugin
to adjust before applying a bounded size. Successful show/hide calls are idempotent
and track state. Drop hides a shown GUI and always calls destroy, including scope
exit or early return. It borrows the instance, so the library remains live throughout.
set_parent and floating set_transient are explicit unsafe native operations:
the caller's compatible parent must remain alive through guard destruction, on
the correct OS UI thread. A Rust Window handle alone does not prove native-object
lifetime. Parent window creation/ownership, event-loop pumping, host GUI resize/show/
hide requests, focus/scaling and callback scheduling remain consumer responsibilities.
The temporary plugin_handle allows explicit state/parameter operations without
replacing/moving the borrowed instance; main_thread_callback services only an
explicitly scheduled plugin request. The guard does not activate/deactivate audio.
On macOS, the native fixture owns a Cocoa parent and verifies child creation and removal across three create/attach/show/resize-or-reject/hide/drop cycles:
cargo run -p ravet-editor-smoke --example hosted --locked -- 'target/clap/release/RAVET Gain.clap'
RAVET Gain and the unmodified upstream Clack EGUI gain at the pinned v0.2 commit both pass. The upstream GUI bundle was built only under target; its baseview/egui GPU dependencies are not RAVET dependencies. These tests establish local native child/lifecycle and callback acceptance, not visual hide/focus/accessibility or all-third-party editor compatibility. Floating GUIs and other OS/API combinations remain unvalidated. See decision 0048.