mathematical 1.6.17 → 1.6.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1186) hide show
  1. checksums.yaml +4 -4
  2. data/ext/mathematical/lasem/COPYING +502 -0
  3. data/ext/mathematical/lasem/NEWS.md +146 -0
  4. data/ext/mathematical/lasem/README.md +65 -0
  5. data/ext/mathematical/lasem/TODO +50 -0
  6. data/ext/mathematical/lasem/docs/lasem-render-0.6.1 +106 -0
  7. data/ext/mathematical/lasem/docs/meson.build +3 -0
  8. data/ext/mathematical/lasem/docs/reference/lasem/building.md +32 -0
  9. data/ext/mathematical/lasem/docs/reference/lasem/lasem.toml.in +47 -0
  10. data/ext/mathematical/lasem/docs/reference/lasem/meson.build +44 -0
  11. data/ext/mathematical/lasem/docs/reference/lasem/overview.md +24 -0
  12. data/ext/mathematical/lasem/docs/reference/lasem/urlmap.js +5 -0
  13. data/ext/mathematical/lasem/itex2mml/COPYING.itex2MML +3 -0
  14. data/ext/mathematical/lasem/itex2mml/README.itex2MML +16 -0
  15. data/ext/mathematical/lasem/itex2mml/itex2MML.h +63 -0
  16. data/ext/mathematical/lasem/itex2mml/itex2MML.l +1183 -0
  17. data/ext/mathematical/lasem/itex2mml/itex2MML.y +2108 -0
  18. data/ext/mathematical/lasem/itex2mml/meson.build +17 -0
  19. data/ext/mathematical/lasem/lasem.doap +21 -0
  20. data/ext/mathematical/lasem/meson.build +46 -0
  21. data/ext/mathematical/lasem/meson_options.txt +5 -0
  22. data/ext/mathematical/lasem/org.lasem.Viewer.json +41 -0
  23. data/ext/mathematical/lasem/po/LINGUAS +31 -0
  24. data/ext/mathematical/lasem/po/POTFILES.in +195 -0
  25. data/ext/mathematical/lasem/po/POTFILES.skip +1 -0
  26. data/ext/mathematical/lasem/po/bs.po +65 -0
  27. data/ext/mathematical/lasem/po/cs.po +102 -0
  28. data/ext/mathematical/lasem/po/da.po +99 -0
  29. data/ext/mathematical/lasem/po/de.po +104 -0
  30. data/ext/mathematical/lasem/po/el.po +73 -0
  31. data/ext/mathematical/lasem/po/es.po +107 -0
  32. data/ext/mathematical/lasem/po/eu.po +66 -0
  33. data/ext/mathematical/lasem/po/fr.po +65 -0
  34. data/ext/mathematical/lasem/po/fur.po +101 -0
  35. data/ext/mathematical/lasem/po/gl.po +64 -0
  36. data/ext/mathematical/lasem/po/hu.po +105 -0
  37. data/ext/mathematical/lasem/po/id.po +102 -0
  38. data/ext/mathematical/lasem/po/it.po +104 -0
  39. data/ext/mathematical/lasem/po/lt.po +106 -0
  40. data/ext/mathematical/lasem/po/lv.po +109 -0
  41. data/ext/mathematical/lasem/po/meson.build +4 -0
  42. data/ext/mathematical/lasem/po/nb.po +62 -0
  43. data/ext/mathematical/lasem/po/nl.po +102 -0
  44. data/ext/mathematical/lasem/po/oc.po +65 -0
  45. data/ext/mathematical/lasem/po/pl.po +102 -0
  46. data/ext/mathematical/lasem/po/pt.po +77 -0
  47. data/ext/mathematical/lasem/po/pt_BR.po +105 -0
  48. data/ext/mathematical/lasem/po/ru.po +66 -0
  49. data/ext/mathematical/lasem/po/sl.po +117 -0
  50. data/ext/mathematical/lasem/po/sr.po +105 -0
  51. data/ext/mathematical/lasem/po/sr@latin.po +105 -0
  52. data/ext/mathematical/lasem/po/sv.po +105 -0
  53. data/ext/mathematical/lasem/po/tg.po +64 -0
  54. data/ext/mathematical/lasem/po/tr.po +105 -0
  55. data/ext/mathematical/lasem/po/zh_CN.po +100 -0
  56. data/ext/mathematical/lasem/src/lasemrender.c +357 -0
  57. data/ext/mathematical/lasem/src/lsm.c +33 -0
  58. data/ext/mathematical/lasem/src/lsm.h +39 -0
  59. data/ext/mathematical/lasem/src/lsmattributes.c +276 -0
  60. data/ext/mathematical/lasem/src/lsmattributes.h +75 -0
  61. data/ext/mathematical/lasem/src/lsmcairo.c +598 -0
  62. data/ext/mathematical/lasem/src/lsmcairo.h +51 -0
  63. data/ext/mathematical/lasem/src/lsmdebug.c +185 -0
  64. data/ext/mathematical/lasem/src/lsmdebug.h +73 -0
  65. data/ext/mathematical/lasem/src/lsmdom.h +43 -0
  66. data/ext/mathematical/lasem/src/lsmdomcharacterdata.c +131 -0
  67. data/ext/mathematical/lasem/src/lsmdomcharacterdata.h +59 -0
  68. data/ext/mathematical/lasem/src/lsmdomdocument.c +272 -0
  69. data/ext/mathematical/lasem/src/lsmdomdocument.h +75 -0
  70. data/ext/mathematical/lasem/src/lsmdomdocumentfragment.c +81 -0
  71. data/ext/mathematical/lasem/src/lsmdomdocumentfragment.h +55 -0
  72. data/ext/mathematical/lasem/src/lsmdomelement.c +148 -0
  73. data/ext/mathematical/lasem/src/lsmdomelement.h +62 -0
  74. data/ext/mathematical/lasem/src/lsmdomentities.c +2166 -0
  75. data/ext/mathematical/lasem/src/lsmdomentities.h +35 -0
  76. data/ext/mathematical/lasem/src/lsmdomimplementation.c +82 -0
  77. data/ext/mathematical/lasem/src/lsmdomimplementation.h +41 -0
  78. data/ext/mathematical/lasem/src/lsmdomnamednodemap.c +118 -0
  79. data/ext/mathematical/lasem/src/lsmdomnamednodemap.h +64 -0
  80. data/ext/mathematical/lasem/src/lsmdomnode.c +737 -0
  81. data/ext/mathematical/lasem/src/lsmdomnode.h +122 -0
  82. data/ext/mathematical/lasem/src/lsmdomnodelist.c +70 -0
  83. data/ext/mathematical/lasem/src/lsmdomnodelist.h +58 -0
  84. data/ext/mathematical/lasem/src/lsmdomparser.c +523 -0
  85. data/ext/mathematical/lasem/src/lsmdomparser.h +54 -0
  86. data/ext/mathematical/lasem/src/lsmdomtext.c +82 -0
  87. data/ext/mathematical/lasem/src/lsmdomtext.h +55 -0
  88. data/ext/mathematical/lasem/src/lsmdomtypes.h +44 -0
  89. data/ext/mathematical/lasem/src/lsmdomview.c +423 -0
  90. data/ext/mathematical/lasem/src/lsmdomview.h +94 -0
  91. data/ext/mathematical/lasem/src/lsmitex.c +79 -0
  92. data/ext/mathematical/lasem/src/lsmitex.h +36 -0
  93. data/ext/mathematical/lasem/src/lsmmathml.h +66 -0
  94. data/ext/mathematical/lasem/src/lsmmathmlactionelement.c +93 -0
  95. data/ext/mathematical/lasem/src/lsmmathmlactionelement.h +57 -0
  96. data/ext/mathematical/lasem/src/lsmmathmlaligngroupelement.c +102 -0
  97. data/ext/mathematical/lasem/src/lsmmathmlaligngroupelement.h +56 -0
  98. data/ext/mathematical/lasem/src/lsmmathmlalignmarkelement.c +102 -0
  99. data/ext/mathematical/lasem/src/lsmmathmlalignmarkelement.h +56 -0
  100. data/ext/mathematical/lasem/src/lsmmathmlattributes.c +219 -0
  101. data/ext/mathematical/lasem/src/lsmmathmlattributes.h +126 -0
  102. data/ext/mathematical/lasem/src/lsmmathmldocument.c +307 -0
  103. data/ext/mathematical/lasem/src/lsmmathmldocument.h +61 -0
  104. data/ext/mathematical/lasem/src/lsmmathmlelement.c +491 -0
  105. data/ext/mathematical/lasem/src/lsmmathmlelement.h +107 -0
  106. data/ext/mathematical/lasem/src/lsmmathmlencloseelement.c +142 -0
  107. data/ext/mathematical/lasem/src/lsmmathmlencloseelement.h +64 -0
  108. data/ext/mathematical/lasem/src/lsmmathmlenums.c +500 -0
  109. data/ext/mathematical/lasem/src/lsmmathmlenums.h +224 -0
  110. data/ext/mathematical/lasem/src/lsmmathmlerrorelement.c +58 -0
  111. data/ext/mathematical/lasem/src/lsmmathmlerrorelement.h +56 -0
  112. data/ext/mathematical/lasem/src/lsmmathmlfencedelement.c +180 -0
  113. data/ext/mathematical/lasem/src/lsmmathmlfencedelement.h +65 -0
  114. data/ext/mathematical/lasem/src/lsmmathmlfractionelement.c +253 -0
  115. data/ext/mathematical/lasem/src/lsmmathmlfractionelement.h +62 -0
  116. data/ext/mathematical/lasem/src/lsmmathmlglyphtableams.c +661 -0
  117. data/ext/mathematical/lasem/src/lsmmathmlglyphtableams.h +45 -0
  118. data/ext/mathematical/lasem/src/lsmmathmlitexelement.c +189 -0
  119. data/ext/mathematical/lasem/src/lsmmathmlitexelement.h +60 -0
  120. data/ext/mathematical/lasem/src/lsmmathmllayoututils.c +191 -0
  121. data/ext/mathematical/lasem/src/lsmmathmllayoututils.h +58 -0
  122. data/ext/mathematical/lasem/src/lsmmathmlmathelement.c +212 -0
  123. data/ext/mathematical/lasem/src/lsmmathmlmathelement.h +81 -0
  124. data/ext/mathematical/lasem/src/lsmmathmloperatordictionary.c +3342 -0
  125. data/ext/mathematical/lasem/src/lsmmathmloperatordictionary.h +55 -0
  126. data/ext/mathematical/lasem/src/lsmmathmloperatorelement.c +314 -0
  127. data/ext/mathematical/lasem/src/lsmmathmloperatorelement.h +73 -0
  128. data/ext/mathematical/lasem/src/lsmmathmlpaddedelement.c +137 -0
  129. data/ext/mathematical/lasem/src/lsmmathmlpaddedelement.h +61 -0
  130. data/ext/mathematical/lasem/src/lsmmathmlphantomelement.c +71 -0
  131. data/ext/mathematical/lasem/src/lsmmathmlphantomelement.h +56 -0
  132. data/ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.c +43 -0
  133. data/ext/mathematical/lasem/src/lsmmathmlpresentationcontainer.h +54 -0
  134. data/ext/mathematical/lasem/src/lsmmathmlpresentationtoken.c +303 -0
  135. data/ext/mathematical/lasem/src/lsmmathmlpresentationtoken.h +83 -0
  136. data/ext/mathematical/lasem/src/lsmmathmlradicalelement.c +266 -0
  137. data/ext/mathematical/lasem/src/lsmmathmlradicalelement.h +71 -0
  138. data/ext/mathematical/lasem/src/lsmmathmlrowelement.c +58 -0
  139. data/ext/mathematical/lasem/src/lsmmathmlrowelement.h +56 -0
  140. data/ext/mathematical/lasem/src/lsmmathmlscriptelement.c +282 -0
  141. data/ext/mathematical/lasem/src/lsmmathmlscriptelement.h +78 -0
  142. data/ext/mathematical/lasem/src/lsmmathmlsemanticselement.c +84 -0
  143. data/ext/mathematical/lasem/src/lsmmathmlsemanticselement.h +56 -0
  144. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.c +156 -0
  145. data/ext/mathematical/lasem/src/lsmmathmlspaceelement.h +60 -0
  146. data/ext/mathematical/lasem/src/lsmmathmlstringelement.c +123 -0
  147. data/ext/mathematical/lasem/src/lsmmathmlstringelement.h +58 -0
  148. data/ext/mathematical/lasem/src/lsmmathmlstyle.c +130 -0
  149. data/ext/mathematical/lasem/src/lsmmathmlstyle.h +89 -0
  150. data/ext/mathematical/lasem/src/lsmmathmlstyleelement.c +391 -0
  151. data/ext/mathematical/lasem/src/lsmmathmlstyleelement.h +94 -0
  152. data/ext/mathematical/lasem/src/lsmmathmltablecellelement.c +122 -0
  153. data/ext/mathematical/lasem/src/lsmmathmltablecellelement.h +62 -0
  154. data/ext/mathematical/lasem/src/lsmmathmltableelement.c +572 -0
  155. data/ext/mathematical/lasem/src/lsmmathmltableelement.h +78 -0
  156. data/ext/mathematical/lasem/src/lsmmathmltablerowelement.c +120 -0
  157. data/ext/mathematical/lasem/src/lsmmathmltablerowelement.h +64 -0
  158. data/ext/mathematical/lasem/src/lsmmathmltraits.c +867 -0
  159. data/ext/mathematical/lasem/src/lsmmathmltraits.h +129 -0
  160. data/ext/mathematical/lasem/src/lsmmathmltypes.h +67 -0
  161. data/ext/mathematical/lasem/src/lsmmathmlunderoverelement.c +485 -0
  162. data/ext/mathematical/lasem/src/lsmmathmlunderoverelement.h +82 -0
  163. data/ext/mathematical/lasem/src/lsmmathmlutils.c +170 -0
  164. data/ext/mathematical/lasem/src/lsmmathmlutils.h +57 -0
  165. data/ext/mathematical/lasem/src/lsmmathmlview.c +1343 -0
  166. data/ext/mathematical/lasem/src/lsmmathmlview.h +179 -0
  167. data/ext/mathematical/lasem/src/lsmmisc.c +15 -0
  168. data/ext/mathematical/lasem/src/lsmmisc.h +32 -0
  169. data/ext/mathematical/lasem/src/lsmproperties.c +415 -0
  170. data/ext/mathematical/lasem/src/lsmproperties.h +85 -0
  171. data/ext/mathematical/lasem/src/lsmstr.c +231 -0
  172. data/ext/mathematical/lasem/src/lsmstr.h +114 -0
  173. data/ext/mathematical/lasem/src/lsmsvg.h +67 -0
  174. data/ext/mathematical/lasem/src/lsmsvgaelement.c +73 -0
  175. data/ext/mathematical/lasem/src/lsmsvgaelement.h +55 -0
  176. data/ext/mathematical/lasem/src/lsmsvgattributes.h +168 -0
  177. data/ext/mathematical/lasem/src/lsmsvgcircleelement.c +153 -0
  178. data/ext/mathematical/lasem/src/lsmsvgcircleelement.h +59 -0
  179. data/ext/mathematical/lasem/src/lsmsvgclippathelement.c +134 -0
  180. data/ext/mathematical/lasem/src/lsmsvgclippathelement.h +59 -0
  181. data/ext/mathematical/lasem/src/lsmsvgcolors.c +212 -0
  182. data/ext/mathematical/lasem/src/lsmsvgcolors.h +39 -0
  183. data/ext/mathematical/lasem/src/lsmsvgdefselement.c +74 -0
  184. data/ext/mathematical/lasem/src/lsmsvgdefselement.h +55 -0
  185. data/ext/mathematical/lasem/src/lsmsvgdocument.c +306 -0
  186. data/ext/mathematical/lasem/src/lsmsvgdocument.h +64 -0
  187. data/ext/mathematical/lasem/src/lsmsvgelement.c +371 -0
  188. data/ext/mathematical/lasem/src/lsmsvgelement.h +80 -0
  189. data/ext/mathematical/lasem/src/lsmsvgellipseelement.c +158 -0
  190. data/ext/mathematical/lasem/src/lsmsvgellipseelement.h +60 -0
  191. data/ext/mathematical/lasem/src/lsmsvgenums.c +674 -0
  192. data/ext/mathematical/lasem/src/lsmsvgenums.h +416 -0
  193. data/ext/mathematical/lasem/src/lsmsvgfilterblend.c +105 -0
  194. data/ext/mathematical/lasem/src/lsmsvgfilterblend.h +58 -0
  195. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.c +115 -0
  196. data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.h +58 -0
  197. data/ext/mathematical/lasem/src/lsmsvgfiltercomposite.c +109 -0
  198. data/ext/mathematical/lasem/src/lsmsvgfiltercomposite.h +58 -0
  199. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.c +206 -0
  200. data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.h +64 -0
  201. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.c +124 -0
  202. data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.h +60 -0
  203. data/ext/mathematical/lasem/src/lsmsvgfilterelement.c +266 -0
  204. data/ext/mathematical/lasem/src/lsmsvgfilterelement.h +66 -0
  205. data/ext/mathematical/lasem/src/lsmsvgfilterflood.c +86 -0
  206. data/ext/mathematical/lasem/src/lsmsvgfilterflood.h +55 -0
  207. data/ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.c +114 -0
  208. data/ext/mathematical/lasem/src/lsmsvgfiltergaussianblur.h +57 -0
  209. data/ext/mathematical/lasem/src/lsmsvgfilterimage.c +169 -0
  210. data/ext/mathematical/lasem/src/lsmsvgfilterimage.h +61 -0
  211. data/ext/mathematical/lasem/src/lsmsvgfiltermerge.c +98 -0
  212. data/ext/mathematical/lasem/src/lsmsvgfiltermerge.h +55 -0
  213. data/ext/mathematical/lasem/src/lsmsvgfiltermergenode.c +87 -0
  214. data/ext/mathematical/lasem/src/lsmsvgfiltermergenode.h +57 -0
  215. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.c +116 -0
  216. data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.h +58 -0
  217. data/ext/mathematical/lasem/src/lsmsvgfilteroffset.c +112 -0
  218. data/ext/mathematical/lasem/src/lsmsvgfilteroffset.h +58 -0
  219. data/ext/mathematical/lasem/src/lsmsvgfilterprimitive.c +168 -0
  220. data/ext/mathematical/lasem/src/lsmsvgfilterprimitive.h +66 -0
  221. data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c +134 -0
  222. data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.h +60 -0
  223. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.c +1540 -0
  224. data/ext/mathematical/lasem/src/lsmsvgfiltersurface.h +92 -0
  225. data/ext/mathematical/lasem/src/lsmsvgfiltertile.c +102 -0
  226. data/ext/mathematical/lasem/src/lsmsvgfiltertile.h +57 -0
  227. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.c +142 -0
  228. data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.h +61 -0
  229. data/ext/mathematical/lasem/src/lsmsvggelement.c +73 -0
  230. data/ext/mathematical/lasem/src/lsmsvggelement.h +55 -0
  231. data/ext/mathematical/lasem/src/lsmsvggradientelement.c +151 -0
  232. data/ext/mathematical/lasem/src/lsmsvggradientelement.h +68 -0
  233. data/ext/mathematical/lasem/src/lsmsvgimageelement.c +261 -0
  234. data/ext/mathematical/lasem/src/lsmsvgimageelement.h +67 -0
  235. data/ext/mathematical/lasem/src/lsmsvglength.c +152 -0
  236. data/ext/mathematical/lasem/src/lsmsvglength.h +65 -0
  237. data/ext/mathematical/lasem/src/lsmsvglineargradientelement.c +271 -0
  238. data/ext/mathematical/lasem/src/lsmsvglineargradientelement.h +60 -0
  239. data/ext/mathematical/lasem/src/lsmsvglineelement.c +153 -0
  240. data/ext/mathematical/lasem/src/lsmsvglineelement.h +60 -0
  241. data/ext/mathematical/lasem/src/lsmsvgmarkerelement.c +266 -0
  242. data/ext/mathematical/lasem/src/lsmsvgmarkerelement.h +74 -0
  243. data/ext/mathematical/lasem/src/lsmsvgmaskelement.c +232 -0
  244. data/ext/mathematical/lasem/src/lsmsvgmaskelement.h +64 -0
  245. data/ext/mathematical/lasem/src/lsmsvgmatrix.c +221 -0
  246. data/ext/mathematical/lasem/src/lsmsvgmatrix.h +60 -0
  247. data/ext/mathematical/lasem/src/lsmsvgpathelement.c +115 -0
  248. data/ext/mathematical/lasem/src/lsmsvgpathelement.h +59 -0
  249. data/ext/mathematical/lasem/src/lsmsvgpatternelement.c +398 -0
  250. data/ext/mathematical/lasem/src/lsmsvgpatternelement.h +69 -0
  251. data/ext/mathematical/lasem/src/lsmsvgpolygonelement.c +106 -0
  252. data/ext/mathematical/lasem/src/lsmsvgpolygonelement.h +57 -0
  253. data/ext/mathematical/lasem/src/lsmsvgpolylineelement.c +106 -0
  254. data/ext/mathematical/lasem/src/lsmsvgpolylineelement.h +57 -0
  255. data/ext/mathematical/lasem/src/lsmsvgradialgradientelement.c +323 -0
  256. data/ext/mathematical/lasem/src/lsmsvgradialgradientelement.h +61 -0
  257. data/ext/mathematical/lasem/src/lsmsvgrectelement.c +184 -0
  258. data/ext/mathematical/lasem/src/lsmsvgrectelement.h +62 -0
  259. data/ext/mathematical/lasem/src/lsmsvgstopelement.c +106 -0
  260. data/ext/mathematical/lasem/src/lsmsvgstopelement.h +57 -0
  261. data/ext/mathematical/lasem/src/lsmsvgstyle.c +546 -0
  262. data/ext/mathematical/lasem/src/lsmsvgstyle.h +217 -0
  263. data/ext/mathematical/lasem/src/lsmsvgsvgelement.c +266 -0
  264. data/ext/mathematical/lasem/src/lsmsvgsvgelement.h +71 -0
  265. data/ext/mathematical/lasem/src/lsmsvgswitchelement.c +103 -0
  266. data/ext/mathematical/lasem/src/lsmsvgswitchelement.h +55 -0
  267. data/ext/mathematical/lasem/src/lsmsvgsymbolelement.c +148 -0
  268. data/ext/mathematical/lasem/src/lsmsvgsymbolelement.h +58 -0
  269. data/ext/mathematical/lasem/src/lsmsvgtextelement.c +203 -0
  270. data/ext/mathematical/lasem/src/lsmsvgtextelement.h +60 -0
  271. data/ext/mathematical/lasem/src/lsmsvgtraits.c +1490 -0
  272. data/ext/mathematical/lasem/src/lsmsvgtraits.h +122 -0
  273. data/ext/mathematical/lasem/src/lsmsvgtransformable.c +106 -0
  274. data/ext/mathematical/lasem/src/lsmsvgtransformable.h +54 -0
  275. data/ext/mathematical/lasem/src/lsmsvgtspanelement.c +174 -0
  276. data/ext/mathematical/lasem/src/lsmsvgtspanelement.h +60 -0
  277. data/ext/mathematical/lasem/src/lsmsvgtypes.h +83 -0
  278. data/ext/mathematical/lasem/src/lsmsvguseelement.c +238 -0
  279. data/ext/mathematical/lasem/src/lsmsvguseelement.h +69 -0
  280. data/ext/mathematical/lasem/src/lsmsvgview.c +2797 -0
  281. data/ext/mathematical/lasem/src/lsmsvgview.h +203 -0
  282. data/ext/mathematical/lasem/src/lsmtraits.c +171 -0
  283. data/ext/mathematical/lasem/src/lsmtraits.h +51 -0
  284. data/ext/mathematical/lasem/src/lsmtypes.h +36 -0
  285. data/ext/mathematical/lasem/src/lsmutils.c +54 -0
  286. data/ext/mathematical/lasem/src/lsmutils.h +56 -0
  287. data/ext/mathematical/lasem/src/meson.build +321 -0
  288. data/ext/mathematical/lasem/subprojects/gi-docgen.wrap +6 -0
  289. data/ext/mathematical/lasem/tests/data/mathml/gtkmathview/README +5 -0
  290. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-02.tex +1 -0
  291. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-03-inline.tex +1 -0
  292. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction-03.tex +1 -0
  293. data/ext/mathematical/lasem/tests/data/mathml/tex/fractions/fraction.tex +1 -0
  294. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/closed.tex +1 -0
  295. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/multiples.tex +1 -0
  296. data/ext/mathematical/lasem/tests/data/mathml/tex/integrals/standard.tex +1 -0
  297. data/ext/mathematical/lasem/tests/data/mathml/tex/matrices/matrix-01.tex +5 -0
  298. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/array.tex +3 -0
  299. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases-cr.tex +7 -0
  300. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases-space.tex +7 -0
  301. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/cases.tex +7 -0
  302. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/color.tex +1 -0
  303. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex-2.tex +1 -0
  304. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex-inline.tex +7 -0
  305. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/complex.tex +7 -0
  306. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/quadratic-inline.tex +1 -0
  307. data/ext/mathematical/lasem/tests/data/mathml/tex/misc/quadratic.tex +1 -0
  308. data/ext/mathematical/lasem/tests/data/mathml/tex/radicals/radical-01.tex +1 -0
  309. data/ext/mathematical/lasem/tests/data/mathml/tex/radicals/radical-02.tex +1 -0
  310. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/accents.tex +1 -0
  311. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/script.tex +1 -0
  312. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/stack.tex +1 -0
  313. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/subscript.tex +1 -0
  314. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/sums-inline.tex +1 -0
  315. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/sums.tex +1 -0
  316. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/superscript-inline.tex +1 -0
  317. data/ext/mathematical/lasem/tests/data/mathml/tex/scripts/superscript.tex +1 -0
  318. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/bmpCursor.bmp +0 -0
  319. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/brushedMetal.jpg +0 -0
  320. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/jpeg.jpg +0 -0
  321. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/jpegCursor.jpg +0 -0
  322. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaBridge.jpg +0 -0
  323. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaSteps.jpg +0 -0
  324. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/operaWalk.jpg +0 -0
  325. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors.tif +0 -0
  326. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_pb.tif +0 -0
  327. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_pb_tile.tif +0 -0
  328. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/sm_colors_tile.tif +0 -0
  329. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/tde.jpg +0 -0
  330. data/ext/mathematical/lasem/tests/data/svg/batik/resources/images/tiffCursor.tif +0 -0
  331. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/image1.jpg +0 -0
  332. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/struct-image-01.jpg +0 -0
  333. data/ext/mathematical/lasem/tests/data/svg/svg1.1/images/struct-image-02.jpg +0 -0
  334. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/CNN.3gp +0 -0
  335. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/SVG-1.1-monolithic-fixed.dtd +1622 -0
  336. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/TraitAccess.common.es +672 -0
  337. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/advice.wav +0 -0
  338. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/beep.wav +0 -0
  339. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/boing_x.wav +0 -0
  340. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/clock.mp4 +0 -0
  341. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud-ps411q4app.jpg +0 -0
  342. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q25s.jpg +0 -0
  343. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q65float.jpg +0 -0
  344. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75o.jpg +0 -0
  345. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75p.jpg +0 -0
  346. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud411q75s.jpg +0 -0
  347. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloud444q65o.jpg +0 -0
  348. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudgsq75s.jpg +0 -0
  349. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudoddq65o.jpg +0 -0
  350. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/cloudqllo.jpg +0 -0
  351. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/copyright-documents-19990405.html +89 -0
  352. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/disco.jpg +0 -0
  353. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.3gp +0 -0
  354. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.jpg +0 -0
  355. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/dogandball.mov +0 -0
  356. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/duckfeeding.3gp +0 -0
  357. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/duckfeeding.mov +0 -0
  358. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/excuse_me.wav +0 -0
  359. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/externalscript.js +1 -0
  360. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton.jpg +0 -0
  361. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton1.jpg +0 -0
  362. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton2.jpg +0 -0
  363. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton3.jpg +0 -0
  364. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/greentopbutton4.jpg +0 -0
  365. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/heroesLanding.3gp +0 -0
  366. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/image1.jpg +0 -0
  367. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/image2_b.jpg +0 -0
  368. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/myimage.jpg +0 -0
  369. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pacman.wav +0 -0
  370. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/plant.jpg +0 -0
  371. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image0.jpg +0 -0
  372. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image1.jpg +0 -0
  373. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image2.jpg +0 -0
  374. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image3.jpg +0 -0
  375. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image4.jpg +0 -0
  376. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image5.jpg +0 -0
  377. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image6.jpg +0 -0
  378. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image7.jpg +0 -0
  379. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image8.jpg +0 -0
  380. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/pref_image9.jpg +0 -0
  381. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script1.js +1 -0
  382. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script10.js +1 -0
  383. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script2.js +1 -0
  384. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script3.js +1 -0
  385. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script4.js +1 -0
  386. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script5.js +1 -0
  387. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script6.js +1 -0
  388. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script7.js +1 -0
  389. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script8.js +1 -0
  390. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/script9.js +1 -0
  391. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/skier.3gp +0 -0
  392. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/skier.jpg +0 -0
  393. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/struct-image-01.jpg +0 -0
  394. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/struct-image-02.jpg +0 -0
  395. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/svgRef4.css +4 -0
  396. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/welcome.wav +0 -0
  397. data/ext/mathematical/lasem/tests/data/svg/svg1.2/images/xmltree.xml +4 -0
  398. data/ext/mathematical/lasem/tests/dom.c +266 -0
  399. data/ext/mathematical/lasem/tests/filter.c +153 -0
  400. data/ext/mathematical/lasem/tests/fuzztest.sh +12 -0
  401. data/ext/mathematical/lasem/tests/lasem.supp +185 -0
  402. data/ext/mathematical/lasem/tests/lsmtest.c +592 -0
  403. data/ext/mathematical/lasem/tests/meson.build +39 -0
  404. data/ext/mathematical/lasem/tests/str.c +44 -0
  405. data/ext/mathematical/lasem/tests/suite.c +140 -0
  406. data/ext/mathematical/lasem/tests/suite.ini +27 -0
  407. data/ext/mathematical/lasem/tools/change-license +3 -0
  408. data/ext/mathematical/lasem/tools/charlist.dtd +73 -0
  409. data/ext/mathematical/lasem/tools/entities-to-c.xsl +1067 -0
  410. data/ext/mathematical/lasem/tools/fuzzxml +243 -0
  411. data/ext/mathematical/lasem/tools/generate-entity-array.c +2136 -0
  412. data/ext/mathematical/lasem/tools/unicode.xml +44303 -0
  413. data/ext/mathematical/lasem/viewer/meson.build +17 -0
  414. data/ext/mathematical/lasem/viewer/viewer.c +248 -0
  415. data/ext/mathematical/lasem_overrides.c +4 -8
  416. data/ext/mathematical/mathematical.c +7 -9
  417. data/ext/mathematical/mtex2MML/CMakeLists.txt +255 -0
  418. data/ext/mathematical/mtex2MML/CONTRIBUTING.md +22 -0
  419. data/ext/mathematical/mtex2MML/README.md +143 -0
  420. data/ext/mathematical/mtex2MML/SUPPORTED.md +1216 -0
  421. data/ext/mathematical/mtex2MML/appveyor.yml +35 -0
  422. data/ext/mathematical/mtex2MML/cmake/Modules/astyle.cmake +12 -0
  423. data/ext/mathematical/mtex2MML/deps/uthash/package.json +27 -0
  424. data/ext/mathematical/mtex2MML/deps/uthash/utarray.h +239 -0
  425. data/ext/mathematical/mtex2MML/deps/uthash/uthash.h +1074 -0
  426. data/ext/mathematical/mtex2MML/deps/uthash/utlist.h +895 -0
  427. data/ext/mathematical/mtex2MML/deps/uthash/utringbuffer.h +108 -0
  428. data/ext/mathematical/mtex2MML/deps/uthash/utstring.h +398 -0
  429. data/ext/mathematical/mtex2MML/script/bootstrap +39 -0
  430. data/ext/mathematical/mtex2MML/script/cibuild +58 -0
  431. data/ext/mathematical/mtex2MML/script/tag +28 -0
  432. data/ext/mathematical/mtex2MML/src/colors.c +44 -0
  433. data/ext/mathematical/mtex2MML/src/colors.h +23 -0
  434. data/ext/mathematical/mtex2MML/src/em.c +99 -0
  435. data/ext/mathematical/mtex2MML/src/em.h +31 -0
  436. data/ext/mathematical/mtex2MML/src/environment.c +515 -0
  437. data/ext/mathematical/mtex2MML/src/environment.h +85 -0
  438. data/ext/mathematical/mtex2MML/src/lexer.l +1594 -0
  439. data/ext/mathematical/mtex2MML/src/libmtex2MML.pc.in +10 -0
  440. data/ext/mathematical/mtex2MML/src/main.c +187 -0
  441. data/ext/mathematical/mtex2MML/src/mtex2MML.h +89 -0
  442. data/ext/mathematical/mtex2MML/src/parser.y +3817 -0
  443. data/ext/mathematical/mtex2MML/src/string_dup.c +23 -0
  444. data/ext/mathematical/mtex2MML/src/string_dup.h +23 -0
  445. data/ext/mathematical/mtex2MML/src/string_extras.c +47 -0
  446. data/ext/mathematical/mtex2MML/src/string_extras.h +30 -0
  447. data/ext/mathematical/mtex2MML/src/win32-shims/unistd.h +51 -0
  448. data/ext/mathematical/mtex2MML/tests/array.c +127 -0
  449. data/ext/mathematical/mtex2MML/tests/basic.c +96 -0
  450. data/ext/mathematical/mtex2MML/tests/clar/fixtures.h +38 -0
  451. data/ext/mathematical/mtex2MML/tests/clar/fs.h +335 -0
  452. data/ext/mathematical/mtex2MML/tests/clar/print.h +66 -0
  453. data/ext/mathematical/mtex2MML/tests/clar/sandbox.h +141 -0
  454. data/ext/mathematical/mtex2MML/tests/clar.c +644 -0
  455. data/ext/mathematical/mtex2MML/tests/clar.h +163 -0
  456. data/ext/mathematical/mtex2MML/tests/clar_test.h +20 -0
  457. data/ext/mathematical/mtex2MML/tests/cornercases.c +46 -0
  458. data/ext/mathematical/mtex2MML/tests/debug/mtex2MML_debug.cc +21 -0
  459. data/ext/mathematical/mtex2MML/tests/delimiters.c +242 -0
  460. data/ext/mathematical/mtex2MML/tests/deps/file2str/file2str.c +62 -0
  461. data/ext/mathematical/mtex2MML/tests/deps/file2str/file2str.h +12 -0
  462. data/ext/mathematical/mtex2MML/tests/deps/file2str/package.json +9 -0
  463. data/ext/mathematical/mtex2MML/tests/deps/mkdtemp/mkdtemp.c +151 -0
  464. data/ext/mathematical/mtex2MML/tests/deps/mkdtemp/mkdtemp.h +10 -0
  465. data/ext/mathematical/mtex2MML/tests/deps/trim/package.json +7 -0
  466. data/ext/mathematical/mtex2MML/tests/deps/trim/trim.c +27 -0
  467. data/ext/mathematical/mtex2MML/tests/deps/trim/trim.h +7 -0
  468. data/ext/mathematical/mtex2MML/tests/env.c +334 -0
  469. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-1.html +86 -0
  470. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-2.html +148 -0
  471. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/amscd-3.html +188 -0
  472. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/arrows-2.html +156 -0
  473. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/min-1.html +45 -0
  474. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/AMScd/min-2.html +35 -0
  475. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-1.html +16 -0
  476. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-2.html +3 -0
  477. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/accents-3.html +5 -0
  478. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/buildrel-1.html +3 -0
  479. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue490.html +0 -0
  480. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue877.html +3 -0
  481. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/issue937.html +3 -0
  482. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overbrace-1.html +3 -0
  483. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overbracket-1.html +3 -0
  484. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/overset-1.html +3 -0
  485. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/sideset-1.html +5 -0
  486. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/stackrel-1.html +3 -0
  487. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/subarray-1.html +1 -0
  488. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/substack-1.html +3 -0
  489. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underbrace-1.html +3 -0
  490. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underbracket-1.html +3 -0
  491. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/above-below/underset-1.html +3 -0
  492. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/mathtip-1.html +6 -0
  493. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/texttip-1.html +6 -0
  494. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/action/toggle-1.html +7 -0
  495. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/Newextarrow-1.html +10 -0
  496. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-1.html +34 -0
  497. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-2.html +30 -0
  498. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-3.html +9 -0
  499. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-4.html +13 -0
  500. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/arrows/arrows-5.html +7 -0
  501. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathbin-1.html +7 -0
  502. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathinner-1.html +3 -0
  503. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-1a.html +3 -0
  504. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-1b.html +5 -0
  505. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathop-2.html +5 -0
  506. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathopenclose-1.html +3 -0
  507. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathord-1.html +3 -0
  508. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathpunct-1.html +3 -0
  509. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/atoms/mathrel-1.html +3 -0
  510. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/backslashed-1.html +16 -0
  511. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/basic-operators-1.html +3 -0
  512. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/basic-operators-2.html +25 -0
  513. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/basic-operators/remap-1.html +5 -0
  514. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/color-1.html +3 -0
  515. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/colorbox-1.html +3 -0
  516. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/definecolor-1.html +37 -0
  517. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/definecolor-2.html +79 -0
  518. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/fcolorbox-1.html +7 -0
  519. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/issue446.html +5 -0
  520. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/colors/namedcolors-1.html +70 -0
  521. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-1.html +3 -0
  522. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-2.html +3 -0
  523. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/big-3.html +3 -0
  524. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/delimiters-1.html +3 -0
  525. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/delimiters-2.html +4 -0
  526. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue775.html +3 -0
  527. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-1a.html +6 -0
  528. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-1b.html +6 -0
  529. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-2.html +6 -0
  530. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-3.html +6 -0
  531. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-4.html +6 -0
  532. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/issue776-5.html +6 -0
  533. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/delimiters/left-right-1.html +3 -0
  534. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/align-1a.html +7 -0
  535. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/align-1b.html +7 -0
  536. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignat-1a.html +6 -0
  537. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignat-1b.html +6 -0
  538. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/aligned-1.html +9 -0
  539. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/aligned-2.html +14 -0
  540. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/alignedat-1.html +8 -0
  541. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqalign-1.html +8 -0
  542. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqalignno-1.html +8 -0
  543. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-1a.html +7 -0
  544. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-1b.html +7 -0
  545. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/eqnarray-2.html +64 -0
  546. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/equation-1.html +5 -0
  547. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/equation-2.html +5 -0
  548. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gather-1a.html +7 -0
  549. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gather-1b.html +7 -0
  550. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gathered-1.html +7 -0
  551. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/gathered-2.html +12 -0
  552. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-1a.html +5 -0
  553. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-1b.html +5 -0
  554. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-2a.html +5 -0
  555. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-2b.html +5 -0
  556. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-3a.html +5 -0
  557. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/issue982-3b.html +5 -0
  558. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/leqalignno-1.html +11 -0
  559. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/multline-1a.html +7 -0
  560. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/multline-1b.html +7 -0
  561. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/environments/split-1.html +9 -0
  562. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/errors/noErrors-1.html +5 -0
  563. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/errors/noUndefined-1.html +3 -0
  564. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/above-1.html +3 -0
  565. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/abovewithdelims-1.html +3 -0
  566. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/atop-1.html +3 -0
  567. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/atopwithdelims-1.html +3 -0
  568. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/binom-1.html +3 -0
  569. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/brace-1.html +3 -0
  570. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/brack-1.html +3 -0
  571. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/cfrac-1.html +3 -0
  572. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/choose-1.html +3 -0
  573. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/dbinom-1.html +3 -0
  574. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/dfrac-1.html +3 -0
  575. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/frac-1a.html +3 -0
  576. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/frac-1b.html +3 -0
  577. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/genfrac-1.html +3 -0
  578. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/issue969.html +3 -0
  579. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/overwithdelims-1.html +3 -0
  580. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/tbinom-1.html +3 -0
  581. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/frac/tfrac-1.html +3 -0
  582. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue1152-1.html +1 -0
  583. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue1152-2.html +4 -0
  584. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue375.html +3 -0
  585. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue856.html +3 -0
  586. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1a.html +5 -0
  587. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1b.html +5 -0
  588. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1c.html +5 -0
  589. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/issues/issue901-1d.html +5 -0
  590. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/boxes-1.html +5 -0
  591. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/kern-1a.html +3 -0
  592. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/kern-1b.html +3 -0
  593. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/llap-1.html +3 -0
  594. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/lower-1.html +4 -0
  595. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/mathstrut-1.html +3 -0
  596. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/moveleft-1.html +3 -0
  597. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/moveright-1.html +3 -0
  598. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/newline-1.html +3 -0
  599. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/phantom-1.html +4 -0
  600. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/raise-1.html +3 -0
  601. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/rlap-1.html +3 -0
  602. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/shove-1.html +19 -0
  603. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/skip-1a.html +3 -0
  604. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/skip-1b.html +3 -0
  605. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/smash-1.html +3 -0
  606. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/spaces-1.html +18 -0
  607. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/strut-1.html +3 -0
  608. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/layout/vcenter-1.html +3 -0
  609. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-1.html +32 -0
  610. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-2.html +13 -0
  611. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-3.html +6 -0
  612. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/greek-4.html +13 -0
  613. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/letters/hebrew-1.html +6 -0
  614. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/begingroup-1.html +15 -0
  615. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/def-1.html +5 -0
  616. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/let-1.html +14 -0
  617. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-1.html +7 -0
  618. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-2.html +25 -0
  619. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-3.html +50 -0
  620. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-5.html +5 -0
  621. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-6.html +7 -0
  622. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/macro/macro-7.html +7 -0
  623. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/Bbb-1.html +3 -0
  624. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/bf-1.html +3 -0
  625. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/boldsymbol-1.html +9 -0
  626. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/cal-1.html +3 -0
  627. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/frak-1.html +3 -0
  628. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/it-1.html +3 -0
  629. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbb-1.html +3 -0
  630. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-1a.html +3 -0
  631. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-1b.html +3 -0
  632. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathbf-2.html +3 -0
  633. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathcal-1.html +3 -0
  634. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathfrak-1.html +3 -0
  635. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathit-1.html +3 -0
  636. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathrm-1.html +3 -0
  637. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathscr-1.html +3 -0
  638. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathsf-1.html +3 -0
  639. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mathtt-1.html +3 -0
  640. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/mit-1.html +3 -0
  641. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/pmb-1.html +3 -0
  642. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/rm-1.html +3 -0
  643. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/scr-1.html +3 -0
  644. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/sf-1.html +3 -0
  645. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/text-1.html +3 -0
  646. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textbf-1.html +3 -0
  647. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textit-1.html +3 -0
  648. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textrm-1.html +3 -0
  649. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/textsf-1.html +3 -0
  650. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/texttt-1.html +3 -0
  651. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mathvariant/tt-1.html +3 -0
  652. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-1a.html +7 -0
  653. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-1b.html +7 -0
  654. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-2.html +3 -0
  655. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/array-3.html +3 -0
  656. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/bmatrix-1.html +7 -0
  657. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/bmatrix-2.html +7 -0
  658. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/matrix-1.html +7 -0
  659. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/matrix-2.html +7 -0
  660. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/pmatrix-1.html +7 -0
  661. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/pmatrix-2.html +8 -0
  662. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/smallmatrix-1.html +3 -0
  663. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/vmatrix-1.html +7 -0
  664. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/matrices/vmatrix-2.html +7 -0
  665. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-1.html +120 -0
  666. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-2.html +35 -0
  667. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/advanced-3.html +138 -0
  668. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/amounts-1.html +46 -0
  669. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/arrows-1.html +235 -0
  670. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/arrows-2.html +159 -0
  671. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/basics-1.html +139 -0
  672. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/bonds-1.html +256 -0
  673. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/environments-1.html +81 -0
  674. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/isotopes-1.html +30 -0
  675. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/math-1.html +101 -0
  676. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/mhchem/special_symbols-1.html +176 -0
  677. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/Rule-1.html +5 -0
  678. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/Tiny-1.html +3 -0
  679. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/class-1.html +3 -0
  680. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/cssId-1.html +3 -0
  681. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/href-1.html +3 -0
  682. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/href-2.html +3 -0
  683. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/require-1.html +3 -0
  684. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/style-1.html +3 -0
  685. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/non-standard/unicode-1.html +8 -0
  686. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/LaTeX-1.html +4 -0
  687. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/bbox-1.html +6 -0
  688. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/boxed-1.html +3 -0
  689. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/cancel-1.html +6 -0
  690. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/cases-1.html +3 -0
  691. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/displaylines-1.html +7 -0
  692. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/enclose-1.html +8 -0
  693. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/functions-1.html +34 -0
  694. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-1.html +5 -0
  695. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-2.html +8 -0
  696. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/limits-3.html +3 -0
  697. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/mathsize-1.html +11 -0
  698. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/mod-1.html +5 -0
  699. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/not-1.html +5 -0
  700. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/pod-1.html +3 -0
  701. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-1.html +8 -0
  702. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-2.html +4 -0
  703. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/primes-3.html +3 -0
  704. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/style-1.html +7 -0
  705. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/style-2.html +0 -0
  706. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/verb-1.html +3 -0
  707. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/other/verb-2.html +3 -0
  708. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/eqref-1.html +5 -0
  709. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/label-1.html +7 -0
  710. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/label-2.html +1 -0
  711. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/notag-1.html +5 -0
  712. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-1.html +5 -0
  713. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-2.html +5 -0
  714. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/references/ref-3.html +5 -0
  715. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-1.html +3 -0
  716. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-2.html +3 -0
  717. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/root-3.html +3 -0
  718. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/sqrt-1.html +3 -0
  719. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/roots/sqrt-2.html +3 -0
  720. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/binaryops-1.html +32 -0
  721. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/dots-1.html +26 -0
  722. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/largeops-1.html +4 -0
  723. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/largeops-2.html +3 -0
  724. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/relations-1.html +39 -0
  725. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-1.html +25 -0
  726. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-2.html +31 -0
  727. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-3.html +40 -0
  728. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-4.html +39 -0
  729. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-5.html +56 -0
  730. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-out/symbols/symbols-6.html +49 -0
  731. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-1.no_tex +8 -0
  732. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-2.no_tex +13 -0
  733. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/amscd-3.no_tex +23 -0
  734. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/arrows-1.no_tex +23 -0
  735. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/arrows-2.no_tex +26 -0
  736. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/min-1.no_tex +14 -0
  737. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/AMScd/min-2.no_tex +14 -0
  738. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-1.txt +16 -0
  739. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-2.txt +3 -0
  740. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/accents-3.txt +5 -0
  741. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/buildrel-1.txt +3 -0
  742. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue490.no_tex +3 -0
  743. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue877.txt +3 -0
  744. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/issue937.txt +3 -0
  745. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overbrace-1.txt +3 -0
  746. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overbracket-1.txt +3 -0
  747. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/overset-1.txt +3 -0
  748. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/sideset-1.txt +6 -0
  749. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/stackrel-1.txt +3 -0
  750. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/subarray-1.txt +1 -0
  751. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/substack-1.txt +3 -0
  752. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underbrace-1.txt +3 -0
  753. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underbracket-1.txt +3 -0
  754. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/above-below/underset-1.txt +3 -0
  755. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/mathtip-1.no_tex +2 -0
  756. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/texttip-1.no_tex +2 -0
  757. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/action/toggle-1.no_tex +3 -0
  758. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/Newextarrow-1.xtex +4 -0
  759. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-1.txt +34 -0
  760. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-2.txt +30 -0
  761. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-3.txt +9 -0
  762. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-4.txt +13 -0
  763. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/arrows/arrows-5.txt +7 -0
  764. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathbin-1.no_tex +3 -0
  765. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathinner-1.txt +3 -0
  766. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-1a.txt +3 -0
  767. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-1b.txt +5 -0
  768. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathop-2.xtex +3 -0
  769. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathopenclose-1.txt +3 -0
  770. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathord-1.txt +3 -0
  771. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathpunct-1.txt +3 -0
  772. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/atoms/mathrel-1.txt +3 -0
  773. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/backslashed-1.txt +16 -0
  774. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/basic-operators-1.txt +3 -0
  775. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/basic-operators-2.xtex +5 -0
  776. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/basic-operators/remap-1.txt +5 -0
  777. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/color-1.txt +3 -0
  778. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/colorbox-1.txt +3 -0
  779. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1a.xtex +7 -0
  780. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1b.xtex +7 -0
  781. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-1c.xtex +7 -0
  782. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/definecolor-2.xtex +13 -0
  783. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/fcolorbox-1.xtex +3 -0
  784. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/issue446.xtex +5 -0
  785. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/colors/namedcolors-1.txt +70 -0
  786. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-1.txt +3 -0
  787. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-2.txt +3 -0
  788. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/big-3.txt +3 -0
  789. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/delimiters-1.txt +3 -0
  790. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/delimiters-2.txt +4 -0
  791. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue775.txt +3 -0
  792. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-1a.txt +6 -0
  793. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-1b.txt +6 -0
  794. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-2.txt +6 -0
  795. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-3.txt +6 -0
  796. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-4.txt +6 -0
  797. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/issue776-5.txt +6 -0
  798. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/delimiters/left-right-1.txt +3 -0
  799. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/align-1a.txt +7 -0
  800. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/align-1b.txt +7 -0
  801. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignat-1a.txt +6 -0
  802. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignat-1b.txt +6 -0
  803. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/aligned-1.txt +9 -0
  804. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/aligned-2.txt +14 -0
  805. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/alignedat-1.txt +8 -0
  806. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqalign-1.txt +8 -0
  807. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqalignno-1.txt +8 -0
  808. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1a.txt +7 -0
  809. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1b.txt +7 -0
  810. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-1c.no_tex +7 -0
  811. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/eqnarray-2a.no_tex +8 -0
  812. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/equation-1.txt +5 -0
  813. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/equation-2.txt +5 -0
  814. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gather-1a.txt +7 -0
  815. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gather-1b.txt +7 -0
  816. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gathered-1.txt +7 -0
  817. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/gathered-2.txt +12 -0
  818. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-1a.txt +5 -0
  819. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-1b.txt +5 -0
  820. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-2a.txt +5 -0
  821. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-2b.txt +5 -0
  822. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-3a.txt +5 -0
  823. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/issue982-3b.txt +5 -0
  824. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/leqalignno-1.xtex +8 -0
  825. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/multline-1a.txt +7 -0
  826. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/multline-1b.txt +7 -0
  827. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/environments/split-1.txt +9 -0
  828. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/errors/noErrors-1.no_tex +3 -0
  829. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/errors/noUndefined-1.no_tex +2 -0
  830. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/above-1.txt +3 -0
  831. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/abovewithdelims-1.txt +3 -0
  832. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/atop-1.txt +3 -0
  833. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/atopwithdelims-1.txt +3 -0
  834. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/binom-1.txt +3 -0
  835. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/brace-1.txt +3 -0
  836. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/brack-1.txt +3 -0
  837. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/cfrac-1.txt +3 -0
  838. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/choose-1.txt +3 -0
  839. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/dbinom-1.txt +3 -0
  840. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/dfrac-1.txt +3 -0
  841. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/frac-1a.txt +3 -0
  842. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/frac-1b.txt +3 -0
  843. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/genfrac-1.txt +3 -0
  844. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/issue969.txt +3 -0
  845. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/overwithdelims-1.txt +3 -0
  846. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/tbinom-1.txt +3 -0
  847. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/frac/tfrac-1.txt +3 -0
  848. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1151.no_tex +3 -0
  849. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1152-1.xtex +1 -0
  850. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue1152-2.txt +4 -0
  851. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue375.txt +3 -0
  852. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue856.txt +3 -0
  853. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1a.txt +5 -0
  854. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1b.txt +5 -0
  855. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1c.txt +5 -0
  856. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue901-1d.txt +5 -0
  857. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue903-1.xtex +6 -0
  858. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/issues/issue903-2.xtex +16 -0
  859. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/boxes-1.txt +5 -0
  860. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/kern-1a.txt +3 -0
  861. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/kern-1b.txt +3 -0
  862. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/llap-1.txt +3 -0
  863. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/lower-1.txt +4 -0
  864. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/mathstrut-1.txt +3 -0
  865. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/moveleft-1.txt +3 -0
  866. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/moveright-1.txt +3 -0
  867. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/newline-1.txt +3 -0
  868. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/phantom-1.txt +4 -0
  869. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/raise-1.txt +3 -0
  870. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/rlap-1.txt +3 -0
  871. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/shove-1.xtex +7 -0
  872. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/skip-1a.txt +3 -0
  873. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/skip-1b.txt +3 -0
  874. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/smash-1.txt +3 -0
  875. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/spaces-1.txt +18 -0
  876. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/strut-1.txt +3 -0
  877. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/layout/vcenter-1.txt +3 -0
  878. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-1.txt +32 -0
  879. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-2.txt +13 -0
  880. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-3.txt +6 -0
  881. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/greek-4.txt +13 -0
  882. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/letters/hebrew-1.txt +6 -0
  883. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/begingroup-1.no_tex +8 -0
  884. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/def-1.no_tex +4 -0
  885. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/let-1.no_tex +5 -0
  886. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-1a.no_tex +3 -0
  887. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-1b.no_tex +3 -0
  888. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-2.no_tex +3 -0
  889. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-3.no_tex +5 -0
  890. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-5.no_tex +3 -0
  891. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-6.no_tex +5 -0
  892. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/macro/macro-7.no_tex +11 -0
  893. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/Bbb-1.txt +3 -0
  894. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/bf-1.txt +3 -0
  895. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/boldsymbol-1.txt +9 -0
  896. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/cal-1.txt +3 -0
  897. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/frak-1.txt +3 -0
  898. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/it-1.txt +3 -0
  899. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbb-1.txt +3 -0
  900. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-1a.txt +3 -0
  901. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-1b.txt +3 -0
  902. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathbf-2.txt +3 -0
  903. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathcal-1.txt +3 -0
  904. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathfrak-1.txt +3 -0
  905. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathit-1.txt +3 -0
  906. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathrm-1.txt +3 -0
  907. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathscr-1.txt +3 -0
  908. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathsf-1.txt +3 -0
  909. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mathtt-1.txt +3 -0
  910. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/mit-1.txt +3 -0
  911. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/pmb-1.txt +3 -0
  912. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/rm-1.txt +3 -0
  913. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/scr-1.txt +3 -0
  914. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/sf-1.txt +3 -0
  915. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/text-1.txt +3 -0
  916. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textbf-1.txt +3 -0
  917. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textit-1.txt +3 -0
  918. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textrm-1.txt +3 -0
  919. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/textsf-1.txt +3 -0
  920. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/texttt-1.txt +3 -0
  921. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mathvariant/tt-1.txt +3 -0
  922. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-1a.txt +7 -0
  923. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-1b.txt +7 -0
  924. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-2.txt +3 -0
  925. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/array-3.txt +3 -0
  926. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/bmatrix-1.txt +7 -0
  927. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/bmatrix-2.txt +7 -0
  928. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/matrix-1.txt +7 -0
  929. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/matrix-2.txt +7 -0
  930. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/pmatrix-1.txt +7 -0
  931. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/pmatrix-2.txt +8 -0
  932. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/smallmatrix-1.txt +3 -0
  933. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/vmatrix-1.txt +7 -0
  934. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/matrices/vmatrix-2.txt +7 -0
  935. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-1.no_tex +8 -0
  936. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-2.no_tex +3 -0
  937. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/advanced-3.no_tex +7 -0
  938. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/amounts-1.no_tex +4 -0
  939. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/arrows-1.no_tex +10 -0
  940. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/arrows-2.no_tex +9 -0
  941. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/basics-1.no_tex +13 -0
  942. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/bonds-1.no_tex +11 -0
  943. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/environments-1.no_tex +6 -0
  944. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/isotopes-1.no_tex +3 -0
  945. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/math-1.no_tex +4 -0
  946. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/mhchem/special_symbols-1.no_tex +7 -0
  947. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/Rule-1.no_tex +3 -0
  948. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/Tiny-1.txt +3 -0
  949. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/class-1.no_tex +3 -0
  950. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/cssId-1.no_tex +3 -0
  951. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/href-1.no_tex +3 -0
  952. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/href-2.no_tex +3 -0
  953. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/require-1.no_tex +5 -0
  954. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/style-1.no_tex +3 -0
  955. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/non-standard/unicode-1.no_tex +3 -0
  956. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/LaTeX-1.txt +4 -0
  957. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/bbox-1.txt +6 -0
  958. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/boxed-1.txt +3 -0
  959. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/cancel-1.txt +6 -0
  960. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/cases-1.txt +3 -0
  961. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/displaylines-1.xtex +8 -0
  962. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/enclose-1.txt +8 -0
  963. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/functions-1.txt +34 -0
  964. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-1.txt +7 -0
  965. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-2.txt +8 -0
  966. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/limits-3.txt +3 -0
  967. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/mathsize-1.txt +11 -0
  968. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/mod-1.txt +5 -0
  969. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/not-1.txt +5 -0
  970. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/pod-1.txt +3 -0
  971. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-1.txt +8 -0
  972. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-2.txt +4 -0
  973. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/primes-3.txt +3 -0
  974. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/style-1.txt +7 -0
  975. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/style-2.no_tex +10 -0
  976. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/verb-1.txt +3 -0
  977. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/other/verb-2.txt +3 -0
  978. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/eqref-1.no_tex +7 -0
  979. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/label-1.no_tex +3 -0
  980. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/label-2.no_tex +2 -0
  981. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/notag-1.txt +5 -0
  982. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-1a.no_tex +2 -0
  983. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-1b.no_tex +2 -0
  984. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-2.no_tex +2 -0
  985. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/ref-3.no_tex +2 -0
  986. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-1.no_tex +1 -0
  987. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-2.no_tex +1 -0
  988. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-3.no_tex +3 -0
  989. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/references/tag-4.no_tex +3 -0
  990. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-1.txt +3 -0
  991. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-2.txt +3 -0
  992. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/root-3.txt +3 -0
  993. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/sqrt-1.txt +3 -0
  994. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/roots/sqrt-2.txt +3 -0
  995. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/binaryops-1.txt +32 -0
  996. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/dots-1.txt +26 -0
  997. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/largeops-1.txt +4 -0
  998. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/largeops-2.txt +3 -0
  999. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/relations-1.txt +39 -0
  1000. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-1.txt +25 -0
  1001. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-2.txt +31 -0
  1002. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-3.txt +40 -0
  1003. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-4.txt +39 -0
  1004. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-5.txt +56 -0
  1005. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/LaTeXToMathML-tex/symbols/symbols-6.txt +49 -0
  1006. data/ext/mathematical/mtex2MML/tests/fixtures/MathJax/TODO.md +3 -0
  1007. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_nesting.html +32 -0
  1008. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_nesting.txt +32 -0
  1009. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment.html +8 -0
  1010. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment.txt +8 -0
  1011. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment_with_hline.html +12 -0
  1012. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_pos_alignment_with_hline.txt +12 -0
  1013. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column.html +5 -0
  1014. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column.txt +5 -0
  1015. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column_with_align.html +5 -0
  1016. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_vertical_column_with_align.txt +5 -0
  1017. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline.html +9 -0
  1018. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline.txt +9 -0
  1019. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline_and_hdashline.html +10 -0
  1020. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_hline_and_hdashline.txt +10 -0
  1021. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_vertical_and_horizontal_dashes.html +10 -0
  1022. data/ext/mathematical/mtex2MML/tests/fixtures/array/array_with_vertical_and_horizontal_dashes.txt +10 -0
  1023. data/ext/mathematical/mtex2MML/tests/fixtures/array/augmented_matrix.html +6 -0
  1024. data/ext/mathematical/mtex2MML/tests/fixtures/array/augmented_matrix.txt +6 -0
  1025. data/ext/mathematical/mtex2MML/tests/fixtures/array/basic_array.html +5 -0
  1026. data/ext/mathematical/mtex2MML/tests/fixtures/array/basic_array.txt +5 -0
  1027. data/ext/mathematical/mtex2MML/tests/fixtures/array/strip_excess_whitespace_in_array_attributes.html +7 -0
  1028. data/ext/mathematical/mtex2MML/tests/fixtures/array/strip_excess_whitespace_in_array_attributes.txt +8 -0
  1029. data/ext/mathematical/mtex2MML/tests/fixtures/basic/block.html +1 -0
  1030. data/ext/mathematical/mtex2MML/tests/fixtures/basic/block.txt +1 -0
  1031. data/ext/mathematical/mtex2MML/tests/fixtures/basic/comments.html +6 -0
  1032. data/ext/mathematical/mtex2MML/tests/fixtures/basic/comments.txt +6 -0
  1033. data/ext/mathematical/mtex2MML/tests/fixtures/basic/filter.html +1 -0
  1034. data/ext/mathematical/mtex2MML/tests/fixtures/basic/filter.txt +3 -0
  1035. data/ext/mathematical/mtex2MML/tests/fixtures/basic/inline.html +1 -0
  1036. data/ext/mathematical/mtex2MML/tests/fixtures/basic/inline.txt +1 -0
  1037. data/ext/mathematical/mtex2MML/tests/fixtures/basic/strict_filter.html +3 -0
  1038. data/ext/mathematical/mtex2MML/tests/fixtures/basic/strict_filter.txt +3 -0
  1039. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_filter.html +3 -0
  1040. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_filter.txt +3 -0
  1041. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_rendering.html +23 -0
  1042. data/ext/mathematical/mtex2MML/tests/fixtures/basic/text_rendering.txt +23 -0
  1043. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/broken_up_inline_env.html +3 -0
  1044. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/broken_up_inline_env.txt +3 -0
  1045. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/some_crazy_alignment.html +24 -0
  1046. data/ext/mathematical/mtex2MML/tests/fixtures/cornercases/some_crazy_alignment.txt +24 -0
  1047. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/align.html +1 -0
  1048. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/align.txt +3 -0
  1049. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/alignat-1a.html +1 -0
  1050. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/alignat-1a.txt +4 -0
  1051. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/aligned_ex_spacing.html +1 -0
  1052. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/aligned_ex_spacing.txt +4 -0
  1053. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/basic_array.html +1 -0
  1054. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/basic_array.txt +3 -0
  1055. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/brackets.html +1 -0
  1056. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_filter.html +2 -0
  1057. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_filter.txt +27 -0
  1058. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_text_filter.html +27 -0
  1059. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/dollar_spacings_text_filter.txt +27 -0
  1060. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/double_dollar.html +1 -0
  1061. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping.txt +35 -0
  1062. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_brackets.html +35 -0
  1063. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_dollars.html +35 -0
  1064. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/escaping_with_parens.html +35 -0
  1065. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed.html +1 -0
  1066. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed_env.html +8 -0
  1067. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/mixed_env.txt +11 -0
  1068. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/parens.html +1 -0
  1069. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_dollar.html +1 -0
  1070. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_equation.html +1 -0
  1071. data/ext/mathematical/mtex2MML/tests/fixtures/delimiters/single_equation.txt +3 -0
  1072. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_ex_spacing.html +6 -0
  1073. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_ex_spacing.txt +6 -0
  1074. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_ex_spacing.html +6 -0
  1075. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_ex_spacing.txt +6 -0
  1076. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_lines.html +5 -0
  1077. data/ext/mathematical/mtex2MML/tests/fixtures/env/aligned_no_lines.txt +5 -0
  1078. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_ex_spacing.html +5 -0
  1079. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_ex_spacing.txt +5 -0
  1080. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_ex_spacing.html +5 -0
  1081. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_ex_spacing.txt +5 -0
  1082. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_lines.html +4 -0
  1083. data/ext/mathematical/mtex2MML/tests/fixtures/env/bbmatrix_no_lines.txt +4 -0
  1084. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_ex_spacing.html +5 -0
  1085. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_ex_spacing.txt +5 -0
  1086. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_ex_spacing.html +5 -0
  1087. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_ex_spacing.txt +5 -0
  1088. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_lines.html +4 -0
  1089. data/ext/mathematical/mtex2MML/tests/fixtures/env/bmatrix_no_lines.txt +4 -0
  1090. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_ex_spacing.html +7 -0
  1091. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_ex_spacing.txt +7 -0
  1092. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_ex_spacing.html +7 -0
  1093. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_ex_spacing.txt +7 -0
  1094. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_lines.html +6 -0
  1095. data/ext/mathematical/mtex2MML/tests/fixtures/env/cases_no_lines.txt +6 -0
  1096. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_ex_spacing.html +6 -0
  1097. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_ex_spacing.txt +6 -0
  1098. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_ex_spacing.html +6 -0
  1099. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_ex_spacing.txt +6 -0
  1100. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_lines.html +5 -0
  1101. data/ext/mathematical/mtex2MML/tests/fixtures/env/gathered_no_lines.txt +5 -0
  1102. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_ex_spacing.html +7 -0
  1103. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_ex_spacing.txt +7 -0
  1104. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_ex_spacing.html +7 -0
  1105. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_ex_spacing.txt +7 -0
  1106. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_lines.html +6 -0
  1107. data/ext/mathematical/mtex2MML/tests/fixtures/env/matrix_no_lines.txt +6 -0
  1108. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_ex_spacing.html +5 -0
  1109. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_ex_spacing.txt +5 -0
  1110. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_ex_spacing.html +5 -0
  1111. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_ex_spacing.txt +5 -0
  1112. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_lines.html +4 -0
  1113. data/ext/mathematical/mtex2MML/tests/fixtures/env/pmatrix_no_lines.txt +4 -0
  1114. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_ex_spacing.html +8 -0
  1115. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_ex_spacing.txt +8 -0
  1116. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_ex_spacing.html +7 -0
  1117. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_ex_spacing.txt +7 -0
  1118. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_lines.html +5 -0
  1119. data/ext/mathematical/mtex2MML/tests/fixtures/env/smallmatrix_no_lines.txt +5 -0
  1120. data/ext/mathematical/mtex2MML/tests/fixtures/env/spaces_after_rowsep.html +7 -0
  1121. data/ext/mathematical/mtex2MML/tests/fixtures/env/spaces_after_rowsep.txt +7 -0
  1122. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_ex_spacing.html +6 -0
  1123. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_ex_spacing.txt +6 -0
  1124. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_ex_spacing.html +6 -0
  1125. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_ex_spacing.txt +6 -0
  1126. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_lines.html +5 -0
  1127. data/ext/mathematical/mtex2MML/tests/fixtures/env/split_no_lines.txt +5 -0
  1128. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_ex_spacing.html +5 -0
  1129. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_ex_spacing.txt +5 -0
  1130. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_ex_spacing.html +5 -0
  1131. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_ex_spacing.txt +5 -0
  1132. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_lines.html +4 -0
  1133. data/ext/mathematical/mtex2MML/tests/fixtures/env/vmatrix_no_lines.txt +4 -0
  1134. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_ex_spacing.html +6 -0
  1135. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_ex_spacing.txt +6 -0
  1136. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_ex_spacing.html +6 -0
  1137. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_ex_spacing.txt +6 -0
  1138. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_lines.html +5 -0
  1139. data/ext/mathematical/mtex2MML/tests/fixtures/env/vvmatrix_no_lines.txt +5 -0
  1140. data/ext/mathematical/mtex2MML/tests/fixtures/functions/max_limits.html +1 -0
  1141. data/ext/mathematical/mtex2MML/tests/fixtures/functions/max_limits.txt +1 -0
  1142. data/ext/mathematical/mtex2MML/tests/fixtures/functions/min_limits.html +1 -0
  1143. data/ext/mathematical/mtex2MML/tests/fixtures/functions/min_limits.txt +1 -0
  1144. data/ext/mathematical/mtex2MML/tests/fixtures/functions/prod_limits.html +1 -0
  1145. data/ext/mathematical/mtex2MML/tests/fixtures/functions/prod_limits.txt +1 -0
  1146. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/excess_parsing.txt +1 -0
  1147. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/just_enough_parsing.html +1 -0
  1148. data/ext/mathematical/mtex2MML/tests/fixtures/maliciousness/just_enough_parsing.txt +1 -0
  1149. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_equations.html +11 -0
  1150. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_equations.txt +13 -0
  1151. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_notag_nonumber.html +7 -0
  1152. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/multiple_notag_nonumber.txt +7 -0
  1153. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_equation.html +5 -0
  1154. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_equation.txt +5 -0
  1155. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_nonumber.html +6 -0
  1156. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_nonumber.txt +6 -0
  1157. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_notag.html +6 -0
  1158. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/single_notag.txt +6 -0
  1159. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_label.html +3 -0
  1160. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_label.txt +3 -0
  1161. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_tag.html +3 -0
  1162. data/ext/mathematical/mtex2MML/tests/fixtures/numbered_equations/skip_tag.txt +3 -0
  1163. data/ext/mathematical/mtex2MML/tests/fixtures/performance/big_file.html +12 -0
  1164. data/ext/mathematical/mtex2MML/tests/fixtures/performance/big_file.txt +1755 -0
  1165. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/gt.html +1 -0
  1166. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/gt.txt +1 -0
  1167. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/lt.html +1 -0
  1168. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/lt.txt +1 -0
  1169. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textgreater.html +1 -0
  1170. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textgreater.txt +1 -0
  1171. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textless.html +1 -0
  1172. data/ext/mathematical/mtex2MML/tests/fixtures/symbols/textless.txt +1 -0
  1173. data/ext/mathematical/mtex2MML/tests/functions.c +55 -0
  1174. data/ext/mathematical/mtex2MML/tests/generate.py +244 -0
  1175. data/ext/mathematical/mtex2MML/tests/helpers.c +29 -0
  1176. data/ext/mathematical/mtex2MML/tests/helpers.h +8 -0
  1177. data/ext/mathematical/mtex2MML/tests/main.c +35 -0
  1178. data/ext/mathematical/mtex2MML/tests/maliciousness.c +107 -0
  1179. data/ext/mathematical/mtex2MML/tests/mathjax.c +2040 -0
  1180. data/ext/mathematical/mtex2MML/tests/mathjax_generate.py +72 -0
  1181. data/ext/mathematical/mtex2MML/tests/numbered_equations.c +92 -0
  1182. data/ext/mathematical/mtex2MML/tests/performance.c +39 -0
  1183. data/ext/mathematical/mtex2MML/tests/symbols.c +69 -0
  1184. data/lib/mathematical/version.rb +1 -1
  1185. data/mathematical.gemspec +1 -1
  1186. metadata +1191 -6
@@ -0,0 +1,2797 @@
1
+ /* Lasem
2
+ *
3
+ * Copyright © 2009 Emmanuel Pacaud
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General
16
+ * Public License along with this library; if not, write to the
17
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
+ * Boston, MA 02110-1335, USA.
19
+ *
20
+ * Author:
21
+ * Emmanuel Pacaud <emmanuel@gnome.org>
22
+ */
23
+
24
+ #include <lsmdebug.h>
25
+ #include <lsmsvgview.h>
26
+ #include <lsmsvgdocument.h>
27
+ #include <lsmsvgelement.h>
28
+ #include <lsmsvgsvgelement.h>
29
+ #include <lsmsvgradialgradientelement.h>
30
+ #include <lsmsvgfilterelement.h>
31
+ #include <lsmsvglineargradientelement.h>
32
+ #include <lsmsvgpatternelement.h>
33
+ #include <lsmsvgmarkerelement.h>
34
+ #include <lsmsvgclippathelement.h>
35
+ #include <lsmsvgmaskelement.h>
36
+ #include <lsmsvgfiltersurface.h>
37
+ #include <lsmcairo.h>
38
+ #include <lsmstr.h>
39
+ #include <gdk-pixbuf/gdk-pixbuf.h>
40
+ #include <glib/gprintf.h>
41
+
42
+ #include <math.h>
43
+ #include <string.h>
44
+
45
+ static gboolean lsm_svg_view_circular_reference_check (LsmSvgView *view, LsmSvgElement *element);
46
+
47
+ static GObjectClass *parent_class;
48
+
49
+ typedef struct {
50
+ gboolean is_text_path;
51
+ gboolean is_extents_defined;
52
+ LsmExtents extents;
53
+ PangoLayout *pango_layout;
54
+ } LsmSvgViewPathInfos;
55
+
56
+ static LsmSvgViewPathInfos default_path_infos = {
57
+ .is_text_path = FALSE,
58
+ .is_extents_defined = FALSE,
59
+ .extents = {0.0, 0.0, 0.0, 0.0},
60
+ .pango_layout = NULL
61
+ };
62
+
63
+ struct _LsmSvgViewPatternData {
64
+ cairo_t *old_cairo;
65
+
66
+ cairo_pattern_t *pattern;
67
+
68
+ LsmBox extents;
69
+ LsmBox object_extents;
70
+
71
+ double opacity;
72
+ };
73
+
74
+ typedef struct {
75
+ cairo_surface_t *surface;
76
+ double group_opacity;
77
+ gboolean enable_background;
78
+ } LsmSvgViewBackground;
79
+
80
+ cairo_operator_t cairo_operators[] = {
81
+ CAIRO_OPERATOR_CLEAR,
82
+ CAIRO_OPERATOR_SOURCE,
83
+ CAIRO_OPERATOR_DEST,
84
+ CAIRO_OPERATOR_OVER,
85
+ CAIRO_OPERATOR_DEST_OVER,
86
+ CAIRO_OPERATOR_IN,
87
+ CAIRO_OPERATOR_DEST_IN,
88
+ CAIRO_OPERATOR_OUT,
89
+ CAIRO_OPERATOR_DEST_OUT,
90
+ CAIRO_OPERATOR_ATOP,
91
+ CAIRO_OPERATOR_DEST_ATOP,
92
+ CAIRO_OPERATOR_XOR,
93
+ CAIRO_OPERATOR_ADD,
94
+ CAIRO_OPERATOR_MULTIPLY,
95
+ CAIRO_OPERATOR_SCREEN,
96
+ CAIRO_OPERATOR_OVERLAY,
97
+ CAIRO_OPERATOR_DARKEN,
98
+ CAIRO_OPERATOR_LIGHTEN,
99
+ CAIRO_OPERATOR_COLOR_DODGE,
100
+ CAIRO_OPERATOR_COLOR_BURN,
101
+ CAIRO_OPERATOR_HARD_LIGHT,
102
+ CAIRO_OPERATOR_SOFT_LIGHT,
103
+ CAIRO_OPERATOR_DIFFERENCE,
104
+ CAIRO_OPERATOR_EXCLUSION
105
+ };
106
+
107
+ static void
108
+ lsm_cairo_set_comp_op (cairo_t *cairo, LsmSvgCompOp comp_op)
109
+ {
110
+ if (G_LIKELY (cairo != NULL && comp_op >= LSM_SVG_COMP_OP_CLEAR && comp_op <= LSM_SVG_COMP_OP_EXCLUSION)) {
111
+ lsm_log_render ("[lsmSvgView::set_comp_op] Set comp-op to %s", lsm_svg_comp_op_to_string (comp_op));
112
+ cairo_set_operator (cairo, cairo_operators[comp_op]);
113
+ }
114
+ }
115
+
116
+ double
117
+ lsm_svg_view_normalize_length (LsmSvgView *view, const LsmSvgLength *length, LsmSvgLengthDirection direction)
118
+ {
119
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), 0.0);
120
+
121
+ return lsm_svg_length_normalize (length, view->viewbox_stack->data, view->style->font_size_px, direction);
122
+ }
123
+
124
+ double *
125
+ lsm_svg_view_normalize_length_list (LsmSvgView *view, const LsmSvgLengthList *list, LsmSvgLengthDirection direction, unsigned int *n_data)
126
+ {
127
+ double *data;
128
+ unsigned int i;
129
+
130
+ g_return_val_if_fail (n_data != NULL, NULL);
131
+ *n_data = 0;
132
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), NULL);
133
+
134
+ if (list->n_lengths == 0)
135
+ return NULL;
136
+
137
+ *n_data = list->n_lengths;
138
+ data = g_new (double, list->n_lengths);
139
+ for (i = 0; i < list->n_lengths; i++)
140
+ data[i] = lsm_svg_view_normalize_length (view, &list->lengths[i], direction);
141
+
142
+ return data;
143
+ }
144
+
145
+ static void
146
+ _start_pattern (LsmSvgView *view, const LsmBox *extents, const LsmBox *object_extents, double opacity)
147
+ {
148
+ lsm_debug_render ("[LsmSvgView::start_pattern]");
149
+
150
+ view->pattern_stack = g_slist_prepend (view->pattern_stack, view->pattern_data);
151
+
152
+ view->pattern_data = g_new (LsmSvgViewPatternData, 1);
153
+ view->pattern_data->old_cairo = view->dom_view.cairo;
154
+ view->pattern_data->pattern = NULL;
155
+ view->pattern_data->extents = *extents;
156
+ view->pattern_data->opacity = opacity;
157
+ view->pattern_data->object_extents = *object_extents;
158
+
159
+ view->dom_view.cairo = NULL;
160
+ }
161
+
162
+ static void
163
+ _end_pattern (LsmSvgView *view)
164
+ {
165
+ g_return_if_fail (view->pattern_data != NULL);
166
+
167
+ if (view->pattern_data->pattern != NULL)
168
+ cairo_pattern_destroy (view->pattern_data->pattern);
169
+ if (view->dom_view.cairo != NULL)
170
+ cairo_destroy (view->dom_view.cairo);
171
+
172
+ view->dom_view.cairo = view->pattern_data->old_cairo;
173
+
174
+ g_free (view->pattern_data);
175
+
176
+ if (view->pattern_stack != NULL) {
177
+ view->pattern_data = view->pattern_stack->data;
178
+ view->pattern_stack = g_slist_delete_link (view->pattern_stack, view->pattern_stack);
179
+ } else
180
+ view->pattern_data = NULL;
181
+
182
+ lsm_debug_render ("[LsmSvgView::end_pattern]");
183
+ }
184
+
185
+ static void
186
+ _set_pattern (LsmSvgView *view, cairo_pattern_t *pattern)
187
+ {
188
+ g_return_if_fail (view->pattern_data != NULL);
189
+ g_return_if_fail (view->pattern_data->pattern == NULL);
190
+
191
+ view->pattern_data->pattern = pattern;
192
+ view->last_stop_offset = 0.0;
193
+ }
194
+
195
+ void
196
+ lsm_svg_view_create_radial_gradient (LsmSvgView *view,
197
+ double cx, double cy,
198
+ double r,
199
+ double fx, double fy)
200
+ {
201
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
202
+
203
+ _set_pattern (view, cairo_pattern_create_radial (fx, fy, 0, cx, cy, r));
204
+ }
205
+
206
+ void
207
+ lsm_svg_view_create_linear_gradient (LsmSvgView *view,
208
+ double x1, double y1,
209
+ double x2, double y2)
210
+ {
211
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
212
+
213
+ _set_pattern (view, cairo_pattern_create_linear (x1, y1, x2, y2));
214
+ }
215
+
216
+ void
217
+ lsm_svg_view_add_gradient_color_stop (LsmSvgView *view, double offset)
218
+ {
219
+ const LsmSvgStyle *style;
220
+ const LsmSvgColor *color;
221
+
222
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
223
+ g_return_if_fail (view->pattern_data != NULL);
224
+ g_return_if_fail (view->pattern_data->pattern != NULL);
225
+
226
+ if (offset > 1.0)
227
+ offset = 1.0;
228
+
229
+ if (offset < view->last_stop_offset)
230
+ offset = view->last_stop_offset;
231
+ else
232
+ view->last_stop_offset = offset;
233
+
234
+ style = view->style;
235
+
236
+ lsm_debug_render ("[LsmSvgView::add_gradient_color_stop] opacity = %g", style->stop_opacity->value);
237
+
238
+ color = &style->stop_color->value;
239
+
240
+ if (color->red < 0.0 || color->blue < 0.0 || color->green < 0.0)
241
+ color = &style->color->value;
242
+
243
+ lsm_debug_render ("[LsmSvgView::add_gradient_color_stop] color = %2x%2x%2x",
244
+ (int) (255.0 * color->red),
245
+ (int) (255.0 * color->green),
246
+ (int) (255.0 * color->blue));
247
+
248
+ cairo_pattern_add_color_stop_rgba (view->pattern_data->pattern, offset,
249
+ color->red,
250
+ color->green,
251
+ color->blue,
252
+ style->stop_opacity->value * view->pattern_data->opacity);
253
+ }
254
+
255
+ gboolean
256
+ lsm_svg_view_set_gradient_properties (LsmSvgView *view,
257
+ LsmSvgSpreadMethod method,
258
+ LsmSvgPatternUnits units,
259
+ const LsmSvgMatrix *gradient_matrix)
260
+ {
261
+ cairo_matrix_t matrix;
262
+ cairo_matrix_t inv_matrix;
263
+ cairo_status_t status;
264
+
265
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), FALSE);
266
+ g_return_val_if_fail (view->pattern_data != NULL, FALSE);
267
+ g_return_val_if_fail (view->pattern_data->pattern != NULL, FALSE);
268
+
269
+ switch (method) {
270
+ case LSM_SVG_SPREAD_METHOD_REFLECT:
271
+ cairo_pattern_set_extend (view->pattern_data->pattern, CAIRO_EXTEND_REFLECT);
272
+ break;
273
+ case LSM_SVG_SPREAD_METHOD_REPEAT:
274
+ cairo_pattern_set_extend (view->pattern_data->pattern, CAIRO_EXTEND_REPEAT);
275
+ break;
276
+ default:
277
+ cairo_pattern_set_extend (view->pattern_data->pattern, CAIRO_EXTEND_PAD);
278
+ }
279
+
280
+ if (gradient_matrix != NULL) {
281
+ cairo_matrix_init (&matrix,
282
+ gradient_matrix->a, gradient_matrix->b,
283
+ gradient_matrix->c, gradient_matrix->d,
284
+ gradient_matrix->e, gradient_matrix->f);
285
+ cairo_matrix_invert (&matrix);
286
+ } else
287
+ cairo_matrix_init_identity (&matrix);
288
+
289
+ if (units == LSM_SVG_PATTERN_UNITS_OBJECT_BOUNDING_BOX &&
290
+ view->pattern_data->extents.width > 0.0 &&
291
+ view->pattern_data->extents.height > 0.0) {
292
+ cairo_matrix_scale (&matrix,
293
+ 1.0 / view->pattern_data->extents.width,
294
+ 1.0 / view->pattern_data->extents.height);
295
+ cairo_matrix_translate (&matrix,
296
+ -view->pattern_data->extents.x,
297
+ -view->pattern_data->extents.y);
298
+
299
+ }
300
+
301
+ inv_matrix = matrix;
302
+ status = cairo_matrix_invert (&inv_matrix);
303
+
304
+ if (status != CAIRO_STATUS_SUCCESS) {
305
+ lsm_debug_render ("[LsmSvgView::set_gradient_properties] Not invertible matrix");
306
+ return FALSE;
307
+ }
308
+
309
+ cairo_pattern_set_matrix (view->pattern_data->pattern, &matrix);
310
+
311
+ return TRUE;
312
+ }
313
+
314
+ gboolean
315
+ lsm_svg_view_create_surface_pattern (LsmSvgView *view,
316
+ const LsmBox *viewport,
317
+ const LsmSvgMatrix *pattern_matrix,
318
+ LsmSvgViewSurfaceType surface_type)
319
+ {
320
+ cairo_surface_t *surface;
321
+ cairo_pattern_t *pattern;
322
+ cairo_matrix_t matrix;
323
+ cairo_matrix_t inv_matrix;
324
+ cairo_status_t status;
325
+ double x1, y1, x2, y2;
326
+ double device_width, device_height;
327
+ double x_scale, y_scale;
328
+
329
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), FALSE);
330
+ g_return_val_if_fail (viewport != NULL, FALSE);
331
+ g_return_val_if_fail (view->pattern_data != NULL, FALSE);
332
+ g_return_val_if_fail (view->dom_view.cairo == NULL, FALSE);
333
+
334
+ /* Calculate a scale that will allow us to create a surface pattern
335
+ * for which a pixel will also be roughly a pixel on the final
336
+ * image */
337
+
338
+ x1 = viewport->x;
339
+ y1 = viewport->y;
340
+ x2 = viewport->x + viewport->width;
341
+ y2 = viewport->y;
342
+
343
+ if (pattern_matrix != NULL) {
344
+ lsm_svg_matrix_transform_point (pattern_matrix, &x1, &y1);
345
+ lsm_svg_matrix_transform_point (pattern_matrix, &x2, &y2);
346
+ }
347
+
348
+ cairo_user_to_device (view->pattern_data->old_cairo, &x1, &y1);
349
+ cairo_user_to_device (view->pattern_data->old_cairo, &x2, &y2);
350
+
351
+ device_width = sqrt ((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
352
+
353
+ x2 = viewport->x;
354
+ y2 = viewport->y + viewport->height;
355
+
356
+ if (pattern_matrix != NULL) {
357
+ lsm_svg_matrix_transform_point (pattern_matrix, &x2, &y2);
358
+ }
359
+
360
+ cairo_user_to_device (view->pattern_data->old_cairo, &x2, &y2);
361
+
362
+ device_height = sqrt ((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
363
+
364
+ /* Create new surface with integer size */
365
+
366
+ device_height = ceil (device_height);
367
+ device_width = ceil (device_width);
368
+
369
+ x_scale = device_width / viewport->width;
370
+ y_scale = device_height / viewport->height;
371
+
372
+ lsm_debug_render ("[LsmSvgView::create_surface_pattern] pattern size = %g ,%g at %g, %g (scale %g x %g)",
373
+ device_width, device_height, viewport->x, viewport->y, x_scale, y_scale);
374
+
375
+ switch (surface_type) {
376
+ case LSM_SVG_VIEW_SURFACE_TYPE_AUTO:
377
+ surface = cairo_surface_create_similar (cairo_get_target (view->pattern_data->old_cairo),
378
+ CAIRO_CONTENT_COLOR_ALPHA,
379
+ device_width, device_height);
380
+ break;
381
+ default:
382
+ case LSM_SVG_VIEW_SURFACE_TYPE_IMAGE:
383
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, device_width, device_height);
384
+ break;
385
+ }
386
+
387
+ pattern = cairo_pattern_create_for_surface (surface);
388
+ view->dom_view.cairo = cairo_create (surface);
389
+ cairo_surface_destroy (surface);
390
+
391
+ cairo_scale (view->dom_view.cairo, x_scale, y_scale);
392
+ cairo_translate (view->dom_view.cairo, -viewport->x, -viewport->y);
393
+
394
+ _set_pattern (view, pattern);
395
+
396
+ if (pattern_matrix != NULL) {
397
+ cairo_matrix_init (&matrix,
398
+ pattern_matrix->a, pattern_matrix->b,
399
+ pattern_matrix->c, pattern_matrix->d,
400
+ pattern_matrix->e + viewport->x, pattern_matrix->f + viewport->y);
401
+ cairo_matrix_scale (&matrix, 1.0 / x_scale, 1.0 / y_scale);
402
+ cairo_matrix_invert (&matrix);
403
+ } else {
404
+ cairo_matrix_init_scale (&matrix, x_scale, y_scale);
405
+ cairo_matrix_translate (&matrix, -viewport->x, -viewport->y);
406
+ }
407
+
408
+ inv_matrix = matrix;
409
+ status = cairo_matrix_invert (&inv_matrix);
410
+
411
+ if (status != CAIRO_STATUS_SUCCESS) {
412
+ lsm_debug_render ("[LsmSvgView::create_surface_pattern] Not invertible matrix");
413
+ return FALSE;
414
+ }
415
+
416
+ cairo_pattern_set_matrix (view->pattern_data->pattern, &matrix);
417
+ cairo_pattern_set_extend (view->pattern_data->pattern, CAIRO_EXTEND_REPEAT);
418
+
419
+ lsm_debug_render ("[LsmSvgView::create_surface_pattern] Pattern matrix %g, %g, %g, %g, %g, %g",
420
+ matrix.xx, matrix.xy, matrix.yx, matrix.yy,
421
+ matrix.x0, matrix.y0);
422
+
423
+ return TRUE;
424
+ }
425
+
426
+ typedef enum {
427
+ LSM_SVG_VIEW_PAINT_OPERATION_FILL,
428
+ LSM_SVG_VIEW_PAINT_OPERATION_STROKE
429
+ } LsmSvgViewPaintOperation;
430
+
431
+ static void
432
+ _paint_url (LsmSvgView *view,
433
+ LsmSvgViewPathInfos *path_infos,
434
+ LsmSvgViewPaintOperation operation,
435
+ const char *url, double opacity)
436
+ {
437
+ cairo_t *cairo;
438
+ LsmSvgElement *element;
439
+ LsmBox extents;
440
+
441
+ element = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document), url);
442
+ if ((!LSM_IS_SVG_RADIAL_GRADIENT_ELEMENT (element) &&
443
+ !LSM_IS_SVG_LINEAR_GRADIENT_ELEMENT (element) &&
444
+ !LSM_IS_SVG_PATTERN_ELEMENT (element)) ||
445
+ lsm_svg_view_circular_reference_check (view, element)) {
446
+
447
+ cairo_set_source_rgba (view->dom_view.cairo, 0, 0, 0, 0);
448
+
449
+ lsm_warning_render ("[LsmSvgView::_paint_url] Paint url not found: %s", url);
450
+
451
+ return;
452
+ }
453
+
454
+ lsm_debug_render ("[LsmSvgView::_paint_url] Paint using '%s'", url);
455
+
456
+ if (!path_infos->is_extents_defined) {
457
+ cairo_path_extents (view->dom_view.cairo,
458
+ &path_infos->extents.x1,
459
+ &path_infos->extents.y1,
460
+ &path_infos->extents.x2,
461
+ &path_infos->extents.y2);
462
+ path_infos->is_extents_defined = TRUE;
463
+ }
464
+
465
+ extents.x = path_infos->extents.x1;
466
+ extents.y = path_infos->extents.y1;
467
+ extents.width = path_infos->extents.x2 - extents.x;
468
+ extents.height = path_infos->extents.y2 - extents.y;
469
+
470
+ lsm_debug_render ("[LsmSvgView::_paint_url] Pattern extents x = %g, y = %g, w = %g, h = %g",
471
+ extents.x, extents.y, extents.width, extents.height);
472
+
473
+ _start_pattern (view, &extents, &extents, opacity);
474
+
475
+ lsm_svg_element_force_render (LSM_SVG_ELEMENT (element), view);
476
+
477
+ cairo = view->pattern_data->old_cairo;
478
+
479
+ if (view->pattern_data->pattern) {
480
+ if (view->debug_pattern && view->dom_view.cairo) {
481
+ char *filename;
482
+
483
+ filename = g_strdup_printf ("pattern-%s).png", url);
484
+ cairo_surface_write_to_png (cairo_get_target (view->dom_view.cairo), filename);
485
+ g_free (filename);
486
+ }
487
+
488
+ cairo_set_source (cairo, view->pattern_data->pattern);
489
+ } else
490
+ cairo_set_source_rgba (cairo, 0.0, 0.0, 0.0, 0.0);
491
+
492
+ _end_pattern (view);
493
+ }
494
+
495
+ static gboolean
496
+ _set_color (LsmSvgView *view,
497
+ LsmSvgViewPathInfos *path_infos,
498
+ LsmSvgViewPaintOperation operation,
499
+ const LsmSvgPaint *paint, double opacity)
500
+ {
501
+ cairo_t *cairo = view->dom_view.cairo;
502
+
503
+ switch (paint->type) {
504
+ case LSM_SVG_PAINT_TYPE_NONE:
505
+ return FALSE;
506
+ case LSM_SVG_PAINT_TYPE_RGB_COLOR:
507
+ cairo_set_source_rgba (cairo,
508
+ paint->color.red,
509
+ paint->color.green,
510
+ paint->color.blue,
511
+ opacity);
512
+ break;
513
+ case LSM_SVG_PAINT_TYPE_CURRENT_COLOR:
514
+ cairo_set_source_rgba (cairo,
515
+ view->style->color->value.red,
516
+ view->style->color->value.green,
517
+ view->style->color->value.blue,
518
+ opacity);
519
+ break;
520
+ case LSM_SVG_PAINT_TYPE_URI:
521
+ case LSM_SVG_PAINT_TYPE_URI_RGB_COLOR:
522
+ case LSM_SVG_PAINT_TYPE_URI_CURRENT_COLOR:
523
+ case LSM_SVG_PAINT_TYPE_URI_NONE:
524
+ _paint_url (view, path_infos, operation, paint->url, opacity);
525
+ break;
526
+ default:
527
+ return FALSE;
528
+ }
529
+
530
+ return TRUE;
531
+ }
532
+
533
+ static void
534
+ paint_markers (LsmSvgView *view)
535
+ {
536
+ const LsmSvgStyle *style;
537
+ LsmSvgElement *marker;
538
+ LsmSvgElement *marker_start;
539
+ LsmSvgElement *marker_mid;
540
+ LsmSvgElement *marker_end;
541
+ cairo_t *cairo;
542
+ cairo_path_t *path;
543
+ cairo_path_data_t *data;
544
+ cairo_path_data_t *next_data;
545
+ double stroke_width;
546
+ double prev_x, prev_y;
547
+ double x = 0;
548
+ double y = 0;
549
+ double next_x, next_y;
550
+ cairo_path_data_type_t type;
551
+ cairo_path_data_type_t next_type;
552
+ double angle;
553
+ int i;
554
+
555
+ style = view->style;
556
+
557
+ if ((style->marker->value == NULL || strcmp (style->marker->value, "none") == 0) &&
558
+ (style->marker_mid->value == NULL || strcmp (style->marker_mid->value, "none") == 0) &&
559
+ (style->marker_end->value == NULL || strcmp (style->marker_end->value, "none") == 0) &&
560
+ (style->marker_start->value == NULL || strcmp (style->marker_start->value, "none") == 0))
561
+ return;
562
+
563
+ cairo = view->dom_view.cairo;
564
+
565
+ marker = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
566
+ style->marker->value);
567
+ marker_start = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
568
+ style->marker_start->value);
569
+ marker_mid = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
570
+ style->marker_mid->value);
571
+ marker_end = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
572
+ style->marker_end->value);
573
+ stroke_width = lsm_svg_view_normalize_length (view, &view->style->stroke_width->length,
574
+ LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
575
+
576
+ if (marker != NULL && lsm_svg_view_circular_reference_check (view, marker))
577
+ return;
578
+ if (marker_start != NULL && lsm_svg_view_circular_reference_check (view, marker_start))
579
+ return;
580
+ if (marker_mid != NULL && lsm_svg_view_circular_reference_check (view, marker_mid))
581
+ return;
582
+ if (marker_end != NULL && lsm_svg_view_circular_reference_check (view, marker_end))
583
+ return;
584
+
585
+ if (marker_start == NULL)
586
+ marker_start = marker;
587
+ if (marker_mid == NULL)
588
+ marker_mid = marker;
589
+ if (marker_end == NULL)
590
+ marker_end = marker;
591
+
592
+ path = cairo_copy_path (cairo);
593
+ cairo_new_path (cairo);
594
+
595
+ if (path->num_data > 0) {
596
+ next_data = &path->data[0];
597
+ next_type = next_data->header.type;
598
+
599
+ if (next_type == CAIRO_PATH_CURVE_TO) {
600
+ next_x = next_data[3].point.x;
601
+ next_y = next_data[3].point.y;
602
+ } else {
603
+ next_x = next_data[1].point.x;
604
+ next_y = next_data[1].point.y;
605
+ }
606
+
607
+ for (i = 0; i < path->num_data; i += path->data[i].header.length) {
608
+ data = next_data;
609
+
610
+ prev_x = x;
611
+ prev_y = y;
612
+ x = next_x;
613
+ y = next_y;
614
+ type = next_type;
615
+
616
+ if (i + path->data[i].header.length < path->num_data) {
617
+ next_data = &path->data[i + path->data[i].header.length];
618
+ next_type = next_data->header.type;
619
+
620
+ if (next_type == CAIRO_PATH_CURVE_TO) {
621
+ next_x = next_data[3].point.x;
622
+ next_y = next_data[3].point.y;
623
+ } else {
624
+ next_x = next_data[1].point.x;
625
+ next_y = next_data[1].point.y;
626
+ }
627
+ } else {
628
+ next_data = NULL;
629
+ next_type = CAIRO_PATH_MOVE_TO;
630
+ next_x = 0.0;
631
+ next_y = 0.0;
632
+ }
633
+
634
+ if (data->header.type == CAIRO_PATH_CLOSE_PATH) {
635
+ marker = NULL;
636
+ } else if (next_data == NULL ||
637
+ next_data->header.type == CAIRO_PATH_MOVE_TO) {
638
+ marker = marker_end;
639
+ if (type == CAIRO_PATH_CURVE_TO) {
640
+ if (y != data[2].point.y ||
641
+ x != data[2].point.x)
642
+ angle = atan2 (y - data[2].point.y,
643
+ x - data[2].point.x);
644
+ else
645
+ angle = atan2 (y - data[1].point.y,
646
+ x - data[1].point.x);
647
+ } else
648
+ angle = atan2 (y - prev_y, x - prev_x);
649
+ } else if (data->header.type == CAIRO_PATH_MOVE_TO) {
650
+ marker = marker_start;
651
+ if (next_type == CAIRO_PATH_CURVE_TO) {
652
+ if (next_data[1].point.y != y ||
653
+ next_data[1].point.x != x)
654
+ angle = atan2 (next_data[1].point.y - y,
655
+ next_data[1].point.x - x);
656
+ else
657
+ angle = atan2 (next_data[2].point.y - y,
658
+ next_data[2].point.x - x);
659
+ } else
660
+ angle = atan2 (next_y - y, next_x - x);
661
+ } else {
662
+ double xdifin, ydifin, xdifout, ydifout, intot, outtot;
663
+
664
+ marker = marker_mid;
665
+
666
+ if (type == CAIRO_PATH_CURVE_TO) {
667
+ if (x != data[2].point.x ||
668
+ y != data[2].point.y) {
669
+ xdifin = x - data[2].point.x;
670
+ ydifin = y - data[2].point.y;
671
+ } else {
672
+ xdifin = x - data[1].point.x;
673
+ ydifin = y - data[1].point.y;
674
+ }
675
+ } else {
676
+ xdifin = x - prev_x;
677
+ ydifin = y - prev_y;
678
+ }
679
+ if (next_type == CAIRO_PATH_CURVE_TO) {
680
+ if (next_data[1].point.x != x ||
681
+ next_data[1].point.y != y) {
682
+ xdifout = next_data[1].point.x - x;
683
+ ydifout = next_data[1].point.y - y;
684
+ } else {
685
+ xdifout = next_data[2].point.x - x;
686
+ ydifout = next_data[2].point.y - y;
687
+ }
688
+ } else {
689
+ xdifout = next_x - x;
690
+ ydifout = next_y - y;
691
+ }
692
+
693
+ intot = sqrt (xdifin * xdifin + ydifin * ydifin);
694
+ outtot = sqrt (xdifout * xdifout + ydifout * ydifout);
695
+
696
+ xdifin /= intot;
697
+ ydifin /= intot;
698
+ xdifout /= outtot;
699
+ ydifout /= outtot;
700
+
701
+ angle = atan2 ((ydifin + ydifout) / 2, (xdifin + xdifout) / 2);
702
+ }
703
+
704
+ if (marker != NULL) {
705
+ cairo_save (cairo);
706
+ cairo_translate (cairo, x, y);
707
+ lsm_svg_marker_element_render (LSM_SVG_MARKER_ELEMENT (marker), view,
708
+ stroke_width, angle);
709
+ cairo_restore (cairo);
710
+ }
711
+ }
712
+
713
+ cairo_path_destroy (path);
714
+ }
715
+ }
716
+
717
+ static void
718
+ paint (LsmSvgView *view, LsmSvgViewPathInfos *path_infos)
719
+ {
720
+ const LsmSvgStyle *style;
721
+ LsmSvgElement *element;
722
+ cairo_t *cairo;
723
+ gboolean use_group;
724
+ double group_opacity;
725
+
726
+ element = view->element_stack->data;
727
+
728
+ g_return_if_fail (LSM_IS_SVG_ELEMENT (element));
729
+
730
+ cairo = view->dom_view.cairo;
731
+ style = view->style;
732
+
733
+ if ((style->opacity != NULL ||
734
+ style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER ) &&
735
+ style->ignore_group_opacity &&
736
+ g_strcmp0 (style->filter->value, "none") == 0) {
737
+ group_opacity = style->opacity->value;
738
+
739
+ use_group = ((style->fill->paint.type != LSM_SVG_PAINT_TYPE_NONE &&
740
+ style->stroke->paint.type != LSM_SVG_PAINT_TYPE_NONE) ||
741
+ style->stroke->paint.type == LSM_SVG_PAINT_TYPE_URI ||
742
+ style->stroke->paint.type == LSM_SVG_PAINT_TYPE_URI_RGB_COLOR ||
743
+ style->fill->paint.type == LSM_SVG_PAINT_TYPE_URI_RGB_COLOR ||
744
+ style->fill->paint.type == LSM_SVG_PAINT_TYPE_URI) &&
745
+ (group_opacity < 1.0 || style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER );
746
+ } else {
747
+ use_group = FALSE;
748
+ group_opacity = 1.0;
749
+ }
750
+
751
+ /* Instead of push_group, we should restrict to the current path bounding box */
752
+ if (use_group) {
753
+ cairo_push_group (cairo);
754
+ } else if (style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER)
755
+ lsm_cairo_set_comp_op (cairo, style->comp_op->value);
756
+
757
+ if (_set_color (view,
758
+ path_infos,
759
+ LSM_SVG_VIEW_PAINT_OPERATION_FILL,
760
+ &style->fill->paint,
761
+ style->fill_opacity->value * (use_group ? 1.0 : group_opacity))) {
762
+
763
+ if (path_infos->is_text_path) {
764
+ pango_cairo_show_layout (cairo, path_infos->pango_layout);
765
+ } else {
766
+ cairo_set_fill_rule (cairo, style->fill_rule->value == LSM_SVG_FILL_RULE_EVEN_ODD ?
767
+ CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
768
+ cairo_fill_preserve (cairo);
769
+ }
770
+ }
771
+
772
+ if (_set_color (view,
773
+ path_infos,
774
+ LSM_SVG_VIEW_PAINT_OPERATION_STROKE,
775
+ &style->stroke->paint,
776
+ style->stroke_opacity->value * (use_group ? 1.0 : group_opacity))) {
777
+ double line_width;
778
+
779
+ if (path_infos->is_text_path) {
780
+ pango_cairo_layout_path (cairo, path_infos->pango_layout);
781
+ }
782
+
783
+ switch (style->stroke_line_join->value) {
784
+ case LSM_SVG_LINE_JOIN_MITER:
785
+ cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER);
786
+ break;
787
+ case LSM_SVG_LINE_JOIN_ROUND:
788
+ cairo_set_line_join (cairo,CAIRO_LINE_JOIN_ROUND);
789
+ break;
790
+ default:
791
+ cairo_set_line_join (cairo,CAIRO_LINE_JOIN_BEVEL);
792
+ }
793
+
794
+ switch (style->stroke_line_cap->value) {
795
+ case LSM_SVG_LINE_CAP_BUTT:
796
+ cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT);
797
+ break;
798
+ case LSM_SVG_LINE_CAP_ROUND:
799
+ cairo_set_line_cap (cairo, CAIRO_LINE_CAP_ROUND);
800
+ break;
801
+ default:
802
+ cairo_set_line_cap (cairo, CAIRO_LINE_CAP_SQUARE);
803
+ }
804
+
805
+ line_width = lsm_svg_view_normalize_length (view, &style->stroke_width->length,
806
+ LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
807
+
808
+ cairo_set_miter_limit (cairo, style->stroke_miter_limit->value);
809
+ cairo_set_line_width (cairo, line_width);
810
+
811
+ if (style->stroke_dash_array->value.n_dashes > 0) {
812
+ double dash_offset;
813
+ double *dashes;
814
+ unsigned int i;
815
+
816
+ dash_offset = lsm_svg_view_normalize_length (view, &style->stroke_dash_offset->length,
817
+ LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
818
+ dashes = g_new (double, style->stroke_dash_array->value.n_dashes);
819
+ for (i = 0; i < style->stroke_dash_array->value.n_dashes; i++)
820
+ dashes[i] = lsm_svg_view_normalize_length (view,
821
+ &style->stroke_dash_array->value.dashes[i],
822
+ LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
823
+
824
+ cairo_set_dash (cairo, dashes, style->stroke_dash_array->value.n_dashes, dash_offset);
825
+ g_free (dashes);
826
+ } else
827
+ cairo_set_dash (cairo, NULL, 0, 0.0);
828
+
829
+ cairo_stroke_preserve (cairo);
830
+ }
831
+
832
+ paint_markers (view);
833
+
834
+ cairo_new_path (cairo);
835
+
836
+ if (use_group) {
837
+ cairo_pop_group_to_source (cairo);
838
+ if (G_UNLIKELY (style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER))
839
+ lsm_cairo_set_comp_op (cairo, style->comp_op->value);
840
+ cairo_paint_with_alpha (cairo, group_opacity);
841
+ }
842
+
843
+ if (view->style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER)
844
+ lsm_cairo_set_comp_op (cairo, LSM_SVG_COMP_OP_SRC_OVER);
845
+ }
846
+
847
+ static void
848
+ process_path (LsmSvgView *view, LsmSvgViewPathInfos *path_infos)
849
+ {
850
+ g_return_if_fail (view->style != NULL);
851
+
852
+ if (view->is_clipping) {
853
+ if (path_infos->is_text_path)
854
+ pango_cairo_layout_path (view->dom_view.cairo, path_infos->pango_layout);
855
+ cairo_set_fill_rule (view->dom_view.cairo, view->style->clip_rule->value);
856
+ } else
857
+ paint (view, path_infos);
858
+ }
859
+
860
+ void
861
+ lsm_svg_view_show_viewport (LsmSvgView*view, const LsmBox *viewport)
862
+ {
863
+ LsmSvgPaint *paint;
864
+
865
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
866
+ g_return_if_fail (viewport != NULL);
867
+
868
+ paint = &view->style->viewport_fill->paint;
869
+
870
+ switch (paint->type) {
871
+ case LSM_SVG_PAINT_TYPE_RGB_COLOR:
872
+ cairo_set_source_rgba (view->dom_view.cairo,
873
+ paint->color.red,
874
+ paint->color.green,
875
+ paint->color.blue,
876
+ view->style->viewport_fill_opacity->value);
877
+ break;
878
+ case LSM_SVG_PAINT_TYPE_CURRENT_COLOR:
879
+ cairo_set_source_rgba (view->dom_view.cairo,
880
+ view->style->color->value.red,
881
+ view->style->color->value.green,
882
+ view->style->color->value.blue,
883
+ view->style->viewport_fill_opacity->value);
884
+ default:
885
+ return;
886
+ }
887
+
888
+ cairo_rectangle (view->dom_view.cairo, viewport->x, viewport->y, 0, 0);
889
+ cairo_paint (view->dom_view.cairo);
890
+ }
891
+
892
+ /*
893
+ * Code for show_rectangle and show ellipse is inspired from
894
+ * the librsvg library (rsvg-shapes.c)
895
+ *
896
+ * Copyright (C) 2000 Eazel, Inc.
897
+ * Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
898
+ *
899
+ * Authors: Raph Levien <raph@artofcode.com>,
900
+ * Dom Lachowicz <cinamod@hotmail.com>,
901
+ * Caleb Moore <c.moore@student.unsw.edu.au>
902
+ */
903
+
904
+ void
905
+ lsm_svg_view_show_rectangle (LsmSvgView *view,
906
+ double x, double y,
907
+ double w, double h,
908
+ double rx, double ry)
909
+ {
910
+ LsmSvgViewPathInfos path_infos = default_path_infos;
911
+ cairo_t *cairo;
912
+
913
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
914
+
915
+ cairo = view->dom_view.cairo;
916
+
917
+ if (rx <= 0.0 || ry <= 0.0)
918
+ cairo_rectangle (cairo, x, y, w, h);
919
+ else {
920
+
921
+ if (rx > fabs (w / 2.))
922
+ rx = fabs (w / 2.);
923
+ if (ry > fabs (h / 2.))
924
+ ry = fabs (h / 2.);
925
+
926
+ cairo_move_to (cairo, x + rx, y);
927
+ cairo_line_to (cairo, x + w - rx, y);
928
+ lsm_cairo_elliptical_arc (cairo, rx, ry, 0.0, FALSE, TRUE, x + w, y + ry);
929
+ cairo_line_to (cairo, x + w, y + h -ry);
930
+ lsm_cairo_elliptical_arc (cairo, rx, ry, 0.0, FALSE, TRUE, x + w - rx, y + h);
931
+ cairo_line_to (cairo, x + rx, y + h);
932
+ lsm_cairo_elliptical_arc (cairo, rx, ry, 0.0, FALSE, TRUE, x, y + h - ry);
933
+ cairo_line_to (cairo, x, y + ry);
934
+ lsm_cairo_elliptical_arc (cairo, rx, ry, 0.0, FALSE, TRUE, x + rx, y);
935
+ cairo_close_path (cairo);
936
+ }
937
+
938
+ process_path (view, &path_infos);
939
+ }
940
+
941
+ void
942
+ lsm_svg_view_show_circle (LsmSvgView *view, double cx, double cy, double r)
943
+ {
944
+ LsmSvgViewPathInfos path_infos = default_path_infos;
945
+
946
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
947
+
948
+ cairo_arc (view->dom_view.cairo, cx, cy, r, 0, 2 * M_PI);
949
+
950
+ process_path (view, &path_infos);
951
+ }
952
+
953
+ #define LSM_SVG_ARC_MAGIC ((double) 0.5522847498) /* 4/3 * (1-cos 45)/sin 45 = 4/3 * sqrt(2) - 1 */
954
+
955
+ void
956
+ lsm_svg_view_show_ellipse (LsmSvgView *view, double cx, double cy, double rx, double ry)
957
+ {
958
+ LsmSvgViewPathInfos path_infos = default_path_infos;
959
+ cairo_t *cairo;
960
+
961
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
962
+
963
+ if (rx <= 0 || ry <= 0)
964
+ return;
965
+
966
+ cairo = view->dom_view.cairo;
967
+
968
+ cairo_move_to (cairo, cx + rx, cy);
969
+ cairo_curve_to (cairo, cx + rx, cy + LSM_SVG_ARC_MAGIC * ry, cx + LSM_SVG_ARC_MAGIC * rx, cy + ry, cx, cy + ry);
970
+ cairo_curve_to (cairo, cx - LSM_SVG_ARC_MAGIC * rx, cy + ry, cx - rx, cy + LSM_SVG_ARC_MAGIC * ry, cx - rx, cy);
971
+ cairo_curve_to (cairo, cx - rx, cy - LSM_SVG_ARC_MAGIC * ry, cx - LSM_SVG_ARC_MAGIC * rx, cy - ry, cx, cy - ry);
972
+ cairo_curve_to (cairo, cx + LSM_SVG_ARC_MAGIC * rx, cy - ry, cx + rx, cy - LSM_SVG_ARC_MAGIC * ry, cx + rx, cy);
973
+ cairo_close_path (cairo);
974
+
975
+ process_path (view, &path_infos);
976
+ }
977
+
978
+ void
979
+ lsm_svg_view_show_path (LsmSvgView *view,
980
+ const char *d)
981
+ {
982
+ LsmSvgViewPathInfos path_infos = default_path_infos;
983
+
984
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
985
+
986
+ lsm_cairo_emit_svg_path (view->dom_view.cairo, d);
987
+
988
+ process_path (view, &path_infos);
989
+ }
990
+
991
+ void
992
+ lsm_svg_view_path_extents (LsmSvgView *view,
993
+ const char *path,
994
+ LsmExtents *extents)
995
+ {
996
+ double x1, y1, x2, y2;
997
+
998
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
999
+ g_return_if_fail (extents != NULL);
1000
+
1001
+ cairo_new_path (view->dom_view.cairo);
1002
+ lsm_cairo_emit_svg_path (view->dom_view.cairo, path);
1003
+ cairo_path_extents (view->dom_view.cairo, &x1, &y1, &x2, &y2);
1004
+ cairo_new_path (view->dom_view.cairo);
1005
+
1006
+ extents->x1 = x1;
1007
+ extents->x2 = x2;
1008
+ extents->y1 = y1;
1009
+ extents->y2 = y2;
1010
+ }
1011
+
1012
+ void
1013
+ lsm_svg_view_show_line (LsmSvgView *view, double x1, double y1, double x2, double y2)
1014
+ {
1015
+ LsmSvgViewPathInfos path_infos = default_path_infos;
1016
+
1017
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1018
+
1019
+ cairo_move_to (view->dom_view.cairo, x1, y1);
1020
+ cairo_line_to (view->dom_view.cairo, x2, y2);
1021
+
1022
+ process_path (view, &path_infos);
1023
+ }
1024
+
1025
+ static void
1026
+ _show_points (LsmSvgView *view, const char *points, gboolean close_path)
1027
+ {
1028
+ LsmSvgViewPathInfos path_infos = default_path_infos;
1029
+ char *str;
1030
+ double values[2];
1031
+ unsigned int n_values;
1032
+ unsigned int count = 0;
1033
+
1034
+ if (points == NULL)
1035
+ return;
1036
+
1037
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1038
+
1039
+ str = (char *) points;
1040
+
1041
+ do {
1042
+ n_values = lsm_str_parse_double_list (&str, 2, values);
1043
+ if (n_values == 2) {
1044
+ if (count == 0)
1045
+ cairo_move_to (view->dom_view.cairo, values[0], values[1]);
1046
+ else
1047
+ cairo_line_to (view->dom_view.cairo, values[0], values[1]);
1048
+ } else if (n_values != 0) {
1049
+ cairo_new_path (view->dom_view.cairo);
1050
+ return;
1051
+ }
1052
+ count++;
1053
+ } while (n_values == 2);
1054
+
1055
+ if (close_path)
1056
+ cairo_close_path (view->dom_view.cairo);
1057
+
1058
+ process_path (view, &path_infos);
1059
+ }
1060
+
1061
+ void
1062
+ lsm_svg_view_show_polyline (LsmSvgView *view, const char *points)
1063
+ {
1064
+ _show_points (view, points, FALSE);
1065
+ }
1066
+
1067
+ void
1068
+ lsm_svg_view_show_polygon (LsmSvgView *view, const char *points)
1069
+ {
1070
+ _show_points (view, points, TRUE);
1071
+ }
1072
+
1073
+ static void
1074
+ _update_pango_layout (LsmSvgView *view, unsigned int n, char const *string, double x, double y,
1075
+ unsigned int n_dx, const double *dx,
1076
+ unsigned int n_dy, const double *dy,
1077
+ LsmSvgViewPathInfos *path_infos)
1078
+ {
1079
+ const LsmSvgStyle *style;
1080
+ PangoLayout *pango_layout;
1081
+ PangoFontDescription *font_description;
1082
+ PangoStretch font_stretch;
1083
+ PangoStyle font_style;
1084
+ PangoLayoutIter *iter;
1085
+ PangoRectangle rectangle;
1086
+ PangoAttrList *attrs;
1087
+ PangoAttribute *attr;
1088
+ int baseline;
1089
+ int i;
1090
+ double x1, y1;
1091
+
1092
+ style = view->style;
1093
+
1094
+ pango_layout = view->pango_layout;
1095
+ font_description = view->dom_view.font_description;
1096
+
1097
+ pango_font_description_set_family (font_description, style->font_family->value);
1098
+ pango_font_description_set_size (font_description, PANGO_SCALE * style->font_size_px);
1099
+ pango_font_description_set_weight (font_description, style->font_weight->value);
1100
+
1101
+ switch (style->font_stretch->value) {
1102
+ case LSM_SVG_FONT_STRETCH_ULTRA_CONDENSED:
1103
+ font_stretch = PANGO_STRETCH_ULTRA_CONDENSED;
1104
+ break;
1105
+ case LSM_SVG_FONT_STRETCH_EXTRA_CONDENSED:
1106
+ font_stretch = PANGO_STRETCH_EXTRA_CONDENSED;
1107
+ break;
1108
+ case LSM_SVG_FONT_STRETCH_CONDENSED:
1109
+ font_stretch = PANGO_STRETCH_CONDENSED;
1110
+ break;
1111
+ case LSM_SVG_FONT_STRETCH_SEMI_CONDENSED:
1112
+ font_stretch = PANGO_STRETCH_SEMI_CONDENSED;
1113
+ break;
1114
+ case LSM_SVG_FONT_STRETCH_SEMI_EXPANDED:
1115
+ font_stretch = PANGO_STRETCH_SEMI_EXPANDED;
1116
+ break;
1117
+ case LSM_SVG_FONT_STRETCH_EXPANDED:
1118
+ font_stretch = PANGO_STRETCH_EXPANDED;
1119
+ break;
1120
+ case LSM_SVG_FONT_STRETCH_EXTRA_EXPANDED:
1121
+ font_stretch = PANGO_STRETCH_EXTRA_EXPANDED;
1122
+ break;
1123
+ case LSM_SVG_FONT_STRETCH_ULTRA_EXPANDED:
1124
+ font_stretch = PANGO_STRETCH_ULTRA_EXPANDED;
1125
+ break;
1126
+ case LSM_SVG_FONT_STRETCH_NORMAL:
1127
+ default:
1128
+ font_stretch = PANGO_STRETCH_NORMAL;
1129
+ break;
1130
+ }
1131
+ pango_font_description_set_stretch (font_description, font_stretch);
1132
+
1133
+ switch (style->font_style->value) {
1134
+ case LSM_SVG_FONT_STYLE_OBLIQUE:
1135
+ font_style = PANGO_STYLE_OBLIQUE;
1136
+ break;
1137
+ case LSM_SVG_FONT_STYLE_ITALIC:
1138
+ font_style = PANGO_STYLE_ITALIC;
1139
+ break;
1140
+ case LSM_SVG_FONT_STYLE_NORMAL:
1141
+ default:
1142
+ font_style = PANGO_STYLE_NORMAL;
1143
+ break;
1144
+ }
1145
+ pango_font_description_set_style (font_description, font_style);
1146
+
1147
+ pango_layout_set_text (pango_layout, string, n);
1148
+
1149
+ attrs = pango_attr_list_new ();
1150
+ #if 0
1151
+ for (i = 0; i < n_dx; i++) {
1152
+
1153
+ attr = pango_attr_letter_spacing_new (pango_units_from_double (dx[i]));
1154
+ attr->start_index = i;
1155
+ if (i < n_dx - 1)
1156
+ attr->end_index = i + 1;
1157
+ else
1158
+ attr->end_index = PANGO_ATTR_INDEX_TO_TEXT_END;
1159
+
1160
+ pango_attr_list_insert (attrs, attr);
1161
+ }
1162
+ #endif
1163
+ for (i = 0; i < n_dy; i++) {
1164
+
1165
+ attr = pango_attr_rise_new (-pango_units_from_double (dy[i]));
1166
+ attr->start_index = i;
1167
+ if (i < n_dy - 1)
1168
+ attr->end_index = i + 1;
1169
+ else
1170
+ attr->end_index = PANGO_ATTR_INDEX_TO_TEXT_END;
1171
+
1172
+ pango_attr_list_insert (attrs, attr);
1173
+ }
1174
+ pango_layout_set_attributes (pango_layout, attrs);
1175
+ pango_attr_list_unref (attrs);
1176
+
1177
+ pango_layout_set_font_description (pango_layout, font_description);
1178
+ pango_layout_get_extents (pango_layout, &rectangle, NULL);
1179
+
1180
+ iter = pango_layout_get_iter (pango_layout);
1181
+ baseline = pango_layout_iter_get_baseline (iter);
1182
+ pango_layout_iter_free (iter);
1183
+
1184
+ x1 = x - pango_units_to_double (rectangle.x);
1185
+ y1 = y - pango_units_to_double (baseline);
1186
+
1187
+ switch (style->text_anchor->value) {
1188
+ case LSM_SVG_TEXT_ANCHOR_END:
1189
+ x1 -= pango_units_to_double (rectangle.width);
1190
+ break;
1191
+ case LSM_SVG_TEXT_ANCHOR_MIDDLE:
1192
+ x1 -= pango_units_to_double (rectangle.width) / 2.0;
1193
+ break;
1194
+ case LSM_SVG_TEXT_ANCHOR_START:
1195
+ default:
1196
+ break;
1197
+ }
1198
+
1199
+ path_infos->is_text_path = TRUE;
1200
+ path_infos->is_extents_defined = TRUE;
1201
+ path_infos->extents.x1 = x1;
1202
+ path_infos->extents.y1 = y1;
1203
+ path_infos->extents.x2 = x1 + pango_units_to_double (rectangle.width);
1204
+ path_infos->extents.y2 = y1 + pango_units_to_double (rectangle.height);
1205
+ path_infos->pango_layout = pango_layout;
1206
+ }
1207
+
1208
+ static gboolean
1209
+ _lock_pango_layout (LsmSvgView *view)
1210
+ {
1211
+ /* A text may be painted with a text based pattern. In this case,
1212
+ * we take care to create a new pango layout if the current one is in use. */
1213
+ if (view->is_pango_layout_in_use) {
1214
+ PangoContext *pango_context;
1215
+
1216
+ pango_context = pango_layout_get_context (view->pango_layout);
1217
+ view->pango_layout_stack = g_slist_prepend (view->pango_layout_stack, view->pango_layout);
1218
+ view->pango_layout = pango_layout_new (pango_context);
1219
+
1220
+ lsm_debug_render ("[LsmSvgView::_lock_pango_layout] Create a new pango layout");
1221
+
1222
+ return TRUE;
1223
+ }
1224
+
1225
+ view->is_pango_layout_in_use = TRUE;
1226
+
1227
+ return FALSE;
1228
+ }
1229
+
1230
+ static void
1231
+ _unlock_pango_layout (LsmSvgView *view, gboolean need_pop)
1232
+ {
1233
+
1234
+ if (need_pop) {
1235
+ lsm_debug_render ("[LsmSvgView::_unlock_pango_layout] Free the child pango layout");
1236
+
1237
+ if (view->pango_layout != NULL) {
1238
+ g_object_unref (view->pango_layout);
1239
+
1240
+ view->pango_layout = view->pango_layout_stack->data;
1241
+ view->pango_layout_stack = g_slist_delete_link (view->pango_layout_stack,
1242
+ view->pango_layout_stack);
1243
+ } else
1244
+ g_warning ("[LsmSvgView::_unlock_pango_layout] Pango layout stack empty");
1245
+ }
1246
+
1247
+ view->is_pango_layout_in_use = FALSE;
1248
+ }
1249
+
1250
+ static void
1251
+ _show_text (LsmSvgView *view,
1252
+ unsigned int n, char const *string,
1253
+ unsigned int n_x, double *x, unsigned int n_y, double *y,
1254
+ unsigned int n_dx, double *dx, unsigned int n_dy, double *dy)
1255
+ {
1256
+ LsmSvgViewPathInfos path_infos = default_path_infos;
1257
+ PangoRectangle extents;
1258
+ PangoLayoutIter *layout_iter;
1259
+ const LsmSvgStyle *style;
1260
+ gboolean need_pop;
1261
+ double x_text;
1262
+ double y_text;
1263
+ double x_end, y_end;
1264
+ double baseline;
1265
+ cairo_t *cairo;
1266
+
1267
+
1268
+ cairo = view->dom_view.cairo;
1269
+
1270
+ style = view->style;
1271
+
1272
+ lsm_debug_render ("[LsmSvgView::show_text] Show '%s' at %g,%g (%g px)", string,
1273
+ x != NULL ? *x : 0, y != NULL ? *y : 0, style->font_size_px);
1274
+
1275
+ need_pop = _lock_pango_layout (view);
1276
+
1277
+ cairo_get_current_point (cairo, &x_text, &y_text);
1278
+ if (x != NULL)
1279
+ x_text = x[0];
1280
+ if (y != NULL)
1281
+ y_text = y[0];
1282
+
1283
+
1284
+ _update_pango_layout (view, n, string, x_text, y_text, n_dx, dx, n_dy, dy, &path_infos);
1285
+
1286
+ if (style->writing_mode->value == LSM_SVG_WRITING_MODE_TB ||
1287
+ style->writing_mode->value == LSM_SVG_WRITING_MODE_TB_RL) {
1288
+
1289
+ cairo_save (cairo);
1290
+ cairo_rotate (cairo, M_PI / 2.0);
1291
+ cairo_move_to (cairo, path_infos.extents.x1, path_infos.extents.y1);
1292
+
1293
+ process_path (view, &path_infos);
1294
+
1295
+ cairo_restore (cairo);
1296
+ } else {
1297
+ cairo_move_to (cairo, path_infos.extents.x1, path_infos.extents.y1);
1298
+ process_path (view, &path_infos);
1299
+ }
1300
+
1301
+ layout_iter = pango_layout_get_iter (view->pango_layout);
1302
+ pango_layout_iter_get_line_extents (layout_iter, NULL, &extents);
1303
+ baseline = pango_units_to_double (pango_layout_iter_get_baseline (layout_iter));
1304
+ pango_layout_iter_free (layout_iter);
1305
+
1306
+ x_end = pango_units_to_double (extents.x + extents.width) + path_infos.extents.x1;
1307
+ y_end = pango_units_to_double (extents.y) + baseline + path_infos.extents.y1;
1308
+
1309
+ if (view->debug_text) {
1310
+ double x1, y1;
1311
+
1312
+ lsm_debug_render ("[LsmSvgView::_show_text] Logical extents %gx%g at %g,%g\n",
1313
+ pango_units_to_double (extents.width),
1314
+ pango_units_to_double (extents.height),
1315
+ pango_units_to_double (extents.x),
1316
+ pango_units_to_double (extents.y));
1317
+
1318
+ lsm_debug_render ("[LsmSvgView::_show_text] End point is %g, %g\n", x_end, y_end);
1319
+ lsm_debug_render ("[LsmSvgView::_show_text] Baseline = %g\n", baseline);
1320
+
1321
+ x1 = 1;
1322
+ y1 = 1;
1323
+ cairo_device_to_user_distance (cairo, &x1, &y1);
1324
+
1325
+ cairo_set_source_rgba (cairo, 1.0, 0.0, 0.0, 0.2);
1326
+ cairo_set_line_width (cairo, x1);
1327
+ cairo_rectangle (cairo, path_infos.extents.x1, path_infos.extents.y1,
1328
+ pango_units_to_double (extents.x + extents.width),
1329
+ pango_units_to_double (extents.y + extents.height));
1330
+ cairo_stroke (cairo);
1331
+ cairo_set_source_rgba (cairo, 1.0, 0.0, 0.0, 0.2);
1332
+ cairo_arc (cairo, x_end, y_end, 4.0 * x1, 0.0, 2.0 * M_PI);
1333
+ cairo_arc (cairo, path_infos.extents.x1, path_infos.extents.y1, 4.0 * x1, 0.0, 2.0 * M_PI);
1334
+ cairo_fill (cairo);
1335
+ }
1336
+
1337
+ cairo_move_to (cairo, x_end, y_end);
1338
+
1339
+ _unlock_pango_layout (view, need_pop);
1340
+ }
1341
+
1342
+ void
1343
+ lsm_svg_view_start_text (LsmSvgView *view)
1344
+ {
1345
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1346
+
1347
+ cairo_move_to (view->dom_view.cairo, 0, 0);
1348
+ }
1349
+
1350
+ void
1351
+ lsm_svg_view_end_text (LsmSvgView *view)
1352
+ {
1353
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1354
+
1355
+ cairo_new_path (view->dom_view.cairo);
1356
+ }
1357
+
1358
+ void
1359
+ lsm_svg_view_show_text (LsmSvgView *view, char const *string,
1360
+ unsigned int n_x, double *x, unsigned int n_y, double *y,
1361
+ unsigned int n_dx, double *dx, unsigned int n_dy, double *dy)
1362
+ {
1363
+ unsigned int n, i;
1364
+ char *iter = (char *) string;
1365
+
1366
+ if (string == NULL || string[0] == '\0')
1367
+ return;
1368
+
1369
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1370
+ g_return_if_fail (n_x > 0 || x == NULL);
1371
+ g_return_if_fail (n_y > 0 || y == NULL);
1372
+ g_return_if_fail (n_dx > 0 || dx == NULL);
1373
+ g_return_if_fail (n_dy > 0 || dy == NULL);
1374
+
1375
+ n = MAX (n_x, n_y);
1376
+ if (n <= 1) {
1377
+ _show_text (view, strlen (string), string, n_x, x, n_y, y, n_dx, dx, n_dy, dy);
1378
+ return;
1379
+ }
1380
+
1381
+ for (i = 0; (i < n - 1) && iter[0] != '\0'; i++) {
1382
+ char *next_char;
1383
+
1384
+ next_char = g_utf8_next_char (iter);
1385
+ _show_text (view, next_char - iter, iter,
1386
+ i < n_x ? n_x - i : 0,
1387
+ i < n_x ? &x[i] : NULL,
1388
+ i < n_y ? n_y - i : 0,
1389
+ i < n_y ? &y[i] : NULL,
1390
+ i < n_dx ? n_dx - i : 0,
1391
+ i < n_dx ? &dx[i] : NULL,
1392
+ i < n_dy ? n_dy - i : 0,
1393
+ i < n_dy ? &dy[i] : NULL);
1394
+ iter = next_char;
1395
+ }
1396
+
1397
+ if (iter[0] != '\0')
1398
+ _show_text (view, strlen (iter), iter,
1399
+ i < n_x ? n_x - i : 0,
1400
+ i < n_x ? &x[i] : NULL,
1401
+ i < n_y ? n_y - i : 0,
1402
+ i < n_y ? &y[i] : NULL,
1403
+ i < n_dx ? n_dx - i : 0,
1404
+ i < n_dx ? &dx[i] : NULL,
1405
+ i < n_dy ? n_dy - i : 0,
1406
+ i < n_dy ? &dy[i] : NULL);
1407
+ }
1408
+
1409
+ void
1410
+ lsm_svg_view_text_extents (LsmSvgView *view, char const *string,
1411
+ double x, double y,
1412
+ unsigned int n_dx, double *dx, unsigned int n_dy, double *dy,
1413
+ LsmExtents *extents)
1414
+ {
1415
+ LsmSvgViewPathInfos path_infos = default_path_infos;
1416
+ gboolean need_pop;
1417
+
1418
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1419
+ g_return_if_fail (extents != NULL);
1420
+
1421
+ if (string == NULL ||
1422
+ string[0] == '\0') {
1423
+ extents->x1 = 0;
1424
+ extents->y1 = 0;
1425
+ extents->y1 = 0;
1426
+ extents->y2 = 0;
1427
+ }
1428
+
1429
+ need_pop = _lock_pango_layout (view);
1430
+
1431
+ _update_pango_layout (view, strlen (string), string, x, y, n_dx, dx, n_dy, dy, &path_infos);
1432
+
1433
+ _unlock_pango_layout (view, need_pop);
1434
+
1435
+ *extents = path_infos.extents;
1436
+ }
1437
+
1438
+ void
1439
+ lsm_svg_view_show_pixbuf (LsmSvgView *view, GdkPixbuf *pixbuf)
1440
+ {
1441
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1442
+ g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
1443
+
1444
+ lsm_cairo_set_source_pixbuf (view->dom_view.cairo, pixbuf, 0, 0);
1445
+ cairo_paint (view->dom_view.cairo);
1446
+ }
1447
+
1448
+ void
1449
+ lsm_svg_view_push_viewbox (LsmSvgView *view, const LsmBox *viewbox)
1450
+ {
1451
+ LsmSvgViewbox *svg_viewbox;
1452
+
1453
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1454
+
1455
+ lsm_debug_render ("[LsmSvgView::push_viewbox] viewbox = %g, %g, %g, %g",
1456
+ viewbox->x, viewbox->y, viewbox->width, viewbox->height);
1457
+
1458
+ svg_viewbox = lsm_svg_viewbox_new (view->resolution_ppi, viewbox);
1459
+
1460
+ view->viewbox_stack = g_slist_prepend (view->viewbox_stack, svg_viewbox);
1461
+ }
1462
+
1463
+ void
1464
+ lsm_svg_view_pop_viewbox (LsmSvgView *view)
1465
+ {
1466
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1467
+ g_return_if_fail (view->viewbox_stack != NULL);
1468
+
1469
+ lsm_debug_render ("[LsmSvgView::pop_viewbox]");
1470
+
1471
+ lsm_svg_viewbox_free (view->viewbox_stack->data);
1472
+ view->viewbox_stack = g_slist_delete_link (view->viewbox_stack, view->viewbox_stack);
1473
+ }
1474
+
1475
+ static const LsmBox *
1476
+ _compute_viewbox_scale (const LsmBox *viewport, const LsmBox *viewbox,
1477
+ const LsmSvgPreserveAspectRatio *aspect_ratio,
1478
+ double *x_offset, double *y_offset,
1479
+ double *x_scale, double *y_scale)
1480
+ {
1481
+ if (viewbox != NULL) {
1482
+ double x, y;
1483
+ double x_ratio;
1484
+ double y_ratio;
1485
+
1486
+ x_ratio = viewbox->width > 0.0 ? viewport->width / viewbox->width : 0.0;
1487
+ y_ratio = viewbox->height > 0.0 ? viewport->height / viewbox->height : 0.0;
1488
+
1489
+ if (aspect_ratio != NULL && aspect_ratio->align > LSM_SVG_ALIGN_NONE) {
1490
+ if (aspect_ratio->meet_or_slice == LSM_SVG_MEET_OR_SLICE_MEET) {
1491
+ *x_scale = MIN (x_ratio, y_ratio);
1492
+ *y_scale = *x_scale;
1493
+ } else {
1494
+ *x_scale = MAX (x_ratio, y_ratio);
1495
+ *y_scale = *x_scale;
1496
+ }
1497
+
1498
+ x = -viewbox->x * *x_scale;
1499
+ y = -viewbox->y * *y_scale;
1500
+
1501
+ switch (aspect_ratio->align) {
1502
+ case LSM_SVG_ALIGN_X_MIN_Y_MIN:
1503
+ break;
1504
+ case LSM_SVG_ALIGN_X_MIN_Y_MID:
1505
+ y += (viewport->height- viewbox->height * *y_scale) * 0.5;
1506
+ break;
1507
+ case LSM_SVG_ALIGN_X_MIN_Y_MAX:
1508
+ y += (viewport->height - viewbox->height * *y_scale);
1509
+ break;
1510
+ case LSM_SVG_ALIGN_X_MID_Y_MIN:
1511
+ x += (viewport->width - viewbox->width * *x_scale) * 0.5;
1512
+ break;
1513
+ case LSM_SVG_ALIGN_X_MID_Y_MID:
1514
+ x += (viewport->width - viewbox->width * *x_scale) * 0.5;
1515
+ y += (viewport->height- viewbox->height * *y_scale) * 0.5;
1516
+ break;
1517
+ case LSM_SVG_ALIGN_X_MID_Y_MAX:
1518
+ x += (viewport->width - viewbox->width * *x_scale) * 0.5;
1519
+ y += (viewport->height - viewbox->height * *y_scale);
1520
+ break;
1521
+ case LSM_SVG_ALIGN_X_MAX_Y_MIN:
1522
+ x += (viewport->width - viewbox->width * *x_scale);
1523
+ break;
1524
+ case LSM_SVG_ALIGN_X_MAX_Y_MID:
1525
+ x += (viewport->width - viewbox->width * *x_scale);
1526
+ y += (viewport->height- viewbox->height * *y_scale) * 0.5;
1527
+ break;
1528
+ case LSM_SVG_ALIGN_X_MAX_Y_MAX:
1529
+ x += (viewport->width - viewbox->width * *x_scale);
1530
+ y += (viewport->height - viewbox->height * *y_scale);
1531
+ break;
1532
+ default:
1533
+ break;
1534
+ }
1535
+
1536
+ *x_offset = x;
1537
+ *y_offset = y;
1538
+
1539
+ } else {
1540
+ *x_scale = x_ratio;
1541
+ *y_scale = y_ratio;
1542
+
1543
+ *x_offset = -viewbox->x * *x_scale;
1544
+ *y_offset = -viewbox->y * *y_scale;
1545
+ }
1546
+
1547
+ lsm_debug_render ("[LsmSvgView::_compute_viewbox_scale] scale = %g, %g", *x_scale, *y_scale);
1548
+
1549
+ return viewbox;
1550
+ }
1551
+
1552
+ *x_scale = *y_scale = 1.0;
1553
+ *x_offset = 0.0;
1554
+ *y_offset = 0.0;
1555
+
1556
+ return viewport;
1557
+ }
1558
+
1559
+ void
1560
+ lsm_svg_view_push_viewport (LsmSvgView *view, const LsmBox *viewport, const LsmBox *viewbox,
1561
+ const LsmSvgPreserveAspectRatio *aspect_ratio,
1562
+ LsmSvgOverflow overflow)
1563
+ {
1564
+ cairo_t *cairo;
1565
+ const LsmBox *actual_viewbox;
1566
+ double x_offset, y_offset;
1567
+ double x_scale, y_scale;
1568
+
1569
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1570
+ g_return_if_fail (viewport != NULL);
1571
+
1572
+ actual_viewbox = _compute_viewbox_scale (viewport, viewbox, aspect_ratio,
1573
+ &x_offset, &y_offset, &x_scale, &y_scale);
1574
+ lsm_svg_view_push_viewbox (view, actual_viewbox);
1575
+
1576
+ cairo = view->dom_view.cairo;
1577
+
1578
+ cairo_save (cairo);
1579
+
1580
+ if (lsm_debug_check (&lsm_debug_category_viewport, LSM_DEBUG_LEVEL_LOG)) {
1581
+ cairo_save (cairo);
1582
+ cairo_set_line_width (cairo, 1.0);
1583
+ cairo_set_source_rgb (cairo, 0.0, 0.0, 0.0);
1584
+ cairo_rectangle (cairo, viewport->x, viewport->y, viewport->width, viewport->height);
1585
+ cairo_stroke (cairo);
1586
+ cairo_restore (cairo);
1587
+ }
1588
+
1589
+ if (overflow == LSM_SVG_OVERFLOW_HIDDEN) {
1590
+ cairo_rectangle (cairo, viewport->x, viewport->y, viewport->width, viewport->height);
1591
+ cairo_clip (cairo);
1592
+ }
1593
+
1594
+ cairo_translate (cairo, viewport->x + x_offset, viewport->y + y_offset);
1595
+ cairo_scale (cairo, x_scale, y_scale);
1596
+ }
1597
+
1598
+ void
1599
+ lsm_svg_view_pop_viewport (LsmSvgView *view)
1600
+ {
1601
+ cairo_restore (view->dom_view.cairo);
1602
+
1603
+ lsm_svg_view_pop_viewbox (view);
1604
+ }
1605
+
1606
+ void
1607
+ lsm_svg_view_viewbox_to_viewport (LsmSvgView *view, const LsmBox *viewport, const LsmBox *viewbox,
1608
+ const LsmSvgPreserveAspectRatio *aspect_ratio,
1609
+ double *x, double *y)
1610
+ {
1611
+ double x_offset, y_offset;
1612
+ double x_scale, y_scale;
1613
+
1614
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1615
+ g_return_if_fail (viewport != NULL);
1616
+
1617
+ _compute_viewbox_scale (viewport, viewbox, aspect_ratio,
1618
+ &x_offset, &y_offset, &x_scale, &y_scale);
1619
+
1620
+ if (x != NULL)
1621
+ *x = *x * x_scale + x_offset;
1622
+
1623
+ if (y != NULL)
1624
+ *y = *y * y_scale + y_offset;
1625
+ }
1626
+
1627
+ gboolean
1628
+ lsm_svg_view_push_matrix (LsmSvgView *view, const LsmSvgMatrix *matrix)
1629
+ {
1630
+ cairo_matrix_t cr_matrix;
1631
+ cairo_matrix_t cr_inv_matrix;
1632
+ cairo_matrix_t *ctm;
1633
+ cairo_status_t status;
1634
+
1635
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), FALSE);
1636
+
1637
+ ctm = g_new (cairo_matrix_t, 1);
1638
+ cairo_get_matrix (view->dom_view.cairo, ctm);
1639
+
1640
+ view->matrix_stack = g_slist_prepend (view->matrix_stack, ctm);
1641
+
1642
+ lsm_debug_render ("[LsmSvgView::push_matrix] New transform %g, %g, %g, %g, %g, %g",
1643
+ matrix->a, matrix->b, matrix->c, matrix->d, matrix->e, matrix->f);
1644
+
1645
+ cairo_matrix_init (&cr_matrix, matrix->a, matrix->b, matrix->c, matrix->d, matrix->e, matrix->f);
1646
+ cr_inv_matrix = cr_matrix;
1647
+ status = cairo_matrix_invert (&cr_inv_matrix) == CAIRO_STATUS_SUCCESS;
1648
+
1649
+ if (status == CAIRO_STATUS_SUCCESS) {
1650
+ lsm_debug_render ("[LsmSvgView::push_matrix] Not invertible matrix");
1651
+ return FALSE;
1652
+ }
1653
+
1654
+ cairo_transform (view->dom_view.cairo, &cr_matrix);
1655
+
1656
+ {
1657
+ cairo_matrix_t current_ctm;
1658
+ cairo_get_matrix (view->dom_view.cairo, &current_ctm);
1659
+
1660
+ lsm_debug_render ("[LsmSvgView::push_matrix] Current ctm %g, %g, %g, %g, %g, %g",
1661
+ current_ctm.xx, current_ctm.xy, current_ctm.yx, current_ctm.yy,
1662
+ current_ctm.x0, current_ctm.y0);
1663
+ }
1664
+
1665
+ return TRUE;
1666
+ }
1667
+
1668
+ void
1669
+ lsm_svg_view_pop_matrix (LsmSvgView *view)
1670
+ {
1671
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1672
+
1673
+ if (view->matrix_stack != NULL) {
1674
+ cairo_matrix_t *ctm;
1675
+
1676
+ ctm = view->matrix_stack->data;
1677
+
1678
+ cairo_set_matrix (view->dom_view.cairo, ctm);
1679
+
1680
+ lsm_debug_render ("[LsmSvgView::pop_matrix] Restore ctm %g, %g, %g, %g, %g, %g",
1681
+ ctm->xx, ctm->xy, ctm->yx, ctm->yy,
1682
+ ctm->x0, ctm->y0);
1683
+
1684
+ g_free (ctm);
1685
+ view->matrix_stack = g_slist_delete_link (view->matrix_stack, view->matrix_stack);
1686
+ }
1687
+ }
1688
+
1689
+ static void
1690
+ lsm_svg_view_push_clip (LsmSvgView *view)
1691
+ {
1692
+ LsmSvgElement *element;
1693
+ LsmExtents extents;
1694
+ char *url;
1695
+
1696
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1697
+ g_return_if_fail (!view->is_clipping);
1698
+
1699
+ lsm_svg_element_get_extents (view->element_stack->data, view, &extents);
1700
+
1701
+ url = view->style->clip_path->value;
1702
+
1703
+ lsm_debug_render ("[LsmSvgView::push_clip] Using '%s'", url);
1704
+
1705
+ cairo_save (view->dom_view.cairo);
1706
+
1707
+ view->clip_extents.x = extents.x1;
1708
+ view->clip_extents.y = extents.y1;
1709
+ view->clip_extents.width = extents.x2 - extents.x1;
1710
+ view->clip_extents.height = extents.y2 - extents.y1;
1711
+
1712
+ lsm_debug_render ("[LsmSvgView::push_clip] x=%g y=%g w=%g h=%g",
1713
+ view->clip_extents.x,
1714
+ view->clip_extents.y,
1715
+ view->clip_extents.width,
1716
+ view->clip_extents.height);
1717
+
1718
+ element = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document), url);
1719
+ if (LSM_IS_SVG_CLIP_PATH_ELEMENT (element) &&
1720
+ !lsm_svg_view_circular_reference_check (view, element)) {
1721
+ view->is_clipping = TRUE;
1722
+ lsm_svg_element_force_render (LSM_SVG_ELEMENT (element), view);
1723
+ cairo_clip (view->dom_view.cairo);
1724
+ view->is_clipping = FALSE;
1725
+ } else
1726
+ lsm_warning_render ("[LsmSvgView::push_clip] Clip path not found: %s", view->style->clip_path->value);
1727
+ }
1728
+
1729
+ static void
1730
+ lsm_svg_view_pop_clip (LsmSvgView *view)
1731
+ {
1732
+ lsm_debug_render ("[LsmSvgView::pop_clip");
1733
+
1734
+ cairo_restore (view->dom_view.cairo);
1735
+ }
1736
+
1737
+ static void
1738
+ lsm_svg_view_push_mask (LsmSvgView *view)
1739
+ {
1740
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1741
+
1742
+ cairo_push_group (view->dom_view.cairo);
1743
+ }
1744
+
1745
+ static void
1746
+ lsm_svg_view_pop_mask (LsmSvgView *view)
1747
+ {
1748
+ LsmSvgElement *mask_element;
1749
+
1750
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1751
+
1752
+ mask_element = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
1753
+ view->style->mask->value);
1754
+
1755
+ if (LSM_IS_SVG_MASK_ELEMENT (mask_element) &&
1756
+ !lsm_svg_view_circular_reference_check (view, mask_element)) {
1757
+ LsmExtents extents;
1758
+ LsmBox mask_extents;
1759
+ cairo_t *cairo;
1760
+
1761
+ lsm_svg_element_get_extents (view->element_stack->data, view, &extents);
1762
+
1763
+ mask_extents.x = extents.x1;
1764
+ mask_extents.y = extents.y1;
1765
+ mask_extents.width = extents.x2 - extents.x1;
1766
+ mask_extents.height = extents.y2 - extents.y1;
1767
+
1768
+ cairo = view->dom_view.cairo;
1769
+
1770
+ _start_pattern (view, &mask_extents, &mask_extents, 1.0);
1771
+
1772
+ lsm_svg_element_force_render (LSM_SVG_ELEMENT (mask_element), view);
1773
+
1774
+ cairo_pop_group_to_source (cairo);
1775
+ if (view->pattern_data->pattern != NULL) {
1776
+ cairo_surface_t *surface;
1777
+
1778
+ if (cairo_pattern_get_surface (view->pattern_data->pattern, &surface) == CAIRO_STATUS_SUCCESS) {
1779
+ int width, height, row, i, stride;
1780
+ unsigned char *pixels;
1781
+
1782
+ pixels = cairo_image_surface_get_data (surface);
1783
+ height = cairo_image_surface_get_height (surface);
1784
+ width = cairo_image_surface_get_width (surface);
1785
+ stride = cairo_image_surface_get_stride (surface);
1786
+
1787
+ for (row = 0; row < height; row++) {
1788
+ guint8 *row_data = (pixels + (row * stride));
1789
+ for (i = 0; i < width; i++) {
1790
+ guint32 *pixel = (guint32 *) row_data + i;
1791
+ *pixel = ((((*pixel & 0x00ff0000) >> 16) * 13817 +
1792
+ ((*pixel & 0x0000ff00) >> 8) * 46518 +
1793
+ ((*pixel & 0x000000ff)) * 4688) * 0xff
1794
+ /* * opacity */);
1795
+ }
1796
+ }
1797
+ }
1798
+
1799
+ cairo_pattern_set_extend (view->pattern_data->pattern, CAIRO_EXTEND_NONE);
1800
+
1801
+ if (view->debug_mask && view->dom_view.cairo != NULL) {
1802
+ char *filename;
1803
+
1804
+ filename = g_strdup_printf ("mask-%s.png", view->style->mask->value);
1805
+ cairo_surface_write_to_png (cairo_get_target (view->dom_view.cairo), filename);
1806
+ g_free (filename);
1807
+ }
1808
+
1809
+ cairo_mask (cairo, view->pattern_data->pattern);
1810
+ } else {
1811
+ cairo_paint (cairo);
1812
+ }
1813
+
1814
+ _end_pattern (view);
1815
+ } else {
1816
+ lsm_warning_render ("[LsmSvgView::pop_mask] Mask url nout found: %s", view->style->mask->value);
1817
+
1818
+ cairo_pop_group_to_source (view->dom_view.cairo);
1819
+ cairo_paint (view->dom_view.cairo);
1820
+ }
1821
+ }
1822
+
1823
+ static void
1824
+ lsm_svg_view_push_filter (LsmSvgView *view)
1825
+ {
1826
+ LsmExtents extents;
1827
+ LsmBox object_extents;
1828
+ LsmBox effect_viewport;
1829
+ LsmSvgElement *filter_element;
1830
+ gboolean success;
1831
+
1832
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1833
+ g_return_if_fail (view->element_stack != NULL);
1834
+
1835
+ lsm_svg_element_get_extents (view->element_stack->data, view, &extents);
1836
+
1837
+ object_extents.x = extents.x1;
1838
+ object_extents.y = extents.y1;
1839
+ object_extents.width = extents.x2 - extents.x1;
1840
+ object_extents.height = extents.y2 - extents.y1;
1841
+
1842
+ filter_element = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
1843
+ view->style->filter->value);
1844
+
1845
+ if (LSM_IS_SVG_FILTER_ELEMENT (filter_element)) {
1846
+ effect_viewport = lsm_svg_filter_element_get_effect_viewport (LSM_SVG_FILTER_ELEMENT (filter_element),
1847
+ &object_extents, view);
1848
+
1849
+ _start_pattern (view, &effect_viewport, &object_extents,
1850
+ view->style->opacity != NULL ? view->style->opacity->value : 1.0);
1851
+
1852
+ success = lsm_svg_view_create_surface_pattern (view,
1853
+ &effect_viewport,
1854
+ NULL,
1855
+ LSM_SVG_VIEW_SURFACE_TYPE_IMAGE);
1856
+ } else {
1857
+ lsm_warning_render ("LsmSvgView::push_filter] Filter not found: %s", view->style->filter->value);
1858
+
1859
+ _start_pattern (view, &object_extents, &object_extents, 0.0);
1860
+
1861
+ success = lsm_svg_view_create_surface_pattern (view,
1862
+ &object_extents,
1863
+ NULL,
1864
+ LSM_SVG_VIEW_SURFACE_TYPE_IMAGE);
1865
+ }
1866
+
1867
+ if (!success)
1868
+ lsm_warning_render ("LsmSvgView::push_filter] Failed to create subsurface");
1869
+ }
1870
+
1871
+ static void
1872
+ lsm_svg_view_pop_filter (LsmSvgView *view)
1873
+ {
1874
+ LsmSvgElement *filter_element;
1875
+ LsmSvgFilterSurface *filter_surface;
1876
+ cairo_surface_t *surface;
1877
+ GSList *iter;
1878
+
1879
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
1880
+
1881
+ filter_element = lsm_svg_document_get_element_by_url (LSM_SVG_DOCUMENT (view->dom_view.document),
1882
+ view->style->filter->value);
1883
+
1884
+ if (LSM_IS_SVG_FILTER_ELEMENT (filter_element) &&
1885
+ view->pattern_data->pattern != NULL) {
1886
+ if (cairo_pattern_get_surface (view->pattern_data->pattern, &surface) == CAIRO_STATUS_SUCCESS) {
1887
+ cairo_matrix_t matrix;
1888
+ LsmBox subregion;
1889
+
1890
+ view->filter_surfaces = NULL;
1891
+
1892
+ subregion.x = 0;
1893
+ subregion.y = 0;
1894
+ subregion.width = cairo_image_surface_get_width (surface);
1895
+ subregion.height = cairo_image_surface_get_height (surface);
1896
+
1897
+ filter_surface = lsm_svg_filter_surface_new_with_content ("SourceGraphic", surface, &subregion);
1898
+ cairo_pattern_get_matrix (view->pattern_data->pattern, &matrix);
1899
+
1900
+ view->filter_surfaces = g_slist_prepend (view->filter_surfaces, filter_surface);
1901
+
1902
+ lsm_svg_element_force_render (filter_element, view);
1903
+
1904
+ if (view->debug_filter) {
1905
+ GSList *iter;
1906
+ char *filename;
1907
+ static int count = 0;
1908
+
1909
+ for (iter = view->filter_surfaces; iter != NULL; iter = iter->next) {
1910
+ LsmSvgFilterSurface *surface = iter->data;
1911
+
1912
+ filename = g_strdup_printf ("filter-%04d-%s-%s.png", count++,
1913
+ view->style->filter->value,
1914
+ lsm_svg_filter_surface_get_name (surface));
1915
+ cairo_surface_write_to_png (lsm_svg_filter_surface_get_cairo_surface (surface), filename);
1916
+ g_free (filename);
1917
+ }
1918
+ }
1919
+
1920
+ if (view->filter_surfaces->next != NULL) {
1921
+ cairo_pattern_t *pattern;
1922
+ cairo_surface_t *surface;
1923
+
1924
+ surface = lsm_svg_filter_surface_get_cairo_surface (view->filter_surfaces->data);
1925
+ pattern = cairo_pattern_create_for_surface (surface);
1926
+ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_NONE);
1927
+ cairo_pattern_set_matrix (pattern, &matrix);
1928
+ cairo_set_source (view->pattern_data->old_cairo, pattern);
1929
+ cairo_pattern_destroy (pattern);
1930
+ cairo_paint_with_alpha (view->pattern_data->old_cairo, view->style->opacity->value);
1931
+ }
1932
+
1933
+ for (iter = view->filter_surfaces; iter != NULL; iter = iter->next)
1934
+ lsm_svg_filter_surface_unref (iter->data);
1935
+ g_slist_free (view->filter_surfaces);
1936
+ view->filter_surfaces = NULL;
1937
+ }
1938
+ }
1939
+
1940
+ _end_pattern (view);
1941
+ }
1942
+
1943
+ static LsmSvgFilterSurface *
1944
+ _get_filter_surface (LsmSvgView *view, const char *input)
1945
+ {
1946
+ GSList *iter;
1947
+ LsmSvgFilterSurface *source_surface = NULL;
1948
+
1949
+ if (input == NULL)
1950
+ return view->filter_surfaces->data;
1951
+
1952
+ for (iter = view->filter_surfaces; iter != NULL; iter = iter->next) {
1953
+ LsmSvgFilterSurface *surface = iter->data;
1954
+
1955
+ if (g_strcmp0 (input, lsm_svg_filter_surface_get_name (surface)) == 0)
1956
+ return surface;
1957
+
1958
+ source_surface = surface;
1959
+ }
1960
+
1961
+ if (g_strcmp0 (input, "SourceAlpha") == 0 && source_surface != NULL) {
1962
+ LsmSvgFilterSurface *surface;
1963
+
1964
+ surface = lsm_svg_filter_surface_new_similar ("SourceAlpha", source_surface, NULL);
1965
+ lsm_svg_filter_surface_alpha (source_surface, surface);
1966
+ view->filter_surfaces = g_slist_prepend (view->filter_surfaces, surface);
1967
+
1968
+ return surface;
1969
+ } else if (g_strcmp0 (input, "BackgroundImage") == 0) {
1970
+ LsmSvgFilterSurface *surface;
1971
+ LsmSvgViewBackground *background;
1972
+ gboolean background_processing = FALSE;
1973
+ cairo_matrix_t matrix;
1974
+ cairo_matrix_t pattern_matrix;
1975
+ cairo_t *cairo;
1976
+ GList *iter;
1977
+
1978
+ for (iter = view->background_stack; iter != NULL; iter = iter->next) {
1979
+ background = iter->data;
1980
+
1981
+ if (background->enable_background) {
1982
+ background_processing = TRUE;
1983
+ break;
1984
+ }
1985
+ }
1986
+
1987
+ if (!background_processing) {
1988
+ lsm_debug_render ("[LsmSvgView::_get_filter_surface] Background processing not enabled");
1989
+ return NULL;
1990
+ }
1991
+
1992
+ surface = lsm_svg_filter_surface_new_similar ("BackgroundImage", source_surface, NULL);
1993
+ view->filter_surfaces = g_slist_prepend (view->filter_surfaces, surface);
1994
+
1995
+ cairo_get_matrix (view->pattern_data->old_cairo, &matrix);
1996
+ cairo_pattern_get_matrix (view->pattern_data->pattern, &pattern_matrix);
1997
+
1998
+ cairo_matrix_invert (&matrix);
1999
+ cairo_matrix_multiply (&matrix, &matrix, &pattern_matrix);
2000
+
2001
+ lsm_debug_render ("[LsmSvgView::_get_filter_surface] Background image matrix %g, %g, %g, %g, %g, %g",
2002
+ matrix.xx, matrix.xy, matrix.yx, matrix.yy,
2003
+ matrix.x0, matrix.y0);
2004
+
2005
+ cairo = cairo_create (lsm_svg_filter_surface_get_cairo_surface (surface));
2006
+ cairo_set_matrix (cairo, &matrix);
2007
+
2008
+ for (; iter != NULL; iter = iter->prev) {
2009
+ background = iter->data;
2010
+
2011
+ cairo_set_source_surface (cairo, background->surface, 0, 0);
2012
+ cairo_paint_with_alpha (cairo, background->group_opacity);
2013
+ }
2014
+
2015
+ cairo_destroy (cairo);
2016
+
2017
+ return surface;
2018
+ } else if (g_strcmp0 (input, "BackgroundAlpha") == 0) {
2019
+ LsmSvgFilterSurface *surface;
2020
+ LsmSvgFilterSurface *background_surface;
2021
+
2022
+ if (view->background_stack == NULL)
2023
+ return NULL;
2024
+
2025
+ background_surface = _get_filter_surface (view, "BackgroundImage");
2026
+
2027
+ surface = lsm_svg_filter_surface_new_similar ("BackgroundAlpha", background_surface, NULL);
2028
+ lsm_svg_filter_surface_alpha (background_surface, surface);
2029
+ view->filter_surfaces = g_slist_prepend (view->filter_surfaces, surface);
2030
+
2031
+ return surface;
2032
+ }
2033
+
2034
+ return NULL;
2035
+ }
2036
+
2037
+ static LsmSvgFilterSurface *
2038
+ _create_filter_surface (LsmSvgView *view, const char *output, LsmSvgFilterSurface *input_surface, const LsmBox *subregion)
2039
+ {
2040
+ LsmSvgFilterSurface *surface;
2041
+
2042
+ surface = lsm_svg_filter_surface_new_similar (output, input_surface, subregion);
2043
+
2044
+ view->filter_surfaces = g_slist_prepend (view->filter_surfaces, surface);
2045
+
2046
+ return surface;
2047
+ }
2048
+
2049
+ LsmBox
2050
+ lsm_svg_view_get_filter_surface_extents (LsmSvgView *view, const char *name)
2051
+ {
2052
+ static LsmBox null_extents = {.x = 0.0, .y = 0.0, .width = 0.0, .height = 0.0};
2053
+ LsmSvgFilterSurface *surface;
2054
+ LsmBox extents;
2055
+
2056
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), null_extents);
2057
+
2058
+ surface = _get_filter_surface (view, name);
2059
+ if (surface == NULL)
2060
+ return null_extents;
2061
+
2062
+ lsm_cairo_box_device_to_user (view->dom_view.cairo, &extents, lsm_svg_filter_surface_get_subregion (surface));
2063
+
2064
+ return extents;
2065
+ }
2066
+
2067
+ void
2068
+ lsm_svg_view_apply_blend (LsmSvgView *view, const char *input_1, const char*input_2, const char *output,
2069
+ const LsmBox *subregion, LsmSvgBlendingMode mode)
2070
+ {
2071
+ LsmSvgFilterSurface *output_surface;
2072
+ LsmSvgFilterSurface *input_1_surface;
2073
+ LsmSvgFilterSurface *input_2_surface;
2074
+ LsmBox subregion_px;
2075
+
2076
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2077
+
2078
+ input_1_surface = _get_filter_surface (view, input_1);
2079
+ input_2_surface = _get_filter_surface (view, input_2);
2080
+
2081
+ if (input_1_surface == NULL || input_2_surface == NULL) {
2082
+ lsm_warning_render ("[SvgView::apply_blend] Inputs '%s' or '%s' not found", input_1, input_2);
2083
+ return;
2084
+ }
2085
+
2086
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2087
+ output_surface = _create_filter_surface (view, output, input_1_surface, &subregion_px);
2088
+
2089
+ lsm_log_render ("[SvgView::blend] mode = %s", lsm_svg_blending_mode_to_string (mode));
2090
+
2091
+ lsm_svg_filter_surface_blend (input_1_surface, input_2_surface, output_surface, mode);
2092
+ }
2093
+
2094
+ void
2095
+ lsm_svg_view_apply_flood (LsmSvgView *view, const char *output, const LsmBox *subregion)
2096
+ {
2097
+ LsmSvgFilterSurface *output_surface;
2098
+ LsmSvgFilterSurface *input_surface;
2099
+ LsmBox subregion_px;
2100
+
2101
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2102
+
2103
+ input_surface = _get_filter_surface (view, NULL);
2104
+
2105
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2106
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2107
+
2108
+ lsm_log_render ("[SvgView::apply_flood] subregion %gx%g px at %g,%g px",
2109
+ subregion_px.width, subregion_px.height,
2110
+ subregion_px.x, subregion_px.y);
2111
+
2112
+ lsm_svg_filter_surface_flood (output_surface,
2113
+ view->style->flood_color->value.red,
2114
+ view->style->flood_color->value.green,
2115
+ view->style->flood_color->value.blue,
2116
+ view->style->flood_opacity->value);
2117
+ }
2118
+
2119
+ void
2120
+ lsm_svg_view_apply_image (LsmSvgView *view, const char *output, const LsmBox *subregion,
2121
+ GdkPixbuf *pixbuf, LsmSvgPreserveAspectRatio preserve_aspect_ratio)
2122
+ {
2123
+ LsmSvgFilterSurface *output_surface;
2124
+ LsmSvgFilterSurface *input_surface;
2125
+ LsmBox subregion_px;
2126
+
2127
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2128
+
2129
+ input_surface = _get_filter_surface (view, NULL);
2130
+
2131
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2132
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2133
+
2134
+ lsm_log_render ("[SvgView::apply_image]");
2135
+
2136
+ lsm_svg_filter_surface_image (output_surface, pixbuf, preserve_aspect_ratio);
2137
+ }
2138
+
2139
+ void
2140
+ lsm_svg_view_apply_gaussian_blur (LsmSvgView *view, const char *input, const char *output,
2141
+ const LsmBox *subregion, double std_x, double std_y)
2142
+ {
2143
+ LsmSvgFilterSurface *input_surface;
2144
+ LsmSvgFilterSurface *output_surface;
2145
+ LsmBox subregion_px;
2146
+
2147
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2148
+
2149
+ input_surface = _get_filter_surface (view, input);
2150
+
2151
+ if (input_surface == NULL) {
2152
+ lsm_debug_render ("[SvgView::apply_gaussian_blur] Input '%s' not found", input);
2153
+ return;
2154
+ }
2155
+
2156
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2157
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2158
+
2159
+ lsm_log_render ("[SvgView::apply_gaussian_blur] %s -> %s (%g,%g)",
2160
+ input != NULL ? input : "previous",
2161
+ output != NULL ? output : "next",
2162
+ std_x, std_y);
2163
+
2164
+ cairo_user_to_device_distance (view->dom_view.cairo, &std_x, &std_y);
2165
+
2166
+ lsm_log_render ("[SvgView::apply_gaussian_blur] %g px,%g px",
2167
+ std_x, std_y);
2168
+
2169
+ lsm_svg_filter_surface_blur (input_surface, output_surface, std_x, std_y);
2170
+ }
2171
+
2172
+ void
2173
+ lsm_svg_view_apply_offset (LsmSvgView *view, const char *input, const char *output,
2174
+ const LsmBox *subregion, double dx, double dy)
2175
+ {
2176
+ LsmSvgFilterSurface *input_surface;
2177
+ LsmSvgFilterSurface *output_surface;
2178
+ LsmBox subregion_px;
2179
+
2180
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2181
+
2182
+ input_surface = _get_filter_surface (view, input);
2183
+
2184
+ if (input_surface == NULL) {
2185
+ lsm_debug_render ("[SvgView::apply_offset] Input '%s' not found", input);
2186
+ return;
2187
+ }
2188
+
2189
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2190
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2191
+
2192
+ lsm_log_render ("[SvgView::apply_offset] %s -> %s (dx:%g,dy:%g)", input, output, dx, dy);
2193
+
2194
+ cairo_user_to_device_distance (view->dom_view.cairo, &dx, &dy);
2195
+
2196
+ lsm_log_render ("[SvgView::apply_offset] %g px,%g px", dx, dy);
2197
+
2198
+ lsm_svg_filter_surface_offset (input_surface, output_surface, dx, dy);
2199
+ }
2200
+
2201
+ void
2202
+ lsm_svg_view_apply_color_matrix (LsmSvgView *view, const char *input, const char *output,
2203
+ const LsmBox *subregion, LsmSvgColorFilterType type,
2204
+ unsigned int n_values, const double *values)
2205
+ {
2206
+ LsmSvgFilterSurface *input_surface;
2207
+ LsmSvgFilterSurface *output_surface;
2208
+ LsmBox subregion_px;
2209
+
2210
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2211
+
2212
+ input_surface = _get_filter_surface (view, input);
2213
+
2214
+ if (input_surface == NULL) {
2215
+ lsm_debug_render ("[SvgView::apply_color_matrix] Input '%s' not found", input);
2216
+ return;
2217
+ }
2218
+
2219
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2220
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2221
+
2222
+ lsm_svg_filter_surface_color_matrix (input_surface, output_surface, type, n_values, values);
2223
+ }
2224
+
2225
+ void
2226
+ lsm_svg_view_apply_displacement_map (LsmSvgView *view, const char *input_1, const char *input_2, const char *output,
2227
+ const LsmBox *subregion,
2228
+ double scale, LsmSvgChannelSelector x_channel_selector, LsmSvgChannelSelector y_channel_selector)
2229
+ {
2230
+ LsmSvgFilterSurface *output_surface;
2231
+ LsmSvgFilterSurface *input_1_surface;
2232
+ LsmSvgFilterSurface *input_2_surface;
2233
+ LsmBox subregion_px;
2234
+ cairo_matrix_t transform;
2235
+ double x_scale, y_scale;
2236
+
2237
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2238
+
2239
+ input_1_surface = _get_filter_surface (view, input_1);
2240
+ input_2_surface = _get_filter_surface (view, input_2);
2241
+
2242
+ if (input_1_surface == NULL || input_2_surface == NULL) {
2243
+ lsm_warning_render ("[SvgView::apply_displacement_map] Inputs '%s' or '%s' not found", input_1, input_2);
2244
+ return;
2245
+ }
2246
+
2247
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2248
+ output_surface = _create_filter_surface (view, output, input_1_surface, &subregion_px);
2249
+
2250
+ cairo_get_matrix (view->dom_view.cairo, &transform);
2251
+
2252
+ x_scale = transform.xx * scale;
2253
+ y_scale = transform.yy * scale;
2254
+
2255
+ lsm_svg_filter_surface_displacement_map (input_1_surface, input_2_surface, output_surface, x_scale, y_scale,
2256
+ x_channel_selector, y_channel_selector);
2257
+ }
2258
+
2259
+ void
2260
+ lsm_svg_view_apply_morphology (LsmSvgView *view, const char *input, const char *output, const LsmBox *subregion,
2261
+ LsmSvgMorphologyOperator op, double radius)
2262
+ {
2263
+ LsmSvgFilterSurface *input_surface;
2264
+ LsmSvgFilterSurface *output_surface;
2265
+ LsmBox subregion_px;
2266
+ double rx, ry;
2267
+
2268
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2269
+
2270
+ input_surface = _get_filter_surface (view, input);
2271
+
2272
+ if (input_surface == NULL) {
2273
+ lsm_debug_render ("[SvgView::apply_morphoogy] Input '%s' not found", input);
2274
+ return;
2275
+ }
2276
+
2277
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2278
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2279
+
2280
+ rx = radius;
2281
+ ry = radius;
2282
+ cairo_user_to_device_distance (view->dom_view.cairo, &rx, &ry);
2283
+
2284
+ lsm_svg_filter_surface_morphology (input_surface, output_surface, op, rx, ry);
2285
+ }
2286
+
2287
+ void
2288
+ lsm_svg_view_apply_convolve_matrix (LsmSvgView *view, const char *input, const char *output, const LsmBox *subregion,
2289
+ unsigned x_order, unsigned y_order, unsigned n_values, double *values,
2290
+ double divisor, double bias, int target_x, int target_y,
2291
+ LsmSvgEdgeMode edge_mode, gboolean preserve_alpha)
2292
+ {
2293
+ LsmSvgFilterSurface *input_surface;
2294
+ LsmSvgFilterSurface *output_surface;
2295
+ LsmBox subregion_px;
2296
+
2297
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2298
+
2299
+ input_surface = _get_filter_surface (view, input);
2300
+
2301
+ if (input_surface == NULL) {
2302
+ lsm_debug_render ("[SvgView::apply_color_matrix] Input '%s' not found", input);
2303
+ return;
2304
+ }
2305
+
2306
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2307
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2308
+
2309
+ lsm_svg_filter_surface_convolve_matrix (input_surface, output_surface, x_order, y_order, n_values, values,
2310
+ divisor, bias, target_x, target_y, edge_mode, preserve_alpha);
2311
+ }
2312
+
2313
+ void
2314
+ lsm_svg_view_apply_specular_lighting (LsmSvgView *view, const char *output, const LsmBox *subregion,
2315
+ double surface_scale, double specular_constant, double specular_exponent,
2316
+ double dx, double dy)
2317
+ {
2318
+ LsmSvgFilterSurface *output_surface;
2319
+ LsmSvgFilterSurface *input_surface;
2320
+ LsmBox subregion_px;
2321
+
2322
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2323
+
2324
+ input_surface = _get_filter_surface (view, NULL);
2325
+
2326
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2327
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2328
+
2329
+ lsm_log_render ("[SvgView::apply_specular_lighting] subregion %gx%g px at %g,%g px",
2330
+ subregion_px.width, subregion_px.height,
2331
+ subregion_px.x, subregion_px.y);
2332
+
2333
+ cairo_user_to_device_distance (view->dom_view.cairo, &dx, &dy);
2334
+
2335
+ lsm_svg_filter_surface_specular_lighting (output_surface, surface_scale, specular_constant, specular_exponent, dx, dy);
2336
+ }
2337
+
2338
+ void
2339
+ lsm_svg_view_apply_turbulence (LsmSvgView *view, const char *output, const LsmBox *subregion,
2340
+ double base_frequency_x, double base_frequency_y,
2341
+ int n_octaves, double seed,
2342
+ LsmSvgStitchTiles stitch_tiles,
2343
+ LsmSvgTurbulenceType type)
2344
+ {
2345
+ LsmSvgFilterSurface *output_surface;
2346
+ LsmSvgFilterSurface *input_surface;
2347
+ LsmBox subregion_px;
2348
+ cairo_matrix_t transform;
2349
+
2350
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2351
+
2352
+ input_surface = _get_filter_surface (view, NULL);
2353
+
2354
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2355
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2356
+
2357
+ lsm_log_render ("[SvgView::apply_turbulence] subregion %gx%g px at %g,%g px",
2358
+ subregion_px.width, subregion_px.height,
2359
+ subregion_px.x, subregion_px.y);
2360
+
2361
+ cairo_get_matrix (view->dom_view.cairo, &transform);
2362
+
2363
+ lsm_svg_filter_surface_turbulence (output_surface, base_frequency_x, base_frequency_y, n_octaves, seed, stitch_tiles, type,
2364
+ &transform);
2365
+ }
2366
+
2367
+ void
2368
+ lsm_svg_view_apply_merge (LsmSvgView *view, const char *input, const char *output, const LsmBox *subregion)
2369
+ {
2370
+ LsmSvgFilterSurface *input_surface;
2371
+ LsmSvgFilterSurface *output_surface;
2372
+ LsmBox subregion_px;
2373
+
2374
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2375
+
2376
+ input_surface = _get_filter_surface (view, input);
2377
+
2378
+ if (input_surface == NULL) {
2379
+ lsm_debug_render ("[SvgView::apply_offset] Input '%s' not found", input);
2380
+ return;
2381
+ }
2382
+
2383
+ output_surface = _get_filter_surface (view, output);
2384
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2385
+ if (output_surface == NULL)
2386
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2387
+
2388
+ if (output_surface != NULL)
2389
+ lsm_svg_filter_surface_merge (input_surface, output_surface);
2390
+ }
2391
+
2392
+ void
2393
+ lsm_svg_view_apply_tile (LsmSvgView *view, const char *input, const char *output, const LsmBox *subregion)
2394
+ {
2395
+ LsmSvgFilterSurface *input_surface;
2396
+ LsmSvgFilterSurface *output_surface;
2397
+ LsmBox subregion_px;
2398
+
2399
+ input_surface = _get_filter_surface (view, input);
2400
+
2401
+ if (input_surface == NULL) {
2402
+ lsm_debug_render ("[SvgView::apply_offset] Input '%s' not found", input);
2403
+ return;
2404
+ }
2405
+
2406
+ lsm_cairo_box_user_to_device (view->dom_view.cairo, &subregion_px, subregion);
2407
+ output_surface = _create_filter_surface (view, output, input_surface, &subregion_px);
2408
+
2409
+ lsm_svg_filter_surface_tile (input_surface, output_surface);
2410
+ }
2411
+
2412
+ void
2413
+ lsm_svg_view_push_element (LsmSvgView *view, const LsmSvgElement *element)
2414
+ {
2415
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2416
+ g_return_if_fail (LSM_IS_SVG_ELEMENT (element));
2417
+
2418
+ view->element_stack = g_slist_prepend (view->element_stack, (void *) element);
2419
+ }
2420
+
2421
+ void
2422
+ lsm_svg_view_pop_element (LsmSvgView *view)
2423
+ {
2424
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2425
+ g_return_if_fail (view->element_stack != NULL);
2426
+
2427
+ view->element_stack = g_slist_delete_link (view->element_stack, view->element_stack);
2428
+ }
2429
+
2430
+ LsmSvgElement *
2431
+ lsm_svg_view_get_referencing_element (LsmSvgView *view)
2432
+ {
2433
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), NULL);
2434
+
2435
+ if (view->element_stack == NULL ||
2436
+ view->element_stack->next == NULL)
2437
+ return NULL;
2438
+
2439
+ return view->element_stack->next->data;
2440
+ }
2441
+
2442
+ static gboolean
2443
+ lsm_svg_view_circular_reference_check (LsmSvgView *view, LsmSvgElement *element)
2444
+ {
2445
+ GSList *iter;
2446
+
2447
+ for (iter = view->element_stack; iter != NULL; iter = iter->next)
2448
+ if (iter->data == element) {
2449
+ lsm_debug_render ("[LsmSvgView::circular_reference_check] "
2450
+ "Circular reference to %s (id = %s)",
2451
+ lsm_dom_element_get_tag_name (LSM_DOM_ELEMENT (element)),
2452
+ lsm_dom_element_get_attribute (LSM_DOM_ELEMENT (element), "id"));
2453
+ return TRUE;
2454
+ }
2455
+
2456
+ return FALSE;
2457
+ }
2458
+
2459
+ void
2460
+ lsm_svg_view_push_style (LsmSvgView *view, LsmSvgStyle *style)
2461
+ {
2462
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2463
+ g_return_if_fail (style != NULL);
2464
+
2465
+ lsm_log_render ("[SvgView::push_style]");
2466
+
2467
+ if (view->style == NULL || (style->font_size != view->style->font_size)) {
2468
+ LsmSvgViewbox font_viewbox;
2469
+ LsmSvgViewbox *viewbox;
2470
+ double current_font_size_px;
2471
+
2472
+ if (view->style != NULL)
2473
+ current_font_size_px = view->style->font_size_px;
2474
+ else
2475
+ current_font_size_px = 0.0;
2476
+
2477
+ viewbox = view->viewbox_stack->data;
2478
+ font_viewbox.resolution_ppi = viewbox->resolution_ppi;
2479
+ font_viewbox.viewbox.x = 0;
2480
+ font_viewbox.viewbox.y = 0;
2481
+ font_viewbox.viewbox.width = current_font_size_px;
2482
+ font_viewbox.viewbox.height = current_font_size_px;
2483
+
2484
+ style->font_size_px = lsm_svg_length_normalize (&style->font_size->length, &font_viewbox,
2485
+ current_font_size_px, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
2486
+
2487
+ if (style->font_size_px < 0.0)
2488
+ style->font_size_px = 0.0;
2489
+ lsm_log_render ("[SvgView::push_style] Font size = %g pixels", style->font_size_px);
2490
+ } else
2491
+ style->font_size_px = view->style->font_size_px;
2492
+
2493
+ view->style_stack = g_slist_prepend (view->style_stack, (void *) style);
2494
+ view->style = style;
2495
+
2496
+ }
2497
+
2498
+ void
2499
+ lsm_svg_view_push_composition (LsmSvgView *view, LsmSvgStyle *style)
2500
+ {
2501
+ gboolean do_filter;
2502
+ gboolean do_mask;
2503
+ gboolean do_clip;
2504
+
2505
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2506
+ g_return_if_fail (style != NULL);
2507
+
2508
+ lsm_svg_view_push_style (view, style);
2509
+
2510
+ lsm_log_render ("[SvgView::push_composition]");
2511
+
2512
+ do_clip = (g_strcmp0 (style->clip_path->value, "none") != 0);
2513
+ do_mask = (g_strcmp0 (style->mask->value, "none") != 0);
2514
+ do_filter = (g_strcmp0 (style->filter->value, "none") != 0);
2515
+
2516
+ if (G_UNLIKELY((view->style->opacity->value < 1.0 ||
2517
+ view->style->enable_background->value == LSM_SVG_ENABLE_BACKGROUND_NEW ||
2518
+ view->style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER) &&
2519
+ !do_filter &&
2520
+ !view->is_clipping &&
2521
+ !view->style->ignore_group_opacity &&
2522
+ view->dom_view.cairo != NULL)) {
2523
+ LsmSvgViewBackground *background;
2524
+
2525
+ lsm_debug_render ("[LsmSvgView::push_composition] Push group");
2526
+ cairo_push_group (view->dom_view.cairo);
2527
+
2528
+ background = g_slice_new (LsmSvgViewBackground);
2529
+ background->surface = cairo_get_group_target (view->dom_view.cairo);
2530
+ background->group_opacity = view->style->opacity->value;
2531
+ background->enable_background = view->style->enable_background->value == LSM_SVG_ENABLE_BACKGROUND_NEW;
2532
+
2533
+ view->background_stack = g_list_prepend (view->background_stack, background);
2534
+ }
2535
+
2536
+ if (G_UNLIKELY (do_clip)) {
2537
+ lsm_debug_render ("[LsmSvgView::push_style] Start clip '%s'", style->clip_path->value);
2538
+ lsm_svg_view_push_clip (view);
2539
+ }
2540
+
2541
+ if (G_UNLIKELY (do_mask)) {
2542
+ lsm_debug_render ("[LsmSvgView::push_style] Start mask '%s'", style->mask->value);
2543
+ lsm_svg_view_push_mask (view);
2544
+ }
2545
+
2546
+ /* Don't do filtering during a clipping operation, as filter will
2547
+ * create a new subsurface, where clipping should occur with the path
2548
+ * of the clip-path element. */
2549
+ if (G_UNLIKELY (do_filter && !view->is_clipping)) {
2550
+ lsm_debug_render ("[LsmSvgView::push_style] Start filter '%s'", style->filter->value);
2551
+ lsm_svg_view_push_filter (view);
2552
+ }
2553
+ }
2554
+
2555
+ void lsm_svg_view_pop_style (LsmSvgView *view)
2556
+ {
2557
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2558
+ g_return_if_fail (view->style_stack != NULL);
2559
+
2560
+ view->style_stack = g_slist_delete_link (view->style_stack, view->style_stack);
2561
+ view->style = view->style_stack != NULL ? view->style_stack->data : NULL;
2562
+
2563
+ lsm_log_render ("[SvgView::pop_style]");
2564
+ }
2565
+
2566
+ void lsm_svg_view_pop_composition (LsmSvgView *view)
2567
+ {
2568
+ gboolean do_filter;
2569
+ gboolean do_mask;
2570
+ gboolean do_clip;
2571
+ cairo_t *cairo;
2572
+
2573
+ g_return_if_fail (LSM_IS_SVG_VIEW (view));
2574
+ g_return_if_fail (view->style != NULL);
2575
+
2576
+ lsm_log_render ("[SvgView::pop_composition]");
2577
+
2578
+ do_clip = (g_strcmp0 (view->style->clip_path->value, "none") != 0);
2579
+ do_mask = (g_strcmp0 (view->style->mask->value, "none") != 0);
2580
+ do_filter = (g_strcmp0 (view->style->filter->value, "none") != 0);
2581
+
2582
+ /* Don't do filtering during a clipping operation, as filter will
2583
+ * create a new subsurface, where clipping should occur with the path
2584
+ * of the clip-path element. */
2585
+ if (G_UNLIKELY (do_filter && !view->is_clipping))
2586
+ lsm_svg_view_pop_filter (view);
2587
+
2588
+ if (G_UNLIKELY (do_mask))
2589
+ lsm_svg_view_pop_mask (view);
2590
+
2591
+ if (G_UNLIKELY (do_clip))
2592
+ lsm_svg_view_pop_clip (view);
2593
+
2594
+ cairo = view->dom_view.cairo;
2595
+
2596
+ if (G_UNLIKELY ((view->style->opacity->value < 1.0 ||
2597
+ view->style->enable_background->value == LSM_SVG_ENABLE_BACKGROUND_NEW ||
2598
+ view->style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER) &&
2599
+ !do_filter &&
2600
+ !view->is_clipping &&
2601
+ !view->style->ignore_group_opacity &&
2602
+ cairo != NULL)) {
2603
+ g_slice_free (LsmSvgViewBackground, view->background_stack->data);
2604
+ view->background_stack = g_list_delete_link (view->background_stack, view->background_stack);
2605
+
2606
+ cairo_pop_group_to_source (view->dom_view.cairo);
2607
+ if (G_UNLIKELY (view->style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER))
2608
+ lsm_cairo_set_comp_op (cairo, view->style->comp_op->value);
2609
+ cairo_paint_with_alpha (cairo, view->style->opacity->value);
2610
+ if (G_UNLIKELY (view->style->comp_op->value != LSM_SVG_COMP_OP_SRC_OVER))
2611
+ lsm_cairo_set_comp_op (cairo, LSM_SVG_COMP_OP_SRC_OVER);
2612
+ lsm_debug_render ("[LsmSvgView::pop_composition] Pop group");
2613
+ }
2614
+
2615
+ lsm_svg_view_pop_style (view);
2616
+ }
2617
+
2618
+ LsmSvgStyle *
2619
+ lsm_svg_view_get_current_style (LsmSvgView *view)
2620
+ {
2621
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), NULL);
2622
+
2623
+ return (LsmSvgStyle *) view->style;
2624
+ }
2625
+
2626
+ const LsmBox *
2627
+ lsm_svg_view_get_pattern_extents (LsmSvgView *view)
2628
+ {
2629
+ static LsmBox null_extents = {.x = 0.0, .y = 0.0, .width = 0.0, .height = 0.0};
2630
+
2631
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), &null_extents);
2632
+ g_return_val_if_fail (view->pattern_data != NULL, &null_extents);
2633
+
2634
+ return &view->pattern_data->extents;
2635
+ }
2636
+
2637
+ const LsmBox *
2638
+ lsm_svg_view_get_object_extents (LsmSvgView *view)
2639
+ {
2640
+ static LsmBox null_extents = {.x = 0.0, .y = 0.0, .width = 0.0, .height = 0.0};
2641
+
2642
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), &null_extents);
2643
+ g_return_val_if_fail (view->pattern_data != NULL, &null_extents);
2644
+
2645
+ return &view->pattern_data->object_extents;
2646
+ }
2647
+
2648
+ const LsmBox *
2649
+ lsm_svg_view_get_clip_extents (LsmSvgView *view)
2650
+ {
2651
+ static LsmBox null_extents = {.x = 0.0, .y = 0.0, .width = 0.0, .height = 0.0};
2652
+
2653
+ g_return_val_if_fail (LSM_IS_SVG_VIEW (view), &null_extents);
2654
+ g_return_val_if_fail (view->is_clipping, &null_extents);
2655
+
2656
+ return &view->clip_extents;
2657
+ }
2658
+
2659
+ static void
2660
+ lsm_svg_view_measure (LsmDomView *view, double *width, double *height, double *baseline)
2661
+ {
2662
+ LsmSvgSvgElement *svg_element;
2663
+
2664
+ svg_element = lsm_svg_document_get_root_element (LSM_SVG_DOCUMENT (view->document));
2665
+ if (svg_element == NULL)
2666
+ return;
2667
+
2668
+ lsm_svg_svg_element_measure (svg_element, LSM_SVG_VIEW (view), width, height);
2669
+ if (baseline)
2670
+ *baseline = *height;
2671
+ }
2672
+
2673
+ static void
2674
+ lsm_svg_view_render (LsmDomView *view)
2675
+ {
2676
+ LsmSvgView *svg_view;
2677
+ LsmSvgSvgElement *svg_element;
2678
+
2679
+ svg_view = LSM_SVG_VIEW (view);
2680
+
2681
+ svg_element = lsm_svg_document_get_root_element (LSM_SVG_DOCUMENT (view->document));
2682
+ if (svg_element == NULL)
2683
+ return;
2684
+
2685
+ svg_view->style_stack = NULL;
2686
+ svg_view->element_stack = NULL;
2687
+ svg_view->viewbox_stack = NULL;
2688
+ svg_view->matrix_stack = NULL;
2689
+ svg_view->pango_layout_stack = NULL;
2690
+ svg_view->background_stack = NULL;
2691
+
2692
+ svg_view->is_clipping = FALSE;
2693
+ svg_view->is_pango_layout_in_use = FALSE;
2694
+ svg_view->pango_layout = view->pango_layout;
2695
+
2696
+ svg_view->resolution_ppi = lsm_dom_view_get_resolution (view);
2697
+
2698
+ lsm_svg_svg_element_render (svg_element, svg_view);
2699
+
2700
+ if (svg_view->is_pango_layout_in_use)
2701
+ g_warning ("[LsmSvgView::render] Unfinished text redenring");
2702
+
2703
+ if (svg_view->is_clipping)
2704
+ g_warning ("[LsmSvgView::render] Unfinished clipping");
2705
+
2706
+ if (svg_view->pango_layout_stack != NULL) {
2707
+ g_warning ("[LsmSvgView::render] Dangling pango_layout in stack");
2708
+ g_slist_free (svg_view->pango_layout_stack);
2709
+ svg_view->pango_layout_stack = NULL;
2710
+ }
2711
+
2712
+ if (svg_view->matrix_stack != NULL) {
2713
+ g_warning ("[LsmSvgView::render] Dangling matrix in stack");
2714
+ g_slist_free (svg_view->matrix_stack);
2715
+ svg_view->matrix_stack = NULL;
2716
+ }
2717
+ if (svg_view->viewbox_stack != NULL) {
2718
+ g_warning ("[LsmSvgView::render] Dangling viewport in stack");
2719
+ g_slist_free (svg_view->viewbox_stack);
2720
+ svg_view->viewbox_stack = NULL;
2721
+ }
2722
+ if (svg_view->element_stack != NULL) {
2723
+ g_warning ("[LsmSvgView::render] Dangling element in stack");
2724
+ g_slist_free (svg_view->element_stack);
2725
+ svg_view->element_stack = NULL;
2726
+ }
2727
+ if (svg_view->style_stack != NULL) {
2728
+ g_warning ("[LsmSvgView::render] Dangling style in stack");
2729
+ g_slist_free (svg_view->style_stack);
2730
+ svg_view->style_stack = NULL;
2731
+ }
2732
+ if (svg_view->background_stack != NULL) {
2733
+ g_warning ("[LsmSvgView::render] Dangling background in stack");
2734
+ g_list_free (svg_view->background_stack);
2735
+ svg_view->background_stack = NULL;
2736
+ }
2737
+ }
2738
+
2739
+ static void
2740
+ lsm_svg_view_set_debug (LsmDomView *view, const char *feature, gboolean enable)
2741
+ {
2742
+ LsmSvgView *svg_view = LSM_SVG_VIEW (view);
2743
+
2744
+ if (g_strcmp0 (feature, "filter") == 0)
2745
+ svg_view->debug_filter = enable;
2746
+ else if (g_strcmp0 (feature, "mask") == 0)
2747
+ svg_view->debug_mask = enable;
2748
+ else if (g_strcmp0 (feature, "pattern") == 0)
2749
+ svg_view->debug_pattern = enable;
2750
+ else if (g_strcmp0 (feature, "group") == 0)
2751
+ svg_view->debug_group = enable;
2752
+ else if (g_strcmp0 (feature, "text") == 0)
2753
+ svg_view->debug_text = enable;
2754
+ }
2755
+
2756
+ LsmSvgView *
2757
+ lsm_svg_view_new (LsmSvgDocument *document)
2758
+ {
2759
+ LsmSvgView *view;
2760
+
2761
+ view = g_object_new (LSM_TYPE_SVG_VIEW, NULL);
2762
+
2763
+ lsm_dom_view_set_document (LSM_DOM_VIEW (view), LSM_DOM_DOCUMENT (document));
2764
+
2765
+ return view;
2766
+ }
2767
+
2768
+ static void
2769
+ lsm_svg_view_init (LsmSvgView *view)
2770
+ {
2771
+ view->debug_mask = FALSE;
2772
+ view->debug_filter = FALSE;
2773
+ view->debug_pattern = FALSE;
2774
+ }
2775
+
2776
+ static void
2777
+ lsm_svg_view_finalize (GObject *object)
2778
+ {
2779
+ parent_class->finalize (object);
2780
+ }
2781
+
2782
+ static void
2783
+ lsm_svg_view_class_init (LsmSvgViewClass *view_class)
2784
+ {
2785
+ GObjectClass *object_class = G_OBJECT_CLASS (view_class);
2786
+ LsmDomViewClass *d_view_class = LSM_DOM_VIEW_CLASS (view_class);
2787
+
2788
+ parent_class = g_type_class_peek_parent (view_class);
2789
+
2790
+ object_class->finalize = lsm_svg_view_finalize;
2791
+
2792
+ d_view_class->measure = lsm_svg_view_measure;
2793
+ d_view_class->render = lsm_svg_view_render;
2794
+ d_view_class->set_debug = lsm_svg_view_set_debug;
2795
+ }
2796
+
2797
+ G_DEFINE_TYPE (LsmSvgView, lsm_svg_view, LSM_TYPE_DOM_VIEW)