cairo 1.14.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

Files changed (636) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +7 -0
  3. data/COPYING +59 -0
  4. data/GPL +340 -0
  5. data/Gemfile +5 -0
  6. data/NEWS +429 -0
  7. data/README.rdoc +120 -0
  8. data/Rakefile +620 -0
  9. data/ext/cairo/cairo.def +140 -0
  10. data/ext/cairo/depend +3 -0
  11. data/ext/cairo/extconf.rb +202 -0
  12. data/ext/cairo/rb_cairo.c +111 -0
  13. data/ext/cairo/rb_cairo.h +348 -0
  14. data/ext/cairo/rb_cairo_constants.c +673 -0
  15. data/ext/cairo/rb_cairo_context.c +1741 -0
  16. data/ext/cairo/rb_cairo_device.c +475 -0
  17. data/ext/cairo/rb_cairo_exception.c +446 -0
  18. data/ext/cairo/rb_cairo_font_extents.c +200 -0
  19. data/ext/cairo/rb_cairo_font_face.c +726 -0
  20. data/ext/cairo/rb_cairo_font_options.c +197 -0
  21. data/ext/cairo/rb_cairo_glyph.c +161 -0
  22. data/ext/cairo/rb_cairo_io.c +166 -0
  23. data/ext/cairo/rb_cairo_io.h +44 -0
  24. data/ext/cairo/rb_cairo_matrix.c +366 -0
  25. data/ext/cairo/rb_cairo_path.c +459 -0
  26. data/ext/cairo/rb_cairo_pattern.c +1192 -0
  27. data/ext/cairo/rb_cairo_private.c +255 -0
  28. data/ext/cairo/rb_cairo_private.h +129 -0
  29. data/ext/cairo/rb_cairo_rectangle.c +83 -0
  30. data/ext/cairo/rb_cairo_region.c +385 -0
  31. data/ext/cairo/rb_cairo_scaled_font.c +235 -0
  32. data/ext/cairo/rb_cairo_surface.c +2284 -0
  33. data/ext/cairo/rb_cairo_text_cluster.c +151 -0
  34. data/ext/cairo/rb_cairo_text_extents.c +221 -0
  35. data/lib/2.0/cairo.so +0 -0
  36. data/lib/2.1/cairo.so +0 -0
  37. data/lib/2.2/cairo.so +0 -0
  38. data/lib/cairo.rb +154 -0
  39. data/lib/cairo/color.rb +267 -0
  40. data/lib/cairo/colors.rb +656 -0
  41. data/lib/cairo/constants.rb +24 -0
  42. data/lib/cairo/context.rb +29 -0
  43. data/lib/cairo/context/blur.rb +45 -0
  44. data/lib/cairo/context/circle.rb +9 -0
  45. data/lib/cairo/context/color.rb +11 -0
  46. data/lib/cairo/context/path.rb +117 -0
  47. data/lib/cairo/context/rectangle.rb +33 -0
  48. data/lib/cairo/context/triangle.rb +12 -0
  49. data/lib/cairo/device.rb +13 -0
  50. data/lib/cairo/paper.rb +183 -0
  51. data/lib/cairo/papers.rb +65 -0
  52. data/lib/cairo/path.rb +15 -0
  53. data/lib/cairo/pattern.rb +12 -0
  54. data/lib/cairo/point.rb +7 -0
  55. data/lib/cairo/surface.rb +13 -0
  56. data/samples/agg/aa_test.rb +304 -0
  57. data/samples/blur.rb +46 -0
  58. data/samples/pac-nomralize.rb +170 -0
  59. data/samples/pac-tee.rb +170 -0
  60. data/samples/pac.rb +98 -0
  61. data/samples/png.rb +44 -0
  62. data/samples/scalable.rb +55 -0
  63. data/samples/text-on-path.rb +59 -0
  64. data/samples/text2.rb +130 -0
  65. data/test/cairo-test-utils.rb +44 -0
  66. data/test/run-test.rb +29 -0
  67. data/test/test_color.rb +17 -0
  68. data/test/test_constants.rb +27 -0
  69. data/test/test_context.rb +105 -0
  70. data/test/test_exception.rb +36 -0
  71. data/test/test_font_extents.rb +36 -0
  72. data/test/test_font_face.rb +257 -0
  73. data/test/test_font_options.rb +13 -0
  74. data/test/test_image_surface.rb +28 -0
  75. data/test/test_paper.rb +81 -0
  76. data/test/test_quartz_image_surface.rb +13 -0
  77. data/test/test_raster_source_pattern.rb +162 -0
  78. data/test/test_recording_surface.rb +19 -0
  79. data/test/test_region.rb +102 -0
  80. data/test/test_scaled_font.rb +34 -0
  81. data/test/test_script_device.rb +46 -0
  82. data/test/test_script_surface.rb +13 -0
  83. data/test/test_surface.rb +61 -0
  84. data/test/test_tee_surface.rb +32 -0
  85. data/test/test_text_cluster.rb +32 -0
  86. data/test/test_text_extents.rb +40 -0
  87. data/test/test_text_to_glyphs_data.rb +51 -0
  88. data/test/test_xml_device.rb +22 -0
  89. data/test/test_xml_surface.rb +34 -0
  90. data/vendor/local/bin/fc-cache.exe +0 -0
  91. data/vendor/local/bin/fc-cat.exe +0 -0
  92. data/vendor/local/bin/fc-list.exe +0 -0
  93. data/vendor/local/bin/fc-match.exe +0 -0
  94. data/vendor/local/bin/fc-pattern.exe +0 -0
  95. data/vendor/local/bin/fc-query.exe +0 -0
  96. data/vendor/local/bin/fc-scan.exe +0 -0
  97. data/vendor/local/bin/fc-validate.exe +0 -0
  98. data/vendor/local/bin/freetype-config +163 -0
  99. data/vendor/local/bin/libcairo-2.dll +0 -0
  100. data/vendor/local/bin/libcairo-gobject-2.dll +0 -0
  101. data/vendor/local/bin/libcairo-script-interpreter-2.dll +0 -0
  102. data/vendor/local/bin/libfontconfig-1.dll +0 -0
  103. data/vendor/local/bin/libfreetype-6.dll +0 -0
  104. data/vendor/local/bin/libgcc_s_seh-1.dll +0 -0
  105. data/vendor/local/bin/libpixman-1-0.dll +0 -0
  106. data/vendor/local/bin/libpng-config +127 -0
  107. data/vendor/local/bin/libpng16-16.dll +0 -0
  108. data/vendor/local/bin/libpng16-config +127 -0
  109. data/vendor/local/bin/libstdc++-6.dll +0 -0
  110. data/vendor/local/bin/libwinpthread-1.dll +0 -0
  111. data/vendor/local/bin/libxml2-2.dll +0 -0
  112. data/vendor/local/bin/png-fix-itxt.exe +0 -0
  113. data/vendor/local/bin/pngfix.exe +0 -0
  114. data/vendor/local/bin/xml2-config +106 -0
  115. data/vendor/local/bin/xmlcatalog.exe +0 -0
  116. data/vendor/local/bin/xmllint.exe +0 -0
  117. data/vendor/local/bin/zlib1.dll +0 -0
  118. data/vendor/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf +81 -0
  119. data/vendor/local/etc/fonts/conf.d/20-unhint-small-vera.conf +48 -0
  120. data/vendor/local/etc/fonts/conf.d/30-metric-aliases.conf +546 -0
  121. data/vendor/local/etc/fonts/conf.d/30-urw-aliases.conf +24 -0
  122. data/vendor/local/etc/fonts/conf.d/40-nonlatin.conf +231 -0
  123. data/vendor/local/etc/fonts/conf.d/45-latin.conf +189 -0
  124. data/vendor/local/etc/fonts/conf.d/49-sansserif.conf +21 -0
  125. data/vendor/local/etc/fonts/conf.d/50-user.conf +15 -0
  126. data/vendor/local/etc/fonts/conf.d/51-local.conf +6 -0
  127. data/vendor/local/etc/fonts/conf.d/60-latin.conf +70 -0
  128. data/vendor/local/etc/fonts/conf.d/65-fonts-persian.conf +419 -0
  129. data/vendor/local/etc/fonts/conf.d/65-nonlatin.conf +196 -0
  130. data/vendor/local/etc/fonts/conf.d/69-unifont.conf +28 -0
  131. data/vendor/local/etc/fonts/conf.d/80-delicious.conf +19 -0
  132. data/vendor/local/etc/fonts/conf.d/90-synthetic.conf +64 -0
  133. data/vendor/local/etc/fonts/conf.d/README +23 -0
  134. data/vendor/local/etc/fonts/fonts.conf +155 -0
  135. data/vendor/local/include/cairo/cairo-deprecated.h +123 -0
  136. data/vendor/local/include/cairo/cairo-features.h +31 -0
  137. data/vendor/local/include/cairo/cairo-ft.h +118 -0
  138. data/vendor/local/include/cairo/cairo-gobject.h +192 -0
  139. data/vendor/local/include/cairo/cairo-pdf.h +94 -0
  140. data/vendor/local/include/cairo/cairo-ps.h +116 -0
  141. data/vendor/local/include/cairo/cairo-script-interpreter.h +124 -0
  142. data/vendor/local/include/cairo/cairo-script.h +98 -0
  143. data/vendor/local/include/cairo/cairo-svg.h +84 -0
  144. data/vendor/local/include/cairo/cairo-version.h +8 -0
  145. data/vendor/local/include/cairo/cairo-win32.h +112 -0
  146. data/vendor/local/include/cairo/cairo.h +3153 -0
  147. data/vendor/local/include/fontconfig/fcfreetype.h +59 -0
  148. data/vendor/local/include/fontconfig/fcprivate.h +124 -0
  149. data/vendor/local/include/fontconfig/fontconfig.h +1010 -0
  150. data/vendor/local/include/freetype2/config/ftconfig.h +706 -0
  151. data/vendor/local/include/freetype2/config/ftheader.h +832 -0
  152. data/vendor/local/include/freetype2/config/ftmodule.h +20 -0
  153. data/vendor/local/include/freetype2/config/ftoption.h +846 -0
  154. data/vendor/local/include/freetype2/config/ftstdlib.h +174 -0
  155. data/vendor/local/include/freetype2/freetype.h +4076 -0
  156. data/vendor/local/include/freetype2/ft2build.h +42 -0
  157. data/vendor/local/include/freetype2/ftadvanc.h +182 -0
  158. data/vendor/local/include/freetype2/ftautoh.h +402 -0
  159. data/vendor/local/include/freetype2/ftbbox.h +102 -0
  160. data/vendor/local/include/freetype2/ftbdf.h +210 -0
  161. data/vendor/local/include/freetype2/ftbitmap.h +227 -0
  162. data/vendor/local/include/freetype2/ftbzip2.h +102 -0
  163. data/vendor/local/include/freetype2/ftcache.h +1057 -0
  164. data/vendor/local/include/freetype2/ftcffdrv.h +254 -0
  165. data/vendor/local/include/freetype2/ftchapters.h +121 -0
  166. data/vendor/local/include/freetype2/ftcid.h +166 -0
  167. data/vendor/local/include/freetype2/fterrdef.h +249 -0
  168. data/vendor/local/include/freetype2/fterrors.h +198 -0
  169. data/vendor/local/include/freetype2/ftgasp.h +128 -0
  170. data/vendor/local/include/freetype2/ftglyph.h +620 -0
  171. data/vendor/local/include/freetype2/ftgxval.h +358 -0
  172. data/vendor/local/include/freetype2/ftgzip.h +149 -0
  173. data/vendor/local/include/freetype2/ftimage.h +1322 -0
  174. data/vendor/local/include/freetype2/ftincrem.h +353 -0
  175. data/vendor/local/include/freetype2/ftlcdfil.h +251 -0
  176. data/vendor/local/include/freetype2/ftlist.h +277 -0
  177. data/vendor/local/include/freetype2/ftlzw.h +99 -0
  178. data/vendor/local/include/freetype2/ftmac.h +274 -0
  179. data/vendor/local/include/freetype2/ftmm.h +377 -0
  180. data/vendor/local/include/freetype2/ftmodapi.h +641 -0
  181. data/vendor/local/include/freetype2/ftmoderr.h +194 -0
  182. data/vendor/local/include/freetype2/ftotval.h +203 -0
  183. data/vendor/local/include/freetype2/ftoutln.h +572 -0
  184. data/vendor/local/include/freetype2/ftpfr.h +172 -0
  185. data/vendor/local/include/freetype2/ftrender.h +238 -0
  186. data/vendor/local/include/freetype2/ftsizes.h +159 -0
  187. data/vendor/local/include/freetype2/ftsnames.h +200 -0
  188. data/vendor/local/include/freetype2/ftstroke.h +751 -0
  189. data/vendor/local/include/freetype2/ftsynth.h +81 -0
  190. data/vendor/local/include/freetype2/ftsystem.h +347 -0
  191. data/vendor/local/include/freetype2/fttrigon.h +350 -0
  192. data/vendor/local/include/freetype2/ftttdrv.h +170 -0
  193. data/vendor/local/include/freetype2/fttypes.h +598 -0
  194. data/vendor/local/include/freetype2/ftwinfnt.h +275 -0
  195. data/vendor/local/include/freetype2/ftxf86.h +83 -0
  196. data/vendor/local/include/freetype2/t1tables.h +662 -0
  197. data/vendor/local/include/freetype2/ttnameid.h +1237 -0
  198. data/vendor/local/include/freetype2/tttables.h +787 -0
  199. data/vendor/local/include/freetype2/tttags.h +111 -0
  200. data/vendor/local/include/freetype2/ttunpat.h +59 -0
  201. data/vendor/local/include/libpng16/png.h +3276 -0
  202. data/vendor/local/include/libpng16/pngconf.h +644 -0
  203. data/vendor/local/include/libpng16/pnglibconf.h +208 -0
  204. data/vendor/local/include/libxml2/libxml/DOCBparser.h +96 -0
  205. data/vendor/local/include/libxml2/libxml/HTMLparser.h +306 -0
  206. data/vendor/local/include/libxml2/libxml/HTMLtree.h +147 -0
  207. data/vendor/local/include/libxml2/libxml/SAX.h +173 -0
  208. data/vendor/local/include/libxml2/libxml/SAX2.h +178 -0
  209. data/vendor/local/include/libxml2/libxml/c14n.h +126 -0
  210. data/vendor/local/include/libxml2/libxml/catalog.h +182 -0
  211. data/vendor/local/include/libxml2/libxml/chvalid.h +230 -0
  212. data/vendor/local/include/libxml2/libxml/debugXML.h +217 -0
  213. data/vendor/local/include/libxml2/libxml/dict.h +80 -0
  214. data/vendor/local/include/libxml2/libxml/encoding.h +240 -0
  215. data/vendor/local/include/libxml2/libxml/entities.h +151 -0
  216. data/vendor/local/include/libxml2/libxml/globals.h +509 -0
  217. data/vendor/local/include/libxml2/libxml/hash.h +233 -0
  218. data/vendor/local/include/libxml2/libxml/list.h +137 -0
  219. data/vendor/local/include/libxml2/libxml/nanoftp.h +163 -0
  220. data/vendor/local/include/libxml2/libxml/nanohttp.h +81 -0
  221. data/vendor/local/include/libxml2/libxml/parser.h +1241 -0
  222. data/vendor/local/include/libxml2/libxml/parserInternals.h +644 -0
  223. data/vendor/local/include/libxml2/libxml/pattern.h +100 -0
  224. data/vendor/local/include/libxml2/libxml/relaxng.h +217 -0
  225. data/vendor/local/include/libxml2/libxml/schemasInternals.h +958 -0
  226. data/vendor/local/include/libxml2/libxml/schematron.h +142 -0
  227. data/vendor/local/include/libxml2/libxml/threads.h +84 -0
  228. data/vendor/local/include/libxml2/libxml/tree.h +1310 -0
  229. data/vendor/local/include/libxml2/libxml/uri.h +94 -0
  230. data/vendor/local/include/libxml2/libxml/valid.h +458 -0
  231. data/vendor/local/include/libxml2/libxml/xinclude.h +129 -0
  232. data/vendor/local/include/libxml2/libxml/xlink.h +189 -0
  233. data/vendor/local/include/libxml2/libxml/xmlIO.h +366 -0
  234. data/vendor/local/include/libxml2/libxml/xmlautomata.h +146 -0
  235. data/vendor/local/include/libxml2/libxml/xmlerror.h +945 -0
  236. data/vendor/local/include/libxml2/libxml/xmlexports.h +162 -0
  237. data/vendor/local/include/libxml2/libxml/xmlmemory.h +224 -0
  238. data/vendor/local/include/libxml2/libxml/xmlmodule.h +57 -0
  239. data/vendor/local/include/libxml2/libxml/xmlreader.h +428 -0
  240. data/vendor/local/include/libxml2/libxml/xmlregexp.h +222 -0
  241. data/vendor/local/include/libxml2/libxml/xmlsave.h +88 -0
  242. data/vendor/local/include/libxml2/libxml/xmlschemas.h +246 -0
  243. data/vendor/local/include/libxml2/libxml/xmlschemastypes.h +151 -0
  244. data/vendor/local/include/libxml2/libxml/xmlstring.h +140 -0
  245. data/vendor/local/include/libxml2/libxml/xmlunicode.h +202 -0
  246. data/vendor/local/include/libxml2/libxml/xmlversion.h +489 -0
  247. data/vendor/local/include/libxml2/libxml/xmlwriter.h +488 -0
  248. data/vendor/local/include/libxml2/libxml/xpath.h +557 -0
  249. data/vendor/local/include/libxml2/libxml/xpathInternals.h +632 -0
  250. data/vendor/local/include/libxml2/libxml/xpointer.h +114 -0
  251. data/vendor/local/include/pixman-1/pixman-version.h +50 -0
  252. data/vendor/local/include/pixman-1/pixman.h +1111 -0
  253. data/vendor/local/include/png.h +3276 -0
  254. data/vendor/local/include/pngconf.h +644 -0
  255. data/vendor/local/include/pnglibconf.h +208 -0
  256. data/vendor/local/include/zconf.h +511 -0
  257. data/vendor/local/include/zlib.h +1768 -0
  258. data/vendor/local/lib/cmake/libxml2/libxml2-config.cmake +50 -0
  259. data/vendor/local/lib/fontconfig.def +207 -0
  260. data/vendor/local/lib/libcairo-gobject.a +0 -0
  261. data/vendor/local/lib/libcairo-gobject.dll.a +0 -0
  262. data/vendor/local/lib/libcairo-gobject.la +41 -0
  263. data/vendor/local/lib/libcairo-script-interpreter.a +0 -0
  264. data/vendor/local/lib/libcairo-script-interpreter.dll.a +0 -0
  265. data/vendor/local/lib/libcairo-script-interpreter.la +41 -0
  266. data/vendor/local/lib/libcairo.a +0 -0
  267. data/vendor/local/lib/libcairo.dll.a +0 -0
  268. data/vendor/local/lib/libcairo.la +41 -0
  269. data/vendor/local/lib/libfontconfig.dll.a +0 -0
  270. data/vendor/local/lib/libfontconfig.la +41 -0
  271. data/vendor/local/lib/libfreetype.a +0 -0
  272. data/vendor/local/lib/libfreetype.dll.a +0 -0
  273. data/vendor/local/lib/libfreetype.la +41 -0
  274. data/vendor/local/lib/libpixman-1.a +0 -0
  275. data/vendor/local/lib/libpixman-1.dll.a +0 -0
  276. data/vendor/local/lib/libpixman-1.la +41 -0
  277. data/vendor/local/lib/libpng.a +0 -0
  278. data/vendor/local/lib/libpng.dll.a +0 -0
  279. data/vendor/local/lib/libpng.la +41 -0
  280. data/vendor/local/lib/libpng16.a +0 -0
  281. data/vendor/local/lib/libpng16.dll.a +0 -0
  282. data/vendor/local/lib/libpng16.la +41 -0
  283. data/vendor/local/lib/libxml2.a +0 -0
  284. data/vendor/local/lib/libxml2.dll.a +0 -0
  285. data/vendor/local/lib/libxml2.la +41 -0
  286. data/vendor/local/lib/libz.a +0 -0
  287. data/vendor/local/lib/libz.dll.a +0 -0
  288. data/vendor/local/lib/pkgconfig/cairo-fc.pc +12 -0
  289. data/vendor/local/lib/pkgconfig/cairo-ft.pc +12 -0
  290. data/vendor/local/lib/pkgconfig/cairo-gobject.pc +12 -0
  291. data/vendor/local/lib/pkgconfig/cairo-pdf.pc +12 -0
  292. data/vendor/local/lib/pkgconfig/cairo-png.pc +12 -0
  293. data/vendor/local/lib/pkgconfig/cairo-ps.pc +12 -0
  294. data/vendor/local/lib/pkgconfig/cairo-script.pc +12 -0
  295. data/vendor/local/lib/pkgconfig/cairo-svg.pc +12 -0
  296. data/vendor/local/lib/pkgconfig/cairo-win32-font.pc +12 -0
  297. data/vendor/local/lib/pkgconfig/cairo-win32.pc +12 -0
  298. data/vendor/local/lib/pkgconfig/cairo.pc +13 -0
  299. data/vendor/local/lib/pkgconfig/fontconfig.pc +18 -0
  300. data/vendor/local/lib/pkgconfig/freetype2.pc +14 -0
  301. data/vendor/local/lib/pkgconfig/libpng.pc +11 -0
  302. data/vendor/local/lib/pkgconfig/libpng16.pc +11 -0
  303. data/vendor/local/lib/pkgconfig/libxml-2.0.pc +13 -0
  304. data/vendor/local/lib/pkgconfig/pixman-1.pc +11 -0
  305. data/vendor/local/lib/pkgconfig/zlib.pc +13 -0
  306. data/vendor/local/lib/xml2Conf.sh +8 -0
  307. data/vendor/local/share/aclocal/freetype2.m4 +194 -0
  308. data/vendor/local/share/aclocal/libxml.m4 +188 -0
  309. data/vendor/local/share/doc/libxml2-2.9.2/Copyright +23 -0
  310. data/vendor/local/share/doc/libxml2-2.9.2/examples/testHTML.c +880 -0
  311. data/vendor/local/share/doc/libxml2-2.9.2/examples/testSAX.c +1198 -0
  312. data/vendor/local/share/doc/libxml2-2.9.2/examples/testXPath.c +229 -0
  313. data/vendor/local/share/doc/libxml2-2.9.2/examples/xmllint.c +3801 -0
  314. data/vendor/local/share/doc/libxml2-2.9.2/html/DOM.gif +0 -0
  315. data/vendor/local/share/doc/libxml2-2.9.2/html/FAQ.html +299 -0
  316. data/vendor/local/share/doc/libxml2-2.9.2/html/Libxml2-Logo-180x168.gif +0 -0
  317. data/vendor/local/share/doc/libxml2-2.9.2/html/Libxml2-Logo-90x34.gif +0 -0
  318. data/vendor/local/share/doc/libxml2-2.9.2/html/encoding.html +217 -0
  319. data/vendor/local/share/doc/libxml2-2.9.2/html/examples.xml +751 -0
  320. data/vendor/local/share/doc/libxml2-2.9.2/html/examples.xsl +174 -0
  321. data/vendor/local/share/doc/libxml2-2.9.2/html/html/book1.html +13 -0
  322. data/vendor/local/share/doc/libxml2-2.9.2/html/html/home.png +0 -0
  323. data/vendor/local/share/doc/libxml2-2.9.2/html/html/index.html +13 -0
  324. data/vendor/local/share/doc/libxml2-2.9.2/html/html/left.png +0 -0
  325. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-DOCBparser.html +51 -0
  326. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-HTMLparser.html +184 -0
  327. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-HTMLtree.html +73 -0
  328. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-SAX.html +125 -0
  329. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-SAX2.html +128 -0
  330. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-c14n.html +38 -0
  331. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-catalog.html +142 -0
  332. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-chvalid.html +72 -0
  333. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-debugXML.html +120 -0
  334. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-dict.html +58 -0
  335. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-encoding.html +124 -0
  336. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-entities.html +79 -0
  337. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-globals.html +152 -0
  338. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-hash.html +116 -0
  339. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-lib.html +13 -0
  340. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-list.html +120 -0
  341. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-nanoftp.html +94 -0
  342. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-nanohttp.html +65 -0
  343. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-parser.html +559 -0
  344. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-parserInternals.html +322 -0
  345. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-pattern.html +76 -0
  346. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-relaxng.html +162 -0
  347. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-schemasInternals.html +373 -0
  348. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-schematron.html +81 -0
  349. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-threads.html +72 -0
  350. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-tree.html +990 -0
  351. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-uri.html +73 -0
  352. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-valid.html +289 -0
  353. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xinclude.html +59 -0
  354. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xlink.html +82 -0
  355. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlIO.html +212 -0
  356. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlautomata.html +85 -0
  357. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlerror.html +865 -0
  358. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlexports.html +20 -0
  359. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlmemory.html +107 -0
  360. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlmodule.html +38 -0
  361. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlreader.html +330 -0
  362. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlregexp.html +143 -0
  363. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlsave.html +60 -0
  364. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlschemas.html +185 -0
  365. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlschemastypes.html +123 -0
  366. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlstring.html +108 -0
  367. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlunicode.html +512 -0
  368. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlversion.html +63 -0
  369. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xmlwriter.html +261 -0
  370. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xpath.html +316 -0
  371. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xpathInternals.html +394 -0
  372. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xpointer.html +83 -0
  373. data/vendor/local/share/doc/libxml2-2.9.2/html/html/libxml-xzlib.html +16 -0
  374. data/vendor/local/share/doc/libxml2-2.9.2/html/html/right.png +0 -0
  375. data/vendor/local/share/doc/libxml2-2.9.2/html/html/up.png +0 -0
  376. data/vendor/local/share/doc/libxml2-2.9.2/html/index.html +14 -0
  377. data/vendor/local/share/doc/libxml2-2.9.2/html/io1.c +166 -0
  378. data/vendor/local/share/doc/libxml2-2.9.2/html/io1.res +5 -0
  379. data/vendor/local/share/doc/libxml2-2.9.2/html/io2.c +58 -0
  380. data/vendor/local/share/doc/libxml2-2.9.2/html/io2.res +2 -0
  381. data/vendor/local/share/doc/libxml2-2.9.2/html/libxml.gif +0 -0
  382. data/vendor/local/share/doc/libxml2-2.9.2/html/parse1.c +56 -0
  383. data/vendor/local/share/doc/libxml2-2.9.2/html/parse2.c +72 -0
  384. data/vendor/local/share/doc/libxml2-2.9.2/html/parse3.c +60 -0
  385. data/vendor/local/share/doc/libxml2-2.9.2/html/parse4.c +143 -0
  386. data/vendor/local/share/doc/libxml2-2.9.2/html/reader1.c +107 -0
  387. data/vendor/local/share/doc/libxml2-2.9.2/html/reader1.res +14 -0
  388. data/vendor/local/share/doc/libxml2-2.9.2/html/reader2.c +122 -0
  389. data/vendor/local/share/doc/libxml2-2.9.2/html/reader3.c +120 -0
  390. data/vendor/local/share/doc/libxml2-2.9.2/html/reader3.res +13 -0
  391. data/vendor/local/share/doc/libxml2-2.9.2/html/reader4.c +122 -0
  392. data/vendor/local/share/doc/libxml2-2.9.2/html/reader4.res +3 -0
  393. data/vendor/local/share/doc/libxml2-2.9.2/html/redhat.gif +0 -0
  394. data/vendor/local/share/doc/libxml2-2.9.2/html/smallfootonly.gif +0 -0
  395. data/vendor/local/share/doc/libxml2-2.9.2/html/structure.gif +0 -0
  396. data/vendor/local/share/doc/libxml2-2.9.2/html/test1.xml +1 -0
  397. data/vendor/local/share/doc/libxml2-2.9.2/html/test2.xml +13 -0
  398. data/vendor/local/share/doc/libxml2-2.9.2/html/test3.xml +39 -0
  399. data/vendor/local/share/doc/libxml2-2.9.2/html/testWriter.c +1198 -0
  400. data/vendor/local/share/doc/libxml2-2.9.2/html/tree1.c +94 -0
  401. data/vendor/local/share/doc/libxml2-2.9.2/html/tree1.res +4 -0
  402. data/vendor/local/share/doc/libxml2-2.9.2/html/tree2.c +118 -0
  403. data/vendor/local/share/doc/libxml2-2.9.2/html/tree2.res +18 -0
  404. data/vendor/local/share/doc/libxml2-2.9.2/html/tst.xml +7 -0
  405. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apa.html +8 -0
  406. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apb.html +14 -0
  407. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apc.html +82 -0
  408. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apd.html +76 -0
  409. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ape.html +78 -0
  410. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apf.html +67 -0
  411. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/apg.html +75 -0
  412. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/aph.html +76 -0
  413. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/api.html +4 -0
  414. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s02.html +14 -0
  415. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s03.html +47 -0
  416. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s04.html +54 -0
  417. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s05.html +55 -0
  418. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s06.html +35 -0
  419. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s07.html +30 -0
  420. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s08.html +38 -0
  421. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ar01s09.html +63 -0
  422. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/blank.png +0 -0
  423. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/1.png +0 -0
  424. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/10.png +0 -0
  425. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/2.png +0 -0
  426. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/3.png +0 -0
  427. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/4.png +0 -0
  428. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/5.png +0 -0
  429. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/6.png +0 -0
  430. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/7.png +0 -0
  431. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/8.png +0 -0
  432. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/callouts/9.png +0 -0
  433. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/caution.png +0 -0
  434. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/draft.png +0 -0
  435. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/home.png +0 -0
  436. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/important.png +0 -0
  437. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/next.png +0 -0
  438. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/note.png +0 -0
  439. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/prev.png +0 -0
  440. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/tip.png +0 -0
  441. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/toc-blank.png +0 -0
  442. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/toc-minus.png +0 -0
  443. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/toc-plus.png +0 -0
  444. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/up.png +0 -0
  445. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/images/warning.png +0 -0
  446. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includeaddattribute.c +64 -0
  447. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includeaddkeyword.c +75 -0
  448. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includeconvert.c +73 -0
  449. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includegetattribute.c +72 -0
  450. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includekeyword.c +79 -0
  451. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/includexpath.c +74 -0
  452. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/index.html +14 -0
  453. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/ix01.html +1 -0
  454. data/vendor/local/share/doc/libxml2-2.9.2/html/tutorial/xmltutorial.pdf +1336 -0
  455. data/vendor/local/share/doc/libxml2-2.9.2/html/w3c.png +0 -0
  456. data/vendor/local/share/doc/libxml2-2.9.2/html/writer.xml +2 -0
  457. data/vendor/local/share/doc/libxml2-2.9.2/html/xml.html +5995 -0
  458. data/vendor/local/share/doc/libxml2-2.9.2/html/xpath1.c +250 -0
  459. data/vendor/local/share/doc/libxml2-2.9.2/html/xpath1.res +5 -0
  460. data/vendor/local/share/doc/libxml2-2.9.2/html/xpath2.c +190 -0
  461. data/vendor/local/share/doc/libxml2-2.9.2/html/xpath2.res +30 -0
  462. data/vendor/local/share/fontconfig/conf.avail/10-autohint.conf +14 -0
  463. data/vendor/local/share/fontconfig/conf.avail/10-no-sub-pixel.conf +14 -0
  464. data/vendor/local/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf +81 -0
  465. data/vendor/local/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf +14 -0
  466. data/vendor/local/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf +14 -0
  467. data/vendor/local/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf +14 -0
  468. data/vendor/local/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf +14 -0
  469. data/vendor/local/share/fontconfig/conf.avail/10-unhinted.conf +14 -0
  470. data/vendor/local/share/fontconfig/conf.avail/11-lcdfilter-default.conf +16 -0
  471. data/vendor/local/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf +16 -0
  472. data/vendor/local/share/fontconfig/conf.avail/11-lcdfilter-light.conf +16 -0
  473. data/vendor/local/share/fontconfig/conf.avail/20-unhint-small-vera.conf +48 -0
  474. data/vendor/local/share/fontconfig/conf.avail/25-unhint-nonlatin.conf +128 -0
  475. data/vendor/local/share/fontconfig/conf.avail/30-metric-aliases.conf +546 -0
  476. data/vendor/local/share/fontconfig/conf.avail/30-urw-aliases.conf +24 -0
  477. data/vendor/local/share/fontconfig/conf.avail/40-nonlatin.conf +231 -0
  478. data/vendor/local/share/fontconfig/conf.avail/45-latin.conf +189 -0
  479. data/vendor/local/share/fontconfig/conf.avail/49-sansserif.conf +21 -0
  480. data/vendor/local/share/fontconfig/conf.avail/50-user.conf +15 -0
  481. data/vendor/local/share/fontconfig/conf.avail/51-local.conf +6 -0
  482. data/vendor/local/share/fontconfig/conf.avail/60-latin.conf +70 -0
  483. data/vendor/local/share/fontconfig/conf.avail/65-fonts-persian.conf +419 -0
  484. data/vendor/local/share/fontconfig/conf.avail/65-khmer.conf +16 -0
  485. data/vendor/local/share/fontconfig/conf.avail/65-nonlatin.conf +196 -0
  486. data/vendor/local/share/fontconfig/conf.avail/69-unifont.conf +28 -0
  487. data/vendor/local/share/fontconfig/conf.avail/70-no-bitmaps.conf +12 -0
  488. data/vendor/local/share/fontconfig/conf.avail/70-yes-bitmaps.conf +12 -0
  489. data/vendor/local/share/fontconfig/conf.avail/80-delicious.conf +19 -0
  490. data/vendor/local/share/fontconfig/conf.avail/90-synthetic.conf +64 -0
  491. data/vendor/local/share/gtk-doc/html/cairo/bindings-errors.html +122 -0
  492. data/vendor/local/share/gtk-doc/html/cairo/bindings-fonts.html +53 -0
  493. data/vendor/local/share/gtk-doc/html/cairo/bindings-memory.html +123 -0
  494. data/vendor/local/share/gtk-doc/html/cairo/bindings-overloading.html +121 -0
  495. data/vendor/local/share/gtk-doc/html/cairo/bindings-path.html +117 -0
  496. data/vendor/local/share/gtk-doc/html/cairo/bindings-patterns.html +75 -0
  497. data/vendor/local/share/gtk-doc/html/cairo/bindings-return-values.html +120 -0
  498. data/vendor/local/share/gtk-doc/html/cairo/bindings-streams.html +92 -0
  499. data/vendor/local/share/gtk-doc/html/cairo/bindings-surfaces.html +93 -0
  500. data/vendor/local/share/gtk-doc/html/cairo/cairo-Error-handling.html +397 -0
  501. data/vendor/local/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +428 -0
  502. data/vendor/local/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +452 -0
  503. data/vendor/local/share/gtk-doc/html/cairo/cairo-PDF-Surfaces.html +342 -0
  504. data/vendor/local/share/gtk-doc/html/cairo/cairo-PNG-Support.html +315 -0
  505. data/vendor/local/share/gtk-doc/html/cairo/cairo-Paths.html +1194 -0
  506. data/vendor/local/share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html +577 -0
  507. data/vendor/local/share/gtk-doc/html/cairo/cairo-Quartz-(CGFont)-Fonts.html +129 -0
  508. data/vendor/local/share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html +197 -0
  509. data/vendor/local/share/gtk-doc/html/cairo/cairo-Raster-Sources.html +600 -0
  510. data/vendor/local/share/gtk-doc/html/cairo/cairo-Recording-Surfaces.html +226 -0
  511. data/vendor/local/share/gtk-doc/html/cairo/cairo-Regions.html +810 -0
  512. data/vendor/local/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +302 -0
  513. data/vendor/local/share/gtk-doc/html/cairo/cairo-Script-Surfaces.html +360 -0
  514. data/vendor/local/share/gtk-doc/html/cairo/cairo-Transformations.html +394 -0
  515. data/vendor/local/share/gtk-doc/html/cairo/cairo-Types.html +156 -0
  516. data/vendor/local/share/gtk-doc/html/cairo/cairo-User-Fonts.html +677 -0
  517. data/vendor/local/share/gtk-doc/html/cairo/cairo-Version-Information.html +342 -0
  518. data/vendor/local/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +326 -0
  519. data/vendor/local/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +280 -0
  520. data/vendor/local/share/gtk-doc/html/cairo/cairo-XCB-Surfaces.html +527 -0
  521. data/vendor/local/share/gtk-doc/html/cairo/cairo-XLib-Surfaces.html +535 -0
  522. data/vendor/local/share/gtk-doc/html/cairo/cairo-XLib-XRender-Backend.html +170 -0
  523. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-device-t.html +636 -0
  524. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +380 -0
  525. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html +653 -0
  526. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html +559 -0
  527. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-pattern-t.html +2231 -0
  528. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-scaled-font-t.html +956 -0
  529. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +1637 -0
  530. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-t.html +2695 -0
  531. data/vendor/local/share/gtk-doc/html/cairo/cairo-drawing.html +53 -0
  532. data/vendor/local/share/gtk-doc/html/cairo/cairo-fonts.html +53 -0
  533. data/vendor/local/share/gtk-doc/html/cairo/cairo-support.html +44 -0
  534. data/vendor/local/share/gtk-doc/html/cairo/cairo-surfaces.html +74 -0
  535. data/vendor/local/share/gtk-doc/html/cairo/cairo-text.html +1138 -0
  536. data/vendor/local/share/gtk-doc/html/cairo/cairo.devhelp2 +747 -0
  537. data/vendor/local/share/gtk-doc/html/cairo/home.png +0 -0
  538. data/vendor/local/share/gtk-doc/html/cairo/index-1.10.html +177 -0
  539. data/vendor/local/share/gtk-doc/html/cairo/index-1.12.html +193 -0
  540. data/vendor/local/share/gtk-doc/html/cairo/index-1.2.html +179 -0
  541. data/vendor/local/share/gtk-doc/html/cairo/index-1.4.html +123 -0
  542. data/vendor/local/share/gtk-doc/html/cairo/index-1.6.html +107 -0
  543. data/vendor/local/share/gtk-doc/html/cairo/index-1.8.html +128 -0
  544. data/vendor/local/share/gtk-doc/html/cairo/index-all.html +1122 -0
  545. data/vendor/local/share/gtk-doc/html/cairo/index.html +157 -0
  546. data/vendor/local/share/gtk-doc/html/cairo/index.sgml +833 -0
  547. data/vendor/local/share/gtk-doc/html/cairo/language-bindings.html +73 -0
  548. data/vendor/local/share/gtk-doc/html/cairo/left.png +0 -0
  549. data/vendor/local/share/gtk-doc/html/cairo/right.png +0 -0
  550. data/vendor/local/share/gtk-doc/html/cairo/style.css +266 -0
  551. data/vendor/local/share/gtk-doc/html/cairo/up.png +0 -0
  552. data/vendor/local/share/gtk-doc/html/libxml2/general.html +38 -0
  553. data/vendor/local/share/gtk-doc/html/libxml2/home.png +0 -0
  554. data/vendor/local/share/gtk-doc/html/libxml2/index.html +67 -0
  555. data/vendor/local/share/gtk-doc/html/libxml2/left.png +0 -0
  556. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-DOCBparser.html +138 -0
  557. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html +373 -0
  558. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLtree.html +172 -0
  559. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-SAX.html +243 -0
  560. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-SAX2.html +247 -0
  561. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-c14n.html +91 -0
  562. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-catalog.html +278 -0
  563. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-chvalid.html +241 -0
  564. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-debugXML.html +225 -0
  565. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-dict.html +134 -0
  566. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-encoding.html +218 -0
  567. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-entities.html +166 -0
  568. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-globals.html +383 -0
  569. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-hash.html +214 -0
  570. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-list.html +226 -0
  571. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html +187 -0
  572. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanohttp.html +142 -0
  573. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parser.html +766 -0
  574. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html +688 -0
  575. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-pattern.html +166 -0
  576. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-relaxng.html +278 -0
  577. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-schemasInternals.html +860 -0
  578. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-schematron.html +166 -0
  579. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-threads.html +161 -0
  580. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-tree.html +1597 -0
  581. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-uri.html +154 -0
  582. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-valid.html +528 -0
  583. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xinclude.html +169 -0
  584. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xlink.html +160 -0
  585. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html +347 -0
  586. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlautomata.html +176 -0
  587. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html +953 -0
  588. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlexports.html +87 -0
  589. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmemory.html +186 -0
  590. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html +97 -0
  591. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html +565 -0
  592. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlregexp.html +280 -0
  593. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html +133 -0
  594. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html +314 -0
  595. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemastypes.html +237 -0
  596. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlstring.html +217 -0
  597. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlunicode.html +887 -0
  598. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html +292 -0
  599. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html +479 -0
  600. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpath.html +542 -0
  601. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html +787 -0
  602. data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpointer.html +171 -0
  603. data/vendor/local/share/gtk-doc/html/libxml2/libxml2.devhelp +3573 -0
  604. data/vendor/local/share/gtk-doc/html/libxml2/right.png +0 -0
  605. data/vendor/local/share/gtk-doc/html/libxml2/style.css +66 -0
  606. data/vendor/local/share/gtk-doc/html/libxml2/up.png +0 -0
  607. data/vendor/local/share/license/cairo/AUTHORS +115 -0
  608. data/vendor/local/share/license/cairo/COPYING +33 -0
  609. data/vendor/local/share/license/cairo/COPYING-LGPL-2.1 +510 -0
  610. data/vendor/local/share/license/cairo/COPYING-MPL-1.1 +470 -0
  611. data/vendor/local/share/license/cairo/README +204 -0
  612. data/vendor/local/share/license/cairo/README.win32 +66 -0
  613. data/vendor/local/share/license/fontconfig/AUTHORS +3 -0
  614. data/vendor/local/share/license/fontconfig/COPYING +28 -0
  615. data/vendor/local/share/license/fontconfig/README +1484 -0
  616. data/vendor/local/share/license/freetype/README +83 -0
  617. data/vendor/local/share/license/freetype/README.git +50 -0
  618. data/vendor/local/share/license/libpng/README +215 -0
  619. data/vendor/local/share/license/libxml2/AUTHORS +5 -0
  620. data/vendor/local/share/license/libxml2/COPYING +23 -0
  621. data/vendor/local/share/license/libxml2/README +39 -0
  622. data/vendor/local/share/license/libxml2/README.tests +39 -0
  623. data/vendor/local/share/license/pixman/AUTHORS +0 -0
  624. data/vendor/local/share/license/pixman/COPYING +42 -0
  625. data/vendor/local/share/license/pixman/README +116 -0
  626. data/vendor/local/share/license/zlib/README +115 -0
  627. data/vendor/local/share/man/man1/freetype-config.1 +108 -0
  628. data/vendor/local/share/man/man1/xml2-config.1 +30 -0
  629. data/vendor/local/share/man/man1/xmlcatalog.1 +340 -0
  630. data/vendor/local/share/man/man1/xmllint.1 +647 -0
  631. data/vendor/local/share/man/man3/libpng.3 +6217 -0
  632. data/vendor/local/share/man/man3/libpngpf.3 +18 -0
  633. data/vendor/local/share/man/man3/libxml.3 +71 -0
  634. data/vendor/local/share/man/man5/png.5 +74 -0
  635. data/vendor/local/share/xml/fontconfig/fonts.dtd +233 -0
  636. metadata +774 -0
@@ -0,0 +1,2284 @@
1
+ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Ruby Cairo Binding
4
+ *
5
+ * Copyright 2005-2014 Kouhei Sutou <kou@cozmixng.org>
6
+ * Copyright 2014 Patrick Hanevold <patrick.hanevold@gmail.com>
7
+ * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
8
+ * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
9
+ *
10
+ * This file is made available under the same terms as Ruby
11
+ *
12
+ */
13
+
14
+ #include "rb_cairo.h"
15
+ #include "rb_cairo_private.h"
16
+ #include "rb_cairo_io.h"
17
+
18
+ #ifdef HAVE_RUBY_ST_H
19
+ # include <ruby/st.h>
20
+ #else
21
+ # include <st.h>
22
+ #endif
23
+
24
+ #if CAIRO_CHECK_VERSION(1, 5, 2)
25
+ # define RB_CAIRO_HAS_WIN32_PRINTING_SURFACE_TYPE
26
+ #endif
27
+
28
+ #if CAIRO_CHECK_VERSION(1, 5, 12)
29
+ # define RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TYPE
30
+ #endif
31
+
32
+ #ifdef CAIRO_HAS_WIN32_SURFACE
33
+ # define OpenFile OpenFile_win32
34
+ # include <cairo-win32.h>
35
+ # undef OpenFile
36
+ # ifdef RB_CAIRO_HAS_WIN32_PRINTING_SURFACE_TYPE
37
+ # define RB_CAIRO_HAS_WIN32_PRINTING_SURFACE
38
+ # endif
39
+ #endif
40
+
41
+ #ifdef HAVE_RUBY_IO_H
42
+ # include <ruby/io.h>
43
+ #else
44
+ # include <rubyio.h>
45
+ #endif
46
+
47
+ #ifdef CAIRO_HAS_QUARTZ_SURFACE
48
+ # ifndef HAVE_TYPE_ENUM_RUBY_VALUE_TYPE
49
+ enum ruby_value_type {
50
+ RUBY_T_DATA = T_DATA
51
+ };
52
+ # endif
53
+ # undef T_DATA
54
+ # include <cairo-quartz.h>
55
+ # define T_DATA RUBY_T_DATA
56
+ # define RB_CAIRO_HAS_QUARTZ_SURFACE
57
+ # ifdef CAIRO_HAS_QUARTZ_IMAGE_SURFACE
58
+ # include <cairo-quartz-image.h>
59
+ # define RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
60
+ # endif
61
+ #endif
62
+
63
+ #ifdef CAIRO_HAS_XML_SURFACE
64
+ # include <cairo-xml.h>
65
+ #endif
66
+
67
+ #ifdef CAIRO_HAS_TEE_SURFACE
68
+ # include <cairo-tee.h>
69
+ #endif
70
+
71
+ #if defined(CAIRO_HAS_GL_SURFACE) || defined(CAIRO_HAS_GLESV2_SURFACE)
72
+ # define RB_CAIRO_HAS_GL_SURFACE
73
+ #endif
74
+
75
+ #ifdef RB_CAIRO_HAS_GL_SURFACE
76
+ # include <cairo-gl.h>
77
+ #endif
78
+
79
+ VALUE rb_cCairo_Surface;
80
+ VALUE rb_cCairo_ImageSurface;
81
+ VALUE rb_cCairo_PDFSurface = Qnil;
82
+ VALUE rb_cCairo_PSSurface = Qnil;
83
+ VALUE rb_cCairo_XLibSurface = Qnil;
84
+ VALUE rb_cCairo_XCBSurface = Qnil;
85
+ VALUE rb_cCairo_SVGSurface = Qnil;
86
+ VALUE rb_cCairo_Win32Surface = Qnil;
87
+ VALUE rb_cCairo_Win32PrintingSurface = Qnil;
88
+ VALUE rb_cCairo_QuartzSurface = Qnil;
89
+ VALUE rb_cCairo_QuartzImageSurface = Qnil;
90
+ VALUE rb_cCairo_ScriptSurface = Qnil;
91
+ VALUE rb_cCairo_QtSurface = Qnil;
92
+ VALUE rb_cCairo_RecordingSurface = Qnil;
93
+ VALUE rb_cCairo_VGSurface = Qnil;
94
+ VALUE rb_cCairo_GLSurface = Qnil;
95
+ VALUE rb_cCairo_GLTextureSurface = Qnil;
96
+ VALUE rb_cCairo_DRMSurface = Qnil;
97
+ VALUE rb_cCairo_TeeSurface = Qnil;
98
+ VALUE rb_cCairo_XMLSurface = Qnil;
99
+ VALUE rb_cCairo_SkiaSurface = Qnil;
100
+ VALUE rb_cCairo_SubSurface = Qnil;
101
+ VALUE rb_cCairo_CoglSurface = Qnil;
102
+
103
+ static ID cr_id_parse;
104
+ static ID cr_id_size;
105
+ static ID cr_id_set_unit;
106
+ static ID cr_id_x;
107
+ static ID cr_id_y;
108
+ static ID cr_id_width;
109
+ static ID cr_id_height;
110
+ static cairo_user_data_key_t cr_closure_key;
111
+ static cairo_user_data_key_t cr_object_holder_key;
112
+ static cairo_user_data_key_t cr_finished_key;
113
+
114
+ #define _SELF (RVAL2CRSURFACE(self))
115
+
116
+ static VALUE
117
+ cr_paper_parse (VALUE paper_description)
118
+ {
119
+ return rb_funcall (rb_cCairo_Paper, cr_id_parse, 2, paper_description, Qtrue);
120
+ }
121
+
122
+ static void
123
+ cr_paper_to_size_in_points (VALUE paper_description, VALUE *width, VALUE *height)
124
+ {
125
+ VALUE paper, size;
126
+
127
+ paper = cr_paper_parse (paper_description);
128
+ size = rb_funcall (paper, cr_id_size, 1, rb_str_new2 ("pt"));
129
+ *width = RARRAY_PTR (size)[0];
130
+ *height = RARRAY_PTR (size)[1];
131
+ }
132
+
133
+ static inline void
134
+ cr_surface_check_status (cairo_surface_t *surface)
135
+ {
136
+ rb_cairo_check_status (cairo_surface_status (surface));
137
+ }
138
+
139
+ static VALUE
140
+ cr_surface_get_klass (cairo_surface_t *surface)
141
+ {
142
+ VALUE klass;
143
+ cairo_surface_type_t type;
144
+
145
+ type = cairo_surface_get_type (surface);
146
+ switch (type)
147
+ {
148
+ case CAIRO_SURFACE_TYPE_IMAGE:
149
+ klass = rb_cCairo_ImageSurface;
150
+ break;
151
+ case CAIRO_SURFACE_TYPE_PDF:
152
+ klass = rb_cCairo_PDFSurface;
153
+ break;
154
+ case CAIRO_SURFACE_TYPE_PS:
155
+ klass = rb_cCairo_PSSurface;
156
+ break;
157
+ case CAIRO_SURFACE_TYPE_XLIB:
158
+ klass = rb_cCairo_XLibSurface;
159
+ break;
160
+ case CAIRO_SURFACE_TYPE_XCB:
161
+ klass = rb_cCairo_XCBSurface;
162
+ break;
163
+ case CAIRO_SURFACE_TYPE_QUARTZ:
164
+ klass = rb_cCairo_QuartzSurface;
165
+ break;
166
+ case CAIRO_SURFACE_TYPE_WIN32:
167
+ klass = rb_cCairo_Win32Surface;
168
+ break;
169
+ case CAIRO_SURFACE_TYPE_SVG:
170
+ klass = rb_cCairo_SVGSurface;
171
+ break;
172
+ #ifdef RB_CAIRO_HAS_WIN32_PRINTING_SURFACE_TYPE
173
+ case CAIRO_SURFACE_TYPE_WIN32_PRINTING:
174
+ klass = rb_cCairo_Win32PrintingSurface;
175
+ break;
176
+ #endif
177
+ #ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TYPE
178
+ case CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
179
+ klass = rb_cCairo_QuartzImageSurface;
180
+ break;
181
+ #endif
182
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
183
+ case CAIRO_SURFACE_TYPE_SCRIPT:
184
+ klass = rb_cCairo_ScriptSurface;
185
+ break;
186
+ case CAIRO_SURFACE_TYPE_QT:
187
+ klass = rb_cCairo_QtSurface;
188
+ break;
189
+ case CAIRO_SURFACE_TYPE_RECORDING:
190
+ klass = rb_cCairo_RecordingSurface;
191
+ break;
192
+ case CAIRO_SURFACE_TYPE_VG:
193
+ klass = rb_cCairo_VGSurface;
194
+ break;
195
+ case CAIRO_SURFACE_TYPE_GL:
196
+ klass = rb_cCairo_GLSurface;
197
+ break;
198
+ case CAIRO_SURFACE_TYPE_DRM:
199
+ klass = rb_cCairo_DRMSurface;
200
+ break;
201
+ case CAIRO_SURFACE_TYPE_TEE:
202
+ klass = rb_cCairo_TeeSurface;
203
+ break;
204
+ case CAIRO_SURFACE_TYPE_XML:
205
+ klass = rb_cCairo_XMLSurface;
206
+ break;
207
+ case CAIRO_SURFACE_TYPE_SKIA:
208
+ klass = rb_cCairo_SkiaSurface;
209
+ break;
210
+ case CAIRO_SURFACE_TYPE_SUBSURFACE:
211
+ klass = rb_cCairo_SubSurface;
212
+ break;
213
+ #endif
214
+ #if CAIRO_CHECK_VERSION(1, 11, 4)
215
+ case CAIRO_SURFACE_TYPE_COGL:
216
+ klass = rb_cCairo_CoglSurface;
217
+ break;
218
+ #endif
219
+ default:
220
+ klass = rb_cCairo_Surface;
221
+ break;
222
+ }
223
+
224
+ if (NIL_P (klass))
225
+ rb_raise (rb_eArgError, "unknown source type: %d", type);
226
+
227
+ return klass;
228
+ }
229
+
230
+ static VALUE
231
+ cr_surface_image_supported_p (VALUE klass)
232
+ {
233
+ return Qtrue;
234
+ }
235
+
236
+ static VALUE
237
+ cr_surface_pdf_supported_p (VALUE klass)
238
+ {
239
+ #ifdef CAIRO_HAS_PDF_SURFACE
240
+ return Qtrue;
241
+ #else
242
+ return Qfalse;
243
+ #endif
244
+ }
245
+
246
+ static VALUE
247
+ cr_surface_ps_supported_p (VALUE klass)
248
+ {
249
+ #ifdef CAIRO_HAS_PS_SURFACE
250
+ return Qtrue;
251
+ #else
252
+ return Qfalse;
253
+ #endif
254
+ }
255
+
256
+ static VALUE
257
+ cr_surface_quartz_supported_p (VALUE klass)
258
+ {
259
+ #ifdef RB_CAIRO_HAS_QUARTZ_SURFACE
260
+ return Qtrue;
261
+ #else
262
+ return Qfalse;
263
+ #endif
264
+ }
265
+
266
+ static VALUE
267
+ cr_surface_win32_supported_p (VALUE klass)
268
+ {
269
+ #ifdef CAIRO_HAS_WIN32_SURFACE
270
+ return Qtrue;
271
+ #else
272
+ return Qfalse;
273
+ #endif
274
+ }
275
+
276
+ static VALUE
277
+ cr_surface_svg_supported_p (VALUE klass)
278
+ {
279
+ #ifdef CAIRO_HAS_SVG_SURFACE
280
+ return Qtrue;
281
+ #else
282
+ return Qfalse;
283
+ #endif
284
+ }
285
+
286
+ static VALUE
287
+ cr_surface_win32_printing_supported_p (VALUE klass)
288
+ {
289
+ #ifdef RB_CAIRO_HAS_WIN32_PRINTING_SURFACE
290
+ return Qtrue;
291
+ #else
292
+ return Qfalse;
293
+ #endif
294
+ }
295
+
296
+ static VALUE
297
+ cr_surface_quartz_image_supported_p (VALUE klass)
298
+ {
299
+ #ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
300
+ return Qtrue;
301
+ #else
302
+ return Qfalse;
303
+ #endif
304
+ }
305
+
306
+ static VALUE
307
+ cr_surface_script_supported_p (VALUE klass)
308
+ {
309
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
310
+ return Qtrue;
311
+ #else
312
+ return Qfalse;
313
+ #endif
314
+ }
315
+
316
+ static VALUE
317
+ cr_surface_recording_supported_p (VALUE klass)
318
+ {
319
+ #ifdef CAIRO_HAS_RECORDING_SURFACE
320
+ return Qtrue;
321
+ #else
322
+ return Qfalse;
323
+ #endif
324
+ }
325
+
326
+ static VALUE
327
+ cr_surface_gl_supported_p (VALUE klass)
328
+ {
329
+ #ifdef RB_CAIRO_HAS_GL_SURFACE
330
+ return Qtrue;
331
+ #else
332
+ return Qfalse;
333
+ #endif
334
+ }
335
+
336
+ static VALUE
337
+ cr_surface_gl_texture_supported_p (VALUE klass)
338
+ {
339
+ return cr_surface_gl_supported_p(klass);
340
+ }
341
+
342
+ static VALUE
343
+ cr_surface_tee_supported_p (VALUE klass)
344
+ {
345
+ #ifdef CAIRO_HAS_TEE_SURFACE
346
+ return Qtrue;
347
+ #else
348
+ return Qfalse;
349
+ #endif
350
+ }
351
+
352
+ static VALUE
353
+ cr_surface_xml_supported_p (VALUE klass)
354
+ {
355
+ #ifdef CAIRO_HAS_XML_SURFACE
356
+ return Qtrue;
357
+ #else
358
+ return Qfalse;
359
+ #endif
360
+ }
361
+
362
+ /* constructor/de-constructor */
363
+ cairo_surface_t *
364
+ rb_cairo_surface_from_ruby_object (VALUE obj)
365
+ {
366
+ cairo_surface_t *surface;
367
+ if (!rb_cairo__is_kind_of (obj, rb_cCairo_Surface))
368
+ {
369
+ rb_raise (rb_eTypeError, "not a cairo surface");
370
+ }
371
+ Data_Get_Struct (obj, cairo_surface_t, surface);
372
+ if (!surface)
373
+ rb_cairo_check_status (CAIRO_STATUS_NULL_POINTER);
374
+ return surface;
375
+ }
376
+
377
+ static rb_cairo__object_holder_t *
378
+ cr_object_holder_new (VALUE object)
379
+ {
380
+ return rb_cairo__object_holder_new (rb_cCairo_Surface, object);
381
+ }
382
+
383
+ static void
384
+ cr_object_holder_free (void *ptr)
385
+ {
386
+ rb_cairo__object_holder_free (rb_cCairo_Surface, ptr);
387
+ }
388
+
389
+ static void
390
+ cr_surface_free (void *ptr)
391
+ {
392
+ cairo_surface_t *surface = ptr;
393
+
394
+ if (surface)
395
+ cairo_surface_destroy (surface);
396
+ }
397
+
398
+ VALUE
399
+ rb_cairo_surface_to_ruby_object (cairo_surface_t *surface)
400
+ {
401
+ if (surface)
402
+ {
403
+ VALUE klass;
404
+ klass = cr_surface_get_klass (surface);
405
+ cairo_surface_reference (surface);
406
+ return Data_Wrap_Struct (klass, NULL, cr_surface_free, surface);
407
+ }
408
+ else
409
+ {
410
+ return Qnil;
411
+ }
412
+ }
413
+
414
+ VALUE
415
+ rb_cairo_surface_to_ruby_object_with_destroy (cairo_surface_t *surface)
416
+ {
417
+ VALUE rb_surface;
418
+
419
+ rb_surface = rb_cairo_surface_to_ruby_object (surface);
420
+ if (surface)
421
+ cairo_surface_destroy (surface);
422
+
423
+ return rb_surface;
424
+ }
425
+
426
+ static VALUE
427
+ cr_surface_allocate (VALUE klass)
428
+ {
429
+ return Data_Wrap_Struct (klass, NULL, cr_surface_free, NULL);
430
+ }
431
+
432
+ static VALUE
433
+ cr_surface_initialize (int argc, VALUE *argv, VALUE self)
434
+ {
435
+ rb_raise(rb_eNotImpError,
436
+ "%s class creation isn't supported on this cairo installation",
437
+ rb_obj_classname(self));
438
+
439
+ return Qnil;
440
+ }
441
+
442
+ /* Surface manipulation */
443
+ static VALUE
444
+ cr_surface_destroy (VALUE self)
445
+ {
446
+ cairo_surface_t *surface;
447
+
448
+ surface = _SELF;
449
+ cairo_surface_destroy (surface);
450
+ DATA_PTR (self) = NULL;
451
+
452
+ return self;
453
+ }
454
+
455
+ static VALUE
456
+ cr_surface_finish (VALUE self)
457
+ {
458
+ cairo_surface_t *surface;
459
+ rb_cairo__io_callback_closure_t *closure;
460
+
461
+ surface = _SELF;
462
+ closure = cairo_surface_get_user_data (surface, &cr_closure_key);
463
+
464
+ cairo_surface_finish (surface);
465
+ cairo_surface_set_user_data (surface, &cr_finished_key, (void *)CR_TRUE, NULL);
466
+ cairo_surface_set_user_data (surface, &cr_object_holder_key, NULL, NULL);
467
+
468
+ if (closure && !NIL_P (closure->error))
469
+ rb_exc_raise (closure->error);
470
+ cr_surface_check_status (surface);
471
+
472
+ return self;
473
+ }
474
+
475
+ static void
476
+ yield_and_finish (VALUE self)
477
+ {
478
+ cairo_surface_t *surface;
479
+
480
+ rb_yield (self);
481
+
482
+ surface = _SELF;
483
+ if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
484
+ return;
485
+ if (cairo_surface_get_user_data (surface, &cr_finished_key))
486
+ return;
487
+
488
+ cr_surface_finish (self);
489
+ }
490
+
491
+ static VALUE
492
+ cr_surface_create_similar (int argc, VALUE *argv, VALUE self)
493
+ {
494
+ cairo_surface_t *surface, *similar_surface;
495
+ cairo_content_t content;
496
+ int width, height;
497
+ VALUE arg1, arg2, arg3;
498
+
499
+ rb_scan_args (argc, argv, "21", &arg1, &arg2, &arg3);
500
+
501
+ surface = _SELF;
502
+ if (argc == 2)
503
+ {
504
+ content = cairo_surface_get_content (surface);
505
+ width = NUM2INT (arg1);
506
+ height = NUM2INT (arg2);
507
+ }
508
+ else
509
+ {
510
+ content = RVAL2CRCONTENT (arg1);
511
+ width = NUM2INT (arg2);
512
+ height = NUM2INT (arg3);
513
+ }
514
+
515
+ similar_surface = cairo_surface_create_similar (surface, content,
516
+ width, height);
517
+ cr_surface_check_status (similar_surface);
518
+ return CRSURFACE2RVAL_WITH_DESTROY (similar_surface);
519
+ }
520
+
521
+ #if CAIRO_CHECK_VERSION(1, 11, 4)
522
+ static VALUE
523
+ cr_surface_create_similar_image (int argc, VALUE *argv, VALUE self)
524
+ {
525
+ cairo_surface_t *surface, *similar_image;
526
+ cairo_format_t format;
527
+ int width, height;
528
+ VALUE arg1, arg2, arg3;
529
+
530
+ rb_scan_args (argc, argv, "21", &arg1, &arg2, &arg3);
531
+
532
+ surface = _SELF;
533
+ if (argc == 2)
534
+ {
535
+ if (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE)
536
+ {
537
+ format = cairo_image_surface_get_format (surface);
538
+ }
539
+ else
540
+ {
541
+ format = CAIRO_FORMAT_ARGB32;
542
+ }
543
+ width = NUM2INT (arg1);
544
+ height = NUM2INT (arg2);
545
+ }
546
+ else
547
+ {
548
+ format = RVAL2CRFORMAT (arg1);
549
+ width = NUM2INT (arg2);
550
+ height = NUM2INT (arg3);
551
+ }
552
+
553
+ similar_image = cairo_surface_create_similar_image (surface, format,
554
+ width, height);
555
+ cr_surface_check_status (similar_image);
556
+ return CRSURFACE2RVAL_WITH_DESTROY (similar_image);
557
+ }
558
+
559
+ static VALUE
560
+ cr_surface_map_to_image (int argc, VALUE *argv, VALUE self)
561
+ {
562
+ cairo_surface_t *surface, *mapped_image;
563
+ cairo_rectangle_int_t extents_value;
564
+ cairo_rectangle_int_t *extents = NULL;
565
+ VALUE rb_extents;
566
+
567
+ rb_scan_args (argc, argv, "01", &rb_extents);
568
+
569
+ surface = _SELF;
570
+ if (!NIL_P (rb_extents))
571
+ {
572
+ extents = &extents_value;
573
+ if (rb_cairo__is_kind_of (rb_extents, rb_cCairo_Rectangle))
574
+ {
575
+ extents->x = NUM2INT (rb_funcall (rb_extents, cr_id_x, 0));
576
+ extents->y = NUM2INT (rb_funcall (rb_extents, cr_id_y, 0));
577
+ extents->width = NUM2INT (rb_funcall (rb_extents, cr_id_width, 0));
578
+ extents->height = NUM2INT (rb_funcall (rb_extents, cr_id_height, 0));
579
+ }
580
+ else
581
+ {
582
+ VALUE *values;
583
+ rb_extents = rb_convert_type (rb_extents, T_ARRAY, "Array", "to_ary");
584
+ values = RARRAY_PTR (rb_extents);
585
+ extents->x = NUM2INT (values[0]);
586
+ extents->y = NUM2INT (values[1]);
587
+ extents->height = NUM2INT (values[2]);
588
+ extents->width = NUM2INT (values[3]);
589
+ }
590
+ }
591
+
592
+ mapped_image = cairo_surface_map_to_image (surface, extents);
593
+ cr_surface_check_status (mapped_image);
594
+ return CRSURFACE2RVAL_WITH_DESTROY (mapped_image);
595
+ }
596
+
597
+ static VALUE
598
+ cr_surface_unmap_image (VALUE self, VALUE rb_mapped_image)
599
+ {
600
+ cairo_surface_t *surface, *mapped_image;
601
+
602
+ surface = _SELF;
603
+ mapped_image = RVAL2CRSURFACE (rb_mapped_image);
604
+ cairo_surface_unmap_image (surface, mapped_image);
605
+ return Qnil;
606
+ }
607
+ #endif
608
+
609
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
610
+ static VALUE
611
+ cr_surface_destroy_with_destroy_check (VALUE self)
612
+ {
613
+ if (DATA_PTR (self))
614
+ cr_surface_destroy (self);
615
+ return Qnil;
616
+ }
617
+
618
+ static VALUE
619
+ cr_surface_create_sub_rectangle_surface (VALUE self, VALUE x, VALUE y,
620
+ VALUE width, VALUE height)
621
+ {
622
+ VALUE rb_surface;
623
+ cairo_surface_t *surface;
624
+
625
+ surface = cairo_surface_create_for_rectangle (RVAL2CRSURFACE (self),
626
+ NUM2DBL (x),
627
+ NUM2DBL (y),
628
+ NUM2DBL (width),
629
+ NUM2INT (height));
630
+ cr_surface_check_status (surface);
631
+ rb_surface = CRSURFACE2RVAL_WITH_DESTROY (surface);
632
+ if (rb_block_given_p ())
633
+ return rb_ensure (rb_yield, rb_surface,
634
+ cr_surface_destroy_with_destroy_check, rb_surface);
635
+ else
636
+ return rb_surface;
637
+ }
638
+
639
+ static VALUE
640
+ cr_surface_get_device (VALUE self)
641
+ {
642
+ return CRDEVICE2RVAL (cairo_surface_get_device (_SELF));
643
+ }
644
+ #endif
645
+
646
+ static VALUE
647
+ cr_surface_get_content (VALUE self)
648
+ {
649
+ return INT2NUM (cairo_surface_get_content (_SELF));
650
+ }
651
+
652
+
653
+ #ifdef CAIRO_HAS_PNG_FUNCTIONS
654
+ static VALUE
655
+ cr_surface_write_to_png_stream (VALUE self, VALUE target)
656
+ {
657
+ cairo_status_t status;
658
+ rb_cairo__io_callback_closure_t closure;
659
+
660
+ closure.target = target;
661
+ closure.error = Qnil;
662
+
663
+ status = cairo_surface_write_to_png_stream (_SELF,
664
+ rb_cairo__io_write_func,
665
+ (void *)&closure);
666
+ if (!NIL_P (closure.error))
667
+ rb_exc_raise (closure.error);
668
+
669
+ rb_cairo_check_status (status);
670
+ return self;
671
+ }
672
+
673
+ static VALUE
674
+ cr_surface_write_to_png (VALUE self, VALUE filename)
675
+ {
676
+ cairo_status_t status;
677
+ status = cairo_surface_write_to_png (_SELF, StringValueCStr (filename));
678
+ rb_cairo_check_status (status);
679
+ return self;
680
+ }
681
+
682
+ static VALUE
683
+ cr_surface_write_to_png_generic (VALUE self, VALUE target)
684
+ {
685
+ if (rb_respond_to (target, rb_cairo__io_id_write))
686
+ return cr_surface_write_to_png_stream (self, target);
687
+ else
688
+ return cr_surface_write_to_png (self, target);
689
+ }
690
+ #endif
691
+
692
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
693
+ static VALUE
694
+ cr_surface_get_mime_data (VALUE self, VALUE mime_type)
695
+ {
696
+ cairo_surface_t *surface;
697
+ const unsigned char *data;
698
+ unsigned long length;
699
+
700
+ surface = _SELF;
701
+ cairo_surface_get_mime_data (surface, StringValueCStr (mime_type),
702
+ &data, &length);
703
+ if (data)
704
+ return rb_str_new ((const char *)data, length);
705
+ else
706
+ return Qnil;
707
+ }
708
+
709
+ static VALUE
710
+ cr_surface_set_mime_data (VALUE self, VALUE rb_mime_type, VALUE rb_data)
711
+ {
712
+ cairo_status_t status;
713
+ cairo_surface_t *surface;
714
+ const char *mime_type;
715
+
716
+ surface = _SELF;
717
+ mime_type = StringValueCStr (rb_mime_type);
718
+ if (NIL_P (rb_data))
719
+ {
720
+ status = cairo_surface_set_mime_data (surface, mime_type,
721
+ NULL, 0, NULL, NULL);
722
+ }
723
+ else
724
+ {
725
+ const char *raw_data;
726
+ unsigned char *data;
727
+ unsigned long length;
728
+
729
+ raw_data = StringValuePtr (rb_data);
730
+ length = RSTRING_LEN (rb_data);
731
+ data = xmalloc (length);
732
+ memcpy (data, raw_data, length);
733
+ status = cairo_surface_set_mime_data (surface, mime_type,
734
+ data, length,
735
+ xfree, data);
736
+ }
737
+ rb_cairo_check_status (status);
738
+ return Qnil;
739
+ }
740
+ #endif
741
+
742
+ #if CAIRO_CHECK_VERSION(1, 11, 4)
743
+ static VALUE
744
+ cr_surface_supported_mime_type_p (VALUE self, VALUE rb_mime_type)
745
+ {
746
+ cairo_surface_t *surface;
747
+ const char *mime_type;
748
+ cairo_bool_t supported_p;
749
+
750
+ surface = _SELF;
751
+ mime_type = StringValueCStr (rb_mime_type);
752
+ supported_p = cairo_surface_supports_mime_type (surface, mime_type);
753
+ return CBOOL2RVAL (supported_p);
754
+ }
755
+ #endif
756
+
757
+ static VALUE
758
+ cr_surface_get_font_options (VALUE self)
759
+ {
760
+ cairo_font_options_t *options = cairo_font_options_create();
761
+ cairo_surface_get_font_options (_SELF, options);
762
+ cr_surface_check_status (_SELF);
763
+ rb_cairo_check_status (cairo_font_options_status (options));
764
+ return CRFONTOPTIONS2RVAL (options);
765
+ }
766
+
767
+ static VALUE
768
+ cr_surface_flush (VALUE self)
769
+ {
770
+ cairo_surface_flush (_SELF);
771
+ cr_surface_check_status (_SELF);
772
+ return self;
773
+ }
774
+
775
+ static VALUE
776
+ cr_surface_mark_dirty (int argc, VALUE *argv, VALUE self)
777
+ {
778
+ VALUE x, y, width, height;
779
+ int n;
780
+
781
+ n = rb_scan_args (argc, argv, "04", &x, &y, &width, &height);
782
+
783
+ if (n == 0)
784
+ {
785
+ cairo_surface_mark_dirty (_SELF);
786
+ }
787
+ else if (n == 4)
788
+ {
789
+ cairo_surface_mark_dirty_rectangle (_SELF,
790
+ NUM2INT (x), NUM2INT (y),
791
+ NUM2INT (width), NUM2INT (height));
792
+ }
793
+ else
794
+ {
795
+ int i;
796
+ VALUE args;
797
+
798
+ args = rb_ary_new2 (n);
799
+ for (i = 0; i < n; i++)
800
+ {
801
+ rb_ary_push (args, argv[i]);
802
+ }
803
+
804
+ rb_raise (rb_eArgError,
805
+ "invalid argument (expect () or (x, y, width, height)): %s",
806
+ rb_cairo__inspect (args));
807
+ }
808
+
809
+ cr_surface_check_status (_SELF);
810
+ return self;
811
+ }
812
+
813
+ static VALUE
814
+ cr_surface_set_device_offset (VALUE self, VALUE x_offset, VALUE y_offset)
815
+ {
816
+ cairo_surface_set_device_offset (_SELF,
817
+ NUM2DBL (x_offset),
818
+ NUM2DBL (y_offset));
819
+ cr_surface_check_status (_SELF);
820
+ return self;
821
+ }
822
+
823
+ static VALUE
824
+ cr_surface_get_device_offset (VALUE self)
825
+ {
826
+ double x_offset, y_offset;
827
+
828
+ cairo_surface_get_device_offset (_SELF, &x_offset, &y_offset);
829
+ cr_surface_check_status (_SELF);
830
+ return rb_ary_new3 (2, rb_float_new (x_offset), rb_float_new (y_offset));
831
+ }
832
+
833
+ #if CAIRO_CHECK_VERSION(1, 14, 0)
834
+ static VALUE
835
+ cr_surface_set_device_scale (VALUE self, VALUE x_scale, VALUE y_scale)
836
+ {
837
+ cairo_surface_set_device_scale (_SELF,
838
+ NUM2DBL (x_scale),
839
+ NUM2DBL (y_scale));
840
+ cr_surface_check_status (_SELF);
841
+ return self;
842
+ }
843
+
844
+ static VALUE
845
+ cr_surface_get_device_scale (VALUE self)
846
+ {
847
+ double x_scale, y_scale;
848
+
849
+ cairo_surface_get_device_scale (_SELF, &x_scale, &y_scale);
850
+ return rb_ary_new3 (2, rb_float_new (x_scale), rb_float_new (y_scale));
851
+ }
852
+ #endif
853
+
854
+ static VALUE
855
+ cr_surface_set_fallback_resolution (VALUE self,
856
+ VALUE x_pixels_per_inch,
857
+ VALUE y_pixels_per_inch)
858
+ {
859
+ cairo_surface_set_fallback_resolution (_SELF,
860
+ NUM2DBL (x_pixels_per_inch),
861
+ NUM2DBL (y_pixels_per_inch));
862
+ cr_surface_check_status (_SELF);
863
+ return self;
864
+ }
865
+
866
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
867
+ static VALUE
868
+ cr_surface_get_fallback_resolution (VALUE self)
869
+ {
870
+ double x_pixels_per_inch, y_pixels_per_inch;
871
+
872
+ cairo_surface_get_fallback_resolution (_SELF,
873
+ &x_pixels_per_inch,
874
+ &y_pixels_per_inch);
875
+ cr_surface_check_status (_SELF);
876
+ return rb_ary_new3 (2,
877
+ rb_float_new (x_pixels_per_inch),
878
+ rb_float_new (y_pixels_per_inch));
879
+ }
880
+ #endif
881
+
882
+
883
+ #if CAIRO_CHECK_VERSION(1, 5, 2)
884
+ static VALUE
885
+ cr_surface_copy_page (VALUE self)
886
+ {
887
+ cairo_surface_copy_page (_SELF);
888
+ cr_surface_check_status (_SELF);
889
+ return self;
890
+ }
891
+
892
+ static VALUE
893
+ cr_surface_show_page (VALUE self)
894
+ {
895
+ cairo_surface_show_page (_SELF);
896
+ cr_surface_check_status (_SELF);
897
+ return self;
898
+ }
899
+ #endif
900
+
901
+ /* image surface functions */
902
+ #ifdef CAIRO_HAS_PNG_FUNCTIONS
903
+ static cairo_surface_t *
904
+ cr_image_surface_create_from_png_stream (VALUE target)
905
+ {
906
+ rb_cairo__io_callback_closure_t closure;
907
+ cairo_surface_t *surface;
908
+
909
+ closure.target = target;
910
+ closure.error = Qnil;
911
+
912
+ surface = cairo_image_surface_create_from_png_stream (rb_cairo__io_read_func,
913
+ (void *)&closure);
914
+ if (!NIL_P (closure.error))
915
+ rb_exc_raise (closure.error);
916
+
917
+ return surface;
918
+ }
919
+
920
+ static cairo_surface_t *
921
+ cr_image_surface_create_from_png (VALUE filename)
922
+ {
923
+ return cairo_image_surface_create_from_png (StringValueCStr (filename));
924
+ }
925
+
926
+ static VALUE
927
+ cr_image_surface_create_from_png_generic (VALUE klass, VALUE target)
928
+ {
929
+ VALUE rb_surface;
930
+ cairo_surface_t *surface;
931
+
932
+ if (rb_respond_to (target, rb_cairo__io_id_read))
933
+ surface = cr_image_surface_create_from_png_stream (target);
934
+ else
935
+ surface = cr_image_surface_create_from_png (target);
936
+
937
+ cr_surface_check_status (surface);
938
+ rb_surface = cr_surface_allocate (klass);
939
+ DATA_PTR (rb_surface) = surface;
940
+ return rb_surface;
941
+ }
942
+ #endif
943
+
944
+ static cairo_surface_t *
945
+ cr_image_surface_create (VALUE self, VALUE format, VALUE width, VALUE height)
946
+ {
947
+ cairo_format_t cr_format;
948
+ cr_format = NIL_P (format) ? CAIRO_FORMAT_ARGB32 : RVAL2CRFORMAT (format);
949
+ return cairo_image_surface_create (cr_format,
950
+ NUM2INT (width),
951
+ NUM2INT (height));
952
+ }
953
+
954
+ static cairo_surface_t *
955
+ cr_image_surface_create_for_data (VALUE self, VALUE rb_data, VALUE format,
956
+ VALUE width, VALUE height, VALUE stride)
957
+ {
958
+ unsigned char *data;
959
+
960
+ rb_data = StringValue (rb_data);
961
+ rb_str_modify (rb_data);
962
+ data = (unsigned char *)StringValuePtr (rb_data);
963
+
964
+ return cairo_image_surface_create_for_data (data,
965
+ RVAL2CRFORMAT (format),
966
+ NUM2INT (width),
967
+ NUM2INT (height),
968
+ NUM2INT (stride));
969
+ }
970
+
971
+ static VALUE
972
+ cr_image_surface_initialize (int argc, VALUE *argv, VALUE self)
973
+ {
974
+ cairo_surface_t *surface;
975
+ VALUE arg1, arg2, arg3, arg4, arg5;
976
+ int n;
977
+
978
+ n = rb_scan_args (argc, argv, "23", &arg1, &arg2, &arg3, &arg4, &arg5);
979
+
980
+ if (n == 2)
981
+ surface = cr_image_surface_create (self, Qnil, arg1, arg2);
982
+ else if (n == 3)
983
+ surface = cr_image_surface_create (self, arg1, arg2, arg3);
984
+ else if (n == 5)
985
+ surface =
986
+ cr_image_surface_create_for_data (self, arg1, arg2, arg3, arg4, arg5);
987
+ else
988
+ rb_raise (rb_eArgError,
989
+ "invalid argument (expect "
990
+ "(width, height) or "
991
+ "(format, width, height) or "
992
+ "(data, format, width, height, stride)): %s",
993
+ rb_cairo__inspect (rb_ary_new3 (4, arg1, arg2, arg3, arg4)));
994
+
995
+ cr_surface_check_status (surface);
996
+ DATA_PTR (self) = surface;
997
+ if (rb_block_given_p ())
998
+ yield_and_finish (self);
999
+ return Qnil;
1000
+ }
1001
+
1002
+ static VALUE
1003
+ cr_image_surface_get_data (VALUE self)
1004
+ {
1005
+ unsigned char *data;
1006
+ cairo_surface_t *surface;
1007
+
1008
+ surface = _SELF;
1009
+ data = cairo_image_surface_get_data (surface);
1010
+
1011
+ if (data)
1012
+ return rb_str_new ((const char *)data,
1013
+ cairo_image_surface_get_stride (surface) *
1014
+ cairo_image_surface_get_height (surface));
1015
+ else
1016
+ return Qnil;
1017
+ }
1018
+
1019
+ static VALUE
1020
+ cr_image_surface_get_format (VALUE self)
1021
+ {
1022
+ return INT2NUM (cairo_image_surface_get_format (_SELF));
1023
+ }
1024
+
1025
+ static VALUE
1026
+ cr_image_surface_get_width (VALUE self)
1027
+ {
1028
+ return INT2NUM (cairo_image_surface_get_width (_SELF));
1029
+ }
1030
+
1031
+ static VALUE
1032
+ cr_image_surface_get_height (VALUE self)
1033
+ {
1034
+ return INT2NUM (cairo_image_surface_get_height (_SELF));
1035
+ }
1036
+
1037
+ static VALUE
1038
+ cr_image_surface_get_stride (VALUE self)
1039
+ {
1040
+ return INT2NUM (cairo_image_surface_get_stride (_SELF));
1041
+ }
1042
+
1043
+ /* printing surfaces */
1044
+ #define DEFINE_SURFACE(type) \
1045
+ static VALUE \
1046
+ cr_ ## type ## _surface_initialize (int argc, VALUE *argv, VALUE self) \
1047
+ { \
1048
+ VALUE target, rb_width_in_points, rb_height_in_points; \
1049
+ VALUE arg2, arg3; \
1050
+ cairo_surface_t *surface; \
1051
+ double width_in_points, height_in_points; \
1052
+ \
1053
+ rb_scan_args (argc, argv, "21", &target, &arg2, &arg3); \
1054
+ if (argc == 2) \
1055
+ { \
1056
+ VALUE paper; \
1057
+ \
1058
+ paper = arg2; \
1059
+ cr_paper_to_size_in_points (paper, \
1060
+ &rb_width_in_points, \
1061
+ &rb_height_in_points); \
1062
+ } \
1063
+ else \
1064
+ { \
1065
+ rb_width_in_points = arg2; \
1066
+ rb_height_in_points = arg3; \
1067
+ } \
1068
+ \
1069
+ width_in_points = NUM2DBL (rb_width_in_points); \
1070
+ height_in_points = NUM2DBL (rb_height_in_points); \
1071
+ \
1072
+ if (rb_respond_to (target, rb_cairo__io_id_write)) \
1073
+ { \
1074
+ rb_cairo__io_callback_closure_t *closure; \
1075
+ \
1076
+ closure = rb_cairo__io_closure_new (target); \
1077
+ surface = \
1078
+ cairo_ ## type ## _surface_create_for_stream ( \
1079
+ rb_cairo__io_write_func, \
1080
+ (void *) closure, \
1081
+ width_in_points, \
1082
+ height_in_points); \
1083
+ \
1084
+ if (cairo_surface_status (surface)) \
1085
+ { \
1086
+ rb_cairo__io_closure_destroy (closure); \
1087
+ } \
1088
+ else \
1089
+ { \
1090
+ rb_ivar_set (self, rb_cairo__io_id_output, target); \
1091
+ cairo_surface_set_user_data (surface, &cr_closure_key, \
1092
+ closure, \
1093
+ rb_cairo__io_closure_free); \
1094
+ cairo_surface_set_user_data (surface, &cr_object_holder_key, \
1095
+ cr_object_holder_new (self), \
1096
+ cr_object_holder_free); \
1097
+ } \
1098
+ } \
1099
+ else \
1100
+ { \
1101
+ surface = \
1102
+ cairo_ ## type ## _surface_create (StringValueCStr (target), \
1103
+ width_in_points, \
1104
+ height_in_points); \
1105
+ } \
1106
+ \
1107
+ cr_surface_check_status (surface); \
1108
+ DATA_PTR (self) = surface; \
1109
+ if (rb_block_given_p ()) \
1110
+ yield_and_finish (self); \
1111
+ return Qnil; \
1112
+ }
1113
+
1114
+ #define DEFINE_SURFACE_SET_SIZE(type) \
1115
+ static VALUE \
1116
+ cr_ ## type ## _surface_set_size (int argc, VALUE *argv, VALUE self) \
1117
+ { \
1118
+ VALUE arg1, arg2; \
1119
+ VALUE width_in_points, height_in_points; \
1120
+ \
1121
+ rb_scan_args(argc, argv, "11", &arg1, &arg2); \
1122
+ if (argc == 1) \
1123
+ { \
1124
+ VALUE paper; \
1125
+ \
1126
+ paper = arg1; \
1127
+ cr_paper_to_size_in_points (paper, \
1128
+ &width_in_points, \
1129
+ &height_in_points); \
1130
+ } \
1131
+ else \
1132
+ { \
1133
+ width_in_points = arg1; \
1134
+ height_in_points = arg2; \
1135
+ } \
1136
+ \
1137
+ cairo_ ## type ## _surface_set_size (_SELF, \
1138
+ NUM2DBL (width_in_points), \
1139
+ NUM2DBL (height_in_points)); \
1140
+ cr_surface_check_status (_SELF); \
1141
+ return Qnil; \
1142
+ }
1143
+
1144
+ #ifdef CAIRO_HAS_PDF_SURFACE
1145
+ /* PDF-surface functions */
1146
+ DEFINE_SURFACE(pdf)
1147
+ DEFINE_SURFACE_SET_SIZE(pdf)
1148
+
1149
+ # if CAIRO_CHECK_VERSION(1, 10, 0)
1150
+ static VALUE
1151
+ cr_pdf_surface_restrict_to_version (VALUE self, VALUE version)
1152
+ {
1153
+ cairo_pdf_surface_restrict_to_version (_SELF, RVAL2CRPDFVERSION (version));
1154
+ cr_surface_check_status (_SELF);
1155
+ return Qnil;
1156
+ }
1157
+ # endif
1158
+ #endif
1159
+
1160
+ #ifdef CAIRO_HAS_PS_SURFACE
1161
+ /* PS-surface functions */
1162
+ DEFINE_SURFACE(ps)
1163
+ DEFINE_SURFACE_SET_SIZE(ps)
1164
+
1165
+ static VALUE
1166
+ cr_ps_surface_dsc_comment (VALUE self, VALUE comment)
1167
+ {
1168
+ cairo_ps_surface_dsc_comment (_SELF, StringValueCStr (comment));
1169
+ cr_surface_check_status (_SELF);
1170
+ return Qnil;
1171
+ }
1172
+
1173
+ static VALUE
1174
+ cr_ps_surface_dsc_begin_setup (VALUE self)
1175
+ {
1176
+ cairo_ps_surface_dsc_begin_setup (_SELF);
1177
+ cr_surface_check_status (_SELF);
1178
+ if (rb_block_given_p ())
1179
+ return rb_yield (self);
1180
+ else
1181
+ return Qnil;
1182
+ }
1183
+
1184
+ static VALUE
1185
+ cr_ps_surface_dsc_begin_page_setup (VALUE self)
1186
+ {
1187
+ cairo_ps_surface_dsc_begin_page_setup (_SELF);
1188
+ cr_surface_check_status (_SELF);
1189
+ if (rb_block_given_p ())
1190
+ return rb_yield (self);
1191
+ else
1192
+ return Qnil;
1193
+ }
1194
+
1195
+ # if CAIRO_CHECK_VERSION(1, 5, 2)
1196
+ static VALUE
1197
+ cr_ps_surface_restrict_to_level (VALUE self, VALUE level)
1198
+ {
1199
+ cairo_ps_surface_restrict_to_level (_SELF, RVAL2CRPSLEVEL (level));
1200
+ cr_surface_check_status (_SELF);
1201
+ return Qnil;
1202
+ }
1203
+
1204
+ static VALUE
1205
+ cr_ps_surface_get_eps (VALUE self)
1206
+ {
1207
+ return cairo_ps_surface_get_eps (_SELF) ? Qtrue : Qfalse;
1208
+ }
1209
+
1210
+ static VALUE
1211
+ cr_ps_surface_set_eps (VALUE self, VALUE eps)
1212
+ {
1213
+ cairo_ps_surface_set_eps (_SELF, RTEST (eps));
1214
+ cr_surface_check_status (_SELF);
1215
+ return Qnil;
1216
+ }
1217
+ # endif
1218
+ #endif
1219
+
1220
+ #ifdef RB_CAIRO_HAS_QUARTZ_SURFACE
1221
+ /* Quartz-surface functions */
1222
+ #include <objc/objc-runtime.h>
1223
+
1224
+ # ifdef HAVE_RUBY_COCOA
1225
+ BOOL rbobj_to_nsobj (VALUE obj, id* nsobj);
1226
+ VALUE ocid_to_rbobj (VALUE context_obj, id ocid);
1227
+ # endif
1228
+
1229
+ static VALUE
1230
+ cr_quartz_surface_initialize (int argc, VALUE *argv, VALUE self)
1231
+ {
1232
+ id objc_object = nil;
1233
+ CGContextRef context;
1234
+ unsigned int width, height;
1235
+ cairo_surface_t *surface = NULL;
1236
+ cairo_format_t format = CAIRO_FORMAT_ARGB32;
1237
+ VALUE arg1, arg2, arg3, rb_width, rb_height;
1238
+ # ifdef HAVE_RUBY_COCOA
1239
+ static VALUE rb_cOSXCGContextRef = Qnil;
1240
+ # endif
1241
+
1242
+ rb_scan_args (argc, argv, "21", &arg1, &arg2, &arg3);
1243
+
1244
+ if (argc == 2)
1245
+ {
1246
+ rb_width = arg1;
1247
+ rb_height = arg2;
1248
+ }
1249
+ else
1250
+ {
1251
+ switch (TYPE (arg1))
1252
+ {
1253
+ case T_NIL:
1254
+ break;
1255
+ case T_STRING:
1256
+ case T_SYMBOL:
1257
+ case T_FIXNUM:
1258
+ format = RVAL2CRFORMAT (arg1);
1259
+ break;
1260
+ default:
1261
+ # ifdef HAVE_RUBY_COCOA
1262
+ if (NIL_P (rb_cOSXCGContextRef))
1263
+ rb_cOSXCGContextRef =
1264
+ rb_const_get (rb_const_get (rb_cObject, rb_intern ("OSX")),
1265
+ rb_intern ("CGContextRef"));
1266
+ # endif
1267
+
1268
+ # ifdef HAVE_RUBY_COCOA
1269
+ if (RTEST (rb_obj_is_kind_of (arg1, rb_cOSXCGContextRef)))
1270
+ {
1271
+ rbobj_to_nsobj (arg1, &objc_object);
1272
+ }
1273
+ else
1274
+ # endif
1275
+ {
1276
+ if (!NIL_P (rb_cairo__cFFIPointer) &&
1277
+ RTEST (rb_obj_is_kind_of (arg1, rb_cairo__cFFIPointer)))
1278
+ {
1279
+ VALUE rb_objc_pointer;
1280
+ rb_objc_pointer = rb_funcall (arg1,
1281
+ rb_intern ("address"),
1282
+ 0);
1283
+ objc_object = NUM2ULONG (rb_objc_pointer);
1284
+ }
1285
+ else
1286
+ {
1287
+ rb_raise (rb_eArgError,
1288
+ "invalid argument (expect "
1289
+ "(width, height), "
1290
+ "(format, width, height), "
1291
+ "(cg_context, width, height) or "
1292
+ "(ffi_pointer, width, height)): %s",
1293
+ rb_cairo__inspect (rb_ary_new3 (3, arg1, arg2, arg3)));
1294
+ }
1295
+ }
1296
+ break;
1297
+ }
1298
+
1299
+ rb_width = arg2;
1300
+ rb_height = arg3;
1301
+ }
1302
+
1303
+ width = NUM2UINT (rb_width);
1304
+ height = NUM2UINT (rb_height);
1305
+
1306
+ if (objc_object == nil)
1307
+ {
1308
+ surface = cairo_quartz_surface_create (format, width, height);
1309
+ }
1310
+ else
1311
+ {
1312
+ context = (CGContextRef)objc_object;
1313
+ surface =
1314
+ cairo_quartz_surface_create_for_cg_context (context, width, height);
1315
+ }
1316
+
1317
+ cr_surface_check_status (surface);
1318
+ DATA_PTR (self) = surface;
1319
+ if (rb_block_given_p ())
1320
+ yield_and_finish (self);
1321
+ return Qnil;
1322
+ }
1323
+
1324
+ static VALUE
1325
+ cr_quartz_surface_get_cg_context (VALUE self)
1326
+ {
1327
+ # ifdef HAVE_RUBY_COCOA
1328
+ CGContextRef context;
1329
+ id objc_object;
1330
+
1331
+ context = cairo_quartz_surface_get_cg_context (_SELF);
1332
+ objc_object = (id)context;
1333
+ return ocid_to_rbobj (Qnil, objc_object);
1334
+ # else
1335
+ rb_raise (rb_eNotImpError,
1336
+ "%s#cg_context requires RubyCocoa",
1337
+ rb_obj_classname(self));
1338
+ return Qnil;
1339
+ # endif
1340
+ }
1341
+ #endif
1342
+
1343
+ #ifdef CAIRO_HAS_WIN32_SURFACE
1344
+ /* Win32 surface functions */
1345
+
1346
+ static VALUE
1347
+ cr_win32_surface_initialize (int argc, VALUE *argv, VALUE self)
1348
+ {
1349
+ cairo_surface_t *surface = NULL;
1350
+ VALUE arg1, arg2, arg3, arg4;
1351
+ VALUE hdc, format, width, height;
1352
+
1353
+ rb_scan_args (argc, argv, "13", &arg1, &arg2, &arg3, &arg4);
1354
+
1355
+ switch (argc)
1356
+ {
1357
+ case 1:
1358
+ hdc = arg1;
1359
+ surface = cairo_win32_surface_create (NUM2PTR (hdc));
1360
+ break;
1361
+ case 2:
1362
+ width = arg1;
1363
+ height = arg2;
1364
+ surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32,
1365
+ NUM2INT (width),
1366
+ NUM2INT (height));
1367
+ break;
1368
+ case 3:
1369
+ if (NIL_P (arg1) ||
1370
+ (rb_cairo__is_kind_of (arg1, rb_cNumeric) &&
1371
+ NUM2INT (arg1) != CAIRO_FORMAT_RGB24))
1372
+ {
1373
+ # if CAIRO_CHECK_VERSION(1, 4, 0)
1374
+ HDC win32_hdc;
1375
+ hdc = arg1;
1376
+ width = arg2;
1377
+ height = arg3;
1378
+ win32_hdc = NIL_P (hdc) ? NULL : NUM2PTR (hdc);
1379
+ surface = cairo_win32_surface_create_with_ddb (win32_hdc,
1380
+ CAIRO_FORMAT_RGB24,
1381
+ NUM2INT (width),
1382
+ NUM2INT (height));
1383
+ # else
1384
+ rb_raise (rb_eArgError,
1385
+ "Cairo::Win32Surface.new(hdc, width, height) "
1386
+ "is available since cairo >= 1.4.0");
1387
+ # endif
1388
+ }
1389
+ else
1390
+ {
1391
+ format = arg1;
1392
+ width = arg2;
1393
+ height = arg3;
1394
+ surface = cairo_win32_surface_create_with_dib (RVAL2CRFORMAT (format),
1395
+ NUM2INT (width),
1396
+ NUM2INT (height));
1397
+ }
1398
+ break;
1399
+ case 4:
1400
+ {
1401
+ # if CAIRO_CHECK_VERSION(1, 4, 0)
1402
+ HDC win32_hdc;
1403
+ hdc = arg1;
1404
+ format = arg2;
1405
+ width = arg3;
1406
+ height = arg4;
1407
+ win32_hdc = NIL_P (hdc) ? NULL : (HDC) NUM2UINT (hdc);
1408
+ surface = cairo_win32_surface_create_with_ddb (win32_hdc,
1409
+ RVAL2CRFORMAT (format),
1410
+ NUM2INT (width),
1411
+ NUM2INT (height));
1412
+ # else
1413
+ rb_raise (rb_eArgError,
1414
+ "Cairo::Win32Surface.new(hdc, format, width, height) "
1415
+ "is available since cairo >= 1.4.0");
1416
+ # endif
1417
+ }
1418
+ break;
1419
+ }
1420
+
1421
+ if (!surface)
1422
+ rb_cairo_check_status (CAIRO_STATUS_INVALID_FORMAT);
1423
+ cr_surface_check_status (surface);
1424
+ DATA_PTR (self) = surface;
1425
+ if (rb_block_given_p ())
1426
+ yield_and_finish (self);
1427
+ return Qnil;
1428
+ }
1429
+
1430
+ static VALUE
1431
+ cr_win32_surface_get_hdc (VALUE self)
1432
+ {
1433
+ HDC hdc;
1434
+
1435
+ hdc = cairo_win32_surface_get_dc (_SELF);
1436
+ if (!hdc)
1437
+ return Qnil;
1438
+ else
1439
+ return PTR2NUM (hdc);
1440
+ }
1441
+
1442
+ # if CAIRO_CHECK_VERSION(1, 4, 0)
1443
+ static VALUE
1444
+ cr_win32_surface_get_image (VALUE self)
1445
+ {
1446
+ cairo_surface_t *surface;
1447
+
1448
+ surface = cairo_win32_surface_get_image (_SELF);
1449
+ if (!surface)
1450
+ return Qnil;
1451
+ cr_surface_check_status (surface);
1452
+ return CRSURFACE2RVAL (surface);
1453
+ }
1454
+ # endif
1455
+ #endif
1456
+
1457
+ #ifdef CAIRO_HAS_SVG_SURFACE
1458
+ /* SVG-surface functions */
1459
+ DEFINE_SURFACE(svg)
1460
+
1461
+ static VALUE
1462
+ cr_svg_surface_restrict_to_version (VALUE self, VALUE version)
1463
+ {
1464
+ cairo_svg_surface_restrict_to_version (_SELF, RVAL2CRSVGVERSION (version));
1465
+ cr_surface_check_status (_SELF);
1466
+ return Qnil;
1467
+ }
1468
+ #endif
1469
+
1470
+ #ifdef RB_CAIRO_HAS_WIN32_PRINTING_SURFACE
1471
+ /* Win32 printing surface functions */
1472
+ static VALUE
1473
+ cr_win32_printing_surface_initialize (VALUE self, VALUE hdc)
1474
+ {
1475
+ cairo_surface_t *surface = NULL;
1476
+
1477
+ surface = cairo_win32_printing_surface_create (NUM2PTR (hdc));
1478
+ cr_surface_check_status (surface);
1479
+ DATA_PTR (self) = surface;
1480
+ if (rb_block_given_p ())
1481
+ yield_and_finish (self);
1482
+ return Qnil;
1483
+ }
1484
+ #endif
1485
+
1486
+ #ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
1487
+
1488
+ /* Quartz image surface functions */
1489
+ static VALUE
1490
+ cr_quartz_image_surface_initialize (VALUE self, VALUE image_surface)
1491
+ {
1492
+ cairo_surface_t *surface;
1493
+
1494
+ surface = cairo_quartz_image_surface_create (RVAL2CRSURFACE (image_surface));
1495
+ cr_surface_check_status (surface);
1496
+ DATA_PTR (self) = surface;
1497
+ if (rb_block_given_p ())
1498
+ yield_and_finish (self);
1499
+ return Qnil;
1500
+ }
1501
+
1502
+ static VALUE
1503
+ cr_quartz_image_surface_get_image (VALUE self)
1504
+ {
1505
+ cairo_surface_t *surface;
1506
+
1507
+ surface = cairo_quartz_image_surface_get_image (_SELF);
1508
+ if (!surface)
1509
+ return Qnil;
1510
+ cr_surface_check_status (surface);
1511
+ return CRSURFACE2RVAL (surface);
1512
+ }
1513
+ #endif
1514
+
1515
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
1516
+ /* script surface functions */
1517
+ static VALUE
1518
+ cr_script_surface_initialize (int argc, VALUE *argv, VALUE self)
1519
+ {
1520
+ cairo_surface_t *surface = NULL, *target = NULL;
1521
+ cairo_device_t *device;
1522
+ double width = 0.0, height = 0.0;
1523
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1524
+ VALUE arg1, arg2, arg3, arg4;
1525
+
1526
+ rb_scan_args (argc, argv, "22", &arg1, &arg2, &arg3, &arg4);
1527
+
1528
+ device = RVAL2CRDEVICE (arg1);
1529
+ if (argc == 2)
1530
+ {
1531
+ target = RVAL2CRSURFACE (arg2);
1532
+ }
1533
+ else
1534
+ {
1535
+ width = NUM2DBL (arg2);
1536
+ height = NUM2DBL (arg3);
1537
+ switch (TYPE (arg4))
1538
+ {
1539
+ case T_NIL:
1540
+ break;
1541
+ case T_STRING:
1542
+ case T_SYMBOL:
1543
+ case T_FIXNUM:
1544
+ content = RVAL2CRCONTENT (arg4);
1545
+ break;
1546
+ default:
1547
+ rb_raise (rb_eArgError,
1548
+ "invalid argument (expect "
1549
+ "(device, width, height), "
1550
+ "(device, width, height, content) or "
1551
+ "(device, surface)): %s",
1552
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1553
+ break;
1554
+ }
1555
+ }
1556
+
1557
+ if (target)
1558
+ surface = cairo_script_surface_create_for_target (device, target);
1559
+ else
1560
+ surface = cairo_script_surface_create (device, content, width, height);
1561
+
1562
+ cr_surface_check_status (surface);
1563
+ DATA_PTR (self) = surface;
1564
+ if (rb_block_given_p ())
1565
+ yield_and_finish (self);
1566
+ return Qnil;
1567
+ }
1568
+ #endif
1569
+
1570
+ #ifdef CAIRO_HAS_RECORDING_SURFACE
1571
+ /* recording surface functions */
1572
+ static VALUE
1573
+ cr_recording_surface_initialize (int argc, VALUE *argv, VALUE self)
1574
+ {
1575
+ VALUE arg1, arg2, arg3, arg4, arg5;
1576
+ cairo_surface_t *surface;
1577
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1578
+ cairo_rectangle_t extents;
1579
+ const char *error_message =
1580
+ "invalid argument (expect "
1581
+ "(x, y, width, height), "
1582
+ "([x, y, width, height]),"
1583
+ "(x, y, width, height, content) or "
1584
+ "([x, y, width, height], content)): %s";
1585
+
1586
+ rb_scan_args (argc, argv, "14", &arg1, &arg2, &arg3, &arg4, &arg5);
1587
+ if (argc == 1 || argc == 2)
1588
+ {
1589
+ VALUE rb_extents;
1590
+
1591
+ rb_extents = rb_check_array_type (arg1);
1592
+ if (RARRAY_LEN (rb_extents) != 4)
1593
+ rb_raise (rb_eArgError, error_message, rb_cairo__inspect (arg1));
1594
+ extents.x = NUM2DBL (RARRAY_PTR (rb_extents)[0]);
1595
+ extents.y = NUM2DBL (RARRAY_PTR (rb_extents)[1]);
1596
+ extents.width = NUM2DBL (RARRAY_PTR (rb_extents)[2]);
1597
+ extents.height = NUM2DBL (RARRAY_PTR (rb_extents)[3]);
1598
+ if (!NIL_P (arg2))
1599
+ content = RVAL2CRCONTENT (arg2);
1600
+ }
1601
+ else if (argc == 4 || argc == 5)
1602
+ {
1603
+ extents.x = NUM2DBL (arg1);
1604
+ extents.y = NUM2DBL (arg2);
1605
+ extents.width = NUM2DBL (arg3);
1606
+ extents.height = NUM2DBL (arg4);
1607
+ if (!NIL_P (arg5))
1608
+ content = RVAL2CRCONTENT (arg5);
1609
+ }
1610
+ else
1611
+ {
1612
+ rb_raise (rb_eArgError, error_message,
1613
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1614
+ }
1615
+
1616
+ surface = cairo_recording_surface_create (content, &extents);
1617
+ cr_surface_check_status (surface);
1618
+ DATA_PTR (self) = surface;
1619
+ if (rb_block_given_p ())
1620
+ yield_and_finish (self);
1621
+ return Qnil;
1622
+ }
1623
+
1624
+ static VALUE
1625
+ cr_recording_surface_get_ink_extents (VALUE self)
1626
+ {
1627
+ cairo_surface_t *surface;
1628
+ double x, y, width, height;
1629
+
1630
+ surface = _SELF;
1631
+ cairo_recording_surface_ink_extents (surface, &x, &y, &width, &height);
1632
+ cr_surface_check_status (surface);
1633
+ return rb_ary_new3 (4,
1634
+ rb_float_new (x), rb_float_new (y),
1635
+ rb_float_new (width), rb_float_new (height));
1636
+ }
1637
+
1638
+ # if CAIRO_CHECK_VERSION(1, 11, 4)
1639
+ static VALUE
1640
+ cr_recording_surface_get_extents (VALUE self)
1641
+ {
1642
+ cairo_surface_t *surface;
1643
+ cairo_rectangle_t extents;
1644
+
1645
+ surface = _SELF;
1646
+ cairo_recording_surface_get_extents (surface, &extents);
1647
+ cr_surface_check_status (surface);
1648
+ return rb_ary_new3 (4,
1649
+ rb_float_new (extents.x),
1650
+ rb_float_new (extents.y),
1651
+ rb_float_new (extents.width),
1652
+ rb_float_new (extents.height));
1653
+ }
1654
+ # endif
1655
+ #endif
1656
+
1657
+ #ifdef RB_CAIRO_HAS_GL_SURFACE
1658
+ /* GL surface functions */
1659
+ static VALUE
1660
+ cr_gl_surface_initialize (int argc, VALUE *argv, VALUE self)
1661
+ {
1662
+ cairo_surface_t *surface;
1663
+ cairo_device_t *device;
1664
+ int width, height;
1665
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1666
+ VALUE rb_device, rb_width, rb_height, rb_content;
1667
+
1668
+ rb_scan_args (argc, argv, "31",
1669
+ &rb_device, &rb_width, &rb_height, &rb_content);
1670
+
1671
+ device = RVAL2CRDEVICE (rb_device);
1672
+ width = NUM2INT (rb_width);
1673
+ height = NUM2INT (rb_height);
1674
+ switch (TYPE (rb_content))
1675
+ {
1676
+ case T_NIL:
1677
+ break;
1678
+ case T_STRING:
1679
+ case T_SYMBOL:
1680
+ case T_FIXNUM:
1681
+ content = RVAL2CRCONTENT (rb_content);
1682
+ break;
1683
+ default:
1684
+ rb_raise (rb_eArgError,
1685
+ "invalid argument (expect "
1686
+ "(device, width, height) or "
1687
+ "(device, width, height, content)): %s",
1688
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1689
+ break;
1690
+ }
1691
+
1692
+ surface = cairo_gl_surface_create (device, content, width, height);
1693
+
1694
+ cr_surface_check_status (surface);
1695
+ DATA_PTR (self) = surface;
1696
+ if (rb_block_given_p ())
1697
+ yield_and_finish (self);
1698
+ return Qnil;
1699
+ }
1700
+
1701
+ static VALUE
1702
+ cr_gl_texture_surface_initialize (int argc, VALUE *argv, VALUE self)
1703
+ {
1704
+ cairo_surface_t *surface;
1705
+ cairo_device_t *device;
1706
+ unsigned int texture;
1707
+ int width, height;
1708
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1709
+ VALUE rb_device, rb_texture, rb_width, rb_height, rb_content;
1710
+
1711
+ rb_scan_args (argc, argv, "41",
1712
+ &rb_device, &rb_texture, &rb_width, &rb_height, &rb_content);
1713
+
1714
+ device = RVAL2CRDEVICE (rb_device);
1715
+ texture = NUM2UINT (rb_texture);
1716
+ width = NUM2INT (rb_width);
1717
+ height = NUM2INT (rb_height);
1718
+ switch (TYPE (rb_content))
1719
+ {
1720
+ case T_NIL:
1721
+ break;
1722
+ case T_STRING:
1723
+ case T_SYMBOL:
1724
+ case T_FIXNUM:
1725
+ content = RVAL2CRCONTENT (rb_content);
1726
+ break;
1727
+ default:
1728
+ rb_raise (rb_eArgError,
1729
+ "invalid argument (expect "
1730
+ "(device, texture, width, height) or "
1731
+ "(device, texture, width, height, content)): %s",
1732
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1733
+ break;
1734
+ }
1735
+
1736
+ surface = cairo_gl_surface_create_for_texture (device, content,
1737
+ texture,
1738
+ width,
1739
+ height);
1740
+
1741
+ cr_surface_check_status (surface);
1742
+ DATA_PTR (self) = surface;
1743
+ if (rb_block_given_p ())
1744
+ yield_and_finish (self);
1745
+ return Qnil;
1746
+ }
1747
+
1748
+ static VALUE
1749
+ cr_gl_surface_set_size (VALUE self, VALUE width, VALUE height)
1750
+ {
1751
+ cairo_surface_t *surface = NULL;
1752
+
1753
+ surface = _SELF;
1754
+ cairo_gl_surface_set_size (surface, NUM2INT (width), NUM2INT (height));
1755
+ cr_surface_check_status (surface);
1756
+ return Qnil;
1757
+ }
1758
+
1759
+ static VALUE
1760
+ cr_gl_surface_get_width (VALUE self)
1761
+ {
1762
+ return INT2NUM (cairo_gl_surface_get_width (_SELF));
1763
+ }
1764
+
1765
+ static VALUE
1766
+ cr_gl_surface_get_height (VALUE self)
1767
+ {
1768
+ return INT2NUM (cairo_gl_surface_get_height (_SELF));
1769
+ }
1770
+
1771
+ static VALUE
1772
+ cr_gl_surface_swap_buffers (VALUE self)
1773
+ {
1774
+ cairo_surface_t *surface = NULL;
1775
+
1776
+ surface = _SELF;
1777
+ cairo_gl_surface_swapbuffers (surface);
1778
+ cr_surface_check_status (surface);
1779
+ return Qnil;
1780
+ }
1781
+ #endif
1782
+
1783
+ #ifdef CAIRO_HAS_TEE_SURFACE
1784
+ /* tee surface functions */
1785
+ static VALUE
1786
+ cr_tee_surface_initialize (VALUE self, VALUE master)
1787
+ {
1788
+ cairo_surface_t *surface = NULL;
1789
+
1790
+ surface = cairo_tee_surface_create (RVAL2CRSURFACE (master));
1791
+ cr_surface_check_status (surface);
1792
+ DATA_PTR (self) = surface;
1793
+ rb_iv_set (self, "surfaces", rb_ary_new3 (1, master));
1794
+ if (rb_block_given_p ())
1795
+ yield_and_finish (self);
1796
+ return Qnil;
1797
+ }
1798
+
1799
+ static VALUE
1800
+ cr_tee_surface_add (VALUE self, VALUE target)
1801
+ {
1802
+ cairo_surface_t *surface = NULL;
1803
+
1804
+ surface = _SELF;
1805
+ cairo_tee_surface_add (surface, RVAL2CRSURFACE (target));
1806
+ cr_surface_check_status (surface);
1807
+ rb_ary_push (rb_iv_get (self, "surfaces"), target);
1808
+ return Qnil;
1809
+ }
1810
+
1811
+ static VALUE
1812
+ cr_tee_surface_shift_operator (VALUE self, VALUE target)
1813
+ {
1814
+ cr_tee_surface_add (self, target);
1815
+ return self;
1816
+ }
1817
+
1818
+ static VALUE
1819
+ cr_tee_surface_remove (VALUE self, VALUE target_or_index)
1820
+ {
1821
+ cairo_surface_t *surface = NULL, *target;
1822
+ VALUE rb_surfaces;
1823
+ int i;
1824
+
1825
+ surface = _SELF;
1826
+ if (rb_cairo__is_kind_of (target_or_index, rb_cCairo_Surface))
1827
+ {
1828
+ target = RVAL2CRSURFACE (target_or_index);
1829
+ }
1830
+ else
1831
+ {
1832
+ VALUE index;
1833
+
1834
+ index = rb_check_to_integer (target_or_index, "to_int");
1835
+ if (NIL_P (index))
1836
+ rb_raise (rb_eArgError,
1837
+ "invalid argument (expect (surface) or (index)): %s",
1838
+ rb_cairo__inspect (target_or_index));
1839
+ target = cairo_tee_surface_index (surface, NUM2INT (index));
1840
+ }
1841
+ cairo_tee_surface_remove (surface, target);
1842
+ cr_surface_check_status (surface);
1843
+
1844
+ rb_surfaces = rb_iv_get (self, "surfaces");
1845
+ for (i = 0; i < RARRAY_LEN (rb_surfaces); i++)
1846
+ {
1847
+ VALUE rb_marked_surface;
1848
+ cairo_surface_t *marked_surface;
1849
+
1850
+ rb_marked_surface = RARRAY_PTR (rb_surfaces)[i];
1851
+ marked_surface = RVAL2CRSURFACE (rb_marked_surface);
1852
+ if (marked_surface == target)
1853
+ {
1854
+ rb_ary_delete (rb_surfaces, rb_marked_surface);
1855
+ break;
1856
+ }
1857
+ }
1858
+
1859
+ return Qnil;
1860
+ }
1861
+
1862
+ static VALUE
1863
+ cr_tee_surface_array_reference (VALUE self, VALUE index)
1864
+ {
1865
+ cairo_surface_t *surface = NULL, *target;
1866
+
1867
+ surface = _SELF;
1868
+ index = rb_Integer (index);
1869
+ target = cairo_tee_surface_index (surface, NUM2UINT (index));
1870
+ cr_surface_check_status (surface);
1871
+ cr_surface_check_status (target);
1872
+ return CRSURFACE2RVAL (target);
1873
+ }
1874
+ #endif
1875
+
1876
+ #ifdef CAIRO_HAS_XML_SURFACE
1877
+ /* XML surface functions */
1878
+ static VALUE
1879
+ cr_xml_surface_initialize (int argc, VALUE *argv, VALUE self)
1880
+ {
1881
+ cairo_surface_t *surface;
1882
+ cairo_device_t *device;
1883
+ double width, height;
1884
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1885
+ VALUE rb_device, rb_width, rb_height, rb_content;
1886
+
1887
+ rb_scan_args (argc, argv, "31",
1888
+ &rb_device, &rb_width, &rb_height, &rb_content);
1889
+
1890
+ device = RVAL2CRDEVICE (rb_device);
1891
+ width = NUM2DBL (rb_width);
1892
+ height = NUM2DBL (rb_height);
1893
+ switch (TYPE (rb_content))
1894
+ {
1895
+ case T_NIL:
1896
+ break;
1897
+ case T_STRING:
1898
+ case T_SYMBOL:
1899
+ case T_FIXNUM:
1900
+ content = RVAL2CRCONTENT (rb_content);
1901
+ break;
1902
+ default:
1903
+ rb_raise (rb_eArgError,
1904
+ "invalid argument (expect "
1905
+ "(device, width, height) or "
1906
+ "(device, width, height, content)): %s",
1907
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1908
+ break;
1909
+ }
1910
+
1911
+ surface = cairo_xml_surface_create (device, content, width, height);
1912
+
1913
+ cr_surface_check_status (surface);
1914
+ DATA_PTR (self) = surface;
1915
+ if (rb_block_given_p ())
1916
+ yield_and_finish (self);
1917
+ return Qnil;
1918
+ }
1919
+ #endif
1920
+
1921
+ static int
1922
+ cr_finish_all_guarded_surfaces_at_end_iter (VALUE key, VALUE value, VALUE data)
1923
+ {
1924
+ cr_surface_finish (key);
1925
+ return ST_CONTINUE;
1926
+ }
1927
+
1928
+ static void
1929
+ cr_finish_all_guarded_surfaces_at_end (VALUE data)
1930
+ {
1931
+ rb_hash_foreach (rb_cairo__gc_guarded_objects (rb_cCairo_Surface),
1932
+ cr_finish_all_guarded_surfaces_at_end_iter,
1933
+ Qnil);
1934
+ }
1935
+
1936
+ void
1937
+ Init_cairo_surface (void)
1938
+ {
1939
+ cr_id_parse = rb_intern ("parse");
1940
+ cr_id_size = rb_intern ("size");
1941
+ cr_id_set_unit = rb_intern ("unit=");
1942
+ cr_id_x = rb_intern ("x");
1943
+ cr_id_y = rb_intern ("y");
1944
+ cr_id_width = rb_intern ("width");
1945
+ cr_id_height = rb_intern ("height");
1946
+
1947
+ rb_cCairo_Surface =
1948
+ rb_define_class_under (rb_mCairo, "Surface", rb_cObject);
1949
+ rb_define_alloc_func (rb_cCairo_Surface, cr_surface_allocate);
1950
+
1951
+ rb_cairo__initialize_gc_guard_holder_class (rb_cCairo_Surface);
1952
+ rb_set_end_proc(cr_finish_all_guarded_surfaces_at_end, Qnil);
1953
+
1954
+ rb_define_singleton_method (rb_cCairo_Surface, "image_supported?",
1955
+ cr_surface_image_supported_p, 0);
1956
+ rb_define_singleton_method (rb_cCairo_Surface, "pdf_supported?",
1957
+ cr_surface_pdf_supported_p, 0);
1958
+ rb_define_singleton_method (rb_cCairo_Surface, "ps_supported?",
1959
+ cr_surface_ps_supported_p, 0);
1960
+ rb_define_singleton_method (rb_cCairo_Surface, "quartz_supported?",
1961
+ cr_surface_quartz_supported_p, 0);
1962
+ rb_define_singleton_method (rb_cCairo_Surface, "win32_supported?",
1963
+ cr_surface_win32_supported_p, 0);
1964
+ rb_define_singleton_method (rb_cCairo_Surface, "svg_supported?",
1965
+ cr_surface_svg_supported_p, 0);
1966
+ rb_define_singleton_method (rb_cCairo_Surface, "win32_printing_supported?",
1967
+ cr_surface_win32_printing_supported_p, 0);
1968
+ rb_define_singleton_method (rb_cCairo_Surface, "quartz_image_supported?",
1969
+ cr_surface_quartz_image_supported_p, 0);
1970
+ rb_define_singleton_method (rb_cCairo_Surface, "script_supported?",
1971
+ cr_surface_script_supported_p, 0);
1972
+ rb_define_singleton_method (rb_cCairo_Surface, "recording_supported?",
1973
+ cr_surface_recording_supported_p, 0);
1974
+ rb_define_singleton_method (rb_cCairo_Surface, "gl_supported?",
1975
+ cr_surface_gl_supported_p, 0);
1976
+ rb_define_singleton_method (rb_cCairo_Surface, "gl_texture_supported?",
1977
+ cr_surface_gl_texture_supported_p, 0);
1978
+ rb_define_singleton_method (rb_cCairo_Surface, "tee_supported?",
1979
+ cr_surface_tee_supported_p, 0);
1980
+ rb_define_singleton_method (rb_cCairo_Surface, "xml_supported?",
1981
+ cr_surface_xml_supported_p, 0);
1982
+
1983
+ rb_define_method (rb_cCairo_Surface, "initialize",
1984
+ cr_surface_initialize, -1);
1985
+
1986
+ rb_define_method (rb_cCairo_Surface, "create_similar",
1987
+ cr_surface_create_similar, -1);
1988
+ #if CAIRO_CHECK_VERSION(1, 11, 4)
1989
+ rb_define_method (rb_cCairo_Surface, "create_similar_image",
1990
+ cr_surface_create_similar_image, -1);
1991
+ rb_define_method (rb_cCairo_Surface, "map_to_image",
1992
+ cr_surface_map_to_image, -1);
1993
+ rb_define_method (rb_cCairo_Surface, "unmap_image",
1994
+ cr_surface_unmap_image, 1);
1995
+ #endif
1996
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
1997
+ rb_define_method (rb_cCairo_Surface, "sub_rectangle_surface",
1998
+ cr_surface_create_sub_rectangle_surface, 4);
1999
+ rb_define_method (rb_cCairo_Surface, "device",
2000
+ cr_surface_get_device, 0);
2001
+ #endif
2002
+ rb_define_method (rb_cCairo_Surface, "destroy", cr_surface_destroy, 0);
2003
+ rb_define_method (rb_cCairo_Surface, "finish", cr_surface_finish, 0);
2004
+ rb_define_method (rb_cCairo_Surface, "content", cr_surface_get_content, 0);
2005
+
2006
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
2007
+ rb_define_method (rb_cCairo_Surface, "get_mime_data",
2008
+ cr_surface_get_mime_data, 1);
2009
+ rb_define_method (rb_cCairo_Surface, "set_mime_data",
2010
+ cr_surface_set_mime_data, 2);
2011
+ #endif
2012
+ #if CAIRO_CHECK_VERSION(1, 11, 4)
2013
+ rb_define_method (rb_cCairo_Surface, "supported_mime_type?",
2014
+ cr_surface_supported_mime_type_p, 1);
2015
+ #endif
2016
+
2017
+
2018
+ rb_define_method (rb_cCairo_Surface, "font_options",
2019
+ cr_surface_get_font_options, 0);
2020
+ rb_define_method (rb_cCairo_Surface, "flush", cr_surface_flush, 0);
2021
+ rb_define_method (rb_cCairo_Surface, "mark_dirty", cr_surface_mark_dirty, -1);
2022
+ rb_define_method (rb_cCairo_Surface, "set_device_offset",
2023
+ cr_surface_set_device_offset, 2);
2024
+ rb_define_method (rb_cCairo_Surface, "device_offset",
2025
+ cr_surface_get_device_offset, 0);
2026
+ #if CAIRO_CHECK_VERSION(1, 14, 0)
2027
+ rb_define_method (rb_cCairo_Surface, "set_device_scale",
2028
+ cr_surface_set_device_scale, 2);
2029
+ rb_define_method (rb_cCairo_Surface, "device_scale",
2030
+ cr_surface_get_device_scale, 0);
2031
+ #endif
2032
+ rb_define_method (rb_cCairo_Surface, "set_fallback_resolution",
2033
+ cr_surface_set_fallback_resolution, 2);
2034
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
2035
+ rb_define_method (rb_cCairo_Surface, "fallback_resolution",
2036
+ cr_surface_get_fallback_resolution, 0);
2037
+ #endif
2038
+ #if CAIRO_CHECK_VERSION(1, 5, 2)
2039
+ rb_define_method (rb_cCairo_Surface, "copy_page",
2040
+ cr_surface_copy_page, 2);
2041
+ rb_define_method (rb_cCairo_Surface, "show_page",
2042
+ cr_surface_show_page, 2);
2043
+ #endif
2044
+
2045
+ #ifdef CAIRO_HAS_PNG_FUNCTIONS
2046
+ rb_define_method (rb_cCairo_Surface, "write_to_png",
2047
+ cr_surface_write_to_png_generic, 1);
2048
+ #endif
2049
+
2050
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_Surface);
2051
+
2052
+ /* image surface */
2053
+ rb_cCairo_ImageSurface =
2054
+ rb_define_class_under (rb_mCairo, "ImageSurface", rb_cCairo_Surface);
2055
+
2056
+ #ifdef CAIRO_HAS_PNG_FUNCTIONS
2057
+ rb_define_singleton_method (rb_cCairo_ImageSurface, "from_png",
2058
+ cr_image_surface_create_from_png_generic, 1);
2059
+ #endif
2060
+
2061
+ rb_define_method (rb_cCairo_ImageSurface, "initialize",
2062
+ cr_image_surface_initialize, -1);
2063
+
2064
+ rb_define_method (rb_cCairo_ImageSurface, "data",
2065
+ cr_image_surface_get_data, 0);
2066
+ rb_define_method (rb_cCairo_ImageSurface, "format",
2067
+ cr_image_surface_get_format, 0);
2068
+ rb_define_method (rb_cCairo_ImageSurface, "width",
2069
+ cr_image_surface_get_width, 0);
2070
+ rb_define_method (rb_cCairo_ImageSurface, "height",
2071
+ cr_image_surface_get_height, 0);
2072
+ rb_define_method (rb_cCairo_ImageSurface, "stride",
2073
+ cr_image_surface_get_stride, 0);
2074
+
2075
+ /* PDF surface */
2076
+ rb_cCairo_PDFSurface =
2077
+ rb_define_class_under (rb_mCairo, "PDFSurface", rb_cCairo_Surface);
2078
+ #ifdef CAIRO_HAS_PDF_SURFACE
2079
+ rb_define_method (rb_cCairo_PDFSurface, "initialize",
2080
+ cr_pdf_surface_initialize, -1);
2081
+
2082
+ rb_define_method (rb_cCairo_PDFSurface, "set_size",
2083
+ cr_pdf_surface_set_size, -1);
2084
+
2085
+ # if CAIRO_CHECK_VERSION(1, 10, 0)
2086
+ rb_define_method (rb_cCairo_PDFSurface, "restrict_to_version",
2087
+ cr_pdf_surface_restrict_to_version, 1);
2088
+ # endif
2089
+
2090
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_PDFSurface);
2091
+ #endif
2092
+
2093
+ /* PS surface */
2094
+ rb_cCairo_PSSurface =
2095
+ rb_define_class_under (rb_mCairo, "PSSurface", rb_cCairo_Surface);
2096
+ #ifdef CAIRO_HAS_PS_SURFACE
2097
+ rb_define_method (rb_cCairo_PSSurface, "initialize",
2098
+ cr_ps_surface_initialize, -1);
2099
+ rb_define_method (rb_cCairo_PSSurface, "set_size", cr_ps_surface_set_size, -1);
2100
+ rb_define_method (rb_cCairo_PSSurface, "dsc_comment",
2101
+ cr_ps_surface_dsc_comment, 1);
2102
+ rb_define_method (rb_cCairo_PSSurface, "dsc_begin_setup",
2103
+ cr_ps_surface_dsc_begin_setup, 0);
2104
+ rb_define_method (rb_cCairo_PSSurface, "dsc_begin_page_setup",
2105
+ cr_ps_surface_dsc_begin_page_setup, 0);
2106
+
2107
+ # if CAIRO_CHECK_VERSION(1, 5, 2)
2108
+ rb_define_method (rb_cCairo_PSSurface, "restrict_to_level",
2109
+ cr_ps_surface_restrict_to_level, 1);
2110
+ rb_define_method (rb_cCairo_PSSurface, "eps?", cr_ps_surface_get_eps, 0);
2111
+ rb_define_method (rb_cCairo_PSSurface, "set_eps", cr_ps_surface_set_eps, 1);
2112
+ # endif
2113
+
2114
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_PSSurface);
2115
+ #endif
2116
+
2117
+ /* XLib surface */
2118
+ rb_cCairo_XLibSurface =
2119
+ rb_define_class_under (rb_mCairo, "XLibSurface", rb_cCairo_Surface);
2120
+
2121
+ /* XCB surface */
2122
+ rb_cCairo_XCBSurface =
2123
+ rb_define_class_under (rb_mCairo, "XCBSurface", rb_cCairo_Surface);
2124
+
2125
+ /* Quartz surface */
2126
+ rb_cCairo_QuartzSurface =
2127
+ rb_define_class_under (rb_mCairo, "QuartzSurface", rb_cCairo_Surface);
2128
+ #ifdef RB_CAIRO_HAS_QUARTZ_SURFACE
2129
+ rb_define_method (rb_cCairo_QuartzSurface, "initialize",
2130
+ cr_quartz_surface_initialize, -1);
2131
+ rb_define_method (rb_cCairo_QuartzSurface, "cg_context",
2132
+ cr_quartz_surface_get_cg_context, 0);
2133
+ #endif
2134
+
2135
+ /* Win32 surface */
2136
+ rb_cCairo_Win32Surface =
2137
+ rb_define_class_under (rb_mCairo, "Win32Surface", rb_cCairo_Surface);
2138
+ #ifdef CAIRO_HAS_WIN32_SURFACE
2139
+ rb_define_method (rb_cCairo_Win32Surface, "initialize",
2140
+ cr_win32_surface_initialize, -1);
2141
+ rb_define_method (rb_cCairo_Win32Surface, "hdc",
2142
+ cr_win32_surface_get_hdc, 0);
2143
+ # if CAIRO_CHECK_VERSION(1, 4, 0)
2144
+ rb_define_method (rb_cCairo_Win32Surface, "image",
2145
+ cr_win32_surface_get_image, 0);
2146
+ # endif
2147
+ #endif
2148
+
2149
+ /* SVG surface */
2150
+ rb_cCairo_SVGSurface =
2151
+ rb_define_class_under (rb_mCairo, "SVGSurface", rb_cCairo_Surface);
2152
+ #ifdef CAIRO_HAS_SVG_SURFACE
2153
+ rb_define_method (rb_cCairo_SVGSurface, "initialize",
2154
+ cr_svg_surface_initialize, -1);
2155
+ rb_define_method (rb_cCairo_SVGSurface, "restrict_to_version",
2156
+ cr_svg_surface_restrict_to_version, 1);
2157
+
2158
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_SVGSurface);
2159
+ #endif
2160
+
2161
+ /* Win32 printing surface */
2162
+ rb_cCairo_Win32PrintingSurface =
2163
+ rb_define_class_under (rb_mCairo, "Win32PrintingSurface", rb_cCairo_Surface);
2164
+ #ifdef RB_CAIRO_HAS_WIN32_PRINTING_SURFACE
2165
+ rb_define_method (rb_cCairo_Win32PrintingSurface, "initialize",
2166
+ cr_win32_printing_surface_initialize, -1);
2167
+ rb_define_method (rb_cCairo_Win32PrintingSurface, "hdc",
2168
+ cr_win32_surface_get_hdc, 0);
2169
+ #endif
2170
+
2171
+ /* Quartz image surface */
2172
+ rb_cCairo_QuartzImageSurface =
2173
+ rb_define_class_under (rb_mCairo, "QuartzImageSurface", rb_cCairo_Surface);
2174
+ #ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
2175
+ rb_define_method (rb_cCairo_QuartzImageSurface, "initialize",
2176
+ cr_quartz_image_surface_initialize, 1);
2177
+ rb_define_method (rb_cCairo_QuartzImageSurface, "image",
2178
+ cr_quartz_image_surface_get_image, 0);
2179
+ #endif
2180
+
2181
+ /* script surface */
2182
+ rb_cCairo_ScriptSurface =
2183
+ rb_define_class_under (rb_mCairo, "ScriptSurface", rb_cCairo_Surface);
2184
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
2185
+ rb_define_method (rb_cCairo_ScriptSurface, "initialize",
2186
+ cr_script_surface_initialize, -1);
2187
+
2188
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_ScriptSurface);
2189
+ #endif
2190
+
2191
+ /* Qt surface */
2192
+ rb_cCairo_QtSurface =
2193
+ rb_define_class_under (rb_mCairo, "QtSurface", rb_cCairo_Surface);
2194
+
2195
+ /* recording surface */
2196
+ rb_cCairo_RecordingSurface =
2197
+ rb_define_class_under (rb_mCairo, "RecordingSurface", rb_cCairo_Surface);
2198
+ #ifdef CAIRO_HAS_RECORDING_SURFACE
2199
+ rb_define_method (rb_cCairo_RecordingSurface, "initialize",
2200
+ cr_recording_surface_initialize, -1);
2201
+
2202
+ rb_define_method (rb_cCairo_RecordingSurface, "ink_extents",
2203
+ cr_recording_surface_get_ink_extents, 0);
2204
+ # if CAIRO_CHECK_VERSION(1, 11, 4)
2205
+ rb_define_method (rb_cCairo_RecordingSurface, "extents",
2206
+ cr_recording_surface_get_extents, 0);
2207
+ # endif
2208
+ #endif
2209
+
2210
+ /* VG surface */
2211
+ rb_cCairo_VGSurface =
2212
+ rb_define_class_under (rb_mCairo, "VGSurface", rb_cCairo_Surface);
2213
+
2214
+ /* GL surface */
2215
+ rb_cCairo_GLSurface =
2216
+ rb_define_class_under (rb_mCairo, "GLSurface", rb_cCairo_Surface);
2217
+ rb_cCairo_GLTextureSurface =
2218
+ rb_define_class_under (rb_mCairo, "GLTextureSurface", rb_cCairo_GLSurface);
2219
+ #ifdef RB_CAIRO_HAS_GL_SURFACE
2220
+ rb_define_method (rb_cCairo_GLSurface, "initialize",
2221
+ cr_gl_surface_initialize, 1);
2222
+
2223
+ rb_define_method (rb_cCairo_GLSurface, "set_size",
2224
+ cr_gl_surface_set_size, 2);
2225
+ rb_define_method (rb_cCairo_GLSurface, "width",
2226
+ cr_gl_surface_get_width, 0);
2227
+ rb_define_method (rb_cCairo_GLSurface, "height",
2228
+ cr_gl_surface_get_height, 0);
2229
+ rb_define_method (rb_cCairo_GLSurface, "swap_buffers",
2230
+ cr_gl_surface_swap_buffers, 0);
2231
+
2232
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_GLSurface);
2233
+
2234
+ rb_define_method (rb_cCairo_GLTextureSurface, "initialize",
2235
+ cr_gl_texture_surface_initialize, 1);
2236
+
2237
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_GLTextureSurface);
2238
+ #endif
2239
+
2240
+ /* DRM surface */
2241
+ rb_cCairo_DRMSurface =
2242
+ rb_define_class_under (rb_mCairo, "DRMSurface", rb_cCairo_Surface);
2243
+
2244
+ /* tee surface */
2245
+ rb_cCairo_TeeSurface =
2246
+ rb_define_class_under (rb_mCairo, "TeeSurface", rb_cCairo_Surface);
2247
+ #ifdef CAIRO_HAS_TEE_SURFACE
2248
+ rb_define_method (rb_cCairo_TeeSurface, "initialize",
2249
+ cr_tee_surface_initialize, 1);
2250
+
2251
+ rb_define_method (rb_cCairo_TeeSurface, "add",
2252
+ cr_tee_surface_add, 1);
2253
+ rb_define_method (rb_cCairo_TeeSurface, "<<",
2254
+ cr_tee_surface_shift_operator, 1);
2255
+ rb_define_method (rb_cCairo_TeeSurface, "remove",
2256
+ cr_tee_surface_remove, 1);
2257
+ rb_define_method (rb_cCairo_TeeSurface, "[]",
2258
+ cr_tee_surface_array_reference, 1);
2259
+
2260
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_TeeSurface);
2261
+ #endif
2262
+
2263
+ /* XML surface */
2264
+ rb_cCairo_XMLSurface =
2265
+ rb_define_class_under (rb_mCairo, "XMLSurface", rb_cCairo_Surface);
2266
+ #ifdef CAIRO_HAS_XML_SURFACE
2267
+ rb_define_method (rb_cCairo_XMLSurface, "initialize",
2268
+ cr_xml_surface_initialize, -1);
2269
+
2270
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_XMLSurface);
2271
+ #endif
2272
+
2273
+ /* Skia surface */
2274
+ rb_cCairo_SkiaSurface =
2275
+ rb_define_class_under (rb_mCairo, "SkiaSurface", rb_cCairo_Surface);
2276
+
2277
+ /* sub surface */
2278
+ rb_cCairo_SubSurface =
2279
+ rb_define_class_under (rb_mCairo, "SubSurface", rb_cCairo_Surface);
2280
+
2281
+ /* Cogl surface */
2282
+ rb_cCairo_CoglSurface =
2283
+ rb_define_class_under (rb_mCairo, "CoglSurface", rb_cCairo_Surface);
2284
+ }