├── doc ├── rsvg-overrides.txt ├── version.xml ├── version.xml.in ├── html │ ├── up.png │ ├── home.png │ ├── left.png │ ├── right.png │ ├── up-insensitive.png │ ├── left-insensitive.png │ ├── right-insensitive.png │ ├── api-index-2-4.html │ ├── object-tree.html │ ├── api-index-2-22.html │ ├── api-index-2-36.html │ ├── rsvg.html │ ├── licence.html │ ├── api-index-2-9.html │ ├── api-index-2-32.html │ ├── api-index-2-8.html │ ├── api-index-2-14.html │ └── annotation-glossary.html ├── rsvg.types └── rsvg-sections.txt ├── tests ├── fixtures │ ├── crash │ │ ├── 785276-empty.svg │ │ ├── 785276-short-file.svg │ │ ├── bug620238.svg │ │ ├── marker-cycles.svg │ │ ├── mask-cycles.svg │ │ ├── bug759084.svg │ │ └── pattern-fallback-cycles.svg │ ├── loading │ │ └── gnome-cool.svgz │ ├── reftests │ │ ├── bugs │ │ │ ├── 340047-ref.png │ │ │ ├── 403357-ref.png │ │ │ ├── 476507-ref.png │ │ │ ├── 548494-ref.png │ │ │ ├── 563933-ref.png │ │ │ ├── 738367-ref.png │ │ │ ├── 749415-ref.png │ │ │ ├── 587721-text-transform-ref.png │ │ │ ├── 603550-mask-luminance-ref.png │ │ │ ├── 761175-recursive-masks-ref.png │ │ │ ├── 777834-empty-text-children-ref.png │ │ │ ├── 548494.svg │ │ │ ├── 738367.svg │ │ │ ├── 587721-text-transform.svg │ │ │ ├── 340047.svg │ │ │ ├── 761175-recursive-masks.svg │ │ │ ├── 476507.svg │ │ │ ├── 603550-mask-luminance.svg │ │ │ ├── 777834-empty-text-children.svg │ │ │ └── 403357.svg │ │ ├── gzip-compressed.svg │ │ ├── duplicate-id-ref.png │ │ ├── gzip-compressed-ref.png │ │ ├── include-compressed-ref.png │ │ ├── nonexisting-filter-ref.png │ │ ├── svg1.1 │ │ │ ├── paths-data-01-t-ref.png │ │ │ ├── paths-data-02-t-ref.png │ │ │ ├── paths-data-03-f-ref.png │ │ │ ├── paths-data-04-t-ref.png │ │ │ ├── paths-data-05-t-ref.png │ │ │ ├── paths-data-06-t-ref.png │ │ │ ├── paths-data-07-t-ref.png │ │ │ ├── paths-data-08-t-ref.png │ │ │ ├── paths-data-09-t-ref.png │ │ │ ├── paths-data-10-t-ref.png │ │ │ ├── paths-data-12-t-ref.png │ │ │ ├── paths-data-13-t-ref.png │ │ │ ├── paths-data-14-t-ref.png │ │ │ ├── paths-data-15-t-ref.png │ │ │ ├── paths-data-16-t-ref.png │ │ │ ├── paths-data-17-f-ref.png │ │ │ ├── paths-data-18-f-ref.png │ │ │ ├── paths-data-19-f-ref.png │ │ │ ├── paths-data-20-f-ref.png │ │ │ ├── resources │ │ │ │ └── bluesquidj.png │ │ │ ├── struct-cond-03-t-ref.png │ │ │ ├── filters-color-02-b-ref.png │ │ │ ├── masking-intro-01-f-ref.png │ │ │ ├── masking-mask-01-b-ref.png │ │ │ ├── masking-mask-02-f-ref.png │ │ │ ├── masking-path-01-b-ref.png │ │ │ ├── masking-path-02-b-ref.png │ │ │ ├── masking-path-03-b-ref.png │ │ │ ├── masking-path-04-b-ref.png │ │ │ ├── pservers-grad-01-b-ref.png │ │ │ ├── pservers-grad-02-b-ref.png │ │ │ ├── pservers-grad-03-b-ref.png │ │ │ ├── pservers-grad-04-b-ref.png │ │ │ ├── pservers-grad-05-b-ref.png │ │ │ ├── pservers-grad-06-b-ref.png │ │ │ ├── pservers-grad-07-b-ref.png │ │ │ ├── pservers-grad-08-b-ref.png │ │ │ ├── pservers-grad-09-b-ref.png │ │ │ ├── pservers-grad-10-b-ref.png │ │ │ ├── pservers-grad-11-b-ref.png │ │ │ ├── pservers-grad-12-b-ref.png │ │ │ ├── pservers-grad-13-b-ref.png │ │ │ ├── pservers-grad-14-b-ref.png │ │ │ ├── pservers-grad-15-b-ref.png │ │ │ ├── pservers-grad-16-b-ref.png │ │ │ ├── pservers-grad-18-b-ref.png │ │ │ ├── pservers-grad-21-b-ref.png │ │ │ ├── pservers-grad-22-b-ref.png │ │ │ ├── pservers-grad-23-f-ref.png │ │ │ ├── pservers-grad-24-f-ref.png │ │ │ ├── masking-opacity-01-b-ref.png │ │ │ ├── painting-marker-01-f-ref.png │ │ │ ├── painting-marker-02-f-ref.png │ │ │ ├── painting-marker-03-f-ref.png │ │ │ ├── painting-marker-04-f-ref.png │ │ │ ├── painting-marker-06-f-ref.png │ │ │ ├── painting-marker-07-f-ref.png │ │ │ ├── filters-composite-02-b-ref.png │ │ │ ├── pservers-grad-stops-01-f-ref.png │ │ │ ├── painting-marker-properties-01-f-ref.png │ │ │ ├── masking-mask-02-f.svg │ │ │ └── masking-path-04-b.svg │ │ ├── nonexisting-filter.svg │ │ ├── include-compressed.svg │ │ └── duplicate-id.svg │ ├── styles │ │ ├── bug620693.svg │ │ ├── bug418823.svg │ │ ├── svg-class.svg │ │ ├── bug614704.svg │ │ ├── bug614643.svg │ │ ├── bug592207.svg │ │ ├── important.svg │ │ └── order.svg │ ├── dimensions │ │ ├── sub-rect-no-unit.svg │ │ └── bug608102.svg │ └── render-crash │ │ └── 777155-zero-sized-pattern.svg ├── resources │ └── LiberationSans-Regular.ttf ├── test-utils.h ├── crash.c ├── render-crash.c ├── loading.c ├── dimensions.c ├── Makefile.am └── test-utils.c ├── .ImageMagick └── Config.txt ├── tap-test ├── Rsvg-2.0.metadata ├── gdk-pixbuf-loader ├── librsvg.thumbnailer.in ├── test.c └── Makefile.am ├── .github └── PULL_REQUEST_TEMPLATE.md ├── librsvg-features.c ├── rsvg-compat.h ├── librsvg-uninstalled.pc.in ├── librsvg.pc.in ├── librsvg-enum-types.h ├── m4 ├── ltversion.m4 ├── glibtests.m4 ├── vapigen.m4 ├── gtk-doc.m4 └── introspection.m4 ├── librsvg-enum-types.c ├── tools ├── Makefile.am ├── test-performance.c └── rsvg-tools-main.h ├── librsvg-zip.in ├── rsvg.symbols ├── rsvg-xml.h ├── rsvg-cairo-clip.h ├── librsvg.doap ├── Rsvg-2.0-custom.vala ├── rsvg-size-callback.h ├── rsvg-cairo.h ├── rsvg-text.h ├── rsvg-io.h ├── rsvg-marker.h ├── librsvg-features.h ├── librsvg-features.h.in ├── rsvg-mask.h ├── rsvg-defs.h ├── rsvg-shapes.h ├── rsvg-image.h ├── rsvg-convert.1 ├── rsvg-cairo-render.h ├── AUTHORS ├── README ├── config.h.in ├── rsvg-cairo-draw.h ├── rsvg-path.h ├── config.h.win32 ├── config.h.win32.in ├── config.h ├── rsvg-structure.h ├── rsvg-size-callback.c ├── rsvg-css.h ├── rsvg-filter.h ├── rsvg-xml.c ├── rsvg-base-file-util.c └── rsvg.c /doc/rsvg-overrides.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/version.xml: -------------------------------------------------------------------------------- 1 | 2.40.20 2 | -------------------------------------------------------------------------------- /doc/version.xml.in: -------------------------------------------------------------------------------- 1 | @VERSION@ -------------------------------------------------------------------------------- /tests/fixtures/crash/785276-empty.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/fixtures/crash/785276-short-file.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/fixtures/crash/bug620238.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/html/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/up.png -------------------------------------------------------------------------------- /doc/html/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/home.png -------------------------------------------------------------------------------- /doc/html/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/left.png -------------------------------------------------------------------------------- /doc/html/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/right.png -------------------------------------------------------------------------------- /.ImageMagick/Config.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/.ImageMagick/Config.txt -------------------------------------------------------------------------------- /doc/rsvg.types: -------------------------------------------------------------------------------- 1 | rsvg_error_get_type 2 | rsvg_handle_flags_get_type 3 | rsvg_handle_get_type 4 | -------------------------------------------------------------------------------- /doc/html/up-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/up-insensitive.png -------------------------------------------------------------------------------- /doc/html/left-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/left-insensitive.png -------------------------------------------------------------------------------- /doc/html/right-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/doc/html/right-insensitive.png -------------------------------------------------------------------------------- /tap-test: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # run a GTest in tap mode. The test binary is passed as $1 4 | 5 | $1 -k --tap 6 | -------------------------------------------------------------------------------- /Rsvg-2.0.metadata: -------------------------------------------------------------------------------- 1 | *_VERSION parent="Rsvg.Version" name="(.+)_VERSION" 2 | VERSION parent="Rsvg.Version" name="STRING" 3 | -------------------------------------------------------------------------------- /tests/fixtures/crash/marker-cycles.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/fixtures/loading/gnome-cool.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/loading/gnome-cool.svgz -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/340047-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/340047-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/403357-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/403357-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/476507-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/476507-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/548494-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/548494-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/563933-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/563933-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/738367-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/738367-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/749415-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/749415-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/gzip-compressed.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/gzip-compressed.svg -------------------------------------------------------------------------------- /tests/resources/LiberationSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/resources/LiberationSans-Regular.ttf -------------------------------------------------------------------------------- /tests/fixtures/reftests/duplicate-id-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/duplicate-id-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/gzip-compressed-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/gzip-compressed-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/include-compressed-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/include-compressed-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/nonexisting-filter-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/nonexisting-filter-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-01-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-01-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-02-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-02-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-03-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-03-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-04-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-04-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-05-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-05-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-06-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-06-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-07-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-07-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-08-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-08-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-09-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-09-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-10-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-10-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-12-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-12-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-13-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-13-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-14-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-14-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-15-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-15-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-16-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-16-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-17-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-17-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-18-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-18-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-19-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-19-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/paths-data-20-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/paths-data-20-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/resources/bluesquidj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/resources/bluesquidj.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/struct-cond-03-t-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/struct-cond-03-t-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/587721-text-transform-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/587721-text-transform-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/603550-mask-luminance-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/603550-mask-luminance-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/filters-color-02-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/filters-color-02-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-intro-01-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-intro-01-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-mask-01-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-mask-01-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-mask-02-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-mask-02-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-path-01-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-path-01-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-path-02-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-path-02-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-path-03-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-path-03-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-path-04-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-path-04-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-01-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-01-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-02-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-02-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-03-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-03-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-04-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-04-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-05-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-05-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-06-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-06-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-07-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-07-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-08-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-08-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-09-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-09-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-10-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-10-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-11-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-11-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-12-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-12-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-13-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-13-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-14-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-14-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-15-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-15-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-16-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-16-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-18-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-18-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-21-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-21-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-22-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-22-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-23-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-23-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-24-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-24-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/761175-recursive-masks-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/761175-recursive-masks-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-opacity-01-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/masking-opacity-01-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-01-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-01-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-02-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-02-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-03-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-03-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-04-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-04-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-06-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-06-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-07-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-07-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/crash/mask-cycles.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/bugs/777834-empty-text-children-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/filters-composite-02-b-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/filters-composite-02-b-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/painting-marker-properties-01-f-ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ImageMagick/rsvg/HEAD/tests/fixtures/reftests/svg1.1/painting-marker-properties-01-f-ref.png -------------------------------------------------------------------------------- /tests/fixtures/reftests/nonexisting-filter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /gdk-pixbuf-loader/librsvg.thumbnailer.in: -------------------------------------------------------------------------------- 1 | [Thumbnailer Entry] 2 | TryExec=@bindir@/gdk-pixbuf-thumbnailer 3 | Exec=@bindir@/gdk-pixbuf-thumbnailer -s %s %u %o 4 | MimeType=image/svg+xml;image/svg+xml-compressed; 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | DO NOT CREATE A PULL REQUEST FOR THIS REPOSITORY, THIS IS ONLY A COPY OF AN EXTERNAL REPOSITORY. 2 | 3 | THE ORGINAL REPOSITORY CAN BE FOUND HERE: https://gitlab.gnome.org/GNOME/librsvg. -------------------------------------------------------------------------------- /tests/fixtures/styles/bug620693.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/include-compressed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/548494.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/fixtures/crash/bug759084.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /librsvg-features.c: -------------------------------------------------------------------------------- 1 | #include "rsvg.h" 2 | 3 | /* General initialization hooks */ 4 | const guint librsvg_major_version = LIBRSVG_MAJOR_VERSION; 5 | const guint librsvg_minor_version = LIBRSVG_MINOR_VERSION; 6 | const guint librsvg_micro_version = LIBRSVG_MICRO_VERSION; 7 | const char librsvg_version[] = LIBRSVG_VERSION; 8 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/duplicate-id.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /rsvg-compat.h: -------------------------------------------------------------------------------- 1 | /* rsvg-compat.h: miscellaneous compatibility functions to deal with deprecations in the platform */ 2 | 3 | #ifndef RSVG_COMPAT_H 4 | #define RSVG_COMPAT_H 5 | 6 | /* g_type_init() was deprecated in glib 2.36.0 */ 7 | #if !GLIB_CHECK_VERSION (2, 36, 0) 8 | # define RSVG_G_TYPE_INIT g_type_init () 9 | #else 10 | # define RSVG_G_TYPE_INIT {} 11 | #endif 12 | 13 | #endif /* RSVG_COMPAT_H */ 14 | -------------------------------------------------------------------------------- /tests/fixtures/styles/bug418823.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /librsvg-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | svgz_supported=true 7 | css_supported=true 8 | 9 | Name: librsvg 10 | Description: library that renders svg files 11 | Version: @VERSION@ 12 | Requires: glib-2.0 gio-2.0 gdk-pixbuf-2.0 cairo 13 | Libs: ${pc_top_builddir}/${pcfiledir}/librsvg-@RSVG_API_MAJOR_VERSION@.la 14 | Cflags: -I${pc_top_builddir}/${pcfiledir} 15 | -------------------------------------------------------------------------------- /librsvg.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | svgz_supported=true 7 | css_supported=true 8 | 9 | Name: librsvg 10 | Description: library that renders svg files 11 | Version: @VERSION@ 12 | Requires: glib-2.0 gio-2.0 gdk-pixbuf-2.0 cairo 13 | Requires.private: 14 | Libs: -L${libdir} -lrsvg-@RSVG_API_MAJOR_VERSION@ -lm 15 | Cflags: -I${includedir}/librsvg-@RSVG_API_VERSION@ 16 | -------------------------------------------------------------------------------- /tests/fixtures/crash/pattern-fallback-cycles.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/fixtures/styles/svg-class.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/fixtures/styles/bug614704.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/738367.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/fixtures/dimensions/sub-rect-no-unit.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/fixtures/styles/bug614643.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/fixtures/styles/bug592207.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /librsvg-enum-types.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION) 5 | #warning "Including directly is deprecated." 6 | #endif 7 | 8 | #ifndef __LIBRSVG_ENUM_TYPES_H__ 9 | #define __LIBRSVG_ENUM_TYPES_H__ 10 | 11 | #include 12 | 13 | G_BEGIN_DECLS 14 | /* enumerations from "rsvg.h" */ 15 | GType rsvg_error_get_type (void); 16 | #define RSVG_TYPE_ERROR (rsvg_error_get_type()) 17 | GType rsvg_handle_flags_get_type (void); 18 | #define RSVG_TYPE_HANDLE_FLAGS (rsvg_handle_flags_get_type()) 19 | G_END_DECLS 20 | 21 | #endif /* __LIBRSVG_ENUM_TYPES_H__ */ 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/587721-text-transform.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | Frenchtown 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/fixtures/styles/important.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /tests/test-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | 4 | #ifndef TEST_UTILS_H 5 | #define TEST_UTILS_H 6 | 7 | #include 8 | 9 | G_BEGIN_DECLS 10 | 11 | typedef gboolean (* AddTestFunc) (GFile *file); 12 | 13 | const gchar *test_utils_get_test_data_path (void); 14 | 15 | void test_utils_add_test_for_all_files (const gchar *prefix, 16 | GFile *base, 17 | GFile *file, 18 | GTestDataFunc test_func, 19 | AddTestFunc add_test_func); 20 | G_END_DECLS 21 | 22 | #endif /* TEST_UTILS_H */ 23 | -------------------------------------------------------------------------------- /tests/fixtures/dimensions/bug608102.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /librsvg-enum-types.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #include "rsvg.h" 5 | 6 | /* enumerations from "rsvg.h" */ 7 | GType 8 | rsvg_error_get_type (void) 9 | { 10 | static GType etype = 0; 11 | if (etype == 0) { 12 | static const GEnumValue values[] = { 13 | { RSVG_ERROR_FAILED, "RSVG_ERROR_FAILED", "failed" }, 14 | { 0, NULL, NULL } 15 | }; 16 | etype = g_enum_register_static ("RsvgError", values); 17 | } 18 | return etype; 19 | } 20 | GType 21 | rsvg_handle_flags_get_type (void) 22 | { 23 | static GType etype = 0; 24 | if (etype == 0) { 25 | static const GFlagsValue values[] = { 26 | { RSVG_HANDLE_FLAGS_NONE, "RSVG_HANDLE_FLAGS_NONE", "flags-none" }, 27 | { RSVG_HANDLE_FLAG_UNLIMITED, "RSVG_HANDLE_FLAG_UNLIMITED", "flag-unlimited" }, 28 | { RSVG_HANDLE_FLAG_KEEP_IMAGE_DATA, "RSVG_HANDLE_FLAG_KEEP_IMAGE_DATA", "flag-keep-image-data" }, 29 | { 0, NULL, NULL } 30 | }; 31 | etype = g_flags_register_static ("RsvgHandleFlags", values); 32 | } 33 | return etype; 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tools/Makefile.am: -------------------------------------------------------------------------------- 1 | if BUILD_MISC_TOOLS 2 | noinst_PROGRAMS = \ 3 | rsvg-dimensions \ 4 | test-performance 5 | 6 | noinst_LTLIBRARIES = \ 7 | librsvg_tools_main.la 8 | endif 9 | 10 | INCLUDES = \ 11 | -I$(top_srcdir) \ 12 | -I$(top_builddir) \ 13 | $(LIBRSVG_CFLAGS) \ 14 | $(GTK_CFLAGS) \ 15 | $(GDK_X11_CFLAGS) \ 16 | -DG_LOG_DOMAIN=\"librsvg\" \ 17 | -DLIBRSVG_DATADIR="\"$(datadir)\"" 18 | 19 | DEPS = $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \ 20 | librsvg_tools_main.la 21 | LDADDS = \ 22 | $(GLIB_LIBS) \ 23 | $(LIBRSVG_LIBS) \ 24 | $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la 25 | 26 | librsvg_tools_main_la_SOURCES = \ 27 | rsvg-tools-main.c \ 28 | rsvg-tools-main.h 29 | librsvg_tools_main_la_LIBADD = 30 | 31 | test_performance_SOURCES = test-performance.c 32 | test_performance_LDFLAGS = 33 | test_performance_DEPENDENCIES = $(DEPS) 34 | test_performance_LDADD = librsvg_tools_main.la $(LDADDS) $(LIBM) 35 | 36 | rsvg_dimensions_SOURCES = rsvg-dimensions.c 37 | rsvg_dimensions_LDFLAGS = 38 | rsvg_dimensions_DEPENDENCIES = $(DEPS) 39 | rsvg_dimensions_LDADD = $(LDADDS) $(LIBM) 40 | -------------------------------------------------------------------------------- /tools/test-performance.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public License as 7 | published by the Free Software Foundation; either version 2 of the 8 | License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | Boston, MA 02111-1307, USA. 19 | 20 | */ 21 | 22 | #include "config.h" 23 | #include 24 | 25 | #include "rsvg-tools-main.h" 26 | 27 | int 28 | main (int argc, char **argv) 29 | { 30 | return rsvg_tools_main(&argc, &argv); 31 | } 32 | -------------------------------------------------------------------------------- /tools/rsvg-tools-main.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public License as 6 | published by the Free Software Foundation; either version 2 of the 7 | License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the 16 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __RSVG_TOOLS_MAIN_H__ 22 | #define __RSVG_TOOLS_MAIN_H__ 23 | 24 | G_BEGIN_DECLS 25 | 26 | int rsvg_tools_main (int *argc, char ***argv); 27 | 28 | G_END_DECLS 29 | 30 | #endif /* __RSVG_TOOLS_MAIN_H__ */ 31 | -------------------------------------------------------------------------------- /librsvg-zip.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build distribution zipfiles for librsvg on Win32: Runtime, 4 | # developer, engine and loader. 5 | 6 | ZIP=/tmp/librsvg-@VERSION@.zip 7 | DEVZIP=/tmp/librsvg-dev-@VERSION@.zip 8 | ENGINEZIP=/tmp/svg-gtk-engine-@VERSION@.zip 9 | LOADERZIP=/tmp/svg-gdk-pixbuf-loader-@VERSION@.zip 10 | 11 | # The DLL name generated by libtool with the passed --version-info 12 | DLLNAME=librsvg-2-@LIBRSVG_MAJOR_VERSION@.dll 13 | 14 | cd @prefix@ 15 | rm $ZIP 16 | 17 | zip $ZIP -@ < 2 | 4 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /rsvg.symbols: -------------------------------------------------------------------------------- 1 | /* rsvg.h */ 2 | rsvg_cleanup 3 | rsvg_error_quark 4 | rsvg_handle_close 5 | rsvg_handle_get_base_uri 6 | rsvg_handle_get_dimensions 7 | rsvg_handle_get_dimensions_sub 8 | rsvg_handle_get_position_sub 9 | rsvg_handle_get_pixbuf 10 | rsvg_handle_get_pixbuf_sub 11 | rsvg_handle_get_type 12 | rsvg_handle_has_sub 13 | rsvg_handle_new 14 | rsvg_handle_new_from_data 15 | rsvg_handle_new_from_file 16 | rsvg_handle_new_from_gfile_sync 17 | rsvg_handle_new_from_stream_sync 18 | rsvg_handle_new_with_flags 19 | rsvg_handle_read_stream_sync 20 | rsvg_handle_set_base_gfile 21 | rsvg_handle_set_base_uri 22 | rsvg_handle_set_dpi 23 | rsvg_handle_set_dpi_x_y 24 | rsvg_handle_write 25 | rsvg_set_default_dpi 26 | rsvg_set_default_dpi_x_y 27 | 28 | /* rsvg-cairo.h */ 29 | rsvg_handle_render_cairo 30 | rsvg_handle_render_cairo_sub 31 | 32 | /* rsvg-css.h---semi-public for rsvg-convert */ 33 | rsvg_css_parse_color 34 | 35 | /* librsvg-enum-types.h */ 36 | rsvg_error_get_type 37 | rsvg_handle_flags_get_type 38 | 39 | /* deprecated APIs */ 40 | rsvg_handle_free 41 | rsvg_handle_set_size_callback 42 | rsvg_init 43 | rsvg_pixbuf_from_file 44 | rsvg_pixbuf_from_file_at_max_size 45 | rsvg_pixbuf_from_file_at_size 46 | rsvg_pixbuf_from_file_at_zoom 47 | rsvg_pixbuf_from_file_at_zoom_with_max 48 | rsvg_handle_get_desc 49 | rsvg_handle_get_metadata 50 | rsvg_handle_get_title 51 | rsvg_term 52 | -------------------------------------------------------------------------------- /m4/glibtests.m4: -------------------------------------------------------------------------------- 1 | dnl GLIB_TESTS 2 | dnl 3 | 4 | AC_DEFUN([GLIB_TESTS], 5 | [ 6 | AC_ARG_ENABLE(installed-tests, 7 | AS_HELP_STRING([--enable-installed-tests], 8 | [Enable installation of some test cases]), 9 | [case ${enableval} in 10 | yes) ENABLE_INSTALLED_TESTS="1" ;; 11 | no) ENABLE_INSTALLED_TESTS="" ;; 12 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;; 13 | esac]) 14 | AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1") 15 | AC_ARG_ENABLE(always-build-tests, 16 | AS_HELP_STRING([--enable-always-build-tests], 17 | [Enable always building tests during 'make all']), 18 | [case ${enableval} in 19 | yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;; 20 | no) ENABLE_ALWAYS_BUILD_TESTS="" ;; 21 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;; 22 | esac]) 23 | AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1") 24 | if test "$ENABLE_INSTALLED_TESTS" = "1"; then 25 | AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME) 26 | AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /rsvg-xml.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 expandtab: */ 3 | /* 4 | * Copyright © 2010 Christian Persch 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License as 8 | * published by the Free Software Foundation; either version 2.1 of the 9 | * License, or (at your option) any later version. 10 | 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #ifndef RSVG_XML_H 23 | #define RSVG_XML_H 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | G_GNUC_INTERNAL 31 | xmlParserCtxtPtr rsvg_create_xml_parser_from_stream (xmlSAXHandlerPtr sax, 32 | void *sax_user_data, 33 | GInputStream *stream, 34 | GCancellable *cancellable, 35 | GError **error); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* !RSVG_XML_H */ 40 | -------------------------------------------------------------------------------- /rsvg-cairo-clip.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-cairo-render.h: The cairo backend plugin 5 | 6 | Copyright (C) 2005 Dom Lachowicz 7 | Caleb Moore 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Authors: Dom Lachowicz 25 | Caleb Moore 26 | */ 27 | 28 | #ifndef RSVG_CAIRO_CLIP_H 29 | #define RSVG_CAIRO_CLIP_H 30 | 31 | #include "rsvg-mask.h" 32 | #include "rsvg-cairo-render.h" 33 | #include 34 | 35 | G_BEGIN_DECLS 36 | 37 | G_GNUC_INTERNAL 38 | void rsvg_cairo_clip (RsvgDrawingCtx * ctx, RsvgClipPath * clip, RsvgBbox * bbox); 39 | 40 | G_END_DECLS 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/340047.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | 20 | 21 | 22 | e = mc 23 | 24 | 2 25 | 26 | 27 | 28 | T 29 | 30 | i+2 31 | 32 | =T 33 | 34 | i 35 | 36 | + T 37 | 38 | i+1 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /librsvg.doap: -------------------------------------------------------------------------------- 1 | 6 | 7 | librsvg 8 | SVG rendering library 9 | 10 | 11 | librsvg is a library to render SVG documents into GdkPixbuf images or 12 | Cairo contexts in general. It is used throughout GNOME to render things 13 | like scalable icons, from image viewers to view SVGs easily, or to generate 14 | thumbnails for SVG files. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | C 23 | Rust 24 | 25 | 26 | 27 | Federico Mena Quintero 28 | 29 | federico 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Rsvg-2.0-custom.vala: -------------------------------------------------------------------------------- 1 | namespace Rsvg { 2 | public class Handle : GLib.Object { 3 | [Deprecated (since = "2.36")] 4 | public unowned string get_desc (); 5 | [Deprecated (replacement = "GLib.Object.unref")] 6 | public void free (); 7 | [Deprecated (replacement = "render_cairo")] 8 | public void set_size_callback (owned Rsvg.SizeFunc size_func); 9 | [Deprecated (since = "2.36")] 10 | public unowned string get_title (); 11 | [Deprecated (since = "2.36")] 12 | public unowned string get_metadata (); 13 | } 14 | 15 | namespace Version { 16 | [CCode (cname = "LIBRSVG_CHECK_VERSION")] 17 | public static bool check (int major, int minor, int micro); 18 | } 19 | 20 | [Deprecated] 21 | public delegate void SizeFunc (ref int width, ref int height); 22 | 23 | [Deprecated (since = "2.36")] 24 | public static void init (); 25 | [Deprecated] 26 | public static Gdk.Pixbuf pixbuf_from_file (string file_name) throws GLib.Error; 27 | [Deprecated] 28 | public static Gdk.Pixbuf pixbuf_from_file_at_max_size (string file_name, int max_width, int max_height) throws GLib.Error; 29 | [Deprecated] 30 | public static Gdk.Pixbuf pixbuf_from_file_at_size (string file_name, int width, int height) throws GLib.Error; 31 | [Deprecated] 32 | public static Gdk.Pixbuf pixbuf_from_file_at_zoom (string file_name, double x_zoom, double y_zoom) throws GLib.Error; 33 | [Deprecated] 34 | public static Gdk.Pixbuf pixbuf_from_file_at_zoom_with_max (string file_name, double x_zoom, double y_zoom, int max_width, int max_height) throws GLib.Error; 35 | [Deprecated (since = "2.36")] 36 | public static void term (); 37 | } 38 | -------------------------------------------------------------------------------- /rsvg-size-callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2000 Eazel, Inc. 3 | Copyright (C) 2002 Dom Lachowicz 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public License as 7 | published by the Free Software Foundation; either version 2 of the 8 | License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | Boston, MA 02111-1307, USA. 19 | 20 | Author: Raph Levien 21 | */ 22 | 23 | #ifndef RSVG_SIZE_CALLBACK_H 24 | #define RSVG_SIZE_CALLBACK_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef enum { 31 | RSVG_SIZE_ZOOM, 32 | RSVG_SIZE_WH, 33 | RSVG_SIZE_WH_MAX, 34 | RSVG_SIZE_ZOOM_MAX 35 | } RsvgSizeType; 36 | 37 | struct RsvgSizeCallbackData { 38 | RsvgSizeType type; 39 | double x_zoom; 40 | double y_zoom; 41 | gint width; 42 | gint height; 43 | 44 | gboolean keep_aspect_ratio; 45 | }; 46 | 47 | G_GNUC_INTERNAL 48 | void _rsvg_size_callback (int *width, int *height, gpointer data); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* RSVG_SIZE_CALLBACK_H */ 53 | -------------------------------------------------------------------------------- /tests/crash.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set ts=4 nowrap ai expandtab sw=4: */ 3 | 4 | #include 5 | #include "rsvg.h" 6 | #include "rsvg-compat.h" 7 | #include "test-utils.h" 8 | 9 | static void 10 | test_crash (gconstpointer data) 11 | { 12 | GFile *file = G_FILE (data); 13 | RsvgHandle *handle; 14 | GError *error = NULL; 15 | 16 | handle = rsvg_handle_new_from_gfile_sync (file, RSVG_HANDLE_FLAGS_NONE, NULL, &error); 17 | if (handle) { 18 | g_assert_no_error (error); 19 | g_object_unref (handle); 20 | } else { 21 | g_assert (error != NULL); 22 | g_error_free (error); 23 | } 24 | } 25 | 26 | int 27 | main (int argc, char *argv[]) 28 | { 29 | GFile *base, *crash; 30 | int result; 31 | 32 | RSVG_G_TYPE_INIT; 33 | g_test_init (&argc, &argv, NULL); 34 | 35 | if (argc < 2) { 36 | base = g_file_new_for_path (test_utils_get_test_data_path ()); 37 | crash = g_file_get_child (base, "crash"); 38 | test_utils_add_test_for_all_files ("/crash", crash, crash, test_crash, NULL); 39 | g_object_unref (base); 40 | g_object_unref (crash); 41 | } else { 42 | guint i; 43 | 44 | for (i = 1; i < argc; i++) { 45 | GFile *file = g_file_new_for_commandline_arg (argv[i]); 46 | 47 | test_utils_add_test_for_all_files ("/crash", NULL, file, test_crash, NULL); 48 | 49 | g_object_unref (file); 50 | } 51 | } 52 | 53 | result = g_test_run (); 54 | 55 | rsvg_cleanup (); 56 | 57 | return result; 58 | } 59 | -------------------------------------------------------------------------------- /rsvg-cairo.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-cairo.h: SAX-based renderer for SVG files using cairo 5 | 6 | Copyright (C) 2005 Red Hat, Inc. 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this program; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | Boston, MA 02111-1307, USA. 22 | 23 | Author: Carl Worth 24 | */ 25 | 26 | #if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION) 27 | #warning "Including directly is deprecated." 28 | #endif 29 | 30 | #ifndef RSVG_CAIRO_H 31 | #define RSVG_CAIRO_H 32 | 33 | #include 34 | 35 | G_BEGIN_DECLS 36 | 37 | RSVG_EXPORT 38 | gboolean rsvg_handle_render_cairo (RsvgHandle * handle, cairo_t * cr); 39 | gboolean rsvg_handle_render_cairo_sub (RsvgHandle * handle, cairo_t * cr, const char *id); 40 | 41 | G_END_DECLS 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /rsvg-text.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-text.h: Text handling routines for RSVG 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | 27 | #ifndef RSVG_TEXT_H 28 | #define RSVG_TEXT_H 29 | 30 | #include "rsvg.h" 31 | #include "rsvg-shapes.h" 32 | 33 | G_BEGIN_DECLS 34 | 35 | G_GNUC_INTERNAL 36 | RsvgNode *rsvg_new_text (void); 37 | G_GNUC_INTERNAL 38 | RsvgNode *rsvg_new_tspan (void); 39 | G_GNUC_INTERNAL 40 | RsvgNode *rsvg_new_tref (void); 41 | G_GNUC_INTERNAL 42 | char *rsvg_make_valid_utf8 (const char *str, int len); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* RSVG_TEXT_H */ 47 | -------------------------------------------------------------------------------- /rsvg-io.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2000 Eazel, Inc. 3 | Copyright (C) 2002, 2003, 2004, 2005 Dom Lachowicz 4 | Copyright (C) 2003, 2004, 2005 Caleb Moore 5 | Copyright © 2011, 2012 Christian Persch 6 | 7 | This program is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public 18 | License along with this program; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #ifndef RSVG_IO_H 24 | #define RSVG_IO_H 25 | 26 | #include 27 | #include 28 | 29 | char *_rsvg_io_acquire_data (const char *uri, 30 | const char *base_uri, 31 | char **mime_type, 32 | gsize *len, 33 | GCancellable *cancellable, 34 | GError **error); 35 | 36 | GInputStream *_rsvg_io_acquire_stream (const char *uri, 37 | const char *base_uri, 38 | char **mime_type, 39 | GCancellable *cancellable, 40 | GError **error); 41 | 42 | #endif /* RSVG_IO_H */ 43 | -------------------------------------------------------------------------------- /tests/fixtures/render-crash/777155-zero-sized-pattern.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

12 |

13 |

14 | 15 | 16 |

Runed.

17 |
18 | 19 |

20 |

21 |
22 | 23 | $RC 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ision: 1.3 $ 43 | 44 | 45 | 46 | 47 | 48 | DRAFT 49 | 50 | 51 | -------------------------------------------------------------------------------- /rsvg-marker.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-marker.h: Marker loading and rendering 5 | 6 | Copyright (C) 2004, 2005 Caleb Moore 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this program; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | Boston, MA 02111-1307, USA. 22 | 23 | Authors: Caleb Moore 24 | */ 25 | 26 | #ifndef RSVG_MARKER_H 27 | #define RSVG_MARKER_H 28 | 29 | #include "rsvg-structure.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _RsvgMarker RsvgMarker; 34 | 35 | struct _RsvgMarker { 36 | RsvgNode super; 37 | gboolean bbox; 38 | RsvgLength refX, refY, width, height; 39 | double orient; 40 | gint preserve_aspect_ratio; 41 | gboolean orientAuto; 42 | RsvgViewBox vbox; 43 | }; 44 | 45 | G_GNUC_INTERNAL 46 | RsvgNode *rsvg_new_marker (void); 47 | G_GNUC_INTERNAL 48 | void rsvg_render_markers (RsvgDrawingCtx *ctx, const cairo_path_t *path); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* RSVG_MARKER_H */ 53 | -------------------------------------------------------------------------------- /librsvg-features.h: -------------------------------------------------------------------------------- 1 | #if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION) 2 | #warning "Including directly is deprecated." 3 | #endif 4 | 5 | #ifndef LIBRSVG_FEATURES_H 6 | #define LIBRSVG_FEATURES_H 7 | 8 | #define LIBRSVG_MAJOR_VERSION (2) 9 | #define LIBRSVG_MINOR_VERSION (40) 10 | #define LIBRSVG_MICRO_VERSION (20) 11 | #define LIBRSVG_VERSION "2.40.20" 12 | 13 | #define LIBRSVG_CHECK_VERSION(major,minor,micro) \ 14 | (LIBRSVG_MAJOR_VERSION > (major) || \ 15 | (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION > (minor)) || \ 16 | (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION == (minor) && LIBRSVG_MICRO_VERSION >= (micro))) 17 | 18 | #ifndef __GI_SCANNER__ 19 | #define LIBRSVG_HAVE_SVGZ (TRUE) 20 | #define LIBRSVG_HAVE_CSS (TRUE) 21 | 22 | #define LIBRSVG_CHECK_FEATURE(FEATURE) (defined(LIBRSVG_HAVE_##FEATURE) && LIBRSVG_HAVE_##FEATURE) 23 | #endif 24 | 25 | /* 26 | * On Windows builds, we need to decorate variables that are exposed in the public API 27 | * so that they can be properly exported and linked to, for DLL builds 28 | */ 29 | #ifndef RSVG_VAR 30 | # ifdef G_PLATFORM_WIN32 31 | # ifndef RSVG_STATIC 32 | # ifdef RSVG_COMPILATION 33 | # define RSVG_VAR extern __declspec (dllexport) 34 | # else /* RSVG_COMPILATION */ 35 | # define RSVG_VAR extern __declspec (dllimport) 36 | # endif /* !RSVG_COMPILATION */ 37 | # else /* !RSVG_STATIC */ 38 | # define RSVG_VAR extern 39 | # endif /* RSVG_STATIC */ 40 | # else /* G_PLATFORM_WIN32 */ 41 | # define RSVG_VAR extern 42 | # endif /* !G_PLATFORM_WIN32 */ 43 | #endif 44 | 45 | RSVG_VAR const guint librsvg_major_version; 46 | RSVG_VAR const guint librsvg_minor_version; 47 | RSVG_VAR const guint librsvg_micro_version; 48 | RSVG_VAR const char librsvg_version[]; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /librsvg-features.h.in: -------------------------------------------------------------------------------- 1 | #if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION) 2 | #warning "Including directly is deprecated." 3 | #endif 4 | 5 | #ifndef LIBRSVG_FEATURES_H 6 | #define LIBRSVG_FEATURES_H 7 | 8 | #define LIBRSVG_MAJOR_VERSION (@LIBRSVG_MAJOR_VERSION@) 9 | #define LIBRSVG_MINOR_VERSION (@LIBRSVG_MINOR_VERSION@) 10 | #define LIBRSVG_MICRO_VERSION (@LIBRSVG_MICRO_VERSION@) 11 | #define LIBRSVG_VERSION "@PACKAGE_VERSION@" 12 | 13 | #define LIBRSVG_CHECK_VERSION(major,minor,micro) \ 14 | (LIBRSVG_MAJOR_VERSION > (major) || \ 15 | (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION > (minor)) || \ 16 | (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION == (minor) && LIBRSVG_MICRO_VERSION >= (micro))) 17 | 18 | #ifndef __GI_SCANNER__ 19 | #define LIBRSVG_HAVE_SVGZ (TRUE) 20 | #define LIBRSVG_HAVE_CSS (TRUE) 21 | 22 | #define LIBRSVG_CHECK_FEATURE(FEATURE) (defined(LIBRSVG_HAVE_##FEATURE) && LIBRSVG_HAVE_##FEATURE) 23 | #endif 24 | 25 | /* 26 | * On Windows builds, we need to decorate variables that are exposed in the public API 27 | * so that they can be properly exported and linked to, for DLL builds 28 | */ 29 | #ifndef RSVG_VAR 30 | # ifdef G_PLATFORM_WIN32 31 | # ifndef RSVG_STATIC 32 | # ifdef RSVG_COMPILATION 33 | # define RSVG_VAR extern __declspec (dllexport) 34 | # else /* RSVG_COMPILATION */ 35 | # define RSVG_VAR extern __declspec (dllimport) 36 | # endif /* !RSVG_COMPILATION */ 37 | # else /* !RSVG_STATIC */ 38 | # define RSVG_VAR extern 39 | # endif /* RSVG_STATIC */ 40 | # else /* G_PLATFORM_WIN32 */ 41 | # define RSVG_VAR extern 42 | # endif /* !G_PLATFORM_WIN32 */ 43 | #endif 44 | 45 | RSVG_VAR const guint librsvg_major_version; 46 | RSVG_VAR const guint librsvg_minor_version; 47 | RSVG_VAR const guint librsvg_micro_version; 48 | RSVG_VAR const char librsvg_version[]; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /rsvg-mask.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-mask.h : Provides Masks 5 | 6 | Copyright (C) 2004 Caleb Moore 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this program; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | Boston, MA 02111-1307, USA. 22 | 23 | Author: Caleb Moore 24 | */ 25 | 26 | #ifndef RSVG_MASK_H 27 | #define RSVG_MASK_H 28 | 29 | #include "rsvg.h" 30 | #include "rsvg-defs.h" 31 | #include "rsvg-css.h" 32 | #include "rsvg-styles.h" 33 | #include "rsvg-shapes.h" 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef RsvgCoordUnits RsvgMaskUnits; 39 | 40 | typedef struct _RsvgMask RsvgMask; 41 | 42 | struct _RsvgMask { 43 | RsvgNode super; 44 | RsvgLength x, y, width, height; 45 | RsvgMaskUnits maskunits; 46 | RsvgMaskUnits contentunits; 47 | }; 48 | 49 | G_GNUC_INTERNAL 50 | RsvgNode *rsvg_new_mask (void); 51 | 52 | typedef struct _RsvgClipPath RsvgClipPath; 53 | 54 | struct _RsvgClipPath { 55 | RsvgNode super; 56 | RsvgCoordUnits units; 57 | }; 58 | 59 | G_GNUC_INTERNAL 60 | RsvgNode *rsvg_new_clip_path (void); 61 | 62 | G_END_DECLS 63 | #endif 64 | -------------------------------------------------------------------------------- /rsvg-defs.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-defs.h : SVG defs utilities 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | 27 | #ifndef RSVG_DEFS_H 28 | #define RSVG_DEFS_H 29 | 30 | /* A module for handling SVG defs */ 31 | 32 | #include 33 | 34 | #include "rsvg.h" 35 | 36 | G_BEGIN_DECLS 37 | 38 | G_GNUC_INTERNAL 39 | RsvgDefs *rsvg_defs_new (RsvgHandle *handle); 40 | /* for some reason this one's public... */ 41 | RsvgNode *rsvg_defs_lookup (const RsvgDefs * defs, const char *name); 42 | G_GNUC_INTERNAL 43 | void rsvg_defs_set (RsvgDefs * defs, const char *name, RsvgNode * val); 44 | G_GNUC_INTERNAL 45 | void rsvg_defs_free (RsvgDefs * defs); 46 | G_GNUC_INTERNAL 47 | void rsvg_defs_register_name (RsvgDefs * defs, const char *name, RsvgNode * val); 48 | G_GNUC_INTERNAL 49 | void rsvg_defs_register_memory (RsvgDefs * defs, RsvgNode * val); 50 | 51 | G_END_DECLS 52 | #endif 53 | -------------------------------------------------------------------------------- /tests/render-crash.c: -------------------------------------------------------------------------------- 1 | /* vim: set ts=4 nowrap ai expandtab sw=4: */ 2 | 3 | #include 4 | #include "rsvg.h" 5 | #include "rsvg-compat.h" 6 | #include "test-utils.h" 7 | 8 | static void 9 | test_render_crash (gconstpointer data) 10 | { 11 | GFile *file = G_FILE (data); 12 | RsvgHandle *handle; 13 | GError *error = NULL; 14 | RsvgDimensionData dimensions; 15 | cairo_surface_t *surface; 16 | cairo_t *cr; 17 | 18 | handle = rsvg_handle_new_from_gfile_sync (file, RSVG_HANDLE_FLAGS_NONE, NULL, &error); 19 | g_assert_no_error (error); 20 | g_assert (handle != NULL); 21 | 22 | rsvg_handle_get_dimensions (handle, &dimensions); 23 | g_assert (dimensions.width > 0); 24 | g_assert (dimensions.height > 0); 25 | surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 26 | dimensions.width, dimensions.height); 27 | cr = cairo_create (surface); 28 | g_assert (rsvg_handle_render_cairo (handle, cr)); 29 | 30 | cairo_surface_destroy (surface); 31 | cairo_destroy (cr); 32 | 33 | g_object_unref (handle); 34 | } 35 | 36 | int 37 | main (int argc, char *argv[]) 38 | { 39 | GFile *base, *crash; 40 | int result; 41 | 42 | RSVG_G_TYPE_INIT; 43 | g_test_init (&argc, &argv, NULL); 44 | 45 | if (argc < 2) { 46 | base = g_file_new_for_path (test_utils_get_test_data_path ()); 47 | crash = g_file_get_child (base, "render-crash"); 48 | test_utils_add_test_for_all_files ("/render-crash", crash, crash, test_render_crash, NULL); 49 | g_object_unref (base); 50 | g_object_unref (crash); 51 | } else { 52 | guint i; 53 | 54 | for (i = 1; i < argc; i++) { 55 | GFile *file = g_file_new_for_commandline_arg (argv[i]); 56 | 57 | test_utils_add_test_for_all_files ("/render-crash", NULL, file, test_render_crash, NULL); 58 | 59 | g_object_unref (file); 60 | } 61 | } 62 | 63 | result = g_test_run (); 64 | 65 | rsvg_cleanup (); 66 | 67 | return result; 68 | } 69 | -------------------------------------------------------------------------------- /rsvg-shapes.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-shapes.h: Draw SVG shapes 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002, 2003, 2004, 2005 Dom Lachowicz 8 | Copyright (C) 2003, 2004, 2005 Caleb Moore 9 | 10 | This program is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Library General Public License as 12 | published by the Free Software Foundation; either version 2 of the 13 | License, or (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Library General Public License for more details. 19 | 20 | You should have received a copy of the GNU Library General Public 21 | License along with this program; if not, write to the 22 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | Boston, MA 02111-1307, USA. 24 | 25 | Authors: Raph Levien , 26 | Dom Lachowicz , 27 | Caleb Moore 28 | */ 29 | 30 | #ifndef RSVG_SHAPES_H 31 | #define RSVG_SHAPES_H 32 | 33 | #include 34 | 35 | #include "rsvg-structure.h" 36 | 37 | G_BEGIN_DECLS 38 | 39 | G_GNUC_INTERNAL 40 | RsvgNode *rsvg_new_path (void); 41 | G_GNUC_INTERNAL 42 | RsvgNode *rsvg_new_polygon (void); 43 | G_GNUC_INTERNAL 44 | RsvgNode *rsvg_new_polyline (void); 45 | G_GNUC_INTERNAL 46 | RsvgNode *rsvg_new_line (void); 47 | G_GNUC_INTERNAL 48 | RsvgNode *rsvg_new_rect (void); 49 | G_GNUC_INTERNAL 50 | RsvgNode *rsvg_new_circle (void); 51 | G_GNUC_INTERNAL 52 | RsvgNode *rsvg_new_ellipse (void); 53 | 54 | typedef struct _RsvgNodePath RsvgNodePath; 55 | 56 | struct _RsvgNodePath { 57 | RsvgNode super; 58 | cairo_path_t *path; 59 | }; 60 | 61 | G_END_DECLS 62 | 63 | #endif /* RSVG_SHAPES_H */ 64 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/761175-recursive-masks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MSS/MilX-Export to SVG 6 | gs-soft AG 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /rsvg-image.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-image.h: Image loading and displaying 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002, 2003, 2004, 2005 Dom Lachowicz 8 | Copyright (C) 2003, 2004, 2005 Caleb Moore 9 | 10 | This program is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Library General Public License as 12 | published by the Free Software Foundation; either version 2 of the 13 | License, or (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Library General Public License for more details. 19 | 20 | You should have received a copy of the GNU Library General Public 21 | License along with this program; if not, write to the 22 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | Boston, MA 02111-1307, USA. 24 | 25 | Authors: Raph Levien , 26 | Dom Lachowicz , 27 | Caleb Moore 28 | */ 29 | 30 | #ifndef RSVG_IMAGE_H 31 | #define RSVG_IMAGE_H 32 | 33 | #include "rsvg-structure.h" 34 | 35 | #include 36 | 37 | G_BEGIN_DECLS 38 | 39 | G_GNUC_INTERNAL 40 | RsvgNode *rsvg_new_image (void); 41 | 42 | typedef struct _RsvgNodeImage RsvgNodeImage; 43 | 44 | struct _RsvgNodeImage { 45 | RsvgNode super; 46 | gint preserve_aspect_ratio; 47 | RsvgLength x, y, w, h; 48 | cairo_surface_t *surface; /* a cairo image surface */ 49 | }; 50 | 51 | G_GNUC_INTERNAL 52 | void rsvg_preserve_aspect_ratio (unsigned int aspect_ratio, double width, 53 | double height, double *w, double *h, double *x, double *y); 54 | G_GNUC_INTERNAL 55 | cairo_surface_t *rsvg_cairo_surface_new_from_href (RsvgHandle *handle, const char *href, GError ** error); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* RSVG_IMAGE_H */ 60 | -------------------------------------------------------------------------------- /rsvg-convert.1: -------------------------------------------------------------------------------- 1 | .TH rsvg-convert 1 2 | .SH NAME 3 | rsvg-convert \- turn SVG files into raster images. 4 | .SH SYNOPSIS 5 | .B rsvg-convert 6 | [options] in.svg > out.png 7 | .I "" 8 | .SH DESCRIPTION 9 | Converts SVG images into PNG raster images, PDF, PS, or SVG vector images, or dumps of Cairo XML or recording surfaces. 10 | .SS OPTIONS 11 | .TP 12 | .I "\-d \-\-dpi-x number" 13 | Set the X resolution of the image in pixels per inch. RSVG's current default is 90dpi 14 | .TP 15 | .I "\-p \-\-dpi-y number" 16 | Set the Y resolution of the image in pixels per inch. RSVG's current default is 90dpi 17 | .TP 18 | .I "\-x \-\-x\-zoom number" 19 | X Zoom factor, as a percentage. If unspecified, 1.0 is used as the default. 20 | .TP 21 | .I "\-y \-\-y\-zoom number" 22 | Y Zoom factor, as a percentage. If unspecified, 1.0 is used as the default. 23 | .TP 24 | .I "\-z \-\-\-zoom number" 25 | Zoom factor, as a percentage. If unspecified, 1.0 is used as the default. 26 | .TP 27 | .I "\-w \-\-width integer" 28 | Specify how wide you wish the image to be. If unspecified, the natural width of the image is used as the default. 29 | .TP 30 | .I "\-h \-\-height integer" 31 | Specify how tall you wish the image to be. If unspecified, the natural height of the image is used as the default. 32 | .TP 33 | .I "\-f \-\-format [png, pdf, ps, svg, xml, recording]" 34 | Specify the output format you wish the image to be saved in. If unspecified, PNG is used as the default. 35 | .TP 36 | .I "\-o \-\-output filename" 37 | Specify the output filename. If unspecified, outputs to stdout. 38 | .TP 39 | .I "\-a \-\-keep-aspect-ratio" 40 | Specify that the aspect ratio is to be preserved. If unspecified, aspect ratio will not be preserved. 41 | .TP 42 | .I "\-b \-\-background-color [black, white, #abccee, #aaa...]" 43 | Specify the background color. If unspecified, none is used as the default. 44 | .TP 45 | .I "\-\-base-uri uri" 46 | Specify the base URI for SVG files. If unspecified, none is used as the default. 47 | .TP 48 | .I "\-v \-\-version" 49 | Display what version of rsvg this is. 50 | .SH MORE INFORMATION 51 | http://librsvg.sourceforge.net/ 52 | http://www.w3.org/TR/SVG11/ 53 | http://www.gnome.org/ 54 | .SH "AUTHORS" 55 | Dom Lachowicz (cinamod@hotmail.com), Caleb Moore (c.moore@student.unsw.edu.au), and a host of others. 56 | -------------------------------------------------------------------------------- /tests/loading.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set ts=4 nowrap ai expandtab sw=4: */ 3 | 4 | #include "config.h" 5 | 6 | #include 7 | #include 8 | #include "rsvg.h" 9 | #include "rsvg-compat.h" 10 | #include "test-utils.h" 11 | 12 | typedef struct { 13 | const char *test_name; 14 | const char *fixture; 15 | size_t buf_size; 16 | } TestData; 17 | 18 | static void 19 | load_n_bytes_at_a_time (gconstpointer data) 20 | { 21 | const TestData *fixture_data = data; 22 | char *filename = g_build_filename (test_utils_get_test_data_path (), fixture_data->fixture, NULL); 23 | guchar *buf = g_new (guchar, fixture_data->buf_size); 24 | gboolean done; 25 | 26 | RsvgHandle *handle; 27 | FILE *file; 28 | 29 | file = fopen (filename, "rb"); 30 | g_assert (file != NULL); 31 | 32 | handle = rsvg_handle_new_with_flags (RSVG_HANDLE_FLAGS_NONE); 33 | 34 | done = FALSE; 35 | 36 | do { 37 | size_t num_read; 38 | 39 | num_read = fread (buf, 1, fixture_data->buf_size, file); 40 | 41 | if (num_read > 0) { 42 | g_assert (rsvg_handle_write (handle, buf, num_read, NULL) != FALSE); 43 | } else { 44 | g_assert (ferror (file) == 0); 45 | 46 | if (feof (file)) { 47 | done = TRUE; 48 | } 49 | } 50 | } while (!done); 51 | 52 | g_assert (rsvg_handle_close (handle, NULL) != FALSE); 53 | 54 | g_object_unref (handle); 55 | 56 | g_free (buf); 57 | } 58 | 59 | static TestData tests[] = { 60 | { "/loading/one-byte-at-a-time", "loading/gnome-cool.svg", 1 }, 61 | { "/loading/compressed-one-byte-at-a-time", "loading/gnome-cool.svgz", 1 }, 62 | { "/loading/compressed-two-bytes-at-a-time", "loading/gnome-cool.svgz", 2 } /* to test reading the entire gzip header */ 63 | }; 64 | 65 | int 66 | main (int argc, char **argv) 67 | { 68 | int result; 69 | int i; 70 | 71 | RSVG_G_TYPE_INIT; 72 | g_test_init (&argc, &argv, NULL); 73 | 74 | for (i = 0; i < G_N_ELEMENTS (tests); i++) { 75 | g_test_add_data_func (tests[i].test_name, &tests[i], load_n_bytes_at_a_time); 76 | } 77 | 78 | result = g_test_run (); 79 | 80 | rsvg_cleanup (); 81 | 82 | return result; 83 | } 84 | -------------------------------------------------------------------------------- /rsvg-cairo-render.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-cairo-render.h: The cairo backend plugin 5 | 6 | Copyright (C) 2005 Dom Lachowicz 7 | Caleb Moore 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Authors: Dom Lachowicz 25 | Caleb Moore 26 | */ 27 | 28 | #ifndef RSVG_CAIRO_RENDER_H 29 | #define RSVG_CAIRO_RENDER_H 30 | 31 | #include "rsvg-private.h" 32 | #include 33 | 34 | #ifdef HAVE_PANGOFT2 35 | #include 36 | #endif 37 | 38 | G_BEGIN_DECLS typedef struct _RsvgCairoRender RsvgCairoRender; 39 | 40 | struct _RsvgCairoRender { 41 | RsvgRender super; 42 | cairo_t *cr; 43 | double width; 44 | double height; 45 | 46 | cairo_t *initial_cr; 47 | double offset_x; 48 | double offset_y; 49 | 50 | GList *cr_stack; 51 | 52 | RsvgBbox bbox; 53 | GList *bb_stack; 54 | GList *surfaces_stack; 55 | 56 | #ifdef HAVE_PANGOFT2 57 | FcConfig *font_config_for_testing; 58 | PangoFontMap *font_map_for_testing; 59 | #endif 60 | }; 61 | 62 | #define RSVG_CAIRO_RENDER(render) (_RSVG_RENDER_CIC ((render), RSVG_RENDER_TYPE_CAIRO, RsvgCairoRender)) 63 | 64 | G_GNUC_INTERNAL 65 | RsvgCairoRender *rsvg_cairo_render_new (cairo_t * cr, double width, double height); 66 | 67 | G_GNUC_INTERNAL 68 | RsvgDrawingCtx *rsvg_cairo_new_drawing_ctx (cairo_t * cr, RsvgHandle * handle); 69 | 70 | G_END_DECLS 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | This is an incomplete list of people who have worked on librsvg. If you are missing here, 2 | please send mail to the maintainers! 3 | 4 | Adam Sampson 5 | Adam Tkac 6 | Adrian Bunk 7 | Alex Duggan 8 | Alex Larsson 9 | Alexander Larsson 10 | Alexandre Rostovtsev 11 | Alexey Pavlov 12 | Anders Carlsson 13 | Andre Klapper 14 | Andrea Griffini 15 | Angus Gratton 16 | Antoine Jacoutot 17 | Bastien Nocera 18 | Behdad Esfahbod 19 | Benjamin Otte 20 | Bertram Felgenhauer 21 | Bruno Girin 22 | Caleb Michael Moore 23 | Carl Worth 24 | Carlos Garnacho 25 | Christian Fredrik Kalager Schaller 26 | Christian Persch 27 | Christian Schaller 28 | Chun-wei Fan 29 | Colin Walters 30 | Craig Keogh 31 | Daniel Drake 32 | Darin Adler 33 | Didier Barvaux 34 | Dodji Seketeli 35 | Dom Lachowicz 36 | Dominic Lachowicz 37 | Edward Sheldrake 38 | Emilio Pozuelo Monfort 39 | Emmanuel Pacaud 40 | Evan Nemerson 41 | Fatih Demir 42 | Federico Mena Quintero 43 | Felix Riemann 44 | Florian Müllner 45 | Gediminas Paulauskas 46 | Germán Poo-Caamaño 47 | Glynn Foster 48 | Gregory Leblanc 49 | Hagen Schink 50 | Hans Breuer 51 | Hans Nieser 52 | Hans de Goede 53 | Hiroyuki Ikezoe 54 | Isak 55 | jacob berkman 56 | Jan Arne Petersen 57 | Jasper Lievisse Adriaanse 58 | Jasper St. Pierre 59 | Javier Jardón 60 | Jean-Baptiste Lallement 61 | John Ralls 62 | Jonathan Blandford 63 | Josselin Mouette 64 | KUROSAWA Takeshi 65 | Kjartan Maraas 66 | Kouhei Sutou 67 | Kurosawa Takeshi 68 | liucougar 69 | LRN 70 | Laszlo Peter 71 | Luis Menina 72 | Maarten Bosmans 73 | Maciej Piechotka 74 | Martin von Gagern 75 | Massimo 76 | Matthias Clasen 77 | Menner 78 | Menner 79 | Michael Meeks 80 | Nicholas Beeuwsaert 81 | Olav Vitters 82 | Owen Taylor 83 | Øyvind Kolås 84 | Paolo Borelli 85 | Philip Withnall 86 | Ramiro Estrugo 87 | Raph Levien 88 | Ray Strode 89 | Richard Hughes 90 | Robert Ancell 91 | Robert Staudinger 92 | Robin Slomkowski 93 | Ron Hopper 94 | Ross Burton 95 | Simon Budig 96 | Suzuki Toshiya 97 | Sven Neumann 98 | Thomas Andersen 99 | Thomas Vander Stichele 100 | Tom Paker 101 | Tor Lillqvist 102 | Vincent Penquerc'h 103 | Vincent Untz 104 | William Hua 105 | William Lachance 106 | Wouter Bolsterlee 107 | -------------------------------------------------------------------------------- /doc/html/api-index-2-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.4: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Index of new symbols in 2.4

25 |

H

26 |
27 | rsvg_handle_get_desc, function in RsvgHandle 28 |
29 |
30 |
31 | rsvg_handle_get_title, function in RsvgHandle 32 |
33 |
34 |
35 | 37 | 38 | -------------------------------------------------------------------------------- /tests/dimensions.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set ts=4 nowrap ai expandtab sw=4: */ 3 | 4 | #include 5 | #include "rsvg.h" 6 | #include "rsvg-compat.h" 7 | #include "test-utils.h" 8 | 9 | typedef struct _FixtureData 10 | { 11 | const gchar *test_name; 12 | const gchar *file_path; 13 | const gchar *id; 14 | gint width; 15 | gint height; 16 | } FixtureData; 17 | 18 | static void 19 | test_dimensions (FixtureData *fixture) 20 | { 21 | RsvgHandle *handle; 22 | RsvgDimensionData dimension; 23 | gchar *target_file; 24 | GError *error = NULL; 25 | 26 | target_file = g_build_filename (test_utils_get_test_data_path (), 27 | fixture->file_path, NULL); 28 | handle = rsvg_handle_new_from_file (target_file, &error); 29 | g_free (target_file); 30 | g_assert_no_error (error); 31 | 32 | if (fixture->id) { 33 | gboolean got_sub; 34 | 35 | got_sub = rsvg_handle_get_dimensions_sub (handle, &dimension, fixture->id); 36 | g_assert (got_sub); 37 | g_message ("w=%d h=%d", dimension.width, dimension.height); 38 | } else 39 | rsvg_handle_get_dimensions (handle, &dimension); 40 | 41 | g_assert_cmpint (fixture->width, ==, dimension.width); 42 | g_assert_cmpint (fixture->height, ==, dimension.height); 43 | 44 | g_object_unref (handle); 45 | } 46 | 47 | static FixtureData fixtures[] = 48 | { 49 | {"/dimensions/no viewbox, width and height", "dimensions/bug608102.svg", NULL, 16, 16}, 50 | {"/dimensions/100% width and height", "dimensions/bug612951.svg", NULL, 47, 47}, 51 | {"/dimensions/viewbox only", "dimensions/bug614018.svg", NULL, 972, 546}, 52 | {"/dimensions/sub/rect no unit", "dimensions/sub-rect-no-unit.svg", "#rect-no-unit", 44, 45}, 53 | /* {"/dimensions/sub/rect with transform", "dimensions/bug564527.svg", "#back", 144, 203} */ 54 | }; 55 | 56 | static const gint n_fixtures = G_N_ELEMENTS (fixtures); 57 | 58 | int 59 | main (int argc, char *argv[]) 60 | { 61 | gint i; 62 | int result; 63 | 64 | RSVG_G_TYPE_INIT; 65 | g_test_init (&argc, &argv, NULL); 66 | 67 | for (i = 0; i < n_fixtures; i++) 68 | g_test_add_data_func (fixtures[i].test_name, &fixtures[i], (void*)test_dimensions); 69 | 70 | result = g_test_run (); 71 | 72 | rsvg_cleanup (); 73 | 74 | return result; 75 | } 76 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Librsvg 2 | ======= 3 | 4 | This is librsvg - A small library to render Scalable Vector Graphics 5 | (SVG), associated with the GNOME Project. It renders SVG files to 6 | Cairo surfaces. Cairo is the 2D, antialiased drawing library that 7 | GNOME uses to draw things to the screen or to generate output for 8 | printing. 9 | 10 | Do you want to render non-animated SVGs to a Cairo surface with a 11 | minimal API? Librsvg may be adequate for you. 12 | 13 | LIBRSVG 2.40.X IS DEPRECATED! 14 | ----------------------------- 15 | 16 | You are looking at the 2.40.x series in librsvg, which is implemented 17 | in the C programming language. This release series is no longer 18 | maintained! 19 | 20 | As of December 2017, we are in the process of porting the internals of 21 | librsvg from C to Rust. The public Application Programming Interface 22 | (API) and Application Binary Interface (ABI) of librsvg remain 23 | identical in the Rust version: it is a **drop-in replacement** for the 24 | version you are looking at. 25 | 26 | **We strongly recommend that you update to the new version of librsvg, 27 | as it has security fixes, lots of bug fixes, and ongoing development.** 28 | 29 | From the outside, the only difference is that librsvg is now much more 30 | trustworthy when run against untrusted SVG files. 31 | 32 | From the inside, the new codebase is just much nicer to work on! If 33 | you want to contribute to librsvg, please look at that version 34 | instead. You can find it at https://gitlab.gnome.org/GNOME/librsvg 35 | 36 | There is a code of conduct for contributors to librsvg; please see the 37 | file code_of_conduct.md. 38 | 39 | Reporting bugs 40 | -------------- 41 | 42 | Please report bugs at https://gitlab.gnome.org/GNOME/librsvg/issues 43 | 44 | If you want to report a rendering bug, or a missing SVG feature, 45 | please provide an example SVG file as an attachment to your bug 46 | report. It really helps if you can minimize the SVG to only the 47 | elements required to reproduce the bug or see the missing feature, but 48 | it is not absolutely required. Please be careful of publishing SVG 49 | images that you don't want other people to see; the bug tracker is a 50 | public resource and attachments are visible to everyone. 51 | 52 | Maintainers 53 | ----------- 54 | 55 | The maintainer of librsvg is Federico Mena Quintero 56 | . You can mail me for any other questions you 57 | have about librsvg. 58 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/glib-tap.mk 2 | 3 | test_programs = \ 4 | loading \ 5 | rsvg-test \ 6 | crash \ 7 | styles \ 8 | render-crash \ 9 | dimensions 10 | 11 | test_utils_common_sources = \ 12 | test-utils.c \ 13 | test-utils.h 14 | 15 | rsvg_test_SOURCES = \ 16 | rsvg-test.c \ 17 | $(test_utils_common_sources) 18 | 19 | crash_SOURCES = \ 20 | crash.c \ 21 | $(test_utils_common_sources) 22 | 23 | render_crash_SOURCES = \ 24 | render-crash.c \ 25 | $(test_utils_common_sources) 26 | 27 | styles_SOURCES = \ 28 | styles.c \ 29 | $(test_utils_common_sources) 30 | 31 | dimensions_SOURCES = \ 32 | dimensions.c \ 33 | $(test_utils_common_sources) 34 | 35 | loading_SOURCES = \ 36 | loading.c \ 37 | $(test_utils_common_sources) 38 | 39 | LDADD = $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \ 40 | $(LIBRSVG_LIBS) \ 41 | $(LIBM) 42 | 43 | INCLUDES = -I$(srcdir) \ 44 | -I$(top_srcdir) \ 45 | -DTEST_DATA_DIR="\"$(srcdir)\"" \ 46 | -DTEST_SRC_DIR="\"$(PWD)\"" \ 47 | -DTOP_SRC_DIR="\"$(top_srcdir)\"" \ 48 | $(LIBRSVG_CFLAGS) 49 | 50 | dist_installed_test_data = \ 51 | $(wildcard $(srcdir)/resources/*) \ 52 | $(wildcard $(srcdir)/fixtures/crash/*.svg) \ 53 | $(wildcard $(srcdir)/fixtures/crash/*.png) \ 54 | $(wildcard $(srcdir)/fixtures/loading/*) \ 55 | $(wildcard $(srcdir)/fixtures/reftests/*.svg) \ 56 | $(wildcard $(srcdir)/fixtures/reftests/*.png) \ 57 | $(wildcard $(srcdir)/fixtures/reftests/bugs/*.svg) \ 58 | $(wildcard $(srcdir)/fixtures/reftests/bugs/*.png) \ 59 | $(wildcard $(srcdir)/fixtures/reftests/svg1.1/*.svg) \ 60 | $(wildcard $(srcdir)/fixtures/reftests/svg1.1/*.png) \ 61 | $(wildcard $(srcdir)/fixtures/reftests/svg1.1/resources/*) \ 62 | $(wildcard $(srcdir)/fixtures/render-crash/*.svg) \ 63 | fixtures/dimensions/bug564527.svg \ 64 | fixtures/dimensions/bug614018.svg \ 65 | fixtures/dimensions/bug612951.svg \ 66 | fixtures/dimensions/bug608102.svg \ 67 | fixtures/dimensions/sub-rect-no-unit.svg \ 68 | fixtures/styles/bug620693.svg \ 69 | fixtures/styles/bug614704.svg \ 70 | fixtures/styles/bug614606.svg \ 71 | fixtures/styles/important.svg \ 72 | fixtures/styles/svg-class.svg \ 73 | fixtures/styles/bug592207.svg \ 74 | fixtures/styles/bug338160.svg \ 75 | fixtures/styles/bug379629.svg \ 76 | fixtures/styles/bug614643.svg \ 77 | fixtures/styles/bug418823.svg \ 78 | fixtures/styles/order.svg 79 | -------------------------------------------------------------------------------- /doc/rsvg-sections.txt: -------------------------------------------------------------------------------- 1 |
2 | rsvg-handle 3 | RsvgHandle 4 | RsvgError 5 | RSVG_ERROR 6 | rsvg_error_quark 7 | RsvgHandle 8 | RsvgHandlePrivate 9 | RsvgHandleClass 10 | RsvgDimensionData 11 | RsvgPositionData 12 | rsvg_cleanup 13 | rsvg_set_default_dpi 14 | rsvg_set_default_dpi_x_y 15 | rsvg_handle_set_dpi 16 | rsvg_handle_set_dpi_x_y 17 | rsvg_handle_new 18 | rsvg_handle_new_with_flags 19 | rsvg_handle_write 20 | rsvg_handle_close 21 | rsvg_handle_get_base_uri 22 | rsvg_handle_set_base_uri 23 | rsvg_handle_get_dimensions 24 | rsvg_handle_get_dimensions_sub 25 | rsvg_handle_get_position_sub 26 | rsvg_handle_has_sub 27 | rsvg_handle_get_title 28 | rsvg_handle_get_desc 29 | rsvg_handle_get_metadata 30 | rsvg_handle_new_from_data 31 | rsvg_handle_new_from_file 32 | rsvg_error_get_type 33 | RSVG_TYPE_ERROR 34 | 35 | 36 | rsvg_init 37 | rsvg_term 38 | rsvg_handle_free 39 | RsvgSizeFunc 40 | rsvg_handle_set_size_callback 41 | 42 | 43 | RSVG_HANDLE 44 | RSVG_IS_HANDLE 45 | RSVG_TYPE_HANDLE 46 | rsvg_handle_get_type 47 | RSVG_HANDLE_CLASS 48 | RSVG_IS_HANDLE_CLASS 49 | RSVG_HANDLE_GET_CLASS 50 |
51 | 52 |
53 | rsvg-gio 54 | Using RSVG with GIO 55 | RsvgHandleFlags 56 | rsvg_handle_set_base_gfile 57 | rsvg_handle_read_stream_sync 58 | rsvg_handle_new_from_gfile_sync 59 | rsvg_handle_new_from_stream_sync 60 | 61 | 62 | rsvg_handle_flags_get_type 63 | RSVG_TYPE_HANDLE_FLAGS 64 |
65 | 66 |
67 | rsvg-cairo 68 | Using RSVG with cairo 69 | rsvg_handle_render_cairo 70 | rsvg_handle_render_cairo_sub 71 |
72 | 73 |
74 | rsvg-pixbuf 75 | Using RSVG with GdkPixbuf 76 | rsvg_handle_get_pixbuf 77 | rsvg_handle_get_pixbuf_sub 78 | rsvg_pixbuf_from_file 79 | rsvg_pixbuf_from_file_at_zoom 80 | rsvg_pixbuf_from_file_at_size 81 | rsvg_pixbuf_from_file_at_max_size 82 | rsvg_pixbuf_from_file_at_zoom_with_max 83 |
84 | 85 |
86 | rsvg-features 87 | Version check and feature tests 88 | LIBRSVG_MAJOR_VERSION 89 | LIBRSVG_MINOR_VERSION 90 | LIBRSVG_MICRO_VERSION 91 | LIBRSVG_VERSION 92 | LIBRSVG_CHECK_VERSION 93 | LIBRSVG_HAVE_SVGZ 94 | LIBRSVG_HAVE_CSS 95 | LIBRSVG_CHECK_FEATURE 96 | librsvg_version 97 | librsvg_preinit 98 | librsvg_postinit 99 |
100 | -------------------------------------------------------------------------------- /doc/html/object-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Object Hierarchy: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Object Hierarchy

25 |
26 |     GObject
27 |     ╰── RsvgHandle
28 |     GEnum
29 |     ╰── RsvgError
30 |     GFlags
31 |     ╰── RsvgHandleFlags
32 | 
33 |
34 | 36 | 37 | -------------------------------------------------------------------------------- /doc/html/api-index-2-22.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.22: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Index of new symbols in 2.22

25 |

H

26 |
27 | rsvg_handle_get_dimensions_sub, function in RsvgHandle 28 |
29 |
30 |
31 | rsvg_handle_get_position_sub, function in RsvgHandle 32 |
33 |
34 |
35 | rsvg_handle_has_sub, function in RsvgHandle 36 |
37 |
38 |
39 | 41 | 42 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define if building universal (internal helper macro) */ 4 | #undef AC_APPLE_UNIVERSAL_BUILD 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DLFCN_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_INTTYPES_H 11 | 12 | /* Define if your file defines LC_MESSAGES. */ 13 | #undef HAVE_LC_MESSAGES 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_LOCALE_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_MEMORY_H 20 | 21 | /* Have the pangoft2 library */ 22 | #undef HAVE_PANGOFT2 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDLIB_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STRINGS_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRING_H 35 | 36 | /* Define to 1 if you have the `strtok_r' function. */ 37 | #undef HAVE_STRTOK_R 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_STAT_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_TYPES_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_UNISTD_H 47 | 48 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 49 | #undef LT_OBJDIR 50 | 51 | /* Name of package */ 52 | #undef PACKAGE 53 | 54 | /* Define to the address where bug reports for this package should be sent. */ 55 | #undef PACKAGE_BUGREPORT 56 | 57 | /* Define to the full name of this package. */ 58 | #undef PACKAGE_NAME 59 | 60 | /* Define to the full name and version of this package. */ 61 | #undef PACKAGE_STRING 62 | 63 | /* Define to the one symbol short name of this package. */ 64 | #undef PACKAGE_TARNAME 65 | 66 | /* Define to the home page for this package. */ 67 | #undef PACKAGE_URL 68 | 69 | /* Define to the version of this package. */ 70 | #undef PACKAGE_VERSION 71 | 72 | /* Define to 1 if you have the ANSI C header files. */ 73 | #undef STDC_HEADERS 74 | 75 | /* Version number of package */ 76 | #undef VERSION 77 | 78 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 79 | significant byte first (like Motorola and SPARC, unlike Intel). */ 80 | #if defined AC_APPLE_UNIVERSAL_BUILD 81 | # if defined __BIG_ENDIAN__ 82 | # define WORDS_BIGENDIAN 1 83 | # endif 84 | #else 85 | # ifndef WORDS_BIGENDIAN 86 | # undef WORDS_BIGENDIAN 87 | # endif 88 | #endif 89 | -------------------------------------------------------------------------------- /rsvg-cairo-draw.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-shapes.c: Draw shapes with libart 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Authors: Raph Levien , 25 | Dom Lachowicz , 26 | Caleb Moore 27 | */ 28 | #ifndef RSVG_CAIRO_DRAW_H 29 | #define RSVG_CAIRO_DRAW_H 30 | 31 | #include "rsvg-private.h" 32 | 33 | G_BEGIN_DECLS 34 | 35 | G_GNUC_INTERNAL 36 | PangoContext *rsvg_cairo_create_pango_context (RsvgDrawingCtx *ctx); 37 | G_GNUC_INTERNAL 38 | void rsvg_cairo_render_pango_layout (RsvgDrawingCtx *ctx, PangoLayout *layout, 39 | double x, double y); 40 | G_GNUC_INTERNAL 41 | void rsvg_cairo_render_path (RsvgDrawingCtx *ctx, 42 | const cairo_path_t *path); 43 | G_GNUC_INTERNAL 44 | void rsvg_cairo_render_surface (RsvgDrawingCtx *ctx, cairo_surface_t *surface, 45 | double x, double y, double w, double h); 46 | G_GNUC_INTERNAL 47 | void rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx); 48 | G_GNUC_INTERNAL 49 | void rsvg_cairo_pop_discrete_layer (RsvgDrawingCtx *ctx); 50 | G_GNUC_INTERNAL 51 | void rsvg_cairo_add_clipping_rect (RsvgDrawingCtx *ctx, 52 | double x, double y, double width, double height); 53 | G_GNUC_INTERNAL 54 | cairo_surface_t*rsvg_cairo_get_surface_of_node (RsvgDrawingCtx *ctx, RsvgNode *drawable, 55 | double width, double height); 56 | 57 | G_END_DECLS 58 | 59 | #endif /*RSVG_CAIRO_DRAW_H */ 60 | -------------------------------------------------------------------------------- /doc/html/api-index-2-36.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.32: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |

26 | Index of new symbols in 2.32

27 |

C

28 |
29 | rsvg_cleanup, function in RsvgHandle 30 |
31 |
32 |

H

33 |
34 | RsvgHandle:flags, object property in RsvgHandle 35 |
36 |
37 |
38 | rsvg_handle_new_with_flags, function in RsvgHandle 39 |
40 |
41 |
42 | 44 | 45 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/476507.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 33 | 34 | 35 | 53 | 55 | 56 | 58 | image/svg+xml 59 | 61 | 62 | 63 | 64 | 65 | 69 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/html/rsvg.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Part I. API Reference: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Part I. API Reference

25 |
26 |
27 |

28 | The GNOME SVG Library (RSVG) is library for rendering SVG and SVGZ files. 29 |

30 |
31 |

Table of Contents

32 |
33 |
34 | RsvgHandle — Create and manipulate SVG objects 35 |
36 |
37 | Using RSVG with GIO 38 |
39 |
40 | Using RSVG with cairo 41 |
42 |
43 | Using RSVG with GdkPixbuf — How to render SVGs into GdkPixbufs, for easy use in GTK+ 44 | applications 45 |
46 |
47 | Version check and feature tests 48 |
49 |
50 |
51 |
52 |
53 | 55 | 56 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/603550-mask-luminance.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 11 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | 131 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/777834-empty-text-children.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | ]> 8 | 9 | 19 | 21 | 23 | 29 | 33 | 37 | 38 | 45 | 46 | 52 | 54 | Hello World! 55 | 56 | 62 | 65 | Hello World! 66 | 67 | 73 | 76 | Hello World! 77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/html/licence.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Appendix A. Licence: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |

23 | Appendix A. Licence

24 |

25 | This library is free software; you can redistribute it and/or 26 | modify it under the terms of the GNU General Public 27 | Licence as published by the Free Software Foundation; either 28 | version 2 of the Licence, or (at your option) any later version. 29 |

30 |

31 | This library is distributed in the hope that it will be useful, 32 | but WITHOUT ANY WARRANTY; without even the implied warranty of 33 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 34 | GNU General Public Licence for 35 | more details. 36 |

37 |

38 | You may obtain a copy of the GNU General Public Licence 39 | from the Free Software Foundation at 40 | GNU Licences web site 41 | or by writing to: 42 | 43 |

44 |


45 |         The Free Software Foundation, Inc.,
46 |         51 Franklin St – Fifth Floor,
47 |         BostonMA 02110-1301,
48 |         USA
49 |       

50 |

51 |

52 |
53 | 55 | 56 | -------------------------------------------------------------------------------- /gdk-pixbuf-loader/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 2011 Christian Persch 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public License as 6 | published by the Free Software Foundation; either version 2.1 of the 7 | License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this program; if not, write to the 16 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include "rsvg-compat.h" 28 | 29 | int 30 | main (int argc, char **argv) 31 | { 32 | GOptionContext *context; 33 | int width = -1; 34 | int height = -1; 35 | char **args = NULL; 36 | GdkPixbuf *pixbuf = NULL; 37 | GError *error = NULL; 38 | int ret = 1; 39 | 40 | GOptionEntry options_table[] = { 41 | { "width", 'w', 0, G_OPTION_ARG_INT, &width, 42 | "width [optional; defaults to the SVG's width]", "WIDTH" }, 43 | { "height", 'h', 0, G_OPTION_ARG_INT, &height, 44 | "height [optional; defaults to the SVG's height]", "HEIGHT" }, 45 | { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL, "INPUT-FILE OUTPUT-FILE" }, 46 | { NULL } 47 | }; 48 | 49 | setlocale(LC_ALL, ""); 50 | 51 | /* Use the locally built rsvg loader, not the system one */ 52 | g_setenv ("GDK_PIXBUF_MODULE_FILE", "./gdk-pixbuf.loaders", TRUE); 53 | 54 | RSVG_G_TYPE_INIT; 55 | 56 | context = g_option_context_new ("- Pixbuf Test Loader"); 57 | g_option_context_add_main_entries (context, options_table, NULL); 58 | g_option_context_parse (context, &argc, &argv, &error); 59 | g_option_context_free (context); 60 | if (error) 61 | goto done; 62 | 63 | if (args == NULL || g_strv_length (args) != 2) { 64 | g_printerr ("Need to specify input and output filenames\n"); 65 | goto done; 66 | } 67 | 68 | pixbuf = gdk_pixbuf_new_from_file_at_size (args[0], width, height, &error); 69 | if (pixbuf == NULL) 70 | goto done; 71 | 72 | if (!gdk_pixbuf_save (pixbuf, args[1], "png", &error, NULL)) 73 | goto done; 74 | 75 | /* Success! */ 76 | ret = 0; 77 | 78 | done: 79 | 80 | if (error) { 81 | g_printerr ("Error: %s\n", error->message); 82 | g_error_free (error); 83 | } 84 | 85 | if (pixbuf) 86 | g_object_unref (pixbuf); 87 | 88 | g_strfreev (args); 89 | 90 | return ret; 91 | } 92 | -------------------------------------------------------------------------------- /rsvg-path.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-path.h: Draw SVG paths 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | 27 | #ifndef RSVG_PATH_H 28 | #define RSVG_PATH_H 29 | 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | typedef struct { 36 | GArray *path_data; 37 | int last_move_to_index; 38 | } RsvgPathBuilder; 39 | 40 | G_GNUC_INTERNAL 41 | void rsvg_path_builder_init (RsvgPathBuilder *builder, 42 | int n_elements); 43 | G_GNUC_INTERNAL 44 | void rsvg_path_builder_move_to (RsvgPathBuilder *builder, 45 | double x, 46 | double y); 47 | G_GNUC_INTERNAL 48 | void rsvg_path_builder_line_to (RsvgPathBuilder *builder, 49 | double x, 50 | double y); 51 | G_GNUC_INTERNAL 52 | void rsvg_path_builder_curve_to (RsvgPathBuilder *builder, 53 | double x1, 54 | double y1, 55 | double x2, 56 | double y2, 57 | double x3, 58 | double y3); 59 | 60 | G_GNUC_INTERNAL 61 | void rsvg_path_builder_arc (RsvgPathBuilder *builder, 62 | double x1, double y1, 63 | double rx, double ry, 64 | double x_axis_rotation, 65 | gboolean large_arc_flag, gboolean sweep_flag, 66 | double x2, double y2); 67 | 68 | G_GNUC_INTERNAL 69 | void rsvg_path_builder_close_path (RsvgPathBuilder *builder); 70 | G_GNUC_INTERNAL 71 | cairo_path_t *rsvg_path_builder_finish (RsvgPathBuilder *builder); 72 | G_GNUC_INTERNAL 73 | cairo_path_t *rsvg_parse_path (const char *path_str); 74 | G_GNUC_INTERNAL 75 | void rsvg_cairo_path_destroy (cairo_path_t *path); 76 | 77 | G_END_DECLS 78 | 79 | #endif /* RSVG_PATH_H */ 80 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-mask-02-f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

12 | If the 'mask' property references a 'mask' element containing no children, the element referencing it is not rendered. 13 |

14 | 15 | 16 |

Run the test. No interaction required.

17 |
18 | 19 |

20 | Test passes if there is a single green rectangle, with no red visible on the page. 21 |

22 |
23 | 24 | $RCSfile: masking-mask-02-f.svg,v $ 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | $Revision: 1.3 $ 42 | 43 | 44 | 50 | -------------------------------------------------------------------------------- /tests/test-utils.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | 4 | #include "config.h" 5 | #include "test-utils.h" 6 | 7 | #include 8 | 9 | static gchar *data_path = NULL; 10 | const gchar * 11 | test_utils_get_test_data_path (void) 12 | { 13 | if (data_path) 14 | return data_path; 15 | 16 | data_path = g_build_filename (g_test_get_dir (G_TEST_DIST), 17 | "fixtures", 18 | NULL); 19 | 20 | return data_path; 21 | } 22 | 23 | static int 24 | compare_files (gconstpointer a, gconstpointer b) 25 | { 26 | GFile *file1 = G_FILE (a); 27 | GFile *file2 = G_FILE (b); 28 | char *uri1, *uri2; 29 | int result; 30 | 31 | uri1 = g_file_get_uri (file1); 32 | uri2 = g_file_get_uri (file2); 33 | 34 | result = strcmp (uri1, uri2); 35 | 36 | g_free (uri1); 37 | g_free (uri2); 38 | 39 | return result; 40 | } 41 | 42 | void 43 | test_utils_add_test_for_all_files (const gchar *prefix, 44 | GFile *base, 45 | GFile *file, 46 | GTestDataFunc test_func, 47 | AddTestFunc add_test_func) 48 | { 49 | GFileEnumerator *enumerator; 50 | GFileInfo *info; 51 | GList *l, *files; 52 | GError *error = NULL; 53 | 54 | 55 | if (g_file_query_file_type (file, 0, NULL) != G_FILE_TYPE_DIRECTORY) 56 | { 57 | gchar *test_path; 58 | gchar *relative_path; 59 | 60 | if (base) 61 | relative_path = g_file_get_relative_path (base, file); 62 | else 63 | relative_path = g_file_get_path (file); 64 | 65 | test_path = g_strconcat (prefix, "/", relative_path, NULL); 66 | g_free (relative_path); 67 | 68 | g_test_add_data_func_full (test_path, g_object_ref (file), test_func, g_object_unref); 69 | 70 | g_free (test_path); 71 | return; 72 | } 73 | 74 | 75 | enumerator = g_file_enumerate_children (file, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &error); 76 | g_assert_no_error (error); 77 | files = NULL; 78 | 79 | while ((info = g_file_enumerator_next_file (enumerator, NULL, &error))) 80 | { 81 | GFile *next_file = g_file_get_child (file, g_file_info_get_name (info)); 82 | 83 | if (add_test_func == NULL || add_test_func (next_file)) 84 | { 85 | files = g_list_prepend (files, g_object_ref (next_file)); 86 | } 87 | 88 | g_object_unref (next_file); 89 | g_object_unref (info); 90 | } 91 | 92 | g_assert_no_error (error); 93 | g_object_unref (enumerator); 94 | 95 | files = g_list_sort (files, compare_files); 96 | 97 | for (l = files; l; l = l->next) 98 | { 99 | test_utils_add_test_for_all_files (prefix, base, l->data, test_func, add_test_func); 100 | } 101 | 102 | g_list_free_full (files, g_object_unref); 103 | } 104 | -------------------------------------------------------------------------------- /config.h.win32: -------------------------------------------------------------------------------- 1 | /* config.h.win32.in. Manually Edited for Windows Builds. */ 2 | 3 | /* Define if building universal (internal helper macro) */ 4 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 5 | 6 | /* Define to 1 if you have the header file. */ 7 | /* #undef HAVE_DLFCN_H */ 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #if !defined (_MSC_VER) || (_MSC_VER >= 1800) 11 | #define HAVE_INTTYPES_H 1 12 | #endif 13 | 14 | /* Define if your file defines LC_MESSAGES. */ 15 | /* #undef HAVE_LC_MESSAGES */ 16 | 17 | /* Define to 1 if you have the header file. */ 18 | #define HAVE_LOCALE_H 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #define HAVE_MEMORY_H 1 22 | 23 | /* Have the pangoft2 library */ 24 | /* #define HAVE_PANGOFT2 1 */ 25 | 26 | /* Define to 1 if you have the header file. */ 27 | #if !defined (_MSC_VER) || (_MSC_VER >= 1600) 28 | #define HAVE_STDINT_H 1 29 | #endif 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STDLIB_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #ifndef _MSC_VER 36 | #define HAVE_STRINGS_H 1 37 | #endif 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #define HAVE_STRING_H 1 41 | 42 | /* Define to 1 if you have the `strtok_r' function. */ 43 | /* #undef HAVE_STRTOK_R */ 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #define HAVE_SYS_STAT_H 1 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #define HAVE_SYS_TYPES_H 1 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #ifndef _MSC_VER 53 | #define HAVE_UNISTD_H 1 54 | #endif 55 | 56 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 57 | */ 58 | #define LT_OBJDIR ".libs/" 59 | 60 | /* Name of package */ 61 | #define PACKAGE "librsvg" 62 | 63 | /* Define to the address where bug reports for this package should be sent. */ 64 | #define PACKAGE_BUGREPORT "https://bugzilla.gnome.org/enter_bug.cgi?product=librsvg" 65 | 66 | /* Define to the full name of this package. */ 67 | #define PACKAGE_NAME "RSVG" 68 | 69 | /* Define to the full name and version of this package. */ 70 | #define PACKAGE_STRING "RSVG 2.40.20" 71 | 72 | /* Define to the one symbol short name of this package. */ 73 | #define PACKAGE_TARNAME "librsvg" 74 | 75 | /* Define to the home page for this package. */ 76 | #define PACKAGE_URL "" 77 | 78 | /* Define to the version of this package. */ 79 | #define PACKAGE_VERSION "2.40.20" 80 | 81 | /* Define to 1 if you have the ANSI C header files. */ 82 | #define STDC_HEADERS 1 83 | 84 | /* Version number of package */ 85 | #define VERSION "2.40.20" 86 | 87 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 88 | significant byte first (like Motorola and SPARC, unlike Intel). */ 89 | #if defined AC_APPLE_UNIVERSAL_BUILD 90 | # if defined __BIG_ENDIAN__ 91 | # define WORDS_BIGENDIAN 1 92 | # endif 93 | #else 94 | # ifndef WORDS_BIGENDIAN 95 | # undef WORDS_BIGENDIAN 96 | # endif 97 | #endif 98 | -------------------------------------------------------------------------------- /config.h.win32.in: -------------------------------------------------------------------------------- 1 | /* config.h.win32.in. Manually Edited for Windows Builds. */ 2 | 3 | /* Define if building universal (internal helper macro) */ 4 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 5 | 6 | /* Define to 1 if you have the header file. */ 7 | /* #undef HAVE_DLFCN_H */ 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #if !defined (_MSC_VER) || (_MSC_VER >= 1800) 11 | #define HAVE_INTTYPES_H 1 12 | #endif 13 | 14 | /* Define if your file defines LC_MESSAGES. */ 15 | /* #undef HAVE_LC_MESSAGES */ 16 | 17 | /* Define to 1 if you have the header file. */ 18 | #define HAVE_LOCALE_H 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #define HAVE_MEMORY_H 1 22 | 23 | /* Have the pangoft2 library */ 24 | /* #define HAVE_PANGOFT2 1 */ 25 | 26 | /* Define to 1 if you have the header file. */ 27 | #if !defined (_MSC_VER) || (_MSC_VER >= 1600) 28 | #define HAVE_STDINT_H 1 29 | #endif 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STDLIB_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #ifndef _MSC_VER 36 | #define HAVE_STRINGS_H 1 37 | #endif 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #define HAVE_STRING_H 1 41 | 42 | /* Define to 1 if you have the `strtok_r' function. */ 43 | /* #undef HAVE_STRTOK_R */ 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #define HAVE_SYS_STAT_H 1 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #define HAVE_SYS_TYPES_H 1 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #ifndef _MSC_VER 53 | #define HAVE_UNISTD_H 1 54 | #endif 55 | 56 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 57 | */ 58 | #define LT_OBJDIR ".libs/" 59 | 60 | /* Name of package */ 61 | #define PACKAGE "@PACKAGE@" 62 | 63 | /* Define to the address where bug reports for this package should be sent. */ 64 | #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" 65 | 66 | /* Define to the full name of this package. */ 67 | #define PACKAGE_NAME "@PACKAGE_NAME@" 68 | 69 | /* Define to the full name and version of this package. */ 70 | #define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@" 71 | 72 | /* Define to the one symbol short name of this package. */ 73 | #define PACKAGE_TARNAME "@PACKAGE_TARNAME@" 74 | 75 | /* Define to the home page for this package. */ 76 | #define PACKAGE_URL "" 77 | 78 | /* Define to the version of this package. */ 79 | #define PACKAGE_VERSION "@PACKAGE_VERSION@" 80 | 81 | /* Define to 1 if you have the ANSI C header files. */ 82 | #define STDC_HEADERS 1 83 | 84 | /* Version number of package */ 85 | #define VERSION "@PACKAGE_VERSION@" 86 | 87 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 88 | significant byte first (like Motorola and SPARC, unlike Intel). */ 89 | #if defined AC_APPLE_UNIVERSAL_BUILD 90 | # if defined __BIG_ENDIAN__ 91 | # define WORDS_BIGENDIAN 1 92 | # endif 93 | #else 94 | # ifndef WORDS_BIGENDIAN 95 | # undef WORDS_BIGENDIAN 96 | # endif 97 | #endif 98 | -------------------------------------------------------------------------------- /gdk-pixbuf-loader/Makefile.am: -------------------------------------------------------------------------------- 1 | if ENABLE_PIXBUF_LOADER 2 | 3 | NULL = 4 | 5 | gdk_pixbuf_module_LTLIBRARIES = libpixbufloader-svg.la 6 | 7 | libpixbufloader_svg_la_SOURCES = \ 8 | io-svg.c 9 | 10 | libpixbufloader_svg_la_CPPFLAGS = \ 11 | -I$(top_srcdir) \ 12 | -I$(top_builddir) \ 13 | -DGDK_PIXBUF_ENABLE_BACKEND \ 14 | -DG_LOG_DOMAIN=\"libpixbufloader-svg\" \ 15 | $(AM_CPPFLAGS) 16 | 17 | libpixbufloader_svg_la_CFLAGS = \ 18 | $(GDK_PIXBUF_CFLAGS) \ 19 | $(LIBRSVG_CFLAGS) \ 20 | $(AM_CFLAGS) 21 | 22 | libpixbufloader_svg_la_LDFLAGS = -avoid-version -module $(AM_LDFLAGS) 23 | 24 | libpixbufloader_svg_la_LIBADD = \ 25 | $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \ 26 | $(GDK_PIXBUF_LIBS) \ 27 | $(LIBRSVG_LIBS) 28 | 29 | if PLATFORM_WIN32 30 | libpixbufloader_svg_la_LDFLAGS += -no-undefined 31 | endif 32 | 33 | noinst_PROGRAMS = rsvg-loader 34 | 35 | rsvg_loader_SOURCES = \ 36 | test.c \ 37 | $(NULL) 38 | rsvg_loader_CPPFLAGS = \ 39 | -I$(top_srcdir) \ 40 | -I$(top_builddir) \ 41 | $(AM_CPPFLAGS) 42 | rsvg_loader_CFLAGS = \ 43 | $(GDK_PIXBUF_CFLAGS) \ 44 | $(AM_CFLAGS) 45 | rsvg_loader_LDFLAGS = \ 46 | $(AM_LDFLAGS) 47 | rsvg_loader_LDADD = \ 48 | $(GDK_PIXBUF_LIBS) \ 49 | /usr/local/lib/libtiff.la 50 | EXTRA_rsvg_loader_DEPENDENCIES = libpixbufloader-svg.la gdk-pixbuf-loaders 51 | 52 | gdk-pixbuf-loaders: Makefile 53 | $(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null 54 | 55 | thumbnailerdir = $(datadir)/thumbnailers/ 56 | thumbnailer_DATA = librsvg.thumbnailer 57 | librsvg.thumbnailer: librsvg.thumbnailer.in 58 | $(AM_V_GEN) $(SED) -e "s|\@bindir\@|$(bindir)|" \ 59 | $< > $@ 60 | 61 | EXTRA_DIST = librsvg.thumbnailer.in 62 | 63 | if CROSS_COMPILING 64 | RUN_QUERY_LOADER_TEST=false 65 | else 66 | RUN_QUERY_LOADER_TEST=test -z "$(DESTDIR)" 67 | endif 68 | 69 | # The following bit is stolen from gdk-pixbuf/gdk-pixbuf/Makefile.am: 70 | # 71 | # Running this if cross compiling or if DESTDIR is set is going to 72 | # not work at all, so skip it 73 | # We use install-data-hook here to workaround a bug in automake and/or libtool 74 | # that makes the install target for the loader libraries a dependency on 75 | # install-data-am, and not install-exec-am. We need to ensure this gets run 76 | # after the libraries are installed in their final locations. 77 | install-data-hook: 78 | @if $(RUN_QUERY_LOADER_TEST) ; then \ 79 | $(mkinstalldirs) $(DESTDIR)$(gdk_pixbuf_binarydir) ; \ 80 | $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \ 81 | else \ 82 | echo "***" ; \ 83 | echo "*** Warning: loaders.cache not built" ; \ 84 | echo "***" ; \ 85 | echo "*** Generate this file manually on host" ; \ 86 | echo "*** system using gdk-pixbuf-query-loaders" ; \ 87 | echo "***" ; \ 88 | fi 89 | 90 | CLEANFILES = \ 91 | gdk-pixbuf.loaders \ 92 | $(thumbnailer_DATA) \ 93 | $(NULL) 94 | 95 | DISTCLEANFILES = \ 96 | gdk-pixbuf.loaders \ 97 | $(NULL) 98 | 99 | endif # ENABLE_PIXBUF_LOADER 100 | -------------------------------------------------------------------------------- /doc/html/api-index-2-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.9: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |

28 | Index of new symbols in 2.9

29 |

H

30 |
31 | rsvg_handle_get_metadata, function in RsvgHandle 32 |
33 |
34 |
35 | rsvg_handle_set_base_uri, function in RsvgHandle 36 |
37 |
38 |

I

39 |
40 | rsvg_init, function in RsvgHandle 41 |
42 |
43 |

T

44 |
45 | rsvg_term, function in RsvgHandle 46 |
47 |
48 |
49 | 51 | 52 | -------------------------------------------------------------------------------- /doc/html/api-index-2-32.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.32: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Index of new symbols in 2.32

25 |

H

26 |
27 | rsvg_handle_new_from_gfile_sync, function in Using RSVG with GIO 28 |
29 |
30 |
31 | rsvg_handle_new_from_stream_sync, function in Using RSVG with GIO 32 |
33 |
34 |
35 | rsvg_handle_read_stream_sync, function in Using RSVG with GIO 36 |
37 |
38 |
39 | rsvg_handle_set_base_gfile, function in Using RSVG with GIO 40 |
41 |
42 |
43 | 45 | 46 | -------------------------------------------------------------------------------- /doc/html/api-index-2-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.8: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |

26 | Index of new symbols in 2.8

27 |

H

28 |
29 | rsvg_handle_get_base_uri, function in RsvgHandle 30 |
31 |
32 |
33 | rsvg_handle_set_dpi, function in RsvgHandle 34 |
35 |
36 |
37 | rsvg_handle_set_dpi_x_y, function in RsvgHandle 38 |
39 |
40 |

S

41 |
42 | rsvg_set_default_dpi, function in RsvgHandle 43 |
44 |
45 |
46 | rsvg_set_default_dpi_x_y, function in RsvgHandle 47 |
48 |
49 |
50 | 52 | 53 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /* config.h.win32.in. Manually Edited for Windows Builds. */ 2 | 3 | /* Define if building universal (internal helper macro) */ 4 | /* #undef AC_APPLE_UNIVERSAL_BUILD */ 5 | 6 | /* Define to 1 if you have the header file. */ 7 | /* #undef HAVE_DLFCN_H */ 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #if !defined (_MSC_VER) || (_MSC_VER >= 1800) 11 | #define HAVE_INTTYPES_H 1 12 | #endif 13 | 14 | /* Define if your file defines LC_MESSAGES. */ 15 | /* #undef HAVE_LC_MESSAGES */ 16 | 17 | /* Define to 1 if you have the header file. */ 18 | #define HAVE_LOCALE_H 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #define HAVE_MEMORY_H 1 22 | 23 | /* Have the pangoft2 library */ 24 | /* #define HAVE_PANGOFT2 1 */ 25 | 26 | /* Define to 1 if you have the header file. */ 27 | #if !defined (_MSC_VER) || (_MSC_VER >= 1600) 28 | #define HAVE_STDINT_H 1 29 | #endif 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STDLIB_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #ifndef _MSC_VER 36 | #define HAVE_STRINGS_H 1 37 | #endif 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #define HAVE_STRING_H 1 41 | 42 | /* Define to 1 if you have the `strtok_r' function. */ 43 | /* #undef HAVE_STRTOK_R */ 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #define HAVE_SYS_STAT_H 1 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #define HAVE_SYS_TYPES_H 1 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #ifndef _MSC_VER 53 | #define HAVE_UNISTD_H 1 54 | #endif 55 | 56 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 57 | */ 58 | #define LT_OBJDIR ".libs/" 59 | 60 | /* Name of package */ 61 | #define PACKAGE "librsvg" 62 | 63 | /* Define to the address where bug reports for this package should be sent. */ 64 | #define PACKAGE_BUGREPORT "https://bugzilla.gnome.org/enter_bug.cgi?product=librsvg" 65 | 66 | /* Define to the full name of this package. */ 67 | #define PACKAGE_NAME "RSVG" 68 | 69 | /* Define to the full name and version of this package. */ 70 | #define PACKAGE_STRING "RSVG 2.40.20" 71 | 72 | /* Define to the one symbol short name of this package. */ 73 | #define PACKAGE_TARNAME "librsvg" 74 | 75 | /* Define to the home page for this package. */ 76 | #define PACKAGE_URL "" 77 | 78 | /* Define to the version of this package. */ 79 | #define PACKAGE_VERSION "2.40.20" 80 | 81 | /* Define to 1 if you have the ANSI C header files. */ 82 | #define STDC_HEADERS 1 83 | 84 | /* Version number of package */ 85 | #define VERSION "2.40.20" 86 | 87 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 88 | significant byte first (like Motorola and SPARC, unlike Intel). */ 89 | #if defined AC_APPLE_UNIVERSAL_BUILD 90 | # if defined __BIG_ENDIAN__ 91 | # define WORDS_BIGENDIAN 1 92 | # endif 93 | #else 94 | # ifndef WORDS_BIGENDIAN 95 | # undef WORDS_BIGENDIAN 96 | # endif 97 | #endif 98 | 99 | #if defined(_MSC_VER) && (_MSC_VER >= 1310) 100 | # define isnan(a) _isnan(a) 101 | #else 102 | # define isnan(a) (a != a) 103 | #endif -------------------------------------------------------------------------------- /tests/fixtures/reftests/bugs/403357.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /m4/vapigen.m4: -------------------------------------------------------------------------------- 1 | dnl vapigen.m4 2 | dnl 3 | dnl Copyright 2012 Evan Nemerson 4 | dnl 5 | dnl This library is free software; you can redistribute it and/or 6 | dnl modify it under the terms of the GNU Lesser General Public 7 | dnl License as published by the Free Software Foundation; either 8 | dnl version 2.1 of the License, or (at your option) any later version. 9 | dnl 10 | dnl This library is distributed in the hope that it will be useful, 11 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | dnl Lesser General Public License for more details. 14 | dnl 15 | dnl You should have received a copy of the GNU Lesser General Public 16 | dnl License along with this library; if not, write to the Free Software 17 | dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | # VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND-INTROSPECTION], [DEFAULT]) 20 | # -------------------------------------- 21 | # Check vapigen existence and version 22 | # 23 | # See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation 24 | AC_DEFUN([VAPIGEN_CHECK], 25 | [ 26 | AC_BEFORE([GOBJECT_INTROSPECTION_CHECK],[$0]) 27 | AC_BEFORE([GOBJECT_INTROSPECTION_REQUIRE],[$0]) 28 | 29 | AC_ARG_ENABLE([vala], 30 | [AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[ 31 | AS_IF([test "x$4" = "x"], [ 32 | enable_vala=auto 33 | ], [ 34 | enable_vala=$4 35 | ]) 36 | ]) 37 | 38 | AS_CASE([$enable_vala], [no], [enable_vala=no], 39 | [yes], [ 40 | AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [ 41 | AC_MSG_ERROR([Vala bindings require GObject Introspection]) 42 | ]) 43 | ], [auto], [ 44 | AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [ 45 | enable_vala=no 46 | ]) 47 | ], [ 48 | AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@]) 49 | ]) 50 | 51 | AS_IF([test "x$2" = "x"], [ 52 | vapigen_pkg_name=vapigen 53 | ], [ 54 | vapigen_pkg_name=vapigen-$2 55 | ]) 56 | AS_IF([test "x$1" = "x"], [ 57 | vapigen_pkg="$vapigen_pkg_name" 58 | ], [ 59 | vapigen_pkg="$vapigen_pkg_name >= $1" 60 | ]) 61 | 62 | PKG_PROG_PKG_CONFIG 63 | 64 | PKG_CHECK_EXISTS([$vapigen_pkg], [ 65 | AS_IF([test "$enable_vala" = "auto"], [ 66 | enable_vala=yes 67 | ]) 68 | ], [ 69 | AS_CASE([$enable_vala], [yes], [ 70 | AC_MSG_ERROR([$vapigen_pkg not found]) 71 | ], [auto], [ 72 | enable_vala=no 73 | ]) 74 | ]) 75 | 76 | AC_MSG_CHECKING([for vala]) 77 | 78 | AS_CASE([$enable_vala], 79 | [yes], [ 80 | VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen` 81 | VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen 82 | AS_IF([test "x$2" = "x"], [ 83 | VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen` 84 | ], [ 85 | VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen` 86 | ]) 87 | ]) 88 | 89 | AC_MSG_RESULT([$enable_vala]) 90 | 91 | AC_SUBST([VAPIGEN]) 92 | AC_SUBST([VAPIGEN_VAPIDIR]) 93 | AC_SUBST([VAPIGEN_MAKEFILE]) 94 | 95 | AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes") 96 | ]) 97 | -------------------------------------------------------------------------------- /rsvg-structure.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-structure.h: Rsvg's structual elements 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002, 2003, 2004, 2005 Dom Lachowicz 8 | Copyright (C) 2003, 2004, 2005 Caleb Moore 9 | 10 | This program is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Library General Public License as 12 | published by the Free Software Foundation; either version 2 of the 13 | License, or (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Library General Public License for more details. 19 | 20 | You should have received a copy of the GNU Library General Public 21 | License along with this program; if not, write to the 22 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | Boston, MA 02111-1307, USA. 24 | 25 | Authors: Raph Levien , 26 | Dom Lachowicz , 27 | Caleb Moore 28 | */ 29 | 30 | #ifndef RSVG_STRUCTURE_H 31 | #define RSVG_STRUCTURE_H 32 | 33 | #include "rsvg-private.h" 34 | #include "rsvg-defs.h" 35 | #include "rsvg-styles.h" 36 | 37 | G_BEGIN_DECLS 38 | 39 | G_GNUC_INTERNAL 40 | RsvgNode *rsvg_new_use (void); 41 | G_GNUC_INTERNAL 42 | RsvgNode *rsvg_new_symbol (void); 43 | G_GNUC_INTERNAL 44 | RsvgNode *rsvg_new_svg (void); 45 | G_GNUC_INTERNAL 46 | RsvgNode *rsvg_new_defs (void); 47 | G_GNUC_INTERNAL 48 | RsvgNode *rsvg_new_group (void); 49 | G_GNUC_INTERNAL 50 | RsvgNode *rsvg_new_switch (void); 51 | 52 | typedef struct _RsvgNodeGroup RsvgNodeGroup; 53 | typedef struct _RsvgNodeUse RsvgNodeUse; 54 | typedef struct _RsvgNodeSymbol RsvgNodeSymbol; 55 | typedef struct _RsvgNodeSvg RsvgNodeSvg; 56 | 57 | struct _RsvgNodeGroup { 58 | RsvgNode super; 59 | char *name; 60 | }; 61 | 62 | struct _RsvgNodeSymbol { 63 | RsvgNode super; 64 | gint preserve_aspect_ratio; 65 | RsvgViewBox vbox; 66 | }; 67 | 68 | struct _RsvgNodeUse { 69 | RsvgNode super; 70 | char *link; 71 | RsvgLength x, y, w, h; 72 | }; 73 | 74 | struct _RsvgNodeSvg { 75 | RsvgNode super; 76 | gint preserve_aspect_ratio; 77 | RsvgLength x, y, w, h; 78 | RsvgViewBox vbox; 79 | RsvgPropertyBag *atts; 80 | }; 81 | 82 | G_GNUC_INTERNAL 83 | void rsvg_pop_def_group (RsvgHandle * ctx); 84 | G_GNUC_INTERNAL 85 | void rsvg_node_group_pack (RsvgNode * self, RsvgNode * child); 86 | G_GNUC_INTERNAL 87 | void rsvg_node_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate); 88 | G_GNUC_INTERNAL 89 | void _rsvg_node_draw_children (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate); 90 | G_GNUC_INTERNAL 91 | void _rsvg_node_finalize (RsvgNode * self); 92 | G_GNUC_INTERNAL 93 | void _rsvg_node_free (RsvgNode * self); 94 | G_GNUC_INTERNAL 95 | void _rsvg_node_init (RsvgNode * self, RsvgNodeType type); 96 | G_GNUC_INTERNAL 97 | void _rsvg_node_svg_apply_atts (RsvgNodeSvg * self, RsvgHandle * ctx); 98 | 99 | G_END_DECLS 100 | 101 | #endif /* RSVG_STRUCTURE_H */ 102 | -------------------------------------------------------------------------------- /rsvg-size-callback.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2000 Eazel, Inc. 3 | Copyright (C) 2002 Dom Lachowicz 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public License as 7 | published by the Free Software Foundation; either version 2 of the 8 | License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | Boston, MA 02111-1307, USA. 19 | 20 | Author: Raph Levien 21 | */ 22 | 23 | #include "config.h" 24 | 25 | #include "rsvg-size-callback.h" 26 | 27 | #include 28 | 29 | void 30 | _rsvg_size_callback (int *width, int *height, gpointer data) 31 | { 32 | struct RsvgSizeCallbackData *real_data = (struct RsvgSizeCallbackData *) data; 33 | double zoomx, zoomy, zoom; 34 | 35 | int in_width, in_height; 36 | 37 | in_width = *width; 38 | in_height = *height; 39 | 40 | switch (real_data->type) { 41 | case RSVG_SIZE_ZOOM: 42 | if (*width < 0 || *height < 0) 43 | return; 44 | 45 | *width = floor (real_data->x_zoom * *width + 0.5); 46 | *height = floor (real_data->y_zoom * *height + 0.5); 47 | break; 48 | 49 | case RSVG_SIZE_ZOOM_MAX: 50 | if (*width < 0 || *height < 0) 51 | return; 52 | 53 | *width = floor (real_data->x_zoom * *width + 0.5); 54 | *height = floor (real_data->y_zoom * *height + 0.5); 55 | 56 | if (*width > real_data->width || *height > real_data->height) { 57 | zoomx = (double) real_data->width / *width; 58 | zoomy = (double) real_data->height / *height; 59 | zoom = MIN (zoomx, zoomy); 60 | 61 | *width = floor (zoom * *width + 0.5); 62 | *height = floor (zoom * *height + 0.5); 63 | } 64 | break; 65 | 66 | case RSVG_SIZE_WH_MAX: 67 | if (*width < 0 || *height < 0) 68 | return; 69 | 70 | zoomx = (double) real_data->width / *width; 71 | zoomy = (double) real_data->height / *height; 72 | if (zoomx < 0) 73 | zoom = zoomy; 74 | else if (zoomy < 0) 75 | zoom = zoomx; 76 | else 77 | zoom = MIN (zoomx, zoomy); 78 | 79 | *width = floor (zoom * *width + 0.5); 80 | *height = floor (zoom * *height + 0.5); 81 | break; 82 | 83 | case RSVG_SIZE_WH: 84 | if (real_data->width != -1) 85 | *width = real_data->width; 86 | if (real_data->height != -1) 87 | *height = real_data->height; 88 | break; 89 | 90 | default: 91 | g_assert_not_reached (); 92 | } 93 | 94 | if (real_data->keep_aspect_ratio) { 95 | int out_min = MIN (*width, *height); 96 | 97 | if (out_min == *width) { 98 | *height = in_height * ((double) *width / (double) in_width); 99 | } else { 100 | *width = in_width * ((double) *height / (double) in_height); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /doc/html/api-index-2-14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of new symbols in 2.14: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |

24 | Index of new symbols in 2.14

25 |

H

26 |
27 | rsvg_handle_get_dimensions, function in RsvgHandle 28 |
29 |
30 |
31 | rsvg_handle_get_pixbuf_sub, function in Using RSVG with GdkPixbuf 32 |
33 |
34 |
35 | rsvg_handle_new_from_data, function in RsvgHandle 36 |
37 |
38 |
39 | rsvg_handle_new_from_file, function in RsvgHandle 40 |
41 |
42 |
43 | rsvg_handle_render_cairo, function in Using RSVG with cairo 44 |
45 |
46 |
47 | rsvg_handle_render_cairo_sub, function in Using RSVG with cairo 48 |
49 |
50 |
51 | 53 | 54 | -------------------------------------------------------------------------------- /m4/gtk-doc.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: autoconf -*- 2 | 3 | # serial 2 4 | 5 | dnl Usage: 6 | dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) 7 | AC_DEFUN([GTK_DOC_CHECK], 8 | [ 9 | AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 10 | AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first 11 | AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first 12 | 13 | ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) 14 | AC_MSG_CHECKING([for gtk-doc]) 15 | PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) 16 | AC_MSG_RESULT($have_gtk_doc) 17 | 18 | if test "$have_gtk_doc" = "no"; then 19 | AC_MSG_WARN([ 20 | You will not be able to create source packages with 'make dist' 21 | because $gtk_doc_requires is not found.]) 22 | fi 23 | 24 | dnl check for tools we added during development 25 | dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that 26 | dnl may not be writable by the user. Currently, automake requires that the 27 | dnl test name must end in '.test'. 28 | dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 29 | AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) 30 | AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) 31 | AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) 32 | AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) 33 | 34 | dnl for overriding the documentation installation directory 35 | AC_ARG_WITH([html-dir], 36 | AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, 37 | [with_html_dir='${datadir}/gtk-doc/html']) 38 | HTML_DIR="$with_html_dir" 39 | AC_SUBST([HTML_DIR]) 40 | 41 | dnl enable/disable documentation building 42 | AC_ARG_ENABLE([gtk-doc], 43 | AS_HELP_STRING([--enable-gtk-doc], 44 | [use gtk-doc to build documentation [[default=no]]]),, 45 | [enable_gtk_doc=no]) 46 | 47 | AC_MSG_CHECKING([whether to build gtk-doc documentation]) 48 | AC_MSG_RESULT($enable_gtk_doc) 49 | 50 | if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then 51 | AC_MSG_ERROR([ 52 | You must have $gtk_doc_requires installed to build documentation for 53 | $PACKAGE_NAME. Please install gtk-doc or disable building the 54 | documentation by adding '--disable-gtk-doc' to '[$]0'.]) 55 | fi 56 | 57 | dnl don't check for glib if we build glib 58 | if test "x$PACKAGE_NAME" != "xglib"; then 59 | dnl don't fail if someone does not have glib 60 | PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) 61 | fi 62 | 63 | dnl enable/disable output formats 64 | AC_ARG_ENABLE([gtk-doc-html], 65 | AS_HELP_STRING([--enable-gtk-doc-html], 66 | [build documentation in html format [[default=yes]]]),, 67 | [enable_gtk_doc_html=yes]) 68 | AC_ARG_ENABLE([gtk-doc-pdf], 69 | AS_HELP_STRING([--enable-gtk-doc-pdf], 70 | [build documentation in pdf format [[default=no]]]),, 71 | [enable_gtk_doc_pdf=no]) 72 | 73 | if test -z "$GTKDOC_MKPDF"; then 74 | enable_gtk_doc_pdf=no 75 | fi 76 | 77 | if test -z "$AM_DEFAULT_VERBOSITY"; then 78 | AM_DEFAULT_VERBOSITY=1 79 | fi 80 | AC_SUBST([AM_DEFAULT_VERBOSITY]) 81 | 82 | AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) 83 | AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) 84 | AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) 85 | AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) 86 | AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) 87 | AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) 88 | ]) 89 | -------------------------------------------------------------------------------- /doc/html/annotation-glossary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Annotation Glossary: RSVG Libary Reference Manual 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |

32 | Annotation Glossary

33 |

A

34 |
allow-none
35 |

NULL is OK, both for passing and for returning.

36 |
array
37 |

Parameter points to an array of items.

38 |

E

39 |
element-type
40 |

Generics and defining elements of containers and arrays.

41 |

N

42 |
nullable
43 |

NULL may be passed as the value in, out, in-out; or as a return value.

44 |

O

45 |
out
46 |

Parameter for returning results. Default is transfer full.

47 |

T

48 |
transfer full
49 |

Free data after the code is done.

50 |
51 | 53 | 54 | -------------------------------------------------------------------------------- /rsvg-css.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-css.h : CSS utility functions 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | #ifndef RSVG_CSS_H 27 | #define RSVG_CSS_H 28 | 29 | #include 30 | 31 | #ifdef RSVG_COMPILATION 32 | #include 33 | #include "rsvg-private.h" 34 | #endif 35 | 36 | G_BEGIN_DECLS 37 | 38 | #define RSVG_ASPECT_RATIO_NONE (0) 39 | #define RSVG_ASPECT_RATIO_XMIN_YMIN (1 << 0) 40 | #define RSVG_ASPECT_RATIO_XMID_YMIN (1 << 1) 41 | #define RSVG_ASPECT_RATIO_XMAX_YMIN (1 << 2) 42 | #define RSVG_ASPECT_RATIO_XMIN_YMID (1 << 3) 43 | #define RSVG_ASPECT_RATIO_XMID_YMID (1 << 4) 44 | #define RSVG_ASPECT_RATIO_XMAX_YMID (1 << 5) 45 | #define RSVG_ASPECT_RATIO_XMIN_YMAX (1 << 6) 46 | #define RSVG_ASPECT_RATIO_XMID_YMAX (1 << 7) 47 | #define RSVG_ASPECT_RATIO_XMAX_YMAX (1 << 8) 48 | #define RSVG_ASPECT_RATIO_SLICE (1 << 31) 49 | 50 | /* This one is semi-public for mis-use in rsvg-convert */ 51 | guint32 rsvg_css_parse_color (const char *str, gboolean * inherit); 52 | 53 | #ifdef RSVG_COMPILATION 54 | 55 | G_GNUC_INTERNAL 56 | int rsvg_css_parse_aspect_ratio (const char *str); 57 | G_GNUC_INTERNAL 58 | guint rsvg_css_parse_opacity (const char *str); 59 | G_GNUC_INTERNAL 60 | double rsvg_css_parse_angle (const char *str); 61 | G_GNUC_INTERNAL 62 | double rsvg_css_parse_frequency (const char *str); 63 | G_GNUC_INTERNAL 64 | double rsvg_css_parse_time (const char *str); 65 | G_GNUC_INTERNAL 66 | PangoStyle rsvg_css_parse_font_style (const char *str, gboolean * inherit); 67 | G_GNUC_INTERNAL 68 | PangoVariant rsvg_css_parse_font_variant (const char *str, gboolean * inherit); 69 | G_GNUC_INTERNAL 70 | PangoWeight rsvg_css_parse_font_weight (const char *str, gboolean * inherit); 71 | G_GNUC_INTERNAL 72 | PangoStretch rsvg_css_parse_font_stretch (const char *str, gboolean * inherit); 73 | G_GNUC_INTERNAL 74 | const char *rsvg_css_parse_font_family (const char *str, gboolean * inherit); 75 | G_GNUC_INTERNAL 76 | RsvgViewBox rsvg_css_parse_vbox (const char *vbox); 77 | G_GNUC_INTERNAL 78 | void rsvg_css_parse_number_optional_number (const char *str, double *x, double *y); 79 | G_GNUC_INTERNAL 80 | gchar **rsvg_css_parse_list (const char *in_str, guint * out_list_len); 81 | G_GNUC_INTERNAL 82 | gdouble *rsvg_css_parse_number_list (const char *in_str, guint * out_list_len); 83 | G_GNUC_INTERNAL 84 | gboolean rsvg_css_parse_overflow (const char *str, gboolean * inherit); 85 | G_GNUC_INTERNAL 86 | char **rsvg_css_parse_xml_attribute_string (const char *attribute_string); 87 | 88 | #endif /* RSVG_COMPILATION */ 89 | 90 | G_END_DECLS 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /rsvg-filter.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-filter.h : Provides filters 5 | 6 | Copyright (C) 2004 Caleb Moore 7 | 8 | This program is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Library General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Library General Public License for more details. 17 | 18 | You should have received a copy of the GNU Library General Public 19 | License along with this program; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | Boston, MA 02111-1307, USA. 22 | 23 | Author: Caleb Moore 24 | */ 25 | 26 | #ifndef RSVG_FILTER_H 27 | #define RSVG_FILTER_H 28 | 29 | #include "rsvg.h" 30 | #include "rsvg-defs.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | typedef struct { 35 | int x0, y0, x1, y1; 36 | } RsvgIRect; 37 | 38 | typedef RsvgCoordUnits RsvgFilterUnits; 39 | 40 | struct _RsvgFilter { 41 | RsvgNode super; 42 | RsvgLength x, y, width, height; 43 | RsvgFilterUnits filterunits; 44 | RsvgFilterUnits primitiveunits; 45 | }; 46 | 47 | G_GNUC_INTERNAL 48 | cairo_surface_t *rsvg_filter_render (RsvgFilter *self, 49 | cairo_surface_t *source, 50 | RsvgDrawingCtx *context, 51 | RsvgBbox *dimentions, 52 | char *channelmap); 53 | 54 | G_GNUC_INTERNAL 55 | RsvgNode *rsvg_new_filter (void); 56 | G_GNUC_INTERNAL 57 | RsvgNode *rsvg_new_filter_primitive_blend (void); 58 | G_GNUC_INTERNAL 59 | RsvgNode *rsvg_new_filter_primitive_convolve_matrix (void); 60 | G_GNUC_INTERNAL 61 | RsvgNode *rsvg_new_filter_primitive_gaussian_blur (void); 62 | G_GNUC_INTERNAL 63 | RsvgNode *rsvg_new_filter_primitive_offset (void); 64 | G_GNUC_INTERNAL 65 | RsvgNode *rsvg_new_filter_primitive_merge (void); 66 | G_GNUC_INTERNAL 67 | RsvgNode *rsvg_new_filter_primitive_merge_node (void); 68 | G_GNUC_INTERNAL 69 | RsvgNode *rsvg_new_filter_primitive_color_matrix (void); 70 | G_GNUC_INTERNAL 71 | RsvgNode *rsvg_new_filter_primitive_component_transfer (void); 72 | G_GNUC_INTERNAL 73 | RsvgNode *rsvg_new_node_component_transfer_function (char channel); 74 | G_GNUC_INTERNAL 75 | RsvgNode *rsvg_new_filter_primitive_erode (void); 76 | G_GNUC_INTERNAL 77 | RsvgNode *rsvg_new_filter_primitive_composite (void); 78 | G_GNUC_INTERNAL 79 | RsvgNode *rsvg_new_filter_primitive_flood (void); 80 | G_GNUC_INTERNAL 81 | RsvgNode *rsvg_new_filter_primitive_displacement_map (void); 82 | G_GNUC_INTERNAL 83 | RsvgNode *rsvg_new_filter_primitive_turbulence (void); 84 | G_GNUC_INTERNAL 85 | RsvgNode *rsvg_new_filter_primitive_image (void); 86 | G_GNUC_INTERNAL 87 | RsvgNode *rsvg_new_filter_primitive_diffuse_lighting (void); 88 | G_GNUC_INTERNAL 89 | RsvgNode *rsvg_new_node_light_source (char type); 90 | G_GNUC_INTERNAL 91 | RsvgNode *rsvg_new_filter_primitive_specular_lighting (void); 92 | G_GNUC_INTERNAL 93 | RsvgNode *rsvg_new_filter_primitive_tile (void); 94 | 95 | G_END_DECLS 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /rsvg-xml.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 expandtab: */ 3 | /* 4 | * Copyright © 2010 Christian Persch 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License as 8 | * published by the Free Software Foundation; either version 2.1 of the 9 | * License, or (at your option) any later version. 10 | 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this program; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include "rsvg-private.h" 25 | #include "rsvg-xml.h" 26 | 27 | typedef struct { 28 | GInputStream *stream; 29 | GCancellable *cancellable; 30 | GError **error; 31 | } RsvgXmlInputStreamContext; 32 | 33 | /* this should use gsize, but libxml2 is borked */ 34 | static int 35 | context_read (void *data, 36 | char *buffer, 37 | int len) 38 | { 39 | RsvgXmlInputStreamContext *context = data; 40 | gssize n_read; 41 | 42 | if (*(context->error)) 43 | return -1; 44 | 45 | n_read = g_input_stream_read (context->stream, buffer, (gsize) len, 46 | context->cancellable, 47 | context->error); 48 | if (n_read < 0) 49 | return -1; 50 | 51 | return (int) n_read; 52 | } 53 | 54 | static int 55 | context_close (void *data) 56 | { 57 | RsvgXmlInputStreamContext *context = data; 58 | gboolean ret; 59 | 60 | /* Don't overwrite a previous error */ 61 | ret = g_input_stream_close (context->stream, context->cancellable, 62 | *(context->error) == NULL ? context->error : NULL); 63 | 64 | g_object_unref (context->stream); 65 | if (context->cancellable) 66 | g_object_unref (context->cancellable); 67 | g_slice_free (RsvgXmlInputStreamContext, context); 68 | 69 | return ret ? 0 : -1; 70 | } 71 | 72 | xmlParserCtxtPtr rsvg_create_xml_parser_from_stream (xmlSAXHandlerPtr sax, 73 | void *sax_user_data, 74 | GInputStream *stream, 75 | GCancellable *cancellable, 76 | GError **error) 77 | { 78 | RsvgXmlInputStreamContext *context; 79 | xmlParserCtxtPtr parser; 80 | 81 | g_return_val_if_fail (G_IS_INPUT_STREAM (stream), NULL); 82 | g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); 83 | g_return_val_if_fail (error != NULL, NULL); 84 | 85 | context = g_slice_new (RsvgXmlInputStreamContext); 86 | context->stream = g_object_ref (stream); 87 | context->cancellable = cancellable ? g_object_ref (cancellable) : NULL; 88 | context->error = error; 89 | 90 | parser = xmlCreateIOParserCtxt (sax, 91 | sax_user_data, 92 | context_read, 93 | context_close, 94 | context, 95 | XML_CHAR_ENCODING_NONE); 96 | 97 | if (!parser) { 98 | g_set_error (error, rsvg_error_quark (), 0, _("Error creating XML parser")); 99 | 100 | /* on error, xmlCreateIOParserCtxt() frees our context via the context_close function */ 101 | } 102 | 103 | return parser; 104 | } 105 | -------------------------------------------------------------------------------- /m4/introspection.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: autoconf -*- 2 | dnl Copyright 2009 Johan Dahlin 3 | dnl 4 | dnl This file is free software; the author(s) gives unlimited 5 | dnl permission to copy and/or distribute it, with or without 6 | dnl modifications, as long as this notice is preserved. 7 | dnl 8 | 9 | # serial 1 10 | 11 | m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], 12 | [ 13 | AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first 14 | AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first 15 | AC_BEFORE([LT_INIT],[$0])dnl setup libtool first 16 | 17 | dnl enable/disable introspection 18 | m4_if([$2], [require], 19 | [dnl 20 | enable_introspection=yes 21 | ],[dnl 22 | AC_ARG_ENABLE(introspection, 23 | AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], 24 | [Enable introspection for this build]),, 25 | [enable_introspection=auto]) 26 | ])dnl 27 | 28 | AC_MSG_CHECKING([for gobject-introspection]) 29 | 30 | dnl presence/version checking 31 | AS_CASE([$enable_introspection], 32 | [no], [dnl 33 | found_introspection="no (disabled, use --enable-introspection to enable)" 34 | ],dnl 35 | [yes],[dnl 36 | PKG_CHECK_EXISTS([gobject-introspection-1.0],, 37 | AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) 38 | PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], 39 | found_introspection=yes, 40 | AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) 41 | ],dnl 42 | [auto],[dnl 43 | PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) 44 | dnl Canonicalize enable_introspection 45 | enable_introspection=$found_introspection 46 | ],dnl 47 | [dnl 48 | AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) 49 | ])dnl 50 | 51 | AC_MSG_RESULT([$found_introspection]) 52 | 53 | INTROSPECTION_SCANNER= 54 | INTROSPECTION_COMPILER= 55 | INTROSPECTION_GENERATE= 56 | INTROSPECTION_GIRDIR= 57 | INTROSPECTION_TYPELIBDIR= 58 | if test "x$found_introspection" = "xyes"; then 59 | INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` 60 | INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` 61 | INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` 62 | INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` 63 | INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" 64 | INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` 65 | INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` 66 | INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection 67 | fi 68 | AC_SUBST(INTROSPECTION_SCANNER) 69 | AC_SUBST(INTROSPECTION_COMPILER) 70 | AC_SUBST(INTROSPECTION_GENERATE) 71 | AC_SUBST(INTROSPECTION_GIRDIR) 72 | AC_SUBST(INTROSPECTION_TYPELIBDIR) 73 | AC_SUBST(INTROSPECTION_CFLAGS) 74 | AC_SUBST(INTROSPECTION_LIBS) 75 | AC_SUBST(INTROSPECTION_MAKEFILE) 76 | 77 | AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") 78 | ]) 79 | 80 | 81 | dnl Usage: 82 | dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) 83 | 84 | AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], 85 | [ 86 | _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) 87 | ]) 88 | 89 | dnl Usage: 90 | dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) 91 | 92 | 93 | AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], 94 | [ 95 | _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) 96 | ]) 97 | -------------------------------------------------------------------------------- /rsvg-base-file-util.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg-file-util.c: SAX-based renderer for SVG files into a GdkPixbuf. 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | 27 | #include "config.h" 28 | #include "rsvg.h" 29 | #include "rsvg-io.h" 30 | #include "rsvg-private.h" 31 | 32 | static gboolean 33 | rsvg_handle_fill_with_data (RsvgHandle * handle, 34 | const char * data, gsize data_len, GError ** error) 35 | { 36 | gboolean rv; 37 | 38 | rsvg_return_val_if_fail (data != NULL, FALSE, error); 39 | rsvg_return_val_if_fail (data_len != 0, FALSE, error); 40 | 41 | rv = rsvg_handle_write (handle, (guchar *) data, data_len, error); 42 | 43 | return rsvg_handle_close (handle, rv ? error : NULL) && rv; 44 | } 45 | 46 | /** 47 | * rsvg_handle_new_from_data: 48 | * @data: (array length=data_len): The SVG data 49 | * @data_len: The length of @data, in bytes 50 | * @error: return location for errors 51 | * 52 | * Loads the SVG specified by @data. 53 | * 54 | * Returns: A #RsvgHandle or %NULL if an error occurs. 55 | * Since: 2.14 56 | */ 57 | RsvgHandle * 58 | rsvg_handle_new_from_data (const guint8 * data, gsize data_len, GError ** error) 59 | { 60 | RsvgHandle *handle; 61 | 62 | handle = rsvg_handle_new (); 63 | 64 | if (handle) { 65 | if (!rsvg_handle_fill_with_data (handle, (char *) data, data_len, error)) { 66 | g_object_unref (handle); 67 | handle = NULL; 68 | } 69 | } 70 | 71 | return handle; 72 | } 73 | 74 | /** 75 | * rsvg_handle_new_from_file: 76 | * @file_name: The file name to load. If built with gnome-vfs, can be a URI. 77 | * @error: return location for errors 78 | * 79 | * Loads the SVG specified by @file_name. 80 | * 81 | * Returns: A #RsvgHandle or %NULL if an error occurs. 82 | * Since: 2.14 83 | */ 84 | RsvgHandle * 85 | rsvg_handle_new_from_file (const gchar * file_name, GError ** error) 86 | { 87 | gchar *base_uri; 88 | char *data; 89 | gsize data_len; 90 | RsvgHandle *handle = NULL; 91 | GFile *file; 92 | 93 | rsvg_return_val_if_fail (file_name != NULL, NULL, error); 94 | 95 | file = g_file_new_for_path (file_name); 96 | base_uri = g_file_get_uri (file); 97 | if (!base_uri) { 98 | g_set_error (error, 99 | G_IO_ERROR, 100 | G_IO_ERROR_FAILED, 101 | _("Cannot obtain URI from '%s'"), file_name); 102 | g_object_unref (file); 103 | return NULL; 104 | } 105 | 106 | data = _rsvg_io_acquire_data (base_uri, base_uri, NULL, &data_len, NULL, error); 107 | 108 | if (data) { 109 | handle = rsvg_handle_new (); 110 | rsvg_handle_set_base_uri (handle, base_uri); 111 | if (!rsvg_handle_fill_with_data (handle, data, data_len, error)) { 112 | g_object_unref (handle); 113 | handle = NULL; 114 | } 115 | g_free (data); 116 | } 117 | 118 | g_free (base_uri); 119 | 120 | return handle; 121 | } 122 | -------------------------------------------------------------------------------- /tests/fixtures/reftests/svg1.1/masking-path-04-b.svg: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 |

18 | This test exercises basic user-specified clip paths, using a text 19 | string (i.e., content of a 'text' element) as the clip path. 20 |

21 |

22 | There is a rectangular image of a swirly blue pattern with large 23 | yellow text, "Clip Test" superimposed. The image is a PNG file, 24 | imported into the picture via the 'image' element. 25 |

26 |

27 | The test uses the 'rect' element, as well as basic fill (solid primary 28 | colors), stroke (black 1-pixel lines), font-family (Arial and 29 | Impact) and font-size properties. 30 |

31 | 32 | 33 |

34 | Run the test. No interaction required. 35 |

36 |
37 | 38 |

39 | The rendered picture should match the reference image, except for 40 | possible variations in the labelling text (per CSS2 rules). 41 |

42 |
43 | 44 | $RCSfile: masking-path-04-b.svg,v $ 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Clip Test 57 | 58 | 59 | 60 | 61 | 62 | Clip Test 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | $Revision: 1.5 $ 71 | 72 | 73 | 74 | 79 | 80 | -------------------------------------------------------------------------------- /rsvg.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* vim: set sw=4 sts=4 ts=4 expandtab: */ 3 | /* 4 | rsvg.c: SAX-based renderer for SVG files into a GdkPixbuf. 5 | 6 | Copyright (C) 2000 Eazel, Inc. 7 | Copyright (C) 2002-2005 Dom Lachowicz 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this program; if not, write to the 21 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | Boston, MA 02111-1307, USA. 23 | 24 | Author: Raph Levien 25 | */ 26 | 27 | #include "config.h" 28 | 29 | #include "rsvg.h" 30 | #include "rsvg-private.h" 31 | #include "rsvg-css.h" 32 | #include "rsvg-styles.h" 33 | #include "rsvg-shapes.h" 34 | #include "rsvg-image.h" 35 | #include "rsvg-text.h" 36 | #include "rsvg-filter.h" 37 | #include "rsvg-mask.h" 38 | #include "rsvg-marker.h" 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | #include "rsvg-cairo.h" 45 | #include "rsvg-cairo-draw.h" 46 | 47 | /** 48 | * rsvg_handle_get_pixbuf_sub: 49 | * @handle: An #RsvgHandle 50 | * @id: (nullable): The id of an element inside the SVG, or %NULL to 51 | * render the whole SVG. For example, if you have a layer called 52 | * "layer1" that you wish to render, pass "##layer1" as the id. 53 | * 54 | * Returns the pixbuf loaded by @handle. The pixbuf returned will be reffed, so 55 | * the caller of this function must assume that ref. If insufficient data has 56 | * been read to create the pixbuf, or an error occurred in loading, then %NULL 57 | * will be returned. Note that the pixbuf may not be complete until 58 | * @rsvg_handle_close has been called. 59 | * 60 | * Returns: (transfer full) (nullable): the pixbuf loaded by @handle, or %NULL. 61 | * 62 | * Since: 2.14 63 | **/ 64 | GdkPixbuf * 65 | rsvg_handle_get_pixbuf_sub (RsvgHandle * handle, const char *id) 66 | { 67 | RsvgDimensionData dimensions; 68 | GdkPixbuf *output = NULL; 69 | cairo_surface_t *surface; 70 | cairo_t *cr; 71 | 72 | g_return_val_if_fail (handle != NULL, NULL); 73 | 74 | if (handle->priv->state != RSVG_HANDLE_STATE_CLOSED_OK) 75 | return NULL; 76 | 77 | rsvg_handle_get_dimensions (handle, &dimensions); 78 | if (!(dimensions.width && dimensions.height)) 79 | return NULL; 80 | 81 | surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 82 | dimensions.width, dimensions.height); 83 | if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) { 84 | cairo_surface_destroy (surface); 85 | return NULL; 86 | } 87 | 88 | cr = cairo_create (surface); 89 | 90 | if (!rsvg_handle_render_cairo_sub (handle, cr, id)) { 91 | cairo_destroy (cr); 92 | cairo_surface_destroy (surface); 93 | return NULL; 94 | } 95 | 96 | cairo_destroy (cr); 97 | 98 | output = rsvg_cairo_surface_to_pixbuf (surface); 99 | cairo_surface_destroy (surface); 100 | 101 | return output; 102 | } 103 | 104 | /** 105 | * rsvg_handle_get_pixbuf: 106 | * @handle: An #RsvgHandle 107 | * 108 | * Returns the pixbuf loaded by @handle. The pixbuf returned will be reffed, so 109 | * the caller of this function must assume that ref. If insufficient data has 110 | * been read to create the pixbuf, or an error occurred in loading, then %NULL 111 | * will be returned. Note that the pixbuf may not be complete until 112 | * @rsvg_handle_close has been called. 113 | * 114 | * Returns: (transfer full) (nullable): the pixbuf loaded by @handle, or %NULL. 115 | **/ 116 | GdkPixbuf * 117 | rsvg_handle_get_pixbuf (RsvgHandle * handle) 118 | { 119 | return rsvg_handle_get_pixbuf_sub (handle, NULL); 120 | } 121 | --------------------------------------------------------------------------------