Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ShapeClipboardPayload.h File Reference

ShapeClipboardPayload is the structured representation of a shape-clipboard copy. The editor serializes the selected element subtrees to SVG fragment text and pairs that text with the metadata needed to paste deterministically (document-space bbox at copy time, source element ids, and whether the copy came from a whole-group selection). More...

#include <optional>
#include <string>
#include <string_view>
#include <vector>
#include "donner/base/Box.h"
Include dependency graph for ShapeClipboardPayload.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::ShapeClipboardPayload
 Structured shape-clipboard payload. See file comment for the wire format. More...

Namespaces

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

Detailed Description

ShapeClipboardPayload is the structured representation of a shape-clipboard copy. The editor serializes the selected element subtrees to SVG fragment text and pairs that text with the metadata needed to paste deterministically (document-space bbox at copy time, source element ids, and whether the copy came from a whole-group selection).

On the system clipboard the payload is stored as plain text, prefixed with a one-line header (# donner-shape-clipboard v1) followed by a small key/value metadata block and the SVG fragment. Generic SVG text without the header is still accepted by parse() as a best-effort import (the metadata fields are left empty), which keeps interoperability with hand-authored fragments.