Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::DocumentSyncController Class Reference

Owns source-pane debounce, parse-error markers, and XML-owned source view mirroring. More...

#include "donner/editor/DocumentSyncController.h"

Public Member Functions

 DocumentSyncController (std::string initialSource)
void resetForLoadedDocument (const std::string &source)
void syncParseErrorMarkers (EditorApp &app, TextEditor &textEditor)
bool mirrorSourceDeltas (EditorApp &app, TextEditor &textEditor, const std::vector< xml::XMLSourceDelta > &sourceDeltas)
 Mirror XML-owned source deltas into the source pane.
void handleTextEdits (EditorApp &app, TextEditor &textEditor, float deltaSeconds)
std::optional< float > nextTextSyncWakeSeconds () const
 Return the pending source-text sync wake interval, if a throttled edit is waiting.
void applyPendingWritebacks (EditorApp &app, SelectTool &selectTool, TextEditor &textEditor)

Detailed Description

Owns source-pane debounce, parse-error markers, and XML-owned source view mirroring.

Member Function Documentation

◆ mirrorSourceDeltas()

bool donner::editor::DocumentSyncController::mirrorSourceDeltas ( EditorApp & app,
TextEditor & textEditor,
const std::vector< xml::XMLSourceDelta > & sourceDeltas )

Mirror XML-owned source deltas into the source pane.

Use this when a canvas/DOM operation already mutated the XML document and returned xml::XMLSourceDelta records. The controller replays the deltas into textEditor with source-change suppression and falls back to mirroring the document source if the delta sequence cannot be applied precisely.

Parameters
appEditor app containing the source-backed document.
textEditorSource pane to update.
sourceDeltasSource deltas emitted by the XML document.
Returns
True if the source pane was updated from the deltas or fallback mirror.

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