Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::app::RenderSession Class Reference

Public Member Functions

 RenderSession (RenderSessionOptions options={})
 RenderSession (const RenderSession &)=delete
RenderSession & operator= (const RenderSession &)=delete
const RenderSessionSnapshotnavigate (std::string_view uri)
 Fetches uri, drives the renderer at the configured viewport, and blocks until a new frame is available on the worker. Returns the updated snapshot. On any error, the previous successful frame's bitmap is retained (accessible via lastGoodBitmap()) and the new snapshot's status reflects the failure.
const RenderSessionSnapshotreload ()
 Fetches the current URI again with the same viewport, useful for "reload the file after editing it in an external editor" workflows. No-op when no URI is loaded yet.
const RenderSessionSnapshotresize (int width, int height)
 Re-renders the currently-loaded document at a new viewport. Cheaper than a full navigate because no fetch happens.
const RenderSessionSnapshotcurrent () const
int width () const
int height () const
const svg::RendererBitmaplastGoodBitmap () const
 The most recent successful bitmap, regardless of the current status. Allows UIs to keep showing the last good render while an error chip covers the new failure — matches the address bar's "keep previous document on screen" behavior from the design doc.
const std::vector< uint8_t > & lastGoodWire () const
 The wire bytes matching lastGoodBitmap(). Same retention semantics.
void setWatchEnabled (bool v)
 Enable or disable filesystem watch mode. When enabled, pollForChanges() checks whether the loaded file's mtime has changed and auto-reloads if so.
bool watchEnabled () const
bool pollForChanges ()
 Checks if the currently-loaded file's modification time has changed since the last fetch. If yes (and watch is enabled), calls reload() internally and returns true. Returns false when watch is disabled, no file is loaded, or the file hasn't changed.

The documentation for this class was generated from the following file: