Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
EditorApp.h File Reference

RenderSession — the headless sandbox/render-session core used by REPL and tooling. Owns the current document state (URI, raw bytes, rendered bitmap, wire stream) and exposes a narrow state-transition API that higher layers (a REPL, a GLFW/ImGui shell, a wasm frontend) call into. More...

#include <cstdint>
#include <filesystem>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include "donner/editor/sandbox/PipelinedRenderer.h"
#include "donner/editor/sandbox/SvgSource.h"
#include "donner/svg/renderer/RendererInterface.h"
Include dependency graph for EditorApp.h:

Classes

struct  donner::editor::app::RenderSessionOptions
struct  donner::editor::app::RenderSessionSnapshot
 Snapshot of the most recent navigation result. All fields are read-only after EditorApp::navigate returns — subsequent navigations produce a new snapshot. More...
class  donner::editor::app::RenderSession

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::editor::app::RenderSessionStatus {
  kEmpty ,
  kLoading ,
  kRendered ,
  kRenderedLossy ,
  kFetchError ,
  kParseError ,
  kRenderError
}
 High-level state the editor can be in. The REPL uses this to decide what status chip / prompt decoration to show the user. More...
enum class  donner::editor::app::RenderSessionMode {
  kInProcessThread ,
  kSandboxedProcess
}
 Render mode — which sandbox variant powers the pipeline. The MVP only wires kInProcessThread today; the kSandboxedProcess variant is reserved so the option struct is forward-compatible when the SandboxHost-backed renderer lands. More...

Detailed Description

RenderSession — the headless sandbox/render-session core used by REPL and tooling. Owns the current document state (URI, raw bytes, rendered bitmap, wire stream) and exposes a narrow state-transition API that higher layers (a REPL, a GLFW/ImGui shell, a wasm frontend) call into.

This is deliberately UI-free: no ImGui, no GLFW, no GL, no stdin/stdout. The UI layer takes an EditorApp& and drives it — tests can do the same. right now the only mutation the MVP supports is "navigate to a new URI and re-render."

Rendering is delegated to a PipelinedRenderer by default — the same multi-threaded wire-based pipeline that S3.6 landed — so the main thread never blocks on rasterization. The backing renderer is pluggable via RenderSessionOptions for tests that want deterministic synchronous execution or sandbox isolation.

Enumeration Type Documentation

◆ RenderSessionMode

Render mode — which sandbox variant powers the pipeline. The MVP only wires kInProcessThread today; the kSandboxedProcess variant is reserved so the option struct is forward-compatible when the SandboxHost-backed renderer lands.

Enumerator
kInProcessThread 

Default. Main thread parses + drives, worker thread rasterizes. Zero process overhead, fully deterministic when waitForFrame is used.

kSandboxedProcess 

Reserved. When implemented, routes through SandboxHost with a separate child process. Surfaces the same API.

◆ RenderSessionStatus

High-level state the editor can be in. The REPL uses this to decide what status chip / prompt decoration to show the user.

Enumerator
kEmpty 

No document loaded yet.

kLoading 

Navigation in flight (rare — our pipeline is synchronous today).

kRendered 

A bitmap is available and was rendered cleanly.

kRenderedLossy 

Rendered, but the wire stream contained kUnsupported messages.

kFetchError 

SvgSource::fetch failed. Previous bitmap is retained.

kParseError 

Parser returned an error. Previous bitmap is retained.

kRenderError 

Rasterization failed post-parse. Previous bitmap is retained.