Browse Source

Add some minor changes to stay compatible with GCC 4.4

tags/2021-05-28
hogliux 9 years ago
parent
commit
6b6dedbfd1
2 changed files with 50 additions and 48 deletions
  1. +1
    -0
      modules/juce_core/juce_core.cpp
  2. +49
    -48
      modules/juce_gui_basics/drawables/juce_SVGParser.cpp

+ 1
- 0
modules/juce_core/juce_core.cpp View File

@@ -82,6 +82,7 @@
#endif #endif
#if JUCE_LINUX #if JUCE_LINUX
#include <stdio.h>
#include <langinfo.h> #include <langinfo.h>
#include <ifaddrs.h> #include <ifaddrs.h>
#include <sys/resource.h> #include <sys/resource.h>


+ 49
- 48
modules/juce_gui_basics/drawables/juce_SVGParser.cpp View File

@@ -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))


Loading…
Cancel
Save