Ordered queue of editor commands awaiting document access.
More...
#include "donner/editor/CommandQueue.h"
|
|
void | push (EditorCommand command) |
| | Push a command onto the queue. UI thread only.
|
| std::optional< std::string > | pendingStyleAttribute (const svg::SVGElement &element) const |
| | Return the latest queued style declaration list for an element, if one exists. A queued style removal returns an empty list. Commands before document replacement are ignored.
|
| void | discardStaleSourceRecoveries (std::optional< EditorCommand::SourceRecoveryState > current) |
| | Drop source-pane recoveries that no longer match the admitted document and draft. Runs before replacement coalescing so a refused recovery cannot discard earlier commands.
|
| FlushResult | flush () |
| | Drain and coalesce the pending commands. Returns the effective set of commands to apply, in the order the application should issue them. After flush() returns, the queue is empty.
|
|
bool | empty () const |
| | Whether the queue currently holds any pending commands. Useful for frame-skip optimizations (no need to re-render if nothing changed).
|
|
std::size_t | size () const |
| | Number of un-coalesced commands currently pending. Coalescing happens at flush() time, so this is the raw count, not the effective count.
|
|
void | clear () |
| | Drop everything pending without applying. Useful for tests and for the "abort drag" cancel path.
|
Ordered queue of editor commands awaiting document access.
◆ donner::editor::CommandQueue::FlushResult
| struct donner::editor::CommandQueue::FlushResult |
Outcome of flushing pending editor commands.
| Class Members |
|
vector< EditorCommand > |
effectiveCommands |
|
|
bool |
hadReplaceDocument = false |
True when any ReplaceDocument was drained from the raw pending batch. |
|
bool |
preserveUndoOnReparse = false |
True only when the drained batch contained at least one ReplaceDocument and every drained ReplaceDocument carried the preserve-undo marker. |
◆ discardStaleSourceRecoveries()
Drop source-pane recoveries that no longer match the admitted document and draft. Runs before replacement coalescing so a refused recovery cannot discard earlier commands.
- Parameters
-
| current | Current admitted state, or nullopt when recovery policy is unavailable. |
◆ flush()
Drain and coalesce the pending commands. Returns the effective set of commands to apply, in the order the application should issue them. After flush() returns, the queue is empty.
flush() is called once per frame at the start of the main loop.
◆ pendingStyleAttribute()
| std::optional< std::string > donner::editor::CommandQueue::pendingStyleAttribute |
( |
const svg::SVGElement & | element | ) |
const |
|
nodiscard |
Return the latest queued style declaration list for an element, if one exists. A queued style removal returns an empty list. Commands before document replacement are ignored.
- Parameters
-
| element | Element whose pending style is needed for another property edit. |
The documentation for this class was generated from the following file: