rito_flutter_protocol library

Typed encoders, decoders, and models for Rito's versioned wire protocols.

Classes

RitoAdjacentAvailability
RitoAdjacentDirection
RitoAdjacentRequest
RitoAnnotationDecoder
Decodes a RITOANR1 message.
RitoAnnotationQuery
Builds or locates an annotation target. Targets depend only on the publication source, so no artifact is involved.
RitoAnnotationRequest
RitoAnnotationResponse
A built target, or a stored one re-anchored where the cascade found it. target is null only for the orphaned levels.
RitoAnnotationTarget
The one persisted annotation format, built and read only by the engine: a highlight stored by any Rito host resolves the same way on every other. Persist json — the engine's canonical bytes — as it is, and hand it back through RitoResolveAnnotationQuery to locate it.
RitoArtifact
RitoArtifactDecoder
RitoArtifactPainter
Paints an artifact's primitive list. The list is resolved on the device grid at the request's render ratio; the painter maps that grid onto the logical canvas by the inverse ratio, so under the framework's own device-pixel transform every coordinate lands where the engine resolved it. Text runs, which the list keeps in CSS pixels, paint under the ratio again — back in logical pixels, at their CSS size.
RitoArtifactRequest
RitoBackgroundAdvance
RitoBackgroundDecoder
RitoBackgroundEncoder
RitoBackgroundHandoff
RitoBackgroundHandoffAck
RitoBackgroundRequest
RitoBoundaryResult
The movement leaves this revision through boundary.
RitoCaret
RitoCaretAddress
A caret between two shaped clusters. It addresses the revision behind the artifact it came from: pass it back only with artifacts of that revision.
RitoCaretGeometry
A caret's line in display-list space: its top and its height.
RitoCaretQuery
The caret nearest a point.
RitoCaretResult
RitoChapterPages
The pages one spine item is laid out on, both ends included.
RitoClusters
Where every cluster of a run paints, in text order: cluster i starts at byte bytes[i] of the run's UTF-8 text and paints with its origin at (origins[2i], origins[2i + 1]) in CSS pixels at float32 (the precision a canvas takes it at), spacing and justification already applied — the y is the alphabetic baseline, for a text run and an annotation alike. joins[i] is 1 where a pen drawing one string from the previous cluster's origin puts cluster i there. A decoded list's runs share the table these are views of: read them, never write them.
RitoColor
RitoColorNoneFlags
RitoColorSpace
RitoCompareQuery
The reading order of two source positions.
RitoCreateAnnotationQuery
Builds the target for a source range, normally a selection's.
RitoDashPattern
RitoDevicePath
A device-space outline. Arc angles are radians from the +x axis; a positive sweep turns clockwise on the y-down device plane. An ellipse is its own closed subpath.
RitoDeviceRotate
RitoDeviceScale
RitoDeviceTransform
RitoDeviceTranslate
RitoDisplayListPayload
The artifact's paint: its display commands lowered to the host's device grid, carried as the RITODL1 format-2 primitive list.
RitoDisplayPoint
RitoDisplayRect
RitoExactSourceRangeDecoder
RitoExactSourceRangeRequest
Asks where a durable source range lands on the pages an artifact draws, so a stored annotation can be painted.
RitoExactSourceRangeResolution
Where a durable source range sits.
RitoExactSourceRect
One run-aligned rectangle of a resolved source range.
RitoFillGround
What a fill declares to the theme override: the page ground, an opaque block ground the ink over it was typeset against (with the unsnapped box it covers), or nothing.
RitoFillRule
RitoFontPaint
RitoFontRef
RitoFontStyle
RitoFootnote
A resolved footnote definition.
RitoFootnoteDecoder
RitoForegroundDecoder
RitoForegroundEncoder
RitoForegroundHandoff
RitoForegroundHandoffAck
RitoHitEntry
RitoHitResolver
Resolves taps against the records of an artifact's pages (RitoReaderSession.readPage).
RitoIconPiece
One even-odd filled outline of an image fallback icon, moved by offset and cut to clip (both in the outline's own coordinates).
RitoLayoutQuery
The page table of the revision behind an artifact: its spreads, the chapters it lays out and where its TOC entries land.
RitoLayoutRequest
RitoLayoutResult
RitoLocatedPage
On pageIndex of the revision; drawn says whether the asking artifact draws that page.
RitoLocateQuery
Where a stored locator lands in an artifact's revision.
RitoLocation
Where a stored locator landed.
RitoLocationResult
RitoLocationUnavailable
The locator does not resolve in the publication.
RitoLocator
RitoMissResult
The point is not over text.
RitoMovementQuery
The focus caret moved by a keyboard-style step. Pass back the preferred positions the previous movement returned so vertical steps keep their column.
RitoNavigation
RitoNavigationDecoder
Decodes a RITONVR1 message.
RitoNavigationQuery
A reading-position question. The engine answers each the way it answers a browser reader, so a chapter title, a bookmark check or a turn direction is the same on every host.
RitoNavigationRequest
RitoNavigationResult
RitoNotLaidOut
The locator's chapter is not laid out in this revision.
RitoOrderResult
-1, 0 or 1 as the first position reads before, at or after the second.
RitoPage
A page an artifact shows: its index and size. What it holds for a host — its targets, outline and text — is read when the host first needs it (RitoReaderSession.readPage).
RitoPageRecords
What one page of a live artifact holds for a host: its interaction targets, its semantic outline, its text and where each text run sits in that text, in the artifact's display-list space.
RitoPaintRuby
RitoPaintText
RitoPathArc
RitoPathClose
RitoPathEllipse
RitoPathLineTo
RitoPathMoveTo
RitoPathOp
RitoPathRect
RitoPendingResult
The movement needs pages past boundary that are not laid out yet.
RitoPendingShards
RITOPSH1: what a call that returned the resource-pending status waited on. A publication opened from shards names, in ascending order, the content shards to supply before the call is retried.
RitoPendingShardsDecoder
RitoPrimitive
RitoPrimitiveClipPath
RitoPrimitiveDrawImage
src sampled over sourceRect (raster pixels; the whole raster when null) into dest, once or per tiles.
RitoPrimitiveFillPath
RitoPrimitiveFillRect
RitoPrimitiveImageFallback
What stands in an image's place while its bitmap is not there, painted only while the image named src is in state: block filled with the page background mixed with blockInk of the text colour, then each piece filled even-odd with the block colour mixed with iconInk of the text colour.
RitoPrimitiveList
RITODL1 format version 3: the device-resolved primitive list.
RitoPrimitiveListDecoder
Strict little-endian decoder for RITODL1 format version 4, the device-resolved primitive list the engine paints every frame as. Its text runs index into tables after the primitives: their clusters are read in place, their text and paints decoded once.
RitoPrimitiveListReplayer
RitoPrimitiveOpacity
RitoPrimitivePopState
RitoPrimitivePushState
RitoPrimitiveRuby
RitoPrimitiveShadow
A canvas-style shadow: shape blurred by Gaussian sigma (device pixels) and drawn at offset, then the shape itself on top, both with clipOut excluded from the result.
RitoPrimitiveStrokePath
RitoPrimitiveTarget
A renderer of the device-resolved primitive list: it blits what the engine resolved and never measures or snaps.
RitoPrimitiveText
A text run with every length in device pixels; glyph placement is still the renderer's.
RitoPrimitiveTransform
RitoPrimitiveTranslate
RitoPublication
RitoPublicationDecoder
RitoPublicationMetadata
RitoPublicationSpineItem
RitoPublicationTocEntry
RitoPublicationTocExternalTarget
RitoPublicationTocLocatorTarget
RitoPublicationTocTarget
RitoPublicationTocUnresolvedTarget
RitoRangeFromPointsQuery
The range two points span, widened to whole words or paragraphs.
RitoRangeQuery
The range between two carets, as when a handle is dropped.
RitoRangeToPointQuery
The range from a kept caret to a point, as while a handle or a character-wise drag moves.
RitoRect
RitoRequestEncoder
RitoResolveAnnotationQuery
Finds a stored target in the publication as it is now. targetJson is the RitoAnnotationTarget.json a host persisted, byte for byte.
RitoResource
RitoResourceDecoder
RitoResourceRef
RitoRevisionLayout
The page table of one revision.
RitoRunPaint
The paint a text run carries: what the pen needs to raster its glyphs. The run's inline box (background band, padding, borders) and its decoration line lower to primitives around the run in the engine.
RitoSelectionResult
A resolved range. The carets are present for every query but RitoRangeQuery, the preferred positions only for RitoMovementQuery.
RitoSemanticNode
RitoSourcePoint
RitoSourceRange
RitoSpreadPages
RitoSpreadRequest
One spread of the revision behind an artifact, addressed by its position in that revision's layout.
RitoStrokeCap
RitoTapFootnote
A note anchor: read the note under key with readFootnote.
RitoTapImage
An image outside any link.
A link that is not a note anchor: navigate or open externally.
RitoTapTarget
What a tap on the painted surface lands on, resolved from the artifact's hit entries — the engine's own account of links, note anchors and images, already in display-list space. Hosts hit-test against this instead of reading semantics off paint commands: every hit says what it is (RitoHitEntry.kind) and this resolver only reads that — a note anchor, indexed or not yet, a link (one wrapping an image included), an image.
RitoTextInteractionDecoder
Decodes a RITOTIR1 message. Enum tags are declaration order, the contract the engine's tag tables share.
RitoTextInteractionQuery
One text interaction against an artifact. These are the five queries a browser reader runs, answered by the same engine code.
RitoTextInteractionRequest
RitoTextInteractionResponse
RitoTextInteractionResult
RitoTextPaintCommand
The text run body the RITODL1 text and ruby primitives carry: every length is in CSS pixels, painted under the list's ratio.
RitoTextPoint
A point on one of an artifact's pages, in its display-list space — the space RitoHitEntry.bounds uses.
RitoTextRunOffset
RitoTextSelection
A resolved text range. start and end are anchor and focus in document order; rects cover only the pages the artifact draws.
RitoTextShadow
RitoTilePlan
A grid of image tiles: columns by rows copies of the destination, stepping stepX/stepY from origin.
RitoTocEntryAtPageQuery
The TOC entry a page of an artifact's revision reads under: the last entry, in TOC order, whose target sits at or before the page.
RitoTocEntryAtPositionQuery
The TOC entry a source position reads under, decided on the source alone — for naming the chapter of a stored highlight or bookmark.
RitoTocEntryResult
A TOC entry by its preorder index — the tocId the publication carries — or null when nothing precedes the page or position.
RitoTocTargetPage
RitoUnavailableResult

Enums

RitoAnnotationLevel
Which level of the engine's cascade located a target, in wire order.
RitoBackgroundState
RitoCaretAffinity
Which side of a line break a caret sits on when one text offset is both a line's end and the next line's start.
RitoExactSourceRangeStatus
What became of a durable source range.
RitoFootnoteKind
EPUB semantic role of a footnote definition, taken from the publication's own epub:type. Hosts title the popup with it — a footnote and an endnote are read differently.
RitoHitKind
What a hit is, as the engine classifies it: a note reference first (its definition indexed, or not yet), then a link, an image, text.
RitoImageFallbackState
When an image's fallback paints: while its bitmap is on the way, or once it can no longer arrive.
RitoLocatorMatch
RitoResourceKind
RitoSelectionBoundary
RitoSelectionGranularity
How far a range from two points extends past them.
RitoSelectionMovement
A keyboard-style caret step, in the order the wire tags them.
RitoSemanticRole
RitoSpreadMode
RitoTextInteractionUnavailableReason
RitoTextProfile

Functions

readRitoRevisionLayout(RitoBinaryReader reader) → RitoRevisionLayout
Reads the layout a RITONVR1 message carries after its result tag.

Exceptions / Errors

RitoWireException