Owns source-pane debounce, parse-error markers, and XML-owned source view mirroring.
More...
#include "donner/editor/DocumentSyncController.h"
|
| | DocumentSyncController (std::string initialSource) |
| | Initialize source synchronization from the displayed source.
|
| void | resetForLoadedDocument (const std::string &source) |
| | Reset pending synchronization state after a document replacement.
|
| void | syncParseErrorMarkers (EditorApp &app, TextEditor &textEditor) |
| | Refresh source diagnostics and editor markers from the application parse state.
|
|
const SourceDiagnosticSnapshot & | sourceDiagnostics () const |
| | Diagnostics normalized for the current source buffer and parse revision.
|
| bool | mirrorSourceDeltas (EditorApp &app, TextEditor &textEditor, const std::vector< xml::XMLSourceDelta > &sourceDeltas) |
| | Mirror XML-owned source deltas into the source pane.
|
|
std::vector< xml::XMLSourceDelta > | takeSourceDeltasOrMirrorWholeSource (EditorApp &app, TextEditor &textEditor) |
| | Take the document's unmirrored source deltas. When too many accumulated to keep, mirror the whole source instead and return none.
|
| void | handleTextEdits (EditorApp &app, TextEditor &textEditor, float deltaSeconds) |
| | Observe source edits and dispatch eligible document updates through the debounce policy.
|
|
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) |
| | Apply queued document-to-source changes when document access permits.
|
|
bool | hasPendingWritebacks () const |
| | True when applyPendingWritebacks still has queued work. Writebacks accumulate while the async renderer owns the document and are drained by the first frame that finds it idle - so a frame that skips the document-sync stage while this holds would strand them until the next user input.
|
|
bool | hasPendingSourceTextSync () const |
| | True while text typed in the source pane is held back by the typing throttle and has not been dispatched to the document yet.
|
Owns source-pane debounce, parse-error markers, and XML-owned source view mirroring.
◆ DocumentSyncController()
| donner::editor::DocumentSyncController::DocumentSyncController |
( |
std::string | initialSource | ) |
|
|
explicit |
Initialize source synchronization from the displayed source.
- Parameters
-
| initialSource | Initial source text owned by the controller. |
◆ applyPendingWritebacks()
Apply queued document-to-source changes when document access permits.
- Parameters
-
| app | Application containing completed mutations. |
| selectTool | Selection tool whose element handles may need remapping. |
| textEditor | Source pane to synchronize. |
◆ handleTextEdits()
| void donner::editor::DocumentSyncController::handleTextEdits |
( |
EditorApp & | app, |
|
|
TextEditor & | textEditor, |
|
|
float | deltaSeconds ) |
Observe source edits and dispatch eligible document updates through the debounce policy.
- Parameters
-
| app | Application receiving source changes. |
| textEditor | Source editor containing the current text. |
| deltaSeconds | Elapsed frame time used by pending-edit timers. |
◆ mirrorSourceDeltas()
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
-
| app | Editor app containing the source-backed document. |
| textEditor | Source pane to update. |
| sourceDeltas | Source deltas emitted by the XML document. |
- Returns
- True if the source pane was updated from the deltas or fallback mirror.
◆ resetForLoadedDocument()
| void donner::editor::DocumentSyncController::resetForLoadedDocument |
( |
const std::string & | source | ) |
|
Reset pending synchronization state after a document replacement.
- Parameters
-
| source | Source text of the newly loaded document. |
◆ syncParseErrorMarkers()
| void donner::editor::DocumentSyncController::syncParseErrorMarkers |
( |
EditorApp & | app, |
|
|
TextEditor & | textEditor ) |
Refresh source diagnostics and editor markers from the application parse state.
- Parameters
-
| app | Application containing the current document and diagnostics. |
| textEditor | Source editor receiving diagnostic markers. |
The documentation for this class was generated from the following file: