Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
AsyncSVGDocument.h File Reference

AsyncSVGDocument is the editor-owned wrapper around svg::SVGDocument. It gates canvas, tool, and application mutations through the CommandQueue, applies incremental source-pane edits through a separate guarded seam, and provides the snapshot hand-off to the render thread. More...

#include <atomic>
#include <cstdint>
#include <memory>
#include <optional>
#include <string_view>
#include <unordered_map>
#include <utility>
#include <vector>
#include "donner/base/EcsRegistry.h"
#include "donner/base/ParseDiagnostic.h"
#include "donner/base/xml/XMLDocument.h"
#include "donner/base/xml/XMLParser.h"
#include "donner/base/xml/XMLSourceStore.h"
#include "donner/editor/CommandQueue.h"
#include "donner/svg/SVGDocument.h"
Include dependency graph for AsyncSVGDocument.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::editor::AsyncSVGDocument
 Wraps an svg::SVGDocument and the editor's per-frame command queue. More...
struct  donner::editor::AsyncSVGDocument::FlushResult
 Outcome of applying queued document mutations. More...

Namespaces

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

Detailed Description

AsyncSVGDocument is the editor-owned wrapper around svg::SVGDocument. It gates canvas, tool, and application mutations through the CommandQueue, applies incremental source-pane edits through a separate guarded seam, and provides the snapshot hand-off to the render thread.

The editor now renders on a dedicated AsyncRenderer worker. The worker shares the live document registry under ConcurrentDom access guards, while frame-version and document-generation counters let the UI discard stale results and preserve valid compositor state across structural reparses.


Class Documentation

◆ donner::editor::AsyncSVGDocument::FlushResult

struct donner::editor::AsyncSVGDocument::FlushResult

Outcome of applying queued document mutations.

Class Members
bool appliedCommands = false
vector< Entity > cacheInvalidatedElements Entities whose existing rendered pixels may have changed because of an incremental command.
bool hadPriorAppliedCommandsOnRollback = false A prior command in this flush still changed source before that rollback.
bool onlyTransformCommands = false True only when every applied command changed an element transform. An overlay guide captured before a drag may be safely projected through these version advances without rereading clip resources; any other edit invalidates that immutable guide cache.
bool preserveUndoOnReparse = false
bool removedElements = false True when at least one flushed command removed an element from the live document.
bool replacedDocument = false
bool rolledBackReplacementBatch = false A failed replacement batch restored its exact pre-command source.
vector< XMLSourceDelta > sourceDeltas