Expand description
The message protocol spoken between the eov host and plugins.
The binary ABI (crate::abi) is deliberately tiny: almost every
interaction is a JSON message whose schema is defined here as serde types
shared by both sides. This keeps the ABI stable while the protocol grows:
- new optional fields are added with
#[serde(default)], so older peers ignore them and newer peers tolerate their absence; - new event variants deserialize as
HostEvent::Unknownin older plugins; - new host methods are answered with an
unknown methoderror by older hosts, so plugins can feature-detect them.
§Coordinates
All image coordinates are level-0 pixels of the slide (x to the right,
y down, origin at the top-left of the level-0 canvas as OpenSlide reports
it). Screen coordinates are logical pixels relative to the top-left corner of
the pane. zoom is screen pixels per level-0 pixel.
§Threading contract
HostEvents are delivered on the host’s UI thread, one at a time, with no host locks held. Handlers must return quickly (aim for < 5 ms); long work belongs on a plugin-owned thread.- Every host method may be called from any thread at any time. Calls never block on the UI thread: queries answer from a recent published snapshot and mutations are queued and applied on the UI thread in call order.
- CPU filters may run on any render worker thread, concurrently for different panes.
Modules§
- event_
names - The
typetags ofHostEventvariants, forevents.subscribe. - methods
- Names of the methods a plugin can invoke through
HostApi::call.
Structs§
- Associated
Image Info - An associated image (
label,macro,thumbnail, …) of a slide. - Badge
Args - Arguments of
methods::BADGE_SET. - Batch
Command Spec - A command a plugin offers for headless batch runs (see
methods::BATCH_REGISTER). - Batch
Finish Args - Arguments of
methods::BATCH_FINISH. - Batch
Param - A parameter of a
BatchCommandSpec. - Batch
Progress Args - Arguments of
methods::BATCH_PROGRESS. - Button
Update - Partial update of a toolbar or HUD button.
- Confirm
Args - Context
Menu Response - Response to
HostEvent::ContextMenuRequested. - Display
Adjustments - How a pane displays its slide (the answer of
methods::VIEW_DISPLAY). - File
Args - File
Dialog Args - File
Filter - File
Info - Metadata of an open slide.
- Filter
Enable Args - Filter
Spec - A viewport filter (CPU post-processing of rendered frames).
- Host
Snapshot - A consistent, recent view of the host state.
- Hotkey
- A hotkey binding.
keyis a single character (case-insensitive) or a named key such as"F2","Delete","Escape"(seekey_name). - Hotkey
Spec - A plugin key binding (see
methods::HOTKEY_REGISTER). - HudButton
Spec - A button in every viewport’s HUD toolbar. When
menuis non-empty the button opens a drop-down and clicks report the chosenitem_id. - IdArgs
- JobFinish
Args - JobStart
Args - JobStarted
- JobUpdate
Args - KeyArgs
- Layer
Spec - Declares an overlay layer. Layers belong to one open file and are drawn only in panes showing it; they are discarded when the file closes.
- Layer
Update - Partial update of a layer;
Noneleaves a field unchanged. - Level
Info - One pyramid level of a slide.
- LogArgs
- Measurement
Info - A measurement made with the host’s measurement tools.
- Menu
Context - Where a context menu was opened.
- Menu
Item - An entry of a menu (context menu, HUD drop-down). Enabled unless
enabledsays otherwise, also when built with..Default::default(). - MinZoom
Args - Arguments of
methods::LAYER_SET_MIN_ZOOM. - Model
Companion - A companion file of a stored model.
- Model
Fetch Args - Arguments of
methods::MODEL_FETCH. Models are stored by the SHA-256 of their main file, so the same model is downloaded once for every plugin and every eov of this user. - Model
File Spec - A file a model needs next to its main file, such as the external
weights of an ONNX model (
model.onnx.data). - Model
Record - A model in eov’s model store (
eov model list). - Model
Resolve Args - Arguments of
methods::MODEL_RESOLVE. - Modifiers
- Keyboard modifiers held during an input event.
- Notify
Args - Object
Ref - Identifies an overlay object: a plugin-scoped layer id plus an object id.
- Offset
Args - Open
File Args - Overlay
Object - A vector object in an overlay layer.
- Pane
Args - Pane
Filter Args - Arguments of
methods::LAYER_SET_PANES. - Pane
Info - One pane in display order.
- Pane
Visibility Args - Arguments of
methods::LAYER_SET_PANE_VISIBILITY. - Plugin
Init - Information handed to a plugin when it is created.
- Pointer
Event - A pointer event for a plugin-owned custom tool.
- Post
Args - Rect
- An axis-aligned rectangle in level-0 pixels.
- Remove
Objects Args - Request
Id - Rgba
- An RGBA colour, each channel 0–255.
- Select
Args - Series
Args - Settings
SetArgs - Slide
Info - The metadata of a slide a plugin opened
(
crate::abi::SlideFfi::info,SlideReader::infoin the SDK). - Slide
Level - One pyramid level of a slide a plugin opened.
- Slide
Open Request - What the host asks a plugin’s slide source to open
(
crate::abi::SlideSourceFfi::open,Plugin::open_slidein the SDK). - Status
Args - Style
- Visual style of overlay objects.
- Subscribe
Args - Surface
Opened - Surface
Properties - Surface
Spec - A Slint UI surface.
ui_pathis relative to the plugin root. - Text
Args - ToolRef
- Reference to a tool: the owning plugin (
Nonefor host tools) and its id. - Tool
Spec - A tool contributed by a plugin. It appears in the toolbar’s tool group.
- Toolbar
Button Spec - A button in the main window toolbar. Enabled unless
enabledsays otherwise, also when built with..Default::default(). - Undo
Clear Args - Undo
Push Args - Upsert
Objects Args - View
Frame Args - View
Info - The visible state of a pane showing a slide.
- View
Orientation Args - View
PanArgs - View
SetArgs - View
Zoom Args
Enums§
- Cursor
- Dash
- Host
Event - Messages the host sends to a plugin’s
handle_event. - LogLevel
- Notify
Level - Pointer
Button - Pointer
Kind - Series
Action - Shape
- A geometric shape in level-0 pixel coordinates.
- Size
Unit - The unit an object’s stroke width or point size is expressed in.
- Surface
Kind - Tool
Kind - What the host does while a tool is active.
Constants§
- MAX_
ASSOCIATED_ IMAGES - Most associated images a
SlideInfomay list. - MAX_
ASSOCIATED_ IMAGE_ PIXELS - Most pixels of one associated image (2^28).
- MAX_
SLIDE_ LEVELS - Most pyramid levels a
SlideInfomay list. - MAX_
SLIDE_ SIDE - Longest side, in pixels, of a slide eov accepts (2^24 = 16,777,216).
Functions§
- check_
model_ file_ name - Checks a name a model file is stored under: one plain file name that every platform accepts.
- is_
sha256_ hex - Whether
textis a SHA-256 in hex (64 digits, either case). - key_
name - The name of a key as
Hotkey::keyandToolSpec::keyswrite it, from the raw text ofHostEvent::Key: a character in lower case ("a","+") or a named key ("Escape","Enter","Tab","Backspace","Delete","Space","ArrowLeft","F2","Home","PageUp", …).
Type Aliases§
- FileId
- Host-assigned identifier of an open slide, stable for the session.
- PaneId
- Host-assigned, stable identifier of a viewer pane (not its position).
- Property
Map - Slide-wide JSON map type used by
file.properties.