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,214 @@
|
|
1
|
+
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Ruby Cairo Binding
|
4
|
+
*
|
5
|
+
* $Author: kou $
|
6
|
+
* $Date: 2008-02-21 13:18:10 $
|
7
|
+
*
|
8
|
+
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
|
+
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
10
|
+
*
|
11
|
+
* This file is made available under the same terms as Ruby
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
|
15
|
+
#include "rb_cairo.h"
|
16
|
+
|
17
|
+
static VALUE rb_eCairo_InvalidRestoreError;
|
18
|
+
static VALUE rb_eCairo_InvalidPopGroupError;
|
19
|
+
static VALUE rb_eCairo_NoCurrentPointError;
|
20
|
+
static VALUE rb_eCairo_InvalidMatrixError;
|
21
|
+
static VALUE rb_eCairo_InvalidStatusError;
|
22
|
+
static VALUE rb_eCairo_NullPointerError;
|
23
|
+
static VALUE rb_eCairo_InvalidStringError;
|
24
|
+
static VALUE rb_eCairo_InvalidPathDataError;
|
25
|
+
static VALUE rb_eCairo_ReadError;
|
26
|
+
static VALUE rb_eCairo_WriteError;
|
27
|
+
static VALUE rb_eCairo_SurfaceFinishedError;
|
28
|
+
static VALUE rb_eCairo_SurfaceTypeMismatchError;
|
29
|
+
static VALUE rb_eCairo_PatternTypeMismatchError;
|
30
|
+
static VALUE rb_eCairo_InvalidContentError;
|
31
|
+
static VALUE rb_eCairo_InvalidFormatError;
|
32
|
+
static VALUE rb_eCairo_InvalidVisualError;
|
33
|
+
static VALUE rb_eCairo_FileNotFoundError;
|
34
|
+
static VALUE rb_eCairo_InvalidDashError;
|
35
|
+
static VALUE rb_eCairo_InvalidDscCommentError;
|
36
|
+
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
37
|
+
static VALUE rb_eCairo_InvalidIndexError;
|
38
|
+
static VALUE rb_eCairo_ClipNotRepresentableError;
|
39
|
+
#endif
|
40
|
+
#if CAIRO_CHECK_VERSION(1, 5, 6)
|
41
|
+
static VALUE rb_eCairo_TempFileError;
|
42
|
+
static VALUE rb_eCairo_InvalidStrideError;
|
43
|
+
#endif
|
44
|
+
|
45
|
+
void
|
46
|
+
rb_cairo_check_status (cairo_status_t status)
|
47
|
+
{
|
48
|
+
const char *string = cairo_status_to_string (status);
|
49
|
+
|
50
|
+
switch (status)
|
51
|
+
{
|
52
|
+
case CAIRO_STATUS_SUCCESS:
|
53
|
+
break;
|
54
|
+
case CAIRO_STATUS_NO_MEMORY:
|
55
|
+
rb_raise (rb_eNoMemError, string);
|
56
|
+
break;
|
57
|
+
case CAIRO_STATUS_INVALID_RESTORE:
|
58
|
+
rb_raise (rb_eCairo_InvalidRestoreError, string);
|
59
|
+
break;
|
60
|
+
case CAIRO_STATUS_INVALID_POP_GROUP:
|
61
|
+
rb_raise (rb_eCairo_InvalidPopGroupError, string);
|
62
|
+
break;
|
63
|
+
case CAIRO_STATUS_NO_CURRENT_POINT:
|
64
|
+
rb_raise (rb_eCairo_NoCurrentPointError, string);
|
65
|
+
break;
|
66
|
+
case CAIRO_STATUS_INVALID_MATRIX:
|
67
|
+
rb_raise (rb_eCairo_InvalidMatrixError, string);
|
68
|
+
break;
|
69
|
+
case CAIRO_STATUS_INVALID_STATUS:
|
70
|
+
rb_raise (rb_eCairo_InvalidStatusError, string);
|
71
|
+
break;
|
72
|
+
case CAIRO_STATUS_NULL_POINTER:
|
73
|
+
rb_raise (rb_eCairo_NullPointerError, string);
|
74
|
+
break;
|
75
|
+
case CAIRO_STATUS_INVALID_STRING:
|
76
|
+
rb_raise (rb_eCairo_InvalidStringError, string);
|
77
|
+
break;
|
78
|
+
case CAIRO_STATUS_INVALID_PATH_DATA:
|
79
|
+
rb_raise (rb_eCairo_InvalidPathDataError, string);
|
80
|
+
break;
|
81
|
+
case CAIRO_STATUS_READ_ERROR:
|
82
|
+
rb_raise (rb_eCairo_ReadError, string);
|
83
|
+
break;
|
84
|
+
case CAIRO_STATUS_WRITE_ERROR:
|
85
|
+
rb_raise (rb_eCairo_WriteError, string);
|
86
|
+
break;
|
87
|
+
case CAIRO_STATUS_SURFACE_FINISHED:
|
88
|
+
rb_raise (rb_eCairo_SurfaceFinishedError, string);
|
89
|
+
break;
|
90
|
+
case CAIRO_STATUS_SURFACE_TYPE_MISMATCH:
|
91
|
+
rb_raise (rb_eCairo_SurfaceTypeMismatchError, string);
|
92
|
+
break;
|
93
|
+
case CAIRO_STATUS_PATTERN_TYPE_MISMATCH:
|
94
|
+
rb_raise (rb_eCairo_PatternTypeMismatchError, string);
|
95
|
+
break;
|
96
|
+
case CAIRO_STATUS_INVALID_CONTENT:
|
97
|
+
rb_raise (rb_eCairo_InvalidContentError, string);
|
98
|
+
break;
|
99
|
+
case CAIRO_STATUS_INVALID_FORMAT:
|
100
|
+
rb_raise (rb_eCairo_InvalidFormatError, string);
|
101
|
+
break;
|
102
|
+
case CAIRO_STATUS_INVALID_VISUAL:
|
103
|
+
rb_raise (rb_eCairo_InvalidVisualError, string);
|
104
|
+
break;
|
105
|
+
case CAIRO_STATUS_FILE_NOT_FOUND:
|
106
|
+
rb_raise (rb_eCairo_FileNotFoundError, string);
|
107
|
+
break;
|
108
|
+
case CAIRO_STATUS_INVALID_DASH:
|
109
|
+
rb_raise (rb_eCairo_InvalidDashError, string);
|
110
|
+
break;
|
111
|
+
case CAIRO_STATUS_INVALID_DSC_COMMENT:
|
112
|
+
rb_raise (rb_eCairo_InvalidDscCommentError, string);
|
113
|
+
break;
|
114
|
+
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
115
|
+
case CAIRO_STATUS_INVALID_INDEX:
|
116
|
+
rb_raise (rb_eCairo_InvalidIndexError, string);
|
117
|
+
break;
|
118
|
+
case CAIRO_STATUS_CLIP_NOT_REPRESENTABLE:
|
119
|
+
rb_raise (rb_eCairo_ClipNotRepresentableError, string);
|
120
|
+
break;
|
121
|
+
#endif
|
122
|
+
#if CAIRO_CHECK_VERSION(1, 5, 6)
|
123
|
+
case CAIRO_STATUS_TEMP_FILE_ERROR:
|
124
|
+
rb_raise (rb_eCairo_TempFileError, string);
|
125
|
+
break;
|
126
|
+
case CAIRO_STATUS_INVALID_STRIDE:
|
127
|
+
rb_raise (rb_eCairo_InvalidStringError, string);
|
128
|
+
break;
|
129
|
+
#endif
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
void
|
134
|
+
Init_cairo_exception ()
|
135
|
+
{
|
136
|
+
VALUE rb_eCairo_Error;
|
137
|
+
rb_eCairo_Error =
|
138
|
+
rb_define_class_under (rb_mCairo, "Error", rb_eStandardError);
|
139
|
+
rb_eCairo_InvalidRestoreError =
|
140
|
+
rb_define_class_under (rb_mCairo, "InvalidRestoreError",
|
141
|
+
rb_eCairo_Error);
|
142
|
+
rb_eCairo_InvalidPopGroupError =
|
143
|
+
rb_define_class_under (rb_mCairo, "InvalidPopGroupError",
|
144
|
+
rb_eCairo_Error);
|
145
|
+
rb_eCairo_NoCurrentPointError =
|
146
|
+
rb_define_class_under (rb_mCairo, "NoCurrentPointError",
|
147
|
+
rb_eCairo_Error);
|
148
|
+
rb_eCairo_InvalidMatrixError =
|
149
|
+
rb_define_class_under (rb_mCairo, "InvalidMatrixError",
|
150
|
+
rb_eArgError);
|
151
|
+
rb_eCairo_InvalidStatusError =
|
152
|
+
rb_define_class_under (rb_mCairo, "InvalidStatusError",
|
153
|
+
rb_eArgError);
|
154
|
+
rb_eCairo_NullPointerError =
|
155
|
+
rb_define_class_under (rb_mCairo, "NullPointerError",
|
156
|
+
rb_eTypeError);
|
157
|
+
rb_eCairo_InvalidStringError =
|
158
|
+
rb_define_class_under (rb_mCairo, "InvalidStringError",
|
159
|
+
rb_eArgError);
|
160
|
+
rb_eCairo_InvalidPathDataError =
|
161
|
+
rb_define_class_under (rb_mCairo, "InvalidPathDataError",
|
162
|
+
rb_eArgError);
|
163
|
+
rb_eCairo_ReadError =
|
164
|
+
rb_define_class_under (rb_mCairo, "ReadError",
|
165
|
+
rb_eIOError);
|
166
|
+
rb_eCairo_WriteError =
|
167
|
+
rb_define_class_under (rb_mCairo, "WriteError",
|
168
|
+
rb_eIOError);
|
169
|
+
rb_eCairo_SurfaceFinishedError =
|
170
|
+
rb_define_class_under (rb_mCairo, "SurfaceFinishedError",
|
171
|
+
rb_eCairo_Error);
|
172
|
+
rb_eCairo_SurfaceTypeMismatchError =
|
173
|
+
rb_define_class_under (rb_mCairo, "SurfaceTypeMismatchError",
|
174
|
+
rb_eTypeError);
|
175
|
+
rb_eCairo_PatternTypeMismatchError =
|
176
|
+
rb_define_class_under (rb_mCairo, "PatternTypeMismatchError",
|
177
|
+
rb_eTypeError);
|
178
|
+
rb_eCairo_InvalidContentError =
|
179
|
+
rb_define_class_under (rb_mCairo, "InvalidContentError",
|
180
|
+
rb_eArgError);
|
181
|
+
rb_eCairo_InvalidFormatError =
|
182
|
+
rb_define_class_under (rb_mCairo, "InvalidFormatError",
|
183
|
+
rb_eArgError);
|
184
|
+
rb_eCairo_InvalidVisualError =
|
185
|
+
rb_define_class_under (rb_mCairo, "InvalidVisualError",
|
186
|
+
rb_eArgError);
|
187
|
+
rb_eCairo_FileNotFoundError =
|
188
|
+
rb_define_class_under (rb_mCairo, "FileNotFound",
|
189
|
+
rb_eCairo_Error);
|
190
|
+
rb_eCairo_InvalidDashError =
|
191
|
+
rb_define_class_under (rb_mCairo, "InvalidDashError",
|
192
|
+
rb_eArgError);
|
193
|
+
rb_eCairo_InvalidDscCommentError =
|
194
|
+
rb_define_class_under (rb_mCairo, "InvalidDscCommentError",
|
195
|
+
rb_eArgError);
|
196
|
+
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
197
|
+
rb_eCairo_InvalidIndexError =
|
198
|
+
rb_define_class_under (rb_mCairo, "InvalidIndexError",
|
199
|
+
rb_eArgError);
|
200
|
+
rb_eCairo_ClipNotRepresentableError =
|
201
|
+
rb_define_class_under (rb_mCairo, "ClipNotRepresentableError",
|
202
|
+
rb_eCairo_Error);
|
203
|
+
#endif
|
204
|
+
|
205
|
+
#if CAIRO_CHECK_VERSION(1, 5, 6)
|
206
|
+
rb_eCairo_TempFileError =
|
207
|
+
rb_define_class_under (rb_mCairo, "TempFileError",
|
208
|
+
rb_eCairo_Error);
|
209
|
+
|
210
|
+
rb_eCairo_InvalidStrideError =
|
211
|
+
rb_define_class_under (rb_mCairo, "InvalidStrideError",
|
212
|
+
rb_eArgError);
|
213
|
+
#endif
|
214
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Ruby Cairo Binding
|
4
|
+
*
|
5
|
+
* $Author: kou $
|
6
|
+
* $Date: 2007/05/03 02:47:39 $
|
7
|
+
*
|
8
|
+
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
|
+
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
10
|
+
*
|
11
|
+
* This file is made available under the same terms as Ruby
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
|
15
|
+
#include "rb_cairo.h"
|
16
|
+
#include "rb_cairo_private.h"
|
17
|
+
|
18
|
+
VALUE rb_cCairo_FontExtents;
|
19
|
+
|
20
|
+
#define _SELF(self) (RVAL2CRFONTEXTENTS(self))
|
21
|
+
|
22
|
+
cairo_font_extents_t *
|
23
|
+
rb_cairo_font_extents_from_ruby_object (VALUE obj)
|
24
|
+
{
|
25
|
+
cairo_font_extents_t *extents;
|
26
|
+
if (!rb_cairo__is_kind_of (obj, rb_cCairo_FontExtents))
|
27
|
+
{
|
28
|
+
rb_raise (rb_eTypeError, "not a cairo font extents");
|
29
|
+
}
|
30
|
+
Data_Get_Struct (obj, cairo_font_extents_t, extents);
|
31
|
+
return extents;
|
32
|
+
}
|
33
|
+
|
34
|
+
VALUE
|
35
|
+
rb_cairo_font_extents_to_ruby_object (cairo_font_extents_t *extents)
|
36
|
+
{
|
37
|
+
if (extents)
|
38
|
+
{
|
39
|
+
cairo_font_extents_t *new_extents = ALLOC (cairo_font_extents_t);
|
40
|
+
*new_extents = *extents;
|
41
|
+
return Data_Wrap_Struct (rb_cCairo_FontExtents, NULL, -1, new_extents);
|
42
|
+
}
|
43
|
+
else
|
44
|
+
{
|
45
|
+
return Qnil;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
static VALUE
|
50
|
+
cr_font_extents_ascent (VALUE self)
|
51
|
+
{
|
52
|
+
return rb_float_new (_SELF(self)->ascent);
|
53
|
+
}
|
54
|
+
|
55
|
+
static VALUE
|
56
|
+
cr_font_extents_descent (VALUE self)
|
57
|
+
{
|
58
|
+
return rb_float_new (_SELF(self)->descent);
|
59
|
+
}
|
60
|
+
|
61
|
+
static VALUE
|
62
|
+
cr_font_extents_height (VALUE self)
|
63
|
+
{
|
64
|
+
return rb_float_new (_SELF(self)->height);
|
65
|
+
}
|
66
|
+
|
67
|
+
static VALUE
|
68
|
+
cr_font_extents_max_x_advance (VALUE self)
|
69
|
+
{
|
70
|
+
return rb_float_new (_SELF(self)->max_x_advance);
|
71
|
+
}
|
72
|
+
|
73
|
+
static VALUE
|
74
|
+
cr_font_extents_max_y_advance (VALUE self)
|
75
|
+
{
|
76
|
+
return rb_float_new (_SELF(self)->max_y_advance);
|
77
|
+
}
|
78
|
+
|
79
|
+
static VALUE
|
80
|
+
cr_font_extents_to_s (VALUE self)
|
81
|
+
{
|
82
|
+
VALUE ret;
|
83
|
+
|
84
|
+
ret = rb_str_new2 ("#<");
|
85
|
+
rb_str_cat2 (ret, rb_class2name (CLASS_OF (self)));
|
86
|
+
rb_str_cat2 (ret, ": ");
|
87
|
+
rb_str_cat2 (ret, "ascent=");
|
88
|
+
rb_str_concat (ret, rb_inspect (cr_font_extents_ascent (self)));
|
89
|
+
rb_str_cat2 (ret, ", ");
|
90
|
+
rb_str_cat2 (ret, "descent=");
|
91
|
+
rb_str_concat (ret, rb_inspect (cr_font_extents_descent (self)));
|
92
|
+
rb_str_cat2 (ret, ", ");
|
93
|
+
rb_str_cat2 (ret, "height=");
|
94
|
+
rb_str_concat (ret, rb_inspect (cr_font_extents_height (self)));
|
95
|
+
rb_str_cat2 (ret, ", ");
|
96
|
+
rb_str_cat2 (ret, "max_x_advance=");
|
97
|
+
rb_str_concat (ret, rb_inspect (cr_font_extents_max_x_advance (self)));
|
98
|
+
rb_str_cat2 (ret, ", ");
|
99
|
+
rb_str_cat2 (ret, "max_y_advance=");
|
100
|
+
rb_str_concat (ret, rb_inspect (cr_font_extents_max_y_advance (self)));
|
101
|
+
rb_str_cat2 (ret, ">");
|
102
|
+
|
103
|
+
return ret;
|
104
|
+
}
|
105
|
+
|
106
|
+
|
107
|
+
void
|
108
|
+
Init_cairo_font_extents (void)
|
109
|
+
{
|
110
|
+
rb_cCairo_FontExtents =
|
111
|
+
rb_define_class_under (rb_mCairo, "FontExtents", rb_cObject);
|
112
|
+
|
113
|
+
rb_define_method (rb_cCairo_FontExtents, "ascent",
|
114
|
+
cr_font_extents_ascent, 0);
|
115
|
+
rb_define_method (rb_cCairo_FontExtents, "descent",
|
116
|
+
cr_font_extents_descent, 0);
|
117
|
+
rb_define_method (rb_cCairo_FontExtents, "height",
|
118
|
+
cr_font_extents_height, 0);
|
119
|
+
rb_define_method (rb_cCairo_FontExtents, "max_x_advance",
|
120
|
+
cr_font_extents_max_x_advance, 0);
|
121
|
+
rb_define_method (rb_cCairo_FontExtents, "max_y_advance",
|
122
|
+
cr_font_extents_max_y_advance, 0);
|
123
|
+
|
124
|
+
rb_define_method (rb_cCairo_FontExtents, "to_s", cr_font_extents_to_s, 0);
|
125
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Ruby Cairo Binding
|
4
|
+
*
|
5
|
+
* $Author: kou $
|
6
|
+
* $Date: 2007/05/20 09:25:37 $
|
7
|
+
*
|
8
|
+
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
9
|
+
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
10
|
+
*
|
11
|
+
* This file is made available under the same terms as Ruby
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
|
15
|
+
|
16
|
+
#include "rb_cairo.h"
|
17
|
+
#include "rb_cairo_private.h"
|
18
|
+
|
19
|
+
VALUE rb_cCairo_FontFace;
|
20
|
+
|
21
|
+
#define _SELF (RVAL2CRFONTFACE(self))
|
22
|
+
|
23
|
+
cairo_font_face_t *
|
24
|
+
rb_cairo_font_face_from_ruby_object (VALUE obj)
|
25
|
+
{
|
26
|
+
cairo_font_face_t *face;
|
27
|
+
if (!rb_cairo__is_kind_of (obj, rb_cCairo_FontFace))
|
28
|
+
{
|
29
|
+
rb_raise (rb_eTypeError, "not a cairo font face");
|
30
|
+
}
|
31
|
+
Data_Get_Struct (obj, cairo_font_face_t, face);
|
32
|
+
return face;
|
33
|
+
}
|
34
|
+
|
35
|
+
VALUE
|
36
|
+
rb_cairo_font_face_to_ruby_object (cairo_font_face_t *face)
|
37
|
+
{
|
38
|
+
if (face)
|
39
|
+
{
|
40
|
+
cairo_font_face_reference (face);
|
41
|
+
return Data_Wrap_Struct (rb_cCairo_FontFace, NULL,
|
42
|
+
cairo_font_face_destroy, face);
|
43
|
+
}
|
44
|
+
else
|
45
|
+
{
|
46
|
+
return Qnil;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
void
|
52
|
+
Init_cairo_font (void)
|
53
|
+
{
|
54
|
+
rb_cCairo_FontFace =
|
55
|
+
rb_define_class_under (rb_mCairo, "FontFace", rb_cObject);
|
56
|
+
}
|
@@ -0,0 +1,197 @@
|
|
1
|
+
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Ruby Cairo Binding
|
4
|
+
*
|
5
|
+
* $Author: kou $
|
6
|
+
* $Date: 2007-05-26 15:13:25 $
|
7
|
+
*
|
8
|
+
* Copyright 2005 Kouhei Sutou <kou@cozmixng.org>
|
9
|
+
*
|
10
|
+
* This file is made available under the same terms as Ruby
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
|
14
|
+
#include "rb_cairo.h"
|
15
|
+
#include "rb_cairo_private.h"
|
16
|
+
|
17
|
+
#define _SELF(self) (RVAL2CRFONTOPTIONS(self))
|
18
|
+
|
19
|
+
VALUE rb_cCairo_FontOptions;
|
20
|
+
|
21
|
+
static inline void
|
22
|
+
cr_options_check_status (cairo_font_options_t *options)
|
23
|
+
{
|
24
|
+
rb_cairo_check_status (cairo_font_options_status (options));
|
25
|
+
}
|
26
|
+
|
27
|
+
cairo_font_options_t *
|
28
|
+
rb_cairo_font_options_from_ruby_object (VALUE obj)
|
29
|
+
{
|
30
|
+
cairo_font_options_t *options;
|
31
|
+
if (!rb_cairo__is_kind_of (obj, rb_cCairo_FontOptions))
|
32
|
+
{
|
33
|
+
rb_raise (rb_eTypeError, "not a cairo font options");
|
34
|
+
}
|
35
|
+
Data_Get_Struct (obj, cairo_font_options_t, options);
|
36
|
+
return options;
|
37
|
+
}
|
38
|
+
|
39
|
+
static void
|
40
|
+
cr_options_free (void *ptr)
|
41
|
+
{
|
42
|
+
if (ptr)
|
43
|
+
{
|
44
|
+
cairo_font_options_destroy ((cairo_font_options_t *) ptr);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
VALUE
|
49
|
+
rb_cairo_font_options_to_ruby_object (cairo_font_options_t *options)
|
50
|
+
{
|
51
|
+
if (options)
|
52
|
+
{
|
53
|
+
return Data_Wrap_Struct (rb_cCairo_FontOptions, NULL,
|
54
|
+
cr_options_free, options);
|
55
|
+
}
|
56
|
+
else
|
57
|
+
{
|
58
|
+
return Qnil;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
static VALUE
|
63
|
+
cr_options_allocate (VALUE klass)
|
64
|
+
{
|
65
|
+
return Data_Wrap_Struct (klass, NULL, cr_options_free, NULL);
|
66
|
+
}
|
67
|
+
|
68
|
+
static VALUE
|
69
|
+
cr_options_create (VALUE self)
|
70
|
+
{
|
71
|
+
cairo_font_options_t *options;
|
72
|
+
|
73
|
+
options = cairo_font_options_create ();
|
74
|
+
cr_options_check_status (options);
|
75
|
+
DATA_PTR (self) = options;
|
76
|
+
return Qnil;
|
77
|
+
}
|
78
|
+
|
79
|
+
static VALUE
|
80
|
+
cr_options_copy (VALUE self)
|
81
|
+
{
|
82
|
+
cairo_font_options_t *options;
|
83
|
+
|
84
|
+
options = cairo_font_options_copy (_SELF (self));
|
85
|
+
cr_options_check_status (options);
|
86
|
+
return CRFONTOPTIONS2RVAL (options);
|
87
|
+
}
|
88
|
+
|
89
|
+
static VALUE
|
90
|
+
cr_options_merge (VALUE self, VALUE other)
|
91
|
+
{
|
92
|
+
cairo_font_options_merge (_SELF (self), _SELF (other));
|
93
|
+
return self;
|
94
|
+
}
|
95
|
+
|
96
|
+
static VALUE
|
97
|
+
cr_options_equal (VALUE self, VALUE other)
|
98
|
+
{
|
99
|
+
return CBOOL2RVAL (cairo_font_options_equal (_SELF (self), _SELF (other)));
|
100
|
+
}
|
101
|
+
|
102
|
+
static VALUE
|
103
|
+
cr_options_hash (VALUE self)
|
104
|
+
{
|
105
|
+
return INT2NUM (cairo_font_options_hash (_SELF (self)));
|
106
|
+
}
|
107
|
+
|
108
|
+
static VALUE
|
109
|
+
cr_options_set_antialias (VALUE self, VALUE antialias)
|
110
|
+
{
|
111
|
+
cairo_font_options_set_antialias (_SELF (self), RVAL2CRANTIALIAS (antialias));
|
112
|
+
return self;
|
113
|
+
}
|
114
|
+
|
115
|
+
static VALUE
|
116
|
+
cr_options_get_antialias (VALUE self)
|
117
|
+
{
|
118
|
+
return INT2NUM (cairo_font_options_get_antialias (_SELF (self)));
|
119
|
+
}
|
120
|
+
|
121
|
+
static VALUE
|
122
|
+
cr_options_set_subpixel_order (VALUE self, VALUE subpixel_order)
|
123
|
+
{
|
124
|
+
cairo_font_options_set_subpixel_order (_SELF (self),
|
125
|
+
RVAL2CRSUBPIXELORDER (subpixel_order));
|
126
|
+
return self;
|
127
|
+
}
|
128
|
+
|
129
|
+
static VALUE
|
130
|
+
cr_options_get_subpixel_order (VALUE self)
|
131
|
+
{
|
132
|
+
return INT2NUM (cairo_font_options_get_subpixel_order (_SELF (self)));
|
133
|
+
}
|
134
|
+
|
135
|
+
static VALUE
|
136
|
+
cr_options_set_hint_style (VALUE self, VALUE hint_style)
|
137
|
+
{
|
138
|
+
cairo_font_options_set_hint_style (_SELF (self),
|
139
|
+
RVAL2CRHINTSTYLE (hint_style));
|
140
|
+
return self;
|
141
|
+
}
|
142
|
+
|
143
|
+
static VALUE
|
144
|
+
cr_options_get_hint_style (VALUE self)
|
145
|
+
{
|
146
|
+
return INT2NUM (cairo_font_options_get_hint_style (_SELF (self)));
|
147
|
+
}
|
148
|
+
|
149
|
+
static VALUE
|
150
|
+
cr_options_set_hint_metrics (VALUE self, VALUE hint_metrics)
|
151
|
+
{
|
152
|
+
cairo_font_options_set_hint_metrics (_SELF (self),
|
153
|
+
RVAL2CRHINTMETRICS (hint_metrics));
|
154
|
+
return self;
|
155
|
+
}
|
156
|
+
|
157
|
+
static VALUE
|
158
|
+
cr_options_get_hint_metrics (VALUE self)
|
159
|
+
{
|
160
|
+
return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
void
|
165
|
+
Init_cairo_font_options (void)
|
166
|
+
{
|
167
|
+
rb_cCairo_FontOptions =
|
168
|
+
rb_define_class_under (rb_mCairo, "FontOptions", rb_cObject);
|
169
|
+
|
170
|
+
rb_define_alloc_func (rb_cCairo_FontOptions, cr_options_allocate);
|
171
|
+
|
172
|
+
rb_define_method (rb_cCairo_FontOptions, "initialize", cr_options_create, 0);
|
173
|
+
|
174
|
+
rb_define_method (rb_cCairo_FontOptions, "dup", cr_options_copy, 0);
|
175
|
+
rb_define_method (rb_cCairo_FontOptions, "merge!", cr_options_merge, 1);
|
176
|
+
rb_define_alias (rb_cCairo_FontOptions, "update", "merge!");
|
177
|
+
rb_define_method (rb_cCairo_FontOptions, "eql?", cr_options_equal, 1);
|
178
|
+
rb_define_method (rb_cCairo_FontOptions, "hash", cr_options_hash, 0);
|
179
|
+
rb_define_method (rb_cCairo_FontOptions, "set_antialias",
|
180
|
+
cr_options_set_antialias, 1);
|
181
|
+
rb_define_method (rb_cCairo_FontOptions, "antialias",
|
182
|
+
cr_options_get_antialias, 0);
|
183
|
+
rb_define_method (rb_cCairo_FontOptions, "set_subpixel_order",
|
184
|
+
cr_options_set_subpixel_order, 1);
|
185
|
+
rb_define_method (rb_cCairo_FontOptions, "subpixel_order",
|
186
|
+
cr_options_get_subpixel_order, 0);
|
187
|
+
rb_define_method (rb_cCairo_FontOptions, "set_hint_style",
|
188
|
+
cr_options_set_hint_style, 1);
|
189
|
+
rb_define_method (rb_cCairo_FontOptions, "hint_style",
|
190
|
+
cr_options_get_hint_style, 0);
|
191
|
+
rb_define_method (rb_cCairo_FontOptions, "set_hint_metrics",
|
192
|
+
cr_options_set_hint_metrics, 1);
|
193
|
+
rb_define_method (rb_cCairo_FontOptions, "hint_metrics",
|
194
|
+
cr_options_get_hint_metrics, 0);
|
195
|
+
|
196
|
+
RB_CAIRO_DEF_SETTERS (rb_cCairo_FontOptions);
|
197
|
+
}
|