Compare commits

...

16 Commits

Author SHA1 Message Date
Curtis Hard 775e5c15a0 Performance increases and modern syntax things 2019-12-02 22:30:52 +00:00
Curtis Hard abd19c78dd This updates formatting to meet the WebKit standard 2019-12-02 21:05:12 +00:00
Curtis Hard 29090f30f9 Fixes stuff 2019-11-28 21:56:56 +00:00
Curtis Hard e2a2fc615c Fixes warning about commas 2019-11-28 20:33:04 +00:00
Curtis Hard 5466e0f2ec More framework stuff 2019-11-28 13:26:37 +00:00
Curtis Hard c2f0c25913 Updated framework stuff 2019-11-28 13:21:08 +00:00
Curtis Hard cddc9554b4 Start of framework 2019-11-28 12:36:14 +00:00
Curtis Hard ffdbe1ec9c Fixes userSpaceOnUse for masks and clipPaths 2019-11-27 22:08:12 +00:00
Curtis Hard 63586f1181 Reformat 2019-11-18 22:57:55 +00:00
Curtis Hard dc94d9761b Fixes subcommands, this is fairly big bug… 2019-11-18 22:55:44 +00:00
Curtis Hard 8deef07f7f Merge branch 'feature/primitive-colors' of https://github.com/curthard89/IJSVG into feature/primitive-colors 2019-10-24 19:31:54 +01:00
Curtis Hard 2c962db6cc Refactoring of commands 2019-10-24 19:31:51 +01:00
Curtis Hard 9dda7915fa Fixes shorthand 2019-10-22 14:11:12 +01:00
Curtis Hard 1fbb56b443 Fixes shorthand not working correctly 2019-10-22 14:10:23 +01:00
Curtis Hard 4bbf2277bc Fixes exporter 2019-10-20 18:50:34 +01:00
Curtis Hard 7eeeea5167 Adds support for RRGGBBAA 2019-10-20 17:07:07 +01:00
114 changed files with 6450 additions and 5554 deletions
@@ -0,0 +1,813 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
594CF55F238FF462009B251B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594CF55E238FF462009B251B /* AppKit.framework */; };
594CF561238FF46C009B251B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594CF560238FF46C009B251B /* Foundation.framework */; };
594CF563238FF473009B251B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594CF562238FF473009B251B /* QuartzCore.framework */; };
599EB4D3238FF570004CB6BC /* libobjc.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 599EB4D2238FF535004CB6BC /* libobjc.tbd */; };
59EB75D623905F7300F5AE63 /* IJSVGLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756523905F6B00F5AE63 /* IJSVGLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75D723905F7300F5AE63 /* IJSVGGradientLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756623905F6B00F5AE63 /* IJSVGGradientLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75D823905F7300F5AE63 /* IJSVGStyleSheetRule.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB756723905F6B00F5AE63 /* IJSVGStyleSheetRule.m */; };
59EB75D923905F7300F5AE63 /* IJSVGCommandLineTo.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756823905F6B00F5AE63 /* IJSVGCommandLineTo.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75DA23905F7300F5AE63 /* IJSVGDef.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB756923905F6B00F5AE63 /* IJSVGDef.m */; };
59EB75DB23905F7300F5AE63 /* IJSVG.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756A23905F6B00F5AE63 /* IJSVG.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75DC23905F7300F5AE63 /* IJSVGText.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756B23905F6B00F5AE63 /* IJSVGText.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75DD23905F7300F5AE63 /* IJSVGCommandQuadraticCurve.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB756C23905F6B00F5AE63 /* IJSVGCommandQuadraticCurve.m */; };
59EB75DE23905F7300F5AE63 /* IJSVGCommandVerticalLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756D23905F6C00F5AE63 /* IJSVGCommandVerticalLine.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75DF23905F7300F5AE63 /* IJSVGWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756E23905F6C00F5AE63 /* IJSVGWriter.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E023905F7300F5AE63 /* IJSVGStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB756F23905F6C00F5AE63 /* IJSVGStyleSheet.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E123905F7300F5AE63 /* IJSVGCommandSmoothCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757023905F6C00F5AE63 /* IJSVGCommandSmoothCurve.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E223905F7300F5AE63 /* IJSVGColorList.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757123905F6C00F5AE63 /* IJSVGColorList.m */; };
59EB75E323905F7300F5AE63 /* IJSVGRadialGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757223905F6C00F5AE63 /* IJSVGRadialGradient.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E423905F7300F5AE63 /* IJSVGGradientUnitLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757323905F6C00F5AE63 /* IJSVGGradientUnitLength.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E523905F7300F5AE63 /* IJSVGStrokeLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757423905F6C00F5AE63 /* IJSVGStrokeLayer.m */; };
59EB75E623905F7300F5AE63 /* IJSVGStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757523905F6C00F5AE63 /* IJSVGStyle.m */; };
59EB75E723905F7300F5AE63 /* IJSVGImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757623905F6C00F5AE63 /* IJSVGImage.m */; };
59EB75E823905F7300F5AE63 /* IJSVGUnitLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757723905F6C00F5AE63 /* IJSVGUnitLength.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75E923905F7300F5AE63 /* IJSVGStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757823905F6C00F5AE63 /* IJSVGStringAdditions.m */; };
59EB75EA23905F7300F5AE63 /* IJSVGTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757923905F6C00F5AE63 /* IJSVGTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75EB23905F7300F5AE63 /* IJSVGShapeLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757A23905F6C00F5AE63 /* IJSVGShapeLayer.m */; };
59EB75EC23905F7300F5AE63 /* IJSVGLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757B23905F6C00F5AE63 /* IJSVGLayer.m */; };
59EB75ED23905F7300F5AE63 /* IJSVGFontConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757C23905F6C00F5AE63 /* IJSVGFontConverter.m */; };
59EB75EE23905F7300F5AE63 /* IJSVGImageRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB757D23905F6C00F5AE63 /* IJSVGImageRep.m */; };
59EB75EF23905F7300F5AE63 /* IJSVGCommandQuadraticCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757E23905F6C00F5AE63 /* IJSVGCommandQuadraticCurve.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75F023905F7300F5AE63 /* IJSVGStyleSheetSelectorRaw.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB757F23905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75F123905F7300F5AE63 /* IJSVGUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758023905F6C00F5AE63 /* IJSVGUtils.m */; };
59EB75F223905F7300F5AE63 /* IJSVGStyleSheetSelectorRaw.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758123905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.m */; };
59EB75F323905F7300F5AE63 /* IJSVGGroupLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758223905F6C00F5AE63 /* IJSVGGroupLayer.m */; };
59EB75F423905F7300F5AE63 /* IJSVGColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB758323905F6C00F5AE63 /* IJSVGColor.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75F523905F7300F5AE63 /* IJSVGError.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB758423905F6C00F5AE63 /* IJSVGError.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75F623905F7300F5AE63 /* IJSVGColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758523905F6C00F5AE63 /* IJSVGColor.m */; };
59EB75F723905F7300F5AE63 /* IJSVGDef.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB758623905F6C00F5AE63 /* IJSVGDef.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75F823905F7300F5AE63 /* IJSVGCommandHorizontalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758723905F6C00F5AE63 /* IJSVGCommandHorizontalLine.m */; };
59EB75F923905F7300F5AE63 /* IJSVGFontConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB758823905F6D00F5AE63 /* IJSVGFontConverter.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75FA23905F7300F5AE63 /* IJSVGWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758923905F6D00F5AE63 /* IJSVGWriter.m */; };
59EB75FB23905F7300F5AE63 /* IJSVGPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758A23905F6D00F5AE63 /* IJSVGPath.m */; };
59EB75FC23905F7300F5AE63 /* IJSVGGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB758B23905F6D00F5AE63 /* IJSVGGroup.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB75FD23905F7300F5AE63 /* IJSVGPatternLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758C23905F6D00F5AE63 /* IJSVGPatternLayer.m */; };
59EB75FE23905F7300F5AE63 /* IJSVGRenderingStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758D23905F6D00F5AE63 /* IJSVGRenderingStyle.m */; };
59EB75FF23905F7300F5AE63 /* IJSVGBezierPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758E23905F6D00F5AE63 /* IJSVGBezierPathAdditions.m */; };
59EB760023905F7300F5AE63 /* IJSVGGradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB758F23905F6D00F5AE63 /* IJSVGGradientLayer.m */; };
59EB760123905F7300F5AE63 /* IJSVGLayerTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759023905F6D00F5AE63 /* IJSVGLayerTree.m */; };
59EB760223905F7300F5AE63 /* IJSVGCommandVerticalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759123905F6D00F5AE63 /* IJSVGCommandVerticalLine.m */; };
59EB760323905F7300F5AE63 /* IJSVGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759223905F6D00F5AE63 /* IJSVGNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760423905F7300F5AE63 /* IJSVGCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759323905F6D00F5AE63 /* IJSVGCache.m */; };
59EB760523905F7300F5AE63 /* IJSVGUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759423905F6D00F5AE63 /* IJSVGUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760623905F7300F5AE63 /* IJSVGCommandHorizontalLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759523905F6D00F5AE63 /* IJSVGCommandHorizontalLine.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760723905F7300F5AE63 /* IJSVGNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759623905F6D00F5AE63 /* IJSVGNode.m */; };
59EB760823905F7300F5AE63 /* IJSVGShapeLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759723905F6D00F5AE63 /* IJSVGShapeLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760923905F7300F5AE63 /* IJSVGCommandCurve.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759823905F6E00F5AE63 /* IJSVGCommandCurve.m */; };
59EB760A23905F7300F5AE63 /* IJSVGCommandMove.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB759923905F6E00F5AE63 /* IJSVGCommandMove.m */; };
59EB760B23905F7300F5AE63 /* IJSVGStyleSheetSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759A23905F6E00F5AE63 /* IJSVGStyleSheetSelector.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760C23905F7300F5AE63 /* IJSVGStyleSheetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759B23905F6E00F5AE63 /* IJSVGStyleSheetRule.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760D23905F7300F5AE63 /* IJSVGCommandCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759C23905F6E00F5AE63 /* IJSVGCommandCurve.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760E23905F7300F5AE63 /* IJSVGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759D23905F6E00F5AE63 /* IJSVGPath.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB760F23905F7300F5AE63 /* IJSVGCommandEllipticalArc.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759E23905F6E00F5AE63 /* IJSVGCommandEllipticalArc.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761023905F7300F5AE63 /* IJSVGLinearGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB759F23905F6E00F5AE63 /* IJSVGLinearGradient.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761123905F7300F5AE63 /* IJSVGCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75A023905F6E00F5AE63 /* IJSVGCommand.m */; };
59EB761223905F7300F5AE63 /* IJSVGRenderingStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75A123905F6E00F5AE63 /* IJSVGRenderingStyle.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761323905F7300F5AE63 /* IJSVG.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75A223905F6E00F5AE63 /* IJSVG.m */; };
59EB761423905F7300F5AE63 /* IJSVGImageRep.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75A323905F6E00F5AE63 /* IJSVGImageRep.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761523905F7300F5AE63 /* IJSVGStrokeLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75A423905F6E00F5AE63 /* IJSVGStrokeLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761623905F7300F5AE63 /* IJSVGParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75A523905F6E00F5AE63 /* IJSVGParser.m */; };
59EB761723905F7300F5AE63 /* IJSVGRadialGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75A623905F6F00F5AE63 /* IJSVGRadialGradient.m */; };
59EB761823905F7300F5AE63 /* IJSVGParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75A723905F6F00F5AE63 /* IJSVGParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761923905F7300F5AE63 /* IJSVGCommandSmoothCurve.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75A823905F6F00F5AE63 /* IJSVGCommandSmoothCurve.m */; };
59EB761A23905F7300F5AE63 /* IJSVGColorList.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75A923905F6F00F5AE63 /* IJSVGColorList.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761B23905F7300F5AE63 /* IJSVGPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75AA23905F6F00F5AE63 /* IJSVGPattern.m */; };
59EB761C23905F7300F5AE63 /* IJSVGGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75AB23905F6F00F5AE63 /* IJSVGGradient.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761D23905F7300F5AE63 /* IJSVGStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75AC23905F6F00F5AE63 /* IJSVGStyle.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761E23905F7300F5AE63 /* IJSVGGroupLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75AD23905F6F00F5AE63 /* IJSVGGroupLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB761F23905F7300F5AE63 /* IJSVGCommandLineTo.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75AE23905F6F00F5AE63 /* IJSVGCommandLineTo.m */; };
59EB762023905F7300F5AE63 /* IJSVGCommandMove.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75AF23905F6F00F5AE63 /* IJSVGCommandMove.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762123905F7300F5AE63 /* IJSVGTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B023905F6F00F5AE63 /* IJSVGTransform.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762223905F7300F5AE63 /* IJSVGMath.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75B123905F6F00F5AE63 /* IJSVGMath.m */; };
59EB762323905F7300F5AE63 /* IJSVGExporterPathInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B223905F6F00F5AE63 /* IJSVGExporterPathInstruction.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762423905F7300F5AE63 /* IJSVGTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75B323905F6F00F5AE63 /* IJSVGTransaction.m */; };
59EB762523905F7300F5AE63 /* IJSVGTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75B423905F6F00F5AE63 /* IJSVGTransform.m */; };
59EB762623905F7300F5AE63 /* IJSVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B523905F7000F5AE63 /* IJSVGImage.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762723905F7300F5AE63 /* IJSVGMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B623905F7000F5AE63 /* IJSVGMath.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762823905F7300F5AE63 /* IJSVGCommandClose.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B723905F7000F5AE63 /* IJSVGCommandClose.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762923905F7300F5AE63 /* IJSVGStringAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75B823905F7000F5AE63 /* IJSVGStringAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762A23905F7300F5AE63 /* IJSVGGradientUnitLength.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75B923905F7000F5AE63 /* IJSVGGradientUnitLength.m */; };
59EB762B23905F7300F5AE63 /* IJSVGUnitLength.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75BA23905F7000F5AE63 /* IJSVGUnitLength.m */; };
59EB762C23905F7300F5AE63 /* IJSVGPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75BB23905F7000F5AE63 /* IJSVGPattern.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762D23905F7300F5AE63 /* IJSVGLayerTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75BC23905F7000F5AE63 /* IJSVGLayerTree.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB762E23905F7300F5AE63 /* IJSVGExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75BD23905F7000F5AE63 /* IJSVGExporter.m */; };
59EB762F23905F7300F5AE63 /* IJSVGCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75BE23905F7000F5AE63 /* IJSVGCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763023905F7300F5AE63 /* IJSVGPatternLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75BF23905F7000F5AE63 /* IJSVGPatternLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763123905F7300F5AE63 /* IJSVGText.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C023905F7100F5AE63 /* IJSVGText.m */; };
59EB763223905F7300F5AE63 /* IJSVGView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C123905F7100F5AE63 /* IJSVGView.m */; };
59EB763323905F7300F5AE63 /* IJSVGLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C223905F7100F5AE63 /* IJSVGLinearGradient.m */; };
59EB763423905F7300F5AE63 /* IJSVGBezierPathAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75C323905F7100F5AE63 /* IJSVGBezierPathAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763523905F7300F5AE63 /* IJSVGStyleSheetSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C423905F7100F5AE63 /* IJSVGStyleSheetSelector.m */; };
59EB763623905F7300F5AE63 /* IJSVGImageLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C523905F7100F5AE63 /* IJSVGImageLayer.m */; };
59EB763723905F7300F5AE63 /* IJSVGCommandClose.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C623905F7100F5AE63 /* IJSVGCommandClose.m */; };
59EB763823905F7300F5AE63 /* IJSVGCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75C723905F7100F5AE63 /* IJSVGCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763923905F7300F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C823905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m */; };
59EB763A23905F7300F5AE63 /* IJSVGForeignObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75C923905F7200F5AE63 /* IJSVGForeignObject.m */; };
59EB763B23905F7300F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75CA23905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763C23905F7300F5AE63 /* IJSVGCommandEllipticalArc.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75CB23905F7200F5AE63 /* IJSVGCommandEllipticalArc.m */; };
59EB763D23905F7300F5AE63 /* IJSVGGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75CC23905F7200F5AE63 /* IJSVGGroup.m */; };
59EB763E23905F7300F5AE63 /* IJSVGView.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75CD23905F7200F5AE63 /* IJSVGView.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB763F23905F7300F5AE63 /* IJSVGForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75CE23905F7200F5AE63 /* IJSVGForeignObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB764023905F7300F5AE63 /* IJSVGExporterPathInstruction.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75CF23905F7200F5AE63 /* IJSVGExporterPathInstruction.m */; };
59EB764123905F7300F5AE63 /* IJSVGImageLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75D023905F7200F5AE63 /* IJSVGImageLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB764223905F7300F5AE63 /* IJSVGStyleSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75D123905F7300F5AE63 /* IJSVGStyleSheet.m */; };
59EB764323905F7300F5AE63 /* IJSVGGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75D223905F7300F5AE63 /* IJSVGGradient.m */; };
59EB764423905F7300F5AE63 /* IJSVGRendering.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75D323905F7300F5AE63 /* IJSVGRendering.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB764523905F7300F5AE63 /* IJSVGExporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EB75D423905F7300F5AE63 /* IJSVGExporter.h */; settings = {ATTRIBUTES = (Public, ); }; };
59EB764623905F7300F5AE63 /* IJSVGRendering.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EB75D523905F7300F5AE63 /* IJSVGRendering.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
594CF46F238FF38E009B251B /* IJSVG.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IJSVG.framework; sourceTree = BUILT_PRODUCTS_DIR; };
594CF473238FF38E009B251B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
594CF55E238FF462009B251B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
594CF560238FF46C009B251B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
594CF562238FF473009B251B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
599EB4D2238FF535004CB6BC /* libobjc.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libobjc.tbd; path = usr/lib/libobjc.tbd; sourceTree = SDKROOT; };
59EB756523905F6B00F5AE63 /* IJSVGLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGLayer.h; path = ../../../../source/IJSVGLayer.h; sourceTree = "<group>"; };
59EB756623905F6B00F5AE63 /* IJSVGGradientLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGGradientLayer.h; path = ../../../../source/IJSVGGradientLayer.h; sourceTree = "<group>"; };
59EB756723905F6B00F5AE63 /* IJSVGStyleSheetRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStyleSheetRule.m; path = ../../../../source/IJSVGStyleSheetRule.m; sourceTree = "<group>"; };
59EB756823905F6B00F5AE63 /* IJSVGCommandLineTo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandLineTo.h; path = ../../../../source/IJSVGCommandLineTo.h; sourceTree = "<group>"; };
59EB756923905F6B00F5AE63 /* IJSVGDef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGDef.m; path = ../../../../source/IJSVGDef.m; sourceTree = "<group>"; };
59EB756A23905F6B00F5AE63 /* IJSVG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVG.h; path = ../../../../source/IJSVG.h; sourceTree = "<group>"; };
59EB756B23905F6B00F5AE63 /* IJSVGText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGText.h; path = ../../../../source/IJSVGText.h; sourceTree = "<group>"; };
59EB756C23905F6B00F5AE63 /* IJSVGCommandQuadraticCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandQuadraticCurve.m; path = ../../../../source/IJSVGCommandQuadraticCurve.m; sourceTree = "<group>"; };
59EB756D23905F6C00F5AE63 /* IJSVGCommandVerticalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandVerticalLine.h; path = ../../../../source/IJSVGCommandVerticalLine.h; sourceTree = "<group>"; };
59EB756E23905F6C00F5AE63 /* IJSVGWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGWriter.h; path = ../../../../source/IJSVGWriter.h; sourceTree = "<group>"; };
59EB756F23905F6C00F5AE63 /* IJSVGStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStyleSheet.h; path = ../../../../source/IJSVGStyleSheet.h; sourceTree = "<group>"; };
59EB757023905F6C00F5AE63 /* IJSVGCommandSmoothCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandSmoothCurve.h; path = ../../../../source/IJSVGCommandSmoothCurve.h; sourceTree = "<group>"; };
59EB757123905F6C00F5AE63 /* IJSVGColorList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGColorList.m; path = ../../../../source/IJSVGColorList.m; sourceTree = "<group>"; };
59EB757223905F6C00F5AE63 /* IJSVGRadialGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGRadialGradient.h; path = ../../../../source/IJSVGRadialGradient.h; sourceTree = "<group>"; };
59EB757323905F6C00F5AE63 /* IJSVGGradientUnitLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGGradientUnitLength.h; path = ../../../../source/IJSVGGradientUnitLength.h; sourceTree = "<group>"; };
59EB757423905F6C00F5AE63 /* IJSVGStrokeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStrokeLayer.m; path = ../../../../source/IJSVGStrokeLayer.m; sourceTree = "<group>"; };
59EB757523905F6C00F5AE63 /* IJSVGStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStyle.m; path = ../../../../source/IJSVGStyle.m; sourceTree = "<group>"; };
59EB757623905F6C00F5AE63 /* IJSVGImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGImage.m; path = ../../../../source/IJSVGImage.m; sourceTree = "<group>"; };
59EB757723905F6C00F5AE63 /* IJSVGUnitLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGUnitLength.h; path = ../../../../source/IJSVGUnitLength.h; sourceTree = "<group>"; };
59EB757823905F6C00F5AE63 /* IJSVGStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStringAdditions.m; path = ../../../../source/IJSVGStringAdditions.m; sourceTree = "<group>"; };
59EB757923905F6C00F5AE63 /* IJSVGTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGTransaction.h; path = ../../../../source/IJSVGTransaction.h; sourceTree = "<group>"; };
59EB757A23905F6C00F5AE63 /* IJSVGShapeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGShapeLayer.m; path = ../../../../source/IJSVGShapeLayer.m; sourceTree = "<group>"; };
59EB757B23905F6C00F5AE63 /* IJSVGLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGLayer.m; path = ../../../../source/IJSVGLayer.m; sourceTree = "<group>"; };
59EB757C23905F6C00F5AE63 /* IJSVGFontConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGFontConverter.m; path = ../../../../source/IJSVGFontConverter.m; sourceTree = "<group>"; };
59EB757D23905F6C00F5AE63 /* IJSVGImageRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGImageRep.m; path = ../../../../source/IJSVGImageRep.m; sourceTree = "<group>"; };
59EB757E23905F6C00F5AE63 /* IJSVGCommandQuadraticCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandQuadraticCurve.h; path = ../../../../source/IJSVGCommandQuadraticCurve.h; sourceTree = "<group>"; };
59EB757F23905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStyleSheetSelectorRaw.h; path = ../../../../source/IJSVGStyleSheetSelectorRaw.h; sourceTree = "<group>"; };
59EB758023905F6C00F5AE63 /* IJSVGUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGUtils.m; path = ../../../../source/IJSVGUtils.m; sourceTree = "<group>"; };
59EB758123905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStyleSheetSelectorRaw.m; path = ../../../../source/IJSVGStyleSheetSelectorRaw.m; sourceTree = "<group>"; };
59EB758223905F6C00F5AE63 /* IJSVGGroupLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGGroupLayer.m; path = ../../../../source/IJSVGGroupLayer.m; sourceTree = "<group>"; };
59EB758323905F6C00F5AE63 /* IJSVGColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGColor.h; path = ../../../../source/IJSVGColor.h; sourceTree = "<group>"; };
59EB758423905F6C00F5AE63 /* IJSVGError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGError.h; path = ../../../../source/IJSVGError.h; sourceTree = "<group>"; };
59EB758523905F6C00F5AE63 /* IJSVGColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGColor.m; path = ../../../../source/IJSVGColor.m; sourceTree = "<group>"; };
59EB758623905F6C00F5AE63 /* IJSVGDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGDef.h; path = ../../../../source/IJSVGDef.h; sourceTree = "<group>"; };
59EB758723905F6C00F5AE63 /* IJSVGCommandHorizontalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandHorizontalLine.m; path = ../../../../source/IJSVGCommandHorizontalLine.m; sourceTree = "<group>"; };
59EB758823905F6D00F5AE63 /* IJSVGFontConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGFontConverter.h; path = ../../../../source/IJSVGFontConverter.h; sourceTree = "<group>"; };
59EB758923905F6D00F5AE63 /* IJSVGWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGWriter.m; path = ../../../../source/IJSVGWriter.m; sourceTree = "<group>"; };
59EB758A23905F6D00F5AE63 /* IJSVGPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGPath.m; path = ../../../../source/IJSVGPath.m; sourceTree = "<group>"; };
59EB758B23905F6D00F5AE63 /* IJSVGGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGGroup.h; path = ../../../../source/IJSVGGroup.h; sourceTree = "<group>"; };
59EB758C23905F6D00F5AE63 /* IJSVGPatternLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGPatternLayer.m; path = ../../../../source/IJSVGPatternLayer.m; sourceTree = "<group>"; };
59EB758D23905F6D00F5AE63 /* IJSVGRenderingStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGRenderingStyle.m; path = ../../../../source/IJSVGRenderingStyle.m; sourceTree = "<group>"; };
59EB758E23905F6D00F5AE63 /* IJSVGBezierPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGBezierPathAdditions.m; path = ../../../../source/IJSVGBezierPathAdditions.m; sourceTree = "<group>"; };
59EB758F23905F6D00F5AE63 /* IJSVGGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGGradientLayer.m; path = ../../../../source/IJSVGGradientLayer.m; sourceTree = "<group>"; };
59EB759023905F6D00F5AE63 /* IJSVGLayerTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGLayerTree.m; path = ../../../../source/IJSVGLayerTree.m; sourceTree = "<group>"; };
59EB759123905F6D00F5AE63 /* IJSVGCommandVerticalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandVerticalLine.m; path = ../../../../source/IJSVGCommandVerticalLine.m; sourceTree = "<group>"; };
59EB759223905F6D00F5AE63 /* IJSVGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGNode.h; path = ../../../../source/IJSVGNode.h; sourceTree = "<group>"; };
59EB759323905F6D00F5AE63 /* IJSVGCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCache.m; path = ../../../../source/IJSVGCache.m; sourceTree = "<group>"; };
59EB759423905F6D00F5AE63 /* IJSVGUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGUtils.h; path = ../../../../source/IJSVGUtils.h; sourceTree = "<group>"; };
59EB759523905F6D00F5AE63 /* IJSVGCommandHorizontalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandHorizontalLine.h; path = ../../../../source/IJSVGCommandHorizontalLine.h; sourceTree = "<group>"; };
59EB759623905F6D00F5AE63 /* IJSVGNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGNode.m; path = ../../../../source/IJSVGNode.m; sourceTree = "<group>"; };
59EB759723905F6D00F5AE63 /* IJSVGShapeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGShapeLayer.h; path = ../../../../source/IJSVGShapeLayer.h; sourceTree = "<group>"; };
59EB759823905F6E00F5AE63 /* IJSVGCommandCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandCurve.m; path = ../../../../source/IJSVGCommandCurve.m; sourceTree = "<group>"; };
59EB759923905F6E00F5AE63 /* IJSVGCommandMove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandMove.m; path = ../../../../source/IJSVGCommandMove.m; sourceTree = "<group>"; };
59EB759A23905F6E00F5AE63 /* IJSVGStyleSheetSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStyleSheetSelector.h; path = ../../../../source/IJSVGStyleSheetSelector.h; sourceTree = "<group>"; };
59EB759B23905F6E00F5AE63 /* IJSVGStyleSheetRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStyleSheetRule.h; path = ../../../../source/IJSVGStyleSheetRule.h; sourceTree = "<group>"; };
59EB759C23905F6E00F5AE63 /* IJSVGCommandCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandCurve.h; path = ../../../../source/IJSVGCommandCurve.h; sourceTree = "<group>"; };
59EB759D23905F6E00F5AE63 /* IJSVGPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGPath.h; path = ../../../../source/IJSVGPath.h; sourceTree = "<group>"; };
59EB759E23905F6E00F5AE63 /* IJSVGCommandEllipticalArc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandEllipticalArc.h; path = ../../../../source/IJSVGCommandEllipticalArc.h; sourceTree = "<group>"; };
59EB759F23905F6E00F5AE63 /* IJSVGLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGLinearGradient.h; path = ../../../../source/IJSVGLinearGradient.h; sourceTree = "<group>"; };
59EB75A023905F6E00F5AE63 /* IJSVGCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommand.m; path = ../../../../source/IJSVGCommand.m; sourceTree = "<group>"; };
59EB75A123905F6E00F5AE63 /* IJSVGRenderingStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGRenderingStyle.h; path = ../../../../source/IJSVGRenderingStyle.h; sourceTree = "<group>"; };
59EB75A223905F6E00F5AE63 /* IJSVG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVG.m; path = ../../../../source/IJSVG.m; sourceTree = "<group>"; };
59EB75A323905F6E00F5AE63 /* IJSVGImageRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGImageRep.h; path = ../../../../source/IJSVGImageRep.h; sourceTree = "<group>"; };
59EB75A423905F6E00F5AE63 /* IJSVGStrokeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStrokeLayer.h; path = ../../../../source/IJSVGStrokeLayer.h; sourceTree = "<group>"; };
59EB75A523905F6E00F5AE63 /* IJSVGParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGParser.m; path = ../../../../source/IJSVGParser.m; sourceTree = "<group>"; };
59EB75A623905F6F00F5AE63 /* IJSVGRadialGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGRadialGradient.m; path = ../../../../source/IJSVGRadialGradient.m; sourceTree = "<group>"; };
59EB75A723905F6F00F5AE63 /* IJSVGParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGParser.h; path = ../../../../source/IJSVGParser.h; sourceTree = "<group>"; };
59EB75A823905F6F00F5AE63 /* IJSVGCommandSmoothCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandSmoothCurve.m; path = ../../../../source/IJSVGCommandSmoothCurve.m; sourceTree = "<group>"; };
59EB75A923905F6F00F5AE63 /* IJSVGColorList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGColorList.h; path = ../../../../source/IJSVGColorList.h; sourceTree = "<group>"; };
59EB75AA23905F6F00F5AE63 /* IJSVGPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGPattern.m; path = ../../../../source/IJSVGPattern.m; sourceTree = "<group>"; };
59EB75AB23905F6F00F5AE63 /* IJSVGGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGGradient.h; path = ../../../../source/IJSVGGradient.h; sourceTree = "<group>"; };
59EB75AC23905F6F00F5AE63 /* IJSVGStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStyle.h; path = ../../../../source/IJSVGStyle.h; sourceTree = "<group>"; };
59EB75AD23905F6F00F5AE63 /* IJSVGGroupLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGGroupLayer.h; path = ../../../../source/IJSVGGroupLayer.h; sourceTree = "<group>"; };
59EB75AE23905F6F00F5AE63 /* IJSVGCommandLineTo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandLineTo.m; path = ../../../../source/IJSVGCommandLineTo.m; sourceTree = "<group>"; };
59EB75AF23905F6F00F5AE63 /* IJSVGCommandMove.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandMove.h; path = ../../../../source/IJSVGCommandMove.h; sourceTree = "<group>"; };
59EB75B023905F6F00F5AE63 /* IJSVGTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGTransform.h; path = ../../../../source/IJSVGTransform.h; sourceTree = "<group>"; };
59EB75B123905F6F00F5AE63 /* IJSVGMath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGMath.m; path = ../../../../source/IJSVGMath.m; sourceTree = "<group>"; };
59EB75B223905F6F00F5AE63 /* IJSVGExporterPathInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGExporterPathInstruction.h; path = ../../../../source/IJSVGExporterPathInstruction.h; sourceTree = "<group>"; };
59EB75B323905F6F00F5AE63 /* IJSVGTransaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGTransaction.m; path = ../../../../source/IJSVGTransaction.m; sourceTree = "<group>"; };
59EB75B423905F6F00F5AE63 /* IJSVGTransform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGTransform.m; path = ../../../../source/IJSVGTransform.m; sourceTree = "<group>"; };
59EB75B523905F7000F5AE63 /* IJSVGImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGImage.h; path = ../../../../source/IJSVGImage.h; sourceTree = "<group>"; };
59EB75B623905F7000F5AE63 /* IJSVGMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGMath.h; path = ../../../../source/IJSVGMath.h; sourceTree = "<group>"; };
59EB75B723905F7000F5AE63 /* IJSVGCommandClose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandClose.h; path = ../../../../source/IJSVGCommandClose.h; sourceTree = "<group>"; };
59EB75B823905F7000F5AE63 /* IJSVGStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGStringAdditions.h; path = ../../../../source/IJSVGStringAdditions.h; sourceTree = "<group>"; };
59EB75B923905F7000F5AE63 /* IJSVGGradientUnitLength.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGGradientUnitLength.m; path = ../../../../source/IJSVGGradientUnitLength.m; sourceTree = "<group>"; };
59EB75BA23905F7000F5AE63 /* IJSVGUnitLength.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGUnitLength.m; path = ../../../../source/IJSVGUnitLength.m; sourceTree = "<group>"; };
59EB75BB23905F7000F5AE63 /* IJSVGPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGPattern.h; path = ../../../../source/IJSVGPattern.h; sourceTree = "<group>"; };
59EB75BC23905F7000F5AE63 /* IJSVGLayerTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGLayerTree.h; path = ../../../../source/IJSVGLayerTree.h; sourceTree = "<group>"; };
59EB75BD23905F7000F5AE63 /* IJSVGExporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGExporter.m; path = ../../../../source/IJSVGExporter.m; sourceTree = "<group>"; };
59EB75BE23905F7000F5AE63 /* IJSVGCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCache.h; path = ../../../../source/IJSVGCache.h; sourceTree = "<group>"; };
59EB75BF23905F7000F5AE63 /* IJSVGPatternLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGPatternLayer.h; path = ../../../../source/IJSVGPatternLayer.h; sourceTree = "<group>"; };
59EB75C023905F7100F5AE63 /* IJSVGText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGText.m; path = ../../../../source/IJSVGText.m; sourceTree = "<group>"; };
59EB75C123905F7100F5AE63 /* IJSVGView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGView.m; path = ../../../../source/IJSVGView.m; sourceTree = "<group>"; };
59EB75C223905F7100F5AE63 /* IJSVGLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGLinearGradient.m; path = ../../../../source/IJSVGLinearGradient.m; sourceTree = "<group>"; };
59EB75C323905F7100F5AE63 /* IJSVGBezierPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGBezierPathAdditions.h; path = ../../../../source/IJSVGBezierPathAdditions.h; sourceTree = "<group>"; };
59EB75C423905F7100F5AE63 /* IJSVGStyleSheetSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStyleSheetSelector.m; path = ../../../../source/IJSVGStyleSheetSelector.m; sourceTree = "<group>"; };
59EB75C523905F7100F5AE63 /* IJSVGImageLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGImageLayer.m; path = ../../../../source/IJSVGImageLayer.m; sourceTree = "<group>"; };
59EB75C623905F7100F5AE63 /* IJSVGCommandClose.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandClose.m; path = ../../../../source/IJSVGCommandClose.m; sourceTree = "<group>"; };
59EB75C723905F7100F5AE63 /* IJSVGCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommand.h; path = ../../../../source/IJSVGCommand.h; sourceTree = "<group>"; };
59EB75C823905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandSmoothQuadraticCurve.m; path = ../../../../source/IJSVGCommandSmoothQuadraticCurve.m; sourceTree = "<group>"; };
59EB75C923905F7200F5AE63 /* IJSVGForeignObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGForeignObject.m; path = ../../../../source/IJSVGForeignObject.m; sourceTree = "<group>"; };
59EB75CA23905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandSmoothQuadraticCurve.h; path = ../../../../source/IJSVGCommandSmoothQuadraticCurve.h; sourceTree = "<group>"; };
59EB75CB23905F7200F5AE63 /* IJSVGCommandEllipticalArc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandEllipticalArc.m; path = ../../../../source/IJSVGCommandEllipticalArc.m; sourceTree = "<group>"; };
59EB75CC23905F7200F5AE63 /* IJSVGGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGGroup.m; path = ../../../../source/IJSVGGroup.m; sourceTree = "<group>"; };
59EB75CD23905F7200F5AE63 /* IJSVGView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGView.h; path = ../../../../source/IJSVGView.h; sourceTree = "<group>"; };
59EB75CE23905F7200F5AE63 /* IJSVGForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGForeignObject.h; path = ../../../../source/IJSVGForeignObject.h; sourceTree = "<group>"; };
59EB75CF23905F7200F5AE63 /* IJSVGExporterPathInstruction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGExporterPathInstruction.m; path = ../../../../source/IJSVGExporterPathInstruction.m; sourceTree = "<group>"; };
59EB75D023905F7200F5AE63 /* IJSVGImageLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGImageLayer.h; path = ../../../../source/IJSVGImageLayer.h; sourceTree = "<group>"; };
59EB75D123905F7300F5AE63 /* IJSVGStyleSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGStyleSheet.m; path = ../../../../source/IJSVGStyleSheet.m; sourceTree = "<group>"; };
59EB75D223905F7300F5AE63 /* IJSVGGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGGradient.m; path = ../../../../source/IJSVGGradient.m; sourceTree = "<group>"; };
59EB75D323905F7300F5AE63 /* IJSVGRendering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGRendering.h; path = ../../../../source/IJSVGRendering.h; sourceTree = "<group>"; };
59EB75D423905F7300F5AE63 /* IJSVGExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJSVGExporter.h; path = ../../../../source/IJSVGExporter.h; sourceTree = "<group>"; };
59EB75D523905F7300F5AE63 /* IJSVGRendering.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJSVGRendering.m; path = ../../../../source/IJSVGRendering.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
594CF46C238FF38E009B251B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
599EB4D3238FF570004CB6BC /* libobjc.tbd in Frameworks */,
594CF55F238FF462009B251B /* AppKit.framework in Frameworks */,
594CF561238FF46C009B251B /* Foundation.framework in Frameworks */,
594CF563238FF473009B251B /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
594CF465238FF38E009B251B = {
isa = PBXGroup;
children = (
594CF471238FF38E009B251B /* IJSVG */,
594CF470238FF38E009B251B /* Products */,
594CF55D238FF461009B251B /* Frameworks */,
);
sourceTree = "<group>";
};
594CF470238FF38E009B251B /* Products */ = {
isa = PBXGroup;
children = (
594CF46F238FF38E009B251B /* IJSVG.framework */,
);
name = Products;
sourceTree = "<group>";
};
594CF471238FF38E009B251B /* IJSVG */ = {
isa = PBXGroup;
children = (
59EB756423905F3100F5AE63 /* Source */,
594CF473238FF38E009B251B /* Info.plist */,
);
path = IJSVG;
sourceTree = "<group>";
};
594CF55D238FF461009B251B /* Frameworks */ = {
isa = PBXGroup;
children = (
599EB4D2238FF535004CB6BC /* libobjc.tbd */,
594CF562238FF473009B251B /* QuartzCore.framework */,
594CF560238FF46C009B251B /* Foundation.framework */,
594CF55E238FF462009B251B /* AppKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
59EB756423905F3100F5AE63 /* Source */ = {
isa = PBXGroup;
children = (
59EB756A23905F6B00F5AE63 /* IJSVG.h */,
59EB75A223905F6E00F5AE63 /* IJSVG.m */,
59EB75C323905F7100F5AE63 /* IJSVGBezierPathAdditions.h */,
59EB758E23905F6D00F5AE63 /* IJSVGBezierPathAdditions.m */,
59EB75BE23905F7000F5AE63 /* IJSVGCache.h */,
59EB759323905F6D00F5AE63 /* IJSVGCache.m */,
59EB758323905F6C00F5AE63 /* IJSVGColor.h */,
59EB758523905F6C00F5AE63 /* IJSVGColor.m */,
59EB75A923905F6F00F5AE63 /* IJSVGColorList.h */,
59EB757123905F6C00F5AE63 /* IJSVGColorList.m */,
59EB75C723905F7100F5AE63 /* IJSVGCommand.h */,
59EB75A023905F6E00F5AE63 /* IJSVGCommand.m */,
59EB75B723905F7000F5AE63 /* IJSVGCommandClose.h */,
59EB75C623905F7100F5AE63 /* IJSVGCommandClose.m */,
59EB759C23905F6E00F5AE63 /* IJSVGCommandCurve.h */,
59EB759823905F6E00F5AE63 /* IJSVGCommandCurve.m */,
59EB759E23905F6E00F5AE63 /* IJSVGCommandEllipticalArc.h */,
59EB75CB23905F7200F5AE63 /* IJSVGCommandEllipticalArc.m */,
59EB759523905F6D00F5AE63 /* IJSVGCommandHorizontalLine.h */,
59EB758723905F6C00F5AE63 /* IJSVGCommandHorizontalLine.m */,
59EB756823905F6B00F5AE63 /* IJSVGCommandLineTo.h */,
59EB75AE23905F6F00F5AE63 /* IJSVGCommandLineTo.m */,
59EB75AF23905F6F00F5AE63 /* IJSVGCommandMove.h */,
59EB759923905F6E00F5AE63 /* IJSVGCommandMove.m */,
59EB757E23905F6C00F5AE63 /* IJSVGCommandQuadraticCurve.h */,
59EB756C23905F6B00F5AE63 /* IJSVGCommandQuadraticCurve.m */,
59EB757023905F6C00F5AE63 /* IJSVGCommandSmoothCurve.h */,
59EB75A823905F6F00F5AE63 /* IJSVGCommandSmoothCurve.m */,
59EB75CA23905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h */,
59EB75C823905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m */,
59EB756D23905F6C00F5AE63 /* IJSVGCommandVerticalLine.h */,
59EB759123905F6D00F5AE63 /* IJSVGCommandVerticalLine.m */,
59EB758623905F6C00F5AE63 /* IJSVGDef.h */,
59EB756923905F6B00F5AE63 /* IJSVGDef.m */,
59EB758423905F6C00F5AE63 /* IJSVGError.h */,
59EB75D423905F7300F5AE63 /* IJSVGExporter.h */,
59EB75BD23905F7000F5AE63 /* IJSVGExporter.m */,
59EB75B223905F6F00F5AE63 /* IJSVGExporterPathInstruction.h */,
59EB75CF23905F7200F5AE63 /* IJSVGExporterPathInstruction.m */,
59EB758823905F6D00F5AE63 /* IJSVGFontConverter.h */,
59EB757C23905F6C00F5AE63 /* IJSVGFontConverter.m */,
59EB75CE23905F7200F5AE63 /* IJSVGForeignObject.h */,
59EB75C923905F7200F5AE63 /* IJSVGForeignObject.m */,
59EB75AB23905F6F00F5AE63 /* IJSVGGradient.h */,
59EB75D223905F7300F5AE63 /* IJSVGGradient.m */,
59EB756623905F6B00F5AE63 /* IJSVGGradientLayer.h */,
59EB758F23905F6D00F5AE63 /* IJSVGGradientLayer.m */,
59EB757323905F6C00F5AE63 /* IJSVGGradientUnitLength.h */,
59EB75B923905F7000F5AE63 /* IJSVGGradientUnitLength.m */,
59EB758B23905F6D00F5AE63 /* IJSVGGroup.h */,
59EB75CC23905F7200F5AE63 /* IJSVGGroup.m */,
59EB75AD23905F6F00F5AE63 /* IJSVGGroupLayer.h */,
59EB758223905F6C00F5AE63 /* IJSVGGroupLayer.m */,
59EB75B523905F7000F5AE63 /* IJSVGImage.h */,
59EB757623905F6C00F5AE63 /* IJSVGImage.m */,
59EB75D023905F7200F5AE63 /* IJSVGImageLayer.h */,
59EB75C523905F7100F5AE63 /* IJSVGImageLayer.m */,
59EB75A323905F6E00F5AE63 /* IJSVGImageRep.h */,
59EB757D23905F6C00F5AE63 /* IJSVGImageRep.m */,
59EB756523905F6B00F5AE63 /* IJSVGLayer.h */,
59EB757B23905F6C00F5AE63 /* IJSVGLayer.m */,
59EB75BC23905F7000F5AE63 /* IJSVGLayerTree.h */,
59EB759023905F6D00F5AE63 /* IJSVGLayerTree.m */,
59EB759F23905F6E00F5AE63 /* IJSVGLinearGradient.h */,
59EB75C223905F7100F5AE63 /* IJSVGLinearGradient.m */,
59EB75B623905F7000F5AE63 /* IJSVGMath.h */,
59EB75B123905F6F00F5AE63 /* IJSVGMath.m */,
59EB759223905F6D00F5AE63 /* IJSVGNode.h */,
59EB759623905F6D00F5AE63 /* IJSVGNode.m */,
59EB75A723905F6F00F5AE63 /* IJSVGParser.h */,
59EB75A523905F6E00F5AE63 /* IJSVGParser.m */,
59EB759D23905F6E00F5AE63 /* IJSVGPath.h */,
59EB758A23905F6D00F5AE63 /* IJSVGPath.m */,
59EB75BB23905F7000F5AE63 /* IJSVGPattern.h */,
59EB75AA23905F6F00F5AE63 /* IJSVGPattern.m */,
59EB75BF23905F7000F5AE63 /* IJSVGPatternLayer.h */,
59EB758C23905F6D00F5AE63 /* IJSVGPatternLayer.m */,
59EB757223905F6C00F5AE63 /* IJSVGRadialGradient.h */,
59EB75A623905F6F00F5AE63 /* IJSVGRadialGradient.m */,
59EB75D323905F7300F5AE63 /* IJSVGRendering.h */,
59EB75D523905F7300F5AE63 /* IJSVGRendering.m */,
59EB75A123905F6E00F5AE63 /* IJSVGRenderingStyle.h */,
59EB758D23905F6D00F5AE63 /* IJSVGRenderingStyle.m */,
59EB759723905F6D00F5AE63 /* IJSVGShapeLayer.h */,
59EB757A23905F6C00F5AE63 /* IJSVGShapeLayer.m */,
59EB75B823905F7000F5AE63 /* IJSVGStringAdditions.h */,
59EB757823905F6C00F5AE63 /* IJSVGStringAdditions.m */,
59EB75A423905F6E00F5AE63 /* IJSVGStrokeLayer.h */,
59EB757423905F6C00F5AE63 /* IJSVGStrokeLayer.m */,
59EB75AC23905F6F00F5AE63 /* IJSVGStyle.h */,
59EB757523905F6C00F5AE63 /* IJSVGStyle.m */,
59EB756F23905F6C00F5AE63 /* IJSVGStyleSheet.h */,
59EB75D123905F7300F5AE63 /* IJSVGStyleSheet.m */,
59EB759B23905F6E00F5AE63 /* IJSVGStyleSheetRule.h */,
59EB756723905F6B00F5AE63 /* IJSVGStyleSheetRule.m */,
59EB759A23905F6E00F5AE63 /* IJSVGStyleSheetSelector.h */,
59EB75C423905F7100F5AE63 /* IJSVGStyleSheetSelector.m */,
59EB757F23905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.h */,
59EB758123905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.m */,
59EB756B23905F6B00F5AE63 /* IJSVGText.h */,
59EB75C023905F7100F5AE63 /* IJSVGText.m */,
59EB757923905F6C00F5AE63 /* IJSVGTransaction.h */,
59EB75B323905F6F00F5AE63 /* IJSVGTransaction.m */,
59EB75B023905F6F00F5AE63 /* IJSVGTransform.h */,
59EB75B423905F6F00F5AE63 /* IJSVGTransform.m */,
59EB757723905F6C00F5AE63 /* IJSVGUnitLength.h */,
59EB75BA23905F7000F5AE63 /* IJSVGUnitLength.m */,
59EB759423905F6D00F5AE63 /* IJSVGUtils.h */,
59EB758023905F6C00F5AE63 /* IJSVGUtils.m */,
59EB75CD23905F7200F5AE63 /* IJSVGView.h */,
59EB75C123905F7100F5AE63 /* IJSVGView.m */,
59EB756E23905F6C00F5AE63 /* IJSVGWriter.h */,
59EB758923905F6D00F5AE63 /* IJSVGWriter.m */,
);
path = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
594CF46A238FF38E009B251B /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
59EB762623905F7300F5AE63 /* IJSVGImage.h in Headers */,
59EB760823905F7300F5AE63 /* IJSVGShapeLayer.h in Headers */,
59EB75DF23905F7300F5AE63 /* IJSVGWriter.h in Headers */,
59EB760F23905F7300F5AE63 /* IJSVGCommandEllipticalArc.h in Headers */,
59EB75F523905F7300F5AE63 /* IJSVGError.h in Headers */,
59EB763E23905F7300F5AE63 /* IJSVGView.h in Headers */,
59EB75DB23905F7300F5AE63 /* IJSVG.h in Headers */,
59EB764423905F7300F5AE63 /* IJSVGRendering.h in Headers */,
59EB75DC23905F7300F5AE63 /* IJSVGText.h in Headers */,
59EB761C23905F7300F5AE63 /* IJSVGGradient.h in Headers */,
59EB75F923905F7300F5AE63 /* IJSVGFontConverter.h in Headers */,
59EB75EF23905F7300F5AE63 /* IJSVGCommandQuadraticCurve.h in Headers */,
59EB75FC23905F7300F5AE63 /* IJSVGGroup.h in Headers */,
59EB760323905F7300F5AE63 /* IJSVGNode.h in Headers */,
59EB762023905F7300F5AE63 /* IJSVGCommandMove.h in Headers */,
59EB762C23905F7300F5AE63 /* IJSVGPattern.h in Headers */,
59EB762923905F7300F5AE63 /* IJSVGStringAdditions.h in Headers */,
59EB761A23905F7300F5AE63 /* IJSVGColorList.h in Headers */,
59EB762123905F7300F5AE63 /* IJSVGTransform.h in Headers */,
59EB763F23905F7300F5AE63 /* IJSVGForeignObject.h in Headers */,
59EB75F423905F7300F5AE63 /* IJSVGColor.h in Headers */,
59EB760D23905F7300F5AE63 /* IJSVGCommandCurve.h in Headers */,
59EB763823905F7300F5AE63 /* IJSVGCommand.h in Headers */,
59EB760C23905F7300F5AE63 /* IJSVGStyleSheetRule.h in Headers */,
59EB75E323905F7300F5AE63 /* IJSVGRadialGradient.h in Headers */,
59EB760523905F7300F5AE63 /* IJSVGUtils.h in Headers */,
59EB763B23905F7300F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h in Headers */,
59EB75E823905F7300F5AE63 /* IJSVGUnitLength.h in Headers */,
59EB762723905F7300F5AE63 /* IJSVGMath.h in Headers */,
59EB761523905F7300F5AE63 /* IJSVGStrokeLayer.h in Headers */,
59EB762F23905F7300F5AE63 /* IJSVGCache.h in Headers */,
59EB75DE23905F7300F5AE63 /* IJSVGCommandVerticalLine.h in Headers */,
59EB764123905F7300F5AE63 /* IJSVGImageLayer.h in Headers */,
59EB75E023905F7300F5AE63 /* IJSVGStyleSheet.h in Headers */,
59EB761423905F7300F5AE63 /* IJSVGImageRep.h in Headers */,
59EB761223905F7300F5AE63 /* IJSVGRenderingStyle.h in Headers */,
59EB760E23905F7300F5AE63 /* IJSVGPath.h in Headers */,
59EB75EA23905F7300F5AE63 /* IJSVGTransaction.h in Headers */,
59EB75D723905F7300F5AE63 /* IJSVGGradientLayer.h in Headers */,
59EB75F723905F7300F5AE63 /* IJSVGDef.h in Headers */,
59EB760623905F7300F5AE63 /* IJSVGCommandHorizontalLine.h in Headers */,
59EB762323905F7300F5AE63 /* IJSVGExporterPathInstruction.h in Headers */,
59EB761023905F7300F5AE63 /* IJSVGLinearGradient.h in Headers */,
59EB75E123905F7300F5AE63 /* IJSVGCommandSmoothCurve.h in Headers */,
59EB75D923905F7300F5AE63 /* IJSVGCommandLineTo.h in Headers */,
59EB75D623905F7300F5AE63 /* IJSVGLayer.h in Headers */,
59EB763023905F7300F5AE63 /* IJSVGPatternLayer.h in Headers */,
59EB75F023905F7300F5AE63 /* IJSVGStyleSheetSelectorRaw.h in Headers */,
59EB763423905F7300F5AE63 /* IJSVGBezierPathAdditions.h in Headers */,
59EB761823905F7300F5AE63 /* IJSVGParser.h in Headers */,
59EB761E23905F7300F5AE63 /* IJSVGGroupLayer.h in Headers */,
59EB761D23905F7300F5AE63 /* IJSVGStyle.h in Headers */,
59EB764523905F7300F5AE63 /* IJSVGExporter.h in Headers */,
59EB762823905F7300F5AE63 /* IJSVGCommandClose.h in Headers */,
59EB75E423905F7300F5AE63 /* IJSVGGradientUnitLength.h in Headers */,
59EB762D23905F7300F5AE63 /* IJSVGLayerTree.h in Headers */,
59EB760B23905F7300F5AE63 /* IJSVGStyleSheetSelector.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
594CF46E238FF38E009B251B /* IJSVG */ = {
isa = PBXNativeTarget;
buildConfigurationList = 594CF477238FF38E009B251B /* Build configuration list for PBXNativeTarget "IJSVG" */;
buildPhases = (
594CF46A238FF38E009B251B /* Headers */,
594CF46B238FF38E009B251B /* Sources */,
594CF46C238FF38E009B251B /* Frameworks */,
594CF46D238FF38E009B251B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = IJSVG;
productName = IJSVG;
productReference = 594CF46F238FF38E009B251B /* IJSVG.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
594CF466238FF38E009B251B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = "Curtis Hard";
TargetAttributes = {
594CF46E238FF38E009B251B = {
CreatedOnToolsVersion = 11.0;
};
};
};
buildConfigurationList = 594CF469238FF38E009B251B /* Build configuration list for PBXProject "IJSVG" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 594CF465238FF38E009B251B;
productRefGroup = 594CF470238FF38E009B251B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
594CF46E238FF38E009B251B /* IJSVG */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
594CF46D238FF38E009B251B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
594CF46B238FF38E009B251B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
59EB763123905F7300F5AE63 /* IJSVGText.m in Sources */,
59EB760223905F7300F5AE63 /* IJSVGCommandVerticalLine.m in Sources */,
59EB75FD23905F7300F5AE63 /* IJSVGPatternLayer.m in Sources */,
59EB763923905F7300F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m in Sources */,
59EB75D823905F7300F5AE63 /* IJSVGStyleSheetRule.m in Sources */,
59EB75FB23905F7300F5AE63 /* IJSVGPath.m in Sources */,
59EB760123905F7300F5AE63 /* IJSVGLayerTree.m in Sources */,
59EB763A23905F7300F5AE63 /* IJSVGForeignObject.m in Sources */,
59EB761123905F7300F5AE63 /* IJSVGCommand.m in Sources */,
59EB760923905F7300F5AE63 /* IJSVGCommandCurve.m in Sources */,
59EB763323905F7300F5AE63 /* IJSVGLinearGradient.m in Sources */,
59EB761923905F7300F5AE63 /* IJSVGCommandSmoothCurve.m in Sources */,
59EB761323905F7300F5AE63 /* IJSVG.m in Sources */,
59EB763623905F7300F5AE63 /* IJSVGImageLayer.m in Sources */,
59EB75EC23905F7300F5AE63 /* IJSVGLayer.m in Sources */,
59EB75E523905F7300F5AE63 /* IJSVGStrokeLayer.m in Sources */,
59EB763223905F7300F5AE63 /* IJSVGView.m in Sources */,
59EB763523905F7300F5AE63 /* IJSVGStyleSheetSelector.m in Sources */,
59EB760723905F7300F5AE63 /* IJSVGNode.m in Sources */,
59EB75E923905F7300F5AE63 /* IJSVGStringAdditions.m in Sources */,
59EB761723905F7300F5AE63 /* IJSVGRadialGradient.m in Sources */,
59EB760423905F7300F5AE63 /* IJSVGCache.m in Sources */,
59EB75E223905F7300F5AE63 /* IJSVGColorList.m in Sources */,
59EB75ED23905F7300F5AE63 /* IJSVGFontConverter.m in Sources */,
59EB763C23905F7300F5AE63 /* IJSVGCommandEllipticalArc.m in Sources */,
59EB75E723905F7300F5AE63 /* IJSVGImage.m in Sources */,
59EB75FF23905F7300F5AE63 /* IJSVGBezierPathAdditions.m in Sources */,
59EB75E623905F7300F5AE63 /* IJSVGStyle.m in Sources */,
59EB75EB23905F7300F5AE63 /* IJSVGShapeLayer.m in Sources */,
59EB75F623905F7300F5AE63 /* IJSVGColor.m in Sources */,
59EB75F323905F7300F5AE63 /* IJSVGGroupLayer.m in Sources */,
59EB762523905F7300F5AE63 /* IJSVGTransform.m in Sources */,
59EB760023905F7300F5AE63 /* IJSVGGradientLayer.m in Sources */,
59EB762B23905F7300F5AE63 /* IJSVGUnitLength.m in Sources */,
59EB75F823905F7300F5AE63 /* IJSVGCommandHorizontalLine.m in Sources */,
59EB75FA23905F7300F5AE63 /* IJSVGWriter.m in Sources */,
59EB764623905F7300F5AE63 /* IJSVGRendering.m in Sources */,
59EB762E23905F7300F5AE63 /* IJSVGExporter.m in Sources */,
59EB761623905F7300F5AE63 /* IJSVGParser.m in Sources */,
59EB75DD23905F7300F5AE63 /* IJSVGCommandQuadraticCurve.m in Sources */,
59EB762423905F7300F5AE63 /* IJSVGTransaction.m in Sources */,
59EB75DA23905F7300F5AE63 /* IJSVGDef.m in Sources */,
59EB763723905F7300F5AE63 /* IJSVGCommandClose.m in Sources */,
59EB764323905F7300F5AE63 /* IJSVGGradient.m in Sources */,
59EB762A23905F7300F5AE63 /* IJSVGGradientUnitLength.m in Sources */,
59EB764223905F7300F5AE63 /* IJSVGStyleSheet.m in Sources */,
59EB764023905F7300F5AE63 /* IJSVGExporterPathInstruction.m in Sources */,
59EB75FE23905F7300F5AE63 /* IJSVGRenderingStyle.m in Sources */,
59EB75F223905F7300F5AE63 /* IJSVGStyleSheetSelectorRaw.m in Sources */,
59EB75EE23905F7300F5AE63 /* IJSVGImageRep.m in Sources */,
59EB762223905F7300F5AE63 /* IJSVGMath.m in Sources */,
59EB763D23905F7300F5AE63 /* IJSVGGroup.m in Sources */,
59EB761F23905F7300F5AE63 /* IJSVGCommandLineTo.m in Sources */,
59EB75F123905F7300F5AE63 /* IJSVGUtils.m in Sources */,
59EB760A23905F7300F5AE63 /* IJSVGCommandMove.m in Sources */,
59EB761B23905F7300F5AE63 /* IJSVGPattern.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
594CF475238FF38E009B251B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
594CF476238FF38E009B251B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
594CF478238FF38E009B251B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_COMMA = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = 9KTR4W9XX6;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = IJSVG/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.iconjar.ijsvg;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
};
name = Debug;
};
594CF479238FF38E009B251B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_COMMA = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = 9KTR4W9XX6;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = IJSVG/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.iconjar.ijsvg;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
594CF469238FF38E009B251B /* Build configuration list for PBXProject "IJSVG" */ = {
isa = XCConfigurationList;
buildConfigurations = (
594CF475238FF38E009B251B /* Debug */,
594CF476238FF38E009B251B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
594CF477238FF38E009B251B /* Build configuration list for PBXNativeTarget "IJSVG" */ = {
isa = XCConfigurationList;
buildConfigurations = (
594CF478238FF38E009B251B /* Debug */,
594CF479238FF38E009B251B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 594CF466238FF38E009B251B /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:IJSVG.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "594CF46E238FF38E009B251B"
BuildableName = "IJSVG.framework"
BlueprintName = "IJSVG"
ReferencedContainer = "container:IJSVG.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "594CF46E238FF38E009B251B"
BuildableName = "IJSVG.framework"
BlueprintName = "IJSVG"
ReferencedContainer = "container:IJSVG.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>IJSVG.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>594CF46E238FF38E009B251B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Curtis Hard. All rights reserved.</string>
</dict>
</plist>
+77 -79
View File
@@ -6,61 +6,59 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGParser.h"
#import "IJSVGBezierPathAdditions.h"
#import "IJSVGLayerTree.h"
#import "IJSVGColorList.h"
#import "IJSVGExporter.h"
#import "IJSVGGradientLayer.h"
#import "IJSVGGroupLayer.h"
#import "IJSVGImageLayer.h"
#import "IJSVGExporter.h"
#import "IJSVGLayerTree.h"
#import "IJSVGParser.h"
#import "IJSVGRendering.h"
#import "IJSVGColorList.h"
#import "IJSVGGradientLayer.h"
#import "IJSVGRenderingStyle.h"
#import <Foundation/Foundation.h>
@class IJSVG;
@class IJSVGQuartzRenderer;
void IJSVGBeginTransactionLock();
void IJSVGEndTransactionLock();
void IJSVGObtainTransactionLock(dispatch_block_t block, BOOL renderOnMainThread);
void IJSVGBeginTransactionLock(void);
void IJSVGEndTransactionLock(void);
@protocol IJSVGDelegate <NSObject,IJSVGParserDelegate>
@protocol IJSVGDelegate <NSObject, IJSVGParserDelegate>
@optional
- (BOOL)svg:(IJSVG *)svg
shouldHandleForeignObject:(IJSVGForeignObject *)foreignObject;
- (void)svg:(IJSVG *)svg
handleForeignObject:(IJSVGForeignObject *)foreignObject
document:(NSXMLDocument *)document;
- (void)svg:(IJSVG *)svg
foundSubSVG:(IJSVG *)subSVG
withSVGString:(NSString *)subSVGString;
- (BOOL)svg:(IJSVG*)svg
shouldHandleForeignObject:(IJSVGForeignObject*)foreignObject;
- (void)svg:(IJSVG*)svg
handleForeignObject:(IJSVGForeignObject*)foreignObject
document:(NSXMLDocument*)document;
- (void)svg:(IJSVG*)svg
foundSubSVG:(IJSVG*)subSVG
withSVGString:(NSString*)subSVGString;
@end
@interface IJSVG : NSObject <NSPasteboardWriting, IJSVGParserDelegate> {
@private
IJSVGParser * _group;
IJSVGParser* _group;
CGFloat _scale;
CGFloat _clipScale;
id<IJSVGDelegate> _delegate;
IJSVGLayer * _layerTree;
IJSVGLayer* _layerTree;
CGRect _viewBox;
CGSize _proposedViewSize;
CGFloat _lastProposedBackingScale;
IJSVGRenderQuality _lastProposedRenderQuality;
CGFloat _backingScale;
NSMutableDictionary * _replacementColors;
IJSVGQuartzRenderer * _quartzRenderer;
NSMutableDictionary* _replacementColors;
IJSVGQuartzRenderer* _quartzRenderer;
struct {
unsigned int shouldHandleForeignObject: 1;
unsigned int handleForeignObject: 1;
unsigned int shouldHandleSubSVG: 1;
unsigned int shouldHandleForeignObject : 1;
unsigned int handleForeignObject : 1;
unsigned int shouldHandleSubSVG : 1;
} _respondsTo;
}
// set this to be called when the layer is about to draw, it will call this
@@ -73,91 +71,91 @@ withSVGString:(NSString *)subSVGString;
// fillColor, strokeColor, pattern and gradient fill
@property (nonatomic, assign) IJSVGRenderQuality renderQuality;
@property (nonatomic, assign) BOOL clipToViewport;
@property (nonatomic, retain) IJSVGRenderingStyle * style;
@property (nonatomic, retain) IJSVGRenderingStyle* style;
- (void)prepForDrawingInView:(NSView *)view;
- (void)prepForDrawingInView:(NSView*)view;
- (BOOL)isFont;
- (IJSVGGroup *)rootNode;
- (IJSVGGroup*)rootNode;
- (NSRect)viewBox;
- (NSArray<IJSVGPath *> *)glyphs;
- (NSString *)identifier;
- (IJSVGLayer *)layer;
- (IJSVGLayer *)layerWithTree:(IJSVGLayerTree *)tree;
- (NSArray<IJSVG *> *)subSVGs:(BOOL)recursive;
- (NSString *)SVGStringWithOptions:(IJSVGExporterOptions)options;
- (NSArray<IJSVGPath*>*)glyphs;
- (NSString*)identifier;
- (IJSVGLayer*)layer;
- (IJSVGLayer*)layerWithTree:(IJSVGLayerTree*)tree;
- (NSArray<IJSVG*>*)subSVGs:(BOOL)recursive;
- (NSString*)SVGStringWithOptions:(IJSVGExporterOptions)options;
- (CGFloat)computeBackingScale:(CGFloat)scale;
- (void)discardDOM;
+ (id)svgNamed:(NSString *)string;
+ (id)svgNamed:(NSString *)string
+ (id)svgNamed:(NSString*)string;
+ (id)svgNamed:(NSString*)string
delegate:(id<IJSVGDelegate>)delegate;
+ (id)svgNamed:(NSString *)string
+ (id)svgNamed:(NSString*)string
useCache:(BOOL)useCache
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithImage:(NSImage *)image;
- (id)initWithImage:(NSImage*)image;
- (id)initWithSVGLayer:(IJSVGGroupLayer *)group
- (id)initWithSVGLayer:(IJSVGGroupLayer*)group
viewBox:(NSRect)viewBox;
- (id)initWithSVGString:(NSString *)string
error:(NSError **)error
- (id)initWithSVGString:(NSString*)string
error:(NSError**)error
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithSVGString:(NSString *)string;
- (id)initWithSVGString:(NSString *)string
error:(NSError **)error;
- (id)initWithSVGString:(NSString*)string;
- (id)initWithSVGString:(NSString*)string
error:(NSError**)error;
- (id)initWithFile:(NSString *)file
- (id)initWithFile:(NSString*)file
useCache:(BOOL)useCache;
- (id)initWithFile:(NSString *)file;
- (id)initWithFile:(NSString *)file
error:(NSError **)error;
- (id)initWithFile:(NSString *)file
- (id)initWithFile:(NSString*)file;
- (id)initWithFile:(NSString*)file
error:(NSError**)error;
- (id)initWithFile:(NSString*)file
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithFile:(NSString *)file
error:(NSError **)error
- (id)initWithFile:(NSString*)file
error:(NSError**)error
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithFile:(NSString *)file
- (id)initWithFile:(NSString*)file
useCache:(BOOL)useCache
error:(NSError **)error
error:(NSError**)error
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithFilePathURL:(NSURL *)aURL;
- (id)initWithFilePathURL:(NSURL *)aURL
- (id)initWithFilePathURL:(NSURL*)aURL;
- (id)initWithFilePathURL:(NSURL*)aURL
useCache:(BOOL)useCache;
- (id)initWithFilePathURL:(NSURL *)aURL
error:(NSError **)error;
- (id)initWithFilePathURL:(NSURL *)aURL
- (id)initWithFilePathURL:(NSURL*)aURL
error:(NSError**)error;
- (id)initWithFilePathURL:(NSURL*)aURL
delegate:(id<IJSVGDelegate>)delegate;
- (id)initWithFilePathURL:(NSURL *)aURL
- (id)initWithFilePathURL:(NSURL*)aURL
useCache:(BOOL)useCache
error:(NSError **)error
error:(NSError**)error
delegate:(id<IJSVGDelegate>)delegate;
- (NSImage *)imageWithSize:(NSSize)aSize;
- (NSImage *)imageWithSize:(NSSize)aSize
error:(NSError **)error;
- (NSImage *)imageWithSize:(NSSize)aSize
flipped:(BOOL)flipped;
- (NSImage *)imageByMaintainingAspectRatioWithSize:(NSSize)aSize
flipped:(BOOL)flipped
error:(NSError **)error;
- (NSImage*)imageWithSize:(NSSize)aSize;
- (NSImage*)imageWithSize:(NSSize)aSize
error:(NSError**)error;
- (NSImage*)imageWithSize:(NSSize)aSize
flipped:(BOOL)flipped;
- (NSImage*)imageByMaintainingAspectRatioWithSize:(NSSize)aSize
flipped:(BOOL)flipped
error:(NSError**)error;
- (BOOL)drawAtPoint:(NSPoint)point
size:(NSSize)size;
- (BOOL)drawAtPoint:(NSPoint)point
size:(NSSize)aSize
error:(NSError **)error;
error:(NSError**)error;
- (BOOL)drawInRect:(NSRect)rect;
- (BOOL)drawInRect:(NSRect)rect
error:(NSError **)error;
error:(NSError**)error;
- (void)drawInRect:(NSRect)rect
context:(CGContextRef)context;
- (NSData *)PDFData;
- (NSData *)PDFData:(NSError **)error;
- (NSData *)PDFDataWithRect:(NSRect)rect;
- (NSData *)PDFDataWithRect:(NSRect)rect
error:(NSError **)error;
- (NSData*)PDFData;
- (NSData*)PDFData:(NSError**)error;
- (NSData*)PDFDataWithRect:(NSRect)rect;
- (NSData*)PDFDataWithRect:(NSRect)rect
error:(NSError**)error;
- (void)beginVectorDraw;
- (void)endVectorDraw;
@@ -166,5 +164,5 @@ withSVGString:(NSString *)subSVGString;
- (void)setNeedsDisplay;
// colors
- (IJSVGColorList *)computedColorList:(BOOL *)hasPatternFills;
- (IJSVGColorList*)computedColorList:(BOOL*)hasPatternFills;
@end
+318 -418
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -6,6 +6,7 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
@interface NSBezierPath (IJSVGAdditions)
+3 -3
View File
@@ -15,9 +15,9 @@
{
CGPoint QP0 = [self currentPoint];
CGPoint CP3 = QP2;
CGPoint CP1 = CGPointMake( QP0.x + ((2.0 / 3.0) * (QP1.x - QP0.x)), QP0.y + ((2.0 / 3.0) * (QP1.y - QP0.y)));
CGPoint CP2 = CGPointMake( QP2.x + (2.0 / 3.0) * (QP1.x - QP2.x), QP2.y + (2.0 / 3.0) * (QP1.y - QP2.y) );
CGPoint CP1 = CGPointMake(QP0.x + ((2.0 / 3.0) * (QP1.x - QP0.x)), QP0.y + ((2.0 / 3.0) * (QP1.y - QP0.y)));
CGPoint CP2 = CGPointMake(QP2.x + (2.0 / 3.0) * (QP1.x - QP2.x), QP2.y + (2.0 / 3.0) * (QP1.y - QP2.y));
[self curveToPoint:CP3
controlPoint1:CP1
controlPoint2:CP2];
+4 -5
View File
@@ -6,20 +6,19 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVG.h"
#import <Foundation/Foundation.h>
#import <sys/stat.h>
#import "IJSVG.h"
@interface IJSVGCache : NSObject {
}
+ (IJSVG *)cachedSVGForFileURL:(NSURL *)aURL;
+ (void)cacheSVG:(IJSVG *)svg fileURL:(NSURL *)aURL;
+ (IJSVG*)cachedSVGForFileURL:(NSURL*)aURL;
+ (void)cacheSVG:(IJSVG*)svg fileURL:(NSURL*)aURL;
+ (void)flushCache;
+ (BOOL)enabled;
+ (void)setEnabled:(BOOL)flag;
+ (void)purgeCachedSVGForFileURL:(NSURL *)aURL;
+ (void)purgeCachedSVGForFileURL:(NSURL*)aURL;
+ (void)setEvictItemsAfter:(NSInteger)count;
@end
+11 -11
View File
@@ -12,7 +12,7 @@
@implementation IJSVGCache
static NSInteger _maxCacheItems = 20;
static NSCache * _cache = nil;
static NSCache* _cache = nil;
static BOOL _enabled = YES;
+ (void)load
@@ -26,23 +26,23 @@ static BOOL _enabled = YES;
[_cache setTotalCostLimit:_maxCacheItems];
}
+ (IJSVG *)cachedSVGForFileURL:(NSURL *)aURL
+ (IJSVG*)cachedSVGForFileURL:(NSURL*)aURL
{
if( ![self.class enabled] || _cache == nil )
if (![self.class enabled] || _cache == nil)
return nil;
IJSVG * svg = nil;
if( ( svg = [_cache objectForKey:aURL] ) == nil )
IJSVG* svg = nil;
if ((svg = [_cache objectForKey:aURL]) == nil)
return nil;
return svg;
}
+ (void)purgeCachedSVGForFileURL:(NSURL *)aURL
+ (void)purgeCachedSVGForFileURL:(NSURL*)aURL
{
[_cache removeObjectForKey:aURL];
}
+ (void)cacheSVG:(IJSVG *)svg
fileURL:(NSURL *)aURL
+ (void)cacheSVG:(IJSVG*)svg
fileURL:(NSURL*)aURL
{
[_cache setObject:svg
forKey:aURL
@@ -52,13 +52,13 @@ static BOOL _enabled = YES;
+ (void)setEnabled:(BOOL)flag
{
_enabled = flag;
if( !flag ) {
if (!flag) {
[self.class flushCache];
return;
}
// create a new cache if allowed
if( _cache == nil ) {
if (_cache == nil) {
_cache = [[NSCache alloc] init];
[_cache setTotalCostLimit:_maxCacheItems];
}
+33 -22
View File
@@ -6,9 +6,18 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
typedef NS_ENUM( NSInteger, IJSVGPredefinedColor ) {
typedef NS_OPTIONS(NSInteger, IJSVGColorStringOptions) {
IJSVGColorStringOptionNone = 1 << 0,
IJSVGColorStringOptionForceHEX = 1 << 1,
IJSVGColorStringOptionAllowShortHand = 1 << 2,
IJSVGColorStringOptionAllowRRGGBBAA = 1 << 3,
IJSVGColorStringOptionDefault = IJSVGColorStringOptionAllowShortHand
};
typedef NS_ENUM(NSInteger, IJSVGPredefinedColor) {
IJSVGColorAliceblue,
IJSVGColorAntiquewhite,
IJSVGColorAqua,
@@ -160,27 +169,29 @@ typedef NS_ENUM( NSInteger, IJSVGPredefinedColor ) {
@interface IJSVGColor : NSObject
CGFloat * IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightness);
CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightness);
+ (NSColor *)computeColorSpace:(NSColor *)color;
+ (NSColorSpace *)defaultColorSpace;
+ (BOOL)isColor:(NSString *)string;
+ (NSString *)colorStringFromColor:(NSColor *)color
forceHex:(BOOL)forceHex
allowShorthand:(BOOL)allowShorthand;
+ (NSString *)colorStringFromColor:(NSColor *)color;
+ (NSColor *)colorFromHEXInteger:(NSInteger)hex;
+ (NSColor *)computeColor:(id)colour;
+ (NSColor *)colorFromString:(NSString *)string;
+ (NSColor *)colorFromHEXString:(NSString *)string
alpha:(CGFloat)alpha;
+ (NSColor *)colorFromRString:(NSString *)rString
gString:(NSString *)gString
bString:(NSString *)bString
aString:(NSString *)aString;
+ (NSColor *)colorFromPredefinedColorName:(NSString *)name;
+ (NSString *)colorNameFromPredefinedColor:(IJSVGPredefinedColor)color;
+ (NSColor *)changeAlphaOnColor:(NSColor *)color
to:(CGFloat)alphaValue;
+ (NSColor*)computeColorSpace:(NSColor*)color;
+ (NSColorSpace*)defaultColorSpace;
+ (BOOL)isColor:(NSString*)string;
+ (NSString*)colorStringFromColor:(NSColor*)color
options:(IJSVGColorStringOptions)options;
+ (NSString*)colorStringFromColor:(NSColor*)color;
+ (NSColor*)colorFromHEXInteger:(NSInteger)hex;
+ (NSColor*)computeColor:(id)colour;
+ (NSColor*)colorFromString:(NSString*)string;
+ (NSColor*)colorFromHEXString:(NSString*)string;
+ (NSColor*)colorFromHEXString:(NSString*)string
containsAlphaComponent:(BOOL*)containsAlphaComponent;
+ (BOOL)HEXContainsAlphaComponent:(NSUInteger)hex;
+ (unsigned long)lengthOfHEXInteger:(NSUInteger)hex;
+ (NSColor*)colorFromRString:(NSString*)rString
gString:(NSString*)gString
bString:(NSString*)bString
aString:(NSString*)aString;
+ (NSColor*)colorFromPredefinedColorName:(NSString*)name;
+ (NSString*)colorNameFromPredefinedColor:(IJSVGPredefinedColor)color;
+ (NSColor*)changeAlphaOnColor:(NSColor*)color
to:(CGFloat)alphaValue;
@end
+624 -570
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -6,26 +6,26 @@
// Copyright © 2019 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGColor.h"
#import <Foundation/Foundation.h>
@interface IJSVGColorList : NSObject <NSCopying> {
@private
NSMutableDictionary<NSColor *, NSColor *> * _replacementColorTree;
NSMutableSet<NSColor *> * _colors;
NSMutableDictionary<NSColor*, NSColor*>* _replacementColorTree;
NSMutableSet<NSColor*>* _colors;
}
- (NSColor *)proposedColorForColor:(NSColor *)color;
- (NSColor*)proposedColorForColor:(NSColor*)color;
- (void)removeAllReplacementColors;
- (void)removeReplacementColor:(NSColor *)color;
- (void)setReplacementColor:(NSColor *)newColor
forColor:(NSColor *)color;
- (void)setReplacementColors:(NSDictionary<NSColor *, NSColor *> *)colors
- (void)removeReplacementColor:(NSColor*)color;
- (void)setReplacementColor:(NSColor*)newColor
forColor:(NSColor*)color;
- (void)setReplacementColors:(NSDictionary<NSColor*, NSColor*>*)colors
clearExistingColors:(BOOL)clearExistingColors;
- (void)addColorsFromList:(IJSVGColorList *)sheet;
- (NSSet<NSColor *> *)colors;
- (void)addColor:(NSColor *)color;
- (void)addColorsFromList:(IJSVGColorList*)sheet;
- (NSSet<NSColor*>*)colors;
- (void)addColor:(NSColor*)color;
@end
+22 -23
View File
@@ -12,39 +12,39 @@
- (void)dealloc
{
[_replacementColorTree release], _replacementColorTree = nil;
[_colors release], _colors = nil;
(void)([_replacementColorTree release]), _replacementColorTree = nil;
(void)([_colors release]), _colors = nil;
[super dealloc];
}
- (instancetype)init
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
_replacementColorTree = [[NSMutableDictionary alloc] init];
_colors = [[NSMutableSet alloc] init];
}
return self;
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGColorList * sheet = [[self.class alloc] init];
IJSVGColorList* sheet = [[self.class alloc] init];
[sheet setReplacementColors:[_replacementColorTree.copy autorelease]
clearExistingColors:YES];
return sheet;
}
- (NSColor *)proposedColorForColor:(NSColor *)color
- (NSColor*)proposedColorForColor:(NSColor*)color
{
// nothing found, just return color
if(_replacementColorTree == nil || _replacementColorTree.count == 0) {
if (_replacementColorTree == nil || _replacementColorTree.count == 0) {
return color;
}
// check the mappings
NSColor * found = nil;
NSColor* found = nil;
color = [IJSVGColor computeColorSpace:color];
if((found = _replacementColorTree[color]) != nil) {
if ((found = _replacementColorTree[color]) != nil) {
return found;
}
return color;
@@ -52,7 +52,7 @@
- (void)_invalidateColorTree
{
[_replacementColorTree release], _replacementColorTree = nil;
(void)([_replacementColorTree release]), _replacementColorTree = nil;
_replacementColorTree = [[NSMutableDictionary alloc] init];
}
@@ -61,53 +61,52 @@
[self _invalidateColorTree];
}
- (void)removeReplacementColor:(NSColor *)color
- (void)removeReplacementColor:(NSColor*)color
{
if(_replacementColorTree == nil) {
if (_replacementColorTree == nil) {
return;
}
[_replacementColorTree removeObjectForKey:[IJSVGColor computeColorSpace:color]];
}
- (void)setReplacementColor:(NSColor *)newColor
forColor:(NSColor *)color
- (void)setReplacementColor:(NSColor*)newColor
forColor:(NSColor*)color
{
color = [IJSVGColor computeColorSpace:color];
newColor = [IJSVGColor computeColorSpace:newColor];
_replacementColorTree[color] = newColor;
}
- (void)setReplacementColors:(NSDictionary<NSColor *, NSColor *> *)colors
- (void)setReplacementColors:(NSDictionary<NSColor*, NSColor*>*)colors
clearExistingColors:(BOOL)clearExistingColors
{
if(clearExistingColors == YES) {
if (clearExistingColors == YES) {
[self _invalidateColorTree];
}
for(NSColor * oldColor in colors) {
for (NSColor* oldColor in colors) {
[self setReplacementColor:colors[oldColor]
forColor:oldColor];
}
}
- (NSSet<NSColor *> *)colors
- (NSSet<NSColor*>*)colors
{
return [NSSet setWithSet:_colors];
}
- (void)addColorsFromList:(IJSVGColorList *)sheet
- (void)addColorsFromList:(IJSVGColorList*)sheet
{
[_colors addObjectsFromArray:sheet.colors.allObjects];
}
- (void)addColor:(NSColor *)color
- (void)addColor:(NSColor*)color
{
[_colors addObject:[IJSVGColor computeColorSpace:color]];
}
- (void)removeColor:(NSColor *)color
- (void)removeColor:(NSColor*)color
{
[_colors removeObject:[IJSVGColor computeColorSpace:color]];
}
@end
+35 -37
View File
@@ -6,59 +6,57 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGPath.h"
#import <Foundation/Foundation.h>
typedef NS_ENUM( NSInteger, IJSVGCommandType ) {
static const NSInteger IJSVGCustomVariableParameterCount = NSNotFound;
typedef NS_ENUM(NSInteger, IJSVGCommandType) {
IJSVGCommandTypeAbsolute,
IJSVGCommandTypeRelative
};
@class IJSVGCommand;
@protocol IJSVGCommandProtocol <NSObject>
@required
+ (void)runWithParams:(CGFloat *)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path;
+ (NSInteger)requiredParameterCount;
@end
@interface IJSVGCommand : NSObject {
NSString * commandString;
NSString * command;
CGFloat * parameters;
NSString* commandString;
NSString* command;
CGFloat* parameters;
NSInteger parameterCount;
NSMutableArray * subCommands;
NSMutableArray* subCommands;
NSInteger requiredParameters;
IJSVGCommandType type;
IJSVGCommand * previousCommand;
IJSVGCommand* previousCommand;
NSInteger _currentIndex;
Class<IJSVGCommandProtocol> commandClass;
BOOL isSubCommand;
}
@property ( nonatomic, copy ) NSString * commandString;
@property ( nonatomic, copy ) NSString * command;
@property ( nonatomic, assign ) CGFloat * parameters;
@property ( nonatomic, assign ) NSInteger parameterCount;
@property ( nonatomic, assign ) NSInteger requiredParameters;
@property ( nonatomic, assign ) IJSVGCommandType type;
@property ( nonatomic, retain ) NSMutableArray * subCommands;
@property ( nonatomic, assign ) Class<IJSVGCommandProtocol> commandClass;
@property ( nonatomic, assign ) IJSVGCommand * previousCommand;
@property ( nonatomic, assign ) BOOL isSubCommand;
@property (nonatomic, copy) NSString* commandString;
@property (nonatomic, copy) NSString* command;
@property (nonatomic, assign) CGFloat* parameters;
@property (nonatomic, assign) NSInteger parameterCount;
@property (nonatomic, assign) NSInteger requiredParameters;
@property (nonatomic, assign) IJSVGCommandType type;
@property (nonatomic, retain) NSMutableArray<IJSVGCommand*>* subCommands;
@property (nonatomic, assign) IJSVGCommand* previousCommand;
@property (nonatomic, assign) BOOL isSubCommand;
- (id)initWithCommandString:(NSString *)commandString;
+ (NSPoint)readCoordinatePair:(CGFloat *)pairs
+ (Class)commandClassForCommandChar:(char)aChar;
+ (NSInteger)requiredParameterCount;
+ (NSPoint)readCoordinatePair:(CGFloat*)pairs
index:(NSInteger)index;
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath*)path;
+ (void)parseParams:(CGFloat*)params
paramCount:(NSInteger)paramCount
intoArray:(NSMutableArray<IJSVGCommand*>*)commands
parentCommand:(IJSVGCommand*)parentCommand;
- (id)initWithCommandString:(NSString*)commandString;
- (IJSVGCommand*)subcommandWithParameters:(CGFloat*)subParams
previousCommand:(IJSVGCommand*)command;
- (CGFloat)readFloat;
- (NSPoint)readPoint;
+138 -78
View File
@@ -9,16 +9,16 @@
#import "IJSVGCommand.h"
#import "IJSVGUtils.h"
#import "IJSVGCommandArc.h"
#import "IJSVGCommandMove.h"
#import "IJSVGCommandClose.h"
#import "IJSVGCommandCurve.h"
#import "IJSVGCommandLineTo.h"
#import "IJSVGCommandVerticalLine.h"
#import "IJSVGCommandEllipticalArc.h"
#import "IJSVGCommandHorizontalLine.h"
#import "IJSVGCommandSmoothCurve.h"
#import "IJSVGCommandLineTo.h"
#import "IJSVGCommandMove.h"
#import "IJSVGCommandQuadraticCurve.h"
#import "IJSVGCommandCommandSmoothQuadraticCurve.h"
#import "IJSVGCommandSmoothCurve.h"
#import "IJSVGCommandSmoothQuadraticCurve.h"
#import "IJSVGCommandVerticalLine.h"
@implementation IJSVGCommand
@@ -27,76 +27,41 @@
@synthesize parameterCount;
@synthesize parameters;
@synthesize subCommands;
@synthesize commandClass;
@synthesize requiredParameters;
@synthesize type;
@synthesize previousCommand;
@synthesize isSubCommand;
- (void)dealloc
+ (BOOL)requiresCustomParameterParsing
{
[commandString release], commandString = nil;
[command release], command = nil;
[subCommands release], subCommands = nil;
free( parameters );
[super dealloc];
return NO;
}
- (id)initWithCommandString:(NSString *)str
+ (NSInteger)requiredParameterCount
{
if( ( self = [super init] ) != nil )
{
// work out the basics
_currentIndex = 0;
command = [[str substringToIndex:1] copy];
type = [IJSVGUtils typeForCommandString:self.command];
commandClass = [self.class commandClassForCommandChar:[self.command characterAtIndex:0]];
parameters = [IJSVGUtils commandParameters:str count:&parameterCount];
requiredParameters = [self.commandClass requiredParameterCount];
// now work out the sets of parameters we have
// each command could have a series of subcommands
// if there is a multiple of commands in a command
// then we need to work those out...
NSInteger sets = 1;
if( self.requiredParameters != 0 ) {
sets = self.parameterCount/self.requiredParameters;
}
subCommands = [[NSMutableArray alloc] initWithCapacity:sets];
// interate over the sets
for( NSInteger i = 0; i < sets; i++ ) {
// memory for this will be handled by the created subcommand
CGFloat * subParams = 0;
if( self.requiredParameters != 0 ) {
subParams = (CGFloat*)malloc(self.requiredParameters*sizeof(CGFloat));
for( NSInteger p = 0; p < self.requiredParameters; p++ ) {
subParams[p] = self.parameters[i*self.requiredParameters+p];
}
}
// create a subcommand per set
IJSVGCommand * c = [[[self.class alloc] init] autorelease];
c.parameterCount = self.requiredParameters;
c.parameters = subParams;
c.type = self.type;
c.command = self.command;
c.previousCommand = self.subCommands.lastObject;
c.commandClass = self.commandClass;
c.isSubCommand = i == 0 ? NO : YES;
// add it to our tree
[self.subCommands addObject:c];
}
}
return self;
return 1;
}
+ (NSPoint)readCoordinatePair:(CGFloat *)pairs
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath*)path
{
}
+ (void)parseParams:(CGFloat*)params
paramCount:(NSInteger)paramCount
intoArray:(NSMutableArray<IJSVGCommand*>*)commands
parentCommand:(IJSVGCommand*)parentCommand
{
}
+ (NSPoint)readCoordinatePair:(CGFloat*)pairs
index:(NSInteger)index
{
return NSMakePoint( pairs[index*2], pairs[index*2+1]);
return NSMakePoint(pairs[index * 2], pairs[index * 2 + 1]);
}
+ (void)load
@@ -104,24 +69,119 @@
// register here...
}
+ (Class<IJSVGCommandProtocol>)commandClassForCommandChar:(char)aChar
+ (Class)commandClassForCommandChar:(char)aChar
{
aChar = tolower(aChar);
switch(aChar) {
case 'a': return IJSVGCommandArc.class;
case 'c': return IJSVGCommandCurve.class;
case 'h': return IJSVGCommandHorizontalLine.class;
case 'l': return IJSVGCommandLineTo.class;
case 'm': return IJSVGCommandMove.class;
case 'q': return IJSVGCommandQuadraticCurve.class;
case 's': return IJSVGCommandSmoothCurve.class;
case 't': return IJSVGCommandCommandSmoothQuadraticCurve.class;
case 'v': return IJSVGCommandVerticalLine.class;
case 'z': return IJSVGCommandClose.class;
switch (aChar) {
case 'a':
return IJSVGCommandEllipticalArc.class;
case 'c':
return IJSVGCommandCurve.class;
case 'h':
return IJSVGCommandHorizontalLine.class;
case 'l':
return IJSVGCommandLineTo.class;
case 'm':
return IJSVGCommandMove.class;
case 'q':
return IJSVGCommandQuadraticCurve.class;
case 's':
return IJSVGCommandSmoothCurve.class;
case 't':
return IJSVGCommandSmoothQuadraticCurve.class;
case 'v':
return IJSVGCommandVerticalLine.class;
case 'z':
return IJSVGCommandClose.class;
}
return nil;
}
- (void)dealloc
{
(void)([commandString release]), commandString = nil;
(void)([command release]), command = nil;
(void)([subCommands release]), subCommands = nil;
(void)(free(parameters)), parameters = nil;
[super dealloc];
}
- (id)initWithCommandString:(NSString*)str
{
if ((self = [super init]) != nil) {
// work out the basics
_currentIndex = 0;
command = [[str substringToIndex:1] copy];
type = [IJSVGUtils typeForCommandString:self.command];
parameters = [IJSVGUtils commandParameters:str
count:&parameterCount];
requiredParameters = [self.class requiredParameterCount];
// check what required params we need
if (requiredParameters == IJSVGCustomVariableParameterCount) {
// looks like we require variable params
subCommands = [[NSMutableArray alloc] init];
// parse the custom params
[self.class parseParams:parameters
paramCount:parameterCount
intoArray:subCommands
parentCommand:self];
} else {
// now work out the sets of parameters we have
// each command could have a series of subcommands
// if there is a multiple of commands in a command
// then we need to work those out...
NSInteger sets = 1;
if (self.requiredParameters != 0) {
sets = (self.parameterCount / self.requiredParameters);
}
subCommands = [[NSMutableArray alloc] initWithCapacity:sets];
// interate over the sets
IJSVGCommand* lastCommand = nil;
for (NSInteger i = 0; i < sets; i++) {
// memory for this will be handled by the created subcommand
CGFloat* subParams = 0;
if (self.requiredParameters != 0) {
subParams = (CGFloat*)malloc(self.requiredParameters * sizeof(CGFloat));
for (NSInteger p = 0; p < self.requiredParameters; p++) {
subParams[p] = self.parameters[i * self.requiredParameters + p];
}
}
// generate the subcommand
IJSVGCommand* command = [self subcommandWithParameters:subParams
previousCommand:lastCommand];
// make sure we assign the last command or hell breaks
// lose and the firey demons will run wild, namely, commands will break
// if they are multiples of a set
lastCommand = command;
// add it to our tree
[subCommands addObject:command];
}
}
}
return self;
}
- (IJSVGCommand*)subcommandWithParameters:(CGFloat*)subParams
previousCommand:(IJSVGCommand*)aPreviousCommand
{
// create a subcommand per set
IJSVGCommand* c = [[[self.class alloc] init] autorelease];
c.parameterCount = self.requiredParameters;
c.parameters = subParams;
c.type = self.type;
c.command = self.command;
c.previousCommand = aPreviousCommand;
c.isSubCommand = aPreviousCommand != nil;
return c;
}
- (CGFloat)readFloat
{
CGFloat f = parameters[_currentIndex];
@@ -132,9 +192,9 @@
- (NSPoint)readPoint
{
CGFloat x = parameters[_currentIndex];
CGFloat y = parameters[_currentIndex+1];
_currentIndex+=2;
return NSMakePoint( x, y );
CGFloat y = parameters[_currentIndex + 1];
_currentIndex += 2;
return NSMakePoint(x, y);
}
- (BOOL)readBOOL
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandClose : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandClose : IJSVGCommand
@end
+4 -4
View File
@@ -15,12 +15,12 @@
return 0;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
[path close];
}
@@ -1,60 +0,0 @@
//
// IJSVGCommandCommandQuadraticCurve.m
// IconJar
//
// Created by Curtis Hard on 30/08/2014.
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandCommandSmoothQuadraticCurve.h"
#import "IJSVGUtils.h"
#import "IJSVGCommandQuadraticCurve.h"
@implementation IJSVGCommandCommandSmoothQuadraticCurve
+ (NSInteger)requiredParameterCount
{
return 2;
}
+ (void)runWithParams:(CGFloat *)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
{
NSPoint commandPoint = NSMakePoint( [path currentSubpath].currentPoint.x, [path currentSubpath].currentPoint.y );
if( command != nil )
{
if( command.commandClass == [IJSVGCommandQuadraticCurve class] )
{
// quadratic curve
if( command.type == IJSVGCommandTypeAbsolute )
{
commandPoint = NSMakePoint(-1*command.parameters[0] + 2*[path currentSubpath].currentPoint.x,
-1*command.parameters[1] + 2*[path currentSubpath].currentPoint.y);
} else {
NSPoint oldPoint = CGPointMake([path currentSubpath].currentPoint.x - command.parameters[2],
[path currentSubpath].currentPoint.y - command.parameters[3]);
commandPoint = CGPointMake(-1*(command.parameters[0] + oldPoint.x) + 2*([path currentSubpath].currentPoint.x),
-1*(command.parameters[1] + oldPoint.y) + 2*[path currentSubpath].currentPoint.y);
}
} else if( command.commandClass == self.class ) {
// smooth quadratic curve
commandPoint = CGPointMake(-1*(path.lastControlPoint.x) + 2*([path currentSubpath].currentPoint.x),
-1*(path.lastControlPoint.y) + 2*[path currentSubpath].currentPoint.y);
}
}
path.lastControlPoint = commandPoint;
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint(params[0], params[1])
controlPoint:commandPoint];
return;
}
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])
controlPoint:commandPoint];
}
@end
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandCurve : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandCurve : IJSVGCommand
@end
+11 -12
View File
@@ -15,23 +15,22 @@
return 6;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
if( type == IJSVGCommandTypeAbsolute ) {
[[path currentSubpath] curveToPoint:NSMakePoint( params[4], params[5])
controlPoint1:NSMakePoint( params[0], params[1])
controlPoint2:NSMakePoint( params[2], params[3])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] curveToPoint:NSMakePoint(params[4], params[5])
controlPoint1:NSMakePoint(params[0], params[1])
controlPoint2:NSMakePoint(params[2], params[3])];
return;
}
[[path currentSubpath] relativeCurveToPoint:NSMakePoint( params[4], params[5])
controlPoint1:NSMakePoint( params[0], params[1])
controlPoint2:NSMakePoint( params[2], params[3])];
[[path currentSubpath] relativeCurveToPoint:NSMakePoint(params[4], params[5])
controlPoint1:NSMakePoint(params[0], params[1])
controlPoint2:NSMakePoint(params[2], params[3])];
}
@end
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandArc : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandEllipticalArc : IJSVGCommand
@end
@@ -6,23 +6,22 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandArc.h"
#import "IJSVGCommandEllipticalArc.h"
#import "IJSVGUtils.h"
@implementation IJSVGCommandArc
@implementation IJSVGCommandEllipticalArc
+ (NSInteger)requiredParameterCount
{
return 7;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
CGPoint radii = CGPointZero;
CGPoint arcEndPoint = CGPointZero;
@@ -30,79 +29,77 @@
CGFloat xAxisRotation = 0;
BOOL largeArcFlag = 0;
BOOL sweepFlag = 0;
radii = [currentCommand readPoint];
xAxisRotation = [currentCommand readFloat];
largeArcFlag = [currentCommand readBOOL];
sweepFlag = [currentCommand readBOOL];
arcEndPoint = [currentCommand readPoint];
if (type == IJSVGCommandTypeRelative) {
arcEndPoint.x += path.currentPoint.x;
arcEndPoint.y += path.currentPoint.y;
}
xAxisRotation *= M_PI / 180.f;
CGPoint currentPoint = CGPointMake(cos(xAxisRotation) * (arcStartPoint.x - arcEndPoint.x) / 2.0 + sin(xAxisRotation) * (arcStartPoint.y - arcEndPoint.y) / 2.0, -sin(xAxisRotation) * (arcStartPoint.x - arcEndPoint.x) / 2.0 + cos(xAxisRotation) * (arcStartPoint.y - arcEndPoint.y) / 2.0);
CGFloat radiiAdjustment = pow(currentPoint.x, 2) / pow(radii.x, 2) + pow(currentPoint.y, 2) / pow(radii.y, 2);
radii.x *= (radiiAdjustment > 1) ? sqrt(radiiAdjustment) : 1;
radii.y *= (radiiAdjustment > 1) ? sqrt(radiiAdjustment) : 1;
CGFloat sweep = (largeArcFlag == sweepFlag ? -1 : 1) * sqrt(((pow(radii.x, 2) * pow(radii.y, 2)) - (pow(radii.x, 2) * pow(currentPoint.y, 2)) - (pow(radii.y, 2) * pow(currentPoint.x, 2))) / (pow(radii.x, 2) * pow(currentPoint.y, 2) + pow(radii.y, 2) * pow(currentPoint.x, 2)));
sweep = (sweep != sweep) ? 0 : sweep;
CGPoint preCenterPoint = CGPointMake(sweep * radii.x * currentPoint.y / radii.y, sweep * -radii.y * currentPoint.x / radii.x);
CGPoint centerPoint = CGPointMake((arcStartPoint.x + arcEndPoint.x) / 2.0 + cos(xAxisRotation) * preCenterPoint.x - sin(xAxisRotation) * preCenterPoint.y, (arcStartPoint.y + arcEndPoint.y) / 2.0 + sin(xAxisRotation) * preCenterPoint.x + cos(xAxisRotation) * preCenterPoint.y);
CGFloat startAngle = angle(CGPointMake(1, 0), CGPointMake((currentPoint.x-preCenterPoint.x)/radii.x,
(currentPoint.y-preCenterPoint.y)/radii.y));
CGFloat startAngle = angle(CGPointMake(1, 0), CGPointMake((currentPoint.x - preCenterPoint.x) / radii.x, (currentPoint.y - preCenterPoint.y) / radii.y));
CGPoint deltaU = CGPointMake((currentPoint.x - preCenterPoint.x) / radii.x,
(currentPoint.y - preCenterPoint.y) / radii.y);
(currentPoint.y - preCenterPoint.y) / radii.y);
CGPoint deltaV = CGPointMake((-currentPoint.x - preCenterPoint.x) / radii.x,
(-currentPoint.y - preCenterPoint.y) / radii.y);
(-currentPoint.y - preCenterPoint.y) / radii.y);
CGFloat angleDelta = (deltaU.x * deltaV.y < deltaU.y * deltaV.x ? -1 : 1) * acos(ratio(deltaU, deltaV));
angleDelta = (ratio(deltaU, deltaV) <= -1) ? M_PI : (ratio(deltaU, deltaV) >= 1) ? 0 : angleDelta;
// check for actually numbers, if this is not valid
// kill it, blame WWDC 2017 SVG background for this...
if(isnan(startAngle) || isnan(angleDelta)) {
if (isnan(startAngle) || isnan(angleDelta)) {
return;
}
CGFloat radius = MAX(radii.x, radii.y);
CGPoint scale = (radii.x > radii.y) ? CGPointMake(1, radii.y / radii.x) :
CGPointMake(radii.x / radii.y, 1);
NSAffineTransform * trans = [NSAffineTransform transform];
CGPoint scale = (radii.x > radii.y) ? CGPointMake(1, radii.y / radii.x) : CGPointMake(radii.x / radii.y, 1);
NSAffineTransform* trans = NSAffineTransform.transform;
[trans translateXBy:-centerPoint.x yBy:-centerPoint.y];
[path.currentSubpath transformUsingAffineTransform:trans];
trans = [NSAffineTransform transform];
trans = NSAffineTransform.transform;
[trans rotateByRadians:-xAxisRotation];
[path.currentSubpath transformUsingAffineTransform:trans];
trans = [NSAffineTransform transform];
[trans scaleXBy:(1/scale.x) yBy:(1/scale.y)];
trans = NSAffineTransform.transform;
[trans scaleXBy:(1 / scale.x) yBy:(1 / scale.y)];
[path.currentSubpath transformUsingAffineTransform:trans];
[path.currentSubpath appendBezierPathWithArcWithCenter:NSZeroPoint
radius:radius
startAngle:radians_to_degrees(startAngle)
endAngle:radians_to_degrees(startAngle + angleDelta)
clockwise:!sweepFlag];
trans = [NSAffineTransform transform];
trans = NSAffineTransform.transform;
[trans scaleXBy:scale.x yBy:scale.y];
[path.currentSubpath transformUsingAffineTransform:trans];
trans = [NSAffineTransform transform];
trans = NSAffineTransform.transform;
[trans rotateByRadians:xAxisRotation];
[path.currentSubpath transformUsingAffineTransform:trans];
trans = [NSAffineTransform transform];
trans = NSAffineTransform.transform;
[trans translateXBy:centerPoint.x yBy:centerPoint.y];
[path.currentSubpath transformUsingAffineTransform:trans];
}
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandHorizontalLine : NSObject <IJSVGCommandProtocol>
@interface IJSVGCommandHorizontalLine : IJSVGCommand
@end
+7 -8
View File
@@ -15,19 +15,18 @@
return 1;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] lineToPoint:NSMakePoint( params[0], [path currentSubpath].currentPoint.y)];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] lineToPoint:NSMakePoint(params[0], [path currentSubpath].currentPoint.y)];
return;
}
[[path currentSubpath] relativeLineToPoint:NSMakePoint( params[0], 0.f)];
[[path currentSubpath] relativeLineToPoint:NSMakePoint(params[0], 0.f)];
}
@end
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandLineTo : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandLineTo : IJSVGCommand
@end
+7 -7
View File
@@ -15,19 +15,19 @@
return 2;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
if( type == IJSVGCommandTypeAbsolute ) {
[[path currentSubpath] lineToPoint:NSMakePoint( params[0], params[1])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] lineToPoint:NSMakePoint(params[0], params[1])];
return;
}
NSPoint point = NSMakePoint([path currentSubpath].currentPoint.x + params[0],
[path currentSubpath].currentPoint.y + params[1]);
[path currentSubpath].currentPoint.y + params[1]);
[[path currentSubpath] lineToPoint:point];
}
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandMove : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandMove : IJSVGCommand
@end
+12 -13
View File
@@ -6,9 +6,8 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandMove.h"
#import "IJSVGCommandLineTo.h"
#import "IJSVGCommandMove.h"
@implementation IJSVGCommandMove
@@ -17,16 +16,16 @@
return 2;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
// move to's allow more then one move to, but if there are more then one,
// we need to run the line to instead...who knew!
if( command.commandClass == self.class && currentCommand.isSubCommand == YES) {
if (command.class == self.class && currentCommand.isSubCommand == YES) {
[IJSVGCommandLineTo runWithParams:params
paramCount:count
command:currentCommand
@@ -35,17 +34,17 @@
path:path];
return;
}
// actual move to command
if( type == IJSVGCommandTypeAbsolute ) {
[[path currentSubpath] moveToPoint:NSMakePoint( params[0], params[1])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] moveToPoint:NSMakePoint(params[0], params[1])];
return;
}
@try {
[[path currentSubpath] relativeMoveToPoint:NSMakePoint( params[0], params[1])];
[[path currentSubpath] relativeMoveToPoint:NSMakePoint(params[0], params[1])];
}
@catch (NSException *exception) {
[[path currentSubpath] moveToPoint:NSMakePoint( params[0], params[1])];
@catch (NSException* exception) {
[[path currentSubpath] moveToPoint:NSMakePoint(params[0], params[1])];
}
}
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandQuadraticCurve : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandQuadraticCurve : IJSVGCommand
@end
+7 -8
View File
@@ -16,17 +16,16 @@
return 4;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint( params[2], params[3])
controlPoint:NSMakePoint( params[0], params[1])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint(params[2], params[3])
controlPoint:NSMakePoint(params[0], params[1])];
return;
}
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[2], [path currentSubpath].currentPoint.y + params[3])
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandSmoothCurve : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandSmoothCurve : IJSVGCommand
@end
+28 -33
View File
@@ -6,8 +6,8 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandSmoothCurve.h"
#import "IJSVGCommandCurve.h"
#import "IJSVGCommandSmoothCurve.h"
#import "IJSVGUtils.h"
@implementation IJSVGCommandSmoothCurve
@@ -17,53 +17,48 @@
return 4;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
NSPoint firstControl = NSMakePoint( [path currentSubpath].currentPoint.x, [path currentSubpath].currentPoint.y );
if( command != nil )
{
if( command.commandClass == [IJSVGCommandCurve class] || command.commandClass == self.class )
{
if( command.commandClass == [IJSVGCommandCurve class] )
{
if( command.type == IJSVGCommandTypeAbsolute )
{
firstControl = NSMakePoint(-1*command.parameters[2] + 2*[path currentSubpath].currentPoint.x,
-1*command.parameters[3] + 2*[path currentSubpath].currentPoint.y);
NSPoint firstControl = NSMakePoint([path currentSubpath].currentPoint.x, [path currentSubpath].currentPoint.y);
if (command != nil) {
if (command.class == [IJSVGCommandCurve class] || command.class == self.class) {
if (command.class == [IJSVGCommandCurve class]) {
if (command.type == IJSVGCommandTypeAbsolute) {
firstControl = NSMakePoint(-1 * command.parameters[2] + 2 * [path currentSubpath].currentPoint.x,
-1 * command.parameters[3] + 2 * [path currentSubpath].currentPoint.y);
} else {
NSPoint oldPoint = NSMakePoint([path currentSubpath].currentPoint.x - command.parameters[4],
[path currentSubpath].currentPoint.y - command.parameters[5]);
firstControl = NSMakePoint(-1*(command.parameters[2] + oldPoint.x) + 2*[path currentSubpath].currentPoint.x,
-1*(command.parameters[3] + oldPoint.y) + 2*[path currentSubpath].currentPoint.y);
[path currentSubpath].currentPoint.y - command.parameters[5]);
firstControl = NSMakePoint(-1 * (command.parameters[2] + oldPoint.x) + 2 * [path currentSubpath].currentPoint.x,
-1 * (command.parameters[3] + oldPoint.y) + 2 * [path currentSubpath].currentPoint.y);
}
} else {
if( command.type == IJSVGCommandTypeAbsolute ) {
firstControl = NSMakePoint(-1*command.parameters[0] + 2*[path currentSubpath].currentPoint.x,
-1*command.parameters[1] + 2*[path currentSubpath].currentPoint.y);
if (command.type == IJSVGCommandTypeAbsolute) {
firstControl = NSMakePoint(-1 * command.parameters[0] + 2 * [path currentSubpath].currentPoint.x,
-1 * command.parameters[1] + 2 * [path currentSubpath].currentPoint.y);
} else {
NSPoint oldPoint = NSMakePoint([path currentSubpath].currentPoint.x - command.parameters[2],
[path currentSubpath].currentPoint.y - command.parameters[3]);
firstControl = NSMakePoint(-1*(command.parameters[0] + oldPoint.x) + 2*[path currentSubpath].currentPoint.x,
-1*(command.parameters[1] + oldPoint.y) + 2*[path currentSubpath].currentPoint.y);
[path currentSubpath].currentPoint.y - command.parameters[3]);
firstControl = NSMakePoint(-1 * (command.parameters[0] + oldPoint.x) + 2 * [path currentSubpath].currentPoint.x,
-1 * (command.parameters[1] + oldPoint.y) + 2 * [path currentSubpath].currentPoint.y);
}
}
}
}
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] curveToPoint:NSMakePoint( params[2], params[3])
controlPoint1:NSMakePoint( firstControl.x, firstControl.y )
controlPoint2:NSMakePoint(params[0], params[1])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] curveToPoint:NSMakePoint(params[2], params[3])
controlPoint1:NSMakePoint(firstControl.x, firstControl.y)
controlPoint2:NSMakePoint(params[0], params[1])];
return;
}
[[path currentSubpath] curveToPoint:NSMakePoint( [path currentSubpath].currentPoint.x + params[2], [path currentSubpath].currentPoint.y + params[3])
controlPoint1:NSMakePoint( firstControl.x, firstControl.y )
controlPoint2:NSMakePoint( [path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])];
[[path currentSubpath] curveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[2], [path currentSubpath].currentPoint.y + params[3])
controlPoint1:NSMakePoint(firstControl.x, firstControl.y)
controlPoint2:NSMakePoint([path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])];
}
@end
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandCommandSmoothQuadraticCurve : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandSmoothQuadraticCurve : IJSVGCommand
@end
+56
View File
@@ -0,0 +1,56 @@
//
// IJSVGCommandCommandQuadraticCurve.m
// IconJar
//
// Created by Curtis Hard on 30/08/2014.
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandQuadraticCurve.h"
#import "IJSVGCommandSmoothQuadraticCurve.h"
#import "IJSVGUtils.h"
@implementation IJSVGCommandSmoothQuadraticCurve
+ (NSInteger)requiredParameterCount
{
return 2;
}
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath*)path
{
NSPoint commandPoint = NSMakePoint([path currentSubpath].currentPoint.x, [path currentSubpath].currentPoint.y);
if (command != nil) {
if (command.class == IJSVGCommandQuadraticCurve.class) {
// quadratic curve
if (command.type == IJSVGCommandTypeAbsolute) {
commandPoint = NSMakePoint(-1 * command.parameters[0] + 2 * [path currentSubpath].currentPoint.x,
-1 * command.parameters[1] + 2 * [path currentSubpath].currentPoint.y);
} else {
NSPoint oldPoint = CGPointMake([path currentSubpath].currentPoint.x - command.parameters[2],
[path currentSubpath].currentPoint.y - command.parameters[3]);
commandPoint = CGPointMake(-1 * (command.parameters[0] + oldPoint.x) + 2 * ([path currentSubpath].currentPoint.x),
-1 * (command.parameters[1] + oldPoint.y) + 2 * [path currentSubpath].currentPoint.y);
}
} else if (command.class == self.class) {
// smooth quadratic curve
commandPoint = CGPointMake(-1 * (path.lastControlPoint.x) + 2 * ([path currentSubpath].currentPoint.x),
-1 * (path.lastControlPoint.y) + 2 * [path currentSubpath].currentPoint.y);
}
}
path.lastControlPoint = commandPoint;
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint(params[0], params[1])
controlPoint:commandPoint];
return;
}
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])
controlPoint:commandPoint];
}
@end
+2 -2
View File
@@ -6,9 +6,9 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGCommand.h"
#import <Foundation/Foundation.h>
@interface IJSVGCommandVerticalLine : IJSVGCommand <IJSVGCommandProtocol>
@interface IJSVGCommandVerticalLine : IJSVGCommand
@end
+7 -8
View File
@@ -15,19 +15,18 @@
return 1;
}
+ (void)runWithParams:(CGFloat *)params
+ (void)runWithParams:(CGFloat*)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
command:(IJSVGCommand*)currentCommand
previousCommand:(IJSVGCommand*)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] lineToPoint:NSMakePoint( [path currentSubpath].currentPoint.x, params[0])];
if (type == IJSVGCommandTypeAbsolute) {
[[path currentSubpath] lineToPoint:NSMakePoint([path currentSubpath].currentPoint.x, params[0])];
return;
}
[[path currentSubpath] relativeLineToPoint:NSMakePoint( 0.f, params[0])];
[[path currentSubpath] relativeLineToPoint:NSMakePoint(0.f, params[0])];
}
@end
+3 -4
View File
@@ -6,16 +6,15 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGNode.h"
#import <Foundation/Foundation.h>
@interface IJSVGDef : IJSVGNode {
@private
NSMutableDictionary * _dict;
NSMutableDictionary* _dict;
}
- (void)addDef:(IJSVGNode *)aDef;
- (void)addDef:(IJSVGNode*)aDef;
@end
+5 -5
View File
@@ -12,28 +12,28 @@
- (void)dealloc
{
[_dict release], _dict = nil;
(void)([_dict release]), _dict = nil;
[super dealloc];
}
- (id)init
{
if( ( self = [super initWithDef:NO] ) != nil ) {
if ((self = [super initWithDef:NO]) != nil) {
_dict = [[NSMutableDictionary alloc] init];
}
return self;
}
- (void)addDef:(IJSVGNode *)aDef
- (void)addDef:(IJSVGNode*)aDef
{
if( aDef.identifier == nil ) {
if (aDef.identifier == nil) {
return;
}
[_dict setObject:aDef
forKey:aDef.identifier];
}
- (IJSVGDef *)defForID:(NSString *)anID
- (IJSVGDef*)defForID:(NSString*)anID
{
return [_dict objectForKey:anID];
}
+2 -2
View File
@@ -8,9 +8,9 @@
#import <Foundation/Foundation.h>
static NSString * const IJSVGErrorDomain = @"IJSVGErrorDomain";
static NSString* const IJSVGErrorDomain = @"IJSVGErrorDomain";
NS_ENUM(NSInteger) {
NS_ENUM(NSInteger){
IJSVGErrorReadingFile,
IJSVGErrorParsingFile,
IJSVGErrorParsingSVG,
+16 -25
View File
@@ -10,11 +10,11 @@
@class IJSVG;
typedef void (^IJSVGCGPathHandler)(const CGPathElement * pathElement);
typedef void (^IJSVGCGPathHandler)(const CGPathElement* pathElement);
void IJSVGExporterPathCaller(void * info, const CGPathElement * pathElement);
void IJSVGExporterPathCaller(void* info, const CGPathElement* pathElement);
typedef NS_OPTIONS( NSInteger, IJSVGExporterOptions) {
typedef NS_OPTIONS(NSInteger, IJSVGExporterOptions) {
IJSVGExporterOptionNone = 1 << 0,
IJSVGExporterOptionRemoveUselessGroups = 1 << 1,
IJSVGExporterOptionRemoveUselessDef = 1 << 2,
@@ -29,42 +29,33 @@ typedef NS_OPTIONS( NSInteger, IJSVGExporterOptions) {
IJSVGExporterOptionCollapseGradients = 1 << 11,
IJSVGExporterOptionCreateClasses = 1 << 12,
IJSVGExporterOptionRemoveWidthHeightAttributes = 1 << 13,
IJSVGExporterOptionAll = IJSVGExporterOptionRemoveUselessDef|
IJSVGExporterOptionRemoveUselessGroups|
IJSVGExporterOptionCreateUseForPaths|
IJSVGExporterOptionMoveAttributesToGroup|
IJSVGExporterOptionSortAttributes|
IJSVGExporterOptionCollapseGroups|
IJSVGExporterOptionCleanupPaths|
IJSVGExporterOptionRemoveHiddenElements|
IJSVGExporterOptionScaleToSizeIfNecessary|
IJSVGExporterOptionCompressOutput|
IJSVGExporterOptionCollapseGradients|
IJSVGExporterOptionRemoveWidthHeightAttributes
IJSVGExporterOptionColorAllowRRGGBBAA = 1 << 14,
IJSVGExporterOptionRemoveComments = 1 << 15,
IJSVGExporterOptionAll = IJSVGExporterOptionRemoveUselessDef | IJSVGExporterOptionRemoveUselessGroups | IJSVGExporterOptionCreateUseForPaths | IJSVGExporterOptionMoveAttributesToGroup | IJSVGExporterOptionSortAttributes | IJSVGExporterOptionCollapseGroups | IJSVGExporterOptionCleanupPaths | IJSVGExporterOptionRemoveHiddenElements | IJSVGExporterOptionScaleToSizeIfNecessary | IJSVGExporterOptionCompressOutput | IJSVGExporterOptionCollapseGradients | IJSVGExporterOptionRemoveWidthHeightAttributes | IJSVGExporterOptionColorAllowRRGGBBAA | IJSVGExporterOptionRemoveComments
};
BOOL IJSVGExporterHasOption(IJSVGExporterOptions options, NSInteger option);
@interface IJSVGExporter : NSObject {
@private
IJSVG * _svg;
IJSVG* _svg;
CGSize _size;
IJSVGExporterOptions _options;
NSXMLDocument * _dom;
NSXMLElement * _defElement;
NSXMLElement * _scaledRootNode;
NSXMLDocument* _dom;
NSXMLElement* _defElement;
NSXMLElement* _scaledRootNode;
NSInteger _idCount;
NSInteger _shortIdCount;
}
@property (nonatomic, copy) NSString * title;
@property (nonatomic, copy) NSString * description;
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* description;
- (id)initWithSVG:(IJSVG *)svg
- (id)initWithSVG:(IJSVG*)svg
size:(CGSize)size
options:(IJSVGExporterOptions)options;
- (NSString *)SVGString;
- (NSData *)SVGData;
- (NSString*)SVGString;
- (NSData*)SVGData;
@end
+644 -634
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -9,24 +9,24 @@
#import <Foundation/Foundation.h>
@interface IJSVGExporterPathInstruction : NSObject {
@private
NSInteger _dataCount;
char _instruction;
CGFloat * _data;
CGFloat* _data;
}
+ (NSArray<IJSVGExporterPathInstruction *> *)instructionsFromPath:(CGPathRef)path;
+ (NSArray<IJSVGExporterPathInstruction*>*)instructionsFromPath:(CGPathRef)path;
- (id)initWithInstruction:(char)instruction
dataCount:(NSInteger)floatCount;
- (void)setInstruction:(char)newInstruction;
- (char)instruction;
- (CGFloat *)data;
- (CGFloat*)data;
- (NSInteger)dataLength;
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction *> *)instructions;
+ (NSString *)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction *> *)instructions;
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction*>*)instructions;
+ (NSString*)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction*>*)instructions;
@end
+231 -236
View File
@@ -6,14 +6,14 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import "IJSVGExporterPathInstruction.h"
#import "IJSVGExporter.h"
#import "IJSVGExporterPathInstruction.h"
@implementation IJSVGExporterPathInstruction
- (void)dealloc
{
if(_data != NULL) {
if (_data != NULL) {
free(_data);
}
[super dealloc];
@@ -22,12 +22,12 @@
- (id)initWithInstruction:(char)instruction
dataCount:(NSInteger)floatCount
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
_instruction = instruction;
// only allocate if not zero
if(floatCount != 0) {
_data = (CGFloat *)calloc(sizeof(CGFloat), floatCount);
if (floatCount != 0) {
_data = (CGFloat*)calloc(sizeof(CGFloat), floatCount);
}
}
return self;
@@ -48,321 +48,316 @@
return _instruction;
}
- (CGFloat *)data
- (CGFloat*)data
{
return _data;
}
+ (NSString *)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction *> *)instructions
+ (NSString*)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction*>*)instructions
{
NSMutableArray * pathData = [[[NSMutableArray alloc] init] autorelease];
for(IJSVGExporterPathInstruction * instruction in instructions) {
CGFloat * data = instruction.data;
NSString * str = nil;
switch(instruction.instruction) {
// move
case 'M':
case 'm': {
char * buffer;
asprintf(&buffer, "%c%g,%g", instruction.instruction, data[0], data[1]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// vertical and horizonal line
case 'V':
case 'v':
case 'H':
case 'h': {
char * buffer;
asprintf(&buffer, "%c%g", instruction.instruction, data[0]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// line
case 'L':
case 'l': {
char * buffer;
asprintf(&buffer, "%c%g,%g",instruction.instruction, data[0], data[1]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// curve
case 'C':
case 'c': {
char * buffer;
asprintf(&buffer, "%c%g,%g %g,%g %g,%g", instruction.instruction,
data[0], data[1], data[2], data[3], data[4], data[5]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// quadratic curve
case 'Q':
case 'q': {
char * buffer;
asprintf(&buffer, "%c%g,%g %g,%g", instruction.instruction,
data[0], data[1], data[2], data[3]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// close path
case 'Z':
case 'z': {
str = [NSString stringWithFormat:@"%c",instruction.instruction];
[pathData addObject:str];
}
NSMutableArray* pathData = [[[NSMutableArray alloc] init] autorelease];
for (IJSVGExporterPathInstruction* instruction in instructions) {
CGFloat* data = instruction.data;
NSString* str = nil;
switch (instruction.instruction) {
// move
case 'M':
case 'm': {
char* buffer;
asprintf(&buffer, "%c%g,%g", instruction.instruction, data[0], data[1]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// vertical and horizonal line
case 'V':
case 'v':
case 'H':
case 'h': {
char* buffer;
asprintf(&buffer, "%c%g", instruction.instruction, data[0]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// line
case 'L':
case 'l': {
char* buffer;
asprintf(&buffer, "%c%g,%g", instruction.instruction, data[0], data[1]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// curve
case 'C':
case 'c': {
char* buffer;
asprintf(&buffer, "%c%g,%g %g,%g %g,%g", instruction.instruction,
data[0], data[1], data[2], data[3], data[4], data[5]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// quadratic curve
case 'Q':
case 'q': {
char* buffer;
asprintf(&buffer, "%c%g,%g %g,%g", instruction.instruction,
data[0], data[1], data[2], data[3]);
str = [NSString stringWithCString:buffer
encoding:NSUTF8StringEncoding];
free(buffer);
[pathData addObject:str];
break;
}
// close path
case 'Z':
case 'z': {
str = [NSString stringWithFormat:@"%c", instruction.instruction];
[pathData addObject:str];
}
}
}
return [pathData componentsJoinedByString:@""];
}
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction *> *)instructions
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction*>*)instructions
{
CGFloat point[2] = {0,0};
CGFloat subpathPoint[2] = {0,0};
CGFloat point[2] = { 0, 0 };
CGFloat subpathPoint[2] = { 0, 0 };
NSInteger index = 0;
for(IJSVGExporterPathInstruction * anInstruction in instructions) {
for (IJSVGExporterPathInstruction* anInstruction in instructions) {
char instruction = anInstruction.instruction;
CGFloat * data = anInstruction.data;
CGFloat* data = anInstruction.data;
NSInteger length = anInstruction.dataLength;
if(data != NULL) {
if (data != NULL) {
// already relative
if(instruction == 'm' || instruction == 'c' || instruction == 's' ||
instruction == 'l' || instruction == 'q' || instruction == 't' ||
instruction == 'a') {
point[0] += data[length-2];
point[1] += data[length-1];
if(instruction == 'm') {
if (instruction == 'm' || instruction == 'c' || instruction == 's' || instruction == 'l' || instruction == 'q' || instruction == 't' || instruction == 'a') {
point[0] += data[length - 2];
point[1] += data[length - 1];
if (instruction == 'm') {
subpathPoint[0] = point[0];
subpathPoint[1] = point[1];
}
} else if(instruction == 'h') {
} else if (instruction == 'h') {
point[0] += data[0];
} else if(instruction == 'v') {
} else if (instruction == 'v') {
point[1] += data[0];
}
// convert absolute to relative
if(instruction == 'M') {
if(index > 0) {
if (instruction == 'M') {
if (index > 0) {
instruction = 'm';
}
data[0] -= point[0];
data[1] -= point[1];
subpathPoint[0] = point[0] += data[0];
subpathPoint[1] = point[1] += data[1];
} else if(instruction == 'L' || instruction == 'T') {
} else if (instruction == 'L' || instruction == 'T') {
instruction = tolower(instruction);
data[0] -= point[0];
data[1] -= point[1];
point[0] += data[0];
point[1] += data[1];
} else if(instruction == 'C') {
} else if (instruction == 'C') {
instruction = 'c';
data[0] -= point[0];
data[1] -= point[1];
data[2] -= point[0];
data[3] -= point[1];
data[4] -= point[0];
data[5] -= point[1];
point[0] += data[4];
point[1] += data[5];
} else if(instruction == 'S' || instruction == 'Q') {
} else if (instruction == 'S' || instruction == 'Q') {
instruction = tolower(instruction);
data[0] -= point[0];
data[1] -= point[1];
data[2] -= point[0];
data[3] -= point[1];
point[0] += data[2];
point[1] += data[3];
} else if(instruction == 'A') {
} else if (instruction == 'A') {
instruction = 'a';
data[5] -= point[0];
data[6] -= point[1];
point[0] += data[5];
point[1] += data[6];
} else if(instruction == 'H') {
} else if (instruction == 'H') {
instruction = 'h';
data[0] -= point[0];
point[0] += data[0];
} else if(instruction == 'V') {
} else if (instruction == 'V') {
instruction = 'v';
data[0] -= point[1];
point[1] += data[0];
}
// reset the instruction
[anInstruction setInstruction:instruction];
} else if(instruction == 'Z' || instruction == 'z') {
} else if (instruction == 'Z' || instruction == 'z') {
point[0] = subpathPoint[0];
point[1] = subpathPoint[1];
}
// increment index
index++;
}
}
+ (NSArray<IJSVGExporterPathInstruction *> *)instructionsFromPath:(CGPathRef)path
+ (NSArray<IJSVGExporterPathInstruction*>*)instructionsFromPath:(CGPathRef)path
{
// keep track of the current point
__block CGPoint currentPoint = CGPointZero;
NSMutableArray * instructions = [[[NSMutableArray alloc] init] autorelease];
NSMutableArray* instructions = [[[NSMutableArray alloc] init] autorelease];
// create the path callback
IJSVGCGPathHandler callback = ^(const CGPathElement * pathElement) {
IJSVGExporterPathInstruction * instruction = nil;
IJSVGCGPathHandler callback = ^(const CGPathElement* pathElement) {
IJSVGExporterPathInstruction* instruction = nil;
// work out what to do
switch(pathElement->type) {
case kCGPathElementMoveToPoint: {
// move to command
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'M'
switch (pathElement->type) {
case kCGPathElementMoveToPoint: {
// move to command
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'M'
dataCount:2] autorelease];
CGPoint point = pathElement->points[0];
instruction.data[0] = point.x;
instruction.data[1] = point.y;
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddLineToPoint: {
// line to command
CGPoint point = pathElement->points[0];
if (point.x == currentPoint.x) {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'V'
dataCount:1] autorelease];
instruction.data[0] = point.y;
} else if (point.y == currentPoint.y) {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'H'
dataCount:1] autorelease];
instruction.data[0] = point.x;
} else {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'L'
dataCount:2] autorelease];
CGPoint point = pathElement->points[0];
instruction.data[0] = point.x;
instruction.data[1] = point.y;
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddLineToPoint: {
// line to command
CGPoint point = pathElement->points[0];
if(point.x == currentPoint.x) {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'V'
dataCount:1] autorelease];
instruction.data[0] = point.y;
} else if(point.y == currentPoint.y) {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'H'
dataCount:1] autorelease];
instruction.data[0] = point.x;
} else {
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'L'
dataCount:2] autorelease];
instruction.data[0] = point.x;
instruction.data[1] = point.y;
}
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddQuadCurveToPoint: {
// quad curve to command
CGPoint controlPoint = pathElement->points[0];
CGPoint point = pathElement->points[1];
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'Q'
dataCount:4] autorelease];
instruction.data[0] = controlPoint.x;
instruction.data[1] = controlPoint.y;
instruction.data[2] = point.x;
instruction.data[3] = point.y;
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddCurveToPoint: {
// curve to command
CGPoint controlPoint1 = pathElement->points[0];
CGPoint controlPoint2 = pathElement->points[1];
CGPoint point = pathElement->points[2];
currentPoint = point;
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'C'
dataCount:6] autorelease];
instruction.data[0] = controlPoint1.x;
instruction.data[1] = controlPoint1.y;
instruction.data[2] = controlPoint2.x;
instruction.data[3] = controlPoint2.y;
instruction.data[4] = point.x;
instruction.data[5] = point.y;
[instructions addObject:instruction];
break;
}
case kCGPathElementCloseSubpath: {
// close command
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'Z'
dataCount:0] autorelease];
[instructions addObject:instruction];
break;
}
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddQuadCurveToPoint: {
// quad curve to command
CGPoint controlPoint = pathElement->points[0];
CGPoint point = pathElement->points[1];
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'Q'
dataCount:4] autorelease];
instruction.data[0] = controlPoint.x;
instruction.data[1] = controlPoint.y;
instruction.data[2] = point.x;
instruction.data[3] = point.y;
currentPoint = point;
[instructions addObject:instruction];
break;
}
case kCGPathElementAddCurveToPoint: {
// curve to command
CGPoint controlPoint1 = pathElement->points[0];
CGPoint controlPoint2 = pathElement->points[1];
CGPoint point = pathElement->points[2];
currentPoint = point;
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'C'
dataCount:6] autorelease];
instruction.data[0] = controlPoint1.x;
instruction.data[1] = controlPoint1.y;
instruction.data[2] = controlPoint2.x;
instruction.data[3] = controlPoint2.y;
instruction.data[4] = point.x;
instruction.data[5] = point.y;
[instructions addObject:instruction];
break;
}
case kCGPathElementCloseSubpath: {
// close command
instruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'Z'
dataCount:0] autorelease];
[instructions addObject:instruction];
break;
}
}
};
// apply the
CGPathApply(path, (__bridge void*)callback, IJSVGExporterPathCaller);
// remove last instruction if it was Z -> M
IJSVGExporterPathInstruction * lastInstruction = instructions.lastObject;
if(lastInstruction.instruction == 'M' ||
lastInstruction.instruction == 'm') {
if(instructions.count >= 2) {
NSInteger index = [instructions indexOfObject:lastInstruction]-1;
IJSVGExporterPathInstruction * prevInstruction = instructions[index];
if(prevInstruction.instruction == 'z' ||
prevInstruction.instruction == 'Z') {
IJSVGExporterPathInstruction* lastInstruction = instructions.lastObject;
if (lastInstruction.instruction == 'M' || lastInstruction.instruction == 'm') {
if (instructions.count >= 2) {
NSInteger index = [instructions indexOfObject:lastInstruction] - 1;
IJSVGExporterPathInstruction* prevInstruction = instructions[index];
if (prevInstruction.instruction == 'z' || prevInstruction.instruction == 'Z') {
[instructions removeLastObject];
}
}
+10 -10
View File
@@ -6,24 +6,24 @@
// Copyright (c) 2015 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVG.h"
#import <Foundation/Foundation.h>
typedef void (^IJSVGFontConverterEnumerateBlock)(NSString * unicode, IJSVG * svg);
typedef void (^IJSVGFontConverterEnumerateBlock)(NSString* unicode, IJSVG* svg);
@interface IJSVGFontConverter : NSObject {
@private
NSURL * _url;
NSFont * _font;
NSMutableDictionary<NSString *, id> * _transformedPaths;
NSURL* _url;
NSFont* _font;
NSMutableDictionary<NSString*, id>* _transformedPaths;
}
- (id)initWithFontAtFileURL:(NSURL *)url;
- (NSFont *)font;
- (id)initWithFontAtFileURL:(NSURL*)url;
- (NSFont*)font;
- (void)enumerateUsingBlock:(IJSVGFontConverterEnumerateBlock)block;
+ (IJSVG *)convertIJSVGPathToSVG:(IJSVGPath *)path;
+ (IJSVG *)convertPathToSVG:(CGPathRef)path;
+ (IJSVG*)convertIJSVGPathToSVG:(IJSVGPath*)path;
+ (IJSVG*)convertPathToSVG:(CGPathRef)path;
@end
+41 -41
View File
@@ -6,32 +6,32 @@
// Copyright (c) 2015 Curtis Hard. All rights reserved.
//
#import "IJSVGFontConverter.h"
#import "IJSVGBezierPathAdditions.h"
#import "IJSVGFontConverter.h"
#import "IJSVGShapeLayer.h"
@implementation IJSVGFontConverter
- (void)dealloc
{
[_transformedPaths release], _transformedPaths = nil;
[_url release], _url = nil;
[_font release], _font = nil;
(void)([_transformedPaths release]), _transformedPaths = nil;
(void)([_url release]), _url = nil;
(void)([_font release]), _font = nil;
[super dealloc];
}
- (id)initWithFontAtFileURL:(NSURL *)url
- (id)initWithFontAtFileURL:(NSURL*)url
{
if( ( self = [super init] ) != nil ) {
if ((self = [super init]) != nil) {
_url = [url copy];
// load the font
CGDataProviderRef dataProvider = CGDataProviderCreateWithURL((CFURLRef)_url);
CGFontRef fontRef = CGFontCreateWithDataProvider(dataProvider);
CTFontRef font = CTFontCreateWithGraphicsFont( fontRef, 30.f, NULL, NULL );
CTFontRef font = CTFontCreateWithGraphicsFont(fontRef, 30.f, NULL, NULL);
// toll free bridge between NSFont at CTFont :)
_font = [(NSFont *)font copy];
_font = [(NSFont*)font copy];
CGFontRelease(fontRef);
CGDataProviderRelease(dataProvider);
CFRelease(font);
@@ -39,21 +39,21 @@
return self;
}
- (NSFont *)font
- (NSFont*)font
{
return _font;
}
- (NSArray *)allCharacters
- (NSArray*)allCharacters
{
NSCharacterSet * charSet = _font.coveredCharacterSet;
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
NSCharacterSet* charSet = _font.coveredCharacterSet;
NSMutableArray* array = [[[NSMutableArray alloc] init] autorelease];
NSStringEncoding encoding = NSUTF32LittleEndianStringEncoding;
for( int plane = 0; plane <= 16; plane++ ) {
if( [charSet hasMemberInPlane:plane] ) {
for (int plane = 0; plane <= 16; plane++) {
if ([charSet hasMemberInPlane:plane]) {
UTF32Char c;
for( c = plane << 16; c < (plane+1) << 16; c++ ) {
if( [charSet longCharacterIsMember:c] ) {
for (c = plane << 16; c < (plane + 1) << 16; c++) {
if ([charSet longCharacterIsMember:c]) {
UTF32Char c1 = NSSwapHostIntToLittle(c);
[array addObject:[[[NSString alloc] initWithBytes:&c1
length:4
@@ -68,20 +68,20 @@
- (void)generateMap
{
CTFontRef font = (CTFontRef)_font;
for( NSString * charString in [self allCharacters] ) {
for (NSString* charString in [self allCharacters]) {
// get the characters in each char
NSUInteger count = charString.length;
unichar characters[count];
[charString getCharacters:characters
range:NSMakeRange( 0, count )];
range:NSMakeRange(0, count)];
// get the glyphs
CGGlyph glyphs[count];
CTFontGetGlyphsForCharacters( font, characters, glyphs, count);
CGPathRef path = CTFontCreatePathForGlyph( font, glyphs[0], NULL );
if(path != NULL) {
CTFontGetGlyphsForCharacters(font, characters, glyphs, count);
CGPathRef path = CTFontCreatePathForGlyph(font, glyphs[0], NULL);
if (path != NULL) {
// add SVG to the dictionary
NSString * key = [NSString stringWithFormat:@"%04x",[charString characterAtIndex:0]];
NSString* key = [NSString stringWithFormat:@"%04x", [charString characterAtIndex:0]];
CGPathRef flippedPath = [IJSVGUtils newFlippedCGPath:path];
_transformedPaths[key] = (id)flippedPath;
CGPathRelease(flippedPath);
@@ -92,38 +92,38 @@
- (void)enumerateUsingBlock:(IJSVGFontConverterEnumerateBlock)block
{
if(_transformedPaths == nil) {
if (_transformedPaths == nil) {
_transformedPaths = [[NSMutableDictionary alloc] init];
[self generateMap];
}
for(NSString * key in _transformedPaths.allKeys) {
for (NSString* key in _transformedPaths.allKeys) {
block(key, [self.class convertPathToSVG:(CGPathRef)_transformedPaths[key]]);
}
}
+ (IJSVG *)convertIJSVGPathToSVG:(IJSVGPath *)path
+ (IJSVG*)convertIJSVGPathToSVG:(IJSVGPath*)path
{
CGPathRef cgPath = [IJSVGUtils newCGPathFromBezierPath:path.path];
CGPathRef flippedPath = [IJSVGUtils newFlippedCGPath:cgPath];
IJSVG * svg = [self convertPathToSVG:flippedPath];
IJSVG* svg = [self convertPathToSVG:flippedPath];
CGPathRelease(flippedPath);
CGPathRelease(cgPath);
return svg;
}
+ (IJSVG *)convertPathToSVG:(CGPathRef)path
+ (IJSVG*)convertPathToSVG:(CGPathRef)path
{
__block IJSVG * svg = nil;
IJSVGObtainTransactionLock(^{
IJSVGGroupLayer * layer = [[[IJSVGGroupLayer alloc] init] autorelease];
IJSVGShapeLayer * shape = [[[IJSVGShapeLayer alloc] init] autorelease];
[layer addSublayer:shape];
shape.path = path;
CGRect box = CGPathGetPathBoundingBox(path);
svg = [[IJSVG alloc] initWithSVGLayer:layer
viewBox:box];
}, NO);
__block IJSVG* svg = nil;
IJSVGBeginTransactionLock();
IJSVGGroupLayer* layer = [[[IJSVGGroupLayer alloc] init] autorelease];
IJSVGShapeLayer* shape = [[[IJSVGShapeLayer alloc] init] autorelease];
[layer addSublayer:shape];
shape.path = path;
CGRect box = CGPathGetPathBoundingBox(path);
svg = [[IJSVG alloc] initWithSVGLayer:layer
viewBox:box];
IJSVGEndTransactionLock();
return [svg autorelease];
}
+1 -1
View File
@@ -10,7 +10,7 @@
#import "IJSVGNode.h"
@interface IJSVGForeignObject : IJSVGNode {
NSString * requiredExtension;
}
+1 -1
View File
@@ -14,7 +14,7 @@
- (void)dealloc
{
[requiredExtension release], requiredExtension = nil;
(void)([requiredExtension release]), requiredExtension = nil;
[super dealloc];
}
+12 -12
View File
@@ -6,23 +6,23 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGColorList.h"
#import "IJSVGDef.h"
#import "IJSVGTransform.h"
#import "IJSVGColorList.h"
#import <Foundation/Foundation.h>
@interface IJSVGGradient : IJSVGNode
@property ( nonatomic, retain ) NSGradient * gradient;
@property ( nonatomic, assign ) CGGradientRef CGGradient;
@property ( nonatomic, retain ) IJSVGUnitLength * x1;
@property ( nonatomic, retain ) IJSVGUnitLength * x2;
@property ( nonatomic, retain ) IJSVGUnitLength * y1;
@property ( nonatomic, retain ) IJSVGUnitLength * y2;
@property ( nonatomic, retain) IJSVGColorList * colorList;
@property (nonatomic, retain) NSGradient* gradient;
@property (nonatomic, assign) CGGradientRef CGGradient;
@property (nonatomic, retain) IJSVGUnitLength* x1;
@property (nonatomic, retain) IJSVGUnitLength* x2;
@property (nonatomic, retain) IJSVGUnitLength* y1;
@property (nonatomic, retain) IJSVGUnitLength* y2;
@property (nonatomic, retain) IJSVGColorList* colorList;
+ (CGFloat *)computeColorStopsFromString:(NSXMLElement *)element
colors:(NSArray **)someColors;
+ (CGFloat*)computeColorStopsFromString:(NSXMLElement*)element
colors:(NSArray**)someColors;
- (CGGradientRef)CGGradient;
- (void)drawInContextRef:(CGContextRef)ctx
objectRect:(NSRect)objectRect
@@ -33,6 +33,6 @@
end:(CGPoint)endPoint
context:(CGContextRef)ctx;
- (IJSVGColorList *)computedColorList;
- (IJSVGColorList*)computedColorList;
@end
+54 -54
View File
@@ -16,78 +16,78 @@
- (void)dealloc
{
[x1 release], x1 = nil;
[x2 release], x2 = nil;
[y1 release], y1 = nil;
[y2 release], y2 = nil;
[gradient release], gradient = nil;
[_colorList release], _colorList = nil;
if(CGGradient != nil) {
(void)([x1 release]), x1 = nil;
(void)([x2 release]), x2 = nil;
(void)([y1 release]), y1 = nil;
(void)([y2 release]), y2 = nil;
(void)([gradient release]), gradient = nil;
(void)([_colorList release]), _colorList = nil;
if (CGGradient != nil) {
CGGradientRelease(CGGradient);
}
[super dealloc];
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGGradient * clone = [super copyWithZone:zone];
IJSVGGradient* clone = [super copyWithZone:zone];
clone.gradient = [[self.gradient copy] autorelease];
return clone;
}
- (void)setColorList:(IJSVGColorList *)list
- (void)setColorList:(IJSVGColorList*)list
{
[_colorList release], _colorList = nil;
(void)([_colorList release]), _colorList = nil;
_colorList = list.retain;
if(CGGradient != nil) {
if (CGGradient != nil) {
CGGradientRelease(CGGradient);
}
}
+ (CGFloat *)computeColorStopsFromString:(NSXMLElement *)element
colors:(NSArray **)someColors
+ (CGFloat*)computeColorStopsFromString:(NSXMLElement*)element
colors:(NSArray**)someColors
{
// find each stop element
NSArray * stops = [element children];
NSMutableArray * colors = [[[NSMutableArray alloc] initWithCapacity:stops.count] autorelease];
CGFloat * stopsParams = (CGFloat *)malloc(stops.count*sizeof(CGFloat));
NSArray* stops = [element children];
NSMutableArray* colors = [[[NSMutableArray alloc] initWithCapacity:stops.count] autorelease];
CGFloat* stopsParams = (CGFloat*)malloc(stops.count * sizeof(CGFloat));
NSInteger i = 0;
for( NSXMLElement * stop in stops ) {
for (NSXMLElement* stop in stops) {
// find the offset
CGFloat offset = [stop attributeForName:@"offset"].stringValue.floatValue;
if( offset > 1.f ) {
if (offset > 1.f) {
offset /= 100.f;
}
stopsParams[i++] = offset;
// find the stop opacity
CGFloat stopOpacity = 1.f;
NSXMLNode * stopOpacityAttribute = [stop attributeForName:@"stop-opacity"];
if( stopOpacityAttribute != nil ) {
NSXMLNode* stopOpacityAttribute = [stop attributeForName:@"stop-opacity"];
if (stopOpacityAttribute != nil) {
stopOpacity = stopOpacityAttribute.stringValue.floatValue;
}
// find the stop color
NSString * scs = [stop attributeForName:@"stop-color"].stringValue;
NSColor * stopColor = [IJSVGColor colorFromString:scs];
if(stopColor != nil && stopOpacity != 1.f) {
NSString* scs = [stop attributeForName:@"stop-color"].stringValue;
NSColor* stopColor = [IJSVGColor colorFromString:scs];
if (stopColor != nil && stopOpacity != 1.f) {
stopColor = [IJSVGColor changeAlphaOnColor:stopColor
to:stopOpacity];
}
// compute any style that there was...
NSXMLNode * styleAttribute = [stop attributeForName:@"style"];
if( styleAttribute != nil ) {
IJSVGStyle * style = [IJSVGStyle parseStyleString:styleAttribute.stringValue];
NSColor * color = [IJSVGColor colorFromString:[style property:@"stop-color"]];
NSXMLNode* styleAttribute = [stop attributeForName:@"style"];
if (styleAttribute != nil) {
IJSVGStyle* style = [IJSVGStyle parseStyleString:styleAttribute.stringValue];
NSColor* color = [IJSVGColor colorFromString:[style property:@"stop-color"]];
// we have a color!
if( color != nil ) {
if (color != nil) {
// is there a stop opacity?
NSString * numberString = nil;
if( (numberString = [style property:@"stop-opacity"] ) != nil ) {
NSString* numberString = nil;
if ((numberString = [style property:@"stop-opacity"]) != nil) {
color = [IJSVGColor changeAlphaOnColor:color
to:numberString.floatValue];
} else {
@@ -97,29 +97,29 @@
stopColor = color;
}
}
// default is black
if(stopColor == nil) {
if (stopColor == nil) {
stopColor = [IJSVGColor colorFromString:@"black"];
if(stopOpacity != 1.f) {
if (stopOpacity != 1.f) {
stopColor = [IJSVGColor changeAlphaOnColor:stopColor
to:stopOpacity];
}
}
// add the stop color
[(NSMutableArray *)colors addObject:stopColor];
[(NSMutableArray*)colors addObject:stopColor];
}
*someColors = colors;
return stopsParams;
}
- (IJSVGColorList *)computedColorList
- (IJSVGColorList*)computedColorList
{
IJSVGColorList * sheet = [[[IJSVGColorList alloc] init] autorelease];
IJSVGColorList* sheet = [[[IJSVGColorList alloc] init] autorelease];
NSInteger num = self.gradient.numberOfColorStops;
for(NSInteger i = 0; i < num; i++) {
NSColor * color;
for (NSInteger i = 0; i < num; i++) {
NSColor* color;
[self.gradient getColor:&color
location:nil
atIndex:i];
@@ -131,27 +131,27 @@
- (CGGradientRef)CGGradient
{
// store it in the cache
if(CGGradient != nil) {
if (CGGradient != nil) {
return CGGradient;
}
// actually create the gradient
NSInteger num = self.gradient.numberOfColorStops;
CGFloat * locations = malloc(sizeof(CGFloat)*num);
CGFloat* locations = malloc(sizeof(CGFloat) * num);
CFMutableArrayRef colors = CFArrayCreateMutable(kCFAllocatorDefault, (CFIndex)num,
&kCFTypeArrayCallBacks);
for( NSInteger i = 0; i < num; i++ ) {
NSColor * color;
&kCFTypeArrayCallBacks);
for (NSInteger i = 0; i < num; i++) {
NSColor* color;
[self.gradient getColor:&color
location:&locations[i]
atIndex:i];
if(_colorList != nil) {
if (_colorList != nil) {
color = [_colorList proposedColorForColor:color];
}
CFArrayAppendValue(colors, color.CGColor);
}
CGGradientRef result = CGGradientCreateWithColors(self.gradient.colorSpace.CGColorSpace,
colors, locations);
colors, locations);
CFRelease(colors);
free(locations);
return CGGradient = result;
+3 -4
View File
@@ -6,17 +6,16 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGGradient.h"
#import "IJSVGPath.h"
#import "IJSVGLayer.h"
#import "IJSVGPath.h"
#import <QuartzCore/QuartzCore.h>
@interface IJSVGGradientLayer : IJSVGLayer {
}
@property (nonatomic, assign) CGRect viewBox;
@property (nonatomic, retain) IJSVGGradient * gradient;
@property (nonatomic, retain) IJSVGGradient* gradient;
@property (nonatomic, assign) CGAffineTransform absoluteTransform;
@property (nonatomic, assign) CGRect objectRect;
+26 -26
View File
@@ -17,35 +17,35 @@
- (void)dealloc
{
[gradient release], gradient = nil;
(void)([gradient release]), gradient = nil;
[super dealloc];
}
- (id)init
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
self.requiresBackingScaleHelp = YES;
self.shouldRasterize = YES;
}
return self;
}
- (void)setGradient:(IJSVGGradient *)newGradient
- (void)setGradient:(IJSVGGradient*)newGradient
{
if(gradient != nil) {
[gradient release], gradient = nil;
if (gradient != nil) {
(void)([gradient release]), gradient = nil;
}
gradient = [newGradient retain];
// lets check its alpha properties on the colors
BOOL hasAlphaChannel = NO;
NSInteger stops = gradient.gradient.numberOfColorStops;
for(NSInteger i = 0; i < stops; i++) {
NSColor * color = nil;
for (NSInteger i = 0; i < stops; i++) {
NSColor* color = nil;
[gradient.gradient getColor:&color
location:NULL
atIndex:i];
if(color.alphaComponent != 1.f) {
if (color.alphaComponent != 1.f) {
hasAlphaChannel = YES;
break;
}
@@ -55,7 +55,7 @@
- (void)setOpacity:(float)opacity
{
if(opacity != 1.f) {
if (opacity != 1.f) {
self.opaque = NO;
}
[super setOpacity:opacity];
@@ -64,17 +64,17 @@
- (void)setBackingScaleFactor:(CGFloat)backingScaleFactor
{
switch (self.renderQuality) {
case IJSVGRenderQualityOptimized: {
backingScaleFactor = (backingScaleFactor * .35f);
break;
}
case IJSVGRenderQualityLow: {
backingScaleFactor = (backingScaleFactor * .05f);
break;
}
default: {
break;
}
case IJSVGRenderQualityOptimized: {
backingScaleFactor = (backingScaleFactor * .35f);
break;
}
case IJSVGRenderQualityLow: {
backingScaleFactor = (backingScaleFactor * .05f);
break;
}
default: {
break;
}
}
[super setBackingScaleFactor:backingScaleFactor];
}
@@ -82,16 +82,16 @@
- (void)drawInContext:(CGContextRef)ctx
{
[super drawInContext:ctx];
// nothing to do :(
if(self.gradient == nil) {
if (self.gradient == nil) {
return;
}
// draw the gradient
CGAffineTransform trans = CGAffineTransformMakeTranslation(-CGRectGetMinX(objectRect),
-CGRectGetMinY(objectRect));
CGAffineTransform transform = CGAffineTransformConcat(absoluteTransform,trans);
-CGRectGetMinY(objectRect));
CGAffineTransform transform = CGAffineTransformConcat(absoluteTransform, trans);
CGContextSaveGState(ctx);
[self.gradient drawInContextRef:ctx
objectRect:objectRect
+3 -3
View File
@@ -10,10 +10,10 @@
@implementation IJSVGGradientUnitLength
- (NSString *)stringValue
- (NSString*)stringValue
{
if(self.type == IJSVGUnitLengthTypePercentage) {
return [NSString stringWithFormat:@"%g",self.value];
if (self.type == IJSVGUnitLengthTypePercentage) {
return [NSString stringWithFormat:@"%g", self.value];
}
return [super stringValue];
}
+4 -5
View File
@@ -6,18 +6,17 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGNode.h"
#import "IJSVGPath.h"
#import <Foundation/Foundation.h>
@interface IJSVGGroup : IJSVGNode {
NSMutableArray * children;
NSMutableArray* children;
}
- (void)addChild:(id)child;
- (NSArray *)children;
- (NSArray*)children;
- (void)purgeChildren;
@end
+10 -12
View File
@@ -12,14 +12,13 @@
- (void)dealloc
{
[children release], children = nil;
(void)([children release]), children = nil;
[super dealloc];
}
- (id)init
{
if( ( self = [super init] ) != nil )
{
if ((self = [super init]) != nil) {
children = [[NSMutableArray alloc] init];
}
return self;
@@ -30,13 +29,12 @@
children = [[NSMutableArray alloc] init];
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGGroup * node = [super copyWithZone:zone];
IJSVGGroup* node = [super copyWithZone:zone];
[node prepareFromCopy];
for( IJSVGNode * childNode in self.children )
{
for (IJSVGNode* childNode in self.children) {
childNode = [[childNode copy] autorelease];
childNode.parentNode = node;
[node addChild:childNode];
@@ -51,18 +49,18 @@
- (void)addChild:(id)child
{
if( child != nil )
if (child != nil)
[children addObject:child];
}
- (NSArray *)children
- (NSArray*)children
{
return children;
}
- (NSString *)description
- (NSString*)description
{
return [NSString stringWithFormat:@"%@ - %@",[super description],self.children];
return [NSString stringWithFormat:@"%@ - %@", [super description], self.children];
}
@end
+1 -1
View File
@@ -6,9 +6,9 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGLayer.h"
#import "IJSVGShapeLayer.h"
#import <QuartzCore/QuartzCore.h>
@interface IJSVGGroupLayer : IJSVGLayer
+6 -7
View File
@@ -6,22 +6,21 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGNode.h"
#import <Foundation/Foundation.h>
@class IJSVGPath;
@interface IJSVGImage : IJSVGNode {
NSImage * image;
NSImage* image;
CGImageRef CGImage;
IJSVGPath * imagePath;
IJSVGPath* imagePath;
}
- (CGImageRef)CGImage;
- (void)drawInContextRef:(CGContextRef)context
path:(IJSVGPath *)path;
- (void)loadFromBase64EncodedString:(NSString *)encodedString;
path:(IJSVGPath*)path;
- (void)loadFromBase64EncodedString:(NSString*)encodedString;
@end
+30 -30
View File
@@ -14,36 +14,36 @@
- (void)dealloc
{
CGImageRelease(CGImage), CGImage = nil;
[imagePath release], imagePath = nil;
[image release], image = nil;
(void)(CGImageRelease(CGImage)), CGImage = nil;
(void)([imagePath release]), imagePath = nil;
(void)([image release]), image = nil;
[super dealloc];
}
- (void)loadFromBase64EncodedString:(NSString *)encodedString
- (void)loadFromBase64EncodedString:(NSString*)encodedString
{
if([encodedString hasPrefix:@"data:"]) {
if ([encodedString hasPrefix:@"data:"]) {
encodedString = [encodedString stringByReplacingOccurrencesOfString:@"\\s+"
withString:@""
options:NSRegularExpressionSearch
range:NSMakeRange(0, encodedString.length)];
}
NSURL * URL = [NSURL URLWithString:encodedString];
NSData * data = [NSData dataWithContentsOfURL:URL];
NSURL* URL = [NSURL URLWithString:encodedString];
NSData* data = [NSData dataWithContentsOfURL:URL];
// no data, just ignore...invalid probably
if(data == nil) {
if (data == nil) {
return;
}
// set the image against the container
NSImage * anImage = [[[NSImage alloc] initWithData:data] autorelease];
NSImage* anImage = [[[NSImage alloc] initWithData:data] autorelease];
[self setImage:anImage];
}
- (IJSVGPath *)path
- (IJSVGPath*)path
{
if(imagePath == nil) {
if (imagePath == nil) {
// lazy load the path as it might not be needed
imagePath = [[IJSVGPath alloc] init];
[imagePath.path appendBezierPathWithRect:NSMakeRect(0.f, 0.f, self.width.value, self.height.value)];
@@ -52,23 +52,23 @@
return imagePath;
}
- (void)setImage:(NSImage *)anImage
- (void)setImage:(NSImage*)anImage
{
if(image != nil) {
[image release], image = nil;
if (image != nil) {
(void)([image release]), image = nil;
}
image = [anImage retain];
if(CGImage != nil) {
if (CGImage != nil) {
CGImageRelease(CGImage);
CGImage = nil;
}
NSRect rect = NSMakeRect( 0.f, 0.f, self.width.value, self.height.value);
NSRect rect = NSMakeRect(0.f, 0.f, self.width.value, self.height.value);
CGImage = [image CGImageForProposedRect:&rect
context:nil
hints:nil];
// be sure to retain (some reason this is required in Xcode 8 beta 5?)
CGImageRetain(CGImage);
}
@@ -79,29 +79,29 @@
}
- (void)drawInContextRef:(CGContextRef)context
path:(IJSVGPath *)path
path:(IJSVGPath*)path
{
// run the transforms
// draw the image
if(self.width.value == 0.f || self.height.value == 0.f) {
if (self.width.value == 0.f || self.height.value == 0.f) {
return;
}
// make sure path is set
if(path == nil) {
if (path == nil) {
path = [self path];
}
CGRect rect = path.path.bounds;
CGRect bounds = CGRectMake( 0.f, 0.f, rect.size.width, rect.size.height);
CGRect bounds = CGRectMake(0.f, 0.f, rect.size.width, rect.size.height);
// save the state of the context
CGContextSaveGState(context);
{
// flip the coordinates
CGContextTranslateCTM(context, rect.origin.x, (rect.origin.y)+rect.size.height);
CGContextTranslateCTM(context, rect.origin.x, (rect.origin.y) + rect.size.height);
CGContextScaleCTM(context, 1.f, -1.f);
CGContextDrawImage( context, bounds, CGImage);
CGContextDrawImage(context, bounds, CGImage);
}
CGContextRestoreGState(context);
}
+3 -3
View File
@@ -6,14 +6,14 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGLayer.h"
#import <AppKit/AppKit.h>
#import <QuartzCore/QuartzCore.h>
@interface IJSVGImageLayer : IJSVGLayer {
}
- (id)initWithImage:(NSImage *)image;
- (id)initWithImage:(NSImage*)image;
- (id)initWithCGImage:(CGImageRef)imageRef;
@end
+5 -5
View File
@@ -10,7 +10,7 @@
@implementation IJSVGImageLayer
- (id)initWithImage:(NSImage *)image
- (id)initWithImage:(NSImage*)image
{
NSRect rect = (NSRect){
.origin = NSZeroPoint,
@@ -24,19 +24,19 @@
- (id)initWithCGImage:(CGImageRef)imageRef
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
// set the contents
self.contents = (id)imageRef;
// make sure we say we need help
self.requiresBackingScaleHelp = YES;
self.shouldRasterize = YES;
// set the frame, simple stuff
self.frame = (CGRect){
.origin = CGPointZero,
.size = CGSizeMake(CGImageGetWidth(imageRef),
CGImageGetHeight(imageRef))
CGImageGetHeight(imageRef))
};
}
return self;
+3 -3
View File
@@ -6,15 +6,15 @@
// Copyright © 2019 Curtis Hard. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "IJSVGParser.h"
#import <Cocoa/Cocoa.h>
@class IJSVG;
@interface IJSVGImageRep : NSImageRep {
@private
IJSVG * _svg;
IJSVG* _svg;
}
@property (nonatomic, readonly) CGRect viewBox;
+20 -20
View File
@@ -6,8 +6,8 @@
// Copyright © 2019 Curtis Hard. All rights reserved.
//
#import "IJSVGImageRep.h"
#import "IJSVG.h"
#import "IJSVGImageRep.h"
@implementation IJSVGImageRep
@@ -18,57 +18,57 @@
[NSBitmapImageRep registerImageRepClass:self];
}
+ (BOOL)canInitWithData:(NSData *)data
+ (BOOL)canInitWithData:(NSData*)data
{
return [IJSVGParser isDataSVG:data];
}
+ (NSArray<NSString *> *)imageTypes
+ (NSArray<NSString*>*)imageTypes
{
return @[(NSString *)kUTTypeScalableVectorGraphics, @"svg"];
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
}
+ (NSArray<NSString *> *)imageUnfilteredTypes
+ (NSArray<NSString*>*)imageUnfilteredTypes
{
return @[(NSString *)kUTTypeScalableVectorGraphics, @"svg"];
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
}
+ (NSArray<NSImageRep *> *)imageRepsWithData:(NSData *)data
+ (NSArray<NSImageRep*>*)imageRepsWithData:(NSData*)data
{
IJSVGImageRep * instance = [self imageRepWithData:data];
if(instance == nil) {
IJSVGImageRep* instance = [self imageRepWithData:data];
if (instance == nil) {
return @[];
}
return @[instance];
return @[ instance ];
}
+ (instancetype)imageRepWithData:(NSData *)data
+ (instancetype)imageRepWithData:(NSData*)data
{
return [[[self alloc] initWithData:data] autorelease];
}
- (void)dealloc
{
[_svg release], _svg = nil;
(void)([_svg release]), _svg = nil;
[super dealloc];
}
- (instancetype)initWithData:(NSData *)data
- (instancetype)initWithData:(NSData*)data
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
// grab the string from the data
// its more then likely UTF-8...
NSString * string = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
NSString* string = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
_svg = [[IJSVG alloc] initWithSVGString:string];
// no valid SVG, just return nil;
if(_svg == nil) {
if (_svg == nil) {
[self release];
return nil;
}
// set default properties
self.pixelsWide = _svg.viewBox.size.width;
self.pixelsHigh = _svg.viewBox.size.height;
+13 -13
View File
@@ -6,9 +6,9 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGTransaction.h"
#import "IJSVGRendering.h"
#import "IJSVGTransaction.h"
#import <QuartzCore/QuartzCore.h>
@class IJSVGShapeLayer;
@class IJSVGGradientLayer;
@@ -17,16 +17,16 @@
@class IJSVGGroupLayer;
@interface IJSVGLayer : CALayer {
@private
IJSVGLayer * _maskingLayer;
IJSVGLayer* _maskingLayer;
}
@property (nonatomic, assign) IJSVGGradientLayer * gradientFillLayer;
@property (nonatomic, assign) IJSVGPatternLayer * patternFillLayer;
@property (nonatomic, assign) IJSVGStrokeLayer * strokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer * gradientStrokeLayer;
@property (nonatomic, assign) IJSVGPatternLayer * patternStrokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer* gradientFillLayer;
@property (nonatomic, assign) IJSVGPatternLayer* patternFillLayer;
@property (nonatomic, assign) IJSVGStrokeLayer* strokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer* gradientStrokeLayer;
@property (nonatomic, assign) IJSVGPatternLayer* patternStrokeLayer;
@property (nonatomic, assign) BOOL requiresBackingScaleHelp;
@property (nonatomic, assign) CGFloat backingScaleFactor;
@property (nonatomic, assign) IJSVGRenderQuality renderQuality;
@@ -34,12 +34,12 @@
@property (nonatomic, assign) CGPoint absoluteOrigin;
@property (nonatomic, assign) BOOL convertMasksToPaths;
+ (NSArray *)deepestSublayersOfLayer:(CALayer *)layer;
+ (void)recursivelyWalkLayer:(CALayer *)layer
withBlock:(void (^)(CALayer * layer, BOOL isMask))block;
+ (NSArray*)deepestSublayersOfLayer:(CALayer*)layer;
+ (void)recursivelyWalkLayer:(CALayer*)layer
withBlock:(void (^)(CALayer* layer, BOOL isMask))block;
- (void)applySublayerMaskToContext:(CGContextRef)context
forSublayer:(IJSVGLayer *)sublayer
forSublayer:(IJSVGLayer*)sublayer
withOffset:(CGPoint)offset;
@end
+92 -93
View File
@@ -6,11 +6,10 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import "IJSVG.h"
#import "IJSVGGroupLayer.h"
#import "IJSVGLayer.h"
#import "IJSVGShapeLayer.h"
#import "IJSVGGroupLayer.h"
#import "IJSVG.h"
@implementation IJSVGLayer
@@ -26,16 +25,16 @@
- (void)dealloc
{
[_maskingLayer release], _maskingLayer = nil;
(void)([_maskingLayer release]), _maskingLayer = nil;
[super dealloc];
}
+ (NSArray *)deepestSublayersOfLayer:(CALayer *)layer
+ (NSArray*)deepestSublayersOfLayer:(CALayer*)layer
{
NSMutableArray * arr = [[[NSMutableArray alloc] init] autorelease];
for(CALayer * subLayer in layer.sublayers) {
if(subLayer.sublayers.count != 0) {
NSArray * moreLayers = [self deepestSublayersOfLayer:(IJSVGLayer *)subLayer];
NSMutableArray* arr = [[[NSMutableArray alloc] init] autorelease];
for (CALayer* subLayer in layer.sublayers) {
if (subLayer.sublayers.count != 0) {
NSArray* moreLayers = [self deepestSublayersOfLayer:(IJSVGLayer*)subLayer];
[arr addObjectsFromArray:moreLayers];
} else {
[arr addObject:subLayer];
@@ -44,41 +43,41 @@
return arr;
}
+ (void)recursivelyWalkLayer:(CALayer *)layer
withBlock:(void (^)(CALayer * layer, BOOL isMask))block
+ (void)recursivelyWalkLayer:(CALayer*)layer
withBlock:(void (^)(CALayer* layer, BOOL isMask))block
{
// call for layer and mask if there is one
block(layer, NO);
// do the mask too!
if(layer.mask != nil) {
if (layer.mask != nil) {
block(layer.mask, YES);
}
// sublayers!!
for(CALayer * aLayer in layer.sublayers) {
for (CALayer* aLayer in layer.sublayers) {
[self recursivelyWalkLayer:aLayer
withBlock:block];
}
}
- (void)addSublayer:(CALayer *)layer
- (void)addSublayer:(CALayer*)layer
{
if([layer isKindOfClass:[IJSVGLayer class]] == NO &&
[layer isKindOfClass:[IJSVGShapeLayer class]] == NO) {
NSString * r = [NSString stringWithFormat:@"The layer must be an instance of IJSVGLayer, %@ given.",
[layer class]];
NSException * exception = [NSException exceptionWithName:@"IJSVGInvalidSublayerException"
reason:r
userInfo:nil];
@throw exception;
if ([layer isKindOfClass:[IJSVGLayer class]] == NO &&
[layer isKindOfClass:[IJSVGShapeLayer class]] == NO) {
NSString* r = [NSString stringWithFormat:@"The layer must be an instance of IJSVGLayer, %@ given.",
[layer class]];
NSException* exception = [NSException exceptionWithName:@"IJSVGInvalidSublayerException"
reason:r
userInfo:nil];
@throw exception;
}
[super addSublayer:layer];
}
}
- (void)setBackingScaleFactor:(CGFloat)newFactor
{
if(self.backingScaleFactor == newFactor) {
- (void)setBackingScaleFactor:(CGFloat)newFactor
{
if (self.backingScaleFactor == newFactor) {
return;
}
backingScaleFactor = newFactor;
@@ -87,71 +86,71 @@
[self setNeedsDisplay];
}
- (void)_customRenderInContext:(CGContextRef)ctx
{
if(self.convertMasksToPaths == YES && _maskingLayer != nil) {
CGContextSaveGState(ctx);
[self applySublayerMaskToContext:ctx
forSublayer:(IJSVGLayer *)self
withOffset:CGPointZero];
[super renderInContext:ctx];
CGContextRestoreGState(ctx);
return;
}
[super renderInContext:ctx];
- (void)_customRenderInContext:(CGContextRef)ctx
{
if (self.convertMasksToPaths == YES && _maskingLayer != nil) {
CGContextSaveGState(ctx);
[self applySublayerMaskToContext:ctx
forSublayer:(IJSVGLayer*)self
withOffset:CGPointZero];
[super renderInContext:ctx];
CGContextRestoreGState(ctx);
return;
}
[super renderInContext:ctx];
}
- (void)setConvertMasksToPaths:(BOOL)flag
- (void)setConvertMasksToPaths:(BOOL)flag
{
if(convertMasksToPaths == flag) {
return;
}
convertMasksToPaths = flag;
if(flag == YES) {
if(_maskingLayer != nil){
[_maskingLayer release], _maskingLayer = nil;
if (convertMasksToPaths == flag) {
return;
}
convertMasksToPaths = flag;
if (flag == YES) {
if (_maskingLayer != nil) {
(void)([_maskingLayer release]), _maskingLayer = nil;
}
_maskingLayer = [(IJSVGLayer *)self.mask retain];
self.mask = nil;
} else {
_maskingLayer = [(IJSVGLayer*)self.mask retain];
self.mask = nil;
} else {
self.mask = _maskingLayer;
[_maskingLayer release], _maskingLayer = nil;
}
}
(void)([_maskingLayer release]), _maskingLayer = nil;
}
}
- (void)applySublayerMaskToContext:(CGContextRef)context
forSublayer:(IJSVGLayer *)sublayer
- (void)applySublayerMaskToContext:(CGContextRef)context
forSublayer:(IJSVGLayer*)sublayer
withOffset:(CGPoint)offset
{
// apply any transforms needed
CGPoint layerOffset = offset;
CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(sublayer.transform);
CGContextConcatCTM( context, CGAffineTransformInvert(sublayerTransform) );
CGPoint layerOffset = offset;
CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(sublayer.transform);
CGContextConcatCTM(context, CGAffineTransformInvert(sublayerTransform));
// walk up the superlayer chain
CALayer * superlayer = self.superlayer;
CALayer* superlayer = self.superlayer;
if (IJSVGIsSVGLayer(superlayer) == YES) {
[(IJSVGLayer *)superlayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer *)self
withOffset:layerOffset];
}
[(IJSVGLayer*)superlayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer*)self
withOffset:layerOffset];
}
// grab the masking layer
IJSVGShapeLayer * maskingLayer = [self maskingLayer];
IJSVGShapeLayer* maskingLayer = [self maskingLayer];
// if its a group we need to get the lowest level children
// and walk up the chain again
if([maskingLayer isKindOfClass:[IJSVGGroupLayer class]]) {
NSArray * subs = [IJSVGLayer deepestSublayersOfLayer:maskingLayer];
for(IJSVGLayer * subLayer in subs) {
[subLayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer *)self
withOffset:layerOffset];
}
if ([maskingLayer isKindOfClass:[IJSVGGroupLayer class]]) {
NSArray* subs = [IJSVGLayer deepestSublayersOfLayer:maskingLayer];
for (IJSVGLayer* subLayer in subs) {
[subLayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer*)self
withOffset:layerOffset];
}
} else if ([maskingLayer isKindOfClass:[IJSVGShapeLayer class]]) {
// is a shape, go for it!
CGPathRef maskPath = maskingLayer.path;
CGContextTranslateCTM(context, -layerOffset.x, -layerOffset.y);
CGPathRef maskPath = maskingLayer.path;
CGContextTranslateCTM(context, -layerOffset.x, -layerOffset.y);
CGContextAddPath(context, maskPath);
CGContextClip(context);
CGContextTranslateCTM(context, layerOffset.x, layerOffset.y);
@@ -159,24 +158,24 @@
CGContextConcatCTM(context, sublayerTransform);
}
- (IJSVGShapeLayer *)maskingLayer
{
return (IJSVGShapeLayer *)_maskingLayer ?: nil;
}
- (void)renderInContext:(CGContextRef)ctx
{
if(self.blendingMode != kCGBlendModeNormal) {
CGContextSaveGState(ctx);
CGContextSetBlendMode(ctx, self.blendingMode);
[self _customRenderInContext:ctx];
CGContextRestoreGState(ctx);
return;
}
[self _customRenderInContext:ctx];
- (IJSVGShapeLayer*)maskingLayer
{
return (IJSVGShapeLayer*)_maskingLayer ?: nil;
}
- (id<CAAction>)actionForKey:(NSString *)event
- (void)renderInContext:(CGContextRef)ctx
{
if (self.blendingMode != kCGBlendModeNormal) {
CGContextSaveGState(ctx);
CGContextSetBlendMode(ctx, self.blendingMode);
[self _customRenderInContext:ctx];
CGContextRestoreGState(ctx);
return;
}
[self _customRenderInContext:ctx];
}
- (id<CAAction>)actionForKey:(NSString*)event
{
return nil;
}
+3 -5
View File
@@ -6,20 +6,18 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGNode.h"
#import "IJSVGRenderingStyle.h"
#import <QuartzCore/QuartzCore.h>
@class IJSVGLayer;
@interface IJSVGLayerTree : NSObject {
}
@property (nonatomic, assign) CGRect viewBox;
@property (nonatomic, retain) IJSVGRenderingStyle * style;
@property (nonatomic, retain) IJSVGRenderingStyle* style;
- (IJSVGLayer *)layerForNode:(IJSVGNode *)node;
- (IJSVGLayer*)layerForNode:(IJSVGNode*)node;
@end
+311 -312
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -6,12 +6,12 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGGradient.h"
#import <Foundation/Foundation.h>
@interface IJSVGLinearGradient : IJSVGGradient
+ (NSGradient *)parseGradient:(NSXMLElement *)element
gradient:(IJSVGLinearGradient *)aGradient;
+ (NSGradient*)parseGradient:(NSXMLElement*)element
gradient:(IJSVGLinearGradient*)aGradient;
@end
+27 -29
View File
@@ -11,29 +11,29 @@
@implementation IJSVGLinearGradient
+ (NSGradient *)parseGradient:(NSXMLElement *)element
gradient:(IJSVGLinearGradient *)aGradient
+ (NSGradient*)parseGradient:(NSXMLElement*)element
gradient:(IJSVGLinearGradient*)aGradient
{
// just ask unit for the value
NSString * x1 = ([element attributeForName:@"x1"].stringValue ?: @"0");
NSString * x2 = ([element attributeForName:@"x2"].stringValue ?: @"100%");
NSString * y1 = ([element attributeForName:@"y1"].stringValue ?: @"0");
NSString * y2 = ([element attributeForName:@"y2"].stringValue ?: @"0");
NSString* x1 = ([element attributeForName:@"x1"].stringValue ?: @"0");
NSString* x2 = ([element attributeForName:@"x2"].stringValue ?: @"100%");
NSString* y1 = ([element attributeForName:@"y1"].stringValue ?: @"0");
NSString* y2 = ([element attributeForName:@"y2"].stringValue ?: @"0");
aGradient.x1 = [IJSVGGradientUnitLength unitWithString:x1 fromUnitType:aGradient.units];
aGradient.x2 = [IJSVGGradientUnitLength unitWithString:x2 fromUnitType:aGradient.units];
aGradient.y1 = [IJSVGGradientUnitLength unitWithString:y1 fromUnitType:aGradient.units];
aGradient.y2 = [IJSVGGradientUnitLength unitWithString:y2 fromUnitType:aGradient.units];
// compute the color stops and colours
NSArray * colors = nil;
CGFloat * stopsParams = [self.class computeColorStopsFromString:element
colors:&colors];
NSArray* colors = nil;
CGFloat* stopsParams = [self.class computeColorStopsFromString:element
colors:&colors];
// create the gradient with the colours
NSGradient * grad = [[NSGradient alloc] initWithColors:colors
atLocations:stopsParams
colorSpace:IJSVGColor.defaultColorSpace];
NSGradient* grad = [[NSGradient alloc] initWithColors:colors
atLocations:stopsParams
colorSpace:IJSVGColor.defaultColorSpace];
free(stopsParams);
return [grad autorelease];
}
@@ -44,38 +44,36 @@
viewPort:(CGRect)viewBox
{
BOOL inUserSpace = self.units == IJSVGUnitUserSpaceOnUse;
CGPoint gradientStartPoint = CGPointZero;
CGPoint gradientEndPoint = CGPointZero;
CGAffineTransform selfTransform = IJSVGConcatTransforms(self.transforms);
CGRect boundingBox = inUserSpace ? viewBox : objectRect;
// make sure we apply the absolute position to
// transform us back into the correct space
if(inUserSpace == YES) {
if (inUserSpace == YES) {
CGContextConcatCTM(ctx, absoluteTransform);
}
CGFloat width = CGRectGetWidth(boundingBox);
CGFloat height = CGRectGetHeight(boundingBox);
gradientStartPoint = CGPointMake([self.x1 computeValue:width],
[self.y1 computeValue:height]);
[self.y1 computeValue:height]);
gradientEndPoint = CGPointMake([self.x2 computeValue:width],
[self.y2 computeValue:height]);
[self.y2 computeValue:height]);
// transform the context
CGContextConcatCTM(ctx, selfTransform);
// draw the gradient
CGGradientDrawingOptions options =
kCGGradientDrawsBeforeStartLocation|
kCGGradientDrawsAfterEndLocation;
CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
CGContextDrawLinearGradient(ctx, self.CGGradient, gradientStartPoint,
gradientEndPoint, options);
gradientEndPoint, options);
#ifdef IJSVG_DEBUG
[self _debugStart:gradientStartPoint
end:gradientEndPoint
+14 -7
View File
@@ -10,31 +10,38 @@
@implementation IJSVGMath
CGFloat IJSVGMathRad(CGFloat val) {
CGFloat IJSVGMathRad(CGFloat val)
{
return val * M_PI / 180;
};
CGFloat IJSVGMathDeg(CGFloat val) {
CGFloat IJSVGMathDeg(CGFloat val)
{
return val * 180.f / M_PI;
};
CGFloat IJSVGMathAcos(CGFloat val) {
CGFloat IJSVGMathAcos(CGFloat val)
{
return IJSVGMathDeg(acosf(val));
};
CGFloat IJSVGMathSin(CGFloat val) {
CGFloat IJSVGMathSin(CGFloat val)
{
return sinf(IJSVGMathRad(val));
};
CGFloat IJSVGMathAsin(CGFloat val) {
CGFloat IJSVGMathAsin(CGFloat val)
{
return IJSVGMathDeg(asinf(val));
};
CGFloat IJSVGMathTan(CGFloat val) {
CGFloat IJSVGMathTan(CGFloat val)
{
return tanf(IJSVGMathRad(val));
};
CGFloat IJSVGMathAtan(CGFloat val) {
CGFloat IJSVGMathAtan(CGFloat val)
{
return IJSVGMathDeg(atanf(val));
};
+50 -49
View File
@@ -6,9 +6,10 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGStyle.h"
#import "IJSVGUnitLength.h"
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
@class IJSVG;
@class IJSVGGroup;
@@ -18,7 +19,7 @@
@class IJSVGPattern;
@class IJSVGTransform;
typedef NS_ENUM( NSInteger, IJSVGNodeType ) {
typedef NS_ENUM(NSInteger, IJSVGNodeType) {
IJSVGNodeTypeGroup,
IJSVGNodeTypePath,
IJSVGNodeTypeDef,
@@ -45,13 +46,13 @@ typedef NS_ENUM( NSInteger, IJSVGNodeType ) {
IJSVGNodeTypeNotFound,
};
typedef NS_ENUM( NSInteger, IJSVGWindingRule ) {
typedef NS_ENUM(NSInteger, IJSVGWindingRule) {
IJSVGWindingRuleNonZero,
IJSVGWindingRuleEvenOdd,
IJSVGWindingRuleInherit
};
typedef NS_ENUM( NSInteger, IJSVGLineCapStyle ) {
typedef NS_ENUM(NSInteger, IJSVGLineCapStyle) {
IJSVGLineCapStyleNone,
IJSVGLineCapStyleButt,
IJSVGLineCapStyleRound,
@@ -59,7 +60,7 @@ typedef NS_ENUM( NSInteger, IJSVGLineCapStyle ) {
IJSVGLineCapStyleInherit
};
typedef NS_ENUM( NSInteger, IJSVGLineJoinStyle ) {
typedef NS_ENUM(NSInteger, IJSVGLineJoinStyle) {
IJSVGLineJoinStyleNone,
IJSVGLineJoinStyleMiter,
IJSVGLineJoinStyleRound,
@@ -67,13 +68,13 @@ typedef NS_ENUM( NSInteger, IJSVGLineJoinStyle ) {
IJSVGLineJoinStyleInherit
};
typedef NS_OPTIONS( NSInteger, IJSVGFontTraits ) {
typedef NS_OPTIONS(NSInteger, IJSVGFontTraits) {
IJSVGFontTraitNone = 1 << 0,
IJSVGFontTraitBold = 1 << 1,
IJSVGFontTraitItalic = 1 << 2
};
typedef NS_ENUM( NSInteger, IJSVGBlendMode) {
typedef NS_ENUM(NSInteger, IJSVGBlendMode) {
IJSVGBlendModeNormal = kCGBlendModeNormal,
IJSVGBlendModeMultiply = kCGBlendModeMultiply,
IJSVGBlendModeScreen = kCGBlendModeScreen,
@@ -96,51 +97,51 @@ static CGFloat IJSVGInheritedFloatValue = -99.9999991;
@interface IJSVGNode : NSObject <NSCopying>
@property ( nonatomic, assign ) IJSVGNodeType type;
@property ( nonatomic, copy ) NSString * name;
@property ( nonatomic, copy ) NSString * className;
@property ( nonatomic, retain ) NSArray * classNameList;
@property ( nonatomic, copy ) NSString * unicode;
@property ( nonatomic, assign ) BOOL shouldRender;
@property ( nonatomic, assign ) BOOL usesDefaultFillColor;
@property ( nonatomic, retain ) IJSVGUnitLength * x;
@property ( nonatomic, retain ) IJSVGUnitLength * y;
@property ( nonatomic, retain ) IJSVGUnitLength * width;
@property ( nonatomic, retain ) IJSVGUnitLength * height;
@property ( nonatomic, retain ) IJSVGUnitLength * opacity;
@property ( nonatomic, retain ) IJSVGUnitLength * fillOpacity;
@property ( nonatomic, retain ) IJSVGUnitLength * strokeOpacity;
@property ( nonatomic, retain ) IJSVGUnitLength * strokeWidth;
@property ( nonatomic, retain ) NSColor * fillColor;
@property ( nonatomic, retain ) NSColor * strokeColor;
@property ( nonatomic, copy ) NSString * identifier;
@property ( nonatomic, assign ) IJSVGNode * parentNode;
@property ( nonatomic, assign ) IJSVGNode * intermediateParentNode;
@property ( nonatomic, retain ) IJSVGGroup * clipPath;
@property ( nonatomic, retain ) IJSVGGroup * mask;
@property ( nonatomic, assign ) IJSVGWindingRule windingRule;
@property ( nonatomic, assign ) IJSVGLineCapStyle lineCapStyle;
@property ( nonatomic, assign ) IJSVGLineJoinStyle lineJoinStyle;
@property ( nonatomic, retain ) NSArray<IJSVGTransform *> * transforms;
@property ( nonatomic, retain ) IJSVGDef * def;
@property ( nonatomic, retain ) IJSVGGradient * fillGradient;
@property ( nonatomic, retain ) IJSVGPattern * fillPattern;
@property ( nonatomic, retain ) IJSVGGradient * strokeGradient;
@property ( nonatomic, retain ) IJSVGPattern * strokePattern;
@property ( nonatomic, assign ) CGFloat * strokeDashArray;
@property ( nonatomic, assign ) NSInteger strokeDashArrayCount;
@property ( nonatomic, retain ) IJSVGUnitLength * strokeDashOffset;
@property ( nonatomic, retain ) IJSVG * svg;
@property ( nonatomic, assign ) IJSVGUnitType contentUnits;
@property ( nonatomic, assign ) IJSVGUnitType units;
@property ( nonatomic, assign ) IJSVGBlendMode blendMode;
@property (nonatomic, assign) IJSVGNodeType type;
@property (nonatomic, copy) NSString* name;
@property (nonatomic, copy) NSString* className;
@property (nonatomic, retain) NSArray* classNameList;
@property (nonatomic, copy) NSString* unicode;
@property (nonatomic, assign) BOOL shouldRender;
@property (nonatomic, assign) BOOL usesDefaultFillColor;
@property (nonatomic, retain) IJSVGUnitLength* x;
@property (nonatomic, retain) IJSVGUnitLength* y;
@property (nonatomic, retain) IJSVGUnitLength* width;
@property (nonatomic, retain) IJSVGUnitLength* height;
@property (nonatomic, retain) IJSVGUnitLength* opacity;
@property (nonatomic, retain) IJSVGUnitLength* fillOpacity;
@property (nonatomic, retain) IJSVGUnitLength* strokeOpacity;
@property (nonatomic, retain) IJSVGUnitLength* strokeWidth;
@property (nonatomic, retain) NSColor* fillColor;
@property (nonatomic, retain) NSColor* strokeColor;
@property (nonatomic, copy) NSString* identifier;
@property (nonatomic, assign) IJSVGNode* parentNode;
@property (nonatomic, assign) IJSVGNode* intermediateParentNode;
@property (nonatomic, retain) IJSVGGroup* clipPath;
@property (nonatomic, retain) IJSVGGroup* mask;
@property (nonatomic, assign) IJSVGWindingRule windingRule;
@property (nonatomic, assign) IJSVGLineCapStyle lineCapStyle;
@property (nonatomic, assign) IJSVGLineJoinStyle lineJoinStyle;
@property (nonatomic, retain) NSArray<IJSVGTransform*>* transforms;
@property (nonatomic, retain) IJSVGDef* def;
@property (nonatomic, retain) IJSVGGradient* fillGradient;
@property (nonatomic, retain) IJSVGPattern* fillPattern;
@property (nonatomic, retain) IJSVGGradient* strokeGradient;
@property (nonatomic, retain) IJSVGPattern* strokePattern;
@property (nonatomic, assign) CGFloat* strokeDashArray;
@property (nonatomic, assign) NSInteger strokeDashArrayCount;
@property (nonatomic, retain) IJSVGUnitLength* strokeDashOffset;
@property (nonatomic, retain) IJSVG* svg;
@property (nonatomic, assign) IJSVGUnitType contentUnits;
@property (nonatomic, assign) IJSVGUnitType units;
@property (nonatomic, assign) IJSVGBlendMode blendMode;
+ (IJSVGNodeType)typeForString:(NSString *)string
+ (IJSVGNodeType)typeForString:(NSString*)string
kind:(NSXMLNodeKind)kind;
- (void)applyPropertiesFromNode:(IJSVGNode *)node;
- (void)applyPropertiesFromNode:(IJSVGNode*)node;
- (id)initWithDef:(BOOL)flag;
- (void)addDef:(IJSVGNode *)aDef;
- (IJSVGDef *)defForID:(NSString *)anID;
- (void)addDef:(IJSVGNode*)aDef;
- (IJSVGDef*)defForID:(NSString*)anID;
@end
+107 -109
View File
@@ -6,8 +6,8 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGNode.h"
#import "IJSVGDef.h"
#import "IJSVGNode.h"
#import "IJSVGUtils.h"
@implementation IJSVGNode
@@ -54,205 +54,203 @@
- (void)dealloc
{
free(strokeDashArray);
[x release], x = nil;
[y release], y = nil;
[width release], width = nil;
[height release], height = nil;
[opacity release], opacity = nil;
[fillOpacity release], fillOpacity = nil;
[strokeOpacity release], strokeOpacity = nil;
[strokeWidth release], strokeWidth = nil;
[strokeDashOffset release], strokeDashOffset = nil;
[unicode release], unicode = nil;
[fillGradient release], fillGradient = nil;
[strokeGradient release], strokeGradient = nil;
[strokePattern release], strokePattern = nil;
[transforms release], transforms = nil;
[fillColor release], fillColor = nil;
[strokeColor release], strokeColor = nil;
[identifier release], identifier = nil;
[def release], def = nil;
[name release], name = nil;
[className release], className = nil;
[classNameList release], classNameList = nil;
[fillPattern release], fillPattern = nil;
[clipPath release], clipPath = nil;
[svg release], svg = nil;
[mask release], mask = nil;
(void)([x release]), x = nil;
(void)([y release]), y = nil;
(void)([width release]), width = nil;
(void)([height release]), height = nil;
(void)([opacity release]), opacity = nil;
(void)([fillOpacity release]), fillOpacity = nil;
(void)([strokeOpacity release]), strokeOpacity = nil;
(void)([strokeWidth release]), strokeWidth = nil;
(void)([strokeDashOffset release]), strokeDashOffset = nil;
(void)([unicode release]), unicode = nil;
(void)([fillGradient release]), fillGradient = nil;
(void)([strokeGradient release]), strokeGradient = nil;
(void)([strokePattern release]), strokePattern = nil;
(void)([transforms release]), transforms = nil;
(void)([fillColor release]), fillColor = nil;
(void)([strokeColor release]), strokeColor = nil;
(void)([identifier release]), identifier = nil;
(void)([def release]), def = nil;
(void)([name release]), name = nil;
(void)([className release]), className = nil;
(void)([classNameList release]), classNameList = nil;
(void)([fillPattern release]), fillPattern = nil;
(void)([clipPath release]), clipPath = nil;
(void)([svg release]), svg = nil;
(void)([mask release]), mask = nil;
[super dealloc];
}
+ (IJSVGNodeType)typeForString:(NSString *)string
+ (IJSVGNodeType)typeForString:(NSString*)string
kind:(NSXMLNodeKind)kind
{
string = [string lowercaseString];
if([string isEqualToString:@"style"])
if ([string isEqualToString:@"style"])
return IJSVGNodeTypeStyle;
if([string isEqualToString:@"switch"])
if ([string isEqualToString:@"switch"])
return IJSVGNodeTypeSwitch;
if( [string isEqualToString:@"defs"] )
if ([string isEqualToString:@"defs"])
return IJSVGNodeTypeDef;
if( [string isEqualToString:@"g"] )
if ([string isEqualToString:@"g"])
return IJSVGNodeTypeGroup;
if( [string isEqualToString:@"path"] )
if ([string isEqualToString:@"path"])
return IJSVGNodeTypePath;
if( [string isEqualToString:@"polygon"] )
if ([string isEqualToString:@"polygon"])
return IJSVGNodeTypePolygon;
if( [string isEqualToString:@"polyline"] )
if ([string isEqualToString:@"polyline"])
return IJSVGNodeTypePolyline;
if( [string isEqualToString:@"rect"] )
if ([string isEqualToString:@"rect"])
return IJSVGNodeTypeRect;
if( [string isEqualToString:@"line"] )
if ([string isEqualToString:@"line"])
return IJSVGNodeTypeLine;
if( [string isEqualToString:@"circle"] )
if ([string isEqualToString:@"circle"])
return IJSVGNodeTypeCircle;
if( [string isEqualToString:@"ellipse"] )
if ([string isEqualToString:@"ellipse"])
return IJSVGNodeTypeEllipse;
if( [string isEqualToString:@"use"] )
if ([string isEqualToString:@"use"])
return IJSVGNodeTypeUse;
if( [string isEqualToString:@"lineargradient"] )
if ([string isEqualToString:@"lineargradient"])
return IJSVGNodeTypeLinearGradient;
if( [string isEqualToString:@"radialgradient"] )
if ([string isEqualToString:@"radialgradient"])
return IJSVGNodeTypeRadialGradient;
if( [string isEqualToString:@"glyph"] )
if ([string isEqualToString:@"glyph"])
return IJSVGNodeTypeGlyph;
if( [string isEqualToString:@"font"] )
if ([string isEqualToString:@"font"])
return IJSVGNodeTypeFont;
if( [string isEqualToString:@"clippath"] )
if ([string isEqualToString:@"clippath"])
return IJSVGNodeTypeClipPath;
if( [string isEqualToString:@"mask"] )
if ([string isEqualToString:@"mask"])
return IJSVGNodeTypeMask;
if( [string isEqualToString:@"image"] )
if ([string isEqualToString:@"image"])
return IJSVGNodeTypeImage;
if([string isEqualToString:@"pattern"])
if ([string isEqualToString:@"pattern"])
return IJSVGNodeTypePattern;
if([string isEqualToString:@"svg"])
if ([string isEqualToString:@"svg"])
return IJSVGNodeTypeSVG;
if([string isEqualToString:@"text"])
if ([string isEqualToString:@"text"])
return IJSVGNodeTypeText;
if([string isEqualToString:@"tspan"] || kind == NSXMLTextKind) {
if ([string isEqualToString:@"tspan"] || kind == NSXMLTextKind) {
return IJSVGNodeTypeTextSpan;
}
// are we commong HTML? - if so just treat as a group
if(IJSVGIsCommonHTMLElementName(string) == YES) {
if (IJSVGIsCommonHTMLElementName(string) == YES) {
return IJSVGNodeTypeGroup;
}
return IJSVGNodeTypeNotFound;
}
- (id)init
{
if( ( self = [self initWithDef:YES] ) != nil )
{
if ((self = [self initWithDef:YES]) != nil) {
self.opacity = [IJSVGUnitLength unitWithFloat:1];
}
return self;
}
- (void)applyPropertiesFromNode:(IJSVGNode *)node
- (void)applyPropertiesFromNode:(IJSVGNode*)node
{
self.name = node.name;
self.type = node.type;
self.unicode = node.unicode;
self.className = node.className;
self.classNameList = node.classNameList;
self.x = node.x;
self.y = node.y;
self.width = node.width;
self.height = node.height;
self.fillGradient = node.fillGradient;
self.fillPattern = node.fillPattern;
self.strokeGradient = node.strokeGradient;
self.strokePattern = node.strokePattern;
self.fillColor = node.fillColor;
self.strokeColor = node.strokeColor;
self.clipPath = node.clipPath;
self.units = node.units;
self.contentUnits = node.contentUnits;
self.opacity = node.opacity;
self.strokeWidth = node.strokeWidth;
self.fillOpacity = node.fillOpacity;
self.strokeOpacity = node.strokeOpacity;
self.identifier = node.identifier;
self.usesDefaultFillColor = node.usesDefaultFillColor;
self.transforms = node.transforms;
self.def = node.def;
self.windingRule = node.windingRule;
self.lineCapStyle = node.lineCapStyle;
self.lineJoinStyle = node.lineJoinStyle;
self.parentNode = node.parentNode;
self.shouldRender = node.shouldRender;
self.blendMode = node.blendMode;
// dash array needs physical memory copied
CGFloat * nStrokeDashArray = (CGFloat *)malloc(node.strokeDashArrayCount*sizeof(CGFloat));
memcpy( self.strokeDashArray, nStrokeDashArray, node.strokeDashArrayCount*sizeof(CGFloat));
CGFloat* nStrokeDashArray = (CGFloat*)malloc(node.strokeDashArrayCount * sizeof(CGFloat));
memcpy(self.strokeDashArray, nStrokeDashArray, node.strokeDashArrayCount * sizeof(CGFloat));
self.strokeDashArray = nStrokeDashArray;
self.strokeDashArrayCount = node.strokeDashArrayCount;
self.strokeDashOffset = node.strokeDashOffset;
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGNode * node = [self.class allocWithZone:zone];
IJSVGNode* node = [self.class allocWithZone:zone];
[node applyPropertiesFromNode:self];
return node;
}
- (id)initWithDef:(BOOL)flag
{
if( ( self = [super init] ) != nil )
{
if ((self = [super init]) != nil) {
self.opacity = [IJSVGUnitLength unitWithFloat:0.f];
self.fillOpacity = [IJSVGUnitLength unitWithFloat:1.f];
self.fillOpacity.inherit = YES;
self.strokeDashOffset = [IJSVGUnitLength unitWithFloat:0.f];
self.shouldRender = YES;
self.strokeOpacity = [IJSVGUnitLength unitWithFloat:1.f];
self.strokeOpacity.inherit = YES;
self.strokeWidth = [IJSVGUnitLength unitWithFloat:1.f];
self.strokeWidth.inherit = YES;
self.windingRule = IJSVGWindingRuleInherit;
self.lineCapStyle = IJSVGLineCapStyleInherit;
self.lineJoinStyle = IJSVGLineJoinStyleInherit;
self.units = IJSVGUnitInherit;
self.blendMode = IJSVGBlendModeNormal;
if( flag ) {
if (flag) {
def = [[IJSVGDef alloc] init];
}
}
return self;
}
- (IJSVGDef *)defForID:(NSString *)anID
- (IJSVGDef*)defForID:(NSString*)anID
{
IJSVGDef * aDef = nil;
if( (aDef = [def defForID:anID]) != nil ) {
IJSVGDef* aDef = nil;
if ((aDef = [def defForID:anID]) != nil) {
return aDef;
}
if( parentNode != nil ) {
if (parentNode != nil) {
return [parentNode defForID:anID];
}
return nil;
}
- (void)addDef:(IJSVGNode *)aDef
- (void)addDef:(IJSVGNode*)aDef
{
[def addDef:aDef];
}
@@ -260,7 +258,7 @@
// winding rule can inherit..
- (IJSVGWindingRule)windingRule
{
if(windingRule == IJSVGWindingRuleInherit && parentNode != nil) {
if (windingRule == IJSVGWindingRuleInherit && parentNode != nil) {
return parentNode.windingRule;
}
return windingRule;
@@ -268,8 +266,8 @@
- (IJSVGLineCapStyle)lineCapStyle
{
if( lineCapStyle == IJSVGLineCapStyleInherit ) {
if( parentNode != nil ) {
if (lineCapStyle == IJSVGLineCapStyleInherit) {
if (parentNode != nil) {
return parentNode.lineCapStyle;
}
}
@@ -278,8 +276,8 @@
- (IJSVGLineJoinStyle)lineJoinStyle
{
if( lineJoinStyle == IJSVGLineJoinStyleInherit ) {
if( parentNode != nil ) {
if (lineJoinStyle == IJSVGLineJoinStyleInherit) {
if (parentNode != nil) {
return parentNode.lineJoinStyle;
}
}
@@ -288,9 +286,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGUnitLength *)opacity
- (IJSVGUnitLength*)opacity
{
if(opacity.inherit && parentNode != nil) {
if (opacity.inherit && parentNode != nil) {
return parentNode.opacity;
}
return opacity;
@@ -298,9 +296,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGUnitLength *)fillOpacity
- (IJSVGUnitLength*)fillOpacity
{
if(fillOpacity.inherit && parentNode != nil) {
if (fillOpacity.inherit && parentNode != nil) {
return parentNode.fillOpacity;
}
return fillOpacity;
@@ -308,9 +306,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGUnitLength *)strokeWidth
- (IJSVGUnitLength*)strokeWidth
{
if(strokeWidth.inherit && parentNode != nil) {
if (strokeWidth.inherit && parentNode != nil) {
return parentNode.strokeWidth;
}
return strokeWidth;
@@ -318,18 +316,18 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (NSColor *)strokeColor
- (NSColor*)strokeColor
{
if( strokeColor != nil )
if (strokeColor != nil)
return strokeColor;
if( strokeColor == nil && parentNode != nil )
if (strokeColor == nil && parentNode != nil)
return parentNode.strokeColor;
return nil;
}
- (IJSVGUnitLength *)strokeOpacity
- (IJSVGUnitLength*)strokeOpacity
{
if(strokeOpacity.inherit && parentNode != nil) {
if (strokeOpacity.inherit && parentNode != nil) {
return parentNode.strokeOpacity;
}
return strokeOpacity;
@@ -337,9 +335,9 @@
// even though the spec explicity states fill color
// must be on the path, it can also be on the
- (NSColor *)fillColor
- (NSColor*)fillColor
{
if( fillColor == nil && parentNode != nil ) {
if (fillColor == nil && parentNode != nil) {
return parentNode.fillColor;
}
return fillColor;
@@ -347,9 +345,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGGradient *)fillGradient
- (IJSVGGradient*)fillGradient
{
if(fillGradient == nil && parentNode != nil) {
if (fillGradient == nil && parentNode != nil) {
return parentNode.fillGradient;
}
return fillGradient;
@@ -357,9 +355,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGPattern *)fillPattern
- (IJSVGPattern*)fillPattern
{
if(fillPattern == nil && parentNode != nil) {
if (fillPattern == nil && parentNode != nil) {
return parentNode.fillPattern;
}
return fillPattern;
@@ -367,9 +365,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGGradient *)strokeGradient
- (IJSVGGradient*)strokeGradient
{
if(strokeGradient == nil && parentNode != nil) {
if (strokeGradient == nil && parentNode != nil) {
return parentNode.strokeGradient;
}
return strokeGradient;
@@ -377,9 +375,9 @@
// these are all recursive, so go up the chain
// if they dont exist on this specific node
- (IJSVGPattern *)strokePattern
- (IJSVGPattern*)strokePattern
{
if(strokePattern == nil && parentNode != nil) {
if (strokePattern == nil && parentNode != nil) {
return parentNode.strokePattern;
}
return strokePattern;
+91 -90
View File
@@ -6,125 +6,126 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGColor.h"
#import "IJSVGCommand.h"
#import "IJSVGDef.h"
#import "IJSVGError.h"
#import "IJSVGForeignObject.h"
#import "IJSVGGroup.h"
#import "IJSVGPath.h"
#import "IJSVGUtils.h"
#import "IJSVGCommand.h"
#import "IJSVGColor.h"
#import "IJSVGTransform.h"
#import "IJSVGDef.h"
#import "IJSVGLinearGradient.h"
#import "IJSVGRadialGradient.h"
#import "IJSVGError.h"
#import "IJSVGStyleSheet.h"
#import "IJSVGPattern.h"
#import "IJSVGImage.h"
#import "IJSVGLinearGradient.h"
#import "IJSVGPath.h"
#import "IJSVGPattern.h"
#import "IJSVGRadialGradient.h"
#import "IJSVGStyleSheet.h"
#import "IJSVGText.h"
#import "IJSVGTransform.h"
#import "IJSVGUtils.h"
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
static NSString const * IJSVGAttributeViewBox = @"viewBox";
static NSString const * IJSVGAttributeID = @"id";
static NSString const * IJSVGAttributeClass = @"class";
static NSString const * IJSVGAttributeX = @"x";
static NSString const * IJSVGAttributeY = @"y";
static NSString const * IJSVGAttributeWidth = @"width";
static NSString const * IJSVGAttributeHeight = @"height";
static NSString const * IJSVGAttributeOpacity = @"opacity";
static NSString const * IJSVGAttributeStrokeOpacity = @"stroke-opacity";
static NSString const * IJSVGAttributeStrokeWidth = @"stroke-width";
static NSString const * IJSVGAttributeStrokeDashOffset = @"stroke-dashoffset";
static NSString const * IJSVGAttributeFillOpacity = @"fill-opacity";
static NSString const * IJSVGAttributeClipPath = @"clip-path";
static NSString const * IJSVGAttributeMask = @"mask";
static NSString const * IJSVGAttributeGradientUnits = @"gradientUnits";
static NSString const * IJSVGAttributeMaskUnits = @"maskUnits";
static NSString const * IJSVGAttributeMaskContentUnits = @"maskContentUnits";
static NSString const * IJSVGAttributeTransform = @"transform";
static NSString const * IJSVGAttributeGradientTransform = @"gradientTransform";
static NSString const * IJSVGAttributeUnicode = @"unicode";
static NSString const * IJSVGAttributeStrokeLineCap = @"stroke-linecap";
static NSString const * IJSVGAttributeLineJoin = @"stroke-linejoin";
static NSString const * IJSVGAttributeStroke = @"stroke";
static NSString const * IJSVGAttributeStrokeDashArray = @"stroke-dasharray";
static NSString const * IJSVGAttributeFill = @"fill";
static NSString const * IJSVGAttributeFillRule = @"fill-rule";
static NSString const * IJSVGAttributeBlendMode = @"mix-blend-mode";
static NSString const * IJSVGAttributeDisplay = @"display";
static NSString const * IJSVGAttributeStyle = @"style";
static NSString const * IJSVGAttributeD = @"d";
static NSString const * IJSVGAttributeXLink = @"xlink:href";
static NSString const * IJSVGAttributeX1 = @"x1";
static NSString const * IJSVGAttributeX2 = @"x2";
static NSString const * IJSVGAttributeY1 = @"y1";
static NSString const * IJSVGAttributeY2 = @"y2";
static NSString const * IJSVGAttributeRX = @"rx";
static NSString const * IJSVGAttributeRY = @"ry";
static NSString const * IJSVGAttributeCX = @"cx";
static NSString const * IJSVGAttributeCY = @"cy";
static NSString const * IJSVGAttributeR = @"r";
static NSString const * IJSVGAttributePoints = @"points";
static NSString const* IJSVGAttributeViewBox = @"viewBox";
static NSString const* IJSVGAttributeID = @"id";
static NSString const* IJSVGAttributeClass = @"class";
static NSString const* IJSVGAttributeX = @"x";
static NSString const* IJSVGAttributeY = @"y";
static NSString const* IJSVGAttributeWidth = @"width";
static NSString const* IJSVGAttributeHeight = @"height";
static NSString const* IJSVGAttributeOpacity = @"opacity";
static NSString const* IJSVGAttributeStrokeOpacity = @"stroke-opacity";
static NSString const* IJSVGAttributeStrokeWidth = @"stroke-width";
static NSString const* IJSVGAttributeStrokeDashOffset = @"stroke-dashoffset";
static NSString const* IJSVGAttributeFillOpacity = @"fill-opacity";
static NSString const* IJSVGAttributeClipPath = @"clip-path";
static NSString const* IJSVGAttributeMask = @"mask";
static NSString const* IJSVGAttributeGradientUnits = @"gradientUnits";
static NSString const* IJSVGAttributeMaskUnits = @"maskUnits";
static NSString const* IJSVGAttributeMaskContentUnits = @"maskContentUnits";
static NSString const* IJSVGAttributeTransform = @"transform";
static NSString const* IJSVGAttributeGradientTransform = @"gradientTransform";
static NSString const* IJSVGAttributeUnicode = @"unicode";
static NSString const* IJSVGAttributeStrokeLineCap = @"stroke-linecap";
static NSString const* IJSVGAttributeLineJoin = @"stroke-linejoin";
static NSString const* IJSVGAttributeStroke = @"stroke";
static NSString const* IJSVGAttributeStrokeDashArray = @"stroke-dasharray";
static NSString const* IJSVGAttributeFill = @"fill";
static NSString const* IJSVGAttributeFillRule = @"fill-rule";
static NSString const* IJSVGAttributeBlendMode = @"mix-blend-mode";
static NSString const* IJSVGAttributeDisplay = @"display";
static NSString const* IJSVGAttributeStyle = @"style";
static NSString const* IJSVGAttributeD = @"d";
static NSString const* IJSVGAttributeXLink = @"xlink:href";
static NSString const* IJSVGAttributeX1 = @"x1";
static NSString const* IJSVGAttributeX2 = @"x2";
static NSString const* IJSVGAttributeY1 = @"y1";
static NSString const* IJSVGAttributeY2 = @"y2";
static NSString const* IJSVGAttributeRX = @"rx";
static NSString const* IJSVGAttributeRY = @"ry";
static NSString const* IJSVGAttributeCX = @"cx";
static NSString const* IJSVGAttributeCY = @"cy";
static NSString const* IJSVGAttributeR = @"r";
static NSString const* IJSVGAttributePoints = @"points";
@class IJSVGParser;
@protocol IJSVGParserDelegate <NSObject>
@optional
- (BOOL)svgParser:(IJSVGParser *)svg
shouldHandleForeignObject:(IJSVGForeignObject *)foreignObject;
- (void)svgParser:(IJSVGParser *)svg
handleForeignObject:(IJSVGForeignObject *)foreignObject
document:(NSXMLDocument *)document;
- (void)svgParser:(IJSVGParser *)svg
foundSubSVG:(IJSVG *)subSVG
withSVGString:(NSString *)string;
- (BOOL)svgParser:(IJSVGParser*)svg
shouldHandleForeignObject:(IJSVGForeignObject*)foreignObject;
- (void)svgParser:(IJSVGParser*)svg
handleForeignObject:(IJSVGForeignObject*)foreignObject
document:(NSXMLDocument*)document;
- (void)svgParser:(IJSVGParser*)svg
foundSubSVG:(IJSVG*)subSVG
withSVGString:(NSString*)string;
@end
@interface IJSVGParser : IJSVGGroup {
NSRect viewBox;
NSSize proposedViewSize;
@private
id<IJSVGParserDelegate> _delegate;
NSXMLDocument * _document;
NSMutableArray * _glyphs;
IJSVGStyleSheet * _styleSheet;
NSMutableArray * _parsedNodes;
NSMutableDictionary * _defNodes;
NSMutableDictionary * _baseDefNodes;
NSMutableArray<IJSVG *> * _svgs;
NSMutableArray * _definedGroups;
NSXMLDocument* _document;
NSMutableArray* _glyphs;
IJSVGStyleSheet* _styleSheet;
NSMutableArray* _parsedNodes;
NSMutableDictionary* _defNodes;
NSMutableDictionary* _baseDefNodes;
NSMutableArray<IJSVG*>* _svgs;
NSMutableArray* _definedGroups;
struct {
unsigned int shouldHandleForeignObject: 1;
unsigned int handleForeignObject: 1;
unsigned int handleSubSVG: 1;
unsigned int shouldHandleForeignObject : 1;
unsigned int handleForeignObject : 1;
unsigned int handleSubSVG : 1;
} _respondsTo;
}
@property ( nonatomic, readonly ) NSRect viewBox;
@property ( nonatomic, readonly ) NSSize proposedViewSize;
@property (nonatomic, readonly) NSRect viewBox;
@property (nonatomic, readonly) NSSize proposedViewSize;
+ (BOOL)isDataSVG:(NSData *)data;
+ (BOOL)isDataSVG:(NSData*)data;
- (id)initWithSVGString:(NSString *)string
error:(NSError **)error
- (id)initWithSVGString:(NSString*)string
error:(NSError**)error
delegate:(id<IJSVGParserDelegate>)delegate;
- (id)initWithFileURL:(NSURL *)aURL
error:(NSError **)error
- (id)initWithFileURL:(NSURL*)aURL
error:(NSError**)error
delegate:(id<IJSVGParserDelegate>)delegate;
+ (IJSVGParser *)groupForFileURL:(NSURL *)aURL;
+ (IJSVGParser *)groupForFileURL:(NSURL *)aURL
delegate:(id<IJSVGParserDelegate>)delegate;
+ (IJSVGParser *)groupForFileURL:(NSURL *)aURL
error:(NSError **)error
delegate:(id<IJSVGParserDelegate>)delegate;
+ (IJSVGParser*)groupForFileURL:(NSURL*)aURL;
+ (IJSVGParser*)groupForFileURL:(NSURL*)aURL
delegate:(id<IJSVGParserDelegate>)delegate;
+ (IJSVGParser*)groupForFileURL:(NSURL*)aURL
error:(NSError**)error
delegate:(id<IJSVGParserDelegate>)delegate;
- (NSSize)size;
- (BOOL)isFont;
- (NSArray *)glyphs;
- (NSArray<IJSVG *> *)subSVGs:(BOOL)recursive;
- (NSArray*)glyphs;
- (NSArray<IJSVG*>*)subSVGs:(BOOL)recursive;
@end
+853 -852
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -6,28 +6,28 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGBezierPathAdditions.h"
#import "IJSVGNode.h"
#import <Foundation/Foundation.h>
@class IJSVGGroup;
@interface IJSVGPath : IJSVGNode {
NSBezierPath * path;
NSBezierPath * subpath;
NSBezierPath* path;
NSBezierPath* subpath;
CGPoint lastControlPoint;
}
@property ( nonatomic, readonly ) NSBezierPath * path;
@property ( nonatomic, readonly ) NSBezierPath * subpath;
@property ( nonatomic, assign ) CGPoint lastControlPoint;
@property (nonatomic, readonly) NSBezierPath* path;
@property (nonatomic, readonly) NSBezierPath* subpath;
@property (nonatomic, assign) CGPoint lastControlPoint;
@property (atomic, readonly) CGPathRef CGPath;
- (NSBezierPath *)currentSubpath;
- (NSBezierPath*)currentSubpath;
- (void)close;
- (NSPoint)currentPoint;
- (void)overwritePath:(NSBezierPath *)aPath;
- (void)overwritePath:(NSBezierPath*)aPath;
- (CGPathRef)newPathRefByAutoClosingPath:(BOOL)autoClose;
@end
+63 -52
View File
@@ -6,36 +6,40 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGPath.h"
#import "IJSVGGroup.h"
#import "IJSVGPath.h"
@implementation IJSVGPath
@synthesize path;
@synthesize subpath;
@synthesize lastControlPoint;
@synthesize CGPath = _CGPath;
- (void)dealloc
{
if(subpath!=nil) {
[subpath release], subpath = nil;
if(_CGPath != nil) {
CGPathRelease(_CGPath);
_CGPath = nil;
}
if (subpath != nil) {
(void)([subpath release]), subpath = nil;
}
[super dealloc];
}
- (id)init
{
if( ( self = [super init] ) != nil )
{
subpath = [[NSBezierPath bezierPath] retain];
if ((self = [super init]) != nil) {
subpath = NSBezierPath.bezierPath.retain;
path = subpath; // for legacy use
}
return self;
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGPath * node = [super copyWithZone:zone];
IJSVGPath* node = [super copyWithZone:zone];
[node overwritePath:self.path];
return node;
}
@@ -45,7 +49,7 @@
return [subpath currentPoint];
}
- (NSBezierPath *)currentSubpath
- (NSBezierPath*)currentSubpath
{
return subpath;
}
@@ -55,9 +59,17 @@
[subpath closePath];
}
- (void)overwritePath:(NSBezierPath *)aPath
- (CGPathRef)CGPath
{
[subpath release], subpath = nil;
if(_CGPath == nil) {
_CGPath = [self newPathRefByAutoClosingPath:NO];
}
return _CGPath;
}
- (void)overwritePath:(NSBezierPath*)aPath
{
(void)([subpath release]), subpath = nil;
subpath = [aPath retain];
path = subpath;
}
@@ -65,62 +77,61 @@
- (CGPathRef)newPathRefByAutoClosingPath:(BOOL)autoClose
{
NSInteger i = 0;
NSInteger numElements = [self.path elementCount];
NSBezierPath * bezPath = self.path;
NSInteger numElements = self.path.elementCount;
NSBezierPath* bezPath = self.path;
// nothing to return
if(numElements == 0) {
if (numElements == 0) {
return NULL;
}
CGMutablePathRef aPath = CGPathCreateMutable();
NSPoint points[3];
BOOL didClosePath = YES;
for (i = 0; i < numElements; i++) {
switch ([bezPath elementAtIndex:i associatedPoints:points])
{
// move
case NSMoveToBezierPathElement: {
CGPathMoveToPoint(aPath, NULL, points[0].x, points[0].y);
break;
}
// line
case NSLineToBezierPathElement: {
CGPathAddLineToPoint(aPath, NULL, points[0].x, points[0].y);
didClosePath = NO;
break;
}
// curve
case NSCurveToBezierPathElement: {
CGPathAddCurveToPoint(aPath, NULL, points[0].x, points[0].y,
points[1].x, points[1].y,
points[2].x, points[2].y);
didClosePath = NO;
break;
}
// close
case NSClosePathBezierPathElement: {
CGPathCloseSubpath(aPath);
didClosePath = YES;
break;
}
switch ([bezPath elementAtIndex:i associatedPoints:points]) {
// move
case NSMoveToBezierPathElement: {
CGPathMoveToPoint(aPath, NULL, points[0].x, points[0].y);
break;
}
// line
case NSLineToBezierPathElement: {
CGPathAddLineToPoint(aPath, NULL, points[0].x, points[0].y);
didClosePath = NO;
break;
}
// curve
case NSCurveToBezierPathElement: {
CGPathAddCurveToPoint(aPath, NULL, points[0].x, points[0].y,
points[1].x, points[1].y,
points[2].x, points[2].y);
didClosePath = NO;
break;
}
// close
case NSClosePathBezierPathElement: {
CGPathCloseSubpath(aPath);
didClosePath = YES;
break;
}
}
}
if (!didClosePath && autoClose) {
CGPathCloseSubpath(aPath);
}
// create immutable and release
CGPathRef pathToReturn = CGPathCreateCopy(aPath);
CGPathRelease(aPath);
return pathToReturn;
}
+1 -2
View File
@@ -6,12 +6,11 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGGroup.h"
#import "IJSVGImage.h"
#import <Foundation/Foundation.h>
@interface IJSVGPattern : IJSVGGroup {
}
@end
+3 -3
View File
@@ -6,13 +6,13 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGLayer.h"
#import "IJSVGPattern.h"
#import <QuartzCore/QuartzCore.h>
@interface IJSVGPatternLayer : IJSVGLayer
@property (nonatomic, retain) IJSVGLayer * pattern;
@property (nonatomic, retain) IJSVGPattern * patternNode;
@property (nonatomic, retain) IJSVGLayer* pattern;
@property (nonatomic, retain) IJSVGPattern* patternNode;
@end
+17 -16
View File
@@ -15,50 +15,51 @@
- (void)dealloc
{
[pattern release], pattern = nil;
[patternNode release], patternNode = nil;
(void)([pattern release]), pattern = nil;
(void)([patternNode release]), patternNode = nil;
[super dealloc];
}
- (id)init
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
self.requiresBackingScaleHelp = YES;
self.shouldRasterize = YES;
}
return self;
}
void IJSVGPatternDrawingCallBack(void * info, CGContextRef ctx) {
void IJSVGPatternDrawingCallBack(void* info, CGContextRef ctx)
{
// reassign the layer
IJSVGPatternLayer * layer = (IJSVGPatternLayer *)info;
IJSVGPatternLayer* layer = (IJSVGPatternLayer*)info;
[layer.pattern renderInContext:ctx];
};
- (void)drawInContext:(CGContextRef)ctx
{
// holder for callback
static const CGPatternCallbacks callbacks = {0, &IJSVGPatternDrawingCallBack, NULL};
static const CGPatternCallbacks callbacks = { 0, &IJSVGPatternDrawingCallBack, NULL };
// create base pattern space
CGColorSpaceRef patternSpace = CGColorSpaceCreatePattern(NULL);
CGContextSetFillColorSpace(ctx, patternSpace);
CGColorSpaceRelease(patternSpace);
// create the pattern
CGRect rect = self.bounds;
CGPatternRef ref = CGPatternCreate( (void *)self, self.bounds,
CGAffineTransformIdentity,
roundf(rect.size.width*self.patternNode.width.value),
roundf(rect.size.height*self.patternNode.height.value),
kCGPatternTilingConstantSpacing,
true, &callbacks);
CGPatternRef ref = CGPatternCreate((void*)self, self.bounds,
CGAffineTransformIdentity,
roundf(rect.size.width * self.patternNode.width.value),
roundf(rect.size.height * self.patternNode.height.value),
kCGPatternTilingConstantSpacing,
true, &callbacks);
// set the pattern then release it
CGFloat alpha = 1.f;
CGContextSetFillPattern(ctx, ref, &alpha);
CGPatternRelease(ref);
// fill it
CGContextFillRect(ctx, rect);
}
+8 -8
View File
@@ -6,18 +6,18 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGGradient.h"
#import <Foundation/Foundation.h>
@interface IJSVGRadialGradient : IJSVGGradient
@property ( nonatomic, retain ) IJSVGUnitLength * cx;
@property ( nonatomic, retain ) IJSVGUnitLength * cy;
@property ( nonatomic, retain ) IJSVGUnitLength * fx;
@property ( nonatomic, retain ) IJSVGUnitLength * fy;
@property ( nonatomic, retain ) IJSVGUnitLength * radius;
@property (nonatomic, retain) IJSVGUnitLength* cx;
@property (nonatomic, retain) IJSVGUnitLength* cy;
@property (nonatomic, retain) IJSVGUnitLength* fx;
@property (nonatomic, retain) IJSVGUnitLength* fy;
@property (nonatomic, retain) IJSVGUnitLength* radius;
+ (NSGradient *)parseGradient:(NSXMLElement *)element
gradient:(IJSVGRadialGradient *)gradient;
+ (NSGradient*)parseGradient:(NSXMLElement*)element
gradient:(IJSVGRadialGradient*)gradient;
@end
+51 -55
View File
@@ -18,17 +18,17 @@
- (void)dealloc
{
[cx release], cx = nil;
[cy release], cy = nil;
[fx release], fx = nil;
[fy release], fy = nil;
[radius release], radius = nil;
(void)([cx release]), cx = nil;
(void)([cy release]), cy = nil;
(void)([fx release]), fx = nil;
(void)([fy release]), fy = nil;
(void)([radius release]), radius = nil;
[super dealloc];
}
- (id)copyWithZone:(NSZone *)zone
- (id)copyWithZone:(NSZone*)zone
{
IJSVGRadialGradient * grad = [super copyWithZone:zone];
IJSVGRadialGradient* grad = [super copyWithZone:zone];
grad.fx = self.fx;
grad.fy = self.fy;
grad.cx = self.cx;
@@ -37,19 +37,18 @@
return grad;
}
+ (NSGradient *)parseGradient:(NSXMLElement *)element
gradient:(IJSVGRadialGradient *)gradient
+ (NSGradient*)parseGradient:(NSXMLElement*)element
gradient:(IJSVGRadialGradient*)gradient
{
// cx defaults to 50% if not specified
NSDictionary * kv = @{@"cx":@"cx",
@"cy":@"cy",
@"r":@"radius"};
for(NSString * key in kv.allKeys) {
NSString * str = [element attributeForName:key].stringValue;
IJSVGUnitLength * unit = nil;
if(str != nil) {
NSDictionary* kv = @{ @"cx" : @"cx",
@"cy" : @"cy",
@"r" : @"radius" };
for (NSString* key in kv.allKeys) {
NSString* str = [element attributeForName:key].stringValue;
IJSVGUnitLength* unit = nil;
if (str != nil) {
unit = [IJSVGUnitLength unitWithString:str
fromUnitType:gradient.units];
} else {
@@ -59,33 +58,33 @@
[gradient setValue:unit
forKey:kv[key]];
}
// fx and fy are the same unless specified otherwise
gradient.fx = gradient.cx;
gradient.fy = gradient.cy;
// needs fixing
NSString * fx = [element attributeForName:@"fx"].stringValue;
if(fx != nil) {
NSString* fx = [element attributeForName:@"fx"].stringValue;
if (fx != nil) {
gradient.fx = [IJSVGUnitLength unitWithString:fx
fromUnitType:gradient.units];
}
NSString * fy = [element attributeForName:@"fy"].stringValue;
if(fx != nil) {
NSString* fy = [element attributeForName:@"fy"].stringValue;
if (fx != nil) {
gradient.fy = [IJSVGUnitLength unitWithString:fy
fromUnitType:gradient.units];
}
if( gradient.gradient != nil ) {
if (gradient.gradient != nil) {
return nil;
}
NSArray * colors = nil;
CGFloat * colorStops = [self.class computeColorStopsFromString:element colors:&colors];
NSGradient * ret = [[[NSGradient alloc] initWithColors:colors
atLocations:colorStops
colorSpace:IJSVGColor.defaultColorSpace] autorelease];
NSArray* colors = nil;
CGFloat* colorStops = [self.class computeColorStopsFromString:element colors:&colors];
NSGradient* ret = [[[NSGradient alloc] initWithColors:colors
atLocations:colorStops
colorSpace:IJSVGColor.defaultColorSpace] autorelease];
free(colorStops);
return ret;
}
@@ -100,42 +99,41 @@
CGPoint startPoint = CGPointZero;
CGPoint gradientStartPoint = CGPointZero;
CGPoint gradientEndPoint = CGPointZero;
// transforms
CGAffineTransform selfTransform = IJSVGConcatTransforms(self.transforms);
CGRect boundingBox = inUserSpace ? viewBox : objectRect;
// make sure we apply the absolute position to
// transform us back into the correct space
if(inUserSpace == YES) {
if (inUserSpace == YES) {
CGContextConcatCTM(ctx, absoluteTransform);
}
// compute size based on percentages
CGFloat x = [self.cx computeValue:CGRectGetWidth(boundingBox)];
CGFloat y = [self.cy computeValue:CGRectGetHeight(boundingBox)];
startPoint = CGPointMake(x, y);
CGFloat val = MIN(CGRectGetWidth(boundingBox),
CGRectGetHeight(boundingBox));
CGRectGetHeight(boundingBox));
radius = [self.radius computeValue:val];
CGFloat ex = [self.fx computeValue:CGRectGetWidth(boundingBox)];
CGFloat ey = [self.fy computeValue:CGRectGetHeight(boundingBox)];
gradientEndPoint = CGPointMake(ex, ey);
gradientStartPoint = startPoint;
// transform if width or height is not equal - this can only
// be done if we are using objectBoundingBox
if(inUserSpace == NO && CGRectGetWidth(boundingBox) != CGRectGetHeight(boundingBox)) {
if (inUserSpace == NO && CGRectGetWidth(boundingBox) != CGRectGetHeight(boundingBox)) {
CGAffineTransform tr = CGAffineTransformMakeTranslation(gradientStartPoint.x,
gradientStartPoint.y);
if(CGRectGetWidth(boundingBox) > CGRectGetHeight(boundingBox)) {
tr = CGAffineTransformScale(tr, CGRectGetWidth(boundingBox)/CGRectGetHeight(boundingBox), 1);
gradientStartPoint.y);
if (CGRectGetWidth(boundingBox) > CGRectGetHeight(boundingBox)) {
tr = CGAffineTransformScale(tr, CGRectGetWidth(boundingBox) / CGRectGetHeight(boundingBox), 1);
} else {
tr = CGAffineTransformScale(tr, 1.f, CGRectGetHeight(boundingBox)/CGRectGetWidth(boundingBox));
tr = CGAffineTransformScale(tr, 1.f, CGRectGetHeight(boundingBox) / CGRectGetWidth(boundingBox));
}
tr = CGAffineTransformTranslate(tr, -gradientStartPoint.x, -gradientStartPoint.y);
selfTransform = CGAffineTransformConcat(tr, selfTransform);
@@ -145,14 +143,12 @@
CGContextConcatCTM(ctx, selfTransform);
// draw the gradient
CGGradientDrawingOptions options =
kCGGradientDrawsBeforeStartLocation|
kCGGradientDrawsAfterEndLocation;
CGGradientDrawingOptions options = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation;
CGContextDrawRadialGradient(ctx, self.CGGradient,
gradientEndPoint, 0,
gradientStartPoint,
radius, options);
gradientEndPoint, 0,
gradientStartPoint,
radius, options);
#ifdef IJSVG_DEBUG_GRADIENTS
[self _debugStart:gradientStartPoint
end:gradientEndPoint
+1 -1
View File
@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
typedef CGFloat (^IJSVGRenderingBackingScaleFactorHelper)();
typedef CGFloat (^IJSVGRenderingBackingScaleFactorHelper)(void);
typedef NS_ENUM(NSInteger, IJSVGRenderQuality) {
IJSVGRenderQualityFullResolution, // slowest to render
+8 -6
View File
@@ -6,19 +6,21 @@
// Copyright © 2019 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGNode.h"
#import "IJSVGColorList.h"
#import "IJSVGNode.h"
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface IJSVGRenderingStyle : NSObject
@property (nonatomic, assign) IJSVGLineCapStyle lineCapStyle;
@property (nonatomic, assign) IJSVGLineJoinStyle lineJoinStyle;
@property (nonatomic, assign) CGFloat lineWidth;
@property (nonatomic, retain) IJSVGColorList * colorList;
@property (nonatomic, retain) NSColor * fillColor;
@property (nonatomic, retain) NSColor * strokeColor;
@property (nonatomic, retain) IJSVGColorList* colorList;
@property (nonatomic, retain) NSColor* fillColor;
@property (nonatomic, retain) NSColor* strokeColor;
+ (NSArray<NSString *> *)observableProperties;
+ (NSArray<NSString*>*)observableProperties;
@end
+11 -17
View File
@@ -19,15 +19,15 @@
- (void)dealloc
{
[_fillColor release], _fillColor = nil;
[_strokeColor release], _strokeColor = nil;
[_colorList release], _colorList = nil;
(void)([_fillColor release]), _fillColor = nil;
(void)([_strokeColor release]), _strokeColor = nil;
(void)([_colorList release]), _colorList = nil;
[super dealloc];
}
- (id)init
{
if((self = [super init]) != nil) {
if ((self = [super init]) != nil) {
_lineCapStyle = IJSVGLineCapStyleNone;
_lineJoinStyle = IJSVGLineJoinStyleNone;
_lineWidth = IJSVGInheritedFloatValue;
@@ -36,21 +36,15 @@
return self;
}
+ (NSArray<NSString *> *)observableProperties
+ (NSArray<NSString*>*)observableProperties
{
unsigned int count;
objc_property_t * properties = class_copyPropertyList(IJSVGRenderingStyle.class,
&count);
NSMutableArray * names = [[[NSMutableArray alloc] initWithCapacity:count] autorelease];
for(int i = 0; i < count; i++) {
objc_property_t property = properties[i];
const char * name = property_getName(property);
NSString * stringName = [NSString stringWithCString:name
encoding:NSUTF8StringEncoding];
[names addObject:stringName];
static NSArray* array = nil;
if (array == nil) {
array = @[ @"lineCapStyle", @"lineJoinStyle", @"lineWidth",
@"colorList", @"fillColor", @"strokeColor" ]
.retain;
}
free(properties);
return names;
return array;
}
@end
+9 -9
View File
@@ -6,21 +6,21 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "IJSVGLayer.h"
#import "IJSVGUtils.h"
#import <QuartzCore/QuartzCore.h>
@interface IJSVGShapeLayer : CAShapeLayer {
@private
IJSVGLayer * _maskingLayer;
IJSVGLayer* _maskingLayer;
}
@property (nonatomic, assign) IJSVGGradientLayer * gradientFillLayer;
@property (nonatomic, assign) IJSVGPatternLayer * patternFillLayer;
@property (nonatomic, assign) IJSVGStrokeLayer * strokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer * gradientStrokeLayer;
@property (nonatomic, assign) IJSVGPatternLayer * patternStrokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer* gradientFillLayer;
@property (nonatomic, assign) IJSVGPatternLayer* patternFillLayer;
@property (nonatomic, assign) IJSVGStrokeLayer* strokeLayer;
@property (nonatomic, assign) IJSVGGradientLayer* gradientStrokeLayer;
@property (nonatomic, assign) IJSVGPatternLayer* patternStrokeLayer;
@property (nonatomic, assign) BOOL requiresBackingScaleHelp;
@property (nonatomic, assign) CGFloat backingScaleFactor;
@property (nonatomic, assign) IJSVGRenderQuality renderQuality;
@@ -30,7 +30,7 @@
@property (nonatomic, assign) BOOL convertMasksToPaths;
- (void)applySublayerMaskToContext:(CGContextRef)context
forSublayer:(IJSVGLayer *)sublayer
forSublayer:(IJSVGLayer*)sublayer
withOffset:(CGPoint)offset;
@end
+40 -39
View File
@@ -6,8 +6,8 @@
// Copyright © 2017 Curtis Hard. All rights reserved.
//
#import "IJSVGShapeLayer.h"
#import "IJSVGGroupLayer.h"
#import "IJSVGShapeLayer.h"
@implementation IJSVGShapeLayer
@@ -25,18 +25,19 @@
- (void)dealloc
{
[_maskingLayer release], _maskingLayer = nil;
(void)([_maskingLayer release]), _maskingLayer = nil;
[super dealloc];
}
- (void)addSublayer:(CALayer *)layer {
if([layer isKindOfClass:[IJSVGLayer class]] == NO &&
[layer isKindOfClass:[IJSVGShapeLayer class]] == NO) {
NSString * r = [NSString stringWithFormat:@"The layer must be an instance of IJSVGLayer, %@ given.",
[layer class]];
NSException * exception = [NSException exceptionWithName:@"IJSVGInvalidSublayerException"
reason:r
userInfo:nil];
- (void)addSublayer:(CALayer*)layer
{
if ([layer isKindOfClass:[IJSVGLayer class]] == NO &&
[layer isKindOfClass:[IJSVGShapeLayer class]] == NO) {
NSString* r = [NSString stringWithFormat:@"The layer must be an instance of IJSVGLayer, %@ given.",
[layer class]];
NSException* exception = [NSException exceptionWithName:@"IJSVGInvalidSublayerException"
reason:r
userInfo:nil];
@throw exception;
}
[super addSublayer:layer];
@@ -44,7 +45,7 @@
- (void)setBackingScaleFactor:(CGFloat)newFactor
{
if(self.backingScaleFactor == newFactor) {
if (self.backingScaleFactor == newFactor) {
return;
}
backingScaleFactor = newFactor;
@@ -55,10 +56,10 @@
- (void)_customRenderInContext:(CGContextRef)ctx
{
if(self.convertMasksToPaths == YES && _maskingLayer != nil) {
if (self.convertMasksToPaths == YES && _maskingLayer != nil) {
CGContextSaveGState(ctx);
[self applySublayerMaskToContext:ctx
forSublayer:(IJSVGLayer *)self
forSublayer:(IJSVGLayer*)self
withOffset:CGPointZero];
[super renderInContext:ctx];
CGContextRestoreGState(ctx);
@@ -69,49 +70,49 @@
- (void)setConvertMasksToPaths:(BOOL)flag
{
if(convertMasksToPaths == flag) {
if (convertMasksToPaths == flag) {
return;
}
convertMasksToPaths = flag;
if(flag == YES) {
if(_maskingLayer != nil) {
[_maskingLayer release], _maskingLayer = nil;
if (flag == YES) {
if (_maskingLayer != nil) {
(void)([_maskingLayer release]), _maskingLayer = nil;
}
_maskingLayer = [(IJSVGLayer *)self.mask retain];
_maskingLayer = [(IJSVGLayer*)self.mask retain];
self.mask = nil;
} else {
self.mask = _maskingLayer;
[_maskingLayer release], _maskingLayer = nil;
(void)([_maskingLayer release]), _maskingLayer = nil;
}
}
- (void)applySublayerMaskToContext:(CGContextRef)context
forSublayer:(IJSVGLayer *)sublayer
forSublayer:(IJSVGLayer*)sublayer
withOffset:(CGPoint)offset
{
// apply any transforms needed
CGPoint layerOffset = offset;
CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(sublayer.transform);
CGContextConcatCTM( context, CGAffineTransformInvert(sublayerTransform) );
CGContextConcatCTM(context, CGAffineTransformInvert(sublayerTransform));
// walk up the superlayer chain
CALayer * superlayer = self.superlayer;
CALayer* superlayer = self.superlayer;
if (IJSVGIsSVGLayer(superlayer) == YES) {
[(IJSVGLayer *)superlayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer *)self
withOffset:layerOffset];
[(IJSVGLayer*)superlayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer*)self
withOffset:layerOffset];
}
// grab the masking layer
IJSVGShapeLayer * maskingLayer = [self maskingLayer];
IJSVGShapeLayer* maskingLayer = [self maskingLayer];
// if its a group we need to get the lowest level children
// and walk up the chain again
if([maskingLayer isKindOfClass:[IJSVGGroupLayer class]]) {
NSArray * subs = [IJSVGLayer deepestSublayersOfLayer:maskingLayer];
for(IJSVGLayer * subLayer in subs) {
if ([maskingLayer isKindOfClass:[IJSVGGroupLayer class]]) {
NSArray* subs = [IJSVGLayer deepestSublayersOfLayer:maskingLayer];
for (IJSVGLayer* subLayer in subs) {
[subLayer applySublayerMaskToContext:context
forSublayer:(IJSVGLayer *)self
forSublayer:(IJSVGLayer*)self
withOffset:layerOffset];
}
} else if ([maskingLayer isKindOfClass:[IJSVGShapeLayer class]]) {
@@ -125,14 +126,14 @@
CGContextConcatCTM(context, sublayerTransform);
}
- (IJSVGShapeLayer *)maskingLayer
- (IJSVGShapeLayer*)maskingLayer
{
return (IJSVGShapeLayer *)_maskingLayer ?: nil;
return (IJSVGShapeLayer*)_maskingLayer ?: nil;
}
- (void)renderInContext:(CGContextRef)ctx
{
if(self.blendingMode != kCGBlendModeNormal) {
if (self.blendingMode != kCGBlendModeNormal) {
CGContextSaveGState(ctx);
CGContextSetBlendMode(ctx, self.blendingMode);
[self _customRenderInContext:ctx];
@@ -145,8 +146,8 @@
- (CGPoint)absoluteOrigin
{
CGPoint point = CGPointZero;
CALayer * pLayer = self;
while(pLayer != nil) {
CALayer* pLayer = self;
while (pLayer != nil) {
point.x += pLayer.frame.origin.x;
point.y += pLayer.frame.origin.y;
pLayer = pLayer.superlayer;
@@ -154,7 +155,7 @@
return point;
}
- (id<CAAction>)actionForKey:(NSString *)event
- (id<CAAction>)actionForKey:(NSString*)event
{
return nil;
}
+4 -4
View File
@@ -10,9 +10,9 @@
@interface NSString (IJSVGAdditions)
- (NSArray<NSString *> *)componentsSeparatedByChars:(char *)aChar;
- (BOOL)isNumeric;
- (BOOL)containsAlpha;
- (NSArray *)componentsSplitByWhiteSpace;
- (NSArray<NSString *> *)ijsvg_componentsSeparatedByChars:(char *)aChar;
- (BOOL)ijsvg_isNumeric;
- (BOOL)ijsvg_containsAlpha;
- (NSArray*)ijsvg_componentsSplitByWhiteSpace;
@end
+27 -28
View File
@@ -10,83 +10,82 @@
@implementation NSString (IJSVGAdditions)
- (NSArray<NSString *> *)componentsSeparatedByChars:(char *)aChar
- (NSArray<NSString*>*)ijsvg_componentsSeparatedByChars:(char*)aChar
{
NSMutableArray * comp = [[[NSMutableArray alloc] init] autorelease];
NSMutableArray* comp = [[[NSMutableArray alloc] init] autorelease];
NSInteger length = self.length;
unichar * chars = (unichar *)calloc(sizeof(unichar),self.length);
unichar* chars = (unichar*)calloc(sizeof(unichar), self.length);
NSInteger ind = 0;
BOOL startedString = NO;
// block for easy comparison
NSUInteger aLength = strlen(aChar);
BOOL (^charsContainsChar)(char anotherChar) = ^(char anotherChar) {
for(NSInteger i = 0; i < aLength; i++) {
if(aChar[i] == anotherChar) {
for (NSInteger i = 0; i < aLength; i++) {
if (aChar[i] == anotherChar) {
return YES;
}
}
return NO;
};
for(NSInteger i = 0; i < length; i++) {
for (NSInteger i = 0; i < length; i++) {
// the char
unichar theChar = [self characterAtIndex:i];
// start the buffer
BOOL isEqualToChar = charsContainsChar(theChar);
if(isEqualToChar == NO) {
if (isEqualToChar == NO) {
startedString = YES;
chars[ind++] = theChar;
}
// has started and char is the search char, or its at end
if((startedString == YES && isEqualToChar) ||
(i == (length-1) && startedString == YES)) {
if ((startedString == YES && isEqualToChar) || (i == (length - 1) && startedString == YES)) {
startedString = NO;
// append the comp
[comp addObject:[NSString stringWithCharacters:chars length:ind]];
free(chars);
// restart and realloc the memory
ind = 0;
chars = (unichar *)calloc(sizeof(unichar), self.length);
chars = (unichar*)calloc(sizeof(unichar), self.length);
}
}
free(chars);
return comp;
}
- (BOOL)containsAlpha
- (BOOL)ijsvg_containsAlpha
{
const char * buffer = self.UTF8String;
const char* buffer = self.UTF8String;
unsigned long length = strlen(buffer);
for( int i = 0; i < length; i++ ) {
if( isalpha(buffer[i]) ) {
for (int i = 0; i < length; i++) {
if (isalpha(buffer[i])) {
return YES;
}
}
return NO;
}
- (BOOL)isNumeric
- (BOOL)ijsvg_isNumeric
{
const char * buffer = self.UTF8String;
const char* buffer = self.UTF8String;
unsigned long length = strlen(buffer);
for(int i = 0; i < length; i++) {
if(!isnumber(buffer[i])) {
for (int i = 0; i < length; i++) {
if (!isnumber(buffer[i])) {
return NO;
}
}
return YES;
}
- (NSArray *)componentsSplitByWhiteSpace
- (NSArray*)ijsvg_componentsSplitByWhiteSpace
{
return [self componentsSeparatedByChars:"\t\n\r "];
return [self ijsvg_componentsSeparatedByChars:"\t\n\r "];
}
@end
+7 -8
View File
@@ -6,22 +6,21 @@
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGColor.h"
#import <Foundation/Foundation.h>
@interface IJSVGStyle : NSObject {
@private
NSMutableDictionary * _dict;
NSMutableDictionary* _dict;
}
+ (IJSVGStyle *)parseStyleString:(NSString *)string;
+ (IJSVGStyle*)parseStyleString:(NSString*)string;
- (void)setPropertyValue:(id)value
forProperty:(NSString *)key;
- (id)property:(NSString *)key;
forProperty:(NSString*)key;
- (id)property:(NSString*)key;
- (IJSVGStyle *)mergedStyle:(IJSVGStyle *)style;
- (IJSVGStyle*)mergedStyle:(IJSVGStyle*)style;
@end
+35 -40
View File
@@ -13,68 +13,68 @@
- (void)dealloc
{
[_dict release], _dict = nil;
(void)([_dict release]), _dict = nil;
[super dealloc];
}
- (id)init
{
if( ( self = [super init] ) != nil ) {
if ((self = [super init]) != nil) {
_dict = [[NSMutableDictionary alloc] init];
}
return self;
}
- (void)setPropertyValue:(id)value
forProperty:(NSString *)key
forProperty:(NSString*)key
{
[_dict setObject:value
forKey:key];
}
- (NSDictionary *)properties
- (NSDictionary*)properties
{
return _dict;
}
- (id)property:(NSString *)key
- (id)property:(NSString*)key
{
return [_dict objectForKey:key];
}
+ (IJSVGStyle *)parseStyleString:(NSString *)string
+ (IJSVGStyle*)parseStyleString:(NSString*)string
{
IJSVGStyle * style = [[[self.class alloc] init] autorelease];
IJSVGStyle* style = [[[self.class alloc] init] autorelease];
NSInteger length = string.length;
NSInteger index = 0;
NSString * key = nil;
NSString * value = nil;
NSString* key = nil;
NSString* value = nil;
// iterate over the string - its actually really simple what we need
// to do
for(NSInteger i = 0; i < length; i++) {
for (NSInteger i = 0; i < length; i++) {
unichar c = [string characterAtIndex:i];
// find the key
if(c == ':') {
key = [string substringWithRange:NSMakeRange(index, (i-index))];
index = i+1;
if (c == ':') {
key = [string substringWithRange:NSMakeRange(index, (i - index))];
index = i + 1;
}
// find the value
else if(c == ';' || i == (length-1)) {
else if (c == ';' || i == (length - 1)) {
NSInteger chomp;
if(i == (length-1) && c != ';') {
chomp = (i-(index-1));
if (i == (length - 1) && c != ';') {
chomp = (i - (index - 1));
} else {
chomp = (i-index);
chomp = (i - index);
}
value = [string substringWithRange:NSMakeRange(index, chomp)];
index = i+1;
index = i + 1;
}
// set the propery if it actually exists
if(key != nil && value != nil) {
if (key != nil && value != nil) {
[style setPropertyValue:[self.class trimString:value]
forProperty:[self.class trimString:key]];
key = nil;
@@ -84,46 +84,41 @@
return style;
}
+ (NSString *)trimString:(NSString *)string
+ (NSString*)trimString:(NSString*)string
{
return [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+ (NSArray *)allowedColourKeys
+ (NSArray*)allowedColourKeys
{
return @[@"fill",@"stroke-colour",@"stop-color",@"stroke"];
return @[ @"fill", @"stroke-colour", @"stop-color", @"stroke" ];
}
+ (BOOL)isNumeric:(NSString *)string
{
return [[NSScanner scannerWithString:string] scanFloat:NULL];
}
- (void)setProperties:(NSDictionary *)properties
- (void)setProperties:(NSDictionary*)properties
replaceAll:(BOOL)flag
{
if(flag) {
if (flag) {
[_dict removeAllObjects];
}
[_dict addEntriesFromDictionary:properties];
}
- (NSString *)description
- (NSString*)description
{
return [_dict description];
}
- (IJSVGStyle *)mergedStyle:(IJSVGStyle *)style
- (IJSVGStyle*)mergedStyle:(IJSVGStyle*)style
{
// create the new style
IJSVGStyle * newStyle = [[[IJSVGStyle alloc] init] autorelease];
IJSVGStyle* newStyle = [[[IJSVGStyle alloc] init] autorelease];
// grab the current style
NSMutableDictionary * dict = [[[self properties] mutableCopy] autorelease];
NSMutableDictionary* dict = [[[self properties] mutableCopy] autorelease];
// overwride the style with the new styles
[dict addEntriesFromDictionary:[style properties]];
// add the styles to the style
[newStyle setProperties:dict
replaceAll:YES];
+7 -7
View File
@@ -6,20 +6,20 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGStyleSheetSelector.h"
#import "IJSVGStyleSheetRule.h"
#import "IJSVGStyleSheetSelector.h"
#import <Foundation/Foundation.h>
@class IJSVGNode;
@interface IJSVGStyleSheet : NSObject {
@private
NSMutableDictionary * _selectors;
NSMutableArray * _rules;
NSMutableDictionary* _selectors;
NSMutableArray* _rules;
}
- (void)parseStyleBlock:(NSString *)string;
- (IJSVGStyle *)styleForNode:(IJSVGNode *)node;
- (void)parseStyleBlock:(NSString*)string;
- (IJSVGStyle*)styleForNode:(IJSVGNode*)node;
@end
+69 -75
View File
@@ -6,19 +6,18 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import "IJSVGStyleSheet.h"
#import "IJSVGStyle.h"
#import "IJSVGNode.h"
#import "IJSVGStyle.h"
#import "IJSVGStyleSheet.h"
@interface IJSVGStyleSheetSelectorListItem : NSObject {
IJSVGStyleSheetSelector * selector;
IJSVGStyleSheetRule * rule;
IJSVGStyleSheetSelector* selector;
IJSVGStyleSheetRule* rule;
}
@property (nonatomic, retain) IJSVGStyleSheetRule * rule;
@property (nonatomic, retain) IJSVGStyleSheetSelector * selector;
@property (nonatomic, retain) IJSVGStyleSheetRule* rule;
@property (nonatomic, retain) IJSVGStyleSheetSelector* selector;
@end
@@ -28,8 +27,8 @@
- (void)dealloc
{
[rule release], rule = nil;
[selector release], selector = nil;
(void)([rule release]), rule = nil;
(void)([selector release]), selector = nil;
[super dealloc];
}
@@ -39,76 +38,73 @@
- (void)dealloc
{
[_selectors release], _selectors = nil;
[_rules release], _rules = nil;
(void)([_selectors release]), _selectors = nil;
(void)([_rules release]), _rules = nil;
[super dealloc];
}
- (id)init
{
if((self = [super init]) != nil)
{
if ((self = [super init]) != nil) {
_selectors = [[NSMutableDictionary alloc] init];
_rules = [[NSMutableArray alloc] init];
}
return self;
}
- (NSArray *)selectorsWithSelectorString:(NSString *)string
- (NSArray*)selectorsWithSelectorString:(NSString*)string
{
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
NSMutableArray* array = [[[NSMutableArray alloc] init] autorelease];
// split the string by the comma, as it could be multiple
NSArray * comp = [string componentsSeparatedByString:@","];
NSCharacterSet * whiteSpaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSArray* comp = [string componentsSeparatedByString:@","];
NSCharacterSet* whiteSpaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
// create a selector or reuse one already being used
for( NSString * selectorName in comp )
{
for (NSString* selectorName in comp) {
selectorName = [selectorName stringByTrimmingCharactersInSet:whiteSpaceCharSet];
IJSVGStyleSheetSelector * selector = nil;
IJSVGStyleSheetSelector* selector = nil;
// create a new selector if not found
if((selector = [_selectors objectForKey:selectorName]) == nil) {
if ((selector = [_selectors objectForKey:selectorName]) == nil) {
selector = [[[IJSVGStyleSheetSelector alloc] initWithSelectorString:selectorName] autorelease];
if(selector != nil) {
if (selector != nil) {
[_selectors setObject:selector
forKey:selectorName];
}
}
// add it to our list
if(selector != nil) {
if (selector != nil) {
[array addObject:selector];
}
}
return array;
}
- (void)parseStyleBlock:(NSString *)string
- (void)parseStyleBlock:(NSString*)string
{
NSUInteger depth = 0, marker = 0;
NSUInteger length = [string length];
NSCharacterSet * whitespaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString * selector = nil;
for( NSUInteger i = 0; i < length; i++ )
{
NSCharacterSet* whitespaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString* selector = nil;
for (NSUInteger i = 0; i < length; i++) {
unichar c = [string characterAtIndex:i];
if( c == '/' ) {
if (c == '/') {
i++;
if( i<length ) {
if (i < length) {
c = [string characterAtIndex:i];
if( c == '*' ) {
if (c == '*') {
// skip comment until closing /
for( ; i < length; i++ ) {
if([string characterAtIndex:i] == '/') {
for (; i < length; i++) {
if ([string characterAtIndex:i] == '/') {
break;
}
}
if( i < length ) {
marker = i+1;
if (i < length) {
marker = i + 1;
continue;
} else {
// end of string
@@ -119,79 +115,77 @@
}
}
}
// opening brace, could be nested or start of a new string
if( c == '{' ) {
if (c == '{') {
// start a new rule
if(depth == 0) {
if (depth == 0) {
// grab selector and trim it
selector = [string substringWithRange:NSMakeRange(marker, i-marker)];
selector = [string substringWithRange:NSMakeRange(marker, i - marker)];
selector = [selector stringByTrimmingCharactersInSet:whitespaceCharSet];
marker = i+1;
marker = i + 1;
}
depth += 1;
}
// ending brace
else if( c == '}' ) {
else if (c == '}') {
// if we finished rule
if(depth == 1) {
NSString * rule = [string substringWithRange:NSMakeRange(marker, i-marker)];
if (depth == 1) {
NSString* rule = [string substringWithRange:NSMakeRange(marker, i - marker)];
rule = [rule stringByTrimmingCharactersInSet:whitespaceCharSet];
// append the rule to the style sheet
[self addStyleRule:rule
withSelectors:[self selectorsWithSelectorString:selector]];
marker = i+1;
marker = i + 1;
}
depth = MAX(depth-1, 0);
depth = MAX(depth - 1, 0);
}
}
}
- (void)addStyleRule:(NSString *)rule
withSelectors:(NSArray *)selectors
- (void)addStyleRule:(NSString*)rule
withSelectors:(NSArray*)selectors
{
// append the rule onto the list within
// this style sheet
IJSVGStyleSheetRule * aRule = [[[IJSVGStyleSheetRule alloc] init] autorelease];
IJSVGStyleSheetRule* aRule = [[[IJSVGStyleSheetRule alloc] init] autorelease];
aRule.style = [IJSVGStyle parseStyleString:rule];
aRule.selectors = selectors;
[_rules addObject:aRule];
}
- (IJSVGStyle *)styleForNode:(IJSVGNode *)node
- (IJSVGStyle*)styleForNode:(IJSVGNode*)node
{
IJSVGStyle * style = [[[IJSVGStyle alloc] init] autorelease];
NSMutableArray * matchedRules = [[[NSMutableArray alloc] init] autorelease];
for(IJSVGStyleSheetRule * rule in _rules)
{
IJSVGStyleSheetSelector * matchedSelector = nil;
if([rule matchesNode:node selector:&matchedSelector]) {
IJSVGStyle* style = [[[IJSVGStyle alloc] init] autorelease];
NSMutableArray* matchedRules = [[[NSMutableArray alloc] init] autorelease];
for (IJSVGStyleSheetRule* rule in _rules) {
IJSVGStyleSheetSelector* matchedSelector = nil;
if ([rule matchesNode:node selector:&matchedSelector]) {
// make a wrapper for the selector with the rule
IJSVGStyleSheetSelectorListItem * listItem = nil;
IJSVGStyleSheetSelectorListItem* listItem = nil;
listItem = [[[IJSVGStyleSheetSelectorListItem alloc] init] autorelease];
listItem.rule = rule;
listItem.selector = matchedSelector;
// add it to the array of matches
[matchedRules addObject:listItem];
}
}
// now we have all the wrappers, we need to sort them
// by specificity
NSSortDescriptor * sort = [NSSortDescriptor sortDescriptorWithKey:@"selector.specificity"
ascending:YES];
[matchedRules sortUsingDescriptors:@[sort]];
NSSortDescriptor* sort = [NSSortDescriptor sortDescriptorWithKey:@"selector.specificity"
ascending:YES];
[matchedRules sortUsingDescriptors:@[ sort ]];
// combine the rule
for(IJSVGStyleSheetSelectorListItem * listItem in matchedRules) {
for (IJSVGStyleSheetSelectorListItem* listItem in matchedRules) {
style = [style mergedStyle:listItem.rule.style];
}
return style;
}
+9 -10
View File
@@ -6,23 +6,22 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGStyleSheetSelector.h"
#import "IJSVGStyle.h"
#import "IJSVGStyleSheetSelector.h"
#import <Foundation/Foundation.h>
@class IJSVGNode;
@interface IJSVGStyleSheetRule : NSObject {
NSArray * selectors;
IJSVGStyle * style;
NSArray* selectors;
IJSVGStyle* style;
}
@property (nonatomic, retain) NSArray * selectors;
@property (nonatomic, retain) IJSVGStyle * style;
@property (nonatomic, retain) NSArray* selectors;
@property (nonatomic, retain) IJSVGStyle* style;
- (BOOL)matchesNode:(IJSVGNode *)node
selector:(IJSVGStyleSheetSelector **)matchedSelector;
- (BOOL)matchesNode:(IJSVGNode*)node
selector:(IJSVGStyleSheetSelector**)matchedSelector;
@end
+6 -6
View File
@@ -14,18 +14,18 @@
- (void)dealloc
{
[selectors release], selectors = nil;
[style release], style = nil;
(void)([selectors release]), selectors = nil;
(void)([style release]), style = nil;
[super dealloc];
}
- (BOOL)matchesNode:(IJSVGNode *)node
selector:(IJSVGStyleSheetSelector **)matchedSelector
- (BOOL)matchesNode:(IJSVGNode*)node
selector:(IJSVGStyleSheetSelector**)matchedSelector
{
// interate over each select and work out if
// it allows us to be applied
for(IJSVGStyleSheetSelector * selector in selectors) {
if([selector matchesNode:node]) {
for (IJSVGStyleSheetSelector* selector in selectors) {
if ([selector matchesNode:node]) {
*matchedSelector = selector;
return YES;
}
+6 -7
View File
@@ -6,23 +6,22 @@
// Copyright © 2016 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGStyleSheetSelectorRaw.h"
#import <Foundation/Foundation.h>
@class IJSVGNode;
@interface IJSVGStyleSheetSelector : NSObject {
NSString * selector;
NSString* selector;
NSUInteger specificity;
@private
NSMutableArray * _rawSelectors;
NSMutableArray* _rawSelectors;
}
@property (nonatomic, assign) NSUInteger specificity;
- (id)initWithSelectorString:(NSString *)string;
- (BOOL)matchesNode:(IJSVGNode *)node;
- (id)initWithSelectorString:(NSString*)string;
- (BOOL)matchesNode:(IJSVGNode*)node;
@end
+3 -3
View File
@@ -246,8 +246,8 @@ BOOL IJSVGStyleSheetMatchSelector(IJSVGNode * node, IJSVGStyleSheetSelectorRaw *
- (void)dealloc
{
[_rawSelectors release], _rawSelectors = nil;
[selector release], selector = nil;
(void)([_rawSelectors release]), _rawSelectors = nil;
(void)([selector release]), selector = nil;
[super dealloc];
}
@@ -260,7 +260,7 @@ BOOL IJSVGStyleSheetMatchSelector(IJSVGNode * node, IJSVGStyleSheetSelectorRaw *
// failed to compile
if([self _compile] == NO) {
[self release], self = nil;
(void)([self release]), self = nil;
return nil;
}
[self _calculate];
+11 -12
View File
@@ -19,21 +19,20 @@ typedef NS_ENUM(NSUInteger, IJSVGStyleSheetSelectorCombinator) {
@interface IJSVGStyleSheetSelectorRaw : NSObject {
NSString * tag;
NSString * identifier;
NSMutableArray * classes;
NSString* tag;
NSString* identifier;
NSMutableArray* classes;
IJSVGStyleSheetSelectorCombinator combinator;
NSString * combinatorString;
NSString* combinatorString;
}
@property (nonatomic, copy) NSString * tag;
@property (nonatomic, copy) NSString * identifier;
@property (nonatomic, copy) NSString * combinatorString;
@property (nonatomic, retain) NSArray * classes;
@property (nonatomic, copy) NSString* tag;
@property (nonatomic, copy) NSString* identifier;
@property (nonatomic, copy) NSString* combinatorString;
@property (nonatomic, retain) NSArray* classes;
@property (nonatomic, assign) IJSVGStyleSheetSelectorCombinator combinator;
- (void)addClassName:(NSString *)className;
- (void)addClassName:(NSString*)className;
@end
+7 -8
View File
@@ -14,17 +14,16 @@
- (void)dealloc
{
[classes release], classes = nil;
[identifier release], identifier = nil;
[tag release], tag = nil;
[combinatorString release], combinatorString = nil;
(void)([classes release]), classes = nil;
(void)([identifier release]), identifier = nil;
(void)([tag release]), tag = nil;
(void)([combinatorString release]), combinatorString = nil;
[super dealloc];
}
- (id)init
{
if( ( self = [super init] ) != nil )
{
if ((self = [super init]) != nil) {
classes = [[NSMutableArray alloc] init];
combinator = IJSVGStyleSheetSelectorCombinatorDescendant;
combinatorString = @" ";
@@ -32,12 +31,12 @@
return self;
}
- (void)addClassName:(NSString *)className
- (void)addClassName:(NSString*)className
{
[classes addObject:className];
}
- (NSString *)description
- (NSString*)description
{
return [NSString stringWithFormat:@"Combinator: %@, Tag: %@, Classes: %@, Identifier: %@", combinatorString, tag, classes, identifier];
}

Some files were not shown because too many files have changed in this diff Show More