3
* Ted Gould <ted@gould.cx>
5
* Copyright (C) 2006 Authors
7
* Released under GNU GPL, read the file 'COPYING' for more information
10
#include "document-private.h"
11
#include "sp-object.h"
13
#include "patheffect.h"
19
PathEffect::PathEffect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp)
20
: Extension(in_repr, in_imp)
25
PathEffect::~PathEffect (void)
31
PathEffect::processPath (SPDocument * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/)
38
PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path)
40
gchar const * patheffectlist = path->attribute("inkscape:path-effects");
41
if (patheffectlist == NULL)
44
gchar ** patheffects = g_strsplit(patheffectlist, ";", 128);
45
Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc));
47
for (int i = 0; patheffects[i] != NULL && i < 128; i++) {
48
gchar * patheffect = patheffects[i];
50
// This is weird, they should all be references... but anyway
51
if (patheffect[0] != '#') continue;
53
Inkscape::XML::Node * prefs = sp_repr_lookup_child(defs, "id", &(patheffect[1]));
59
gchar const * ext_id = prefs->attribute("extension");
65
Inkscape::Extension::PathEffect * peffect;
66
peffect = dynamic_cast<Inkscape::Extension::PathEffect *>(Inkscape::Extension::db.get(ext_id));
67
if (peffect != NULL) {
72
peffect->processPath(doc, path, prefs);
75
g_strfreev(patheffects);
80
} } /* namespace Inkscape, Extension */
85
c-file-style:"stroustrup"
86
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
91
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :