Compare commits
128 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e7b8b38a5 | |||
| 58e1a8c45d | |||
| a525e4351a | |||
| c87716b311 | |||
| 583a930bf7 | |||
| ec2473d450 | |||
| 3cc477955a | |||
| 1f0ff52dff | |||
| e96bfa54b0 | |||
| cd3b540274 | |||
| 1cfbaf14e4 | |||
| 5a389f88d3 | |||
| 9f43832ff3 | |||
| 65623ec552 | |||
| 5192520b7c | |||
| 5123ee7308 | |||
| c886a6a80d | |||
| 4cd2895703 | |||
| a98d84f209 | |||
| 8faab28823 | |||
| cca5524a11 | |||
| c14e2367a0 | |||
| db4b0e9a18 | |||
| 93d6a868a9 | |||
| 60fa627d99 | |||
| ccaa350190 | |||
| 727f8a2dea | |||
| 972812b3f6 | |||
| ad8f440c72 | |||
| 68393b296b | |||
| 1cfcb596d9 | |||
| 69077e49cf | |||
| 3bdf2151ca | |||
| f7e28a2962 | |||
| 2c07cfabdd | |||
| 3e356b3fdc | |||
| 49f759edc0 | |||
| 38e314eb99 | |||
| d0eb015cf1 | |||
| 080626a022 | |||
| 36c20bc55c | |||
| 4d89631e9a | |||
| 65f62007f3 | |||
| af5f16288d | |||
| 08e0f9288d | |||
| 7650f6205c | |||
| 263768af5b | |||
| 4b1be17f9a | |||
| 6b0d6b1452 | |||
| f80d4145bb | |||
| f68c83285b | |||
| 1f4bd989d8 | |||
| 5b5d0b738b | |||
| bd82c5d81b | |||
| 145bbb17f8 | |||
| d9f40551a4 | |||
| 4448f6aeaf | |||
| 6834abba19 | |||
| a86b4e80ba | |||
| 2e8d039599 | |||
| 4ba6bb776d | |||
| 9c80412e88 | |||
| 509f0e0b0a | |||
| ce30877a26 | |||
| 122271bf36 | |||
| 28b4c6b85c | |||
| 4b308d3a3e | |||
| d3ee05d8ac | |||
| 204b516e77 | |||
| a832a986fd | |||
| f875714609 | |||
| b8f166f4c1 | |||
| 7901c9eafe | |||
| 5de88cb1d7 | |||
| 6216b61c19 | |||
| e05f5a0884 | |||
| 849807d3c5 | |||
| eeb03bd89c | |||
| fdc0859e3f | |||
| e2a7f51507 | |||
| ab69ed94dc | |||
| c5be83f57f | |||
| ed00aca06e | |||
| f51fda5f1e | |||
| dd655053ca | |||
| 8c89627f74 | |||
| eb1d27decd | |||
| e6141d7a0f | |||
| 3b7ad40794 | |||
| 674d17863f | |||
| a59072fa1d | |||
| 910b90cd4e | |||
| bb3b9c5378 | |||
| 6d10b172e7 | |||
| c6e59a9280 | |||
| df5b3219ca | |||
| 2c1ae8d0f3 | |||
| 7ba939aabf | |||
| 24e097fedf | |||
| 025ac84958 | |||
| ac9ccdda25 | |||
| 14641ddd60 | |||
| 5f32d03744 | |||
| af086622b1 | |||
| 79187326bc | |||
| ee570eb77f | |||
| d8e1ce8d70 | |||
| a900e2dc50 | |||
| 21f97babec | |||
| 0273a491de | |||
| 488a0c3654 | |||
| 7f7321e6a7 | |||
| d0878c9f1b | |||
| cd135ce271 | |||
| b369891e96 | |||
| cde99fc501 | |||
| efc5f139f6 | |||
| f1c62ed828 | |||
| d66332ad07 | |||
| f2363769bf | |||
| ca1f0d9bf3 | |||
| 8b7fc3171d | |||
| 38df2094c9 | |||
| 2355e86ed7 | |||
| 192a9259fe | |||
| 2a9eb3cdc5 | |||
| 6ed4e3fb8e | |||
| f6e1f1494e |
@@ -7,10 +7,22 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5919E65723F47FF60051873A /* IJSVGUnitRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 5919E65523F47FF60051873A /* IJSVGUnitRect.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5919E65823F47FF60051873A /* IJSVGUnitRect.m in Sources */ = {isa = PBXBuildFile; fileRef = 5919E65623F47FF60051873A /* IJSVGUnitRect.m */; };
|
||||
5919E65B23F480330051873A /* IJSVGUnitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5919E65923F480330051873A /* IJSVGUnitPoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5919E65C23F480330051873A /* IJSVGUnitPoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 5919E65A23F480330051873A /* IJSVGUnitPoint.m */; };
|
||||
591A3E4D25CC91F800AD45B7 /* IJSVGParsing.h in Headers */ = {isa = PBXBuildFile; fileRef = 591A3E4B25CC91F800AD45B7 /* IJSVGParsing.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
591A3E4E25CC91F800AD45B7 /* IJSVGParsing.m in Sources */ = {isa = PBXBuildFile; fileRef = 591A3E4C25CC91F800AD45B7 /* IJSVGParsing.m */; };
|
||||
594A10DA248D7C90001A3181 /* NSImage+IJSVGAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 594A10D8248D7C90001A3181 /* NSImage+IJSVGAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
594A10DB248D7C90001A3181 /* NSImage+IJSVGAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 594A10D9248D7C90001A3181 /* NSImage+IJSVGAdditions.m */; };
|
||||
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 */; };
|
||||
59A24EBC23F480EA0090C374 /* IJSVGUnitSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A24EBA23F480EA0090C374 /* IJSVGUnitSize.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
59A24EBD23F480EA0090C374 /* IJSVGUnitSize.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A24EBB23F480EA0090C374 /* IJSVGUnitSize.m */; };
|
||||
59E7CFAF23B148600077D599 /* IJSVGCommandParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E7CFAD23B148600077D599 /* IJSVGCommandParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
59E7CFB023B148600077D599 /* IJSVGCommandParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7CFAE23B148600077D599 /* IJSVGCommandParser.m */; };
|
||||
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 */; };
|
||||
@@ -20,7 +32,6 @@
|
||||
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 */; };
|
||||
@@ -47,17 +58,14 @@
|
||||
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 */; };
|
||||
@@ -100,12 +108,10 @@
|
||||
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 */; };
|
||||
@@ -124,128 +130,138 @@
|
||||
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 */; };
|
||||
59F36508262F1ABB00BCE3FD /* IJSVGColorType.h in Headers */ = {isa = PBXBuildFile; fileRef = 59F36506262F1ABB00BCE3FD /* IJSVGColorType.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
59F36509262F1ABB00BCE3FD /* IJSVGColorType.m in Sources */ = {isa = PBXBuildFile; fileRef = 59F36507262F1ABB00BCE3FD /* IJSVGColorType.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
5919E65523F47FF60051873A /* IJSVGUnitRect.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IJSVGUnitRect.h; sourceTree = "<group>"; };
|
||||
5919E65623F47FF60051873A /* IJSVGUnitRect.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IJSVGUnitRect.m; sourceTree = "<group>"; };
|
||||
5919E65923F480330051873A /* IJSVGUnitPoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IJSVGUnitPoint.h; sourceTree = "<group>"; };
|
||||
5919E65A23F480330051873A /* IJSVGUnitPoint.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IJSVGUnitPoint.m; sourceTree = "<group>"; };
|
||||
591A3E4B25CC91F800AD45B7 /* IJSVGParsing.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IJSVGParsing.h; sourceTree = "<group>"; };
|
||||
591A3E4C25CC91F800AD45B7 /* IJSVGParsing.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IJSVGParsing.m; sourceTree = "<group>"; };
|
||||
594A10D8248D7C90001A3181 /* NSImage+IJSVGAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSImage+IJSVGAdditions.h"; sourceTree = "<group>"; };
|
||||
594A10D9248D7C90001A3181 /* NSImage+IJSVGAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSImage+IJSVGAdditions.m"; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
59A24EBA23F480EA0090C374 /* IJSVGUnitSize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IJSVGUnitSize.h; sourceTree = "<group>"; };
|
||||
59A24EBB23F480EA0090C374 /* IJSVGUnitSize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IJSVGUnitSize.m; sourceTree = "<group>"; };
|
||||
59E7CFAD23B148600077D599 /* IJSVGCommandParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IJSVGCommandParser.h; path = IJSVG/Source/Parsing/IJSVGCommandParser.h; sourceTree = SOURCE_ROOT; };
|
||||
59E7CFAE23B148600077D599 /* IJSVGCommandParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = IJSVGCommandParser.m; path = IJSVG/Source/Parsing/IJSVGCommandParser.m; sourceTree = SOURCE_ROOT; };
|
||||
59EB756523905F6B00F5AE63 /* IJSVGLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGLayer.h; sourceTree = "<group>"; };
|
||||
59EB756623905F6B00F5AE63 /* IJSVGGradientLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGGradientLayer.h; sourceTree = "<group>"; };
|
||||
59EB756723905F6B00F5AE63 /* IJSVGStyleSheetRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStyleSheetRule.m; sourceTree = "<group>"; };
|
||||
59EB756823905F6B00F5AE63 /* IJSVGCommandLineTo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandLineTo.h; sourceTree = "<group>"; };
|
||||
59EB756923905F6B00F5AE63 /* IJSVGDef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGDef.m; sourceTree = "<group>"; };
|
||||
59EB756A23905F6B00F5AE63 /* IJSVG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVG.h; sourceTree = "<group>"; };
|
||||
59EB756B23905F6B00F5AE63 /* IJSVGText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGText.h; sourceTree = "<group>"; };
|
||||
59EB756C23905F6B00F5AE63 /* IJSVGCommandQuadraticCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandQuadraticCurve.m; sourceTree = "<group>"; };
|
||||
59EB756D23905F6C00F5AE63 /* IJSVGCommandVerticalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandVerticalLine.h; sourceTree = "<group>"; };
|
||||
59EB756F23905F6C00F5AE63 /* IJSVGStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStyleSheet.h; sourceTree = "<group>"; };
|
||||
59EB757023905F6C00F5AE63 /* IJSVGCommandSmoothCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandSmoothCurve.h; sourceTree = "<group>"; };
|
||||
59EB757123905F6C00F5AE63 /* IJSVGColorList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGColorList.m; sourceTree = "<group>"; };
|
||||
59EB757223905F6C00F5AE63 /* IJSVGRadialGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGRadialGradient.h; sourceTree = "<group>"; };
|
||||
59EB757323905F6C00F5AE63 /* IJSVGGradientUnitLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGGradientUnitLength.h; sourceTree = "<group>"; };
|
||||
59EB757423905F6C00F5AE63 /* IJSVGStrokeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStrokeLayer.m; sourceTree = "<group>"; };
|
||||
59EB757523905F6C00F5AE63 /* IJSVGStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStyle.m; sourceTree = "<group>"; };
|
||||
59EB757623905F6C00F5AE63 /* IJSVGImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGImage.m; sourceTree = "<group>"; };
|
||||
59EB757723905F6C00F5AE63 /* IJSVGUnitLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGUnitLength.h; sourceTree = "<group>"; };
|
||||
59EB757823905F6C00F5AE63 /* IJSVGStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStringAdditions.m; sourceTree = "<group>"; };
|
||||
59EB757923905F6C00F5AE63 /* IJSVGTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGTransaction.h; sourceTree = "<group>"; };
|
||||
59EB757A23905F6C00F5AE63 /* IJSVGShapeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGShapeLayer.m; sourceTree = "<group>"; };
|
||||
59EB757B23905F6C00F5AE63 /* IJSVGLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGLayer.m; sourceTree = "<group>"; };
|
||||
59EB757C23905F6C00F5AE63 /* IJSVGFontConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGFontConverter.m; sourceTree = "<group>"; };
|
||||
59EB757D23905F6C00F5AE63 /* IJSVGImageRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGImageRep.m; sourceTree = "<group>"; };
|
||||
59EB757E23905F6C00F5AE63 /* IJSVGCommandQuadraticCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandQuadraticCurve.h; sourceTree = "<group>"; };
|
||||
59EB757F23905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStyleSheetSelectorRaw.h; sourceTree = "<group>"; };
|
||||
59EB758023905F6C00F5AE63 /* IJSVGUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGUtils.m; sourceTree = "<group>"; };
|
||||
59EB758123905F6C00F5AE63 /* IJSVGStyleSheetSelectorRaw.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStyleSheetSelectorRaw.m; sourceTree = "<group>"; };
|
||||
59EB758223905F6C00F5AE63 /* IJSVGGroupLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGGroupLayer.m; sourceTree = "<group>"; };
|
||||
59EB758323905F6C00F5AE63 /* IJSVGColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGColor.h; sourceTree = "<group>"; };
|
||||
59EB758423905F6C00F5AE63 /* IJSVGError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGError.h; sourceTree = "<group>"; };
|
||||
59EB758523905F6C00F5AE63 /* IJSVGColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGColor.m; sourceTree = "<group>"; };
|
||||
59EB758623905F6C00F5AE63 /* IJSVGDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGDef.h; sourceTree = "<group>"; };
|
||||
59EB758723905F6C00F5AE63 /* IJSVGCommandHorizontalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandHorizontalLine.m; sourceTree = "<group>"; };
|
||||
59EB758823905F6D00F5AE63 /* IJSVGFontConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGFontConverter.h; sourceTree = "<group>"; };
|
||||
59EB758A23905F6D00F5AE63 /* IJSVGPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGPath.m; sourceTree = "<group>"; };
|
||||
59EB758B23905F6D00F5AE63 /* IJSVGGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGGroup.h; sourceTree = "<group>"; };
|
||||
59EB758C23905F6D00F5AE63 /* IJSVGPatternLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGPatternLayer.m; sourceTree = "<group>"; };
|
||||
59EB758D23905F6D00F5AE63 /* IJSVGRenderingStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGRenderingStyle.m; sourceTree = "<group>"; };
|
||||
59EB758F23905F6D00F5AE63 /* IJSVGGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGGradientLayer.m; sourceTree = "<group>"; };
|
||||
59EB759023905F6D00F5AE63 /* IJSVGLayerTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGLayerTree.m; sourceTree = "<group>"; };
|
||||
59EB759123905F6D00F5AE63 /* IJSVGCommandVerticalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandVerticalLine.m; sourceTree = "<group>"; };
|
||||
59EB759223905F6D00F5AE63 /* IJSVGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGNode.h; sourceTree = "<group>"; };
|
||||
59EB759423905F6D00F5AE63 /* IJSVGUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGUtils.h; sourceTree = "<group>"; };
|
||||
59EB759523905F6D00F5AE63 /* IJSVGCommandHorizontalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandHorizontalLine.h; sourceTree = "<group>"; };
|
||||
59EB759623905F6D00F5AE63 /* IJSVGNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGNode.m; sourceTree = "<group>"; };
|
||||
59EB759723905F6D00F5AE63 /* IJSVGShapeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGShapeLayer.h; sourceTree = "<group>"; };
|
||||
59EB759823905F6E00F5AE63 /* IJSVGCommandCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandCurve.m; sourceTree = "<group>"; };
|
||||
59EB759923905F6E00F5AE63 /* IJSVGCommandMove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandMove.m; sourceTree = "<group>"; };
|
||||
59EB759A23905F6E00F5AE63 /* IJSVGStyleSheetSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStyleSheetSelector.h; sourceTree = "<group>"; };
|
||||
59EB759B23905F6E00F5AE63 /* IJSVGStyleSheetRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStyleSheetRule.h; sourceTree = "<group>"; };
|
||||
59EB759C23905F6E00F5AE63 /* IJSVGCommandCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandCurve.h; sourceTree = "<group>"; };
|
||||
59EB759D23905F6E00F5AE63 /* IJSVGPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGPath.h; sourceTree = "<group>"; };
|
||||
59EB759E23905F6E00F5AE63 /* IJSVGCommandEllipticalArc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandEllipticalArc.h; sourceTree = "<group>"; };
|
||||
59EB759F23905F6E00F5AE63 /* IJSVGLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGLinearGradient.h; sourceTree = "<group>"; };
|
||||
59EB75A023905F6E00F5AE63 /* IJSVGCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommand.m; sourceTree = "<group>"; };
|
||||
59EB75A123905F6E00F5AE63 /* IJSVGRenderingStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGRenderingStyle.h; sourceTree = "<group>"; };
|
||||
59EB75A223905F6E00F5AE63 /* IJSVG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVG.m; sourceTree = "<group>"; };
|
||||
59EB75A323905F6E00F5AE63 /* IJSVGImageRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGImageRep.h; sourceTree = "<group>"; };
|
||||
59EB75A423905F6E00F5AE63 /* IJSVGStrokeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStrokeLayer.h; sourceTree = "<group>"; };
|
||||
59EB75A523905F6E00F5AE63 /* IJSVGParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGParser.m; sourceTree = "<group>"; };
|
||||
59EB75A623905F6F00F5AE63 /* IJSVGRadialGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGRadialGradient.m; sourceTree = "<group>"; };
|
||||
59EB75A723905F6F00F5AE63 /* IJSVGParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGParser.h; sourceTree = "<group>"; };
|
||||
59EB75A823905F6F00F5AE63 /* IJSVGCommandSmoothCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandSmoothCurve.m; sourceTree = "<group>"; };
|
||||
59EB75A923905F6F00F5AE63 /* IJSVGColorList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGColorList.h; sourceTree = "<group>"; };
|
||||
59EB75AA23905F6F00F5AE63 /* IJSVGPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGPattern.m; sourceTree = "<group>"; };
|
||||
59EB75AB23905F6F00F5AE63 /* IJSVGGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGGradient.h; sourceTree = "<group>"; };
|
||||
59EB75AC23905F6F00F5AE63 /* IJSVGStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStyle.h; sourceTree = "<group>"; };
|
||||
59EB75AD23905F6F00F5AE63 /* IJSVGGroupLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGGroupLayer.h; sourceTree = "<group>"; };
|
||||
59EB75AE23905F6F00F5AE63 /* IJSVGCommandLineTo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandLineTo.m; sourceTree = "<group>"; };
|
||||
59EB75AF23905F6F00F5AE63 /* IJSVGCommandMove.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandMove.h; sourceTree = "<group>"; };
|
||||
59EB75B023905F6F00F5AE63 /* IJSVGTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGTransform.h; sourceTree = "<group>"; };
|
||||
59EB75B123905F6F00F5AE63 /* IJSVGMath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGMath.m; sourceTree = "<group>"; };
|
||||
59EB75B223905F6F00F5AE63 /* IJSVGExporterPathInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGExporterPathInstruction.h; sourceTree = "<group>"; };
|
||||
59EB75B323905F6F00F5AE63 /* IJSVGTransaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGTransaction.m; sourceTree = "<group>"; };
|
||||
59EB75B423905F6F00F5AE63 /* IJSVGTransform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGTransform.m; sourceTree = "<group>"; };
|
||||
59EB75B523905F7000F5AE63 /* IJSVGImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGImage.h; sourceTree = "<group>"; };
|
||||
59EB75B623905F7000F5AE63 /* IJSVGMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGMath.h; sourceTree = "<group>"; };
|
||||
59EB75B723905F7000F5AE63 /* IJSVGCommandClose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandClose.h; sourceTree = "<group>"; };
|
||||
59EB75B823905F7000F5AE63 /* IJSVGStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGStringAdditions.h; sourceTree = "<group>"; };
|
||||
59EB75B923905F7000F5AE63 /* IJSVGGradientUnitLength.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGGradientUnitLength.m; sourceTree = "<group>"; };
|
||||
59EB75BA23905F7000F5AE63 /* IJSVGUnitLength.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGUnitLength.m; sourceTree = "<group>"; };
|
||||
59EB75BB23905F7000F5AE63 /* IJSVGPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGPattern.h; sourceTree = "<group>"; };
|
||||
59EB75BC23905F7000F5AE63 /* IJSVGLayerTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGLayerTree.h; sourceTree = "<group>"; };
|
||||
59EB75BD23905F7000F5AE63 /* IJSVGExporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGExporter.m; sourceTree = "<group>"; };
|
||||
59EB75BF23905F7000F5AE63 /* IJSVGPatternLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGPatternLayer.h; sourceTree = "<group>"; };
|
||||
59EB75C023905F7100F5AE63 /* IJSVGText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGText.m; sourceTree = "<group>"; };
|
||||
59EB75C123905F7100F5AE63 /* IJSVGView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGView.m; sourceTree = "<group>"; };
|
||||
59EB75C223905F7100F5AE63 /* IJSVGLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGLinearGradient.m; sourceTree = "<group>"; };
|
||||
59EB75C423905F7100F5AE63 /* IJSVGStyleSheetSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStyleSheetSelector.m; sourceTree = "<group>"; };
|
||||
59EB75C523905F7100F5AE63 /* IJSVGImageLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGImageLayer.m; sourceTree = "<group>"; };
|
||||
59EB75C623905F7100F5AE63 /* IJSVGCommandClose.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandClose.m; sourceTree = "<group>"; };
|
||||
59EB75C723905F7100F5AE63 /* IJSVGCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommand.h; sourceTree = "<group>"; };
|
||||
59EB75C823905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandSmoothQuadraticCurve.m; sourceTree = "<group>"; };
|
||||
59EB75C923905F7200F5AE63 /* IJSVGForeignObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGForeignObject.m; sourceTree = "<group>"; };
|
||||
59EB75CA23905F7200F5AE63 /* IJSVGCommandSmoothQuadraticCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGCommandSmoothQuadraticCurve.h; sourceTree = "<group>"; };
|
||||
59EB75CB23905F7200F5AE63 /* IJSVGCommandEllipticalArc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGCommandEllipticalArc.m; sourceTree = "<group>"; };
|
||||
59EB75CC23905F7200F5AE63 /* IJSVGGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGGroup.m; sourceTree = "<group>"; };
|
||||
59EB75CD23905F7200F5AE63 /* IJSVGView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGView.h; sourceTree = "<group>"; };
|
||||
59EB75CE23905F7200F5AE63 /* IJSVGForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGForeignObject.h; sourceTree = "<group>"; };
|
||||
59EB75CF23905F7200F5AE63 /* IJSVGExporterPathInstruction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGExporterPathInstruction.m; sourceTree = "<group>"; };
|
||||
59EB75D023905F7200F5AE63 /* IJSVGImageLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGImageLayer.h; sourceTree = "<group>"; };
|
||||
59EB75D123905F7300F5AE63 /* IJSVGStyleSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGStyleSheet.m; sourceTree = "<group>"; };
|
||||
59EB75D223905F7300F5AE63 /* IJSVGGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGGradient.m; sourceTree = "<group>"; };
|
||||
59EB75D323905F7300F5AE63 /* IJSVGRendering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGRendering.h; sourceTree = "<group>"; };
|
||||
59EB75D423905F7300F5AE63 /* IJSVGExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJSVGExporter.h; sourceTree = "<group>"; };
|
||||
59EB75D523905F7300F5AE63 /* IJSVGRendering.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJSVGRendering.m; sourceTree = "<group>"; };
|
||||
59F36506262F1ABB00BCE3FD /* IJSVGColorType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IJSVGColorType.h; sourceTree = "<group>"; };
|
||||
59F36507262F1ABB00BCE3FD /* IJSVGColorType.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IJSVGColorType.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -263,6 +279,188 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
592ABBE223979F9B00F44380 /* Commands */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
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 */,
|
||||
);
|
||||
path = Commands;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE323979FBB00F44380 /* Stylesheets */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
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 */,
|
||||
);
|
||||
path = Stylesheets;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE423979FD200F44380 /* Colors */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB758323905F6C00F5AE63 /* IJSVGColor.h */,
|
||||
59EB758523905F6C00F5AE63 /* IJSVGColor.m */,
|
||||
59EB75A923905F6F00F5AE63 /* IJSVGColorList.h */,
|
||||
59EB757123905F6C00F5AE63 /* IJSVGColorList.m */,
|
||||
59F36506262F1ABB00BCE3FD /* IJSVGColorType.h */,
|
||||
59F36507262F1ABB00BCE3FD /* IJSVGColorType.m */,
|
||||
);
|
||||
path = Colors;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE523979FE100F44380 /* Layers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB756623905F6B00F5AE63 /* IJSVGGradientLayer.h */,
|
||||
59EB758F23905F6D00F5AE63 /* IJSVGGradientLayer.m */,
|
||||
59EB75AD23905F6F00F5AE63 /* IJSVGGroupLayer.h */,
|
||||
59EB758223905F6C00F5AE63 /* IJSVGGroupLayer.m */,
|
||||
59EB75D023905F7200F5AE63 /* IJSVGImageLayer.h */,
|
||||
59EB75C523905F7100F5AE63 /* IJSVGImageLayer.m */,
|
||||
59EB756523905F6B00F5AE63 /* IJSVGLayer.h */,
|
||||
59EB757B23905F6C00F5AE63 /* IJSVGLayer.m */,
|
||||
59EB75BF23905F7000F5AE63 /* IJSVGPatternLayer.h */,
|
||||
59EB758C23905F6D00F5AE63 /* IJSVGPatternLayer.m */,
|
||||
59EB759723905F6D00F5AE63 /* IJSVGShapeLayer.h */,
|
||||
59EB757A23905F6C00F5AE63 /* IJSVGShapeLayer.m */,
|
||||
59EB75A423905F6E00F5AE63 /* IJSVGStrokeLayer.h */,
|
||||
59EB757423905F6C00F5AE63 /* IJSVGStrokeLayer.m */,
|
||||
);
|
||||
path = Layers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE62397A00C00F44380 /* Parsing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59E7CFAD23B148600077D599 /* IJSVGCommandParser.h */,
|
||||
59E7CFAE23B148600077D599 /* IJSVGCommandParser.m */,
|
||||
59EB75A723905F6F00F5AE63 /* IJSVGParser.h */,
|
||||
59EB75A523905F6E00F5AE63 /* IJSVGParser.m */,
|
||||
);
|
||||
path = Parsing;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE72397A02900F44380 /* Nodes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB75CE23905F7200F5AE63 /* IJSVGForeignObject.h */,
|
||||
59EB75C923905F7200F5AE63 /* IJSVGForeignObject.m */,
|
||||
59EB758623905F6C00F5AE63 /* IJSVGDef.h */,
|
||||
59EB756923905F6B00F5AE63 /* IJSVGDef.m */,
|
||||
59EB759F23905F6E00F5AE63 /* IJSVGLinearGradient.h */,
|
||||
59EB75C223905F7100F5AE63 /* IJSVGLinearGradient.m */,
|
||||
59EB757223905F6C00F5AE63 /* IJSVGRadialGradient.h */,
|
||||
59EB75A623905F6F00F5AE63 /* IJSVGRadialGradient.m */,
|
||||
59EB75AB23905F6F00F5AE63 /* IJSVGGradient.h */,
|
||||
59EB75D223905F7300F5AE63 /* IJSVGGradient.m */,
|
||||
59EB758B23905F6D00F5AE63 /* IJSVGGroup.h */,
|
||||
59EB75CC23905F7200F5AE63 /* IJSVGGroup.m */,
|
||||
59EB75B523905F7000F5AE63 /* IJSVGImage.h */,
|
||||
59EB757623905F6C00F5AE63 /* IJSVGImage.m */,
|
||||
59EB759223905F6D00F5AE63 /* IJSVGNode.h */,
|
||||
59EB759623905F6D00F5AE63 /* IJSVGNode.m */,
|
||||
59EB759D23905F6E00F5AE63 /* IJSVGPath.h */,
|
||||
59EB758A23905F6D00F5AE63 /* IJSVGPath.m */,
|
||||
59EB75BB23905F7000F5AE63 /* IJSVGPattern.h */,
|
||||
59EB75AA23905F6F00F5AE63 /* IJSVGPattern.m */,
|
||||
59EB756B23905F6B00F5AE63 /* IJSVGText.h */,
|
||||
59EB75C023905F7100F5AE63 /* IJSVGText.m */,
|
||||
);
|
||||
path = Nodes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE82397A06800F44380 /* Utils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB757323905F6C00F5AE63 /* IJSVGGradientUnitLength.h */,
|
||||
59EB75B923905F7000F5AE63 /* IJSVGGradientUnitLength.m */,
|
||||
59EB75B623905F7000F5AE63 /* IJSVGMath.h */,
|
||||
59EB75B123905F6F00F5AE63 /* IJSVGMath.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 */,
|
||||
5919E65523F47FF60051873A /* IJSVGUnitRect.h */,
|
||||
5919E65623F47FF60051873A /* IJSVGUnitRect.m */,
|
||||
5919E65923F480330051873A /* IJSVGUnitPoint.h */,
|
||||
5919E65A23F480330051873A /* IJSVGUnitPoint.m */,
|
||||
59A24EBA23F480EA0090C374 /* IJSVGUnitSize.h */,
|
||||
59A24EBB23F480EA0090C374 /* IJSVGUnitSize.m */,
|
||||
591A3E4B25CC91F800AD45B7 /* IJSVGParsing.h */,
|
||||
591A3E4C25CC91F800AD45B7 /* IJSVGParsing.m */,
|
||||
);
|
||||
path = Utils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBE92397A08500F44380 /* Exporter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB75D423905F7300F5AE63 /* IJSVGExporter.h */,
|
||||
59EB75BD23905F7000F5AE63 /* IJSVGExporter.m */,
|
||||
59EB75B223905F6F00F5AE63 /* IJSVGExporterPathInstruction.h */,
|
||||
59EB75CF23905F7200F5AE63 /* IJSVGExporterPathInstruction.m */,
|
||||
);
|
||||
path = Exporter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBEA2397A10000F44380 /* Rendering */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB75BC23905F7000F5AE63 /* IJSVGLayerTree.h */,
|
||||
59EB759023905F6D00F5AE63 /* IJSVGLayerTree.m */,
|
||||
59EB75D323905F7300F5AE63 /* IJSVGRendering.h */,
|
||||
59EB75D523905F7300F5AE63 /* IJSVGRendering.m */,
|
||||
59EB75A123905F6E00F5AE63 /* IJSVGRenderingStyle.h */,
|
||||
59EB758D23905F6D00F5AE63 /* IJSVGRenderingStyle.m */,
|
||||
);
|
||||
path = Rendering;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
592ABBEB2397A11800F44380 /* Additions */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59EB75B823905F7000F5AE63 /* IJSVGStringAdditions.h */,
|
||||
59EB757823905F6C00F5AE63 /* IJSVGStringAdditions.m */,
|
||||
594A10D8248D7C90001A3181 /* NSImage+IJSVGAdditions.h */,
|
||||
594A10D9248D7C90001A3181 /* NSImage+IJSVGAdditions.m */,
|
||||
);
|
||||
path = Additions;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
594CF465238FF38E009B251B = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -300,122 +498,36 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
59EB756423905F3100F5AE63 /* Source */ = {
|
||||
59DD1FD123A22CFD00E28C56 /* Core */ = {
|
||||
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 = Core;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
59EB756423905F3100F5AE63 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
59DD1FD123A22CFD00E28C56 /* Core */,
|
||||
592ABBEB2397A11800F44380 /* Additions */,
|
||||
592ABBEA2397A10000F44380 /* Rendering */,
|
||||
592ABBE92397A08500F44380 /* Exporter */,
|
||||
592ABBE82397A06800F44380 /* Utils */,
|
||||
592ABBE72397A02900F44380 /* Nodes */,
|
||||
592ABBE62397A00C00F44380 /* Parsing */,
|
||||
592ABBE523979FE100F44380 /* Layers */,
|
||||
592ABBE423979FD200F44380 /* Colors */,
|
||||
592ABBE323979FBB00F44380 /* Stylesheets */,
|
||||
592ABBE223979F9B00F44380 /* Commands */,
|
||||
);
|
||||
path = Source;
|
||||
sourceTree = "<group>";
|
||||
@@ -429,7 +541,6 @@
|
||||
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 */,
|
||||
@@ -457,7 +568,6 @@
|
||||
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 */,
|
||||
@@ -475,13 +585,19 @@
|
||||
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 */,
|
||||
5919E65723F47FF60051873A /* IJSVGUnitRect.h in Headers */,
|
||||
5919E65B23F480330051873A /* IJSVGUnitPoint.h in Headers */,
|
||||
591A3E4D25CC91F800AD45B7 /* IJSVGParsing.h in Headers */,
|
||||
59A24EBC23F480EA0090C374 /* IJSVGUnitSize.h in Headers */,
|
||||
59EB764523905F7300F5AE63 /* IJSVGExporter.h in Headers */,
|
||||
59F36508262F1ABB00BCE3FD /* IJSVGColorType.h in Headers */,
|
||||
59E7CFAF23B148600077D599 /* IJSVGCommandParser.h in Headers */,
|
||||
59EB762823905F7300F5AE63 /* IJSVGCommandClose.h in Headers */,
|
||||
59EB75E423905F7300F5AE63 /* IJSVGGradientUnitLength.h in Headers */,
|
||||
594A10DA248D7C90001A3181 /* NSImage+IJSVGAdditions.h in Headers */,
|
||||
59EB762D23905F7300F5AE63 /* IJSVGLayerTree.h in Headers */,
|
||||
59EB760B23905F7300F5AE63 /* IJSVGStyleSheetSelector.h in Headers */,
|
||||
);
|
||||
@@ -514,7 +630,7 @@
|
||||
594CF466238FF38E009B251B /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1100;
|
||||
LastUpgradeCheck = 1220;
|
||||
ORGANIZATIONNAME = "Curtis Hard";
|
||||
TargetAttributes = {
|
||||
594CF46E238FF38E009B251B = {
|
||||
@@ -556,16 +672,19 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
59EB763123905F7300F5AE63 /* IJSVGText.m in Sources */,
|
||||
59A24EBD23F480EA0090C374 /* IJSVGUnitSize.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 */,
|
||||
59F36509262F1ABB00BCE3FD /* IJSVGColorType.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 */,
|
||||
594A10DB248D7C90001A3181 /* NSImage+IJSVGAdditions.m in Sources */,
|
||||
59EB761923905F7300F5AE63 /* IJSVGCommandSmoothCurve.m in Sources */,
|
||||
59EB761323905F7300F5AE63 /* IJSVG.m in Sources */,
|
||||
59EB763623905F7300F5AE63 /* IJSVGImageLayer.m in Sources */,
|
||||
@@ -573,24 +692,25 @@
|
||||
59EB75E523905F7300F5AE63 /* IJSVGStrokeLayer.m in Sources */,
|
||||
59EB763223905F7300F5AE63 /* IJSVGView.m in Sources */,
|
||||
59EB763523905F7300F5AE63 /* IJSVGStyleSheetSelector.m in Sources */,
|
||||
59E7CFB023B148600077D599 /* IJSVGCommandParser.m in Sources */,
|
||||
59EB760723905F7300F5AE63 /* IJSVGNode.m in Sources */,
|
||||
5919E65C23F480330051873A /* IJSVGUnitPoint.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 */,
|
||||
591A3E4E25CC91F800AD45B7 /* IJSVGParsing.m in Sources */,
|
||||
5919E65823F47FF60051873A /* IJSVGUnitRect.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 */,
|
||||
@@ -643,6 +763,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -658,6 +779,7 @@
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
@@ -704,6 +826,7 @@
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
@@ -717,6 +840,7 @@
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
@@ -740,6 +864,7 @@
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEFINES_MODULE = NO;
|
||||
DEVELOPMENT_TEAM = 9KTR4W9XX6;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -752,7 +877,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.1;
|
||||
MARKETING_VERSION = 2.2.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.iconjar.ijsvg;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SKIP_INSTALL = YES;
|
||||
@@ -767,6 +892,7 @@
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
DEFINES_MODULE = NO;
|
||||
DEVELOPMENT_TEAM = 9KTR4W9XX6;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -779,7 +905,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.1;
|
||||
MARKETING_VERSION = 2.2.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.iconjar.ijsvg;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
||||
BIN
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1120"
|
||||
LastUpgradeVersion = "1250"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
<key>IJSVG.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>594CF46E238FF38E009B251B</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
<true />
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2019 Curtis Hard. All rights reserved.</string>
|
||||
<string>Copyright © 2020 Curtis Hard. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
+2
-1
@@ -10,9 +10,10 @@
|
||||
|
||||
@interface NSString (IJSVGAdditions)
|
||||
|
||||
- (NSArray<NSString *> *)ijsvg_componentsSeparatedByChars:(char *)aChar;
|
||||
- (NSArray<NSString*>*)ijsvg_componentsSeparatedByChars:(const char*)aChar;
|
||||
- (BOOL)ijsvg_isNumeric;
|
||||
- (BOOL)ijsvg_containsAlpha;
|
||||
- (NSArray*)ijsvg_componentsSplitByWhiteSpace;
|
||||
- (BOOL)ijsvg_isHexString;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// IJSVGStringAdditions.m
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 07/06/2019.
|
||||
// Copyright © 2019 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGStringAdditions.h"
|
||||
#import "IJSVGUtils.h"
|
||||
|
||||
@implementation NSString (IJSVGAdditions)
|
||||
|
||||
- (NSArray<NSString*>*)ijsvg_componentsSeparatedByChars:(const char*)aChar
|
||||
{
|
||||
char* chars = (char*)self.UTF8String;
|
||||
if(chars == NULL || strlen(chars) == 0) {
|
||||
return @[];
|
||||
}
|
||||
NSMutableArray<NSString*>* strings = nil;
|
||||
strings = [[[NSMutableArray alloc] init] autorelease];
|
||||
char* copy = strdup(chars);
|
||||
char* spt = NULL;
|
||||
char* ptr = strtok_r(copy, aChar, &spt);
|
||||
while(ptr != NULL) {
|
||||
NSString* possibleString = nil;
|
||||
if((possibleString = [NSString stringWithUTF8String:ptr]) != nil) {
|
||||
[strings addObject:possibleString];
|
||||
}
|
||||
ptr = strtok_r(NULL, aChar, &spt);
|
||||
}
|
||||
(void)free(copy), copy = NULL;
|
||||
return strings;
|
||||
}
|
||||
|
||||
- (BOOL)ijsvg_containsAlpha
|
||||
{
|
||||
const char* buffer = self.UTF8String;
|
||||
char currentChar;
|
||||
while((currentChar = *buffer++) ) {
|
||||
if (isalpha(currentChar)) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)ijsvg_isNumeric
|
||||
{
|
||||
const char* buffer = self.UTF8String;
|
||||
char currentChar;
|
||||
while((currentChar = *buffer++) ) {
|
||||
if (!isnumber(currentChar)) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSArray*)ijsvg_componentsSplitByWhiteSpace
|
||||
{
|
||||
return [self ijsvg_componentsSeparatedByChars:"\t\n\r "];
|
||||
}
|
||||
|
||||
- (BOOL)ijsvg_isHexString
|
||||
{
|
||||
const char* chars = self.UTF8String;
|
||||
return IJSVGCharBufferIsHEX((char*)chars);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// NSImage+IJSVGAdditions.h
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 07/06/2020.
|
||||
// Copyright © 2020 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
IJSVG* IJSVGGetFromNSImage(NSImage* image);
|
||||
|
||||
@interface NSImage (IJSVGAdditions)
|
||||
|
||||
+ (NSImage*)SVGImageNamed:(NSString*)imageName;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// NSImage+IJSVGAdditions.m
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 07/06/2020.
|
||||
// Copyright © 2020 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGImageRep.h"
|
||||
#import "NSImage+IJSVGAdditions.h"
|
||||
|
||||
IJSVG* IJSVGGetFromNSImage(NSImage* image)
|
||||
{
|
||||
for (NSImageRep* rep in image.representations) {
|
||||
if ([rep isKindOfClass:IJSVGImageRep.class]) {
|
||||
return ((IJSVGImageRep*)rep).SVG;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@implementation NSImage (IJSVGAdditions)
|
||||
|
||||
+ (NSImage*)SVGImageNamed:(NSString*)imageName
|
||||
{
|
||||
// find the image
|
||||
NSBundle* bundle = NSBundle.mainBundle;
|
||||
NSString* str = nil;
|
||||
NSString* ext = imageName.pathExtension;
|
||||
if (ext == nil || ext.length == 0) {
|
||||
ext = @"svg";
|
||||
}
|
||||
|
||||
if ((str = [bundle pathForResource:imageName.stringByDeletingPathExtension
|
||||
ofType:ext])
|
||||
!= nil) {
|
||||
|
||||
// work out if we can get the data
|
||||
NSData* data = [[[NSData alloc] initWithContentsOfFile:str] autorelease];
|
||||
if (data == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// grab the image rep
|
||||
IJSVGImageRep* rep = [[[IJSVGImageRep alloc] initWithData:data] autorelease];
|
||||
NSImage* image = [[[NSImage alloc] init] autorelease];
|
||||
[image addRepresentation:rep];
|
||||
return image;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#import "IJSVGColor.h"
|
||||
#import "IJSVGUtils.h"
|
||||
#import "IJSVGStringAdditions.h"
|
||||
#import "IJSVGParsing.h"
|
||||
|
||||
@implementation IJSVGColor
|
||||
|
||||
@@ -241,36 +243,47 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
|
||||
+ (NSColor*)colorFromString:(NSString*)string
|
||||
{
|
||||
NSCharacterSet* set = NSCharacterSet.whitespaceAndNewlineCharacterSet;
|
||||
string = [string stringByTrimmingCharactersInSet:set];
|
||||
|
||||
if ([string length] < 3) {
|
||||
// swap over to C for performance
|
||||
if(string == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSColor* color = nil;
|
||||
string = [string lowercaseString];
|
||||
if ([self.class isHex:string] == NO) {
|
||||
color = [self.class colorFromPredefinedColorName:string];
|
||||
if (color != nil) {
|
||||
return color;
|
||||
}
|
||||
|
||||
char* str = (char*)string.UTF8String;
|
||||
if(strlen(str) == 0) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// is simply a clear color, dont fill
|
||||
if ([[string lowercaseString] isEqualToString:@"none"]) {
|
||||
return [self computeColorSpace:NSColor.clearColor];
|
||||
|
||||
IJSVGTrimCharBuffer(str);
|
||||
if (IJSVGCharBufferIsHEX(str) == YES) {
|
||||
return [self.class colorFromHEXString:string];
|
||||
}
|
||||
|
||||
// is it RGB?
|
||||
if ([[string substringToIndex:3] isEqualToString:@"rgb"]) {
|
||||
NSRange range = [IJSVGUtils rangeOfParentheses:string];
|
||||
NSString* rgbString = [string substringWithRange:range];
|
||||
NSArray* parts = [rgbString ijsvg_componentsSeparatedByChars:","];
|
||||
if (IJSVGCharBufferHasPrefix(str, "rgb") == YES) {
|
||||
NSUInteger count = 0;
|
||||
IJSVGParsingStringMethod** methods = NULL;
|
||||
methods = IJSVGParsingMethodParseString(str, &count);
|
||||
IJSVGParsingStringMethod* method = methods[0];
|
||||
|
||||
// nothing to return, just mem clean and get out of here
|
||||
if(count == 0 || methods == NULL) {
|
||||
if(methods != NULL) {
|
||||
IJSVGParsingStringMethodsRelease(methods, count);
|
||||
methods = NULL;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// parse the parameters
|
||||
NSString* parameters = [NSString stringWithUTF8String:method->parameters];
|
||||
NSArray* parts = [parameters ijsvg_componentsSeparatedByChars:","];
|
||||
NSString* alpha = @"100%";
|
||||
if (parts.count == 4) {
|
||||
alpha = parts[3];
|
||||
}
|
||||
|
||||
IJSVGParsingStringMethodsRelease(methods, count);
|
||||
methods = NULL;
|
||||
return [self colorFromRString:parts[0]
|
||||
gString:parts[1]
|
||||
bString:parts[2]
|
||||
@@ -278,10 +291,10 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
}
|
||||
|
||||
// is it HSL?
|
||||
if ([[string substringToIndex:3] isEqualToString:@"hsl"]) {
|
||||
if (IJSVGCharBufferHasPrefix(str, "hsl")) {
|
||||
NSInteger count = 0;
|
||||
CGFloat* params = [IJSVGUtils commandParameters:string
|
||||
count:&count];
|
||||
CGFloat* params = [IJSVGUtils scanFloatsFromCString:str
|
||||
size:&count];
|
||||
CGFloat alpha = 1;
|
||||
if (count == 4) {
|
||||
alpha = params[3];
|
||||
@@ -289,27 +302,33 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
|
||||
// convert HSL to HSB
|
||||
CGFloat* hsb = IJSVGColorCSSHSLToHSB(params[0], params[1], params[2]);
|
||||
color = [NSColor colorWithDeviceHue:hsb[0]
|
||||
saturation:hsb[1]
|
||||
brightness:hsb[2]
|
||||
alpha:alpha];
|
||||
NSColor* color = [NSColor colorWithDeviceHue:hsb[0]
|
||||
saturation:hsb[1]
|
||||
brightness:hsb[2]
|
||||
alpha:alpha];
|
||||
|
||||
color = [self computeColorSpace:color];
|
||||
|
||||
// memory clean!
|
||||
free(hsb);
|
||||
free(params);
|
||||
(void)free(hsb), hsb = NULL;
|
||||
(void)free(params), params = NULL;
|
||||
return color;
|
||||
}
|
||||
|
||||
color = [self.class colorFromHEXString:string];
|
||||
return color;
|
||||
|
||||
// is simply a clear color, dont fill
|
||||
if (strcmp(str, "none") == 0 ||
|
||||
strcmp(str, "transparent") == 0) {
|
||||
return [self computeColorSpace:NSColor.clearColor];
|
||||
}
|
||||
|
||||
// could return nil
|
||||
return [self.class colorFromPredefinedColorName:string];
|
||||
}
|
||||
|
||||
+ (NSColor*)colorFromPredefinedColorName:(NSString*)name
|
||||
{
|
||||
NSNumber* hex = nil;
|
||||
name = [name.lowercaseString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
name = [name.lowercaseString stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
|
||||
if ((hex = _colorTree[name]) == nil) {
|
||||
return nil;
|
||||
}
|
||||
@@ -384,8 +403,8 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
}
|
||||
|
||||
// note the %g, CSS alpha is 0 to 1, not 0 - 100, my bad!
|
||||
return [NSString stringWithFormat:@"rgba(%d,%d,%d,%g)", red, green, blue,
|
||||
((float)alpha / 100.f)];
|
||||
return [NSString stringWithFormat:@"rgba(%d,%d,%d,%@)", red, green, blue,
|
||||
IJSVGShortFloatString((float)alpha / 100.f)];
|
||||
}
|
||||
|
||||
+ (NSString*)colorNameFromPredefinedColor:(IJSVGPredefinedColor)color
|
||||
@@ -701,20 +720,12 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
|
||||
+ (BOOL)isColor:(NSString*)string
|
||||
{
|
||||
return [[string substringToIndex:1] isEqualToString:@"#"] ||
|
||||
[[string substringToIndex:3] isEqualToString:@"rgb"];
|
||||
return [string hasPrefix:@"#"] || [string hasPrefix:@"rgb"];
|
||||
}
|
||||
|
||||
+ (BOOL)isHex:(NSString*)string
|
||||
{
|
||||
const char* validList = "0123456789ABCDEFabcdef#";
|
||||
for (NSInteger i = 0; i < string.length; i++) {
|
||||
char c = [string characterAtIndex:i];
|
||||
if (strchr(validList, c) == NULL) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
return string.ijsvg_isHexString;
|
||||
}
|
||||
|
||||
+ (unsigned long)lengthOfHEXInteger:(NSUInteger)hex
|
||||
@@ -760,28 +771,38 @@ CGFloat* IJSVGColorCSSHSLToHSB(CGFloat hue, CGFloat saturation, CGFloat lightnes
|
||||
containsAlphaComponent:(BOOL*)containsAlphaComponent
|
||||
{
|
||||
// absolutely no string
|
||||
if (string == nil || string.length == 0 || ![self.class isHex:string]) {
|
||||
if(string == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
char* str = (char*)string.UTF8String;
|
||||
size_t length = strlen(str);
|
||||
if (length == 0 || IJSVGCharBufferIsHEX(str) == NO) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ([[string substringToIndex:1] isEqualToString:@"#"]) {
|
||||
string = [string substringFromIndex:1];
|
||||
// remove the hash from the front of the string
|
||||
if(str[0] == '#') {
|
||||
length--;
|
||||
str++;
|
||||
}
|
||||
|
||||
// whats the length?
|
||||
NSUInteger length = string.length;
|
||||
unsigned long hex;
|
||||
// we need to work out if its shorthand
|
||||
// if it is, the length needs to be length*2
|
||||
if (length == 3 || length == 4) {
|
||||
// shorthand...
|
||||
NSMutableString* str = [[[NSMutableString alloc] init] autorelease];
|
||||
for (NSInteger i = 0; i < length; i++) {
|
||||
NSString* sub = [string substringWithRange:NSMakeRange(i, 1)];
|
||||
[str appendFormat:@"%@%@", sub, sub];
|
||||
char* chars = NULL;
|
||||
chars = (char*)calloc(sizeof(char),length*2+1);
|
||||
for(int i = 0; i < length; i++) {
|
||||
chars[i*2] = chars[i*2+1] = str[i];
|
||||
}
|
||||
string = str;
|
||||
hex = strtoul(chars, NULL, 16);
|
||||
(void)free(chars), chars = NULL;
|
||||
} else {
|
||||
hex = strtoul(str, NULL, 16);
|
||||
}
|
||||
|
||||
|
||||
// now convert rest to hex
|
||||
unsigned long hex = [self HEXFromArbitraryHexString:string];
|
||||
if (containsAlphaComponent != nil) {
|
||||
*containsAlphaComponent = [self HEXContainsAlphaComponent:hex];
|
||||
}
|
||||
@@ -6,16 +6,19 @@
|
||||
// Copyright © 2019 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGColor.h"
|
||||
#import <IJSVG/IJSVGColor.h>
|
||||
#import <IJSVG/IJSVGColorType.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGColorList : NSObject <NSCopying> {
|
||||
|
||||
@private
|
||||
NSMutableDictionary<NSColor*, NSColor*>* _replacementColorTree;
|
||||
NSMutableSet<NSColor*>* _colors;
|
||||
NSMutableSet<IJSVGColorType*>* _colors;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign, readonly) NSUInteger count;
|
||||
|
||||
- (NSColor*)proposedColorForColor:(NSColor*)color;
|
||||
- (void)removeAllReplacementColors;
|
||||
- (void)removeReplacementColor:(NSColor*)color;
|
||||
@@ -25,7 +28,8 @@
|
||||
clearExistingColors:(BOOL)clearExistingColors;
|
||||
|
||||
- (void)addColorsFromList:(IJSVGColorList*)sheet;
|
||||
- (NSSet<NSColor*>*)colors;
|
||||
- (void)addColor:(NSColor*)color;
|
||||
- (NSSet<IJSVGColorType*>*)colors;
|
||||
- (void)addColor:(IJSVGColorType*)color;
|
||||
- (NSDictionary<NSColor*, NSColor*>*)replacementColors;
|
||||
|
||||
@end
|
||||
@@ -89,24 +89,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSSet<NSColor*>*)colors
|
||||
- (NSSet<IJSVGColorType*>*)colors
|
||||
{
|
||||
return [NSSet setWithSet:_colors];
|
||||
}
|
||||
|
||||
- (void)addColorsFromList:(IJSVGColorList*)sheet
|
||||
{
|
||||
[_colors addObjectsFromArray:sheet.colors.allObjects];
|
||||
for(IJSVGColorType* color in sheet.colors) {
|
||||
[self addColor:color];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addColor:(NSColor*)color
|
||||
- (void)addColor:(IJSVGColorType*)color
|
||||
{
|
||||
[_colors addObject:[IJSVGColor computeColorSpace:color]];
|
||||
// we just need to update its bit mask
|
||||
if([_colors containsObject:color] == YES) {
|
||||
void (^handler)(IJSVGColorType * _Nonnull obj, BOOL * _Nonnull stop) =
|
||||
^(IJSVGColorType * _Nonnull obj, BOOL * _Nonnull stop) {
|
||||
if([obj isEqual:color] == YES) {
|
||||
obj.flags |= color.flags;
|
||||
*stop = YES;
|
||||
}
|
||||
};
|
||||
[_colors enumerateObjectsUsingBlock:handler];
|
||||
return;
|
||||
}
|
||||
[_colors addObject:color];
|
||||
}
|
||||
|
||||
- (void)removeColor:(NSColor*)color
|
||||
- (NSDictionary<NSColor*,NSColor*>*)replacementColors
|
||||
{
|
||||
[_colors removeObject:[IJSVGColor computeColorSpace:color]];
|
||||
return _replacementColorTree;
|
||||
}
|
||||
|
||||
- (void)removeColor:(IJSVGColorType*)color
|
||||
{
|
||||
[_colors removeObject:color];
|
||||
}
|
||||
|
||||
- (NSUInteger)count
|
||||
{
|
||||
return _colors.count;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// IJSVGColorType.h
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 20/04/2021.
|
||||
// Copyright © 2021 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
typedef NS_OPTIONS(NSInteger, IJSVGColorTypeFlags) {
|
||||
IJSVGColorTypeNone = 0,
|
||||
IJSVGColorTypeFlagUnknown = 1 << 0,
|
||||
IJSVGColorTypeFlagFill = 1 << 1,
|
||||
IJSVGColorTypeFlagStroke = 1 << 2,
|
||||
IJSVGColorTypeFlagStop = 1 << 3
|
||||
};
|
||||
|
||||
@interface IJSVGColorType : NSObject {
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSColor* color;
|
||||
@property (nonatomic, assign) IJSVGColorTypeFlags flags;
|
||||
|
||||
+ (IJSVGColorType*)typeWithColor:(NSColor*)color
|
||||
flags:(IJSVGColorTypeFlags)mask;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// IJSVGColorType.m
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 20/04/2021.
|
||||
// Copyright © 2021 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGColorType.h"
|
||||
|
||||
@implementation IJSVGColorType
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)[_color release], _color = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (IJSVGColorType*)typeWithColor:(NSColor*)color
|
||||
flags:(IJSVGColorTypeFlags)mask
|
||||
{
|
||||
IJSVGColorType* type = [[[self alloc] init] autorelease];
|
||||
type.color = color;
|
||||
type.flags = mask;
|
||||
return type;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object
|
||||
{
|
||||
if([object isKindOfClass:IJSVGColorType.class] == NO) {
|
||||
return NO;
|
||||
}
|
||||
return [self.color isEqual:((IJSVGColorType*)object).color];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash
|
||||
{
|
||||
return self.color.hash;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,36 +6,28 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGPath.h"
|
||||
#import <IJSVG/IJSVGCommandParser.h>
|
||||
#import <IJSVG/IJSVGPath.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
static const NSInteger IJSVGCustomVariableParameterCount = NSNotFound;
|
||||
|
||||
typedef NS_ENUM(NSInteger, IJSVGCommandType) {
|
||||
IJSVGCommandTypeAbsolute,
|
||||
IJSVGCommandTypeRelative
|
||||
kIJSVGCommandTypeAbsolute,
|
||||
kIJSVGCommandTypeRelative
|
||||
};
|
||||
|
||||
@interface IJSVGCommand : NSObject {
|
||||
NSString* commandString;
|
||||
NSString* command;
|
||||
CGFloat* parameters;
|
||||
NSInteger parameterCount;
|
||||
NSMutableArray* subCommands;
|
||||
NSInteger requiredParameters;
|
||||
IJSVGCommandType type;
|
||||
IJSVGCommand* previousCommand;
|
||||
@private
|
||||
NSInteger _currentIndex;
|
||||
BOOL isSubCommand;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* commandString;
|
||||
@property (nonatomic, copy) NSString* command;
|
||||
@property (nonatomic, assign) char 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, retain) NSArray<IJSVGCommand*>* subCommands;
|
||||
@property (nonatomic, assign) IJSVGCommand* previousCommand;
|
||||
@property (nonatomic, assign) BOOL isSubCommand;
|
||||
|
||||
@@ -43,6 +35,7 @@ typedef NS_ENUM(NSInteger, IJSVGCommandType) {
|
||||
+ (NSInteger)requiredParameterCount;
|
||||
+ (NSPoint)readCoordinatePair:(CGFloat*)pairs
|
||||
index:(NSInteger)index;
|
||||
+ (IJSVGPathDataSequence*)pathDataSequence;
|
||||
+ (void)runWithParams:(CGFloat*)params
|
||||
paramCount:(NSInteger)count
|
||||
command:(IJSVGCommand*)currentCommand
|
||||
@@ -54,8 +47,10 @@ typedef NS_ENUM(NSInteger, IJSVGCommandType) {
|
||||
intoArray:(NSMutableArray<IJSVGCommand*>*)commands
|
||||
parentCommand:(IJSVGCommand*)parentCommand;
|
||||
|
||||
- (id)initWithCommandString:(NSString*)commandString;
|
||||
- (id)initWithCommandStringBuffer:(const char*)str
|
||||
dataStream:(IJSVGPathDataStream*)dataStream;
|
||||
- (IJSVGCommand*)subcommandWithParameters:(CGFloat*)subParams
|
||||
paramCount:(NSInteger)paramCount
|
||||
previousCommand:(IJSVGCommand*)command;
|
||||
|
||||
- (CGFloat)readFloat;
|
||||
@@ -22,16 +22,6 @@
|
||||
|
||||
@implementation IJSVGCommand
|
||||
|
||||
@synthesize commandString;
|
||||
@synthesize command;
|
||||
@synthesize parameterCount;
|
||||
@synthesize parameters;
|
||||
@synthesize subCommands;
|
||||
@synthesize requiredParameters;
|
||||
@synthesize type;
|
||||
@synthesize previousCommand;
|
||||
@synthesize isSubCommand;
|
||||
|
||||
+ (BOOL)requiresCustomParameterParsing
|
||||
{
|
||||
return NO;
|
||||
@@ -42,6 +32,11 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
+ (IJSVGPathDataSequence*)pathDataSequence
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+ (void)runWithParams:(CGFloat*)params
|
||||
paramCount:(NSInteger)count
|
||||
command:(IJSVGCommand*)currentCommand
|
||||
@@ -99,81 +94,81 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([commandString release]), commandString = nil;
|
||||
(void)([command release]), command = nil;
|
||||
(void)([subCommands release]), subCommands = nil;
|
||||
(void)(free(parameters)), parameters = nil;
|
||||
(void)([_commandString release]), _commandString = nil;
|
||||
(void)([_subCommands release]), _subCommands = nil;
|
||||
if (_parameters) {
|
||||
(void)(free(_parameters)), _parameters = nil;
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)initWithCommandString:(NSString*)str
|
||||
- (id)initWithCommandStringBuffer:(const char*)str
|
||||
dataStream:(IJSVGPathDataStream*)dataStream
|
||||
{
|
||||
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:¶meterCount];
|
||||
requiredParameters = [self.class requiredParameterCount];
|
||||
_command = str[0];
|
||||
_type = [IJSVGUtils typeForCommandChar:_command];
|
||||
NSInteger sets = 0;
|
||||
NSInteger paramCount = [self.class requiredParameterCount];
|
||||
IJSVGPathDataSequence* sequence = [self.class pathDataSequence];
|
||||
_parameters = IJSVGParsePathDataStreamSequence(str, strlen(str),
|
||||
dataStream, sequence, [self.class requiredParameterCount], &sets);
|
||||
|
||||
// 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];
|
||||
if (sets <= 1) {
|
||||
CGFloat* subParams = [self parametersFromIndexOffset:0];
|
||||
IJSVGCommand* command = [self subcommandWithParameters:subParams
|
||||
paramCount:paramCount
|
||||
previousCommand:nil];
|
||||
_subCommands = @[ command ].retain;
|
||||
} 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];
|
||||
NSMutableArray<IJSVGCommand*>* subCommandArray = nil;
|
||||
subCommandArray = [[NSMutableArray alloc] initWithCapacity:sets].autorelease;
|
||||
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
CGFloat* subParams = [self parametersFromIndexOffset:i];
|
||||
|
||||
// generate the subcommand
|
||||
IJSVGCommand* command = [self subcommandWithParameters:subParams
|
||||
paramCount:paramCount
|
||||
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];
|
||||
[subCommandArray addObject:command];
|
||||
}
|
||||
|
||||
// store the retained value
|
||||
_subCommands = subCommandArray.copy;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (CGFloat*)parametersFromIndexOffset:(NSInteger)index
|
||||
{
|
||||
CGFloat* subParams = 0;
|
||||
NSInteger req = [self.class requiredParameterCount];
|
||||
if (req != 0) {
|
||||
subParams = (CGFloat*)malloc(req * sizeof(CGFloat));
|
||||
memcpy(subParams, &self.parameters[index * req], sizeof(CGFloat) * req);
|
||||
}
|
||||
return subParams;
|
||||
}
|
||||
|
||||
- (IJSVGCommand*)subcommandWithParameters:(CGFloat*)subParams
|
||||
paramCount:(NSInteger)paramCount
|
||||
previousCommand:(IJSVGCommand*)aPreviousCommand
|
||||
{
|
||||
// create a subcommand per set
|
||||
IJSVGCommand* c = [[[self.class alloc] init] autorelease];
|
||||
c.parameterCount = self.requiredParameters;
|
||||
c.parameterCount = paramCount;
|
||||
c.parameters = subParams;
|
||||
c.type = self.type;
|
||||
c.command = self.command;
|
||||
@@ -184,15 +179,15 @@
|
||||
|
||||
- (CGFloat)readFloat
|
||||
{
|
||||
CGFloat f = parameters[_currentIndex];
|
||||
CGFloat f = _parameters[_currentIndex];
|
||||
_currentIndex++;
|
||||
return f;
|
||||
}
|
||||
|
||||
- (NSPoint)readPoint
|
||||
{
|
||||
CGFloat x = parameters[_currentIndex];
|
||||
CGFloat y = parameters[_currentIndex + 1];
|
||||
CGFloat x = _parameters[_currentIndex];
|
||||
CGFloat y = _parameters[_currentIndex + 1];
|
||||
_currentIndex += 2;
|
||||
return NSMakePoint(x, y);
|
||||
}
|
||||
@@ -207,4 +202,16 @@
|
||||
_currentIndex = 0;
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
NSMutableString* str = [[[NSMutableString alloc] init] autorelease];
|
||||
[str appendFormat:@"%c ",_command];
|
||||
NSMutableArray* args = [[[NSMutableArray alloc] initWithCapacity:_parameterCount] autorelease];
|
||||
for(int i = 0; i < _parameterCount; i++) {
|
||||
[args addObject:[NSString stringWithFormat:@"%f",_parameters[i]]];
|
||||
}
|
||||
[str appendString:[args componentsJoinedByString:@", "]];
|
||||
return str;
|
||||
}
|
||||
|
||||
@end
|
||||
+9
-7
@@ -22,15 +22,17 @@
|
||||
type:(IJSVGCommandType)type
|
||||
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 == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddCurveToPoint(path.path, NULL, params[0], params[1],
|
||||
params[2], params[3],
|
||||
params[4], params[5]);
|
||||
return;
|
||||
}
|
||||
[[path currentSubpath] relativeCurveToPoint:NSMakePoint(params[4], params[5])
|
||||
controlPoint1:NSMakePoint(params[0], params[1])
|
||||
controlPoint2:NSMakePoint(params[2], params[3])];
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathAddCurveToPoint(path.path, NULL,
|
||||
currentPoint.x + params[0], currentPoint.y + params[1],
|
||||
currentPoint.x + params[2], currentPoint.y + params[3],
|
||||
currentPoint.x + params[4], currentPoint.y + params[5]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// IJSVGCommandArc.m
|
||||
// IJSVGExample
|
||||
//
|
||||
// Created by Curtis Hard on 03/09/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGCommandEllipticalArc.h"
|
||||
#import "IJSVGUtils.h"
|
||||
|
||||
@implementation IJSVGCommandEllipticalArc
|
||||
|
||||
static IJSVGPathDataSequence* _sequence;
|
||||
|
||||
+ (NSInteger)requiredParameterCount
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
+ (IJSVGPathDataSequence*)pathDataSequence
|
||||
{
|
||||
if(_sequence == NULL) {
|
||||
_sequence = (IJSVGPathDataSequence*)malloc(sizeof(IJSVGPathDataSequence) * 7);
|
||||
_sequence[0] = kIJSVGPathDataSequenceTypeFloat;
|
||||
_sequence[1] = kIJSVGPathDataSequenceTypeFloat;
|
||||
_sequence[2] = kIJSVGPathDataSequenceTypeFloat;
|
||||
_sequence[3] = kIJSVGPathDataSequenceTypeFlag;
|
||||
_sequence[4] = kIJSVGPathDataSequenceTypeFlag;
|
||||
_sequence[5] = kIJSVGPathDataSequenceTypeFloat;
|
||||
_sequence[6] = kIJSVGPathDataSequenceTypeFloat;
|
||||
}
|
||||
return _sequence;
|
||||
}
|
||||
|
||||
// modified from https://github.com/SVGKit/SVGKit/blob/880c94a5b77b6f22beb491a7a7e02ace220c32af/Source/Parsers/SVGKPointsAndPathsParser.m
|
||||
+ (void)runWithParams:(CGFloat*)params
|
||||
paramCount:(NSInteger)count
|
||||
command:(IJSVGCommand*)currentCommand
|
||||
previousCommand:(IJSVGCommand*)command
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
CGPoint radii = CGPointZero;
|
||||
CGPoint arcEndPoint = CGPointZero;
|
||||
CGPoint pathCurrentPoint = path.currentPoint;
|
||||
CGFloat xAxisRotation = 0.f;
|
||||
BOOL largeArcFlag = NO;
|
||||
BOOL sweepFlag = NO;
|
||||
|
||||
radii = [currentCommand readPoint];
|
||||
xAxisRotation = [currentCommand readFloat];
|
||||
largeArcFlag = [currentCommand readBOOL];
|
||||
sweepFlag = [currentCommand readBOOL];
|
||||
arcEndPoint = [currentCommand readPoint];
|
||||
|
||||
CGFloat rx = fabs(radii.x);
|
||||
CGFloat ry = fabs(radii.y);
|
||||
|
||||
xAxisRotation *= M_PI / 180.f;
|
||||
xAxisRotation = fmod(xAxisRotation, 2.f * M_PI);
|
||||
|
||||
if (type == kIJSVGCommandTypeRelative) {
|
||||
arcEndPoint.x += pathCurrentPoint.x;
|
||||
arcEndPoint.y += pathCurrentPoint.y;
|
||||
}
|
||||
|
||||
CGFloat x1 = pathCurrentPoint.x;
|
||||
CGFloat y1 = pathCurrentPoint.y;
|
||||
|
||||
CGFloat x2 = arcEndPoint.x;
|
||||
CGFloat y2 = arcEndPoint.y;
|
||||
|
||||
if (rx == 0.f || ry == 0.f) {
|
||||
CGPathAddLineToPoint(path.path, NULL, x2, y2);
|
||||
return;
|
||||
}
|
||||
|
||||
CGFloat cosPhi = cos(xAxisRotation);
|
||||
CGFloat sinPhi = sin(xAxisRotation);
|
||||
|
||||
CGFloat x1p = cosPhi * (x1 - x2) / 2.f + sinPhi * (y1 - y2) / 2.f;
|
||||
CGFloat y1p = -sinPhi * (x1 - x2) / 2.f + cosPhi * (y1 - y2) / 2.f;
|
||||
|
||||
CGFloat rx_2 = rx * rx;
|
||||
CGFloat ry_2 = ry * ry;
|
||||
CGFloat xp_2 = x1p * x1p;
|
||||
CGFloat yp_2 = y1p * y1p;
|
||||
|
||||
CGFloat delta = xp_2 / rx_2 + yp_2 / ry_2;
|
||||
|
||||
if (delta > 1.f) {
|
||||
rx *= sqrt(delta);
|
||||
ry *= sqrt(delta);
|
||||
rx_2 = rx * rx;
|
||||
ry_2 = ry * ry;
|
||||
}
|
||||
|
||||
CGFloat sign = (largeArcFlag == sweepFlag) ? -1.f : 1.f;
|
||||
CGFloat numerator = MAX(0.f, rx_2 * ry_2 - rx_2 * yp_2 - ry_2 * xp_2);
|
||||
CGFloat denom = rx_2 * yp_2 + ry_2 * xp_2;
|
||||
CGFloat lhs = denom == 0.f ? 0.f : sign * sqrt(numerator / denom);
|
||||
|
||||
CGFloat cxp = lhs * (rx * y1p) / ry;
|
||||
CGFloat cyp = lhs * -((ry * x1p) / rx);
|
||||
|
||||
CGFloat cx = cosPhi * cxp + -sinPhi * cyp + (x1 + x2) / 2.f;
|
||||
CGFloat cy = cxp * sinPhi + cyp * cosPhi + (y1 + y2) / 2.f;
|
||||
|
||||
CGAffineTransform transform = CGAffineTransformMakeScale(1.f / rx, 1.f / ry);
|
||||
transform = CGAffineTransformRotate(transform, -xAxisRotation);
|
||||
transform = CGAffineTransformTranslate(transform, -cx, -cy);
|
||||
|
||||
CGPoint arcPt1 = CGPointApplyAffineTransform(CGPointMake(x1, y1), transform);
|
||||
CGPoint arcPt2 = CGPointApplyAffineTransform(CGPointMake(x2, y2), transform);
|
||||
|
||||
CGFloat startAngle = atan2(arcPt1.y, arcPt1.x);
|
||||
CGFloat endAngle = atan2(arcPt2.y, arcPt2.x);
|
||||
|
||||
CGFloat angleDelta = endAngle - startAngle;;
|
||||
|
||||
if (sweepFlag == YES) {
|
||||
if (angleDelta < 0.f) {
|
||||
angleDelta += 2.f * M_PI;
|
||||
}
|
||||
} else if (angleDelta > 0.f) {
|
||||
angleDelta = angleDelta - 2.f * M_PI;
|
||||
}
|
||||
|
||||
transform = CGAffineTransformMakeTranslation(cx, cy);
|
||||
transform = CGAffineTransformRotate(transform, xAxisRotation);
|
||||
transform = CGAffineTransformScale(transform, rx, ry);
|
||||
|
||||
CGPathAddRelativeArc(path.path, &transform, 0.f, 0.f, 1.f,
|
||||
startAngle, angleDelta);
|
||||
}
|
||||
|
||||
@end
|
||||
+5
-3
@@ -22,11 +22,13 @@
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] lineToPoint:NSMakePoint(params[0], [path currentSubpath].currentPoint.y)];
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddLineToPoint(path.path, NULL, params[0], path.currentPoint.y);
|
||||
return;
|
||||
}
|
||||
[[path currentSubpath] relativeLineToPoint:NSMakePoint(params[0], 0.f)];
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathAddLineToPoint(path.path, NULL, currentPoint.x + params[0],
|
||||
path.currentPoint.y);
|
||||
}
|
||||
|
||||
@end
|
||||
+5
-5
@@ -22,13 +22,13 @@
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] lineToPoint:NSMakePoint(params[0], params[1])];
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddLineToPoint(path.path, NULL, params[0], params[1]);
|
||||
return;
|
||||
}
|
||||
NSPoint point = NSMakePoint([path currentSubpath].currentPoint.x + params[0],
|
||||
[path currentSubpath].currentPoint.y + params[1]);
|
||||
[[path currentSubpath] lineToPoint:point];
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathAddLineToPoint(path.path, NULL, currentPoint.x + params[0],
|
||||
currentPoint.y + params[1]);
|
||||
}
|
||||
|
||||
@end
|
||||
+12
-9
@@ -35,17 +35,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// actual move to command
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] moveToPoint:NSMakePoint(params[0], params[1])];
|
||||
// actual move to command - do a moveToPoint only
|
||||
// if the type is absolute, or its possible the type is
|
||||
// relative but there is no previous command which means
|
||||
// there is no current point. Asking for current point on an empty
|
||||
// path will result in an exception being thrown
|
||||
if (type == kIJSVGCommandTypeAbsolute || command == nil) {
|
||||
CGPathMoveToPoint(path.path, NULL,
|
||||
params[0], params[1]);
|
||||
return;
|
||||
}
|
||||
@try {
|
||||
[[path currentSubpath] relativeMoveToPoint:NSMakePoint(params[0], params[1])];
|
||||
}
|
||||
@catch (NSException* exception) {
|
||||
[[path currentSubpath] moveToPoint:NSMakePoint(params[0], params[1])];
|
||||
}
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathMoveToPoint(path.path, NULL,
|
||||
currentPoint.x + params[0],
|
||||
currentPoint.y + params[1]);
|
||||
}
|
||||
|
||||
@end
|
||||
+7
-5
@@ -23,13 +23,15 @@
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint(params[2], params[3])
|
||||
controlPoint:NSMakePoint(params[0], params[1])];
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddQuadCurveToPoint(path.path, NULL, params[0], params[1],
|
||||
params[2], params[3]);
|
||||
return;
|
||||
}
|
||||
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[2], [path currentSubpath].currentPoint.y + params[3])
|
||||
controlPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])];
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathAddQuadCurveToPoint(path.path, NULL,
|
||||
currentPoint.x + params[0], currentPoint.y + params[1],
|
||||
currentPoint.x + params[2], currentPoint.y + params[3]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// IJSVGCommandSmoothCurve.m
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 30/08/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGCommandCurve.h"
|
||||
#import "IJSVGCommandSmoothCurve.h"
|
||||
#import "IJSVGUtils.h"
|
||||
|
||||
@implementation IJSVGCommandSmoothCurve
|
||||
|
||||
+ (NSInteger)requiredParameterCount
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
+ (void)runWithParams:(CGFloat*)params
|
||||
paramCount:(NSInteger)count
|
||||
command:(IJSVGCommand*)currentCommand
|
||||
previousCommand:(IJSVGCommand*)command
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPoint firstControl = CGPointMake(currentPoint.x, currentPoint.y);
|
||||
if (command != nil) {
|
||||
if (command.class == [IJSVGCommandCurve class] || command.class == self.class) {
|
||||
if (command.class == [IJSVGCommandCurve class]) {
|
||||
if (command.type == kIJSVGCommandTypeAbsolute) {
|
||||
firstControl = CGPointMake(-1 * command.parameters[2] + 2 * currentPoint.x,
|
||||
-1 * command.parameters[3] + 2 * currentPoint.y);
|
||||
} else {
|
||||
NSPoint oldPoint = CGPointMake(currentPoint.x - command.parameters[4],
|
||||
currentPoint.y - command.parameters[5]);
|
||||
firstControl = CGPointMake(-1 * (command.parameters[2] + oldPoint.x) + 2 * currentPoint.x,
|
||||
-1 * (command.parameters[3] + oldPoint.y) + 2 * currentPoint.y);
|
||||
}
|
||||
} else {
|
||||
if (command.type == kIJSVGCommandTypeAbsolute) {
|
||||
firstControl = CGPointMake(-1 * command.parameters[0] + 2 * currentPoint.x,
|
||||
-1 * command.parameters[1] + 2 * currentPoint.y);
|
||||
} else {
|
||||
NSPoint oldPoint = CGPointMake(currentPoint.x - command.parameters[2],
|
||||
currentPoint.y - command.parameters[3]);
|
||||
firstControl = CGPointMake(-1 * (command.parameters[0] + oldPoint.x) + 2 * currentPoint.x,
|
||||
-1 * (command.parameters[1] + oldPoint.y) + 2 * currentPoint.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddCurveToPoint(path.path, NULL, firstControl.x, firstControl.y,
|
||||
params[0], params[1], params[2], params[3]);
|
||||
return;
|
||||
}
|
||||
CGPathAddCurveToPoint(path.path, NULL, firstControl.x, firstControl.y,
|
||||
currentPoint.x + params[0], currentPoint.y + params[1],
|
||||
currentPoint.x + params[2], currentPoint.y + params[3]);
|
||||
}
|
||||
|
||||
@end
|
||||
+16
-15
@@ -24,33 +24,34 @@
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
NSPoint commandPoint = NSMakePoint([path currentSubpath].currentPoint.x, [path currentSubpath].currentPoint.y);
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPoint commandPoint = CGPointMake(currentPoint.x, 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);
|
||||
if (command.type == kIJSVGCommandTypeAbsolute) {
|
||||
commandPoint = NSMakePoint(-1 * command.parameters[0] + 2 * currentPoint.x,
|
||||
-1 * command.parameters[1] + 2 * 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);
|
||||
CGPoint oldPoint = CGPointMake(currentPoint.x - command.parameters[2],
|
||||
currentPoint.y - command.parameters[3]);
|
||||
commandPoint = CGPointMake(-1 * (command.parameters[0] + oldPoint.x) + 2 * (currentPoint.x),
|
||||
-1 * (command.parameters[1] + oldPoint.y) + 2 * 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);
|
||||
commandPoint = CGPointMake(-1 * (path.lastControlPoint.x) + 2 * (currentPoint.x),
|
||||
-1 * (path.lastControlPoint.y) + 2 * currentPoint.y);
|
||||
}
|
||||
}
|
||||
path.lastControlPoint = commandPoint;
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint(params[0], params[1])
|
||||
controlPoint:commandPoint];
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddQuadCurveToPoint(path.path, NULL, commandPoint.x, commandPoint.y,
|
||||
params[0], params[1]);
|
||||
return;
|
||||
}
|
||||
[[path currentSubpath] addQuadCurveToPoint:NSMakePoint([path currentSubpath].currentPoint.x + params[0], [path currentSubpath].currentPoint.y + params[1])
|
||||
controlPoint:commandPoint];
|
||||
CGPathAddQuadCurveToPoint(path.path, NULL, commandPoint.x, commandPoint.y,
|
||||
currentPoint.x + params[0], currentPoint.y + params[1]);
|
||||
}
|
||||
|
||||
@end
|
||||
+4
-3
@@ -22,11 +22,12 @@
|
||||
type:(IJSVGCommandType)type
|
||||
path:(IJSVGPath*)path
|
||||
{
|
||||
if (type == IJSVGCommandTypeAbsolute) {
|
||||
[[path currentSubpath] lineToPoint:NSMakePoint([path currentSubpath].currentPoint.x, params[0])];
|
||||
if (type == kIJSVGCommandTypeAbsolute) {
|
||||
CGPathAddLineToPoint(path.path, NULL, path.currentPoint.x, params[0]);
|
||||
return;
|
||||
}
|
||||
[[path currentSubpath] relativeLineToPoint:NSMakePoint(0.f, params[0])];
|
||||
CGPoint currentPoint = path.currentPoint;
|
||||
CGPathAddLineToPoint(path.path, NULL, currentPoint.x, currentPoint.y + params[0]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,23 +6,25 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGBezierPathAdditions.h"
|
||||
#import "IJSVGColorList.h"
|
||||
#import "IJSVGExporter.h"
|
||||
#import "IJSVGGradientLayer.h"
|
||||
#import "IJSVGGroupLayer.h"
|
||||
#import "IJSVGImageLayer.h"
|
||||
#import "IJSVGLayerTree.h"
|
||||
#import "IJSVGParser.h"
|
||||
#import "IJSVGRendering.h"
|
||||
#import "IJSVGRenderingStyle.h"
|
||||
#import <IJSVG/IJSVGColorList.h>
|
||||
#import <IJSVG/IJSVGExporter.h>
|
||||
#import <IJSVG/IJSVGGradientLayer.h>
|
||||
#import <IJSVG/IJSVGGroupLayer.h>
|
||||
#import <IJSVG/IJSVGImageLayer.h>
|
||||
#import <IJSVG/IJSVGLayerTree.h>
|
||||
#import <IJSVG/IJSVGParser.h>
|
||||
#import <IJSVG/IJSVGRendering.h>
|
||||
#import <IJSVG/IJSVGRenderingStyle.h>
|
||||
#import <IJSVG/IJSVGTransaction.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class IJSVG;
|
||||
@class IJSVGQuartzRenderer;
|
||||
|
||||
void IJSVGBeginTransactionLock(void);
|
||||
void IJSVGEndTransactionLock(void);
|
||||
typedef NS_OPTIONS(NSInteger, IJSVGMatchPropertiesMask) {
|
||||
IJSVGMatchPropertyNone = 0,
|
||||
IJSVGMatchPropertyContainsMaskedElement = 1 << 0,
|
||||
IJSVGMatchPropertyContainsStrokedElement = 1 << 1
|
||||
};
|
||||
|
||||
@protocol IJSVGDelegate <NSObject, IJSVGParserDelegate>
|
||||
|
||||
@@ -47,12 +49,11 @@ void IJSVGEndTransactionLock(void);
|
||||
id<IJSVGDelegate> _delegate;
|
||||
IJSVGLayer* _layerTree;
|
||||
CGRect _viewBox;
|
||||
CGSize _proposedViewSize;
|
||||
CGFloat _backingScaleFactor;
|
||||
CGFloat _lastProposedBackingScale;
|
||||
IJSVGRenderQuality _lastProposedRenderQuality;
|
||||
CGFloat _backingScale;
|
||||
NSMutableDictionary* _replacementColors;
|
||||
IJSVGQuartzRenderer* _quartzRenderer;
|
||||
|
||||
struct {
|
||||
unsigned int shouldHandleForeignObject : 1;
|
||||
@@ -71,7 +72,10 @@ void IJSVGEndTransactionLock(void);
|
||||
// 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* renderingStyle;
|
||||
@property (nonatomic, readonly) IJSVGUnitSize * intrinsicSize;
|
||||
@property (nonatomic, copy) NSString* title;
|
||||
@property (nonatomic, copy) NSString* desc;
|
||||
|
||||
- (void)prepForDrawingInView:(NSView*)view;
|
||||
- (BOOL)isFont;
|
||||
@@ -83,6 +87,8 @@ void IJSVGEndTransactionLock(void);
|
||||
- (IJSVGLayer*)layerWithTree:(IJSVGLayerTree*)tree;
|
||||
- (NSArray<IJSVG*>*)subSVGs:(BOOL)recursive;
|
||||
- (NSString*)SVGStringWithOptions:(IJSVGExporterOptions)options;
|
||||
- (NSString*)SVGStringWithOptions:(IJSVGExporterOptions)options
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
|
||||
- (CGFloat)computeBackingScale:(CGFloat)scale;
|
||||
- (void)discardDOM;
|
||||
@@ -90,9 +96,6 @@ void IJSVGEndTransactionLock(void);
|
||||
+ (id)svgNamed:(NSString*)string;
|
||||
+ (id)svgNamed:(NSString*)string
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
+ (id)svgNamed:(NSString*)string
|
||||
useCache:(BOOL)useCache
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
|
||||
- (id)initWithImage:(NSImage*)image;
|
||||
|
||||
@@ -107,8 +110,10 @@ void IJSVGEndTransactionLock(void);
|
||||
- (id)initWithSVGString:(NSString*)string
|
||||
error:(NSError**)error;
|
||||
|
||||
- (id)initWithFile:(NSString*)file
|
||||
useCache:(BOOL)useCache;
|
||||
- (id)initWithSVGData:(NSData*)data;
|
||||
- (id)initWithSVGData:(NSData*)data
|
||||
error:(NSError**)error;
|
||||
|
||||
- (id)initWithFile:(NSString*)file;
|
||||
- (id)initWithFile:(NSString*)file
|
||||
error:(NSError**)error;
|
||||
@@ -117,29 +122,36 @@ void IJSVGEndTransactionLock(void);
|
||||
- (id)initWithFile:(NSString*)file
|
||||
error:(NSError**)error
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
- (id)initWithFile:(NSString*)file
|
||||
useCache:(BOOL)useCache
|
||||
error:(NSError**)error
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
- (id)initWithFilePathURL:(NSURL*)aURL;
|
||||
- (id)initWithFilePathURL:(NSURL*)aURL
|
||||
useCache:(BOOL)useCache;
|
||||
- (id)initWithFilePathURL:(NSURL*)aURL
|
||||
error:(NSError**)error;
|
||||
- (id)initWithFilePathURL:(NSURL*)aURL
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
- (id)initWithFilePathURL:(NSURL*)aURL
|
||||
useCache:(BOOL)useCache
|
||||
error:(NSError**)error
|
||||
delegate:(id<IJSVGDelegate>)delegate;
|
||||
|
||||
- (id)initWithDataAssetNamed:(NSDataAssetName)name
|
||||
error:(NSError**)error;
|
||||
- (id)initWithDataAssetNamed:(NSDataAssetName)name
|
||||
bundle:(NSBundle*)bundle
|
||||
error:(NSError**)error;
|
||||
|
||||
- (NSImage*)imageWithSize:(NSSize)aSize;
|
||||
- (NSImage*)imageWithSize:(NSSize)aSize
|
||||
error:(NSError**)error;
|
||||
- (NSImage*)imageWithSize:(NSSize)aSize
|
||||
flipped:(BOOL)flipped;
|
||||
- (NSImage*)imageWithSize:(NSSize)aSize
|
||||
flipped:(BOOL)flipped
|
||||
error:(NSError**)error;
|
||||
- (NSImage*)imageByMaintainingAspectRatioWithSize:(NSSize)aSize
|
||||
flipped:(BOOL)flipped
|
||||
error:(NSError**)error;
|
||||
- (CGImageRef)newCGImageRefWithSize:(CGSize)size
|
||||
flipped:(BOOL)flipped
|
||||
error:(NSError**)error;
|
||||
|
||||
- (BOOL)drawAtPoint:(NSPoint)point
|
||||
size:(NSSize)size;
|
||||
- (BOOL)drawAtPoint:(NSPoint)point
|
||||
@@ -164,5 +176,9 @@ void IJSVGEndTransactionLock(void);
|
||||
- (void)setNeedsDisplay;
|
||||
|
||||
// colors
|
||||
- (IJSVGColorList*)computedColorList:(BOOL*)hasPatternFills;
|
||||
- (IJSVGColorList*)colorList;
|
||||
- (void)performBlock:(dispatch_block_t)block;
|
||||
|
||||
// matching
|
||||
- (BOOL)matchesPropertiesWithMask:(IJSVGMatchPropertiesMask)mask;
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2015 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVG.h"
|
||||
#import <IJSVG/IJSVG.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef void (^IJSVGFontConverterEnumerateBlock)(NSString* unicode, IJSVG* svg);
|
||||
+3
-6
@@ -6,7 +6,6 @@
|
||||
// Copyright (c) 2015 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGBezierPathAdditions.h"
|
||||
#import "IJSVGFontConverter.h"
|
||||
#import "IJSVGShapeLayer.h"
|
||||
|
||||
@@ -104,18 +103,16 @@
|
||||
|
||||
+ (IJSVG*)convertIJSVGPathToSVG:(IJSVGPath*)path
|
||||
{
|
||||
CGPathRef cgPath = [IJSVGUtils newCGPathFromBezierPath:path.path];
|
||||
CGPathRef flippedPath = [IJSVGUtils newFlippedCGPath:cgPath];
|
||||
CGPathRef flippedPath = [IJSVGUtils newFlippedCGPath:path.path];
|
||||
IJSVG* svg = [self convertPathToSVG:flippedPath];
|
||||
CGPathRelease(flippedPath);
|
||||
CGPathRelease(cgPath);
|
||||
return svg;
|
||||
}
|
||||
|
||||
+ (IJSVG*)convertPathToSVG:(CGPathRef)path
|
||||
{
|
||||
IJSVGBeginTransaction();
|
||||
__block IJSVG* svg = nil;
|
||||
IJSVGBeginTransactionLock();
|
||||
IJSVGGroupLayer* layer = [[[IJSVGGroupLayer alloc] init] autorelease];
|
||||
IJSVGShapeLayer* shape = [[[IJSVGShapeLayer alloc] init] autorelease];
|
||||
[layer addSublayer:shape];
|
||||
@@ -123,7 +120,7 @@
|
||||
CGRect box = CGPathGetPathBoundingBox(path);
|
||||
svg = [[IJSVG alloc] initWithSVGLayer:layer
|
||||
viewBox:box];
|
||||
IJSVGEndTransactionLock();
|
||||
IJSVGEndTransaction();
|
||||
return [svg autorelease];
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
IJSVG* _svg;
|
||||
}
|
||||
|
||||
- (instancetype)initWithData:(NSData*)data;
|
||||
|
||||
@property (nonatomic, readonly) CGRect viewBox;
|
||||
@property (nonatomic, readonly) IJSVG* SVG;
|
||||
|
||||
@end
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
@implementation IJSVGImageRep
|
||||
|
||||
@synthesize viewBox = _viewBox;
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
[NSBitmapImageRep registerImageRepClass:self];
|
||||
@@ -25,12 +23,20 @@
|
||||
|
||||
+ (NSArray<NSString*>*)imageTypes
|
||||
{
|
||||
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
|
||||
if (@available(macOS 10.10, *)) {
|
||||
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
|
||||
} else {
|
||||
return @[ @"public.svg-image", @"svg" ];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray<NSString*>*)imageUnfilteredTypes
|
||||
{
|
||||
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
|
||||
if (@available(macOS 10.10, *)) {
|
||||
return @[ (NSString*)kUTTypeScalableVectorGraphics, @"svg" ];
|
||||
} else {
|
||||
return @[ @"public.svg-image", @"svg" ];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray<NSImageRep*>*)imageRepsWithData:(NSData*)data
|
||||
@@ -101,4 +107,9 @@
|
||||
return _svg.viewBox;
|
||||
}
|
||||
|
||||
- (IJSVG*)SVG
|
||||
{
|
||||
return _svg;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVG.h"
|
||||
#import <IJSVG/IJSVG.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
IB_DESIGNABLE
|
||||
@@ -42,7 +42,7 @@
|
||||
if (imageName != nil) {
|
||||
IJSVG* anSVG = [IJSVG svgNamed:imageName];
|
||||
if (tintColor != nil) {
|
||||
anSVG.style.fillColor = tintColor;
|
||||
anSVG.renderingStyle.fillColor = tintColor;
|
||||
}
|
||||
self.SVG = anSVG;
|
||||
}
|
||||
@@ -7,10 +7,12 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <IJSVG/IJSVGUtils.h>
|
||||
|
||||
@class IJSVG;
|
||||
|
||||
typedef void (^IJSVGCGPathHandler)(const CGPathElement* pathElement);
|
||||
typedef void (^IJSVGPathElementEnumerationBlock)(const CGPathElement* pathElement, CGPoint currentPoint);
|
||||
|
||||
void IJSVGExporterPathCaller(void* info, const CGPathElement* pathElement);
|
||||
|
||||
@@ -31,10 +33,19 @@ typedef NS_OPTIONS(NSInteger, IJSVGExporterOptions) {
|
||||
IJSVGExporterOptionRemoveWidthHeightAttributes = 1 << 13,
|
||||
IJSVGExporterOptionColorAllowRRGGBBAA = 1 << 14,
|
||||
IJSVGExporterOptionRemoveComments = 1 << 15,
|
||||
IJSVGExporterOptionAll = IJSVGExporterOptionRemoveUselessDef | IJSVGExporterOptionRemoveUselessGroups | IJSVGExporterOptionCreateUseForPaths | IJSVGExporterOptionMoveAttributesToGroup | IJSVGExporterOptionSortAttributes | IJSVGExporterOptionCollapseGroups | IJSVGExporterOptionCleanupPaths | IJSVGExporterOptionRemoveHiddenElements | IJSVGExporterOptionScaleToSizeIfNecessary | IJSVGExporterOptionCompressOutput | IJSVGExporterOptionCollapseGradients | IJSVGExporterOptionRemoveWidthHeightAttributes | IJSVGExporterOptionColorAllowRRGGBBAA | IJSVGExporterOptionRemoveComments
|
||||
IJSVGExporterOptionCenterWithinViewBox = 1 << 16,
|
||||
IJSVGExporterOptionRemoveXMLDeclaration = 1 << 17,
|
||||
IJSVGExporterOptionConvertArcs = 1 << 18,
|
||||
IJSVGExporterOptionConvertShapesToPaths = 1 << 19,
|
||||
IJSVGExporterOptionRoundTransforms = 1 << 20,
|
||||
IJSVGExporterOptionRemoveDefaultValues = 1 << 21,
|
||||
IJSVGExporterOptionAll = IJSVGExporterOptionRemoveUselessDef | IJSVGExporterOptionRemoveUselessGroups | IJSVGExporterOptionCreateUseForPaths | IJSVGExporterOptionMoveAttributesToGroup | IJSVGExporterOptionSortAttributes | IJSVGExporterOptionCollapseGroups | IJSVGExporterOptionCleanupPaths | IJSVGExporterOptionRemoveHiddenElements | IJSVGExporterOptionScaleToSizeIfNecessary | IJSVGExporterOptionCompressOutput | IJSVGExporterOptionCollapseGradients | IJSVGExporterOptionRemoveWidthHeightAttributes | IJSVGExporterOptionColorAllowRRGGBBAA | IJSVGExporterOptionRemoveComments | IJSVGExporterOptionCenterWithinViewBox | IJSVGExporterOptionRemoveXMLDeclaration | IJSVGExporterOptionConvertArcs | IJSVGExporterOptionConvertShapesToPaths | IJSVGExporterOptionRoundTransforms | IJSVGExporterOptionRemoveDefaultValues
|
||||
};
|
||||
|
||||
BOOL IJSVGExporterHasOption(IJSVGExporterOptions options, NSInteger option);
|
||||
void IJSVGEnumerateCGPathElements(CGPathRef path, IJSVGPathElementEnumerationBlock enumBlock);
|
||||
const NSArray<NSString*>* IJSVGShortCharacterArray(void);
|
||||
const NSDictionary<NSString*, NSString*>* IJSVGDefaultAttributes(void);
|
||||
|
||||
@interface IJSVGExporter : NSObject {
|
||||
|
||||
@@ -44,18 +55,25 @@ BOOL IJSVGExporterHasOption(IJSVGExporterOptions options, NSInteger option);
|
||||
IJSVGExporterOptions _options;
|
||||
NSXMLDocument* _dom;
|
||||
NSXMLElement* _defElement;
|
||||
NSXMLElement* _scaledRootNode;
|
||||
NSInteger _idCount;
|
||||
NSInteger _shortIdCount;
|
||||
BOOL _appliedXLink;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IJSVGFloatingPointOptions floatingPointOptions;
|
||||
@property (nonatomic, copy) NSString* title;
|
||||
@property (nonatomic, copy) NSString* description;
|
||||
@property (nonatomic, copy) NSString* desc;
|
||||
|
||||
- (id)initWithSVG:(IJSVG*)svg
|
||||
size:(CGSize)size
|
||||
options:(IJSVGExporterOptions)options;
|
||||
- (id)initWithSVG:(IJSVG*)svg
|
||||
size:(CGSize)size
|
||||
options:(IJSVGExporterOptions)options
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
|
||||
- (NSString*)SVGString;
|
||||
- (NSData*)SVGData;
|
||||
- (IJSVG*)SVG:(NSError**)error;
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// IJSVGExporterPathInstruction.h
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 08/01/2017.
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef struct {
|
||||
char instruction;
|
||||
NSArray<NSString*>* params;
|
||||
} IJSVGExporterPathInstructionCommand;
|
||||
|
||||
typedef struct {
|
||||
CGPoint center;
|
||||
CGFloat radius;
|
||||
} IJSVGExporterPathInstructionCircle;
|
||||
|
||||
@interface IJSVGExporterPathInstruction : NSObject {
|
||||
|
||||
@private
|
||||
NSInteger _dataCount;
|
||||
CGFloat* _data;
|
||||
CGFloat* _base;
|
||||
CGFloat* _coords;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) char instruction;
|
||||
|
||||
void IJSVGExporterPathInstructionRoundData(CGFloat* data, NSInteger length, IJSVGFloatingPointOptions options);
|
||||
CGFloat IJSVGExporterPathFloatToFixed(CGFloat number, int precision);
|
||||
IJSVGExporterPathInstructionCommand* IJSVGExporterPathInstructionCommandCopy(IJSVGExporterPathInstructionCommand command);
|
||||
void IJSVGExporterPathInstructionCommandFree(IJSVGExporterPathInstructionCommand* _Nullable command);
|
||||
|
||||
+ (NSArray<IJSVGExporterPathInstruction*>*)instructionsFromPath:(CGPathRef)path
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
|
||||
- (id)initWithInstruction:(char)instruction
|
||||
dataCount:(NSInteger)floatCount;
|
||||
|
||||
- (CGFloat*)data;
|
||||
- (NSInteger)dataLength;
|
||||
|
||||
+ (NSArray<IJSVGExporterPathInstruction*>*)convertInstructionsCurves:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
+ (void)convertInstructionsToMixedAbsoluteRelative:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
+ (void)convertInstructionsDataToRounded:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
+ (NSString*)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
+ (NSString*)pathStringWithInstructionSet:(NSArray<NSValue*>*)instructionSets
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions;
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
static NSInteger const kIJSVGExporterPathInstructionFloatPrecision = 3;
|
||||
static CGFloat const kIJSVGExporterPathInstructionErrorThreshold = 1e-2;
|
||||
|
||||
#define IJ_SVG_EXPORT_ROUND(value) IJSVGExporterPathFloatToFixed(value, kIJSVGExporterPathInstructionFloatPrecision)
|
||||
@@ -0,0 +1,629 @@
|
||||
//
|
||||
// IJSVGExporterPathInstruction.m
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 08/01/2017.
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGExporter.h"
|
||||
#import "IJSVGExporterPathInstruction.h"
|
||||
#import "IJSVGUtils.h"
|
||||
#import <math.h>
|
||||
|
||||
@implementation IJSVGExporterPathInstruction
|
||||
|
||||
@synthesize instruction = _instruction;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if (_data != NULL) {
|
||||
(void)free(_data), _data = NULL;
|
||||
}
|
||||
if (_base != NULL) {
|
||||
(void)free(_base), _base = NULL;
|
||||
}
|
||||
if (_coords != NULL) {
|
||||
(void)free(_coords), _coords = NULL;
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)initWithInstruction:(char)instruction
|
||||
dataCount:(NSInteger)floatCount
|
||||
{
|
||||
if ((self = [super init]) != nil) {
|
||||
_instruction = instruction;
|
||||
|
||||
// only allocate if not zero
|
||||
if (floatCount != 0) {
|
||||
_dataCount = floatCount;
|
||||
_data = (CGFloat*)calloc(sizeof(CGFloat), floatCount);
|
||||
}
|
||||
|
||||
// setup base and coords
|
||||
_base = (CGFloat*)malloc(sizeof(CGFloat) * 2);
|
||||
_coords = (CGFloat*)malloc(sizeof(CGFloat) * 2);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSInteger)dataLength
|
||||
{
|
||||
return _dataCount;
|
||||
}
|
||||
|
||||
- (CGFloat*)data
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
|
||||
- (CGFloat*)base
|
||||
{
|
||||
return _base;
|
||||
}
|
||||
|
||||
- (CGFloat*)coords
|
||||
{
|
||||
return _coords;
|
||||
}
|
||||
|
||||
IJSVGExporterPathInstructionCommand* IJSVGExporterPathInstructionCommandCopy(IJSVGExporterPathInstructionCommand command)
|
||||
{
|
||||
IJSVGExporterPathInstructionCommand* copy = NULL;
|
||||
copy = (IJSVGExporterPathInstructionCommand*)malloc(sizeof(IJSVGExporterPathInstructionCommand));
|
||||
copy->instruction = command.instruction;
|
||||
copy->params = command.params;
|
||||
return copy;
|
||||
}
|
||||
|
||||
void IJSVGExporterPathInstructionCommandFree(IJSVGExporterPathInstructionCommand* _Nullable command)
|
||||
{
|
||||
if (command != NULL) {
|
||||
free(command);
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString*)pathStringWithInstructionSet:(NSArray<NSValue*>*)instructionSets
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
IJSVGExporterPathInstructionCommand* lastCommand = NULL;
|
||||
NSMutableString* string = [[[NSMutableString alloc] init] autorelease];
|
||||
for (NSValue* value in instructionSets) {
|
||||
// read back the bytes
|
||||
IJSVGExporterPathInstructionCommand command;
|
||||
[value getValue:&command];
|
||||
|
||||
// add on the instruction character only if there is no current command
|
||||
// or the last command is not the same as the current command
|
||||
// if they both are the same, we still need to seperate them via a space
|
||||
if (lastCommand == nil || (lastCommand != nil && lastCommand->instruction != command.instruction)) {
|
||||
[string appendFormat:@"%c", command.instruction];
|
||||
} else {
|
||||
[string appendString:@" "];
|
||||
}
|
||||
|
||||
// compresses the floats
|
||||
NSString* compressedFloats = IJSVGCompressFloatParameterArray(command.params);
|
||||
[string appendString:compressedFloats];
|
||||
|
||||
// store last command
|
||||
IJSVGExporterPathInstructionCommandFree(lastCommand);
|
||||
lastCommand = IJSVGExporterPathInstructionCommandCopy(command);
|
||||
}
|
||||
|
||||
IJSVGExporterPathInstructionCommandFree(lastCommand);
|
||||
return string;
|
||||
}
|
||||
|
||||
+ (NSString*)pathStringFromInstructions:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
NSMutableArray* pathInstructions = [[[NSMutableArray alloc] init] autorelease];
|
||||
for (IJSVGExporterPathInstruction* instruction in instructions) {
|
||||
CGFloat* data = instruction.data;
|
||||
const char lowerInstruction = tolower(instruction.instruction);
|
||||
NSArray<NSString*>* set = nil;
|
||||
switch (lowerInstruction) {
|
||||
case 't':
|
||||
case 'm':
|
||||
case 'l': {
|
||||
set = @[
|
||||
IJSVGShortFloatStringWithOptions(data[0], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[1], floatingPointOptions)
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
case 'v':
|
||||
case 'h': {
|
||||
set = @[
|
||||
IJSVGShortFloatStringWithOptions(data[0], floatingPointOptions)
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
case 'c': {
|
||||
set = @[
|
||||
IJSVGShortFloatStringWithOptions(data[0], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[1], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[2], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[3], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[4], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[5], floatingPointOptions)
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
case 's':
|
||||
case 'q': {
|
||||
set = @[
|
||||
IJSVGShortFloatStringWithOptions(data[0], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[1], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[2], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[3], floatingPointOptions)
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
case 'a': {
|
||||
set = @[
|
||||
IJSVGShortFloatStringWithOptions(data[0], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[1], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[2], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[3], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[4], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[5], floatingPointOptions),
|
||||
IJSVGShortFloatStringWithOptions(data[6], floatingPointOptions),
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
// close path
|
||||
case 'z': {
|
||||
set = @[];
|
||||
}
|
||||
}
|
||||
|
||||
// wrap into the command and give to the array
|
||||
IJSVGExporterPathInstructionCommand wrapper;
|
||||
wrapper.instruction = instruction.instruction;
|
||||
wrapper.params = set ?: @[];
|
||||
|
||||
// encode and store
|
||||
NSValue* value = [NSValue valueWithBytes:&wrapper
|
||||
objCType:@encode(IJSVGExporterPathInstructionCommand)];
|
||||
[pathInstructions addObject:value];
|
||||
}
|
||||
return [self pathStringWithInstructionSet:pathInstructions
|
||||
floatingPointOptions:floatingPointOptions];
|
||||
}
|
||||
|
||||
CGFloat IJSVGExporterPathFloatToFixed(CGFloat number, int precision)
|
||||
{
|
||||
return floorf(pow(10, precision) * number) / pow(10, precision);
|
||||
}
|
||||
|
||||
void IJSVGExporterPathInstructionRoundData(CGFloat* data, NSInteger length,
|
||||
IJSVGFloatingPointOptions options)
|
||||
{
|
||||
for (NSInteger i = length; i-- > 0;) {
|
||||
CGFloat d = data[i];
|
||||
CGFloat proposed = IJSVGExporterPathFloatToFixed(d, options.precision);
|
||||
if (proposed != d) {
|
||||
CGFloat rounded = +IJSVGExporterPathFloatToFixed(d, options.precision - 1);
|
||||
data[i] = IJSVGExporterPathFloatToFixed(+fabs(rounded - d), options.precision + 1)
|
||||
>= kIJSVGExporterPathInstructionErrorThreshold
|
||||
? +IJSVGExporterPathFloatToFixed(d, options.precision)
|
||||
: rounded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)convertInstructionsToRoundRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
CGFloat relSubPoint[2] = { 0.f, 0.f };
|
||||
for (IJSVGExporterPathInstruction* instruction in instructions) {
|
||||
char instructionChar = instruction.instruction;
|
||||
NSInteger length = instruction.dataLength;
|
||||
CGFloat* data = instruction.data;
|
||||
if (strchr("mltqsc", instructionChar) != NULL) {
|
||||
for (NSInteger i = length; i--;) {
|
||||
data[i] += instruction.base[i % 2] - relSubPoint[i % 2];
|
||||
}
|
||||
} else if (instructionChar == 'h') {
|
||||
data[0] += instruction.base[0] - relSubPoint[0];
|
||||
} else if (instructionChar == 'v') {
|
||||
data[0] += instruction.base[1] - relSubPoint[1];
|
||||
} else if (instructionChar == 'a') {
|
||||
data[5] += instruction.base[0] - relSubPoint[0];
|
||||
data[5] += instruction.base[1] - relSubPoint[1];
|
||||
}
|
||||
IJSVGExporterPathInstructionRoundData(data, length, floatingPointOptions);
|
||||
if (instructionChar == 'h') {
|
||||
relSubPoint[0] += data[0];
|
||||
} else if (instructionChar == 'v') {
|
||||
relSubPoint[1] += data[0];
|
||||
} else {
|
||||
relSubPoint[0] += data[length - 2];
|
||||
relSubPoint[1] += data[length - 1];
|
||||
}
|
||||
IJSVGExporterPathInstructionRoundData(relSubPoint, 2, floatingPointOptions);
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)convertInstructionsToMixedAbsoluteRelative:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
IJSVGExporterPathInstruction* prevInstruction = nil;
|
||||
for (IJSVGExporterPathInstruction* instruction in instructions) {
|
||||
if (prevInstruction == nil || instruction.dataLength == 0) {
|
||||
prevInstruction = instruction;
|
||||
continue;
|
||||
}
|
||||
|
||||
char instructionChar = instruction.instruction;
|
||||
CGFloat* data = instruction.data;
|
||||
NSInteger length = instruction.dataLength;
|
||||
CGFloat* adata = (CGFloat*)malloc(sizeof(CGFloat) * length);
|
||||
memcpy(adata, data, sizeof(CGFloat) * length);
|
||||
|
||||
if (strchr("mltqsc", instructionChar) != NULL) {
|
||||
for (NSInteger i = length; i--;) {
|
||||
adata[i] += instruction.base[i % 2];
|
||||
}
|
||||
} else if (instructionChar == 'h') {
|
||||
adata[0] += instruction.base[0];
|
||||
} else if (instructionChar == 'v') {
|
||||
adata[0] += instruction.base[1];
|
||||
} else if (instructionChar == 'a') {
|
||||
adata[5] += instruction.base[0];
|
||||
adata[6] += instruction.base[1];
|
||||
}
|
||||
|
||||
IJSVGExporterPathInstructionRoundData(adata, length, floatingPointOptions);
|
||||
|
||||
IJSVGExporterPathInstruction* ainstruction = nil;
|
||||
ainstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:instructionChar
|
||||
dataCount:length] autorelease];
|
||||
memcpy(ainstruction.data, adata, sizeof(CGFloat) * length);
|
||||
|
||||
// run these through our default string runner
|
||||
// to compare the outputs
|
||||
NSString* orig = [self pathStringFromInstructions:@[ instruction ]
|
||||
floatingPointOptions:floatingPointOptions];
|
||||
NSString* comp = [self pathStringFromInstructions:@[ ainstruction ]
|
||||
floatingPointOptions:floatingPointOptions];
|
||||
|
||||
if (comp.length < orig.length && !(instructionChar == prevInstruction.instruction && prevInstruction.instruction > 96 && comp.length == orig.length - 1 && data[0] < 0.f && fmod(prevInstruction.data[prevInstruction.dataLength - 1], 1) != 0.f)) {
|
||||
instruction.instruction = toupper(instructionChar);
|
||||
memcpy(data, adata, sizeof(CGFloat) * length);
|
||||
}
|
||||
(void)free(adata), adata = NULL;
|
||||
prevInstruction = instruction;
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)convertInstructionsDataToRounded:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
for (IJSVGExporterPathInstruction* instruction in instructions) {
|
||||
CGFloat* data = instruction.data;
|
||||
IJSVGExporterPathInstructionRoundData(data, instruction.dataLength,
|
||||
floatingPointOptions);
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray<IJSVGExporterPathInstruction*>*)convertInstructionsCurves:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
NSMutableArray<IJSVGExporterPathInstruction*>* nInstructions = nil;
|
||||
nInstructions = [[[NSMutableArray alloc] initWithCapacity:instructions.count] autorelease];
|
||||
IJSVGExporterPathInstruction* lastInstruction = nil;
|
||||
for (IJSVGExporterPathInstruction* instruction in instructions) {
|
||||
lastInstruction = nInstructions.lastObject;
|
||||
if (lastInstruction == nil) {
|
||||
[nInstructions addObject:instruction];
|
||||
continue;
|
||||
}
|
||||
if (instruction.instruction == 'c') {
|
||||
if (lastInstruction.instruction == 'c' && instruction.data[0] == -(lastInstruction.data[2] - lastInstruction.data[4]) && instruction.data[1] == -(lastInstruction.data[3] - lastInstruction.data[5])) {
|
||||
IJSVGExporterPathInstruction* nInstruction = nil;
|
||||
nInstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'s'
|
||||
dataCount:4] autorelease];
|
||||
nInstruction.data[0] = instruction.data[2];
|
||||
nInstruction.data[1] = instruction.data[3];
|
||||
nInstruction.data[2] = instruction.data[4];
|
||||
nInstruction.data[3] = instruction.data[5];
|
||||
[nInstructions addObject:nInstruction];
|
||||
continue;
|
||||
} else if (lastInstruction.instruction == 's' && instruction.data[0] == -(lastInstruction.data[0] - lastInstruction.data[2]) && instruction.data[1] == -(lastInstruction.data[1] - lastInstruction.data[3])) {
|
||||
IJSVGExporterPathInstruction* nInstruction = nil;
|
||||
nInstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'s'
|
||||
dataCount:4] autorelease];
|
||||
nInstruction.data[0] = instruction.data[2];
|
||||
nInstruction.data[1] = instruction.data[3];
|
||||
nInstruction.data[2] = instruction.data[4];
|
||||
nInstruction.data[3] = instruction.data[5];
|
||||
[nInstructions addObject:nInstruction];
|
||||
continue;
|
||||
} else if (lastInstruction.instruction != 'c' && lastInstruction.instruction != 's' && instruction.data[0] == 0.f && instruction.data[1] == 0.f) {
|
||||
IJSVGExporterPathInstruction* nInstruction = nil;
|
||||
nInstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'s'
|
||||
dataCount:4] autorelease];
|
||||
nInstruction.data[0] = instruction.data[2];
|
||||
nInstruction.data[1] = instruction.data[3];
|
||||
nInstruction.data[2] = instruction.data[4];
|
||||
nInstruction.data[3] = instruction.data[5];
|
||||
[nInstructions addObject:nInstruction];
|
||||
continue;
|
||||
}
|
||||
} else if (instruction.instruction == 'q') {
|
||||
if (lastInstruction.instruction == 'q' && instruction.data[0] == (lastInstruction.data[2] - lastInstruction.data[0]) && instruction.data[1] == (lastInstruction.data[3] - lastInstruction.data[1])) {
|
||||
IJSVGExporterPathInstruction* nInstruction = nil;
|
||||
nInstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'t'
|
||||
dataCount:2] autorelease];
|
||||
nInstruction.data[0] = instruction.data[3];
|
||||
nInstruction.data[1] = instruction.data[4];
|
||||
[nInstructions addObject:nInstruction];
|
||||
continue;
|
||||
} else if (lastInstruction.instruction == 't' && instruction.data[2] == lastInstruction.data[0] && instruction.data[3] == lastInstruction.data[1]) {
|
||||
IJSVGExporterPathInstruction* nInstruction = nil;
|
||||
nInstruction = [[[IJSVGExporterPathInstruction alloc] initWithInstruction:'t'
|
||||
dataCount:2] autorelease];
|
||||
nInstruction.data[0] = instruction.data[3];
|
||||
nInstruction.data[1] = instruction.data[4];
|
||||
[nInstructions addObject:nInstruction];
|
||||
continue;
|
||||
}
|
||||
}
|
||||
[nInstructions addObject:instruction];
|
||||
}
|
||||
return nInstructions;
|
||||
}
|
||||
|
||||
+ (void)convertInstructionsToRelativeCoordinates:(NSArray<IJSVGExporterPathInstruction*>*)instructions
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
CGFloat point[2] = { 0, 0 };
|
||||
CGFloat subpathPoint[2] = { 0, 0 };
|
||||
IJSVGExporterPathInstruction* baseInstruction = nil;
|
||||
IJSVGExporterPathInstruction* prevInstruction = nil;
|
||||
|
||||
NSInteger index = 0;
|
||||
for (IJSVGExporterPathInstruction* anInstruction in instructions) {
|
||||
char instruction = anInstruction.instruction;
|
||||
CGFloat* data = anInstruction.data;
|
||||
NSInteger length = anInstruction.dataLength;
|
||||
|
||||
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') {
|
||||
subpathPoint[0] = point[0];
|
||||
subpathPoint[1] = point[1];
|
||||
|
||||
baseInstruction = anInstruction;
|
||||
}
|
||||
|
||||
} else if (instruction == 'h') {
|
||||
point[0] += data[0];
|
||||
} else if (instruction == 'v') {
|
||||
point[1] += data[0];
|
||||
}
|
||||
|
||||
// convert absolute to relative
|
||||
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];
|
||||
|
||||
baseInstruction = anInstruction;
|
||||
} 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') {
|
||||
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') {
|
||||
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') {
|
||||
instruction = 'a';
|
||||
|
||||
data[5] -= point[0];
|
||||
data[6] -= point[1];
|
||||
|
||||
point[0] += data[5];
|
||||
point[1] += data[6];
|
||||
} else if (instruction == 'H') {
|
||||
instruction = 'h';
|
||||
|
||||
data[0] -= point[0];
|
||||
point[0] += data[0];
|
||||
} else if (instruction == 'V') {
|
||||
instruction = 'v';
|
||||
|
||||
data[0] -= point[1];
|
||||
point[1] += data[0];
|
||||
}
|
||||
|
||||
// reset the instruction
|
||||
anInstruction.instruction = instruction;
|
||||
CGFloat* coords = anInstruction.coords;
|
||||
coords[0] = point[0];
|
||||
coords[1] = point[1];
|
||||
|
||||
} else if (instruction == 'Z' || instruction == 'z') {
|
||||
if (baseInstruction != nil) {
|
||||
CGFloat* coords = anInstruction.coords;
|
||||
coords[0] = baseInstruction.coords[0];
|
||||
coords[1] = baseInstruction.coords[1];
|
||||
}
|
||||
point[0] = subpathPoint[0];
|
||||
point[1] = subpathPoint[1];
|
||||
}
|
||||
|
||||
CGFloat* base = anInstruction.base;
|
||||
if (prevInstruction != nil) {
|
||||
base[0] = prevInstruction.coords[0];
|
||||
base[1] = prevInstruction.coords[1];
|
||||
} else {
|
||||
base[0] = 0.f;
|
||||
base[1] = 0.f;
|
||||
}
|
||||
|
||||
// increment index
|
||||
prevInstruction = anInstruction;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray<IJSVGExporterPathInstruction*>*)instructionsFromPath:(CGPathRef)path
|
||||
floatingPointOptions:(IJSVGFloatingPointOptions)floatingPointOptions
|
||||
{
|
||||
|
||||
// keep track of the current point
|
||||
__block CGPoint currentPoint = CGPointZero;
|
||||
NSMutableArray* instructions = [[[NSMutableArray alloc] init] autorelease];
|
||||
|
||||
// create the path callback
|
||||
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'
|
||||
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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 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') {
|
||||
[instructions removeLastObject];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return instructions;
|
||||
}
|
||||
|
||||
@end
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
// Copyright © 2016 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGradient.h"
|
||||
#import "IJSVGLayer.h"
|
||||
#import "IJSVGPath.h"
|
||||
#import <IJSVG/IJSVGGradient.h>
|
||||
#import <IJSVG/IJSVGLayer.h>
|
||||
#import <IJSVG/IJSVGPath.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@interface IJSVGGradientLayer : IJSVGLayer {
|
||||
+12
-17
@@ -10,14 +10,9 @@
|
||||
|
||||
@implementation IJSVGGradientLayer
|
||||
|
||||
@synthesize viewBox;
|
||||
@synthesize gradient;
|
||||
@synthesize absoluteTransform;
|
||||
@synthesize objectRect;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([gradient release]), gradient = nil;
|
||||
(void)([_gradient release]), _gradient = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -32,17 +27,17 @@
|
||||
|
||||
- (void)setGradient:(IJSVGGradient*)newGradient
|
||||
{
|
||||
if (gradient != nil) {
|
||||
(void)([gradient release]), gradient = nil;
|
||||
if (_gradient != nil) {
|
||||
(void)([_gradient release]), _gradient = nil;
|
||||
}
|
||||
gradient = [newGradient retain];
|
||||
_gradient = [newGradient retain];
|
||||
|
||||
// lets check its alpha properties on the colors
|
||||
BOOL hasAlphaChannel = NO;
|
||||
NSInteger stops = gradient.gradient.numberOfColorStops;
|
||||
NSInteger stops = _gradient.gradient.numberOfColorStops;
|
||||
for (NSInteger i = 0; i < stops; i++) {
|
||||
NSColor* color = nil;
|
||||
[gradient.gradient getColor:&color
|
||||
[_gradient.gradient getColor:&color
|
||||
location:NULL
|
||||
atIndex:i];
|
||||
if (color.alphaComponent != 1.f) {
|
||||
@@ -64,11 +59,11 @@
|
||||
- (void)setBackingScaleFactor:(CGFloat)backingScaleFactor
|
||||
{
|
||||
switch (self.renderQuality) {
|
||||
case IJSVGRenderQualityOptimized: {
|
||||
case kIJSVGRenderQualityOptimized: {
|
||||
backingScaleFactor = (backingScaleFactor * .35f);
|
||||
break;
|
||||
}
|
||||
case IJSVGRenderQualityLow: {
|
||||
case kIJSVGRenderQualityLow: {
|
||||
backingScaleFactor = (backingScaleFactor * .05f);
|
||||
break;
|
||||
}
|
||||
@@ -89,12 +84,12 @@
|
||||
}
|
||||
|
||||
// draw the gradient
|
||||
CGAffineTransform trans = CGAffineTransformMakeTranslation(-CGRectGetMinX(objectRect),
|
||||
-CGRectGetMinY(objectRect));
|
||||
CGAffineTransform transform = CGAffineTransformConcat(absoluteTransform, trans);
|
||||
CGAffineTransform trans = CGAffineTransformMakeTranslation(-CGRectGetMinX(_objectRect),
|
||||
-CGRectGetMinY(_objectRect));
|
||||
CGAffineTransform transform = CGAffineTransformConcat(_absoluteTransform, trans);
|
||||
CGContextSaveGState(ctx);
|
||||
[self.gradient drawInContextRef:ctx
|
||||
objectRect:objectRect
|
||||
objectRect:_objectRect
|
||||
absoluteTransform:transform
|
||||
viewPort:self.viewBox];
|
||||
CGContextRestoreGState(ctx);
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGLayer.h"
|
||||
#import "IJSVGShapeLayer.h"
|
||||
#import <IJSVG/IJSVGLayer.h>
|
||||
#import <IJSVG/IJSVGShapeLayer.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@interface IJSVGGroupLayer : IJSVGLayer
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGLayer.h"
|
||||
#import <IJSVG/IJSVGLayer.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGRendering.h"
|
||||
#import "IJSVGTransaction.h"
|
||||
#import <IJSVG/IJSVGRendering.h>
|
||||
#import <IJSVG/IJSVGTransaction.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@class IJSVGShapeLayer;
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
+ (NSArray*)deepestSublayersOfLayer:(CALayer*)layer;
|
||||
+ (void)recursivelyWalkLayer:(CALayer*)layer
|
||||
withBlock:(void (^)(CALayer* layer, BOOL isMask))block;
|
||||
withBlock:(void (^)(CALayer* layer, BOOL isMask, BOOL* stop))block;
|
||||
|
||||
- (void)applySublayerMaskToContext:(CGContextRef)context
|
||||
forSublayer:(IJSVGLayer*)sublayer
|
||||
@@ -13,16 +13,6 @@
|
||||
|
||||
@implementation IJSVGLayer
|
||||
|
||||
@synthesize gradientFillLayer;
|
||||
@synthesize patternFillLayer;
|
||||
@synthesize gradientStrokeLayer;
|
||||
@synthesize patternStrokeLayer;
|
||||
@synthesize strokeLayer;
|
||||
@synthesize requiresBackingScaleHelp;
|
||||
@synthesize backingScaleFactor;
|
||||
@synthesize blendingMode;
|
||||
@synthesize convertMasksToPaths;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([_maskingLayer release]), _maskingLayer = nil;
|
||||
@@ -44,14 +34,21 @@
|
||||
}
|
||||
|
||||
+ (void)recursivelyWalkLayer:(CALayer*)layer
|
||||
withBlock:(void (^)(CALayer* layer, BOOL isMask))block
|
||||
withBlock:(void (^)(CALayer* layer, BOOL isMask, BOOL* stop))block
|
||||
{
|
||||
// call for layer and mask if there is one
|
||||
block(layer, NO);
|
||||
BOOL stop = NO;
|
||||
block(layer, NO, &stop);
|
||||
if(stop == YES) {
|
||||
return;
|
||||
}
|
||||
|
||||
// do the mask too!
|
||||
if (layer.mask != nil) {
|
||||
block(layer.mask, YES);
|
||||
block(layer.mask, YES, &stop);
|
||||
if(stop == YES) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// sublayers!!
|
||||
@@ -61,26 +58,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (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];
|
||||
}
|
||||
|
||||
- (void)setBackingScaleFactor:(CGFloat)newFactor
|
||||
{
|
||||
if (self.backingScaleFactor == newFactor) {
|
||||
if (_backingScaleFactor == newFactor) {
|
||||
return;
|
||||
}
|
||||
backingScaleFactor = newFactor;
|
||||
_backingScaleFactor = newFactor;
|
||||
self.contentsScale = newFactor;
|
||||
self.rasterizationScale = newFactor;
|
||||
[self setNeedsDisplay];
|
||||
@@ -88,7 +71,7 @@
|
||||
|
||||
- (void)_customRenderInContext:(CGContextRef)ctx
|
||||
{
|
||||
if (self.convertMasksToPaths == YES && _maskingLayer != nil) {
|
||||
if (_convertMasksToPaths == YES && _maskingLayer != nil) {
|
||||
CGContextSaveGState(ctx);
|
||||
[self applySublayerMaskToContext:ctx
|
||||
forSublayer:(IJSVGLayer*)self
|
||||
@@ -102,10 +85,10 @@
|
||||
|
||||
- (void)setConvertMasksToPaths:(BOOL)flag
|
||||
{
|
||||
if (convertMasksToPaths == flag) {
|
||||
if (_convertMasksToPaths == flag) {
|
||||
return;
|
||||
}
|
||||
convertMasksToPaths = flag;
|
||||
_convertMasksToPaths = flag;
|
||||
if (flag == YES) {
|
||||
if (_maskingLayer != nil) {
|
||||
(void)([_maskingLayer release]), _maskingLayer = nil;
|
||||
@@ -165,9 +148,9 @@
|
||||
|
||||
- (void)renderInContext:(CGContextRef)ctx
|
||||
{
|
||||
if (self.blendingMode != kCGBlendModeNormal) {
|
||||
if (_blendingMode != kCGBlendModeNormal) {
|
||||
CGContextSaveGState(ctx);
|
||||
CGContextSetBlendMode(ctx, self.blendingMode);
|
||||
CGContextSetBlendMode(ctx, _blendingMode);
|
||||
[self _customRenderInContext:ctx];
|
||||
CGContextRestoreGState(ctx);
|
||||
return;
|
||||
+4
-7
@@ -10,13 +10,10 @@
|
||||
|
||||
@implementation IJSVGPatternLayer
|
||||
|
||||
@synthesize pattern;
|
||||
@synthesize patternNode;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([pattern release]), pattern = nil;
|
||||
(void)([patternNode release]), patternNode = nil;
|
||||
(void)([_pattern release]), _pattern = nil;
|
||||
(void)([_patternNode release]), _patternNode = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -50,8 +47,8 @@ void IJSVGPatternDrawingCallBack(void* info, CGContextRef ctx)
|
||||
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),
|
||||
roundf(rect.size.width * _patternNode.width.value),
|
||||
roundf(rect.size.height * _patternNode.height.value),
|
||||
kCGPatternTilingConstantSpacing,
|
||||
true, &callbacks);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGLayer.h"
|
||||
#import "IJSVGUtils.h"
|
||||
#import <IJSVG/IJSVGLayer.h>
|
||||
#import <IJSVG/IJSVGUtils.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@interface IJSVGShapeLayer : CAShapeLayer {
|
||||
@@ -28,6 +28,7 @@
|
||||
@property (nonatomic, assign) CGPoint absoluteOrigin;
|
||||
@property (nonatomic, assign) CGPoint originalPathOrigin;
|
||||
@property (nonatomic, assign) BOOL convertMasksToPaths;
|
||||
@property (nonatomic, assign) IJSVGPrimitivePathType primitiveType;
|
||||
|
||||
- (void)applySublayerMaskToContext:(CGContextRef)context
|
||||
forSublayer:(IJSVGLayer*)sublayer
|
||||
@@ -11,44 +11,18 @@
|
||||
|
||||
@implementation IJSVGShapeLayer
|
||||
|
||||
@synthesize gradientFillLayer;
|
||||
@synthesize patternFillLayer;
|
||||
@synthesize gradientStrokeLayer;
|
||||
@synthesize patternStrokeLayer;
|
||||
@synthesize strokeLayer;
|
||||
@synthesize requiresBackingScaleHelp;
|
||||
@synthesize backingScaleFactor;
|
||||
@synthesize blendingMode;
|
||||
@synthesize convertMasksToPaths;
|
||||
@synthesize originalPathOrigin;
|
||||
@synthesize renderQuality;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(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];
|
||||
@throw exception;
|
||||
}
|
||||
[super addSublayer:layer];
|
||||
}
|
||||
|
||||
- (void)setBackingScaleFactor:(CGFloat)newFactor
|
||||
{
|
||||
if (self.backingScaleFactor == newFactor) {
|
||||
return;
|
||||
}
|
||||
backingScaleFactor = newFactor;
|
||||
_backingScaleFactor = newFactor;
|
||||
self.contentsScale = newFactor;
|
||||
self.rasterizationScale = newFactor;
|
||||
[self setNeedsDisplay];
|
||||
@@ -70,10 +44,10 @@
|
||||
|
||||
- (void)setConvertMasksToPaths:(BOOL)flag
|
||||
{
|
||||
if (convertMasksToPaths == flag) {
|
||||
if (_convertMasksToPaths == flag) {
|
||||
return;
|
||||
}
|
||||
convertMasksToPaths = flag;
|
||||
_convertMasksToPaths = flag;
|
||||
if (flag == YES) {
|
||||
if (_maskingLayer != nil) {
|
||||
(void)([_maskingLayer release]), _maskingLayer = nil;
|
||||
@@ -6,15 +6,16 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGNode.h"
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGDef : IJSVGNode {
|
||||
@interface IJSVGDef : NSObject {
|
||||
|
||||
@private
|
||||
NSMutableDictionary* _dict;
|
||||
}
|
||||
|
||||
- (void)addDef:(IJSVGNode*)aDef;
|
||||
- (IJSVGDef*)defForID:(NSString*)anID;
|
||||
|
||||
@end
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super initWithDef:NO]) != nil) {
|
||||
if ((self = [super init]) != nil) {
|
||||
_dict = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
return self;
|
||||
@@ -29,13 +29,12 @@
|
||||
if (aDef.identifier == nil) {
|
||||
return;
|
||||
}
|
||||
[_dict setObject:aDef
|
||||
forKey:aDef.identifier];
|
||||
_dict[aDef.identifier] = aDef;
|
||||
}
|
||||
|
||||
- (IJSVGDef*)defForID:(NSString*)anID
|
||||
{
|
||||
return [_dict objectForKey:anID];
|
||||
return _dict[anID];
|
||||
}
|
||||
|
||||
@end
|
||||
+2
-5
@@ -7,14 +7,11 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "IJSVGNode.h"
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
|
||||
@interface IJSVGForeignObject : IJSVGNode {
|
||||
|
||||
NSString * requiredExtension;
|
||||
|
||||
}
|
||||
|
||||
@property ( nonatomic, copy ) NSString * requiredExtension;
|
||||
@property (nonatomic, copy) NSString* requiredExtension;
|
||||
|
||||
@end
|
||||
+1
-3
@@ -10,11 +10,9 @@
|
||||
|
||||
@implementation IJSVGForeignObject
|
||||
|
||||
@synthesize requiredExtension;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([requiredExtension release]), requiredExtension = nil;
|
||||
(void)([_requiredExtension release]), _requiredExtension = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGColorList.h"
|
||||
#import "IJSVGDef.h"
|
||||
#import "IJSVGTransform.h"
|
||||
#import <IJSVG/IJSVGColorList.h>
|
||||
#import <IJSVG/IJSVGDef.h>
|
||||
#import <IJSVG/IJSVGTransform.h>
|
||||
#import <IJSVG/IJSVGGroup.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGGradient : IJSVGNode
|
||||
@interface IJSVGGradient : IJSVGGroup
|
||||
|
||||
@property (nonatomic, retain) NSGradient* gradient;
|
||||
@property (nonatomic, assign) CGGradientRef CGGradient;
|
||||
@@ -21,8 +22,9 @@
|
||||
@property (nonatomic, retain) IJSVGUnitLength* y2;
|
||||
@property (nonatomic, retain) IJSVGColorList* colorList;
|
||||
|
||||
+ (CGFloat*)computeColorStopsFromString:(NSXMLElement*)element
|
||||
colors:(NSArray**)someColors;
|
||||
+ (CGFloat*)computeColorStops:(IJSVGGradient*)gradient
|
||||
colors:(NSArray**)someColors;
|
||||
|
||||
- (CGGradientRef)CGGradient;
|
||||
- (void)drawInContextRef:(CGContextRef)ctx
|
||||
objectRect:(NSRect)objectRect
|
||||
@@ -33,6 +35,7 @@
|
||||
end:(CGPoint)endPoint
|
||||
context:(CGContextRef)ctx;
|
||||
|
||||
- (IJSVGColorList*)colorList;
|
||||
- (IJSVGColorList*)computedColorList;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// IJSVGGradient.m
|
||||
// IJSVGExample
|
||||
//
|
||||
// Created by Curtis Hard on 03/09/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGradient.h"
|
||||
#import "IJSVGParser.h"
|
||||
|
||||
@implementation IJSVGGradient
|
||||
|
||||
@synthesize colorList = _privateColorList;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(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)([_privateColorList release]), _privateColorList = nil;
|
||||
if (_CGGradient != nil) {
|
||||
CGGradientRelease(_CGGradient);
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
IJSVGGradient* clone = [super copyWithZone:zone];
|
||||
clone.gradient = [[self.gradient copy] autorelease];
|
||||
return clone;
|
||||
}
|
||||
|
||||
- (void)setColorList:(IJSVGColorList*)list
|
||||
{
|
||||
(void)([_privateColorList release]), _privateColorList = nil;
|
||||
_privateColorList = list.retain;
|
||||
if (_CGGradient != nil) {
|
||||
CGGradientRelease(_CGGradient);
|
||||
}
|
||||
}
|
||||
|
||||
+ (CGFloat *)computeColorStops:(IJSVGGradient*)gradient
|
||||
colors:(NSArray**)someColors
|
||||
{
|
||||
NSArray<IJSVGNode*>* stops = gradient.childNodes;
|
||||
NSMutableArray* colors = [[[NSMutableArray alloc] initWithCapacity:stops.count] autorelease];
|
||||
CGFloat* stopsParams = (CGFloat*)malloc(stops.count * sizeof(CGFloat));
|
||||
|
||||
NSInteger i = 0;
|
||||
for(IJSVGNode* stopNode in stops) {
|
||||
NSColor* color = stopNode.fillColor;
|
||||
CGFloat opacity = stopNode.fillOpacity.value;
|
||||
CGFloat offset = stopNode.offset.value;
|
||||
stopsParams[i++] = offset;
|
||||
if(color == nil) {
|
||||
color = [IJSVGColor colorFromHEXInteger:0x000000];
|
||||
if(opacity != 1.f) {
|
||||
color = [IJSVGColor changeAlphaOnColor:color
|
||||
to:opacity];
|
||||
}
|
||||
}
|
||||
[colors addObject:color];
|
||||
}
|
||||
*someColors = (NSArray*)colors;
|
||||
return stopsParams;
|
||||
}
|
||||
|
||||
- (IJSVGColorList*)colorList
|
||||
{
|
||||
IJSVGColorList* sheet = [[[IJSVGColorList alloc] init] autorelease];
|
||||
NSInteger num = self.gradient.numberOfColorStops;
|
||||
for (NSInteger i = 0; i < num; i++) {
|
||||
NSColor* color;
|
||||
[self.gradient getColor:&color
|
||||
location:nil
|
||||
atIndex:i];
|
||||
IJSVGColorType* type = [IJSVGColorType typeWithColor:color
|
||||
flags:IJSVGColorTypeFlagStop];
|
||||
[sheet addColor:type];
|
||||
}
|
||||
return sheet;
|
||||
}
|
||||
|
||||
- (IJSVGColorList*)computedColorList
|
||||
{
|
||||
return _privateColorList;
|
||||
}
|
||||
|
||||
- (CGGradientRef)CGGradient
|
||||
{
|
||||
// store it in the cache
|
||||
if (_CGGradient != nil) {
|
||||
return _CGGradient;
|
||||
}
|
||||
|
||||
// actually create the gradient
|
||||
NSInteger num = self.gradient.numberOfColorStops;
|
||||
CGFloat* locations = malloc(sizeof(CGFloat) * num);
|
||||
CFMutableArrayRef colors = CFArrayCreateMutable(kCFAllocatorDefault, (CFIndex)num,
|
||||
&kCFTypeArrayCallBacks);
|
||||
for (NSInteger i = 0; i < num; i++) {
|
||||
NSColor* color;
|
||||
[self.gradient getColor:&color
|
||||
location:&locations[i]
|
||||
atIndex:i];
|
||||
if (_privateColorList != nil) {
|
||||
color = [_privateColorList proposedColorForColor:color];
|
||||
}
|
||||
CFArrayAppendValue(colors, color.CGColor);
|
||||
}
|
||||
CGGradientRef result = CGGradientCreateWithColors(self.gradient.colorSpace.CGColorSpace,
|
||||
colors, locations);
|
||||
CFRelease(colors);
|
||||
free(locations);
|
||||
return _CGGradient = result;
|
||||
}
|
||||
|
||||
- (void)drawInContextRef:(CGContextRef)ctx
|
||||
objectRect:(NSRect)objectRect
|
||||
absoluteTransform:(CGAffineTransform)absoluteTransform
|
||||
viewPort:(CGRect)viewBox
|
||||
{
|
||||
}
|
||||
|
||||
- (void)_debugStart:(CGPoint)startPoint
|
||||
end:(CGPoint)endPoint
|
||||
context:(CGContextRef)ctx
|
||||
{
|
||||
CGContextSaveGState(ctx);
|
||||
CGContextSetStrokeColorWithColor(ctx, NSColor.blackColor.CGColor);
|
||||
CGContextSetLineWidth(ctx, 1.f);
|
||||
CGContextMoveToPoint(ctx, startPoint.x, startPoint.y);
|
||||
CGContextAddLineToPoint(ctx, endPoint.x, endPoint.y);
|
||||
CGContextStrokePath(ctx);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,17 +6,18 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGNode.h"
|
||||
#import "IJSVGPath.h"
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <IJSVG/IJSVGPath.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGGroup : IJSVGNode {
|
||||
|
||||
NSMutableArray* children;
|
||||
@private
|
||||
NSMutableArray<IJSVGNode*>* _childNodes;
|
||||
}
|
||||
|
||||
- (void)addChild:(id)child;
|
||||
- (NSArray*)children;
|
||||
- (void)addChild:(IJSVGNode*)child;
|
||||
- (NSArray<IJSVGNode*>*)childNodes;
|
||||
- (void)purgeChildren;
|
||||
|
||||
@end
|
||||
@@ -12,21 +12,24 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([children release]), children = nil;
|
||||
(void)([_childNodes release]), _childNodes = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]) != nil) {
|
||||
children = [[NSMutableArray alloc] init];
|
||||
_childNodes = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)prepareFromCopy
|
||||
{
|
||||
children = [[NSMutableArray alloc] init];
|
||||
if(_childNodes != nil) {
|
||||
(void)[_childNodes release], _childNodes = nil;
|
||||
}
|
||||
_childNodes = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
@@ -34,7 +37,7 @@
|
||||
IJSVGGroup* node = [super copyWithZone:zone];
|
||||
[node prepareFromCopy];
|
||||
|
||||
for (IJSVGNode* childNode in self.children) {
|
||||
for (IJSVGNode* childNode in _childNodes) {
|
||||
childNode = [[childNode copy] autorelease];
|
||||
childNode.parentNode = node;
|
||||
[node addChild:childNode];
|
||||
@@ -44,23 +47,25 @@
|
||||
|
||||
- (void)purgeChildren
|
||||
{
|
||||
[children removeAllObjects];
|
||||
[_childNodes removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)addChild:(id)child
|
||||
- (void)addChild:(IJSVGNode*)child
|
||||
{
|
||||
if (child != nil)
|
||||
[children addObject:child];
|
||||
if (child != nil) {
|
||||
[_childNodes addObject:child];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray*)children
|
||||
- (NSArray<IJSVGNode*>*)childNodes
|
||||
{
|
||||
return children;
|
||||
return _childNodes;
|
||||
}
|
||||
|
||||
- (NSString*)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@ - %@", [super description], self.children];
|
||||
return [NSString stringWithFormat:@"%@ - %@",
|
||||
[super description], self.childNodes];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright © 2016 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGNode.h"
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class IJSVGPath;
|
||||
@@ -21,6 +21,7 @@
|
||||
- (CGImageRef)CGImage;
|
||||
- (void)drawInContextRef:(CGContextRef)context
|
||||
path:(IJSVGPath*)path;
|
||||
- (void)loadFromBase64EncodedString:(NSString*)encodedString;
|
||||
- (void)loadFromString:(NSString*)encodedString;
|
||||
- (void)loadFromURL:(NSURL*)aURL;
|
||||
|
||||
@end
|
||||
@@ -20,7 +20,7 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)loadFromBase64EncodedString:(NSString*)encodedString
|
||||
- (void)loadFromString:(NSString*)encodedString
|
||||
{
|
||||
if ([encodedString hasPrefix:@"data:"]) {
|
||||
encodedString = [encodedString stringByReplacingOccurrencesOfString:@"\\s+"
|
||||
@@ -28,8 +28,15 @@
|
||||
options:NSRegularExpressionSearch
|
||||
range:NSMakeRange(0, encodedString.length)];
|
||||
}
|
||||
NSURL* URL = [NSURL URLWithString:encodedString];
|
||||
NSData* data = [NSData dataWithContentsOfURL:URL];
|
||||
NSURL* url = [NSURL URLWithString:encodedString];
|
||||
if(url != nil) {
|
||||
[self loadFromURL:url];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)loadFromURL:(NSURL*)aURL
|
||||
{
|
||||
NSData* data = [NSData dataWithContentsOfURL:aURL];
|
||||
|
||||
// no data, just ignore...invalid probably
|
||||
if (data == nil) {
|
||||
@@ -46,7 +53,8 @@
|
||||
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)];
|
||||
CGRect rect = CGRectMake(0.f, 0.f, self.width.value, self.height.value);
|
||||
CGPathAddRect(imagePath.path, NULL, rect);
|
||||
[imagePath close];
|
||||
}
|
||||
return imagePath;
|
||||
@@ -92,7 +100,7 @@
|
||||
path = [self path];
|
||||
}
|
||||
|
||||
CGRect rect = path.path.bounds;
|
||||
CGRect rect = path.pathBoundingBox;
|
||||
CGRect bounds = CGRectMake(0.f, 0.f, rect.size.width, rect.size.height);
|
||||
|
||||
// save the state of the context
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGradient.h"
|
||||
#import <IJSVG/IJSVGGradient.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGLinearGradient : IJSVGGradient
|
||||
+7
-6
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "IJSVGLinearGradient.h"
|
||||
#import "IJSVGUtils.h"
|
||||
#import "IJSVGParser.h"
|
||||
|
||||
@implementation IJSVGLinearGradient
|
||||
|
||||
@@ -15,10 +16,10 @@
|
||||
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:IJSVGAttributeX1].stringValue ?: @"0");
|
||||
NSString* x2 = ([element attributeForName:IJSVGAttributeX2].stringValue ?: @"100%");
|
||||
NSString* y1 = ([element attributeForName:IJSVGAttributeY1].stringValue ?: @"0");
|
||||
NSString* y2 = ([element attributeForName:IJSVGAttributeY2].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];
|
||||
@@ -26,8 +27,8 @@
|
||||
|
||||
// compute the color stops and colours
|
||||
NSArray* colors = nil;
|
||||
CGFloat* stopsParams = [self.class computeColorStopsFromString:element
|
||||
colors:&colors];
|
||||
CGFloat* stopsParams = [self.class computeColorStops:aGradient
|
||||
colors:&colors];
|
||||
|
||||
// create the gradient with the colours
|
||||
NSGradient* grad = [[NSGradient alloc] initWithColors:colors
|
||||
@@ -6,11 +6,12 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGStyle.h"
|
||||
#import "IJSVGUnitLength.h"
|
||||
#import <IJSVG/IJSVGStyle.h>
|
||||
#import <IJSVG/IJSVGUnitLength.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class IJSVGNode;
|
||||
@class IJSVG;
|
||||
@class IJSVGGroup;
|
||||
@class IJSVGDef;
|
||||
@@ -19,6 +20,8 @@
|
||||
@class IJSVGPattern;
|
||||
@class IJSVGTransform;
|
||||
|
||||
typedef void (^IJSVGNodeWalkHandler)(IJSVGNode* node, BOOL* allowChildNodes, BOOL* stop);
|
||||
|
||||
typedef NS_ENUM(NSInteger, IJSVGNodeType) {
|
||||
IJSVGNodeTypeGroup,
|
||||
IJSVGNodeTypePath,
|
||||
@@ -43,6 +46,9 @@ typedef NS_ENUM(NSInteger, IJSVGNodeType) {
|
||||
IJSVGNodeTypeTextSpan,
|
||||
IJSVGNodeTypeStyle,
|
||||
IJSVGNodeTypeSwitch,
|
||||
IJSVGNodeTypeTitle,
|
||||
IJSVGNodeTypeDesc,
|
||||
IJSVGNodeTypeStop,
|
||||
IJSVGNodeTypeNotFound,
|
||||
};
|
||||
|
||||
@@ -97,6 +103,8 @@ static CGFloat IJSVGInheritedFloatValue = -99.9999991;
|
||||
|
||||
@interface IJSVGNode : NSObject <NSCopying>
|
||||
|
||||
@property (nonatomic, copy) NSString* title;
|
||||
@property (nonatomic, copy) NSString* desc;
|
||||
@property (nonatomic, assign) IJSVGNodeType type;
|
||||
@property (nonatomic, copy) NSString* name;
|
||||
@property (nonatomic, copy) NSString* className;
|
||||
@@ -112,6 +120,7 @@ static CGFloat IJSVGInheritedFloatValue = -99.9999991;
|
||||
@property (nonatomic, retain) IJSVGUnitLength* fillOpacity;
|
||||
@property (nonatomic, retain) IJSVGUnitLength* strokeOpacity;
|
||||
@property (nonatomic, retain) IJSVGUnitLength* strokeWidth;
|
||||
@property (nonatomic, retain) IJSVGUnitLength* offset;
|
||||
@property (nonatomic, retain) NSColor* fillColor;
|
||||
@property (nonatomic, retain) NSColor* strokeColor;
|
||||
@property (nonatomic, copy) NSString* identifier;
|
||||
@@ -136,6 +145,9 @@ static CGFloat IJSVGInheritedFloatValue = -99.9999991;
|
||||
@property (nonatomic, assign) IJSVGUnitType units;
|
||||
@property (nonatomic, assign) IJSVGBlendMode blendMode;
|
||||
|
||||
+ (void)walkNodeTree:(IJSVGNode*)node
|
||||
handler:(IJSVGNodeWalkHandler)handler;
|
||||
|
||||
+ (IJSVGNodeType)typeForString:(NSString*)string
|
||||
kind:(NSXMLNodeKind)kind;
|
||||
|
||||
@@ -0,0 +1,427 @@
|
||||
//
|
||||
// IJSVGNode.m
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 30/08/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGDef.h"
|
||||
#import "IJSVGNode.h"
|
||||
#import "IJSVGUtils.h"
|
||||
#import "IJSVGGroup.h"
|
||||
|
||||
@implementation IJSVGNode
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)free(_strokeDashArray), _strokeDashArray = NULL;
|
||||
(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)([_offset release]), _offset = 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)([_title release]), _title = nil;
|
||||
(void)([_desc release]), _desc = 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
|
||||
kind:(NSXMLNodeKind)kind
|
||||
{
|
||||
const char* name = string.UTF8String;
|
||||
if(name == NULL) {
|
||||
return IJSVGNodeTypeNotFound;
|
||||
}
|
||||
IJSVGCharBufferToLower((char*)name);
|
||||
if (strcmp(name, "style") == 0) {
|
||||
return IJSVGNodeTypeStyle;
|
||||
}
|
||||
if (strcmp(name, "switch") == 0) {
|
||||
return IJSVGNodeTypeSwitch;
|
||||
}
|
||||
if (strcmp(name, "defs") == 0) {
|
||||
return IJSVGNodeTypeDef;
|
||||
}
|
||||
if (strcmp(name, "g") == 0) {
|
||||
return IJSVGNodeTypeGroup;
|
||||
}
|
||||
if (strcmp(name, "path") == 0) {
|
||||
return IJSVGNodeTypePath;
|
||||
}
|
||||
if (strcmp(name, "polygon") == 0) {
|
||||
return IJSVGNodeTypePolygon;
|
||||
}
|
||||
if (strcmp(name, "polyline") == 0) {
|
||||
return IJSVGNodeTypePolyline;
|
||||
}
|
||||
if (strcmp(name, "rect") == 0) {
|
||||
return IJSVGNodeTypeRect;
|
||||
}
|
||||
if (strcmp(name, "line") == 0) {
|
||||
return IJSVGNodeTypeLine;
|
||||
}
|
||||
if (strcmp(name, "circle") == 0) {
|
||||
return IJSVGNodeTypeCircle;
|
||||
}
|
||||
if (strcmp(name, "ellipse") == 0) {
|
||||
return IJSVGNodeTypeEllipse;
|
||||
}
|
||||
if (strcmp(name, "use") == 0) {
|
||||
return IJSVGNodeTypeUse;
|
||||
}
|
||||
if (strcmp(name, "lineargradient") == 0) {
|
||||
return IJSVGNodeTypeLinearGradient;
|
||||
}
|
||||
if (strcmp(name, "radialgradient") == 0) {
|
||||
return IJSVGNodeTypeRadialGradient;
|
||||
}
|
||||
if(strcmp(name, "stop") == 0) {
|
||||
return IJSVGNodeTypeStop;
|
||||
}
|
||||
if (strcmp(name, "glyph") == 0) {
|
||||
return IJSVGNodeTypeGlyph;
|
||||
}
|
||||
if (strcmp(name, "font") == 0) {
|
||||
return IJSVGNodeTypeFont;
|
||||
}
|
||||
if (strcmp(name, "clippath") == 0) {
|
||||
return IJSVGNodeTypeClipPath;
|
||||
}
|
||||
if (strcmp(name, "mask") == 0) {
|
||||
return IJSVGNodeTypeMask;
|
||||
}
|
||||
if (strcmp(name, "image") == 0) {
|
||||
return IJSVGNodeTypeImage;
|
||||
}
|
||||
if (strcmp(name, "pattern") == 0) {
|
||||
return IJSVGNodeTypePattern;
|
||||
}
|
||||
if (strcmp(name, "svg") == 0) {
|
||||
return IJSVGNodeTypeSVG;
|
||||
}
|
||||
if (strcmp(name, "text") == 0) {
|
||||
return IJSVGNodeTypeText;
|
||||
}
|
||||
if (strcmp(name, "tspan") == 0 || kind == NSXMLTextKind) {
|
||||
return IJSVGNodeTypeTextSpan;
|
||||
}
|
||||
if(strcmp(name, "title") == 0) {
|
||||
return IJSVGNodeTypeTitle;
|
||||
}
|
||||
if(strcmp(name, "desc") == 0) {
|
||||
return IJSVGNodeTypeDesc;
|
||||
}
|
||||
return IJSVGNodeTypeNotFound;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [self initWithDef:YES]) != nil) {
|
||||
self.opacity = [IJSVGUnitLength unitWithFloat:1];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)walkNodeTree:(IJSVGNode*)node
|
||||
handler:(IJSVGNodeWalkHandler)handler
|
||||
{
|
||||
BOOL allowChildNodes = YES;
|
||||
BOOL stop = NO;
|
||||
[self _walkNodeTree:node
|
||||
handler:handler
|
||||
allowChildNodes:&allowChildNodes
|
||||
stop:&stop];
|
||||
}
|
||||
|
||||
+ (void)_walkNodeTree:(IJSVGNode*)node
|
||||
handler:(IJSVGNodeWalkHandler)handler
|
||||
allowChildNodes:(BOOL*)allowChildNodes
|
||||
stop:(BOOL*)stop
|
||||
{
|
||||
// run the handler and instantly stop
|
||||
// if stop is set
|
||||
handler(node, allowChildNodes, stop);
|
||||
if(*stop == YES) {
|
||||
return;
|
||||
}
|
||||
|
||||
// child nodes only work for nodes
|
||||
// that are type group
|
||||
if(*allowChildNodes == NO ||
|
||||
[node isKindOfClass:IJSVGGroup.class] == NO) {
|
||||
*allowChildNodes = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
// iterate over the childnodes
|
||||
IJSVGGroup* group = (IJSVGGroup*)node;
|
||||
for(IJSVGNode* childNode in group.childNodes) {
|
||||
[self _walkNodeTree:childNode
|
||||
handler:handler
|
||||
allowChildNodes:allowChildNodes
|
||||
stop:stop];
|
||||
if(*stop == YES) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applyPropertiesFromNode:(IJSVGNode*)node
|
||||
{
|
||||
self.title = node.title;
|
||||
self.desc = node.desc;
|
||||
|
||||
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));
|
||||
self.strokeDashArray = nStrokeDashArray;
|
||||
self.strokeDashArrayCount = node.strokeDashArrayCount;
|
||||
self.strokeDashOffset = node.strokeDashOffset;
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
IJSVGNode* node = [self.class allocWithZone:zone];
|
||||
[node applyPropertiesFromNode:self];
|
||||
return node;
|
||||
}
|
||||
|
||||
- (id)initWithDef:(BOOL)flag
|
||||
{
|
||||
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 == YES) {
|
||||
_def = [[IJSVGDef alloc] init];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (IJSVGDef*)defForID:(NSString*)anID
|
||||
{
|
||||
IJSVGDef* aDef = nil;
|
||||
if ((aDef = [_def defForID:anID]) != nil) {
|
||||
return aDef;
|
||||
}
|
||||
if (_parentNode != nil) {
|
||||
return [_parentNode defForID:anID];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)addDef:(IJSVGNode*)aDef
|
||||
{
|
||||
[_def addDef:aDef];
|
||||
}
|
||||
|
||||
// winding rule can inherit..
|
||||
- (IJSVGWindingRule)windingRule
|
||||
{
|
||||
if (_windingRule == IJSVGWindingRuleInherit && _parentNode != nil) {
|
||||
return _parentNode.windingRule;
|
||||
}
|
||||
return _windingRule;
|
||||
}
|
||||
|
||||
- (IJSVGLineCapStyle)lineCapStyle
|
||||
{
|
||||
if (_lineCapStyle == IJSVGLineCapStyleInherit) {
|
||||
if (_parentNode != nil) {
|
||||
return _parentNode.lineCapStyle;
|
||||
}
|
||||
}
|
||||
return _lineCapStyle;
|
||||
}
|
||||
|
||||
- (IJSVGLineJoinStyle)lineJoinStyle
|
||||
{
|
||||
if (_lineJoinStyle == IJSVGLineJoinStyleInherit) {
|
||||
if (_parentNode != nil) {
|
||||
return _parentNode.lineJoinStyle;
|
||||
}
|
||||
}
|
||||
return _lineJoinStyle;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGUnitLength*)opacity
|
||||
{
|
||||
if (_opacity.inherit && _parentNode != nil) {
|
||||
return _parentNode.opacity;
|
||||
}
|
||||
return _opacity;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGUnitLength*)fillOpacity
|
||||
{
|
||||
if (_fillOpacity.inherit && _parentNode != nil) {
|
||||
return _parentNode.fillOpacity;
|
||||
}
|
||||
return _fillOpacity;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGUnitLength*)strokeWidth
|
||||
{
|
||||
if (_strokeWidth.inherit && _parentNode != nil) {
|
||||
return _parentNode.strokeWidth;
|
||||
}
|
||||
return _strokeWidth;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (NSColor*)strokeColor
|
||||
{
|
||||
if (_strokeColor != nil)
|
||||
return _strokeColor;
|
||||
if (_strokeColor == nil && _parentNode != nil)
|
||||
return _parentNode.strokeColor;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (IJSVGUnitLength*)strokeOpacity
|
||||
{
|
||||
if (_strokeOpacity.inherit && _parentNode != nil) {
|
||||
return _parentNode.strokeOpacity;
|
||||
}
|
||||
return _strokeOpacity;
|
||||
}
|
||||
|
||||
// even though the spec explicity states fill color
|
||||
// must be on the path, it can also be on the
|
||||
- (NSColor*)fillColor
|
||||
{
|
||||
if (_fillColor == nil && _parentNode != nil) {
|
||||
return _parentNode.fillColor;
|
||||
}
|
||||
return _fillColor;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGGradient*)fillGradient
|
||||
{
|
||||
if (_fillGradient == nil && _parentNode != nil) {
|
||||
return _parentNode.fillGradient;
|
||||
}
|
||||
return _fillGradient;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGPattern*)fillPattern
|
||||
{
|
||||
if (_fillPattern == nil && _parentNode != nil) {
|
||||
return _parentNode.fillPattern;
|
||||
}
|
||||
return _fillPattern;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGGradient*)strokeGradient
|
||||
{
|
||||
if (_strokeGradient == nil && _parentNode != nil) {
|
||||
return _parentNode.strokeGradient;
|
||||
}
|
||||
return _strokeGradient;
|
||||
}
|
||||
|
||||
// these are all recursive, so go up the chain
|
||||
// if they dont exist on this specific node
|
||||
- (IJSVGPattern*)strokePattern
|
||||
{
|
||||
if (_strokePattern == nil && _parentNode != nil) {
|
||||
return _parentNode.strokePattern;
|
||||
}
|
||||
return _strokePattern;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// IJSVGPath.h
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 30/08/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class IJSVGGroup;
|
||||
|
||||
typedef NS_ENUM(NSInteger, IJSVGPrimitivePathType) {
|
||||
kIJSVGPrimitivePathTypePath,
|
||||
kIJSVGPrimitivePathTypeRect,
|
||||
kIJSVGPrimitivePathTypePolygon,
|
||||
kIJSVGPrimitivePathTypePolyLine,
|
||||
kIJSVGPrimitivePathTypeCircle,
|
||||
kIJSVGPrimitivePathTypeEllipse,
|
||||
kIJSVGPrimitivePathTypeLine
|
||||
};
|
||||
|
||||
@interface IJSVGPath : IJSVGNode {
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IJSVGPrimitivePathType primitiveType;
|
||||
@property (nonatomic, assign) CGMutablePathRef path;
|
||||
@property (nonatomic, assign) CGPoint lastControlPoint;
|
||||
@property (nonatomic, readonly) CGRect controlPointBoundingBox;
|
||||
@property (nonatomic, readonly) CGRect pathBoundingBox;
|
||||
@property (nonatomic, assign, readonly) BOOL isStroked;
|
||||
|
||||
- (void)close;
|
||||
- (NSPoint)currentPoint;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// IJSVGPath.m
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 30/08/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGroup.h"
|
||||
#import "IJSVGPath.h"
|
||||
|
||||
@implementation IJSVGPath
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if(_path != NULL) {
|
||||
(void)CGPathRelease(_path), _path = NULL;
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]) != nil) {
|
||||
_primitiveType = kIJSVGPrimitivePathTypePath;
|
||||
_path = CGPathCreateMutable();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
IJSVGPath* node = [super copyWithZone:zone];
|
||||
node.path = _path;
|
||||
return node;
|
||||
}
|
||||
|
||||
- (void)setPath:(CGMutablePathRef)path
|
||||
{
|
||||
// this will automatically copy any path into a mutable path
|
||||
// regardless of if it was a mutable path to begin with
|
||||
if(_path != NULL) {
|
||||
(void)CGPathRelease(_path), _path = NULL;
|
||||
}
|
||||
_path = CGPathCreateMutableCopy(path);
|
||||
}
|
||||
|
||||
- (CGRect)pathBoundingBox
|
||||
{
|
||||
return CGPathGetPathBoundingBox(_path);
|
||||
}
|
||||
|
||||
- (CGRect)controlPointBoundingBox
|
||||
{
|
||||
return CGPathGetBoundingBox(_path);
|
||||
}
|
||||
|
||||
- (NSPoint)currentPoint
|
||||
{
|
||||
return CGPathGetCurrentPoint(_path);
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
CGPathCloseSubpath(_path);
|
||||
}
|
||||
|
||||
- (BOOL)isStroked
|
||||
{
|
||||
return (self.strokeColor != nil && self.strokeColor.alphaComponent != 0.f) ||
|
||||
self.strokePattern != nil ||
|
||||
self.strokeGradient != nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2016 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGroup.h"
|
||||
#import "IJSVGImage.h"
|
||||
#import <IJSVG/IJSVGGroup.h>
|
||||
#import <IJSVG/IJSVGImage.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGPattern : IJSVGGroup {
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGradient.h"
|
||||
#import <IJSVG/IJSVGGradient.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGRadialGradient : IJSVGGradient
|
||||
+25
-27
@@ -7,33 +7,28 @@
|
||||
//
|
||||
|
||||
#import "IJSVGRadialGradient.h"
|
||||
#import "IJSVGParser.h"
|
||||
|
||||
@implementation IJSVGRadialGradient
|
||||
|
||||
@synthesize cx;
|
||||
@synthesize cy;
|
||||
@synthesize fx;
|
||||
@synthesize fy;
|
||||
@synthesize radius;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(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;
|
||||
(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
|
||||
{
|
||||
IJSVGRadialGradient* grad = [super copyWithZone:zone];
|
||||
grad.fx = self.fx;
|
||||
grad.fy = self.fy;
|
||||
grad.cx = self.cx;
|
||||
grad.cy = self.cy;
|
||||
grad.radius = self.radius;
|
||||
grad.fx = _fx;
|
||||
grad.fy = _fy;
|
||||
grad.cx = _cx;
|
||||
grad.cy = _cy;
|
||||
grad.radius = _radius;
|
||||
return grad;
|
||||
}
|
||||
|
||||
@@ -41,9 +36,10 @@
|
||||
gradient:(IJSVGRadialGradient*)gradient
|
||||
{
|
||||
// cx defaults to 50% if not specified
|
||||
NSDictionary* kv = @{ @"cx" : @"cx",
|
||||
@"cy" : @"cy",
|
||||
@"r" : @"radius" };
|
||||
NSDictionary* kv = @{
|
||||
IJSVGAttributeCX : @"cx",
|
||||
IJSVGAttributeCY : @"cy",
|
||||
IJSVGAttributeR : @"radius" };
|
||||
|
||||
for (NSString* key in kv.allKeys) {
|
||||
NSString* str = [element attributeForName:key].stringValue;
|
||||
@@ -64,13 +60,13 @@
|
||||
gradient.fy = gradient.cy;
|
||||
|
||||
// needs fixing
|
||||
NSString* fx = [element attributeForName:@"fx"].stringValue;
|
||||
NSString* fx = [element attributeForName:IJSVGAttributeFX].stringValue;
|
||||
if (fx != nil) {
|
||||
gradient.fx = [IJSVGUnitLength unitWithString:fx
|
||||
fromUnitType:gradient.units];
|
||||
}
|
||||
|
||||
NSString* fy = [element attributeForName:@"fy"].stringValue;
|
||||
NSString* fy = [element attributeForName:IJSVGAttributeFY].stringValue;
|
||||
if (fx != nil) {
|
||||
gradient.fy = [IJSVGUnitLength unitWithString:fy
|
||||
fromUnitType:gradient.units];
|
||||
@@ -81,7 +77,9 @@
|
||||
}
|
||||
|
||||
NSArray* colors = nil;
|
||||
CGFloat* colorStops = [self.class computeColorStopsFromString:element colors:&colors];
|
||||
CGFloat* colorStops = [self.class computeColorStops:gradient
|
||||
colors:&colors];
|
||||
|
||||
NSGradient* ret = [[[NSGradient alloc] initWithColors:colors
|
||||
atLocations:colorStops
|
||||
colorSpace:IJSVGColor.defaultColorSpace] autorelease];
|
||||
@@ -112,15 +110,15 @@
|
||||
}
|
||||
|
||||
// compute size based on percentages
|
||||
CGFloat x = [self.cx computeValue:CGRectGetWidth(boundingBox)];
|
||||
CGFloat y = [self.cy computeValue:CGRectGetHeight(boundingBox)];
|
||||
CGFloat x = [_cx computeValue:CGRectGetWidth(boundingBox)];
|
||||
CGFloat y = [_cy computeValue:CGRectGetHeight(boundingBox)];
|
||||
startPoint = CGPointMake(x, y);
|
||||
CGFloat val = MIN(CGRectGetWidth(boundingBox),
|
||||
CGRectGetHeight(boundingBox));
|
||||
radius = [self.radius computeValue:val];
|
||||
radius = [_radius computeValue:val];
|
||||
|
||||
CGFloat ex = [self.fx computeValue:CGRectGetWidth(boundingBox)];
|
||||
CGFloat ey = [self.fy computeValue:CGRectGetHeight(boundingBox)];
|
||||
CGFloat ex = [_fx computeValue:CGRectGetWidth(boundingBox)];
|
||||
CGFloat ey = [_fy computeValue:CGRectGetHeight(boundingBox)];
|
||||
|
||||
gradientEndPoint = CGPointMake(ex, ey);
|
||||
gradientStartPoint = startPoint;
|
||||
@@ -6,11 +6,9 @@
|
||||
// Copyright © 2017 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGGroup.h"
|
||||
#import <IJSVG/IJSVGGroup.h>
|
||||
|
||||
@interface IJSVGText : IJSVGGroup {
|
||||
|
||||
NSString* text;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* text;
|
||||
@@ -10,18 +10,16 @@
|
||||
|
||||
@implementation IJSVGText
|
||||
|
||||
@synthesize text;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([text release]), text = nil;
|
||||
(void)([_text release]), _text = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (IJSVGText*)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
IJSVGText* node = [super copyWithZone:zone];
|
||||
node.text = self.text;
|
||||
node.text = _text;
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// IJSVGCommandParser.h
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 23/12/2019.
|
||||
// Copyright © 2019 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <xlocale.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, IJSVGPathDataSequence) {
|
||||
kIJSVGPathDataSequenceTypeFloat,
|
||||
kIJSVGPathDataSequenceTypeFlag
|
||||
};
|
||||
|
||||
static NSUInteger const IJSVG_STREAM_FLOAT_BLOCK_SIZE = 50;
|
||||
static NSUInteger const IJSVG_STREAM_CHAR_BLOCK_SIZE = 20;
|
||||
|
||||
typedef struct {
|
||||
CGFloat* floatBuffer;
|
||||
NSInteger floatCount;
|
||||
char* charBuffer;
|
||||
NSInteger charCount;
|
||||
} IJSVGPathDataStream;
|
||||
|
||||
@interface IJSVGCommandParser : NSObject
|
||||
|
||||
IJSVGPathDataStream* IJSVGPathDataStreamCreateDefault(void);
|
||||
IJSVGPathDataStream* IJSVGPathDataStreamCreate(NSUInteger floatCount, NSUInteger charCount);
|
||||
void IJSVGPathDataStreamRelease(IJSVGPathDataStream* buffer);
|
||||
|
||||
IJSVGPathDataSequence* IJSVGPathDataSequenceCreateWithType(IJSVGPathDataSequence type, NSInteger length);
|
||||
CGFloat* _Nullable IJSVGParsePathDataStreamSequence(const char* commandChars, NSInteger commandCharLength,
|
||||
IJSVGPathDataStream* dataStream, IJSVGPathDataSequence* _Nullable sequence,
|
||||
NSInteger commandLength, NSInteger* _Nullable commandsFound);
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,249 @@
|
||||
//
|
||||
// IJSVGCommandParser.m
|
||||
// IJSVG
|
||||
//
|
||||
// Created by Curtis Hard on 23/12/2019.
|
||||
// Copyright © 2019 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGCommandParser.h"
|
||||
|
||||
@implementation IJSVGCommandParser
|
||||
|
||||
#define VALID_DIGIT(c) ((c ^ '0') <= 9)
|
||||
|
||||
IJSVGPathDataSequence* IJSVGPathDataSequenceCreateWithType(IJSVGPathDataSequence type, NSInteger length)
|
||||
{
|
||||
size_t size = sizeof(IJSVGPathDataSequence) * length;
|
||||
IJSVGPathDataSequence* sequence = (IJSVGPathDataSequence*)malloc(size);
|
||||
memset(sequence, (int)type, size);
|
||||
return sequence;
|
||||
};
|
||||
|
||||
// Datastreams work by setting up one stream of bits/memory per SVG
|
||||
// so that each SVG has a reusable memory block to read and parse paths into.
|
||||
// As its all linear and one SVG per thread, this saves alot of memory allocation
|
||||
// calls as we simple can just reuse the buffer that already exists - this also
|
||||
// allows us to specify the default allocation size, so when parsing viewBox we
|
||||
// can simply allocate (4*sizeof(CGFloat)) instead of the default 50 slots
|
||||
IJSVGPathDataStream* IJSVGPathDataStreamCreateDefault(void)
|
||||
{
|
||||
return IJSVGPathDataStreamCreate(IJSVG_STREAM_FLOAT_BLOCK_SIZE,
|
||||
IJSVG_STREAM_CHAR_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
IJSVGPathDataStream* IJSVGPathDataStreamCreate(NSUInteger floatCount, NSUInteger charCount)
|
||||
{
|
||||
floatCount = floatCount ?: IJSVG_STREAM_FLOAT_BLOCK_SIZE;
|
||||
charCount = charCount ?: IJSVG_STREAM_CHAR_BLOCK_SIZE;
|
||||
IJSVGPathDataStream* buffer = (IJSVGPathDataStream*)malloc(sizeof(IJSVGPathDataStream));
|
||||
buffer->floatBuffer = (CGFloat*)malloc(sizeof(CGFloat) * floatCount);
|
||||
buffer->floatCount = floatCount;
|
||||
buffer->charBuffer = (char*)calloc(sizeof(char), charCount);
|
||||
buffer->charCount = charCount;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void IJSVGPathDataStreamRelease(IJSVGPathDataStream* buffer)
|
||||
{
|
||||
free(buffer->charBuffer);
|
||||
free(buffer->floatBuffer);
|
||||
free(buffer);
|
||||
};
|
||||
|
||||
CGFloat* _Nullable IJSVGParsePathDataStreamSequence(const char* commandChars, NSInteger commandCharLength,
|
||||
IJSVGPathDataStream* dataStream, IJSVGPathDataSequence* _Nullable sequence,
|
||||
NSInteger commandLength, NSInteger* _Nullable commandsFound)
|
||||
{
|
||||
// if no command length, its completely pointless function,
|
||||
// so just return null and set commandsFound to 0, if we dont
|
||||
// we get a arithmetic error later on due to zero
|
||||
if (commandLength == 0) {
|
||||
*commandsFound = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// default memory size for the float
|
||||
NSInteger i = 0;
|
||||
NSInteger counter = 0;
|
||||
|
||||
const char* cString = commandChars;
|
||||
const char* validChars = "+-.";
|
||||
|
||||
// this is much faster then doing strlen as it doesnt need
|
||||
// to compute the length
|
||||
NSInteger sLength = commandCharLength;
|
||||
NSInteger sLengthMinusOne = sLength - 1;
|
||||
|
||||
bool isDecimal = false;
|
||||
int bufferCount = 0;
|
||||
|
||||
while (i < sLength) {
|
||||
char currentChar = *cString++;
|
||||
|
||||
// work out next char
|
||||
char nextChar = (char)0;
|
||||
if (i < sLengthMinusOne) {
|
||||
nextChar = *cString++;
|
||||
cString--;
|
||||
}
|
||||
|
||||
// check for validator
|
||||
bool isE = (currentChar | ('E' ^ 'e')) == 'e';
|
||||
bool isValid = VALID_DIGIT(currentChar) || isE || strchr(validChars, currentChar) != NULL;
|
||||
|
||||
// in order to work out the split, its either because the next char is
|
||||
// a hyphen or a plus, or next char is a decimal and the current number is a decimal
|
||||
bool nIsSign = nextChar == '-' || nextChar == '+';
|
||||
bool wantsEnd = nIsSign || (nextChar == '.' && isDecimal);
|
||||
|
||||
// work our what the sequence is...
|
||||
IJSVGPathDataSequence seq = kIJSVGPathDataSequenceTypeFloat;
|
||||
if (sequence != NULL) {
|
||||
seq = sequence[counter % commandLength];
|
||||
}
|
||||
|
||||
// is a flag, consists of one value
|
||||
// if its invalid, make sure we free the memory
|
||||
// and return null - or hell breaks lose
|
||||
if (isValid == YES && seq == kIJSVGPathDataSequenceTypeFlag) {
|
||||
if (bufferCount != 0 || (currentChar != '0' && currentChar != '1')) {
|
||||
return NULL;
|
||||
}
|
||||
wantsEnd = YES;
|
||||
}
|
||||
|
||||
// could be a float like 5.334e-5 so dont break on the hypen
|
||||
if (wantsEnd && isE && nIsSign) {
|
||||
wantsEnd = false;
|
||||
}
|
||||
|
||||
// make sure its a valid string
|
||||
if (isValid == YES) {
|
||||
// alloc the buffer if needed
|
||||
if ((bufferCount + 1) == dataStream->charCount) {
|
||||
// realloc the buffer, incase the string is overflowing the
|
||||
// allocated memory
|
||||
dataStream->charCount += IJSVG_STREAM_CHAR_BLOCK_SIZE;
|
||||
dataStream->charBuffer = (char*)realloc(dataStream->charBuffer,
|
||||
sizeof(char) * dataStream->charCount);
|
||||
}
|
||||
// set the actual char against it
|
||||
if (currentChar == '.') {
|
||||
isDecimal = true;
|
||||
}
|
||||
dataStream->charBuffer[bufferCount++] = currentChar;
|
||||
} else {
|
||||
// if its an invalid char, just stop it
|
||||
wantsEnd = true;
|
||||
}
|
||||
|
||||
// is at end of string, or wants to be stopped
|
||||
// buffer has to actually exist or its completly
|
||||
// useless and will cause a crash
|
||||
if (bufferCount != 0 && (wantsEnd || i == sLengthMinusOne)) {
|
||||
// make sure there is enough room in the float pool
|
||||
if ((counter + 1) == dataStream->floatCount) {
|
||||
dataStream->floatCount += IJSVG_STREAM_FLOAT_BLOCK_SIZE;
|
||||
dataStream->floatBuffer = (CGFloat*)realloc(dataStream->floatBuffer,
|
||||
sizeof(CGFloat) * dataStream->floatCount);
|
||||
}
|
||||
|
||||
// add the float - for performance reasons, we can simply set the
|
||||
// null value of the end of the string instead of nulling out
|
||||
// with memset \0 - huzzah!
|
||||
dataStream->charBuffer[bufferCount] = '\0';
|
||||
dataStream->floatBuffer[counter++] = IJSVGParseFloat(dataStream->charBuffer);
|
||||
|
||||
// reset
|
||||
isDecimal = false;
|
||||
bufferCount = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// set commands found - only if there is one
|
||||
if (commandsFound != NULL) {
|
||||
*commandsFound = (NSInteger)round(counter / commandLength);
|
||||
}
|
||||
|
||||
// allocate the new buffer from memory
|
||||
CGFloat* floats = (CGFloat*)malloc(sizeof(CGFloat) * counter);
|
||||
memcpy(floats, dataStream->floatBuffer, counter * sizeof(CGFloat));
|
||||
|
||||
// return the floats just set into the memory
|
||||
return floats;
|
||||
}
|
||||
|
||||
// this method is finely tuned to just handle the buffer
|
||||
// that IJSVGParsePathDataSequence produces for each float
|
||||
// it does not look or skip white space as the previous method
|
||||
// handles this for us
|
||||
// inspired and modified from http://www.leapsecond.com/tools/fast_atof.c
|
||||
CGFloat IJSVGParseFloat(char* buffer)
|
||||
{
|
||||
int fraction;
|
||||
double sign, value, scale;
|
||||
|
||||
// work out a sign, if any, might not be, who knows
|
||||
sign = 1.f;
|
||||
if (*buffer == '-') {
|
||||
sign = -1.f;
|
||||
buffer += 1;
|
||||
} else if (*buffer == '+') {
|
||||
buffer += 1;
|
||||
}
|
||||
|
||||
// get numbers before decimal point or exponent
|
||||
for (value = 0.f; VALID_DIGIT(*buffer); buffer += 1) {
|
||||
value = value * 10.f + (*buffer - '0');
|
||||
}
|
||||
|
||||
// get digits after decimal point
|
||||
if (*buffer == '.') {
|
||||
double pow10 = 10.f;
|
||||
buffer += 1;
|
||||
while (VALID_DIGIT(*buffer)) {
|
||||
value += (*buffer - '0') / pow10;
|
||||
pow10 *= 10.f;
|
||||
buffer += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// handle exponent
|
||||
fraction = 0;
|
||||
scale = 1.f;
|
||||
if ((*buffer | ('E' ^ 'e')) == 'e') {
|
||||
unsigned int exponent;
|
||||
buffer += 1;
|
||||
if (*buffer == '-') {
|
||||
fraction = 1;
|
||||
buffer += 1;
|
||||
} else if (*buffer == '+') {
|
||||
buffer += 1;
|
||||
}
|
||||
for (exponent = 0; VALID_DIGIT(*buffer); buffer += 1) {
|
||||
exponent = exponent * 10 + (*buffer - '0');
|
||||
}
|
||||
if (exponent > 308) {
|
||||
exponent = 308;
|
||||
}
|
||||
while (exponent >= 50) {
|
||||
scale *= 1E50;
|
||||
exponent -= 50;
|
||||
}
|
||||
while (exponent >= 8) {
|
||||
scale *= 1E8;
|
||||
exponent -= 8;
|
||||
}
|
||||
while (exponent > 0) {
|
||||
scale *= 10.f;
|
||||
exponent -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
// make sure we cast this to a CGFloat before return
|
||||
return (CGFloat)(sign * (fraction ? (value / scale) : (value * scale)));
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// IJSVGParser.h
|
||||
// IconJar
|
||||
//
|
||||
// Created by Curtis Hard on 30/08/2014.
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <IJSVG/IJSVGColor.h>
|
||||
#import <IJSVG/IJSVGCommand.h>
|
||||
#import <IJSVG/IJSVGDef.h>
|
||||
#import <IJSVG/IJSVGError.h>
|
||||
#import <IJSVG/IJSVGForeignObject.h>
|
||||
#import <IJSVG/IJSVGGroup.h>
|
||||
#import <IJSVG/IJSVGImage.h>
|
||||
#import <IJSVG/IJSVGLinearGradient.h>
|
||||
#import <IJSVG/IJSVGPath.h>
|
||||
#import <IJSVG/IJSVGPattern.h>
|
||||
#import <IJSVG/IJSVGRadialGradient.h>
|
||||
#import <IJSVG/IJSVGStyleSheet.h>
|
||||
#import <IJSVG/IJSVGText.h>
|
||||
#import <IJSVG/IJSVGTransform.h>
|
||||
#import <IJSVG/IJSVGUnitRect.h>
|
||||
#import <IJSVG/IJSVGUtils.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
extern NSString* const IJSVGAttributeViewBox;
|
||||
extern NSString* const IJSVGAttributeID;
|
||||
extern NSString* const IJSVGAttributeClass;
|
||||
extern NSString* const IJSVGAttributeX;
|
||||
extern NSString* const IJSVGAttributeY;
|
||||
extern NSString* const IJSVGAttributeWidth;
|
||||
extern NSString* const IJSVGAttributeHeight;
|
||||
extern NSString* const IJSVGAttributeOpacity;
|
||||
extern NSString* const IJSVGAttributeStrokeOpacity;
|
||||
extern NSString* const IJSVGAttributeStrokeWidth;
|
||||
extern NSString* const IJSVGAttributeStrokeDashOffset;
|
||||
extern NSString* const IJSVGAttributeFillOpacity;
|
||||
extern NSString* const IJSVGAttributeClipPath;
|
||||
extern NSString* const IJSVGAttributeMask;
|
||||
extern NSString* const IJSVGAttributeGradientUnits;
|
||||
extern NSString* const IJSVGAttributeMaskUnits;
|
||||
extern NSString* const IJSVGAttributeMaskContentUnits;
|
||||
extern NSString* const IJSVGAttributeTransform;
|
||||
extern NSString* const IJSVGAttributeGradientTransform;
|
||||
extern NSString* const IJSVGAttributeUnicode;
|
||||
extern NSString* const IJSVGAttributeStrokeLineCap;
|
||||
extern NSString* const IJSVGAttributeLineJoin;
|
||||
extern NSString* const IJSVGAttributeStroke;
|
||||
extern NSString* const IJSVGAttributeStrokeDashArray;
|
||||
extern NSString* const IJSVGAttributeFill;
|
||||
extern NSString* const IJSVGAttributeFillRule;
|
||||
extern NSString* const IJSVGAttributeBlendMode;
|
||||
extern NSString* const IJSVGAttributeDisplay;
|
||||
extern NSString* const IJSVGAttributeStyle;
|
||||
extern NSString* const IJSVGAttributeD;
|
||||
extern NSString* const IJSVGAttributeXLink;
|
||||
extern NSString* const IJSVGAttributeX1;
|
||||
extern NSString* const IJSVGAttributeX2;
|
||||
extern NSString* const IJSVGAttributeY1;
|
||||
extern NSString* const IJSVGAttributeY2;
|
||||
extern NSString* const IJSVGAttributeRX;
|
||||
extern NSString* const IJSVGAttributeRY;
|
||||
extern NSString* const IJSVGAttributeCX;
|
||||
extern NSString* const IJSVGAttributeCY;
|
||||
extern NSString* const IJSVGAttributeR;
|
||||
extern NSString* const IJSVGAttributeFX;
|
||||
extern NSString* const IJSVGAttributeFY;
|
||||
extern NSString* const IJSVGAttributePoints;
|
||||
extern NSString* const IJSVGAttributeOffset;
|
||||
extern NSString* const IJSVGAttributeStopColor;
|
||||
extern NSString* const IJSVGAttributeStopOpacity;
|
||||
extern NSString* const IJSVGAttributeHref;
|
||||
|
||||
|
||||
@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;
|
||||
|
||||
@end
|
||||
|
||||
@interface IJSVGParser : IJSVGGroup {
|
||||
|
||||
@private
|
||||
id<IJSVGParserDelegate> _delegate;
|
||||
NSXMLDocument* _document;
|
||||
NSMutableArray<IJSVGPath*>* _glyphs;
|
||||
IJSVGStyleSheet* _styleSheet;
|
||||
NSMutableDictionary<NSString*, NSXMLElement*>* _defNodes;
|
||||
NSMutableDictionary<NSString*, NSXMLElement*>* _baseDefNodes;
|
||||
NSMutableArray<IJSVG*>* _svgs;
|
||||
|
||||
struct {
|
||||
unsigned int shouldHandleForeignObject : 1;
|
||||
unsigned int handleForeignObject : 1;
|
||||
unsigned int handleSubSVG : 1;
|
||||
} _respondsTo;
|
||||
|
||||
IJSVGPathDataStream* _commandDataStream;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSRect viewBox;
|
||||
@property (nonatomic, readonly) IJSVGUnitSize* intrinsicSize;
|
||||
|
||||
+ (BOOL)isDataSVG:(NSData*)data;
|
||||
|
||||
- (id)initWithSVGString:(NSString*)string
|
||||
error:(NSError**)error
|
||||
delegate:(id<IJSVGParserDelegate>)delegate;
|
||||
|
||||
- (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;
|
||||
- (NSSize)size;
|
||||
- (BOOL)isFont;
|
||||
- (NSArray*)glyphs;
|
||||
- (NSArray<IJSVG*>*)subSVGs:(BOOL)recursive;
|
||||
|
||||
@end
|
||||
@@ -9,10 +9,84 @@
|
||||
#import "IJSVG.h"
|
||||
#import "IJSVGParser.h"
|
||||
|
||||
NSString* const IJSVGAttributeViewBox = @"viewBox";
|
||||
NSString* const IJSVGAttributeID = @"id";
|
||||
NSString* const IJSVGAttributeClass = @"class";
|
||||
NSString* const IJSVGAttributeX = @"x";
|
||||
NSString* const IJSVGAttributeY = @"y";
|
||||
NSString* const IJSVGAttributeWidth = @"width";
|
||||
NSString* const IJSVGAttributeHeight = @"height";
|
||||
NSString* const IJSVGAttributeOpacity = @"opacity";
|
||||
NSString* const IJSVGAttributeStrokeOpacity = @"stroke-opacity";
|
||||
NSString* const IJSVGAttributeStrokeWidth = @"stroke-width";
|
||||
NSString* const IJSVGAttributeStrokeDashOffset = @"stroke-dashoffset";
|
||||
NSString* const IJSVGAttributeFillOpacity = @"fill-opacity";
|
||||
NSString* const IJSVGAttributeClipPath = @"clip-path";
|
||||
NSString* const IJSVGAttributeMask = @"mask";
|
||||
NSString* const IJSVGAttributeGradientUnits = @"gradientUnits";
|
||||
NSString* const IJSVGAttributeMaskUnits = @"maskUnits";
|
||||
NSString* const IJSVGAttributeMaskContentUnits = @"maskContentUnits";
|
||||
NSString* const IJSVGAttributeTransform = @"transform";
|
||||
NSString* const IJSVGAttributeGradientTransform = @"gradientTransform";
|
||||
NSString* const IJSVGAttributeUnicode = @"unicode";
|
||||
NSString* const IJSVGAttributeStrokeLineCap = @"stroke-linecap";
|
||||
NSString* const IJSVGAttributeLineJoin = @"stroke-linejoin";
|
||||
NSString* const IJSVGAttributeStroke = @"stroke";
|
||||
NSString* const IJSVGAttributeStrokeDashArray = @"stroke-dasharray";
|
||||
NSString* const IJSVGAttributeFill = @"fill";
|
||||
NSString* const IJSVGAttributeFillRule = @"fill-rule";
|
||||
NSString* const IJSVGAttributeBlendMode = @"mix-blend-mode";
|
||||
NSString* const IJSVGAttributeDisplay = @"display";
|
||||
NSString* const IJSVGAttributeStyle = @"style";
|
||||
NSString* const IJSVGAttributeD = @"d";
|
||||
NSString* const IJSVGAttributeXLink = @"xlink:href";
|
||||
NSString* const IJSVGAttributeX1 = @"x1";
|
||||
NSString* const IJSVGAttributeX2 = @"x2";
|
||||
NSString* const IJSVGAttributeY1 = @"y1";
|
||||
NSString* const IJSVGAttributeY2 = @"y2";
|
||||
NSString* const IJSVGAttributeRX = @"rx";
|
||||
NSString* const IJSVGAttributeRY = @"ry";
|
||||
NSString* const IJSVGAttributeCX = @"cx";
|
||||
NSString* const IJSVGAttributeCY = @"cy";
|
||||
NSString* const IJSVGAttributeR = @"r";
|
||||
NSString* const IJSVGAttributeFX = @"fx";
|
||||
NSString* const IJSVGAttributeFY = @"fy";
|
||||
NSString* const IJSVGAttributePoints = @"points";
|
||||
NSString* const IJSVGAttributeOffset = @"offset";
|
||||
NSString* const IJSVGAttributeStopColor = @"stop-color";
|
||||
NSString* const IJSVGAttributeStopOpacity = @"stop-opacity";
|
||||
NSString* const IJSVGAttributeHref = @"href";
|
||||
|
||||
@implementation IJSVGParser
|
||||
|
||||
@synthesize viewBox;
|
||||
@synthesize proposedViewSize;
|
||||
static NSDictionary* _IJSVGAttributeDictionaryFloats = nil;
|
||||
static NSDictionary* _IJSVGAttributeDictionaryNodes = nil;
|
||||
static NSDictionary* _IJSVGAttributeDictionaryUnits = nil;
|
||||
static NSDictionary* _IJSVGAttributeDictionaryTransforms = nil;
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
_IJSVGAttributeDictionaryFloats = [@{
|
||||
IJSVGAttributeX : @"x",
|
||||
IJSVGAttributeY : @"y",
|
||||
IJSVGAttributeWidth : @"width",
|
||||
IJSVGAttributeHeight : @"height",
|
||||
IJSVGAttributeOpacity : @"opacity",
|
||||
IJSVGAttributeStrokeOpacity : @"strokeOpacity",
|
||||
IJSVGAttributeStrokeWidth : @"strokeWidth",
|
||||
IJSVGAttributeStrokeDashOffset : @"strokeDashOffset",
|
||||
IJSVGAttributeFillOpacity : @"fillOpacity" } retain];
|
||||
_IJSVGAttributeDictionaryNodes = [@{
|
||||
IJSVGAttributeClipPath : @"clipPath",
|
||||
IJSVGAttributeMask : @"mask" } retain];
|
||||
_IJSVGAttributeDictionaryUnits = [@{
|
||||
IJSVGAttributeGradientUnits : @"units",
|
||||
IJSVGAttributeMaskUnits : @"units",
|
||||
IJSVGAttributeMaskContentUnits : @"contentUnits"} retain];
|
||||
_IJSVGAttributeDictionaryTransforms = [@{
|
||||
IJSVGAttributeTransform : @"transforms",
|
||||
IJSVGAttributeGradientTransform : @"transforms" } retain];
|
||||
}
|
||||
|
||||
+ (IJSVGParser*)groupForFileURL:(NSURL*)aURL
|
||||
{
|
||||
@@ -42,11 +116,13 @@
|
||||
{
|
||||
(void)([_glyphs release]), _glyphs = nil;
|
||||
(void)([_styleSheet release]), _styleSheet = nil;
|
||||
(void)([_parsedNodes release]), _parsedNodes = nil;
|
||||
(void)([_defNodes release]), _defNodes = nil;
|
||||
(void)([_baseDefNodes release]), _baseDefNodes = nil;
|
||||
(void)([_definedGroups release]), _definedGroups = nil;
|
||||
(void)([_svgs release]), _svgs = nil;
|
||||
(void)([_intrinsicSize release]), _intrinsicSize = nil;
|
||||
if (_commandDataStream != NULL) {
|
||||
(void)IJSVGPathDataStreamRelease(_commandDataStream), _commandDataStream = nil;
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -61,11 +137,8 @@
|
||||
_respondsTo.shouldHandleForeignObject = [_delegate respondsToSelector:@selector(svgParser:shouldHandleForeignObject:)];
|
||||
_respondsTo.handleSubSVG = [_delegate respondsToSelector:@selector(svgParser:foundSubSVG:withSVGString:)];
|
||||
|
||||
_glyphs = [[NSMutableArray alloc] init];
|
||||
_parsedNodes = [[NSMutableArray alloc] init];
|
||||
_commandDataStream = IJSVGPathDataStreamCreateDefault();
|
||||
_defNodes = [[NSMutableDictionary alloc] init];
|
||||
_baseDefNodes = [[NSMutableDictionary alloc] init];
|
||||
_svgs = [[NSMutableArray alloc] init];
|
||||
|
||||
// load the document / file, assume its UTF8
|
||||
|
||||
@@ -178,7 +251,7 @@
|
||||
|
||||
- (NSSize)size
|
||||
{
|
||||
return viewBox.size;
|
||||
return _viewBox.size;
|
||||
}
|
||||
|
||||
- (void)_parse
|
||||
@@ -192,35 +265,47 @@
|
||||
|
||||
// find the sizebox!
|
||||
NSXMLNode* attribute = nil;
|
||||
if ((attribute = [svgElement attributeForName:(NSString*)IJSVGAttributeViewBox]) != nil) {
|
||||
if ((attribute = [svgElement attributeForName:IJSVGAttributeViewBox]) != nil) {
|
||||
// we have a viewbox...
|
||||
CGFloat* box = [IJSVGUtils parseViewBox:[attribute stringValue]];
|
||||
viewBox = NSMakeRect(box[0], box[1], box[2], box[3]);
|
||||
free(box);
|
||||
CGFloat* box = [IJSVGUtils parseViewBox:attribute.stringValue];
|
||||
_viewBox = NSMakeRect(box[0], box[1], box[2], box[3]);
|
||||
(void)free(box);
|
||||
} else {
|
||||
// there is no view box so find the width and height
|
||||
CGFloat w = [svgElement attributeForName:(NSString*)IJSVGAttributeWidth].stringValue.floatValue;
|
||||
CGFloat h = [svgElement attributeForName:(NSString*)IJSVGAttributeHeight].stringValue.floatValue;
|
||||
NSString* wAtt = [svgElement attributeForName:IJSVGAttributeWidth].stringValue;
|
||||
NSString* hAtt = [svgElement attributeForName:IJSVGAttributeHeight].stringValue;
|
||||
IJSVGUnitLength* wLength = [IJSVGUnitLength unitWithString:wAtt];
|
||||
IJSVGUnitLength* hLength = [IJSVGUnitLength unitWithString:hAtt];
|
||||
|
||||
// its possible wlength or hlength are nil
|
||||
CGFloat w = wLength ? wLength.value : 0.f;
|
||||
CGFloat h = hLength ? hLength.value : 0.f;
|
||||
|
||||
if (h == 0.f && w != 0.f) {
|
||||
h = w;
|
||||
} else if (w == 0.f && h != 0.f) {
|
||||
w = h;
|
||||
}
|
||||
viewBox = NSMakeRect(0.f, 0.f, w, h);
|
||||
_viewBox = NSMakeRect(0.f, 0.f, w, h);
|
||||
}
|
||||
|
||||
// parse the width and height....
|
||||
CGFloat w = [svgElement attributeForName:(NSString*)IJSVGAttributeWidth].stringValue.floatValue;
|
||||
CGFloat h = [svgElement attributeForName:(NSString*)IJSVGAttributeHeight].stringValue.floatValue;
|
||||
if (w == 0.f && h == 0.f) {
|
||||
w = viewBox.size.width;
|
||||
h = viewBox.size.height;
|
||||
} else if (w == 0 && h != 0.f) {
|
||||
w = viewBox.size.width;
|
||||
} else if (h == 0 && w != 0.f) {
|
||||
h = viewBox.size.height;
|
||||
NSString* w = [svgElement attributeForName:IJSVGAttributeWidth].stringValue;
|
||||
NSString* h = [svgElement attributeForName:IJSVGAttributeHeight].stringValue;
|
||||
|
||||
// by default just the the width and height from the viewbox unless
|
||||
// specified otherwise
|
||||
IJSVGUnitLength* wl = [IJSVGUnitLength unitWithFloat:_viewBox.size.width];
|
||||
IJSVGUnitLength* hl = [IJSVGUnitLength unitWithFloat:_viewBox.size.height];
|
||||
if (w != nil) {
|
||||
wl = [IJSVGUnitLength unitWithString:w];
|
||||
}
|
||||
proposedViewSize = NSMakeSize(w, h);
|
||||
if (h != nil) {
|
||||
hl = [IJSVGUnitLength unitWithString:h];
|
||||
}
|
||||
|
||||
// store the width and height
|
||||
_intrinsicSize = [IJSVGUnitSize sizeWithWidth:wl height:hl].retain;
|
||||
|
||||
// the root element is SVG, so iterate over its children
|
||||
// recursively
|
||||
@@ -229,17 +314,10 @@
|
||||
intoGroup:self
|
||||
def:NO];
|
||||
|
||||
// now everything has been done we need to compute the style tree
|
||||
for (NSDictionary* dict in _parsedNodes) {
|
||||
[self _postParseElementForCommonAttributes:dict[@"element"]
|
||||
node:dict[@"node"]
|
||||
ignoreAttributes:nil];
|
||||
}
|
||||
|
||||
// dont need the style sheet or the parsed nodes as this point
|
||||
(void)([_styleSheet release]), _styleSheet = nil;
|
||||
(void)([_parsedNodes release]), _parsedNodes = nil;
|
||||
(void)([_defNodes release]), _defNodes = nil;
|
||||
(void)IJSVGPathDataStreamRelease(_commandDataStream), _commandDataStream = NULL;
|
||||
}
|
||||
|
||||
- (void)_postParseElementForCommonAttributes:(NSXMLElement*)element
|
||||
@@ -313,22 +391,13 @@
|
||||
}
|
||||
|
||||
// floats
|
||||
atts(@{ (NSString*)IJSVGAttributeX : @"x",
|
||||
(NSString*)IJSVGAttributeY : @"y",
|
||||
(NSString*)IJSVGAttributeWidth : @"width",
|
||||
(NSString*)IJSVGAttributeHeight : @"height",
|
||||
(NSString*)IJSVGAttributeOpacity : @"opacity",
|
||||
(NSString*)IJSVGAttributeStrokeOpacity : @"strokeOpacity",
|
||||
(NSString*)IJSVGAttributeStrokeWidth : @"strokeWidth",
|
||||
(NSString*)IJSVGAttributeStrokeDashOffset : @"strokeDashOffset",
|
||||
(NSString*)IJSVGAttributeFillOpacity : @"fillOpacity" },
|
||||
atts(_IJSVGAttributeDictionaryFloats,
|
||||
^id(NSString* value) {
|
||||
return [IJSVGUnitLength unitWithString:value];
|
||||
});
|
||||
|
||||
// nodes
|
||||
atts(@{ (NSString*)IJSVGAttributeClipPath : @"clipPath",
|
||||
(NSString*)IJSVGAttributeMask : @"mask" },
|
||||
atts(_IJSVGAttributeDictionaryNodes,
|
||||
^id(NSString* value) {
|
||||
NSString* url = [IJSVGUtils defURL:value];
|
||||
if (url != nil) {
|
||||
@@ -338,16 +407,13 @@
|
||||
});
|
||||
|
||||
// units
|
||||
atts(@{ (NSString*)IJSVGAttributeGradientUnits : @"units",
|
||||
(NSString*)IJSVGAttributeMaskUnits : @"units",
|
||||
(NSString*)IJSVGAttributeMaskContentUnits : @"contentUnits" },
|
||||
atts(_IJSVGAttributeDictionaryUnits,
|
||||
^id(NSString* value) {
|
||||
return @([IJSVGUtils unitTypeForString:value]);
|
||||
});
|
||||
|
||||
// transforms
|
||||
atts(@{ (NSString*)IJSVGAttributeTransform : @"transforms",
|
||||
(NSString*)IJSVGAttributeGradientTransform : @"transforms" },
|
||||
atts(_IJSVGAttributeDictionaryTransforms,
|
||||
^(NSString* value) {
|
||||
NSMutableArray* tempTransforms = [[[NSMutableArray alloc] init] autorelease];
|
||||
[tempTransforms addObjectsFromArray:[IJSVGTransform transformsForString:value]];
|
||||
@@ -414,7 +480,6 @@
|
||||
if (fillDefID != nil) {
|
||||
// find the object
|
||||
id obj = [self definedObjectForID:fillDefID];
|
||||
|
||||
// what type is it?
|
||||
if ([obj isKindOfClass:[IJSVGGradient class]]) {
|
||||
node.fillGradient = (IJSVGGradient*)obj;
|
||||
@@ -450,6 +515,43 @@
|
||||
node.shouldRender = NO;
|
||||
}
|
||||
});
|
||||
|
||||
// offset
|
||||
attr(IJSVGAttributeOffset, ^(NSString* value) {
|
||||
node.offset = [IJSVGUnitLength unitWithString:value];
|
||||
});
|
||||
|
||||
// stop-opacity
|
||||
attr(IJSVGAttributeStopOpacity, ^(NSString* value) {
|
||||
node.fillOpacity = [IJSVGUnitLength unitWithString:value];
|
||||
});
|
||||
|
||||
// stop-color
|
||||
attr(IJSVGAttributeStopColor, ^(NSString* value) {
|
||||
node.fillColor = [IJSVGColor colorFromString:value];
|
||||
if(node.fillOpacity.value != 1.f) {
|
||||
node.fillColor = [IJSVGColor changeAlphaOnColor:node.fillColor
|
||||
to:node.fillOpacity.value];
|
||||
}
|
||||
});
|
||||
|
||||
// is there a title or desc?
|
||||
for(NSXMLElement* childElement in element.children) {
|
||||
IJSVGNodeType type = [IJSVGNode typeForString:childElement.localName
|
||||
kind:childElement.kind];
|
||||
switch(type) {
|
||||
case IJSVGNodeTypeTitle: {
|
||||
node.title = childElement.stringValue;
|
||||
break;
|
||||
}
|
||||
case IJSVGNodeTypeDesc: {
|
||||
node.desc = childElement.stringValue;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (id)definedObjectForID:(NSString*)anID
|
||||
@@ -466,10 +568,6 @@
|
||||
[self _parseBaseBlock:parseElement
|
||||
intoGroup:group
|
||||
def:NO];
|
||||
if (_definedGroups == nil) {
|
||||
_definedGroups = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[_definedGroups addObject:group];
|
||||
return [group defForID:anID];
|
||||
}
|
||||
return nil;
|
||||
@@ -483,25 +581,28 @@
|
||||
|
||||
- (BOOL)isFont
|
||||
{
|
||||
return [_glyphs count] != 0;
|
||||
return _glyphs != nil && [_glyphs count] != 0;
|
||||
}
|
||||
|
||||
- (NSArray*)glyphs
|
||||
{
|
||||
return _glyphs;
|
||||
return _glyphs ?: @[];
|
||||
}
|
||||
|
||||
- (void)addSubSVG:(IJSVG*)anSVG
|
||||
{
|
||||
if (_svgs == nil) {
|
||||
_svgs = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[_svgs addObject:anSVG];
|
||||
}
|
||||
|
||||
- (NSArray<IJSVG*>*)subSVGs:(BOOL)recursive
|
||||
{
|
||||
if (recursive == NO) {
|
||||
return _svgs;
|
||||
return _svgs ?: @[];
|
||||
}
|
||||
NSMutableArray* svgs = [[[NSMutableArray alloc] init] autorelease];
|
||||
NSMutableArray<IJSVG*>* svgs = [[[NSMutableArray alloc] init] autorelease];
|
||||
for (IJSVG* anSVG in svgs) {
|
||||
[svgs addObject:anSVG];
|
||||
[svgs addObjectsFromArray:[anSVG subSVGs:recursive]];
|
||||
@@ -509,8 +610,11 @@
|
||||
return svgs;
|
||||
}
|
||||
|
||||
- (void)addGlyph:(IJSVGNode*)glyph
|
||||
- (void)addGlyph:(IJSVGPath*)glyph
|
||||
{
|
||||
if (_glyphs == nil) {
|
||||
_glyphs = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[_glyphs addObject:glyph];
|
||||
}
|
||||
|
||||
@@ -581,7 +685,10 @@
|
||||
default: {
|
||||
// just a default def, continue on, as we are a def element,
|
||||
// store these seperately to the default ID string ones
|
||||
NSString* defID = [childDef attributeForName:@"id"].stringValue;
|
||||
if (_baseDefNodes == nil) {
|
||||
_baseDefNodes = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
NSString* defID = [childDef attributeForName:IJSVGAttributeID].stringValue;
|
||||
if (defID != nil) {
|
||||
_baseDefNodes[defID] = childDef;
|
||||
}
|
||||
@@ -635,8 +742,8 @@
|
||||
// if its a sub svg, we can remove the attributes for x and y
|
||||
// this is required or it could go out of bounds before the exporter
|
||||
// hits the layers from the groups :)
|
||||
[element removeAttributeForName:@"x"];
|
||||
[element removeAttributeForName:@"y"];
|
||||
[element removeAttributeForName:IJSVGAttributeX];
|
||||
[element removeAttributeForName:IJSVGAttributeY];
|
||||
|
||||
// work out the SVG
|
||||
NSError* error = nil;
|
||||
@@ -668,8 +775,8 @@
|
||||
case IJSVGNodeTypeGlyph: {
|
||||
|
||||
// no path data
|
||||
if ([element attributeForName:(NSString*)IJSVGAttributeD] == nil ||
|
||||
[[element attributeForName:(NSString*)IJSVGAttributeD] stringValue].length == 0) {
|
||||
if ([element attributeForName:IJSVGAttributeD] == nil ||
|
||||
[[element attributeForName:IJSVGAttributeD] stringValue].length == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -685,14 +792,14 @@
|
||||
ignoreAttributes:nil];
|
||||
|
||||
// pass the commands for it
|
||||
[self _parsePathCommandData:[[element attributeForName:(NSString*)IJSVGAttributeD] stringValue]
|
||||
[self _parsePathCommandData:[[element attributeForName:IJSVGAttributeD] stringValue]
|
||||
intoPath:path];
|
||||
|
||||
// check the size...
|
||||
if (NSIsEmptyRect([path path].controlPointBounds)) {
|
||||
if (CGRectIsEmpty(path.controlPointBoundingBox) == YES) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// add the glyph
|
||||
[self addGlyph:path];
|
||||
break;
|
||||
@@ -750,7 +857,7 @@
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:path
|
||||
ignoreAttributes:nil];
|
||||
[self _parsePathCommandData:[[element attributeForName:(NSString*)IJSVGAttributeD] stringValue]
|
||||
[self _parsePathCommandData:[[element attributeForName:IJSVGAttributeD] stringValue]
|
||||
intoPath:path];
|
||||
|
||||
[parentGroup addDef:path];
|
||||
@@ -819,7 +926,7 @@
|
||||
[self _setupDefaultsForNode:path];
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:path
|
||||
ignoreAttributes:@[ @"x", @"y" ]];
|
||||
ignoreAttributes:@[ IJSVGAttributeX, IJSVGAttributeY ]];
|
||||
[parentGroup addDef:path];
|
||||
break;
|
||||
}
|
||||
@@ -891,7 +998,7 @@
|
||||
// use
|
||||
case IJSVGNodeTypeUse: {
|
||||
|
||||
NSString* xlink = [[element attributeForName:(NSString*)IJSVGAttributeXLink] stringValue];
|
||||
NSString* xlink = [[self resolveXLinkAttributeForElement:element] stringValue];
|
||||
NSString* xlinkID = [xlink substringFromIndex:1];
|
||||
IJSVGNode* node = [self definedObjectForID:xlinkID];
|
||||
|
||||
@@ -902,7 +1009,7 @@
|
||||
}
|
||||
|
||||
// due to this being a carbon clone, we need to clear the ID
|
||||
if ([element attributeForName:(NSString*)IJSVGAttributeID] == nil) {
|
||||
if ([element attributeForName:IJSVGAttributeID] == nil) {
|
||||
node.identifier = nil;
|
||||
}
|
||||
|
||||
@@ -914,8 +1021,8 @@
|
||||
node.intermediateParentNode = subGroup;
|
||||
|
||||
// is there a width and height?
|
||||
CGFloat x = [element attributeForName:(NSString*)IJSVGAttributeX].stringValue.floatValue;
|
||||
CGFloat y = [element attributeForName:(NSString*)IJSVGAttributeY].stringValue.floatValue;
|
||||
CGFloat x = [element attributeForName:IJSVGAttributeX].stringValue.floatValue;
|
||||
CGFloat y = [element attributeForName:IJSVGAttributeY].stringValue.floatValue;
|
||||
|
||||
// we need to add a transform to the subgroup
|
||||
subGroup.transforms = @[ [IJSVGTransform transformByTranslatingX:x y:y] ];
|
||||
@@ -928,17 +1035,30 @@
|
||||
// says ignore x, y, width, height and xlink:href...
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:node
|
||||
ignoreAttributes:@[ @"x", @"y", @"width",
|
||||
@"height", @"xlink:href" ]];
|
||||
ignoreAttributes:@[IJSVGAttributeX, IJSVGAttributeY,
|
||||
IJSVGAttributeWidth, IJSVGAttributeHeight,
|
||||
IJSVGAttributeXLink]];
|
||||
|
||||
[parentGroup addDef:node];
|
||||
break;
|
||||
}
|
||||
|
||||
// stop color
|
||||
case IJSVGNodeTypeStop: {
|
||||
IJSVGNode* node = [[[IJSVGNode alloc] init] autorelease];
|
||||
node.type = IJSVGNodeTypeStop;
|
||||
[self _setupDefaultsForNode:node];
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:node
|
||||
ignoreAttributes:nil];
|
||||
[parentGroup addChild:node];
|
||||
break;
|
||||
}
|
||||
|
||||
// linear gradient
|
||||
case IJSVGNodeTypeLinearGradient: {
|
||||
|
||||
NSString* xlink = [[element attributeForName:(NSString*)IJSVGAttributeXLink] stringValue];
|
||||
NSString* xlink = [[self resolveXLinkAttributeForElement:element] stringValue];
|
||||
NSString* xlinkID = [xlink substringFromIndex:1];
|
||||
NSXMLElement* referenceElement;
|
||||
IJSVGNode* node = [self definedObjectForID:xlinkID
|
||||
@@ -954,6 +1074,9 @@
|
||||
[self _parseElementForCommonAttributes:elementCopy
|
||||
node:grad
|
||||
ignoreAttributes:nil];
|
||||
[self _parseBlock:elementCopy
|
||||
intoGroup:grad
|
||||
def:NO];
|
||||
grad.gradient = [IJSVGLinearGradient parseGradient:elementCopy
|
||||
gradient:grad];
|
||||
[parentGroup addDef:grad];
|
||||
@@ -966,6 +1089,9 @@
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:gradient
|
||||
ignoreAttributes:nil];
|
||||
[self _parseBlock:element
|
||||
intoGroup:gradient
|
||||
def:NO];
|
||||
gradient.gradient = [IJSVGLinearGradient parseGradient:element
|
||||
gradient:gradient];
|
||||
[parentGroup addDef:gradient];
|
||||
@@ -975,7 +1101,7 @@
|
||||
// radial gradient
|
||||
case IJSVGNodeTypeRadialGradient: {
|
||||
|
||||
NSString* xlink = [[element attributeForName:(NSString*)IJSVGAttributeXLink] stringValue];
|
||||
NSString* xlink = [[self resolveXLinkAttributeForElement:element] stringValue];
|
||||
NSString* xlinkID = [xlink substringFromIndex:1];
|
||||
NSXMLElement* referenceElement;
|
||||
IJSVGNode* node = [self definedObjectForID:xlinkID
|
||||
@@ -991,6 +1117,9 @@
|
||||
[self _parseElementForCommonAttributes:elementCopy
|
||||
node:grad
|
||||
ignoreAttributes:nil];
|
||||
[self _parseBlock:elementCopy
|
||||
intoGroup:grad
|
||||
def:NO];
|
||||
grad.gradient = [IJSVGRadialGradient parseGradient:elementCopy
|
||||
gradient:grad];
|
||||
[parentGroup addDef:grad];
|
||||
@@ -1003,6 +1132,9 @@
|
||||
[self _parseElementForCommonAttributes:element
|
||||
node:gradient
|
||||
ignoreAttributes:nil];
|
||||
[self _parseBlock:element
|
||||
intoGroup:gradient
|
||||
def:NO];
|
||||
gradient.gradient = [IJSVGRadialGradient parseGradient:element
|
||||
gradient:gradient];
|
||||
[parentGroup addDef:gradient];
|
||||
@@ -1064,7 +1196,9 @@
|
||||
ignoreAttributes:nil];
|
||||
|
||||
// from base64
|
||||
[image loadFromBase64EncodedString:[[element attributeForName:(NSString*)IJSVGAttributeXLink] stringValue]];
|
||||
NSXMLNode* attributeNode = [self resolveXLinkAttributeForElement:element] ?:
|
||||
[element attributeForName:IJSVGAttributeHref];
|
||||
[image loadFromString:attributeNode.stringValue];
|
||||
|
||||
// add to parent
|
||||
[parentGroup addChild:image];
|
||||
@@ -1074,6 +1208,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSXMLNode*)resolveXLinkAttributeForElement:(NSXMLElement*)element
|
||||
{
|
||||
NSString* const namespaceURI = @"http://www.w3.org/1999/xlink";
|
||||
NSXMLNode* attributeNode = [element attributeForLocalName:IJSVGAttributeHref
|
||||
URI:namespaceURI];
|
||||
if (attributeNode == nil) {
|
||||
attributeNode = [element attributeForName:IJSVGAttributeXLink];
|
||||
}
|
||||
return attributeNode;
|
||||
}
|
||||
|
||||
- (NSXMLElement*)mergedElement:(NSXMLElement*)element
|
||||
withReferenceElement:(NSXMLElement*)reference
|
||||
{
|
||||
@@ -1103,70 +1248,71 @@
|
||||
|
||||
#pragma mark Parser stuff!
|
||||
|
||||
- (void)_parsePathCommandData:(NSString*)command
|
||||
intoPath:(IJSVGPath*)path
|
||||
- (void)_parsePathCommandDataBuffer:(const char*)buffer
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
// invalid command
|
||||
|
||||
if (command == nil || command.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSUInteger len = [command length];
|
||||
|
||||
// allocate memory for the string buffer for reading
|
||||
const char* buffer = [command cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
int defaultBufferSize = 200;
|
||||
int currentBufferSize = 0;
|
||||
int currentSize = defaultBufferSize;
|
||||
|
||||
unichar* commandBuffer = NULL;
|
||||
if (len != 0) {
|
||||
commandBuffer = (unichar*)calloc(defaultBufferSize, sizeof(unichar));
|
||||
}
|
||||
NSUInteger len = strlen(buffer);
|
||||
NSUInteger lastIndex = len - 1;
|
||||
|
||||
// make sure we plus 1 for the null byte
|
||||
char* charBuffer = (char*)malloc(sizeof(char)*(len + 1));
|
||||
NSInteger start = 0;
|
||||
IJSVGCommand* _currentCommand = nil;
|
||||
for (int i = 0; i < len; i++) {
|
||||
unichar currentChar = buffer[i];
|
||||
unichar nextChar = buffer[i + 1];
|
||||
|
||||
BOOL atEnd = i == len - 1;
|
||||
for (NSInteger i = 0; i < len; i++) {
|
||||
char nextChar = buffer[i + 1];
|
||||
BOOL atEnd = i == lastIndex;
|
||||
BOOL isStartCommand = IJSVGIsLegalCommandCharacter(nextChar);
|
||||
if ((currentBufferSize + 1) == currentSize) {
|
||||
currentSize += defaultBufferSize;
|
||||
commandBuffer = (unichar*)realloc(commandBuffer, sizeof(unichar) * currentSize);
|
||||
}
|
||||
commandBuffer[currentBufferSize++] = currentChar;
|
||||
if (isStartCommand == YES || atEnd == YES) {
|
||||
NSString* commandString = [NSString stringWithCharacters:commandBuffer
|
||||
length:currentBufferSize];
|
||||
|
||||
// copy memory from current buffer
|
||||
NSInteger index = ((i + 1) - start);
|
||||
memcpy(&charBuffer[0], &buffer[start], sizeof(char)*index);
|
||||
charBuffer[index] = '\0';
|
||||
|
||||
// create the command from the substring
|
||||
unsigned long length = index + 1;
|
||||
size_t mlength = sizeof(char)*length;
|
||||
char* commandString = (char*)malloc(mlength);
|
||||
memcpy(commandString, &charBuffer[0], mlength);
|
||||
|
||||
// reset start position
|
||||
start = (i + 1);
|
||||
|
||||
// previous command is actual subcommand
|
||||
IJSVGCommand* previousCommand = [_currentCommand subCommands].lastObject;
|
||||
IJSVGCommand* cCommand = [self _parseCommandString:commandString
|
||||
previousCommand:previousCommand
|
||||
intoPath:path];
|
||||
IJSVGCommand* previousCommand = _currentCommand.subCommands.lastObject;
|
||||
IJSVGCommand* cCommand = [self _parseCommandStringBuffer:commandString
|
||||
previousCommand:previousCommand
|
||||
intoPath:path];
|
||||
|
||||
// free the memory as at this point, we are done with it
|
||||
(void)free(commandString), commandString = NULL;
|
||||
|
||||
// retain the current one
|
||||
if (cCommand != nil) {
|
||||
_currentCommand = cCommand;
|
||||
}
|
||||
|
||||
if (atEnd == NO) {
|
||||
currentBufferSize = 0;
|
||||
memset(commandBuffer, '\0', sizeof(unichar) * currentSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// free the buffer
|
||||
free(commandBuffer);
|
||||
(void)free(charBuffer), charBuffer = NULL;
|
||||
}
|
||||
|
||||
- (IJSVGCommand*)_parseCommandString:(NSString*)string
|
||||
previousCommand:(IJSVGCommand*)previousCommand
|
||||
intoPath:(IJSVGPath*)path
|
||||
- (void)_parsePathCommandData:(NSString*)command
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
// invalid command
|
||||
if (command == nil || command.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// allocate memory for the string buffer for reading
|
||||
const char* buffer = command.UTF8String;
|
||||
[self _parsePathCommandDataBuffer:buffer
|
||||
intoPath:path];
|
||||
}
|
||||
|
||||
- (IJSVGCommand*)_parseCommandStringBuffer:(const char*)buffer
|
||||
previousCommand:(IJSVGCommand*)previousCommand
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
// work out the last command - the reason this is so long is because the command
|
||||
// could be a series of the same commands, so work it out by the number of parameters
|
||||
@@ -1178,9 +1324,11 @@
|
||||
|
||||
// main commands
|
||||
// Class commandClass = [IJSVGCommand classFor]
|
||||
Class commandClass = [IJSVGCommand commandClassForCommandChar:[string characterAtIndex:0]];
|
||||
IJSVGCommand* command = (IJSVGCommand*)[[[commandClass alloc] initWithCommandString:string] autorelease];
|
||||
for (IJSVGCommand* subCommand in [command subCommands]) {
|
||||
Class commandClass = [IJSVGCommand commandClassForCommandChar:buffer[0]];
|
||||
IJSVGCommand* command = nil;
|
||||
command = (IJSVGCommand*)[[[commandClass alloc] initWithCommandStringBuffer:buffer
|
||||
dataStream:_commandDataStream] autorelease];
|
||||
for (IJSVGCommand* subCommand in command.subCommands) {
|
||||
[command.class runWithParams:subCommand.parameters
|
||||
paramCount:subCommand.parameterCount
|
||||
command:subCommand
|
||||
@@ -1197,44 +1345,51 @@
|
||||
{
|
||||
// convert a line into a command,
|
||||
// basically MX1 Y1LX2 Y2
|
||||
CGFloat x1 = [element attributeForName:(NSString*)IJSVGAttributeX1].stringValue.floatValue;
|
||||
CGFloat y1 = [element attributeForName:(NSString*)IJSVGAttributeY1].stringValue.floatValue;
|
||||
CGFloat x2 = [element attributeForName:(NSString*)IJSVGAttributeX2].stringValue.floatValue;
|
||||
CGFloat y2 = [element attributeForName:(NSString*)IJSVGAttributeY2].stringValue.floatValue;
|
||||
path.primitiveType = kIJSVGPrimitivePathTypeLine;
|
||||
CGFloat x1 = [element attributeForName:IJSVGAttributeX1].stringValue.floatValue;
|
||||
CGFloat y1 = [element attributeForName:IJSVGAttributeY1].stringValue.floatValue;
|
||||
CGFloat x2 = [element attributeForName:IJSVGAttributeX2].stringValue.floatValue;
|
||||
CGFloat y2 = [element attributeForName:IJSVGAttributeY2].stringValue.floatValue;
|
||||
|
||||
// use sprintf as its quicker then stringWithFormat...
|
||||
char buffer[50];
|
||||
sprintf(buffer, "M%.2f %.2fL%.2f %.2f", x1, y1, x2, y2);
|
||||
NSString* command = [NSString stringWithCString:buffer
|
||||
encoding:NSUTF8StringEncoding];
|
||||
[self _parsePathCommandData:command
|
||||
intoPath:path];
|
||||
char* buffer;
|
||||
asprintf(&buffer, "M%.2f %.2fL%.2f %.2f", x1, y1, x2, y2);
|
||||
[self _parsePathCommandDataBuffer:buffer
|
||||
intoPath:path];
|
||||
(void)free(buffer);
|
||||
}
|
||||
|
||||
- (void)_parseCircle:(NSXMLElement*)element
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
CGFloat cX = [element attributeForName:(NSString*)IJSVGAttributeCX].stringValue.floatValue;
|
||||
CGFloat cY = [element attributeForName:(NSString*)IJSVGAttributeCY].stringValue.floatValue;
|
||||
CGFloat r = [element attributeForName:(NSString*)IJSVGAttributeR].stringValue.floatValue;
|
||||
NSRect rect = NSMakeRect(cX - r, cY - r, r * 2, r * 2);
|
||||
[path overwritePath:[NSBezierPath bezierPathWithOvalInRect:rect]];
|
||||
path.primitiveType = kIJSVGPrimitivePathTypeCircle;
|
||||
CGFloat cX = [element attributeForName:IJSVGAttributeCX].stringValue.floatValue;
|
||||
CGFloat cY = [element attributeForName:IJSVGAttributeCY].stringValue.floatValue;
|
||||
CGFloat r = [element attributeForName:IJSVGAttributeR].stringValue.floatValue;
|
||||
CGRect rect = CGRectMake(cX - r, cY - r, r * 2, r * 2);
|
||||
CGPathRef nPath = CGPathCreateWithEllipseInRect(rect, NULL);
|
||||
path.path = (CGMutablePathRef)nPath;
|
||||
CGPathRelease(nPath);
|
||||
}
|
||||
|
||||
- (void)_parseEllipse:(NSXMLElement*)element
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
CGFloat cX = [element attributeForName:(NSString*)IJSVGAttributeCX].stringValue.floatValue;
|
||||
CGFloat cY = [element attributeForName:(NSString*)IJSVGAttributeCY].stringValue.floatValue;
|
||||
CGFloat rX = [element attributeForName:(NSString*)IJSVGAttributeRX].stringValue.floatValue;
|
||||
CGFloat rY = [element attributeForName:(NSString*)IJSVGAttributeRY].stringValue.floatValue;
|
||||
path.primitiveType = kIJSVGPrimitivePathTypeEllipse;
|
||||
CGFloat cX = [element attributeForName:IJSVGAttributeCX].stringValue.floatValue;
|
||||
CGFloat cY = [element attributeForName:IJSVGAttributeCY].stringValue.floatValue;
|
||||
CGFloat rX = [element attributeForName:IJSVGAttributeRX].stringValue.floatValue;
|
||||
CGFloat rY = [element attributeForName:IJSVGAttributeRY].stringValue.floatValue;
|
||||
NSRect rect = NSMakeRect(cX - rX, cY - rY, rX * 2, rY * 2);
|
||||
[path overwritePath:[NSBezierPath bezierPathWithOvalInRect:rect]];
|
||||
CGPathRef nPath = CGPathCreateWithEllipseInRect(rect, NULL);
|
||||
path.path = (CGMutablePathRef)nPath;
|
||||
CGPathRelease(nPath);
|
||||
}
|
||||
|
||||
- (void)_parsePolyline:(NSXMLElement*)element
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
path.primitiveType = kIJSVGPrimitivePathTypePolyLine;
|
||||
[self _parsePoly:element
|
||||
intoPath:path
|
||||
closePath:NO];
|
||||
@@ -1243,6 +1398,7 @@
|
||||
- (void)_parsePolygon:(NSXMLElement*)element
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
path.primitiveType = kIJSVGPrimitivePathTypePolygon;
|
||||
[self _parsePoly:element
|
||||
intoPath:path
|
||||
closePath:YES];
|
||||
@@ -1252,58 +1408,88 @@
|
||||
intoPath:(IJSVGPath*)path
|
||||
closePath:(BOOL)closePath
|
||||
{
|
||||
NSString* points = [[element attributeForName:(NSString*)IJSVGAttributePoints] stringValue];
|
||||
NSString* points = [element attributeForName:IJSVGAttributePoints].stringValue;
|
||||
NSInteger count = 0;
|
||||
CGFloat* params = [IJSVGUtils commandParameters:points
|
||||
count:&count];
|
||||
|
||||
// error occured, free the params
|
||||
if ((count % 2) != 0) {
|
||||
// error occured, free the params
|
||||
free(params);
|
||||
return;
|
||||
}
|
||||
|
||||
// construct a command
|
||||
NSMutableString* str = [[[NSMutableString alloc] init] autorelease];
|
||||
[str appendFormat:@"M%f,%f L", params[0], params[1]];
|
||||
for (NSInteger i = 2; i < count; i += 2) {
|
||||
[str appendFormat:@"%f,%f ", params[i], params[i + 1]];
|
||||
|
||||
const int defBufferSize = 10;
|
||||
char* buffer;
|
||||
asprintf(&buffer, "M%f %f L", params[0], params[1]);
|
||||
|
||||
// compute a default buffer - bSize is strlen + 1 for null byte
|
||||
size_t bSize = strlen(buffer) + 1;
|
||||
size_t strLength = bSize - 1;
|
||||
|
||||
// for every pair of coordinates
|
||||
for(int i = 2; i < count; i+= 2) {
|
||||
char* subbuf;
|
||||
asprintf(&subbuf, "%f %f ", params[i], params[i + 1]);
|
||||
size_t sSize = strlen(subbuf);
|
||||
|
||||
// if the new size of the string is large than the buffer
|
||||
// increase the buffer up another def size - note, we always
|
||||
// plus 2 incase the close path needs to be appended on the end
|
||||
if((strLength + sSize + 2) > bSize) {
|
||||
size_t nLength = MAX(sSize, defBufferSize) + 2;
|
||||
buffer = realloc(buffer, sizeof(char)*(bSize+nLength));
|
||||
bSize += nLength;
|
||||
}
|
||||
|
||||
// append the string onto the buffer, increment the
|
||||
// string length and free the subbuffer memory
|
||||
strcat(buffer, subbuf);
|
||||
strLength += sSize;
|
||||
(void)free(subbuf), subbuf = NULL;
|
||||
}
|
||||
if (closePath) {
|
||||
[str appendString:@"z"];
|
||||
|
||||
// append the close path if required
|
||||
if(closePath == YES) {
|
||||
strcat(buffer, "z");
|
||||
}
|
||||
[self _parsePathCommandData:str
|
||||
intoPath:path];
|
||||
free(params);
|
||||
|
||||
// actually perform the parse
|
||||
[self _parsePathCommandDataBuffer:buffer
|
||||
intoPath:path];
|
||||
|
||||
// free the params
|
||||
(void)free(buffer), buffer = NULL;
|
||||
(void)free(params), params = NULL;
|
||||
}
|
||||
|
||||
- (void)_parseRect:(NSXMLElement*)element
|
||||
intoPath:(IJSVGPath*)path
|
||||
{
|
||||
|
||||
path.primitiveType = kIJSVGPrimitivePathTypeRect;
|
||||
// width and height
|
||||
CGFloat width = [IJSVGUtils floatValue:[[element attributeForName:(NSString*)IJSVGAttributeWidth] stringValue]
|
||||
CGFloat width = [IJSVGUtils floatValue:[element attributeForName:IJSVGAttributeWidth].stringValue
|
||||
fallBackForPercent:self.viewBox.size.width];
|
||||
|
||||
CGFloat height = [IJSVGUtils floatValue:[[element attributeForName:(NSString*)IJSVGAttributeHeight] stringValue]
|
||||
CGFloat height = [IJSVGUtils floatValue:[element attributeForName:IJSVGAttributeHeight].stringValue
|
||||
fallBackForPercent:self.viewBox.size.height];
|
||||
|
||||
// rect uses x and y as start of path, not move path object -_-
|
||||
CGFloat x = [IJSVGUtils floatValue:[[element attributeForName:(NSString*)IJSVGAttributeX] stringValue]
|
||||
CGFloat x = [IJSVGUtils floatValue:[element attributeForName:IJSVGAttributeX].stringValue
|
||||
fallBackForPercent:self.viewBox.size.width];
|
||||
CGFloat y = [IJSVGUtils floatValue:[[element attributeForName:(NSString*)IJSVGAttributeY] stringValue]
|
||||
CGFloat y = [IJSVGUtils floatValue:[element attributeForName:IJSVGAttributeY].stringValue
|
||||
fallBackForPercent:self.viewBox.size.height];
|
||||
|
||||
// radius
|
||||
CGFloat rX = [element attributeForName:(NSString*)IJSVGAttributeRX].stringValue.floatValue;
|
||||
CGFloat rY = [element attributeForName:(NSString*)IJSVGAttributeRY].stringValue.floatValue;
|
||||
if ([element attributeForName:(NSString*)IJSVGAttributeRY] == nil) {
|
||||
CGFloat rX = [element attributeForName:IJSVGAttributeRX].stringValue.floatValue;
|
||||
CGFloat rY = [element attributeForName:IJSVGAttributeRY].stringValue.floatValue;
|
||||
if ([element attributeForName:IJSVGAttributeRY] == nil) {
|
||||
rY = rX;
|
||||
}
|
||||
|
||||
NSBezierPath* newPath = [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(x, y, width, height)
|
||||
xRadius:rX
|
||||
yRadius:rY];
|
||||
[path overwritePath:newPath];
|
||||
CGRect rect = CGRectMake(x, y, width, height);
|
||||
CGPathRef nPath = CGPathCreateWithRoundedRect(rect, rX, rY, NULL);
|
||||
path.path = (CGMutablePathRef)nPath;
|
||||
CGPathRelease(nPath);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2016 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGNode.h"
|
||||
#import "IJSVGRenderingStyle.h"
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <IJSVG/IJSVGRenderingStyle.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@class IJSVGLayer;
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
@implementation IJSVGLayerTree
|
||||
|
||||
@synthesize viewBox;
|
||||
@synthesize style = _style;
|
||||
|
||||
- (void)dealloc
|
||||
@@ -74,59 +73,40 @@
|
||||
|
||||
{
|
||||
// any x and y?
|
||||
CGFloat x = [node.x computeValue:layer.frame.size.width];
|
||||
CGFloat y = [node.y computeValue:layer.frame.size.height];
|
||||
CGRect frame = layer.bounds;
|
||||
CGFloat x = [node.x computeValue:frame.size.width];
|
||||
CGFloat y = [node.y computeValue:frame.size.height];
|
||||
|
||||
// do some magic transform
|
||||
// no need to do anything if no transform, or x or y == 0
|
||||
if (transforms.count == 0 && x == 0.f && y == 0.f) {
|
||||
return layer;
|
||||
}
|
||||
|
||||
// simply cascade all the transforms onto the identity
|
||||
CGAffineTransform identity = CGAffineTransformIdentity;
|
||||
if (x != 0.f || y != 0.f) {
|
||||
// we must add translate to the stack
|
||||
NSMutableArray* trans = nil;
|
||||
if (transforms != nil) {
|
||||
trans = [[transforms mutableCopy] autorelease];
|
||||
} else {
|
||||
trans = [[[NSMutableArray alloc] initWithCapacity:1] autorelease];
|
||||
}
|
||||
[trans addObject:[IJSVGTransform transformByTranslatingX:x y:y]];
|
||||
transforms = trans;
|
||||
identity = CGAffineTransformTranslate(identity, x, y);
|
||||
}
|
||||
|
||||
// add any transforms
|
||||
IJSVGLayer* topLayer = nil;
|
||||
IJSVGLayer* parentLayer = nil;
|
||||
|
||||
for (IJSVGTransform* transform in transforms) {
|
||||
// make sure we apply the transform to the parent
|
||||
// so they stack
|
||||
IJSVGGroupLayer* childLayer = [[[IJSVGGroupLayer alloc] init] autorelease];
|
||||
childLayer.affineTransform = transform.CGAffineTransform;
|
||||
|
||||
// add it to the parent layer
|
||||
if (parentLayer != nil) {
|
||||
[parentLayer addSublayer:childLayer];
|
||||
} else {
|
||||
// make sure we keep track of the top most layer
|
||||
topLayer = childLayer;
|
||||
}
|
||||
|
||||
// reset parent layer to the new child
|
||||
parentLayer = childLayer;
|
||||
|
||||
// this used to be done with each transform being added to its own
|
||||
// group layer, but we can simply use one and then apply
|
||||
// the transforms in reverse order, has same outcome with less memory
|
||||
IJSVGGroupLayer* parentLayer = [[[IJSVGGroupLayer alloc] init] autorelease];
|
||||
for(IJSVGTransform* transform in transforms.reverseObjectEnumerator) {
|
||||
identity = CGAffineTransformConcat(identity, transform.CGAffineTransform);
|
||||
}
|
||||
|
||||
// swap the layer around
|
||||
parentLayer.affineTransform = identity;
|
||||
[parentLayer addSublayer:layer];
|
||||
layer = topLayer;
|
||||
return layer;
|
||||
return parentLayer;
|
||||
}
|
||||
|
||||
- (void)applyDefaultsToLayer:(IJSVGLayer*)layer
|
||||
fromNode:(IJSVGNode*)node
|
||||
{
|
||||
CGFloat opacity = node.opacity.value;
|
||||
layer.opacity = opacity;
|
||||
if(opacity != 1.f) {
|
||||
layer.opacity = opacity;
|
||||
}
|
||||
|
||||
// setup the blending mode
|
||||
if (node.blendMode != IJSVGBlendModeNormal) {
|
||||
@@ -164,14 +144,15 @@
|
||||
}
|
||||
|
||||
IJSVGGroupLayer* groupLayer = [[[IJSVGGroupLayer alloc] init] autorelease];
|
||||
for (IJSVGNode* node in group.children) {
|
||||
for (IJSVGNode* node in group.childNodes) {
|
||||
[groupLayer addSublayer:[self layerForNode:node]];
|
||||
}
|
||||
groupLayer.frame = (CGRect){
|
||||
groupLayer.frame = (CGRect) {
|
||||
.origin = CGPointZero,
|
||||
.size = (CGSize){
|
||||
.size = (CGSize) {
|
||||
.width = group.width.value,
|
||||
.height = group.height.value }
|
||||
.height = group.height.value
|
||||
}
|
||||
};
|
||||
|
||||
// mask it - forgot groups can have masks too, doh! simple
|
||||
@@ -203,7 +184,8 @@
|
||||
{
|
||||
// setup path and layer
|
||||
IJSVGShapeLayer* layer = [[[IJSVGShapeLayer alloc] init] autorelease];
|
||||
CGPathRef introPath = path.CGPath;
|
||||
layer.primitiveType = path.primitiveType;
|
||||
CGPathRef introPath = path.path;
|
||||
|
||||
*originalBoundingBox = CGRectIntegral(CGPathGetBoundingBox(introPath));
|
||||
layer.originalPathOrigin = (*originalBoundingBox).origin;
|
||||
@@ -298,9 +280,14 @@
|
||||
NSColor* fColor = path.fillColor;
|
||||
BOOL hasColor = (fColor.alphaComponent == 0.f || fColor == nil) == NO;
|
||||
BOOL hasFill = path.fillPattern != nil || path.fillGradient != nil;
|
||||
|
||||
// is there an overriding style in the sheet?
|
||||
if (_style.fillColor && (hasFill || hasColor || fColor == nil)) {
|
||||
fColor = _style.fillColor;
|
||||
} else if (fColor != nil && path.fillOpacity.value != 1.f) {
|
||||
}
|
||||
|
||||
// if there is a color, change the opacity if required
|
||||
if (fColor != nil && path.fillOpacity.value != 1.f) {
|
||||
fColor = [IJSVGColor changeAlphaOnColor:fColor
|
||||
to:path.fillOpacity.value];
|
||||
}
|
||||
@@ -441,7 +428,7 @@
|
||||
// the gradient drawing layer
|
||||
gradient.colorList = _style.colorList;
|
||||
IJSVGGradientLayer* gradLayer = [[[IJSVGGradientLayer alloc] init] autorelease];
|
||||
gradLayer.viewBox = self.viewBox;
|
||||
gradLayer.viewBox = _viewBox;
|
||||
gradLayer.frame = layer.bounds;
|
||||
gradLayer.gradient = gradient;
|
||||
gradLayer.absoluteTransform = [self absoluteTransform:path];
|
||||
@@ -602,7 +589,9 @@
|
||||
|
||||
// dashing
|
||||
strokeLayer.lineDashPhase = path.strokeDashOffset.value;
|
||||
strokeLayer.lineDashPattern = [self lineDashPattern:path];
|
||||
if(path.strokeDashArrayCount != 0.f) {
|
||||
strokeLayer.lineDashPattern = [self lineDashPattern:path];
|
||||
}
|
||||
|
||||
return strokeLayer;
|
||||
}
|
||||
@@ -622,8 +611,6 @@
|
||||
if (node.clipPath.units == IJSVGUnitObjectBoundingBox) {
|
||||
[self adjustLayer:clip
|
||||
toParentLayerFrame:layer];
|
||||
} else {
|
||||
clip.affineTransform = [self absoluteTransform:node];
|
||||
}
|
||||
|
||||
// add the layer
|
||||
@@ -638,8 +625,6 @@
|
||||
if (node.mask.units == IJSVGUnitObjectBoundingBox) {
|
||||
[self adjustLayer:mask
|
||||
toParentLayerFrame:layer];
|
||||
} else {
|
||||
mask.affineTransform = [self absoluteTransform:node];
|
||||
}
|
||||
|
||||
// add the layer
|
||||
@@ -647,8 +632,9 @@
|
||||
}
|
||||
|
||||
// recursive colourize for each item
|
||||
NSColor* color = [IJSVGColor computeColorSpace:NSColor.whiteColor];
|
||||
[self _recursiveColorLayersFromLayer:maskLayer
|
||||
withColor:[IJSVGColor computeColorSpace:NSColor.whiteColor].CGColor];
|
||||
withColor:color.CGColor];
|
||||
|
||||
// add the mask
|
||||
layer.mask = maskLayer;
|
||||
@@ -691,69 +677,54 @@
|
||||
|
||||
- (NSArray<NSNumber*>*)lineDashPattern:(IJSVGNode*)node
|
||||
{
|
||||
NSMutableArray* arr = [[[NSMutableArray alloc] init] autorelease];
|
||||
NSMutableArray* arr = [[[NSMutableArray alloc] initWithCapacity:node.strokeDashArrayCount] autorelease];
|
||||
for (NSInteger i = 0; i < node.strokeDashArrayCount; i++) {
|
||||
[arr addObject:@((CGFloat)node.strokeDashArray[i])];
|
||||
}
|
||||
return [[arr copy] autorelease];
|
||||
return arr;
|
||||
}
|
||||
|
||||
- (NSString*)lineJoin:(IJSVGLineJoinStyle)joinStyle
|
||||
{
|
||||
switch (joinStyle) {
|
||||
default:
|
||||
case IJSVGLineJoinStyleMiter: {
|
||||
return kCALineJoinMiter;
|
||||
}
|
||||
case IJSVGLineJoinStyleBevel: {
|
||||
return kCALineJoinBevel;
|
||||
}
|
||||
case IJSVGLineJoinStyleRound: {
|
||||
return kCALineJoinRound;
|
||||
}
|
||||
default:
|
||||
case IJSVGLineJoinStyleMiter: {
|
||||
return kCALineJoinMiter;
|
||||
}
|
||||
case IJSVGLineJoinStyleBevel: {
|
||||
return kCALineJoinBevel;
|
||||
}
|
||||
case IJSVGLineJoinStyleRound: {
|
||||
return kCALineJoinRound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)lineCap:(IJSVGLineCapStyle)capStyle
|
||||
{
|
||||
switch (capStyle) {
|
||||
default:
|
||||
case IJSVGLineCapStyleButt: {
|
||||
return kCALineCapButt;
|
||||
}
|
||||
case IJSVGLineCapStyleRound: {
|
||||
return kCALineCapRound;
|
||||
}
|
||||
case IJSVGLineCapStyleSquare: {
|
||||
return kCALineCapSquare;
|
||||
}
|
||||
default:
|
||||
case IJSVGLineCapStyleButt: {
|
||||
return kCALineCapButt;
|
||||
}
|
||||
case IJSVGLineCapStyleRound: {
|
||||
return kCALineCapRound;
|
||||
}
|
||||
case IJSVGLineCapStyleSquare: {
|
||||
return kCALineCapSquare;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*)fillRule:(IJSVGWindingRule)rule
|
||||
{
|
||||
switch (rule) {
|
||||
case IJSVGWindingRuleEvenOdd: {
|
||||
return kCAFillRuleEvenOdd;
|
||||
}
|
||||
default: {
|
||||
return kCAFillRuleNonZero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)log:(IJSVGLayer*)layer
|
||||
depth:(NSInteger)depth
|
||||
{
|
||||
NSLog(@"%@%@: %@, Transforms: %@", [@"" stringByPaddingToLength:depth
|
||||
withString:@"\t"
|
||||
startingAtIndex:0],
|
||||
layer,
|
||||
NSStringFromRect(layer.frame),
|
||||
[IJSVGTransform affineTransformToSVGTransformAttributeString:layer.affineTransform]);
|
||||
for (IJSVGLayer* sublayer in layer.sublayers) {
|
||||
[self log:(IJSVGLayer*)sublayer
|
||||
depth:depth++];
|
||||
case IJSVGWindingRuleEvenOdd: {
|
||||
return kCAFillRuleEvenOdd;
|
||||
}
|
||||
default: {
|
||||
return kCAFillRuleNonZero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
typedef CGFloat (^IJSVGRenderingBackingScaleFactorHelper)(void);
|
||||
|
||||
typedef NS_ENUM(NSInteger, IJSVGRenderQuality) {
|
||||
IJSVGRenderQualityFullResolution, // slowest to render
|
||||
IJSVGRenderQualityOptimized, // best of both worlds
|
||||
IJSVGRenderQualityLow // fast rendering
|
||||
kIJSVGRenderQualityFullResolution, // slowest to render
|
||||
kIJSVGRenderQualityOptimized, // best of both worlds
|
||||
kIJSVGRenderQualityLow // fast rendering
|
||||
};
|
||||
|
||||
@interface IJSVGRendering : NSObject
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2019 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGColorList.h"
|
||||
#import "IJSVGNode.h"
|
||||
#import <IJSVG/IJSVGColorList.h>
|
||||
#import <IJSVG/IJSVGNode.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <objc/runtime.h>
|
||||
-7
@@ -10,13 +10,6 @@
|
||||
|
||||
@implementation IJSVGRenderingStyle
|
||||
|
||||
@synthesize colorList = _colorList;
|
||||
@synthesize lineCapStyle = _lineCapStyle;
|
||||
@synthesize lineJoinStyle = _lineJoinStyle;
|
||||
@synthesize lineWidth = _lineWidth;
|
||||
@synthesize fillColor = _fillColor;
|
||||
@synthesize strokeColor = _strokeColor;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([_fillColor release]), _fillColor = nil;
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGColor.h"
|
||||
#import <IJSVG/IJSVGColor.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IJSVGStyle : NSObject {
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
// Copyright © 2016 Curtis Hard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IJSVGStyleSheetRule.h"
|
||||
#import "IJSVGStyleSheetSelector.h"
|
||||
#import <IJSVG/IJSVGStyleSheetRule.h>
|
||||
#import <IJSVG/IJSVGStyleSheetSelector.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class IJSVGNode;
|
||||
+2
-6
@@ -11,9 +11,6 @@
|
||||
#import "IJSVGStyleSheet.h"
|
||||
|
||||
@interface IJSVGStyleSheetSelectorListItem : NSObject {
|
||||
|
||||
IJSVGStyleSheetSelector* selector;
|
||||
IJSVGStyleSheetRule* rule;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IJSVGStyleSheetRule* rule;
|
||||
@@ -23,12 +20,11 @@
|
||||
|
||||
@implementation IJSVGStyleSheetSelectorListItem
|
||||
|
||||
@synthesize rule, selector;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
(void)([rule release]), rule = nil;
|
||||
(void)([selector release]), selector = nil;
|
||||
(void)([_rule release]), _rule = nil;
|
||||
(void)([_selector release]), _selector = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user