diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-03-19 23:19:10 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-03-19 23:19:10 +0000 |
| commit | 56203e13823d18965321e46218f4d2995287383d (patch) | |
| tree | 608ea929af1aafc1b820344662881ed52ea34966 /src/sp-clippath.cpp | |
| parent | restore broken ngettext (diff) | |
| download | inkscape-56203e13823d18965321e46218f4d2995287383d.tar.gz inkscape-56203e13823d18965321e46218f4d2995287383d.zip | |
patch by Andrius R. for (un)clip and (un)mask commands
(bzr r263)
Diffstat (limited to 'src/sp-clippath.cpp')
| -rw-r--r-- | src/sp-clippath.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 086b6dcfa..33feea8ce 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -21,6 +21,7 @@ #include "enums.h" #include "attributes.h" #include "document.h" +#include "document-private.h" #include "sp-item.h" #include "sp-clippath.h" @@ -368,6 +369,27 @@ sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view) 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: |
