41 if (!source || !source->
document || !dest_document) {
47 auto dest_defs = dest_document->
getDefs();
50 dest_defs->getRepr()->
addChild(repr,
nullptr);
52 g_assert(
object !=
nullptr);
56 auto xhref =
object->getAttribute(
"xlink:href");
57 auto href =
object->getAttribute(
"href");
Interface for refcounted XML nodes.
virtual void addChild(Node *child, Node *after)=0
Insert another node as a child of this node.
virtual Node * duplicate(Document *doc) const =0
Create a duplicate of this node.
Typed SVG document implementation.
SPDefs * getDefs()
Return the main defs object for the document.
Inkscape::XML::Document * getReprDoc()
Our Inkscape::XML::Document.
SPObject * getObjectByHref(std::string const &href) const
SPObject * getObjectByRepr(Inkscape::XML::Node *repr) const
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
char const * getAttribute(char const *name) const
SPObject * sp_copy_resource(const SPObject *source, SPDocument *dest_document)
Copy source resource form one document into another destination document.
void copy_style_links(const SPObject *source, SPDocument *src_document, SPDocument *dest_document)
std::shared_ptr< Css const > css
static R & release(R &r)
Decrements the reference count of a anchored object.
static T clip(T const &v, T const &a, T const &b)
void sp_repr_css_attr_unref(SPCSSAttr *css)
Unreferences an SPCSSAttr (will be garbage collected if no references remain).
char const * sp_repr_css_property(SPCSSAttr *css, gchar const *name, gchar const *defval)
Returns a character string of the value of a given style property or a default value if the attribute...
C facade to Inkscape::XML::Node.
Interface for XML documents.
static const unsigned SP_STYLE_FLAG_ALWAYS(1<< 2)
SPCSSAttr * sp_css_attr_from_object(SPObject *object, guint const flags)
SPStyle - a style object for SPItem objects.
std::optional< std::string > try_extract_uri(const char *url)
Try extracting URI from "url(xyz)" string using extract_uri.
URI functions as per 4.3.4 of CSS 2.1 http://www.w3.org/TR/CSS21/syndata.html#uri.