|
| void | setCx (Lengthd value) |
| | Set the center X coordinate.
|
| void | setCy (Lengthd value) |
| | Set the center Y coordinate.
|
| void | setR (Lengthd value) |
| | Set the radius.
|
|
Lengthd | cx () const |
| | Get the center X coordinate.
|
|
Lengthd | cy () const |
| | Get the center Y coordinate.
|
|
Lengthd | r () const |
| | Get the radius.
|
|
Lengthd | computedCx () const |
| | Applies stylesheet rules to the element, and returns the computed value of the cx property.
|
|
Lengthd | computedCy () const |
| | Applies stylesheet rules to the element, and returns the computed value of the cy property.
|
|
Lengthd | computedR () const |
| | Applies stylesheet rules to the element, and returns the computed value of the r property.
|
|
double | computedPathLength () const |
| | Get the length of the path in user units. To override this value for stroke-dasharray and other path-offset-relative values, use setPathLength.
|
|
std::optional< double > | pathLength () const |
| | Get the path length override, if set. To get the computed path length, use computedPathLength().
|
| void | setPathLength (std::optional< double > value) |
| | Set the path length override.
|
| std::optional< Path > | computedSpline () const |
| | Get the computed path geometry as a Path - a sequence of line segments, quadratic and cubic Bezier curves that define the shape's outline.
|
| std::optional< Box2d > | worldBounds () const |
| | Get the bounding box of the element, in world coordinates.
|
|
Transform2d | transform () const |
| | Get the 2d transformation for this element, which maps element coordinates into the parent's coordinate space (parent-from-element). The transform-origin offset is not included.
|
|
void | setTransform (const Transform2d &transform) |
| | Set the 2d transformation for this element (parent-from-element), overriding any authored transform. The transform-origin offset still applies on top of it.
|
|
Transform2d | elementFromWorld () const |
| | Get the absolute transform that maps this element's coordinates into world (document) coordinates, including all ancestor transforms. Despite the name, this is the world-from-element transform; invert it to map world points into element space.
|
| std::optional< Path > | resolvedSimpleClipPathOutline (std::size_t maxVerbs, std::size_t maxPoints, std::size_t maxBytes, bool *hasClipPath=nullptr) const |
| | Return this element's single effective clip outline in document coordinates. The transform includes the referencing element's own transform, as required for userSpaceOnUse and objectBoundingBox clips; callers can distinguish an inherited clip by querying the ancestor that owns it. An absent, invalid, nested, or multi-shape boolean clip returns nullopt rather than a misleading source outline. If provided, hasClipPath distinguishes absence from an unsupported effective clip; callers combining ancestor clips must fail closed in the latter case. Explicit limits bound source and returned path storage. This reads the prepared render tree, and returns nullopt when this element has no visible rendering instance.
|
|
| SVGElement (const SVGElement &other) |
| | Create another reference to the same SVGElement.
|
|
| SVGElement (SVGElement &&other) noexcept |
| | Move constructor.
|
|
| ~SVGElement () noexcept |
| | Destructor.
|
|
SVGElement & | operator= (const SVGElement &other) |
| | Create another reference to the same SVGElement.
|
|
SVGElement & | operator= (SVGElement &&other) noexcept |
| | Move assignment operator.
|
|
ElementType | type () const |
| | Get the ElementType for known XML element types.
|
|
std::optional< ElementType > | tryType () const |
| | Get the ElementType if this handle still has SVG element identity.
|
|
xml::XMLQualifiedName | tagName () const |
| | Get the owning XML qualified tag name for this element.
|
|
std::optional< xml::XMLQualifiedName > | tryTagName () const |
| | Get the owning XML qualified tag name if this handle still has XML tree identity.
|
|
bool | isKnownType () const |
| | Returns true if this is a known element type, returns false if this is an donner::svg::SVGUnknownElement.
|
| EntityHandle | unsafeEntityHandle () const |
| | Get the underlying donner::EntityHandle.
|
|
EntityHandle | entityHandle () const |
| | Get the underlying donner::EntityHandle, for advanced use-cases that require direct access to the ECS.
|
| template<typename Callback> |
| decltype(auto) | withReadAccess (Callback &&callback) const |
| | Run a callback with scoped read access to this element's document and resolved entity handle.
|
| template<typename Callback> |
| decltype(auto) | withWriteAccess (Callback &&callback) const |
| | Run a callback with scoped write access to this element's document and resolved entity handle.
|
|
RcString | id () const |
| | Get the element id, the value of the "id" attribute.
|
| void | setId (std::string_view id) |
| | Set the element id, the value of the "id" attribute.
|
|
RcString | className () const |
| | Get the element class name, the value of the "class" attribute.
|
| void | setClassName (std::string_view name) |
| | Set the element class name, the value of the "class" attribute.
|
| void | setStyle (std::string_view style) |
| | Set the element style, the value of the "style" attribute.
|
| void | updateStyle (std::string_view style) |
| | Update the element style, adding new properties or overriding existing ones (without removing them).
|
| ParseResult< bool > | trySetPresentationAttribute (std::string_view name, std::string_view value) |
| | Set the value of a presentation attribute, such as "fill" or "stroke".
|
| bool | hasAttribute (const xml::XMLQualifiedNameRef &name) const |
| | Returns true if the element has an attribute with the given name.
|
| std::optional< RcString > | getAttribute (const xml::XMLQualifiedNameRef &name) const |
| | Get the value of an attribute, if it exists.
|
| SmallVector< xml::XMLQualifiedNameRef, 1 > | findMatchingAttributes (const xml::XMLQualifiedNameRef &matcher) const |
| | Find attributes matching the given name matcher.
|
| SmallVector< xml::XMLQualifiedNameRef, 10 > | attributes () const |
| | Get the list of attributes for this element.
|
| void | setAttribute (const xml::XMLQualifiedNameRef &name, std::string_view value) |
| | Set the value of a generic XML attribute, which may be either a presentation attribute or custom user-provided attribute.
|
| void | removeAttribute (const xml::XMLQualifiedNameRef &name) |
| | Remove an attribute, which may be either a presentation attribute or custom user-provided attribute.
|
|
SVGDocument | ownerDocument () |
| | Get an owning reference to the SVGDocument containing this element.
|
| std::optional< SVGElement > | parentElement () const |
| | Get this element's parent, if it exists.
|
| std::optional< SVGElement > | firstChild () const |
| | Get the first child of this element, if it exists.
|
| std::optional< SVGElement > | firstChild (css::SelectorTraversalBudget *budget) const |
| | Selector navigation charging skipped non-element nodes.
|
| bool | isEmptyForSelector (css::SelectorTraversalBudget *budget=nullptr) const |
| | Whether this element is empty under the CSS :empty content rules.
|
| std::optional< SVGElement > | lastChild () const |
| | Get the last child of this element, if it exists.
|
| std::optional< SVGElement > | lastChild (css::SelectorTraversalBudget *budget) const |
| | Selector navigation charging skipped non-element nodes.
|
| std::optional< SVGElement > | previousSibling () const |
| | Get the previous sibling of this element, if it exists.
|
| std::optional< SVGElement > | previousSibling (css::SelectorTraversalBudget *budget) const |
| | Selector navigation charging skipped non-element nodes.
|
| std::optional< SVGElement > | nextSibling () const |
| | Get the next sibling of this element, if it exists.
|
| std::optional< SVGElement > | nextSibling (css::SelectorTraversalBudget *budget) const |
| | Selector navigation charging skipped non-element nodes.
|
| void | insertBefore (const SVGElement &newNode, std::optional< SVGElement > referenceNode) |
| | Insert newNode as a child, before referenceNode.
|
| void | appendChild (const SVGElement &child) |
| | Append child as a child of the current node.
|
| void | replaceChild (const SVGElement &newChild, const SVGElement &oldChild) |
| | Replace oldChild with newChild in the tree, removing oldChild and inserting newChild in its place.
|
| void | removeChild (const SVGElement &child) |
| | Remove child from this node.
|
| void | remove () |
| | Remove this node from its parent, if it has one.
|
|
bool | operator== (const SVGElement &other) const |
| | Returns true if the two SVGElement handles reference the same underlying element.
|
|
bool | operator!= (const SVGElement &other) const |
| | Returns true if the two SVGElement handles reference different underlying elements.
|
| template<typename Derived> |
| bool | isa () const |
| | Return true if this element "is a" instance of type, i.e.
|
| template<typename Derived> |
| Derived | cast () |
| | Cast this element to its derived type.
|
| template<typename Derived> |
| Derived | cast () const |
| | Cast this element to its derived type (const version).
|
| template<typename Derived> |
| std::optional< Derived > | tryCast () |
| | Cast this element to its derived type, if possible.
|
| template<typename Derived> |
| std::optional< const Derived > | tryCast () const |
| | Cast this element to its derived type, if possible.
|
| std::optional< SVGElement > | querySelector (std::string_view selector) |
| | Find the first descendant of this element, in document order, that matches the given CSS selector.
|
| const PropertyRegistry & | getComputedStyle () const |
| | Get the computed CSS style of this element, after the CSS cascade has been applied.
|
| const PropertyRegistry * | specifiedStyle () const |
| | The element's own specified style properties - the parsed style attribute plus presentation attributes, before the CSS cascade and inheritance - or nullptr when the element carries no style data.
|
| const PropertyRegistry * | computedStyleIfPresent () const |
| | The cascaded computed style if it has already been computed (by rendering or a prior getComputedStyle call), otherwise nullptr.
|
| std::optional< PaintServer > | resolvedFillPaint () const |
| | The renderer-resolved fill paint from this element's prepared rendering instance, or std::nullopt when the render tree has not been built or this element has no rendering instance.
|
|
| | SVGGeometryElement (EntityHandle handle) |
| | Internal constructor to create an SVGGeometryElement from an EntityHandle.
|
|
void | invalidate () |
| | Invalidates the computed shape for this element, should be called when the shape geometry changes.
|
|
| SVGGraphicsElement (EntityHandle handle) |
| | Inheriting constructor to be called by derived classes. SVGGraphicsElement cannot be instantiated directly.
|
| | SVGElement (EntityHandle handle) |
| | Internal constructor to create an SVGElement from an donner::EntityHandle.
|
| template<typename InvalidateCallback> |
| ScopedMutation< std::decay_t< InvalidateCallback > > | mutationScope (InvalidateCallback &&invalidateOnScopeExit) const |
| | Create a scoped mutation that runs invalidateOnScopeExit before the revision commit.
|
| std::optional< ParseDiagnostic > | setAttributeFromXMLMutation (const xml::XMLQualifiedNameRef &name, std::string_view value, bool *consumedAsPresentationAttribute=nullptr) |
| | Set an attribute from an XML mutation and return any SVG semantic parse diagnostic.
|
| void | removeAttributeFromXMLMutation (const xml::XMLQualifiedNameRef &name) |
| | Remove an attribute from an XML mutation without writing back to XML source.
|
|
Registry & | unsafeRegistry () const |
| | Get the underlying ECS Registry, which holds all data for the document, for advanced use.
|
|
Registry & | registry () const |
| | Get the underlying ECS Registry, which holds all data for the document, for advanced use.
|
| EntityHandle | toHandle (Entity entity) const |
| | Convert an Entity to an EntityHandle, for advanced use.
|
| static SVGElement | CreateFromEntityHandle (EntityHandle handle) |
| | Wrap an arbitrary existing entity as a generic SVGElement.
|
| static DocumentWriteAccess | CreateElementWriteAccess (SVGDocument &document) |
| | Acquire write access for creating an element in a document.
|
| static DocumentMutationBatch | CreateElementMutationBatch (SVGDocument &document) |
| | Acquire a mutation scope for creating an element in a document.
|
| static EntityHandle | CreateEmptyEntity (SVGDocument &document) |
| | Create a new Entity within the document ECS, and return a handle to it.
|
| static EntityHandle | CreateEmptyEntity (DocumentWriteAccess &access) |
| | Create a new Entity within a guarded document ECS, and return a handle to it.
|
| static void | CreateEntityOn (EntityHandle handle, const xml::XMLQualifiedNameRef &tagName, ElementType Type) |
| | Create a new SVG element instance on a given donner::Entity.
|
|
ElementAnchor | handle_ |
| | The lifetime-aware ECS entity anchor for this element.
|