|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Public Member Functions | |
| RenderSession (RenderSessionOptions options={}) | |
| RenderSession (const RenderSession &)=delete | |
| RenderSession & | operator= (const RenderSession &)=delete |
| const RenderSessionSnapshot & | navigate (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 RenderSessionSnapshot & | reload () |
| 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 RenderSessionSnapshot & | resize (int width, int height) |
| Re-renders the currently-loaded document at a new viewport. Cheaper than a full navigate because no fetch happens. | |
| const RenderSessionSnapshot & | current () const |
| int | width () const |
| int | height () const |
| const svg::RendererBitmap & | lastGoodBitmap () 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. | |