cairo 1.6.1-x86-mswin32

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 (418) hide show
  1. data/AUTHORS +4 -0
  2. data/COPYING +59 -0
  3. data/ChangeLog +1320 -0
  4. data/GPL +340 -0
  5. data/NEWS +98 -0
  6. data/README +70 -0
  7. data/Rakefile +215 -0
  8. data/cairo/bin/libcairo-2.dll +0 -0
  9. data/cairo/bin/libpng13.dll +0 -0
  10. data/cairo/bin/zlib1.dll +0 -0
  11. data/cairo/include/cairo/cairo-deprecated.h +142 -0
  12. data/cairo/include/cairo/cairo-features.h +35 -0
  13. data/cairo/include/cairo/cairo-pdf.h +68 -0
  14. data/cairo/include/cairo/cairo-ps.h +114 -0
  15. data/cairo/include/cairo/cairo-svg.h +82 -0
  16. data/cairo/include/cairo/cairo-win32.h +104 -0
  17. data/cairo/include/cairo/cairo.h +1945 -0
  18. data/cairo/include/libpng13/png.h +3419 -0
  19. data/cairo/include/libpng13/pngconf.h +1437 -0
  20. data/cairo/lib/cairo.def +251 -0
  21. data/cairo/lib/cairo.lib +0 -0
  22. data/cairo/lib/libcairo.dll.a +0 -0
  23. data/cairo/lib/libpng.def +372 -0
  24. data/cairo/lib/libpng13.dll.a +0 -0
  25. data/cairo/lib/pkgconfig/cairo-pdf.pc +12 -0
  26. data/cairo/lib/pkgconfig/cairo-png.pc +12 -0
  27. data/cairo/lib/pkgconfig/cairo-ps.pc +12 -0
  28. data/cairo/lib/pkgconfig/cairo-svg.pc +12 -0
  29. data/cairo/lib/pkgconfig/cairo-win32-font.pc +12 -0
  30. data/cairo/lib/pkgconfig/cairo-win32.pc +12 -0
  31. data/cairo/lib/pkgconfig/cairo.pc +13 -0
  32. data/cairo/lib/pkgconfig/libpng.pc +14 -0
  33. data/cairo/lib/pkgconfig/libpng13.pc +14 -0
  34. data/cairo/make/cairo-1.6.4-1.sh +55 -0
  35. data/cairo/manifest/cairo-1.6.4-1.mft +6 -0
  36. data/cairo/manifest/cairo-dev-1.6.4-1.mft +72 -0
  37. data/cairo/manifest/libpng-dev-1.2.8.mft +7 -0
  38. data/cairo/share/doc/cairo-1.6.4-1/COPYING +32 -0
  39. data/cairo/share/doc/cairo-1.6.4-1/COPYING-LGPL-2.1 +510 -0
  40. data/cairo/share/doc/cairo-1.6.4-1/COPYING-MPL-1.1 +470 -0
  41. data/cairo/share/gtk-doc/html/cairo/Drawing.html +53 -0
  42. data/cairo/share/gtk-doc/html/cairo/Fonts.html +56 -0
  43. data/cairo/share/gtk-doc/html/cairo/Support.html +50 -0
  44. data/cairo/share/gtk-doc/html/cairo/Surfaces.html +65 -0
  45. data/cairo/share/gtk-doc/html/cairo/bindings-errors.html +128 -0
  46. data/cairo/share/gtk-doc/html/cairo/bindings-fonts.html +59 -0
  47. data/cairo/share/gtk-doc/html/cairo/bindings-memory.html +129 -0
  48. data/cairo/share/gtk-doc/html/cairo/bindings-overloading.html +127 -0
  49. data/cairo/share/gtk-doc/html/cairo/bindings-path.html +123 -0
  50. data/cairo/share/gtk-doc/html/cairo/bindings-patterns.html +63 -0
  51. data/cairo/share/gtk-doc/html/cairo/bindings-return-values.html +126 -0
  52. data/cairo/share/gtk-doc/html/cairo/bindings-streams.html +98 -0
  53. data/cairo/share/gtk-doc/html/cairo/bindings-surfaces.html +99 -0
  54. data/cairo/share/gtk-doc/html/cairo/cairo-Error-Handling.html +328 -0
  55. data/cairo/share/gtk-doc/html/cairo/cairo-Font-Options.html +720 -0
  56. data/cairo/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +297 -0
  57. data/cairo/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +484 -0
  58. data/cairo/share/gtk-doc/html/cairo/cairo-PDF-Surfaces.html +246 -0
  59. data/cairo/share/gtk-doc/html/cairo/cairo-PNG-Support.html +345 -0
  60. data/cairo/share/gtk-doc/html/cairo/cairo-Paths.html +1336 -0
  61. data/cairo/share/gtk-doc/html/cairo/cairo-Patterns.html +1560 -0
  62. data/cairo/share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html +656 -0
  63. data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html +161 -0
  64. data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html +232 -0
  65. data/cairo/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +337 -0
  66. data/cairo/share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html +823 -0
  67. data/cairo/share/gtk-doc/html/cairo/cairo-Text.html +836 -0
  68. data/cairo/share/gtk-doc/html/cairo/cairo-Transformations.html +462 -0
  69. data/cairo/share/gtk-doc/html/cairo/cairo-Types.html +143 -0
  70. data/cairo/share/gtk-doc/html/cairo/cairo-Version-Information.html +325 -0
  71. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +381 -0
  72. data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +331 -0
  73. data/cairo/share/gtk-doc/html/cairo/cairo-XLib-Surfaces.html +525 -0
  74. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +427 -0
  75. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html +626 -0
  76. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +995 -0
  77. data/cairo/share/gtk-doc/html/cairo/cairo-cairo-t.html +2795 -0
  78. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp +432 -0
  79. data/cairo/share/gtk-doc/html/cairo/cairo.devhelp2 +432 -0
  80. data/cairo/share/gtk-doc/html/cairo/home.png +0 -0
  81. data/cairo/share/gtk-doc/html/cairo/index-1.2.html +137 -0
  82. data/cairo/share/gtk-doc/html/cairo/index-1.4.html +105 -0
  83. data/cairo/share/gtk-doc/html/cairo/index-1.6.html +65 -0
  84. data/cairo/share/gtk-doc/html/cairo/index.html +134 -0
  85. data/cairo/share/gtk-doc/html/cairo/index.sgml +466 -0
  86. data/cairo/share/gtk-doc/html/cairo/ix01.html +693 -0
  87. data/cairo/share/gtk-doc/html/cairo/language-bindings.html +79 -0
  88. data/cairo/share/gtk-doc/html/cairo/left.png +0 -0
  89. data/cairo/share/gtk-doc/html/cairo/right.png +0 -0
  90. data/cairo/share/gtk-doc/html/cairo/style.css +148 -0
  91. data/cairo/share/gtk-doc/html/cairo/up.png +0 -0
  92. data/doc/doc.css +91 -0
  93. data/doc/en/cairo-antialias.html +41 -0
  94. data/doc/en/cairo-antialias.rd +16 -0
  95. data/doc/en/cairo-clip-not-representable-error.html +50 -0
  96. data/doc/en/cairo-clip-not-representable-error.rd +17 -0
  97. data/doc/en/cairo-color-base.html +72 -0
  98. data/doc/en/cairo-color-base.rd +38 -0
  99. data/doc/en/cairo-color-cmyk.html +160 -0
  100. data/doc/en/cairo-color-cmyk.rd +107 -0
  101. data/doc/en/cairo-color-hsv.html +140 -0
  102. data/doc/en/cairo-color-hsv.rd +91 -0
  103. data/doc/en/cairo-color-rgb.html +145 -0
  104. data/doc/en/cairo-color-rgb.rd +95 -0
  105. data/doc/en/cairo-color-x11.html +176 -0
  106. data/doc/en/cairo-color-x11.rd +151 -0
  107. data/doc/en/cairo-color.html +241 -0
  108. data/doc/en/cairo-color.rd +213 -0
  109. data/doc/en/cairo-content.html +40 -0
  110. data/doc/en/cairo-content.rd +15 -0
  111. data/doc/en/cairo-context-blur.html +42 -0
  112. data/doc/en/cairo-context-blur.rd +15 -0
  113. data/doc/en/cairo-context-circle.html +42 -0
  114. data/doc/en/cairo-context-circle.rd +15 -0
  115. data/doc/en/cairo-context-color.html +42 -0
  116. data/doc/en/cairo-context-color.rd +15 -0
  117. data/doc/en/cairo-context-path.html +47 -0
  118. data/doc/en/cairo-context-path.rd +19 -0
  119. data/doc/en/cairo-context-rectangle.html +42 -0
  120. data/doc/en/cairo-context-rectangle.rd +15 -0
  121. data/doc/en/cairo-context-triangle.html +42 -0
  122. data/doc/en/cairo-context-triangle.rd +15 -0
  123. data/doc/en/cairo-context.html +636 -0
  124. data/doc/en/cairo-context.rd +491 -0
  125. data/doc/en/cairo-error.html +47 -0
  126. data/doc/en/cairo-error.rd +16 -0
  127. data/doc/en/cairo-extend.html +41 -0
  128. data/doc/en/cairo-extend.rd +16 -0
  129. data/doc/en/cairo-file-not-found.html +50 -0
  130. data/doc/en/cairo-file-not-found.rd +17 -0
  131. data/doc/en/cairo-fill-rule.html +39 -0
  132. data/doc/en/cairo-fill-rule.rd +14 -0
  133. data/doc/en/cairo-filter.html +43 -0
  134. data/doc/en/cairo-filter.rd +18 -0
  135. data/doc/en/cairo-font-extents.html +74 -0
  136. data/doc/en/cairo-font-extents.rd +40 -0
  137. data/doc/en/cairo-font-face.html +41 -0
  138. data/doc/en/cairo-font-face.rd +14 -0
  139. data/doc/en/cairo-font-options.html +142 -0
  140. data/doc/en/cairo-font-options.rd +94 -0
  141. data/doc/en/cairo-font-slant.html +40 -0
  142. data/doc/en/cairo-font-slant.rd +15 -0
  143. data/doc/en/cairo-font-weight.html +39 -0
  144. data/doc/en/cairo-font-weight.rd +14 -0
  145. data/doc/en/cairo-format.html +49 -0
  146. data/doc/en/cairo-format.rd +22 -0
  147. data/doc/en/cairo-glyph.html +102 -0
  148. data/doc/en/cairo-glyph.rd +62 -0
  149. data/doc/en/cairo-gradient-pattern.html +77 -0
  150. data/doc/en/cairo-gradient-pattern.rd +41 -0
  151. data/doc/en/cairo-hint-metrics.html +40 -0
  152. data/doc/en/cairo-hint-metrics.rd +15 -0
  153. data/doc/en/cairo-hint-style.html +42 -0
  154. data/doc/en/cairo-hint-style.rd +17 -0
  155. data/doc/en/cairo-image-surface.html +85 -0
  156. data/doc/en/cairo-image-surface.rd +47 -0
  157. data/doc/en/cairo-invalid-content-error.html +50 -0
  158. data/doc/en/cairo-invalid-content-error.rd +17 -0
  159. data/doc/en/cairo-invalid-dash-error.html +50 -0
  160. data/doc/en/cairo-invalid-dash-error.rd +17 -0
  161. data/doc/en/cairo-invalid-dsc-comment-error.html +50 -0
  162. data/doc/en/cairo-invalid-dsc-comment-error.rd +17 -0
  163. data/doc/en/cairo-invalid-format-error.html +50 -0
  164. data/doc/en/cairo-invalid-format-error.rd +17 -0
  165. data/doc/en/cairo-invalid-index-error.html +50 -0
  166. data/doc/en/cairo-invalid-index-error.rd +17 -0
  167. data/doc/en/cairo-invalid-matrix-error.html +50 -0
  168. data/doc/en/cairo-invalid-matrix-error.rd +17 -0
  169. data/doc/en/cairo-invalid-path-data-error.html +50 -0
  170. data/doc/en/cairo-invalid-path-data-error.rd +17 -0
  171. data/doc/en/cairo-invalid-pop-group-error.html +50 -0
  172. data/doc/en/cairo-invalid-pop-group-error.rd +17 -0
  173. data/doc/en/cairo-invalid-restore-error.html +50 -0
  174. data/doc/en/cairo-invalid-restore-error.rd +17 -0
  175. data/doc/en/cairo-invalid-status-error.html +50 -0
  176. data/doc/en/cairo-invalid-status-error.rd +17 -0
  177. data/doc/en/cairo-invalid-stride-error.html +50 -0
  178. data/doc/en/cairo-invalid-stride-error.rd +17 -0
  179. data/doc/en/cairo-invalid-string-error.html +50 -0
  180. data/doc/en/cairo-invalid-string-error.rd +17 -0
  181. data/doc/en/cairo-invalid-visual-error.html +50 -0
  182. data/doc/en/cairo-invalid-visual-error.rd +17 -0
  183. data/doc/en/cairo-line-cap.html +40 -0
  184. data/doc/en/cairo-line-cap.rd +15 -0
  185. data/doc/en/cairo-line-join.html +40 -0
  186. data/doc/en/cairo-line-join.rd +15 -0
  187. data/doc/en/cairo-linear-pattern.html +63 -0
  188. data/doc/en/cairo-linear-pattern.rd +28 -0
  189. data/doc/en/cairo-matrix.html +257 -0
  190. data/doc/en/cairo-matrix.rd +186 -0
  191. data/doc/en/cairo-no-current-point-error.html +50 -0
  192. data/doc/en/cairo-no-current-point-error.rd +17 -0
  193. data/doc/en/cairo-null-pointer-error.html +50 -0
  194. data/doc/en/cairo-null-pointer-error.rd +17 -0
  195. data/doc/en/cairo-operator.html +51 -0
  196. data/doc/en/cairo-operator.rd +26 -0
  197. data/doc/en/cairo-paper-parse-error.html +50 -0
  198. data/doc/en/cairo-paper-parse-error.rd +17 -0
  199. data/doc/en/cairo-paper-unknown-paper-name.html +69 -0
  200. data/doc/en/cairo-paper-unknown-paper-name.rd +30 -0
  201. data/doc/en/cairo-paper-unknown-unit.html +69 -0
  202. data/doc/en/cairo-paper-unknown-unit.rd +30 -0
  203. data/doc/en/cairo-paper-unrecognized-paper-description.html +69 -0
  204. data/doc/en/cairo-paper-unrecognized-paper-description.rd +30 -0
  205. data/doc/en/cairo-paper.html +187 -0
  206. data/doc/en/cairo-paper.rd +141 -0
  207. data/doc/en/cairo-path-close-path.html +52 -0
  208. data/doc/en/cairo-path-close-path.rd +21 -0
  209. data/doc/en/cairo-path-curve-to.html +52 -0
  210. data/doc/en/cairo-path-curve-to.rd +21 -0
  211. data/doc/en/cairo-path-data-type.html +41 -0
  212. data/doc/en/cairo-path-data-type.rd +16 -0
  213. data/doc/en/cairo-path-data.html +101 -0
  214. data/doc/en/cairo-path-data.rd +62 -0
  215. data/doc/en/cairo-path-line-to.html +52 -0
  216. data/doc/en/cairo-path-line-to.rd +21 -0
  217. data/doc/en/cairo-path-move-to.html +52 -0
  218. data/doc/en/cairo-path-move-to.rd +21 -0
  219. data/doc/en/cairo-path.html +158 -0
  220. data/doc/en/cairo-path.rd +109 -0
  221. data/doc/en/cairo-pattern-type-mismatch-error.html +50 -0
  222. data/doc/en/cairo-pattern-type-mismatch-error.rd +17 -0
  223. data/doc/en/cairo-pattern.html +102 -0
  224. data/doc/en/cairo-pattern.rd +62 -0
  225. data/doc/en/cairo-pdf-surface.html +60 -0
  226. data/doc/en/cairo-pdf-surface.rd +27 -0
  227. data/doc/en/cairo-point.html +77 -0
  228. data/doc/en/cairo-point.rd +42 -0
  229. data/doc/en/cairo-ps-level.html +52 -0
  230. data/doc/en/cairo-ps-level.rd +24 -0
  231. data/doc/en/cairo-ps-surface.html +95 -0
  232. data/doc/en/cairo-ps-surface.rd +55 -0
  233. data/doc/en/cairo-quartz-image-surface.html +60 -0
  234. data/doc/en/cairo-quartz-image-surface.rd +27 -0
  235. data/doc/en/cairo-quartz-surface.html +60 -0
  236. data/doc/en/cairo-quartz-surface.rd +27 -0
  237. data/doc/en/cairo-radial-pattern.html +63 -0
  238. data/doc/en/cairo-radial-pattern.rd +28 -0
  239. data/doc/en/cairo-read-error.html +50 -0
  240. data/doc/en/cairo-read-error.rd +17 -0
  241. data/doc/en/cairo-rectangle.html +92 -0
  242. data/doc/en/cairo-rectangle.rd +54 -0
  243. data/doc/en/cairo-scaled-font.html +87 -0
  244. data/doc/en/cairo-scaled-font.rd +50 -0
  245. data/doc/en/cairo-solid-pattern.html +65 -0
  246. data/doc/en/cairo-solid-pattern.rd +31 -0
  247. data/doc/en/cairo-subpixel-order.html +42 -0
  248. data/doc/en/cairo-subpixel-order.rd +17 -0
  249. data/doc/en/cairo-surface-finished-error.html +50 -0
  250. data/doc/en/cairo-surface-finished-error.rd +17 -0
  251. data/doc/en/cairo-surface-pattern.html +60 -0
  252. data/doc/en/cairo-surface-pattern.rd +27 -0
  253. data/doc/en/cairo-surface-type-mismatch-error.html +50 -0
  254. data/doc/en/cairo-surface-type-mismatch-error.rd +17 -0
  255. data/doc/en/cairo-surface.html +114 -0
  256. data/doc/en/cairo-surface.rd +72 -0
  257. data/doc/en/cairo-svg-surface.html +80 -0
  258. data/doc/en/cairo-svg-surface.rd +44 -0
  259. data/doc/en/cairo-svg-version.html +52 -0
  260. data/doc/en/cairo-svg-version.rd +24 -0
  261. data/doc/en/cairo-temp-file-error.html +50 -0
  262. data/doc/en/cairo-temp-file-error.rd +17 -0
  263. data/doc/en/cairo-text-extents.html +79 -0
  264. data/doc/en/cairo-text-extents.rd +44 -0
  265. data/doc/en/cairo-win32-printing-surface.html +60 -0
  266. data/doc/en/cairo-win32-printing-surface.rd +27 -0
  267. data/doc/en/cairo-win32-surface.html +65 -0
  268. data/doc/en/cairo-win32-surface.rd +31 -0
  269. data/doc/en/cairo-write-error.html +50 -0
  270. data/doc/en/cairo-write-error.rd +17 -0
  271. data/doc/en/cairo.html +123 -0
  272. data/doc/en/cairo.rd +95 -0
  273. data/doc/en/index.html +1080 -0
  274. data/doc/en/index.rd +1051 -0
  275. data/doc/index.html +18 -0
  276. data/doc/ja/cairo-antialias.html +57 -0
  277. data/doc/ja/cairo-clip-not-representable-error.html +56 -0
  278. data/doc/ja/cairo-color-base.html +75 -0
  279. data/doc/ja/cairo-color-cmyk.html +152 -0
  280. data/doc/ja/cairo-color-hsv.html +135 -0
  281. data/doc/ja/cairo-color-rgb.html +145 -0
  282. data/doc/ja/cairo-color-x11.html +183 -0
  283. data/doc/ja/cairo-color.html +317 -0
  284. data/doc/ja/cairo-content.html +51 -0
  285. data/doc/ja/cairo-context-blur.html +53 -0
  286. data/doc/ja/cairo-context-circle.html +54 -0
  287. data/doc/ja/cairo-context-color.html +52 -0
  288. data/doc/ja/cairo-context-path.html +77 -0
  289. data/doc/ja/cairo-context-rectangle.html +60 -0
  290. data/doc/ja/cairo-context-triangle.html +47 -0
  291. data/doc/ja/cairo-context.html +1449 -0
  292. data/doc/ja/cairo-error.html +56 -0
  293. data/doc/ja/cairo-extend.html +56 -0
  294. data/doc/ja/cairo-file-not-found.html +51 -0
  295. data/doc/ja/cairo-fill-rule.html +58 -0
  296. data/doc/ja/cairo-filter.html +43 -0
  297. data/doc/ja/cairo-font-extents.html +110 -0
  298. data/doc/ja/cairo-font-face.html +55 -0
  299. data/doc/ja/cairo-font-options.html +186 -0
  300. data/doc/ja/cairo-font-slant.html +50 -0
  301. data/doc/ja/cairo-font-weight.html +47 -0
  302. data/doc/ja/cairo-format.html +81 -0
  303. data/doc/ja/cairo-glyph.html +115 -0
  304. data/doc/ja/cairo-gradient-pattern.html +119 -0
  305. data/doc/ja/cairo-hint-metrics.html +57 -0
  306. data/doc/ja/cairo-hint-style.html +64 -0
  307. data/doc/ja/cairo-image-surface.html +131 -0
  308. data/doc/ja/cairo-invalid-content-error.html +54 -0
  309. data/doc/ja/cairo-invalid-dash-error.html +54 -0
  310. data/doc/ja/cairo-invalid-dsc-comment-error.html +54 -0
  311. data/doc/ja/cairo-invalid-format-error.html +54 -0
  312. data/doc/ja/cairo-invalid-index-error.html +54 -0
  313. data/doc/ja/cairo-invalid-matrix-error.html +54 -0
  314. data/doc/ja/cairo-invalid-path-data-error.html +54 -0
  315. data/doc/ja/cairo-invalid-pop-group-error.html +54 -0
  316. data/doc/ja/cairo-invalid-restore-error.html +55 -0
  317. data/doc/ja/cairo-invalid-status-error.html +55 -0
  318. data/doc/ja/cairo-invalid-stride-error.html +55 -0
  319. data/doc/ja/cairo-invalid-string-error.html +54 -0
  320. data/doc/ja/cairo-invalid-visual-error.html +57 -0
  321. data/doc/ja/cairo-line-cap.html +50 -0
  322. data/doc/ja/cairo-line-join.html +53 -0
  323. data/doc/ja/cairo-linear-pattern.html +87 -0
  324. data/doc/ja/cairo-matrix.html +343 -0
  325. data/doc/ja/cairo-no-current-point-error.html +54 -0
  326. data/doc/ja/cairo-null-pointer-error.html +54 -0
  327. data/doc/ja/cairo-operator.html +51 -0
  328. data/doc/ja/cairo-paper-parse-error.html +55 -0
  329. data/doc/ja/cairo-paper-unknown-paper-name.html +76 -0
  330. data/doc/ja/cairo-paper-unknown-unit.html +75 -0
  331. data/doc/ja/cairo-paper-unrecognized-paper-description.html +76 -0
  332. data/doc/ja/cairo-paper.html +357 -0
  333. data/doc/ja/cairo-path-close-path.html +57 -0
  334. data/doc/ja/cairo-path-curve-to.html +70 -0
  335. data/doc/ja/cairo-path-data-type.html +53 -0
  336. data/doc/ja/cairo-path-data.html +127 -0
  337. data/doc/ja/cairo-path-line-to.html +62 -0
  338. data/doc/ja/cairo-path-move-to.html +62 -0
  339. data/doc/ja/cairo-path.html +144 -0
  340. data/doc/ja/cairo-pattern-type-mismatch-error.html +56 -0
  341. data/doc/ja/cairo-pattern.html +128 -0
  342. data/doc/ja/cairo-pdf-surface.html +86 -0
  343. data/doc/ja/cairo-point.html +90 -0
  344. data/doc/ja/cairo-ps-level.html +62 -0
  345. data/doc/ja/cairo-ps-surface.html +214 -0
  346. data/doc/ja/cairo-quartz-image-surface.html +75 -0
  347. data/doc/ja/cairo-quartz-surface.html +93 -0
  348. data/doc/ja/cairo-radial-pattern.html +93 -0
  349. data/doc/ja/cairo-read-error.html +55 -0
  350. data/doc/ja/cairo-rectangle.html +109 -0
  351. data/doc/ja/cairo-scaled-font.html +144 -0
  352. data/doc/ja/cairo-solid-pattern.html +87 -0
  353. data/doc/ja/cairo-subpixel-order.html +57 -0
  354. data/doc/ja/cairo-surface-finished-error.html +54 -0
  355. data/doc/ja/cairo-surface-pattern.html +68 -0
  356. data/doc/ja/cairo-surface-type-mismatch-error.html +56 -0
  357. data/doc/ja/cairo-surface.html +191 -0
  358. data/doc/ja/cairo-svg-surface.html +114 -0
  359. data/doc/ja/cairo-svg-version.html +66 -0
  360. data/doc/ja/cairo-temp-file-error.html +50 -0
  361. data/doc/ja/cairo-text-extents.html +101 -0
  362. data/doc/ja/cairo-win32-printing-surface.html +80 -0
  363. data/doc/ja/cairo-win32-surface.html +100 -0
  364. data/doc/ja/cairo-write-error.html +55 -0
  365. data/doc/ja/cairo.html +148 -0
  366. data/doc/ja/index.html +1080 -0
  367. data/extconf.rb +153 -0
  368. data/misc/update-colors.rb +143 -0
  369. data/pkg-config.rb +278 -0
  370. data/samples/agg/README +4 -0
  371. data/samples/agg/aa_demo.rb +47 -0
  372. data/samples/agg/aa_test.rb +304 -0
  373. data/samples/blur.rb +47 -0
  374. data/samples/pac.rb +99 -0
  375. data/samples/pac2.rb +171 -0
  376. data/samples/png.rb +45 -0
  377. data/samples/scalable.rb +56 -0
  378. data/samples/text-on-path.rb +60 -0
  379. data/samples/text2.rb +131 -0
  380. data/src/cairo.def +96 -0
  381. data/src/cairo.so +0 -0
  382. data/src/lib/cairo.rb +141 -0
  383. data/src/lib/cairo/color.rb +255 -0
  384. data/src/lib/cairo/colors.rb +656 -0
  385. data/src/lib/cairo/constants.rb +21 -0
  386. data/src/lib/cairo/context.rb +29 -0
  387. data/src/lib/cairo/context/blur.rb +45 -0
  388. data/src/lib/cairo/context/circle.rb +9 -0
  389. data/src/lib/cairo/context/color.rb +11 -0
  390. data/src/lib/cairo/context/path.rb +116 -0
  391. data/src/lib/cairo/context/rectangle.rb +33 -0
  392. data/src/lib/cairo/context/triangle.rb +12 -0
  393. data/src/lib/cairo/paper.rb +183 -0
  394. data/src/lib/cairo/papers.rb +41 -0
  395. data/src/lib/cairo/path.rb +15 -0
  396. data/src/lib/cairo/point.rb +7 -0
  397. data/src/libruby-cairo.a +0 -0
  398. data/src/rb_cairo.c +82 -0
  399. data/src/rb_cairo.h +264 -0
  400. data/src/rb_cairo_constants.c +456 -0
  401. data/src/rb_cairo_context.c +1548 -0
  402. data/src/rb_cairo_exception.c +214 -0
  403. data/src/rb_cairo_font_extents.c +125 -0
  404. data/src/rb_cairo_font_face.c +56 -0
  405. data/src/rb_cairo_font_options.c +197 -0
  406. data/src/rb_cairo_glyph.c +159 -0
  407. data/src/rb_cairo_matrix.c +350 -0
  408. data/src/rb_cairo_path.c +459 -0
  409. data/src/rb_cairo_pattern.c +540 -0
  410. data/src/rb_cairo_private.c +78 -0
  411. data/src/rb_cairo_private.h +72 -0
  412. data/src/rb_cairo_scaled_font.c +177 -0
  413. data/src/rb_cairo_surface.c +1252 -0
  414. data/src/rb_cairo_text_extents.c +138 -0
  415. data/test/run-test.rb +15 -0
  416. data/test/test_paper.rb +81 -0
  417. data/test/test_pkg_config.rb +122 -0
  418. metadata +490 -0
@@ -0,0 +1,41 @@
1
+ require 'cairo/paper'
2
+
3
+ module Cairo
4
+ class Paper
5
+ [
6
+ [841, 1189, "A0"],
7
+ [594, 841, "A1"],
8
+ [420, 594, "A2"],
9
+ [297, 420, "A3"],
10
+ [210, 297, "A4"],
11
+ [148, 210, "A5"],
12
+ [105, 148, "A6"],
13
+ [74, 105, "A7"],
14
+ [52, 74, "A8"],
15
+ [37, 52, "A9"],
16
+ [26, 37, "A10"],
17
+
18
+ [1030, 1456, "B0"],
19
+ [728, 1030, "B1"],
20
+ [515, 728, "B2"],
21
+ [364, 515, "B3"],
22
+ [257, 364, "B4"],
23
+ [182, 257, "B5"],
24
+ [128, 182, "B6"],
25
+ [91, 128, "B7"],
26
+ [64, 91, "B8"],
27
+ [45, 64, "B9"],
28
+ [32, 45, "B10"],
29
+
30
+ [215.9, 279.4, "letter"],
31
+ [215.9, 355.6, "legal"],
32
+ [279.9, 431.8, "tabloid"],
33
+ [100, 148, "Japanese postcard"],
34
+ ].each do |width, height, name|
35
+ constant_name = name.upcase.gsub(/ +/, '_')
36
+ const_set(constant_name, new(width, height, "mm", name))
37
+ const_set("#{constant_name}_LANDSCAPE",
38
+ new(height, width, "mm", "#{name} (landscape)"))
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,15 @@
1
+ require 'forwardable'
2
+
3
+ module Cairo
4
+ class Path
5
+ extend Forwardable
6
+ methods = %w(new_path new_sub_path move_to line_to curve_to
7
+ arc arc_negative rel_move_to rel_line_to rel_curve_to
8
+ rectangle rounded_rectangle circle)
9
+ def_delegators :@context, *methods
10
+
11
+ def close
12
+ @context.close_path
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ module Cairo
2
+ class Point
3
+ def distance(other)
4
+ Math.sqrt((other.x - x) ** 2 + (other.y - y) ** 2)
5
+ end
6
+ end
7
+ end
Binary file
@@ -0,0 +1,82 @@
1
+ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Ruby Cairo Binding
4
+ *
5
+ * $Author: kou $
6
+ * $Date: 2008-04-24 12:36:17 $
7
+ *
8
+ * Copyright 2006-2007 Kouhei Sutou <kou@cozmixng.org>
9
+ * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
+ * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
+ *
12
+ * This file is made available under the same terms as Ruby
13
+ *
14
+ */
15
+
16
+
17
+ #include "rb_cairo.h"
18
+ #include "rb_cairo_private.h"
19
+
20
+ VALUE rb_mCairo, rb_mCairo_Color, rb_cCairo_Color_Base, rb_cCairo_Paper;
21
+
22
+ static ID id__add_one_arg_setter;
23
+
24
+ void
25
+ rb_cairo_def_setters (VALUE klass)
26
+ {
27
+ rb_funcall (rb_mCairo, id__add_one_arg_setter, 1, klass);
28
+ }
29
+
30
+ void
31
+ Init_cairo ()
32
+ {
33
+ int major, minor, micro;
34
+
35
+ id__add_one_arg_setter = rb_intern("__add_one_arg_setter");
36
+
37
+ rb_mCairo = rb_define_module ("Cairo");
38
+
39
+ rb_define_const (rb_mCairo, "BUILD_VERSION",
40
+ rb_ary_new3 (3,
41
+ INT2FIX (CAIRO_VERSION_MAJOR),
42
+ INT2FIX (CAIRO_VERSION_MINOR),
43
+ INT2FIX (CAIRO_VERSION_MICRO)));
44
+
45
+ major = cairo_version () / 10000;
46
+ minor = (cairo_version () % 10000) / 100;
47
+ micro = cairo_version () % 100;
48
+
49
+ rb_define_const (rb_mCairo, "VERSION",
50
+ rb_ary_new3 (3,
51
+ INT2FIX (major),
52
+ INT2FIX (minor),
53
+ INT2FIX (micro)));
54
+
55
+ rb_define_const (rb_mCairo, "MAJOR_VERSION", INT2FIX (major));
56
+ rb_define_const (rb_mCairo, "MINOR_VERSION", INT2FIX (minor));
57
+ rb_define_const (rb_mCairo, "MICRO_VERSION", INT2FIX (micro));
58
+
59
+ rb_define_const (rb_mCairo, "BINDINGS_VERSION",
60
+ rb_ary_new3 (4,
61
+ INT2FIX (1), INT2FIX (6), INT2FIX (1), Qnil));
62
+
63
+ rb_mCairo_Color = rb_const_get (rb_mCairo, rb_intern ("Color"));
64
+ rb_cCairo_Color_Base = rb_const_get (rb_mCairo_Color, rb_intern ("Base"));
65
+ rb_cCairo_Paper = rb_const_get (rb_mCairo, rb_intern ("Paper"));
66
+
67
+ Init_cairo_private ();
68
+ Init_cairo_constants ();
69
+
70
+ Init_cairo_context ();
71
+ Init_cairo_path ();
72
+ Init_cairo_matrix ();
73
+ Init_cairo_surface ();
74
+ Init_cairo_exception ();
75
+ Init_cairo_font ();
76
+ Init_cairo_font_extents ();
77
+ Init_cairo_font_options ();
78
+ Init_cairo_scaled_font ();
79
+ Init_cairo_text_extents ();
80
+ Init_cairo_pattern ();
81
+ Init_cairo_glyph ();
82
+ }
@@ -0,0 +1,264 @@
1
+ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Ruby Cairo Binding
4
+ *
5
+ * $Author: kou $
6
+ * $Date: 2008-04-11 03:01:33 $
7
+ *
8
+ * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
+ * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
10
+ *
11
+ * This file is made available under the same terms as Ruby
12
+ *
13
+ */
14
+
15
+
16
+ #ifndef RB_CAIRO_H
17
+ #define RB_CAIRO_H
18
+
19
+ #include <cairo.h>
20
+
21
+ #if CAIRO_HAS_PS_SURFACE
22
+ # include <cairo-ps.h>
23
+ #endif
24
+
25
+ #if CAIRO_HAS_PDF_SURFACE
26
+ # include <cairo-pdf.h>
27
+ #endif
28
+
29
+ #if CAIRO_HAS_SVG_SURFACE
30
+ # include <cairo-svg.h>
31
+ #endif
32
+
33
+ #if CAIRO_HAS_WIN32_SURFACE
34
+ # define OpenFile OpenFile_win32
35
+ # include <cairo-win32.h>
36
+ # undef OpenFile
37
+ #endif
38
+
39
+ #if CAIRO_HAS_QUARTZ_SURFACE
40
+ # include <cairo-quartz.h>
41
+ #endif
42
+
43
+ #define CAIRO_CHECK_VERSION(major, minor, micro) \
44
+ (CAIRO_VERSION_MAJOR > (major) || \
45
+ (CAIRO_VERSION_MAJOR == (major) && CAIRO_VERSION_MINOR > (minor)) || \
46
+ (CAIRO_VERSION_MAJOR == (major) && CAIRO_VERSION_MINOR == (minor) && \
47
+ CAIRO_VERSION_MICRO >= (micro)))
48
+
49
+ #include "ruby.h"
50
+
51
+ #if defined(__cplusplus)
52
+ # define RB_CAIRO_BEGIN_DECLS extern "C" {
53
+ # define RB_CAIRO_END_DECLS }
54
+ #else
55
+ # define RB_CAIRO_BEGIN_DECLS
56
+ # define RB_CAIRO_END_DECLS
57
+ #endif
58
+
59
+ RB_CAIRO_BEGIN_DECLS
60
+
61
+ #if defined(RUBY_CAIRO_PLATFORM_WIN32) && !defined(RB_CAIRO_PLATFORM_WIN32)
62
+ # define RB_CAIRO_PLATFORM_WIN32 RUBY_CAIRO_PLATFORM_WIN32
63
+ #endif
64
+
65
+ #if defined(RUBY_CAIRO_STATIC_COMPILATION) && !defined(RB_CAIRO_STATIC_COMPILATION)
66
+ # define RB_CAIRO_STATIC_COMPILATION RUBY_CAIRO_STATIC_COMPILATION
67
+ #endif
68
+
69
+ #if defined(RB_CAIRO_PLATFORM_WIN32) && !defined(RB_CAIRO_STATIC_COMPILATION)
70
+ # ifdef RB_CAIRO_COMPILATION
71
+ # define RB_CAIRO_VAR __declspec(dllexport)
72
+ # else
73
+ # define RB_CAIRO_VAR extern __declspec(dllimport)
74
+ # endif
75
+ #else
76
+ # define RB_CAIRO_VAR extern
77
+ #endif
78
+
79
+ RB_CAIRO_VAR VALUE rb_mCairo;
80
+ RB_CAIRO_VAR VALUE rb_cCairo_Context;
81
+ RB_CAIRO_VAR VALUE rb_cCairo_Point;
82
+ RB_CAIRO_VAR VALUE rb_cCairo_Path;
83
+ RB_CAIRO_VAR VALUE rb_cCairo_PathData;
84
+ RB_CAIRO_VAR VALUE rb_cCairo_PathMoveTo;
85
+ RB_CAIRO_VAR VALUE rb_cCairo_PathLineTo;
86
+ RB_CAIRO_VAR VALUE rb_cCairo_PathCurveTo;
87
+ RB_CAIRO_VAR VALUE rb_cCairo_PathClosePath;
88
+ RB_CAIRO_VAR VALUE rb_cCairo_Matrix;
89
+ RB_CAIRO_VAR VALUE rb_cCairo_Pattern;
90
+ RB_CAIRO_VAR VALUE rb_cCairo_SolidPattern;
91
+ RB_CAIRO_VAR VALUE rb_cCairo_SurfacePattern;
92
+ RB_CAIRO_VAR VALUE rb_cCairo_GradientPattern;
93
+ RB_CAIRO_VAR VALUE rb_cCairo_LinearPattern;
94
+ RB_CAIRO_VAR VALUE rb_cCairo_RadialPattern;
95
+ RB_CAIRO_VAR VALUE rb_cCairo_FontFace;
96
+ RB_CAIRO_VAR VALUE rb_cCairo_FontExtents;
97
+ RB_CAIRO_VAR VALUE rb_cCairo_FontOptions;
98
+ RB_CAIRO_VAR VALUE rb_cCairo_ScaledFont;
99
+ RB_CAIRO_VAR VALUE rb_cCairo_TextExtents;
100
+ RB_CAIRO_VAR VALUE rb_cCairo_Glyph;
101
+ RB_CAIRO_VAR VALUE rb_cCairo_Surface;
102
+ RB_CAIRO_VAR VALUE rb_cCairo_ImageSurface;
103
+ RB_CAIRO_VAR VALUE rb_cCairo_PDFSurface;
104
+ RB_CAIRO_VAR VALUE rb_cCairo_PSSurface;
105
+ RB_CAIRO_VAR VALUE rb_cCairo_SVGSurface;
106
+ RB_CAIRO_VAR VALUE rb_cCairo_Win32Surface;
107
+ RB_CAIRO_VAR VALUE rb_cCairo_Win32PrintingSurface;
108
+ /* For backward compatibility*/
109
+ #define rb_cCairo_WIN32Surface rb_cCairo_Win32Surface
110
+ RB_CAIRO_VAR VALUE rb_cCairo_QuartzSurface;
111
+ RB_CAIRO_VAR VALUE rb_cCairo_QuartzImageSurface;
112
+
113
+ RB_CAIRO_VAR VALUE rb_mCairo_Operator;
114
+ RB_CAIRO_VAR VALUE rb_mCairo_Antialias;
115
+ RB_CAIRO_VAR VALUE rb_mCairo_FillRule;
116
+ RB_CAIRO_VAR VALUE rb_mCairo_LineCap;
117
+ RB_CAIRO_VAR VALUE rb_mCairo_LineJoin;
118
+ RB_CAIRO_VAR VALUE rb_mCairo_FontSlant;
119
+ RB_CAIRO_VAR VALUE rb_mCairo_FontWeight;
120
+ RB_CAIRO_VAR VALUE rb_mCairo_SubpixelOrder;
121
+ RB_CAIRO_VAR VALUE rb_mCairo_HintStyle;
122
+ RB_CAIRO_VAR VALUE rb_mCairo_HintMetrics;
123
+ RB_CAIRO_VAR VALUE rb_mCairo_FontType;
124
+ RB_CAIRO_VAR VALUE rb_mCairo_PathDataType;
125
+ RB_CAIRO_VAR VALUE rb_mCairo_Content;
126
+ RB_CAIRO_VAR VALUE rb_mCairo_SurfaceType;
127
+ RB_CAIRO_VAR VALUE rb_mCairo_Format;
128
+ RB_CAIRO_VAR VALUE rb_mCairo_PatternType;
129
+ RB_CAIRO_VAR VALUE rb_mCairo_Extend;
130
+ RB_CAIRO_VAR VALUE rb_mCairo_Filter;
131
+ RB_CAIRO_VAR VALUE rb_mCairo_SVGVersion;
132
+ RB_CAIRO_VAR VALUE rb_mCairo_Color;
133
+ RB_CAIRO_VAR VALUE rb_cCairo_Color_Base;
134
+ RB_CAIRO_VAR VALUE rb_cCairo_Paper;
135
+
136
+
137
+ #define RVAL2CRCONTEXT(obj) (rb_cairo_context_from_ruby_object(obj))
138
+ #define CRCONTEXT2RVAL(cr) (rb_cairo_context_to_ruby_object(cr))
139
+
140
+ #define RVAL2CRPATH(obj) (rb_cairo_path_from_ruby_object(obj))
141
+ #define CRPATH2RVAL(path) (rb_cairo_path_to_ruby_object(path))
142
+
143
+ #define RVAL2CRMATRIX(obj) (rb_cairo_matrix_from_ruby_object(obj))
144
+ #define CRMATRIX2RVAL(matrix) (rb_cairo_matrix_to_ruby_object(matrix))
145
+
146
+ #define RVAL2CRPATTERN(obj) (rb_cairo_pattern_from_ruby_object(obj))
147
+ #define CRPATTERN2RVAL(pattern) (rb_cairo_pattern_to_ruby_object(pattern))
148
+
149
+ #define RVAL2CRFONTFACE(obj) (rb_cairo_font_face_from_ruby_object(obj))
150
+ #define CRFONTFACE2RVAL(face) (rb_cairo_font_face_to_ruby_object(face))
151
+
152
+ #define RVAL2CRFONTEXTENTS(obj) (rb_cairo_font_extents_from_ruby_object(obj))
153
+ #define CRFONTEXTENTS2RVAL(ext) (rb_cairo_font_extents_to_ruby_object(ext))
154
+
155
+ #define RVAL2CRFONTOPTIONS(obj) (rb_cairo_font_options_from_ruby_object(obj))
156
+ #define CRFONTOPTIONS2RVAL(opt) (rb_cairo_font_options_to_ruby_object(opt))
157
+
158
+ #define RVAL2CRSCALEDFONT(obj) (rb_cairo_scaled_font_from_ruby_object(obj))
159
+ #define CRSCALEDFONT2RVAL(font) (rb_cairo_scaled_font_to_ruby_object(font))
160
+
161
+ #define RVAL2CRTEXTEXTENTS(obj) (rb_cairo_text_extents_from_ruby_object(obj))
162
+ #define CRTEXTEXTENTS2RVAL(ext) (rb_cairo_text_extents_to_ruby_object(ext))
163
+
164
+ #define RVAL2CRGLYPH(obj) (rb_cairo_glyph_from_ruby_object(obj))
165
+ #define CRGLYPH2RVAL(glyph) (rb_cairo_glyph_to_ruby_object(glyph))
166
+
167
+ #define RVAL2CRSURFACE(obj) (rb_cairo_surface_from_ruby_object(obj))
168
+ #define CRSURFACE2RVAL(surface) (rb_cairo_surface_to_ruby_object(surface))
169
+ #define CRSURFACE2RVAL_WITH_DESTROY(surface) \
170
+ (rb_cairo_surface_to_ruby_object_with_destroy(surface))
171
+
172
+ cairo_t *rb_cairo_context_from_ruby_object (VALUE obj);
173
+ VALUE rb_cairo_context_to_ruby_object (cairo_t *cr);
174
+
175
+ cairo_path_t *rb_cairo_path_from_ruby_object (VALUE obj);
176
+ VALUE rb_cairo_path_to_ruby_object (cairo_path_t *path);
177
+
178
+ cairo_matrix_t *rb_cairo_matrix_from_ruby_object (VALUE obj);
179
+ VALUE rb_cairo_matrix_to_ruby_object (cairo_matrix_t *matrix);
180
+
181
+ cairo_pattern_t *rb_cairo_pattern_from_ruby_object (VALUE obj);
182
+ VALUE rb_cairo_pattern_to_ruby_object (cairo_pattern_t *pat);
183
+
184
+ cairo_font_face_t *rb_cairo_font_face_from_ruby_object (VALUE obj);
185
+ VALUE rb_cairo_font_face_to_ruby_object (cairo_font_face_t *face);
186
+
187
+ cairo_font_extents_t *rb_cairo_font_extents_from_ruby_object (VALUE obj);
188
+ VALUE rb_cairo_font_extents_to_ruby_object (cairo_font_extents_t *extents);
189
+
190
+ cairo_font_options_t *rb_cairo_font_options_from_ruby_object (VALUE obj);
191
+ VALUE rb_cairo_font_options_to_ruby_object (cairo_font_options_t *options);
192
+
193
+ cairo_scaled_font_t *rb_cairo_scaled_font_from_ruby_object (VALUE obj);
194
+ VALUE rb_cairo_scaled_font_to_ruby_object (cairo_scaled_font_t *options);
195
+
196
+ cairo_text_extents_t *rb_cairo_text_extents_from_ruby_object (VALUE obj);
197
+ VALUE rb_cairo_text_extents_to_ruby_object (cairo_text_extents_t *extents);
198
+
199
+ cairo_glyph_t *rb_cairo_glyph_from_ruby_object (VALUE obj);
200
+ VALUE rb_cairo_glyph_to_ruby_object (cairo_glyph_t *glyph);
201
+
202
+ cairo_surface_t *rb_cairo_surface_from_ruby_object (VALUE obj);
203
+ VALUE rb_cairo_surface_to_ruby_object (cairo_surface_t *surface);
204
+ VALUE rb_cairo_surface_to_ruby_object_with_destroy
205
+ (cairo_surface_t *surface);
206
+
207
+
208
+ #define RVAL2CROPERATOR(obj) (rb_cairo_operator_from_ruby_object(obj))
209
+ #define RVAL2CRANTIALIAS(obj) (rb_cairo_antialias_from_ruby_object(obj))
210
+ #define RVAL2CRFILLRULE(obj) (rb_cairo_fill_rule_from_ruby_object(obj))
211
+ #define RVAL2CRLINECAP(obj) (rb_cairo_line_cap_from_ruby_object(obj))
212
+ #define RVAL2CRLINEJOIN(obj) (rb_cairo_line_join_from_ruby_object(obj))
213
+ #define RVAL2CRFONTSLANT(obj) (rb_cairo_font_slant_from_ruby_object(obj))
214
+ #define RVAL2CRFONTWEIGHT(obj) (rb_cairo_font_weight_from_ruby_object(obj))
215
+ #define RVAL2CRSUBPIXELORDER(obj) (rb_cairo_subpixel_order_from_ruby_object(obj))
216
+ #define RVAL2CRHINTSTYLE(obj) (rb_cairo_hint_style_from_ruby_object(obj))
217
+ #define RVAL2CRHINTMETRICS(obj) (rb_cairo_hint_metrics_from_ruby_object(obj))
218
+ #define RVAL2CRPATHDATATYPE(obj) (rb_cairo_path_data_type_from_ruby_object(obj))
219
+ #define RVAL2CRCONTENT(obj) (rb_cairo_content_from_ruby_object(obj))
220
+ #define RVAL2CRFORMAT(obj) (rb_cairo_format_from_ruby_object(obj))
221
+ #define RVAL2CREXTEND(obj) (rb_cairo_extend_from_ruby_object(obj))
222
+ #define RVAL2CRFILTER(obj) (rb_cairo_filter_from_ruby_object(obj))
223
+ #if CAIRO_HAS_SVG_SURFACE
224
+ #define RVAL2CRSVGVERSION(obj) (rb_cairo_svg_version_from_ruby_object(obj))
225
+ #endif
226
+ #if CAIRO_HAS_PS_SURFACE
227
+ # if CAIRO_CHECK_VERSION(1, 5, 2)
228
+ #define RVAL2CRPSLEVEL(obj) (rb_cairo_ps_level_from_ruby_object(obj))
229
+ # endif
230
+ #endif
231
+
232
+ cairo_operator_t rb_cairo_operator_from_ruby_object (VALUE obj);
233
+ cairo_antialias_t rb_cairo_antialias_from_ruby_object (VALUE obj);
234
+ cairo_fill_rule_t rb_cairo_fill_rule_from_ruby_object (VALUE obj);
235
+ cairo_line_cap_t rb_cairo_line_cap_from_ruby_object (VALUE obj);
236
+ cairo_line_join_t rb_cairo_line_join_from_ruby_object (VALUE obj);
237
+ cairo_font_slant_t rb_cairo_font_slant_from_ruby_object (VALUE obj);
238
+ cairo_font_weight_t rb_cairo_font_weight_from_ruby_object (VALUE obj);
239
+ cairo_subpixel_order_t rb_cairo_subpixel_order_from_ruby_object (VALUE obj);
240
+ cairo_hint_style_t rb_cairo_hint_style_from_ruby_object (VALUE obj);
241
+ cairo_hint_metrics_t rb_cairo_hint_metrics_from_ruby_object (VALUE obj);
242
+ cairo_path_data_type_t rb_cairo_path_data_type_from_ruby_object (VALUE obj);
243
+ cairo_content_t rb_cairo_content_from_ruby_object (VALUE obj);
244
+ cairo_format_t rb_cairo_format_from_ruby_object (VALUE obj);
245
+ cairo_extend_t rb_cairo_extend_from_ruby_object (VALUE obj);
246
+ cairo_filter_t rb_cairo_filter_from_ruby_object (VALUE obj);
247
+ #if CAIRO_HAS_SVG_SURFACE
248
+ cairo_svg_version_t rb_cairo_svg_version_from_ruby_object (VALUE obj);
249
+ #endif
250
+ #if CAIRO_HAS_PS_SURFACE
251
+ # if CAIRO_CHECK_VERSION(1, 5, 2)
252
+ cairo_ps_level_t rb_cairo_ps_level_from_ruby_object (VALUE obj);
253
+ # endif
254
+ #endif
255
+
256
+ void rb_cairo_check_status (cairo_status_t status);
257
+
258
+
259
+ #define RB_CAIRO_DEF_SETTERS(klass) rb_cairo_def_setters(klass);
260
+ void rb_cairo_def_setters (VALUE klass);
261
+
262
+ RB_CAIRO_END_DECLS
263
+
264
+ #endif
@@ -0,0 +1,456 @@
1
+ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Ruby Cairo Binding
4
+ *
5
+ * $Author: kou $
6
+ * $Date: 2008-04-04 04:25:16 $
7
+ *
8
+ * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
+ * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
10
+ *
11
+ * This file is made available under the same terms as Ruby
12
+ *
13
+ */
14
+
15
+
16
+ #include "rb_cairo.h"
17
+ #include "rb_cairo_private.h"
18
+
19
+ VALUE rb_mCairo_Operator;
20
+ VALUE rb_mCairo_Antialias;
21
+ VALUE rb_mCairo_FillRule;
22
+ VALUE rb_mCairo_LineCap;
23
+ VALUE rb_mCairo_LineJoin;
24
+ VALUE rb_mCairo_FontSlant;
25
+ VALUE rb_mCairo_FontWeight;
26
+ VALUE rb_mCairo_SubpixelOrder;
27
+ VALUE rb_mCairo_HintStyle;
28
+ VALUE rb_mCairo_HintMetrics;
29
+ VALUE rb_mCairo_PathDataType;
30
+ VALUE rb_mCairo_Content;
31
+ VALUE rb_mCairo_Format;
32
+ VALUE rb_mCairo_Extend;
33
+ VALUE rb_mCairo_Filter;
34
+ VALUE rb_mCairo_SVGVersion = Qnil;
35
+ VALUE rb_mCairo_PSLevel = Qnil;
36
+
37
+ #define CAIRO_OPERATOR_MIN CAIRO_OPERATOR_CLEAR
38
+ #define CAIRO_OPERATOR_MAX CAIRO_OPERATOR_SATURATE
39
+
40
+ #define CAIRO_ANTIALIAS_MIN CAIRO_ANTIALIAS_DEFAULT
41
+ #define CAIRO_ANTIALIAS_MAX CAIRO_ANTIALIAS_SUBPIXEL
42
+
43
+ #define CAIRO_FILL_RULE_MIN CAIRO_FILL_RULE_WINDING
44
+ #define CAIRO_FILL_RULE_MAX CAIRO_FILL_RULE_EVEN_ODD
45
+
46
+ #define CAIRO_LINE_CAP_MIN CAIRO_LINE_CAP_BUTT
47
+ #define CAIRO_LINE_CAP_MAX CAIRO_LINE_CAP_SQUARE
48
+
49
+ #define CAIRO_LINE_JOIN_MIN CAIRO_LINE_JOIN_MITER
50
+ #define CAIRO_LINE_JOIN_MAX CAIRO_LINE_JOIN_BEVEL
51
+
52
+ #define CAIRO_FONT_SLANT_MIN CAIRO_FONT_SLANT_NORMAL
53
+ #define CAIRO_FONT_SLANT_MAX CAIRO_FONT_SLANT_OBLIQUE
54
+
55
+ #define CAIRO_FONT_WEIGHT_MIN CAIRO_FONT_WEIGHT_NORMAL
56
+ #define CAIRO_FONT_WEIGHT_MAX CAIRO_FONT_WEIGHT_BOLD
57
+
58
+ #define CAIRO_SUBPIXEL_ORDER_MIN CAIRO_SUBPIXEL_ORDER_DEFAULT
59
+ #define CAIRO_SUBPIXEL_ORDER_MAX CAIRO_SUBPIXEL_ORDER_VBGR
60
+
61
+ #define CAIRO_HINT_STYLE_MIN CAIRO_HINT_STYLE_DEFAULT
62
+ #define CAIRO_HINT_STYLE_MAX CAIRO_HINT_STYLE_FULL
63
+
64
+ #define CAIRO_HINT_METRICS_MIN CAIRO_HINT_METRICS_DEFAULT
65
+ #define CAIRO_HINT_METRICS_MAX CAIRO_HINT_METRICS_OFF
66
+
67
+ #define CAIRO_PATH_MIN CAIRO_PATH_MOVE_TO
68
+ #define CAIRO_PATH_MAX CAIRO_PATH_CLOSE_PATH
69
+
70
+ #define CAIRO_CONTENT_MIN CAIRO_CONTENT_COLOR
71
+ #define CAIRO_CONTENT_MAX CAIRO_CONTENT_COLOR_ALPHA
72
+
73
+ #define CAIRO_FORMAT_MIN CAIRO_FORMAT_ARGB32
74
+ #define CAIRO_FORMAT_MAX CAIRO_FORMAT_A1
75
+
76
+ #define CAIRO_EXTEND_MIN CAIRO_EXTEND_NONE
77
+ #define CAIRO_EXTEND_MAX CAIRO_EXTEND_REFLECT
78
+
79
+ #define CAIRO_FILTER_MIN CAIRO_FILTER_FAST
80
+ #define CAIRO_FILTER_MAX CAIRO_FILTER_GAUSSIAN
81
+
82
+ #define CAIRO_SVG_VERSION_MIN CAIRO_SVG_VERSION_1_1
83
+ #define CAIRO_SVG_VERSION_MAX CAIRO_SVG_VERSION_1_2
84
+
85
+ #define CAIRO_PS_LEVEL_MIN CAIRO_PS_LEVEL_2
86
+ #define CAIRO_PS_LEVEL_MAX CAIRO_PS_LEVEL_3
87
+
88
+ #define DEFINE_RVAL2ENUM(name, const_name) \
89
+ cairo_ ## name ## _t \
90
+ rb_cairo_ ## name ## _from_ruby_object (VALUE rb_ ## name) \
91
+ { \
92
+ cairo_ ## name ## _t name; \
93
+ \
94
+ if (!rb_cairo__is_kind_of (rb_ ## name, rb_cNumeric)) \
95
+ rb_ ## name = rb_cairo__const_get (rb_ ## name, \
96
+ # const_name "_"); \
97
+ \
98
+ name = FIX2INT (rb_ ## name); \
99
+ if (name < CAIRO_ ## const_name ## _MIN || \
100
+ name > CAIRO_ ## const_name ## _MAX) \
101
+ { \
102
+ rb_raise (rb_eArgError, \
103
+ "invalid %s: %d (expect %d <= %s <= %d)", \
104
+ #name, name, \
105
+ CAIRO_ ## const_name ## _MIN, \
106
+ #name, \
107
+ CAIRO_ ## const_name ## _MAX); \
108
+ } \
109
+ return name; \
110
+ }
111
+
112
+ DEFINE_RVAL2ENUM(operator, OPERATOR)
113
+ DEFINE_RVAL2ENUM(antialias, ANTIALIAS)
114
+ DEFINE_RVAL2ENUM(fill_rule, FILL_RULE)
115
+ DEFINE_RVAL2ENUM(line_cap, LINE_CAP)
116
+ DEFINE_RVAL2ENUM(line_join, LINE_JOIN)
117
+ DEFINE_RVAL2ENUM(font_slant, FONT_SLANT)
118
+ DEFINE_RVAL2ENUM(font_weight, FONT_WEIGHT)
119
+ DEFINE_RVAL2ENUM(subpixel_order, SUBPIXEL_ORDER)
120
+ DEFINE_RVAL2ENUM(hint_style, HINT_STYLE)
121
+ DEFINE_RVAL2ENUM(hint_metrics, HINT_METRICS)
122
+ DEFINE_RVAL2ENUM(path_data_type, PATH)
123
+ DEFINE_RVAL2ENUM(content, CONTENT)
124
+ DEFINE_RVAL2ENUM(format, FORMAT)
125
+ DEFINE_RVAL2ENUM(extend, EXTEND)
126
+ DEFINE_RVAL2ENUM(filter, FILTER)
127
+ #if CAIRO_HAS_SVG_SURFACE
128
+ DEFINE_RVAL2ENUM(svg_version, SVG_VERSION)
129
+ #endif
130
+ #if CAIRO_HAS_PS_SURFACE && CAIRO_CHECK_VERSION(1, 5, 2)
131
+ DEFINE_RVAL2ENUM(ps_level, PS_LEVEL)
132
+ #else
133
+ # ifdef RB_CAIRO_PLATFORM_WIN32
134
+ void
135
+ rb_cairo_ps_level_from_ruby_object (VALUE rb_ps_level)
136
+ {
137
+ /* dummy */
138
+ }
139
+ # endif
140
+ #endif
141
+
142
+
143
+ #if CAIRO_HAS_SVG_SURFACE
144
+ static VALUE
145
+ cr_svg_get_versions (VALUE self)
146
+ {
147
+ VALUE rb_versions;
148
+ int i, num_versions;
149
+ cairo_svg_version_t const *versions;
150
+
151
+ cairo_svg_get_versions (&versions, &num_versions);
152
+
153
+ rb_versions = rb_ary_new2 (num_versions);
154
+
155
+ for (i = 0; i < num_versions; i++)
156
+ {
157
+ rb_ary_push (rb_versions, INT2NUM (versions[i]));
158
+ }
159
+
160
+ return rb_versions;
161
+ }
162
+
163
+ static VALUE
164
+ cr_svg_version_to_string (int argc, VALUE *argv, VALUE self)
165
+ {
166
+ if (argc == 0)
167
+ {
168
+ return rb_call_super (argc, argv);
169
+ }
170
+ else
171
+ {
172
+ VALUE version;
173
+ const char *ver_str;
174
+ rb_scan_args (argc, argv, "1", &version);
175
+ ver_str = cairo_svg_version_to_string (RVAL2CRSVGVERSION(version));
176
+ return rb_str_new2 (ver_str);
177
+ }
178
+ }
179
+ #endif
180
+
181
+ #if CAIRO_CHECK_VERSION(1, 5, 8)
182
+ static VALUE
183
+ cr_format_stride_for_width (VALUE self, VALUE format, VALUE width)
184
+ {
185
+ return INT2NUM (cairo_format_stride_for_width (RVAL2CRFORMAT (format),
186
+ NUM2INT (width)));
187
+ }
188
+ #endif
189
+
190
+ #if CAIRO_HAS_PS_SURFACE
191
+ # if CAIRO_CHECK_VERSION(1, 5, 8)
192
+ static VALUE
193
+ cr_ps_get_levels (VALUE self)
194
+ {
195
+ VALUE rb_levels;
196
+ const cairo_ps_level_t *levels;
197
+ int i, n_levels;
198
+
199
+ cairo_ps_get_levels (&levels, &n_levels);
200
+
201
+ rb_levels = rb_ary_new2 (n_levels);
202
+ for (i = 0; i < n_levels; i++)
203
+ {
204
+ rb_ary_push (rb_levels, INT2NUM (levels[i]));
205
+ }
206
+
207
+ return rb_levels;
208
+ }
209
+
210
+ static VALUE
211
+ cr_ps_level_to_string (int argc, VALUE *argv, VALUE self)
212
+ {
213
+ if (argc == 0)
214
+ {
215
+ return rb_call_super (argc, argv);
216
+ }
217
+ else
218
+ {
219
+ VALUE level;
220
+ rb_scan_args (argc, argv, "1", &level);
221
+ return rb_str_new2 (cairo_ps_level_to_string (RVAL2CRPSLEVEL (level)));
222
+ }
223
+ }
224
+ # endif
225
+ #endif
226
+
227
+ void
228
+ Init_cairo_constants (void)
229
+ {
230
+ /* cairo_operator_t */
231
+ rb_mCairo_Operator = rb_define_module_under (rb_mCairo, "Operator");
232
+ rb_define_const (rb_mCairo_Operator, "CLEAR",
233
+ INT2FIX (CAIRO_OPERATOR_CLEAR));
234
+
235
+ rb_define_const (rb_mCairo_Operator, "SOURCE",
236
+ INT2FIX (CAIRO_OPERATOR_SOURCE));
237
+ rb_define_const (rb_mCairo_Operator, "OVER",
238
+ INT2FIX (CAIRO_OPERATOR_OVER));
239
+ rb_define_const (rb_mCairo_Operator, "IN",
240
+ INT2FIX (CAIRO_OPERATOR_IN));
241
+ rb_define_const (rb_mCairo_Operator, "OUT",
242
+ INT2FIX (CAIRO_OPERATOR_OUT));
243
+ rb_define_const (rb_mCairo_Operator, "ATOP",
244
+ INT2FIX (CAIRO_OPERATOR_ATOP));
245
+
246
+ rb_define_const (rb_mCairo_Operator, "DEST",
247
+ INT2FIX (CAIRO_OPERATOR_DEST));
248
+ rb_define_const (rb_mCairo_Operator, "DEST_OVER",
249
+ INT2FIX (CAIRO_OPERATOR_DEST_OVER));
250
+ rb_define_const (rb_mCairo_Operator, "DEST_IN",
251
+ INT2FIX (CAIRO_OPERATOR_DEST_IN));
252
+ rb_define_const (rb_mCairo_Operator, "DEST_OUT",
253
+ INT2FIX (CAIRO_OPERATOR_DEST_OUT));
254
+ rb_define_const (rb_mCairo_Operator, "DEST_ATOP",
255
+ INT2FIX (CAIRO_OPERATOR_DEST_ATOP));
256
+
257
+ rb_define_const (rb_mCairo_Operator, "XOR",
258
+ INT2FIX (CAIRO_OPERATOR_XOR));
259
+ rb_define_const (rb_mCairo_Operator, "ADD",
260
+ INT2FIX (CAIRO_OPERATOR_ADD));
261
+ rb_define_const (rb_mCairo_Operator, "SATURATE",
262
+ INT2FIX (CAIRO_OPERATOR_SATURATE));
263
+
264
+
265
+ /* cairo_antialias_t */
266
+ rb_mCairo_Antialias = rb_define_module_under (rb_mCairo, "Antialias");
267
+ rb_define_const (rb_mCairo_Antialias, "DEFAULT",
268
+ INT2FIX (CAIRO_ANTIALIAS_DEFAULT));
269
+ rb_define_const (rb_mCairo_Antialias, "NONE",
270
+ INT2FIX (CAIRO_ANTIALIAS_NONE));
271
+ rb_define_const (rb_mCairo_Antialias, "GRAY",
272
+ INT2FIX (CAIRO_ANTIALIAS_GRAY));
273
+ rb_define_const (rb_mCairo_Antialias, "SUBPIXEL",
274
+ INT2FIX (CAIRO_ANTIALIAS_SUBPIXEL));
275
+
276
+
277
+ /* cairo_fill_rule_t */
278
+ rb_mCairo_FillRule = rb_define_module_under (rb_mCairo, "FillRule");
279
+ rb_define_const (rb_mCairo_FillRule, "WINDING",
280
+ INT2FIX (CAIRO_FILL_RULE_WINDING));
281
+ rb_define_const (rb_mCairo_FillRule, "EVEN_ODD",
282
+ INT2FIX (CAIRO_FILL_RULE_EVEN_ODD));
283
+
284
+
285
+ /* cairo_line_cap_t */
286
+ rb_mCairo_LineCap = rb_define_module_under (rb_mCairo, "LineCap");
287
+ rb_define_const (rb_mCairo_LineCap, "BUTT",
288
+ INT2FIX (CAIRO_LINE_CAP_BUTT));
289
+ rb_define_const (rb_mCairo_LineCap, "ROUND",
290
+ INT2FIX (CAIRO_LINE_CAP_ROUND));
291
+ rb_define_const (rb_mCairo_LineCap, "SQUARE",
292
+ INT2FIX (CAIRO_LINE_CAP_SQUARE));
293
+
294
+
295
+ /* cairo_line_join_t */
296
+ rb_mCairo_LineJoin = rb_define_module_under (rb_mCairo, "LineJoin");
297
+ rb_define_const (rb_mCairo_LineJoin, "MITER",
298
+ INT2FIX (CAIRO_LINE_JOIN_MITER));
299
+ rb_define_const (rb_mCairo_LineJoin, "ROUND",
300
+ INT2FIX (CAIRO_LINE_JOIN_ROUND));
301
+ rb_define_const (rb_mCairo_LineJoin, "BEVEL",
302
+ INT2FIX (CAIRO_LINE_JOIN_BEVEL));
303
+
304
+
305
+ /* cairo_font_slant_t */
306
+ rb_mCairo_FontSlant = rb_define_module_under (rb_mCairo, "FontSlant");
307
+ rb_define_const (rb_mCairo_FontSlant, "NORMAL",
308
+ INT2FIX (CAIRO_FONT_SLANT_NORMAL));
309
+ rb_define_const (rb_mCairo_FontSlant, "ITALIC",
310
+ INT2FIX (CAIRO_FONT_SLANT_ITALIC));
311
+ rb_define_const (rb_mCairo_FontSlant, "OBLIQUE",
312
+ INT2FIX (CAIRO_FONT_SLANT_OBLIQUE));
313
+
314
+
315
+ /* cairo_font_weight_t */
316
+ rb_mCairo_FontWeight = rb_define_module_under (rb_mCairo, "FontWeight");
317
+ rb_define_const (rb_mCairo_FontWeight, "NORMAL",
318
+ INT2FIX (CAIRO_FONT_WEIGHT_NORMAL));
319
+ rb_define_const (rb_mCairo_FontWeight, "BOLD",
320
+ INT2FIX (CAIRO_FONT_WEIGHT_BOLD));
321
+
322
+
323
+ /* cairo_subpixel_order_t */
324
+ rb_mCairo_SubpixelOrder = rb_define_module_under (rb_mCairo, "SubpixelOrder");
325
+ rb_define_const (rb_mCairo_SubpixelOrder, "DEFAULT",
326
+ INT2FIX (CAIRO_SUBPIXEL_ORDER_DEFAULT));
327
+ rb_define_const (rb_mCairo_SubpixelOrder, "RGB",
328
+ INT2FIX (CAIRO_SUBPIXEL_ORDER_RGB));
329
+ rb_define_const (rb_mCairo_SubpixelOrder, "BGR",
330
+ INT2FIX (CAIRO_SUBPIXEL_ORDER_BGR));
331
+ rb_define_const (rb_mCairo_SubpixelOrder, "VRGB",
332
+ INT2FIX (CAIRO_SUBPIXEL_ORDER_VRGB));
333
+ rb_define_const (rb_mCairo_SubpixelOrder, "VBGR",
334
+ INT2FIX (CAIRO_SUBPIXEL_ORDER_VBGR));
335
+
336
+
337
+ /* cairo_hint_style_t */
338
+ rb_mCairo_HintStyle = rb_define_module_under (rb_mCairo, "HintStyle");
339
+ rb_define_const (rb_mCairo_HintStyle, "DEFAULT",
340
+ INT2FIX (CAIRO_HINT_STYLE_DEFAULT));
341
+ rb_define_const (rb_mCairo_HintStyle, "NONE",
342
+ INT2FIX (CAIRO_HINT_STYLE_NONE));
343
+ rb_define_const (rb_mCairo_HintStyle, "SLIGHT",
344
+ INT2FIX (CAIRO_HINT_STYLE_SLIGHT));
345
+ rb_define_const (rb_mCairo_HintStyle, "MEDIUM",
346
+ INT2FIX (CAIRO_HINT_STYLE_MEDIUM));
347
+ rb_define_const (rb_mCairo_HintStyle, "FULL",
348
+ INT2FIX (CAIRO_HINT_STYLE_FULL));
349
+
350
+
351
+ /* cairo_hint_metrics_t */
352
+ rb_mCairo_HintMetrics = rb_define_module_under (rb_mCairo, "HintMetrics");
353
+ rb_define_const (rb_mCairo_HintMetrics, "DEFAULT",
354
+ INT2FIX (CAIRO_HINT_METRICS_DEFAULT));
355
+ rb_define_const (rb_mCairo_HintMetrics, "ON",
356
+ INT2FIX (CAIRO_HINT_METRICS_ON));
357
+ rb_define_const (rb_mCairo_HintMetrics, "OFF",
358
+ INT2FIX (CAIRO_HINT_METRICS_OFF));
359
+
360
+
361
+ /* cairo_path_data_type_t */
362
+ rb_mCairo_PathDataType = rb_define_module_under (rb_mCairo, "PathDataType");
363
+ rb_define_const (rb_mCairo_PathDataType, "MOVE_TO",
364
+ INT2FIX (CAIRO_PATH_MOVE_TO));
365
+ rb_define_const (rb_mCairo_PathDataType, "LINE_TO",
366
+ INT2FIX (CAIRO_PATH_LINE_TO));
367
+ rb_define_const (rb_mCairo_PathDataType, "CURVE_TO",
368
+ INT2FIX (CAIRO_PATH_CURVE_TO));
369
+ rb_define_const (rb_mCairo_PathDataType, "CLOSE_PATH",
370
+ INT2FIX (CAIRO_PATH_CLOSE_PATH));
371
+
372
+
373
+ /* cairo_content_t */
374
+ rb_mCairo_Content = rb_define_module_under (rb_mCairo, "Content");
375
+ rb_define_const (rb_mCairo_Content, "COLOR",
376
+ INT2FIX (CAIRO_CONTENT_COLOR));
377
+ rb_define_const (rb_mCairo_Content, "ALPHA",
378
+ INT2FIX (CAIRO_CONTENT_ALPHA));
379
+ rb_define_const (rb_mCairo_Content, "COLOR_ALPHA",
380
+ INT2FIX (CAIRO_CONTENT_COLOR_ALPHA));
381
+
382
+
383
+ /* cairo_format_t */
384
+ rb_mCairo_Format = rb_define_module_under (rb_mCairo, "Format");
385
+ rb_define_const (rb_mCairo_Format, "ARGB32",
386
+ INT2FIX (CAIRO_FORMAT_ARGB32));
387
+ rb_define_const (rb_mCairo_Format, "RGB24",
388
+ INT2FIX (CAIRO_FORMAT_RGB24));
389
+ rb_define_const (rb_mCairo_Format, "A8",
390
+ INT2FIX (CAIRO_FORMAT_A8));
391
+ rb_define_const (rb_mCairo_Format, "A1",
392
+ INT2FIX (CAIRO_FORMAT_A1));
393
+ #if !CAIRO_CHECK_VERSION(1, 3, 0)
394
+ rb_define_const (rb_mCairo_Format, "RGB16_565",
395
+ INT2FIX (CAIRO_FORMAT_RGB16_565));
396
+ #endif
397
+
398
+ #if CAIRO_CHECK_VERSION(1, 5, 8)
399
+ rb_define_singleton_method (rb_mCairo_Format, "stride_for_width",
400
+ cr_format_stride_for_width, 2);
401
+ #endif
402
+
403
+
404
+ /* cairo_extend_t */
405
+ rb_mCairo_Extend = rb_define_module_under (rb_mCairo, "Extend");
406
+ rb_define_const (rb_mCairo_Extend, "NONE",
407
+ INT2FIX (CAIRO_EXTEND_NONE));
408
+ rb_define_const (rb_mCairo_Extend, "REPEAT",
409
+ INT2FIX (CAIRO_EXTEND_REPEAT));
410
+ rb_define_const (rb_mCairo_Extend, "REFLECT",
411
+ INT2FIX (CAIRO_EXTEND_REFLECT));
412
+ rb_define_const (rb_mCairo_Extend, "PAD",
413
+ INT2FIX (CAIRO_EXTEND_PAD));
414
+
415
+
416
+ /* cairo_filter_t */
417
+ rb_mCairo_Filter = rb_define_module_under (rb_mCairo, "Filter");
418
+ rb_define_const (rb_mCairo_Filter, "FAST",
419
+ INT2FIX (CAIRO_FILTER_FAST));
420
+ rb_define_const (rb_mCairo_Filter, "GOOD",
421
+ INT2FIX (CAIRO_FILTER_GOOD));
422
+ rb_define_const (rb_mCairo_Filter, "BEST",
423
+ INT2FIX (CAIRO_FILTER_BEST));
424
+ rb_define_const (rb_mCairo_Filter, "NEAREST",
425
+ INT2FIX (CAIRO_FILTER_NEAREST));
426
+ rb_define_const (rb_mCairo_Filter, "BILINEAR",
427
+ INT2FIX (CAIRO_FILTER_BILINEAR));
428
+ rb_define_const (rb_mCairo_Filter, "GAUSSIAN",
429
+ INT2FIX (CAIRO_FILTER_GAUSSIAN));
430
+
431
+ #if CAIRO_HAS_SVG_SURFACE
432
+ /* cairo_svg_version_t */
433
+ rb_mCairo_SVGVersion = rb_define_module_under (rb_mCairo, "SVGVersion");
434
+ rb_define_const (rb_mCairo_SVGVersion, "VERSION_1_1",
435
+ INT2FIX (CAIRO_SVG_VERSION_1_1));
436
+ rb_define_const (rb_mCairo_SVGVersion, "VERSION_1_2",
437
+ INT2FIX (CAIRO_SVG_VERSION_1_2));
438
+
439
+ rb_define_singleton_method (rb_mCairo_SVGVersion, "list",
440
+ cr_svg_get_versions, 0);
441
+ rb_define_singleton_method (rb_mCairo_SVGVersion, "name",
442
+ cr_svg_version_to_string, -1);
443
+ #endif
444
+
445
+ #if CAIRO_HAS_PS_SURFACE && CAIRO_CHECK_VERSION(1, 5, 2)
446
+ /* cairo_ps_level_t */
447
+ rb_mCairo_PSLevel = rb_define_module_under (rb_mCairo, "PSLevel");
448
+ rb_define_const (rb_mCairo_PSLevel, "LEVEL_2", INT2FIX (CAIRO_PS_LEVEL_2));
449
+ rb_define_const (rb_mCairo_PSLevel, "LEVEL_3", INT2FIX (CAIRO_PS_LEVEL_3));
450
+
451
+ rb_define_singleton_method (rb_mCairo_PSLevel, "list",
452
+ cr_ps_get_levels, 0);
453
+ rb_define_singleton_method (rb_mCairo_PSLevel, "name",
454
+ cr_ps_level_to_string, -1);
455
+ #endif
456
+ }