|
@@ -66,6 +66,55 @@ public: |
|
|
const XmlPath* parent;
|
|
|
const XmlPath* parent;
|
|
|
};
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
struct UsePathOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
Path* targetPath;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xmlPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->parsePathElement (xmlPath, *targetPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct GetClipPathOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
Drawable* target;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xmlPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->applyClipPath (*target, xmlPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct SetGradientStopsOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
ColourGradient* gradient;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xml)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->addGradientStopsIn (*gradient, xml);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct GetFillTypeOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
const Path* path;
|
|
|
|
|
|
float opacity;
|
|
|
|
|
|
FillType fillType;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xml)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (xml->hasTagNameIgnoringNamespace ("linearGradient")
|
|
|
|
|
|
|| xml->hasTagNameIgnoringNamespace ("radialGradient"))
|
|
|
|
|
|
fillType = state->getGradientFillType (xml, *path, opacity);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
//==============================================================================
|
|
|
Drawable* parseSVGElement (const XmlPath& xml)
|
|
|
Drawable* parseSVGElement (const XmlPath& xml)
|
|
|
{
|
|
|
{
|
|
@@ -553,17 +602,6 @@ private: |
|
|
{
|
|
|
{
|
|
|
const String linkedID = link.substring (1);
|
|
|
const String linkedID = link.substring (1);
|
|
|
|
|
|
|
|
|
struct UsePathOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
Path* targetPath;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xmlPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->parsePathElement (xmlPath, *targetPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
UsePathOp op = { this, &path };
|
|
|
UsePathOp op = { this, &path };
|
|
|
topLevelXml.applyOperationToChildWithID (linkedID, op);
|
|
|
topLevelXml.applyOperationToChildWithID (linkedID, op);
|
|
|
}
|
|
|
}
|
|
@@ -692,17 +730,6 @@ private: |
|
|
|
|
|
|
|
|
if (urlID.isNotEmpty())
|
|
|
if (urlID.isNotEmpty())
|
|
|
{
|
|
|
{
|
|
|
struct GetClipPathOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
Drawable* target;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xmlPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->applyClipPath (*target, xmlPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
GetClipPathOp op = { this, &d };
|
|
|
GetClipPathOp op = { this, &d };
|
|
|
topLevelXml.applyOperationToChildWithID (urlID, op);
|
|
|
topLevelXml.applyOperationToChildWithID (urlID, op);
|
|
|
}
|
|
|
}
|
|
@@ -751,17 +778,6 @@ private: |
|
|
|
|
|
|
|
|
if (id.startsWithChar ('#'))
|
|
|
if (id.startsWithChar ('#'))
|
|
|
{
|
|
|
{
|
|
|
struct SetGradientStopsOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
ColourGradient* gradient;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xml)
|
|
|
|
|
|
{
|
|
|
|
|
|
state->addGradientStopsIn (*gradient, xml);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SetGradientStopsOp op = { this, &gradient, };
|
|
|
SetGradientStopsOp op = { this, &gradient, };
|
|
|
topLevelXml.applyOperationToChildWithID (id.substring (1), op);
|
|
|
topLevelXml.applyOperationToChildWithID (id.substring (1), op);
|
|
|
}
|
|
|
}
|
|
@@ -893,21 +909,6 @@ private: |
|
|
|
|
|
|
|
|
if (urlID.isNotEmpty())
|
|
|
if (urlID.isNotEmpty())
|
|
|
{
|
|
|
{
|
|
|
struct GetFillTypeOp
|
|
|
|
|
|
{
|
|
|
|
|
|
const SVGState* state;
|
|
|
|
|
|
const Path* path;
|
|
|
|
|
|
float opacity;
|
|
|
|
|
|
FillType fillType;
|
|
|
|
|
|
|
|
|
|
|
|
void operator() (const XmlPath& xml)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (xml->hasTagNameIgnoringNamespace ("linearGradient")
|
|
|
|
|
|
|| xml->hasTagNameIgnoringNamespace ("radialGradient"))
|
|
|
|
|
|
fillType = state->getGradientFillType (xml, *path, opacity);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
GetFillTypeOp op = { this, &path, opacity, FillType() };
|
|
|
GetFillTypeOp op = { this, &path, opacity, FillType() };
|
|
|
|
|
|
|
|
|
if (topLevelXml.applyOperationToChildWithID (urlID, op))
|
|
|
if (topLevelXml.applyOperationToChildWithID (urlID, op))
|
|
|