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.
- data/AUTHORS +4 -0
- data/COPYING +59 -0
- data/ChangeLog +1320 -0
- data/GPL +340 -0
- data/NEWS +98 -0
- data/README +70 -0
- data/Rakefile +215 -0
- data/cairo/bin/libcairo-2.dll +0 -0
- data/cairo/bin/libpng13.dll +0 -0
- data/cairo/bin/zlib1.dll +0 -0
- data/cairo/include/cairo/cairo-deprecated.h +142 -0
- data/cairo/include/cairo/cairo-features.h +35 -0
- data/cairo/include/cairo/cairo-pdf.h +68 -0
- data/cairo/include/cairo/cairo-ps.h +114 -0
- data/cairo/include/cairo/cairo-svg.h +82 -0
- data/cairo/include/cairo/cairo-win32.h +104 -0
- data/cairo/include/cairo/cairo.h +1945 -0
- data/cairo/include/libpng13/png.h +3419 -0
- data/cairo/include/libpng13/pngconf.h +1437 -0
- data/cairo/lib/cairo.def +251 -0
- data/cairo/lib/cairo.lib +0 -0
- data/cairo/lib/libcairo.dll.a +0 -0
- data/cairo/lib/libpng.def +372 -0
- data/cairo/lib/libpng13.dll.a +0 -0
- data/cairo/lib/pkgconfig/cairo-pdf.pc +12 -0
- data/cairo/lib/pkgconfig/cairo-png.pc +12 -0
- data/cairo/lib/pkgconfig/cairo-ps.pc +12 -0
- data/cairo/lib/pkgconfig/cairo-svg.pc +12 -0
- data/cairo/lib/pkgconfig/cairo-win32-font.pc +12 -0
- data/cairo/lib/pkgconfig/cairo-win32.pc +12 -0
- data/cairo/lib/pkgconfig/cairo.pc +13 -0
- data/cairo/lib/pkgconfig/libpng.pc +14 -0
- data/cairo/lib/pkgconfig/libpng13.pc +14 -0
- data/cairo/make/cairo-1.6.4-1.sh +55 -0
- data/cairo/manifest/cairo-1.6.4-1.mft +6 -0
- data/cairo/manifest/cairo-dev-1.6.4-1.mft +72 -0
- data/cairo/manifest/libpng-dev-1.2.8.mft +7 -0
- data/cairo/share/doc/cairo-1.6.4-1/COPYING +32 -0
- data/cairo/share/doc/cairo-1.6.4-1/COPYING-LGPL-2.1 +510 -0
- data/cairo/share/doc/cairo-1.6.4-1/COPYING-MPL-1.1 +470 -0
- data/cairo/share/gtk-doc/html/cairo/Drawing.html +53 -0
- data/cairo/share/gtk-doc/html/cairo/Fonts.html +56 -0
- data/cairo/share/gtk-doc/html/cairo/Support.html +50 -0
- data/cairo/share/gtk-doc/html/cairo/Surfaces.html +65 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-errors.html +128 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-fonts.html +59 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-memory.html +129 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-overloading.html +127 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-path.html +123 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-patterns.html +63 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-return-values.html +126 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-streams.html +98 -0
- data/cairo/share/gtk-doc/html/cairo/bindings-surfaces.html +99 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Error-Handling.html +328 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Font-Options.html +720 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html +297 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Image-Surfaces.html +484 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-PDF-Surfaces.html +246 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-PNG-Support.html +345 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Paths.html +1336 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Patterns.html +1560 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html +656 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html +161 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html +232 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html +337 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html +823 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Text.html +836 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Transformations.html +462 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Types.html +143 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Version-Information.html +325 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Fonts.html +381 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-Win32-Surfaces.html +331 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-XLib-Surfaces.html +525 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-font-face-t.html +427 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html +626 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html +995 -0
- data/cairo/share/gtk-doc/html/cairo/cairo-cairo-t.html +2795 -0
- data/cairo/share/gtk-doc/html/cairo/cairo.devhelp +432 -0
- data/cairo/share/gtk-doc/html/cairo/cairo.devhelp2 +432 -0
- data/cairo/share/gtk-doc/html/cairo/home.png +0 -0
- data/cairo/share/gtk-doc/html/cairo/index-1.2.html +137 -0
- data/cairo/share/gtk-doc/html/cairo/index-1.4.html +105 -0
- data/cairo/share/gtk-doc/html/cairo/index-1.6.html +65 -0
- data/cairo/share/gtk-doc/html/cairo/index.html +134 -0
- data/cairo/share/gtk-doc/html/cairo/index.sgml +466 -0
- data/cairo/share/gtk-doc/html/cairo/ix01.html +693 -0
- data/cairo/share/gtk-doc/html/cairo/language-bindings.html +79 -0
- data/cairo/share/gtk-doc/html/cairo/left.png +0 -0
- data/cairo/share/gtk-doc/html/cairo/right.png +0 -0
- data/cairo/share/gtk-doc/html/cairo/style.css +148 -0
- data/cairo/share/gtk-doc/html/cairo/up.png +0 -0
- data/doc/doc.css +91 -0
- data/doc/en/cairo-antialias.html +41 -0
- data/doc/en/cairo-antialias.rd +16 -0
- data/doc/en/cairo-clip-not-representable-error.html +50 -0
- data/doc/en/cairo-clip-not-representable-error.rd +17 -0
- data/doc/en/cairo-color-base.html +72 -0
- data/doc/en/cairo-color-base.rd +38 -0
- data/doc/en/cairo-color-cmyk.html +160 -0
- data/doc/en/cairo-color-cmyk.rd +107 -0
- data/doc/en/cairo-color-hsv.html +140 -0
- data/doc/en/cairo-color-hsv.rd +91 -0
- data/doc/en/cairo-color-rgb.html +145 -0
- data/doc/en/cairo-color-rgb.rd +95 -0
- data/doc/en/cairo-color-x11.html +176 -0
- data/doc/en/cairo-color-x11.rd +151 -0
- data/doc/en/cairo-color.html +241 -0
- data/doc/en/cairo-color.rd +213 -0
- data/doc/en/cairo-content.html +40 -0
- data/doc/en/cairo-content.rd +15 -0
- data/doc/en/cairo-context-blur.html +42 -0
- data/doc/en/cairo-context-blur.rd +15 -0
- data/doc/en/cairo-context-circle.html +42 -0
- data/doc/en/cairo-context-circle.rd +15 -0
- data/doc/en/cairo-context-color.html +42 -0
- data/doc/en/cairo-context-color.rd +15 -0
- data/doc/en/cairo-context-path.html +47 -0
- data/doc/en/cairo-context-path.rd +19 -0
- data/doc/en/cairo-context-rectangle.html +42 -0
- data/doc/en/cairo-context-rectangle.rd +15 -0
- data/doc/en/cairo-context-triangle.html +42 -0
- data/doc/en/cairo-context-triangle.rd +15 -0
- data/doc/en/cairo-context.html +636 -0
- data/doc/en/cairo-context.rd +491 -0
- data/doc/en/cairo-error.html +47 -0
- data/doc/en/cairo-error.rd +16 -0
- data/doc/en/cairo-extend.html +41 -0
- data/doc/en/cairo-extend.rd +16 -0
- data/doc/en/cairo-file-not-found.html +50 -0
- data/doc/en/cairo-file-not-found.rd +17 -0
- data/doc/en/cairo-fill-rule.html +39 -0
- data/doc/en/cairo-fill-rule.rd +14 -0
- data/doc/en/cairo-filter.html +43 -0
- data/doc/en/cairo-filter.rd +18 -0
- data/doc/en/cairo-font-extents.html +74 -0
- data/doc/en/cairo-font-extents.rd +40 -0
- data/doc/en/cairo-font-face.html +41 -0
- data/doc/en/cairo-font-face.rd +14 -0
- data/doc/en/cairo-font-options.html +142 -0
- data/doc/en/cairo-font-options.rd +94 -0
- data/doc/en/cairo-font-slant.html +40 -0
- data/doc/en/cairo-font-slant.rd +15 -0
- data/doc/en/cairo-font-weight.html +39 -0
- data/doc/en/cairo-font-weight.rd +14 -0
- data/doc/en/cairo-format.html +49 -0
- data/doc/en/cairo-format.rd +22 -0
- data/doc/en/cairo-glyph.html +102 -0
- data/doc/en/cairo-glyph.rd +62 -0
- data/doc/en/cairo-gradient-pattern.html +77 -0
- data/doc/en/cairo-gradient-pattern.rd +41 -0
- data/doc/en/cairo-hint-metrics.html +40 -0
- data/doc/en/cairo-hint-metrics.rd +15 -0
- data/doc/en/cairo-hint-style.html +42 -0
- data/doc/en/cairo-hint-style.rd +17 -0
- data/doc/en/cairo-image-surface.html +85 -0
- data/doc/en/cairo-image-surface.rd +47 -0
- data/doc/en/cairo-invalid-content-error.html +50 -0
- data/doc/en/cairo-invalid-content-error.rd +17 -0
- data/doc/en/cairo-invalid-dash-error.html +50 -0
- data/doc/en/cairo-invalid-dash-error.rd +17 -0
- data/doc/en/cairo-invalid-dsc-comment-error.html +50 -0
- data/doc/en/cairo-invalid-dsc-comment-error.rd +17 -0
- data/doc/en/cairo-invalid-format-error.html +50 -0
- data/doc/en/cairo-invalid-format-error.rd +17 -0
- data/doc/en/cairo-invalid-index-error.html +50 -0
- data/doc/en/cairo-invalid-index-error.rd +17 -0
- data/doc/en/cairo-invalid-matrix-error.html +50 -0
- data/doc/en/cairo-invalid-matrix-error.rd +17 -0
- data/doc/en/cairo-invalid-path-data-error.html +50 -0
- data/doc/en/cairo-invalid-path-data-error.rd +17 -0
- data/doc/en/cairo-invalid-pop-group-error.html +50 -0
- data/doc/en/cairo-invalid-pop-group-error.rd +17 -0
- data/doc/en/cairo-invalid-restore-error.html +50 -0
- data/doc/en/cairo-invalid-restore-error.rd +17 -0
- data/doc/en/cairo-invalid-status-error.html +50 -0
- data/doc/en/cairo-invalid-status-error.rd +17 -0
- data/doc/en/cairo-invalid-stride-error.html +50 -0
- data/doc/en/cairo-invalid-stride-error.rd +17 -0
- data/doc/en/cairo-invalid-string-error.html +50 -0
- data/doc/en/cairo-invalid-string-error.rd +17 -0
- data/doc/en/cairo-invalid-visual-error.html +50 -0
- data/doc/en/cairo-invalid-visual-error.rd +17 -0
- data/doc/en/cairo-line-cap.html +40 -0
- data/doc/en/cairo-line-cap.rd +15 -0
- data/doc/en/cairo-line-join.html +40 -0
- data/doc/en/cairo-line-join.rd +15 -0
- data/doc/en/cairo-linear-pattern.html +63 -0
- data/doc/en/cairo-linear-pattern.rd +28 -0
- data/doc/en/cairo-matrix.html +257 -0
- data/doc/en/cairo-matrix.rd +186 -0
- data/doc/en/cairo-no-current-point-error.html +50 -0
- data/doc/en/cairo-no-current-point-error.rd +17 -0
- data/doc/en/cairo-null-pointer-error.html +50 -0
- data/doc/en/cairo-null-pointer-error.rd +17 -0
- data/doc/en/cairo-operator.html +51 -0
- data/doc/en/cairo-operator.rd +26 -0
- data/doc/en/cairo-paper-parse-error.html +50 -0
- data/doc/en/cairo-paper-parse-error.rd +17 -0
- data/doc/en/cairo-paper-unknown-paper-name.html +69 -0
- data/doc/en/cairo-paper-unknown-paper-name.rd +30 -0
- data/doc/en/cairo-paper-unknown-unit.html +69 -0
- data/doc/en/cairo-paper-unknown-unit.rd +30 -0
- data/doc/en/cairo-paper-unrecognized-paper-description.html +69 -0
- data/doc/en/cairo-paper-unrecognized-paper-description.rd +30 -0
- data/doc/en/cairo-paper.html +187 -0
- data/doc/en/cairo-paper.rd +141 -0
- data/doc/en/cairo-path-close-path.html +52 -0
- data/doc/en/cairo-path-close-path.rd +21 -0
- data/doc/en/cairo-path-curve-to.html +52 -0
- data/doc/en/cairo-path-curve-to.rd +21 -0
- data/doc/en/cairo-path-data-type.html +41 -0
- data/doc/en/cairo-path-data-type.rd +16 -0
- data/doc/en/cairo-path-data.html +101 -0
- data/doc/en/cairo-path-data.rd +62 -0
- data/doc/en/cairo-path-line-to.html +52 -0
- data/doc/en/cairo-path-line-to.rd +21 -0
- data/doc/en/cairo-path-move-to.html +52 -0
- data/doc/en/cairo-path-move-to.rd +21 -0
- data/doc/en/cairo-path.html +158 -0
- data/doc/en/cairo-path.rd +109 -0
- data/doc/en/cairo-pattern-type-mismatch-error.html +50 -0
- data/doc/en/cairo-pattern-type-mismatch-error.rd +17 -0
- data/doc/en/cairo-pattern.html +102 -0
- data/doc/en/cairo-pattern.rd +62 -0
- data/doc/en/cairo-pdf-surface.html +60 -0
- data/doc/en/cairo-pdf-surface.rd +27 -0
- data/doc/en/cairo-point.html +77 -0
- data/doc/en/cairo-point.rd +42 -0
- data/doc/en/cairo-ps-level.html +52 -0
- data/doc/en/cairo-ps-level.rd +24 -0
- data/doc/en/cairo-ps-surface.html +95 -0
- data/doc/en/cairo-ps-surface.rd +55 -0
- data/doc/en/cairo-quartz-image-surface.html +60 -0
- data/doc/en/cairo-quartz-image-surface.rd +27 -0
- data/doc/en/cairo-quartz-surface.html +60 -0
- data/doc/en/cairo-quartz-surface.rd +27 -0
- data/doc/en/cairo-radial-pattern.html +63 -0
- data/doc/en/cairo-radial-pattern.rd +28 -0
- data/doc/en/cairo-read-error.html +50 -0
- data/doc/en/cairo-read-error.rd +17 -0
- data/doc/en/cairo-rectangle.html +92 -0
- data/doc/en/cairo-rectangle.rd +54 -0
- data/doc/en/cairo-scaled-font.html +87 -0
- data/doc/en/cairo-scaled-font.rd +50 -0
- data/doc/en/cairo-solid-pattern.html +65 -0
- data/doc/en/cairo-solid-pattern.rd +31 -0
- data/doc/en/cairo-subpixel-order.html +42 -0
- data/doc/en/cairo-subpixel-order.rd +17 -0
- data/doc/en/cairo-surface-finished-error.html +50 -0
- data/doc/en/cairo-surface-finished-error.rd +17 -0
- data/doc/en/cairo-surface-pattern.html +60 -0
- data/doc/en/cairo-surface-pattern.rd +27 -0
- data/doc/en/cairo-surface-type-mismatch-error.html +50 -0
- data/doc/en/cairo-surface-type-mismatch-error.rd +17 -0
- data/doc/en/cairo-surface.html +114 -0
- data/doc/en/cairo-surface.rd +72 -0
- data/doc/en/cairo-svg-surface.html +80 -0
- data/doc/en/cairo-svg-surface.rd +44 -0
- data/doc/en/cairo-svg-version.html +52 -0
- data/doc/en/cairo-svg-version.rd +24 -0
- data/doc/en/cairo-temp-file-error.html +50 -0
- data/doc/en/cairo-temp-file-error.rd +17 -0
- data/doc/en/cairo-text-extents.html +79 -0
- data/doc/en/cairo-text-extents.rd +44 -0
- data/doc/en/cairo-win32-printing-surface.html +60 -0
- data/doc/en/cairo-win32-printing-surface.rd +27 -0
- data/doc/en/cairo-win32-surface.html +65 -0
- data/doc/en/cairo-win32-surface.rd +31 -0
- data/doc/en/cairo-write-error.html +50 -0
- data/doc/en/cairo-write-error.rd +17 -0
- data/doc/en/cairo.html +123 -0
- data/doc/en/cairo.rd +95 -0
- data/doc/en/index.html +1080 -0
- data/doc/en/index.rd +1051 -0
- data/doc/index.html +18 -0
- data/doc/ja/cairo-antialias.html +57 -0
- data/doc/ja/cairo-clip-not-representable-error.html +56 -0
- data/doc/ja/cairo-color-base.html +75 -0
- data/doc/ja/cairo-color-cmyk.html +152 -0
- data/doc/ja/cairo-color-hsv.html +135 -0
- data/doc/ja/cairo-color-rgb.html +145 -0
- data/doc/ja/cairo-color-x11.html +183 -0
- data/doc/ja/cairo-color.html +317 -0
- data/doc/ja/cairo-content.html +51 -0
- data/doc/ja/cairo-context-blur.html +53 -0
- data/doc/ja/cairo-context-circle.html +54 -0
- data/doc/ja/cairo-context-color.html +52 -0
- data/doc/ja/cairo-context-path.html +77 -0
- data/doc/ja/cairo-context-rectangle.html +60 -0
- data/doc/ja/cairo-context-triangle.html +47 -0
- data/doc/ja/cairo-context.html +1449 -0
- data/doc/ja/cairo-error.html +56 -0
- data/doc/ja/cairo-extend.html +56 -0
- data/doc/ja/cairo-file-not-found.html +51 -0
- data/doc/ja/cairo-fill-rule.html +58 -0
- data/doc/ja/cairo-filter.html +43 -0
- data/doc/ja/cairo-font-extents.html +110 -0
- data/doc/ja/cairo-font-face.html +55 -0
- data/doc/ja/cairo-font-options.html +186 -0
- data/doc/ja/cairo-font-slant.html +50 -0
- data/doc/ja/cairo-font-weight.html +47 -0
- data/doc/ja/cairo-format.html +81 -0
- data/doc/ja/cairo-glyph.html +115 -0
- data/doc/ja/cairo-gradient-pattern.html +119 -0
- data/doc/ja/cairo-hint-metrics.html +57 -0
- data/doc/ja/cairo-hint-style.html +64 -0
- data/doc/ja/cairo-image-surface.html +131 -0
- data/doc/ja/cairo-invalid-content-error.html +54 -0
- data/doc/ja/cairo-invalid-dash-error.html +54 -0
- data/doc/ja/cairo-invalid-dsc-comment-error.html +54 -0
- data/doc/ja/cairo-invalid-format-error.html +54 -0
- data/doc/ja/cairo-invalid-index-error.html +54 -0
- data/doc/ja/cairo-invalid-matrix-error.html +54 -0
- data/doc/ja/cairo-invalid-path-data-error.html +54 -0
- data/doc/ja/cairo-invalid-pop-group-error.html +54 -0
- data/doc/ja/cairo-invalid-restore-error.html +55 -0
- data/doc/ja/cairo-invalid-status-error.html +55 -0
- data/doc/ja/cairo-invalid-stride-error.html +55 -0
- data/doc/ja/cairo-invalid-string-error.html +54 -0
- data/doc/ja/cairo-invalid-visual-error.html +57 -0
- data/doc/ja/cairo-line-cap.html +50 -0
- data/doc/ja/cairo-line-join.html +53 -0
- data/doc/ja/cairo-linear-pattern.html +87 -0
- data/doc/ja/cairo-matrix.html +343 -0
- data/doc/ja/cairo-no-current-point-error.html +54 -0
- data/doc/ja/cairo-null-pointer-error.html +54 -0
- data/doc/ja/cairo-operator.html +51 -0
- data/doc/ja/cairo-paper-parse-error.html +55 -0
- data/doc/ja/cairo-paper-unknown-paper-name.html +76 -0
- data/doc/ja/cairo-paper-unknown-unit.html +75 -0
- data/doc/ja/cairo-paper-unrecognized-paper-description.html +76 -0
- data/doc/ja/cairo-paper.html +357 -0
- data/doc/ja/cairo-path-close-path.html +57 -0
- data/doc/ja/cairo-path-curve-to.html +70 -0
- data/doc/ja/cairo-path-data-type.html +53 -0
- data/doc/ja/cairo-path-data.html +127 -0
- data/doc/ja/cairo-path-line-to.html +62 -0
- data/doc/ja/cairo-path-move-to.html +62 -0
- data/doc/ja/cairo-path.html +144 -0
- data/doc/ja/cairo-pattern-type-mismatch-error.html +56 -0
- data/doc/ja/cairo-pattern.html +128 -0
- data/doc/ja/cairo-pdf-surface.html +86 -0
- data/doc/ja/cairo-point.html +90 -0
- data/doc/ja/cairo-ps-level.html +62 -0
- data/doc/ja/cairo-ps-surface.html +214 -0
- data/doc/ja/cairo-quartz-image-surface.html +75 -0
- data/doc/ja/cairo-quartz-surface.html +93 -0
- data/doc/ja/cairo-radial-pattern.html +93 -0
- data/doc/ja/cairo-read-error.html +55 -0
- data/doc/ja/cairo-rectangle.html +109 -0
- data/doc/ja/cairo-scaled-font.html +144 -0
- data/doc/ja/cairo-solid-pattern.html +87 -0
- data/doc/ja/cairo-subpixel-order.html +57 -0
- data/doc/ja/cairo-surface-finished-error.html +54 -0
- data/doc/ja/cairo-surface-pattern.html +68 -0
- data/doc/ja/cairo-surface-type-mismatch-error.html +56 -0
- data/doc/ja/cairo-surface.html +191 -0
- data/doc/ja/cairo-svg-surface.html +114 -0
- data/doc/ja/cairo-svg-version.html +66 -0
- data/doc/ja/cairo-temp-file-error.html +50 -0
- data/doc/ja/cairo-text-extents.html +101 -0
- data/doc/ja/cairo-win32-printing-surface.html +80 -0
- data/doc/ja/cairo-win32-surface.html +100 -0
- data/doc/ja/cairo-write-error.html +55 -0
- data/doc/ja/cairo.html +148 -0
- data/doc/ja/index.html +1080 -0
- data/extconf.rb +153 -0
- data/misc/update-colors.rb +143 -0
- data/pkg-config.rb +278 -0
- data/samples/agg/README +4 -0
- data/samples/agg/aa_demo.rb +47 -0
- data/samples/agg/aa_test.rb +304 -0
- data/samples/blur.rb +47 -0
- data/samples/pac.rb +99 -0
- data/samples/pac2.rb +171 -0
- data/samples/png.rb +45 -0
- data/samples/scalable.rb +56 -0
- data/samples/text-on-path.rb +60 -0
- data/samples/text2.rb +131 -0
- data/src/cairo.def +96 -0
- data/src/cairo.so +0 -0
- data/src/lib/cairo.rb +141 -0
- data/src/lib/cairo/color.rb +255 -0
- data/src/lib/cairo/colors.rb +656 -0
- data/src/lib/cairo/constants.rb +21 -0
- data/src/lib/cairo/context.rb +29 -0
- data/src/lib/cairo/context/blur.rb +45 -0
- data/src/lib/cairo/context/circle.rb +9 -0
- data/src/lib/cairo/context/color.rb +11 -0
- data/src/lib/cairo/context/path.rb +116 -0
- data/src/lib/cairo/context/rectangle.rb +33 -0
- data/src/lib/cairo/context/triangle.rb +12 -0
- data/src/lib/cairo/paper.rb +183 -0
- data/src/lib/cairo/papers.rb +41 -0
- data/src/lib/cairo/path.rb +15 -0
- data/src/lib/cairo/point.rb +7 -0
- data/src/libruby-cairo.a +0 -0
- data/src/rb_cairo.c +82 -0
- data/src/rb_cairo.h +264 -0
- data/src/rb_cairo_constants.c +456 -0
- data/src/rb_cairo_context.c +1548 -0
- data/src/rb_cairo_exception.c +214 -0
- data/src/rb_cairo_font_extents.c +125 -0
- data/src/rb_cairo_font_face.c +56 -0
- data/src/rb_cairo_font_options.c +197 -0
- data/src/rb_cairo_glyph.c +159 -0
- data/src/rb_cairo_matrix.c +350 -0
- data/src/rb_cairo_path.c +459 -0
- data/src/rb_cairo_pattern.c +540 -0
- data/src/rb_cairo_private.c +78 -0
- data/src/rb_cairo_private.h +72 -0
- data/src/rb_cairo_scaled_font.c +177 -0
- data/src/rb_cairo_surface.c +1252 -0
- data/src/rb_cairo_text_extents.c +138 -0
- data/test/run-test.rb +15 -0
- data/test/test_paper.rb +81 -0
- data/test/test_pkg_config.rb +122 -0
- metadata +490 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
5
|
+
<title>Overloading and optional arguments</title>
|
6
|
+
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
7
|
+
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
|
8
|
+
<link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
9
|
+
<link rel="prev" href="bindings-return-values.html" title="Multiple return values">
|
10
|
+
<link rel="next" href="bindings-streams.html" title="Streams and File I/O">
|
11
|
+
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
|
12
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
13
|
+
<link rel="chapter" href="Drawing.html" title="Drawing">
|
14
|
+
<link rel="chapter" href="Fonts.html" title="Fonts">
|
15
|
+
<link rel="chapter" href="Surfaces.html" title="Surfaces">
|
16
|
+
<link rel="chapter" href="Support.html" title="Utilities">
|
17
|
+
<link rel="index" href="ix01.html" title="Index">
|
18
|
+
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
|
19
|
+
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
|
20
|
+
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
|
21
|
+
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
22
|
+
</head>
|
23
|
+
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
24
|
+
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
25
|
+
<td><a accesskey="p" href="bindings-return-values.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
26
|
+
<td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
27
|
+
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
28
|
+
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
|
29
|
+
<td><a accesskey="n" href="bindings-streams.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
30
|
+
</tr></table>
|
31
|
+
<div class="sect1" lang="en">
|
32
|
+
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
33
|
+
<a name="bindings-overloading"></a>Overloading and optional arguments</h2></div></div></div>
|
34
|
+
<p>
|
35
|
+
Function overloading (having a several variants of a function
|
36
|
+
with the same name and different arguments) is a language
|
37
|
+
feature available in many languages but not in C.
|
38
|
+
</p>
|
39
|
+
<p>
|
40
|
+
In general, language binding authors should use restraint in
|
41
|
+
combining functions in the cairo API via function
|
42
|
+
overloading. What may seem like an obvious overload now may
|
43
|
+
turn out to be strange with future additions to cairo.
|
44
|
+
It might seem logical to make
|
45
|
+
<a class="link" href="cairo-cairo-t.html#cairo-set-source-rgb"><code class="function">cairo_set_source_rgb()</code></a>
|
46
|
+
an overload of <code class="function">cairo_set_source()</code>, but future plans to add
|
47
|
+
<code class="function">cairo_set_source_rgb_premultiplied()</code>,
|
48
|
+
which will also take three doubles make this a bad idea. For
|
49
|
+
this reason, only the following pairs of functions should
|
50
|
+
be combined via overloading
|
51
|
+
</p>
|
52
|
+
<pre class="programlisting">
|
53
|
+
void
|
54
|
+
cairo_set_source (cairo_t *cr, cairo_pattern_t *source);
|
55
|
+
|
56
|
+
void
|
57
|
+
cairo_set_source_surface (cairo_t *cr,
|
58
|
+
cairo_surface_t *source,
|
59
|
+
double surface_x,
|
60
|
+
double surface_y);
|
61
|
+
|
62
|
+
void
|
63
|
+
cairo_mask (cairo_t *cr,
|
64
|
+
cairo_pattern_t *pattern);
|
65
|
+
|
66
|
+
void
|
67
|
+
cairo_mask_surface (cairo_t *cr,
|
68
|
+
cairo_surface_t *surface,
|
69
|
+
double surface_x,
|
70
|
+
double surface_y);
|
71
|
+
|
72
|
+
cairo_surface_t *
|
73
|
+
cairo_image_surface_create (cairo_format_t format,
|
74
|
+
int width,
|
75
|
+
int height);
|
76
|
+
cairo_surface_t *
|
77
|
+
cairo_image_surface_create_for_data (unsigned char *data,
|
78
|
+
cairo_format_t format,
|
79
|
+
int width,
|
80
|
+
int height,
|
81
|
+
int stride);
|
82
|
+
|
83
|
+
cairo_status_t
|
84
|
+
cairo_surface_write_to_png (cairo_surface_t *surface,
|
85
|
+
const char *filename);
|
86
|
+
|
87
|
+
cairo_status_t
|
88
|
+
cairo_surface_write_to_png_stream (cairo_surface_t *surface,
|
89
|
+
cairo_write_func_t write_func,
|
90
|
+
void *closure);
|
91
|
+
|
92
|
+
cairo_surface_t *
|
93
|
+
cairo_image_surface_create_from_png (const char *filename);
|
94
|
+
|
95
|
+
cairo_surface_t *
|
96
|
+
cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,
|
97
|
+
void *closure);
|
98
|
+
</pre>
|
99
|
+
<p>
|
100
|
+
Note that there are cases where all constructors for a type
|
101
|
+
aren't overloaded together. For example
|
102
|
+
<a class="link" href="cairo-PNG-Support.html#cairo-image-surface-create-from-png"><code class="function">cairo_image_surface_create_from_png()</code></a>
|
103
|
+
should <span class="emphasis"><em>not</em></span> be overloaded together with
|
104
|
+
<a class="link" href="cairo-Image-Surfaces.html#cairo-image-surface-create"><code class="function">cairo_image_surface_create()</code></a>.
|
105
|
+
In such cases, the remaining constructors will typically need to
|
106
|
+
be bound as static methods. In Java, for example, we might have:
|
107
|
+
</p>
|
108
|
+
<pre class="programlisting">
|
109
|
+
Surface surface1 = ImageSurface(Format.RGB24, 100, 100);
|
110
|
+
Surface surface2 = ImageSurface.createFromPNG("camera.png");</pre>
|
111
|
+
<p>
|
112
|
+
Some other overloads that add combinations not found in C may be
|
113
|
+
convenient for users for language bindings that provide
|
114
|
+
<span class="type">cairo_point_t</span> and <span class="type">cairo_rectangle_t</span>
|
115
|
+
types, for example:
|
116
|
+
</p>
|
117
|
+
<pre class="programlisting">
|
118
|
+
void
|
119
|
+
cairo_move_to (cairo_t *cr,
|
120
|
+
cairo_point_t *point);
|
121
|
+
void
|
122
|
+
cairo_rectangle (cairo_t *cr,
|
123
|
+
cairo_rectangle_t *rectangle);
|
124
|
+
</pre>
|
125
|
+
</div>
|
126
|
+
</body>
|
127
|
+
</html>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
5
|
+
<title>cairo_path_t</title>
|
6
|
+
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
7
|
+
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
|
8
|
+
<link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
9
|
+
<link rel="prev" href="bindings-fonts.html" title="Fonts">
|
10
|
+
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
|
11
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
12
|
+
<link rel="chapter" href="Drawing.html" title="Drawing">
|
13
|
+
<link rel="chapter" href="Fonts.html" title="Fonts">
|
14
|
+
<link rel="chapter" href="Surfaces.html" title="Surfaces">
|
15
|
+
<link rel="chapter" href="Support.html" title="Utilities">
|
16
|
+
<link rel="index" href="ix01.html" title="Index">
|
17
|
+
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
|
18
|
+
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
|
19
|
+
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
|
20
|
+
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
21
|
+
</head>
|
22
|
+
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
23
|
+
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
24
|
+
<td><a accesskey="p" href="bindings-fonts.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
25
|
+
<td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
26
|
+
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
27
|
+
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
|
28
|
+
<td> </td>
|
29
|
+
</tr></table>
|
30
|
+
<div class="sect1" lang="en">
|
31
|
+
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
32
|
+
<a name="bindings-path"></a>cairo_path_t</h2></div></div></div>
|
33
|
+
<p>
|
34
|
+
The <a class="link" href="cairo-Paths.html#cairo-path-t"><span class="type">cairo_path_t</span></a> type is one
|
35
|
+
area in which most language bindings will differ significantly
|
36
|
+
from the C API. The C API for <span class="type">cairo_path_t</span> is
|
37
|
+
designed for efficiency and to avoid auxiliary objects that
|
38
|
+
would be have to be manually memory managed by the
|
39
|
+
application. However,
|
40
|
+
a language binding should not present <span class="type">cairo_path_t</span> as an
|
41
|
+
array, but rather as an opaque that can be iterated
|
42
|
+
over. Different languages have quite different conventions for
|
43
|
+
how iterators work, so it is impossible to give an exact
|
44
|
+
specification for how this API should work, but the type names
|
45
|
+
and methods should be similar to the language's mapping of the following:
|
46
|
+
</p>
|
47
|
+
<pre class="programlisting">
|
48
|
+
typedef struct cairo_path_iterator cairo_path_iterator_t;
|
49
|
+
typedef struct cairo_path_element cairo_path_element_t;
|
50
|
+
|
51
|
+
cairo_path_iterator_t *
|
52
|
+
cairo_path_get_iterator (cairo_path_t *path);
|
53
|
+
|
54
|
+
cairo_bool_t
|
55
|
+
cairo_path_iterator_has_next (cairo_path_iterator_t *iterator);
|
56
|
+
|
57
|
+
cairo_path_element_t *
|
58
|
+
cairo_path_iterator_next (cairo_path_iterator_t *iterator);
|
59
|
+
|
60
|
+
cairo_path_element_type_t
|
61
|
+
cairo_path_element_get_type (cairo_path_element_t *element);
|
62
|
+
|
63
|
+
void
|
64
|
+
cairo_path_element_get_point (cairo_path_element_t *element,
|
65
|
+
int index,
|
66
|
+
double *x,
|
67
|
+
double *y);
|
68
|
+
</pre>
|
69
|
+
<p>
|
70
|
+
The above is written using the Java conventions for
|
71
|
+
iterators. To illustrate how the API for PathIterator might
|
72
|
+
depend on the native iteration conventions of the API, examine
|
73
|
+
three versions of the loop, first written in a hypothetical Java
|
74
|
+
binding:
|
75
|
+
</p>
|
76
|
+
<pre class="programlisting">
|
77
|
+
PathIterator iter = cr.copyPath().iterator();
|
78
|
+
while (cr.hasNext()) {
|
79
|
+
PathElement element = iter.next();
|
80
|
+
if (element.getType() == PathElementType.MOVE_TO) {
|
81
|
+
Point p = element.getPoint(0);
|
82
|
+
doMoveTo (p.x, p.y);
|
83
|
+
}
|
84
|
+
}</pre>
|
85
|
+
<p>
|
86
|
+
And then in a hypothetical C++ binding:
|
87
|
+
</p>
|
88
|
+
<pre class="programlisting">
|
89
|
+
Path path = cr.copyPath();
|
90
|
+
for (PathIterator iter = path.begin(); iter != path.end(); iter++) {
|
91
|
+
PathElement element = *iter;
|
92
|
+
if (element.getType() == PathElementType.MOVE_TO) {
|
93
|
+
Point p = element.getPoint(0);
|
94
|
+
doMoveTo (p.x, p.y);
|
95
|
+
}
|
96
|
+
}</pre>
|
97
|
+
<p>
|
98
|
+
And then finally in a Python binding:
|
99
|
+
</p>
|
100
|
+
<pre class="programlisting">
|
101
|
+
for element in cr.copy_path():
|
102
|
+
if element.getType == cairo.PATH_ELEMENT_MOVE_TO:
|
103
|
+
(x, y) = element.getPoint(0)
|
104
|
+
doMoveTo (x, y);</pre>
|
105
|
+
<p>
|
106
|
+
While many of the API elements stay the same in the three
|
107
|
+
examples, the exact iteration mechanism is quite different, to
|
108
|
+
match how users of the language would expect to iterate over
|
109
|
+
a container.
|
110
|
+
</p>
|
111
|
+
<p>
|
112
|
+
You should not present an API for mutating or for creating new
|
113
|
+
<span class="type">cairo_path_t</span> objects. In the future, these
|
114
|
+
guidelines may be extended to present an API for creating a
|
115
|
+
<span class="type">cairo_path_t</span> from scratch for use with
|
116
|
+
<a class="link" href="cairo-Paths.html#cairo-append-path"><code class="function">cairo_append_path()</code></a>
|
117
|
+
but the current expectation is that <code class="function">cairo_append_path()</code> will
|
118
|
+
mostly be used with paths from
|
119
|
+
<a class="link" href="cairo-Paths.html#cairo-append-path"><code class="function">cairo_copy_path()</code></a>.
|
120
|
+
</p>
|
121
|
+
</div>
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
5
|
+
<title>Patterns</title>
|
6
|
+
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
7
|
+
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
|
8
|
+
<link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
9
|
+
<link rel="prev" href="bindings-errors.html" title="Error handling">
|
10
|
+
<link rel="next" href="bindings-surfaces.html" title="Surfaces">
|
11
|
+
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
|
12
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
13
|
+
<link rel="chapter" href="Drawing.html" title="Drawing">
|
14
|
+
<link rel="chapter" href="Fonts.html" title="Fonts">
|
15
|
+
<link rel="chapter" href="Surfaces.html" title="Surfaces">
|
16
|
+
<link rel="chapter" href="Support.html" title="Utilities">
|
17
|
+
<link rel="index" href="ix01.html" title="Index">
|
18
|
+
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
|
19
|
+
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
|
20
|
+
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
|
21
|
+
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
22
|
+
</head>
|
23
|
+
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
24
|
+
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
25
|
+
<td><a accesskey="p" href="bindings-errors.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
26
|
+
<td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
27
|
+
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
28
|
+
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
|
29
|
+
<td><a accesskey="n" href="bindings-surfaces.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
30
|
+
</tr></table>
|
31
|
+
<div class="sect1" lang="en">
|
32
|
+
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
33
|
+
<a name="bindings-patterns"></a>Patterns</h2></div></div></div>
|
34
|
+
<p>
|
35
|
+
The cairo C API allows for creating a number of different types
|
36
|
+
of patterns. All of these different types of patterns map to
|
37
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-t"><span class="type">cairo_pattern_t</span></a>
|
38
|
+
in C, but in an object oriented language, there should instead
|
39
|
+
be a hierarchy of types. (The functions that should map to
|
40
|
+
constructors for the various types are listed after the type,
|
41
|
+
methods on that type are listed below)
|
42
|
+
</p>
|
43
|
+
<pre class="programlisting">
|
44
|
+
cairo_pattern_t
|
45
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-set-matrix"><code class="function">cairo_pattern_set_matrix()</code></a>
|
46
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-get-matrix"><code class="function">cairo_pattern_get_matrix()</code></a>
|
47
|
+
cairo_solid_pattern_t
|
48
|
+
cairo_surface_pattern_t (<a class="link" href="cairo-Patterns.html#cairo-pattern-create-for-surface"><code class="function">cairo_pattern_create_for_surface()</code></a>)
|
49
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-set-extend"><code class="function">cairo_pattern_set_extend()</code></a>
|
50
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-get-extend"><code class="function">cairo_pattern_get_extend()</code></a>
|
51
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-set-filter"><code class="function">cairo_pattern_set_filter()</code></a>
|
52
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-get-filter"><code class="function">cairo_pattern_get_filter()</code></a>
|
53
|
+
cairo_gradient_t
|
54
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgb"><code class="function">cairo_pattern_add_color_stop_rgb()</code></a>
|
55
|
+
<a class="link" href="cairo-Patterns.html#cairo-pattern-add-color-stop-rgba"><code class="function">cairo_pattern_add_color_stop_rgba()</code></a>
|
56
|
+
cairo_linear_gradient_t (<a class="link" href="cairo-Patterns.html#cairo-pattern-create-linear"><code class="function">cairo_pattern_create_linear()</code></a>)
|
57
|
+
cairo_radial_gradient_t (<a class="link" href="cairo-Patterns.html#cairo-pattern-create-radial"><code class="function">cairo_pattern_create_radial()</code></a>)
|
58
|
+
</pre>
|
59
|
+
<p>
|
60
|
+
</p>
|
61
|
+
</div>
|
62
|
+
</body>
|
63
|
+
</html>
|
@@ -0,0 +1,126 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
5
|
+
<title>Multiple return values</title>
|
6
|
+
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
7
|
+
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
|
8
|
+
<link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
9
|
+
<link rel="prev" href="bindings-memory.html" title="Memory management">
|
10
|
+
<link rel="next" href="bindings-overloading.html" title="Overloading and optional arguments">
|
11
|
+
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
|
12
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
13
|
+
<link rel="chapter" href="Drawing.html" title="Drawing">
|
14
|
+
<link rel="chapter" href="Fonts.html" title="Fonts">
|
15
|
+
<link rel="chapter" href="Surfaces.html" title="Surfaces">
|
16
|
+
<link rel="chapter" href="Support.html" title="Utilities">
|
17
|
+
<link rel="index" href="ix01.html" title="Index">
|
18
|
+
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
|
19
|
+
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
|
20
|
+
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
|
21
|
+
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
22
|
+
</head>
|
23
|
+
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
24
|
+
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
25
|
+
<td><a accesskey="p" href="bindings-memory.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
26
|
+
<td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
27
|
+
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
28
|
+
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
|
29
|
+
<td><a accesskey="n" href="bindings-overloading.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
30
|
+
</tr></table>
|
31
|
+
<div class="sect1" lang="en">
|
32
|
+
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
33
|
+
<a name="bindings-return-values"></a>Multiple return values</h2></div></div></div>
|
34
|
+
<p>
|
35
|
+
There are a number of functions in the cairo API that have
|
36
|
+
multiple <em class="firstterm">out parameters</em> or
|
37
|
+
<em class="firstterm">in-out parameters</em>. In some languages
|
38
|
+
these can be translated into multiple return values. In Python,
|
39
|
+
what is:
|
40
|
+
</p>
|
41
|
+
<pre class="programlisting">
|
42
|
+
cairo_user_to_device (cr, &x, &y);</pre>
|
43
|
+
<p>
|
44
|
+
can by mapped to:
|
45
|
+
</p>
|
46
|
+
<pre class="programlisting">
|
47
|
+
(x, y) = cr.user_to_device (cr, x, y);</pre>
|
48
|
+
<p>
|
49
|
+
but many languages don't have provisions for multiple return
|
50
|
+
values, so it is necessary to introduce auxiliary types.
|
51
|
+
Most of the functions that require the auxiliary types
|
52
|
+
require a type that would, in C, look like
|
53
|
+
</p>
|
54
|
+
<pre class="programlisting">
|
55
|
+
typedef struct _cairo_point cairo_point_t;
|
56
|
+
struct _cairo_point {
|
57
|
+
double x;
|
58
|
+
double y;
|
59
|
+
}</pre>
|
60
|
+
<p>
|
61
|
+
The same type should be used both for functions that use a pair
|
62
|
+
of coordinates as an absolute position, and functions that use
|
63
|
+
a pair of coordinates as a displacement. While an argument could
|
64
|
+
be made that having a separate “distance” type is more correct,
|
65
|
+
it is more likely just to confuse users.
|
66
|
+
</p>
|
67
|
+
<pre class="programlisting">
|
68
|
+
void
|
69
|
+
cairo_user_to_device (cairo_t *cr, double *x, double *y);
|
70
|
+
|
71
|
+
void
|
72
|
+
cairo_user_to_device_distance (cairo_t *cr, double *dx, double *dy);
|
73
|
+
|
74
|
+
void
|
75
|
+
cairo_device_to_user (cairo_t *cr, double *x, double *y);
|
76
|
+
|
77
|
+
void
|
78
|
+
cairo_device_to_user_distance (cairo_t *cr, double *dx, double *dy);
|
79
|
+
|
80
|
+
void
|
81
|
+
cairo_matrix_transform_distance (cairo_matrix_t *matrix, double *dx, double *dy);
|
82
|
+
|
83
|
+
void
|
84
|
+
cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
|
85
|
+
|
86
|
+
void
|
87
|
+
cairo_get_current_point (cairo_t *cr, double *x, double *y);
|
88
|
+
</pre>
|
89
|
+
<p>
|
90
|
+
There are also a couple of functions that return four values
|
91
|
+
representing a rectangle. These should be mapped to a
|
92
|
+
“rectangle” type that looks like:
|
93
|
+
</p>
|
94
|
+
<pre class="programlisting">
|
95
|
+
typedef struct _cairo_rectangle cairo_rectangle_t;
|
96
|
+
struct _cairo_rectangle {
|
97
|
+
double x;
|
98
|
+
double y;
|
99
|
+
double width;
|
100
|
+
double height;
|
101
|
+
}</pre>
|
102
|
+
<p>
|
103
|
+
The C function returns the rectangle as a set of two points to
|
104
|
+
facilitate rounding to integral extents, but this isn't worth
|
105
|
+
adding a “box” type to go along with the more obvious
|
106
|
+
“rectangle” representation.
|
107
|
+
</p>
|
108
|
+
<p class="remark"><i><span class="remark">
|
109
|
+
Q: Would it make sense here to define a standard
|
110
|
+
<code class="function">cairo_rectangle_round()</code> method
|
111
|
+
that language bindings should map?
|
112
|
+
</span></i></p>
|
113
|
+
<pre class="programlisting">
|
114
|
+
void
|
115
|
+
cairo_stroke_extents (cairo_t *cr,
|
116
|
+
double *x1, double *y1,
|
117
|
+
double *x2, double *y2);
|
118
|
+
|
119
|
+
void
|
120
|
+
cairo_fill_extents (cairo_t *cr,
|
121
|
+
double *x1, double *y1,
|
122
|
+
double *x2, double *y2);
|
123
|
+
</pre>
|
124
|
+
</div>
|
125
|
+
</body>
|
126
|
+
</html>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
5
|
+
<title>Streams and File I/O</title>
|
6
|
+
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
|
7
|
+
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
|
8
|
+
<link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
9
|
+
<link rel="prev" href="bindings-overloading.html" title="Overloading and optional arguments">
|
10
|
+
<link rel="next" href="bindings-errors.html" title="Error handling">
|
11
|
+
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
|
12
|
+
<link rel="stylesheet" href="style.css" type="text/css">
|
13
|
+
<link rel="chapter" href="Drawing.html" title="Drawing">
|
14
|
+
<link rel="chapter" href="Fonts.html" title="Fonts">
|
15
|
+
<link rel="chapter" href="Surfaces.html" title="Surfaces">
|
16
|
+
<link rel="chapter" href="Support.html" title="Utilities">
|
17
|
+
<link rel="index" href="ix01.html" title="Index">
|
18
|
+
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
|
19
|
+
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
|
20
|
+
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
|
21
|
+
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
|
22
|
+
</head>
|
23
|
+
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
24
|
+
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
25
|
+
<td><a accesskey="p" href="bindings-overloading.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
26
|
+
<td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
|
27
|
+
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
|
28
|
+
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
|
29
|
+
<td><a accesskey="n" href="bindings-errors.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
30
|
+
</tr></table>
|
31
|
+
<div class="sect1" lang="en">
|
32
|
+
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
33
|
+
<a name="bindings-streams"></a>Streams and File I/O</h2></div></div></div>
|
34
|
+
<p>
|
35
|
+
Various places in the cairo API deal with reading and writing
|
36
|
+
data, whether from and to files, or to other sources and
|
37
|
+
destinations. In these cases, what is typically provided in the
|
38
|
+
C API is a simple version that just takes a filename, and a
|
39
|
+
complex version that takes a callback function.
|
40
|
+
An example is the PNG handling functions:
|
41
|
+
</p>
|
42
|
+
<pre class="programlisting">
|
43
|
+
cairo_surface_t *
|
44
|
+
cairo_image_surface_create_from_png (const char *filename);
|
45
|
+
|
46
|
+
cairo_surface_t *
|
47
|
+
cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,
|
48
|
+
void *closure);
|
49
|
+
|
50
|
+
cairo_status_t
|
51
|
+
cairo_surface_write_to_png (cairo_surface_t *surface,
|
52
|
+
const char *filename);
|
53
|
+
|
54
|
+
cairo_status_t
|
55
|
+
cairo_surface_write_to_png_stream (cairo_surface_t *surface,
|
56
|
+
cairo_write_func_t write_func,
|
57
|
+
void *closure);</pre>
|
58
|
+
<p>
|
59
|
+
The expectation is that the filename version will be mapped
|
60
|
+
literally in the language binding, but the callback version
|
61
|
+
will be mapped to a version that takes a language stream
|
62
|
+
object. For example, in Java, the four functions above
|
63
|
+
might be mapped to:
|
64
|
+
</p>
|
65
|
+
<pre class="programlisting">
|
66
|
+
static public ImageSurface createFromPNG (String filename) throws IOException;
|
67
|
+
static public ImageSurface createFromPNG (InputStream stream) throws IOException;
|
68
|
+
public void writeToPNG (String filename) throws IOException;
|
69
|
+
public void writeToPNG (OutputStream stream) throws IOException;
|
70
|
+
</pre>
|
71
|
+
<p>
|
72
|
+
In many cases, it will be better to
|
73
|
+
implement the filename version internally
|
74
|
+
using the stream version, rather than building it on top of the
|
75
|
+
filename version in C. The reason for this is that will
|
76
|
+
naturally give a more standard handling of file errors for
|
77
|
+
the language, as seen in the above Java example, where
|
78
|
+
<code class="methodname">createFromPNG()</code> is marked as raising
|
79
|
+
an exception. Propagating exceptions from inside the callback
|
80
|
+
function to the caller will pose a challenge to the language
|
81
|
+
binding implementor, since an exception must not propagate
|
82
|
+
through the Cairo code. A technique that will be useful in
|
83
|
+
some cases is to catch the exception in the callback,
|
84
|
+
store the exception object inside a structure pointed to by
|
85
|
+
<em class="parameter"><code>closure</code></em>, and then rethrow it once
|
86
|
+
the function returns.
|
87
|
+
</p>
|
88
|
+
<p class="remark"><i><span class="remark">
|
89
|
+
I'm not sure how to handle this for
|
90
|
+
<code class="function">cairo_pdf_surface_create_for_callback()</code>.
|
91
|
+
Other than keep a “exception to rethrow” thread-specific
|
92
|
+
variable
|
93
|
+
that is checked after <span class="emphasis"><em>every</em></span> call to a Cairo
|
94
|
+
function.
|
95
|
+
</span></i></p>
|
96
|
+
</div>
|
97
|
+
</body>
|
98
|
+
</html>
|