cairo 1.8.5-x86-mingw32 → 1.10.0-x86-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 (450) hide show
  1. data/NEWS +2 -2
  2. data/Rakefile +44 -7
  3. data/ext/cairo/cairo.def +28 -1
  4. data/ext/cairo/extconf.rb +14 -16
  5. data/ext/cairo/rb_cairo.c +4 -1
  6. data/ext/cairo/rb_cairo.h +65 -1
  7. data/ext/cairo/rb_cairo_constants.c +150 -3
  8. data/ext/cairo/rb_cairo_context.c +17 -0
  9. data/ext/cairo/rb_cairo_device.c +406 -0
  10. data/ext/cairo/rb_cairo_exception.c +83 -32
  11. data/ext/cairo/rb_cairo_io.c +166 -0
  12. data/ext/cairo/rb_cairo_io.h +44 -0
  13. data/ext/cairo/rb_cairo_matrix.c +1 -1
  14. data/ext/cairo/rb_cairo_private.h +3 -0
  15. data/ext/cairo/rb_cairo_region.c +385 -0
  16. data/ext/cairo/rb_cairo_surface.c +674 -199
  17. data/lib/1.8/cairo.so +0 -0
  18. data/lib/1.9/cairo.so +0 -0
  19. data/samples/blur.rb +2 -3
  20. data/samples/{pac2.rb → pac-nomralize.rb} +5 -6
  21. data/samples/pac-tee.rb +170 -0
  22. data/samples/pac.rb +2 -3
  23. data/samples/png.rb +2 -3
  24. data/samples/scalable.rb +2 -3
  25. data/samples/text-on-path.rb +2 -3
  26. data/samples/text2.rb +2 -3
  27. data/test/cairo-test-utils.rb +15 -0
  28. data/test/run-test.rb +5 -4
  29. data/test/test_context.rb +4 -4
  30. data/test/test_font_face.rb +34 -21
  31. data/test/test_recording_surface.rb +18 -0
  32. data/test/test_region.rb +102 -0
  33. data/test/test_script_device.rb +46 -0
  34. data/test/test_script_surface.rb +13 -0
  35. data/test/test_surface.rb +14 -4
  36. data/test/test_tee_surface.rb +32 -0
  37. data/test/test_xml_device.rb +22 -0
  38. data/test/test_xml_surface.rb +32 -0
  39. data/tmp/i386-mingw32/cairo/1.9.2/rbconfig.rb +1 -1
  40. data/vendor/local/bin/libcairo-2.dll +0 -0
  41. data/vendor/local/include/cairo/cairo-deprecated.h +1 -16
  42. data/vendor/local/include/cairo/cairo-features.h +7 -0
  43. data/vendor/local/include/cairo/cairo-ft.h +16 -9
  44. data/vendor/local/include/cairo/cairo-gobject.h +186 -0
  45. data/vendor/local/include/cairo/cairo-pdf.h +27 -1
  46. data/vendor/local/include/cairo/cairo-ps.h +1 -1
  47. data/vendor/local/include/cairo/cairo-script-interpreter.h +117 -0
  48. data/vendor/local/include/cairo/cairo-svg.h +1 -1
  49. data/vendor/local/include/cairo/cairo-version.h +2 -2
  50. data/vendor/local/include/cairo/cairo-win32.h +1 -1
  51. data/vendor/local/include/cairo/cairo.h +382 -26
  52. data/vendor/local/lib/cairo.def +44 -0
  53. data/vendor/local/lib/cairo.lib +0 -0
  54. data/vendor/local/lib/libcairo.dll.a +0 -0
  55. data/vendor/local/lib/pkgconfig/cairo-fc.pc +12 -0
  56. data/vendor/local/lib/pkgconfig/cairo-ft.pc +4 -4
  57. data/vendor/local/lib/pkgconfig/cairo-gobject.pc +12 -0
  58. data/vendor/local/lib/pkgconfig/cairo-pdf.pc +3 -3
  59. data/vendor/local/lib/pkgconfig/cairo-png.pc +3 -3
  60. data/vendor/local/lib/pkgconfig/cairo-ps.pc +3 -3
  61. data/vendor/local/lib/pkgconfig/cairo-svg.pc +3 -3
  62. data/vendor/local/lib/pkgconfig/cairo-win32-font.pc +3 -3
  63. data/vendor/local/lib/pkgconfig/cairo-win32.pc +3 -3
  64. data/vendor/local/lib/pkgconfig/cairo.pc +4 -4
  65. data/vendor/local/manifest/{cairo-dev_1.8.10-4_win32.mft → cairo-dev_1.10.0-1_win32.mft} +34 -27
  66. data/vendor/local/manifest/cairo_1.10.0-1_win32.mft +5 -0
  67. data/vendor/local/share/doc/{cairo_1.8.10-4_win32 → cairo_1.10.0-1_win32}/COPYING +9 -8
  68. data/vendor/local/share/doc/{cairo_1.8.10-4_win32 → cairo_1.10.0-1_win32}/COPYING-LGPL-2.1 +2 -2
  69. data/vendor/local/share/doc/{cairo_1.8.10-4_win32 → cairo_1.10.0-1_win32}/COPYING-MPL-1.1 +0 -0
  70. data/vendor/local/share/gtk-doc/html/cairo/bindings-errors.html +4 -14
  71. data/vendor/local/share/gtk-doc/html/cairo/bindings-fonts.html +5 -15
  72. data/vendor/local/share/gtk-doc/html/cairo/bindings-memory.html +7 -17
  73. data/vendor/local/share/gtk-doc/html/cairo/bindings-overloading.html +6 -16
  74. data/vendor/local/share/gtk-doc/html/cairo/bindings-path.html +6 -16
  75. data/vendor/local/share/gtk-doc/html/cairo/bindings-patterns.html +23 -28
  76. data/vendor/local/share/gtk-doc/html/cairo/bindings-return-values.html +3 -13
  77. data/vendor/local/share/gtk-doc/html/cairo/bindings-streams.html +3 -13
  78. data/vendor/local/share/gtk-doc/html/cairo/bindings-surfaces.html +7 -17
  79. data/vendor/local/share/gtk-doc/html/cairo/cairo-Error-handling.html +373 -0
  80. data/vendor/local/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +330 -0
  81. data/vendor/local/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +478 -0
  82. data/vendor/local/share/gtk-doc/html/cairo/cairo-PDF-Surfaces.html +344 -0
  83. data/vendor/local/share/gtk-doc/html/cairo/cairo-PNG-Support.html +320 -0
  84. data/vendor/local/share/gtk-doc/html/cairo/cairo-Paths.html +1291 -0
  85. data/vendor/local/share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html +622 -0
  86. data/vendor/local/share/gtk-doc/html/cairo/cairo-Quartz-(CGFont)-Fonts.html +134 -0
  87. data/vendor/local/share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html +210 -0
  88. data/vendor/local/share/gtk-doc/html/cairo/cairo-Regions.html +834 -0
  89. data/vendor/local/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +318 -0
  90. data/vendor/local/share/gtk-doc/html/cairo/cairo-Transformations.html +410 -0
  91. data/vendor/local/share/gtk-doc/html/cairo/cairo-Types.html +169 -0
  92. data/vendor/local/share/gtk-doc/html/cairo/cairo-User-Fonts.html +715 -0
  93. data/vendor/local/share/gtk-doc/html/cairo/cairo-Version-Information.html +410 -0
  94. data/vendor/local/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +335 -0
  95. data/vendor/local/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +291 -0
  96. data/vendor/local/share/gtk-doc/html/cairo/cairo-XLib-Surfaces.html +470 -0
  97. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-device-t.html +595 -0
  98. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +384 -0
  99. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-font-options-t.html +644 -0
  100. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html +574 -0
  101. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-pattern-t.html +1457 -0
  102. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-scaled-font-t.html +1076 -0
  103. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +1396 -0
  104. data/vendor/local/share/gtk-doc/html/cairo/cairo-cairo-t.html +2743 -0
  105. data/vendor/local/share/gtk-doc/html/cairo/cairo-drawing.html +13 -20
  106. data/vendor/local/share/gtk-doc/html/cairo/cairo-fonts.html +13 -23
  107. data/vendor/local/share/gtk-doc/html/cairo/cairo-support.html +11 -21
  108. data/vendor/local/share/gtk-doc/html/cairo/cairo-surfaces.html +19 -26
  109. data/vendor/local/share/gtk-doc/html/cairo/cairo-text.html +279 -326
  110. data/vendor/local/share/gtk-doc/html/cairo/cairo.devhelp +411 -355
  111. data/vendor/local/share/gtk-doc/html/cairo/cairo.devhelp2 +579 -480
  112. data/vendor/local/share/gtk-doc/html/cairo/index-1.10.html +147 -0
  113. data/vendor/local/share/gtk-doc/html/cairo/index-1.2.html +88 -65
  114. data/vendor/local/share/gtk-doc/html/cairo/index-1.4.html +72 -47
  115. data/vendor/local/share/gtk-doc/html/cairo/index-1.6.html +43 -32
  116. data/vendor/local/share/gtk-doc/html/cairo/index-1.8.html +42 -41
  117. data/vendor/local/share/gtk-doc/html/cairo/index-all.html +542 -345
  118. data/vendor/local/share/gtk-doc/html/cairo/index.html +36 -39
  119. data/vendor/local/share/gtk-doc/html/cairo/index.sgml +674 -444
  120. data/vendor/local/share/gtk-doc/html/cairo/language-bindings.html +6 -16
  121. data/vendor/local/share/gtk-doc/html/cairo/style.css +152 -54
  122. data/vendor/local/src/tml/packaging/cairo_1.10.0-1_win32.log +1262 -0
  123. data/vendor/local/src/tml/packaging/{cairo_1.8.10-4_win32.sh → cairo_1.10.0-1_win32.sh} +3 -3
  124. metadata +137 -389
  125. data/doc/doc.css +0 -91
  126. data/doc/en/cairo-antialias.html +0 -38
  127. data/doc/en/cairo-clip-not-representable-error.html +0 -47
  128. data/doc/en/cairo-color-base.html +0 -69
  129. data/doc/en/cairo-color-cmyk.html +0 -157
  130. data/doc/en/cairo-color-hsv.html +0 -137
  131. data/doc/en/cairo-color-rgb.html +0 -142
  132. data/doc/en/cairo-color-x11.html +0 -173
  133. data/doc/en/cairo-color.html +0 -238
  134. data/doc/en/cairo-content.html +0 -37
  135. data/doc/en/cairo-context-blur.html +0 -39
  136. data/doc/en/cairo-context-circle.html +0 -39
  137. data/doc/en/cairo-context-color.html +0 -39
  138. data/doc/en/cairo-context-path.html +0 -44
  139. data/doc/en/cairo-context-rectangle.html +0 -39
  140. data/doc/en/cairo-context-triangle.html +0 -39
  141. data/doc/en/cairo-context.html +0 -643
  142. data/doc/en/cairo-error.html +0 -44
  143. data/doc/en/cairo-extend.html +0 -38
  144. data/doc/en/cairo-file-not-found.html +0 -47
  145. data/doc/en/cairo-fill-rule.html +0 -36
  146. data/doc/en/cairo-filter.html +0 -40
  147. data/doc/en/cairo-font-extents.html +0 -129
  148. data/doc/en/cairo-font-face.html +0 -38
  149. data/doc/en/cairo-font-options.html +0 -139
  150. data/doc/en/cairo-font-slant.html +0 -37
  151. data/doc/en/cairo-font-type-mismatch.html +0 -47
  152. data/doc/en/cairo-font-weight.html +0 -36
  153. data/doc/en/cairo-format.html +0 -46
  154. data/doc/en/cairo-glyph.html +0 -99
  155. data/doc/en/cairo-gradient-pattern.html +0 -74
  156. data/doc/en/cairo-hint-metrics.html +0 -37
  157. data/doc/en/cairo-hint-style.html +0 -39
  158. data/doc/en/cairo-image-surface.html +0 -82
  159. data/doc/en/cairo-invalid-clusters.html +0 -47
  160. data/doc/en/cairo-invalid-content-error.html +0 -47
  161. data/doc/en/cairo-invalid-dash-error.html +0 -47
  162. data/doc/en/cairo-invalid-dsc-comment-error.html +0 -47
  163. data/doc/en/cairo-invalid-format-error.html +0 -47
  164. data/doc/en/cairo-invalid-index-error.html +0 -47
  165. data/doc/en/cairo-invalid-matrix-error.html +0 -47
  166. data/doc/en/cairo-invalid-path-data-error.html +0 -47
  167. data/doc/en/cairo-invalid-pop-group-error.html +0 -47
  168. data/doc/en/cairo-invalid-restore-error.html +0 -47
  169. data/doc/en/cairo-invalid-slant.html +0 -47
  170. data/doc/en/cairo-invalid-status-error.html +0 -47
  171. data/doc/en/cairo-invalid-stride-error.html +0 -47
  172. data/doc/en/cairo-invalid-string-error.html +0 -47
  173. data/doc/en/cairo-invalid-visual-error.html +0 -47
  174. data/doc/en/cairo-invalid-weight.html +0 -47
  175. data/doc/en/cairo-line-cap.html +0 -37
  176. data/doc/en/cairo-line-join.html +0 -37
  177. data/doc/en/cairo-linear-pattern.html +0 -60
  178. data/doc/en/cairo-matrix.html +0 -259
  179. data/doc/en/cairo-negative-count.html +0 -47
  180. data/doc/en/cairo-no-current-point-error.html +0 -47
  181. data/doc/en/cairo-null-pointer-error.html +0 -47
  182. data/doc/en/cairo-operator.html +0 -48
  183. data/doc/en/cairo-paper-parse-error.html +0 -47
  184. data/doc/en/cairo-paper-unknown-paper-name.html +0 -66
  185. data/doc/en/cairo-paper-unknown-unit.html +0 -66
  186. data/doc/en/cairo-paper-unrecognized-paper-description.html +0 -66
  187. data/doc/en/cairo-paper.html +0 -184
  188. data/doc/en/cairo-path-close-path.html +0 -49
  189. data/doc/en/cairo-path-curve-to.html +0 -49
  190. data/doc/en/cairo-path-data-type.html +0 -38
  191. data/doc/en/cairo-path-data.html +0 -98
  192. data/doc/en/cairo-path-line-to.html +0 -49
  193. data/doc/en/cairo-path-move-to.html +0 -49
  194. data/doc/en/cairo-path.html +0 -155
  195. data/doc/en/cairo-pattern-type-mismatch-error.html +0 -47
  196. data/doc/en/cairo-pattern.html +0 -99
  197. data/doc/en/cairo-pdf-surface.html +0 -57
  198. data/doc/en/cairo-point.html +0 -74
  199. data/doc/en/cairo-ps-level.html +0 -49
  200. data/doc/en/cairo-ps-surface.html +0 -92
  201. data/doc/en/cairo-quartz-image-surface.html +0 -57
  202. data/doc/en/cairo-quartz-surface.html +0 -57
  203. data/doc/en/cairo-radial-pattern.html +0 -60
  204. data/doc/en/cairo-read-error.html +0 -47
  205. data/doc/en/cairo-rectangle.html +0 -89
  206. data/doc/en/cairo-scaled-font.html +0 -94
  207. data/doc/en/cairo-solid-pattern.html +0 -62
  208. data/doc/en/cairo-subpixel-order.html +0 -39
  209. data/doc/en/cairo-surface-finished-error.html +0 -47
  210. data/doc/en/cairo-surface-pattern.html +0 -57
  211. data/doc/en/cairo-surface-type-mismatch-error.html +0 -47
  212. data/doc/en/cairo-surface.html +0 -121
  213. data/doc/en/cairo-svg-surface.html +0 -77
  214. data/doc/en/cairo-svg-version.html +0 -49
  215. data/doc/en/cairo-temp-file-error.html +0 -47
  216. data/doc/en/cairo-text-cluster-flag.html +0 -35
  217. data/doc/en/cairo-text-cluster.html +0 -84
  218. data/doc/en/cairo-text-extents.html +0 -144
  219. data/doc/en/cairo-toy-font-face.html +0 -67
  220. data/doc/en/cairo-user-font-error.html +0 -47
  221. data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +0 -94
  222. data/doc/en/cairo-user-font-face.html +0 -72
  223. data/doc/en/cairo-user-font-immutable.html +0 -47
  224. data/doc/en/cairo-win32-printing-surface.html +0 -57
  225. data/doc/en/cairo-win32-surface.html +0 -62
  226. data/doc/en/cairo-write-error.html +0 -47
  227. data/doc/en/cairo.html +0 -131
  228. data/doc/en/index.html +0 -1154
  229. data/doc/index.html +0 -18
  230. data/doc/ja/cairo-antialias.html +0 -57
  231. data/doc/ja/cairo-clip-not-representable-error.html +0 -56
  232. data/doc/ja/cairo-color-base.html +0 -75
  233. data/doc/ja/cairo-color-cmyk.html +0 -152
  234. data/doc/ja/cairo-color-hsv.html +0 -135
  235. data/doc/ja/cairo-color-rgb.html +0 -145
  236. data/doc/ja/cairo-color-x11.html +0 -183
  237. data/doc/ja/cairo-color.html +0 -317
  238. data/doc/ja/cairo-content.html +0 -51
  239. data/doc/ja/cairo-context-blur.html +0 -53
  240. data/doc/ja/cairo-context-circle.html +0 -54
  241. data/doc/ja/cairo-context-color.html +0 -52
  242. data/doc/ja/cairo-context-path.html +0 -77
  243. data/doc/ja/cairo-context-rectangle.html +0 -60
  244. data/doc/ja/cairo-context-triangle.html +0 -47
  245. data/doc/ja/cairo-context.html +0 -1542
  246. data/doc/ja/cairo-error.html +0 -56
  247. data/doc/ja/cairo-extend.html +0 -56
  248. data/doc/ja/cairo-file-not-found.html +0 -51
  249. data/doc/ja/cairo-fill-rule.html +0 -58
  250. data/doc/ja/cairo-filter.html +0 -43
  251. data/doc/ja/cairo-font-extents.html +0 -164
  252. data/doc/ja/cairo-font-face.html +0 -55
  253. data/doc/ja/cairo-font-options.html +0 -189
  254. data/doc/ja/cairo-font-slant.html +0 -50
  255. data/doc/ja/cairo-font-type-mismatch.html +0 -52
  256. data/doc/ja/cairo-font-weight.html +0 -47
  257. data/doc/ja/cairo-format.html +0 -81
  258. data/doc/ja/cairo-glyph.html +0 -115
  259. data/doc/ja/cairo-gradient-pattern.html +0 -119
  260. data/doc/ja/cairo-hint-metrics.html +0 -57
  261. data/doc/ja/cairo-hint-style.html +0 -64
  262. data/doc/ja/cairo-image-surface.html +0 -131
  263. data/doc/ja/cairo-invalid-clusters.html +0 -55
  264. data/doc/ja/cairo-invalid-content-error.html +0 -54
  265. data/doc/ja/cairo-invalid-dash-error.html +0 -54
  266. data/doc/ja/cairo-invalid-dsc-comment-error.html +0 -54
  267. data/doc/ja/cairo-invalid-format-error.html +0 -54
  268. data/doc/ja/cairo-invalid-index-error.html +0 -54
  269. data/doc/ja/cairo-invalid-matrix-error.html +0 -54
  270. data/doc/ja/cairo-invalid-path-data-error.html +0 -54
  271. data/doc/ja/cairo-invalid-pop-group-error.html +0 -54
  272. data/doc/ja/cairo-invalid-restore-error.html +0 -55
  273. data/doc/ja/cairo-invalid-slant.html +0 -57
  274. data/doc/ja/cairo-invalid-status-error.html +0 -55
  275. data/doc/ja/cairo-invalid-stride-error.html +0 -55
  276. data/doc/ja/cairo-invalid-string-error.html +0 -54
  277. data/doc/ja/cairo-invalid-visual-error.html +0 -57
  278. data/doc/ja/cairo-invalid-weight.html +0 -57
  279. data/doc/ja/cairo-line-cap.html +0 -50
  280. data/doc/ja/cairo-line-join.html +0 -53
  281. data/doc/ja/cairo-linear-pattern.html +0 -87
  282. data/doc/ja/cairo-matrix.html +0 -354
  283. data/doc/ja/cairo-negative-count.html +0 -52
  284. data/doc/ja/cairo-no-current-point-error.html +0 -54
  285. data/doc/ja/cairo-null-pointer-error.html +0 -54
  286. data/doc/ja/cairo-operator.html +0 -51
  287. data/doc/ja/cairo-paper-parse-error.html +0 -55
  288. data/doc/ja/cairo-paper-unknown-paper-name.html +0 -76
  289. data/doc/ja/cairo-paper-unknown-unit.html +0 -75
  290. data/doc/ja/cairo-paper-unrecognized-paper-description.html +0 -76
  291. data/doc/ja/cairo-paper.html +0 -357
  292. data/doc/ja/cairo-path-close-path.html +0 -57
  293. data/doc/ja/cairo-path-curve-to.html +0 -70
  294. data/doc/ja/cairo-path-data-type.html +0 -53
  295. data/doc/ja/cairo-path-data.html +0 -127
  296. data/doc/ja/cairo-path-line-to.html +0 -62
  297. data/doc/ja/cairo-path-move-to.html +0 -62
  298. data/doc/ja/cairo-path.html +0 -144
  299. data/doc/ja/cairo-pattern-type-mismatch-error.html +0 -56
  300. data/doc/ja/cairo-pattern.html +0 -128
  301. data/doc/ja/cairo-pdf-surface.html +0 -86
  302. data/doc/ja/cairo-point.html +0 -90
  303. data/doc/ja/cairo-ps-level.html +0 -62
  304. data/doc/ja/cairo-ps-surface.html +0 -214
  305. data/doc/ja/cairo-quartz-image-surface.html +0 -75
  306. data/doc/ja/cairo-quartz-surface.html +0 -93
  307. data/doc/ja/cairo-radial-pattern.html +0 -93
  308. data/doc/ja/cairo-read-error.html +0 -55
  309. data/doc/ja/cairo-rectangle.html +0 -109
  310. data/doc/ja/cairo-scaled-font.html +0 -180
  311. data/doc/ja/cairo-solid-pattern.html +0 -87
  312. data/doc/ja/cairo-subpixel-order.html +0 -57
  313. data/doc/ja/cairo-surface-finished-error.html +0 -54
  314. data/doc/ja/cairo-surface-pattern.html +0 -68
  315. data/doc/ja/cairo-surface-type-mismatch-error.html +0 -56
  316. data/doc/ja/cairo-surface.html +0 -213
  317. data/doc/ja/cairo-svg-surface.html +0 -114
  318. data/doc/ja/cairo-svg-version.html +0 -66
  319. data/doc/ja/cairo-temp-file-error.html +0 -50
  320. data/doc/ja/cairo-text-cluster-flag.html +0 -46
  321. data/doc/ja/cairo-text-cluster.html +0 -102
  322. data/doc/ja/cairo-text-extents.html +0 -163
  323. data/doc/ja/cairo-toy-font-face.html +0 -107
  324. data/doc/ja/cairo-user-font-error.html +0 -55
  325. data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +0 -156
  326. data/doc/ja/cairo-user-font-face.html +0 -268
  327. data/doc/ja/cairo-user-font-immutable.html +0 -54
  328. data/doc/ja/cairo-win32-printing-surface.html +0 -80
  329. data/doc/ja/cairo-win32-surface.html +0 -100
  330. data/doc/ja/cairo-write-error.html +0 -55
  331. data/doc/ja/cairo.html +0 -177
  332. data/doc/ja/index.html +0 -1156
  333. data/pkg-config.rb +0 -313
  334. data/test-unit/Rakefile +0 -30
  335. data/test-unit/bin/testrb +0 -5
  336. data/test-unit/lib/test/unit.rb +0 -280
  337. data/test-unit/lib/test/unit/assertionfailederror.rb +0 -14
  338. data/test-unit/lib/test/unit/assertions.rb +0 -722
  339. data/test-unit/lib/test/unit/attribute.rb +0 -125
  340. data/test-unit/lib/test/unit/autorunner.rb +0 -254
  341. data/test-unit/lib/test/unit/collector.rb +0 -43
  342. data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
  343. data/test-unit/lib/test/unit/collector/dir.rb +0 -108
  344. data/test-unit/lib/test/unit/collector/load.rb +0 -135
  345. data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
  346. data/test-unit/lib/test/unit/color.rb +0 -61
  347. data/test-unit/lib/test/unit/diff.rb +0 -524
  348. data/test-unit/lib/test/unit/error.rb +0 -124
  349. data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
  350. data/test-unit/lib/test/unit/failure.rb +0 -110
  351. data/test-unit/lib/test/unit/fixture.rb +0 -185
  352. data/test-unit/lib/test/unit/notification.rb +0 -125
  353. data/test-unit/lib/test/unit/omission.rb +0 -143
  354. data/test-unit/lib/test/unit/pending.rb +0 -146
  355. data/test-unit/lib/test/unit/priority.rb +0 -146
  356. data/test-unit/lib/test/unit/runner/console.rb +0 -46
  357. data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
  358. data/test-unit/lib/test/unit/testcase.rb +0 -281
  359. data/test-unit/lib/test/unit/testresult.rb +0 -89
  360. data/test-unit/lib/test/unit/testsuite.rb +0 -110
  361. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
  362. data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -195
  363. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -49
  364. data/test-unit/lib/test/unit/ui/testrunner.rb +0 -20
  365. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
  366. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
  367. data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -41
  368. data/test-unit/lib/test/unit/util/observable.rb +0 -90
  369. data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
  370. data/test-unit/lib/test/unit/version.rb +0 -7
  371. data/test-unit/sample/adder.rb +0 -13
  372. data/test-unit/sample/subtracter.rb +0 -12
  373. data/test-unit/sample/tc_adder.rb +0 -18
  374. data/test-unit/sample/tc_subtracter.rb +0 -18
  375. data/test-unit/sample/ts_examples.rb +0 -7
  376. data/test-unit/test/collector/test_descendant.rb +0 -135
  377. data/test-unit/test/collector/test_dir.rb +0 -406
  378. data/test-unit/test/collector/test_load.rb +0 -333
  379. data/test-unit/test/collector/test_objectspace.rb +0 -98
  380. data/test-unit/test/run-test.rb +0 -13
  381. data/test-unit/test/test_assertions.rb +0 -693
  382. data/test-unit/test/test_attribute.rb +0 -86
  383. data/test-unit/test/test_color.rb +0 -37
  384. data/test-unit/test/test_diff.rb +0 -477
  385. data/test-unit/test/test_emacs_runner.rb +0 -60
  386. data/test-unit/test/test_error.rb +0 -26
  387. data/test-unit/test/test_failure.rb +0 -33
  388. data/test-unit/test/test_fixture.rb +0 -252
  389. data/test-unit/test/test_notification.rb +0 -33
  390. data/test-unit/test/test_omission.rb +0 -81
  391. data/test-unit/test/test_pending.rb +0 -70
  392. data/test-unit/test/test_priority.rb +0 -89
  393. data/test-unit/test/test_testcase.rb +0 -430
  394. data/test-unit/test/test_testresult.rb +0 -113
  395. data/test-unit/test/test_testsuite.rb +0 -129
  396. data/test-unit/test/testunit_test_util.rb +0 -14
  397. data/test-unit/test/ui/test_testrunmediator.rb +0 -20
  398. data/test-unit/test/util/test_backtracefilter.rb +0 -41
  399. data/test-unit/test/util/test_observable.rb +0 -102
  400. data/test-unit/test/util/test_procwrapper.rb +0 -36
  401. data/test/test_pkg_config.rb +0 -123
  402. data/vendor/local/include/libpng14/png.h +0 -2701
  403. data/vendor/local/include/libpng14/pngconf.h +0 -1525
  404. data/vendor/local/include/png.h +0 -2701
  405. data/vendor/local/include/pngconf.h +0 -1525
  406. data/vendor/local/include/zconf.h +0 -461
  407. data/vendor/local/include/zlib.h +0 -1589
  408. data/vendor/local/lib/libpng.def +0 -192
  409. data/vendor/local/lib/libpng.lib +0 -0
  410. data/vendor/local/lib/libpng14.dll.a +0 -0
  411. data/vendor/local/lib/libz.dll.a +0 -0
  412. data/vendor/local/lib/pkgconfig/libpng.pc +0 -11
  413. data/vendor/local/lib/pkgconfig/libpng14.pc +0 -11
  414. data/vendor/local/lib/zdll.lib +0 -0
  415. data/vendor/local/lib/zlib.def +0 -67
  416. data/vendor/local/manifest/cairo_1.8.10-4_win32.mft +0 -5
  417. data/vendor/local/manifest/libpng-dev_1.4.3-1_win32.mft +0 -15
  418. data/vendor/local/manifest/zlib-dev_1.2.5-2_win32.mft +0 -8
  419. data/vendor/local/share/gtk-doc/html/cairo/cairo-context.html +0 -2643
  420. data/vendor/local/share/gtk-doc/html/cairo/cairo-error-status.html +0 -360
  421. data/vendor/local/share/gtk-doc/html/cairo/cairo-font-face.html +0 -408
  422. data/vendor/local/share/gtk-doc/html/cairo/cairo-font-options.html +0 -678
  423. data/vendor/local/share/gtk-doc/html/cairo/cairo-ft-font.html +0 -319
  424. data/vendor/local/share/gtk-doc/html/cairo/cairo-image-surface.html +0 -473
  425. data/vendor/local/share/gtk-doc/html/cairo/cairo-matrix.html +0 -596
  426. data/vendor/local/share/gtk-doc/html/cairo/cairo-paths.html +0 -1274
  427. data/vendor/local/share/gtk-doc/html/cairo/cairo-pattern.html +0 -1485
  428. data/vendor/local/share/gtk-doc/html/cairo/cairo-pdf-surface.html +0 -238
  429. data/vendor/local/share/gtk-doc/html/cairo/cairo-png-functions.html +0 -341
  430. data/vendor/local/share/gtk-doc/html/cairo/cairo-ps-surface.html +0 -622
  431. data/vendor/local/share/gtk-doc/html/cairo/cairo-quartz-font.html +0 -151
  432. data/vendor/local/share/gtk-doc/html/cairo/cairo-quartz-surface.html +0 -219
  433. data/vendor/local/share/gtk-doc/html/cairo/cairo-scaled-font.html +0 -1023
  434. data/vendor/local/share/gtk-doc/html/cairo/cairo-surface.html +0 -1026
  435. data/vendor/local/share/gtk-doc/html/cairo/cairo-svg-surface.html +0 -321
  436. data/vendor/local/share/gtk-doc/html/cairo/cairo-transformations.html +0 -436
  437. data/vendor/local/share/gtk-doc/html/cairo/cairo-types.html +0 -133
  438. data/vendor/local/share/gtk-doc/html/cairo/cairo-user-font.html +0 -735
  439. data/vendor/local/share/gtk-doc/html/cairo/cairo-version-info.html +0 -345
  440. data/vendor/local/share/gtk-doc/html/cairo/cairo-win32-font.html +0 -358
  441. data/vendor/local/share/gtk-doc/html/cairo/cairo-win32-surface.html +0 -312
  442. data/vendor/local/share/gtk-doc/html/cairo/cairo-xlib-surface.html +0 -492
  443. data/vendor/local/share/man/man3/libpng.3 +0 -4455
  444. data/vendor/local/share/man/man3/libpngpf.3 +0 -808
  445. data/vendor/local/share/man/man5/png.5 +0 -74
  446. data/vendor/local/src/tml/packaging/cairo_1.8.10-4_win32.log +0 -920
  447. data/vendor/local/src/tml/packaging/libpng_1.4.3-1_win32.log +0 -272
  448. data/vendor/local/src/tml/packaging/libpng_1.4.3-1_win32.sh +0 -71
  449. data/vendor/local/src/tml/packaging/zlib_1.2.5-2_win32.log +0 -42
  450. data/vendor/local/src/tml/packaging/zlib_1.2.5-2_win32.sh +0 -189
@@ -5,6 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-11-01 14:23:14 $
7
7
  *
8
+ * Copyright 2005-2010 Kouhei Sutou <kou@cozmixng.org>
8
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
10
11
  *
@@ -14,6 +15,7 @@
14
15
 
15
16
  #include "rb_cairo.h"
16
17
  #include "rb_cairo_private.h"
18
+ #include "rb_cairo_io.h"
17
19
 
18
20
  #ifdef HAVE_RUBY_ST_H
19
21
  # include <ruby/st.h>
@@ -44,14 +46,17 @@ enum ruby_value_type {
44
46
  # define T_DATA RUBY_T_DATA
45
47
  #endif
46
48
 
47
- #if defined(CAIRO_HAS_PS_SURFACE) || \
48
- defined(CAIRO_HAS_PDF_SURFACE) || \
49
- defined(CAIRO_HAS_SVG_SURFACE)
50
- # define HAS_CREATE_CR_CLOSURE_SURFACE 1
51
- #else
52
- # define HAS_CREATE_CR_CLOSURE_SURFACE 0
49
+ #ifdef CAIRO_HAS_XML_SURFACE
50
+ # include <cairo-xml.h>
51
+ #endif
52
+
53
+ #ifdef CAIRO_HAS_TEE_SURFACE
54
+ # include <cairo-tee.h>
53
55
  #endif
54
56
 
57
+ #ifdef CAIRO_HAS_GL_SURFACE
58
+ # include <cairo-gl.h>
59
+ #endif
55
60
 
56
61
  VALUE rb_cCairo_Surface;
57
62
  VALUE rb_cCairo_ImageSurface;
@@ -62,11 +67,18 @@ VALUE rb_cCairo_Win32Surface = Qnil;
62
67
  VALUE rb_cCairo_Win32PrintingSurface = Qnil;
63
68
  VALUE rb_cCairo_QuartzSurface = Qnil;
64
69
  VALUE rb_cCairo_QuartzImageSurface = Qnil;
70
+ VALUE rb_cCairo_ScriptSurface = Qnil;
71
+ VALUE rb_cCairo_QtSurface = Qnil;
72
+ VALUE rb_cCairo_RecordingSurface = Qnil;
73
+ VALUE rb_cCairo_VGSurface = Qnil;
74
+ VALUE rb_cCairo_GLSurface = Qnil;
75
+ VALUE rb_cCairo_GLTextureSurface = Qnil;
76
+ VALUE rb_cCairo_DRMSurface = Qnil;
77
+ VALUE rb_cCairo_TeeSurface = Qnil;
78
+ VALUE rb_cCairo_XMLSurface = Qnil;
79
+ VALUE rb_cCairo_SkiaSurface = Qnil;
80
+ VALUE rb_cCairo_SubSurface = Qnil;
65
81
 
66
- static ID cr_id_target;
67
- static ID cr_id_read;
68
- static ID cr_id_write;
69
- static ID cr_id_inspect;
70
82
  static ID cr_id_parse;
71
83
  static ID cr_id_size;
72
84
  static ID cr_id_set_unit;
@@ -135,6 +147,38 @@ cr_surface_get_klass (cairo_surface_t *surface)
135
147
  case CAIRO_SURFACE_TYPE_QUARTZ_IMAGE:
136
148
  klass = rb_cCairo_QuartzImageSurface;
137
149
  break;
150
+ #endif
151
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
152
+ case CAIRO_SURFACE_TYPE_SCRIPT:
153
+ klass = rb_cCairo_ScriptSurface;
154
+ break;
155
+ case CAIRO_SURFACE_TYPE_QT:
156
+ klass = rb_cCairo_QtSurface;
157
+ break;
158
+ case CAIRO_SURFACE_TYPE_RECORDING:
159
+ klass = rb_cCairo_RecordingSurface;
160
+ break;
161
+ case CAIRO_SURFACE_TYPE_VG:
162
+ klass = rb_cCairo_VGSurface;
163
+ break;
164
+ case CAIRO_SURFACE_TYPE_GL:
165
+ klass = rb_cCairo_GLSurface;
166
+ break;
167
+ case CAIRO_SURFACE_TYPE_DRM:
168
+ klass = rb_cCairo_DRMSurface;
169
+ break;
170
+ case CAIRO_SURFACE_TYPE_TEE:
171
+ klass = rb_cCairo_TeeSurface;
172
+ break;
173
+ case CAIRO_SURFACE_TYPE_XML:
174
+ klass = rb_cCairo_XMLSurface;
175
+ break;
176
+ case CAIRO_SURFACE_TYPE_SKIA:
177
+ klass = rb_cCairo_SkiaSurface;
178
+ break;
179
+ case CAIRO_SURFACE_TYPE_SUBSURFACE:
180
+ klass = rb_cCairo_SubSurface;
181
+ break;
138
182
  #endif
139
183
  default:
140
184
  klass = rb_cCairo_Surface;
@@ -147,166 +191,6 @@ cr_surface_get_klass (cairo_surface_t *surface)
147
191
  return klass;
148
192
  }
149
193
 
150
- static char *
151
- inspect (VALUE object)
152
- {
153
- VALUE inspected;
154
- inspected = rb_funcall (object, cr_id_inspect, 0);
155
- return StringValueCStr(inspected);
156
- }
157
-
158
- /* read/write callback */
159
- typedef struct cr_io_callback_closure {
160
- VALUE target;
161
- VALUE error;
162
- unsigned char *data;
163
- unsigned int length;
164
- } cr_io_callback_closure_t;
165
-
166
- typedef struct cr_invoke_data {
167
- cr_callback_func_t func;
168
- VALUE data;
169
- } cr_invoke_data_t;
170
-
171
- #if HAS_CREATE_CR_CLOSURE_SURFACE
172
- static cr_io_callback_closure_t *
173
- cr_closure_new (VALUE target)
174
- {
175
- cr_io_callback_closure_t *closure;
176
- closure = ALLOC (cr_io_callback_closure_t);
177
-
178
- closure->target = target;
179
- closure->error = Qnil;
180
-
181
- return closure;
182
- }
183
-
184
- static void
185
- cr_closure_destroy (cr_io_callback_closure_t *closure)
186
- {
187
- xfree (closure);
188
- }
189
-
190
- static void
191
- cr_closure_free (void *closure)
192
- {
193
- cr_closure_destroy ((cr_io_callback_closure_t *) closure);
194
- }
195
- #endif
196
-
197
- static VALUE
198
- cr_surface_io_func_rescue (VALUE io_closure)
199
- {
200
- cr_io_callback_closure_t *closure;
201
- closure = (cr_io_callback_closure_t *)io_closure;
202
- closure->error = RB_ERRINFO;
203
- return Qnil;
204
- }
205
-
206
- static VALUE
207
- cr_surface_invoke_io_func (VALUE user_data)
208
- {
209
- cr_invoke_data_t *data;
210
-
211
- data = (cr_invoke_data_t *)user_data;
212
- return rb_rescue2 (data->func, data->data,
213
- cr_surface_io_func_rescue, data->data, rb_eException,
214
- (VALUE)0);
215
- }
216
-
217
- /* write callback */
218
- static VALUE
219
- cr_surface_write_func_invoke (VALUE write_closure)
220
- {
221
- VALUE output, data;
222
- long written_bytes;
223
- cr_io_callback_closure_t *closure;
224
- unsigned int length;
225
-
226
- closure = (cr_io_callback_closure_t *)write_closure;
227
-
228
- output = closure->target;
229
- data = rb_str_new ((const char *)closure->data, closure->length);
230
-
231
- length = RSTRING_LEN (data);
232
- while (length != 0)
233
- {
234
- VALUE rb_written_bytes = rb_funcall (output, cr_id_write, 1, data);
235
- written_bytes = NUM2LONG (rb_written_bytes);
236
- data = rb_str_substr (data, written_bytes,
237
- RSTRING_LEN (data) - written_bytes);
238
- length -= written_bytes;
239
- }
240
-
241
- return Qnil;
242
- }
243
-
244
- static cairo_status_t
245
- cr_surface_write_func (void *write_closure,
246
- const unsigned char *data, unsigned int length)
247
- {
248
- cr_io_callback_closure_t *closure;
249
- cr_invoke_data_t invoke_data;
250
-
251
- closure = (cr_io_callback_closure_t *)write_closure;
252
- closure->data = (unsigned char *)data;
253
- closure->length = length;
254
-
255
- invoke_data.func = cr_surface_write_func_invoke;
256
- invoke_data.data = (VALUE)closure;
257
- rb_cairo__invoke_callback (cr_surface_invoke_io_func, (VALUE)&invoke_data);
258
-
259
- if (NIL_P (closure->error))
260
- return CAIRO_STATUS_SUCCESS;
261
- else
262
- return CAIRO_STATUS_WRITE_ERROR;
263
- }
264
-
265
- /* read callback */
266
- static VALUE
267
- cr_surface_read_func_invoke (VALUE read_closure)
268
- {
269
- VALUE input, result;
270
- cr_io_callback_closure_t *closure;
271
- unsigned int length, rest;
272
-
273
- closure = (cr_io_callback_closure_t *)read_closure;
274
- input = closure->target;
275
- length = closure->length;
276
-
277
- result = rb_str_new2 ("");
278
-
279
- for (rest = length; rest != 0; rest = length - RSTRING_LEN (result))
280
- {
281
- rb_str_concat (result, rb_funcall (input, cr_id_read, 1, INT2NUM (rest)));
282
- }
283
-
284
- memcpy ((void *)closure->data, (const void *)StringValuePtr (result), length);
285
-
286
- return Qnil;
287
- }
288
-
289
- static cairo_status_t
290
- cr_surface_read_func (void *read_closure,
291
- unsigned char *data, unsigned int length)
292
- {
293
- cr_io_callback_closure_t *closure;
294
- cr_invoke_data_t invoke_data;
295
-
296
- closure = (cr_io_callback_closure_t *)read_closure;
297
- closure->data = data;
298
- closure->length = length;
299
-
300
- invoke_data.func = cr_surface_read_func_invoke;
301
- invoke_data.data = (VALUE)closure;
302
- rb_cairo__invoke_callback (cr_surface_invoke_io_func, (VALUE)&invoke_data);
303
-
304
- if (NIL_P (closure->error))
305
- return CAIRO_STATUS_SUCCESS;
306
- else
307
- return CAIRO_STATUS_READ_ERROR;
308
- }
309
-
310
194
  /* constructor/de-constructor */
311
195
  cairo_surface_t *
312
196
  rb_cairo_surface_from_ruby_object (VALUE obj)
@@ -394,7 +278,7 @@ static VALUE
394
278
  cr_surface_finish (VALUE self)
395
279
  {
396
280
  cairo_surface_t *surface;
397
- cr_io_callback_closure_t *closure;
281
+ rb_cairo__io_callback_closure_t *closure;
398
282
 
399
283
  surface = _SELF;
400
284
  closure = cairo_surface_get_user_data (surface, &cr_closure_key);
@@ -423,17 +307,72 @@ yield_and_finish (VALUE self)
423
307
  }
424
308
 
425
309
  static VALUE
426
- cr_surface_create_similar (VALUE self, VALUE content, VALUE width, VALUE height)
310
+ cr_surface_create_similar (int argc, VALUE *argv, VALUE self)
311
+ {
312
+ cairo_surface_t *surface, *similar_surface;
313
+ cairo_content_t content;
314
+ int width, height;
315
+ VALUE arg1, arg2, arg3;
316
+
317
+ rb_scan_args (argc, argv, "21", &arg1, &arg2, &arg3);
318
+
319
+ surface = _SELF;
320
+ if (argc == 2)
321
+ {
322
+ content = cairo_surface_get_content (surface);
323
+ width = NUM2INT (arg1);
324
+ height = NUM2INT (arg2);
325
+ }
326
+ else
327
+ {
328
+ content = RVAL2CRCONTENT (arg1);
329
+ width = NUM2INT (arg2);
330
+ height = NUM2INT (arg3);
331
+ }
332
+
333
+ similar_surface = cairo_surface_create_similar (surface, content,
334
+ width, height);
335
+ cr_surface_check_status (similar_surface);
336
+ return CRSURFACE2RVAL_WITH_DESTROY (similar_surface);
337
+ }
338
+
339
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
340
+ static VALUE
341
+ cr_surface_destroy_with_destroy_check (VALUE self)
342
+ {
343
+ if (DATA_PTR (self))
344
+ cr_surface_destroy (self);
345
+ return Qnil;
346
+ }
347
+
348
+ static VALUE
349
+ cr_surface_create_sub_rectangle_surface (VALUE self, VALUE x, VALUE y,
350
+ VALUE width, VALUE height)
427
351
  {
352
+ VALUE rb_surface;
428
353
  cairo_surface_t *surface;
429
354
 
430
- surface = cairo_surface_create_similar (RVAL2CRSURFACE (self),
431
- RVAL2CRCONTENT (content),
432
- NUM2INT (width), NUM2INT (height));
355
+ surface = cairo_surface_create_for_rectangle (RVAL2CRSURFACE (self),
356
+ NUM2DBL (x),
357
+ NUM2DBL (y),
358
+ NUM2DBL (width),
359
+ NUM2INT (height));
433
360
  cr_surface_check_status (surface);
434
- return CRSURFACE2RVAL_WITH_DESTROY (surface);
361
+ rb_surface = CRSURFACE2RVAL_WITH_DESTROY (surface);
362
+ if (rb_block_given_p ())
363
+ return rb_ensure (rb_yield, rb_surface,
364
+ cr_surface_destroy_with_destroy_check, rb_surface);
365
+ else
366
+ return rb_surface;
435
367
  }
436
368
 
369
+ static VALUE
370
+ cr_surface_get_device (VALUE self)
371
+ {
372
+ return CRDEVICE2RVAL (cairo_surface_get_device (_SELF));
373
+ }
374
+ #endif
375
+
437
376
  static VALUE
438
377
  cr_surface_get_content (VALUE self)
439
378
  {
@@ -446,12 +385,13 @@ static VALUE
446
385
  cr_surface_write_to_png_stream (VALUE self, VALUE target)
447
386
  {
448
387
  cairo_status_t status;
449
- cr_io_callback_closure_t closure;
388
+ rb_cairo__io_callback_closure_t closure;
450
389
 
451
390
  closure.target = target;
452
391
  closure.error = Qnil;
453
392
 
454
- status = cairo_surface_write_to_png_stream (_SELF, cr_surface_write_func,
393
+ status = cairo_surface_write_to_png_stream (_SELF,
394
+ rb_cairo__io_write_func,
455
395
  (void *)&closure);
456
396
  if (!NIL_P (closure.error))
457
397
  rb_exc_raise (closure.error);
@@ -472,13 +412,63 @@ cr_surface_write_to_png (VALUE self, VALUE filename)
472
412
  static VALUE
473
413
  cr_surface_write_to_png_generic (VALUE self, VALUE target)
474
414
  {
475
- if (rb_respond_to (target, cr_id_write))
415
+ if (rb_respond_to (target, rb_cairo__io_id_write))
476
416
  return cr_surface_write_to_png_stream (self, target);
477
417
  else
478
418
  return cr_surface_write_to_png (self, target);
479
419
  }
480
420
  #endif
481
421
 
422
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
423
+ static VALUE
424
+ cr_surface_get_mime_data (VALUE self, VALUE mime_type)
425
+ {
426
+ cairo_surface_t *surface;
427
+ const unsigned char *data;
428
+ unsigned long length;
429
+
430
+ surface = _SELF;
431
+ cairo_surface_get_mime_data (surface, StringValueCStr (mime_type),
432
+ &data, &length);
433
+ if (data)
434
+ return rb_str_new ((const char *)data, length);
435
+ else
436
+ return Qnil;
437
+ }
438
+
439
+ static VALUE
440
+ cr_surface_set_mime_data (VALUE self, VALUE rb_mime_type, VALUE rb_data)
441
+ {
442
+ cairo_status_t status;
443
+ cairo_surface_t *surface;
444
+ const char *mime_type;
445
+
446
+ surface = _SELF;
447
+ mime_type = StringValueCStr (rb_mime_type);
448
+ if (NIL_P (rb_data))
449
+ {
450
+ status = cairo_surface_set_mime_data (surface, mime_type,
451
+ NULL, 0, NULL, NULL);
452
+ }
453
+ else
454
+ {
455
+ const char *raw_data;
456
+ unsigned char *data;
457
+ unsigned long length;
458
+
459
+ raw_data = StringValuePtr (rb_data);
460
+ length = RSTRING_LEN (rb_data);
461
+ data = xmalloc (length);
462
+ memcpy (data, raw_data, length);
463
+ status = cairo_surface_set_mime_data (surface, mime_type,
464
+ data, length,
465
+ xfree, data);
466
+ }
467
+ rb_cairo_check_status (status);
468
+ return Qnil;
469
+ }
470
+ #endif
471
+
482
472
  static VALUE
483
473
  cr_surface_get_font_options (VALUE self)
484
474
  {
@@ -528,7 +518,7 @@ cr_surface_mark_dirty (int argc, VALUE *argv, VALUE self)
528
518
 
529
519
  rb_raise (rb_eArgError,
530
520
  "invalid argument (expect () or (x, y, width, height)): %s",
531
- inspect (args));
521
+ rb_cairo__inspect (args));
532
522
  }
533
523
 
534
524
  cr_surface_check_status (_SELF);
@@ -607,17 +597,17 @@ cr_surface_show_page (VALUE self)
607
597
  static cairo_surface_t *
608
598
  cr_image_surface_create_from_png_stream (VALUE target)
609
599
  {
610
- cr_io_callback_closure_t closure;
600
+ rb_cairo__io_callback_closure_t closure;
611
601
  cairo_surface_t *surface;
612
602
 
613
603
  closure.target = target;
614
604
  closure.error = Qnil;
615
605
 
616
- surface = cairo_image_surface_create_from_png_stream (cr_surface_read_func,
606
+ surface = cairo_image_surface_create_from_png_stream (rb_cairo__io_read_func,
617
607
  (void *)&closure);
618
608
  if (!NIL_P (closure.error))
619
609
  rb_exc_raise (closure.error);
620
-
610
+
621
611
  return surface;
622
612
  }
623
613
 
@@ -633,7 +623,7 @@ cr_image_surface_create_from_png_generic (VALUE klass, VALUE target)
633
623
  VALUE rb_surface;
634
624
  cairo_surface_t *surface;
635
625
 
636
- if (rb_respond_to (target, cr_id_read))
626
+ if (rb_respond_to (target, rb_cairo__io_id_read))
637
627
  surface = cr_image_surface_create_from_png_stream (target);
638
628
  else
639
629
  surface = cr_image_surface_create_from_png (target);
@@ -692,7 +682,7 @@ cr_image_surface_initialize (int argc, VALUE *argv, VALUE self)
692
682
  "(width, height) or "
693
683
  "(format, width, height) or "
694
684
  "(data, format, width, height, stride)): %s",
695
- inspect (rb_ary_new3 (4, arg1, arg2, arg3, arg4)));
685
+ rb_cairo__inspect (rb_ary_new3 (4, arg1, arg2, arg3, arg4)));
696
686
 
697
687
  cr_surface_check_status (surface);
698
688
  DATA_PTR (self) = surface;
@@ -742,6 +732,74 @@ cr_image_surface_get_stride (VALUE self)
742
732
  return INT2NUM (cairo_image_surface_get_stride (_SELF));
743
733
  }
744
734
 
735
+ #ifdef CAIRO_HAS_RECORDING_SURFACE
736
+ /* Recording-surface functions */
737
+ static VALUE
738
+ cr_recording_surface_initialize (int argc, VALUE *argv, VALUE self)
739
+ {
740
+ VALUE arg1, arg2, arg3, arg4, arg5;
741
+ cairo_surface_t *surface;
742
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
743
+ cairo_rectangle_t extents;
744
+ const char *error_message =
745
+ "invalid argument (expect "
746
+ "(x, y, width, height), "
747
+ "([x, y, width, height]),"
748
+ "(x, y, width, height, content) or "
749
+ "([x, y, width, height], content)): %s";
750
+
751
+ rb_scan_args (argc, argv, "14", &arg1, &arg2, &arg3, &arg4, &arg5);
752
+ if (argc == 1 || argc == 2)
753
+ {
754
+ VALUE rb_extents;
755
+
756
+ rb_extents = rb_check_array_type (arg1);
757
+ if (RARRAY_LEN (rb_extents) != 4)
758
+ rb_raise (rb_eArgError, error_message, rb_cairo__inspect (arg1));
759
+ extents.x = NUM2DBL (RARRAY_PTR (rb_extents)[0]);
760
+ extents.y = NUM2DBL (RARRAY_PTR (rb_extents)[1]);
761
+ extents.width = NUM2DBL (RARRAY_PTR (rb_extents)[2]);
762
+ extents.height = NUM2DBL (RARRAY_PTR (rb_extents)[3]);
763
+ if (!NIL_P (arg2))
764
+ content = RVAL2CRCONTENT (arg2);
765
+ }
766
+ else if (argc == 4 || argc == 5)
767
+ {
768
+ extents.x = NUM2DBL (arg1);
769
+ extents.y = NUM2DBL (arg2);
770
+ extents.width = NUM2DBL (arg3);
771
+ extents.height = NUM2DBL (arg4);
772
+ if (!NIL_P (arg5))
773
+ content = RVAL2CRCONTENT (arg5);
774
+ }
775
+ else
776
+ {
777
+ rb_raise (rb_eArgError, error_message,
778
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
779
+ }
780
+
781
+ surface = cairo_recording_surface_create (content, &extents);
782
+ cr_surface_check_status (surface);
783
+ DATA_PTR (self) = surface;
784
+ if (rb_block_given_p ())
785
+ yield_and_finish (self);
786
+ return Qnil;
787
+ }
788
+
789
+ static VALUE
790
+ cr_recording_surface_get_ink_extents (VALUE self)
791
+ {
792
+ cairo_surface_t *surface;
793
+ double x, y, width, height;
794
+
795
+ surface = _SELF;
796
+ cairo_recording_surface_ink_extents (surface, &x, &y, &width, &height);
797
+ cr_surface_check_status (surface);
798
+ return rb_ary_new3 (4,
799
+ rb_float_new (x), rb_float_new (y),
800
+ rb_float_new (width), rb_float_new (height));
801
+ }
802
+ #endif
745
803
 
746
804
  /* Printing surfaces */
747
805
  #define DEFINE_SURFACE(type) \
@@ -772,29 +830,30 @@ cr_ ## type ## _surface_initialize (int argc, VALUE *argv, VALUE self) \
772
830
  width_in_points = NUM2DBL (rb_width_in_points); \
773
831
  height_in_points = NUM2DBL (rb_height_in_points); \
774
832
  \
775
- if (rb_respond_to (target, cr_id_write)) \
833
+ if (rb_respond_to (target, rb_cairo__io_id_write)) \
776
834
  { \
777
- cr_io_callback_closure_t *closure; \
835
+ rb_cairo__io_callback_closure_t *closure; \
778
836
  \
779
- closure = cr_closure_new (target); \
837
+ closure = rb_cairo__io_closure_new (target); \
780
838
  surface = \
781
839
  cairo_ ## type ## _surface_create_for_stream ( \
782
- cr_surface_write_func, \
840
+ rb_cairo__io_write_func, \
783
841
  (void *) closure, \
784
842
  width_in_points, \
785
843
  height_in_points); \
786
844
  \
787
845
  if (cairo_surface_status (surface)) \
788
846
  { \
789
- cr_closure_destroy (closure); \
847
+ rb_cairo__io_closure_destroy (closure); \
790
848
  } \
791
849
  else \
792
850
  { \
793
- rb_ivar_set (self, cr_id_target, target); \
851
+ rb_ivar_set (self, rb_cairo__io_id_output, target); \
794
852
  cairo_surface_set_user_data (surface, &cr_closure_key, \
795
- closure, cr_closure_free); \
853
+ closure, \
854
+ rb_cairo__io_closure_free); \
796
855
  cairo_surface_set_user_data (surface, &cr_object_holder_key, \
797
- cr_object_holder_new(self), \
856
+ cr_object_holder_new (self), \
798
857
  cr_object_holder_free); \
799
858
  } \
800
859
  } \
@@ -907,6 +966,16 @@ cr_ps_surface_set_eps (VALUE self, VALUE eps)
907
966
  /* PDF-surface functions */
908
967
  DEFINE_SURFACE(pdf)
909
968
  DEFINE_SURFACE_SET_SIZE(pdf)
969
+
970
+ # if CAIRO_CHECK_VERSION(1, 10, 0)
971
+ static VALUE
972
+ cr_pdf_surface_restrict_to_version (VALUE self, VALUE version)
973
+ {
974
+ cairo_pdf_surface_restrict_to_version (_SELF, RVAL2CRPDFVERSION (version));
975
+ cr_surface_check_status (_SELF);
976
+ return Qnil;
977
+ }
978
+ # endif
910
979
  #endif
911
980
 
912
981
  #ifdef CAIRO_HAS_SVG_SURFACE
@@ -1111,7 +1180,7 @@ cr_quartz_surface_initialize (int argc, VALUE *argv, VALUE self)
1111
1180
  "(width, height), "
1112
1181
  "(format, width, height) or "
1113
1182
  "(cg_context, width, height)): %s",
1114
- inspect (rb_ary_new3 (3, arg1, arg2, arg3)));
1183
+ rb_cairo__inspect (rb_ary_new3 (3, arg1, arg2, arg3)));
1115
1184
  break;
1116
1185
  }
1117
1186
 
@@ -1179,6 +1248,321 @@ cr_quartz_image_surface_get_image (VALUE self)
1179
1248
  # endif
1180
1249
  #endif
1181
1250
 
1251
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
1252
+ static VALUE
1253
+ cr_script_surface_initialize (int argc, VALUE *argv, VALUE self)
1254
+ {
1255
+ cairo_surface_t *surface = NULL, *target = NULL;
1256
+ cairo_device_t *device;
1257
+ double width = 0.0, height = 0.0;
1258
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1259
+ VALUE arg1, arg2, arg3, arg4;
1260
+
1261
+ rb_scan_args (argc, argv, "22", &arg1, &arg2, &arg3, &arg4);
1262
+
1263
+ device = RVAL2CRDEVICE (arg1);
1264
+ if (argc == 2)
1265
+ {
1266
+ target = RVAL2CRSURFACE (arg2);
1267
+ }
1268
+ else
1269
+ {
1270
+ width = NUM2DBL (arg2);
1271
+ height = NUM2DBL (arg3);
1272
+ switch (TYPE (arg4))
1273
+ {
1274
+ case T_NIL:
1275
+ break;
1276
+ case T_STRING:
1277
+ case T_SYMBOL:
1278
+ case T_FIXNUM:
1279
+ content = RVAL2CRCONTENT (arg4);
1280
+ break;
1281
+ default:
1282
+ rb_raise (rb_eArgError,
1283
+ "invalid argument (expect "
1284
+ "(device, width, height), "
1285
+ "(device, width, height, content) or "
1286
+ "(device, surface)): %s",
1287
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1288
+ break;
1289
+ }
1290
+ }
1291
+
1292
+ if (target)
1293
+ surface = cairo_script_surface_create_for_target (device, target);
1294
+ else
1295
+ surface = cairo_script_surface_create (device, content, width, height);
1296
+
1297
+ cr_surface_check_status (surface);
1298
+ DATA_PTR (self) = surface;
1299
+ if (rb_block_given_p ())
1300
+ yield_and_finish (self);
1301
+ return Qnil;
1302
+ }
1303
+ #endif
1304
+
1305
+ #ifdef CAIRO_HAS_XML_SURFACE
1306
+ static VALUE
1307
+ cr_xml_surface_initialize (int argc, VALUE *argv, VALUE self)
1308
+ {
1309
+ cairo_surface_t *surface;
1310
+ cairo_device_t *device;
1311
+ double width, height;
1312
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1313
+ VALUE rb_device, rb_width, rb_height, rb_content;
1314
+
1315
+ rb_scan_args (argc, argv, "31",
1316
+ &rb_device, &rb_width, &rb_height, &rb_content);
1317
+
1318
+ device = RVAL2CRDEVICE (rb_device);
1319
+ width = NUM2DBL (rb_width);
1320
+ height = NUM2DBL (rb_height);
1321
+ switch (TYPE (rb_content))
1322
+ {
1323
+ case T_NIL:
1324
+ break;
1325
+ case T_STRING:
1326
+ case T_SYMBOL:
1327
+ case T_FIXNUM:
1328
+ content = RVAL2CRCONTENT (rb_content);
1329
+ break;
1330
+ default:
1331
+ rb_raise (rb_eArgError,
1332
+ "invalid argument (expect "
1333
+ "(device, width, height) or "
1334
+ "(device, width, height, content)): %s",
1335
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1336
+ break;
1337
+ }
1338
+
1339
+ surface = cairo_xml_surface_create (device, content, width, height);
1340
+
1341
+ cr_surface_check_status (surface);
1342
+ DATA_PTR (self) = surface;
1343
+ if (rb_block_given_p ())
1344
+ yield_and_finish (self);
1345
+ return Qnil;
1346
+ }
1347
+ #endif
1348
+
1349
+ #ifdef CAIRO_HAS_TEE_SURFACE
1350
+ static VALUE
1351
+ cr_tee_surface_initialize (VALUE self, VALUE master)
1352
+ {
1353
+ cairo_surface_t *surface = NULL;
1354
+
1355
+ surface = cairo_tee_surface_create (RVAL2CRSURFACE (master));
1356
+ cr_surface_check_status (surface);
1357
+ DATA_PTR (self) = surface;
1358
+ rb_iv_set (self, "surfaces", rb_ary_new3 (1, master));
1359
+ if (rb_block_given_p ())
1360
+ yield_and_finish (self);
1361
+ return Qnil;
1362
+ }
1363
+
1364
+ static VALUE
1365
+ cr_tee_surface_add (VALUE self, VALUE target)
1366
+ {
1367
+ cairo_surface_t *surface = NULL;
1368
+
1369
+ surface = _SELF;
1370
+ cairo_tee_surface_add (surface, RVAL2CRSURFACE (target));
1371
+ cr_surface_check_status (surface);
1372
+ rb_ary_push (rb_iv_get (self, "surfaces"), target);
1373
+ return Qnil;
1374
+ }
1375
+
1376
+ static VALUE
1377
+ cr_tee_surface_shift_operator (VALUE self, VALUE target)
1378
+ {
1379
+ cr_tee_surface_add (self, target);
1380
+ return self;
1381
+ }
1382
+
1383
+ static VALUE
1384
+ cr_tee_surface_remove (VALUE self, VALUE target_or_index)
1385
+ {
1386
+ cairo_surface_t *surface = NULL, *target;
1387
+ VALUE rb_surfaces;
1388
+ int i;
1389
+
1390
+ surface = _SELF;
1391
+ if (rb_cairo__is_kind_of (target_or_index, rb_cCairo_Surface))
1392
+ {
1393
+ target = RVAL2CRSURFACE (target_or_index);
1394
+ }
1395
+ else
1396
+ {
1397
+ VALUE index;
1398
+
1399
+ index = rb_check_to_integer (target_or_index, "to_int");
1400
+ if (NIL_P (index))
1401
+ rb_raise (rb_eArgError,
1402
+ "invalid argument (expect (surface) or (index)): %s",
1403
+ rb_cairo__inspect (target_or_index));
1404
+ target = cairo_tee_surface_index (surface, NUM2INT (index));
1405
+ }
1406
+ cairo_tee_surface_remove (surface, target);
1407
+ cr_surface_check_status (surface);
1408
+
1409
+ rb_surfaces = rb_iv_get (self, "surfaces");
1410
+ for (i = 0; i < RARRAY_LEN (rb_surfaces); i++)
1411
+ {
1412
+ VALUE rb_marked_surface;
1413
+ cairo_surface_t *marked_surface;
1414
+
1415
+ rb_marked_surface = RARRAY_PTR (rb_surfaces)[i];
1416
+ marked_surface = RVAL2CRSURFACE (rb_marked_surface);
1417
+ if (marked_surface == target)
1418
+ {
1419
+ rb_ary_delete (rb_surfaces, rb_marked_surface);
1420
+ break;
1421
+ }
1422
+ }
1423
+
1424
+ return Qnil;
1425
+ }
1426
+
1427
+ static VALUE
1428
+ cr_tee_surface_array_reference (VALUE self, VALUE index)
1429
+ {
1430
+ cairo_surface_t *surface = NULL, *target;
1431
+
1432
+ surface = _SELF;
1433
+ index = rb_Integer (index);
1434
+ target = cairo_tee_surface_index (surface, NUM2INT (index));
1435
+ cr_surface_check_status (surface);
1436
+ cr_surface_check_status (target);
1437
+ return CRSURFACE2RVAL (target);
1438
+ }
1439
+ #endif
1440
+
1441
+ #ifdef CAIRO_HAS_GL_SURFACE
1442
+ static VALUE
1443
+ cr_gl_surface_initialize (int argc, VALUE *argv, VALUE self)
1444
+ {
1445
+ cairo_surface_t *surface;
1446
+ cairo_device_t *device;
1447
+ int width, height;
1448
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1449
+ VALUE rb_device, rb_width, rb_height, rb_content;
1450
+
1451
+ rb_scan_args (argc, argv, "31",
1452
+ &rb_device, &rb_width, &rb_height, &rb_content);
1453
+
1454
+ device = RVAL2CRDEVICE (rb_device);
1455
+ width = NUM2INT (rb_width);
1456
+ height = NUM2INT (rb_height);
1457
+ switch (TYPE (rb_content))
1458
+ {
1459
+ case T_NIL:
1460
+ break;
1461
+ case T_STRING:
1462
+ case T_SYMBOL:
1463
+ case T_FIXNUM:
1464
+ content = RVAL2CRCONTENT (rb_content);
1465
+ break;
1466
+ default:
1467
+ rb_raise (rb_eArgError,
1468
+ "invalid argument (expect "
1469
+ "(device, width, height) or "
1470
+ "(device, width, height, content)): %s",
1471
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1472
+ break;
1473
+ }
1474
+
1475
+ surface = cairo_gl_surface_create (device, content, width, height);
1476
+
1477
+ cr_surface_check_status (surface);
1478
+ DATA_PTR (self) = surface;
1479
+ if (rb_block_given_p ())
1480
+ yield_and_finish (self);
1481
+ return Qnil;
1482
+ }
1483
+
1484
+ static VALUE
1485
+ cr_gl_texture_surface_initialize (int argc, VALUE *argv, VALUE self)
1486
+ {
1487
+ cairo_surface_t *surface;
1488
+ cairo_device_t *device;
1489
+ unsigned int texture;
1490
+ int width, height;
1491
+ cairo_content_t content = CAIRO_CONTENT_COLOR_ALPHA;
1492
+ VALUE rb_device, rb_texture, rb_width, rb_height, rb_content;
1493
+
1494
+ rb_scan_args (argc, argv, "41",
1495
+ &rb_device, &rb_texture, &rb_width, &rb_height, &rb_content);
1496
+
1497
+ device = RVAL2CRDEVICE (rb_device);
1498
+ texture = NUM2UINT (rb_texture);
1499
+ width = NUM2INT (rb_width);
1500
+ height = NUM2INT (rb_height);
1501
+ switch (TYPE (rb_content))
1502
+ {
1503
+ case T_NIL:
1504
+ break;
1505
+ case T_STRING:
1506
+ case T_SYMBOL:
1507
+ case T_FIXNUM:
1508
+ content = RVAL2CRCONTENT (rb_content);
1509
+ break;
1510
+ default:
1511
+ rb_raise (rb_eArgError,
1512
+ "invalid argument (expect "
1513
+ "(device, texture, width, height) or "
1514
+ "(device, texture, width, height, content)): %s",
1515
+ rb_cairo__inspect (rb_ary_new4 (argc, argv)));
1516
+ break;
1517
+ }
1518
+
1519
+ surface = cairo_gl_surface_create_for_texture (device, content,
1520
+ texture,
1521
+ width,
1522
+ height);
1523
+
1524
+ cr_surface_check_status (surface);
1525
+ DATA_PTR (self) = surface;
1526
+ if (rb_block_given_p ())
1527
+ yield_and_finish (self);
1528
+ return Qnil;
1529
+ }
1530
+
1531
+ static VALUE
1532
+ cr_gl_surface_set_size (VALUE self, VALUE width, VALUE height)
1533
+ {
1534
+ cairo_surface_t *surface = NULL;
1535
+
1536
+ surface = _SELF;
1537
+ cairo_gl_surface_set_size (surface, NUM2INT (width), NUM2INT (height));
1538
+ cr_surface_check_status (surface);
1539
+ return Qnil;
1540
+ }
1541
+
1542
+ static VALUE
1543
+ cr_gl_surface_get_width (VALUE self)
1544
+ {
1545
+ return INT2NUM (cairo_gl_surface_get_width (_SELF));
1546
+ }
1547
+
1548
+ static VALUE
1549
+ cr_gl_surface_get_height (VALUE self)
1550
+ {
1551
+ return INT2NUM (cairo_gl_surface_get_height (_SELF));
1552
+ }
1553
+
1554
+ static VALUE
1555
+ cr_gl_surface_swap_buffers (VALUE self)
1556
+ {
1557
+ cairo_surface_t *surface = NULL;
1558
+
1559
+ surface = _SELF;
1560
+ cairo_gl_surface_swapbuffers (surface);
1561
+ cr_surface_check_status (surface);
1562
+ return Qnil;
1563
+ }
1564
+ #endif
1565
+
1182
1566
  static int
1183
1567
  cr_finish_all_guarded_surfaces_at_end_iter (VALUE key, VALUE value, VALUE data)
1184
1568
  {
@@ -1197,10 +1581,6 @@ cr_finish_all_guarded_surfaces_at_end (VALUE data)
1197
1581
  void
1198
1582
  Init_cairo_surface (void)
1199
1583
  {
1200
- cr_id_target = rb_intern ("target");
1201
- cr_id_read = rb_intern ("read");
1202
- cr_id_write = rb_intern ("write");
1203
- cr_id_inspect = rb_intern ("inspect");
1204
1584
  cr_id_parse = rb_intern ("parse");
1205
1585
  cr_id_size = rb_intern ("size");
1206
1586
  cr_id_set_unit = rb_intern ("unit=");
@@ -1214,11 +1594,24 @@ Init_cairo_surface (void)
1214
1594
 
1215
1595
 
1216
1596
  rb_define_method (rb_cCairo_Surface, "create_similar",
1217
- cr_surface_create_similar, 3);
1597
+ cr_surface_create_similar, -1);
1598
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
1599
+ rb_define_method (rb_cCairo_Surface, "sub_rectangle_surface",
1600
+ cr_surface_create_sub_rectangle_surface, 4);
1601
+ rb_define_method (rb_cCairo_Surface, "device",
1602
+ cr_surface_get_device, 0);
1603
+ #endif
1218
1604
  rb_define_method (rb_cCairo_Surface, "destroy", cr_surface_destroy, 0);
1219
1605
  rb_define_method (rb_cCairo_Surface, "finish", cr_surface_finish, 0);
1220
1606
  rb_define_method (rb_cCairo_Surface, "content", cr_surface_get_content, 0);
1221
1607
 
1608
+ #if CAIRO_CHECK_VERSION(1, 10, 0)
1609
+ rb_define_method (rb_cCairo_Surface, "get_mime_data",
1610
+ cr_surface_get_mime_data, 1);
1611
+ rb_define_method (rb_cCairo_Surface, "set_mime_data",
1612
+ cr_surface_set_mime_data, 2);
1613
+ #endif
1614
+
1222
1615
  rb_define_method (rb_cCairo_Surface, "font_options",
1223
1616
  cr_surface_get_font_options, 0);
1224
1617
  rb_define_method (rb_cCairo_Surface, "flush", cr_surface_flush, 0);
@@ -1270,6 +1663,18 @@ Init_cairo_surface (void)
1270
1663
  rb_define_method (rb_cCairo_ImageSurface, "stride",
1271
1664
  cr_image_surface_get_stride, 0);
1272
1665
 
1666
+ #ifdef CAIRO_HAS_RECORDING_SURFACE
1667
+ /* Recording-surface */
1668
+ rb_cCairo_RecordingSurface =
1669
+ rb_define_class_under (rb_mCairo, "RecordingSurface", rb_cCairo_Surface);
1670
+
1671
+ rb_define_method (rb_cCairo_RecordingSurface, "initialize",
1672
+ cr_recording_surface_initialize, -1);
1673
+
1674
+ rb_define_method (rb_cCairo_RecordingSurface, "ink_extents",
1675
+ cr_recording_surface_get_ink_extents, 0);
1676
+ #endif
1677
+
1273
1678
  #define INIT_SURFACE(type, name) \
1274
1679
  rb_cCairo_ ## name ## Surface = \
1275
1680
  rb_define_class_under (rb_mCairo, # name "Surface", \
@@ -1307,6 +1712,11 @@ Init_cairo_surface (void)
1307
1712
  rb_define_method (rb_cCairo_PDFSurface, "set_size",
1308
1713
  cr_pdf_surface_set_size, -1);
1309
1714
 
1715
+ # if CAIRO_CHECK_VERSION(1, 10, 0)
1716
+ rb_define_method (rb_cCairo_PDFSurface, "restrict_to_version",
1717
+ cr_pdf_surface_restrict_to_version, 1);
1718
+ # endif
1719
+
1310
1720
  RB_CAIRO_DEF_SETTERS (rb_cCairo_PDFSurface);
1311
1721
  #endif
1312
1722
 
@@ -1366,6 +1776,71 @@ Init_cairo_surface (void)
1366
1776
  rb_define_method (rb_cCairo_QuartzImageSurface, "image",
1367
1777
  cr_quartz_image_surface_get_image, 0);
1368
1778
  # endif
1779
+ #endif
1780
+
1781
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
1782
+ rb_cCairo_ScriptSurface =
1783
+ rb_define_class_under (rb_mCairo, "ScriptSurface", rb_cCairo_Surface);
1784
+
1785
+ rb_define_method (rb_cCairo_ScriptSurface, "initialize",
1786
+ cr_script_surface_initialize, -1);
1787
+
1788
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_ScriptSurface);
1789
+ #endif
1790
+
1791
+ #ifdef CAIRO_HAS_XML_SURFACE
1792
+ rb_cCairo_XMLSurface =
1793
+ rb_define_class_under (rb_mCairo, "XMLSurface", rb_cCairo_Surface);
1794
+
1795
+ rb_define_method (rb_cCairo_XMLSurface, "initialize",
1796
+ cr_xml_surface_initialize, -1);
1797
+
1798
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_XMLSurface);
1799
+ #endif
1800
+
1801
+ #ifdef CAIRO_HAS_TEE_SURFACE
1802
+ rb_cCairo_TeeSurface =
1803
+ rb_define_class_under (rb_mCairo, "TeeSurface", rb_cCairo_Surface);
1804
+
1805
+ rb_define_method (rb_cCairo_TeeSurface, "initialize",
1806
+ cr_tee_surface_initialize, 1);
1807
+
1808
+ rb_define_method (rb_cCairo_TeeSurface, "add",
1809
+ cr_tee_surface_add, 1);
1810
+ rb_define_method (rb_cCairo_TeeSurface, "<<",
1811
+ cr_tee_surface_shift_operator, 1);
1812
+ rb_define_method (rb_cCairo_TeeSurface, "remove",
1813
+ cr_tee_surface_remove, 1);
1814
+ rb_define_method (rb_cCairo_TeeSurface, "[]",
1815
+ cr_tee_surface_array_reference, 1);
1816
+
1817
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_TeeSurface);
1818
+ #endif
1819
+
1820
+ #ifdef CAIRO_HAS_GL_SURFACE
1821
+ rb_cCairo_GLSurface =
1822
+ rb_define_class_under (rb_mCairo, "GLSurface", rb_cCairo_Surface);
1823
+
1824
+ rb_define_method (rb_cCairo_GLSurface, "initialize",
1825
+ cr_gl_surface_initialize, 1);
1826
+
1827
+ rb_define_method (rb_cCairo_GLSurface, "set_size",
1828
+ cr_gl_surface_set_size, 2);
1829
+ rb_define_method (rb_cCairo_GLSurface, "width",
1830
+ cr_gl_surface_get_width, 0);
1831
+ rb_define_method (rb_cCairo_GLSurface, "height",
1832
+ cr_gl_surface_get_height, 0);
1833
+ rb_define_method (rb_cCairo_GLSurface, "swap_buffers",
1834
+ cr_gl_surface_swap_buffers, 0);
1835
+
1836
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_GLSurface);
1837
+
1838
+ rb_cCairo_GLTextureSurface =
1839
+ rb_define_class_under (rb_mCairo, "GLTextureSurface", rb_cCairo_GLSurface);
1840
+
1841
+ rb_define_method (rb_cCairo_GLTextureSurface, "initialize",
1842
+ cr_gl_texture_surface_initialize, 1);
1369
1843
 
1844
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_GLTextureSurface);
1370
1845
  #endif
1371
1846
  }