Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::svg::components::TreeMutation Class Reference

Central mutation service for SVG DOM tree edits. More...

#include "donner/svg/components/TreeMutation.h"

Static Public Member Functions

static void InsertBefore (EntityHandle parent, EntityHandle newNode, EntityHandle referenceNode=EntityHandle())
 Insert newNode as a child of parent before referenceNode.
static void AppendChild (EntityHandle parent, EntityHandle child)
 Append child as the last child of parent.
static void ReplaceChild (EntityHandle parent, EntityHandle newChild, EntityHandle oldChild)
 Replace oldChild with newChild under parent.
static void RemoveChild (EntityHandle parent, EntityHandle child)
 Remove child from parent.
static void Remove (EntityHandle entity)
 Remove entity from its parent, if it has one.

Detailed Description

Central mutation service for SVG DOM tree edits.

TreeMutation is the public SVG layer's single path for inserting, replacing, and detaching SVG element entities. It wraps the low-level donner::components::TreeComponent link operations with SVG-specific validation, dirty-flag propagation, render-tree invalidation, and node-lifetime state updates.

Member Function Documentation

◆ AppendChild()

void donner::svg::components::TreeMutation::AppendChild ( EntityHandle parent,
EntityHandle child )
static

Append child as the last child of parent.

Parameters
parentParent entity to receive the child.
childEntity to append.

◆ InsertBefore()

void donner::svg::components::TreeMutation::InsertBefore ( EntityHandle parent,
EntityHandle newNode,
EntityHandle referenceNode = EntityHandle() )
static

Insert newNode as a child of parent before referenceNode.

If referenceNode is invalid, newNode is appended.

Parameters
parentParent entity to receive the child.
newNodeEntity to insert.
referenceNodeExisting child to insert before, or an invalid handle to append.

◆ Remove()

void donner::svg::components::TreeMutation::Remove ( EntityHandle entity)
static

Remove entity from its parent, if it has one.

Parameters
entityEntity to detach from its parent.

◆ RemoveChild()

void donner::svg::components::TreeMutation::RemoveChild ( EntityHandle parent,
EntityHandle child )
static

Remove child from parent.

The child entity and its descendants remain alive as a detached subtree.

Parameters
parentParent entity whose child is removed.
childExisting child to detach.

◆ ReplaceChild()

void donner::svg::components::TreeMutation::ReplaceChild ( EntityHandle parent,
EntityHandle newChild,
EntityHandle oldChild )
static

Replace oldChild with newChild under parent.

Parameters
parentParent entity whose child is replaced.
newChildReplacement entity.
oldChildExisting child to detach.

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