|
|
Donner
Embeddable browser-grade SVG2 engine
|
Contains the implementation of the Donner ECS,. More...
Namespaces | |
| namespace | filter_primitive |
| Variant holding the parameters for each type of filter primitive. | |
Classes | |
| struct | ClassComponent |
| Holds the value of the class attribute of an element. More... | |
| struct | ComputedClipPathsComponent |
| Stores a computed clip path, which is used to clip the rendering of an entity. More... | |
| struct | DirtyFlagsComponent |
| Tracks which computed properties are stale and need recomputation after a DOM mutation. More... | |
| struct | RenderTreeState |
| Global invalidation state, stored in the registry context via Registry::ctx(). More... | |
| class | ElementTypeComponent |
| Stores the parsed element type of the current entity. More... | |
| struct | EvaluatedReferenceComponent |
| Represents a reference to another entity which has been evaluated from a Reference string. More... | |
| struct | FilterComponent |
| Parameters for a "<filter>" element. More... | |
| struct | ComputedFilterComponent |
| Computed filter parameters parsed by FilterSystem, represents the resolved DOM hierarchy of a "<filter>" element. More... | |
| struct | FilterInput |
| Identifies the input to a filter primitive node. More... | |
| struct | FilterNode |
| A single node in the filter graph, representing one filter primitive. More... | |
| struct | FilterGraph |
The complete filter graph for a <filter> element. More... | |
| struct | FilterPrimitiveComponent |
| Parameters for SVGFilterPrimitiveStandardAttributes. More... | |
| struct | FEGaussianBlurComponent |
| Parameters for SVGFEGaussianBlurElement. More... | |
| struct | FEFloodComponent |
| Parameters for SVGFEFloodElement. More... | |
| struct | FEOffsetComponent |
| Parameters for SVGFEOffsetElement. More... | |
| struct | FECompositeComponent |
| Parameters for SVGFECompositeElement. More... | |
| struct | FEColorMatrixComponent |
| Parameters for SVGFEColorMatrixElement. More... | |
| struct | FEBlendComponent |
| Parameters for SVGFEBlendElement. More... | |
| struct | FEDropShadowComponent |
| Parameters for SVGFEDropShadowElement. More... | |
| struct | FEComponentTransferComponent |
| Marker component for SVGFEComponentTransferElement. More... | |
| struct | FEFuncComponent |
| Parameters for a feFuncR/G/B/A child element within feComponentTransfer. More... | |
| struct | FEConvolveMatrixComponent |
| Parameters for SVGFEConvolveMatrixElement. More... | |
| struct | FEMorphologyComponent |
| Parameters for SVGFEMorphologyElement. More... | |
| struct | FETileComponent |
| Marker component for SVGFETileElement. More... | |
| struct | FEImageComponent |
| Parameters for SVGFEImageElement. More... | |
| struct | FEDisplacementMapComponent |
| Parameters for SVGFEDisplacementMapElement. More... | |
| struct | FETurbulenceComponent |
| Parameters for SVGFETurbulenceElement. More... | |
| struct | FEMergeComponent |
| Marker component for SVGFEMergeElement. More... | |
| struct | FEMergeNodeComponent |
| Parameters for a feMergeNode child element within feMerge. More... | |
| struct | LightSourceComponent |
| Light source parameters, stored on feDistantLight, fePointLight, or feSpotLight child elements. More... | |
| struct | FEDiffuseLightingComponent |
| Parameters for SVGFEDiffuseLightingElement. More... | |
| struct | FESpecularLightingComponent |
| Parameters for SVGFESpecularLightingElement. More... | |
| class | FilterSystem |
| Handles parsing and instantiating SVG filter effects from the SVG DOM. More... | |
| struct | IdComponent |
| Holds the value of the id attribute of an element. More... | |
| class | LayoutSystem |
| Handles layout and bounds calculations for SVG elements. More... | |
| struct | SizedElementProperties |
| Stores an offset/size for elements that are positioned with x/y/width/height attributes with respect to their parent. More... | |
| struct | SizedElementComponent |
| Stores the properties of a sized element, x, y, width, height. More... | |
| struct | ComputedSizedElementComponent |
| Stores the computed bounds of a sized element, resolving units and percentages. More... | |
| struct | ComputedShadowSizedElementComponent |
| Stores a shadow tree's computed SizedElementComponent, where a "<use>" element overrides the width or height on "<symbol>" or "<svg>" which use SizedElementComponent. More... | |
| struct | SymbolComponent |
| Stores unique parameters for the "<symbol>" element. More... | |
| struct | TransformComponent |
| Stores the raw transform value set on an entity, for the transform presentation attribute. More... | |
| struct | ComputedLocalTransformComponent |
| Stores the computed transform value for an entity, relative to the parent. More... | |
| struct | ComputedAbsoluteTransformComponent |
| Stores the computed transform value for an entity, relative to the world. More... | |
| struct | ViewBoxComponent |
| A component attached to entities that have a viewBox attribute, such as "<svg>" and "<pattern>". More... | |
| struct | ComputedViewBoxComponent |
| Computed value of a viewBox for the current element. More... | |
| struct | ClipPathComponent |
| Parameters for the "<clipPath>" element. More... | |
| struct | GradientComponent |
| Common parameters for gradient elements, "<linearGradient>" and "<radialGradient>". More... | |
| struct | ComputedGradientComponent |
| Created by PaintSystem during render tree instantiation. More... | |
| struct | LinearGradientComponent |
| Parameters for a "<linearGradient>" element. More... | |
| struct | ComputedLinearGradientComponent |
| Computed properties for a "<linearGradient>" element. More... | |
| struct | MarkerComponent |
| Stores the marker data for an SVG element. More... | |
| struct | MaskComponent |
| Parameters for the "<mask>" element. More... | |
| class | PaintSystem |
| Manages Paint Servers for gradients and patterns, handling style and structural inheritance and creating "computed" state and shadow trees for these elements. More... | |
| struct | PatternComponent |
| Parameters for "<pattern>" elements which are not captured by ViewBoxComponent and SizedElementComponent. More... | |
| struct | ComputedPatternComponent |
| Computed properties for "<pattern>" elements, after resolving and inheriting values from referenced patterns. More... | |
| struct | RadialGradientComponent |
| Parameters for a "<radialGradient>" element. More... | |
| struct | ComputedRadialGradientComponent |
| Computed properties for a "<radialGradient>" element. More... | |
| struct | StopProperties |
| Parameters for a "<stop>" element. More... | |
| struct | ComputedStopComponent |
| Stores the computed properties of a "<stop>" element. More... | |
| struct | StopComponent |
| Stores the properties of a "<stop>" element. More... | |
| struct | PathLengthComponent |
| Stores a user-overridden path length on an element. More... | |
| struct | PreserveAspectRatioComponent |
| Stores the preserveAspectRatio attribute of "<svg>" and "<pattern>". More... | |
| struct | RenderingBehaviorComponent |
| Component that controls how the attached element is rendered, determines how different element types are rendered. More... | |
| struct | SubtreeInfo |
| Created on the start of a subtree, to inform the renderer about which element ends the current subtree, plus how many isolated layers need to be popped when the subtree is complete. More... | |
| struct | PaintResolvedReference |
| Contains rendering information for a paint server, such as the subtree needed if it establishes an isolated layer, and where the paint server is located. More... | |
| struct | ResolvedClipPath |
| Contains resolved information about the clip-path property, such as which element it is pointing to. More... | |
| struct | ResolvedMask |
| Contains resolved information about the mask property, such as which element it is pointing to. More... | |
| struct | ResolvedMarker |
| struct | RenderingInstanceComponent |
| An instance of the entity in the rendering tree. More... | |
| struct | FontResource |
| In-memory representation of a font resource, containing the parsed WOFF data. More... | |
| struct | ImageComponent |
| Parameters for the "<image>" element. More... | |
| struct | LoadedImageComponent |
| Loaded raster image resource, created from a ImageComponent when the href references a raster image (PNG, JPEG, GIF). More... | |
| struct | LoadedSVGImageComponent |
| Loaded SVG sub-document, created from a ImageComponent when the href references an SVG file (image/svg+xml). More... | |
| struct | ExternalUseComponent |
| Loaded external SVG sub-document referenced by a <use> element. More... | |
| class | ResourceManagerContext |
| Resource manager, which handles loading resources from URLs and caching results. More... | |
| class | SubDocumentCache |
| Cache for parsed SVG sub-documents referenced by <image> or <use> elements. More... | |
| struct | ComputedShadowTreeComponent |
| An instantiated ShadowTreeComponent, which points to the roots of parallel entity trees. More... | |
| class | OffscreenShadowTreeComponent |
| Defines an offscreen shadow tree attached to the current entity (the shadow host). More... | |
| struct | ShadowEntityComponent |
| A component attached to entities in the shadow tree, indicating which light entity they are mirroring. More... | |
| struct | ShadowTreeRootComponent |
| Indicates root of an instantiated shadow tree, where the light entity is is the target of the href, e.g. More... | |
| class | ShadowTreeComponent |
| Indicates the entry point to a shadow tree, which instantiates a virtual tree of entities mirroring another entity's tree. More... | |
| class | ShadowTreeSystem |
| Instantiates shadow trees for elements that are not part of the main render graph, such as "<use>" and "<pattern>" elements. More... | |
| struct | CircleProperties |
| Properties for a "<circle>" element. More... | |
| struct | ComputedCircleComponent |
| Computed properties for a "<circle>" element, which applies values from the CSS cascade. More... | |
| struct | CircleComponent |
| Parameters for a "<circle>" element. More... | |
| struct | ComputedPathComponent |
| Stores a Path used for rendering a shape, which may be generated from the parameters of shapes such as circle, rect, line, poly, and path. More... | |
| struct | EllipseProperties |
| Parameters for a "<ellipse>" element. More... | |
| struct | ComputedEllipseComponent |
| Computed properties for a "<ellipse>" element, which applies values from the CSS cascade. More... | |
| struct | EllipseComponent |
| Parameters for a "<ellipse>" element. More... | |
| struct | LineComponent |
| Parameters for a "<line>" element. More... | |
| struct | PathComponent |
| Parameters for a "<path>" element. More... | |
| struct | PolyComponent |
| Parameters for a "<polygon>" or "<polyline>" element. More... | |
| struct | RectProperties |
| Parameters for a "<rect>" element. More... | |
| struct | ComputedRectComponent |
| Computed properties for a "<rect>" element, which applies values from the CSS cascade. More... | |
| struct | RectComponent |
| Parameters for a "<rect>" element. More... | |
| class | ShapeSystem |
| Creates computed path for shapes such as "<circle>", "<line>", and "<path>". More... | |
| struct | ComputedStyleComponent |
| Contains the computed style properties for an element, which is a combination of the style="" attribute, the CSS stylesheet, and the CSS cascade where properties are inherited from the parent. More... | |
| struct | DoNotInheritFillOrStrokeTag |
| This component is added to entities to indicate that 'fill' and 'stroke' attributes should not be inherited, which is used for "<pattern>" because it establishes a shadow tree, and we do not want to recursively inherit 'fill' or 'stroke' values into the children. More... | |
| struct | StyleComponent |
| Contains properties the style="" attribute for an element, local to the element. More... | |
| class | StyleSystem |
| Computes stylesheet information for elements, applying the CSS cascade and inheritance rules. More... | |
| struct | StylesheetComponent |
| Data for a "<style>" element. More... | |
| class | SVGDocumentContext |
| Holds global state of an SVG document, such as the root element, id-to-element mapping, and the document size. More... | |
| struct | ComputedTextComponent |
| Pre‑computed layout information for a text subtree. More... | |
| struct | ComputedTextGeometryComponent |
| Cached geometry for text layout and text-derived public API queries. More... | |
| struct | TextComponent |
| Defines the start of a text element, which may have other text elements as children. More... | |
| struct | TextPathComponent |
| Stores attributes specific to "<textPath>" elements. More... | |
| struct | TextPositioningComponent |
| Defines the positioning of a text element, which may have other text elements as children. More... | |
| struct | TextRootComponent |
| Defines the start of a text element, which may have other text elements as children. More... | |
| class | TextSystem |
| System to compute text layout spans from raw text and positioning attributes. More... | |
| class | RenderingContext |
| Rendering controller, which instantiates and and manages the rendering tree. More... | |
Typedefs | |
| using | FilterPrimitive |
| Variant holding any filter primitive type. | |
| using | ResolvedPaintServer |
| The resolved paint server for a fill or stroke. | |
| using | ResolvedFilterEffect = std::variant<std::vector<FilterEffect>, ResolvedReference> |
| The resolved filter effect for a filter. | |
| using | ShadowSizedElementHandler |
| Type definition for a callback to process sized elements. | |
Enumerations | |
| enum class | FilterStandardInput : std::uint8_t { SourceGraphic , SourceAlpha , FillPaint , StrokePaint } |
| Standard named inputs available to filter primitives. More... | |
| enum class | RenderingBehavior { Default , Nonrenderable , NoTraverseChildren , ShadowOnlyChildren } |
| Controls how the attached element is rendered, determines how different element types are rendered. More... | |
| enum class | ShadowBranchType { Main , OffscreenFill , OffscreenStroke , OffscreenMask , OffscreenMarkerStart , OffscreenMarkerMid , OffscreenMarkerEnd , OffscreenFeImage } |
| There are two types of shadow trees: More... | |
| enum class | TextPathMethod { Align , Stretch } |
| Method for placing glyphs along a path in "<textPath>". More... | |
| enum class | TextPathSide { Left , Right } |
| Which side of the path to render text in "<textPath>". More... | |
| enum class | TextPathSpacing { Auto , Exact } |
| Spacing mode for "<textPath>". More... | |
Functions | |
| ParseResult< bool > | ParseFeFloodPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| ParseResult< bool > | ParseFeDropShadowPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| ParseResult< bool > | ParseFeDiffuseLightingPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| ParseResult< bool > | ParseFeSpecularLightingPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| ParseResult< bool > | ParseSizedElementPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for sized elements (SVG, Use, Image), such as x, y, width, height. | |
| ParseResult< bool > | ParseStopPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for a "<stop>" element, such as stop-color and stop-opacity. | |
| bool | HasPaint (const ResolvedPaintServer &paint) |
| Returns true if the paint server is not a PaintServer::None. | |
| ParseResult< bool > | ParseCirclePresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for a "<circle>" element, such as cx, cy, r. | |
| ParseResult< bool > | ParseEllipsePresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for a "<ellipse>" element, such as cx, cy, rx, ry. | |
| ParseResult< bool > | ParseRectPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for a "<rect>" element, such as x, y, width, height, rx, ry. | |
| ParseResult< bool > | ParsePathPresentationAttribute (EntityHandle handle, std::string_view name, const parser::PropertyParseFnParams ¶ms) |
| Parse presentation attributes for a "<path>" element (the "d" attribute). | |
Contains the implementation of the Donner ECS,.
Classes are named as follows:
Registry::ctx().| struct donner::svg::components::ClassComponent |
| struct donner::svg::components::ComputedClipPathsComponent |
Stores a computed clip path, which is used to clip the rendering of an entity.
Aggregates together all paths that compose a clip path, including nested clip paths.
| Class Members | ||
|---|---|---|
| vector< ClipPath > | clipPaths | All clip paths, in order they need to be applied based on their layer. |
| struct donner::svg::components::RenderTreeState |
Global invalidation state, stored in the registry context via Registry::ctx().
Tracks whether a full render tree rebuild is required (e.g., after setTime() or setCanvasSize()), separate from per-entity dirty flags.
| struct donner::svg::components::EvaluatedReferenceComponent |
Represents a reference to another entity which has been evaluated from a Reference string.
This is used by PaintSystem for gradients and patterns which have an href attribute for inheritance.
| ReferenceType | tag which determines which subsystem the reference is for, used to avoid collisions. |
| Class Members | ||
|---|---|---|
| typedef ReferenceType | Type ReferenceType | Tag type of this reference. |
| Class Members | ||
|---|---|---|
| EntityHandle | target | The resolved target entity of the reference. |
| struct donner::svg::components::FilterComponent |
Parameters for a "<filter>" element.
Contains the filter bounds, which determines how large the canvas needs to be when applying the filter, and filter configuration such as units for its parameters.
| Class Members | ||
|---|---|---|
| optional< ColorInterpolationFilters > | colorInterpolationFilters | The parsed value of the "color-interpolation-filters" property, which specifies the color space for filter operations. |
| optional< FilterUnits > | filterUnits | The parsed value of the "filterUnits" attribute, which defines the coordinate system for the x, y, width, and height attributes of the mask. |
| optional< Lengthd > | height | Height of the filter, defaults to 120% (outside of the element itself). |
| optional< Reference > | href | An optional href to another filter, used to inherit attributes and primitive children. |
| optional< PrimitiveUnits > | primitiveUnits | The parsed value of the "primitiveUnits" attribute, which defines the coordinate system for the various attributes of the filter effects. |
| optional< Lengthd > | width | Width of the filter, defaults to 120% (outside of the element itself). |
| optional< Lengthd > | x | The x-coordinate of the filter, defaults to -10% (outside the element itself). |
| optional< Lengthd > | y | The y-coordinate of the filter, defaults to -10% (outside the element itself). |
| struct donner::svg::components::ComputedFilterComponent |
Computed filter parameters parsed by FilterSystem, represents the resolved DOM hierarchy of a "<filter>" element.
| Class Members | ||
|---|---|---|
| ColorInterpolationFilters | colorInterpolationFilters = ColorInterpolationFilters::Default | |
| vector< FilterEffect > | effectChain | Parsed list of effects for backward-compatibility with existing renderer push/pop interface. Will be removed once the graph-based renderer API is complete. |
| FilterGraph | filterGraph | The filter graph built from child filter primitives. |
| FilterUnits | filterUnits = FilterUnits::Default | The computed filter units. |
| Lengthd | height = Lengthd(120.0, Lengthd::Unit::Percent) | The computed height of the filter. |
| PrimitiveUnits | primitiveUnits = PrimitiveUnits::Default | The computed primitive units. The computed color interpolation mode for filter operations. |
| Lengthd | width = Lengthd(120.0, Lengthd::Unit::Percent) | The computed width of the filter. |
| Lengthd | x = Lengthd(-10.0, Lengthd::Unit::Percent) | The computed x-coordinate of the filter. |
| Lengthd | y = Lengthd(-10.0, Lengthd::Unit::Percent) | The computed y-coordinate of the filter. |
| struct donner::svg::components::FilterNode |
A single node in the filter graph, representing one filter primitive.
Nodes are executed in document order. Each node reads from its inputs (which may be standard inputs like SourceGraphic, or outputs of prior nodes), applies its primitive operation, and writes to an output buffer.
| Class Members | ||
|---|---|---|
| optional< ColorInterpolationFilters > | colorInterpolationFilters | Per-primitive color-interpolation-filters. When set, overrides the graph-level default. |
| optional< Lengthd > | height | Primitive subregion height. |
| vector< FilterInput > | inputs | Input(s) to this primitive. |
| FilterPrimitive | primitive | The filter primitive operation. |
| optional< RcString > | result | Named output (for result attribute). |
| optional< Lengthd > | width | Primitive subregion width. |
| optional< Lengthd > | x | Primitive subregion X. |
| optional< Lengthd > | y | Primitive subregion Y. |
| struct donner::svg::components::FilterPrimitiveComponent |
Parameters for SVGFilterPrimitiveStandardAttributes.
| Class Members | ||
|---|---|---|
| optional< Lengthd > | height | The height of the filter region. |
| optional< FilterInput > | in | The input specification for this filter primitive. Parsed from the in attribute. When nullopt, defaults to Previous (output of preceding primitive, or SourceGraphic for the first). |
| optional< FilterInput > | in2 | The second input specification for two-input primitives (e.g., feComposite, feBlend). Parsed from the in2 attribute. |
| optional< RcString > | result | Name of the filter primitive, which enables it to be used as a reference for subsequent filter primitives under the same "<filter>" element. |
| optional< Lengthd > | width | The width of the filter region. |
| optional< Lengthd > | x | The x-coordinate of the filter region. |
| optional< Lengthd > | y | The y-coordinate of the filter region. |
| struct donner::svg::components::FEFloodComponent |
Parameters for SVGFEFloodElement.
| Class Members | ||
|---|---|---|
| Property< Color > | floodColor | The flood fill color, defaults to black. |
| Property< double > | floodOpacity | The flood fill opacity, defaults to 1. Range is [0, 1]. |
| struct donner::svg::components::FEOffsetComponent |
Parameters for SVGFEOffsetElement.
| Class Members | ||
|---|---|---|
| double | dx = 0.0 | The horizontal offset. |
| double | dy = 0.0 | The vertical offset. |
| struct donner::svg::components::FEDropShadowComponent |
Parameters for SVGFEDropShadowElement.
| Class Members | ||
|---|---|---|
| double | dx = 2.0 | Horizontal offset. |
| double | dy = 2.0 | Vertical offset. |
| Property< Color > | floodColor | The flood fill color, defaults to black. |
| Property< double > | floodOpacity | The flood fill opacity, defaults to 1. |
| double | stdDeviationX = 2.0 | Blur standard deviation in X. |
| double | stdDeviationY = 2.0 | Blur standard deviation in Y. |
| struct donner::svg::components::FEComponentTransferComponent |
Marker component for SVGFEComponentTransferElement.
The element itself has no parameters; its children (feFuncR/G/B/A) define the transfer functions for each channel.
| Class Members | ||
|---|---|---|
| int | placeholder = 0 | Placeholder to avoid empty struct issues with entt. |
| struct donner::svg::components::FETileComponent |
Marker component for SVGFETileElement.
The feTile element has no element-specific parameters. It tiles its input's content (within the input's primitive subregion) across its own primitive subregion.
| Class Members | ||
|---|---|---|
| int | placeholder = 0 | Placeholder to avoid empty struct issues with entt. |
| struct donner::svg::components::FEImageComponent |
Parameters for SVGFEImageElement.
| Class Members | ||
|---|---|---|
| RcString | href | Image URL or fragment reference. |
| PreserveAspectRatio | preserveAspectRatio | How to fit the image. |
| struct donner::svg::components::FEMergeComponent |
Marker component for SVGFEMergeElement.
The merge element itself has no parameters; its children (feMergeNode) specify the inputs.
| Class Members | ||
|---|---|---|
| int | placeholder = 0 | Placeholder to avoid empty struct issues with entt. |
| struct donner::svg::components::FEMergeNodeComponent |
Parameters for a feMergeNode child element within feMerge.
Each merge node specifies an input via the in attribute. The inputs are composited bottom-to-top using Source Over.
| Class Members | ||
|---|---|---|
| optional< FilterInput > | in | The input to this merge node. Parsed from the in attribute. |
| struct donner::svg::components::FEDiffuseLightingComponent |
Parameters for SVGFEDiffuseLightingElement.
| Class Members | ||
|---|---|---|
| double | diffuseConstant = 1.0 | Diffuse reflection constant (kd). |
| Property< Color > | lightingColor | lighting-color property, specifying the color of the light source (default: white). |
| double | surfaceScale = 1.0 | Height of surface when alpha=1. |
| struct donner::svg::components::FESpecularLightingComponent |
Parameters for SVGFESpecularLightingElement.
| Class Members | ||
|---|---|---|
| Property< Color > | lightingColor | lighting-color property, specifying the color of the light source (default: white). |
| double | specularConstant = 1.0 | Specular reflection constant (ks). |
| double | specularExponent = 1.0 | Specular exponent (1..128). |
| double | surfaceScale = 1.0 | Height of surface when alpha=1. |
| struct donner::svg::components::SizedElementComponent |
Stores the properties of a sized element, x, y, width, height.
Used for "<svg>", "<image>" and xml_foreignObject by the standard, and also internally with "<use>" for Donner.
| Class Members | ||
|---|---|---|
| bool | applyTranslationForUseElement = false | Set to true for "<use>" elements, so that x/y are applied as a translation. |
| bool | canOverrideWidthHeightForSymbol = false | Set to true for "<symbol>" elements, so that width/height are inherited from the "<use>" element. |
| SizedElementProperties | properties | The properties of the sized element, x, y, width, height. |
| struct donner::svg::components::ComputedSizedElementComponent |
Stores the computed bounds of a sized element, resolving units and percentages.
Contains the computed rect and inherited viewBox of the parent element.
| Class Members | ||
|---|---|---|
| Box2d | bounds | The computed rect of this sized element. |
| Box2d | inheritedViewBox | The viewBox of the parent element, used for preserveAspectRatio transformations. |
| struct donner::svg::components::ComputedShadowSizedElementComponent |
Stores a shadow tree's computed SizedElementComponent, where a "<use>" element overrides the width or height on "<symbol>" or "<svg>" which use SizedElementComponent.
From https://www.w3.org/TR/SVG2/struct.html#UseElement:
The width and height attributes only have an effect if the referenced element defines a viewport (i.e., if it is a 'svg' or 'symbol'); if so, a value other than auto for the 'use' element overrides the value of the corresponding geometric property on that element.
| Class Members | ||
|---|---|---|
| Box2d | bounds | The computed rect of this sized element. |
| struct donner::svg::components::SymbolComponent |
Stores unique parameters for the "<symbol>" element.
refX and refY provide a reference point (if needed) when the symbol is instantiated by a "<use>" element.
| Class Members | ||
|---|---|---|
| SizedElementProperties | properties | The properties of the sized element, x, y, width, height. |
| double | refX = 0.0 | The reference x coordinate. |
| double | refY = 0.0 | The reference y coordinate. |
| struct donner::svg::components::TransformComponent |
Stores the raw transform value set on an entity, for the transform presentation attribute.
This can be sourced from the transform="..." XML attribute, or from the transform CSS property.
| Class Members | ||
|---|---|---|
| Property< CssTransform > | transform | Value of the transform, if it is set. Defaults to std::nullopt. Represents the entity-from-parent transform. |
| struct donner::svg::components::ComputedLocalTransformComponent |
Stores the computed transform value for an entity, relative to the parent.
This resolves presentation attributes and the CSS cascade and stores the resulting value for the current entity.
| Class Members | ||
|---|---|---|
| Transform2d | entityFromParent | Transform from the entity from its parent. |
| CssTransform | rawCssTransform | Raw CSS transform value, before resolving percentages relative to the viewport. |
| Vector2d | transformOrigin | Resolved transform origin in pixels. |
| struct donner::svg::components::ComputedAbsoluteTransformComponent |
Stores the computed transform value for an entity, relative to the world.
This applies the transform from the from all parent entities, and represents the transform of the entity from the root.
| Class Members | ||
|---|---|---|
| Transform2d | entityFromWorld | Transform from the entity from the world. |
| bool | worldIsCanvas | |
| struct donner::svg::components::ViewBoxComponent |
A component attached to entities that have a viewBox attribute, such as "<svg>" and "<pattern>".
| Class Members | ||
|---|---|---|
| optional< Box2d > | viewBox | Stored viewBox, if any. |
| struct donner::svg::components::ComputedViewBoxComponent |
Computed value of a viewBox for the current element.
If this element does not define a viewBox, this is the viewBox of the nearest ancestor or the document itself.
| Class Members | ||
|---|---|---|
| Box2d | viewBox | The viewBox of the element, or the viewBox of the nearest ancestor. |
| struct donner::svg::components::ClipPathComponent |
Parameters for the "<clipPath>" element.
| Class Members | ||
|---|---|---|
| optional< ClipPathUnits > | clipPathUnits | The parsed value of the "clipPathUnits" attribute, which defines the coordinate system for the contents of the clip path. |
| struct donner::svg::components::GradientComponent |
Common parameters for gradient elements, "<linearGradient>" and "<radialGradient>".
When this component is present, either LinearGradientComponent or RadialGradientComponent must be present.
| Class Members | ||
|---|---|---|
| optional< GradientUnits > | gradientUnits | The parsed value of the "gradientUnits" attribute, which specifies how the coordinate system for linear/radial gradient positional attributes (such as x1, y1, cx, cy). Empty if no attribute was specified. |
| optional< Reference > | href | The parsed value of the "href" attribute, which specifies a reference to a gradient element to inherit from. |
| optional< GradientSpreadMethod > | spreadMethod | The parsed value of the "spreadMethod" attribute, which specifies how the gradient is repeated on its edges (such as spread, reflect, or repeat). Empty if no attribute was specified. |
| struct donner::svg::components::MarkerComponent |
Stores the marker data for an SVG element.
| Class Members | ||
|---|---|---|
| double | markerHeight = 3.0 | Height of the marker viewport. |
| MarkerUnits | markerUnits | Coordinate system for marker attributes and contents. |
| double | markerWidth = 3.0 | Width of the marker viewport. |
| MarkerOrient | orient | Orientation of the marker. |
| double | refX = 0.0 | X coordinate for the reference point of the marker. |
| double | refY = 0.0 | Y coordinate for the reference point of the marker. |
| struct donner::svg::components::PatternComponent |
Parameters for "<pattern>" elements which are not captured by ViewBoxComponent and SizedElementComponent.
| Class Members | ||
|---|---|---|
| optional< Reference > | href | An optional href to another pattern, which is used to inherit properties from if not by this entity. |
| optional< PatternContentUnits > | patternContentUnits |
The pattern content units of the pattern, if std::nullopt, the pattern content units are inherited from the parent or defaulted to PatternContentUnits::Default. |
| optional< PatternUnits > | patternUnits |
The pattern units of the pattern, if std::nullopt, the pattern units are inherited from the parent or defaulted to PatternUnits::Default. |
| SizedElementProperties | sizeProperties | Contains the x, y, width, and height properties of the pattern tile rectangle. |
| struct donner::svg::components::StopComponent |
Stores the properties of a "<stop>" element.
| Class Members | ||
|---|---|---|
| StopProperties | properties | The properties of the "<stop>" element. |
| struct donner::svg::components::PathLengthComponent |
| struct donner::svg::components::PreserveAspectRatioComponent |
Stores the preserveAspectRatio attribute of "<svg>" and "<pattern>".
| Class Members | ||
|---|---|---|
| PreserveAspectRatio | preserveAspectRatio | The preserveAspectRatio of the element, defaults to PreserveAspectRatio::None(). |
| struct donner::svg::components::SubtreeInfo |
Created on the start of a subtree, to inform the renderer about which element ends the current subtree, plus how many isolated layers need to be popped when the subtree is complete.
| Class Members | ||
|---|---|---|
| Entity | firstRenderedEntity | Indicates the first entity within the current subtree. The renderer will continue rendering entities until it reaches this one, then it will pop restorePopDepth isolated layers from the render state. |
| Entity | lastRenderedEntity | Indicates the last entity within the current subtree. The renderer will continue rendering entities until it reaches this one, then it will pop restorePopDepth isolated layers from the render state. |
| int | restorePopDepth = 0 | How many isolated layers to pop after rendering this entity. |
| struct donner::svg::components::PaintResolvedReference |
Contains rendering information for a paint server, such as the subtree needed if it establishes an isolated layer, and where the paint server is located.
| Class Members | ||
|---|---|---|
| optional< Color > | fallback | Fallback color to use if this paint fails to instantiate. This can happen for various reasons, such as if a gradient has no stops (making it invalid). |
| ResolvedReference | reference | Reference to the paint server element. |
| optional< SubtreeInfo > | subtreeInfo | If this paint server creates a subtree, such as for patterns, contains subtree info to inform the renderer how to render it. |
| struct donner::svg::components::FontResource |
In-memory representation of a font resource, containing the parsed WOFF data.
| Class Members | ||
|---|---|---|
| WoffFont | font | The parsed WOFF font data. |
| struct donner::svg::components::ImageComponent |
| struct donner::svg::components::LoadedImageComponent |
Loaded raster image resource, created from a ImageComponent when the href references a raster image (PNG, JPEG, GIF).
| Class Members | ||
|---|---|---|
| optional< ImageResource > | image | Loaded image resource. |
| struct donner::svg::components::LoadedSVGImageComponent |
Loaded SVG sub-document, created from a ImageComponent when the href references an SVG file (image/svg+xml).
Stores the shared internal document handle used by SVGDocument.
| Class Members | ||
|---|---|---|
| SVGDocumentHandle | subDocument | Parsed external SVG sub-document handle. |
| struct donner::svg::components::ExternalUseComponent |
Loaded external SVG sub-document referenced by a <use> element.
When a <use> element's href points to an external SVG file, the document is loaded via SubDocumentCache and stored here as an SVGDocumentHandle for rendering as a nested sub-document.
| Class Members | ||
|---|---|---|
| RcString | fragment | Fragment identifier within the external document (e.g., "elementId" from "file.svg#elementId"). Empty if the whole document is referenced. |
| SVGDocumentHandle | subDocument | Parsed external SVG sub-document handle. |
| struct donner::svg::components::ShadowEntityComponent |
A component attached to entities in the shadow tree, indicating which light entity they are mirroring.
This component exists on every shadow entity, forming a one-to-one mapping between shadow entities and light entities.
| Class Members | ||
|---|---|---|
| Entity | lightEntity | The entity that this shadow entity is mirroring. |
| struct donner::svg::components::ShadowTreeRootComponent |
Indicates root of an instantiated shadow tree, where the light entity is is the target of the href, e.g.
a "<symbol>" element.
| Class Members | ||
|---|---|---|
| Entity | sourceEntity | The entity of the source (e.g. "<use>") element that instantiated this shadow tree. |
| struct donner::svg::components::CircleComponent |
Parameters for a "<circle>" element.
| Class Members | ||
|---|---|---|
| CircleProperties | properties | The properties for the circle. |
| struct donner::svg::components::EllipseComponent |
Parameters for a "<ellipse>" element.
| Class Members | ||
|---|---|---|
| EllipseProperties | properties | The properties of the ellipse. |
| struct donner::svg::components::LineComponent |
Parameters for a "<line>" element.
Note that unlike other elements, the x1, y1, x2, and y2 properties are not presentation attributes, so they must be specified on the element and not through CSS. This means that we don't need a ComputedLineComponent counterpart of this struct.
From https://www.w3.org/TR/SVG2/shapes.html#LineElement
A future specification may convert the ‘x1’, ‘y1’, ‘x2’, and ‘y2’ attributes to geometric properties. Currently, they can only be specified via element attributes, and not CSS.
| Class Members | ||
|---|---|---|
| Lengthd | x1 | The x-coordinate of the start of the line. |
| Lengthd | x2 | The x-coordinate of the end of the line. |
| Lengthd | y1 | The y-coordinate of the start of the line. |
| Lengthd | y2 | The y-coordinate of the end of the line. |
| struct donner::svg::components::RectComponent |
Parameters for a "<rect>" element.
| Class Members | ||
|---|---|---|
| RectProperties | properties | The properties of the rectangle. |
| struct donner::svg::components::ComputedStyleComponent |
Contains the computed style properties for an element, which is a combination of the style="" attribute, the CSS stylesheet, and the CSS cascade where properties are inherited from the parent.
| Class Members | ||
|---|---|---|
| optional< PropertyRegistry > | properties |
The computed style properties. std::nullopt may be present mid-computation before all properties have been cascaded. |
| struct donner::svg::components::DoNotInheritFillOrStrokeTag |
This component is added to entities to indicate that 'fill' and 'stroke' attributes should not be inherited, which is used for "<pattern>" because it establishes a shadow tree, and we do not want to recursively inherit 'fill' or 'stroke' values into the children.
| struct donner::svg::components::ComputedTextComponent |
Pre‑computed layout information for a text subtree.
A ComputedTextComponent is attached by the layout system to the root "<text>" element after all "<text>", "<tspan>", and "<textPath>" descendants have been resolved. It stores the final, absolute positions for each contiguous slice of text, allowing the renderer to iterate quickly without re‑evaluating attribute vectors on every frame.
The component contains a single public field, spans, which is the computed list of text spans.
| Class Members | ||
|---|---|---|
| SmallVector< TextSpan, 1 > | spans | |
| struct donner::svg::components::ComputedTextGeometryComponent |
Cached geometry for text layout and text-derived public API queries.
Attached to the root <text> entity and populated from the shared text engine. This stores per-glyph outlines and per-character metrics so DOM APIs can answer geometry queries without duplicating text layout logic.
| Class Members | ||
|---|---|---|
| vector< CharacterGeometry > | characters | Cached character metrics in logical order. |
| Box2d | emBoxBounds | Union of em-box bounds used for text bbox. |
| vector< GlyphGeometry > | glyphs | Cached glyph outlines for the text root. |
| Box2d | inkBounds | Union of glyph ink bounds. |
| vector< TextRun > | runs | Cached layout runs for renderer reuse. |
| struct donner::svg::components::TextComponent |
Defines the start of a text element, which may have other text elements as children.
Created on each "<text>", "<tspan>", and "<textPath>" element.
| Class Members | ||
|---|---|---|
| LengthAdjust | lengthAdjust = LengthAdjust::Default | How to adjust the text length, either by adding spacing between glyphs or stretching the glyphs themselves. |
| RcString | text | Text content. |
| SmallVector< RcString, 1 > | textChunks |
Direct text chunks between child elements, in DOM order. Chunk 0 is the text before the first child element, chunk 1 is the text between the first and second child elements, and so on. Empty chunks are preserved so mixed text and element content can be reconstructed in order during layout. |
| optional< Lengthd > | textLength | Override for the text length. If empty, the property is not set. |
| struct donner::svg::components::TextPathComponent |
Stores attributes specific to "<textPath>" elements.
The <textPath> element renders text along an arbitrary path referenced by href.
| Class Members | ||
|---|---|---|
| RcString | href | Reference to a <path> element (IRI fragment, e.g., "#myPath"). |
| TextPathMethod | method = TextPathMethod::Align | How glyphs are placed on the path. |
| TextPathSide | side = TextPathSide::Left | Which side of the path to render text. |
| TextPathSpacing | spacing = TextPathSpacing::Exact | Spacing control. |
| optional< Lengthd > | startOffset | Offset along the path where text begins. Percentages are relative to path length. |
| struct donner::svg::components::TextPositioningComponent |
Defines the positioning of a text element, which may have other text elements as children.
| Class Members | ||
|---|---|---|
| SmallVector< Lengthd, 1 > | dx | Relative shift in x for each character. If empty, the property is not set. |
| SmallVector< Lengthd, 1 > | dy | Relative shift in y for each character. If empty, the property is not set. |
| SmallVector< double, 1 > | rotateDegrees | Rotation in degrees for each character. If empty, the property is not set. |
| SmallVector< Lengthd, 1 > | x | X coordinate for each character. If empty, the property is not set. |
| SmallVector< Lengthd, 1 > | y | Y coordinate for each character. If empty, the property is not set. |
| struct donner::svg::components::TextRootComponent |
Defines the start of a text element, which may have other text elements as children.
Created on each "<text>" element.
Variant holding any filter primitive type.
The resolved paint server for a fill or stroke.
Type definition for a callback to process sized elements.
This allows systems that can't directly depend on LayoutSystem to request sized element processing.
| registry | ECS registry. |
| shadowEntity | The shadow entity to create a computed component for. |
| useEntity | The source "<use>" that may provide size override. |
| symbolEntity | The target "<symbol>" entity whose properties might be overridden. |
| branchType | The type of branch being created. |
| outWarnings | Output vector of parse errors, if any. |
|
strong |
|
strong |
Controls how the attached element is rendered, determines how different element types are rendered.
|
strong |
There are two types of shadow trees:
Shadow trees always belong to specific branches, and there are no multiples; there are a finite number of branches. To enable this, list each branch individually, with everything except Main being an offscreen branch.
|
strong |
Method for placing glyphs along a path in "<textPath>".
| Enumerator | |
|---|---|
| Align | Glyphs are aligned to the tangent of the path. |
| Stretch | Glyphs are stretched along the tangent to match path curvature. |
|
strong |
Which side of the path to render text in "<textPath>".
| Enumerator | |
|---|---|
| Left | Text rendered on the left side (default). |
| Right | Text rendered on the right side (reversed direction). |
|
strong |
Spacing mode for "<textPath>".
| Enumerator | |
|---|---|
| Auto | UA determines spacing. |
| Exact | Exact inter-character spacing. |
|
inline |
Returns true if the paint server is not a PaintServer::None.
| paint | The paint server to check. |