@react-native-ohos/react-native-svg 15.12.1-rc.1

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.
Files changed (280) hide show
  1. package/LICENSE +21 -0
  2. package/README.OpenSource +11 -0
  3. package/README.md +13 -0
  4. package/css/package.json +6 -0
  5. package/harmony/svg/BuildProfile.ets +17 -0
  6. package/harmony/svg/build-profile.json5 +9 -0
  7. package/harmony/svg/hvigorfile.ts +2 -0
  8. package/harmony/svg/index.ets +7 -0
  9. package/harmony/svg/oh-package.json5 +13 -0
  10. package/harmony/svg/src/main/cpp/Attribute.h +52 -0
  11. package/harmony/svg/src/main/cpp/CMakeLists.txt +32 -0
  12. package/harmony/svg/src/main/cpp/FallbackProps.h +0 -0
  13. package/harmony/svg/src/main/cpp/FontHolderBase.cpp +22 -0
  14. package/harmony/svg/src/main/cpp/FontHolderBase.h +54 -0
  15. package/harmony/svg/src/main/cpp/SVGPackage.cpp +135 -0
  16. package/harmony/svg/src/main/cpp/SVGPackage.h +153 -0
  17. package/harmony/svg/src/main/cpp/SvgArkUINode.cpp +75 -0
  18. package/harmony/svg/src/main/cpp/SvgArkUINode.h +45 -0
  19. package/harmony/svg/src/main/cpp/SvgBaseAttribute.h +83 -0
  20. package/harmony/svg/src/main/cpp/SvgCircle.cpp +29 -0
  21. package/harmony/svg/src/main/cpp/SvgCircle.h +29 -0
  22. package/harmony/svg/src/main/cpp/SvgClipPath.h +22 -0
  23. package/harmony/svg/src/main/cpp/SvgContext.cpp +56 -0
  24. package/harmony/svg/src/main/cpp/SvgContext.h +71 -0
  25. package/harmony/svg/src/main/cpp/SvgDefs.h +46 -0
  26. package/harmony/svg/src/main/cpp/SvgEllipse.cpp +32 -0
  27. package/harmony/svg/src/main/cpp/SvgEllipse.h +34 -0
  28. package/harmony/svg/src/main/cpp/SvgFilter.cpp +505 -0
  29. package/harmony/svg/src/main/cpp/SvgFilter.h +112 -0
  30. package/harmony/svg/src/main/cpp/SvgGradient.cpp +116 -0
  31. package/harmony/svg/src/main/cpp/SvgGradient.h +49 -0
  32. package/harmony/svg/src/main/cpp/SvgGraphic.cpp +553 -0
  33. package/harmony/svg/src/main/cpp/SvgGraphic.h +77 -0
  34. package/harmony/svg/src/main/cpp/SvgGroup.cpp +86 -0
  35. package/harmony/svg/src/main/cpp/SvgGroup.h +41 -0
  36. package/harmony/svg/src/main/cpp/SvgHost.cpp +27 -0
  37. package/harmony/svg/src/main/cpp/SvgHost.h +38 -0
  38. package/harmony/svg/src/main/cpp/SvgImage.cpp +168 -0
  39. package/harmony/svg/src/main/cpp/SvgImage.h +52 -0
  40. package/harmony/svg/src/main/cpp/SvgLine.cpp +28 -0
  41. package/harmony/svg/src/main/cpp/SvgLine.h +32 -0
  42. package/harmony/svg/src/main/cpp/SvgMarker.cpp +61 -0
  43. package/harmony/svg/src/main/cpp/SvgMarker.h +86 -0
  44. package/harmony/svg/src/main/cpp/SvgMask.cpp +72 -0
  45. package/harmony/svg/src/main/cpp/SvgMask.h +68 -0
  46. package/harmony/svg/src/main/cpp/SvgNode.cpp +289 -0
  47. package/harmony/svg/src/main/cpp/SvgNode.h +347 -0
  48. package/harmony/svg/src/main/cpp/SvgPath.cpp +42 -0
  49. package/harmony/svg/src/main/cpp/SvgPath.h +29 -0
  50. package/harmony/svg/src/main/cpp/SvgPattern.cpp +77 -0
  51. package/harmony/svg/src/main/cpp/SvgPattern.h +64 -0
  52. package/harmony/svg/src/main/cpp/SvgQuote.h +87 -0
  53. package/harmony/svg/src/main/cpp/SvgRect.cpp +58 -0
  54. package/harmony/svg/src/main/cpp/SvgRect.h +33 -0
  55. package/harmony/svg/src/main/cpp/SvgSvg.cpp +83 -0
  56. package/harmony/svg/src/main/cpp/SvgSvg.h +52 -0
  57. package/harmony/svg/src/main/cpp/SvgSymbol.cpp +25 -0
  58. package/harmony/svg/src/main/cpp/SvgSymbol.h +37 -0
  59. package/harmony/svg/src/main/cpp/SvgTSpan.cpp +501 -0
  60. package/harmony/svg/src/main/cpp/SvgTSpan.h +101 -0
  61. package/harmony/svg/src/main/cpp/SvgText.cpp +48 -0
  62. package/harmony/svg/src/main/cpp/SvgText.h +29 -0
  63. package/harmony/svg/src/main/cpp/SvgTextPath.cpp +35 -0
  64. package/harmony/svg/src/main/cpp/SvgTextPath.h +51 -0
  65. package/harmony/svg/src/main/cpp/SvgUse.cpp +65 -0
  66. package/harmony/svg/src/main/cpp/SvgUse.h +46 -0
  67. package/harmony/svg/src/main/cpp/SvgViewManager.cpp +36 -0
  68. package/harmony/svg/src/main/cpp/SvgViewManager.h +37 -0
  69. package/harmony/svg/src/main/cpp/TextBase.cpp +20 -0
  70. package/harmony/svg/src/main/cpp/TextBase.h +114 -0
  71. package/harmony/svg/src/main/cpp/componentInstances/RNSVGBaseComponentInstance.h +212 -0
  72. package/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.cpp +31 -0
  73. package/harmony/svg/src/main/cpp/componentInstances/RNSVGCircleComponentInstance.h +27 -0
  74. package/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.cpp +23 -0
  75. package/harmony/svg/src/main/cpp/componentInstances/RNSVGClipPathComponentInstance.h +27 -0
  76. package/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.cpp +23 -0
  77. package/harmony/svg/src/main/cpp/componentInstances/RNSVGDefsComponentInstance.h +28 -0
  78. package/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.cpp +27 -0
  79. package/harmony/svg/src/main/cpp/componentInstances/RNSVGEllipseComponentInstance.h +27 -0
  80. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.cpp +40 -0
  81. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.h +48 -0
  82. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.cpp +33 -0
  83. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.h +48 -0
  84. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.cpp +39 -0
  85. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.h +55 -0
  86. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.cpp +33 -0
  87. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.h +49 -0
  88. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.cpp +34 -0
  89. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.h +48 -0
  90. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.cpp +35 -0
  91. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.h +46 -0
  92. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.cpp +199 -0
  93. package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.h +48 -0
  94. package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.cpp +32 -0
  95. package/harmony/svg/src/main/cpp/componentInstances/RNSVGGroupComponentInstance.h +27 -0
  96. package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp +100 -0
  97. package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.h +43 -0
  98. package/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.cpp +27 -0
  99. package/harmony/svg/src/main/cpp/componentInstances/RNSVGLineComponentInstance.h +27 -0
  100. package/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.cpp +30 -0
  101. package/harmony/svg/src/main/cpp/componentInstances/RNSVGLinearGradientComponentInstance.h +28 -0
  102. package/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.cpp +35 -0
  103. package/harmony/svg/src/main/cpp/componentInstances/RNSVGMarkerComponentInstance.h +27 -0
  104. package/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.cpp +30 -0
  105. package/harmony/svg/src/main/cpp/componentInstances/RNSVGMaskComponentInstance.h +27 -0
  106. package/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.cpp +33 -0
  107. package/harmony/svg/src/main/cpp/componentInstances/RNSVGPathComponentInstance.h +29 -0
  108. package/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.cpp +40 -0
  109. package/harmony/svg/src/main/cpp/componentInstances/RNSVGPatternComponentInstance.h +27 -0
  110. package/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.cpp +32 -0
  111. package/harmony/svg/src/main/cpp/componentInstances/RNSVGRadialGradientComponentInstance.h +28 -0
  112. package/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.cpp +36 -0
  113. package/harmony/svg/src/main/cpp/componentInstances/RNSVGRectComponentInstance.h +27 -0
  114. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.cpp +86 -0
  115. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSvgViewComponentInstance.h +47 -0
  116. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.cpp +30 -0
  117. package/harmony/svg/src/main/cpp/componentInstances/RNSVGSymbolComponentInstance.h +27 -0
  118. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.cpp +27 -0
  119. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTSpanComponentInstance.h +27 -0
  120. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.cpp +25 -0
  121. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextComponentInstance.h +27 -0
  122. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.cpp +32 -0
  123. package/harmony/svg/src/main/cpp/componentInstances/RNSVGTextPathComponentInstance.h +27 -0
  124. package/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.cpp +32 -0
  125. package/harmony/svg/src/main/cpp/componentInstances/RNSVGUseComponentInstance.h +32 -0
  126. package/harmony/svg/src/main/cpp/downloadUtils/HttpTaskProcessor.cpp +207 -0
  127. package/harmony/svg/src/main/cpp/downloadUtils/HttpTaskProcessor.h +88 -0
  128. package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.cpp +106 -0
  129. package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.h +97 -0
  130. package/harmony/svg/src/main/cpp/downloadUtils/LRUCache.h +98 -0
  131. package/harmony/svg/src/main/cpp/drawing/Brush.cpp +50 -0
  132. package/harmony/svg/src/main/cpp/drawing/Brush.h +52 -0
  133. package/harmony/svg/src/main/cpp/drawing/GlyPathBag.cpp +20 -0
  134. package/harmony/svg/src/main/cpp/drawing/GlyPathBag.h +31 -0
  135. package/harmony/svg/src/main/cpp/drawing/Matrix.cpp +100 -0
  136. package/harmony/svg/src/main/cpp/drawing/Matrix.h +68 -0
  137. package/harmony/svg/src/main/cpp/drawing/Path.cpp +173 -0
  138. package/harmony/svg/src/main/cpp/drawing/Path.h +127 -0
  139. package/harmony/svg/src/main/cpp/drawing/Pen.cpp +57 -0
  140. package/harmony/svg/src/main/cpp/drawing/Pen.h +59 -0
  141. package/harmony/svg/src/main/cpp/drawing/Rect.cpp +47 -0
  142. package/harmony/svg/src/main/cpp/drawing/Rect.h +56 -0
  143. package/harmony/svg/src/main/cpp/drawing/RoundRect.cpp +24 -0
  144. package/harmony/svg/src/main/cpp/drawing/RoundRect.h +39 -0
  145. package/harmony/svg/src/main/cpp/drawing/ShaderEffect.cpp +37 -0
  146. package/harmony/svg/src/main/cpp/drawing/ShaderEffect.h +51 -0
  147. package/harmony/svg/src/main/cpp/drawing/TextStyle.cpp +49 -0
  148. package/harmony/svg/src/main/cpp/drawing/TextStyle.h +41 -0
  149. package/harmony/svg/src/main/cpp/drawing/Typography.cpp +9 -0
  150. package/harmony/svg/src/main/cpp/drawing/Typography.h +25 -0
  151. package/harmony/svg/src/main/cpp/drawing/TypographyStyle.cpp +31 -0
  152. package/harmony/svg/src/main/cpp/drawing/TypographyStyle.h +41 -0
  153. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGCircleJSIBinder.h +54 -0
  154. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGClipPathJSIBinder.h +54 -0
  155. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGDefsJSIBinder.h +38 -0
  156. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGEllipseJSIBinder.h +55 -0
  157. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeBlendJSIBinder.h +26 -0
  158. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeColorMatrixJSIBinder.h +26 -0
  159. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeCompositeJSIBinder.h +30 -0
  160. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeFloodJSIBinder.h +26 -0
  161. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeGaussianBlurJSIBinder.h +27 -0
  162. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeOffsetJSIBinder.h +26 -0
  163. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFilterJSIBinder.h +44 -0
  164. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGForeignObjectJSIBinder.h +57 -0
  165. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGGroupJSIBinder.h +54 -0
  166. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGImageJSIBinder.h +58 -0
  167. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGLineJSIBinder.h +55 -0
  168. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGLinearGradientJSIBinder.h +45 -0
  169. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGMarkerJSIBinder.h +66 -0
  170. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGMaskJSIBinder.h +60 -0
  171. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGPathJSIBinder.h +52 -0
  172. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGPatternJSIBinder.h +67 -0
  173. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGRadialGradientJSIBinder.h +47 -0
  174. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGRectJSIBinder.h +57 -0
  175. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewAndroidJSIBinder.h +67 -0
  176. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSvgViewJSIBinder.h +36 -0
  177. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGSymbolJSIBinder.h +60 -0
  178. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTSpanJSIBinder.h +66 -0
  179. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTextJSIBinder.h +65 -0
  180. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGTextPathJSIBinder.h +71 -0
  181. package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGUseJSIBinder.h +56 -0
  182. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ComponentDescriptors.h +48 -0
  183. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.cpp +20 -0
  184. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/EventEmitters.h +253 -0
  185. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.cpp +977 -0
  186. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.h +1280 -0
  187. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.cpp +45 -0
  188. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/ShadowNodes.h +331 -0
  189. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/States.cpp +18 -0
  190. package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/States.h +441 -0
  191. package/harmony/svg/src/main/cpp/properties/Color.cpp +458 -0
  192. package/harmony/svg/src/main/cpp/properties/Color.h +144 -0
  193. package/harmony/svg/src/main/cpp/properties/Decoration.cpp +41 -0
  194. package/harmony/svg/src/main/cpp/properties/Decoration.h +483 -0
  195. package/harmony/svg/src/main/cpp/properties/Dimension.cpp +64 -0
  196. package/harmony/svg/src/main/cpp/properties/Dimension.h +243 -0
  197. package/harmony/svg/src/main/cpp/properties/Font.cpp +166 -0
  198. package/harmony/svg/src/main/cpp/properties/Font.h +163 -0
  199. package/harmony/svg/src/main/cpp/properties/Offset.h +119 -0
  200. package/harmony/svg/src/main/cpp/properties/PaintState.h +240 -0
  201. package/harmony/svg/src/main/cpp/properties/Rect.h +423 -0
  202. package/harmony/svg/src/main/cpp/properties/Size.h +246 -0
  203. package/harmony/svg/src/main/cpp/properties/SvgPaintState.h +452 -0
  204. package/harmony/svg/src/main/cpp/properties/TextProperties.cpp +91 -0
  205. package/harmony/svg/src/main/cpp/properties/TextProperties.h +56 -0
  206. package/harmony/svg/src/main/cpp/properties/ViewBox.h +108 -0
  207. package/harmony/svg/src/main/cpp/svgImage/RNSVGImageComponentDescriptor.h +41 -0
  208. package/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.cpp +62 -0
  209. package/harmony/svg/src/main/cpp/svgImage/RNSVGImageShadowNode.h +63 -0
  210. package/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.cpp +17 -0
  211. package/harmony/svg/src/main/cpp/svgImage/RNSVGImageState.h +58 -0
  212. package/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.cpp +54 -0
  213. package/harmony/svg/src/main/cpp/turboModules/RNSVGImageModule.h +32 -0
  214. package/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.cpp +101 -0
  215. package/harmony/svg/src/main/cpp/turboModules/RNSVGRenderableModule.h +32 -0
  216. package/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.cpp +71 -0
  217. package/harmony/svg/src/main/cpp/turboModules/RNSVGSvgViewModule.h +32 -0
  218. package/harmony/svg/src/main/cpp/utils/DynamicUtils.h +55 -0
  219. package/harmony/svg/src/main/cpp/utils/FilterManager.h +190 -0
  220. package/harmony/svg/src/main/cpp/utils/GlyphContext.cpp +221 -0
  221. package/harmony/svg/src/main/cpp/utils/GlyphContext.h +106 -0
  222. package/harmony/svg/src/main/cpp/utils/LinearMap.h +69 -0
  223. package/harmony/svg/src/main/cpp/utils/PathParserUtils.cpp +591 -0
  224. package/harmony/svg/src/main/cpp/utils/PathParserUtils.h +93 -0
  225. package/harmony/svg/src/main/cpp/utils/StringUtils.cpp +134 -0
  226. package/harmony/svg/src/main/cpp/utils/StringUtils.h +644 -0
  227. package/harmony/svg/src/main/cpp/utils/SvgAttributesParser.cpp +239 -0
  228. package/harmony/svg/src/main/cpp/utils/SvgAttributesParser.h +277 -0
  229. package/harmony/svg/src/main/cpp/utils/SvgMarkerPositionUtils.h +200 -0
  230. package/harmony/svg/src/main/cpp/utils/SvgUtils.h +176 -0
  231. package/harmony/svg/src/main/cpp/utils/TextPathHelper.cpp +94 -0
  232. package/harmony/svg/src/main/cpp/utils/TextPathHelper.h +61 -0
  233. package/harmony/svg/src/main/ets/RNSVGImageModule.ts +21 -0
  234. package/harmony/svg/src/main/ets/RNSVGRenderableModule.ts +16 -0
  235. package/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts +18 -0
  236. package/harmony/svg/src/main/ets/SvgPackage.ts +58 -0
  237. package/harmony/svg/src/main/module.json5 +7 -0
  238. package/harmony/svg/src/main/resources/base/element/string.json +8 -0
  239. package/harmony/svg/src/main/resources/en_US/element/string.json +8 -0
  240. package/harmony/svg/src/main/resources/zh_CN/element/string.json +8 -0
  241. package/harmony/svg/ts.ts +8 -0
  242. package/harmony/svg.har +0 -0
  243. package/lib/commonjs/css/index.js +55 -0
  244. package/lib/commonjs/css/index.js.map +1 -0
  245. package/lib/commonjs/index.js +26 -0
  246. package/lib/commonjs/index.js.map +1 -0
  247. package/lib/module/css/index.js +4 -0
  248. package/lib/module/css/index.js.map +1 -0
  249. package/lib/module/index.js +3 -0
  250. package/lib/module/index.js.map +1 -0
  251. package/lib/typescript/babel.config.d.ts +8 -0
  252. package/lib/typescript/babel.config.d.ts.map +1 -0
  253. package/lib/typescript/example/babel.config.d.ts +3 -0
  254. package/lib/typescript/example/babel.config.d.ts.map +1 -0
  255. package/lib/typescript/example/contexts.d.ts +3 -0
  256. package/lib/typescript/example/contexts.d.ts.map +1 -0
  257. package/lib/typescript/example/harmony/entry/hvigorfile.d.ts +2 -0
  258. package/lib/typescript/example/harmony/entry/hvigorfile.d.ts.map +1 -0
  259. package/lib/typescript/example/harmony/hvigorfile.d.ts +2 -0
  260. package/lib/typescript/example/harmony/hvigorfile.d.ts.map +1 -0
  261. package/lib/typescript/example/index.d.ts +2 -0
  262. package/lib/typescript/example/index.d.ts.map +1 -0
  263. package/lib/typescript/example/jest.config.d.ts +3 -0
  264. package/lib/typescript/example/jest.config.d.ts.map +1 -0
  265. package/lib/typescript/example/metro.config.d.ts +3 -0
  266. package/lib/typescript/example/metro.config.d.ts.map +1 -0
  267. package/lib/typescript/example/react-native.config.d.ts +3 -0
  268. package/lib/typescript/example/react-native.config.d.ts.map +1 -0
  269. package/lib/typescript/example/scripts/create-build-profile.d.ts +2 -0
  270. package/lib/typescript/example/scripts/create-build-profile.d.ts.map +1 -0
  271. package/lib/typescript/example/src/index.d.ts +3 -0
  272. package/lib/typescript/example/src/index.d.ts.map +1 -0
  273. package/lib/typescript/src/css/index.d.ts +4 -0
  274. package/lib/typescript/src/css/index.d.ts.map +1 -0
  275. package/lib/typescript/src/index.d.ts +3 -0
  276. package/lib/typescript/src/index.d.ts.map +1 -0
  277. package/package.json +54 -0
  278. package/src/css/index.tsx +20 -0
  279. package/src/index.tsx +3 -0
  280. package/tsconfig.json +12 -0
@@ -0,0 +1,59 @@
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 "ShaderEffect.h"
10
+ #include <memory>
11
+ #include <native_drawing/drawing_pen.h>
12
+ #include <native_drawing/drawing_shader_effect.h>
13
+
14
+ namespace rnoh::drawing {
15
+
16
+ class Pen final {
17
+
18
+ using UniqueNativePen = std::unique_ptr<OH_Drawing_Pen, decltype(&OH_Drawing_PenDestroy)>;
19
+
20
+ public:
21
+ using LineCapStyle = OH_Drawing_PenLineCapStyle;
22
+ using LineJoinStyle = OH_Drawing_PenLineJoinStyle;
23
+
24
+ Pen();
25
+
26
+ Pen(Pen const &);
27
+ Pen &operator=(Pen const &);
28
+
29
+ Pen(Pen &&) = default;
30
+ Pen &operator=(Pen &&) = default;
31
+
32
+ ~Pen() noexcept = default;
33
+
34
+ void SetAntiAlias(bool antiAlias);
35
+ void SetColor(uint32_t color);
36
+ void SetAlpha(uint8_t alpha);
37
+ void SetWidth(double width);
38
+ void SetMiterLimit(float miterLimit);
39
+ void SetLineCap(LineCapStyle lineCap);
40
+ void SetLineJoin(LineJoinStyle lineJoin);
41
+ void SetLinearShaderEffect(const OH_Drawing_Point2D *startPt, const OH_Drawing_Point2D *endPt,
42
+ const uint32_t *colors, const float *pos, uint32_t size, OH_Drawing_TileMode mode,
43
+ const OH_Drawing_Matrix *mat);
44
+ void SetRadialShaderEffect(const OH_Drawing_Point2D *startPt, float startRadius, const OH_Drawing_Point2D *endPt,
45
+ float endRadius, const uint32_t *colors, const float *pos, uint32_t size,
46
+ OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat);
47
+ void SetImageShaderEffect(OH_Drawing_Image *image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY,
48
+ const OH_Drawing_SamplingOptions *opt, const OH_Drawing_Matrix *mat);
49
+
50
+ void Reset();
51
+
52
+ OH_Drawing_Pen *get() const { return pen_.get(); }
53
+
54
+ private:
55
+ UniqueNativePen pen_;
56
+ ShaderEffect penShaderEffect_;
57
+ };
58
+
59
+ } // namespace rnoh::drawing
@@ -0,0 +1,47 @@
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 "Rect.h"
8
+
9
+ namespace rnoh {
10
+ namespace drawing {
11
+ Rect::Rect() : Rect(0, 0, 0, 0) {}
12
+
13
+ Rect::Rect(float left, float top, float right, float bottom)
14
+ : rect_(UniqueNativeRect(OH_Drawing_RectCreate(left, top, right, bottom), &OH_Drawing_RectDestroy)) {}
15
+
16
+ Rect::Rect(Rect const &other) : Rect() { *this = other; }
17
+ Rect &Rect::operator=(Rect const &other) {
18
+ OH_Drawing_RectCopy(other.get(), get());
19
+ return *this;
20
+ }
21
+
22
+ bool Rect::Intersect(const Rect &other) { return OH_Drawing_RectIntersect(get(), other.get()); }
23
+
24
+ bool Rect::Join(const Rect &other) { return OH_Drawing_RectJoin(get(), other.get()); }
25
+
26
+ void Rect::SetLeft(float left) { OH_Drawing_RectSetLeft(get(), left); }
27
+
28
+ void Rect::SetTop(float top) { OH_Drawing_RectSetTop(get(), top); }
29
+
30
+ void Rect::SetRight(float right) { OH_Drawing_RectSetRight(get(), right); }
31
+
32
+ void Rect::SetBottom(float bottom) { OH_Drawing_RectSetBottom(get(), bottom); }
33
+
34
+ float Rect::GetLeft() { return OH_Drawing_RectGetLeft(get()); }
35
+
36
+ float Rect::GetTop() { return OH_Drawing_RectGetTop(get()); }
37
+
38
+ float Rect::GetRight() { return OH_Drawing_RectGetRight(get()); }
39
+
40
+ float Rect::GetBottom() { return OH_Drawing_RectGetBottom(get()); }
41
+
42
+ float Rect::GetHeight() { return OH_Drawing_RectGetHeight(get()); }
43
+
44
+ float Rect::GetWidth() { return OH_Drawing_RectGetWidth(get()); }
45
+
46
+ } // namespace drawing
47
+ } // namespace rnoh
@@ -0,0 +1,56 @@
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 <memory>
10
+ #include <native_drawing/drawing_rect.h>
11
+
12
+ namespace rnoh {
13
+ namespace drawing {
14
+ class Rect final {
15
+ using UniqueNativeRect = std::unique_ptr<OH_Drawing_Rect, decltype(&OH_Drawing_RectDestroy)>;
16
+
17
+ public:
18
+ Rect();
19
+ Rect(float left, float top, float right, float bottom);
20
+ Rect(Rect const &);
21
+ Rect &operator=(Rect const &);
22
+ Rect(Rect &&) = default;
23
+ Rect &operator=(Rect &&) = default;
24
+ ~Rect() noexcept = default;
25
+
26
+ bool Intersect(const Rect &other);
27
+
28
+ bool Join(const Rect &other);
29
+
30
+ void SetLeft(float left);
31
+
32
+ void SetTop(float top);
33
+
34
+ void SetRight(float right);
35
+
36
+ void SetBottom(float bottom);
37
+
38
+ float GetLeft();
39
+
40
+ float GetTop();
41
+
42
+ float GetRight();
43
+
44
+ float GetBottom();
45
+
46
+ float GetHeight();
47
+
48
+ float GetWidth();
49
+
50
+ OH_Drawing_Rect *get() const { return rect_.get(); }
51
+
52
+ private:
53
+ UniqueNativeRect rect_;
54
+ };
55
+ } // namespace drawing
56
+ } // namespace rnoh
@@ -0,0 +1,24 @@
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 "RoundRect.h"
8
+
9
+ namespace rnoh {
10
+ namespace drawing {
11
+
12
+ RoundRect::RoundRect(Rect rect, float rx, float ry)
13
+ : rect_(std::move(rect)),
14
+ roundRect_(UniqueNativeRoundRect(OH_Drawing_RoundRectCreate(rect_.get(), rx, ry), &OH_Drawing_RoundRectDestroy)) {
15
+ }
16
+ void RoundRect::SetCorner(CornerPos pos, CornerRadii radii) {
17
+ OH_Drawing_RoundRectSetCorner(roundRect_.get(), pos, radii);
18
+ }
19
+ RoundRect::CornerRadii RoundRect::GetCorner(CornerPos pos) {
20
+ return OH_Drawing_RoundRectGetCorner(roundRect_.get(), pos);
21
+ }
22
+
23
+ } // namespace drawing
24
+ } // namespace rnoh
@@ -0,0 +1,39 @@
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 <memory>
10
+ #include <native_drawing/drawing_round_rect.h>
11
+ #include "Rect.h"
12
+
13
+ namespace rnoh {
14
+ namespace drawing {
15
+ class RoundRect final {
16
+ using UniqueNativeRoundRect = std::unique_ptr<OH_Drawing_RoundRect, decltype(&OH_Drawing_RoundRectDestroy)>;
17
+
18
+ using CornerPos = OH_Drawing_CornerPos;
19
+ using CornerRadii = OH_Drawing_Corner_Radii;
20
+
21
+ public:
22
+ RoundRect(Rect rect, float rx, float ry);
23
+ RoundRect(RoundRect const &) = delete;
24
+ RoundRect &operator=(RoundRect const &) = delete;
25
+ RoundRect(RoundRect &&) = default;
26
+ RoundRect &operator=(RoundRect &&) = default;
27
+ ~RoundRect() noexcept = default;
28
+
29
+ void SetCorner(CornerPos pos, CornerRadii radii);
30
+ CornerRadii GetCorner(CornerPos pos);
31
+
32
+ OH_Drawing_RoundRect *get() const { return roundRect_.get(); }
33
+
34
+ private:
35
+ Rect rect_;
36
+ UniqueNativeRoundRect roundRect_;
37
+ };
38
+ } // namespace drawing
39
+ } // namespace rnoh
@@ -0,0 +1,37 @@
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 "ShaderEffect.h"
8
+
9
+ namespace rnoh::drawing {
10
+
11
+ ShaderEffect::ShaderEffect() : shaderEffect_(UniqueNativeShaderEffect(nullptr, &OH_Drawing_ShaderEffectDestroy)) {}
12
+
13
+ void ShaderEffect::ShaderEffectCreateLinearGradient(const OH_Drawing_Point2D *startPt, const OH_Drawing_Point2D *endPt,
14
+ const uint32_t *colors, const float *pos, uint32_t size,
15
+ OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat) {
16
+ shaderEffect_ = UniqueNativeShaderEffect(
17
+ OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(startPt, endPt, colors, pos, size, mode, mat),
18
+ &OH_Drawing_ShaderEffectDestroy);
19
+ }
20
+
21
+ void ShaderEffect::ShaderEffectCreateRadialGradient(const OH_Drawing_Point2D *startPt, float startRadius,
22
+ const OH_Drawing_Point2D *endPt, float endRadius,
23
+ const uint32_t *colors, const float *pos, uint32_t size,
24
+ OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat) {
25
+ shaderEffect_ = UniqueNativeShaderEffect(OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(
26
+ startPt, startRadius, endPt, endRadius, colors, pos, size, mode, mat),
27
+ &OH_Drawing_ShaderEffectDestroy);
28
+ }
29
+
30
+ void ShaderEffect::ShaderEffectCreateImageShader(OH_Drawing_Image *image, OH_Drawing_TileMode tileX,
31
+ OH_Drawing_TileMode tileY, const OH_Drawing_SamplingOptions *opt,
32
+ const OH_Drawing_Matrix *mat) {
33
+ shaderEffect_ = UniqueNativeShaderEffect(OH_Drawing_ShaderEffectCreateImageShader(image, tileX, tileY, opt, mat),
34
+ &OH_Drawing_ShaderEffectDestroy);
35
+ }
36
+
37
+ } // namespace rnoh::drawing
@@ -0,0 +1,51 @@
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 <memory>
10
+ #include <native_drawing/drawing_shader_effect.h>
11
+ #include <native_drawing/drawing_point.h>
12
+ #include <native_drawing/drawing_matrix.h>
13
+ #include <native_drawing/drawing_types.h>
14
+
15
+ namespace rnoh::drawing {
16
+
17
+ class ShaderEffect final {
18
+
19
+ using UniqueNativeShaderEffect =
20
+ std::unique_ptr<OH_Drawing_ShaderEffect, decltype(&OH_Drawing_ShaderEffectDestroy)>;
21
+
22
+ public:
23
+ ShaderEffect();
24
+
25
+ ShaderEffect(ShaderEffect const &other) = delete;
26
+ ShaderEffect &operator=(ShaderEffect const &other) = delete;
27
+
28
+ ShaderEffect(ShaderEffect &&other) = default;
29
+ ShaderEffect &operator=(ShaderEffect &&other) = default;
30
+
31
+ void ShaderEffectCreateLinearGradient(const OH_Drawing_Point2D *startPt, const OH_Drawing_Point2D *endPt,
32
+ const uint32_t *colors, const float *pos, uint32_t size,
33
+ OH_Drawing_TileMode mode, const OH_Drawing_Matrix *mat);
34
+
35
+ void ShaderEffectCreateRadialGradient(const OH_Drawing_Point2D *startPt, float startRadius,
36
+ const OH_Drawing_Point2D *endPt, float endRadius, const uint32_t *colors,
37
+ const float *pos, uint32_t size, OH_Drawing_TileMode mode,
38
+ const OH_Drawing_Matrix *mat);
39
+
40
+ void ShaderEffectCreateImageShader(OH_Drawing_Image *image, OH_Drawing_TileMode tileX, OH_Drawing_TileMode tileY,
41
+ const OH_Drawing_SamplingOptions *opt, const OH_Drawing_Matrix *mat);
42
+
43
+ ~ShaderEffect() noexcept = default;
44
+
45
+ OH_Drawing_ShaderEffect *get() const { return shaderEffect_.get(); }
46
+
47
+ private:
48
+ UniqueNativeShaderEffect shaderEffect_;
49
+ };
50
+
51
+ } // namespace rnoh::drawing
@@ -0,0 +1,49 @@
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 "TextStyle.h"
8
+
9
+ namespace rnoh::drawing {
10
+ static std::vector<std::string> disableDiscretionaryLigatures = {"liga", "clig", "dlig", "hlig", "cala"};
11
+ static std::vector<std::string> defaultFeatures = {"rlig", "liga", "clig", "calt", "locl",
12
+ "ccmp", "mark", "mkmk", "kern"};
13
+ static std::vector<std::string> additionalLigatures = {"hlig", "cala"};
14
+ static std::string fontWeightTag = "wght";
15
+
16
+ TextStyle::TextStyle() : textStyle_(UniqueTextStyle(OH_Drawing_CreateTextStyle(), OH_Drawing_DestroyTextStyle)) {}
17
+
18
+ void TextStyle::Update(const std::shared_ptr<svg::FontData> &style) {
19
+ auto *ts = textStyle_.get();
20
+ OH_Drawing_SetTextStyleFontSize(ts, style->fontSize);
21
+ OH_Drawing_SetTextStyleFontWeight(ts, static_cast<int>(style->fontWeight));
22
+ OH_Drawing_SetTextStyleFontStyle(ts, static_cast<int>(style->fontStyle));
23
+ if (!style->fontFamily.empty()) {
24
+ std::vector<const char *> ff{style->fontFamily.c_str()};
25
+ OH_Drawing_SetTextStyleFontFamilies(ts, 1, ff.data());
26
+ }
27
+ OH_Drawing_SetTextStyleDecoration(ts, static_cast<int>(style->textDecoration));
28
+ OH_Drawing_SetTextStyleLetterSpacing(ts, style->letterSpacing);
29
+ OH_Drawing_SetTextStyleWordSpacing(ts, style->wordSpacing);
30
+
31
+ for (const auto &key : defaultFeatures) {
32
+ OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 1);
33
+ }
34
+ OH_Drawing_TextStyleAddFontFeature(ts, style->fontFeatureSettings.c_str(), 1);
35
+
36
+ const bool allowOptionalLigatures =
37
+ style->letterSpacing == 0 && style->fontVariantLigatures == svg::FontVariantLigatures::normal;
38
+ if (allowOptionalLigatures) {
39
+ for (const auto &key : additionalLigatures) {
40
+ OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 1);
41
+ }
42
+ } else {
43
+ for (const auto &key : disableDiscretionaryLigatures) {
44
+ OH_Drawing_TextStyleAddFontFeature(ts, key.c_str(), 0);
45
+ }
46
+ }
47
+ }
48
+
49
+ } // namespace rnoh::drawing
@@ -0,0 +1,41 @@
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 <memory>
10
+ #include <native_drawing/drawing_text_typography.h>
11
+ #include "properties/Font.h"
12
+
13
+ namespace rnoh::drawing {
14
+
15
+ class TextStyle final {
16
+
17
+ using UniqueTextStyle = std::unique_ptr<OH_Drawing_TextStyle, decltype(&OH_Drawing_DestroyTextStyle)>;
18
+
19
+ public:
20
+ TextStyle();
21
+ ~TextStyle() noexcept = default;
22
+
23
+ TextStyle(const TextStyle &) = delete;
24
+ TextStyle &operator=(const TextStyle &) = delete;
25
+
26
+ TextStyle(TextStyle &&) = default;
27
+ TextStyle &operator=(TextStyle &&) = default;
28
+
29
+ void SetForegroundPen(OH_Drawing_Pen *pen) { OH_Drawing_SetTextStyleForegroundPen(textStyle_.get(), pen); }
30
+
31
+ void SetForegroundBrush(OH_Drawing_Brush *brush) {
32
+ OH_Drawing_SetTextStyleForegroundBrush(textStyle_.get(), brush);
33
+ }
34
+
35
+ void Update(const std::shared_ptr<svg::FontData> &style);
36
+ // private:
37
+ UniqueTextStyle textStyle_;
38
+ friend class TypographyStyle;
39
+ };
40
+
41
+ } // namespace rnoh::drawing
@@ -0,0 +1,9 @@
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 "Typography.h"
8
+
9
+ // NO-OP
@@ -0,0 +1,25 @@
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 <native_drawing/drawing_text_typography.h>
10
+ #include "TypographyStyle.h"
11
+
12
+ namespace rnoh::drawing {
13
+
14
+ class Typography {
15
+ public:
16
+ Typography(OH_Drawing_TypographyCreate *handler)
17
+ : typ_(TypUPtr(OH_Drawing_CreateTypography(handler), OH_Drawing_DestroyTypography)) {}
18
+ OH_Drawing_Typography *operator&() { return typ_.get(); }
19
+
20
+ private:
21
+ using TypUPtr = std::unique_ptr<OH_Drawing_Typography, decltype(&OH_Drawing_DestroyTypography)>;
22
+ TypUPtr typ_;
23
+ };
24
+
25
+ } // namespace rnoh::drawing
@@ -0,0 +1,31 @@
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 "TypographyStyle.h"
8
+ #include <native_drawing/drawing_text_typography.h>
9
+
10
+ namespace rnoh::drawing {
11
+
12
+ TypographyStyle::TypographyStyle()
13
+ : typographyStyle_(UniqueTypographyStyle(OH_Drawing_CreateTypographyStyle(), OH_Drawing_DestroyTypographyStyle)) {}
14
+
15
+ TypographyStyle::~TypographyStyle() noexcept {}
16
+
17
+ void TypographyStyle::SetTextStyle(TextStyle textStyle) {
18
+ textStyle_ = std::move(textStyle.textStyle_);
19
+ OH_Drawing_SetTypographyTextStyle(typographyStyle_.get(), textStyle_.get());
20
+ }
21
+
22
+ void TypographyStyle::Update(const std::shared_ptr<svg::FontData> &style) {
23
+ auto *ts = typographyStyle_.get();
24
+ OH_Drawing_SetTypographyTextFontWeight(ts, style->absoluteFontWeight);
25
+ OH_Drawing_SetTypographyTextFontStyle(ts, static_cast<int>(style->fontStyle));
26
+ OH_Drawing_SetTypographyTextFontFamily(ts, style->fontFamily.c_str());
27
+ OH_Drawing_SetTypographyTextFontSize(ts, style->fontSize);
28
+ // to be done? TypographyTextAlign
29
+ }
30
+
31
+ } // namespace rnoh::drawing
@@ -0,0 +1,41 @@
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 <memory>
10
+ #include <optional>
11
+ #include <native_drawing/drawing_text_typography.h>
12
+
13
+ #include "TextStyle.h"
14
+ #include "properties/Font.h"
15
+
16
+ namespace rnoh::drawing {
17
+
18
+ class TypographyStyle final {
19
+
20
+ using UniqueTypographyStyle =
21
+ std::unique_ptr<OH_Drawing_TypographyStyle, decltype(&OH_Drawing_DestroyTypographyStyle)>;
22
+
23
+ public:
24
+ TypographyStyle();
25
+ ~TypographyStyle() noexcept;
26
+
27
+ TypographyStyle(const TypographyStyle &) = delete;
28
+ TypographyStyle &operator=(const TypographyStyle &) = delete;
29
+
30
+ TypographyStyle(TypographyStyle &&other) = default;
31
+ TypographyStyle &operator=(TypographyStyle &&other) = default;
32
+
33
+ void SetTextStyle(TextStyle textStyle);
34
+
35
+ void Update(const std::shared_ptr<svg::FontData> &style);
36
+
37
+ UniqueTypographyStyle typographyStyle_;
38
+ TextStyle::UniqueTextStyle textStyle_ = {nullptr, OH_Drawing_DestroyTextStyle};
39
+ };
40
+
41
+ } // namespace rnoh::drawing
@@ -0,0 +1,54 @@
1
+ #pragma once
2
+
3
+ // This file was generated.
4
+
5
+ #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
6
+
7
+ namespace rnoh {
8
+ class RNSVGCircleJSIBinder : public ViewComponentJSIBinder {
9
+ protected:
10
+ facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
11
+ auto object = ViewComponentJSIBinder::createNativeProps(rt);
12
+ object.setProperty(rt, "name", true);
13
+ object.setProperty(rt, "opacity", true);
14
+ object.setProperty(rt, "matrix", true);
15
+ object.setProperty(rt, "mask", true);
16
+ object.setProperty(rt, "markerStart", true);
17
+ object.setProperty(rt, "markerMid", true);
18
+ object.setProperty(rt, "markerEnd", true);
19
+ object.setProperty(rt, "clipPath", true);
20
+ object.setProperty(rt, "clipRule", true);
21
+ object.setProperty(rt, "filter", true);
22
+ object.setProperty(rt, "responsible", true);
23
+ object.setProperty(rt, "display", true);
24
+ object.setProperty(rt, "pointerEvents", true);
25
+ object.setProperty(rt, "fill", "Object");
26
+ object.setProperty(rt, "fillOpacity", true);
27
+ object.setProperty(rt, "fillRule", true);
28
+ object.setProperty(rt, "stroke", "Object");
29
+ object.setProperty(rt, "strokeOpacity", true);
30
+ object.setProperty(rt, "strokeWidth", true);
31
+ object.setProperty(rt, "strokeLinecap", true);
32
+ object.setProperty(rt, "strokeLinejoin", true);
33
+ object.setProperty(rt, "strokeDasharray", true);
34
+ object.setProperty(rt, "strokeDashoffset", true);
35
+ object.setProperty(rt, "strokeMiterlimit", true);
36
+ object.setProperty(rt, "vectorEffect", true);
37
+ object.setProperty(rt, "propList", true);
38
+ object.setProperty(rt, "cx", true);
39
+ object.setProperty(rt, "cy", true);
40
+ object.setProperty(rt, "r", true);
41
+ return object;
42
+ }
43
+
44
+ facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
45
+ facebook::jsi::Object events(rt);
46
+ return events;
47
+ }
48
+
49
+ facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
50
+ facebook::jsi::Object events(rt);
51
+ return events;
52
+ }
53
+ };
54
+ } // namespace rnoh
@@ -0,0 +1,54 @@
1
+ #pragma once
2
+
3
+ // This file was generated.
4
+
5
+ #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
6
+
7
+ namespace rnoh {
8
+ class RNSVGClipPathJSIBinder : public ViewComponentJSIBinder {
9
+ protected:
10
+ facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
11
+ auto object = ViewComponentJSIBinder::createNativeProps(rt);
12
+ object.setProperty(rt, "name", true);
13
+ object.setProperty(rt, "opacity", true);
14
+ object.setProperty(rt, "matrix", true);
15
+ object.setProperty(rt, "mask", true);
16
+ object.setProperty(rt, "markerStart", true);
17
+ object.setProperty(rt, "markerMid", true);
18
+ object.setProperty(rt, "markerEnd", true);
19
+ object.setProperty(rt, "clipPath", true);
20
+ object.setProperty(rt, "clipRule", true);
21
+ object.setProperty(rt, "filter", true);
22
+ object.setProperty(rt, "responsible", true);
23
+ object.setProperty(rt, "display", true);
24
+ object.setProperty(rt, "pointerEvents", true);
25
+ object.setProperty(rt, "fill", "Object");
26
+ object.setProperty(rt, "fillOpacity", true);
27
+ object.setProperty(rt, "fillRule", true);
28
+ object.setProperty(rt, "stroke", "Object");
29
+ object.setProperty(rt, "strokeOpacity", true);
30
+ object.setProperty(rt, "strokeWidth", true);
31
+ object.setProperty(rt, "strokeLinecap", true);
32
+ object.setProperty(rt, "strokeLinejoin", true);
33
+ object.setProperty(rt, "strokeDasharray", true);
34
+ object.setProperty(rt, "strokeDashoffset", true);
35
+ object.setProperty(rt, "strokeMiterlimit", true);
36
+ object.setProperty(rt, "vectorEffect", true);
37
+ object.setProperty(rt, "propList", true);
38
+ object.setProperty(rt, "fontSize", true);
39
+ object.setProperty(rt, "fontWeight", true);
40
+ object.setProperty(rt, "font", "Object");
41
+ return object;
42
+ }
43
+
44
+ facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
45
+ facebook::jsi::Object events(rt);
46
+ return events;
47
+ }
48
+
49
+ facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
50
+ facebook::jsi::Object events(rt);
51
+ return events;
52
+ }
53
+ };
54
+ } // namespace rnoh
@@ -0,0 +1,38 @@
1
+ #pragma once
2
+
3
+ // This file was generated.
4
+
5
+ #include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
6
+
7
+ namespace rnoh {
8
+ class RNSVGDefsJSIBinder : public ViewComponentJSIBinder {
9
+ protected:
10
+ facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
11
+ auto object = ViewComponentJSIBinder::createNativeProps(rt);
12
+ object.setProperty(rt, "name", true);
13
+ object.setProperty(rt, "opacity", true);
14
+ object.setProperty(rt, "matrix", true);
15
+ object.setProperty(rt, "mask", true);
16
+ object.setProperty(rt, "markerStart", true);
17
+ object.setProperty(rt, "markerMid", true);
18
+ object.setProperty(rt, "markerEnd", true);
19
+ object.setProperty(rt, "clipPath", true);
20
+ object.setProperty(rt, "clipRule", true);
21
+ object.setProperty(rt, "filter", true);
22
+ object.setProperty(rt, "responsible", true);
23
+ object.setProperty(rt, "display", true);
24
+ object.setProperty(rt, "pointerEvents", true);
25
+ return object;
26
+ }
27
+
28
+ facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
29
+ facebook::jsi::Object events(rt);
30
+ return events;
31
+ }
32
+
33
+ facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
34
+ facebook::jsi::Object events(rt);
35
+ return events;
36
+ }
37
+ };
38
+ } // namespace rnoh