LMMS
Loading...
Searching...
No Matches
juce::SVGState Class Reference

Classes

struct  XmlPath
struct  UsePathOp
struct  UseTextOp
struct  UseImageOp
struct  GetClipPathOp
struct  SetGradientStopsOp
struct  GetFillTypeOp

Public Member Functions

 SVGState (const XmlElement *topLevel, const File &svgFile={})
DrawableparseSVGElement (const XmlPath &xml)
void parsePathString (Path &path, const String &pathString) const

Private Member Functions

void parseSubElements (const XmlPath &xml, DrawableComposite &parentDrawable, bool shouldParseClip=true)
DrawableparseSubElement (const XmlPath &xml)
bool parsePathElement (const XmlPath &xml, Path &path) const
DrawableCompositeparseSwitch (const XmlPath &xml)
DrawableCompositeparseGroupElement (const XmlPath &xml, bool shouldParseTransform)
DrawableCompositeparseLinkElement (const XmlPath &xml)
void parsePath (const XmlPath &xml, Path &path) const
void parseRect (const XmlPath &xml, Path &rect) const
void parseCircle (const XmlPath &xml, Path &circle) const
void parseEllipse (const XmlPath &xml, Path &ellipse) const
void parseLine (const XmlPath &xml, Path &line) const
void parsePolygon (const XmlPath &xml, bool isPolyline, Path &path) const
bool parseUsePath (const XmlPath &xml, Path &path) const
DrawableparseUseOther (const XmlPath &xml) const
DrawableparseShape (const XmlPath &xml, Path &path, bool shouldParseTransform=true, AffineTransform *additonalTransform=nullptr) const
void parseDashArray (const String &dashList, DrawablePath &dp) const
bool parseClipPath (const XmlPath &xml, Drawable &d)
bool applyClipPath (Drawable &target, const XmlPath &xmlPath)
bool addGradientStopsIn (ColourGradient &cg, const XmlPath &fillXml) const
FillType getGradientFillType (const XmlPath &fillXml, const Path &path, const float opacity) const
FillType getPathFillType (const Path &path, const XmlPath &xml, StringRef fillAttribute, const String &fillOpacity, const String &overallOpacity, const Colour defaultColour) const
float getStrokeWidth (const String &strokeWidth) const noexcept
PathStrokeType getStrokeFor (const XmlPath &xml) const
DrawableuseText (const XmlPath &xml) const
DrawableparseText (const XmlPath &xml, bool shouldParseTransform, AffineTransform *additonalTransform=nullptr) const
Font getFont (const XmlPath &xml) const
DrawableuseImage (const XmlPath &xml) const
DrawableparseImage (const XmlPath &xml, bool shouldParseTransform, AffineTransform *additionalTransform=nullptr) const
void addTransform (const XmlPath &xml)
bool parseCoord (String::CharPointerType &s, float &value, bool allowUnits, bool isX) const
bool parseCoords (String::CharPointerType &s, Point< float > &p, bool allowUnits) const
bool parseCoordsOrSkip (String::CharPointerType &s, Point< float > &p, bool allowUnits) const
float getCoordLength (const String &s, const float sizeForProportions) const noexcept
float getCoordLength (const XmlPath &xml, const char *attName, const float sizeForProportions) const noexcept
void getCoordList (Array< float > &coords, const String &list, bool allowUnits, bool isX) const
void parseCSSStyle (const XmlPath &xml)
void parseDefs (const XmlPath &xml)
String getStyleAttribute (const XmlPath &xml, StringRef attributeName, const String &defaultValue=String()) const
String getInheritedAttribute (const XmlPath &xml, StringRef attributeName) const
Colour parseColour (const XmlPath &xml, StringRef attributeName, const Colour defaultColour) const
 SVGState (const SVGState &)=default
SVGStateoperator= (const SVGState &)=delete

Static Private Member Functions

static bool isNone (const String &s) noexcept
static void setCommonAttributes (Drawable &d, const XmlPath &xml)
static String getLinkedID (const XmlPath &xml)
static String parseURL (const String &str)
static bool pathContainsClosedSubPath (const Path &path) noexcept
static PathStrokeType::JointStyle getJointStyle (const String &join) noexcept
static PathStrokeType::EndCapStyle getEndCapStyle (const String &cap) noexcept
static float parseSafeFloat (const String &s)
static String::CharPointerType findStyleItem (String::CharPointerType source, String::CharPointerType name)
static int parsePlacementFlags (const String &align) noexcept
static bool isIdentifierChar (juce_wchar c)
static String getAttributeFromStyleList (const String &list, StringRef attributeName, const String &defaultValue)
static bool isStartOfNumber (juce_wchar c) noexcept
static bool parseNextNumber (String::CharPointerType &text, String &value, bool allowUnits)
static bool parseNextFlag (String::CharPointerType &text, bool &value)
static AffineTransform parseTransform (String t)
static void endpointToCentreParameters (double x1, double y1, double x2, double y2, double angle, bool largeArc, bool sweep, double &rx, double &ry, double &centreX, double &centreY, double &startAngle, double &deltaAngle) noexcept

Private Attributes

const File originalFile
const XmlPath topLevelXml
float width = 512
float height = 512
float viewBoxW = 0
float viewBoxH = 0
AffineTransform transform
String cssStyleText

Constructor & Destructor Documentation

◆ SVGState() [1/2]

juce::SVGState::SVGState ( const XmlElement * topLevel,
const File & svgFile = {} )
inlineexplicit

◆ SVGState() [2/2]

juce::SVGState::SVGState ( const SVGState & )
privatedefault

Member Function Documentation

◆ addGradientStopsIn()

bool juce::SVGState::addGradientStopsIn ( ColourGradient & cg,
const XmlPath & fillXml ) const
inlineprivate

◆ addTransform()

void juce::SVGState::addTransform ( const XmlPath & xml)
inlineprivate

◆ applyClipPath()

bool juce::SVGState::applyClipPath ( Drawable & target,
const XmlPath & xmlPath )
inlineprivate

◆ endpointToCentreParameters()

void juce::SVGState::endpointToCentreParameters ( double x1,
double y1,
double x2,
double y2,
double angle,
bool largeArc,
bool sweep,
double & rx,
double & ry,
double & centreX,
double & centreY,
double & startAngle,
double & deltaAngle )
inlinestaticprivatenoexcept

◆ findStyleItem()

String::CharPointerType juce::SVGState::findStyleItem ( String::CharPointerType source,
String::CharPointerType name )
inlinestaticprivate

◆ getAttributeFromStyleList()

String juce::SVGState::getAttributeFromStyleList ( const String & list,
StringRef attributeName,
const String & defaultValue )
inlinestaticprivate

◆ getCoordLength() [1/2]

float juce::SVGState::getCoordLength ( const String & s,
const float sizeForProportions ) const
inlineprivatenoexcept

◆ getCoordLength() [2/2]

float juce::SVGState::getCoordLength ( const XmlPath & xml,
const char * attName,
const float sizeForProportions ) const
inlineprivatenoexcept

◆ getCoordList()

void juce::SVGState::getCoordList ( Array< float > & coords,
const String & list,
bool allowUnits,
bool isX ) const
inlineprivate

◆ getEndCapStyle()

PathStrokeType::EndCapStyle juce::SVGState::getEndCapStyle ( const String & cap)
inlinestaticprivatenoexcept

◆ getFont()

Font juce::SVGState::getFont ( const XmlPath & xml) const
inlineprivate

◆ getGradientFillType()

FillType juce::SVGState::getGradientFillType ( const XmlPath & fillXml,
const Path & path,
const float opacity ) const
inlineprivate

◆ getInheritedAttribute()

String juce::SVGState::getInheritedAttribute ( const XmlPath & xml,
StringRef attributeName ) const
inlineprivate

◆ getJointStyle()

PathStrokeType::JointStyle juce::SVGState::getJointStyle ( const String & join)
inlinestaticprivatenoexcept

◆ getLinkedID()

String juce::SVGState::getLinkedID ( const XmlPath & xml)
inlinestaticprivate

◆ getPathFillType()

FillType juce::SVGState::getPathFillType ( const Path & path,
const XmlPath & xml,
StringRef fillAttribute,
const String & fillOpacity,
const String & overallOpacity,
const Colour defaultColour ) const
inlineprivate

◆ getStrokeFor()

PathStrokeType juce::SVGState::getStrokeFor ( const XmlPath & xml) const
inlineprivate

◆ getStrokeWidth()

float juce::SVGState::getStrokeWidth ( const String & strokeWidth) const
inlineprivatenoexcept

◆ getStyleAttribute()

String juce::SVGState::getStyleAttribute ( const XmlPath & xml,
StringRef attributeName,
const String & defaultValue = String() ) const
inlineprivate

◆ isIdentifierChar()

bool juce::SVGState::isIdentifierChar ( juce_wchar c)
inlinestaticprivate

◆ isNone()

bool juce::SVGState::isNone ( const String & s)
inlinestaticprivatenoexcept

◆ isStartOfNumber()

bool juce::SVGState::isStartOfNumber ( juce_wchar c)
inlinestaticprivatenoexcept

◆ operator=()

SVGState & juce::SVGState::operator= ( const SVGState & )
privatedelete

◆ parseCircle()

void juce::SVGState::parseCircle ( const XmlPath & xml,
Path & circle ) const
inlineprivate

◆ parseClipPath()

bool juce::SVGState::parseClipPath ( const XmlPath & xml,
Drawable & d )
inlineprivate

◆ parseColour()

Colour juce::SVGState::parseColour ( const XmlPath & xml,
StringRef attributeName,
const Colour defaultColour ) const
inlineprivate

◆ parseCoord()

bool juce::SVGState::parseCoord ( String::CharPointerType & s,
float & value,
bool allowUnits,
bool isX ) const
inlineprivate

◆ parseCoords()

bool juce::SVGState::parseCoords ( String::CharPointerType & s,
Point< float > & p,
bool allowUnits ) const
inlineprivate

◆ parseCoordsOrSkip()

bool juce::SVGState::parseCoordsOrSkip ( String::CharPointerType & s,
Point< float > & p,
bool allowUnits ) const
inlineprivate

◆ parseCSSStyle()

void juce::SVGState::parseCSSStyle ( const XmlPath & xml)
inlineprivate

◆ parseDashArray()

void juce::SVGState::parseDashArray ( const String & dashList,
DrawablePath & dp ) const
inlineprivate

◆ parseDefs()

void juce::SVGState::parseDefs ( const XmlPath & xml)
inlineprivate

◆ parseEllipse()

void juce::SVGState::parseEllipse ( const XmlPath & xml,
Path & ellipse ) const
inlineprivate

◆ parseGroupElement()

DrawableComposite * juce::SVGState::parseGroupElement ( const XmlPath & xml,
bool shouldParseTransform )
inlineprivate

◆ parseImage()

Drawable * juce::SVGState::parseImage ( const XmlPath & xml,
bool shouldParseTransform,
AffineTransform * additionalTransform = nullptr ) const
inlineprivate

◆ parseLine()

void juce::SVGState::parseLine ( const XmlPath & xml,
Path & line ) const
inlineprivate

◆ parseLinkElement()

DrawableComposite * juce::SVGState::parseLinkElement ( const XmlPath & xml)
inlineprivate

◆ parseNextFlag()

bool juce::SVGState::parseNextFlag ( String::CharPointerType & text,
bool & value )
inlinestaticprivate

◆ parseNextNumber()

bool juce::SVGState::parseNextNumber ( String::CharPointerType & text,
String & value,
bool allowUnits )
inlinestaticprivate

◆ parsePath()

void juce::SVGState::parsePath ( const XmlPath & xml,
Path & path ) const
inlineprivate

◆ parsePathElement()

bool juce::SVGState::parsePathElement ( const XmlPath & xml,
Path & path ) const
inlineprivate

◆ parsePathString()

void juce::SVGState::parsePathString ( Path & path,
const String & pathString ) const
inline

◆ parsePlacementFlags()

int juce::SVGState::parsePlacementFlags ( const String & align)
inlinestaticprivatenoexcept

◆ parsePolygon()

void juce::SVGState::parsePolygon ( const XmlPath & xml,
bool isPolyline,
Path & path ) const
inlineprivate

◆ parseRect()

void juce::SVGState::parseRect ( const XmlPath & xml,
Path & rect ) const
inlineprivate

◆ parseSafeFloat()

float juce::SVGState::parseSafeFloat ( const String & s)
inlinestaticprivate

◆ parseShape()

Drawable * juce::SVGState::parseShape ( const XmlPath & xml,
Path & path,
bool shouldParseTransform = true,
AffineTransform * additonalTransform = nullptr ) const
inlineprivate

◆ parseSubElement()

Drawable * juce::SVGState::parseSubElement ( const XmlPath & xml)
inlineprivate

◆ parseSubElements()

void juce::SVGState::parseSubElements ( const XmlPath & xml,
DrawableComposite & parentDrawable,
bool shouldParseClip = true )
inlineprivate

◆ parseSVGElement()

Drawable * juce::SVGState::parseSVGElement ( const XmlPath & xml)
inline

◆ parseSwitch()

DrawableComposite * juce::SVGState::parseSwitch ( const XmlPath & xml)
inlineprivate

◆ parseText()

Drawable * juce::SVGState::parseText ( const XmlPath & xml,
bool shouldParseTransform,
AffineTransform * additonalTransform = nullptr ) const
inlineprivate

◆ parseTransform()

AffineTransform juce::SVGState::parseTransform ( String t)
inlinestaticprivate

◆ parseURL()

String juce::SVGState::parseURL ( const String & str)
inlinestaticprivate

◆ parseUseOther()

Drawable * juce::SVGState::parseUseOther ( const XmlPath & xml) const
inlineprivate

◆ parseUsePath()

bool juce::SVGState::parseUsePath ( const XmlPath & xml,
Path & path ) const
inlineprivate

◆ pathContainsClosedSubPath()

bool juce::SVGState::pathContainsClosedSubPath ( const Path & path)
inlinestaticprivatenoexcept

◆ setCommonAttributes()

void juce::SVGState::setCommonAttributes ( Drawable & d,
const XmlPath & xml )
inlinestaticprivate

◆ useImage()

Drawable * juce::SVGState::useImage ( const XmlPath & xml) const
inlineprivate

◆ useText()

Drawable * juce::SVGState::useText ( const XmlPath & xml) const
inlineprivate

Member Data Documentation

◆ cssStyleText

String juce::SVGState::cssStyleText
private

◆ height

float juce::SVGState::height = 512
private

◆ originalFile

const File juce::SVGState::originalFile
private

◆ topLevelXml

const XmlPath juce::SVGState::topLevelXml
private

◆ transform

AffineTransform juce::SVGState::transform
private

◆ viewBoxH

float juce::SVGState::viewBoxH = 0
private

◆ viewBoxW

float juce::SVGState::viewBoxW = 0
private

◆ width

float juce::SVGState::width = 512
private

The documentation for this class was generated from the following file: