#[non_exhaustive]pub enum HostEvent {
Show 40 variants
Ready {
restore_sidebar: bool,
},
Shutdown,
FileOpened {
file: FileInfo,
},
FileClosed {
file_id: FileId,
},
ActiveChanged {
pane: Option<PaneId>,
file_id: Option<FileId>,
},
ViewChanged {
view: ViewInfo,
},
WindowFocusChanged {
focused: bool,
},
ToolbarButtonClicked {
button_id: String,
},
HudButtonClicked {
button_id: String,
item_id: Option<String>,
pane: PaneId,
view: Option<ViewInfo>,
},
ContextMenuRequested(MenuContext),
ContextMenuItemSelected {
item_id: String,
context: MenuContext,
},
ToolActivated {
tool_id: String,
},
ToolDeactivated {
tool_id: String,
},
ShapeDrawn {
tool_id: String,
pane: PaneId,
file_id: FileId,
shape: Shape,
modifiers: Modifiers,
},
Pointer {
tool_id: String,
pane: PaneId,
file_id: FileId,
event: PointerEvent,
},
Key {
tool_id: Option<String>,
pane: Option<PaneId>,
key: String,
modifiers: Modifiers,
pressed: bool,
repeat: bool,
},
ObjectClicked {
object: ObjectRef,
pane: PaneId,
button: PointerButton,
modifiers: Modifiers,
click_count: u32,
},
ObjectHovered {
object: Option<ObjectRef>,
pane: PaneId,
},
ObjectEdited {
object: ObjectRef,
shape: Shape,
},
ObjectsDeleteRequested {
objects: Vec<ObjectRef>,
},
SelectionChanged {
objects: Vec<ObjectRef>,
},
Posted {
token: String,
},
EmptyAreaClicked {
pane: PaneId,
file_id: Option<FileId>,
modifiers: Modifiers,
},
Undo {
entry_id: String,
},
Redo {
entry_id: String,
},
UiCallback {
surface_id: String,
name: String,
args: Vec<Value>,
},
SurfaceClosed {
surface_id: String,
},
DialogResult {
request_id: String,
paths: Vec<String>,
},
ConfirmResult {
request_id: String,
confirmed: bool,
},
JobCancelRequested {
job_id: String,
},
FilterToggled {
filter_id: String,
enabled: bool,
},
UndoDropped {
entry_ids: Vec<String>,
},
HotkeyPressed {
hotkey_id: String,
pane: Option<PaneId>,
},
RegistrationRefused {
what: String,
id: String,
reason: String,
shown_reason: Option<String>,
},
DisplayChanged {
pane: PaneId,
display: DisplayAdjustments,
},
RoiChanged {
file_id: FileId,
roi: Option<Rect>,
},
BatchRun {
run_id: String,
command_id: String,
file: FileInfo,
output_dir: String,
params: Map<String, Value>,
},
ModelFetched {
request_id: String,
path: Option<String>,
model: Option<ModelRecord>,
error: Option<String>,
cancelled: bool,
},
LanguageChanged {
language: String,
},
Unknown,
}Expand description
Messages the host sends to a plugin’s handle_event.
Unless documented otherwise the response is ignored (return null).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ready
The host finished starting up; every plugin has been created and the main window exists. Restore surfaces and layers here.
Fields
This plugin’s sidebar was open when eov last exited; re-open it to restore the user’s layout.
Shutdown
The application is exiting. Flush state; no further events follow.
FileOpened
FileClosed
The file is closed; its layers were discarded.
ActiveChanged
The focused pane changed, or the file shown in it.
ViewChanged
A pane’s view settled after navigation (debounced).
WindowFocusChanged
ToolbarButtonClicked
Fields
HudButtonClicked
ContextMenuRequested(MenuContext)
The context menu is opening. Respond with ContextMenuResponse.
ContextMenuItemSelected
One of the plugin’s context-menu items was chosen.
ToolActivated
ToolDeactivated
ShapeDrawn
A host-drawn shape for one of the plugin’s tools was completed.
Pointer
Raw pointer input for an active Custom tool.
Key
Key input for an active Custom tool, or a plugin hotkey. key is
the raw key text; key_name names it.
Fields
ObjectClicked
Fields
ObjectHovered
ObjectEdited
A host editing gesture reshaped an editable object. The host already shows the new geometry; persist it (or upsert the old one to revert).
ObjectsDeleteRequested
The user asked to delete objects (Delete key or context menu).
SelectionChanged
The host-side selection of the plugin’s objects changed (click,
Escape, layer removal). objects is the complete new selection.
Posted
Delivered on the UI thread in response to the post method.
EmptyAreaClicked
A click in Navigate/Select mode hit none of the plugin’s objects.
Undo
Undo the plugin-pushed history entry.
Redo
UiCallback
A callback declared in a surface’s .slint file was invoked.
SurfaceClosed
The user closed a surface (window close button, Escape on a modal).
DialogResult
Result of dialog.open_file / dialog.save_file; empty = cancelled.
ConfirmResult
JobCancelRequested
FilterToggled
The user toggled one of the plugin’s filters in the host UI.
UndoDropped
The host dropped some of the plugin’s undo entries (the history is bounded, and a new change discards the redo history of its slide): they will never be undone or redone, so their data can be freed.
HotkeyPressed
A hotkey registered with methods::HOTKEY_REGISTER was pressed.
RegistrationRefused
Part of a registration was refused, e.g. a hotkey that eov or
another plugin already uses (what: "hotkey"; id: the button,
tool or hotkey id). eov has told the user and written it to its log.
Show shown_reason when it is there, else reason (wrapped in
crate::i18n::isolate inside a translated text). After a change of
language, registering the contribution again brings the reason in
the new language (eov does not warn the user twice).
Fields
DisplayChanged
How a pane displays its slide changed (see
methods::VIEW_DISPLAY).
RoiChanged
A slide’s region of interest was drawn, changed or removed (None).
BatchRun
A headless batch run (eov batch run, see
methods::BATCH_REGISTER) asks for file to be analysed with
command_id, writing results under output_dir. Slides come one at
a time; work may continue on the plugin’s own threads, and the run
waits until methods::BATCH_FINISH names run_id.
Fields
ModelFetched
The answer to methods::MODEL_FETCH: the model is stored and
verified (path and model), or it is not (error). The host has
already told the user why a download failed or was refused; plugins
need not repeat it. cancelled is set when the user declined the
download or cancelled it (and error says so).
Fields
model: Option<ModelRecord>LanguageChanged
The user chose another language for the interface: a tag of
crate::i18n::LANGUAGES. The SDK has already switched
tr! and the surfaces’ @tr texts to it when the
plugin receives this; hand eov again the texts it shows for the
plugin (toolbar tooltips, tool names, status texts) and update the
texts surfaces got as properties. Not sent by hosts before plugin API
1.1.
Unknown
Sent by newer hosts for events this plugin version does not know.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HostEvent
impl<'de> Deserialize<'de> for HostEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for HostEvent
Auto Trait Implementations§
impl Forget for HostEvent
impl Freeze for HostEvent
impl Move for HostEvent
impl RefUnwindSafe for HostEvent
impl Send for HostEvent
impl Sync for HostEvent
impl Unpin for HostEvent
impl UnsafeUnpin for HostEvent
impl UnwindSafe for HostEvent
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped except that the function takes &Self
Useful for functions that take &Self instead of Self. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped, except that the function takes &mut Self.
Useful for functions that take &mut Self instead of Self.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read more