Skip to main content

Module protocol

Module protocol 

Source
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::Unknown in older plugins;
  • new host methods are answered with an unknown method error 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 type tags of HostEvent variants, for events.subscribe.
methods
Names of the methods a plugin can invoke through HostApi::call.

Structs§

AssociatedImageInfo
An associated image (label, macro, thumbnail, …) of a slide.
BadgeArgs
Arguments of methods::BADGE_SET.
BatchCommandSpec
A command a plugin offers for headless batch runs (see methods::BATCH_REGISTER).
BatchFinishArgs
Arguments of methods::BATCH_FINISH.
BatchParam
A parameter of a BatchCommandSpec.
BatchProgressArgs
Arguments of methods::BATCH_PROGRESS.
ButtonUpdate
Partial update of a toolbar or HUD button.
ConfirmArgs
ContextMenuResponse
Response to HostEvent::ContextMenuRequested.
DisplayAdjustments
How a pane displays its slide (the answer of methods::VIEW_DISPLAY).
FileArgs
FileDialogArgs
FileFilter
FileInfo
Metadata of an open slide.
FilterEnableArgs
FilterSpec
A viewport filter (CPU post-processing of rendered frames).
HostSnapshot
A consistent, recent view of the host state.
Hotkey
A hotkey binding. key is a single character (case-insensitive) or a named key such as "F2", "Delete", "Escape" (see key_name).
HotkeySpec
A plugin key binding (see methods::HOTKEY_REGISTER).
HudButtonSpec
A button in every viewport’s HUD toolbar. When menu is non-empty the button opens a drop-down and clicks report the chosen item_id.
IdArgs
JobFinishArgs
JobStartArgs
JobStarted
JobUpdateArgs
KeyArgs
LayerSpec
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.
LayerUpdate
Partial update of a layer; None leaves a field unchanged.
LevelInfo
One pyramid level of a slide.
LogArgs
MeasurementInfo
A measurement made with the host’s measurement tools.
MenuContext
Where a context menu was opened.
MenuItem
An entry of a menu (context menu, HUD drop-down). Enabled unless enabled says otherwise, also when built with ..Default::default().
MinZoomArgs
Arguments of methods::LAYER_SET_MIN_ZOOM.
ModelCompanion
A companion file of a stored model.
ModelFetchArgs
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.
ModelFileSpec
A file a model needs next to its main file, such as the external weights of an ONNX model (model.onnx.data).
ModelRecord
A model in eov’s model store (eov model list).
ModelResolveArgs
Arguments of methods::MODEL_RESOLVE.
Modifiers
Keyboard modifiers held during an input event.
NotifyArgs
ObjectRef
Identifies an overlay object: a plugin-scoped layer id plus an object id.
OffsetArgs
OpenFileArgs
OverlayObject
A vector object in an overlay layer.
PaneArgs
PaneFilterArgs
Arguments of methods::LAYER_SET_PANES.
PaneInfo
One pane in display order.
PaneVisibilityArgs
Arguments of methods::LAYER_SET_PANE_VISIBILITY.
PluginInit
Information handed to a plugin when it is created.
PointerEvent
A pointer event for a plugin-owned custom tool.
PostArgs
Rect
An axis-aligned rectangle in level-0 pixels.
RemoveObjectsArgs
RequestId
Rgba
An RGBA colour, each channel 0–255.
SelectArgs
SeriesArgs
SettingsSetArgs
SlideInfo
The metadata of a slide a plugin opened (crate::abi::SlideFfi::info, SlideReader::info in the SDK).
SlideLevel
One pyramid level of a slide a plugin opened.
SlideOpenRequest
What the host asks a plugin’s slide source to open (crate::abi::SlideSourceFfi::open, Plugin::open_slide in the SDK).
StatusArgs
Style
Visual style of overlay objects.
SubscribeArgs
SurfaceOpened
SurfaceProperties
SurfaceSpec
A Slint UI surface. ui_path is relative to the plugin root.
TextArgs
ToolRef
Reference to a tool: the owning plugin (None for host tools) and its id.
ToolSpec
A tool contributed by a plugin. It appears in the toolbar’s tool group.
ToolbarButtonSpec
A button in the main window toolbar. Enabled unless enabled says otherwise, also when built with ..Default::default().
UndoClearArgs
UndoPushArgs
UpsertObjectsArgs
ViewFrameArgs
ViewInfo
The visible state of a pane showing a slide.
ViewOrientationArgs
ViewPanArgs
ViewSetArgs
ViewZoomArgs

Enums§

Cursor
Dash
HostEvent
Messages the host sends to a plugin’s handle_event.
LogLevel
NotifyLevel
PointerButton
PointerKind
SeriesAction
Shape
A geometric shape in level-0 pixel coordinates.
SizeUnit
The unit an object’s stroke width or point size is expressed in.
SurfaceKind
ToolKind
What the host does while a tool is active.

Constants§

MAX_ASSOCIATED_IMAGES
Most associated images a SlideInfo may list.
MAX_ASSOCIATED_IMAGE_PIXELS
Most pixels of one associated image (2^28).
MAX_SLIDE_LEVELS
Most pyramid levels a SlideInfo may 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 text is a SHA-256 in hex (64 digits, either case).
key_name
The name of a key as Hotkey::key and ToolSpec::keys write it, from the raw text of HostEvent::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).
PropertyMap
Slide-wide JSON map type used by file.properties.