cairo 1.6.3 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. data/ChangeLog +206 -0
  2. data/NEWS +13 -0
  3. data/README +10 -3
  4. data/Rakefile +3 -2
  5. data/doc/en/cairo-antialias.html +0 -3
  6. data/doc/en/cairo-clip-not-representable-error.html +1 -4
  7. data/doc/en/cairo-color-base.html +0 -3
  8. data/doc/en/cairo-color-cmyk.html +1 -4
  9. data/doc/en/cairo-color-hsv.html +137 -0
  10. data/doc/en/cairo-color-rgb.html +142 -0
  11. data/doc/en/cairo-color-x11.html +173 -0
  12. data/doc/en/cairo-color.html +238 -0
  13. data/doc/en/cairo-content.html +37 -0
  14. data/doc/en/cairo-context-blur.html +39 -0
  15. data/doc/en/cairo-context-circle.html +39 -0
  16. data/doc/en/cairo-context-color.html +39 -0
  17. data/doc/en/cairo-context-path.html +44 -0
  18. data/doc/en/cairo-context-rectangle.html +0 -3
  19. data/doc/en/cairo-context-triangle.html +39 -0
  20. data/doc/en/cairo-context.html +124 -107
  21. data/doc/en/cairo-error.html +44 -0
  22. data/doc/en/cairo-extend.html +38 -0
  23. data/doc/en/cairo-file-not-found.html +1 -4
  24. data/doc/en/cairo-fill-rule.html +36 -0
  25. data/doc/en/cairo-filter.html +0 -3
  26. data/doc/en/cairo-font-extents.html +129 -0
  27. data/doc/en/cairo-font-face.html +38 -0
  28. data/doc/en/cairo-font-options.html +154 -0
  29. data/doc/en/cairo-font-slant.html +0 -3
  30. data/doc/en/cairo-font-type-mismatch.html +47 -0
  31. data/doc/en/cairo-font-weight.html +0 -3
  32. data/doc/en/cairo-format.html +0 -3
  33. data/doc/en/cairo-glyph.html +99 -0
  34. data/doc/en/cairo-gradient-pattern.html +74 -0
  35. data/doc/en/cairo-hint-metrics.html +37 -0
  36. data/doc/en/cairo-hint-style.html +0 -3
  37. data/doc/en/cairo-image-surface.html +82 -0
  38. data/doc/en/cairo-invalid-clusters.html +47 -0
  39. data/doc/en/cairo-invalid-content-error.html +47 -0
  40. data/doc/en/cairo-invalid-dash-error.html +0 -3
  41. data/doc/en/cairo-invalid-dsc-comment-error.html +47 -0
  42. data/doc/en/cairo-invalid-format-error.html +47 -0
  43. data/doc/en/cairo-invalid-index-error.html +47 -0
  44. data/doc/en/cairo-invalid-matrix-error.html +0 -3
  45. data/doc/en/cairo-invalid-path-data-error.html +47 -0
  46. data/doc/en/cairo-invalid-pop-group-error.html +1 -4
  47. data/doc/en/cairo-invalid-restore-error.html +47 -0
  48. data/doc/en/cairo-invalid-slant.html +47 -0
  49. data/doc/en/cairo-invalid-status-error.html +47 -0
  50. data/doc/en/cairo-invalid-stride-error.html +0 -3
  51. data/doc/en/cairo-invalid-string-error.html +47 -0
  52. data/doc/en/cairo-invalid-visual-error.html +47 -0
  53. data/doc/en/cairo-invalid-weight.html +47 -0
  54. data/doc/en/cairo-lcd-filter.html +39 -0
  55. data/doc/en/cairo-line-cap.html +37 -0
  56. data/doc/en/cairo-line-join.html +37 -0
  57. data/doc/en/cairo-linear-pattern.html +60 -0
  58. data/doc/en/cairo-matrix.html +259 -0
  59. data/doc/en/cairo-negative-count.html +47 -0
  60. data/doc/en/cairo-no-current-point-error.html +47 -0
  61. data/doc/en/cairo-null-pointer-error.html +0 -3
  62. data/doc/en/cairo-operator.html +0 -3
  63. data/doc/en/cairo-paper-parse-error.html +0 -3
  64. data/doc/en/cairo-paper-unknown-paper-name.html +66 -0
  65. data/doc/en/cairo-paper-unknown-unit.html +66 -0
  66. data/doc/en/cairo-paper-unrecognized-paper-description.html +1 -4
  67. data/doc/en/cairo-paper.html +0 -3
  68. data/doc/en/cairo-path-close-path.html +49 -0
  69. data/doc/en/cairo-path-curve-to.html +1 -4
  70. data/doc/en/cairo-path-data-type.html +0 -3
  71. data/doc/en/cairo-path-data.html +0 -3
  72. data/doc/en/cairo-path-line-to.html +1 -4
  73. data/doc/en/cairo-path-move-to.html +1 -4
  74. data/doc/en/cairo-path.html +0 -3
  75. data/doc/en/cairo-pattern-type-mismatch-error.html +47 -0
  76. data/doc/en/cairo-pattern.html +0 -3
  77. data/doc/en/cairo-pdf-surface.html +1 -4
  78. data/doc/en/cairo-point.html +0 -3
  79. data/doc/en/cairo-ps-level.html +49 -0
  80. data/doc/en/cairo-ps-surface.html +1 -4
  81. data/doc/en/cairo-quartz-image-surface.html +57 -0
  82. data/doc/en/cairo-quartz-surface.html +1 -4
  83. data/doc/en/cairo-radial-pattern.html +60 -0
  84. data/doc/en/cairo-read-error.html +47 -0
  85. data/doc/en/cairo-rectangle.html +0 -3
  86. data/doc/en/cairo-scaled-font.html +94 -0
  87. data/doc/en/cairo-solid-pattern.html +62 -0
  88. data/doc/en/cairo-subpixel-order.html +0 -3
  89. data/doc/en/cairo-surface-finished-error.html +1 -4
  90. data/doc/en/cairo-surface-pattern.html +0 -3
  91. data/doc/en/cairo-surface-type-mismatch-error.html +47 -0
  92. data/doc/en/cairo-surface.html +22 -15
  93. data/doc/en/cairo-svg-surface.html +77 -0
  94. data/doc/en/cairo-svg-version.html +0 -3
  95. data/doc/en/cairo-temp-file-error.html +47 -0
  96. data/doc/en/cairo-text-cluster.html +84 -0
  97. data/doc/en/cairo-text-extents.html +144 -0
  98. data/doc/en/cairo-toy-font-face.html +67 -0
  99. data/doc/en/cairo-user-font-error.html +47 -0
  100. data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +94 -0
  101. data/doc/en/cairo-user-font-face.html +72 -0
  102. data/doc/en/cairo-user-font-immutable.html +47 -0
  103. data/doc/en/cairo-win32-printing-surface.html +57 -0
  104. data/doc/en/cairo-win32-surface.html +62 -0
  105. data/doc/en/cairo-write-error.html +47 -0
  106. data/doc/en/cairo.html +92 -80
  107. data/doc/en/index.html +1076 -989
  108. data/doc/ja/cairo-clip-not-representable-error.html +1 -1
  109. data/doc/ja/cairo-color-base.html +1 -1
  110. data/doc/ja/cairo-color-cmyk.html +9 -9
  111. data/doc/ja/cairo-color-hsv.html +8 -8
  112. data/doc/ja/cairo-color-rgb.html +9 -9
  113. data/doc/ja/cairo-color.html +8 -8
  114. data/doc/ja/cairo-context-circle.html +1 -1
  115. data/doc/ja/cairo-context-color.html +1 -1
  116. data/doc/ja/cairo-context-path.html +2 -2
  117. data/doc/ja/cairo-context.html +435 -342
  118. data/doc/ja/cairo-font-extents.html +69 -15
  119. data/doc/ja/cairo-font-face.html +3 -3
  120. data/doc/ja/cairo-font-options.html +37 -12
  121. data/doc/ja/cairo-font-slant.html +1 -1
  122. data/doc/ja/cairo-font-type-mismatch.html +52 -0
  123. data/doc/ja/cairo-glyph.html +5 -5
  124. data/doc/ja/cairo-gradient-pattern.html +6 -6
  125. data/doc/ja/cairo-image-surface.html +8 -8
  126. data/doc/ja/cairo-invalid-clusters.html +55 -0
  127. data/doc/ja/cairo-invalid-restore-error.html +1 -1
  128. data/doc/ja/cairo-invalid-slant.html +57 -0
  129. data/doc/ja/cairo-invalid-weight.html +57 -0
  130. data/doc/ja/cairo-lcd-filter.html +63 -0
  131. data/doc/ja/cairo-line-join.html +1 -1
  132. data/doc/ja/cairo-linear-pattern.html +2 -2
  133. data/doc/ja/cairo-matrix.html +35 -24
  134. data/doc/ja/cairo-negative-count.html +52 -0
  135. data/doc/ja/cairo-paper-unknown-paper-name.html +2 -2
  136. data/doc/ja/cairo-paper-unknown-unit.html +2 -2
  137. data/doc/ja/cairo-paper-unrecognized-paper-description.html +1 -1
  138. data/doc/ja/cairo-paper.html +12 -12
  139. data/doc/ja/cairo-path-close-path.html +1 -1
  140. data/doc/ja/cairo-path-curve-to.html +1 -1
  141. data/doc/ja/cairo-path-data.html +8 -8
  142. data/doc/ja/cairo-path-line-to.html +1 -1
  143. data/doc/ja/cairo-path-move-to.html +1 -1
  144. data/doc/ja/cairo-path.html +21 -21
  145. data/doc/ja/cairo-pattern.html +4 -4
  146. data/doc/ja/cairo-pdf-surface.html +2 -2
  147. data/doc/ja/cairo-point.html +5 -5
  148. data/doc/ja/cairo-ps-level.html +2 -2
  149. data/doc/ja/cairo-ps-surface.html +6 -6
  150. data/doc/ja/cairo-quartz-image-surface.html +2 -2
  151. data/doc/ja/cairo-quartz-surface.html +3 -3
  152. data/doc/ja/cairo-radial-pattern.html +2 -2
  153. data/doc/ja/cairo-rectangle.html +5 -5
  154. data/doc/ja/cairo-scaled-font.html +53 -17
  155. data/doc/ja/cairo-solid-pattern.html +3 -3
  156. data/doc/ja/cairo-surface-pattern.html +2 -2
  157. data/doc/ja/cairo-surface.html +58 -36
  158. data/doc/ja/cairo-svg-surface.html +4 -4
  159. data/doc/ja/cairo-svg-version.html +2 -2
  160. data/doc/ja/cairo-text-cluster.html +102 -0
  161. data/doc/ja/cairo-text-extents.html +84 -22
  162. data/doc/ja/cairo-toy-font-face.html +107 -0
  163. data/doc/ja/cairo-user-font-error.html +55 -0
  164. data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +155 -0
  165. data/doc/ja/cairo-user-font-face.html +268 -0
  166. data/doc/ja/cairo-user-font-immutable.html +54 -0
  167. data/doc/ja/cairo-win32-printing-surface.html +3 -3
  168. data/doc/ja/cairo-win32-surface.html +4 -4
  169. data/doc/ja/cairo.html +110 -77
  170. data/doc/ja/index.html +292 -205
  171. data/extconf.rb +1 -0
  172. data/src/cairo.def +8 -0
  173. data/src/lib/cairo.rb +12 -7
  174. data/src/lib/cairo/constants.rb +1 -0
  175. data/src/rb_cairo.c +25 -3
  176. data/src/rb_cairo.h +22 -1
  177. data/src/rb_cairo_constants.c +24 -1
  178. data/src/rb_cairo_context.c +147 -6
  179. data/src/rb_cairo_exception.c +143 -3
  180. data/src/rb_cairo_font_extents.c +81 -6
  181. data/src/rb_cairo_font_face.c +646 -4
  182. data/src/rb_cairo_font_options.c +24 -2
  183. data/src/rb_cairo_glyph.c +5 -3
  184. data/src/rb_cairo_matrix.c +17 -1
  185. data/src/rb_cairo_private.c +169 -5
  186. data/src/rb_cairo_private.h +36 -2
  187. data/src/rb_cairo_scaled_font.c +61 -3
  188. data/src/rb_cairo_surface.c +77 -52
  189. data/src/rb_cairo_text_cluster.c +151 -0
  190. data/src/rb_cairo_text_extents.c +85 -2
  191. data/test-unit/Rakefile +30 -0
  192. data/test-unit/bin/testrb +5 -0
  193. data/test-unit/lib/test/unit.rb +280 -0
  194. data/test-unit/lib/test/unit/assertionfailederror.rb +14 -0
  195. data/test-unit/lib/test/unit/assertions.rb +722 -0
  196. data/test-unit/lib/test/unit/attribute.rb +125 -0
  197. data/test-unit/lib/test/unit/autorunner.rb +254 -0
  198. data/test-unit/lib/test/unit/collector.rb +43 -0
  199. data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
  200. data/test-unit/lib/test/unit/collector/dir.rb +108 -0
  201. data/test-unit/lib/test/unit/collector/load.rb +135 -0
  202. data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
  203. data/test-unit/lib/test/unit/color.rb +61 -0
  204. data/test-unit/lib/test/unit/diff.rb +524 -0
  205. data/test-unit/lib/test/unit/error.rb +124 -0
  206. data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
  207. data/test-unit/lib/test/unit/failure.rb +110 -0
  208. data/test-unit/lib/test/unit/fixture.rb +185 -0
  209. data/test-unit/lib/test/unit/notification.rb +125 -0
  210. data/test-unit/lib/test/unit/omission.rb +143 -0
  211. data/test-unit/lib/test/unit/pending.rb +146 -0
  212. data/test-unit/lib/test/unit/priority.rb +146 -0
  213. data/test-unit/lib/test/unit/runner/console.rb +46 -0
  214. data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
  215. data/test-unit/lib/test/unit/testcase.rb +281 -0
  216. data/test-unit/lib/test/unit/testresult.rb +89 -0
  217. data/test-unit/lib/test/unit/testsuite.rb +110 -0
  218. data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
  219. data/test-unit/lib/test/unit/ui/console/testrunner.rb +195 -0
  220. data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +49 -0
  221. data/test-unit/lib/test/unit/ui/testrunner.rb +20 -0
  222. data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
  223. data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  224. data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
  225. data/test-unit/lib/test/unit/util/observable.rb +90 -0
  226. data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
  227. data/test-unit/lib/test/unit/version.rb +7 -0
  228. data/test-unit/sample/adder.rb +13 -0
  229. data/test-unit/sample/subtracter.rb +12 -0
  230. data/test-unit/sample/tc_adder.rb +18 -0
  231. data/test-unit/sample/tc_subtracter.rb +18 -0
  232. data/test-unit/sample/ts_examples.rb +7 -0
  233. data/test-unit/test/collector/test_descendant.rb +135 -0
  234. data/test-unit/test/collector/test_dir.rb +406 -0
  235. data/test-unit/test/collector/test_load.rb +333 -0
  236. data/test-unit/test/collector/test_objectspace.rb +98 -0
  237. data/test-unit/test/run-test.rb +13 -0
  238. data/test-unit/test/test_assertions.rb +693 -0
  239. data/test-unit/test/test_attribute.rb +86 -0
  240. data/test-unit/test/test_color.rb +37 -0
  241. data/test-unit/test/test_diff.rb +477 -0
  242. data/test-unit/test/test_emacs_runner.rb +60 -0
  243. data/test-unit/test/test_error.rb +26 -0
  244. data/test-unit/test/test_failure.rb +33 -0
  245. data/test-unit/test/test_fixture.rb +252 -0
  246. data/test-unit/test/test_notification.rb +33 -0
  247. data/test-unit/test/test_omission.rb +81 -0
  248. data/test-unit/test/test_pending.rb +70 -0
  249. data/test-unit/test/test_priority.rb +89 -0
  250. data/test-unit/test/test_testcase.rb +430 -0
  251. data/test-unit/test/test_testresult.rb +113 -0
  252. data/test-unit/test/test_testsuite.rb +129 -0
  253. data/test-unit/test/testunit_test_util.rb +14 -0
  254. data/test-unit/test/ui/test_testrunmediator.rb +20 -0
  255. data/test-unit/test/util/test_backtracefilter.rb +41 -0
  256. data/test-unit/test/util/test_observable.rb +102 -0
  257. data/test-unit/test/util/test_procwrapper.rb +36 -0
  258. data/test/cairo-test-utils.rb +18 -0
  259. data/test/run-test.rb +14 -1
  260. data/test/test_constants.rb +19 -0
  261. data/test/test_context.rb +117 -0
  262. data/test/test_exception.rb +27 -0
  263. data/test/test_font_extents.rb +36 -0
  264. data/test/test_font_face.rb +244 -0
  265. data/test/test_font_options.rb +32 -0
  266. data/test/test_pkg_config.rb +3 -2
  267. data/test/test_scaled_font.rb +34 -0
  268. data/test/test_surface.rb +13 -0
  269. data/test/test_text_cluster.rb +32 -0
  270. data/test/test_text_extents.rb +40 -0
  271. data/test/test_text_to_glyphs_data.rb +47 -0
  272. metadata +156 -175
  273. data/doc/en/cairo-antialias.rbl +0 -8
  274. data/doc/en/cairo-antialias.rd +0 -16
  275. data/doc/en/cairo-antialias.rdc +0 -16
  276. data/doc/en/cairo-clip-not-representable-error.rbl +0 -4
  277. data/doc/en/cairo-clip-not-representable-error.rd +0 -17
  278. data/doc/en/cairo-clip-not-representable-error.rdc +0 -17
  279. data/doc/en/cairo-color-base.rbl +0 -11
  280. data/doc/en/cairo-color-base.rd +0 -38
  281. data/doc/en/cairo-color-base.rdc +0 -38
  282. data/doc/en/cairo-color-cmyk.rbl +0 -28
  283. data/doc/en/cairo-color-cmyk.rd +0 -107
  284. data/doc/en/cairo-color-cmyk.rdc +0 -107
  285. data/doc/en/cairo-color-hsv.rd +0 -91
  286. data/doc/en/cairo-color-rgb.rd +0 -95
  287. data/doc/en/cairo-color-x11.rd +0 -151
  288. data/doc/en/cairo-color.rd +0 -213
  289. data/doc/en/cairo-content.rd +0 -15
  290. data/doc/en/cairo-context-blur.rd +0 -15
  291. data/doc/en/cairo-context-circle.rd +0 -15
  292. data/doc/en/cairo-context-color.rd +0 -15
  293. data/doc/en/cairo-context-path.rd +0 -19
  294. data/doc/en/cairo-context-rectangle.rbl +0 -5
  295. data/doc/en/cairo-context-rectangle.rd +0 -15
  296. data/doc/en/cairo-context-rectangle.rdc +0 -15
  297. data/doc/en/cairo-context-triangle.rd +0 -15
  298. data/doc/en/cairo-context.rbl +0 -123
  299. data/doc/en/cairo-context.rd +0 -491
  300. data/doc/en/cairo-context.rdc +0 -491
  301. data/doc/en/cairo-error.rd +0 -16
  302. data/doc/en/cairo-extend.rd +0 -16
  303. data/doc/en/cairo-file-not-found.rbl +0 -4
  304. data/doc/en/cairo-file-not-found.rd +0 -17
  305. data/doc/en/cairo-file-not-found.rdc +0 -17
  306. data/doc/en/cairo-fill-rule.rd +0 -14
  307. data/doc/en/cairo-filter.rbl +0 -10
  308. data/doc/en/cairo-filter.rd +0 -18
  309. data/doc/en/cairo-filter.rdc +0 -18
  310. data/doc/en/cairo-font-extents.rd +0 -40
  311. data/doc/en/cairo-font-face.rd +0 -14
  312. data/doc/en/cairo-font-options.rd +0 -94
  313. data/doc/en/cairo-font-slant.rbl +0 -7
  314. data/doc/en/cairo-font-slant.rd +0 -15
  315. data/doc/en/cairo-font-slant.rdc +0 -15
  316. data/doc/en/cairo-font-weight.rbl +0 -6
  317. data/doc/en/cairo-font-weight.rd +0 -14
  318. data/doc/en/cairo-font-weight.rdc +0 -14
  319. data/doc/en/cairo-format.rbl +0 -10
  320. data/doc/en/cairo-format.rd +0 -22
  321. data/doc/en/cairo-format.rdc +0 -22
  322. data/doc/en/cairo-glyph.rd +0 -62
  323. data/doc/en/cairo-gradient-pattern.rd +0 -41
  324. data/doc/en/cairo-hint-metrics.rd +0 -15
  325. data/doc/en/cairo-hint-style.rbl +0 -9
  326. data/doc/en/cairo-hint-style.rd +0 -17
  327. data/doc/en/cairo-hint-style.rdc +0 -17
  328. data/doc/en/cairo-image-surface.rd +0 -47
  329. data/doc/en/cairo-invalid-content-error.rd +0 -17
  330. data/doc/en/cairo-invalid-dash-error.rbl +0 -4
  331. data/doc/en/cairo-invalid-dash-error.rd +0 -17
  332. data/doc/en/cairo-invalid-dash-error.rdc +0 -17
  333. data/doc/en/cairo-invalid-dsc-comment-error.rd +0 -17
  334. data/doc/en/cairo-invalid-format-error.rd +0 -17
  335. data/doc/en/cairo-invalid-index-error.rd +0 -17
  336. data/doc/en/cairo-invalid-matrix-error.rbl +0 -4
  337. data/doc/en/cairo-invalid-matrix-error.rd +0 -17
  338. data/doc/en/cairo-invalid-matrix-error.rdc +0 -17
  339. data/doc/en/cairo-invalid-path-data-error.rd +0 -17
  340. data/doc/en/cairo-invalid-pop-group-error.rbl +0 -4
  341. data/doc/en/cairo-invalid-pop-group-error.rd +0 -17
  342. data/doc/en/cairo-invalid-pop-group-error.rdc +0 -17
  343. data/doc/en/cairo-invalid-restore-error.rd +0 -17
  344. data/doc/en/cairo-invalid-status-error.rd +0 -17
  345. data/doc/en/cairo-invalid-stride-error.rbl +0 -4
  346. data/doc/en/cairo-invalid-stride-error.rd +0 -17
  347. data/doc/en/cairo-invalid-stride-error.rdc +0 -17
  348. data/doc/en/cairo-invalid-string-error.rd +0 -17
  349. data/doc/en/cairo-invalid-visual-error.rd +0 -17
  350. data/doc/en/cairo-line-cap.rd +0 -15
  351. data/doc/en/cairo-line-join.rd +0 -15
  352. data/doc/en/cairo-linear-pattern.rd +0 -28
  353. data/doc/en/cairo-matrix.rd +0 -186
  354. data/doc/en/cairo-no-current-point-error.rd +0 -17
  355. data/doc/en/cairo-null-pointer-error.rbl +0 -4
  356. data/doc/en/cairo-null-pointer-error.rd +0 -17
  357. data/doc/en/cairo-null-pointer-error.rdc +0 -17
  358. data/doc/en/cairo-operator.rbl +0 -18
  359. data/doc/en/cairo-operator.rd +0 -26
  360. data/doc/en/cairo-operator.rdc +0 -26
  361. data/doc/en/cairo-paper-parse-error.rbl +0 -4
  362. data/doc/en/cairo-paper-parse-error.rd +0 -17
  363. data/doc/en/cairo-paper-parse-error.rdc +0 -17
  364. data/doc/en/cairo-paper-unknown-paper-name.rd +0 -30
  365. data/doc/en/cairo-paper-unknown-unit.rd +0 -30
  366. data/doc/en/cairo-paper-unrecognized-paper-description.rbl +0 -8
  367. data/doc/en/cairo-paper-unrecognized-paper-description.rd +0 -30
  368. data/doc/en/cairo-paper-unrecognized-paper-description.rdc +0 -30
  369. data/doc/en/cairo-paper.rbl +0 -76
  370. data/doc/en/cairo-paper.rd +0 -141
  371. data/doc/en/cairo-paper.rdc +0 -141
  372. data/doc/en/cairo-path-close-path.rd +0 -21
  373. data/doc/en/cairo-path-curve-to.rbl +0 -6
  374. data/doc/en/cairo-path-curve-to.rd +0 -21
  375. data/doc/en/cairo-path-curve-to.rdc +0 -21
  376. data/doc/en/cairo-path-data-type.rbl +0 -8
  377. data/doc/en/cairo-path-data-type.rd +0 -16
  378. data/doc/en/cairo-path-data-type.rdc +0 -16
  379. data/doc/en/cairo-path-data.rbl +0 -17
  380. data/doc/en/cairo-path-data.rd +0 -62
  381. data/doc/en/cairo-path-data.rdc +0 -62
  382. data/doc/en/cairo-path-line-to.rbl +0 -6
  383. data/doc/en/cairo-path-line-to.rd +0 -21
  384. data/doc/en/cairo-path-line-to.rdc +0 -21
  385. data/doc/en/cairo-path-move-to.rbl +0 -6
  386. data/doc/en/cairo-path-move-to.rd +0 -21
  387. data/doc/en/cairo-path-move-to.rdc +0 -21
  388. data/doc/en/cairo-path.rbl +0 -32
  389. data/doc/en/cairo-path.rd +0 -109
  390. data/doc/en/cairo-path.rdc +0 -109
  391. data/doc/en/cairo-pattern-type-mismatch-error.rd +0 -17
  392. data/doc/en/cairo-pattern.rbl +0 -17
  393. data/doc/en/cairo-pattern.rd +0 -62
  394. data/doc/en/cairo-pattern.rdc +0 -62
  395. data/doc/en/cairo-pdf-surface.rbl +0 -8
  396. data/doc/en/cairo-pdf-surface.rd +0 -27
  397. data/doc/en/cairo-pdf-surface.rdc +0 -27
  398. data/doc/en/cairo-point.rbl +0 -12
  399. data/doc/en/cairo-point.rd +0 -42
  400. data/doc/en/cairo-point.rdc +0 -42
  401. data/doc/en/cairo-ps-level.rd +0 -24
  402. data/doc/en/cairo-ps-surface.rbl +0 -15
  403. data/doc/en/cairo-ps-surface.rd +0 -55
  404. data/doc/en/cairo-ps-surface.rdc +0 -55
  405. data/doc/en/cairo-quartz-image-surface.rd +0 -27
  406. data/doc/en/cairo-quartz-surface.rbl +0 -8
  407. data/doc/en/cairo-quartz-surface.rd +0 -27
  408. data/doc/en/cairo-quartz-surface.rdc +0 -27
  409. data/doc/en/cairo-radial-pattern.rd +0 -28
  410. data/doc/en/cairo-read-error.rd +0 -17
  411. data/doc/en/cairo-rectangle.rbl +0 -15
  412. data/doc/en/cairo-rectangle.rd +0 -54
  413. data/doc/en/cairo-rectangle.rdc +0 -54
  414. data/doc/en/cairo-scaled-font.rd +0 -50
  415. data/doc/en/cairo-solid-pattern.rd +0 -31
  416. data/doc/en/cairo-subpixel-order.rbl +0 -9
  417. data/doc/en/cairo-subpixel-order.rd +0 -17
  418. data/doc/en/cairo-subpixel-order.rdc +0 -17
  419. data/doc/en/cairo-surface-finished-error.rbl +0 -4
  420. data/doc/en/cairo-surface-finished-error.rd +0 -17
  421. data/doc/en/cairo-surface-finished-error.rdc +0 -17
  422. data/doc/en/cairo-surface-pattern.rbl +0 -8
  423. data/doc/en/cairo-surface-pattern.rd +0 -27
  424. data/doc/en/cairo-surface-pattern.rdc +0 -27
  425. data/doc/en/cairo-surface-type-mismatch-error.rd +0 -17
  426. data/doc/en/cairo-surface.rbl +0 -19
  427. data/doc/en/cairo-surface.rd +0 -72
  428. data/doc/en/cairo-surface.rdc +0 -72
  429. data/doc/en/cairo-svg-surface.rd +0 -44
  430. data/doc/en/cairo-svg-version.rbl +0 -9
  431. data/doc/en/cairo-svg-version.rd +0 -24
  432. data/doc/en/cairo-svg-version.rdc +0 -24
  433. data/doc/en/cairo-temp-file-error.rd +0 -17
  434. data/doc/en/cairo-text-extents.rd +0 -44
  435. data/doc/en/cairo-win32-printing-surface.rd +0 -27
  436. data/doc/en/cairo-win32-surface.rd +0 -31
  437. data/doc/en/cairo-write-error.rd +0 -17
  438. data/doc/en/cairo.rbl +0 -80
  439. data/doc/en/cairo.rd +0 -95
  440. data/doc/en/cairo.rdc +0 -95
  441. data/doc/en/index.rbl +0 -1
  442. data/doc/en/index.rd +0 -1051
  443. data/doc/en/index.rdc +0 -1051
  444. data/samples/agg/aa_demo.rb +0 -47
  445. data/src/lib/cairo/table.rb +0 -29
@@ -3,7 +3,7 @@
3
3
  * Ruby Cairo Binding
4
4
  *
5
5
  * $Author: kou $
6
- * $Date: 2008-06-20 02:01:53 $
6
+ * $Date: 2008-08-16 12:52:17 $
7
7
  *
8
8
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
9
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
@@ -15,7 +15,11 @@
15
15
  #include "rb_cairo.h"
16
16
  #include "rb_cairo_private.h"
17
17
 
18
- #include <st.h>
18
+ #ifdef HAVE_RUBY_ST_H
19
+ # include <ruby/st.h>
20
+ #else
21
+ # include <st.h>
22
+ #endif
19
23
 
20
24
  #ifdef CAIRO_HAS_WIN32_SURFACE
21
25
  # define OpenFile OpenFile_win32
@@ -62,8 +66,6 @@ static ID cr_id_inspect;
62
66
  static ID cr_id_parse;
63
67
  static ID cr_id_size;
64
68
  static ID cr_id_set_unit;
65
- static ID cr_id_instances;
66
- static ID cr_id_dup;
67
69
  static cairo_user_data_key_t cr_closure_key;
68
70
  static cairo_user_data_key_t cr_object_holder_key;
69
71
  static cairo_user_data_key_t cr_finished_key;
@@ -131,7 +133,7 @@ cr_surface_get_klass (cairo_surface_t *surface)
131
133
  break;
132
134
  #endif
133
135
  default:
134
- rb_raise (rb_eArgError, "unknown source type: %d", type);
136
+ klass = rb_cCairo_Surface;
135
137
  break;
136
138
  }
137
139
 
@@ -157,6 +159,11 @@ typedef struct cr_io_callback_closure {
157
159
  unsigned int length;
158
160
  } cr_io_callback_closure_t;
159
161
 
162
+ typedef struct cr_invoke_data {
163
+ cr_callback_func_t func;
164
+ VALUE data;
165
+ } cr_invoke_data_t;
166
+
160
167
  #if HAS_CREATE_CR_CLOSURE_SURFACE
161
168
  static cr_io_callback_closure_t *
162
169
  cr_closure_new (VALUE target)
@@ -192,6 +199,17 @@ cr_surface_io_func_rescue (VALUE io_closure)
192
199
  return Qnil;
193
200
  }
194
201
 
202
+ static VALUE
203
+ cr_surface_invoke_io_func (VALUE user_data)
204
+ {
205
+ cr_invoke_data_t *data;
206
+
207
+ data = (cr_invoke_data_t *)user_data;
208
+ return rb_rescue2 (data->func, data->data,
209
+ cr_surface_io_func_rescue, data->data, rb_eException,
210
+ (VALUE)0);
211
+ }
212
+
195
213
  /* write callback */
196
214
  static VALUE
197
215
  cr_surface_write_func_invoke (VALUE write_closure)
@@ -224,15 +242,16 @@ cr_surface_write_func (void *write_closure,
224
242
  const unsigned char *data, unsigned int length)
225
243
  {
226
244
  cr_io_callback_closure_t *closure;
245
+ cr_invoke_data_t invoke_data;
227
246
 
228
247
  closure = (cr_io_callback_closure_t *)write_closure;
229
248
  closure->data = (unsigned char *)data;
230
249
  closure->length = length;
231
-
232
- rb_rescue2 (cr_surface_write_func_invoke, (VALUE) closure,
233
- cr_surface_io_func_rescue, (VALUE) closure, rb_eException,
234
- (VALUE)0);
235
-
250
+
251
+ invoke_data.func = cr_surface_write_func_invoke;
252
+ invoke_data.data = (VALUE)closure;
253
+ rb_cairo__invoke_callback (cr_surface_invoke_io_func, (VALUE)&invoke_data);
254
+
236
255
  if (NIL_P (closure->error))
237
256
  return CAIRO_STATUS_SUCCESS;
238
257
  else
@@ -268,14 +287,16 @@ cr_surface_read_func (void *read_closure,
268
287
  unsigned char *data, unsigned int length)
269
288
  {
270
289
  cr_io_callback_closure_t *closure;
290
+ cr_invoke_data_t invoke_data;
271
291
 
272
292
  closure = (cr_io_callback_closure_t *)read_closure;
273
293
  closure->data = data;
274
294
  closure->length = length;
275
- rb_rescue2 (cr_surface_read_func_invoke, (VALUE) closure,
276
- cr_surface_io_func_rescue, (VALUE) closure, rb_eException,
277
- (VALUE)0);
278
-
295
+
296
+ invoke_data.func = cr_surface_read_func_invoke;
297
+ invoke_data.data = (VALUE)closure;
298
+ rb_cairo__invoke_callback (cr_surface_invoke_io_func, (VALUE)&invoke_data);
299
+
279
300
  if (NIL_P (closure->error))
280
301
  return CAIRO_STATUS_SUCCESS;
281
302
  else
@@ -292,47 +313,21 @@ rb_cairo_surface_from_ruby_object (VALUE obj)
292
313
  rb_raise (rb_eTypeError, "not a cairo surface");
293
314
  }
294
315
  Data_Get_Struct (obj, cairo_surface_t, surface);
316
+ if (!surface)
317
+ rb_cairo_check_status (CAIRO_STATUS_NULL_POINTER);
295
318
  return surface;
296
319
  }
297
320
 
298
- static void
299
- add_gc_guard (VALUE self)
300
- {
301
- rb_hash_aset (rb_ivar_get (rb_cCairo_Surface, cr_id_instances),
302
- self, Qnil);
303
- }
304
-
305
- static void
306
- remove_gc_guard (VALUE self)
307
- {
308
- rb_hash_delete (rb_ivar_get (rb_cCairo_Surface, cr_id_instances),
309
- self);
310
- }
311
-
312
- typedef struct cr_object_holder {
313
- VALUE object;
314
- } cr_object_holder_t;
315
-
316
- static cr_object_holder_t *
321
+ static rb_cairo__object_holder_t *
317
322
  cr_object_holder_new (VALUE object)
318
323
  {
319
- cr_object_holder_t *holder;
320
-
321
- holder = ALLOC(cr_object_holder_t);
322
- add_gc_guard (object);
323
- holder->object = object;
324
- return holder;
324
+ return rb_cairo__object_holder_new (rb_cCairo_Surface, object);
325
325
  }
326
326
 
327
327
  static void
328
328
  cr_object_holder_free (void *ptr)
329
329
  {
330
- cr_object_holder_t *holder = ptr;
331
-
332
- if (!NIL_P (holder->object))
333
- remove_gc_guard (holder->object);
334
-
335
- xfree (holder);
330
+ rb_cairo__object_holder_free (rb_cCairo_Surface, ptr);
336
331
  }
337
332
 
338
333
  static void
@@ -379,6 +374,18 @@ cr_surface_allocate (VALUE klass)
379
374
  }
380
375
 
381
376
  /* Surface manipulation */
377
+ static VALUE
378
+ cr_surface_destroy (VALUE self)
379
+ {
380
+ cairo_surface_t *surface;
381
+
382
+ surface = _SELF;
383
+ cairo_surface_destroy (surface);
384
+ DATA_PTR (self) = NULL;
385
+
386
+ return self;
387
+ }
388
+
382
389
  static VALUE
383
390
  cr_surface_finish (VALUE self)
384
391
  {
@@ -556,6 +563,23 @@ cr_surface_set_fallback_resolution (VALUE self,
556
563
  return self;
557
564
  }
558
565
 
566
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
567
+ static VALUE
568
+ cr_surface_get_fallback_resolution (VALUE self)
569
+ {
570
+ double x_pixels_per_inch, y_pixels_per_inch;
571
+
572
+ cairo_surface_get_fallback_resolution (_SELF,
573
+ &x_pixels_per_inch,
574
+ &y_pixels_per_inch);
575
+ cr_surface_check_status (_SELF);
576
+ return rb_ary_new3 (2,
577
+ rb_float_new (x_pixels_per_inch),
578
+ rb_float_new (y_pixels_per_inch));
579
+ }
580
+ #endif
581
+
582
+
559
583
  #if CAIRO_CHECK_VERSION(1, 5, 2)
560
584
  static VALUE
561
585
  cr_surface_copy_page (VALUE self)
@@ -1161,8 +1185,7 @@ cr_finish_all_guarded_surfaces_at_end_iter (VALUE key, VALUE value, VALUE data)
1161
1185
  static void
1162
1186
  cr_finish_all_guarded_surfaces_at_end (VALUE data)
1163
1187
  {
1164
- rb_hash_foreach (rb_funcall (rb_ivar_get (rb_cCairo_Surface, cr_id_instances),
1165
- cr_id_dup, 0),
1188
+ rb_hash_foreach (rb_cairo__gc_guarded_objects (rb_cCairo_Surface),
1166
1189
  cr_finish_all_guarded_surfaces_at_end_iter,
1167
1190
  Qnil);
1168
1191
  }
@@ -1177,20 +1200,18 @@ Init_cairo_surface (void)
1177
1200
  cr_id_parse = rb_intern ("parse");
1178
1201
  cr_id_size = rb_intern ("size");
1179
1202
  cr_id_set_unit = rb_intern ("unit=");
1180
- cr_id_instances = rb_intern ("instances");
1181
- cr_id_dup = rb_intern ("dup");
1182
-
1183
- rb_set_end_proc(cr_finish_all_guarded_surfaces_at_end, Qnil);
1184
1203
 
1185
1204
  rb_cCairo_Surface =
1186
1205
  rb_define_class_under (rb_mCairo, "Surface", rb_cObject);
1187
1206
  rb_define_alloc_func (rb_cCairo_Surface, cr_surface_allocate);
1188
1207
 
1189
- rb_ivar_set (rb_cCairo_Surface, cr_id_instances, rb_hash_new ());
1208
+ rb_cairo__initialize_gc_guard_holder_class (rb_cCairo_Surface);
1209
+ rb_set_end_proc(cr_finish_all_guarded_surfaces_at_end, Qnil);
1190
1210
 
1191
1211
 
1192
1212
  rb_define_method (rb_cCairo_Surface, "create_similar",
1193
1213
  cr_surface_create_similar, 3);
1214
+ rb_define_method (rb_cCairo_Surface, "destroy", cr_surface_destroy, 0);
1194
1215
  rb_define_method (rb_cCairo_Surface, "finish", cr_surface_finish, 0);
1195
1216
  rb_define_method (rb_cCairo_Surface, "content", cr_surface_get_content, 0);
1196
1217
 
@@ -1204,6 +1225,10 @@ Init_cairo_surface (void)
1204
1225
  cr_surface_get_device_offset, 0);
1205
1226
  rb_define_method (rb_cCairo_Surface, "set_fallback_resolution",
1206
1227
  cr_surface_set_fallback_resolution, 2);
1228
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
1229
+ rb_define_method (rb_cCairo_Surface, "fallback_resolution",
1230
+ cr_surface_get_fallback_resolution, 0);
1231
+ #endif
1207
1232
  #if CAIRO_CHECK_VERSION(1, 5, 2)
1208
1233
  rb_define_method (rb_cCairo_Surface, "copy_page",
1209
1234
  cr_surface_copy_page, 2);
@@ -0,0 +1,151 @@
1
+ /* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Ruby Cairo Binding
4
+ *
5
+ * $Author: kou $
6
+ * $Date: 2008-08-16 08:16:40 $
7
+ *
8
+ * Copyright 2008 Kouhei Sutou <kou@cozmixng.org>
9
+ *
10
+ * This file is made available under the same terms as Ruby
11
+ *
12
+ */
13
+
14
+
15
+ #include "rb_cairo.h"
16
+ #include "rb_cairo_private.h"
17
+
18
+ VALUE rb_cCairo_TextCluster = Qnil;
19
+
20
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
21
+ #define _SELF(self) (RVAL2CRTEXTCLUSTER(self))
22
+
23
+ cairo_text_cluster_t *
24
+ rb_cairo_text_cluster_from_ruby_object (VALUE obj)
25
+ {
26
+ cairo_text_cluster_t *cluster;
27
+ if (!rb_cairo__is_kind_of (obj, rb_cCairo_TextCluster))
28
+ {
29
+ rb_raise (rb_eTypeError,
30
+ "not a cairo cluster: %s", rb_cairo__inspect (obj));
31
+ }
32
+ Data_Get_Struct (obj, cairo_text_cluster_t, cluster);
33
+ return cluster;
34
+ }
35
+
36
+ static void
37
+ cr_text_cluster_free (void *ptr)
38
+ {
39
+ if (ptr)
40
+ {
41
+ xfree (ptr);
42
+ }
43
+ }
44
+
45
+ VALUE
46
+ rb_cairo_text_cluster_to_ruby_object (cairo_text_cluster_t *cluster)
47
+ {
48
+ if (cluster)
49
+ {
50
+ cairo_text_cluster_t *new_cluster;
51
+
52
+ new_cluster = ALLOC (cairo_text_cluster_t);
53
+ *new_cluster = *cluster;
54
+ return Data_Wrap_Struct (rb_cCairo_TextCluster, NULL,
55
+ cr_text_cluster_free, new_cluster);
56
+ }
57
+ else
58
+ {
59
+ return Qnil;
60
+ }
61
+ }
62
+
63
+ static VALUE
64
+ cr_text_cluster_allocate (VALUE klass)
65
+ {
66
+ return Data_Wrap_Struct (klass, NULL, cr_text_cluster_free, NULL);
67
+ }
68
+
69
+ static VALUE
70
+ cr_text_cluster_initialize (VALUE self, VALUE num_bytes, VALUE num_glyphs)
71
+ {
72
+ cairo_text_cluster_t *cluster;
73
+
74
+ cluster = ALLOC (cairo_text_cluster_t);
75
+ cluster->num_bytes = NUM2INT (num_bytes);
76
+ cluster->num_glyphs = NUM2INT (num_glyphs);
77
+
78
+ DATA_PTR (self) = cluster;
79
+ return Qnil;
80
+ }
81
+
82
+ static VALUE
83
+ cr_text_cluster_num_bytes (VALUE self)
84
+ {
85
+ return INT2NUM (_SELF(self)->num_bytes);
86
+ }
87
+
88
+ static VALUE
89
+ cr_text_cluster_num_glyphs (VALUE self)
90
+ {
91
+ return INT2NUM (_SELF(self)->num_glyphs);
92
+ }
93
+
94
+ static VALUE
95
+ cr_text_cluster_set_num_bytes (VALUE self, VALUE num_bytes)
96
+ {
97
+ _SELF(self)->num_bytes = NUM2INT (num_bytes);
98
+ return self;
99
+ }
100
+
101
+ static VALUE
102
+ cr_text_cluster_set_num_glyphs (VALUE self, VALUE num_glyphs)
103
+ {
104
+ _SELF(self)->num_glyphs = NUM2INT (num_glyphs);
105
+ return self;
106
+ }
107
+
108
+ static VALUE
109
+ cr_text_cluster_to_s (VALUE self)
110
+ {
111
+ VALUE ret;
112
+
113
+ ret = rb_str_new2 ("#<");
114
+ rb_str_cat2 (ret, rb_class2name (CLASS_OF (self)));
115
+ rb_str_cat2 (ret, ": ");
116
+ rb_str_cat2 (ret, "num_bytes=");
117
+ rb_str_concat (ret, rb_inspect (cr_text_cluster_num_bytes (self)));
118
+ rb_str_cat2 (ret, ", ");
119
+ rb_str_cat2 (ret, "num_glyphs=");
120
+ rb_str_concat (ret, rb_inspect (cr_text_cluster_num_glyphs (self)));
121
+ rb_str_cat2 (ret, ">");
122
+
123
+ return ret;
124
+ }
125
+ #endif
126
+
127
+ void
128
+ Init_cairo_text_cluster (void)
129
+ {
130
+ #if CAIRO_CHECK_VERSION(1, 7, 2)
131
+ rb_cCairo_TextCluster = rb_define_class_under (rb_mCairo, "TextCluster", rb_cObject);
132
+
133
+ rb_define_alloc_func (rb_cCairo_TextCluster, cr_text_cluster_allocate);
134
+
135
+ rb_define_method (rb_cCairo_TextCluster, "initialize",
136
+ cr_text_cluster_initialize, 2);
137
+
138
+ rb_define_method (rb_cCairo_TextCluster, "num_bytes",
139
+ cr_text_cluster_num_bytes, 0);
140
+ rb_define_method (rb_cCairo_TextCluster, "num_glyphs",
141
+ cr_text_cluster_num_glyphs, 0);
142
+ rb_define_method (rb_cCairo_TextCluster, "set_num_bytes",
143
+ cr_text_cluster_set_num_bytes, 1);
144
+ rb_define_method (rb_cCairo_TextCluster, "set_num_glyphs",
145
+ cr_text_cluster_set_num_glyphs, 1);
146
+
147
+ rb_define_method (rb_cCairo_TextCluster, "to_s", cr_text_cluster_to_s, 0);
148
+
149
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_TextCluster);
150
+ #endif
151
+ }
@@ -3,7 +3,7 @@
3
3
  * Ruby Cairo Binding
4
4
  *
5
5
  * $Author: kou $
6
- * $Date: 2007/05/03 02:47:39 $
6
+ * $Date: 2008-08-17 05:41:28 $
7
7
  *
8
8
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
9
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
@@ -46,6 +46,29 @@ rb_cairo_text_extents_to_ruby_object (cairo_text_extents_t *extents)
46
46
  }
47
47
  }
48
48
 
49
+ static VALUE
50
+ cr_text_extents_allocate (VALUE klass)
51
+ {
52
+ return Data_Wrap_Struct (klass, NULL, -1, NULL);
53
+ }
54
+
55
+ static VALUE
56
+ cr_text_extents_initialize (VALUE self)
57
+ {
58
+ cairo_text_extents_t *extents;
59
+
60
+ extents = ALLOC (cairo_text_extents_t);
61
+ extents->x_bearing = 0.0;
62
+ extents->y_bearing = -1.0;
63
+ extents->width = 0.0;
64
+ extents->height = 1.0;
65
+ extents->x_advance = 1.0;
66
+ extents->y_advance = 0.0;
67
+
68
+ DATA_PTR (self) = extents;
69
+
70
+ return Qnil;
71
+ }
49
72
 
50
73
  static VALUE
51
74
  cr_text_extents_x_bearing (VALUE self)
@@ -53,36 +76,78 @@ cr_text_extents_x_bearing (VALUE self)
53
76
  return rb_float_new (_SELF(self)->x_bearing);
54
77
  }
55
78
 
79
+ static VALUE
80
+ cr_text_extents_set_x_bearing (VALUE self, VALUE x_bearing)
81
+ {
82
+ _SELF(self)->x_bearing = NUM2DBL (x_bearing);
83
+ return Qnil;
84
+ }
85
+
56
86
  static VALUE
57
87
  cr_text_extents_y_bearing (VALUE self)
58
88
  {
59
89
  return rb_float_new (_SELF(self)->y_bearing);
60
90
  }
61
91
 
92
+ static VALUE
93
+ cr_text_extents_set_y_bearing (VALUE self, VALUE y_bearing)
94
+ {
95
+ _SELF(self)->y_bearing = NUM2DBL (y_bearing);
96
+ return Qnil;
97
+ }
98
+
62
99
  static VALUE
63
100
  cr_text_extents_width (VALUE self)
64
101
  {
65
102
  return rb_float_new (_SELF(self)->width);
66
103
  }
67
104
 
105
+ static VALUE
106
+ cr_text_extents_set_width (VALUE self, VALUE width)
107
+ {
108
+ _SELF(self)->width = NUM2DBL (width);
109
+ return Qnil;
110
+ }
111
+
68
112
  static VALUE
69
113
  cr_text_extents_height (VALUE self)
70
114
  {
71
115
  return rb_float_new (_SELF(self)->height);
72
116
  }
73
117
 
118
+ static VALUE
119
+ cr_text_extents_set_height (VALUE self, VALUE height)
120
+ {
121
+ _SELF(self)->height = NUM2DBL (height);
122
+ return Qnil;
123
+ }
124
+
74
125
  static VALUE
75
126
  cr_text_extents_x_advance (VALUE self)
76
127
  {
77
128
  return rb_float_new (_SELF(self)->x_advance);
78
129
  }
79
130
 
131
+ static VALUE
132
+ cr_text_extents_set_x_advance (VALUE self, VALUE x_advance)
133
+ {
134
+ _SELF(self)->x_advance = NUM2DBL (x_advance);
135
+ return Qnil;
136
+ }
137
+
80
138
  static VALUE
81
139
  cr_text_extents_y_advance (VALUE self)
82
140
  {
83
141
  return rb_float_new (_SELF(self)->y_advance);
84
142
  }
85
143
 
144
+ static VALUE
145
+ cr_text_extents_set_y_advance (VALUE self, VALUE y_advance)
146
+ {
147
+ _SELF(self)->y_advance = NUM2DBL (y_advance);
148
+ return Qnil;
149
+ }
150
+
86
151
  static VALUE
87
152
  cr_text_extents_to_s (VALUE self)
88
153
  {
@@ -109,7 +174,7 @@ cr_text_extents_to_s (VALUE self)
109
174
  rb_str_cat2 (ret, "y_advance=");
110
175
  rb_str_concat (ret, rb_inspect (cr_text_extents_y_advance (self)));
111
176
  rb_str_cat2 (ret, ">");
112
-
177
+
113
178
  return ret;
114
179
  }
115
180
 
@@ -119,20 +184,38 @@ Init_cairo_text_extents (void)
119
184
  {
120
185
  rb_cCairo_TextExtents =
121
186
  rb_define_class_under (rb_mCairo, "TextExtents", rb_cObject);
187
+ rb_define_alloc_func (rb_cCairo_TextExtents, cr_text_extents_allocate);
188
+
189
+ rb_define_method (rb_cCairo_TextExtents, "initialize",
190
+ cr_text_extents_initialize, 0);
122
191
 
123
192
  rb_define_method (rb_cCairo_TextExtents, "x_bearing",
124
193
  cr_text_extents_x_bearing, 0);
194
+ rb_define_method (rb_cCairo_TextExtents, "set_x_bearing",
195
+ cr_text_extents_set_x_bearing, 1);
125
196
  rb_define_method (rb_cCairo_TextExtents, "y_bearing",
126
197
  cr_text_extents_y_bearing, 0);
198
+ rb_define_method (rb_cCairo_TextExtents, "set_y_bearing",
199
+ cr_text_extents_set_y_bearing, 1);
127
200
  rb_define_method (rb_cCairo_TextExtents, "width",
128
201
  cr_text_extents_width, 0);
202
+ rb_define_method (rb_cCairo_TextExtents, "set_width",
203
+ cr_text_extents_set_width, 1);
129
204
  rb_define_method (rb_cCairo_TextExtents, "height",
130
205
  cr_text_extents_height, 0);
206
+ rb_define_method (rb_cCairo_TextExtents, "set_height",
207
+ cr_text_extents_set_height, 1);
131
208
  rb_define_method (rb_cCairo_TextExtents, "x_advance",
132
209
  cr_text_extents_x_advance, 0);
210
+ rb_define_method (rb_cCairo_TextExtents, "set_x_advance",
211
+ cr_text_extents_set_x_advance, 1);
133
212
  rb_define_method (rb_cCairo_TextExtents, "y_advance",
134
213
  cr_text_extents_y_advance, 0);
214
+ rb_define_method (rb_cCairo_TextExtents, "set_y_advance",
215
+ cr_text_extents_set_y_advance, 1);
135
216
 
136
217
  rb_define_method (rb_cCairo_TextExtents, "to_s",
137
218
  cr_text_extents_to_s, 0);
219
+
220
+ RB_CAIRO_DEF_SETTERS (rb_cCairo_TextExtents);
138
221
  }