Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
UndoTimeline.h File Reference
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "donner/base/Transform.h"
#include "donner/editor/AttributeWriteback.h"
#include "donner/svg/SVGElement.h"
Include dependency graph for UndoTimeline.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::UndoSnapshot
 Captured state of an element at a point in time. More...
struct  donner::editor::UndoEntry
 A single entry in the non-destructive undo timeline. More...
class  donner::editor::UndoTimeline
 Non-destructive chronological undo timeline. More...

Namespaces

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

Functions

UndoSnapshot donner::editor::captureTransformSnapshot (const svg::SVGElement &element)
 Capture the current transform of an SVGElement as an undo snapshot.
UndoSnapshot donner::editor::captureDocumentSourceSnapshot (const svg::SVGElement &anchorElement, std::string_view source)
 Capture the full SVG source text for a structural undo snapshot.
UndoSnapshot donner::editor::captureAttributeSnapshot (const svg::SVGElement &element, std::string_view attributeName, std::optional< std::string > attributeValue)
 Capture one attribute's value on an element for an attribute undo snapshot.
void donner::editor::applySnapshot (const UndoSnapshot &snapshot)
 Apply a previously captured snapshot, including grouped extra element snapshots.

Function Documentation

◆ captureAttributeSnapshot()

UndoSnapshot donner::editor::captureAttributeSnapshot ( const svg::SVGElement & element,
std::string_view attributeName,
std::optional< std::string > attributeValue )

Capture one attribute's value on an element for an attribute undo snapshot.

Parameters
elementElement that owns the attribute.
attributeNameAttribute to restore.
attributeValueValue to restore, or std::nullopt to remove the attribute.