rito_flutter library

High-level reader sessions, prepared artifacts, and Flutter page painting.

Classes

RitoAdjacentAvailability
RitoAdjacentDirection
RitoAdjacentRequest
RitoArtifact
RitoArtifactFontCache
Process-wide cache for Flutter font registrations.
RitoArtifactImageCache
Ref-counted cache for paint-ready Flutter images owned by artifact leases.
RitoArtifactImageLease
One artifact's synchronous, paint-ready image resolver.
RitoArtifactImageLimits
Production safety limits for one artifact image preparation lease.
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
RitoBackgroundHandoff
RitoBackgroundHandoffAck
RitoBackgroundRequest
RitoCanvasColorOverride
Host theme override for the Canvas pen, mirroring the browser pen's colorOverride. The override does exactly one thing: where the book expressed no opinion (it assumed white paper), it supplies the theme's ground and re-inks the text. Wherever the book declared a ground itself, the foreground/background pair was the typesetter's choice and stays untouched.
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.
RitoDynamicLibrarySource
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
RitoFontEnvelope
Per-family font metrics the browser pen reads off Chromium's canvas, re-derived from the same sfnt tables so both pens stay platform-independent (SkParagraph only exposes hhea-based line metrics, which match neither anchor).
RitoFontEnvelopeStore
RitoFontRef
RitoFontRegistrar
Registers an EPUB font with the Flutter engine on the UI isolate.
RitoFootnote
A resolved footnote definition.
RitoForegroundHandoff
RitoForegroundHandoffAck
RitoHitEntry
RitoHitResolver
Resolves taps against an artifact's pages.
RitoImageDecoder
Injectable image header/decode boundary for platform-specific codecs.
RitoImageDecodeSource
Header-inspected encoded image whose full pixels have not been decoded.
RitoIsolateGateway
Runs EPUB parsing, CSS, layout, resource access, release and disposal away from Flutter's UI isolate. Large typed-wire payloads use Dart's transferable isolate transport and are decoded only after the receiver materializes them. This avoids an isolate-message copy; it is not an end-to-end zero-copy claim across caller buffers, FFI allocation, and Rust ownership.
RitoLayoutRequest
RitoLocator
RitoNavigation
RitoPage
RitoPageSurface
RitoPaintRuby
RitoPaintText
RitoPathArc
RitoPathClose
RitoPathEllipse
RitoPathLineTo
RitoPathMoveTo
RitoPathOp
RitoPathRect
RitoPendingAdjacentDriver
Advances one retained adjacent intent by one quantum per asynchronous host turn. Only the dedicated adjacent-pending status is retryable.
RitoPinnedFontFace
One host-pinned measurement fallback face.
RitoPinnedFontPolicy
Version-one pinned fallback face set supplied on session open. The measurement and paint fallback faces a host pins for a session.
RitoPreparedArtifact
An artifact whose declared font faces have completed Flutter registration.
RitoPreparedBackgroundAdvance
One host-owned background result whose optional candidate has completed resource and font preparation but has not been made visible.
RitoPrimitive
RitoPrimitiveClipPath
RitoPrimitiveDrawImage
src sampled over sourceRect (raster pixels; the whole raster when null) into dest, once or per tiles.
RitoPrimitiveFillPath
RitoPrimitiveFillRect
RitoPrimitiveList
RITODL1 format version 2: the device-resolved primitive list.
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
RitoPrimitiveText
A text run with every length in device pixels; glyph placement is still the renderer's.
RitoPrimitiveTransform
RitoPrimitiveTranslate
RitoPublication
RitoPublicationMetadata
RitoPublicationSpineItem
RitoPublicationTocEntry
RitoPublicationTocExternalTarget
RitoPublicationTocLocatorTarget
RitoPublicationTocTarget
RitoPublicationTocUnresolvedTarget
RitoReaderGateway
RitoReaderSession
RitoRect
RitoResource
RitoResourceRef
RitoResumableAdjacentGateway
Marker contract for gateways that consume strictly newer native request IDs while cooperatively resolving one retained adjacent intent.
RitoResumableExactSeekGateway
Marker contract for gateways that may send an exact open or seek under a strictly newer native request ID than the caller's. The gateway substitutes one when the caller's ID was already consumed on the native side (an adjacent continuation the session has not learned about yet consumes IDs), so the returned artifact carries the substituted ID and the session adopts it as its new request baseline.
RitoSearchRequest
RitoSearchResponse
RitoSearchResult
One in-book search hit.
RitoSemanticNode
RitoSourcePoint
RitoSourceRange
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: the engine classifies note anchors (and reports whether their definition is indexed yet), and a link wrapping an image resolves as the link.
RitoTextPaintCommand
RitoTextPosition
A position inside a page's laid-out text, in the same coordinates RitoPage.textRuns reports.
RitoTextRangeGeometry
RitoTextRangeRequest
Asks where a text range sits on a page.
RitoTextRect
One run-aligned rectangle of a resolved text range.
RitoTextRunOffset
RitoTilePlan
A grid of image tiles: columns by rows copies of the destination, stepping stepX/stepY from origin.
RitoUiImageDecoder
Flutter engine decoder used by the artifact image cache by default.

Enums

RitoBackgroundState
RitoDynamicLibraryKind
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.
RitoLocatorMatch
RitoPinnedFontGenericRole
Generic CSS family role occupied by one pinned fallback face (runtime pinned-font policy schema v1). Which generic keyword a pinned face serves.
RitoResourceKind
RitoSemanticRole
RitoSpreadMode
RitoTextProfile

Functions

ritoUiColor(RitoColor color) Color
Converts typed CSS Color 4 components to a Flutter paint color.

Typedefs

RitoArtifactImageResourceReader = Future<RitoResource> Function(RitoResourceRef reference)
RitoArtifactResourcePreparer = Future<void> Function({required RitoArtifact artifact, required RitoArtifactResourceReader readResource})
Optional host hook for preparing artifact resources such as decoded images.
RitoArtifactResourceReader = Future<RitoResource> Function(RitoResourceRef reference)
RitoFontResourceReader = Future<RitoResource> Function(RitoResourceRef reference)
RitoImageResolver = Image? Function(String href)
Resolves only caller-owned, already-decoded resources. The renderer never performs network or filesystem I/O.

Exceptions / Errors

RitoArtifactNotLiveException
Raised when an artifact of this session is no longer live.
RitoImageBudgetExceededException
RitoNativeException
RitoNativeSessionInvalidatedException
The native session was invalidated because ownership cleanup failed.
RitoNativeWorkerTerminatedException
Raised when the native worker terminates before acknowledging an operation.
RitoNavigationSupersededException
A navigation request that was replaced by newer intent.
RitoPendingAdjacentLimitException