X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Fpatheffect.cpp;h=e45d0b25504950b68e4f52e8373ee7945c174c8d;hb=78023b76d7395f1b2dc1c64e1e7ad538be13c62c;hp=80815c5d08508700eeea21a650234affcf6b86a2;hpb=42e04ed2e6aa6366e0ae13638a28ae64cad76ba7;p=inkscape.git diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp index 80815c5d0..e45d0b255 100644 --- a/src/extension/patheffect.cpp +++ b/src/extension/patheffect.cpp @@ -7,7 +7,11 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include "document-private.h" +#include "sp-object.h" + #include "patheffect.h" +#include "db.h" namespace Inkscape { namespace Extension { @@ -23,11 +27,53 @@ PathEffect::~PathEffect (void) } -gchar * -PathEffect::processPath (gchar * path_data, gchar * pressure, gchar * tilt) +void +PathEffect::processPath (SPDocument * doc, Inkscape::XML::Node * path, Inkscape::XML::Node * def) +{ + + +} + +void +PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path) { + gchar const * patheffectlist = path->attribute("inkscape:path-effects"); + if (patheffectlist == NULL) + return; + + gchar ** patheffects = g_strsplit(patheffectlist, ";", 128); + Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); + + for (int i = 0; patheffects[i] != NULL && i < 128; i++) { + gchar * patheffect = patheffects[i]; + + // This is weird, they should all be references... but anyway + if (patheffect[0] != '#') continue; + + Inkscape::XML::Node * prefs = sp_repr_lookup_child(defs, "id", &(patheffect[1])); + if (prefs == NULL) { + + continue; + } + + gchar const * ext_id = prefs->attribute("extension"); + if (ext_id == NULL) { + + continue; + } + + Inkscape::Extension::PathEffect * peffect; + peffect = dynamic_cast(Inkscape::Extension::db.get(ext_id)); + if (peffect != NULL) { + + continue; + } + peffect->processPath(doc, path, prefs); + } + g_strfreev(patheffects); + return; }