1df6105803c4c56c020a56301c7c9c4890fd4158mathog/*
1df6105803c4c56c020a56301c7c9c4890fd4158mathog * Factory for SPObject tree
1df6105803c4c56c020a56301c7c9c4890fd4158mathog *
1df6105803c4c56c020a56301c7c9c4890fd4158mathog * Authors:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog * Markus Engel
1df6105803c4c56c020a56301c7c9c4890fd4158mathog *
1df6105803c4c56c020a56301c7c9c4890fd4158mathog * Copyright (C) 2013 Authors
1df6105803c4c56c020a56301c7c9c4890fd4158mathog * Released under GNU GPL, read the file 'COPYING' for more information
1df6105803c4c56c020a56301c7c9c4890fd4158mathog */
1df6105803c4c56c020a56301c7c9c4890fd4158mathog
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-factory.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog
1df6105803c4c56c020a56301c7c9c4890fd4158mathog// primary
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "box3d.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "box3d-side.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "color-profile.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "persp3d.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-anchor.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-clippath.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-defs.h"
2238559b1acb6cb7b91188901478dd99e5e02518Martin Owens#include "sp-desc.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-ellipse.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-filter.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-flowdiv.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-flowregion.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-flowtext.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-font.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-font-face.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-glyph.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-glyph-kerning.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-guide.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-hatch.h"
5e657c265e2687328f5f9c7bf71a4c6b39bb3be9Liam P. White#include "sp-hatch-path.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-image.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-item-group.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-line.h"
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog#include "sp-linear-gradient.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-marker.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-mask.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-mesh.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-mesh-patch.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-mesh-row.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-metadata.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-missing-glyph.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-namedview.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-object.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-offset.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-path.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-pattern.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-polygon.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-polyline.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-radial-gradient.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-rect.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-root.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-script.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-solid-color.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-spiral.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-star.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-stop.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-string.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-style-elem.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-switch.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-symbol.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-tag.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-tag-use.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-text.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-textpath.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-title.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-tref.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-tspan.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "sp-use.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "live_effects/lpeobject.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog
1df6105803c4c56c020a56301c7c9c4890fd4158mathog// filters
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/blend.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/colormatrix.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/componenttransfer.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/componenttransfer-funcnode.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/composite.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/convolvematrix.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/diffuselighting.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/displacementmap.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/distantlight.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/flood.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/gaussian-blur.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/image.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/merge.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/mergenode.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/morphology.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/offset.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/pointlight.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/specularlighting.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/spotlight.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/tile.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog#include "filters/turbulence.h"
1df6105803c4c56c020a56301c7c9c4890fd4158mathog
1df6105803c4c56c020a56301c7c9c4890fd4158mathogSPObject *SPFactory::createObject(std::string const& id)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog{
1df6105803c4c56c020a56301c7c9c4890fd4158mathog SPObject *ret = NULL;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog
1df6105803c4c56c020a56301c7c9c4890fd4158mathog if (id == "inkscape:box3d")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPBox3D;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "inkscape:box3dside")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new Box3DSide;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:color-profile")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new Inkscape::ColorProfile;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "inkscape:persp3d")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new Persp3D;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:a")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPAnchor;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:clipPath")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPClipPath;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:defs")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPDefs;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:desc")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPDesc;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:ellipse") {
1df6105803c4c56c020a56301c7c9c4890fd4158mathog SPGenericEllipse *e = new SPGenericEllipse;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog e->type = SP_GENERIC_ELLIPSE_ELLIPSE;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = e;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog } else if (id == "svg:circle") {
1df6105803c4c56c020a56301c7c9c4890fd4158mathog SPGenericEllipse *c = new SPGenericEllipse;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog c->type = SP_GENERIC_ELLIPSE_CIRCLE;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = c;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog } else if (id == "arc") {
1df6105803c4c56c020a56301c7c9c4890fd4158mathog SPGenericEllipse *a = new SPGenericEllipse;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog a->type = SP_GENERIC_ELLIPSE_ARC;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = a;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog }
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:filter")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFilter;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowDiv")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowdiv;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowSpan")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowtspan;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowPara")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowpara;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowLine")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowline;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowRegionBreak")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowregionbreak;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowRegion")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowregion;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowRegionExclude")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowregionExclude;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:flowRoot")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFlowtext;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:font")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFont;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:font-face")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFontFace;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:glyph")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPGlyph;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:hkern")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPHkern;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:vkern")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPVkern;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "sodipodi:guide")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPGuide;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:hatch")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPHatch;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:hatchPath")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPHatchPath;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:image")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPImage;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:g")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPGroup;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:line")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPLine;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:linearGradient")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPLinearGradient;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:marker")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPMarker;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:mask")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPMask;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:mesh")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPMesh;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:meshpatch")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPMeshpatch;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:meshrow")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPMeshrow;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:metadata")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPMetadata;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:missing-glyph")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPMissingGlyph;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "sodipodi:namedview")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPNamedView;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "inkscape:offset")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPOffset;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:path")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPPath;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:pattern")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPPattern;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:polygon")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPPolygon;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:polyline")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPPolyLine;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:radialGradient")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPRadialGradient;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:rect")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPRect;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:svg")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPRoot;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:script")
5e657c265e2687328f5f9c7bf71a4c6b39bb3be9Liam P. White ret = new SPScript;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:solidColor")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPSolidColor;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "spiral")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPSpiral;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "star")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPStar;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:stop")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPStop;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "string")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPString;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:style")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPStyleElem;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:switch")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPSwitch;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:symbol")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPSymbol;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "inkscape:tag")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPTag;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "inkscape:tagref")
804ac6d80f744681705361c407a9ee11aaed685bmathog ret = new SPTagUse;
5e657c265e2687328f5f9c7bf71a4c6b39bb3be9Liam P. White else if (id == "svg:text")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPText;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:title")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPTitle;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:tref")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPTRef;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:tspan")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPTSpan;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:textPath")
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog ret = new SPTextPath;
3b70d4b4adefa3ff65931070bee74f26bab2f6f6mathog else if (id == "svg:use")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPUse;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "inkscape:path-effect")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new LivePathEffectObject;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog // filters
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feBlend")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeBlend;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feColorMatrix")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeColorMatrix;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feComponentTransfer")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeComponentTransfer;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feFuncR")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeFuncNode(SPFeFuncNode::R);
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feFuncG")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeFuncNode(SPFeFuncNode::G);
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feFuncB")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeFuncNode(SPFeFuncNode::B);
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feFuncA")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeFuncNode(SPFeFuncNode::A);
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feComposite")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeComposite;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feConvolveMatrix")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeConvolveMatrix;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feDiffuseLighting")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeDiffuseLighting;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feDisplacementMap")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeDisplacementMap;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feDistantLight")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeDistantLight;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feFlood")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeFlood;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feGaussianBlur")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPGaussianBlur;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feImage")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeImage;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feMerge")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeMerge;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feMergeNode")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeMergeNode;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feMorphology")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeMorphology;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feOffset")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeOffset;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:fePointLight")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFePointLight;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feSpecularLighting")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeSpecularLighting;
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog else if (id == "svg:feSpotLight")
034d7ccaa6acbcd03e37974a2d164706862c32a2mathog ret = new SPFeSpotLight;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:feTile")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFeTile;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "svg:feTurbulence")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPFeTurbulence;
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "inkscape:grid")
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ret = new SPObject; // TODO wtf
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "rdf:RDF") // no SP node yet
1df6105803c4c56c020a56301c7c9c4890fd4158mathog {}
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "inkscape:clipboard") // SP node not necessary
1df6105803c4c56c020a56301c7c9c4890fd4158mathog {}
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id == "inkscape:_templateinfo") // ?
1df6105803c4c56c020a56301c7c9c4890fd4158mathog {}
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else if (id.empty()) // comments
1df6105803c4c56c020a56301c7c9c4890fd4158mathog {}
1df6105803c4c56c020a56301c7c9c4890fd4158mathog else {
fprintf(stderr, "WARNING: unknown type: %s\n", id.c_str());
}
return ret;
}
std::string NodeTraits::get_type_string(Inkscape::XML::Node const &node)
{
std::string name;
switch (node.type()) {
case Inkscape::XML::TEXT_NODE:
name = "string";
break;
case Inkscape::XML::ELEMENT_NODE: {
char const *const sptype = node.attribute("sodipodi:type");
if (sptype) {
name = sptype;
} else {
name = node.name();
}
break;
}
default:
name = "";
break;
}
return name;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :