|
| virtual | ~Editor ()=default |
| virtual bool | supports_parent (NativeParentKind kind) const =0 |
| | Whether this editor can attach to a parent of kind.
|
| virtual bool | attach (const NativeParent &parent)=0 |
| | Attach to and start drawing into parent.
|
| virtual void | detach ()=0 |
| | Stop drawing and remove everything the editor added to its parent.
|
| virtual void | invalidate ()=0 |
| | The host's window is already gone or about to be destroyed by the host itself.
|
| virtual EditorSize | size () const =0 |
| | The editor's current size.
|
| virtual bool | set_size (const EditorSize &size)=0 |
| | The host resized the window (or changed its scale).
|
| virtual ViewSize | size_hints () const |
| | Preferred, minimum and maximum size and the aspect ratio to hold.
|
| virtual EditorSize | adjust_size (const EditorSize &proposed) const |
| | The nearest size to proposed this editor accepts, for a host that negotiates during an interactive resize.
|
| virtual void | idle () |
| | Main-thread tick from the host (a timer or the window's frame clock).
|
| virtual void | visibility_changed (bool) |
| | The editor's window became visible or hidden without being detached.
|
| virtual void | focus_changed (bool) |
| | The editor's window gained or lost keyboard focus.
|
| virtual KeyDisposition | offer_key (const EditorKeyEvent &) |
| | A key the host would otherwise act on itself, offered synchronously before it does.
|
| virtual void | parameter_highlight (state::ParamID, bool, std::uint32_t) |
| | The host highlights or un-highlights a parameter's control (for example while it is automation-enabled).
|
| virtual EditorAutomation * | automation () |
| | The editor's automation surface, or null when it has none.
|
One editor instance in one native window.
Lifecycle: the factory creates it unattached. The size members may be called before the first attach(): some hosts negotiate scale and size first and only then hand over a window, and some defer attaching until the host's size settles. The host then calls attach() with its window, any of the members below, and detach(); the editor may be attached again or destroyed. If the host's window is going away underneath the editor without an orderly detach, the host calls invalidate() instead.
Every member runs on the host's main thread.
Reaching the plug-in: an editor reaches parameter and visual state only through its EditorContext ports. Once the host has called invalidate(), or has begun closing the editor because its plug-in instance is going away (including a teardown off the main thread, where the instance is destroyed before the editor's close runs on the main thread), the editor must not use the Processor& it was created with: that processor may already be gone. Its ports are disconnected by then and refuse every call, so an editor that only uses its context stays safe.