@react-native-ohos/react-native-svg 15.0.2-rc.5 → 15.12.1-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.OpenSource +11 -0
- package/README.md +13 -0
- package/harmony/svg/BuildProfile.ets +17 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/.ts_checker_cache +3052 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo +1 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/.tsbuildinfo.linter +1 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/compileInfo.json +1 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSVGImageModule.ts-7c464e69f4a700eeeaae44cf66ca5fd3b3e84299010d5c3a5643612ba1a48d70.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSVGRenderableModule.ts-c2df5206c2aa9e868b7f24f706a131fff1236faaff78688ffdeec3ce25bf5d91.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/RNSVGSvgViewModule.ts-b9a699770b693eeaa2eb98307323dc9087e44afc9c01b08d222555636b3fac0d.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/SvgPackage.ts-08ac57d81b1742792af8813eac27abe5eca1a5714b1a5b76f97436b13abe48e4.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/index.ets-0e520bf323178f6f973ec12f44622042dcdd19e5032efd9bd02ac5606fb58275.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/modules/ts.ts-1d50b47087f159616212dd3c5ecd04a204a5be09940b7dbba77a59e3a66499c2.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/other/pkgName2SourceRoots.msgpack +1 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/compiler.cache/plugins/plugins.msgpack +0 -0
- package/harmony/svg/build/default/cache/default/default@HarCompileArkTS/esmodule/debug/dep_info.json +1 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/BuildProfile.ets +17 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/ResourceTable.txt +1 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/build-profile.json5 +9 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/hvigorfile.ts +2 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/index.ets +7 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/oh-package-lock.json5 +19 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/oh-package.json5 +1 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/Attribute.h +52 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/CMakeLists.txt +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/FallbackProps.h +0 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/FontHolderBase.cpp +22 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/FontHolderBase.h +54 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SVGPackage.cpp +135 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SVGPackage.h +157 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgArkUINode.cpp +78 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgArkUINode.h +51 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgBaseAttribute.h +83 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgCircle.cpp +29 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgCircle.h +29 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgClipPath.h +22 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgContext.cpp +56 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgContext.h +71 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgDefs.h +46 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgEllipse.cpp +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgEllipse.h +34 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgFilter.cpp +505 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgFilter.h +112 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgForeignObjectNode.cpp +86 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgForeignObjectNode.h +81 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgForeignObjectNodeDelegate.h +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgForeignProps.h +39 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGradient.cpp +117 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGradient.h +49 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGraphic.cpp +553 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGraphic.h +77 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGroup.cpp +93 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgGroup.h +41 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgHost.cpp +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgHost.h +38 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgImage.cpp +168 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgImage.h +52 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgLine.cpp +28 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgLine.h +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgMarker.cpp +61 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgMarker.h +86 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgMask.cpp +72 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgMask.h +68 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgNode.cpp +395 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgNode.h +377 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgPath.cpp +42 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgPath.h +29 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgPattern.cpp +77 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgPattern.h +64 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgQuote.h +87 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgRect.cpp +58 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgRect.h +33 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgSvg.cpp +83 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgSvg.h +52 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgSymbol.cpp +25 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgSymbol.h +37 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgTSpan.cpp +501 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgTSpan.h +101 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgText.cpp +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgText.h +29 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgTextPath.cpp +35 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgTextPath.h +51 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgUse.cpp +65 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgUse.h +46 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgViewManager.cpp +36 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/SvgViewManager.h +37 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/TextBase.cpp +20 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/TextBase.h +114 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h +212 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp +31 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp +23 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.cpp +23 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h +28 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.cpp +40 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.h +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.cpp +33 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.h +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.cpp +39 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.h +55 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.cpp +33 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.h +49 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.cpp +34 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.h +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.cpp +35 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.h +46 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.cpp +199 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.h +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.cpp +93 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.h +55 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h +31 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp +103 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h +43 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h +28 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp +35 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp +33 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h +29 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp +40 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h +28 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp +36 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp +124 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h +56 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp +25 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/downloadUtils/HttpTaskProcessor.cpp +266 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/downloadUtils/HttpTaskProcessor.h +88 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/downloadUtils/ImageSourceResolver.cpp +134 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/downloadUtils/ImageSourceResolver.h +93 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/downloadUtils/LRUCache.h +98 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Brush.cpp +50 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Brush.h +52 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/GlyPathBag.cpp +20 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/GlyPathBag.h +31 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Matrix.cpp +100 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Matrix.h +68 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Path.cpp +173 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Path.h +127 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Pen.cpp +57 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Pen.h +59 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Rect.cpp +47 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Rect.h +56 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/RoundRect.cpp +24 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/RoundRect.h +39 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/ShaderEffect.cpp +37 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/ShaderEffect.h +51 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/TextStyle.cpp +49 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/TextStyle.h +41 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Typography.cpp +9 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/Typography.h +25 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/TypographyStyle.cpp +31 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/drawing/TypographyStyle.h +41 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGCircleJSIBinder.h +54 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGClipPathJSIBinder.h +54 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGDefsJSIBinder.h +38 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGEllipseJSIBinder.h +55 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeBlendJSIBinder.h +26 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeColorMatrixJSIBinder.h +26 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeCompositeJSIBinder.h +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeFloodJSIBinder.h +26 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeGaussianBlurJSIBinder.h +27 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFeOffsetJSIBinder.h +26 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGFilterJSIBinder.h +44 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGForeignObjectJSIBinder.h +57 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGGroupJSIBinder.h +54 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGImageJSIBinder.h +58 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGLineJSIBinder.h +55 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGLinearGradientJSIBinder.h +45 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGMarkerJSIBinder.h +66 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGMaskJSIBinder.h +60 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGPathJSIBinder.h +52 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGPatternJSIBinder.h +67 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGRadialGradientJSIBinder.h +47 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGRectJSIBinder.h +57 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewAndroidJSIBinder.h +67 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewJSIBinder.h +36 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGSymbolJSIBinder.h +60 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGTSpanJSIBinder.h +66 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGTextJSIBinder.h +65 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGTextPathJSIBinder.h +71 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/RNOH/generated/components/RNSVGUseJSIBinder.h +56 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/ComponentDescriptors.h +48 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.cpp +20 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.h +253 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.cpp +977 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.h +1280 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.cpp +45 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.h +331 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/States.cpp +18 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/generated/react/renderer/components/react_native_svg/States.h +441 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Color.cpp +458 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Color.h +144 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Decoration.cpp +41 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Decoration.h +483 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Dimension.cpp +64 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Dimension.h +257 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Font.cpp +166 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Font.h +163 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Offset.h +119 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/PaintState.h +240 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Rect.h +423 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/Size.h +246 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/SvgPaintState.h +452 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/TextProperties.cpp +91 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/TextProperties.h +56 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/properties/ViewBox.h +108 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h +41 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp +62 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/svgImage/RNSVGImageShadowNode.h +63 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/svgImage/RNSVGImageState.cpp +17 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/svgImage/RNSVGImageState.h +58 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGImageModule.cpp +83 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGImageModule.h +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGRenderableModule.cpp +101 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGRenderableModule.h +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp +71 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/turboModules/RNSVGSvgViewModule.h +32 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/DynamicUtils.h +55 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/FilterManager.h +190 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/GlyphContext.cpp +221 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/GlyphContext.h +106 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/LinearMap.h +69 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/PathParserUtils.cpp +591 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/PathParserUtils.h +93 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/StringUtils.cpp +134 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/StringUtils.h +644 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/SvgAttributesParser.cpp +239 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/SvgAttributesParser.h +277 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/SvgMarkerPositionUtils.h +200 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/SvgUtils.h +176 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/TextPathHelper.cpp +94 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/cpp/utils/TextPathHelper.h +61 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/ets/RNSVGImageModule.ts +21 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/ets/RNSVGRenderableModule.ts +16 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/ets/RNSVGSvgViewModule.ts +18 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/ets/SvgPackage.ts +58 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/module.json +30 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/resources/base/element/string.json +8 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/svg/build/default/cache/default/default@PackageHar/ts.ts +8 -0
- package/harmony/svg/build/default/generated/pm/default/oh-package.json5 +1 -0
- package/harmony/svg/build/default/generated/r/default/ResourceTable.h +24 -0
- package/harmony/svg/build/default/intermediates/loader/default/loader.json +26 -0
- package/harmony/svg/build/default/intermediates/merge_profile/default/module.json +27 -0
- package/harmony/svg/build/default/intermediates/patch/default/base_native_libs.json +1 -0
- package/harmony/svg/build/default/intermediates/process_profile/default/module.json +30 -0
- package/harmony/svg/build/default/intermediates/res/default/ResourceTable.txt +1 -0
- package/harmony/svg/build/default/intermediates/res/default/ark_module.json +1 -0
- package/harmony/svg/build/default/intermediates/res/default/ids_map/id_defined.json +7 -0
- package/harmony/svg/build/default/intermediates/res/default/module.json +28 -0
- package/harmony/svg/build/default/intermediates/res/default/opt-compression.json +1 -0
- package/harmony/svg/build/default/intermediates/res/default/resConfig.json +1 -0
- package/harmony/svg/build/default/intermediates/res/default/resources/rawfile/rnoh.profdata +0 -0
- package/harmony/svg/build/default/intermediates/res/default/resources.index +0 -0
- package/harmony/svg/build/default/outputs/default/svg.har +0 -0
- package/harmony/svg/build-profile.json5 +9 -0
- package/harmony/svg/hvigorfile.ts +2 -0
- package/harmony/svg/index.ets +7 -0
- package/harmony/svg/oh-package.json5 +13 -0
- package/harmony/svg/src/main/cpp/Attribute.h +52 -0
- package/harmony/svg/src/main/cpp/CMakeLists.txt +32 -0
- package/harmony/svg/src/main/cpp/FallbackProps.h +0 -0
- package/harmony/svg/src/main/cpp/FontHolderBase.cpp +22 -0
- package/harmony/svg/src/main/cpp/FontHolderBase.h +54 -0
- package/harmony/svg/src/main/cpp/SVGPackage.cpp +135 -0
- package/harmony/svg/src/main/cpp/SVGPackage.h +157 -0
- package/harmony/svg/src/main/cpp/SvgArkUINode.cpp +78 -0
- package/harmony/svg/src/main/cpp/SvgArkUINode.h +51 -0
- package/harmony/svg/src/main/cpp/SvgBaseAttribute.h +83 -0
- package/harmony/svg/src/main/cpp/SvgCircle.cpp +29 -0
- package/harmony/svg/src/main/cpp/SvgCircle.h +29 -0
- package/harmony/svg/src/main/cpp/SvgClipPath.h +22 -0
- package/harmony/svg/src/main/cpp/SvgContext.cpp +56 -0
- package/harmony/svg/src/main/cpp/SvgContext.h +71 -0
- package/harmony/svg/src/main/cpp/SvgDefs.h +46 -0
- package/harmony/svg/src/main/cpp/SvgEllipse.cpp +32 -0
- package/harmony/svg/src/main/cpp/SvgEllipse.h +34 -0
- package/harmony/svg/src/main/cpp/SvgFilter.cpp +505 -0
- package/harmony/svg/src/main/cpp/SvgFilter.h +112 -0
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.cpp +86 -0
- package/harmony/svg/src/main/cpp/SvgForeignObjectNode.h +81 -0
- package/harmony/svg/src/main/cpp/SvgForeignObjectNodeDelegate.h +30 -0
- package/harmony/svg/src/main/cpp/SvgForeignProps.h +39 -0
- package/harmony/svg/src/main/cpp/SvgGradient.cpp +117 -0
- package/harmony/svg/src/main/cpp/SvgGradient.h +49 -0
- package/harmony/svg/src/main/cpp/SvgGraphic.cpp +553 -0
- package/harmony/svg/src/main/cpp/SvgGraphic.h +77 -0
- package/harmony/svg/src/main/cpp/SvgGroup.cpp +93 -0
- package/harmony/svg/src/main/cpp/SvgGroup.h +41 -0
- package/harmony/svg/src/main/cpp/SvgHost.cpp +27 -0
- package/harmony/svg/src/main/cpp/SvgHost.h +38 -0
- package/harmony/svg/src/main/cpp/SvgImage.cpp +168 -0
- package/harmony/svg/src/main/cpp/SvgImage.h +52 -0
- package/harmony/svg/src/main/cpp/SvgLine.cpp +28 -0
- package/harmony/svg/src/main/cpp/SvgLine.h +32 -0
- package/harmony/svg/src/main/cpp/SvgMarker.cpp +61 -0
- package/harmony/svg/src/main/cpp/SvgMarker.h +86 -0
- package/harmony/svg/src/main/cpp/SvgMask.cpp +72 -0
- package/harmony/svg/src/main/cpp/SvgMask.h +68 -0
- package/harmony/svg/src/main/cpp/SvgNode.cpp +395 -0
- package/harmony/svg/src/main/cpp/SvgNode.h +377 -0
- package/harmony/svg/src/main/cpp/SvgPath.cpp +42 -0
- package/harmony/svg/src/main/cpp/SvgPath.h +29 -0
- package/harmony/svg/src/main/cpp/SvgPattern.cpp +77 -0
- package/harmony/svg/src/main/cpp/SvgPattern.h +64 -0
- package/harmony/svg/src/main/cpp/SvgQuote.h +87 -0
- package/harmony/svg/src/main/cpp/SvgRect.cpp +58 -0
- package/harmony/svg/src/main/cpp/SvgRect.h +33 -0
- package/harmony/svg/src/main/cpp/SvgSvg.cpp +83 -0
- package/harmony/svg/src/main/cpp/SvgSvg.h +52 -0
- package/harmony/svg/src/main/cpp/SvgSymbol.cpp +25 -0
- package/harmony/svg/src/main/cpp/SvgSymbol.h +37 -0
- package/harmony/svg/src/main/cpp/SvgTSpan.cpp +501 -0
- package/harmony/svg/src/main/cpp/SvgTSpan.h +101 -0
- package/harmony/svg/src/main/cpp/SvgText.cpp +48 -0
- package/harmony/svg/src/main/cpp/SvgText.h +29 -0
- package/harmony/svg/src/main/cpp/SvgTextPath.cpp +35 -0
- package/harmony/svg/src/main/cpp/SvgTextPath.h +51 -0
- package/harmony/svg/src/main/cpp/SvgUse.cpp +65 -0
- package/harmony/svg/src/main/cpp/SvgUse.h +46 -0
- package/harmony/svg/src/main/cpp/SvgViewManager.cpp +36 -0
- package/harmony/svg/src/main/cpp/SvgViewManager.h +37 -0
- package/harmony/svg/src/main/cpp/TextBase.cpp +20 -0
- package/harmony/svg/src/main/cpp/TextBase.h +114 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h +212 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp +31 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp +23 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.cpp +23 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h +28 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.cpp +40 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.h +48 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.cpp +33 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.h +48 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.cpp +39 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.h +55 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.cpp +33 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.h +49 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.cpp +34 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.h +48 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.cpp +35 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.h +46 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.cpp +199 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.h +48 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.cpp +93 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGForeignObjectComponentInstance.h +55 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp +32 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h +31 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp +103 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h +43 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp +30 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h +28 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp +35 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp +30 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp +33 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h +29 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp +40 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp +32 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h +28 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp +36 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp +124 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h +56 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp +30 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp +25 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp +32 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h +27 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp +32 -0
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h +32 -0
- package/harmony/svg/src/main/cpp/downloadUtils/HttpTaskProcessor.cpp +266 -0
- package/harmony/svg/src/main/cpp/downloadUtils/HttpTaskProcessor.h +88 -0
- package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.cpp +134 -0
- package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.h +93 -0
- package/harmony/svg/src/main/cpp/downloadUtils/LRUCache.h +98 -0
- package/harmony/svg/src/main/cpp/drawing/Brush.cpp +50 -0
- package/harmony/svg/src/main/cpp/drawing/Brush.h +52 -0
- package/harmony/svg/src/main/cpp/drawing/GlyPathBag.cpp +20 -0
- package/harmony/svg/src/main/cpp/drawing/GlyPathBag.h +31 -0
- package/harmony/svg/src/main/cpp/drawing/Matrix.cpp +100 -0
- package/harmony/svg/src/main/cpp/drawing/Matrix.h +68 -0
- package/harmony/svg/src/main/cpp/drawing/Path.cpp +173 -0
- package/harmony/svg/src/main/cpp/drawing/Path.h +127 -0
- package/harmony/svg/src/main/cpp/drawing/Pen.cpp +57 -0
- package/harmony/svg/src/main/cpp/drawing/Pen.h +59 -0
- package/harmony/svg/src/main/cpp/drawing/Rect.cpp +47 -0
- package/harmony/svg/src/main/cpp/drawing/Rect.h +56 -0
- package/harmony/svg/src/main/cpp/drawing/RoundRect.cpp +24 -0
- package/harmony/svg/src/main/cpp/drawing/RoundRect.h +39 -0
- package/harmony/svg/src/main/cpp/drawing/ShaderEffect.cpp +37 -0
- package/harmony/svg/src/main/cpp/drawing/ShaderEffect.h +51 -0
- package/harmony/svg/src/main/cpp/drawing/TextStyle.cpp +49 -0
- package/harmony/svg/src/main/cpp/drawing/TextStyle.h +41 -0
- package/harmony/svg/src/main/cpp/drawing/Typography.cpp +9 -0
- package/harmony/svg/src/main/cpp/drawing/Typography.h +25 -0
- package/harmony/svg/src/main/cpp/drawing/TypographyStyle.cpp +31 -0
- package/harmony/svg/src/main/cpp/drawing/TypographyStyle.h +41 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGCircleJSIBinder.h +54 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGClipPathJSIBinder.h +54 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGDefsJSIBinder.h +38 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGEllipseJSIBinder.h +55 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeBlendJSIBinder.h +26 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeColorMatrixJSIBinder.h +26 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeCompositeJSIBinder.h +30 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeFloodJSIBinder.h +26 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeGaussianBlurJSIBinder.h +27 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeOffsetJSIBinder.h +26 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFilterJSIBinder.h +44 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGForeignObjectJSIBinder.h +57 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGGroupJSIBinder.h +54 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGImageJSIBinder.h +58 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGLineJSIBinder.h +55 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGLinearGradientJSIBinder.h +45 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGMarkerJSIBinder.h +66 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGMaskJSIBinder.h +60 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGPathJSIBinder.h +52 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGPatternJSIBinder.h +67 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGRadialGradientJSIBinder.h +47 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGRectJSIBinder.h +57 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewAndroidJSIBinder.h +67 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewJSIBinder.h +36 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSymbolJSIBinder.h +60 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTSpanJSIBinder.h +66 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTextJSIBinder.h +65 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTextPathJSIBinder.h +71 -0
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGUseJSIBinder.h +56 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ComponentDescriptors.h +48 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.cpp +20 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.h +253 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.cpp +977 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.h +1280 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.cpp +45 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.h +331 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/States.cpp +18 -0
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/States.h +441 -0
- package/harmony/svg/src/main/cpp/properties/Color.cpp +458 -0
- package/harmony/svg/src/main/cpp/properties/Color.h +144 -0
- package/harmony/svg/src/main/cpp/properties/Decoration.cpp +41 -0
- package/harmony/svg/src/main/cpp/properties/Decoration.h +483 -0
- package/harmony/svg/src/main/cpp/properties/Dimension.cpp +64 -0
- package/harmony/svg/src/main/cpp/properties/Dimension.h +257 -0
- package/harmony/svg/src/main/cpp/properties/Font.cpp +166 -0
- package/harmony/svg/src/main/cpp/properties/Font.h +163 -0
- package/harmony/svg/src/main/cpp/properties/Offset.h +119 -0
- package/harmony/svg/src/main/cpp/properties/PaintState.h +240 -0
- package/harmony/svg/src/main/cpp/properties/Rect.h +423 -0
- package/harmony/svg/src/main/cpp/properties/Size.h +246 -0
- package/harmony/svg/src/main/cpp/properties/SvgPaintState.h +452 -0
- package/harmony/svg/src/main/cpp/properties/TextProperties.cpp +91 -0
- package/harmony/svg/src/main/cpp/properties/TextProperties.h +56 -0
- package/harmony/svg/src/main/cpp/properties/ViewBox.h +108 -0
- package/harmony/svg/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h +41 -0
- package/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp +62 -0
- package/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.h +63 -0
- package/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.cpp +17 -0
- package/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.h +58 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.cpp +83 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.h +32 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.cpp +101 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.h +32 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp +71 -0
- package/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.h +32 -0
- package/harmony/svg/src/main/cpp/utils/DynamicUtils.h +55 -0
- package/harmony/svg/src/main/cpp/utils/FilterManager.h +190 -0
- package/harmony/svg/src/main/cpp/utils/GlyphContext.cpp +221 -0
- package/harmony/svg/src/main/cpp/utils/GlyphContext.h +106 -0
- package/harmony/svg/src/main/cpp/utils/LinearMap.h +69 -0
- package/harmony/svg/src/main/cpp/utils/PathParserUtils.cpp +591 -0
- package/harmony/svg/src/main/cpp/utils/PathParserUtils.h +93 -0
- package/harmony/svg/src/main/cpp/utils/StringUtils.cpp +134 -0
- package/harmony/svg/src/main/cpp/utils/StringUtils.h +644 -0
- package/harmony/svg/src/main/cpp/utils/SvgAttributesParser.cpp +239 -0
- package/harmony/svg/src/main/cpp/utils/SvgAttributesParser.h +277 -0
- package/harmony/svg/src/main/cpp/utils/SvgMarkerPositionUtils.h +200 -0
- package/harmony/svg/src/main/cpp/utils/SvgUtils.h +176 -0
- package/harmony/svg/src/main/cpp/utils/TextPathHelper.cpp +94 -0
- package/harmony/svg/src/main/cpp/utils/TextPathHelper.h +61 -0
- package/harmony/svg/src/main/ets/RNSVGImageModule.ts +21 -0
- package/harmony/svg/src/main/ets/RNSVGRenderableModule.ts +16 -0
- package/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts +18 -0
- package/harmony/svg/src/main/ets/SvgPackage.ts +58 -0
- package/harmony/svg/src/main/module.json5 +7 -0
- package/harmony/svg/src/main/resources/base/element/string.json +8 -0
- package/harmony/svg/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/svg/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/svg/ts.ts +8 -0
- package/harmony/svg.har +0 -0
- package/lib/typescript/babel.config.d.ts +8 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/example/babel.config.d.ts +3 -0
- package/lib/typescript/example/babel.config.d.ts.map +1 -0
- package/lib/typescript/example/contexts.d.ts +3 -0
- package/lib/typescript/example/contexts.d.ts.map +1 -0
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts +2 -0
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts.map +1 -0
- package/lib/typescript/example/harmony/hvigorfile.d.ts +2 -0
- package/lib/typescript/example/harmony/hvigorfile.d.ts.map +1 -0
- package/lib/typescript/example/index.d.ts +2 -0
- package/lib/typescript/example/index.d.ts.map +1 -0
- package/lib/typescript/example/jest.config.d.ts +3 -0
- package/lib/typescript/example/jest.config.d.ts.map +1 -0
- package/lib/typescript/example/metro.config.d.ts +3 -0
- package/lib/typescript/example/metro.config.d.ts.map +1 -0
- package/lib/typescript/example/react-native.config.d.ts +3 -0
- package/lib/typescript/example/react-native.config.d.ts.map +1 -0
- package/lib/typescript/example/scripts/create-build-profile.d.ts +2 -0
- package/lib/typescript/example/scripts/create-build-profile.d.ts.map +1 -0
- package/lib/typescript/example/src/index.d.ts +3 -0
- package/lib/typescript/example/src/index.d.ts.map +1 -0
- package/lib/typescript/src/css/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +10 -15
- package/lib/typescript/css/index.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- /package/lib/typescript/{css → src/css}/index.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// from ArkUI "frameworks/base/geometry/dimension.h"
|
|
23
|
+
#pragma once
|
|
24
|
+
|
|
25
|
+
#include <cmath>
|
|
26
|
+
#include <string>
|
|
27
|
+
#include "Size.h"
|
|
28
|
+
|
|
29
|
+
#define NEAR_ZERO(value) ((value > 0.0) ? ((value - 0.0) <= 0.000001f) : ((0.0 - value) <= 0.000001f))
|
|
30
|
+
|
|
31
|
+
namespace rnoh {
|
|
32
|
+
namespace svg {
|
|
33
|
+
|
|
34
|
+
enum class DimensionUnit {
|
|
35
|
+
/*
|
|
36
|
+
* Unit is invalid.
|
|
37
|
+
*/
|
|
38
|
+
INVALID = -2,
|
|
39
|
+
/*
|
|
40
|
+
* Unit is empty.
|
|
41
|
+
*/
|
|
42
|
+
NONE = -1,
|
|
43
|
+
/*
|
|
44
|
+
* Logical pixel used in Ace1.0. It's based on frontend design width.
|
|
45
|
+
* For example, when a frontend with 750px design width running on a
|
|
46
|
+
* device with 1080 pixels width, 1px represents 1.44 pixels.
|
|
47
|
+
*/
|
|
48
|
+
PX = 0,
|
|
49
|
+
/*
|
|
50
|
+
* Density independent pixels, one vp is one pixel on a 160 dpi screen.
|
|
51
|
+
*/
|
|
52
|
+
VP,
|
|
53
|
+
/*
|
|
54
|
+
* Scale independent pixels. This is like VP but will be scaled by
|
|
55
|
+
* user's font size preference.
|
|
56
|
+
*/
|
|
57
|
+
FP,
|
|
58
|
+
/*
|
|
59
|
+
* The percentage of either a value from the element's parent or from
|
|
60
|
+
* another property of the element itself.
|
|
61
|
+
*/
|
|
62
|
+
PERCENT,
|
|
63
|
+
/*
|
|
64
|
+
* logic pixels used in ACE2.0 instead of PX, and PX is the physical pixels in ACE2.0
|
|
65
|
+
*/
|
|
66
|
+
LPX,
|
|
67
|
+
/*
|
|
68
|
+
* The value is calculated from the element's parent and another property of the element itself.
|
|
69
|
+
*/
|
|
70
|
+
AUTO,
|
|
71
|
+
/*
|
|
72
|
+
* The value is expression.
|
|
73
|
+
*/
|
|
74
|
+
CALC,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
enum class SvgLengthType {
|
|
78
|
+
HORIZONTAL,
|
|
79
|
+
VERTICAL,
|
|
80
|
+
OTHER,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* Dimension contains a value and an unit to represent different
|
|
85
|
+
* scales in one class.
|
|
86
|
+
*/
|
|
87
|
+
class Dimension {
|
|
88
|
+
public:
|
|
89
|
+
constexpr Dimension() = default;
|
|
90
|
+
~Dimension() = default;
|
|
91
|
+
constexpr explicit Dimension(double value, DimensionUnit unit = DimensionUnit::PX) : value_(value), unit_(unit) {}
|
|
92
|
+
|
|
93
|
+
void Reset() {
|
|
94
|
+
value_ = 0.0;
|
|
95
|
+
unit_ = DimensionUnit::PX;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
void ResetInvalidValue() {
|
|
99
|
+
if (std::isnan(value_)) {
|
|
100
|
+
Reset();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
constexpr double Value() const { return value_; }
|
|
105
|
+
|
|
106
|
+
void SetValue(double value) { value_ = value; }
|
|
107
|
+
|
|
108
|
+
constexpr DimensionUnit Unit() const { return unit_; }
|
|
109
|
+
|
|
110
|
+
void SetUnit(DimensionUnit unit) { unit_ = unit; }
|
|
111
|
+
|
|
112
|
+
double RelativeConvertToPx(double baseLen, double scale) const;
|
|
113
|
+
|
|
114
|
+
double ConvertToPx(const Size &viewPort, SvgLengthType type, double scale) const;
|
|
115
|
+
|
|
116
|
+
// Percentage unit conversion is not supported.
|
|
117
|
+
double ConvertToVp(double scale) const {
|
|
118
|
+
if (unit_ == DimensionUnit::VP) {
|
|
119
|
+
return value_;
|
|
120
|
+
}
|
|
121
|
+
if (unit_ == DimensionUnit::PX) {
|
|
122
|
+
return value_ / scale;
|
|
123
|
+
}
|
|
124
|
+
return 0.0;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// Percentage unit conversion is not supported.
|
|
128
|
+
double ConvertToPx(double scale) const {
|
|
129
|
+
if (unit_ == DimensionUnit::NONE) {
|
|
130
|
+
return value_;
|
|
131
|
+
}
|
|
132
|
+
if (unit_ == DimensionUnit::PX) {
|
|
133
|
+
return value_;
|
|
134
|
+
}
|
|
135
|
+
if (unit_ == DimensionUnit::VP) {
|
|
136
|
+
return value_ * scale;
|
|
137
|
+
}
|
|
138
|
+
if (unit_ == DimensionUnit::FP) {
|
|
139
|
+
return value_ * scale;
|
|
140
|
+
}
|
|
141
|
+
return 0.0;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
double ParsePropsToPx(double relative, float pointScaleFactor){
|
|
145
|
+
if (unit_ == DimensionUnit::NONE) {
|
|
146
|
+
return value_*pointScaleFactor;
|
|
147
|
+
}
|
|
148
|
+
if (unit_ == DimensionUnit::PERCENT) {
|
|
149
|
+
return value_*relative - pointScaleFactor;
|
|
150
|
+
}
|
|
151
|
+
if (unit_ == DimensionUnit::VP) {
|
|
152
|
+
return value_*pointScaleFactor;
|
|
153
|
+
} else {
|
|
154
|
+
return value_;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
double GetNativeValue(DimensionUnit unit, double scale) const {
|
|
159
|
+
if (unit_ == unit) {
|
|
160
|
+
return value_;
|
|
161
|
+
} else if (unit == DimensionUnit::PX) {
|
|
162
|
+
return ConvertToPx(scale);
|
|
163
|
+
} else {
|
|
164
|
+
return ConvertToVp(scale);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
double FromRelative(bool isObjectBoundingBoxUnit, double relative, double scale);
|
|
169
|
+
|
|
170
|
+
bool NormalizeToPx(double vpScale, double fpScale, double lpxScale, double parentLength, double &result) const;
|
|
171
|
+
|
|
172
|
+
constexpr Dimension operator*(double value) const { return Dimension(value_ * value, unit_); }
|
|
173
|
+
|
|
174
|
+
constexpr Dimension operator/(double value) const {
|
|
175
|
+
// NearZero cannot be used in a constant expression
|
|
176
|
+
if (NEAR_ZERO(value)) {
|
|
177
|
+
return {};
|
|
178
|
+
}
|
|
179
|
+
return Dimension(value_ / value, unit_);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
bool operator==(const Dimension &dimension) const {
|
|
183
|
+
return (unit_ == dimension.unit_) && value_ == dimension.value_;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
bool operator!=(const Dimension &dimension) const { return !operator==(dimension); }
|
|
187
|
+
|
|
188
|
+
/*
|
|
189
|
+
* Add two dimensions using the same unit.
|
|
190
|
+
*/
|
|
191
|
+
constexpr Dimension operator+(const Dimension &dimension) const {
|
|
192
|
+
if (NEAR_ZERO(dimension.Value())) {
|
|
193
|
+
return *this;
|
|
194
|
+
}
|
|
195
|
+
return Dimension(value_ + dimension.value_, unit_);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/*
|
|
199
|
+
* Add a new dimension to itself using same unit.
|
|
200
|
+
*/
|
|
201
|
+
Dimension &operator+=(const Dimension &dimension) {
|
|
202
|
+
value_ += dimension.value_;
|
|
203
|
+
return *this;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/*
|
|
207
|
+
* Minus a dimension using the same unit.
|
|
208
|
+
*/
|
|
209
|
+
constexpr Dimension operator-(const Dimension &dimension) const {
|
|
210
|
+
if (NEAR_ZERO(dimension.Value())) {
|
|
211
|
+
return *this;
|
|
212
|
+
}
|
|
213
|
+
return Dimension(value_ - dimension.value_, unit_);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
* The opposite of dimension.
|
|
218
|
+
*/
|
|
219
|
+
constexpr Dimension operator-() const { return Dimension(-value_, unit_); }
|
|
220
|
+
|
|
221
|
+
/*
|
|
222
|
+
* Minus a dimension to itself using the same unit.
|
|
223
|
+
*/
|
|
224
|
+
Dimension &operator-=(const Dimension &dimension) {
|
|
225
|
+
value_ -= dimension.value_;
|
|
226
|
+
return *this;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
bool operator>(const Dimension &dimension) const { return (value_ > dimension.value_); }
|
|
230
|
+
|
|
231
|
+
bool operator<(const Dimension &dimension) const { return (value_ < dimension.value_); }
|
|
232
|
+
|
|
233
|
+
std::string ToString() const;
|
|
234
|
+
|
|
235
|
+
private:
|
|
236
|
+
double value_ = 0.0;
|
|
237
|
+
DimensionUnit unit_ = DimensionUnit::PX;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// literal operators for dimension
|
|
241
|
+
inline constexpr Dimension operator""_vp(long double value) {
|
|
242
|
+
return Dimension(static_cast<double>(value), DimensionUnit::VP);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
inline constexpr Dimension operator""_px(long double value) {
|
|
246
|
+
return Dimension(static_cast<double>(value), DimensionUnit::PX);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
inline constexpr Dimension operator""_fp(long double value) {
|
|
250
|
+
return Dimension(static_cast<double>(value), DimensionUnit::FP);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
inline constexpr Dimension operator""_pct(long double value) {
|
|
254
|
+
return Dimension(static_cast<double>(value), DimensionUnit::PERCENT);
|
|
255
|
+
}
|
|
256
|
+
} // namespace svg
|
|
257
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#include "Font.h"
|
|
8
|
+
#include "utils/StringUtils.h"
|
|
9
|
+
|
|
10
|
+
namespace rnoh {
|
|
11
|
+
namespace svg {
|
|
12
|
+
|
|
13
|
+
double FontData::toAbsolute(const std::string &value, double scale, double fontSz, double relative) {
|
|
14
|
+
auto val = StringUtils::FromString(value);
|
|
15
|
+
return val.RelativeConvertToPx(fontSz, scale);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
void FontData::setInheritedWeight(const FontData &parent) {
|
|
19
|
+
absoluteFontWeight = parent.absoluteFontWeight;
|
|
20
|
+
fontWeight = parent.fontWeight;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
void FontData::handleNumericWeight(const FontData &parent, double number) {
|
|
24
|
+
long weight = static_cast<long>(number);
|
|
25
|
+
if (weight >= 1 && weight <= 1000) {
|
|
26
|
+
absoluteFontWeight = static_cast<int>(weight);
|
|
27
|
+
fontWeight = nearestFontWeight(absoluteFontWeight);
|
|
28
|
+
} else {
|
|
29
|
+
setInheritedWeight(parent);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
FontData::FontData(const FontProps &props, const FontData &parent, double scale) {
|
|
34
|
+
double parentFontSize = parent.fontSize;
|
|
35
|
+
|
|
36
|
+
if (!props.fontSize.empty()) {
|
|
37
|
+
fontSize = toAbsolute(props.fontSize, scale, parentFontSize, parentFontSize);
|
|
38
|
+
} else {
|
|
39
|
+
fontSize = parentFontSize;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!props.fontWeight.empty()) {
|
|
43
|
+
fontWeight = fontWeightFromStr(props.fontWeight);
|
|
44
|
+
if (fontWeight != FontWeight::unknown) {
|
|
45
|
+
absoluteFontWeight = from(fontWeight, parent);
|
|
46
|
+
fontWeight = nearestFontWeight(absoluteFontWeight);
|
|
47
|
+
} else {
|
|
48
|
+
handleNumericWeight(parent, StringUtils::FromString(props.fontWeight).Value());
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
setInheritedWeight(parent);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fontFamily = !props.fontFamily.empty() ? props.fontFamily : parent.fontFamily;
|
|
55
|
+
fontStyle = !props.fontStyle.empty() ? fontStyleFromStr(props.fontStyle) : parent.fontStyle;
|
|
56
|
+
fontFeatureSettings = !props.fontFeatureSettings.empty() ? props.fontFeatureSettings : parent.fontFeatureSettings;
|
|
57
|
+
fontVariationSettings =
|
|
58
|
+
!props.fontVariationSettings.empty() ? props.fontVariationSettings : parent.fontVariationSettings;
|
|
59
|
+
fontVariantLigatures = !props.fontVariantLigatures.empty() ? fontVariantFromStr(props.fontVariantLigatures)
|
|
60
|
+
: parent.fontVariantLigatures;
|
|
61
|
+
|
|
62
|
+
textAnchor = !props.textAnchor.empty() ? textAnchorFromStr(props.textAnchor) : parent.textAnchor;
|
|
63
|
+
textDecoration =
|
|
64
|
+
!props.textDecoration.empty() ? textDecorationFromStr(props.textDecoration) : parent.textDecoration;
|
|
65
|
+
|
|
66
|
+
bool hasKerning = !props.kerning.empty();
|
|
67
|
+
manualKerning = hasKerning || parent.manualKerning;
|
|
68
|
+
|
|
69
|
+
kerning = hasKerning ? toAbsolute(props.kerning, scale, fontSize, 0) : parent.kerning;
|
|
70
|
+
wordSpacing = !props.wordSpacing.empty() ? toAbsolute(props.wordSpacing, scale, fontSize, 0) : parent.wordSpacing;
|
|
71
|
+
letterSpacing =
|
|
72
|
+
!props.letterSpacing.empty() ? toAbsolute(props.letterSpacing, scale, fontSize, 0) : parent.letterSpacing;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const double FontData::DEFAULT_FONT_SIZE = 3.25 * 12.0;
|
|
76
|
+
const double FontData::DEFAULT_KERNING = 0.0;
|
|
77
|
+
const double FontData::DEFAULT_WORD_SPACING = 0.0;
|
|
78
|
+
const double FontData::DEFAULT_LETTER_SPACING = 0.0;
|
|
79
|
+
|
|
80
|
+
const FontWeight FontData::WEIGHTS[] = {FontWeight::w100, FontWeight::w200, FontWeight::w300,
|
|
81
|
+
FontWeight::normal, FontWeight::w500, FontWeight::w600,
|
|
82
|
+
FontWeight::bold, FontWeight::w800, FontWeight::w900};
|
|
83
|
+
|
|
84
|
+
const int FontData::absoluteFontWeights[] = {400, 700, 100, 200, 300, 400, 500, 600, 700, 800, 900};
|
|
85
|
+
|
|
86
|
+
FontStyle fontStyleFromStr(const std::string &str) {
|
|
87
|
+
if (str == "normal") {
|
|
88
|
+
return FontStyle::normal;
|
|
89
|
+
} else if (str == "italic") {
|
|
90
|
+
return FontStyle::italic;
|
|
91
|
+
} else if (str == "oblique") {
|
|
92
|
+
return FontStyle::oblique;
|
|
93
|
+
} else {
|
|
94
|
+
// Default case
|
|
95
|
+
return FontStyle::normal;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
FontWeight fontWeightFromStr(const std::string &str) {
|
|
100
|
+
if (str == "w100") {
|
|
101
|
+
return FontWeight::w100;
|
|
102
|
+
} else if (str == "w200") {
|
|
103
|
+
return FontWeight::w200;
|
|
104
|
+
} else if (str == "w300") {
|
|
105
|
+
return FontWeight::w300;
|
|
106
|
+
} else if (str == "normal") {
|
|
107
|
+
return FontWeight::normal;
|
|
108
|
+
} else if (str == "w500") {
|
|
109
|
+
return FontWeight::w500;
|
|
110
|
+
} else if (str == "w600") {
|
|
111
|
+
return FontWeight::w600;
|
|
112
|
+
} else if (str == "bold") {
|
|
113
|
+
return FontWeight::bold;
|
|
114
|
+
} else if (str == "w800") {
|
|
115
|
+
return FontWeight::w800;
|
|
116
|
+
} else if (str == "w900") {
|
|
117
|
+
return FontWeight::w900;
|
|
118
|
+
} else if (str == "lighter") {
|
|
119
|
+
return FontWeight::lighter;
|
|
120
|
+
} else if (str == "bolder") {
|
|
121
|
+
return FontWeight::bolder;
|
|
122
|
+
}
|
|
123
|
+
return FontWeight::unknown;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
TextAnchor textAnchorFromStr(const std::string &str) {
|
|
127
|
+
if (str == "start") {
|
|
128
|
+
return TextAnchor::start;
|
|
129
|
+
} else if (str == "middle") {
|
|
130
|
+
return TextAnchor::middle;
|
|
131
|
+
} else if (str == "end") {
|
|
132
|
+
return TextAnchor::end;
|
|
133
|
+
} else {
|
|
134
|
+
// Default case
|
|
135
|
+
return TextAnchor::start;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
TextDecoration textDecorationFromStr(const std::string &str) {
|
|
140
|
+
if (str == "None") {
|
|
141
|
+
return TextDecoration::None;
|
|
142
|
+
} else if (str == "Underline") {
|
|
143
|
+
return TextDecoration::Underline;
|
|
144
|
+
} else if (str == "Overline") {
|
|
145
|
+
return TextDecoration::Overline;
|
|
146
|
+
} else if (str == "LineThrough") {
|
|
147
|
+
return TextDecoration::LineThrough;
|
|
148
|
+
} else {
|
|
149
|
+
// Default case
|
|
150
|
+
return TextDecoration::None;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
FontVariantLigatures fontVariantFromStr(const std::string &str) {
|
|
155
|
+
if (str == "normal") {
|
|
156
|
+
return FontVariantLigatures::normal;
|
|
157
|
+
} else if (str == "none") {
|
|
158
|
+
return FontVariantLigatures::none;
|
|
159
|
+
} else {
|
|
160
|
+
// Default case
|
|
161
|
+
return FontVariantLigatures::normal;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
} // namespace svg
|
|
166
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
|
|
11
|
+
namespace rnoh {
|
|
12
|
+
namespace svg {
|
|
13
|
+
|
|
14
|
+
constexpr int LIGHTER_THRESHOLD_550 = 550;
|
|
15
|
+
constexpr int LIGHTER_THRESHOLD_750 = 750;
|
|
16
|
+
constexpr int BOLDER_THRESHOLD_350 = 350;
|
|
17
|
+
constexpr int BOLDER_THRESHOLD_550 = 550;
|
|
18
|
+
constexpr int BOLDER_THRESHOLD_900 = 900;
|
|
19
|
+
constexpr int DEFAULT_BOLDER_WEIGHT = 400;
|
|
20
|
+
constexpr int DEFAULT_LIGHTER_WEIGHT = 100;
|
|
21
|
+
constexpr int DEFAULT_MEDIUM_WEIGHT = 400;
|
|
22
|
+
constexpr int DEFAULT_BOLDER_WEIGHT_700 = 700;
|
|
23
|
+
constexpr int DEFAULT_BOLDER_WEIGHT_900 = 900;
|
|
24
|
+
|
|
25
|
+
enum class FontStyle { normal, italic, oblique };
|
|
26
|
+
|
|
27
|
+
enum class FontWeight {
|
|
28
|
+
w100,
|
|
29
|
+
w200,
|
|
30
|
+
w300,
|
|
31
|
+
normal,
|
|
32
|
+
w500,
|
|
33
|
+
w600,
|
|
34
|
+
bold,
|
|
35
|
+
w800,
|
|
36
|
+
w900,
|
|
37
|
+
bolder,
|
|
38
|
+
lighter,
|
|
39
|
+
unknown,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// match with <native_drawing/drawing_text_typography.h>
|
|
43
|
+
enum class TextAnchor { start = 4, middle = 2, end = 5 };
|
|
44
|
+
|
|
45
|
+
// match with <native_drawing/drawing_text_typography.h>
|
|
46
|
+
enum class TextDecoration { None = 0x0, Underline = 0x1, Overline = 0x2, LineThrough = 0x4 };
|
|
47
|
+
|
|
48
|
+
enum class FontVariantLigatures { normal, none };
|
|
49
|
+
|
|
50
|
+
FontStyle fontStyleFromStr(const std::string &str);
|
|
51
|
+
FontWeight fontWeightFromStr(const std::string &str);
|
|
52
|
+
TextAnchor textAnchorFromStr(const std::string &str);
|
|
53
|
+
TextDecoration textDecorationFromStr(const std::string &str);
|
|
54
|
+
FontVariantLigatures fontVariantFromStr(const std::string &str);
|
|
55
|
+
|
|
56
|
+
// intermediate data to store in Svg nodes
|
|
57
|
+
struct FontProps {
|
|
58
|
+
std::string fontStyle;
|
|
59
|
+
std::string fontVariant;
|
|
60
|
+
std::string fontWeight;
|
|
61
|
+
std::string fontStretch;
|
|
62
|
+
std::string fontSize;
|
|
63
|
+
std::string fontFamily;
|
|
64
|
+
std::string textAnchor;
|
|
65
|
+
std::string textDecoration;
|
|
66
|
+
std::string letterSpacing;
|
|
67
|
+
std::string wordSpacing;
|
|
68
|
+
std::string kerning;
|
|
69
|
+
std::string fontFeatureSettings;
|
|
70
|
+
std::string fontVariantLigatures;
|
|
71
|
+
std::string fontVariationSettings;
|
|
72
|
+
|
|
73
|
+
inline bool Empty() const {
|
|
74
|
+
return fontStyle.empty() && fontVariant.empty() && fontWeight.empty() && fontStretch.empty() &&
|
|
75
|
+
fontSize.empty() && fontFamily.empty() && textAnchor.empty() && textDecoration.empty() &&
|
|
76
|
+
letterSpacing.empty() && wordSpacing.empty() && kerning.empty() && fontFeatureSettings.empty() &&
|
|
77
|
+
fontVariantLigatures.empty() && fontVariationSettings.empty();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
class FontData {
|
|
82
|
+
public:
|
|
83
|
+
FontData() = default;
|
|
84
|
+
FontData(const FontProps &props, const FontData &parent, double scale);
|
|
85
|
+
|
|
86
|
+
static const double DEFAULT_FONT_SIZE;
|
|
87
|
+
static const double DEFAULT_KERNING;
|
|
88
|
+
static const double DEFAULT_WORD_SPACING;
|
|
89
|
+
static const double DEFAULT_LETTER_SPACING;
|
|
90
|
+
|
|
91
|
+
/* ------- Props -------- */
|
|
92
|
+
double fontSize = DEFAULT_FONT_SIZE;
|
|
93
|
+
std::string fontFamily;
|
|
94
|
+
FontStyle fontStyle = FontStyle::normal;
|
|
95
|
+
FontWeight fontWeight = FontWeight::normal;
|
|
96
|
+
int absoluteFontWeight = 400;
|
|
97
|
+
std::string fontFeatureSettings;
|
|
98
|
+
std::string fontVariationSettings;
|
|
99
|
+
FontVariantLigatures fontVariantLigatures = FontVariantLigatures::normal;
|
|
100
|
+
TextAnchor textAnchor = TextAnchor::start;
|
|
101
|
+
TextDecoration textDecoration = TextDecoration::None;
|
|
102
|
+
|
|
103
|
+
double kerning = DEFAULT_KERNING;
|
|
104
|
+
double wordSpacing = DEFAULT_WORD_SPACING;
|
|
105
|
+
double letterSpacing = DEFAULT_LETTER_SPACING;
|
|
106
|
+
|
|
107
|
+
bool manualKerning = false;
|
|
108
|
+
/* -------------------- */
|
|
109
|
+
|
|
110
|
+
double toAbsolute(const std::string &value, double scale, double fontSize, double relative);
|
|
111
|
+
|
|
112
|
+
void setInheritedWeight(const FontData &parent);
|
|
113
|
+
|
|
114
|
+
void handleNumericWeight(const FontData &parent, double number);
|
|
115
|
+
|
|
116
|
+
private:
|
|
117
|
+
static const int normal = 400;
|
|
118
|
+
|
|
119
|
+
static const FontWeight WEIGHTS[];
|
|
120
|
+
|
|
121
|
+
static FontWeight nearestFontWeight(int abFontWeight) {
|
|
122
|
+
return WEIGHTS[static_cast<int>(abFontWeight / 100.0f)];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
static const int absoluteFontWeights[];
|
|
126
|
+
|
|
127
|
+
static int from(FontWeight fontW, const FontData &parent) {
|
|
128
|
+
if (fontW == FontWeight::bolder) {
|
|
129
|
+
return WeightToBolder(parent.absoluteFontWeight);
|
|
130
|
+
} else if (fontW == FontWeight::lighter) {
|
|
131
|
+
return lighter(parent.absoluteFontWeight);
|
|
132
|
+
} else {
|
|
133
|
+
return absoluteFontWeights[static_cast<int>(fontW)];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
static int WeightToBolder(int inherited) {
|
|
138
|
+
if (inherited < BOLDER_THRESHOLD_350) {
|
|
139
|
+
return DEFAULT_BOLDER_WEIGHT;
|
|
140
|
+
} else if (inherited < BOLDER_THRESHOLD_550) {
|
|
141
|
+
return DEFAULT_BOLDER_WEIGHT_700;
|
|
142
|
+
} else if (inherited < BOLDER_THRESHOLD_900) {
|
|
143
|
+
return DEFAULT_BOLDER_WEIGHT_900;
|
|
144
|
+
} else {
|
|
145
|
+
return inherited;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static int lighter(int inherited) {
|
|
150
|
+
if (inherited < DEFAULT_LIGHTER_WEIGHT) {
|
|
151
|
+
return inherited;
|
|
152
|
+
} else if (inherited < LIGHTER_THRESHOLD_550) {
|
|
153
|
+
return DEFAULT_LIGHTER_WEIGHT;
|
|
154
|
+
} else if (inherited < LIGHTER_THRESHOLD_750) {
|
|
155
|
+
return DEFAULT_MEDIUM_WEIGHT;
|
|
156
|
+
} else {
|
|
157
|
+
return DEFAULT_BOLDER_WEIGHT_700;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
} // namespace svg
|
|
163
|
+
} // namespace rnoh
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*
|
|
6
|
+
* This file incorporates from the OpenHarmony project, licensed under
|
|
7
|
+
* the Apache License, Version 2.0. Specifically:
|
|
8
|
+
* - [OpenHarmony/arkui_ace_engine] (https://gitee.com/openharmony/arkui_ace_engine)
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
11
|
+
* use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at:
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations
|
|
19
|
+
* under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// from ArkUI "frameworks/base/geometry/offset.h"
|
|
23
|
+
#pragma once
|
|
24
|
+
|
|
25
|
+
#include <cmath>
|
|
26
|
+
#include <limits>
|
|
27
|
+
|
|
28
|
+
#include "properties/Size.h"
|
|
29
|
+
#include "utils/SvgUtils.h"
|
|
30
|
+
|
|
31
|
+
namespace rnoh {
|
|
32
|
+
namespace svg {
|
|
33
|
+
|
|
34
|
+
class Offset {
|
|
35
|
+
public:
|
|
36
|
+
Offset() = default;
|
|
37
|
+
~Offset() = default;
|
|
38
|
+
Offset(double deltaX, double deltaY) : deltaX_(deltaX), deltaY_(deltaY) {}
|
|
39
|
+
|
|
40
|
+
void Reset() {
|
|
41
|
+
deltaX_ = 0.0;
|
|
42
|
+
deltaY_ = 0.0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static Offset Zero() { return Offset(); }
|
|
46
|
+
|
|
47
|
+
static Offset ErrorOffset() {
|
|
48
|
+
return Offset((std::numeric_limits<double>::max)(), (std::numeric_limits<double>::max)());
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
bool IsZero() const { return operator==(Offset()); }
|
|
52
|
+
|
|
53
|
+
bool IsErrorOffset() const { return operator==(ErrorOffset()); }
|
|
54
|
+
|
|
55
|
+
double GetX() const { return deltaX_; }
|
|
56
|
+
|
|
57
|
+
double GetY() const { return deltaY_; }
|
|
58
|
+
|
|
59
|
+
void SetX(double x) { deltaX_ = x; }
|
|
60
|
+
|
|
61
|
+
void SetY(double y) { deltaY_ = y; }
|
|
62
|
+
|
|
63
|
+
void AddX(double x) { deltaX_ += x; }
|
|
64
|
+
|
|
65
|
+
void AddY(double y) { deltaY_ += y; }
|
|
66
|
+
|
|
67
|
+
double GetDistance() const { return std::sqrt((deltaX_ * deltaX_) + (deltaY_ * deltaY_)); }
|
|
68
|
+
|
|
69
|
+
Offset operator+(const Offset &offset) const { return Offset(deltaX_ + offset.deltaX_, deltaY_ + offset.deltaY_); }
|
|
70
|
+
|
|
71
|
+
Offset operator+(const Size &size) const { return Offset(deltaX_ + size.Width(), deltaY_ + size.Height()); }
|
|
72
|
+
|
|
73
|
+
Offset operator-(const Offset &offset) const { return Offset(deltaX_ - offset.deltaX_, deltaY_ - offset.deltaY_); }
|
|
74
|
+
|
|
75
|
+
Offset operator-(const Size &size) const { return Offset(deltaX_ - size.Width(), deltaY_ - size.Height()); }
|
|
76
|
+
|
|
77
|
+
Offset operator*(double value) const { return Offset(deltaX_ * value, deltaY_ * value); }
|
|
78
|
+
|
|
79
|
+
Offset operator/(double value) const {
|
|
80
|
+
if (NearZero(value)) {
|
|
81
|
+
return ErrorOffset();
|
|
82
|
+
}
|
|
83
|
+
return Offset(deltaX_ / value, deltaY_ / value);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
Offset &operator+=(const Offset &offset) {
|
|
87
|
+
deltaX_ += offset.deltaX_;
|
|
88
|
+
deltaY_ += offset.deltaY_;
|
|
89
|
+
return *this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
Offset &operator-=(const Offset &offset) {
|
|
93
|
+
deltaX_ -= offset.deltaX_;
|
|
94
|
+
deltaY_ -= offset.deltaY_;
|
|
95
|
+
return *this;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
bool operator==(const Offset &offset) const {
|
|
99
|
+
return NearEqual(deltaX_, offset.deltaX_) && NearEqual(deltaY_, offset.deltaY_);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
bool operator!=(const Offset &offset) const { return !operator==(offset); }
|
|
103
|
+
|
|
104
|
+
std::string ToString() const {
|
|
105
|
+
std::stringstream ss;
|
|
106
|
+
ss << "Offset (" << std::fixed << std::setprecision(2) << deltaX_ << ", " << deltaY_ << ")";
|
|
107
|
+
std::string output = ss.str();
|
|
108
|
+
return output;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
bool IsPositiveOffset() const { return deltaX_ >= 0 && deltaY_ >= 0; }
|
|
112
|
+
|
|
113
|
+
private:
|
|
114
|
+
double deltaX_ = 0.0;
|
|
115
|
+
double deltaY_ = 0.0;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
} // namespace svg
|
|
119
|
+
} // namespace rnoh
|