cairo 1.6.1-x86-mswin32 → 1.7.0-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.
- data/ChangeLog +285 -0
- data/NEWS +33 -0
- data/README +15 -4
- data/Rakefile +3 -0
- data/cairo/bin/libcairo-2.dll +0 -0
- data/cairo/bin/libpng12-0.dll +0 -0
- data/cairo/include/{libpng13/png.h → png.h} +285 -135
- data/cairo/include/{libpng13/pngconf.h → pngconf.h} +116 -72
- data/cairo/lib/cairo.lib +0 -0
- data/cairo/lib/libcairo.dll.a +0 -0
- data/cairo/lib/libpng.def +361 -371
- data/cairo/lib/libpng.lib +0 -0
- data/cairo/lib/libpng12.dll.a +0 -0
- data/cairo/lib/pkgconfig/cairo-pdf.pc +1 -1
- data/cairo/lib/pkgconfig/cairo-png.pc +2 -2
- data/cairo/lib/pkgconfig/cairo-ps.pc +1 -1
- data/cairo/lib/pkgconfig/cairo-svg.pc +1 -1
- data/cairo/lib/pkgconfig/cairo-win32-font.pc +1 -1
- data/cairo/lib/pkgconfig/cairo-win32.pc +1 -1
- data/cairo/lib/pkgconfig/cairo.pc +2 -2
- data/cairo/lib/pkgconfig/libpng.pc +10 -14
- data/cairo/lib/pkgconfig/libpng12.pc +10 -0
- data/cairo/make/{cairo-1.6.4-1.sh → cairo-1.6.4-2.sh} +3 -3
- data/cairo/make/libpng-1.2.29.sh +35 -0
- data/cairo/manifest/cairo-1.6.4-2.mft +6 -0
- data/cairo/manifest/{cairo-dev-1.6.4-1.mft → cairo-dev-1.6.4-2.mft} +2 -2
- data/cairo/manifest/libpng-1.2.29.mft +2 -0
- data/cairo/manifest/libpng-dev-1.2.29.mft +12 -0
- data/cairo/share/doc/{cairo-1.6.4-1 → cairo-1.6.4-2}/COPYING +0 -0
- data/cairo/share/doc/{cairo-1.6.4-1 → cairo-1.6.4-2}/COPYING-LGPL-2.1 +0 -0
- data/cairo/share/doc/{cairo-1.6.4-1 → cairo-1.6.4-2}/COPYING-MPL-1.1 +0 -0
- data/cairo/share/man/man3/libpng.3 +3680 -0
- data/cairo/share/man/man3/libpngpf.3 +274 -0
- data/cairo/share/man/man5/png.5 +74 -0
- data/doc/en/cairo-antialias.html +0 -3
- data/doc/en/cairo-clip-not-representable-error.html +0 -3
- data/doc/en/cairo-color-base.html +0 -3
- data/doc/en/cairo-color-cmyk.html +0 -3
- data/doc/en/cairo-color-hsv.html +0 -3
- data/doc/en/cairo-color-rgb.html +0 -3
- data/doc/en/cairo-color-x11.html +0 -3
- data/doc/en/cairo-color.html +0 -3
- data/doc/en/cairo-content.html +0 -3
- data/doc/en/cairo-context-blur.html +0 -3
- data/doc/en/cairo-context-circle.html +0 -3
- data/doc/en/cairo-context-color.html +0 -3
- data/doc/en/cairo-context-path.html +0 -3
- data/doc/en/cairo-context-rectangle.html +0 -3
- data/doc/en/cairo-context-triangle.html +0 -3
- data/doc/en/cairo-context.html +119 -102
- data/doc/en/cairo-error.html +0 -3
- data/doc/en/cairo-extend.html +0 -3
- data/doc/en/cairo-file-not-found.html +0 -3
- data/doc/en/cairo-fill-rule.html +0 -3
- data/doc/en/cairo-filter.html +0 -3
- data/doc/en/cairo-font-extents.html +67 -12
- data/doc/en/cairo-font-face.html +0 -3
- data/doc/en/cairo-font-options.html +26 -14
- data/doc/en/cairo-font-slant.html +0 -3
- data/doc/en/cairo-font-type-mismatch.html +47 -0
- data/doc/en/cairo-font-weight.html +0 -3
- data/doc/en/cairo-format.html +0 -3
- data/doc/en/cairo-glyph.html +0 -3
- data/doc/en/cairo-gradient-pattern.html +0 -3
- data/doc/en/cairo-hint-metrics.html +0 -3
- data/doc/en/cairo-hint-style.html +0 -3
- data/doc/en/cairo-image-surface.html +0 -3
- data/doc/en/cairo-invalid-clusters.html +47 -0
- data/doc/en/cairo-invalid-content-error.html +0 -3
- data/doc/en/cairo-invalid-dash-error.html +0 -3
- data/doc/en/cairo-invalid-dsc-comment-error.html +0 -3
- data/doc/en/cairo-invalid-format-error.html +0 -3
- data/doc/en/cairo-invalid-index-error.html +0 -3
- data/doc/en/cairo-invalid-matrix-error.html +0 -3
- data/doc/en/cairo-invalid-path-data-error.html +0 -3
- data/doc/en/cairo-invalid-pop-group-error.html +0 -3
- data/doc/en/cairo-invalid-restore-error.html +0 -3
- data/doc/en/cairo-invalid-slant.html +47 -0
- data/doc/en/cairo-invalid-status-error.html +0 -3
- data/doc/en/cairo-invalid-stride-error.html +0 -3
- data/doc/en/cairo-invalid-string-error.html +0 -3
- data/doc/en/cairo-invalid-visual-error.html +0 -3
- data/doc/en/cairo-invalid-weight.html +47 -0
- data/doc/en/cairo-lcd-filter.html +39 -0
- data/doc/en/cairo-line-cap.html +0 -3
- data/doc/en/cairo-line-join.html +0 -3
- data/doc/en/cairo-linear-pattern.html +0 -3
- data/doc/en/cairo-matrix.html +43 -41
- data/doc/en/cairo-negative-count.html +47 -0
- data/doc/en/cairo-no-current-point-error.html +0 -3
- data/doc/en/cairo-null-pointer-error.html +0 -3
- data/doc/en/cairo-operator.html +0 -3
- data/doc/en/cairo-paper-parse-error.html +0 -3
- data/doc/en/cairo-paper-unknown-paper-name.html +0 -3
- data/doc/en/cairo-paper-unknown-unit.html +0 -3
- data/doc/en/cairo-paper-unrecognized-paper-description.html +0 -3
- data/doc/en/cairo-paper.html +0 -3
- data/doc/en/cairo-path-close-path.html +0 -3
- data/doc/en/cairo-path-curve-to.html +0 -3
- data/doc/en/cairo-path-data-type.html +0 -3
- data/doc/en/cairo-path-data.html +0 -3
- data/doc/en/cairo-path-line-to.html +0 -3
- data/doc/en/cairo-path-move-to.html +0 -3
- data/doc/en/cairo-path.html +0 -3
- data/doc/en/cairo-pattern-type-mismatch-error.html +0 -3
- data/doc/en/cairo-pattern.html +0 -3
- data/doc/en/cairo-pdf-surface.html +0 -3
- data/doc/en/cairo-point.html +0 -3
- data/doc/en/cairo-ps-level.html +0 -3
- data/doc/en/cairo-ps-surface.html +0 -3
- data/doc/en/cairo-quartz-image-surface.html +0 -3
- data/doc/en/cairo-quartz-surface.html +0 -3
- data/doc/en/cairo-radial-pattern.html +0 -3
- data/doc/en/cairo-read-error.html +0 -3
- data/doc/en/cairo-rectangle.html +0 -3
- data/doc/en/cairo-scaled-font.html +13 -6
- data/doc/en/cairo-solid-pattern.html +0 -3
- data/doc/en/cairo-subpixel-order.html +0 -3
- data/doc/en/cairo-surface-finished-error.html +0 -3
- data/doc/en/cairo-surface-pattern.html +0 -3
- data/doc/en/cairo-surface-type-mismatch-error.html +0 -3
- data/doc/en/cairo-surface.html +22 -15
- data/doc/en/cairo-svg-surface.html +0 -3
- data/doc/en/cairo-svg-version.html +0 -3
- data/doc/en/cairo-temp-file-error.html +0 -3
- data/doc/en/cairo-text-cluster.html +84 -0
- data/doc/en/cairo-text-extents.html +78 -13
- data/doc/en/cairo-toy-font-face.html +67 -0
- data/doc/en/cairo-user-font-error.html +47 -0
- data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +94 -0
- data/doc/en/cairo-user-font-face.html +72 -0
- data/doc/en/cairo-user-font-immutable.html +47 -0
- data/doc/en/cairo-win32-printing-surface.html +0 -3
- data/doc/en/cairo-win32-surface.html +0 -3
- data/doc/en/cairo-write-error.html +0 -3
- data/doc/en/cairo.html +92 -80
- data/doc/en/index.html +327 -240
- data/doc/ja/cairo-clip-not-representable-error.html +1 -1
- data/doc/ja/cairo-color-base.html +1 -1
- data/doc/ja/cairo-color-cmyk.html +9 -9
- data/doc/ja/cairo-color-hsv.html +8 -8
- data/doc/ja/cairo-color-rgb.html +9 -9
- data/doc/ja/cairo-color.html +8 -8
- data/doc/ja/cairo-context-circle.html +1 -1
- data/doc/ja/cairo-context-color.html +1 -1
- data/doc/ja/cairo-context-path.html +2 -2
- data/doc/ja/cairo-context.html +435 -342
- data/doc/ja/cairo-font-extents.html +69 -15
- data/doc/ja/cairo-font-face.html +3 -3
- data/doc/ja/cairo-font-options.html +37 -12
- data/doc/ja/cairo-font-slant.html +1 -1
- data/doc/ja/cairo-font-type-mismatch.html +52 -0
- data/doc/ja/cairo-glyph.html +5 -5
- data/doc/ja/cairo-gradient-pattern.html +6 -6
- data/doc/ja/cairo-image-surface.html +8 -8
- data/doc/ja/cairo-invalid-clusters.html +55 -0
- data/doc/ja/cairo-invalid-restore-error.html +1 -1
- data/doc/ja/cairo-invalid-slant.html +57 -0
- data/doc/ja/cairo-invalid-weight.html +57 -0
- data/doc/ja/cairo-lcd-filter.html +63 -0
- data/doc/ja/cairo-line-join.html +1 -1
- data/doc/ja/cairo-linear-pattern.html +2 -2
- data/doc/ja/cairo-matrix.html +35 -24
- data/doc/ja/cairo-negative-count.html +52 -0
- data/doc/ja/cairo-paper-unknown-paper-name.html +2 -2
- data/doc/ja/cairo-paper-unknown-unit.html +2 -2
- data/doc/ja/cairo-paper-unrecognized-paper-description.html +1 -1
- data/doc/ja/cairo-paper.html +12 -12
- data/doc/ja/cairo-path-close-path.html +1 -1
- data/doc/ja/cairo-path-curve-to.html +1 -1
- data/doc/ja/cairo-path-data.html +8 -8
- data/doc/ja/cairo-path-line-to.html +1 -1
- data/doc/ja/cairo-path-move-to.html +1 -1
- data/doc/ja/cairo-path.html +21 -21
- data/doc/ja/cairo-pattern.html +4 -4
- data/doc/ja/cairo-pdf-surface.html +2 -2
- data/doc/ja/cairo-point.html +5 -5
- data/doc/ja/cairo-ps-level.html +2 -2
- data/doc/ja/cairo-ps-surface.html +6 -6
- data/doc/ja/cairo-quartz-image-surface.html +2 -2
- data/doc/ja/cairo-quartz-surface.html +3 -3
- data/doc/ja/cairo-radial-pattern.html +2 -2
- data/doc/ja/cairo-rectangle.html +5 -5
- data/doc/ja/cairo-scaled-font.html +53 -17
- data/doc/ja/cairo-solid-pattern.html +3 -3
- data/doc/ja/cairo-surface-pattern.html +2 -2
- data/doc/ja/cairo-surface.html +58 -36
- data/doc/ja/cairo-svg-surface.html +4 -4
- data/doc/ja/cairo-svg-version.html +2 -2
- data/doc/ja/cairo-text-cluster.html +102 -0
- data/doc/ja/cairo-text-extents.html +84 -22
- data/doc/ja/cairo-toy-font-face.html +107 -0
- data/doc/ja/cairo-user-font-error.html +55 -0
- data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +155 -0
- data/doc/ja/cairo-user-font-face.html +268 -0
- data/doc/ja/cairo-user-font-immutable.html +54 -0
- data/doc/ja/cairo-win32-printing-surface.html +3 -3
- data/doc/ja/cairo-win32-surface.html +4 -4
- data/doc/ja/cairo.html +110 -77
- data/doc/ja/index.html +292 -205
- data/extconf.rb +3 -1
- data/misc/update-colors.rb +0 -0
- data/pkg-config.rb +54 -28
- data/samples/agg/aa_test.rb +0 -0
- data/samples/blur.rb +0 -0
- data/samples/png.rb +0 -0
- data/samples/scalable.rb +0 -0
- data/samples/text-on-path.rb +0 -0
- data/samples/text2.rb +0 -0
- data/src/cairo.def +8 -0
- data/src/cairo.so +0 -0
- data/src/lib/cairo.rb +12 -7
- data/src/lib/cairo/constants.rb +1 -0
- data/src/libruby-cairo.a +0 -0
- data/src/rb_cairo.c +25 -3
- data/src/rb_cairo.h +29 -18
- data/src/rb_cairo_constants.c +39 -10
- data/src/rb_cairo_context.c +156 -15
- data/src/rb_cairo_exception.c +143 -3
- data/src/rb_cairo_font_extents.c +81 -6
- data/src/rb_cairo_font_face.c +646 -4
- data/src/rb_cairo_font_options.c +24 -2
- data/src/rb_cairo_glyph.c +5 -3
- data/src/rb_cairo_matrix.c +17 -1
- data/src/rb_cairo_pattern.c +4 -4
- data/src/rb_cairo_private.c +169 -5
- data/src/rb_cairo_private.h +45 -3
- data/src/rb_cairo_scaled_font.c +61 -3
- data/src/rb_cairo_surface.c +174 -59
- data/src/rb_cairo_text_cluster.c +151 -0
- data/src/rb_cairo_text_extents.c +85 -2
- data/test-unit/Rakefile +30 -0
- data/test-unit/bin/testrb +5 -0
- data/test-unit/lib/test/unit.rb +280 -0
- data/test-unit/lib/test/unit/assertionfailederror.rb +14 -0
- data/test-unit/lib/test/unit/assertions.rb +722 -0
- data/test-unit/lib/test/unit/attribute.rb +125 -0
- data/test-unit/lib/test/unit/autorunner.rb +254 -0
- data/test-unit/lib/test/unit/collector.rb +43 -0
- data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
- data/test-unit/lib/test/unit/collector/dir.rb +108 -0
- data/test-unit/lib/test/unit/collector/load.rb +135 -0
- data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
- data/test-unit/lib/test/unit/color.rb +61 -0
- data/test-unit/lib/test/unit/diff.rb +524 -0
- data/test-unit/lib/test/unit/error.rb +124 -0
- data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
- data/test-unit/lib/test/unit/failure.rb +110 -0
- data/test-unit/lib/test/unit/fixture.rb +185 -0
- data/test-unit/lib/test/unit/notification.rb +125 -0
- data/test-unit/lib/test/unit/omission.rb +143 -0
- data/test-unit/lib/test/unit/pending.rb +146 -0
- data/test-unit/lib/test/unit/priority.rb +146 -0
- data/test-unit/lib/test/unit/runner/console.rb +46 -0
- data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
- data/test-unit/lib/test/unit/testcase.rb +281 -0
- data/test-unit/lib/test/unit/testresult.rb +89 -0
- data/test-unit/lib/test/unit/testsuite.rb +110 -0
- data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +195 -0
- data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/test-unit/lib/test/unit/ui/testrunner.rb +20 -0
- data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
- data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
- data/test-unit/lib/test/unit/util/observable.rb +90 -0
- data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
- data/test-unit/lib/test/unit/version.rb +7 -0
- data/test-unit/sample/adder.rb +13 -0
- data/test-unit/sample/subtracter.rb +12 -0
- data/test-unit/sample/tc_adder.rb +18 -0
- data/test-unit/sample/tc_subtracter.rb +18 -0
- data/test-unit/sample/ts_examples.rb +7 -0
- data/test-unit/test/collector/test_descendant.rb +135 -0
- data/test-unit/test/collector/test_dir.rb +406 -0
- data/test-unit/test/collector/test_load.rb +333 -0
- data/test-unit/test/collector/test_objectspace.rb +98 -0
- data/test-unit/test/run-test.rb +13 -0
- data/test-unit/test/test_assertions.rb +693 -0
- data/test-unit/test/test_attribute.rb +86 -0
- data/test-unit/test/test_color.rb +37 -0
- data/test-unit/test/test_diff.rb +477 -0
- data/test-unit/test/test_emacs_runner.rb +60 -0
- data/test-unit/test/test_error.rb +26 -0
- data/test-unit/test/test_failure.rb +33 -0
- data/test-unit/test/test_fixture.rb +252 -0
- data/test-unit/test/test_notification.rb +33 -0
- data/test-unit/test/test_omission.rb +81 -0
- data/test-unit/test/test_pending.rb +70 -0
- data/test-unit/test/test_priority.rb +89 -0
- data/test-unit/test/test_testcase.rb +430 -0
- data/test-unit/test/test_testresult.rb +113 -0
- data/test-unit/test/test_testsuite.rb +129 -0
- data/test-unit/test/testunit_test_util.rb +14 -0
- data/test-unit/test/ui/test_testrunmediator.rb +20 -0
- data/test-unit/test/util/test_backtracefilter.rb +41 -0
- data/test-unit/test/util/test_observable.rb +102 -0
- data/test-unit/test/util/test_procwrapper.rb +36 -0
- data/test/cairo-test-utils.rb +18 -0
- data/test/run-test.rb +14 -1
- data/test/test_constants.rb +19 -0
- data/test/test_context.rb +117 -0
- data/test/test_exception.rb +27 -0
- data/test/test_font_extents.rb +36 -0
- data/test/test_font_face.rb +244 -0
- data/test/test_font_options.rb +32 -0
- data/test/test_pkg_config.rb +3 -2
- data/test/test_scaled_font.rb +34 -0
- data/test/test_surface.rb +41 -0
- data/test/test_text_cluster.rb +32 -0
- data/test/test_text_extents.rb +40 -0
- data/test/test_text_to_glyphs_data.rb +47 -0
- metadata +129 -109
- data/cairo/bin/libpng13.dll +0 -0
- data/cairo/lib/libpng13.dll.a +0 -0
- data/cairo/lib/pkgconfig/libpng13.pc +0 -14
- data/cairo/manifest/cairo-1.6.4-1.mft +0 -6
- data/cairo/manifest/libpng-dev-1.2.8.mft +0 -7
- data/doc/en/cairo-antialias.rd +0 -16
- data/doc/en/cairo-clip-not-representable-error.rd +0 -17
- data/doc/en/cairo-color-base.rd +0 -38
- data/doc/en/cairo-color-cmyk.rd +0 -107
- data/doc/en/cairo-color-hsv.rd +0 -91
- data/doc/en/cairo-color-rgb.rd +0 -95
- data/doc/en/cairo-color-x11.rd +0 -151
- data/doc/en/cairo-color.rd +0 -213
- data/doc/en/cairo-content.rd +0 -15
- data/doc/en/cairo-context-blur.rd +0 -15
- data/doc/en/cairo-context-circle.rd +0 -15
- data/doc/en/cairo-context-color.rd +0 -15
- data/doc/en/cairo-context-path.rd +0 -19
- data/doc/en/cairo-context-rectangle.rd +0 -15
- data/doc/en/cairo-context-triangle.rd +0 -15
- data/doc/en/cairo-context.rd +0 -491
- data/doc/en/cairo-error.rd +0 -16
- data/doc/en/cairo-extend.rd +0 -16
- data/doc/en/cairo-file-not-found.rd +0 -17
- data/doc/en/cairo-fill-rule.rd +0 -14
- data/doc/en/cairo-filter.rd +0 -18
- data/doc/en/cairo-font-extents.rd +0 -40
- data/doc/en/cairo-font-face.rd +0 -14
- data/doc/en/cairo-font-options.rd +0 -94
- data/doc/en/cairo-font-slant.rd +0 -15
- data/doc/en/cairo-font-weight.rd +0 -14
- data/doc/en/cairo-format.rd +0 -22
- data/doc/en/cairo-glyph.rd +0 -62
- data/doc/en/cairo-gradient-pattern.rd +0 -41
- data/doc/en/cairo-hint-metrics.rd +0 -15
- data/doc/en/cairo-hint-style.rd +0 -17
- data/doc/en/cairo-image-surface.rd +0 -47
- data/doc/en/cairo-invalid-content-error.rd +0 -17
- data/doc/en/cairo-invalid-dash-error.rd +0 -17
- data/doc/en/cairo-invalid-dsc-comment-error.rd +0 -17
- data/doc/en/cairo-invalid-format-error.rd +0 -17
- data/doc/en/cairo-invalid-index-error.rd +0 -17
- data/doc/en/cairo-invalid-matrix-error.rd +0 -17
- data/doc/en/cairo-invalid-path-data-error.rd +0 -17
- data/doc/en/cairo-invalid-pop-group-error.rd +0 -17
- data/doc/en/cairo-invalid-restore-error.rd +0 -17
- data/doc/en/cairo-invalid-status-error.rd +0 -17
- data/doc/en/cairo-invalid-stride-error.rd +0 -17
- data/doc/en/cairo-invalid-string-error.rd +0 -17
- data/doc/en/cairo-invalid-visual-error.rd +0 -17
- data/doc/en/cairo-line-cap.rd +0 -15
- data/doc/en/cairo-line-join.rd +0 -15
- data/doc/en/cairo-linear-pattern.rd +0 -28
- data/doc/en/cairo-matrix.rd +0 -186
- data/doc/en/cairo-no-current-point-error.rd +0 -17
- data/doc/en/cairo-null-pointer-error.rd +0 -17
- data/doc/en/cairo-operator.rd +0 -26
- data/doc/en/cairo-paper-parse-error.rd +0 -17
- data/doc/en/cairo-paper-unknown-paper-name.rd +0 -30
- data/doc/en/cairo-paper-unknown-unit.rd +0 -30
- data/doc/en/cairo-paper-unrecognized-paper-description.rd +0 -30
- data/doc/en/cairo-paper.rd +0 -141
- data/doc/en/cairo-path-close-path.rd +0 -21
- data/doc/en/cairo-path-curve-to.rd +0 -21
- data/doc/en/cairo-path-data-type.rd +0 -16
- data/doc/en/cairo-path-data.rd +0 -62
- data/doc/en/cairo-path-line-to.rd +0 -21
- data/doc/en/cairo-path-move-to.rd +0 -21
- data/doc/en/cairo-path.rd +0 -109
- data/doc/en/cairo-pattern-type-mismatch-error.rd +0 -17
- data/doc/en/cairo-pattern.rd +0 -62
- data/doc/en/cairo-pdf-surface.rd +0 -27
- data/doc/en/cairo-point.rd +0 -42
- data/doc/en/cairo-ps-level.rd +0 -24
- data/doc/en/cairo-ps-surface.rd +0 -55
- data/doc/en/cairo-quartz-image-surface.rd +0 -27
- data/doc/en/cairo-quartz-surface.rd +0 -27
- data/doc/en/cairo-radial-pattern.rd +0 -28
- data/doc/en/cairo-read-error.rd +0 -17
- data/doc/en/cairo-rectangle.rd +0 -54
- data/doc/en/cairo-scaled-font.rd +0 -50
- data/doc/en/cairo-solid-pattern.rd +0 -31
- data/doc/en/cairo-subpixel-order.rd +0 -17
- data/doc/en/cairo-surface-finished-error.rd +0 -17
- data/doc/en/cairo-surface-pattern.rd +0 -27
- data/doc/en/cairo-surface-type-mismatch-error.rd +0 -17
- data/doc/en/cairo-surface.rd +0 -72
- data/doc/en/cairo-svg-surface.rd +0 -44
- data/doc/en/cairo-svg-version.rd +0 -24
- data/doc/en/cairo-temp-file-error.rd +0 -17
- data/doc/en/cairo-text-extents.rd +0 -44
- data/doc/en/cairo-win32-printing-surface.rd +0 -27
- data/doc/en/cairo-win32-surface.rd +0 -31
- data/doc/en/cairo-write-error.rd +0 -17
- data/doc/en/cairo.rd +0 -95
- data/doc/en/index.rd +0 -1051
- data/samples/agg/aa_demo.rb +0 -47
data/src/rb_cairo_context.c
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
5
|
* $Author: kou $
|
6
|
-
* $Date: 2008-
|
6
|
+
* $Date: 2008-08-17 03:00:41 $
|
7
7
|
*
|
8
8
|
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
9
|
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
@@ -15,10 +15,17 @@
|
|
15
15
|
#include "rb_cairo.h"
|
16
16
|
#include "rb_cairo_private.h"
|
17
17
|
|
18
|
+
#ifdef HAVE_RUBY_ST_H
|
19
|
+
# include <ruby/st.h>
|
20
|
+
#else
|
21
|
+
# include <st.h>
|
22
|
+
#endif
|
23
|
+
|
18
24
|
VALUE rb_cCairo_Context;
|
19
25
|
|
20
26
|
static ID cr_id_surface, cr_id_source;
|
21
27
|
static ID cr_id_plus, cr_id_minus, cr_id_multi, cr_id_div;
|
28
|
+
static cairo_user_data_key_t cr_object_holder_key;
|
22
29
|
|
23
30
|
#define _SELF (RVAL2CRCONTEXT(self))
|
24
31
|
|
@@ -57,9 +64,23 @@ rb_cairo_context_from_ruby_object (VALUE obj)
|
|
57
64
|
rb_raise (rb_eTypeError, "not a cairo graphics context");
|
58
65
|
}
|
59
66
|
Data_Get_Struct (obj, cairo_t, context);
|
67
|
+
if (!context)
|
68
|
+
rb_cairo_check_status (CAIRO_STATUS_NULL_POINTER);
|
60
69
|
return context;
|
61
70
|
}
|
62
71
|
|
72
|
+
static rb_cairo__object_holder_t *
|
73
|
+
cr_object_holder_new (VALUE object)
|
74
|
+
{
|
75
|
+
return rb_cairo__object_holder_new (rb_cCairo_Context, object);
|
76
|
+
}
|
77
|
+
|
78
|
+
static void
|
79
|
+
cr_object_holder_free (void *ptr)
|
80
|
+
{
|
81
|
+
rb_cairo__object_holder_free (rb_cCairo_Context, ptr);
|
82
|
+
}
|
83
|
+
|
63
84
|
static void
|
64
85
|
cr_context_free (void *ptr)
|
65
86
|
{
|
@@ -89,16 +110,43 @@ cr_allocate (VALUE klass)
|
|
89
110
|
return Data_Wrap_Struct (klass, NULL, cr_context_free, NULL);
|
90
111
|
}
|
91
112
|
|
113
|
+
static VALUE
|
114
|
+
cr_destroy (VALUE self)
|
115
|
+
{
|
116
|
+
cairo_t *cr;
|
117
|
+
|
118
|
+
cr = _SELF;
|
119
|
+
cairo_set_user_data (cr, &cr_object_holder_key, NULL, NULL); /* needed? */
|
120
|
+
cairo_destroy (cr);
|
121
|
+
|
122
|
+
DATA_PTR (self) = NULL;
|
123
|
+
return Qnil;
|
124
|
+
}
|
125
|
+
|
126
|
+
static VALUE
|
127
|
+
cr_destroy_with_destroy_check (VALUE self)
|
128
|
+
{
|
129
|
+
if (DATA_PTR (self))
|
130
|
+
cr_destroy (self);
|
131
|
+
return Qnil;
|
132
|
+
}
|
133
|
+
|
92
134
|
static VALUE
|
93
135
|
cr_initialize (VALUE self, VALUE target)
|
94
136
|
{
|
95
137
|
cairo_t *cr;
|
138
|
+
VALUE result = Qnil;
|
96
139
|
|
97
140
|
cr = cairo_create (RVAL2CRSURFACE (target));
|
98
141
|
cr_check_status (cr);
|
99
142
|
rb_ivar_set (self, cr_id_surface, target);
|
143
|
+
cairo_set_user_data (cr, &cr_object_holder_key,
|
144
|
+
cr_object_holder_new(self),
|
145
|
+
cr_object_holder_free);
|
100
146
|
DATA_PTR (self) = cr;
|
101
|
-
|
147
|
+
if (rb_block_given_p ())
|
148
|
+
result = rb_ensure (rb_yield, self, cr_destroy_with_destroy_check, self);
|
149
|
+
return result;
|
102
150
|
}
|
103
151
|
|
104
152
|
static VALUE
|
@@ -211,7 +259,7 @@ cr_set_source_rgb (int argc, VALUE *argv, VALUE self)
|
|
211
259
|
if (n == 1 && rb_cairo__is_kind_of (red, rb_cArray))
|
212
260
|
{
|
213
261
|
VALUE ary = red;
|
214
|
-
n =
|
262
|
+
n = RARRAY_LEN (ary);
|
215
263
|
red = rb_ary_entry (ary, 0);
|
216
264
|
green = rb_ary_entry (ary, 1);
|
217
265
|
blue = rb_ary_entry (ary, 2);
|
@@ -248,7 +296,7 @@ cr_set_source_rgba (int argc, VALUE *argv, VALUE self)
|
|
248
296
|
if (n == 1 && rb_cairo__is_kind_of (red, rb_cArray))
|
249
297
|
{
|
250
298
|
VALUE ary = red;
|
251
|
-
n =
|
299
|
+
n = RARRAY_LEN (ary);
|
252
300
|
red = rb_ary_entry (ary, 0);
|
253
301
|
green = rb_ary_entry (ary, 1);
|
254
302
|
blue = rb_ary_entry (ary, 2);
|
@@ -318,6 +366,12 @@ cr_set_source_generic (int argc, VALUE *argv, VALUE self)
|
|
318
366
|
{
|
319
367
|
return cr_set_source_rgba (argc, argv, self);
|
320
368
|
}
|
369
|
+
else if (n == 1 && rb_cairo__is_kind_of (arg1, rb_cCairo_Surface))
|
370
|
+
{
|
371
|
+
return cr_set_source_surface (self, arg1,
|
372
|
+
rb_float_new (0),
|
373
|
+
rb_float_new (0));
|
374
|
+
}
|
321
375
|
else if (n == 1)
|
322
376
|
{
|
323
377
|
return cr_set_source (self, arg1);
|
@@ -336,7 +390,7 @@ cr_set_source_generic (int argc, VALUE *argv, VALUE self)
|
|
336
390
|
"invalid argument (expect "
|
337
391
|
"(red, green, blue), (red, green, blue, alpha), "
|
338
392
|
"([red, green, blue]), ([red, green, blue, alpha]), "
|
339
|
-
"(pattern) or (surface, x, y))");
|
393
|
+
"(surface), (pattern) or (surface, x, y))");
|
340
394
|
}
|
341
395
|
}
|
342
396
|
|
@@ -413,7 +467,7 @@ cr_set_dash (int argc, VALUE *argv, VALUE self)
|
|
413
467
|
values[0] = NUM2DBL (dash_array);
|
414
468
|
cairo_set_dash (_SELF, values, 1, offset);
|
415
469
|
}
|
416
|
-
else if (NIL_P (dash_array) ||
|
470
|
+
else if (NIL_P (dash_array) || RARRAY_LEN (dash_array) == 0)
|
417
471
|
{
|
418
472
|
cairo_set_dash (_SELF, NULL, 0, offset);
|
419
473
|
}
|
@@ -421,7 +475,7 @@ cr_set_dash (int argc, VALUE *argv, VALUE self)
|
|
421
475
|
{
|
422
476
|
int i, length;
|
423
477
|
double *values;
|
424
|
-
length =
|
478
|
+
length = RARRAY_LEN (dash_array);
|
425
479
|
values = ALLOCA_N (double, length);
|
426
480
|
if (!values)
|
427
481
|
{
|
@@ -429,7 +483,7 @@ cr_set_dash (int argc, VALUE *argv, VALUE self)
|
|
429
483
|
}
|
430
484
|
for (i = 0; i < length; i++)
|
431
485
|
{
|
432
|
-
values[i] = NUM2DBL (
|
486
|
+
values[i] = NUM2DBL (RARRAY_PTR (dash_array)[i]);
|
433
487
|
}
|
434
488
|
cairo_set_dash (_SELF, values, length, offset);
|
435
489
|
}
|
@@ -588,8 +642,8 @@ cr_quadratic_curve_to (VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2)
|
|
588
642
|
VALUE current_point, x0, y0, cx1, cy1, cx2, cy2;
|
589
643
|
|
590
644
|
current_point = cr_get_current_point (self);
|
591
|
-
x0 =
|
592
|
-
y0 =
|
645
|
+
x0 = RARRAY_PTR (current_point)[0];
|
646
|
+
y0 = RARRAY_PTR (current_point)[1];
|
593
647
|
|
594
648
|
/* cx1 = x0 + 2 * ((x1 - x0) / 3.0) */
|
595
649
|
cx1 = rb_funcall (x0, cr_id_plus, 1,
|
@@ -689,8 +743,8 @@ cr_rel_quadratic_curve_to (VALUE self, VALUE dx1, VALUE dy1,
|
|
689
743
|
VALUE current_point, x0, y0;
|
690
744
|
|
691
745
|
current_point = cr_get_current_point (self);
|
692
|
-
x0 =
|
693
|
-
y0 =
|
746
|
+
x0 = RARRAY_PTR (current_point)[0];
|
747
|
+
y0 = RARRAY_PTR (current_point)[1];
|
694
748
|
return cr_quadratic_curve_to (self,
|
695
749
|
rb_funcall (dx1, cr_id_plus, 1, x0),
|
696
750
|
rb_funcall (dy1, cr_id_plus, 1, y0),
|
@@ -1017,11 +1071,31 @@ cr_clip_rectangle_list (VALUE self)
|
|
1017
1071
|
static VALUE
|
1018
1072
|
cr_select_font_face (int argc, VALUE *argv, VALUE self)
|
1019
1073
|
{
|
1020
|
-
VALUE
|
1074
|
+
VALUE rb_family, rb_slant, rb_weight;
|
1075
|
+
const char *family;
|
1021
1076
|
cairo_font_slant_t slant;
|
1022
1077
|
cairo_font_weight_t weight;
|
1023
1078
|
|
1024
|
-
rb_scan_args(argc, argv, "
|
1079
|
+
rb_scan_args(argc, argv, "03", &rb_family, &rb_slant, &rb_weight);
|
1080
|
+
|
1081
|
+
if (NIL_P (rb_family))
|
1082
|
+
{
|
1083
|
+
family = "";
|
1084
|
+
}
|
1085
|
+
else if (rb_cairo__is_kind_of (rb_family, rb_cString))
|
1086
|
+
{
|
1087
|
+
family = RSTRING_PTR (rb_family);
|
1088
|
+
}
|
1089
|
+
else if (rb_cairo__is_kind_of (rb_family, rb_cSymbol))
|
1090
|
+
{
|
1091
|
+
family = rb_id2name (SYM2ID (rb_family));
|
1092
|
+
}
|
1093
|
+
else
|
1094
|
+
{
|
1095
|
+
rb_raise (rb_eArgError,
|
1096
|
+
"family name should be nil, String or Symbol: %s",
|
1097
|
+
rb_cairo__inspect (rb_family));
|
1098
|
+
}
|
1025
1099
|
|
1026
1100
|
if (NIL_P (rb_slant))
|
1027
1101
|
slant = CAIRO_FONT_SLANT_NORMAL;
|
@@ -1033,7 +1107,7 @@ cr_select_font_face (int argc, VALUE *argv, VALUE self)
|
|
1033
1107
|
else
|
1034
1108
|
weight = RVAL2CRFONTWEIGHT (rb_weight);
|
1035
1109
|
|
1036
|
-
cairo_select_font_face (_SELF,
|
1110
|
+
cairo_select_font_face (_SELF, family, slant, weight);
|
1037
1111
|
cr_check_status (_SELF);
|
1038
1112
|
return self;
|
1039
1113
|
}
|
@@ -1117,6 +1191,46 @@ cr_show_glyphs (VALUE self, VALUE rb_glyphs)
|
|
1117
1191
|
return self;
|
1118
1192
|
}
|
1119
1193
|
|
1194
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
1195
|
+
static VALUE
|
1196
|
+
cr_has_show_text_glyphs (VALUE self)
|
1197
|
+
{
|
1198
|
+
return CBOOL2RVAL (cairo_has_show_text_glyphs (_SELF));
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
static VALUE
|
1202
|
+
cr_show_text_glyphs (VALUE self, VALUE rb_utf8, VALUE rb_glyphs,
|
1203
|
+
VALUE rb_clusters, VALUE rb_backward)
|
1204
|
+
{
|
1205
|
+
cairo_t *cr;
|
1206
|
+
const char *utf8;
|
1207
|
+
int utf8_len;
|
1208
|
+
cairo_glyph_t *glyphs = NULL;
|
1209
|
+
int num_glyphs = 0;
|
1210
|
+
cairo_text_cluster_t *clusters = NULL;
|
1211
|
+
int num_clusters = 0;
|
1212
|
+
cairo_bool_t backward;
|
1213
|
+
|
1214
|
+
cr = _SELF;
|
1215
|
+
utf8 = RSTRING_PTR (rb_utf8);
|
1216
|
+
utf8_len = RSTRING_LEN (rb_utf8);
|
1217
|
+
rb_cairo__glyphs_from_ruby_object (rb_glyphs, &glyphs, &num_glyphs);
|
1218
|
+
rb_cairo__text_clusters_from_ruby_object (rb_clusters,
|
1219
|
+
&clusters, &num_clusters);
|
1220
|
+
backward = RVAL2CBOOL (rb_backward);
|
1221
|
+
cairo_show_text_glyphs (cr, utf8, utf8_len,
|
1222
|
+
glyphs, num_glyphs,
|
1223
|
+
clusters, num_clusters,
|
1224
|
+
backward);
|
1225
|
+
if (glyphs)
|
1226
|
+
cairo_glyph_free (glyphs);
|
1227
|
+
if (clusters)
|
1228
|
+
cairo_text_cluster_free (clusters);
|
1229
|
+
|
1230
|
+
return self;
|
1231
|
+
}
|
1232
|
+
#endif
|
1233
|
+
|
1120
1234
|
static VALUE
|
1121
1235
|
cr_get_font_face (VALUE self)
|
1122
1236
|
{
|
@@ -1370,6 +1484,21 @@ cr_copy_append_path (VALUE self, VALUE path)
|
|
1370
1484
|
return self;
|
1371
1485
|
}
|
1372
1486
|
|
1487
|
+
static int
|
1488
|
+
cr_destroy_all_guarded_contexts_at_end_iter (VALUE key, VALUE value, VALUE data)
|
1489
|
+
{
|
1490
|
+
cr_destroy (key);
|
1491
|
+
return ST_CONTINUE;
|
1492
|
+
}
|
1493
|
+
|
1494
|
+
static void
|
1495
|
+
cr_destroy_all_guarded_contexts_at_end (VALUE data)
|
1496
|
+
{
|
1497
|
+
rb_hash_foreach (rb_cairo__gc_guarded_objects (rb_cCairo_Context),
|
1498
|
+
cr_destroy_all_guarded_contexts_at_end_iter,
|
1499
|
+
Qnil);
|
1500
|
+
}
|
1501
|
+
|
1373
1502
|
void
|
1374
1503
|
Init_cairo_context (void)
|
1375
1504
|
{
|
@@ -1403,8 +1532,12 @@ Init_cairo_context (void)
|
|
1403
1532
|
|
1404
1533
|
rb_define_alloc_func (rb_cCairo_Context, cr_allocate);
|
1405
1534
|
|
1535
|
+
rb_cairo__initialize_gc_guard_holder_class (rb_cCairo_Context);
|
1536
|
+
rb_set_end_proc(cr_destroy_all_guarded_contexts_at_end, Qnil);
|
1537
|
+
|
1406
1538
|
/* Functions for manipulating state objects */
|
1407
1539
|
rb_define_method (rb_cCairo_Context, "initialize", cr_initialize, 1);
|
1540
|
+
rb_define_method (rb_cCairo_Context, "destroy", cr_destroy, 0);
|
1408
1541
|
|
1409
1542
|
rb_define_method (rb_cCairo_Context, "save", cr_save, 0);
|
1410
1543
|
rb_define_method (rb_cCairo_Context, "restore", cr_restore, 0);
|
@@ -1507,6 +1640,14 @@ Init_cairo_context (void)
|
|
1507
1640
|
#endif
|
1508
1641
|
rb_define_method (rb_cCairo_Context, "show_text", cr_show_text, 1);
|
1509
1642
|
rb_define_method (rb_cCairo_Context, "show_glyphs", cr_show_glyphs, 1);
|
1643
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
1644
|
+
rb_define_method (rb_cCairo_Context, "have_show_text_glyphs?",
|
1645
|
+
cr_has_show_text_glyphs, 0);
|
1646
|
+
rb_define_alias (rb_cCairo_Context,
|
1647
|
+
"has_show_text_glyphs?", "have_show_text_glyphs?");
|
1648
|
+
rb_define_method (rb_cCairo_Context, "show_text_glyphs",
|
1649
|
+
cr_show_text_glyphs, 4);
|
1650
|
+
#endif
|
1510
1651
|
rb_define_method (rb_cCairo_Context, "text_path", cr_text_path, 1);
|
1511
1652
|
rb_define_method (rb_cCairo_Context, "glyph_path", cr_glyph_path, 1);
|
1512
1653
|
rb_define_method (rb_cCairo_Context, "text_extents", cr_text_extents, 1);
|
data/src/rb_cairo_exception.c
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
5
|
* $Author: kou $
|
6
|
-
* $Date: 2008-
|
6
|
+
* $Date: 2008-08-16 12:52:16 $
|
7
7
|
*
|
8
8
|
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
9
|
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
@@ -13,6 +13,7 @@
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
#include "rb_cairo.h"
|
16
|
+
#include "rb_cairo_private.h"
|
16
17
|
|
17
18
|
static VALUE rb_eCairo_InvalidRestoreError;
|
18
19
|
static VALUE rb_eCairo_InvalidPopGroupError;
|
@@ -41,6 +42,15 @@ static VALUE rb_eCairo_ClipNotRepresentableError;
|
|
41
42
|
static VALUE rb_eCairo_TempFileError;
|
42
43
|
static VALUE rb_eCairo_InvalidStrideError;
|
43
44
|
#endif
|
45
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
46
|
+
static VALUE rb_eCairo_FontTypeMismatch;
|
47
|
+
static VALUE rb_eCairo_UserFontImmutable;
|
48
|
+
static VALUE rb_eCairo_UserFontError;
|
49
|
+
static VALUE rb_eCairo_NegativeCount;
|
50
|
+
static VALUE rb_eCairo_InvalidClusters;
|
51
|
+
static VALUE rb_eCairo_InvalidSlant;
|
52
|
+
static VALUE rb_eCairo_InvalidWeight;
|
53
|
+
#endif
|
44
54
|
|
45
55
|
void
|
46
56
|
rb_cairo_check_status (cairo_status_t status)
|
@@ -126,10 +136,110 @@ rb_cairo_check_status (cairo_status_t status)
|
|
126
136
|
case CAIRO_STATUS_INVALID_STRIDE:
|
127
137
|
rb_raise (rb_eCairo_InvalidStringError, string);
|
128
138
|
break;
|
139
|
+
#endif
|
140
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
141
|
+
case CAIRO_STATUS_FONT_TYPE_MISMATCH:
|
142
|
+
rb_raise (rb_eCairo_FontTypeMismatch, string);
|
143
|
+
break;
|
144
|
+
case CAIRO_STATUS_USER_FONT_IMMUTABLE:
|
145
|
+
rb_raise (rb_eCairo_UserFontImmutable, string);
|
146
|
+
break;
|
147
|
+
case CAIRO_STATUS_USER_FONT_ERROR:
|
148
|
+
rb_raise (rb_eCairo_UserFontError, string);
|
149
|
+
break;
|
150
|
+
case CAIRO_STATUS_NEGATIVE_COUNT:
|
151
|
+
rb_raise (rb_eCairo_NegativeCount, string);
|
152
|
+
break;
|
153
|
+
case CAIRO_STATUS_INVALID_CLUSTERS:
|
154
|
+
rb_raise (rb_eCairo_InvalidClusters, string);
|
155
|
+
break;
|
156
|
+
case CAIRO_STATUS_INVALID_SLANT:
|
157
|
+
rb_raise (rb_eCairo_InvalidSlant, string);
|
158
|
+
break;
|
159
|
+
case CAIRO_STATUS_INVALID_WEIGHT:
|
160
|
+
rb_raise (rb_eCairo_InvalidWeight, string);
|
161
|
+
break;
|
129
162
|
#endif
|
130
163
|
}
|
131
164
|
}
|
132
165
|
|
166
|
+
cairo_status_t
|
167
|
+
rb_cairo__exception_to_status (VALUE exception)
|
168
|
+
{
|
169
|
+
if (NIL_P (exception))
|
170
|
+
return CAIRO_STATUS_SUCCESS;
|
171
|
+
else if (rb_cairo__is_kind_of (exception, rb_eNoMemError))
|
172
|
+
return CAIRO_STATUS_NO_MEMORY;
|
173
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidRestoreError))
|
174
|
+
return CAIRO_STATUS_INVALID_RESTORE;
|
175
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidPopGroupError))
|
176
|
+
return CAIRO_STATUS_INVALID_POP_GROUP;
|
177
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_NoCurrentPointError))
|
178
|
+
return CAIRO_STATUS_NO_CURRENT_POINT;
|
179
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidMatrixError))
|
180
|
+
return CAIRO_STATUS_INVALID_MATRIX;
|
181
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidStatusError))
|
182
|
+
return CAIRO_STATUS_INVALID_STATUS;
|
183
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_NullPointerError))
|
184
|
+
return CAIRO_STATUS_NULL_POINTER;
|
185
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidStringError))
|
186
|
+
return CAIRO_STATUS_INVALID_STRING;
|
187
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidPathDataError))
|
188
|
+
return CAIRO_STATUS_INVALID_PATH_DATA;
|
189
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_ReadError))
|
190
|
+
return CAIRO_STATUS_READ_ERROR;
|
191
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_WriteError))
|
192
|
+
return CAIRO_STATUS_WRITE_ERROR;
|
193
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_SurfaceFinishedError))
|
194
|
+
return CAIRO_STATUS_SURFACE_FINISHED;
|
195
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_SurfaceTypeMismatchError))
|
196
|
+
return CAIRO_STATUS_SURFACE_TYPE_MISMATCH;
|
197
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_PatternTypeMismatchError))
|
198
|
+
return CAIRO_STATUS_PATTERN_TYPE_MISMATCH;
|
199
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidContentError))
|
200
|
+
return CAIRO_STATUS_INVALID_CONTENT;
|
201
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidFormatError))
|
202
|
+
return CAIRO_STATUS_INVALID_FORMAT;
|
203
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidVisualError))
|
204
|
+
return CAIRO_STATUS_INVALID_VISUAL;
|
205
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_FileNotFoundError))
|
206
|
+
return CAIRO_STATUS_FILE_NOT_FOUND;
|
207
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidDashError))
|
208
|
+
return CAIRO_STATUS_INVALID_DASH;
|
209
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidDscCommentError))
|
210
|
+
return CAIRO_STATUS_INVALID_DSC_COMMENT;
|
211
|
+
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
212
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidIndexError))
|
213
|
+
return CAIRO_STATUS_INVALID_INDEX;
|
214
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_ClipNotRepresentableError))
|
215
|
+
return CAIRO_STATUS_CLIP_NOT_REPRESENTABLE;
|
216
|
+
#endif
|
217
|
+
#if CAIRO_CHECK_VERSION(1, 5, 6)
|
218
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_TempFileError))
|
219
|
+
return CAIRO_STATUS_TEMP_FILE_ERROR;
|
220
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidStringError))
|
221
|
+
return CAIRO_STATUS_INVALID_STRIDE;
|
222
|
+
#endif
|
223
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
224
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_FontTypeMismatch))
|
225
|
+
return CAIRO_STATUS_FONT_TYPE_MISMATCH;
|
226
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_UserFontImmutable))
|
227
|
+
return CAIRO_STATUS_USER_FONT_IMMUTABLE;
|
228
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_UserFontError))
|
229
|
+
return CAIRO_STATUS_USER_FONT_ERROR;
|
230
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_NegativeCount))
|
231
|
+
return CAIRO_STATUS_NEGATIVE_COUNT;
|
232
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidClusters))
|
233
|
+
return CAIRO_STATUS_INVALID_CLUSTERS;
|
234
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidSlant))
|
235
|
+
return CAIRO_STATUS_INVALID_SLANT;
|
236
|
+
else if (rb_cairo__is_kind_of (exception, rb_eCairo_InvalidWeight))
|
237
|
+
return CAIRO_STATUS_INVALID_WEIGHT;
|
238
|
+
#endif
|
239
|
+
|
240
|
+
return -1;
|
241
|
+
}
|
242
|
+
|
133
243
|
void
|
134
244
|
Init_cairo_exception ()
|
135
245
|
{
|
@@ -208,7 +318,37 @@ Init_cairo_exception ()
|
|
208
318
|
rb_eCairo_Error);
|
209
319
|
|
210
320
|
rb_eCairo_InvalidStrideError =
|
211
|
-
|
212
|
-
|
321
|
+
rb_define_class_under (rb_mCairo, "InvalidStrideError",
|
322
|
+
rb_eArgError);
|
323
|
+
#endif
|
324
|
+
|
325
|
+
#if CAIRO_CHECK_VERSION(1, 7, 2)
|
326
|
+
rb_eCairo_FontTypeMismatch =
|
327
|
+
rb_define_class_under (rb_mCairo, "FontTypeMismatch",
|
328
|
+
rb_eCairo_Error);
|
329
|
+
|
330
|
+
rb_eCairo_UserFontImmutable =
|
331
|
+
rb_define_class_under (rb_mCairo, "UserFontImmutable",
|
332
|
+
rb_eCairo_Error);
|
333
|
+
|
334
|
+
rb_eCairo_UserFontError =
|
335
|
+
rb_define_class_under (rb_mCairo, "UserFontError",
|
336
|
+
rb_eCairo_Error);
|
337
|
+
|
338
|
+
rb_eCairo_NegativeCount =
|
339
|
+
rb_define_class_under (rb_mCairo, "NegativeCount",
|
340
|
+
rb_eCairo_Error);
|
341
|
+
|
342
|
+
rb_eCairo_InvalidClusters =
|
343
|
+
rb_define_class_under (rb_mCairo, "InvalidClusters",
|
344
|
+
rb_eArgError);
|
345
|
+
|
346
|
+
rb_eCairo_InvalidSlant =
|
347
|
+
rb_define_class_under (rb_mCairo, "InvalidSlant",
|
348
|
+
rb_eCairo_Error);
|
349
|
+
|
350
|
+
rb_eCairo_InvalidWeight =
|
351
|
+
rb_define_class_under (rb_mCairo, "InvalidWeight",
|
352
|
+
rb_eArgError);
|
213
353
|
#endif
|
214
354
|
}
|