diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 086b6dcfa3084f040af83d8265a4dae0944a8442..33feea8ce2eef50669b8a78841becde558822f69 100644 (file)
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
#include "enums.h"
#include "attributes.h"
#include "document.h"
+#include "document-private.h"
#include "sp-item.h"
#include "sp-clippath.h"
return list;
}
+// Create a mask element (using passed elements), add it to <defs>
+const gchar *
+sp_clippath_create (GSList *reprs, SPDocument *document)
+{
+ Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document));
+
+ Inkscape::XML::Node *repr = sp_repr_new ("svg:clipPath");
+ repr->setAttribute("clipPathUnits", "userSpaceOnUse");
+
+ defsrepr->appendChild(repr);
+ const gchar *id = repr->attribute("id");
+ SPObject *clip_path_object = document->getObjectById(id);
+
+ for (GSList *it = reprs; it != NULL; it = it->next) {
+ Inkscape::XML::Node *node = (Inkscape::XML::Node *)(it->data);
+ clip_path_object->appendChildRepr(node);
+ }
+
+ Inkscape::GC::release(repr);
+ return id;
+}
/*
Local Variables: