|
|
Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
|
Document-local hooks for tree mutations. More...
#include "donner/base/xml/components/TreeMutationContext.h"
Public Member Functions | |
| TreeMutationContext () | |
| Default ctor installs the basic XML callbacks. Higher-level models (SVGDocument) overwrite the individual function fields after construction. | |
Static Public Member Functions | |
| static void | DefaultInsertBefore (EntityHandle parent, EntityHandle newNode, EntityHandle referenceNode) |
| Basic XML defaults — operate on TreeComponent directly. | |
| static void | DefaultAppendChild (EntityHandle parent, EntityHandle child) |
| static void | DefaultReplaceChild (EntityHandle parent, EntityHandle newChild, EntityHandle oldChild) |
| static void | DefaultRemoveChild (EntityHandle parent, EntityHandle child) |
| static void | DefaultRemove (EntityHandle entity) |
Public Attributes | |
| std::function< void(EntityHandle parent, EntityHandle newNode, EntityHandle referenceNode)> | insertBefore |
| Callback for insertBefore(parent, newNode, referenceNode). | |
| std::function< void(EntityHandle parent, EntityHandle child)> | appendChild |
| Callback for appendChild(parent, child). | |
| std::function< void(EntityHandle parent, EntityHandle newChild, EntityHandle oldChild)> | replaceChild |
| Callback for replaceChild(parent, newChild, oldChild). | |
| std::function< void(EntityHandle parent, EntityHandle child)> | removeChild |
| Callback for removeChild(parent, child). | |
| std::function< void(EntityHandle entity)> | remove |
| Callback for remove(entity). | |
Document-local hooks for tree mutations.
Always installed in Registry::ctx() by the owning document model: XMLDocument installs the Default* callbacks below (which operate on TreeComponent directly), and higher-level models such as SVGDocument overwrite the individual callbacks after construction to layer invalidation and lifetime tracking on top. XMLNode mutation methods always go through the context, so the lookup never needs to fall back to a direct TreeComponent path — Registry::ctx().contains<TreeMutationContext>() is an invariant of any registry exposed through one of the document facades.