summaryrefslogtreecommitdiffstats
path: root/tests/arthur
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /tests/arthur
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'tests/arthur')
-rw-r--r--tests/arthur/.gitattributes2
-rw-r--r--tests/arthur/.gitignore2
-rw-r--r--tests/arthur/README84
-rw-r--r--tests/arthur/arthurtester.pri21
-rw-r--r--tests/arthur/arthurtester.pro6
-rw-r--r--tests/arthur/baselineserver/.gitignore2
-rwxr-xr-xtests/arthur/baselineserver/bin/runserver13
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp557
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.h137
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.pro30
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.qrc5
-rw-r--r--tests/arthur/baselineserver/src/main.cpp70
-rw-r--r--tests/arthur/baselineserver/src/report.cpp311
-rw-r--r--tests/arthur/baselineserver/src/report.h91
-rw-r--r--tests/arthur/baselineserver/src/templates/view.html79
-rw-r--r--tests/arthur/common/baselineprotocol.cpp525
-rw-r--r--tests/arthur/common/baselineprotocol.h193
-rw-r--r--tests/arthur/common/baselineprotocol.pri11
-rw-r--r--tests/arthur/common/common.pri18
-rw-r--r--tests/arthur/common/common.pro20
-rw-r--r--tests/arthur/common/framework.cpp130
-rw-r--r--tests/arthur/common/framework.h76
-rw-r--r--tests/arthur/common/images.qrc34
-rw-r--r--tests/arthur/common/images/alpha.pngbin0 -> 2422 bytes
-rw-r--r--tests/arthur/common/images/alpha2x2.pngbin0 -> 169 bytes
-rw-r--r--tests/arthur/common/images/bitmap.pngbin0 -> 254 bytes
-rw-r--r--tests/arthur/common/images/border.pngbin0 -> 182 bytes
-rw-r--r--tests/arthur/common/images/borderimage.pngbin0 -> 826 bytes
-rw-r--r--tests/arthur/common/images/dome_argb32.pngbin0 -> 18234 bytes
-rw-r--r--tests/arthur/common/images/dome_indexed.pngbin0 -> 7946 bytes
-rw-r--r--tests/arthur/common/images/dome_indexed_mask.pngbin0 -> 5411 bytes
-rw-r--r--tests/arthur/common/images/dome_mono.pngbin0 -> 1391 bytes
-rw-r--r--tests/arthur/common/images/dome_mono_128.pngbin0 -> 2649 bytes
-rw-r--r--tests/arthur/common/images/dome_mono_palette.pngbin0 -> 1404 bytes
-rw-r--r--tests/arthur/common/images/dome_rgb32.pngbin0 -> 17890 bytes
-rw-r--r--tests/arthur/common/images/dot.pngbin0 -> 287 bytes
-rw-r--r--tests/arthur/common/images/face.pngbin0 -> 2414 bytes
-rw-r--r--tests/arthur/common/images/gam030.pngbin0 -> 213 bytes
-rw-r--r--tests/arthur/common/images/gam045.pngbin0 -> 216 bytes
-rw-r--r--tests/arthur/common/images/gam056.pngbin0 -> 216 bytes
-rw-r--r--tests/arthur/common/images/gam100.pngbin0 -> 205 bytes
-rw-r--r--tests/arthur/common/images/gam200.pngbin0 -> 187 bytes
-rw-r--r--tests/arthur/common/images/image.pngbin0 -> 169554 bytes
-rw-r--r--tests/arthur/common/images/mask.pngbin0 -> 274 bytes
-rw-r--r--tests/arthur/common/images/mask_100.pngbin0 -> 319 bytes
-rw-r--r--tests/arthur/common/images/masked.pngbin0 -> 788 bytes
-rw-r--r--tests/arthur/common/images/sign.pngbin0 -> 10647 bytes
-rw-r--r--tests/arthur/common/images/solid.pngbin0 -> 607 bytes
-rw-r--r--tests/arthur/common/images/solid2x2.pngbin0 -> 169 bytes
-rw-r--r--tests/arthur/common/images/struct-image-01.jpgbin0 -> 4751 bytes
-rw-r--r--tests/arthur/common/images/struct-image-01.pngbin0 -> 63238 bytes
-rw-r--r--tests/arthur/common/images/zebra.pngbin0 -> 426 bytes
-rw-r--r--tests/arthur/common/lookup3.cpp786
-rw-r--r--tests/arthur/common/paintcommands.cpp2684
-rw-r--r--tests/arthur/common/paintcommands.h340
-rw-r--r--tests/arthur/common/qbaselinetest.cpp193
-rw-r--r--tests/arthur/common/qbaselinetest.h77
-rw-r--r--tests/arthur/common/qbaselinetest.pri13
-rw-r--r--tests/arthur/common/qengines.cpp733
-rw-r--r--tests/arthur/common/qengines.h241
-rw-r--r--tests/arthur/common/xmldata.cpp110
-rw-r--r--tests/arthur/common/xmldata.h153
-rw-r--r--tests/arthur/data/1.1/color-prop-03-t.svg101
-rw-r--r--tests/arthur/data/1.1/coords-trans-01-b.svg240
-rw-r--r--tests/arthur/data/1.1/coords-trans-02-t.svg178
-rw-r--r--tests/arthur/data/1.1/coords-trans-03-t.svg100
-rw-r--r--tests/arthur/data/1.1/coords-trans-04-t.svg69
-rw-r--r--tests/arthur/data/1.1/coords-trans-05-t.svg89
-rw-r--r--tests/arthur/data/1.1/coords-trans-06-t.svg83
-rw-r--r--tests/arthur/data/1.1/fonts-elem-01-t.svg103
-rw-r--r--tests/arthur/data/1.1/fonts-elem-02-t.svg107
-rw-r--r--tests/arthur/data/1.1/interact-zoom-01-t.svg71
-rw-r--r--tests/arthur/data/1.1/linking-a-04-t.svg124
-rw-r--r--tests/arthur/data/1.1/linking-uri-03-t.svg74
-rw-r--r--tests/arthur/data/1.1/metadata-example-01-b.svg175
-rw-r--r--tests/arthur/data/1.1/painting-fill-01-t.svg80
-rw-r--r--tests/arthur/data/1.1/painting-fill-02-t.svg80
-rw-r--r--tests/arthur/data/1.1/painting-fill-03-t.svg77
-rw-r--r--tests/arthur/data/1.1/painting-fill-04-t.svg57
-rw-r--r--tests/arthur/data/1.1/painting-stroke-01-t.svg55
-rw-r--r--tests/arthur/data/1.1/painting-stroke-02-t.svg56
-rw-r--r--tests/arthur/data/1.1/painting-stroke-03-t.svg57
-rw-r--r--tests/arthur/data/1.1/painting-stroke-04-t.svg71
-rw-r--r--tests/arthur/data/1.1/paths-data-01-t.svg158
-rw-r--r--tests/arthur/data/1.1/paths-data-02-t.svg132
-rw-r--r--tests/arthur/data/1.1/paths-data-04-t.svg92
-rw-r--r--tests/arthur/data/1.1/paths-data-05-t.svg89
-rw-r--r--tests/arthur/data/1.1/paths-data-06-t.svg72
-rw-r--r--tests/arthur/data/1.1/paths-data-07-t.svg72
-rw-r--r--tests/arthur/data/1.1/pservers-grad-07-b.svg74
-rw-r--r--tests/arthur/data/1.1/pservers-grad-11-b.svg100
-rw-r--r--tests/arthur/data/1.1/render-elems-01-t.svg54
-rw-r--r--tests/arthur/data/1.1/render-elems-02-t.svg75
-rw-r--r--tests/arthur/data/1.1/render-elems-03-t.svg57
-rw-r--r--tests/arthur/data/1.1/render-elems-06-t.svg75
-rw-r--r--tests/arthur/data/1.1/render-elems-07-t.svg76
-rw-r--r--tests/arthur/data/1.1/render-elems-08-t.svg78
-rw-r--r--tests/arthur/data/1.1/render-groups-03-t.svg117
-rw-r--r--tests/arthur/data/1.1/shapes-circle-01-t.svg56
-rw-r--r--tests/arthur/data/1.1/shapes-ellipse-01-t.svg72
-rw-r--r--tests/arthur/data/1.1/shapes-line-01-t.svg80
-rw-r--r--tests/arthur/data/1.1/shapes-polygon-01-t.svg73
-rw-r--r--tests/arthur/data/1.1/shapes-polyline-01-t.svg84
-rw-r--r--tests/arthur/data/1.1/shapes-rect-01-t.svg72
-rw-r--r--tests/arthur/data/1.1/struct-cond-01-t.svg75
-rw-r--r--tests/arthur/data/1.1/struct-cond-02-t.svg574
-rw-r--r--tests/arthur/data/1.1/struct-defs-01-t.svg85
-rw-r--r--tests/arthur/data/1.1/struct-group-01-t.svg71
-rw-r--r--tests/arthur/data/1.1/struct-image-01-t.svg65
-rw-r--r--tests/arthur/data/1.1/struct-image-03-t.svg54
-rw-r--r--tests/arthur/data/1.1/struct-image-04-t.svg126
-rw-r--r--tests/arthur/data/1.1/styling-pres-01-t.svg38
-rw-r--r--tests/arthur/data/1.1/text-fonts-01-t.svg98
-rw-r--r--tests/arthur/data/1.1/text-fonts-02-t.svg73
-rw-r--r--tests/arthur/data/1.1/text-intro-01-t.svg69
-rw-r--r--tests/arthur/data/1.1/text-intro-04-t.svg68
-rw-r--r--tests/arthur/data/1.1/text-ws-01-t.svg99
-rw-r--r--tests/arthur/data/1.1/text-ws-02-t.svg104
-rw-r--r--tests/arthur/data/1.2/07_07.svg40
-rw-r--r--tests/arthur/data/1.2/07_12.svg21
-rw-r--r--tests/arthur/data/1.2/08_02.svg26
-rw-r--r--tests/arthur/data/1.2/08_03.svg28
-rw-r--r--tests/arthur/data/1.2/08_04.svg19
-rw-r--r--tests/arthur/data/1.2/09_02.svg14
-rw-r--r--tests/arthur/data/1.2/09_03.svg10
-rw-r--r--tests/arthur/data/1.2/09_04.svg15
-rw-r--r--tests/arthur/data/1.2/09_05.svg20
-rw-r--r--tests/arthur/data/1.2/09_06.svg16
-rw-r--r--tests/arthur/data/1.2/09_07.svg15
-rw-r--r--tests/arthur/data/1.2/10_03.svg15
-rw-r--r--tests/arthur/data/1.2/10_04.svg20
-rw-r--r--tests/arthur/data/1.2/10_05.svg21
-rw-r--r--tests/arthur/data/1.2/10_06.svg20
-rw-r--r--tests/arthur/data/1.2/10_07.svg20
-rw-r--r--tests/arthur/data/1.2/10_08.svg23
-rw-r--r--tests/arthur/data/1.2/10_09.svg30
-rw-r--r--tests/arthur/data/1.2/10_10.svg23
-rw-r--r--tests/arthur/data/1.2/10_11.svg24
-rw-r--r--tests/arthur/data/1.2/11_01.svg20
-rw-r--r--tests/arthur/data/1.2/11_02.svg9
-rw-r--r--tests/arthur/data/1.2/11_03.svg11
-rw-r--r--tests/arthur/data/1.2/13_01.svg20
-rw-r--r--tests/arthur/data/1.2/13_02.svg22
-rw-r--r--tests/arthur/data/1.2/19_01.svg51
-rw-r--r--tests/arthur/data/1.2/19_02.svg25
-rw-r--r--tests/arthur/data/1.2/animation.svg11
-rw-r--r--tests/arthur/data/1.2/cubic02.svg77
-rw-r--r--tests/arthur/data/1.2/fillrule-evenodd.svg38
-rw-r--r--tests/arthur/data/1.2/fillrule-nonzero.svg38
-rw-r--r--tests/arthur/data/1.2/linecap.svg32
-rw-r--r--tests/arthur/data/1.2/linejoin.svg29
-rw-r--r--tests/arthur/data/1.2/media01.svg20
-rw-r--r--tests/arthur/data/1.2/media02.svg13
-rw-r--r--tests/arthur/data/1.2/media03.svg13
-rw-r--r--tests/arthur/data/1.2/media04.svg24
-rw-r--r--tests/arthur/data/1.2/media05.svg27
-rw-r--r--tests/arthur/data/1.2/mpath01.svg10
-rw-r--r--tests/arthur/data/1.2/non-scaling-stroke.svg15
-rw-r--r--tests/arthur/data/1.2/noonoo.svg13
-rw-r--r--tests/arthur/data/1.2/referencedRect.svg9
-rw-r--r--tests/arthur/data/1.2/referencedRect2.svg9
-rw-r--r--tests/arthur/data/1.2/solidcolor.svg16
-rw-r--r--tests/arthur/data/1.2/textArea01.svg10
-rw-r--r--tests/arthur/data/1.2/timed-lyrics.svg22
-rw-r--r--tests/arthur/data/1.2/use.svg22
-rw-r--r--tests/arthur/data/bugs/.gitattributes2
-rw-r--r--tests/arthur/data/bugs/gradient-defaults.svg18
-rw-r--r--tests/arthur/data/bugs/gradient_pen_fill.svg32
-rw-r--r--tests/arthur/data/bugs/openglcurve.svg35
-rw-r--r--tests/arthur/data/bugs/org_module.svg389
-rw-r--r--tests/arthur/data/bugs/resolve_linear.svg29
-rw-r--r--tests/arthur/data/bugs/resolve_radial.svg36
-rw-r--r--tests/arthur/data/bugs/text_pens.svg7
-rw-r--r--tests/arthur/data/framework.ini22
-rw-r--r--tests/arthur/data/images/alpha.pngbin0 -> 2422 bytes
-rw-r--r--tests/arthur/data/images/bitmap.pngbin0 -> 254 bytes
-rw-r--r--tests/arthur/data/images/border.pngbin0 -> 182 bytes
-rw-r--r--tests/arthur/data/images/dome_argb32.pngbin0 -> 18234 bytes
-rw-r--r--tests/arthur/data/images/dome_indexed.pngbin0 -> 7946 bytes
-rw-r--r--tests/arthur/data/images/dome_indexed_mask.pngbin0 -> 5411 bytes
-rw-r--r--tests/arthur/data/images/dome_mono.pngbin0 -> 1391 bytes
-rw-r--r--tests/arthur/data/images/dome_mono_128.pngbin0 -> 2649 bytes
-rw-r--r--tests/arthur/data/images/dome_mono_palette.pngbin0 -> 1404 bytes
-rw-r--r--tests/arthur/data/images/dome_rgb32.pngbin0 -> 17890 bytes
-rw-r--r--tests/arthur/data/images/dot.pngbin0 -> 287 bytes
-rw-r--r--tests/arthur/data/images/face.pngbin0 -> 2414 bytes
-rw-r--r--tests/arthur/data/images/gam030.pngbin0 -> 213 bytes
-rw-r--r--tests/arthur/data/images/gam045.pngbin0 -> 216 bytes
-rw-r--r--tests/arthur/data/images/gam056.pngbin0 -> 216 bytes
-rw-r--r--tests/arthur/data/images/gam100.pngbin0 -> 205 bytes
-rw-r--r--tests/arthur/data/images/gam200.pngbin0 -> 187 bytes
-rw-r--r--tests/arthur/data/images/image.pngbin0 -> 169554 bytes
-rw-r--r--tests/arthur/data/images/mask.pngbin0 -> 274 bytes
-rw-r--r--tests/arthur/data/images/mask_100.pngbin0 -> 319 bytes
-rw-r--r--tests/arthur/data/images/masked.pngbin0 -> 788 bytes
-rw-r--r--tests/arthur/data/images/paths.qps32
-rw-r--r--tests/arthur/data/images/pens.qps96
-rw-r--r--tests/arthur/data/images/sign.pngbin0 -> 10647 bytes
-rw-r--r--tests/arthur/data/images/solid.pngbin0 -> 607 bytes
-rw-r--r--tests/arthur/data/images/struct-image-01.jpgbin0 -> 4751 bytes
-rw-r--r--tests/arthur/data/images/struct-image-01.pngbin0 -> 63238 bytes
-rw-r--r--tests/arthur/data/qps/aliasing.qps156
-rw-r--r--tests/arthur/data/qps/aliasing_qps.pngbin0 -> 30531 bytes
-rw-r--r--tests/arthur/data/qps/alphas.qps63
-rw-r--r--tests/arthur/data/qps/alphas_qps.pngbin0 -> 45840 bytes
-rw-r--r--tests/arthur/data/qps/arcs.qps65
-rw-r--r--tests/arthur/data/qps/arcs2.qps44
-rw-r--r--tests/arthur/data/qps/arcs2_qps.pngbin0 -> 9136 bytes
-rw-r--r--tests/arthur/data/qps/arcs_qps.pngbin0 -> 110658 bytes
-rw-r--r--tests/arthur/data/qps/background.qps133
-rw-r--r--tests/arthur/data/qps/background_brush.qps2
-rw-r--r--tests/arthur/data/qps/background_brush_qps.pngbin0 -> 62149 bytes
-rw-r--r--tests/arthur/data/qps/background_qps.pngbin0 -> 53461 bytes
-rw-r--r--tests/arthur/data/qps/beziers.qps144
-rw-r--r--tests/arthur/data/qps/beziers_qps.pngbin0 -> 57610 bytes
-rw-r--r--tests/arthur/data/qps/bitmaps.qps163
-rw-r--r--tests/arthur/data/qps/bitmaps_qps.pngbin0 -> 89888 bytes
-rw-r--r--tests/arthur/data/qps/borderimage.qps164
-rw-r--r--tests/arthur/data/qps/borderimage_qps.pngbin0 -> 91838 bytes
-rw-r--r--tests/arthur/data/qps/brush_pens.qps101
-rw-r--r--tests/arthur/data/qps/brush_pens_qps.pngbin0 -> 77823 bytes
-rw-r--r--tests/arthur/data/qps/brushes.qps77
-rw-r--r--tests/arthur/data/qps/brushes_qps.pngbin0 -> 134906 bytes
-rw-r--r--tests/arthur/data/qps/clippaths.qps58
-rw-r--r--tests/arthur/data/qps/clippaths_qps.pngbin0 -> 6484 bytes
-rw-r--r--tests/arthur/data/qps/clipping.qps179
-rw-r--r--tests/arthur/data/qps/clipping_qps.pngbin0 -> 14424 bytes
-rw-r--r--tests/arthur/data/qps/clipping_state.qps72
-rw-r--r--tests/arthur/data/qps/clipping_state_qps.pngbin0 -> 5133 bytes
-rw-r--r--tests/arthur/data/qps/cliprects.qps57
-rw-r--r--tests/arthur/data/qps/cliprects_qps.pngbin0 -> 6484 bytes
-rw-r--r--tests/arthur/data/qps/conical_gradients.qps82
-rw-r--r--tests/arthur/data/qps/conical_gradients_perspectives.qps61
-rw-r--r--tests/arthur/data/qps/conical_gradients_perspectives_qps.pngbin0 -> 115264 bytes
-rw-r--r--tests/arthur/data/qps/conical_gradients_qps.pngbin0 -> 108982 bytes
-rw-r--r--tests/arthur/data/qps/dashes.qps265
-rw-r--r--tests/arthur/data/qps/dashes_qps.pngbin0 -> 48344 bytes
-rw-r--r--tests/arthur/data/qps/degeneratebeziers.qps7
-rw-r--r--tests/arthur/data/qps/degeneratebeziers_qps.pngbin0 -> 5503 bytes
-rw-r--r--tests/arthur/data/qps/deviceclipping.qps45
-rw-r--r--tests/arthur/data/qps/deviceclipping_qps.pngbin0 -> 12919 bytes
-rw-r--r--tests/arthur/data/qps/drawpoints.qps98
-rw-r--r--tests/arthur/data/qps/drawpoints_qps.pngbin0 -> 8224 bytes
-rw-r--r--tests/arthur/data/qps/drawtext.qps85
-rw-r--r--tests/arthur/data/qps/drawtext_qps.pngbin0 -> 55646 bytes
-rw-r--r--tests/arthur/data/qps/ellipses.qps83
-rw-r--r--tests/arthur/data/qps/ellipses_qps.pngbin0 -> 36197 bytes
-rw-r--r--tests/arthur/data/qps/filltest.qps410
-rw-r--r--tests/arthur/data/qps/filltest_qps.pngbin0 -> 22602 bytes
-rw-r--r--tests/arthur/data/qps/fonts.qps64
-rw-r--r--tests/arthur/data/qps/fonts_qps.pngbin0 -> 75853 bytes
-rw-r--r--tests/arthur/data/qps/gradients.qps41
-rw-r--r--tests/arthur/data/qps/gradients_qps.pngbin0 -> 41596 bytes
-rw-r--r--tests/arthur/data/qps/image_formats.qps78
-rw-r--r--tests/arthur/data/qps/image_formats_qps.pngbin0 -> 275242 bytes
-rw-r--r--tests/arthur/data/qps/images.qps103
-rw-r--r--tests/arthur/data/qps/images2.qps143
-rw-r--r--tests/arthur/data/qps/images2_qps.pngbin0 -> 182146 bytes
-rw-r--r--tests/arthur/data/qps/images_qps.pngbin0 -> 322000 bytes
-rw-r--r--tests/arthur/data/qps/join_cap_styles.qps60
-rw-r--r--tests/arthur/data/qps/join_cap_styles_duplicate_control_points.qps65
-rw-r--r--tests/arthur/data/qps/join_cap_styles_duplicate_control_points_qps.pngbin0 -> 42237 bytes
-rw-r--r--tests/arthur/data/qps/join_cap_styles_qps.pngbin0 -> 37518 bytes
-rw-r--r--tests/arthur/data/qps/linear_gradients.qps141
-rw-r--r--tests/arthur/data/qps/linear_gradients_perspectives.qps60
-rw-r--r--tests/arthur/data/qps/linear_gradients_perspectives_qps.pngbin0 -> 77944 bytes
-rw-r--r--tests/arthur/data/qps/linear_gradients_qps.pngbin0 -> 162643 bytes
-rw-r--r--tests/arthur/data/qps/linear_resolving_gradients.qps75
-rw-r--r--tests/arthur/data/qps/linear_resolving_gradients_qps.pngbin0 -> 76697 bytes
-rw-r--r--tests/arthur/data/qps/lineconsistency.qps70
-rw-r--r--tests/arthur/data/qps/lineconsistency_qps.pngbin0 -> 12388 bytes
-rw-r--r--tests/arthur/data/qps/linedashes.qps92
-rw-r--r--tests/arthur/data/qps/linedashes2.qps151
-rw-r--r--tests/arthur/data/qps/linedashes2_aa.qps2
-rw-r--r--tests/arthur/data/qps/linedashes2_aa_qps.pngbin0 -> 28418 bytes
-rw-r--r--tests/arthur/data/qps/linedashes2_qps.pngbin0 -> 12182 bytes
-rw-r--r--tests/arthur/data/qps/linedashes_qps.pngbin0 -> 11801 bytes
-rw-r--r--tests/arthur/data/qps/lines.qps555
-rw-r--r--tests/arthur/data/qps/lines2.qps176
-rw-r--r--tests/arthur/data/qps/lines2_qps.pngbin0 -> 36623 bytes
-rw-r--r--tests/arthur/data/qps/lines_qps.pngbin0 -> 113575 bytes
-rw-r--r--tests/arthur/data/qps/object_bounding_mode.qps35
-rw-r--r--tests/arthur/data/qps/object_bounding_mode_qps.pngbin0 -> 85460 bytes
-rw-r--r--tests/arthur/data/qps/pathfill.qps35
-rw-r--r--tests/arthur/data/qps/pathfill_qps.pngbin0 -> 198538 bytes
-rw-r--r--tests/arthur/data/qps/paths.qps32
-rw-r--r--tests/arthur/data/qps/paths_aa.qps2
-rw-r--r--tests/arthur/data/qps/paths_aa_qps.pngbin0 -> 92147 bytes
-rw-r--r--tests/arthur/data/qps/paths_qps.pngbin0 -> 20392 bytes
-rw-r--r--tests/arthur/data/qps/pens.qps130
-rw-r--r--tests/arthur/data/qps/pens_aa.qps3
-rw-r--r--tests/arthur/data/qps/pens_aa_qps.pngbin0 -> 30813 bytes
-rw-r--r--tests/arthur/data/qps/pens_cosmetic.qps107
-rw-r--r--tests/arthur/data/qps/pens_cosmetic_qps.pngbin0 -> 47487 bytes
-rw-r--r--tests/arthur/data/qps/pens_qps.pngbin0 -> 11822 bytes
-rw-r--r--tests/arthur/data/qps/perspectives.qps70
-rw-r--r--tests/arthur/data/qps/perspectives2.qps307
-rw-r--r--tests/arthur/data/qps/perspectives2_qps.pngbin0 -> 234054 bytes
-rw-r--r--tests/arthur/data/qps/perspectives_qps.pngbin0 -> 491494 bytes
-rw-r--r--tests/arthur/data/qps/pixmap_rotation.qps27
-rw-r--r--tests/arthur/data/qps/pixmap_rotation_qps.pngbin0 -> 8141 bytes
-rw-r--r--tests/arthur/data/qps/pixmap_scaling.qps527
-rw-r--r--tests/arthur/data/qps/pixmap_subpixel.qps115
-rw-r--r--tests/arthur/data/qps/pixmap_subpixel_qps.pngbin0 -> 5317 bytes
-rw-r--r--tests/arthur/data/qps/pixmaps.qps103
-rw-r--r--tests/arthur/data/qps/pixmaps_qps.pngbin0 -> 321685 bytes
-rw-r--r--tests/arthur/data/qps/porter_duff.qps248
-rw-r--r--tests/arthur/data/qps/porter_duff2.qps256
-rw-r--r--tests/arthur/data/qps/porter_duff2_qps.pngbin0 -> 99167 bytes
-rw-r--r--tests/arthur/data/qps/porter_duff_qps.pngbin0 -> 39375 bytes
-rw-r--r--tests/arthur/data/qps/primitives.qps198
-rw-r--r--tests/arthur/data/qps/primitives_qps.pngbin0 -> 104235 bytes
-rw-r--r--tests/arthur/data/qps/radial_gradients.qps96
-rw-r--r--tests/arthur/data/qps/radial_gradients_perspectives.qps60
-rw-r--r--tests/arthur/data/qps/radial_gradients_perspectives_qps.pngbin0 -> 131744 bytes
-rw-r--r--tests/arthur/data/qps/radial_gradients_qps.pngbin0 -> 161009 bytes
-rw-r--r--tests/arthur/data/qps/rasterops.qps84
-rw-r--r--tests/arthur/data/qps/rasterops_qps.pngbin0 -> 11059 bytes
-rw-r--r--tests/arthur/data/qps/sizes.qps147
-rw-r--r--tests/arthur/data/qps/sizes_qps.pngbin0 -> 42355 bytes
-rw-r--r--tests/arthur/data/qps/text.qps122
-rw-r--r--tests/arthur/data/qps/text_perspectives.qps100
-rw-r--r--tests/arthur/data/qps/text_perspectives_qps.pngbin0 -> 116847 bytes
-rw-r--r--tests/arthur/data/qps/text_qps.pngbin0 -> 32991 bytes
-rw-r--r--tests/arthur/data/qps/tiled_pixmap.qps82
-rw-r--r--tests/arthur/data/qps/tiled_pixmap_qps.pngbin0 -> 376370 bytes
-rw-r--r--tests/arthur/data/random/arcs02.svg59
-rw-r--r--tests/arthur/data/random/atop.svg55
-rw-r--r--tests/arthur/data/random/clinton.svg370
-rw-r--r--tests/arthur/data/random/cowboy.svg4110
-rw-r--r--tests/arthur/data/random/gear_is_rising.svg702
-rw-r--r--tests/arthur/data/random/gearflowers.svg8342
-rw-r--r--tests/arthur/data/random/kde-look.svg16674
-rw-r--r--tests/arthur/data/random/linear_grad_transform.svg51
-rw-r--r--tests/arthur/data/random/longhorn.svg1595
-rw-r--r--tests/arthur/data/random/multiply.svg48
-rw-r--r--tests/arthur/data/random/picasso.svg2842
-rw-r--r--tests/arthur/data/random/porterduff.svg298
-rw-r--r--tests/arthur/data/random/radial_grad_transform.svg59
-rw-r--r--tests/arthur/data/random/solidcolor.svg15
-rw-r--r--tests/arthur/data/random/spiral.svg536
-rw-r--r--tests/arthur/data/random/tests.svg36
-rw-r--r--tests/arthur/data/random/tests2.svg12
-rw-r--r--tests/arthur/data/random/tiger.svg728
-rw-r--r--tests/arthur/data/random/uluru.pngbin0 -> 11749 bytes
-rw-r--r--tests/arthur/data/random/worldcup.svg14668
-rw-r--r--tests/arthur/datagenerator/datagenerator.cpp481
-rw-r--r--tests/arthur/datagenerator/datagenerator.h103
-rw-r--r--tests/arthur/datagenerator/datagenerator.pri2
-rw-r--r--tests/arthur/datagenerator/datagenerator.pro22
-rw-r--r--tests/arthur/datagenerator/main.cpp54
-rw-r--r--tests/arthur/datagenerator/xmlgenerator.cpp262
-rw-r--r--tests/arthur/datagenerator/xmlgenerator.h73
-rw-r--r--tests/arthur/htmlgenerator/htmlgenerator.cpp518
-rw-r--r--tests/arthur/htmlgenerator/htmlgenerator.h126
-rw-r--r--tests/arthur/htmlgenerator/htmlgenerator.pro20
-rw-r--r--tests/arthur/htmlgenerator/main.cpp54
-rw-r--r--tests/arthur/lance/enum.pngbin0 -> 4619 bytes
-rw-r--r--tests/arthur/lance/icons.qrc6
-rw-r--r--tests/arthur/lance/interactivewidget.cpp202
-rw-r--r--tests/arthur/lance/interactivewidget.h80
-rw-r--r--tests/arthur/lance/lance.pro23
-rw-r--r--tests/arthur/lance/main.cpp678
-rw-r--r--tests/arthur/lance/tools.pngbin0 -> 4424 bytes
-rw-r--r--tests/arthur/lance/widgets.h354
-rw-r--r--tests/arthur/performancediff/main.cpp54
-rw-r--r--tests/arthur/performancediff/performancediff.cpp219
-rw-r--r--tests/arthur/performancediff/performancediff.h73
-rw-r--r--tests/arthur/performancediff/performancediff.pro20
-rw-r--r--tests/arthur/shower/main.cpp99
-rw-r--r--tests/arthur/shower/shower.cpp125
-rw-r--r--tests/arthur/shower/shower.h73
-rw-r--r--tests/arthur/shower/shower.pro18
373 files changed, 77190 insertions, 0 deletions
diff --git a/tests/arthur/.gitattributes b/tests/arthur/.gitattributes
new file mode 100644
index 0000000000..b7fa3a03c1
--- /dev/null
+++ b/tests/arthur/.gitattributes
@@ -0,0 +1,2 @@
+data/*/*.svg -crlf
+data/qps/*.qps -crlf
diff --git a/tests/arthur/.gitignore b/tests/arthur/.gitignore
new file mode 100644
index 0000000000..7f0c1fa2cd
--- /dev/null
+++ b/tests/arthur/.gitignore
@@ -0,0 +1,2 @@
+bin/shower
+lance/lance
diff --git a/tests/arthur/README b/tests/arthur/README
new file mode 100644
index 0000000000..0178351b95
--- /dev/null
+++ b/tests/arthur/README
@@ -0,0 +1,84 @@
+This is a simple regression testing framework for Arthur.
+
+There are three parts to it.
+
+1) datagenerator . which is the main part. it's used to
+ run all the tests, create output png files,
+ measure rendering performance and output it in
+ data.xml file. datagenerator reads in
+ framework.ini to figure out where to look for tests.
+ if the framework.ini file isn't in the current directory
+ you have to specify its location with the -framework
+ parameter. by default datagenerator generates output in the
+ current directory - to specify output directory pass in
+ -output parameter followed by a directory name. if the given
+ directory doesn't exist it will be created.
+
+ it's recommended to always specify -iterations argument (followed
+ by the number). if the argument has been specified datagenerator
+ will try to render all testcases the given amount of times yielding
+ a lot more precise results.
+
+ if one wants to test just a specified engine -engine argument
+ should be specified (followed by the desired engine name).
+
+ individual testsuites can be run with -suite paramenter.
+ individual testcases from testcases can also be reran with
+ -testcase paramenter.
+
+ given files can also be tested individually. if the option -file
+ is specified with a SVG file engines will be tested against just
+ that file and output will be written directly to stdout (not files).
+ it's useful when optimizing one engine with particular case in
+ mind.
+
+ Example command line:
+ ./bin/datagenerator -framework data/framework.ini -output sampleout -iterations 5 -engine [ENGINE]
+
+2) htmlgenerator. which is used to generate html pages out of
+ generated output (generated by datagenerator). htmlgenerator also
+ reads in the framework.ini file. so the option -framework also
+ applies. but htmlgenerator takes a mandatory directory name as the
+ second argument. the mandatory directory name is the directory to
+ which you output the files generated by datagenerator (either
+ whatever followed the -output or the current directory)
+
+ htmlgenerator will generate html pages that can be viewed to
+ manually inspect the results.
+
+ Example command line:
+ ./bin/htmlgenerator -framework data/framework.ini sampleout
+
+3) performancediff. diffs the performance data between two output
+ directories. so assuming you already have data for all the engines,
+ you change something in an engine. to see the performance
+ difference run
+ ./bin/datagenerator -framework data/framework.ini -output newoutput -iterations 5
+ and then
+ ./bin/performancediff sampleout newoutput
+
+ The performance results will be printed out.
+
+ The two first columns are in ms. The last one is a
+ percentage of difference.
+
+ After the percentage a '+' or a '-' sign followed by a
+ number will be sometimes printed.
+
+ '+' signifies the new results were mathematically better. '-' is of
+ course just the opposite.
+ the number following '+' is the minimum rendering time the engine
+ spent rendering the given file up till this moment.
+ the number following '-' is the maximum rendering time the engine
+ spent rendering the given file up till this moment.
+
+ (if the current results are out of the scope from within maximum and
+ minimum number then the respective sign is printed out.)
+-------------------------------------------------------------------
+
+Note that the generated output directories can be copied from one
+machine to the other. htmlgenerator will generate webpages for all
+engines with valid data.xml files. So if you want add NativeWin32 and
+NativeMac engines you'll have to have someone with a windows and mac
+run datagenerator with "-engine NativeWin32" or "-engine NativeMac"
+options and then sending you the respective output directories.
diff --git a/tests/arthur/arthurtester.pri b/tests/arthur/arthurtester.pri
new file mode 100644
index 0000000000..87ca08292e
--- /dev/null
+++ b/tests/arthur/arthurtester.pri
@@ -0,0 +1,21 @@
+DEFINES += QT_COMPAT_WARNINGS QT_NO_CAST_TO_ASCII
+
+INCLUDEPATH += $$COMMON_FOLDER
+
+include($$COMMON_FOLDER/common.pri)
+
+#build_all:!build_pass {
+# CONFIG -= build_all
+# CONFIG += release
+#}
+#contains(CONFIG, debug_and_release_target) {
+# CONFIG(debug, debug|release) {
+# LIBS+=-L$$COMMON_FOLDER/debug
+# } else {
+# LIBS+=-L$$COMMON_FOLDER/release
+# }
+#} else {
+# LIBS += -L$$COMMON_FOLDER
+#}
+#
+#LIBS += -ltestcommon
diff --git a/tests/arthur/arthurtester.pro b/tests/arthur/arthurtester.pro
new file mode 100644
index 0000000000..443ec56c30
--- /dev/null
+++ b/tests/arthur/arthurtester.pro
@@ -0,0 +1,6 @@
+# -*-Mode:makefile-*-
+TEMPLATE = subdirs
+SUBDIRS = datagenerator htmlgenerator \
+ performancediff shower lance
+
+
diff --git a/tests/arthur/baselineserver/.gitignore b/tests/arthur/baselineserver/.gitignore
new file mode 100644
index 0000000000..cc513e0df2
--- /dev/null
+++ b/tests/arthur/baselineserver/.gitignore
@@ -0,0 +1,2 @@
+storage
+bin/baselineserver
diff --git a/tests/arthur/baselineserver/bin/runserver b/tests/arthur/baselineserver/bin/runserver
new file mode 100755
index 0000000000..48c5c1d086
--- /dev/null
+++ b/tests/arthur/baselineserver/bin/runserver
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+logfile=baselineserver.log
+
+while true; do
+ echo >> $logfile
+ echo -n "***RESTARTING*** " >> $logfile
+ date >> $logfile
+
+ ./baselineserver 2>&1 | tee -a $logfile
+
+ sleep 2
+done
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp
new file mode 100644
index 0000000000..0c0871ae6f
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.cpp
@@ -0,0 +1,557 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#define QT_USE_FAST_CONCATENATION
+#define QT_USE_FAST_OPERATOR_PLUS
+
+#include "baselineserver.h"
+#include <QBuffer>
+#include <QFile>
+#include <QDir>
+#include <QCoreApplication>
+#include <QFileInfo>
+#include <QHostInfo>
+#include <QTextStream>
+#include <QProcess>
+#include <QDirIterator>
+
+// extra fields, for use in image metadata storage
+const QString PI_ImageChecksum(QLS("ImageChecksum"));
+const QString PI_RunId(QLS("RunId"));
+const QString PI_CreationDate(QLS("CreationDate"));
+
+QString BaselineServer::storage;
+QString BaselineServer::url;
+
+BaselineServer::BaselineServer(QObject *parent)
+ : QTcpServer(parent), lastRunIdIdx(0)
+{
+ QFileInfo me(QCoreApplication::applicationFilePath());
+ meLastMod = me.lastModified();
+ heartbeatTimer = new QTimer(this);
+ connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT(heartbeat()));
+ heartbeatTimer->start(HEARTBEAT*1000);
+}
+
+QString BaselineServer::storagePath()
+{
+ if (storage.isEmpty()) {
+ storage = QLS(qgetenv("QT_LANCELOT_DIR"));
+ if (storage.isEmpty())
+ storage = QLS("/var/www");
+ }
+ return storage;
+}
+
+QString BaselineServer::baseUrl()
+{
+ if (url.isEmpty()) {
+ url = QLS("http://")
+ + QHostInfo::localHostName().toLatin1() + '.'
+ + QHostInfo::localDomainName().toLatin1() + '/';
+ }
+ return url;
+}
+
+void BaselineServer::incomingConnection(int socketDescriptor)
+{
+ QString runId = QDateTime::currentDateTime().toString(QLS("MMMdd-hhmmss"));
+ if (runId == lastRunId) {
+ runId += QLC('-') + QString::number(++lastRunIdIdx);
+ } else {
+ lastRunId = runId;
+ lastRunIdIdx = 0;
+ }
+ qDebug() << "Server: New connection! RunId:" << runId;
+ BaselineThread *thread = new BaselineThread(runId, socketDescriptor, this);
+ connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
+ thread->start();
+}
+
+void BaselineServer::heartbeat()
+{
+ // The idea is to exit to be restarted when modified, as soon as not actually serving
+ QFileInfo me(QCoreApplication::applicationFilePath());
+ if (me.lastModified() == meLastMod)
+ return;
+ if (!me.exists() || !me.isExecutable())
+ return;
+
+ //# (could close() here to avoid accepting new connections, to avoid livelock)
+ //# also, could check for a timeout to force exit, to avoid hung threads blocking
+ bool isServing = false;
+ foreach(BaselineThread *thread, findChildren<BaselineThread *>()) {
+ if (thread->isRunning()) {
+ isServing = true;
+ break;
+ }
+ }
+
+ if (!isServing)
+ QCoreApplication::exit();
+}
+
+BaselineThread::BaselineThread(const QString &runId, int socketDescriptor, QObject *parent)
+ : QThread(parent), runId(runId), socketDescriptor(socketDescriptor)
+{
+}
+
+void BaselineThread::run()
+{
+ BaselineHandler handler(runId, socketDescriptor);
+ exec();
+}
+
+
+BaselineHandler::BaselineHandler(const QString &runId, int socketDescriptor)
+ : QObject(), runId(runId), connectionEstablished(false)
+{
+ if (socketDescriptor == -1)
+ return;
+
+ connect(&proto.socket, SIGNAL(readyRead()), this, SLOT(receiveRequest()));
+ connect(&proto.socket, SIGNAL(disconnected()), this, SLOT(receiveDisconnect()));
+ proto.socket.setSocketDescriptor(socketDescriptor);
+}
+
+const char *BaselineHandler::logtime()
+{
+ return 0;
+ //return QTime::currentTime().toString(QLS("mm:ss.zzz"));
+}
+
+bool BaselineHandler::establishConnection()
+{
+ if (!proto.acceptConnection(&plat)) {
+ qWarning() << runId << logtime() << "Accepting new connection from" << proto.socket.peerAddress().toString() << "failed." << proto.errorMessage();
+ proto.socket.disconnectFromHost();
+ return false;
+ }
+ QString logMsg;
+ foreach (QString key, plat.keys()) {
+ if (key != PI_HostName && key != PI_HostAddress)
+ logMsg += key + QLS(": '") + plat.value(key) + QLS("', ");
+ }
+ qDebug() << runId << logtime() << "Connection established with" << plat.value(PI_HostName)
+ << "[" << qPrintable(plat.value(PI_HostAddress)) << "]" << logMsg;
+
+ // Filter on branch
+ QString branch = plat.value(PI_PulseGitBranch);
+ if (branch.isEmpty()) {
+ // Not run by Pulse, i.e. ad hoc run: Ok.
+ }
+ else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration"))) {
+ qDebug() << runId << logtime() << "Did not pass branch/staging repo filter, disconnecting.";
+ proto.sendBlock(BaselineProtocol::Abort, QByteArray("This branch/staging repo is not assigned to be tested."));
+ proto.socket.disconnectFromHost();
+ return false;
+ }
+
+ proto.sendBlock(BaselineProtocol::Ack, QByteArray());
+
+ report.init(this, runId, plat);
+ return true;
+}
+
+void BaselineHandler::receiveRequest()
+{
+ if (!connectionEstablished) {
+ connectionEstablished = establishConnection();
+ return;
+ }
+
+ QByteArray block;
+ BaselineProtocol::Command cmd;
+ if (!proto.receiveBlock(&cmd, &block)) {
+ qWarning() << runId << logtime() << "Command reception failed. "<< proto.errorMessage();
+ QThread::currentThread()->exit(1);
+ return;
+ }
+
+ switch(cmd) {
+ case BaselineProtocol::RequestBaselineChecksums:
+ provideBaselineChecksums(block);
+ break;
+ case BaselineProtocol::AcceptNewBaseline:
+ storeImage(block, true);
+ break;
+ case BaselineProtocol::AcceptMismatch:
+ storeImage(block, false);
+ break;
+ default:
+ qWarning() << runId << logtime() << "Unknown command received. " << proto.errorMessage();
+ proto.sendBlock(BaselineProtocol::UnknownError, QByteArray());
+ }
+}
+
+
+void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock)
+{
+ ImageItemList itemList;
+ QDataStream ds(itemListBlock);
+ ds >> itemList;
+ qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count()
+ << "items in test function" << itemList.at(0).testFunction;
+
+ for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) {
+ i->imageChecksums.clear();
+ i->status = ImageItem::BaselineNotFound;
+ QString prefix = pathForItem(*i, true);
+ PlatformInfo itemData = fetchItemMetadata(prefix);
+ if (itemData.contains(PI_ImageChecksum)) {
+ bool ok = false;
+ quint64 checksum = itemData.value(PI_ImageChecksum).toULongLong(&ok, 16);
+ if (ok) {
+ i->imageChecksums.prepend(checksum);
+ i->status = ImageItem::Ok;
+ }
+ }
+ }
+
+ // Find and mark blacklisted items
+ QString context = pathForItem(itemList.at(0), true, false).section(QLC('/'), 0, -2);
+ if (itemList.count() > 0) {
+ QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
+ if (file.open(QIODevice::ReadOnly)) {
+ QTextStream in(&file);
+ do {
+ QString itemName = in.readLine();
+ if (!itemName.isNull()) {
+ for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) {
+ if (i->itemName == itemName)
+ i->status = ImageItem::IgnoreItem;
+ }
+ }
+ } while (!in.atEnd());
+ }
+ }
+
+ QByteArray block;
+ QDataStream ods(&block, QIODevice::WriteOnly);
+ ods << itemList;
+ proto.sendBlock(BaselineProtocol::Ack, block);
+ report.addItems(itemList);
+}
+
+
+void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline)
+{
+ QDataStream ds(itemBlock);
+ ImageItem item;
+ ds >> item;
+
+ QString prefix = pathForItem(item, isBaseline);
+ qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.itemName << "Storing in" << prefix;
+
+ QString msg;
+ if (isBaseline)
+ msg = QLS("New baseline image stored: ") + pathForItem(item, true, true) + QLS(FileFormat);
+ else
+ msg = BaselineServer::baseUrl() + report.filePath();
+ proto.sendBlock(BaselineProtocol::Ack, msg.toLatin1());
+
+ QString dir = prefix.section(QLC('/'), 0, -2);
+ QDir cwd;
+ if (!cwd.exists(dir))
+ cwd.mkpath(dir);
+ item.image.save(prefix + QLS(FileFormat), FileFormat);
+
+ PlatformInfo itemData = plat;
+ itemData.insert(PI_ImageChecksum, QString::number(item.imageChecksums.at(0), 16)); //# Only the first is stored. TBD: get rid of list
+ itemData.insert(PI_RunId, runId);
+ itemData.insert(PI_CreationDate, QDateTime::currentDateTime().toString());
+ storeItemMetadata(itemData, prefix);
+
+ if (!isBaseline)
+ report.addMismatch(item);
+}
+
+
+void BaselineHandler::storeItemMetadata(const PlatformInfo &metadata, const QString &path)
+{
+ QFile file(path + QLS(MetadataFileExt));
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ qWarning() << runId << logtime() << "ERROR: could not write to file" << file.fileName();
+ return;
+ }
+ QTextStream out(&file);
+ PlatformInfo::const_iterator it = metadata.constBegin();
+ while (it != metadata.constEnd()) {
+ out << it.key() << ": " << it.value() << endl;
+ ++it;
+ }
+ file.close();
+}
+
+
+PlatformInfo BaselineHandler::fetchItemMetadata(const QString &path)
+{
+ PlatformInfo res;
+ QFile file(path + QLS(MetadataFileExt));
+ if (!file.open(QIODevice::ReadOnly))
+ return res;
+ QTextStream in(&file);
+ do {
+ QString line = in.readLine();
+ int idx = line.indexOf(QLS(": "));
+ if (idx > 0)
+ res.insert(line.left(idx), line.mid(idx+2));
+ } while (!in.atEnd());
+ return res;
+}
+
+
+void BaselineHandler::receiveDisconnect()
+{
+ qDebug() << runId << logtime() << "Client disconnected.";
+ report.end();
+ QThread::currentThread()->exit(0);
+}
+
+
+void BaselineHandler::mapPlatformInfo() const
+{
+ mapped = plat;
+
+ // Map hostname
+ QString host = plat.value(PI_HostName).section(QLC('.'), 0, 0); // Filter away domain, if any
+ if (host.isEmpty() || host == QLS("localhost")) {
+ host = plat.value(PI_HostAddress);
+ } else {
+ if (!plat.value(PI_PulseGitBranch).isEmpty()) {
+ // i.e. pulse run, so remove index postfix typical of vm hostnames
+ host.remove(QRegExp(QLS("\\d+$")));
+ if (host.endsWith(QLC('-')))
+ host.chop(1);
+ }
+ }
+ if (host.isEmpty())
+ host = QLS("unknownhost");
+ mapped.insert(PI_HostName, host);
+
+ // Map qmakespec
+ QString mkspec = plat.value(PI_QMakeSpec);
+ mapped.insert(PI_QMakeSpec, mkspec.replace(QLC('/'), QLC('_')));
+
+ // Map Qt version
+ QString ver = plat.value(PI_QtVersion);
+ mapped.insert(PI_QtVersion, ver.prepend(QLS("Qt-")));
+}
+
+QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, bool absolute) const
+{
+ if (mapped.isEmpty())
+ mapPlatformInfo();
+
+ QString itemName = item.itemName.simplified();
+ itemName.replace(QLC(' '), QLC('_'));
+ itemName.replace(QLC('.'), QLC('_'));
+ itemName.append(QLC('_'));
+ itemName.append(QString::number(item.itemChecksum, 16).rightJustified(4, QLC('0')));
+
+ QStringList path;
+ if (absolute)
+ path += BaselineServer::storagePath();
+ path += mapped.value(PI_TestCase);
+ path += QLS(isBaseline ? "baselines" : "mismatches");
+ path += item.testFunction;
+ path += mapped.value(PI_QtVersion);
+ path += mapped.value(PI_QMakeSpec);
+ path += mapped.value(PI_HostName);
+ if (!isBaseline)
+ path += runId;
+ path += itemName + QLC('.');
+
+ return path.join(QLS("/"));
+}
+
+
+QString BaselineHandler::view(const QString &baseline, const QString &rendered, const QString &compared)
+{
+ QFile f(":/templates/view.html");
+ f.open(QIODevice::ReadOnly);
+ return QString::fromLatin1(f.readAll()).arg('/'+baseline, '/'+rendered, '/'+compared);
+}
+
+
+QString BaselineHandler::clearAllBaselines(const QString &context)
+{
+ int tot = 0;
+ int failed = 0;
+ QDirIterator it(BaselineServer::storagePath() + QLC('/') + context,
+ QStringList() << QLS("*.") + QLS(FileFormat) << QLS("*.") + QLS(MetadataFileExt));
+ while (it.hasNext()) {
+ tot++;
+ if (!QFile::remove(it.next()))
+ failed++;
+ }
+ return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context;
+}
+
+QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile)
+{
+ int tot = 0;
+ int failed = 0;
+ QString storagePrefix = BaselineServer::storagePath() + QLC('/');
+ // If itemId is set, update just that one, otherwise, update all:
+ QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile;
+ QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt));
+ while (it.hasNext()) {
+ tot++;
+ it.next();
+ QString oldFile = storagePrefix + context + QLC('/') + it.fileName();
+ QFile::remove(oldFile); // Remove existing baseline file
+ if (!QFile::copy(it.filePath(), oldFile)) // and replace it with the mismatch
+ failed++;
+ }
+ return QString(QLS("%1 of %2 baselines updated in context %3 from context %4")).arg((tot-failed)/2).arg(tot/2).arg(context, mismatchContext);
+}
+
+QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist)
+{
+ QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
+ QStringList blackList;
+ if (file.open(QIODevice::ReadWrite)) {
+ while (!file.atEnd())
+ blackList.append(file.readLine().trimmed());
+
+ if (removeFromBlacklist)
+ blackList.removeAll(itemId);
+ else if (!blackList.contains(itemId))
+ blackList.append(itemId);
+
+ file.resize(0);
+ foreach (QString id, blackList)
+ file.write(id.toLatin1() + '\n');
+ file.close();
+ return QLS(removeFromBlacklist ? "Whitelisted " : "Blacklisted ") + itemId + QLS(" in context ") + context;
+ } else {
+ return QLS("Unable to update blacklisted tests, failed to open ") + file.fileName();
+ }
+}
+
+
+void BaselineHandler::testPathMapping()
+{
+ qDebug() << "Storage prefix:" << BaselineServer::storagePath();
+
+ QStringList hosts;
+ hosts << QLS("bq-ubuntu910-x86-01")
+ << QLS("bq-ubuntu910-x86-15")
+ << QLS("osl-mac-master-5.test.qt.nokia.com")
+ << QLS("osl-mac-master-6.test.qt.nokia.com")
+ << QLS("sv-xp-vs-010")
+ << QLS("sv-xp-vs-011")
+ << QLS("sv-solaris-sparc-008")
+ << QLS("macbuilder-02.test.troll.no")
+ << QLS("bqvm1164")
+ << QLS("chimera")
+ << QLS("localhost")
+ << QLS("");
+
+ ImageItem item;
+ item.testFunction = QLS("testPathMapping");
+ item.itemName = QLS("arcs.qps");
+ item.imageChecksums << 0x0123456789abcdefULL;
+ item.itemChecksum = 0x0123;
+
+ plat.insert(PI_QtVersion, QLS("4.8.0"));
+ plat.insert(PI_BuildKey, QLS("(nobuildkey)"));
+ plat.insert(PI_QMakeSpec, QLS("linux-g++"));
+ plat.insert(PI_PulseGitBranch, QLS("somebranch"));
+ foreach(const QString& host, hosts) {
+ mapped.clear();
+ plat.insert(PI_HostName, host);
+ qDebug() << "Baseline from" << host << "->" << pathForItem(item, true);
+ qDebug() << "Mismatch from" << host << "->" << pathForItem(item, false);
+ }
+}
+
+
+QString BaselineHandler::computeMismatchScore(const QImage &baseline, const QImage &rendered)
+{
+ if (baseline.size() != rendered.size() || baseline.format() != rendered.format())
+ return QLS("[No score, incomparable images.]");
+ if (baseline.depth() != 32)
+ return QLS("[Score computation not implemented for format.]");
+
+ int w = baseline.width();
+ int h = baseline.height();
+
+ uint ncd = 0; // number of differing color pixels
+ uint nad = 0; // number of differing alpha pixels
+ uint scd = 0; // sum of color pixel difference
+ uint sad = 0; // sum of alpha pixel difference
+
+ for (int y=0; y<h; ++y) {
+ const QRgb *bl = (const QRgb *) baseline.constScanLine(y);
+ const QRgb *rl = (const QRgb *) rendered.constScanLine(y);
+ for (int x=0; x<w; ++x) {
+ QRgb b = bl[x];
+ QRgb r = rl[x];
+ if (r != b) {
+ int dr = qAbs(qRed(b) - qRed(r));
+ int dg = qAbs(qGreen(b) - qGreen(r));
+ int db = qAbs(qBlue(b) - qBlue(r));
+ int ds = dr + dg + db;
+ int da = qAbs(qAlpha(b) - qAlpha(r));
+ if (ds) {
+ ncd++;
+ scd += ds;
+ }
+ if (da) {
+ nad++;
+ sad += da;
+ }
+ }
+ }
+ }
+
+ double pcd = 100.0 * ncd / (w*h); // percent of pixels that differ
+ double acd = ncd ? double(scd) / (3*ncd) : 0; // avg. difference
+ QString res = QString(QLS("Diffscore: %1% (Num:%2 Avg:%3)")).arg(pcd, 0, 'g', 2).arg(ncd).arg(acd, 0, 'g', 2);
+ if (baseline.hasAlphaChannel()) {
+ double pad = 100.0 * nad / (w*h); // percent of pixels that differ
+ double aad = nad ? double(sad) / (3*nad) : 0; // avg. difference
+ res += QString(QLS(" Alpha-diffscore: %1% (Num:%2 Avg:%3)")).arg(pad, 0, 'g', 2).arg(nad).arg(aad, 0, 'g', 2);
+ }
+ return res;
+}
diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h
new file mode 100644
index 0000000000..cae490fb0b
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BASELINESERVER_H
+#define BASELINESERVER_H
+
+#include <QStringList>
+#include <QTcpServer>
+#include <QThread>
+#include <QTcpSocket>
+#include <QScopedPointer>
+#include <QTimer>
+#include <QDateTime>
+
+#include "baselineprotocol.h"
+#include "report.h"
+
+// #seconds between update checks
+#define HEARTBEAT 10
+#define MetadataFileExt "metadata"
+
+class BaselineServer : public QTcpServer
+{
+ Q_OBJECT
+
+public:
+ BaselineServer(QObject *parent = 0);
+
+ static QString storagePath();
+ static QString baseUrl();
+
+protected:
+ void incomingConnection(int socketDescriptor);
+
+private slots:
+ void heartbeat();
+
+private:
+ QTimer *heartbeatTimer;
+ QDateTime meLastMod;
+ QString lastRunId;
+ int lastRunIdIdx;
+ static QString storage;
+ static QString url;
+};
+
+
+
+class BaselineThread : public QThread
+{
+ Q_OBJECT
+
+public:
+ BaselineThread(const QString &runId, int socketDescriptor, QObject *parent);
+ void run();
+
+private:
+ QString runId;
+ int socketDescriptor;
+};
+
+
+class BaselineHandler : public QObject
+{
+ Q_OBJECT
+
+public:
+ BaselineHandler(const QString &runId, int socketDescriptor = -1);
+ void testPathMapping();
+ QString pathForItem(const ImageItem &item, bool isBaseline = true, bool absolute = true) const;
+
+ // CGI callbacks:
+ static QString view(const QString &baseline, const QString &rendered, const QString &compared);
+ static QString clearAllBaselines(const QString &context);
+ static QString updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile);
+ static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false);
+
+private slots:
+ void receiveRequest();
+ void receiveDisconnect();
+
+private:
+ bool establishConnection();
+ void provideBaselineChecksums(const QByteArray &itemListBlock);
+ void storeImage(const QByteArray &itemBlock, bool isBaseline);
+ void storeItemMetadata(const PlatformInfo &metadata, const QString &path);
+ PlatformInfo fetchItemMetadata(const QString &path);
+ void mapPlatformInfo() const;
+ const char *logtime();
+ QString computeMismatchScore(const QImage& baseline, const QImage& rendered);
+
+ BaselineProtocol proto;
+ PlatformInfo plat;
+ mutable PlatformInfo mapped;
+ QString runId;
+ bool connectionEstablished;
+ Report report;
+};
+
+#endif // BASELINESERVER_H
diff --git a/tests/arthur/baselineserver/src/baselineserver.pro b/tests/arthur/baselineserver/src/baselineserver.pro
new file mode 100644
index 0000000000..770662b5fd
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.pro
@@ -0,0 +1,30 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-11T11:51:09
+#
+#-------------------------------------------------
+
+QT += core network
+
+# gui needed for QImage
+# QT -= gui
+
+TARGET = baselineserver
+DESTDIR = ../bin
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+include(../../common/baselineprotocol.pri)
+
+SOURCES += main.cpp \
+ baselineserver.cpp \
+ report.cpp
+
+HEADERS += \
+ baselineserver.h \
+ report.h
+
+RESOURCES += \
+ baselineserver.qrc
diff --git a/tests/arthur/baselineserver/src/baselineserver.qrc b/tests/arthur/baselineserver/src/baselineserver.qrc
new file mode 100644
index 0000000000..b5cd6afadb
--- /dev/null
+++ b/tests/arthur/baselineserver/src/baselineserver.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>templates/view.html</file>
+ </qresource>
+</RCC>
diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp
new file mode 100644
index 0000000000..3a03b2f01d
--- /dev/null
+++ b/tests/arthur/baselineserver/src/main.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore/QCoreApplication>
+#include "baselineserver.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QString queryString(qgetenv("QUERY_STRING"));
+ if (!queryString.isEmpty()) {
+ // run as CGI script
+ Report::handleCGIQuery(queryString);
+ return 0;
+ }
+
+ if (a.arguments().contains(QLatin1String("-testmapping"))) {
+ BaselineHandler h(QLS("SomeRunId"));
+ h.testPathMapping();
+ return 0;
+ }
+
+ BaselineServer server;
+ if (!server.listen(QHostAddress::Any, BaselineProtocol::ServerPort)) {
+ qWarning("Failed to listen!");
+ return 1;
+ }
+
+ qDebug() << "\n*****" << argv[0] << "started, ready to serve on port" << BaselineProtocol::ServerPort
+ << "with baseline protocol version" << BaselineProtocol::ProtocolVersion << "*****\n";
+ return a.exec();
+}
diff --git a/tests/arthur/baselineserver/src/report.cpp b/tests/arthur/baselineserver/src/report.cpp
new file mode 100644
index 0000000000..5854706447
--- /dev/null
+++ b/tests/arthur/baselineserver/src/report.cpp
@@ -0,0 +1,311 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "report.h"
+#include "baselineprotocol.h"
+#include "baselineserver.h"
+#include <QDir>
+#include <QProcess>
+#include <QUrl>
+
+Report::Report()
+ : written(false), numItems(0), numMismatches(0)
+{
+}
+
+Report::~Report()
+{
+ end();
+}
+
+QString Report::filePath()
+{
+ return path;
+}
+
+void Report::init(const BaselineHandler *h, const QString &r, const PlatformInfo &p)
+{
+ handler = h;
+ runId = r;
+ plat = p;
+ rootDir = BaselineServer::storagePath() + QLC('/');
+ reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/"));
+ QString dir = rootDir + reportDir;
+ QDir cwd;
+ if (!cwd.exists(dir))
+ cwd.mkpath(dir);
+ path = reportDir + QLS("Report_") + runId + QLS(".html");
+}
+
+void Report::addItems(const ImageItemList &items)
+{
+ if (items.isEmpty())
+ return;
+ numItems += items.size();
+ QString func = items.at(0).testFunction;
+ if (!testFunctions.contains(func))
+ testFunctions.append(func);
+ itemLists[func] += items;
+}
+
+void Report::addMismatch(const ImageItem &item)
+{
+ if (!testFunctions.contains(item.testFunction)) {
+ qWarning() << "Report::addMismatch: unknown testfunction" << item.testFunction;
+ return;
+ }
+ bool found = false;
+ ImageItemList &list = itemLists[item.testFunction];
+ for (ImageItemList::iterator it = list.begin(); it != list.end(); ++it) {
+ if (it->itemName == item.itemName && it->itemChecksum == item.itemChecksum) {
+ it->status = ImageItem::Mismatch;
+ found = true;
+ break;
+ }
+ }
+ if (found)
+ numMismatches++;
+ else
+ qWarning() << "Report::addMismatch: unknown item" << item.itemName << "in testfunction" << item.testFunction;
+}
+
+void Report::end()
+{
+ if (written || !numMismatches)
+ return;
+ write();
+ written = true;
+}
+
+
+void Report::write()
+{
+ QFile file(rootDir + path);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ qWarning() << "Failed to open report file" << file.fileName();
+ return;
+ }
+ out.setDevice(&file);
+
+ writeHeader();
+ foreach(const QString &func, testFunctions) {
+ writeFunctionResults(itemLists.value(func));
+ }
+ writeFooter();
+ file.close();
+}
+
+
+void Report::writeHeader()
+{
+ QString title = plat.value(PI_TestCase) + QLS(" Qt Baseline Test Report");
+ out << "<head><title>" << title << "</title></head>\n"
+ << "<html><body><h1>" << title << "</h1>\n"
+ << "<p>Note: This is a <i>static</i> page, generated at " << QDateTime::currentDateTime().toString()
+ << " for the test run with id " << runId << "</p>\n"
+ << "<p>Summary: <b><span style=\"color:red\">" << numMismatches << " of " << numItems << "</b></span> items reported mismatching</p>\n\n";
+ out << "<h3>Platform Info:</h3>\n"
+ << "<table>\n";
+ foreach (QString key, plat.keys())
+ out << "<tr><td>" << key << "</td><td>" << plat.value(key) << "</td></tr>\n";
+ out << "</table>\n\n";
+}
+
+
+void Report::writeFunctionResults(const ImageItemList &list)
+{
+ QString testFunction = list.at(0).testFunction;
+ QString pageUrl = BaselineServer::baseUrl() + path;
+ QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2);
+ QString misCtx = handler->pathForItem(list.at(0), false, false).section(QLC('/'), 0, -2);
+
+
+ out << "\n<p>&nbsp;</p><h3>Test function: " << testFunction << "</h3>\n";
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=clearAllBaselines&context=" << ctx << "&url=" << pageUrl
+ << "\"><b>Clear all baselines</b></a> for this testfunction (They will be recreated by the next run)</p>\n";
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&context=" << ctx << "&mismatchContext=" << misCtx << "&url=" << pageUrl
+ << "\"><b>Let these mismatching images be the new baselines</b></a> for this testfunction</p>\n\n";
+
+ out << "<table border=\"2\">\n"
+ "<tr>\n"
+ "<th width=123>Item</th>\n"
+ "<th width=246>Baseline</th>\n"
+ "<th width=246>Rendered</th>\n"
+ "<th width=246>Comparison (diffs are <span style=\"color:red\">RED</span>)</th>\n"
+ "<th width=246>Info/Action</th>\n"
+ "</tr>\n\n";
+
+ foreach (const ImageItem &item, list) {
+ out << "<tr>\n";
+ out << "<td>" << item.itemName << "</td>\n";
+ QString prefix = handler->pathForItem(item, true, false);
+ QString baseline = prefix + QLS(FileFormat);
+ QString metadata = prefix + QLS(MetadataFileExt);
+ if (item.status == ImageItem::Mismatch) {
+ QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat);
+ QString itemFile = prefix.section(QLC('/'), -1);
+ writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata);
+ }
+ else {
+ out << "<td align=center><a href=\"/" << baseline << "\">image</a> <a href=\"/" << metadata << "\">info</a></td>\n"
+ << "<td align=center colspan=2><small>n/a</small></td>\n"
+ << "<td align=center>";
+ switch (item.status) {
+ case ImageItem::BaselineNotFound:
+ out << "Baseline not found/regenerated";
+ break;
+ case ImageItem::IgnoreItem:
+ out << "<span style=\"background-color:yellow\">Blacklisted</span> "
+ << "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl
+ << "\">Whitelist this item</a>";
+ break;
+ case ImageItem::Ok:
+ out << "<span style=\"color:green\"><small>No mismatch reported</small></span>";
+ break;
+ default:
+ out << "?";
+ break;
+ }
+ out << "</td>\n";
+ }
+ out << "</tr>\n\n";
+ }
+
+ out << "</table>\n";
+}
+
+void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata)
+{
+ QString compared = generateCompared(baseline, rendered);
+ QString pageUrl = BaselineServer::baseUrl() + path;
+
+ QStringList images = QStringList() << baseline << rendered << compared;
+ foreach (const QString& img, images)
+ out << "<td height=246 align=center><a href=\"/" << img << "\"><img src=\"/" << generateThumbnail(img) << "\"></a></td>\n";
+
+ out << "<td align=center>\n"
+ << "<p><span style=\"color:red\">Mismatch reported</span></p>\n"
+ << "<p><a href=\"/" << metadata << "\">Baseline Info</a>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&context=" << ctx << "&mismatchContext=" << misCtx
+ << "&itemFile=" << itemFile << "&url=" << pageUrl << "\">Let this be the new baseline</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered
+ << "&compared=" << compared << "&url=" << pageUrl << "\">Inspect</a></p>\n"
+ << "</td>\n";
+}
+
+void Report::writeFooter()
+{
+ out << "\n</body></html>\n";
+}
+
+
+QString Report::generateCompared(const QString &baseline, const QString &rendered, bool fuzzy)
+{
+ QString res = rendered;
+ QFileInfo fi(res);
+ res.chop(fi.suffix().length() + 1);
+ res += QLS(fuzzy ? "_fuzzycompared.png" : "_compared.png");
+ QStringList args;
+ if (fuzzy)
+ args << QLS("-fuzz") << QLS("5%");
+ args << rootDir+baseline << rootDir+rendered << rootDir+res;
+ QProcess::execute(QLS("compare"), args);
+ return res;
+}
+
+
+QString Report::generateThumbnail(const QString &image)
+{
+ QString res = image;
+ QFileInfo imgFI(rootDir+image);
+ res.chop(imgFI.suffix().length() + 1);
+ res += QLS("_thumbnail.jpg");
+ QFileInfo resFI(rootDir+res);
+ if (resFI.exists() && resFI.lastModified() > imgFI.lastModified())
+ return res;
+ QStringList args;
+ args << rootDir+image << QLS("-resize") << QLS("240x240>") << QLS("-quality") << QLS("50") << rootDir+res;
+ QProcess::execute(QLS("convert"), args);
+ return res;
+}
+
+
+void Report::handleCGIQuery(const QString &query)
+{
+ QUrl cgiUrl(QLS("http://dummy/cgi-bin/dummy.cgi?") + query);
+ QTextStream s(stdout);
+ s << "Content-Type: text/html\r\n\r\n"
+ << "<HTML>";
+
+ QString command(cgiUrl.queryItemValue("cmd"));
+
+ if (command == QLS("view")) {
+ s << BaselineHandler::view(cgiUrl.queryItemValue(QLS("baseline")),
+ cgiUrl.queryItemValue(QLS("rendered")),
+ cgiUrl.queryItemValue(QLS("compared")));
+ }
+ else if (command == QLS("updateSingleBaseline")) {
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ cgiUrl.queryItemValue(QLS("itemFile")));
+ } else if (command == QLS("updateAllBaselines")) {
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ QString());
+ } else if (command == QLS("clearAllBaselines")) {
+ s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context")));
+ } else if (command == QLS("blacklist")) {
+ // blacklist a test
+ s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("itemId")));
+ } else if (command == QLS("whitelist")) {
+ // whitelist a test
+ s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("itemId")), true);
+ } else {
+ s << "Unknown query:<br>" << query << "<br>";
+ }
+ s << "<p><a href=\"" << cgiUrl.queryItemValue(QLS("url")) << "\">Back to report</a>";
+ s << "</HTML>";
+}
diff --git a/tests/arthur/baselineserver/src/report.h b/tests/arthur/baselineserver/src/report.h
new file mode 100644
index 0000000000..d549a72af3
--- /dev/null
+++ b/tests/arthur/baselineserver/src/report.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef REPORT_H
+#define REPORT_H
+
+#include "baselineprotocol.h"
+#include <QFile>
+#include <QTextStream>
+#include <QMap>
+#include <QStringList>
+
+class BaselineHandler;
+
+class Report
+{
+public:
+ Report();
+ ~Report();
+
+ void init(const BaselineHandler *h, const QString &r, const PlatformInfo &p);
+ void addItems(const ImageItemList& items);
+ void addMismatch(const ImageItem& item);
+ void end();
+
+ QString filePath();
+
+ static void handleCGIQuery(const QString &query);
+
+private:
+ void write();
+ void writeFunctionResults(const ImageItemList &list);
+ void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata);
+ void writeHeader();
+ void writeFooter();
+ QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false);
+ QString generateThumbnail(const QString &image);
+
+ const BaselineHandler *handler;
+ QString runId;
+ PlatformInfo plat;
+ QString rootDir;
+ QString reportDir;
+ QString path;
+ QStringList testFunctions;
+ QMap<QString, ImageItemList> itemLists;
+ bool written;
+ int numItems;
+ int numMismatches;
+ QTextStream out;
+};
+
+#endif // REPORT_H
diff --git a/tests/arthur/baselineserver/src/templates/view.html b/tests/arthur/baselineserver/src/templates/view.html
new file mode 100644
index 0000000000..c048f4781c
--- /dev/null
+++ b/tests/arthur/baselineserver/src/templates/view.html
@@ -0,0 +1,79 @@
+<h3>Lancelot Viewer</h3>
+
+<p>
+Zoom:
+<input name="zoom" id="z1" type="radio" checked="Checked">1x</input>
+<input name="zoom" id="z2" type="radio">2x</input>
+<input name="zoom" id="z4" type="radio">4x</input>
+</p>
+
+<p><table>
+<tr>
+<td><input name="imgselect" id="baseline" type="radio" checked="Checked">Baseline</input></td>
+<td>%1</td>
+</tr>
+<tr>
+<td><input name="imgselect" id="rendered" type="radio">Rendered</input></td>
+<td>%2</td>
+</tr>
+<tr>
+<td><input name="imgselect" id="compared" type="radio">Differences</input></td>
+<td></td>
+</tr>
+</table></p>
+
+
+<p>
+<canvas id="c" width="800" height="800"></canvas>
+</p>
+
+<script>
+ var canvas = document.getElementById("c");
+ var context = canvas.getContext("2d");
+ var cat = new Image();
+ cat.src = "%1";
+ var z = 1;
+ cat.onload = function() {
+ context.mozImageSmoothingEnabled = false;
+ context.drawImage(cat, 0, 0, z*cat.width, z*cat.height);
+ };
+
+ var bbut = document.getElementById("baseline");
+ bbut.onclick = function() {
+ cat.src = "%1";
+ };
+
+ var rbut = document.getElementById("rendered");
+ rbut.onclick = function() {
+ cat.src = "%2";
+ };
+
+ var cbut = document.getElementById("compared");
+ cbut.onclick = function() {
+ cat.src = "%3";
+ };
+
+ function setZoom(zoom)
+ {
+ z = zoom;
+ canvas.width = z*800;
+ canvas.height = z*800;
+ context.mozImageSmoothingEnabled = false;
+ context.drawImage(cat, 0, 0, z*cat.width, z*cat.height);
+ }
+
+ var z1but = document.getElementById("z1");
+ z1but.onclick = function() {
+ setZoom(1);
+ };
+
+ var z2but = document.getElementById("z2");
+ z2but.onclick = function() {
+ setZoom(2);
+ };
+
+ var z4but = document.getElementById("z4");
+ z4but.onclick = function() {
+ setZoom(4);
+ };
+</script>
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
new file mode 100644
index 0000000000..88cea362ee
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -0,0 +1,525 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "baselineprotocol.h"
+#include <QLibraryInfo>
+#include <QImage>
+#include <QBuffer>
+#include <QHostInfo>
+#include <QSysInfo>
+#include <QProcess>
+#include <QFileInfo>
+#include <QDir>
+#include <QTime>
+#include <QPointer>
+
+const QString PI_TestCase(QLS("TestCase"));
+const QString PI_HostName(QLS("HostName"));
+const QString PI_HostAddress(QLS("HostAddress"));
+const QString PI_OSName(QLS("OSName"));
+const QString PI_OSVersion(QLS("OSVersion"));
+const QString PI_QtVersion(QLS("QtVersion"));
+const QString PI_BuildKey(QLS("BuildKey"));
+const QString PI_GitCommit(QLS("GitCommit"));
+const QString PI_QMakeSpec(QLS("QMakeSpec"));
+const QString PI_PulseGitBranch(QLS("PulseGitBranch"));
+const QString PI_PulseTestrBranch(QLS("PulseTestrBranch"));
+
+#ifndef QMAKESPEC
+#define QMAKESPEC "Unknown"
+#endif
+
+#if defined(Q_OS_WIN)
+#include <QtCore/qt_windows.h>
+#endif
+#if defined(Q_OS_UNIX)
+#include <time.h>
+#endif
+void BaselineProtocol::sysSleep(int ms)
+{
+#if defined(Q_OS_WIN)
+ Sleep(DWORD(ms));
+#else
+ struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
+ nanosleep(&ts, NULL);
+#endif
+}
+
+PlatformInfo::PlatformInfo()
+ : QMap<QString, QString>(), replaceDefault(false)
+{
+}
+
+PlatformInfo PlatformInfo::localHostInfo()
+{
+ PlatformInfo pi;
+ pi.insert(PI_HostName, QHostInfo::localHostName());
+ pi.insert(PI_QtVersion, QLS(qVersion()));
+ pi.insert(PI_QMakeSpec, QString(QLS(QMAKESPEC)).remove(QRegExp(QLS("^.*mkspecs/"))));
+ pi.insert(PI_BuildKey, QLibraryInfo::buildKey());
+#if defined(Q_OS_LINUX)
+ pi.insert(PI_OSName, QLS("Linux"));
+ QProcess uname;
+ uname.start(QLS("uname"), QStringList() << QLS("-r"));
+ if (uname.waitForFinished(3000))
+ pi.insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified());
+#elif defined(Q_OS_WINCE)
+ pi.insert(PI_OSName, QLS("WinCE"));
+ pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
+#elif defined(Q_OS_WIN)
+ pi.insert(PI_OSName, QLS("Windows"));
+ pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
+#elif defined(Q_OS_MAC)
+ pi.insert(PI_OSName, QLS("MacOS"));
+ pi.insert(PI_OSVersion, QString::number(qMacVersion()));
+#elif defined(Q_OS_SYMBIAN)
+ pi.insert(PI_OSName, QLS("Symbian"));
+ pi.insert(PI_OSVersion, QString::number(QSysInfo::symbianVersion());
+#else
+ pi.insert(PI_OSName, QLS("Other"));
+#endif
+
+ QProcess git;
+ QString cmd;
+ QStringList args;
+#if defined(Q_OS_WIN)
+ cmd = QLS("cmd.exe");
+ args << QLS("/c") << QLS("git");
+#else
+ cmd = QLS("git");
+#endif
+ args << QLS("log") << QLS("--max-count=1") << QLS("--pretty=%H [%an] [%ad] %s");
+ git.start(cmd, args);
+ git.waitForFinished(3000);
+ if (!git.exitCode())
+ pi.insert(PI_GitCommit, QString::fromLocal8Bit(git.readAllStandardOutput().constData()).simplified());
+ else
+ pi.insert(PI_GitCommit, QLS("Unknown"));
+
+ QByteArray gb = qgetenv("PULSE_GIT_BRANCH");
+ if (!gb.isEmpty())
+ pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb));
+ QByteArray tb = qgetenv("PULSE_TESTR_BRANCH");
+ if (!tb.isEmpty())
+ pi.insert(PI_PulseTestrBranch, QString::fromLatin1(tb));
+
+ return pi;
+}
+
+
+PlatformInfo::PlatformInfo(const PlatformInfo &other)
+ : QMap<QString, QString>(other)
+{
+ sigKeys = other.sigKeys;
+ replaceDefault = other.replaceDefault;
+}
+
+
+PlatformInfo &PlatformInfo::operator=(const PlatformInfo &other)
+{
+ QMap<QString, QString>::operator=(other);
+ sigKeys = other.sigKeys;
+ replaceDefault = other.replaceDefault;
+ return *this;
+}
+
+
+void PlatformInfo::addSignificantKeys(const QStringList &keys, bool replaceDefaultKeys)
+{
+ sigKeys = keys;
+ replaceDefault = replaceDefaultKeys;
+}
+
+
+QStringList PlatformInfo::addedKeys() const
+{
+ return sigKeys;
+}
+
+
+bool PlatformInfo::addedKeysReplaceDefault() const
+{
+ return replaceDefault;
+}
+
+
+QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi)
+{
+ stream << static_cast<const QMap<QString, QString>&>(pi);
+ stream << pi.sigKeys << pi.replaceDefault;
+ return stream;
+}
+
+
+QDataStream & operator>> (QDataStream &stream, PlatformInfo &pi)
+{
+ stream >> static_cast<QMap<QString, QString>&>(pi);
+ stream >> pi.sigKeys >> pi.replaceDefault;
+ return stream;
+}
+
+
+ImageItem &ImageItem::operator=(const ImageItem &other)
+{
+ testFunction = other.testFunction;
+ itemName = other.itemName;
+ itemChecksum = other.itemChecksum;
+ status = other.status;
+ image = other.image;
+ imageChecksums = other.imageChecksums;
+ return *this;
+}
+
+// Defined in lookup3.c:
+void hashword2 (
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 *pc, /* IN: seed OUT: primary hash value */
+quint32 *pb); /* IN: more seed OUT: secondary hash value */
+
+quint64 ImageItem::computeChecksum(const QImage &image)
+{
+ QImage img(image);
+ const int bpl = img.bytesPerLine();
+ const int padBytes = bpl - (img.width() * img.depth() / 8);
+ if (padBytes) {
+ uchar *p = img.bits() + bpl - padBytes;
+ const int h = img.height();
+ for (int y = 0; y < h; ++y) {
+ qMemSet(p, 0, padBytes);
+ p += bpl;
+ }
+ }
+
+ quint32 h1 = 0xfeedbacc;
+ quint32 h2 = 0x21604894;
+ hashword2((const quint32 *)img.constBits(), img.byteCount()/4, &h1, &h2);
+ return (quint64(h1) << 32) | h2;
+}
+
+#if 0
+QString ImageItem::engineAsString() const
+{
+ switch (engine) {
+ case Raster:
+ return QLS("Raster");
+ break;
+ case OpenGL:
+ return QLS("OpenGL");
+ break;
+ default:
+ break;
+ }
+ return QLS("Unknown");
+}
+
+QString ImageItem::formatAsString() const
+{
+ static const int numFormats = 16;
+ static const char *formatNames[numFormats] = {
+ "Invalid",
+ "Mono",
+ "MonoLSB",
+ "Indexed8",
+ "RGB32",
+ "ARGB32",
+ "ARGB32-Premult",
+ "RGB16",
+ "ARGB8565-Premult",
+ "RGB666",
+ "ARGB6666-Premult",
+ "RGB555",
+ "ARGB8555-Premult",
+ "RGB888",
+ "RGB444",
+ "ARGB4444-Premult"
+ };
+ if (renderFormat < 0 || renderFormat >= numFormats)
+ return QLS("UnknownFormat");
+ return QLS(formatNames[renderFormat]);
+}
+#endif
+
+void ImageItem::writeImageToStream(QDataStream &out) const
+{
+ if (image.isNull() || image.format() == QImage::Format_Invalid) {
+ out << quint8(0);
+ return;
+ }
+ out << quint8('Q') << quint8(image.format());
+ out << quint8(QSysInfo::ByteOrder) << quint8(0); // pad to multiple of 4 bytes
+ out << quint32(image.width()) << quint32(image.height()) << quint32(image.bytesPerLine());
+ out << qCompress((const uchar *)image.constBits(), image.byteCount());
+ //# can be followed by colormap for formats that use it
+}
+
+void ImageItem::readImageFromStream(QDataStream &in)
+{
+ quint8 hdr, fmt, endian, pad;
+ quint32 width, height, bpl;
+ QByteArray data;
+
+ in >> hdr;
+ if (hdr != 'Q') {
+ image = QImage();
+ return;
+ }
+ in >> fmt >> endian >> pad;
+ if (!fmt || fmt >= QImage::NImageFormats) {
+ image = QImage();
+ return;
+ }
+ if (endian != QSysInfo::ByteOrder) {
+ qWarning("ImageItem cannot read streamed image with different endianness");
+ image = QImage();
+ return;
+ }
+ in >> width >> height >> bpl;
+ in >> data;
+ data = qUncompress(data);
+ QImage res((const uchar *)data.constData(), width, height, bpl, QImage::Format(fmt));
+ image = res.copy(); //# yuck, seems there is currently no way to avoid data copy
+}
+
+QDataStream & operator<< (QDataStream &stream, const ImageItem &ii)
+{
+ stream << ii.testFunction << ii.itemName << ii.itemChecksum << quint8(ii.status) << ii.imageChecksums << ii.misc;
+ ii.writeImageToStream(stream);
+ return stream;
+}
+
+QDataStream & operator>> (QDataStream &stream, ImageItem &ii)
+{
+ quint8 encStatus;
+ stream >> ii.testFunction >> ii.itemName >> ii.itemChecksum >> encStatus >> ii.imageChecksums >> ii.misc;
+ ii.status = ImageItem::ItemStatus(encStatus);
+ ii.readImageFromStream(stream);
+ return stream;
+}
+
+BaselineProtocol::BaselineProtocol()
+{
+}
+
+BaselineProtocol::~BaselineProtocol()
+{
+ socket.close();
+ if (socket.state() != QTcpSocket::UnconnectedState)
+ socket.waitForDisconnected(Timeout);
+}
+
+
+bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
+{
+ errMsg.clear();
+ QByteArray serverName(qgetenv("QT_LANCELOT_SERVER"));
+ if (serverName.isNull())
+ serverName = "lancelot.test.qt.nokia.com";
+
+ socket.connectToHost(serverName, ServerPort);
+ if (!socket.waitForConnected(Timeout)) {
+ sysSleep(Timeout); // Wait a bit and try again, the server might just be restarting
+ if (!socket.waitForConnected(Timeout)) {
+ errMsg += QLS("TCP connectToHost failed. Host:") + serverName + QLS(" port:") + QString::number(ServerPort);
+ return false;
+ }
+ }
+
+ PlatformInfo pi = PlatformInfo::localHostInfo();
+ pi.insert(PI_TestCase, testCase);
+ QByteArray block;
+ QDataStream ds(&block, QIODevice::ReadWrite);
+ ds << pi;
+ if (!sendBlock(AcceptPlatformInfo, block)) {
+ errMsg += QLS("Failed to send data to server.");
+ return false;
+ }
+
+ Command cmd = UnknownError;
+ if (!receiveBlock(&cmd, &block)) {
+ errMsg += QLS("Failed to get response from server.");
+ return false;
+ }
+
+ if (cmd == Abort) {
+ errMsg += QLS("Server rejected connection. Reason: ") + QString::fromLatin1(block);
+ return false;
+ }
+
+ if (dryrun)
+ *dryrun = (cmd == DoDryRun);
+
+ if (cmd != Ack && cmd != DoDryRun) {
+ errMsg += QLS("Unexpected response from server.");
+ return false;
+ }
+
+ return true;
+}
+
+
+bool BaselineProtocol::acceptConnection(PlatformInfo *pi)
+{
+ errMsg.clear();
+
+ QByteArray block;
+ Command cmd = AcceptPlatformInfo;
+ if (!receiveBlock(&cmd, &block) || cmd != AcceptPlatformInfo)
+ return false;
+
+ if (pi) {
+ QDataStream ds(block);
+ ds >> *pi;
+ pi->insert(PI_HostAddress, socket.peerAddress().toString());
+ }
+
+ return true;
+}
+
+
+bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList)
+{
+ errMsg.clear();
+ if (!itemList)
+ return false;
+
+ for(ImageItemList::iterator it = itemList->begin(); it != itemList->end(); it++)
+ it->testFunction = testFunction;
+
+ QByteArray block;
+ QDataStream ds(&block, QIODevice::ReadWrite);
+ ds << *itemList;
+ if (!sendBlock(RequestBaselineChecksums, block))
+ return false;
+ Command cmd;
+ if (!receiveBlock(&cmd, &block))
+ return false;
+ ds.device()->seek(0);
+ ds >> *itemList;
+ return true;
+}
+
+
+bool BaselineProtocol::submitNewBaseline(const ImageItem &item, QByteArray *serverMsg)
+{
+ Command cmd;
+ return (sendItem(AcceptNewBaseline, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack);
+}
+
+
+bool BaselineProtocol::submitMismatch(const ImageItem &item, QByteArray *serverMsg)
+{
+ Command cmd;
+ return (sendItem(AcceptMismatch, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack);
+}
+
+
+bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item)
+{
+ errMsg.clear();
+ QBuffer buf;
+ buf.open(QIODevice::WriteOnly);
+ QDataStream ds(&buf);
+ ds << item;
+ if (!sendBlock(cmd, buf.data())) {
+ errMsg.prepend(QLS("Failed to submit image to server. "));
+ return false;
+ }
+ return true;
+}
+
+
+bool BaselineProtocol::sendBlock(Command cmd, const QByteArray &block)
+{
+ QDataStream s(&socket);
+ // TBD: set qds version as a constant
+ s << quint16(ProtocolVersion) << quint16(cmd);
+ s.writeBytes(block.constData(), block.size());
+ return true;
+}
+
+
+bool BaselineProtocol::receiveBlock(Command *cmd, QByteArray *block)
+{
+ while (socket.bytesAvailable() < int(2*sizeof(quint16) + sizeof(quint32))) {
+ if (!socket.waitForReadyRead(Timeout))
+ return false;
+ }
+ QDataStream ds(&socket);
+ quint16 rcvProtocolVersion, rcvCmd;
+ ds >> rcvProtocolVersion >> rcvCmd;
+ if (rcvProtocolVersion != ProtocolVersion) {
+ errMsg = QLS("Baseline protocol version mismatch, received:") + QString::number(rcvProtocolVersion)
+ + QLS(" expected:") + QString::number(ProtocolVersion);
+ return false;
+ }
+ if (cmd)
+ *cmd = Command(rcvCmd);
+
+ QByteArray uMsg;
+ quint32 remaining;
+ ds >> remaining;
+ uMsg.resize(remaining);
+ int got = 0;
+ char* uMsgBuf = uMsg.data();
+ do {
+ got = ds.readRawData(uMsgBuf, remaining);
+ remaining -= got;
+ uMsgBuf += got;
+ } while (remaining && got >= 0 && socket.waitForReadyRead(Timeout));
+
+ if (got < 0)
+ return false;
+
+ if (block)
+ *block = uMsg;
+
+ return true;
+}
+
+
+QString BaselineProtocol::errorMessage()
+{
+ QString ret = errMsg;
+ if (socket.error() >= 0)
+ ret += QLS(" Socket state: ") + socket.errorString();
+ return ret;
+}
+
diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h
new file mode 100644
index 0000000000..8a99ace6ee
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.h
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BASELINEPROTOCOL_H
+#define BASELINEPROTOCOL_H
+
+#include <QDataStream>
+#include <QTcpSocket>
+#include <QImage>
+#include <QVector>
+#include <QMap>
+#include <QPointer>
+#include <QStringList>
+
+#define QLS QLatin1String
+#define QLC QLatin1Char
+
+#define FileFormat "png"
+
+extern const QString PI_TestCase;
+extern const QString PI_HostName;
+extern const QString PI_HostAddress;
+extern const QString PI_OSName;
+extern const QString PI_OSVersion;
+extern const QString PI_QtVersion;
+extern const QString PI_BuildKey;
+extern const QString PI_GitCommit;
+extern const QString PI_QMakeSpec;
+extern const QString PI_PulseGitBranch;
+extern const QString PI_PulseTestrBranch;
+
+class PlatformInfo : public QMap<QString, QString>
+{
+public:
+ PlatformInfo();
+ PlatformInfo(const PlatformInfo &other);
+ ~PlatformInfo()
+ {}
+ PlatformInfo &operator=(const PlatformInfo &other);
+
+ static PlatformInfo localHostInfo();
+
+ void addSignificantKeys(const QStringList& keys, bool replaceDefaultKeys=false);
+ QStringList addedKeys() const;
+ bool addedKeysReplaceDefault() const;
+
+private:
+ QStringList sigKeys;
+ bool replaceDefault;
+ friend QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi);
+ friend QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi);
+};
+QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi);
+QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi);
+
+
+struct ImageItem
+{
+public:
+ ImageItem()
+ : status(Ok), itemChecksum(0)
+ {}
+ ImageItem(const ImageItem &other)
+ { *this = other; }
+ ~ImageItem()
+ {}
+ ImageItem &operator=(const ImageItem &other);
+
+ static quint64 computeChecksum(const QImage& image);
+
+ enum ItemStatus {
+ Ok = 0,
+ BaselineNotFound = 1,
+ IgnoreItem = 2,
+ Mismatch = 3
+ };
+
+ QString testFunction;
+ QString itemName;
+ ItemStatus status;
+ QImage image;
+ QList<quint64> imageChecksums;
+ quint16 itemChecksum;
+ QByteArray misc;
+
+ void writeImageToStream(QDataStream &stream) const;
+ void readImageFromStream(QDataStream &stream);
+};
+QDataStream & operator<< (QDataStream &stream, const ImageItem &ii);
+QDataStream & operator>> (QDataStream &stream, ImageItem& ii);
+
+Q_DECLARE_METATYPE(ImageItem);
+
+typedef QVector<ImageItem> ImageItemList;
+
+
+class BaselineProtocol
+{
+public:
+ BaselineProtocol();
+ ~BaselineProtocol();
+
+ static BaselineProtocol *instance(QObject *parent = 0);
+
+ // ****************************************************
+ // Important constants here
+ // ****************************************************
+ enum Constant {
+ ProtocolVersion = 5,
+ ServerPort = 54129,
+ Timeout = 5000
+ };
+
+ enum Command {
+ UnknownError = 0,
+ // Queries
+ AcceptPlatformInfo = 1,
+ RequestBaselineChecksums = 2,
+ AcceptNewBaseline = 4,
+ AcceptMismatch = 5,
+ // Responses
+ Ack = 128,
+ Abort = 129,
+ DoDryRun = 130
+ };
+
+ // For client:
+
+ // For advanced client:
+ bool connect(const QString &testCase, bool *dryrun = 0);
+ bool requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList);
+ bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg);
+ bool submitMismatch(const ImageItem &item, QByteArray *serverMsg);
+
+ // For server:
+ bool acceptConnection(PlatformInfo *pi);
+
+ QString errorMessage();
+
+private:
+ bool sendItem(Command cmd, const ImageItem &item);
+
+ bool sendBlock(Command cmd, const QByteArray &block);
+ bool receiveBlock(Command *cmd, QByteArray *block);
+ void sysSleep(int ms);
+
+ QString errMsg;
+ QTcpSocket socket;
+
+ friend class BaselineThread;
+ friend class BaselineHandler;
+};
+
+
+#endif // BASELINEPROTOCOL_H
diff --git a/tests/arthur/common/baselineprotocol.pri b/tests/arthur/common/baselineprotocol.pri
new file mode 100644
index 0000000000..62e38a6ab5
--- /dev/null
+++ b/tests/arthur/common/baselineprotocol.pri
@@ -0,0 +1,11 @@
+INCLUDEPATH += $$PWD
+DEPENDPATH += $$PWD
+
+QT *= network
+
+SOURCES += \
+ $$PWD/baselineprotocol.cpp \
+ $$PWD/lookup3.cpp
+
+HEADERS += \
+ $$PWD/baselineprotocol.h
diff --git a/tests/arthur/common/common.pri b/tests/arthur/common/common.pri
new file mode 100644
index 0000000000..1f84904474
--- /dev/null
+++ b/tests/arthur/common/common.pri
@@ -0,0 +1,18 @@
+VPATH+=$$PWD
+INCLUDEPATH += $$PWD
+
+contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):DEFINES += BUILD_OPENGL
+
+SOURCES += \
+ xmldata.cpp \
+ paintcommands.cpp \
+ qengines.cpp \
+ framework.cpp
+
+HEADERS += \
+ xmldata.h \
+ paintcommands.h \
+ qengines.h \
+ framework.h
+
+RESOURCES += images.qrc
diff --git a/tests/arthur/common/common.pro b/tests/arthur/common/common.pro
new file mode 100644
index 0000000000..9510f87f06
--- /dev/null
+++ b/tests/arthur/common/common.pro
@@ -0,0 +1,20 @@
+# -*- Mode: makefile -*-
+#
+# not used as a library all binaries include common.pri anyway
+#
+#COMMON_FOLDER = ../common
+#include(../arthurtester.pri)
+#TEMPLATE = lib
+#CONFIG += static
+#QT += xml opengl svg qt3support
+
+#build_all:!build_pass {
+# CONFIG -= build_all
+# CONFIG += release
+#}
+
+#TARGET = testcommon
+
+#include(common.pri)
+
+
diff --git a/tests/arthur/common/framework.cpp b/tests/arthur/common/framework.cpp
new file mode 100644
index 0000000000..1271e59cde
--- /dev/null
+++ b/tests/arthur/common/framework.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "framework.h"
+
+#include <QFile>
+#include <QFileInfo>
+#include <QSettings>
+#include <QStringList>
+#include <QtDebug>
+
+Framework::Framework()
+ : qsettings(0)
+{
+}
+
+Framework::Framework(const QString &file)
+ : qsettings(0)
+{
+ load(file);
+}
+
+Framework::~Framework()
+{
+ delete qsettings;
+ qsettings = 0;
+}
+
+QString Framework::basePath() const
+{
+ if (!qsettings)
+ return QString();
+
+ QFileInfo fi(qsettings->fileName());
+ return fi.absolutePath();
+}
+
+
+QStringList Framework::suites() const
+{
+ if (!qsettings)
+ return QStringList();
+
+ QStringList tests = qsettings->childGroups();
+ qDebug()<<"here suites "<<tests;
+ tests.removeAll("General");
+ tests.removeAll("Blacklist");
+ return tests;
+}
+
+
+bool Framework::isTestBlacklisted(const QString &engineName,
+ const QString &testcase) const
+{
+ return m_blacklist[engineName].contains(testcase);
+}
+
+bool Framework::isValid() const
+{
+ return qsettings;
+}
+
+void Framework::load(const QString &file)
+{
+ if (qsettings) {
+ delete qsettings;
+ qsettings = 0;
+ }
+ if (QFile::exists(file)) {
+ qsettings = new QSettings(file, QSettings::IniFormat);
+ qsettings->beginGroup(QString("Blacklist"));
+ QStringList engines = qsettings->childKeys();
+ foreach(QString engineName, engines) {
+ QStringList testcases = qsettings->value(engineName).toStringList();
+ m_blacklist.insert(engineName, testcases);
+ qDebug()<<"Blacklists for "<<testcases;
+ }
+ qsettings->endGroup();
+ }
+}
+
+QString Framework::outputDir() const
+{
+ qsettings->beginGroup("General");
+ QString outputDirName = qsettings->value("outputDir").toString();
+ qsettings->endGroup();
+ return outputDirName;
+}
+
+QSettings * Framework::settings() const
+{
+ return qsettings;
+}
diff --git a/tests/arthur/common/framework.h b/tests/arthur/common/framework.h
new file mode 100644
index 0000000000..e25c9a1a37
--- /dev/null
+++ b/tests/arthur/common/framework.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef FRAMEWORK_H
+#define FRAMEWORK_H
+
+#include <QMap>
+#include <QStringList>
+#include <QString>
+
+QT_FORWARD_DECLARE_CLASS(QSettings)
+
+class Framework
+{
+public:
+ Framework();
+ Framework(const QString &file);
+ ~Framework();
+
+ bool isValid() const;
+
+ void load(const QString &file);
+
+ QSettings *settings() const;
+
+
+ QString basePath() const;
+ QString outputDir() const;
+
+ QStringList suites() const;
+
+ bool isTestBlacklisted(const QString &engineName,
+ const QString &testcase) const;
+private:
+ QSettings *qsettings;
+ QMap<QString, QStringList> m_blacklist;
+};
+
+#endif
diff --git a/tests/arthur/common/images.qrc b/tests/arthur/common/images.qrc
new file mode 100644
index 0000000000..060b52c85a
--- /dev/null
+++ b/tests/arthur/common/images.qrc
@@ -0,0 +1,34 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+<qresource>
+ <file>images/alpha.png</file>
+ <file>images/border.png</file>
+ <file>images/borderimage.png</file>
+ <file>images/dome_argb32.png</file>
+ <file>images/dome_indexed.png</file>
+ <file>images/dome_mono_palette.png</file>
+ <file>images/dome_rgb32.png</file>
+ <file>images/face.png</file>
+ <file>images/gam045.png</file>
+ <file>images/gam100.png</file>
+ <file>images/image.png</file>
+ <file>images/masked.png</file>
+ <file>images/sign.png</file>
+ <file>images/struct-image-01.jpg</file>
+ <file>images/bitmap.png</file>
+ <file>images/dome_indexed_mask.png</file>
+ <file>images/dome_mono_128.png</file>
+ <file>images/dome_mono.png</file>
+ <file>images/dot.png</file>
+ <file>images/gam030.png</file>
+ <file>images/gam056.png</file>
+ <file>images/gam200.png</file>
+ <file>images/mask_100.png</file>
+ <file>images/mask.png</file>
+ <file>images/solid.png</file>
+ <file>images/struct-image-01.png</file>
+ <file>images/zebra.png</file>
+ <file>images/alpha2x2.png</file>
+ <file>images/solid2x2.png</file>
+</qresource>
+</RCC>
diff --git a/tests/arthur/common/images/alpha.png b/tests/arthur/common/images/alpha.png
new file mode 100644
index 0000000000..e465b2586d
--- /dev/null
+++ b/tests/arthur/common/images/alpha.png
Binary files differ
diff --git a/tests/arthur/common/images/alpha2x2.png b/tests/arthur/common/images/alpha2x2.png
new file mode 100644
index 0000000000..67ecc04286
--- /dev/null
+++ b/tests/arthur/common/images/alpha2x2.png
Binary files differ
diff --git a/tests/arthur/common/images/bitmap.png b/tests/arthur/common/images/bitmap.png
new file mode 100644
index 0000000000..d21f8f51bb
--- /dev/null
+++ b/tests/arthur/common/images/bitmap.png
Binary files differ
diff --git a/tests/arthur/common/images/border.png b/tests/arthur/common/images/border.png
new file mode 100644
index 0000000000..a3d2fed0a3
--- /dev/null
+++ b/tests/arthur/common/images/border.png
Binary files differ
diff --git a/tests/arthur/common/images/borderimage.png b/tests/arthur/common/images/borderimage.png
new file mode 100644
index 0000000000..f7f6b66227
--- /dev/null
+++ b/tests/arthur/common/images/borderimage.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_argb32.png b/tests/arthur/common/images/dome_argb32.png
new file mode 100644
index 0000000000..e3ccba0c13
--- /dev/null
+++ b/tests/arthur/common/images/dome_argb32.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_indexed.png b/tests/arthur/common/images/dome_indexed.png
new file mode 100644
index 0000000000..beefcd514e
--- /dev/null
+++ b/tests/arthur/common/images/dome_indexed.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_indexed_mask.png b/tests/arthur/common/images/dome_indexed_mask.png
new file mode 100644
index 0000000000..a62f29f40e
--- /dev/null
+++ b/tests/arthur/common/images/dome_indexed_mask.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_mono.png b/tests/arthur/common/images/dome_mono.png
new file mode 100644
index 0000000000..950c2a7494
--- /dev/null
+++ b/tests/arthur/common/images/dome_mono.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_mono_128.png b/tests/arthur/common/images/dome_mono_128.png
new file mode 100644
index 0000000000..77e48aaab7
--- /dev/null
+++ b/tests/arthur/common/images/dome_mono_128.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_mono_palette.png b/tests/arthur/common/images/dome_mono_palette.png
new file mode 100644
index 0000000000..dca3f59245
--- /dev/null
+++ b/tests/arthur/common/images/dome_mono_palette.png
Binary files differ
diff --git a/tests/arthur/common/images/dome_rgb32.png b/tests/arthur/common/images/dome_rgb32.png
new file mode 100644
index 0000000000..27bc02a545
--- /dev/null
+++ b/tests/arthur/common/images/dome_rgb32.png
Binary files differ
diff --git a/tests/arthur/common/images/dot.png b/tests/arthur/common/images/dot.png
new file mode 100644
index 0000000000..17a7b6a0ba
--- /dev/null
+++ b/tests/arthur/common/images/dot.png
Binary files differ
diff --git a/tests/arthur/common/images/face.png b/tests/arthur/common/images/face.png
new file mode 100644
index 0000000000..4f6172d83b
--- /dev/null
+++ b/tests/arthur/common/images/face.png
Binary files differ
diff --git a/tests/arthur/common/images/gam030.png b/tests/arthur/common/images/gam030.png
new file mode 100644
index 0000000000..904c9721bd
--- /dev/null
+++ b/tests/arthur/common/images/gam030.png
Binary files differ
diff --git a/tests/arthur/common/images/gam045.png b/tests/arthur/common/images/gam045.png
new file mode 100644
index 0000000000..b649a8a54f
--- /dev/null
+++ b/tests/arthur/common/images/gam045.png
Binary files differ
diff --git a/tests/arthur/common/images/gam056.png b/tests/arthur/common/images/gam056.png
new file mode 100644
index 0000000000..e5f959dc96
--- /dev/null
+++ b/tests/arthur/common/images/gam056.png
Binary files differ
diff --git a/tests/arthur/common/images/gam100.png b/tests/arthur/common/images/gam100.png
new file mode 100644
index 0000000000..6c7ba5f1ed
--- /dev/null
+++ b/tests/arthur/common/images/gam100.png
Binary files differ
diff --git a/tests/arthur/common/images/gam200.png b/tests/arthur/common/images/gam200.png
new file mode 100644
index 0000000000..daa20fcbc4
--- /dev/null
+++ b/tests/arthur/common/images/gam200.png
Binary files differ
diff --git a/tests/arthur/common/images/image.png b/tests/arthur/common/images/image.png
new file mode 100644
index 0000000000..85d486a790
--- /dev/null
+++ b/tests/arthur/common/images/image.png
Binary files differ
diff --git a/tests/arthur/common/images/mask.png b/tests/arthur/common/images/mask.png
new file mode 100644
index 0000000000..c3f3b1b6ca
--- /dev/null
+++ b/tests/arthur/common/images/mask.png
Binary files differ
diff --git a/tests/arthur/common/images/mask_100.png b/tests/arthur/common/images/mask_100.png
new file mode 100644
index 0000000000..fc950dc7ed
--- /dev/null
+++ b/tests/arthur/common/images/mask_100.png
Binary files differ
diff --git a/tests/arthur/common/images/masked.png b/tests/arthur/common/images/masked.png
new file mode 100644
index 0000000000..6debec534d
--- /dev/null
+++ b/tests/arthur/common/images/masked.png
Binary files differ
diff --git a/tests/arthur/common/images/sign.png b/tests/arthur/common/images/sign.png
new file mode 100644
index 0000000000..6aac7e150a
--- /dev/null
+++ b/tests/arthur/common/images/sign.png
Binary files differ
diff --git a/tests/arthur/common/images/solid.png b/tests/arthur/common/images/solid.png
new file mode 100644
index 0000000000..371e9c1aee
--- /dev/null
+++ b/tests/arthur/common/images/solid.png
Binary files differ
diff --git a/tests/arthur/common/images/solid2x2.png b/tests/arthur/common/images/solid2x2.png
new file mode 100644
index 0000000000..ad67cd3e12
--- /dev/null
+++ b/tests/arthur/common/images/solid2x2.png
Binary files differ
diff --git a/tests/arthur/common/images/struct-image-01.jpg b/tests/arthur/common/images/struct-image-01.jpg
new file mode 100644
index 0000000000..a74e07223b
--- /dev/null
+++ b/tests/arthur/common/images/struct-image-01.jpg
Binary files differ
diff --git a/tests/arthur/common/images/struct-image-01.png b/tests/arthur/common/images/struct-image-01.png
new file mode 100644
index 0000000000..4ed08406dc
--- /dev/null
+++ b/tests/arthur/common/images/struct-image-01.png
Binary files differ
diff --git a/tests/arthur/common/images/zebra.png b/tests/arthur/common/images/zebra.png
new file mode 100644
index 0000000000..ef35f20785
--- /dev/null
+++ b/tests/arthur/common/images/zebra.png
Binary files differ
diff --git a/tests/arthur/common/lookup3.cpp b/tests/arthur/common/lookup3.cpp
new file mode 100644
index 0000000000..1aa501fa4f
--- /dev/null
+++ b/tests/arthur/common/lookup3.cpp
@@ -0,0 +1,786 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+/*
+These functions are based on:
+
+-------------------------------------------------------------------------------
+lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+
+These are functions for producing 32-bit hashes for hash table lookup.
+hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
+are externally useful functions. Routines to test the hash are included
+if SELF_TEST is defined. You can use this free for any purpose. It's in
+the public domain. It has no warranty.
+
+You probably want to use hashlittle(). hashlittle() and hashbig()
+hash byte arrays. hashlittle() is is faster than hashbig() on
+little-endian machines. Intel and AMD are little-endian machines.
+On second thought, you probably want hashlittle2(), which is identical to
+hashlittle() except it returns two 32-bit hashes for the price of one.
+You could implement hashbig2() if you wanted but I haven't bothered here.
+
+If you want to find a hash of, say, exactly 7 integers, do
+ a = i1; b = i2; c = i3;
+ mix(a,b,c);
+ a += i4; b += i5; c += i6;
+ mix(a,b,c);
+ a += i7;
+ final(a,b,c);
+then use c as the hash value. If you have a variable length array of
+4-byte integers to hash, use hashword(). If you have a byte array (like
+a character string), use hashlittle(). If you have several byte arrays, or
+a mix of things, see the comments above hashlittle().
+
+Why is this so big? I read 12 bytes at a time into 3 4-byte integers,
+then mix those integers. This is fast (you can do a lot more thorough
+mixing with 12*3 instructions on 3 integers than you can with 3 instructions
+on 1 byte), but shoehorning those bytes into integers efficiently is messy.
+-------------------------------------------------------------------------------
+*/
+
+#include <QtGlobal>
+
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+# define HASH_LITTLE_ENDIAN 0
+# define HASH_BIG_ENDIAN 1
+#else
+# define HASH_LITTLE_ENDIAN 1
+# define HASH_BIG_ENDIAN 0
+#endif
+
+#define hashsize(n) ((quint32)1<<(n))
+#define hashmask(n) (hashsize(n)-1)
+#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+
+/*
+-------------------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+
+This is reversible, so any information in (a,b,c) before mix() is
+still in (a,b,c) after mix().
+
+If four pairs of (a,b,c) inputs are run through mix(), or through
+mix() in reverse, there are at least 32 bits of the output that
+are sometimes the same for one pair and different for another pair.
+This was tested for:
+* pairs that differed by one bit, by two bits, in any combination
+ of top bits of (a,b,c), or in any combination of bottom bits of
+ (a,b,c).
+* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
+ the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+ is commonly produced by subtraction) look like a single 1-bit
+ difference.
+* the base values were pseudorandom, all zero but one bit set, or
+ all zero plus a counter that starts at zero.
+
+Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
+satisfy this are
+ 4 6 8 16 19 4
+ 9 15 3 18 27 15
+ 14 9 3 7 17 3
+Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
+for "differ" defined as + with a one-bit base and a two-bit delta. I
+used http://burtleburtle.net/bob/hash/avalanche.html to choose
+the operations, constants, and arrangements of the variables.
+
+This does not achieve avalanche. There are input bits of (a,b,c)
+that fail to affect some output bits of (a,b,c), especially of a. The
+most thoroughly mixed value is c, but it doesn't really even achieve
+avalanche in c.
+
+This allows some parallelism. Read-after-writes are good at doubling
+the number of bits affected, so the goal of mixing pulls in the opposite
+direction as the goal of parallelism. I did what I could. Rotates
+seem to cost as much as shifts on every machine I could lay my hands
+on, and rotates are much kinder to the top and bottom bits, so I used
+rotates.
+-------------------------------------------------------------------------------
+*/
+#define mix(a,b,c) \
+{ \
+ a -= c; a ^= rot(c, 4); c += b; \
+ b -= a; b ^= rot(a, 6); a += c; \
+ c -= b; c ^= rot(b, 8); b += a; \
+ a -= c; a ^= rot(c,16); c += b; \
+ b -= a; b ^= rot(a,19); a += c; \
+ c -= b; c ^= rot(b, 4); b += a; \
+}
+
+/*
+-------------------------------------------------------------------------------
+final -- final mixing of 3 32-bit values (a,b,c) into c
+
+Pairs of (a,b,c) values differing in only a few bits will usually
+produce values of c that look totally different. This was tested for
+* pairs that differed by one bit, by two bits, in any combination
+ of top bits of (a,b,c), or in any combination of bottom bits of
+ (a,b,c).
+* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
+ the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
+ is commonly produced by subtraction) look like a single 1-bit
+ difference.
+* the base values were pseudorandom, all zero but one bit set, or
+ all zero plus a counter that starts at zero.
+
+These constants passed:
+ 14 11 25 16 4 14 24
+ 12 14 25 16 4 14 24
+and these came close:
+ 4 8 15 26 3 22 24
+ 10 8 15 26 3 22 24
+ 11 8 15 26 3 22 24
+-------------------------------------------------------------------------------
+*/
+#define final(a,b,c) \
+{ \
+ c ^= b; c -= rot(b,14); \
+ a ^= c; a -= rot(c,11); \
+ b ^= a; b -= rot(a,25); \
+ c ^= b; c -= rot(b,16); \
+ a ^= c; a -= rot(c,4); \
+ b ^= a; b -= rot(a,14); \
+ c ^= b; c -= rot(b,24); \
+}
+
+/*
+--------------------------------------------------------------------
+ This works on all machines. To be useful, it requires
+ -- that the key be an array of quint32's, and
+ -- that the length be the number of quint32's in the key
+
+ The function hashword() is identical to hashlittle() on little-endian
+ machines, and identical to hashbig() on big-endian machines,
+ except that the length has to be measured in quint32s rather than in
+ bytes. hashlittle() is more complicated than hashword() only because
+ hashlittle() has to dance around fitting the key bytes into registers.
+--------------------------------------------------------------------
+*/
+quint32 hashword(
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 initval) /* the previous hash, or an arbitrary value */
+{
+ quint32 a,b,c;
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + (((quint32)length)<<2) + initval;
+
+ /*------------------------------------------------- handle most of the key */
+ while (length > 3)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 3;
+ k += 3;
+ }
+
+ /*------------------------------------------- handle the last 3 quint32's */
+ switch(length) /* all the case statements fall through */
+ {
+ case 3 : c+=k[2];
+ case 2 : b+=k[1];
+ case 1 : a+=k[0];
+ final(a,b,c);
+ case 0: /* case 0: nothing left to add */
+ break;
+ }
+ /*------------------------------------------------------ report the result */
+ return c;
+}
+
+
+/*
+--------------------------------------------------------------------
+hashword2() -- same as hashword(), but take two seeds and return two
+32-bit values. pc and pb must both be nonnull, and *pc and *pb must
+both be initialized with seeds. If you pass in (*pb)==0, the output
+(*pc) will be the same as the return value from hashword().
+--------------------------------------------------------------------
+*/
+void hashword2 (
+const quint32 *k, /* the key, an array of quint32 values */
+size_t length, /* the length of the key, in quint32s */
+quint32 *pc, /* IN: seed OUT: primary hash value */
+quint32 *pb) /* IN: more seed OUT: secondary hash value */
+{
+ quint32 a,b,c;
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)(length<<2)) + *pc;
+ c += *pb;
+
+ /*------------------------------------------------- handle most of the key */
+ while (length > 3)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 3;
+ k += 3;
+ }
+
+ /*------------------------------------------- handle the last 3 quint32's */
+ switch(length) /* all the case statements fall through */
+ {
+ case 3 : c+=k[2];
+ case 2 : b+=k[1];
+ case 1 : a+=k[0];
+ final(a,b,c);
+ case 0: /* case 0: nothing left to add */
+ break;
+ }
+ /*------------------------------------------------------ report the result */
+ *pc=c; *pb=b;
+}
+
+
+/*
+-------------------------------------------------------------------------------
+hashlittle() -- hash a variable-length key into a 32-bit value
+ k : the key (the unaligned variable-length array of bytes)
+ length : the length of the key, counting by bytes
+ initval : can be any 4-byte value
+Returns a 32-bit value. Every bit of the key affects every bit of
+the return value. Two keys differing by one or two bits will have
+totally different hash values.
+
+The best hash table sizes are powers of 2. There is no need to do
+mod a prime (mod is sooo slow!). If you need less than 32 bits,
+use a bitmask. For example, if you need only 10 bits, do
+ h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (quint8 **)k, do it like this:
+ for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
+
+By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
+code any way you wish, private, educational, or commercial. It's free.
+
+Use for hash table lookup, or anything where one collision in 2^^32 is
+acceptable. Do NOT use for cryptographic purposes.
+-------------------------------------------------------------------------------
+*/
+
+quint32 hashlittle( const void *key, size_t length, quint32 initval)
+{
+ quint32 a,b,c; /* internal state */
+ union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + initval;
+
+ u.ptr = key;
+ if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]&0xffffff" actually reads beyond the end of the string, but
+ * then masks off the part it's not allowed to read. Because the
+ * string is aligned, the masked-off tail is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff; break;
+ case 2 : a+=k[0]&0xffff; break;
+ case 1 : a+=k[0]&0xff; break;
+ case 0 : return c; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=((quint32)k8[9])<<8; /* fall through */
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<8; /* fall through */
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<8; /* fall through */
+ case 1 : a+=k8[0]; break;
+ case 0 : return c;
+ }
+
+#endif /* !valgrind */
+
+ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+ const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */
+ const quint8 *k8;
+
+ /*--------------- all but last block: aligned reads and different mixing */
+ while (length > 12)
+ {
+ a += k[0] + (((quint32)k[1])<<16);
+ b += k[2] + (((quint32)k[3])<<16);
+ c += k[4] + (((quint32)k[5])<<16);
+ mix(a,b,c);
+ length -= 12;
+ k += 6;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[4]+(((quint32)k[5])<<16);
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=k[4];
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=k[2];
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=k[0];
+ break;
+ case 1 : a+=k8[0];
+ break;
+ case 0 : return c; /* zero length requires no mixing */
+ }
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ a += ((quint32)k[1])<<8;
+ a += ((quint32)k[2])<<16;
+ a += ((quint32)k[3])<<24;
+ b += k[4];
+ b += ((quint32)k[5])<<8;
+ b += ((quint32)k[6])<<16;
+ b += ((quint32)k[7])<<24;
+ c += k[8];
+ c += ((quint32)k[9])<<8;
+ c += ((quint32)k[10])<<16;
+ c += ((quint32)k[11])<<24;
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=((quint32)k[11])<<24;
+ case 11: c+=((quint32)k[10])<<16;
+ case 10: c+=((quint32)k[9])<<8;
+ case 9 : c+=k[8];
+ case 8 : b+=((quint32)k[7])<<24;
+ case 7 : b+=((quint32)k[6])<<16;
+ case 6 : b+=((quint32)k[5])<<8;
+ case 5 : b+=k[4];
+ case 4 : a+=((quint32)k[3])<<24;
+ case 3 : a+=((quint32)k[2])<<16;
+ case 2 : a+=((quint32)k[1])<<8;
+ case 1 : a+=k[0];
+ break;
+ case 0 : return c;
+ }
+ }
+
+ final(a,b,c);
+ return c;
+}
+
+
+/*
+ * hashlittle2: return 2 32-bit hash values
+ *
+ * This is identical to hashlittle(), except it returns two 32-bit hash
+ * values instead of just one. This is good enough for hash table
+ * lookup with 2^^64 buckets, or if you want a second hash if you're not
+ * happy with the first, or if you want a probably-unique 64-bit ID for
+ * the key. *pc is better mixed than *pb, so use *pc first. If you want
+ * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
+ */
+void hashlittle2(
+ const void *key, /* the key to hash */
+ size_t length, /* length of the key */
+ quint32 *pc, /* IN: primary initval, OUT: primary hash */
+ quint32 *pb) /* IN: secondary initval, OUT: secondary hash */
+{
+ quint32 a,b,c; /* internal state */
+ union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + *pc;
+ c += *pb;
+
+ u.ptr = key;
+ if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]&0xffffff" actually reads beyond the end of the string, but
+ * then masks off the part it's not allowed to read. Because the
+ * string is aligned, the masked-off tail is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff; break;
+ case 2 : a+=k[0]&0xffff; break;
+ case 1 : a+=k[0]&0xff; break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=((quint32)k8[9])<<8; /* fall through */
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<8; /* fall through */
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<8; /* fall through */
+ case 1 : a+=k8[0]; break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+#endif /* !valgrind */
+
+ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
+ const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */
+ const quint8 *k8;
+
+ /*--------------- all but last block: aligned reads and different mixing */
+ while (length > 12)
+ {
+ a += k[0] + (((quint32)k[1])<<16);
+ b += k[2] + (((quint32)k[3])<<16);
+ c += k[4] + (((quint32)k[5])<<16);
+ mix(a,b,c);
+ length -= 12;
+ k += 6;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ k8 = (const quint8 *)k;
+ switch(length)
+ {
+ case 12: c+=k[4]+(((quint32)k[5])<<16);
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 11: c+=((quint32)k8[10])<<16; /* fall through */
+ case 10: c+=k[4];
+ b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 9 : c+=k8[8]; /* fall through */
+ case 8 : b+=k[2]+(((quint32)k[3])<<16);
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 7 : b+=((quint32)k8[6])<<16; /* fall through */
+ case 6 : b+=k[2];
+ a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 5 : b+=k8[4]; /* fall through */
+ case 4 : a+=k[0]+(((quint32)k[1])<<16);
+ break;
+ case 3 : a+=((quint32)k8[2])<<16; /* fall through */
+ case 2 : a+=k[0];
+ break;
+ case 1 : a+=k8[0];
+ break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ a += ((quint32)k[1])<<8;
+ a += ((quint32)k[2])<<16;
+ a += ((quint32)k[3])<<24;
+ b += k[4];
+ b += ((quint32)k[5])<<8;
+ b += ((quint32)k[6])<<16;
+ b += ((quint32)k[7])<<24;
+ c += k[8];
+ c += ((quint32)k[9])<<8;
+ c += ((quint32)k[10])<<16;
+ c += ((quint32)k[11])<<24;
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=((quint32)k[11])<<24;
+ case 11: c+=((quint32)k[10])<<16;
+ case 10: c+=((quint32)k[9])<<8;
+ case 9 : c+=k[8];
+ case 8 : b+=((quint32)k[7])<<24;
+ case 7 : b+=((quint32)k[6])<<16;
+ case 6 : b+=((quint32)k[5])<<8;
+ case 5 : b+=k[4];
+ case 4 : a+=((quint32)k[3])<<24;
+ case 3 : a+=((quint32)k[2])<<16;
+ case 2 : a+=((quint32)k[1])<<8;
+ case 1 : a+=k[0];
+ break;
+ case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */
+ }
+ }
+
+ final(a,b,c);
+ *pc=c; *pb=b;
+}
+
+
+
+/*
+ * hashbig():
+ * This is the same as hashword() on big-endian machines. It is different
+ * from hashlittle() on all machines. hashbig() takes advantage of
+ * big-endian byte ordering.
+ */
+quint32 hashbig( const void *key, size_t length, quint32 initval)
+{
+ quint32 a,b,c;
+ union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
+
+ /* Set up the internal state */
+ a = b = c = 0xdeadbeef + ((quint32)length) + initval;
+
+ u.ptr = key;
+ if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
+ const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */
+
+ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ mix(a,b,c);
+ length -= 12;
+ k += 3;
+ }
+
+ /*----------------------------- handle the last (probably partial) block */
+ /*
+ * "k[2]<<8" actually reads beyond the end of the string, but
+ * then shifts out the part it's not allowed to read. Because the
+ * string is aligned, the illegal read is in the same word as the
+ * rest of the string. Every machine with memory protection I've seen
+ * does it on word boundaries, so is OK with this. But VALGRIND will
+ * still catch it and complain. The masking trick does make the hash
+ * noticably faster for short strings (like English words).
+ */
+#ifndef VALGRIND
+
+ switch(length)
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
+ case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
+ case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=k[1]&0xffffff00; a+=k[0]; break;
+ case 6 : b+=k[1]&0xffff0000; a+=k[0]; break;
+ case 5 : b+=k[1]&0xff000000; a+=k[0]; break;
+ case 4 : a+=k[0]; break;
+ case 3 : a+=k[0]&0xffffff00; break;
+ case 2 : a+=k[0]&0xffff0000; break;
+ case 1 : a+=k[0]&0xff000000; break;
+ case 0 : return c; /* zero length strings require no mixing */
+ }
+
+#else /* make valgrind happy */
+
+ const quint8 *k8 = (const quint8 *)k;
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
+ case 11: c+=((quint32)k8[10])<<8; /* fall through */
+ case 10: c+=((quint32)k8[9])<<16; /* fall through */
+ case 9 : c+=((quint32)k8[8])<<24; /* fall through */
+ case 8 : b+=k[1]; a+=k[0]; break;
+ case 7 : b+=((quint32)k8[6])<<8; /* fall through */
+ case 6 : b+=((quint32)k8[5])<<16; /* fall through */
+ case 5 : b+=((quint32)k8[4])<<24; /* fall through */
+ case 4 : a+=k[0]; break;
+ case 3 : a+=((quint32)k8[2])<<8; /* fall through */
+ case 2 : a+=((quint32)k8[1])<<16; /* fall through */
+ case 1 : a+=((quint32)k8[0])<<24; break;
+ case 0 : return c;
+ }
+
+#endif /* !VALGRIND */
+
+ } else { /* need to read the key one byte at a time */
+ const quint8 *k = (const quint8 *)key;
+
+ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
+ while (length > 12)
+ {
+ a += ((quint32)k[0])<<24;
+ a += ((quint32)k[1])<<16;
+ a += ((quint32)k[2])<<8;
+ a += ((quint32)k[3]);
+ b += ((quint32)k[4])<<24;
+ b += ((quint32)k[5])<<16;
+ b += ((quint32)k[6])<<8;
+ b += ((quint32)k[7]);
+ c += ((quint32)k[8])<<24;
+ c += ((quint32)k[9])<<16;
+ c += ((quint32)k[10])<<8;
+ c += ((quint32)k[11]);
+ mix(a,b,c);
+ length -= 12;
+ k += 12;
+ }
+
+ /*-------------------------------- last block: affect all 32 bits of (c) */
+ switch(length) /* all the case statements fall through */
+ {
+ case 12: c+=k[11];
+ case 11: c+=((quint32)k[10])<<8;
+ case 10: c+=((quint32)k[9])<<16;
+ case 9 : c+=((quint32)k[8])<<24;
+ case 8 : b+=k[7];
+ case 7 : b+=((quint32)k[6])<<8;
+ case 6 : b+=((quint32)k[5])<<16;
+ case 5 : b+=((quint32)k[4])<<24;
+ case 4 : a+=k[3];
+ case 3 : a+=((quint32)k[2])<<8;
+ case 2 : a+=((quint32)k[1])<<16;
+ case 1 : a+=((quint32)k[0])<<24;
+ break;
+ case 0 : return c;
+ }
+ }
+
+ final(a,b,c);
+ return c;
+}
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
new file mode 100644
index 0000000000..7a018e3ce6
--- /dev/null
+++ b/tests/arthur/common/paintcommands.cpp
@@ -0,0 +1,2684 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "paintcommands.h"
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qpainter.h>
+#include <qbitmap.h>
+#include <qtextstream.h>
+#include <qtextlayout.h>
+#include <qdebug.h>
+
+#ifdef QT3_SUPPORT
+#include <q3painter.h>
+#endif
+
+#ifndef QT_NO_OPENGL
+#include <qglpixelbuffer.h>
+#endif
+
+/*********************************************************************************
+** everything to populate static tables
+**********************************************************************************/
+const char *PaintCommands::brushStyleTable[] = {
+ "NoBrush",
+ "SolidPattern",
+ "Dense1Pattern",
+ "Dense2Pattern",
+ "Dense3Pattern",
+ "Dense4Pattern",
+ "Dense5Pattern",
+ "Dense6Pattern",
+ "Dense7Pattern",
+ "HorPattern",
+ "VerPattern",
+ "CrossPattern",
+ "BDiagPattern",
+ "FDiagPattern",
+ "DiagCrossPattern",
+ "LinearGradientPattern"
+};
+
+const char *PaintCommands::penStyleTable[] = {
+ "NoPen",
+ "SolidLine",
+ "DashLine",
+ "DotLine",
+ "DashDotLine",
+ "DashDotDotLine"
+};
+
+const char *PaintCommands::fontWeightTable[] = {
+ "Light",
+ "Normal",
+ "DemiBold",
+ "Bold",
+ "Black"
+};
+
+const char *PaintCommands::fontHintingTable[] = {
+ "Default",
+ "None",
+ "Vertical",
+ "Full"
+};
+
+const char *PaintCommands::clipOperationTable[] = {
+ "NoClip",
+ "ReplaceClip",
+ "IntersectClip",
+ "UniteClip"
+};
+
+const char *PaintCommands::spreadMethodTable[] = {
+ "PadSpread",
+ "ReflectSpread",
+ "RepeatSpread"
+};
+
+const char *PaintCommands::coordinateMethodTable[] = {
+ "LogicalMode",
+ "StretchToDeviceMode",
+ "ObjectBoundingMode"
+};
+
+const char *PaintCommands::sizeModeTable[] = {
+ "AbsoluteSize",
+ "RelativeSize"
+};
+
+const char *PaintCommands::compositionModeTable[] = {
+ "SourceOver",
+ "DestinationOver",
+ "Clear",
+ "Source",
+ "Destination",
+ "SourceIn",
+ "DestinationIn",
+ "SourceOut",
+ "DestinationOut",
+ "SourceAtop",
+ "DestinationAtop",
+ "Xor",
+ "Plus",
+ "Multiply",
+ "Screen",
+ "Overlay",
+ "Darken",
+ "Lighten",
+ "ColorDodge",
+ "ColorBurn",
+ "HardLight",
+ "SoftLight",
+ "Difference",
+ "Exclusion",
+ "SourceOrDestination",
+ "SourceAndDestination",
+ "SourceXorDestination",
+ "NotSourceAndNotDestination",
+ "NotSourceOrNotDestination",
+ "NotSourceXorDestination",
+ "NotSource",
+ "NotSourceAndDestination",
+ "SourceAndNotDestination"
+};
+
+const char *PaintCommands::imageFormatTable[] = {
+ "Invalid",
+ "Mono",
+ "MonoLSB",
+ "Indexed8",
+ "RGB32",
+ "ARGB32",
+ "ARGB32_Premultiplied",
+ "Format_RGB16",
+ "Format_ARGB8565_Premultiplied",
+ "Format_RGB666",
+ "Format_ARGB6666_Premultiplied",
+ "Format_RGB555",
+ "Format_ARGB8555_Premultiplied",
+ "Format_RGB888",
+ "Format_RGB444",
+ "Format_ARGB4444_Premultiplied"
+};
+
+int PaintCommands::translateEnum(const char *table[], const QString &pattern, int limit)
+{
+ QByteArray p = pattern.toLatin1().toLower();
+ for (int i=0; i<limit; ++i)
+ if (p == QByteArray::fromRawData(table[i], qstrlen(table[i])).toLower())
+ return i;
+ return -1;
+}
+
+QList<PaintCommands::PaintCommandInfos> PaintCommands::s_commandInfoTable = QList<PaintCommands::PaintCommandInfos>();
+QList<QPair<QString,QStringList> > PaintCommands::s_enumsTable = QList<QPair<QString,QStringList> >();
+QMultiHash<QString, int> PaintCommands::s_commandHash;
+
+#define DECL_PAINTCOMMAND(identifier, method, regexp, syntax, sample) \
+ s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegExp(regexp), \
+ QLatin1String(syntax), QLatin1String(sample) );
+
+#define DECL_PAINTCOMMANDSECTION(title) \
+ s_commandInfoTable << PaintCommandInfos(QLatin1String(title));
+
+#define ADD_ENUMLIST(listCaption, cStrArray) { \
+ QStringList list; \
+ for (int i=0; i<int(sizeof(cStrArray)/sizeof(char*)); i++) \
+ list << cStrArray[i]; \
+ s_enumsTable << qMakePair(QString(listCaption), list); \
+ }
+
+void PaintCommands::staticInit()
+{
+ // check if already done
+ if (!s_commandInfoTable.isEmpty()) return;
+
+ // populate the command list
+ DECL_PAINTCOMMANDSECTION("misc");
+ DECL_PAINTCOMMAND("comment", command_comment,
+ "^\\s*#",
+ "# this is some comments",
+ "# place your comments here");
+ DECL_PAINTCOMMAND("import", command_import,
+ "^import\\s+\"(.*)\"$",
+ "import <qrcFilename>",
+ "import \"myfile.qrc\"");
+ DECL_PAINTCOMMAND("begin_block", command_begin_block,
+ "^begin_block\\s+(\\w*)$",
+ "begin_block <blockName>",
+ "begin_block blockName");
+ DECL_PAINTCOMMAND("end_block", command_end_block,
+ "^end_block$",
+ "end_block",
+ "end_block");
+ DECL_PAINTCOMMAND("repeat_block", command_repeat_block,
+ "^repeat_block\\s+(\\w*)$",
+ "repeat_block <blockName>",
+ "repeat_block blockName");
+ DECL_PAINTCOMMAND("textlayout_draw", command_textlayout_draw,
+ "^textlayout_draw\\s+\"(.*)\"\\s+([0-9.]*)$",
+ "textlayout_draw <text> <width>",
+ "textlayout_draw \"your text\" 1.0");
+ DECL_PAINTCOMMAND("abort", command_abort,
+ "^abort$",
+ "abort",
+ "abort");
+ DECL_PAINTCOMMAND("noop", command_noop,
+ "^$",
+ "-",
+ "\n");
+
+ DECL_PAINTCOMMANDSECTION("setters");
+ DECL_PAINTCOMMAND("setBackgroundMode", command_setBgMode,
+ "^(setBackgroundMode|setBgMode)\\s+(\\w*)$",
+ "setBackgroundMode <OpaqueMode|TransparentMode>",
+ "setBackgroundMode TransparentMode");
+ DECL_PAINTCOMMAND("setBackground", command_setBackground,
+ "^setBackground\\s+#?(\\w*)\\s*(\\w*)?$",
+ "setBackground <color> [brush style enum]",
+ "setBackground black SolidPattern");
+ DECL_PAINTCOMMAND("setOpacity", command_setOpacity,
+ "^setOpacity\\s+(-?\\d*\\.?\\d*)$",
+ "setOpacity <opacity>\n - opacity is in [0,1]",
+ "setOpacity 1.0");
+ DECL_PAINTCOMMAND("path_setFillRule", command_path_setFillRule,
+ "^path_setFillRule\\s+(\\w*)\\s+(\\w*)$",
+ "path_setFillRule <pathName> [Winding|OddEven]",
+ "path_setFillRule pathName Winding");
+ DECL_PAINTCOMMAND("setBrush", command_setBrush,
+ "^setBrush\\s+(#?[\\w.:\\/]*)\\s*(\\w*)?$",
+ "setBrush <pixmapFileName>\nsetBrush noBrush\nsetBrush <color> <brush style enum>",
+ "setBrush white SolidPattern");
+ DECL_PAINTCOMMAND("setBrushOrigin", command_setBrushOrigin,
+ "^setBrushOrigin\\s*(-?\\w*)\\s+(-?\\w*)$",
+ "setBrushOrigin <dx> <dy>",
+ "setBrushOrigin 0 0");
+ DECL_PAINTCOMMAND("brushTranslate", command_brushTranslate,
+ "^brushTranslate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "brushTranslate <tx> <ty>",
+ "brushTranslate 0.0 0.0");
+ DECL_PAINTCOMMAND("brushScale", command_brushScale,
+ "^brushScale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "brushScale <kx> <ky>",
+ "brushScale 0.0 0.0");
+ DECL_PAINTCOMMAND("brushRotate", command_brushRotate,
+ "^brushRotate\\s+(-?[\\w.]*)$",
+ "brushRotate <angle>\n - angle in degrees",
+ "brushRotate 0.0");
+ DECL_PAINTCOMMAND("brushShear", command_brushShear,
+ "^brushShear\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "brushShear <sx> <sy>",
+ "brushShear 0.0 0.0");
+ DECL_PAINTCOMMAND("setCompositionMode", command_setCompositionMode,
+ "^setCompositionMode\\s+([\\w_0-9]*)$",
+ "setCompositionMode <composition mode enum>",
+ "setCompositionMode SourceOver");
+ DECL_PAINTCOMMAND("setFont", command_setFont,
+ "^setFont\\s+\"([\\w\\s]*)\"\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$",
+ "setFont <fontFace> [size] [font weight|font weight enum] [italic] [hinting enum]\n - font weight is an integer between 0 and 99",
+ "setFont \"times\" 12");
+ DECL_PAINTCOMMAND("setPen", command_setPen,
+ "^setPen\\s+#?(\\w*)$",
+ "setPen <color>\nsetPen <pen style enum>\nsetPen brush",
+ "setPen black");
+ DECL_PAINTCOMMAND("setPen", command_setPen2,
+ "^setPen\\s+(#?\\w*)\\s+([\\w.]+)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$",
+ "setPen brush|<color> [width] [pen style enum] [FlatCap|SquareCap|RoundCap] [MiterJoin|BevelJoin|RoundJoin]",
+ "setPen black 1 FlatCap MiterJoin");
+ DECL_PAINTCOMMAND("pen_setDashOffset", command_pen_setDashOffset,
+ "^pen_setDashOffset\\s+(-?[\\w.]+)$",
+ "pen_setDashOffset <offset>\n",
+ "pen_setDashOffset 1.0");
+ DECL_PAINTCOMMAND("pen_setDashPattern", command_pen_setDashPattern,
+ "^pen_setDashPattern\\s+\\[([\\w\\s.]*)\\]$",
+ "pen_setDashPattern <[ <dash_1> <space_1> ... <dash_n> <space_n> ]>",
+ "pen_setDashPattern [ 2 1 4 1 3 3 ]");
+ DECL_PAINTCOMMAND("pen_setCosmetic", command_pen_setCosmetic,
+ "^pen_setCosmetic\\s+(\\w*)$",
+ "pen_setCosmetic <true|false>",
+ "pen_setCosmetic true");
+ DECL_PAINTCOMMAND("setRenderHint", command_setRenderHint,
+ "^setRenderHint\\s+([\\w_0-9]*)\\s*(\\w*)$",
+ "setRenderHint <Antialiasing|SmoothPixmapTransform> <true|false>",
+ "setRenderHint Antialiasing true");
+ DECL_PAINTCOMMAND("clearRenderHint", command_clearRenderHint,
+ "^clearRenderHint$",
+ "clearRenderHint",
+ "clearRenderHint");
+
+ DECL_PAINTCOMMANDSECTION("gradients");
+ DECL_PAINTCOMMAND("gradient_appendStop", command_gradient_appendStop,
+ "^gradient_appendStop\\s+([\\w.]*)\\s+#?(\\w*)$",
+ "gradient_appendStop <pos> <color>",
+ "gradient_appendStop 1.0 red");
+ DECL_PAINTCOMMAND("gradient_clearStops", command_gradient_clearStops,
+ "^gradient_clearStops$",
+ "gradient_clearStops",
+ "gradient_clearStops");
+ DECL_PAINTCOMMAND("gradient_setConical", command_gradient_setConical,
+ "^gradient_setConical\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$",
+ "gradient_setConical <cx> <cy> <angle>\n - angle in degrees",
+ "gradient_setConical 5.0 5.0 45.0");
+ DECL_PAINTCOMMAND("gradient_setLinear", command_gradient_setLinear,
+ "^gradient_setLinear\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$",
+ "gradient_setLinear <x1> <y1> <x2> <y2>",
+ "gradient_setLinear 1.0 1.0 2.0 2.0");
+ DECL_PAINTCOMMAND("gradient_setRadial", command_gradient_setRadial,
+ "^gradient_setRadial\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$",
+ "gradient_setRadial <cx> <cy> <rad> <fx> <fy>\n - C is the center\n - rad is the angle in degrees\n - F is the focal point",
+ "gradient_setRadial 1.0 1.0 45.0 2.0 2.0");
+ DECL_PAINTCOMMAND("gradient_setLinearPen", command_gradient_setLinearPen,
+ "^gradient_setLinearPen\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$",
+ "gradient_setLinearPen <x1> <y1> <x2> <y2>",
+ "gradient_setLinearPen 1.0 1.0 2.0 2.0");
+ DECL_PAINTCOMMAND("gradient_setSpread", command_gradient_setSpread,
+ "^gradient_setSpread\\s+(\\w*)$",
+ "gradient_setSpread <spread method enum>",
+ "gradient_setSpread PadSpread");
+ DECL_PAINTCOMMAND("gradient_setCoordinateMode", command_gradient_setCoordinateMode,
+ "^gradient_setCoordinateMode\\s+(\\w*)$",
+ "gradient_setCoordinateMode <coordinate method enum>",
+ "gradient_setCoordinateMode ObjectBoundingMode");
+#ifdef QT3_SUPPORT
+ DECL_PAINTCOMMANDSECTION("qt3 drawing ops");
+ DECL_PAINTCOMMAND("qt3_drawArc", command_qt3_drawArc,
+ "^qt3_drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "qt3_drawArc <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "qt3_drawArc 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("qt3_drawChord", command_qt3_drawChord,
+ "^qt3_drawChord\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "qt3_drawChord <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "qt3_drawChord 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("qt3_drawEllipse", command_qt3_drawEllipse,
+ "^qt3_drawEllipse\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "qt3_drawEllipse <x> <y> <w> <h>",
+ "qt3_drawEllipse 10 10 20 20");
+ DECL_PAINTCOMMAND("qt3_drawPie", command_qt3_drawPie,
+ "^qt3_drawPie\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "qt3_drawPie <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "qt3_drawPie 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("qt3_drawRect", command_qt3_drawRect,
+ "^qt3_drawRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "qt3_drawRect <x> <y> <w> <h>",
+ "qt3_drawRect 10 10 20 20");
+ DECL_PAINTCOMMAND("qt3_drawRoundRect", command_qt3_drawRoundRect,
+ "^qt3_drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w)?\\s*(-?\\w)?$",
+ "qt3_drawRoundRect <x> <y> <w> <h> [rx] [ry]",
+ "qt3_drawRoundRect 10 10 20 20 3 3");
+#endif
+ DECL_PAINTCOMMANDSECTION("drawing ops");
+ DECL_PAINTCOMMAND("drawPoint", command_drawPoint,
+ "^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "drawPoint <x> <y>",
+ "drawPoint 10.0 10.0");
+ DECL_PAINTCOMMAND("drawLine", command_drawLine,
+ "^drawLine\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "drawLine <x1> <y1> <x2> <y2>",
+ "drawLine 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("drawRect", command_drawRect,
+ "^drawRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "drawRect <x> <y> <w> <h>",
+ "drawRect 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("drawRoundRect", command_drawRoundRect,
+ "^drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)?\\s*(-?\\w*)?$",
+ "drawRoundRect <x> <y> <w> <h> [rx] [ry]",
+ "drawRoundRect 10 10 20 20 3 3");
+ DECL_PAINTCOMMAND("drawRoundedRect", command_drawRoundedRect,
+ "^drawRoundedRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(\\w*)?$",
+ "drawRoundedRect <x> <y> <w> <h> <rx> <ry> [SizeMode enum]",
+ "drawRoundedRect 10 10 20 20 4 4 AbsoluteSize");
+ DECL_PAINTCOMMAND("drawArc", command_drawArc,
+ "^drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "drawArc <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "drawArc 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("drawChord", command_drawChord,
+ "^drawChord\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "drawChord <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "drawChord 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("drawEllipse", command_drawEllipse,
+ "^drawEllipse\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "drawEllipse <x> <y> <w> <h>",
+ "drawEllipse 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("drawPath", command_drawPath,
+ "^drawPath\\s+(\\w*)$",
+ "drawPath <pathName>",
+ "drawPath mypath");
+ DECL_PAINTCOMMAND("drawPie", command_drawPie,
+ "^drawPie\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "drawPie <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
+ "drawPie 10 10 20 20 0 5760");
+ DECL_PAINTCOMMAND("drawPixmap", command_drawPixmap,
+ "^drawPixmap\\s+([\\w.:\\-/]*)"
+ "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect
+ "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect
+ "drawPixmap <filename> <tx> <ty> <tw> <th> <sx> <sy> <sw> <sh>"
+ "\n- where t means target and s means source"
+ "\n- a width or height of -1 means maximum space",
+ "drawPixmap :/images/face.png 0 0 -1 -1 0 0 -1 -1");
+ DECL_PAINTCOMMAND("drawImage", command_drawImage,
+ "^drawImage\\s+([\\w.:\\/]*)"
+ "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect
+ "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect
+ "drawImage <filename> <tx> <ty> <tw> <th> <sx> <sy> <sw> <sh>"
+ "\n- where t means target and s means source"
+ "\n- a width or height of -1 means maximum space",
+ "drawImage :/images/face.png 0 0 -1 -1 0 0 -1 -1");
+ DECL_PAINTCOMMAND("drawPolygon", command_drawPolygon,
+ "^drawPolygon\\s+\\[([\\w\\s-.]*)\\]\\s*(\\w*)$",
+ "drawPolygon <[ <x1> <y1> ... <xn> <yn> ]> <Winding|OddEven>",
+ "drawPolygon [ 1 4 6 8 5 3 ] Winding");
+ DECL_PAINTCOMMAND("drawConvexPolygon", command_drawConvexPolygon,
+ "^drawConvexPolygon\\s+\\[([\\w\\s-.]*)\\]$",
+ "drawConvexPolygon <[ <x1> <y1> ... <xn> <yn> ]>",
+ "drawConvexPolygon [ 1 4 6 8 5 3 ]");
+ DECL_PAINTCOMMAND("drawPolyline", command_drawPolyline,
+ "^drawPolyline\\s+\\[([\\w\\s]*)\\]$",
+ "drawPolyline <[ <x1> <y1> ... <xn> <yn> ]>",
+ "drawPolyline [ 1 4 6 8 5 3 ]");
+ DECL_PAINTCOMMAND("drawText", command_drawText,
+ "^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
+ "drawText <x> <y> <text>",
+ "drawText 10 10 \"my text\"");
+ DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap,
+ "^drawTiledPixmap\\s+([\\w.:\\/]*)"
+ "\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)"
+ "\\s*(-?\\w*)\\s*(-?\\w*)$",
+ "drawTiledPixmap <tile image filename> <tx> <ty> <tx> <ty> <sx> <sy>"
+ "\n - where t means tile"
+ "\n - and s is an offset in the tile",
+ "drawTiledPixmap :/images/alpha.png ");
+
+ DECL_PAINTCOMMANDSECTION("painterPaths");
+ DECL_PAINTCOMMAND("path_moveTo", command_path_moveTo,
+ "^path_moveTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_moveTo <pathName> <x> <y>",
+ "path_moveTo mypath 1.0 1.0");
+ DECL_PAINTCOMMAND("path_lineTo", command_path_lineTo,
+ "^path_lineTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_lineTo <pathName> <x> <y>",
+ "path_lineTo mypath 1.0 1.0");
+ DECL_PAINTCOMMAND("path_addEllipse", command_path_addEllipse,
+ "^path_addEllipse\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_addEllipse <pathName> <x1> <y1> <x2> <y2>",
+ "path_addEllipse mypath 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("path_addPolygon", command_path_addPolygon,
+ "^path_addPolygon\\s+(\\w*)\\s+\\[([\\w\\s]*)\\]\\s*(\\w*)$",
+ "path_addPolygon <pathName> <[ <x1> <y1> ... <xn> <yn> ]>",
+ "path_addPolygon mypath [ 1 4 6 8 5 3 ]");
+ DECL_PAINTCOMMAND("path_addRect", command_path_addRect,
+ "^path_addRect\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_addRect <pathName> <x1> <y1> <x2> <y2>",
+ "path_addRect mypath 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("path_addText", command_path_addText,
+ "^path_addText\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+\"(.*)\"$",
+ "path_addText <pathName> <x> <y> <text>",
+ "path_addText mypath 10.0 20.0 \"some text\"");
+ DECL_PAINTCOMMAND("path_arcTo", command_path_arcTo,
+ "^path_arcTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_arcTo <pathName> <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in degrees",
+ "path_arcTo mypath 0.0 0.0 10.0 10.0 0.0 360.0");
+ DECL_PAINTCOMMAND("path_cubicTo", command_path_cubicTo,
+ "^path_cubicTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "path_cubicTo <pathName> <x1> <y1> <x2> <y2> <x3> <y3>",
+ "path_cubicTo mypath 0.0 0.0 10.0 10.0 20.0 20.0");
+ DECL_PAINTCOMMAND("path_closeSubpath", command_path_closeSubpath,
+ "^path_closeSubpath\\s+(\\w*)$",
+ "path_closeSubpath <pathName>",
+ "path_closeSubpath mypath");
+ DECL_PAINTCOMMAND("path_createOutline", command_path_createOutline,
+ "^path_createOutline\\s+(\\w*)\\s+(\\w*)$",
+ "path_createOutline <pathName> <newName>",
+ "path_createOutline mypath myoutline");
+ DECL_PAINTCOMMAND("path_debugPrint", command_path_debugPrint,
+ "^path_debugPrint\\s+(\\w*)$",
+ "path_debugPrint <pathName>",
+ "path_debugPrint mypath");
+
+ DECL_PAINTCOMMANDSECTION("regions");
+ DECL_PAINTCOMMAND("region_addRect", command_region_addRect,
+ "^region_addRect\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "region_addRect <regionName> <x1> <y1> <x2> <y2>",
+ "region_addRect myregion 0.0 0.0 10.0 10.0");
+ DECL_PAINTCOMMAND("region_addEllipse", command_region_addEllipse,
+ "^region_addEllipse\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
+ "region_addEllipse <regionName> <x1> <y1> <x2> <y2>",
+ "region_addEllipse myregion 0.0 0.0 10.0 10.0");
+
+ DECL_PAINTCOMMANDSECTION("clipping");
+ DECL_PAINTCOMMAND("region_getClipRegion", command_region_getClipRegion,
+ "^region_getClipRegion\\s+(\\w*)$",
+ "region_getClipRegion <regionName>",
+ "region_getClipRegion myregion");
+ DECL_PAINTCOMMAND("setClipRegion", command_setClipRegion,
+ "^setClipRegion\\s+(\\w*)\\s*(\\w*)$",
+ "setClipRegion <regionName> <clip operation enum>",
+ "setClipRegion myregion ReplaceClip");
+ DECL_PAINTCOMMAND("path_getClipPath", command_path_getClipPath,
+ "^path_getClipPath\\s+([\\w0-9]*)$",
+ "path_getClipPath <pathName>",
+ "path_getClipPath mypath");
+ DECL_PAINTCOMMAND("setClipPath", command_setClipPath,
+ "^setClipPath\\s+(\\w*)\\s*(\\w*)$",
+ "setClipPath <pathName> <clip operation enum>",
+ "setClipPath mypath ReplaceClip");
+ DECL_PAINTCOMMAND("setClipRect", command_setClipRect,
+ "^setClipRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(\\w*)$",
+ "setClipRect <x1> <y1> <x2> <y2> <clip operation enum>",
+ "setClipRect 0.0 0.0 10.0 10.0 ReplaceClip");
+ DECL_PAINTCOMMAND("setClipping", command_setClipping,
+ "^setClipping\\s+(\\w*)$",
+ "setClipping <true|false>",
+ "setClipping true");
+
+ DECL_PAINTCOMMANDSECTION("surface");
+ DECL_PAINTCOMMAND("surface_begin", command_surface_begin,
+ "^surface_begin\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "surface_begin <x> <y> <w> <h>",
+ "surface_begin 0.0 0.0 10.0 10.0");
+ DECL_PAINTCOMMAND("surface_end", command_surface_end,
+ "^surface_end$",
+ "surface_end",
+ "surface_end");
+
+ DECL_PAINTCOMMANDSECTION("painter states");
+ DECL_PAINTCOMMAND("restore", command_restore,
+ "^restore$",
+ "restore",
+ "restore");
+ DECL_PAINTCOMMAND("save", command_save,
+ "^save$",
+ "save",
+ "save");
+
+ DECL_PAINTCOMMANDSECTION("pixmaps'n'images");
+ DECL_PAINTCOMMAND("pixmap_load", command_pixmap_load,
+ "^pixmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$",
+ "pixmap_load <image filename> <pixmapName>",
+ "pixmap_load :/images/face.png myPixmap");
+ DECL_PAINTCOMMAND("pixmap_setMask", command_pixmap_setMask,
+ "^pixmap_setMask\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]*)$",
+ "pixmap_setMask <pixmapName> <bitmap filename>",
+ "pixmap_setMask myPixmap :/images/bitmap.png");
+ DECL_PAINTCOMMAND("bitmap_load", command_bitmap_load,
+ "^bitmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$",
+ "bitmap_load <bitmap filename> <bitmapName>\n - note that the image is stored as a pixmap",
+ "bitmap_load :/images/bitmap.png myBitmap");
+ DECL_PAINTCOMMAND("image_convertToFormat", command_image_convertToFormat,
+ "^image_convertToFormat\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]+)\\s+([\\w0-9_]*)$",
+ "image_convertToFormat <sourceImageName> <destImageName> <image format enum>",
+ "image_convertToFormat myImage myNewImage Indexed8");
+ DECL_PAINTCOMMAND("image_load", command_image_load,
+ "^image_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$",
+ "image_load <filename> <imageName>",
+ "image_load :/images/face.png myImage");
+ DECL_PAINTCOMMAND("image_setColor", command_image_setColor,
+ "^image_setColor\\s+([\\w.:\\/]*)\\s+([0-9]*)\\s+#([0-9]*)$",
+ "image_setColor <imageName> <index> <color>",
+ "image_setColor myImage 0 black");
+ DECL_PAINTCOMMAND("image_setColorCount", command_image_setColorCount,
+ "^image_setColorCount\\s+([\\w.:\\/]*)\\s+([0-9]*)$",
+ "image_setColorCount <imageName> <nbColors>",
+ "image_setColorCount myImage 128");
+
+ DECL_PAINTCOMMANDSECTION("transformations");
+ DECL_PAINTCOMMAND("resetMatrix", command_resetMatrix,
+ "^resetMatrix$",
+ "resetMatrix",
+ "resetMatrix");
+ DECL_PAINTCOMMAND("setMatrix", command_setMatrix,
+ "^setMatrix\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "setMatrix <m11> <m12> <m13> <m21> <m22> <m23> <m31> <m32> <m33>",
+ "setMatrix 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0");
+ DECL_PAINTCOMMAND("translate", command_translate,
+ "^translate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "translate <tx> <ty>",
+ "translate 10.0 10.0");
+ DECL_PAINTCOMMAND("rotate", command_rotate,
+ "^rotate\\s+(-?[\\w.]*)$",
+ "rotate <angle>\n - with angle in degrees",
+ "rotate 30.0");
+ DECL_PAINTCOMMAND("rotate_x", command_rotate_x,
+ "^rotate_x\\s+(-?[\\w.]*)$",
+ "rotate_x <angle>\n - with angle in degrees",
+ "rotate_x 30.0");
+ DECL_PAINTCOMMAND("rotate_y", command_rotate_y,
+ "^rotate_y\\s+(-?[\\w.]*)$",
+ "rotate_y <angle>\n - with angle in degrees",
+ "rotate_y 30.0");
+ DECL_PAINTCOMMAND("scale", command_scale,
+ "^scale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
+ "scale <sx> <sy>",
+ "scale 2.0 1.0");
+ DECL_PAINTCOMMAND("mapQuadToQuad", command_mapQuadToQuad,
+ "^mapQuadToQuad\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$",
+ "mapQuadToQuad <x1> <y1> <x2> <y2> <x3> <y3> <x4> <y4> <x5> <y5> <x6> <y6> <x7> <y7> <x8> <y8>"
+ "\n - where vertices 1 to 4 defines the source quad and 5 to 8 the destination quad",
+ "mapQuadToQuad 0.0 0.0 1.0 1.0 0.0 0.0 -1.0 -1.0");
+
+ // populate the command lookup hash
+ for (int i=0; i<s_commandInfoTable.size(); i++) {
+ if (s_commandInfoTable.at(i).isSectionHeader() ||
+ s_commandInfoTable.at(i).identifier == QLatin1String("comment") ||
+ s_commandInfoTable.at(i).identifier == QLatin1String("noop"))
+ continue;
+ s_commandHash.insert(s_commandInfoTable.at(i).identifier, i);
+ }
+
+ // populate the enums list
+ ADD_ENUMLIST("brush styles", brushStyleTable);
+ ADD_ENUMLIST("pen styles", penStyleTable);
+ ADD_ENUMLIST("font weights", fontWeightTable);
+ ADD_ENUMLIST("font hintings", fontHintingTable);
+ ADD_ENUMLIST("clip operations", clipOperationTable);
+ ADD_ENUMLIST("spread methods", spreadMethodTable);
+ ADD_ENUMLIST("composition modes", compositionModeTable);
+ ADD_ENUMLIST("image formats", imageFormatTable);
+ ADD_ENUMLIST("coordinate modes", coordinateMethodTable);
+ ADD_ENUMLIST("size modes", sizeModeTable);
+}
+
+#undef DECL_PAINTCOMMAND
+#undef ADD_ENUMLIST
+/*********************************************************************************
+** utility
+**********************************************************************************/
+template <typename T> T PaintCommands::image_load(const QString &filepath)
+{
+ T t(filepath);
+
+ if (t.isNull())
+ t = T(":images/" + filepath);
+
+ if (t.isNull())
+ t = T("images/" + filepath);
+
+ if (t.isNull()) {
+ QFileInfo fi(filepath);
+ QDir dir = fi.absoluteDir();
+ dir.cdUp();
+ dir.cd("images");
+ QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(fi.fileName());
+ t = T(fileName);
+ if (t.isNull() && !fileName.endsWith(".png")) {
+ fileName.append(".png");
+ t = T(fileName);
+ }
+ }
+
+ return t;
+}
+
+/*********************************************************************************
+** setters
+**********************************************************************************/
+void PaintCommands::insertAt(int commandIndex, const QStringList &newCommands)
+{
+ int index = 0;
+ int left = newCommands.size();
+ while (left--)
+ m_commands.insert(++commandIndex, newCommands.at(index++));
+}
+
+/*********************************************************************************
+** run
+**********************************************************************************/
+void PaintCommands::runCommand(const QString &scriptLine)
+{
+ if (scriptLine.isEmpty()) {
+ command_noop(QRegExp());
+ return;
+ }
+ if (scriptLine.startsWith('#')) {
+ command_comment(QRegExp());
+ return;
+ }
+ QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0);
+ QList<int> indices = s_commandHash.values(firstWord);
+ foreach(int idx, indices) {
+ const PaintCommandInfos &command = s_commandInfoTable.at(idx);
+ if (command.regExp.indexIn(scriptLine) >= 0) {
+ (this->*(command.paintMethod))(command.regExp);
+ return;
+ }
+ }
+ qWarning("ERROR: unknown command or argument syntax error in \"%s\"", qPrintable(scriptLine));
+}
+
+void PaintCommands::runCommands()
+{
+ staticInit();
+ int width = m_painter->window().width();
+ int height = m_painter->window().height();
+
+ if (width <= 0)
+ width = 800;
+ if (height <= 0)
+ height = 800;
+
+ // paint background
+ if (m_checkers_background) {
+ QPixmap pm(20, 20);
+ pm.fill(Qt::white);
+ QPainter pt(&pm);
+ pt.fillRect(0, 0, 10, 10, QColor::fromRgba(0xffdfdfdf));
+ pt.fillRect(10, 10, 10, 10, QColor::fromRgba(0xffdfdfdf));
+ pt.end();
+ m_painter->drawTiledPixmap(0, 0, width, height, pm);
+ } else {
+ m_painter->fillRect(0, 0, width, height, Qt::white);
+ }
+
+ // run each command
+ m_abort = false;
+ for (int i=0; i<m_commands.size() && !m_abort; ++i) {
+ const QString &commandNow = m_commands.at(i);
+ m_currentCommand = commandNow;
+ m_currentCommandIndex = i;
+ runCommand(commandNow.trimmed());
+ }
+}
+
+/*********************************************************************************
+** conversions
+**********************************************************************************/
+int PaintCommands::convertToInt(const QString &str)
+{
+ return qRound(convertToDouble(str));
+}
+
+float PaintCommands::convertToFloat(const QString &str)
+{
+ return float(convertToDouble(str));
+}
+
+double PaintCommands::convertToDouble(const QString &str)
+{
+ static QRegExp re("cp([0-9])([xy])");
+ if (str.toLower() == "width") {
+ if (m_painter->device()->devType() == Qt::Widget)
+ return m_painter->window().width();
+ else
+ return 800;
+ }
+ if (str.toLower() == "height") {
+ if (m_painter->device()->devType() == Qt::Widget)
+ return m_painter->window().height();
+ else
+ return 800;
+ }
+ if (re.indexIn(str) >= 0) {
+ int index = re.cap(1).toInt();
+ bool is_it_x = re.cap(2) == "x";
+ if (index < 0 || index >= m_controlPoints.size()) {
+ qWarning("ERROR: control point index=%d is out of bounds", index);
+ return 0;
+ }
+ return is_it_x ? m_controlPoints.at(index).x() : m_controlPoints.at(index).y();
+ }
+ return str.toDouble();
+}
+
+QColor PaintCommands::convertToColor(const QString &str)
+{
+ static QRegExp alphaColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})");
+ static QRegExp opaqueColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})");
+
+ Q_ASSERT(alphaColor.isValid());
+ Q_ASSERT(opaqueColor.isValid());
+
+ if (alphaColor.indexIn(str) >= 0) {
+ return QColor(alphaColor.cap(2).toInt(0, 16),
+ alphaColor.cap(3).toInt(0, 16),
+ alphaColor.cap(4).toInt(0, 16),
+ alphaColor.cap(1).toInt(0, 16));
+ } else if (opaqueColor.indexIn(str) >= 0) {
+ return QColor(opaqueColor.cap(1).toInt(0, 16),
+ opaqueColor.cap(2).toInt(0, 16),
+ opaqueColor.cap(3).toInt(0, 16));
+ }
+ return QColor(str);
+}
+
+/*********************************************************************************
+** command implementations
+**********************************************************************************/
+void PaintCommands::command_comment(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) comment: %s\n", qPrintable(m_currentCommand));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_import(QRegExp re)
+{
+ QString importFile(re.cap(1));
+ QFileInfo fi(m_filepath);
+ QDir dir = fi.absoluteDir();
+ QFile *file = new QFile(dir.absolutePath() + QDir::separator() + importFile);
+
+ if (importFile.isEmpty() || !file->exists()) {
+ dir.cdUp();
+ dir.cd("data");
+ dir.cd("qps");
+ delete file;
+ file = new QFile(dir.absolutePath() + QDir::separator() + importFile);
+ }
+
+ if (importFile.isEmpty() || !file->exists()) {
+ dir.cdUp();
+ dir.cd("images");
+ delete file;
+ file = new QFile(dir.absolutePath() + QDir::separator() + importFile);
+ }
+
+ if (importFile.isEmpty() || !file->exists()) {
+ printf(" - importing non-existing file at line %d (%s)\n", m_currentCommandIndex,
+ qPrintable(file->fileName()));
+ delete file;
+ return;
+ }
+
+ if (!file->open(QIODevice::ReadOnly)) {
+ printf(" - failed to read file: '%s'\n", qPrintable(file->fileName()));
+ delete file;
+ return;
+ }
+ if (m_verboseMode)
+ printf(" -(lance) importing file at line %d (%s)\n", m_currentCommandIndex,
+ qPrintable(fi.fileName()));
+
+ QFileInfo fileinfo(*file);
+ m_commands[m_currentCommandIndex] = QString("# import file (%1) start").arg(fileinfo.fileName());
+ QTextStream textFile(file);
+ QString rawContent = textFile.readAll();
+ QStringList importedData = rawContent.split('\n', QString::SkipEmptyParts);
+ importedData.append(QString("# import file (%1) end ---").arg(fileinfo.fileName()));
+ insertAt(m_currentCommandIndex, importedData);
+
+ if (m_verboseMode) {
+ printf(" -(lance) Command buffer now looks like:\n");
+ for (int i = 0; i < m_commands.count(); ++i)
+ printf(" ---> {%s}\n", qPrintable(m_commands.at(i)));
+ }
+ delete file;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_begin_block(QRegExp re)
+{
+ const QString &blockName = re.cap(1);
+ if (m_verboseMode)
+ printf(" -(lance) begin_block (%s)\n", qPrintable(blockName));
+
+ m_commands[m_currentCommandIndex] = QString("# begin block (%1)").arg(blockName);
+ QStringList newBlock;
+ int i = m_currentCommandIndex + 1;
+ for (; i < m_commands.count(); ++i) {
+ const QString &nextCmd = m_commands.at(i);
+ if (nextCmd.startsWith("end_block")) {
+ m_commands[i] = QString("# end block (%1)").arg(blockName);
+ break;
+ }
+ newBlock += nextCmd;
+ }
+
+ if (m_verboseMode)
+ for (int j = 0; j < newBlock.count(); ++j)
+ printf(" %d: %s\n", j, qPrintable(newBlock.at(j)));
+
+ if (i >= m_commands.count())
+ printf(" - Warning! Block doesn't have an 'end_block' marker!\n");
+
+ m_blockMap.insert(blockName, newBlock);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_end_block(QRegExp)
+{
+ printf(" - end_block should be consumed by begin_block command.\n");
+ printf(" You will never see this if your block markers are in sync\n");
+ printf(" (noop)\n");
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_repeat_block(QRegExp re)
+{
+ QString blockName = re.cap(1);
+ if (m_verboseMode)
+ printf(" -(lance) repeating block (%s)\n", qPrintable(blockName));
+
+ QStringList block = m_blockMap.value(blockName);
+ if (block.isEmpty()) {
+ printf(" - repeated block (%s) is empty!\n", qPrintable(blockName));
+ return;
+ }
+
+ m_commands[m_currentCommandIndex] = QString("# repeated block (%1)").arg(blockName);
+ insertAt(m_currentCommandIndex, block);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawLine(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double x1 = convertToDouble(caps.at(1));
+ double y1 = convertToDouble(caps.at(2));
+ double x2 = convertToDouble(caps.at(3));
+ double y2 = convertToDouble(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawLine((%.2f, %.2f), (%.2f, %.2f))\n", x1, y1, x2, y2);
+
+ m_painter->drawLine(QLineF(x1, y1, x2, y2));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPath(QRegExp re)
+{
+ if (m_verboseMode)
+ printf(" -(lance) drawPath(name=%s)\n", qPrintable(re.cap(1)));
+
+ QPainterPath &path = m_pathMap[re.cap(1)];
+ m_painter->drawPath(path);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPixmap(QRegExp re)
+{
+ QPixmap pm;
+ pm = m_pixmapMap[re.cap(1)]; // try cache first
+ if (pm.isNull())
+ pm = image_load<QPixmap>(re.cap(1));
+ if (pm.isNull()) {
+ QFileInfo fi(m_filepath);
+ QDir dir = fi.absoluteDir();
+ dir.cdUp();
+ dir.cd("images");
+ QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1));
+ pm = QPixmap(fileName);
+ if (pm.isNull() && !fileName.endsWith(".png")) {
+ fileName.append(".png");
+ pm = QPixmap(fileName);
+ }
+ }
+ if (pm.isNull()) {
+ fprintf(stderr, "ERROR(drawPixmap): failed to load pixmap: '%s'\n",
+ qPrintable(re.cap(1)));
+ return;
+ }
+
+ qreal tx = convertToFloat(re.cap(2));
+ qreal ty = convertToFloat(re.cap(3));
+ qreal tw = convertToFloat(re.cap(4));
+ qreal th = convertToFloat(re.cap(5));
+
+ qreal sx = convertToFloat(re.cap(6));
+ qreal sy = convertToFloat(re.cap(7));
+ qreal sw = convertToFloat(re.cap(8));
+ qreal sh = convertToFloat(re.cap(9));
+
+ if (tw == 0) tw = -1;
+ if (th == 0) th = -1;
+ if (sw == 0) sw = -1;
+ if (sh == 0) sh = -1;
+
+ if (m_verboseMode)
+ printf(" -(lance) drawPixmap('%s' dim=(%d, %d), depth=%d, (%f, %f, %f, %f), (%f, %f, %f, %f)\n",
+ qPrintable(re.cap(1)), pm.width(), pm.height(), pm.depth(),
+ tx, ty, tw, th, sx, sy, sw, sh);
+
+ m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawImage(QRegExp re)
+{
+ QImage im;
+ im = m_imageMap[re.cap(1)]; // try cache first
+ if (im.isNull())
+ im = image_load<QImage>(re.cap(1));
+
+ if (im.isNull()) {
+ QFileInfo fi(m_filepath);
+ QDir dir = fi.absoluteDir();
+ dir.cdUp();
+ dir.cd("images");
+ QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1));
+ im = QImage(fileName);
+ if (im.isNull() && !fileName.endsWith(".png")) {
+ fileName.append(".png");
+ im = QImage(fileName);
+ }
+ }
+ if (im.isNull()) {
+ fprintf(stderr, "ERROR(drawImage): failed to load image: '%s'\n", qPrintable(re.cap(1)));
+ return;
+ }
+
+ qreal tx = convertToFloat(re.cap(2));
+ qreal ty = convertToFloat(re.cap(3));
+ qreal tw = convertToFloat(re.cap(4));
+ qreal th = convertToFloat(re.cap(5));
+
+ qreal sx = convertToFloat(re.cap(6));
+ qreal sy = convertToFloat(re.cap(7));
+ qreal sw = convertToFloat(re.cap(8));
+ qreal sh = convertToFloat(re.cap(9));
+
+ if (tw == 0) tw = -1;
+ if (th == 0) th = -1;
+ if (sw == 0) sw = -1;
+ if (sh == 0) sh = -1;
+
+ if (m_verboseMode)
+ printf(" -(lance) drawImage('%s' dim=(%d, %d), (%f, %f, %f, %f), (%f, %f, %f, %f)\n",
+ qPrintable(re.cap(1)), im.width(), im.height(), tx, ty, tw, th, sx, sy, sw, sh);
+
+ m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh), Qt::OrderedDither | Qt::OrderedAlphaDither);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawTiledPixmap(QRegExp re)
+{
+ QPixmap pm;
+ pm = m_pixmapMap[re.cap(1)]; // try cache first
+ if (pm.isNull())
+ pm = image_load<QPixmap>(re.cap(1));
+ if (pm.isNull()) {
+ QFileInfo fi(m_filepath);
+ QDir dir = fi.absoluteDir();
+ dir.cdUp();
+ dir.cd("images");
+ QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1));
+ pm = QPixmap(fileName);
+ if (pm.isNull() && !fileName.endsWith(".png")) {
+ fileName.append(".png");
+ pm = QPixmap(fileName);
+ }
+ }
+ if (pm.isNull()) {
+ fprintf(stderr, "ERROR(drawTiledPixmap): failed to load pixmap: '%s'\n",
+ qPrintable(re.cap(1)));
+ return;
+ }
+
+ int tx = convertToInt(re.cap(2));
+ int ty = convertToInt(re.cap(3));
+ int tw = convertToInt(re.cap(4));
+ int th = convertToInt(re.cap(5));
+
+ int sx = convertToInt(re.cap(6));
+ int sy = convertToInt(re.cap(7));
+
+ if (tw == 0) tw = -1;
+ if (th == 0) th = -1;
+
+ if (m_verboseMode)
+ printf(" -(lance) drawTiledPixmap('%s' dim=(%d, %d), (%d, %d, %d, %d), (%d, %d)\n",
+ qPrintable(re.cap(1)), pm.width(), pm.height(), tx, ty, tw, th, sx, sy);
+
+ m_painter->drawTiledPixmap(tx, ty, tw, th, pm, sx, sy);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPoint(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ float x = convertToFloat(caps.at(1));
+ float y = convertToFloat(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawPoint(%.2f, %.2f)\n", x, y);
+
+ m_painter->drawPoint(QPointF(x, y));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPolygon(QRegExp re)
+{
+ static QRegExp separators("\\s");
+ QStringList caps = re.capturedTexts();
+ QString cap = caps.at(1);
+ QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
+
+ QPolygonF array;
+ for (int i=0; i + 1<numbers.size(); i+=2)
+ array.append(QPointF(convertToDouble(numbers.at(i)), convertToDouble(numbers.at(i+1))));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawPolygon(size=%d)\n", array.size());
+
+ m_painter->drawPolygon(array, caps.at(2).toLower() == "winding" ? Qt::WindingFill : Qt::OddEvenFill);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPolyline(QRegExp re)
+{
+ static QRegExp separators("\\s");
+ QStringList numbers = re.cap(1).split(separators, QString::SkipEmptyParts);
+
+ QPolygonF array;
+ for (int i=0; i + 1<numbers.size(); i+=2)
+ array.append(QPointF(numbers.at(i).toFloat(),numbers.at(i+1).toFloat()));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawPolyline(size=%d)\n", array.size());
+
+ m_painter->drawPolyline(array.toPolygon());
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ float x = convertToFloat(caps.at(1));
+ float y = convertToFloat(caps.at(2));
+ float w = convertToFloat(caps.at(3));
+ float h = convertToFloat(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawRect(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h);
+
+ m_painter->drawRect(QRectF(x, y, w, h));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawRoundedRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ float x = convertToFloat(caps.at(1));
+ float y = convertToFloat(caps.at(2));
+ float w = convertToFloat(caps.at(3));
+ float h = convertToFloat(caps.at(4));
+ float xr = convertToFloat(caps.at(5));
+ float yr = convertToFloat(caps.at(6));
+
+ int mode = translateEnum(sizeModeTable, caps.at(7), sizeof(sizeModeTable)/sizeof(char *));
+ if (mode < 0)
+ mode = Qt::AbsoluteSize;
+
+ if (m_verboseMode)
+ printf(" -(lance) drawRoundRect(%f, %f, %f, %f, %f, %f, %s)\n", x, y, w, h, xr, yr, mode ? "RelativeSize" : "AbsoluteSize");
+
+ m_painter->drawRoundedRect(QRectF(x, y, w, h), xr, yr, Qt::SizeMode(mode));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawRoundRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int xs = caps.at(5).isEmpty() ? 50 : convertToInt(caps.at(5));
+ int ys = caps.at(6).isEmpty() ? 50 : convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawRoundRect(%d, %d, %d, %d, [%d, %d])\n", x, y, w, h, xs, ys);
+
+ m_painter->drawRoundRect(x, y, w, h, xs, ys);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawEllipse(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ float x = convertToFloat(caps.at(1));
+ float y = convertToFloat(caps.at(2));
+ float w = convertToFloat(caps.at(3));
+ float h = convertToFloat(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawEllipse(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h);
+
+ m_painter->drawEllipse(QRectF(x, y, w, h));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawPie(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawPie(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ m_painter->drawPie(x, y, w, h, angle, sweep);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawChord(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawChord(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ m_painter->drawChord(x, y, w, h, angle, sweep);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawArc(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawArc(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ m_painter->drawArc(x, y, w, h, angle, sweep);
+}
+
+#ifdef QT3_SUPPORT
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawRect(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawRect(%d, %d, %d, %d)\n", x, y, w, h);
+
+ static_cast<Q3Painter*>(m_painter)->drawRect(x, y, w, h);
+#endif
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawRoundRect(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int xrnd = caps.at(5).isEmpty() ? 25 : convertToInt(caps.at(5));
+ int yrnd = caps.at(6).isEmpty() ? 25 : convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawRoundRect(%d, %d, %d, %d), %d, %d\n", x, y, w, h, xrnd, yrnd);
+
+ static_cast<Q3Painter*>(m_painter)->drawRoundRect(x, y, w, h, xrnd, yrnd);
+#endif
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawEllipse(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawEllipse(%d, %d, %d, %d)\n", x, y, w, h);
+
+ static_cast<Q3Painter*>(m_painter)->drawEllipse(x, y, w, h);
+#endif
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawPie(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawPie(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ static_cast<Q3Painter*>(m_painter)->drawPie(x, y, w, h, angle, sweep);
+#endif
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawChord(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawChord(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ static_cast<Q3Painter*>(m_painter)->drawChord(x, y, w, h, angle, sweep);
+#endif
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_qt3_drawArc(QRegExp re)
+{
+ Q_UNUSED(re);
+#ifdef QT3_SUPPORT
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+ int angle = convertToInt(caps.at(5));
+ int sweep = convertToInt(caps.at(6));
+
+ if (m_verboseMode)
+ printf(" -(lance) qt3_drawArc(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
+
+ static_cast<Q3Painter*>(m_painter)->drawArc(x, y, w, h, angle, sweep);
+#endif
+}
+#endif //QT3_SUPPORT
+/***************************************************************************************************/
+void PaintCommands::command_drawText(QRegExp re)
+{
+ if (!m_shouldDrawText)
+ return;
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ QString txt = caps.at(3);
+
+ if (m_verboseMode)
+ printf(" -(lance) drawText(%d, %d, %s)\n", x, y, qPrintable(txt));
+
+ m_painter->drawText(x, y, txt);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_noop(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) noop: %s\n", qPrintable(m_currentCommand));
+
+ if (!m_currentCommand.trimmed().isEmpty()) {
+ fprintf(stderr, "unknown command: '%s'\n", qPrintable(m_currentCommand.trimmed()));
+ }
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_addText(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x = convertToDouble(caps.at(2));
+ double y = convertToDouble(caps.at(3));
+ QString text = caps.at(4);
+
+ if (m_verboseMode)
+ printf(" -(lance) path_addText(%s, %.2f, %.2f, text=%s\n", qPrintable(name), x, y, qPrintable(text));
+
+ m_pathMap[name].addText(x, y, m_painter->font(), text);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_addEllipse(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x = convertToDouble(caps.at(2));
+ double y = convertToDouble(caps.at(3));
+ double w = convertToDouble(caps.at(4));
+ double h = convertToDouble(caps.at(5));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_addEllipse(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h);
+
+ m_pathMap[name].addEllipse(x, y, w, h);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_addRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x = convertToDouble(caps.at(2));
+ double y = convertToDouble(caps.at(3));
+ double w = convertToDouble(caps.at(4));
+ double h = convertToDouble(caps.at(5));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_addRect(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h);
+
+ m_pathMap[name].addRect(x, y, w, h);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_addPolygon(QRegExp re)
+{
+ static QRegExp separators("\\s");
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ QString cap = caps.at(2);
+ QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
+
+ QPolygonF array;
+ for (int i=0; i + 1<numbers.size(); i+=2)
+ array.append(QPointF(numbers.at(i).toFloat(),numbers.at(i+1).toFloat()));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_addPolygon(name=%s, size=%d)\n", qPrintable(name), array.size());
+
+ m_pathMap[name].addPolygon(array);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_arcTo(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x = convertToDouble(caps.at(2));
+ double y = convertToDouble(caps.at(3));
+ double w = convertToDouble(caps.at(4));
+ double h = convertToDouble(caps.at(5));
+ double angle = convertToDouble(caps.at(6));
+ double length = convertToDouble(caps.at(7));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_arcTo(%s, %.2f, %.2f, %.2f, %.2f, angle=%.2f, len=%.2f)\n", qPrintable(name), x, y, w, h, angle, length);
+
+ m_pathMap[name].arcTo(x, y, w, h, angle, length);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_createOutline(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ QString newName = caps.at(2);
+ QPen pen = m_painter->pen();
+
+ if (m_verboseMode)
+ printf(" -(lance) path_createOutline(%s, name=%s, width=%d)\n",
+ qPrintable(name), qPrintable(newName), pen.width());
+
+ if (!m_pathMap.contains(name)) {
+ fprintf(stderr, "createOutline(), unknown path: %s\n", qPrintable(name));
+ return;
+ }
+ QPainterPathStroker stroker;
+ stroker.setWidth(pen.widthF());
+ stroker.setDashPattern(pen.style());
+ stroker.setCapStyle(pen.capStyle());
+ stroker.setJoinStyle(pen.joinStyle());
+ m_pathMap[newName] = stroker.createStroke(m_pathMap[name]);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_cubicTo(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x1 = convertToDouble(caps.at(2));
+ double y1 = convertToDouble(caps.at(3));
+ double x2 = convertToDouble(caps.at(4));
+ double y2 = convertToDouble(caps.at(5));
+ double x3 = convertToDouble(caps.at(6));
+ double y3 = convertToDouble(caps.at(7));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_cubicTo(%s, (%.2f, %.2f), (%.2f, %.2f), (%.2f, %.2f))\n", qPrintable(name), x1, y1, x2, y2, x3, y3);
+
+ m_pathMap[name].cubicTo(x1, y1, x2, y2, x3, y3);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_moveTo(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x1 = convertToDouble(caps.at(2));
+ double y1 = convertToDouble(caps.at(3));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_moveTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1);
+
+ m_pathMap[name].moveTo(x1, y1);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_lineTo(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ double x1 = convertToDouble(caps.at(2));
+ double y1 = convertToDouble(caps.at(3));
+
+ if (m_verboseMode)
+ printf(" -(lance) path_lineTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1);
+
+ m_pathMap[name].lineTo(x1, y1);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_setFillRule(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ bool winding = caps.at(2).toLower() == "winding";
+
+ if (m_verboseMode)
+ printf(" -(lance) path_setFillRule(name=%s, winding=%d)\n", qPrintable(name), winding);
+
+ m_pathMap[name].setFillRule(winding ? Qt::WindingFill : Qt::OddEvenFill);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_closeSubpath(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+
+ if (m_verboseMode)
+ printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name));
+
+ m_pathMap[name].closeSubpath();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_getClipPath(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+
+ if (m_verboseMode)
+ printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name));
+
+ m_pathMap[name] = m_painter->clipPath();
+}
+
+/***************************************************************************************************/
+static void qt_debug_path(const QPainterPath &path, const QString &name)
+{
+ const char *names[] = {
+ "MoveTo ",
+ "LineTo ",
+ "CurveTo ",
+ "CurveToData"
+ };
+
+ printf("\nQPainterPath (%s): elementCount=%d\n", qPrintable(name), path.elementCount());
+ for (int i=0; i<path.elementCount(); ++i) {
+ const QPainterPath::Element &e = path.elementAt(i);
+ Q_ASSERT(e.type >= 0 && e.type <= QPainterPath::CurveToDataElement);
+ printf(" - %3d:: %s, (%.2f, %.2f)\n", i, names[e.type], e.x, e.y);
+ }
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_path_debugPrint(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ qt_debug_path(m_pathMap[name], name);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_region_addRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ int x = convertToInt(caps.at(2));
+ int y = convertToInt(caps.at(3));
+ int w = convertToInt(caps.at(4));
+ int h = convertToInt(caps.at(5));
+
+ if (m_verboseMode)
+ printf(" -(lance) region_addRect(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h);
+
+ m_regionMap[name] += QRect(x, y, w, h);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_region_addEllipse(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ int x = convertToInt(caps.at(2));
+ int y = convertToInt(caps.at(3));
+ int w = convertToInt(caps.at(4));
+ int h = convertToInt(caps.at(5));
+
+ if (m_verboseMode)
+ printf(" -(lance) region_addEllipse(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h);
+
+ m_regionMap[name] += QRegion(x, y, w, h, QRegion::Ellipse);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_region_getClipRegion(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString name = caps.at(1);
+ QRegion region = m_painter->clipRegion();
+
+ if (m_verboseMode)
+ printf(" -(lance) region_getClipRegion(name=%s), bounds=[%d, %d, %d, %d]\n", qPrintable(name),
+ region.boundingRect().x(),
+ region.boundingRect().y(),
+ region.boundingRect().width(),
+ region.boundingRect().height());
+
+ m_regionMap[name] = region;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_resetMatrix(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) resetMatrix()\n");
+
+ m_painter->resetTransform();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_restore(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) restore()\n");
+
+ m_painter->restore();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_rotate(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double angle = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) rotate(%.2f)\n", angle);
+
+ m_painter->rotate(angle);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_rotate_x(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double angle = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) rotate_x(%.2f)\n", angle);
+
+ QTransform transform;
+ transform.rotate(angle, Qt::XAxis);
+ m_painter->setTransform(transform, true);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_rotate_y(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double angle = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) rotate_y(%.2f)\n", angle);
+
+ QTransform transform;
+ transform.rotate(angle, Qt::YAxis);
+ m_painter->setTransform(transform, true);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_save(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) save()\n");
+
+ m_painter->save();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_mapQuadToQuad(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double x1 = convertToDouble(caps.at(1));
+ double y1 = convertToDouble(caps.at(2));
+ double x2 = convertToDouble(caps.at(3));
+ double y2 = convertToDouble(caps.at(4));
+ double x3 = convertToDouble(caps.at(5));
+ double y3 = convertToDouble(caps.at(6));
+ double x4 = convertToDouble(caps.at(7));
+ double y4 = convertToDouble(caps.at(8));
+ QPolygonF poly1(4);
+ poly1[0] = QPointF(x1, y1);
+ poly1[1] = QPointF(x2, y2);
+ poly1[2] = QPointF(x3, y3);
+ poly1[3] = QPointF(x4, y4);
+
+ double x5 = convertToDouble(caps.at(9));
+ double y5 = convertToDouble(caps.at(10));
+ double x6 = convertToDouble(caps.at(11));
+ double y6 = convertToDouble(caps.at(12));
+ double x7 = convertToDouble(caps.at(13));
+ double y7 = convertToDouble(caps.at(14));
+ double x8 = convertToDouble(caps.at(15));
+ double y8 = convertToDouble(caps.at(16));
+ QPolygonF poly2(4);
+ poly2[0] = QPointF(x5, y5);
+ poly2[1] = QPointF(x6, y6);
+ poly2[2] = QPointF(x7, y7);
+ poly2[3] = QPointF(x8, y8);
+
+ if (m_verboseMode)
+ printf(" -(lance) mapQuadToQuad(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f ->\n\t"
+ ",%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
+ x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, x8, y8);
+
+ QTransform trans;
+
+ if (!QTransform::quadToQuad(poly1, poly2, trans)) {
+ qWarning("Couldn't perform quad to quad transformation!");
+ }
+
+ m_painter->setTransform(trans, true);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setMatrix(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double m11 = convertToDouble(caps.at(1));
+ double m12 = convertToDouble(caps.at(2));
+ double m13 = convertToDouble(caps.at(3));
+ double m21 = convertToDouble(caps.at(4));
+ double m22 = convertToDouble(caps.at(5));
+ double m23 = convertToDouble(caps.at(6));
+ double m31 = convertToDouble(caps.at(7));
+ double m32 = convertToDouble(caps.at(8));
+ double m33 = convertToDouble(caps.at(9));
+
+ if (m_verboseMode)
+ printf(" -(lance) setMatrix(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
+ m11, m12, m13, m21, m22, m23, m31, m32, m33);
+
+ QTransform trans;
+ trans.setMatrix(m11, m12, m13,
+ m21, m22, m23,
+ m31, m32, m33);
+
+ m_painter->setTransform(trans, true);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_scale(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double sx = convertToDouble(caps.at(1));
+ double sy = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) scale(%.2f, %.2f)\n", sx, sy);
+
+
+ m_painter->scale(sx, sy);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setBackground(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QColor color = convertToColor(caps.at(1));
+ QString pattern = caps.at(2);
+
+ int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern);
+ if (style < 0)
+ style = Qt::SolidPattern;
+
+ if (m_verboseMode)
+ printf(" -(lance) setBackground(%s, %s)\n", qPrintable(color.name()), qPrintable(pattern));
+
+ m_painter->setBackground(QBrush(color, Qt::BrushStyle(style)));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setOpacity(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double opacity = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) setOpacity(%lf)\n", opacity);
+
+ m_painter->setOpacity(opacity);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setBgMode(QRegExp re)
+{
+ QString cap = re.cap(2);
+ Qt::BGMode mode = Qt::TransparentMode;
+ if (cap.toLower() == QLatin1String("opaquemode") || cap.toLower() == QLatin1String("opaque"))
+ mode = Qt::OpaqueMode;
+
+ if (m_verboseMode)
+ printf(" -(lance) setBackgroundMode(%s)\n", mode == Qt::OpaqueMode ? "OpaqueMode" : "TransparentMode");
+
+ m_painter->setBackgroundMode(mode);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setBrush(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QPixmap pm = image_load<QPixmap>(caps.at(1));
+ if (!pm.isNull()) { // Assume pixmap
+ if (m_verboseMode)
+ printf(" -(lance) setBrush(pixmap=%s, width=%d, height=%d)\n",
+ qPrintable(caps.at(1)), pm.width(), pm.height());
+
+ m_painter->setBrush(QBrush(pm));
+ } else if (caps.at(1).toLower() == "nobrush") {
+ m_painter->setBrush(Qt::NoBrush);
+ if (m_verboseMode)
+ printf(" -(lance) setBrush(Qt::NoBrush)\n");
+ } else {
+ QColor color = convertToColor(caps.at(1));
+ QString pattern = caps.at(2);
+
+ int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern);
+ if (style < 0)
+ style = Qt::SolidPattern;
+
+ if (m_verboseMode)
+ printf(" -(lance) setBrush(%s, %s (%d))\n", qPrintable(color.name()), qPrintable(pattern), style);
+
+ m_painter->setBrush(QBrush(color, Qt::BrushStyle(style)));
+ }
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setBrushOrigin(QRegExp re)
+{
+ int x = convertToInt(re.cap(1));
+ int y = convertToInt(re.cap(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) setBrushOrigin(%d, %d)\n", x, y);
+
+ m_painter->setBrushOrigin(x, y);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_brushTranslate(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double dx = convertToDouble(caps.at(1));
+ double dy = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) brushTranslate(%f, %f)\n", dx, dy);
+
+ QBrush new_brush = m_painter->brush();
+ QTransform brush_matrix = new_brush.transform();
+ brush_matrix.translate(dx, dy);
+ new_brush.setTransform(brush_matrix);
+ m_painter->setBrush(new_brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_brushScale(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double sx = convertToDouble(caps.at(1));
+ double sy = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) brushScale(%f, %f)\n", sx, sy);
+
+ QBrush new_brush = m_painter->brush();
+ QTransform brush_matrix = new_brush.transform();
+ brush_matrix.scale(sx, sy);
+ new_brush.setTransform(brush_matrix);
+ m_painter->setBrush(new_brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_brushRotate(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double rot = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) brushScale(%f)\n", rot);
+
+ QBrush new_brush = m_painter->brush();
+ QTransform brush_matrix = new_brush.transform();
+ brush_matrix.rotate(rot);
+ new_brush.setTransform(brush_matrix);
+ m_painter->setBrush(new_brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_brushShear(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double sx = convertToDouble(caps.at(1));
+ double sy = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) brushShear(%f, %f)\n", sx, sy);
+
+ QBrush new_brush = m_painter->brush();
+ QTransform brush_matrix = new_brush.transform();
+ brush_matrix.shear(sx, sy);
+ new_brush.setTransform(brush_matrix);
+ m_painter->setBrush(new_brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setClipping(QRegExp re)
+{
+ bool clipping = re.cap(1).toLower() == "true";
+
+ if (m_verboseMode)
+ printf(" -(lance) setClipping(%d)\n", clipping);
+
+ m_painter->setClipping(clipping);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setClipRect(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+
+ int combine = translateEnum(clipOperationTable, caps.at(5), Qt::UniteClip + 1);
+ if (combine == -1)
+ combine = Qt::ReplaceClip;
+
+ if (m_verboseMode)
+ printf(" -(lance) setClipRect(%d, %d, %d, %d), %s\n", x, y, w, h, clipOperationTable[combine]);
+
+ m_painter->setClipRect(x, y, w, h, Qt::ClipOperation(combine));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setClipPath(QRegExp re)
+{
+ int combine = translateEnum(clipOperationTable, re.cap(2), Qt::UniteClip + 1);
+ if (combine == -1)
+ combine = Qt::ReplaceClip;
+
+ if (m_verboseMode)
+ printf(" -(lance) setClipPath(name=%s), %s\n", qPrintable(re.cap(1)), clipOperationTable[combine]);
+
+ if (!m_pathMap.contains(re.cap(1)))
+ fprintf(stderr, " - setClipPath, no such path");
+ m_painter->setClipPath(m_pathMap[re.cap(1)], Qt::ClipOperation(combine));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setClipRegion(QRegExp re)
+{
+ int combine = translateEnum(clipOperationTable, re.cap(2), Qt::UniteClip + 1);
+ if (combine == -1)
+ combine = Qt::ReplaceClip;
+ QRegion r = m_regionMap[re.cap(1)];
+
+ if (m_verboseMode)
+ printf(" -(lance) setClipRegion(name=%s), bounds=[%d, %d, %d, %d], %s\n",
+ qPrintable(re.cap(1)),
+ r.boundingRect().x(),
+ r.boundingRect().y(),
+ r.boundingRect().width(),
+ r.boundingRect().height(),
+ clipOperationTable[combine]);
+
+ m_painter->setClipRegion(m_regionMap[re.cap(1)], Qt::ClipOperation(combine));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setFont(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QString family = caps.at(1);
+ int size = convertToInt(caps.at(2));
+
+ int weight = translateEnum(fontWeightTable, re.cap(3).toLower(), 5);
+ if (weight != -1) {
+ switch (weight) {
+ case 0: weight = QFont::Light; break;
+ case 1: weight = QFont::Normal; break;
+ case 2: weight = QFont::DemiBold; break;
+ case 3: weight = QFont::Bold; break;
+ case 4: weight = QFont::Black; break;
+ }
+ } else {
+ weight = convertToInt(re.cap(3));
+ }
+
+ bool italic = caps.at(4).toLower() == "true" || caps.at(4).toLower() == "italic";
+
+ QFont font(family, size, weight, italic);
+
+#if QT_VERSION >= 0x040800
+ int hinting = translateEnum(fontHintingTable, caps.at(5), 4);
+ if (hinting == -1)
+ hinting = 0;
+ else
+ font.setHintingPreference(QFont::HintingPreference(hinting));
+#else
+ int hinting = 1;
+#endif
+ if (m_verboseMode)
+ printf(" -(lance) setFont(family=%s, size=%d, weight=%d, italic=%d hinting=%s\n",
+ qPrintable(family), size, weight, italic, fontHintingTable[hinting]);
+
+ m_painter->setFont(font);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setPen(QRegExp re)
+{
+ QString cap = re.cap(1);
+ int style = translateEnum(penStyleTable, cap, Qt::DashDotDotLine + 1);
+ if (style >= 0) {
+ if (m_verboseMode)
+ printf(" -(lance) setPen(%s)\n", qPrintable(cap));
+
+ m_painter->setPen(Qt::PenStyle(style));
+ } else if (cap.toLower() == "brush") {
+ QPen pen(m_painter->brush(), 0);
+ if (m_verboseMode) {
+ printf(" -(lance) setPen(brush), style=%d, color=%08x\n",
+ pen.brush().style(), pen.color().rgba());
+ }
+ m_painter->setPen(pen);
+ } else {
+ QColor color = convertToColor(cap);
+ if (m_verboseMode)
+ printf(" -(lance) setPen(%s)\n", qPrintable(color.name()));
+
+ m_painter->setPen(color);
+ }
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setPen2(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QBrush brush;
+
+ if (caps.at(1).toLower() == "brush")
+ brush = m_painter->brush();
+ else
+ brush = convertToColor(caps.at(1));
+
+ double width = convertToDouble(caps.at(2));
+ int penStyle = translateEnum(penStyleTable, caps.at(3), Qt::DashDotDotLine + 1);
+ if (penStyle < 0)
+ penStyle = Qt::SolidLine;
+
+ Qt::PenCapStyle capStyle = Qt::SquareCap;
+ if (caps.at(4).toLower() == "flatcap") capStyle = Qt::FlatCap;
+ else if (caps.at(4).toLower() == "squarecap") capStyle = Qt::SquareCap;
+ else if (caps.at(4).toLower() == "roundcap") capStyle = Qt::RoundCap;
+ else if (!caps.at(4).isEmpty())
+ fprintf(stderr, "ERROR: setPen, unknown capStyle: %s\n", qPrintable(caps.at(4)));
+
+ Qt::PenJoinStyle joinStyle = Qt::BevelJoin;
+ if (caps.at(5).toLower() == "miterjoin") joinStyle = Qt::MiterJoin;
+ else if (caps.at(5).toLower() == "beveljoin") joinStyle = Qt::BevelJoin;
+ else if (caps.at(5).toLower() == "roundjoin") joinStyle = Qt::RoundJoin;
+ else if (!caps.at(5).isEmpty())
+ fprintf(stderr, "ERROR: setPen, unknown joinStyle: %s\n", qPrintable(caps.at(5)));
+
+ if (m_verboseMode)
+ printf(" -(lance) setPen(%s, width=%f, style=%d, cap=%d, join=%d)\n",
+ qPrintable(brush.color().name()), width, penStyle, capStyle, joinStyle);
+
+ m_painter->setPen(QPen(brush, width, Qt::PenStyle(penStyle), capStyle, joinStyle));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setRenderHint(QRegExp re)
+{
+ QString hintString = re.cap(1).toLower();
+ bool on = re.cap(2).isEmpty() || re.cap(2).toLower() == "true";
+ if (hintString.contains("antialiasing")) {
+ if (m_verboseMode)
+ printf(" -(lance) setRenderHint Antialiasing\n");
+
+ m_painter->setRenderHint(QPainter::Antialiasing, on);
+ } else if (hintString.contains("smoothpixmaptransform")) {
+ if (m_verboseMode)
+ printf(" -(lance) setRenderHint SmoothPixmapTransform\n");
+ m_painter->setRenderHint(QPainter::SmoothPixmapTransform, on);
+ } else {
+ fprintf(stderr, "ERROR(setRenderHint): unknown hint '%s'\n", qPrintable(hintString));
+ }
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_clearRenderHint(QRegExp /*re*/)
+{
+ m_painter->setRenderHint(QPainter::Antialiasing, false);
+ m_painter->setRenderHint(QPainter::SmoothPixmapTransform, false);
+ if (m_verboseMode)
+ printf(" -(lance) clearRenderHint\n");
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_setCompositionMode(QRegExp re)
+{
+ QString modeString = re.cap(1).toLower();
+ int mode = translateEnum(compositionModeTable, modeString, 33);
+
+ if (mode < 0 || mode > QPainter::RasterOp_SourceAndNotDestination) {
+ fprintf(stderr, "ERROR: invalid mode: %s\n", qPrintable(modeString));
+ return;
+ }
+
+ if (m_verboseMode)
+ printf(" -(lance) setCompositionMode: %d: %s\n", mode, qPrintable(modeString));
+
+ m_painter->setCompositionMode(QPainter::CompositionMode(mode));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_translate(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double dx = convertToDouble(caps.at(1));
+ double dy = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) translate(%f, %f)\n", dx, dy);
+
+ m_painter->translate(dx, dy);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_pixmap_load(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString fileName = caps.at(1);
+ QString name = caps.at(2);
+
+ if (name.isEmpty())
+ name = fileName;
+
+ QImage im = image_load<QImage>(fileName);
+ QPixmap px = QPixmap::fromImage(im, Qt::OrderedDither | Qt::OrderedAlphaDither);
+
+ if (m_verboseMode)
+ printf(" -(lance) pixmap_load(%s as %s), size=[%d, %d], depth=%d\n",
+ qPrintable(fileName), qPrintable(name),
+ px.width(), px.height(), px.depth());
+
+ m_pixmapMap[name] = px;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_bitmap_load(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString fileName = caps.at(1);
+ QString name = caps.at(2);
+
+ if (name.isEmpty())
+ name = fileName;
+
+ QBitmap bm = image_load<QBitmap>(fileName);
+
+ if (m_verboseMode)
+ printf(" -(lance) bitmap_load(%s as %s), size=[%d, %d], depth=%d\n",
+ qPrintable(fileName), qPrintable(name),
+ bm.width(), bm.height(), bm.depth());
+
+ m_pixmapMap[name] = bm;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_pixmap_setMask(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ QBitmap mask = image_load<QBitmap>(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) pixmap_setMask(%s, %s)\n", qPrintable(caps.at(1)), qPrintable(caps.at(2)));
+
+ if (!m_pixmapMap[caps.at(1)].isNull())
+ m_pixmapMap[caps.at(1)].setMask(mask);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_image_load(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString fileName = caps.at(1);
+ QString name = caps.at(2);
+
+ if (name.isEmpty())
+ name = fileName;
+
+ QImage image = image_load<QImage>(fileName);
+
+ if (m_verboseMode)
+ printf(" -(lance) image_load(%s as %s), size=[%d, %d], format=%d\n",
+ qPrintable(fileName), qPrintable(name),
+ image.width(), image.height(), image.format());
+
+ m_imageMap[name] = image;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_image_setColorCount(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString name = caps.at(1);
+ int count = convertToInt(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) image_setColorCount(%s), %d -> %d\n",
+ qPrintable(name), m_imageMap[name].colorCount(), count);
+
+ m_imageMap[name].setColorCount(count);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_image_setColor(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString name = caps.at(1);
+ int index = convertToInt(caps.at(2));
+ QColor color = convertToColor(caps.at(3));
+
+ if (m_verboseMode)
+ printf(" -(lance) image_setColor(%s), %d = %08x\n", qPrintable(name), index, color.rgba());
+
+ m_imageMap[name].setColor(index, color.rgba());
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_abort(QRegExp)
+{
+ m_abort = true;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_clearStops(QRegExp)
+{
+ if (m_verboseMode)
+ printf(" -(lance) gradient_clearStops\n");
+ m_gradientStops.clear();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_appendStop(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double pos = convertToDouble(caps.at(1));
+ QColor color = convertToColor(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_appendStop(%.2f, %x)\n", pos, color.rgba());
+
+ m_gradientStops << QGradientStop(pos, color);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_setLinear(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double x1 = convertToDouble(caps.at(1));
+ double y1 = convertToDouble(caps.at(2));
+ double x2 = convertToDouble(caps.at(3));
+ double y2 = convertToDouble(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n",
+ x1, y1, x2, y2, m_gradientSpread);
+
+ QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2));
+ lg.setStops(m_gradientStops);
+ lg.setSpread(m_gradientSpread);
+ lg.setCoordinateMode(m_gradientCoordinate);
+ QBrush brush(lg);
+ QTransform brush_matrix = m_painter->brush().transform();
+ brush.setTransform(brush_matrix);
+ m_painter->setBrush(brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_setLinearPen(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double x1 = convertToDouble(caps.at(1));
+ double y1 = convertToDouble(caps.at(2));
+ double x2 = convertToDouble(caps.at(3));
+ double y2 = convertToDouble(caps.at(4));
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n",
+ x1, y1, x2, y2, m_gradientSpread);
+
+ QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2));
+ lg.setStops(m_gradientStops);
+ lg.setSpread(m_gradientSpread);
+ lg.setCoordinateMode(m_gradientCoordinate);
+ QPen pen = m_painter->pen();
+ pen.setBrush(lg);
+ m_painter->setPen(pen);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_setRadial(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double cx = convertToDouble(caps.at(1));
+ double cy = convertToDouble(caps.at(2));
+ double rad = convertToDouble(caps.at(3));
+ double fx = convertToDouble(caps.at(4));
+ double fy = convertToDouble(caps.at(5));
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_setRadial center=(%.2f, %.2f), radius=%.2f focal=(%.2f, %.2f), "
+ "spread=%d\n",
+ cx, cy, rad, fx, fy, m_gradientSpread);
+
+ QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy));
+ rg.setStops(m_gradientStops);
+ rg.setSpread(m_gradientSpread);
+ rg.setCoordinateMode(m_gradientCoordinate);
+ QBrush brush(rg);
+ QTransform brush_matrix = m_painter->brush().transform();
+ brush.setTransform(brush_matrix);
+ m_painter->setBrush(brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_setConical(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double cx = convertToDouble(caps.at(1));
+ double cy = convertToDouble(caps.at(2));
+ double angle = convertToDouble(caps.at(3));
+
+ if (m_verboseMode) {
+ printf(" -(lance) gradient_setConical center=(%.2f, %.2f), angle=%.2f\n, spread=%d",
+ cx, cy, angle, m_gradientSpread);
+ }
+
+ QConicalGradient cg(QPointF(cx, cy), angle);
+ cg.setStops(m_gradientStops);
+ cg.setSpread(m_gradientSpread);
+ cg.setCoordinateMode(m_gradientCoordinate);
+ QBrush brush(cg);
+ QTransform brush_matrix = m_painter->brush().transform();
+ brush.setTransform(brush_matrix);
+ m_painter->setBrush(brush);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_gradient_setSpread(QRegExp re)
+{
+ int spreadMethod = translateEnum(spreadMethodTable, re.cap(1), 3);
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_setSpread %d=[%s]\n", spreadMethod, spreadMethodTable[spreadMethod]);
+
+ m_gradientSpread = QGradient::Spread(spreadMethod);
+}
+
+void PaintCommands::command_gradient_setCoordinateMode(QRegExp re)
+{
+ int coord = translateEnum(coordinateMethodTable, re.cap(1), 3);
+
+ if (m_verboseMode)
+ printf(" -(lance) gradient_setCoordinateMode %d=[%s]\n", coord,
+ coordinateMethodTable[coord]);
+
+ m_gradientCoordinate = QGradient::CoordinateMode(coord);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_surface_begin(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double x = convertToDouble(caps.at(1));
+ double y = convertToDouble(caps.at(2));
+ double w = convertToDouble(caps.at(3));
+ double h = convertToDouble(caps.at(4));
+
+ if (m_surface_painter) {
+ fprintf(stderr, "ERROR: surface already active");
+ return;
+ }
+
+ if (m_verboseMode)
+ printf(" -(lance) surface_begin, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n", x, y, w, h);
+
+ m_surface_painter = m_painter;
+
+ if (m_type == OpenGLType || m_type == OpenGLPBufferType) {
+#ifndef QT_NO_OPENGL
+ m_surface_pbuffer = new QGLPixelBuffer(qRound(w), qRound(h));
+ m_painter = new QPainter(m_surface_pbuffer);
+ m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent);
+#endif
+#ifdef Q_WS_X11
+ } else if (m_type == WidgetType) {
+ m_surface_pixmap = QPixmap(qRound(w), qRound(h));
+ m_surface_pixmap.fill(Qt::transparent);
+ m_painter = new QPainter(&m_surface_pixmap);
+#endif
+ } else {
+ m_surface_image = QImage(qRound(w), qRound(h), QImage::Format_ARGB32_Premultiplied);
+ m_surface_image.fill(0);
+ m_painter = new QPainter(&m_surface_image);
+ }
+ m_surface_rect = QRectF(x, y, w, h);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_surface_end(QRegExp)
+{
+ if (!m_surface_painter) {
+ fprintf(stderr, "ERROR: surface not active");
+ return;
+ }
+
+ if (m_verboseMode)
+ printf(" -(lance) surface_end, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n",
+ m_surface_rect.x(),
+ m_surface_rect.y(),
+ m_surface_rect.width(),
+ m_surface_rect.height());
+ m_painter->end();
+
+ delete m_painter;
+ m_painter = m_surface_painter;
+ m_surface_painter = 0;
+
+ if (m_type == OpenGLType || m_type == OpenGLPBufferType) {
+#ifndef QT_NO_OPENGL
+ QImage image = m_surface_pbuffer->toImage();
+ QImage new_image(image.bits(), image.width(),
+ image.height(), QImage::Format_ARGB32_Premultiplied);
+ QPaintDevice *pdev = m_painter->device();
+ if (pdev->devType() == QInternal::Widget) {
+ QWidget *w = static_cast<QWidget *>(pdev);
+ static_cast<QGLWidget *>(w)->makeCurrent();
+ } else if (pdev->devType() == QInternal::Pbuffer) {
+ static_cast<QGLPixelBuffer *>(pdev)->makeCurrent();
+ }
+
+ m_painter->drawImage(m_surface_rect, new_image);
+
+ delete m_surface_pbuffer;
+ m_surface_pbuffer = 0;
+#endif
+#ifdef Q_WS_X11
+ } else if (m_type == WidgetType) {
+ m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap);
+ m_surface_pixmap = QPixmap();
+#endif
+ } else {
+ m_painter->drawImage(m_surface_rect, m_surface_image);
+ m_surface_image = QImage();
+ }
+ m_surface_rect = QRectF();
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_image_convertToFormat(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString srcName = caps.at(1);
+ QString destName = caps.at(2);
+
+ if (!m_imageMap.contains(srcName)) {
+ fprintf(stderr, "ERROR(convertToFormat): no such image '%s'\n", qPrintable(srcName));
+ return;
+ }
+
+ int format = translateEnum(imageFormatTable, caps.at(3), QImage::NImageFormats);
+ if (format < 0 || format >= QImage::NImageFormats) {
+ fprintf(stderr, "ERROR(convertToFormat): invalid format %d = '%s'\n",
+ format, qPrintable(caps.at(3)));
+ return;
+ }
+
+ QImage src = m_imageMap[srcName];
+ QImage dest = src.convertToFormat(QImage::Format(format),
+ Qt::OrderedAlphaDither | Qt::OrderedDither);
+
+ if (m_verboseMode) {
+ printf(" -(lance) convertToFormat %s:%d -> %s:%d\n",
+ qPrintable(srcName), src.format(),
+ qPrintable(destName), dest.format());
+ }
+
+ m_imageMap[destName] = dest;
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_textlayout_draw(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString text = caps.at(1);
+ double width = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) textlayout_draw text='%s', width=%f\n",
+ qPrintable(text), width);
+
+ QFont copy = m_painter->font();
+ copy.setPointSize(10);
+
+ QTextLayout layout(text, copy, m_painter->device());
+ layout.beginLayout();
+
+ double y_offset = 0;
+
+ while (true) {
+ QTextLine line = layout.createLine();
+ if (!line.isValid())
+ break;
+ line.setLineWidth(width);
+ line.setPosition(QPointF(0, y_offset));
+
+ y_offset += line.height();
+ }
+
+ layout.draw(m_painter, QPointF(0, 0));
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_pen_setDashOffset(QRegExp re)
+{
+ QStringList caps = re.capturedTexts();
+ double offset = convertToDouble(caps.at(1));
+
+ if (m_verboseMode)
+ printf(" -(lance) setDashOffset(%lf)\n", offset);
+
+ QPen p = m_painter->pen();
+ p.setDashOffset(offset);
+ m_painter->setPen(p);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_pen_setDashPattern(QRegExp re)
+{
+ static QRegExp separators("\\s");
+ QStringList caps = re.capturedTexts();
+ QString cap = caps.at(1);
+ QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
+
+ QVector<qreal> pattern;
+ for (int i=0; i<numbers.size(); ++i)
+ pattern.append(convertToDouble(numbers.at(i)));
+
+ if (m_verboseMode)
+ printf(" -(lance) pen_setDashPattern(size=%d)\n", pattern.size());
+
+ QPen p = m_painter->pen();
+ p.setDashPattern(pattern);
+ m_painter->setPen(p);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_pen_setCosmetic(QRegExp re)
+{
+ QString hm = re.capturedTexts().at(1);
+ bool on = hm == "true" || hm == "yes" || hm == "on";
+
+ if (m_verboseMode) {
+ printf(" -(lance) pen_setCosmetic(%s)\n", on ? "true" : "false");
+ }
+
+ QPen p = m_painter->pen();
+ p.setCosmetic(on);
+
+ m_painter->setPen(p);
+}
+
+/***************************************************************************************************/
+void PaintCommands::command_drawConvexPolygon(QRegExp re)
+{
+ static QRegExp separators("\\s");
+ QStringList caps = re.capturedTexts();
+ QString cap = caps.at(1);
+ QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
+
+ QPolygonF array;
+ for (int i=0; i + 1<numbers.size(); i+=2)
+ array.append(QPointF(convertToDouble(numbers.at(i)), convertToDouble(numbers.at(i+1))));
+
+ if (m_verboseMode)
+ printf(" -(lance) drawConvexPolygon(size=%d)\n", array.size());
+
+
+ m_painter->drawConvexPolygon(array);
+}
diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h
new file mode 100644
index 0000000000..2740412654
--- /dev/null
+++ b/tests/arthur/common/paintcommands.h
@@ -0,0 +1,340 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PAINTCOMMANDS_H
+#define PAINTCOMMANDS_H
+
+#include <qcolor.h>
+#include <qmap.h>
+#include <qpainterpath.h>
+#include <qregion.h>
+#include <qstringlist.h>
+#include <qpixmap.h>
+#include <qbrush.h>
+#include <qhash.h>
+
+QT_FORWARD_DECLARE_CLASS(QPainter)
+QT_FORWARD_DECLARE_CLASS(QRegExp)
+#ifndef QT_NO_OPENGL
+QT_FORWARD_DECLARE_CLASS(QGLPixelBuffer)
+#endif
+
+enum DeviceType {
+ WidgetType,
+ BitmapType,
+ PixmapType,
+ ImageType,
+ ImageMonoType,
+ OpenGLType,
+ OpenGLPBufferType,
+ PictureType,
+ PrinterType,
+ PdfType,
+ PsType,
+ GrabType,
+ CustomDeviceType,
+ CustomWidgetType,
+ ImageWidgetType
+};
+
+/************************************************************************/
+class PaintCommands
+{
+public:
+ // construction / initialization
+ PaintCommands(const QStringList &cmds, int w, int h)
+ : m_painter(0)
+ , m_surface_painter(0)
+ , m_commands(cmds)
+ , m_gradientSpread(QGradient::PadSpread)
+ , m_gradientCoordinate(QGradient::LogicalMode)
+ , m_width(w)
+ , m_height(h)
+ , m_verboseMode(false)
+ , m_type(WidgetType)
+ , m_checkers_background(true)
+ , m_shouldDrawText(true)
+ { staticInit(); }
+
+public:
+ void setCheckersBackground(bool b) { staticInit(); m_checkers_background = b; }
+ void setContents(const QStringList &cmds) {
+ staticInit();
+ m_blockMap.clear();
+ m_pathMap.clear();
+ m_pixmapMap.clear();
+ m_imageMap.clear();
+ m_regionMap.clear();
+ m_gradientStops.clear();
+ m_controlPoints.clear();
+ m_gradientSpread = QGradient::PadSpread;
+ m_gradientCoordinate = QGradient::LogicalMode;
+ m_commands = cmds;
+
+
+ }
+ void setPainter(QPainter *pt) { staticInit(); m_painter = pt; }
+ void setType(DeviceType t) { staticInit(); m_type = t; }
+ void setFilePath(const QString &path) { staticInit(); m_filepath = path; }
+ void setControlPoints(const QVector<QPointF> &points) { staticInit(); m_controlPoints = points; }
+ void setVerboseMode(bool v) { staticInit(); m_verboseMode = v; }
+ void insertAt(int commandIndex, const QStringList &newCommands);
+ void setShouldDrawText(bool drawText) { m_shouldDrawText = drawText; }
+
+ // run
+ void runCommands();
+
+private:
+ // run
+ void runCommand(const QString &scriptLine);
+
+ // conversion methods
+ int convertToInt(const QString &str);
+ double convertToDouble(const QString &str);
+ float convertToFloat(const QString &str);
+ QColor convertToColor(const QString &str);
+
+ // commands: comments
+ void command_comment(QRegExp re);
+
+ // commands: importer
+ void command_import(QRegExp re);
+
+ // commands: blocks
+ void command_begin_block(QRegExp re);
+ void command_end_block(QRegExp re);
+ void command_repeat_block(QRegExp re);
+
+ // commands: misc
+ void command_textlayout_draw(QRegExp re);
+ void command_abort(QRegExp re);
+
+ // commands: noops
+ void command_noop(QRegExp re);
+
+ // commands: setters
+ void command_setBgMode(QRegExp re);
+ void command_setBackground(QRegExp re);
+ void command_setOpacity(QRegExp re);
+ void command_path_setFillRule(QRegExp re);
+ void command_setBrush(QRegExp re);
+ void command_setBrushOrigin(QRegExp re);
+ void command_brushTranslate(QRegExp re);
+ void command_brushRotate(QRegExp re);
+ void command_brushScale(QRegExp re);
+ void command_brushShear(QRegExp re);
+ void command_setClipPath(QRegExp re);
+ void command_setClipRect(QRegExp re);
+ void command_setClipRectangle(QRegExp re);
+ void command_setClipRegion(QRegExp re);
+ void command_setClipping(QRegExp re);
+ void command_setCompositionMode(QRegExp re);
+ void command_setFont(QRegExp re);
+ void command_setPen(QRegExp re);
+ void command_setPen2(QRegExp re);
+ void command_pen_setDashOffset(QRegExp re);
+ void command_pen_setDashPattern(QRegExp re);
+ void command_pen_setCosmetic(QRegExp re);
+ void command_setRenderHint(QRegExp re);
+ void command_clearRenderHint(QRegExp re);
+ void command_gradient_appendStop(QRegExp re);
+ void command_gradient_clearStops(QRegExp re);
+ void command_gradient_setConical(QRegExp re);
+ void command_gradient_setLinear(QRegExp re);
+ void command_gradient_setRadial(QRegExp re);
+ void command_gradient_setLinearPen(QRegExp re);
+ void command_gradient_setSpread(QRegExp re);
+ void command_gradient_setCoordinateMode(QRegExp re);
+
+ // commands: drawing ops
+#ifdef QT3_SUPPORT
+ void command_qt3_drawArc(QRegExp re);
+ void command_qt3_drawChord(QRegExp re);
+ void command_qt3_drawEllipse(QRegExp re);
+ void command_qt3_drawPie(QRegExp re);
+ void command_qt3_drawRect(QRegExp re);
+ void command_qt3_drawRoundRect(QRegExp re);
+#endif
+ void command_drawArc(QRegExp re);
+ void command_drawChord(QRegExp re);
+ void command_drawConvexPolygon(QRegExp re);
+ void command_drawEllipse(QRegExp re);
+ void command_drawImage(QRegExp re);
+ void command_drawLine(QRegExp re);
+ void command_drawPath(QRegExp re);
+ void command_drawPie(QRegExp re);
+ void command_drawPixmap(QRegExp re);
+ void command_drawPoint(QRegExp re);
+ void command_drawPolygon(QRegExp re);
+ void command_drawPolyline(QRegExp re);
+ void command_drawRect(QRegExp re);
+ void command_drawRoundedRect(QRegExp re);
+ void command_drawRoundRect(QRegExp re);
+ void command_drawText(QRegExp re);
+ void command_drawTiledPixmap(QRegExp re);
+ void command_path_addEllipse(QRegExp re);
+ void command_path_addPolygon(QRegExp re);
+ void command_path_addRect(QRegExp re);
+ void command_path_addText(QRegExp re);
+ void command_path_arcTo(QRegExp re);
+ void command_path_closeSubpath(QRegExp re);
+ void command_path_createOutline(QRegExp re);
+ void command_path_cubicTo(QRegExp re);
+ void command_path_debugPrint(QRegExp re);
+ void command_path_lineTo(QRegExp re);
+ void command_path_moveTo(QRegExp re);
+ void command_region_addEllipse(QRegExp re);
+ void command_region_addRect(QRegExp re);
+
+ // getters
+ void command_region_getClipRegion(QRegExp re);
+ void command_path_getClipPath(QRegExp re);
+
+ // commands: surface begin/end
+ void command_surface_begin(QRegExp re);
+ void command_surface_end(QRegExp re);
+
+ // commands: save/restore painter state
+ void command_restore(QRegExp re);
+ void command_save(QRegExp re);
+
+ // commands: pixmap/image
+ void command_pixmap_load(QRegExp re);
+ void command_pixmap_setMask(QRegExp re);
+ void command_bitmap_load(QRegExp re);
+ void command_image_convertToFormat(QRegExp re);
+ void command_image_load(QRegExp re);
+ void command_image_setColor(QRegExp re);
+ void command_image_setColorCount(QRegExp re);
+
+ // commands: transformation
+ void command_resetMatrix(QRegExp re);
+ void command_translate(QRegExp re);
+ void command_rotate(QRegExp re);
+ void command_rotate_x(QRegExp re);
+ void command_rotate_y(QRegExp re);
+ void command_scale(QRegExp re);
+ void command_mapQuadToQuad(QRegExp re);
+ void command_setMatrix(QRegExp re);
+
+ // attributes
+ QPainter *m_painter;
+ QPainter *m_surface_painter;
+ QImage m_surface_image;
+ QPixmap m_surface_pixmap;
+#ifndef QT_NO_OPENGL
+ QGLPixelBuffer *m_surface_pbuffer;
+#endif
+ QRectF m_surface_rect;
+ QStringList m_commands;
+ QString m_currentCommand;
+ int m_currentCommandIndex;
+ QString m_filepath;
+ QMap<QString, QStringList> m_blockMap;
+ QMap<QString, QPainterPath> m_pathMap;
+ QMap<QString, QPixmap> m_pixmapMap;
+ QMap<QString, QImage> m_imageMap;
+ QMap<QString, QRegion> m_regionMap;
+ QGradientStops m_gradientStops;
+ QGradient::Spread m_gradientSpread;
+ QGradient::CoordinateMode m_gradientCoordinate;
+ bool m_abort;
+ int m_width;
+ int m_height;
+
+ bool m_verboseMode;
+ DeviceType m_type;
+ bool m_checkers_background;
+ bool m_shouldDrawText;
+
+ QVector<QPointF> m_controlPoints;
+
+ // painter functionalities string tables
+ static const char *brushStyleTable[];
+ static const char *penStyleTable[];
+ static const char *fontWeightTable[];
+ static const char *fontHintingTable[];
+ static const char *clipOperationTable[];
+ static const char *spreadMethodTable[];
+ static const char *coordinateMethodTable[];
+ static const char *compositionModeTable[];
+ static const char *imageFormatTable[];
+ static const char *sizeModeTable[];
+ static int translateEnum(const char *table[], const QString &pattern, int limit);
+
+ // utility
+ template <typename T> T image_load(const QString &filepath);
+
+ // commands dictionary management
+ static void staticInit();
+
+public:
+ struct PaintCommandInfos
+ {
+ PaintCommandInfos(QString id, void (PaintCommands::*p)(QRegExp), QRegExp r, QString sy, QString sa)
+ : identifier(id)
+ , regExp(r)
+ , syntax(sy)
+ , sample(sa)
+ , paintMethod(p)
+ {}
+ PaintCommandInfos(QString title)
+ : identifier(title), paintMethod(0) {}
+ bool isSectionHeader() const { return paintMethod == 0; }
+ QString identifier;
+ QRegExp regExp;
+ QString syntax;
+ QString sample;
+ void (PaintCommands::*paintMethod)(QRegExp);
+ };
+
+ static PaintCommandInfos *findCommandById(const QString &identifier) {
+ for (int i=0; i<s_commandInfoTable.size(); i++)
+ if (s_commandInfoTable[i].identifier == identifier)
+ return &s_commandInfoTable[i];
+ return 0;
+ }
+
+ static QList<PaintCommandInfos> s_commandInfoTable;
+ static QList<QPair<QString,QStringList> > s_enumsTable;
+ static QMultiHash<QString, int> s_commandHash;
+};
+
+#endif // PAINTCOMMANDS_H
diff --git a/tests/arthur/common/qbaselinetest.cpp b/tests/arthur/common/qbaselinetest.cpp
new file mode 100644
index 0000000000..1d028f8b23
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.cpp
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbaselinetest.h"
+#include "baselineprotocol.h"
+
+namespace QBaselineTest {
+
+BaselineProtocol proto;
+bool connected = false;
+bool triedConnecting = false;
+
+QByteArray curFunction;
+ImageItemList itemList;
+bool gotBaselines;
+
+
+bool connect(QByteArray *msg, bool *error)
+{
+ if (!triedConnecting) {
+ triedConnecting = true;
+ if (!proto.connect(QTest::testObject()->metaObject()->className())) {
+ *msg += "Failed to connect to baseline server: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return false;
+ }
+ connected = true;
+ }
+ if (!connected) {
+ *msg = "Not connected to baseline server.";
+ *error = true;
+ return false;
+ }
+ return true;
+}
+
+
+bool compareItem(const ImageItem &baseline, const QImage &img, QByteArray *msg, bool *error)
+{
+ ImageItem item = baseline;
+ item.image = img;
+ item.imageChecksums.clear();
+ item.imageChecksums.prepend(ImageItem::computeChecksum(img));
+ QByteArray srvMsg;
+ switch (baseline.status) {
+ case ImageItem::Ok:
+ break;
+ case ImageItem::IgnoreItem :
+ qDebug() << msg->constData() << "Ignored, blacklisted on server.";
+ return true;
+ break;
+ case ImageItem::BaselineNotFound:
+ if (proto.submitNewBaseline(item, &srvMsg))
+ qDebug() << msg->constData() << "Baseline not found on server. New baseline uploaded.";
+ else
+ qDebug() << msg->constData() << "Baseline not found on server. Uploading of new baseline failed:" << srvMsg;
+ return true;
+ break;
+ default:
+ qWarning() << "Unexpected reply from baseline server.";
+ return true;
+ break;
+ }
+ *error = false;
+ // The actual comparison of the given image with the baseline:
+ if (baseline.imageChecksums.contains(item.imageChecksums.at(0)))
+ return true;
+ proto.submitMismatch(item, &srvMsg);
+ *msg += "Mismatch. See report:\n " + srvMsg;
+ return false;
+}
+
+bool checkImage(const QImage &img, const char *name, quint16 checksum, QByteArray *msg, bool *error)
+{
+ if (!connected && !connect(msg, error))
+ return true;
+
+ QByteArray itemName;
+ bool hasName = qstrlen(name);
+ const char *tag = QTest::currentDataTag();
+ if (qstrlen(tag)) {
+ itemName = tag;
+ if (hasName)
+ itemName.append('_').append(name);
+ } else {
+ itemName = hasName ? name : "default_name";
+ }
+
+ *msg = "Baseline check of image '" + itemName + "': ";
+
+
+ ImageItem item;
+ item.itemName = QString::fromLatin1(itemName);
+ item.itemChecksum = checksum;
+ item.testFunction = QString::fromLatin1(QTest::currentTestFunction());
+ ImageItemList list;
+ list.append(item);
+ if (!proto.requestBaselineChecksums(QLatin1String(QTest::currentTestFunction()), &list) || list.isEmpty()) {
+ *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return true;
+ }
+
+ return compareItem(list.at(0), img, msg, error);
+}
+
+
+QTestData &newRow(const char *dataTag, quint16 checksum)
+{
+ if (QTest::currentTestFunction() != curFunction) {
+ curFunction = QTest::currentTestFunction();
+ itemList.clear();
+ gotBaselines = false;
+ }
+ ImageItem item;
+ item.itemName = QString::fromLatin1(dataTag);
+ item.itemChecksum = checksum;
+ item.testFunction = QString::fromLatin1(QTest::currentTestFunction());
+ itemList.append(item);
+
+ return QTest::newRow(dataTag);
+}
+
+
+bool testImage(const QImage& img, QByteArray *msg, bool *error)
+{
+ if (!connected && !connect(msg, error))
+ return true;
+
+ if (QTest::currentTestFunction() != curFunction || itemList.isEmpty()) {
+ qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow()";
+ return true;
+ }
+
+ if (!gotBaselines) {
+ if (!proto.requestBaselineChecksums(QString::fromLatin1(QTest::currentTestFunction()), &itemList) || itemList.isEmpty()) {
+ *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1();
+ *error = true;
+ return true;
+ }
+ gotBaselines = true;
+ }
+
+ QString curTag = QString::fromLatin1(QTest::currentDataTag());
+ ImageItemList::const_iterator it = itemList.constBegin();
+ while (it != itemList.constEnd() && it->itemName != curTag)
+ ++it;
+ if (it == itemList.constEnd()) {
+ qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow() for row" << curTag;
+ return true;
+ }
+ return compareItem(*it, img, msg, error);
+}
+
+}
diff --git a/tests/arthur/common/qbaselinetest.h b/tests/arthur/common/qbaselinetest.h
new file mode 100644
index 0000000000..dc32109979
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BASELINETEST_H
+#define BASELINETEST_H
+
+#include <QTest>
+
+namespace QBaselineTest {
+bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error);
+bool testImage(const QImage& img, QByteArray *msg, bool *error);
+QTestData &newRow(const char *dataTag, quint16 checksum = 0);
+}
+
+#define QBASELINE_CHECK_SUM(image, name, checksum)\
+do {\
+ QByteArray _msg;\
+ bool _err = false;\
+ if (!QBaselineTest::checkImage((image), (name), (checksum), &_msg, &_err)) {\
+ QFAIL(_msg.constData());\
+ } else if (_err) {\
+ QSKIP(_msg.constData(), SkipSingle);\
+ }\
+} while (0)
+
+#define QBASELINE_CHECK(image, name) QBASELINE_CHECK_SUM(image, name, 0)
+
+#define QBASELINE_TEST(image)\
+do {\
+ QByteArray _msg;\
+ bool _err = false;\
+ if (!QBaselineTest::testImage((image), &_msg, &_err)) {\
+ QFAIL(_msg.constData());\
+ } else if (_err) {\
+ QSKIP(_msg.constData(), SkipSingle);\
+ }\
+} while (0)
+
+#endif // BASELINETEST_H
diff --git a/tests/arthur/common/qbaselinetest.pri b/tests/arthur/common/qbaselinetest.pri
new file mode 100644
index 0000000000..5420c6ed1c
--- /dev/null
+++ b/tests/arthur/common/qbaselinetest.pri
@@ -0,0 +1,13 @@
+QT *= testlib
+
+SOURCES += \
+ $$PWD/qbaselinetest.cpp
+
+HEADERS += \
+ $$PWD/qbaselinetest.h
+
+win32|symbian*:MKSPEC=$$replace(QMAKESPEC, \\\\, /)
+else:MKSPEC=$$QMAKESPEC
+DEFINES += QMAKESPEC=\\\"$$MKSPEC\\\"
+
+include($$PWD/baselineprotocol.pri)
diff --git a/tests/arthur/common/qengines.cpp b/tests/arthur/common/qengines.cpp
new file mode 100644
index 0000000000..8eff2219b5
--- /dev/null
+++ b/tests/arthur/common/qengines.cpp
@@ -0,0 +1,733 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qengines.h"
+#include "paintcommands.h"
+
+#include <QApplication>
+#include <QProcess>
+#include <QPainter>
+#include <QSvgRenderer>
+#include <QStringList>
+#include <QDir>
+#include <QDebug>
+#include <QPrintEngine>
+#include <QWidget>
+
+// For QApplicationPrivate::graphics_system_name
+#include <private/qapplication_p.h>
+
+QEngine::~QEngine()
+{
+}
+
+Q_GLOBAL_STATIC(QtEngines, qtengines_global)
+QtEngines * QtEngines::self()
+{
+ return qtengines_global();
+}
+
+
+QList<QEngine*> QtEngines::engines() const
+{
+ return m_engines;
+}
+
+
+QList<QEngine*> QtEngines::foreignEngines() const
+{
+ return m_foreignEngines;
+}
+
+
+QEngine * QtEngines::defaultEngine() const
+{
+ return m_defaultEngine;
+}
+
+
+QtEngines::QtEngines()
+{
+ init();
+}
+
+
+void QtEngines::init()
+{
+ m_defaultEngine = new RasterEngine;
+ m_engines << m_defaultEngine
+ << new NativeEngine
+ << new WidgetEngine;
+
+#if defined(BUILD_OPENGL)
+ if (QGLFormat::hasOpenGL())
+ m_engines << new GLEngine;
+#endif
+
+#ifndef QT_NO_PRINTER
+ m_engines << new PDFEngine
+#ifdef Q_WS_X11
+ << new PSEngine
+#endif
+#ifdef Q_WS_WIN
+ << new WinPrintEngine
+#endif
+ ;
+#endif //QT_NO_PRINTER
+
+ m_foreignEngines << new RSVGEngine;
+}
+
+RasterEngine::RasterEngine()
+{
+
+}
+
+QString RasterEngine::name() const
+{
+ return QLatin1String("Raster");
+}
+
+
+void RasterEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ image = QImage(size, QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&image);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.fillRect(image.rect(), fillColor);
+}
+
+
+void RasterEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter p(&image);
+ r->render(&p);
+ p.end();
+}
+
+
+void RasterEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter pt(&image);
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(&pt);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ pt.end();
+}
+
+bool RasterEngine::drawOnPainter(QPainter *p)
+{
+ p->drawImage(0, 0, image);
+ return true;
+}
+
+void RasterEngine::save(const QString &file)
+{
+ image.save(file, "PNG");
+}
+
+
+NativeEngine::NativeEngine()
+{
+
+}
+
+
+QString NativeEngine::name() const
+{
+#ifdef Q_WS_X11
+#ifndef QT_NO_XRENDER
+ return QLatin1String("NativeXRender");
+#else
+ return QLatin1String("NativeXLib");
+#endif
+#elif (defined Q_WS_WIN32)
+ return QLatin1String("NativeWin32");
+#elif (defined Q_WS_MAC)
+ return QLatin1String("NativeMac");
+#elif defined(Q_WS_QWS)
+ return QLatin1String("NativeEmbedded");
+#endif
+}
+
+
+void NativeEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ pixmap = QPixmap(size);
+ pixmap.fill(fillColor);
+}
+
+
+void NativeEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter p(&pixmap);
+ r->render(&p);
+ p.end();
+}
+
+
+void NativeEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter pt(&pixmap);
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(&pt);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ pt.end();
+}
+
+bool NativeEngine::drawOnPainter(QPainter *p)
+{
+ p->drawPixmap(0, 0, pixmap);
+ return true;
+}
+
+void NativeEngine::save(const QString &file)
+{
+ pixmap.save(file, "PNG");
+}
+
+
+#if defined(BUILD_OPENGL)
+GLEngine::GLEngine()
+ : pbuffer(0), widget(0)
+{
+ usePixelBuffers = QGLPixelBuffer::hasOpenGLPbuffers();
+}
+
+
+QString GLEngine::name() const
+{
+ return QLatin1String("OpenGL");
+}
+
+void GLEngine::prepare(const QSize &_size, const QColor &color)
+{
+ size = _size;
+ fillColor = color;
+ if (usePixelBuffers) {
+ pbuffer = new QGLPixelBuffer(size, QGLFormat(QGL::SampleBuffers));
+ } else {
+ widget = new QGLWidget(QGLFormat(QGL::SampleBuffers));
+ widget->setAutoFillBackground(false);
+ widget->resize(size);
+ widget->show();
+ QApplication::flush();
+ QApplication::syncX();
+ }
+}
+
+void GLEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter *p;
+ if (usePixelBuffers)
+ p = new QPainter(pbuffer);
+ else
+ p = new QPainter(widget);
+ p->fillRect(0, 0, size.width(), size.height(), fillColor);
+ r->render(p);
+ p->end();
+ delete p;
+}
+
+void GLEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter *p;
+ if (usePixelBuffers)
+ p = new QPainter(pbuffer);
+ else
+ p = new QPainter(widget);
+
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(p);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ p->end();
+ delete p;
+}
+
+bool GLEngine::drawOnPainter(QPainter *p)
+{
+ if (usePixelBuffers) {
+ QImage img = pbuffer->toImage();
+ p->drawImage(0, 0, img);
+ } else {
+ QImage img = widget->grabFrameBuffer();
+ p->drawImage(0, 0, img);
+ }
+ return true;
+}
+
+
+void GLEngine::save(const QString &file)
+{
+ if (usePixelBuffers) {
+ QImage img = pbuffer->toImage();
+ img.save(file, "PNG");
+ } else {
+ QImage img = widget->grabFrameBuffer();
+ img.save(file, "PNG");
+ }
+}
+
+void GLEngine::cleanup()
+{
+ delete pbuffer;
+ delete widget;
+}
+
+#endif
+
+class WidgetEngineWidget : public QWidget
+{
+public:
+ WidgetEngineWidget(QWidget* =0);
+
+ void paintEvent(QPaintEvent*);
+ void render(QSvgRenderer*);
+ void render(QStringList const&,QString const&);
+
+ QSize m_size;
+ QColor m_fillColor;
+
+private:
+ QSvgRenderer* m_svgr;
+ QStringList m_qpsScript;
+ QString m_absFilePath;
+};
+
+WidgetEngineWidget::WidgetEngineWidget(QWidget* parent)
+ : QWidget(parent)
+ , m_size()
+ , m_fillColor()
+ , m_svgr(0)
+ , m_qpsScript()
+ , m_absFilePath()
+{}
+
+void WidgetEngineWidget::render(QSvgRenderer* r)
+{
+ m_svgr = r;
+ repaint();
+ m_svgr = 0;
+}
+
+void WidgetEngineWidget::render(QStringList const& qpsScript, QString const& absFilePath)
+{
+ m_qpsScript = qpsScript;
+ m_absFilePath = absFilePath;
+ repaint();
+ m_qpsScript = QStringList();
+ m_absFilePath = QString();
+}
+
+void WidgetEngineWidget::paintEvent(QPaintEvent*)
+{
+ if (m_svgr) {
+ QPainter p(this);
+ p.fillRect(0, 0, m_size.width(), m_size.height(), m_fillColor);
+ m_svgr->render(&p);
+ p.end();
+ }
+ else {
+ QPainter p(this);
+
+ PaintCommands pcmd(m_qpsScript, 800, 800);
+ pcmd.setPainter(&p);
+ pcmd.setFilePath(m_absFilePath);
+ pcmd.runCommands();
+ p.end();
+ }
+}
+
+WidgetEngine::WidgetEngine()
+ : m_widget(0)
+{
+}
+
+
+QString WidgetEngine::name() const
+{
+ QString gs = QApplicationPrivate::graphics_system_name;
+ if (!gs.isEmpty()) gs[0] = gs[0].toUpper();
+ return QString::fromLatin1("Widget") + gs;
+}
+
+void WidgetEngine::prepare(const QSize &size, const QColor &color)
+{
+ m_widget = new WidgetEngineWidget;
+ m_widget->m_size = size;
+ m_widget->m_fillColor = color;
+ m_widget->setAutoFillBackground(false);
+ m_widget->resize(size);
+ m_widget->show();
+ QApplication::flush();
+ QApplication::syncX();
+}
+
+void WidgetEngine::render(QSvgRenderer *r, const QString &)
+{
+ m_widget->render(r);
+}
+
+void WidgetEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ m_widget->render(qpsScript, absFilePath);
+}
+
+bool WidgetEngine::drawOnPainter(QPainter *p)
+{
+ p->drawPixmap(0, 0, QPixmap::grabWindow(m_widget->winId()));
+ return true;
+}
+
+
+void WidgetEngine::save(const QString &file)
+{
+ QImage img = QPixmap::grabWindow(m_widget->winId()).toImage();
+ img.save(file, "PNG");
+}
+
+void WidgetEngine::cleanup()
+{
+ delete m_widget;
+}
+
+#ifndef QT_NO_PRINTER
+PDFEngine::PDFEngine()
+{
+}
+
+
+QString PDFEngine::name() const
+{
+ return QLatin1String("PDF");
+}
+
+void PDFEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ Q_UNUSED(fillColor);
+
+ static int i = 1;
+
+ m_size = size;
+ printer = new QPrinter(QPrinter::ScreenResolution);
+ printer->setOutputFormat(QPrinter::PdfFormat);
+ printer->setFullPage(true);
+ //printer->setOrientation(QPrinter::Landscape);
+ m_tempFile = QDir::tempPath() + QString("temp%1.pdf").arg(i++);
+ printer->setOutputFileName(m_tempFile);
+}
+
+void PDFEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter p(printer);
+ r->render(&p);
+ p.end();
+}
+
+
+void PDFEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter pt(printer);
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(&pt);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ pt.end();
+}
+
+bool PDFEngine::drawOnPainter(QPainter *)
+{
+ return false;
+}
+
+void PDFEngine::save(const QString &file)
+{
+#ifdef USE_ACROBAT
+ QString psFile = m_tempFile;
+ psFile.replace(".pdf", ".ps");
+ QProcess toPs;
+ QStringList args1;
+ args1 << "-toPostScript"
+ << "-level3"
+ << "-transQuality"
+ << "1";
+ args1 << m_tempFile;
+ toPs.start("acroread", args1);
+ toPs.waitForFinished();
+
+ QProcess convert;
+ QStringList args;
+ args << psFile;
+ args << QString("-resize")
+ << QString("%1x%2")
+ .arg(m_size.width())
+ .arg(m_size.height());
+ args << file;
+
+ convert.start("convert", args);
+ convert.waitForFinished();
+ QFile::remove(psFile);
+#else
+ QProcess toPng;
+ QStringList args1;
+ args1 << "-sDEVICE=png16m"
+ << QString("-sOutputFile=") + file
+ << "-r97x69"
+ << "-dBATCH"
+ << "-dNOPAUSE";
+ args1 << m_tempFile;
+ toPng.start("gs", args1);
+ toPng.waitForFinished();
+#endif
+
+ QString pfile = file;
+ pfile.replace(".png", ".pdf");
+ QFile::rename(m_tempFile, pfile);
+// QFile::remove(m_tempFile);
+}
+
+void PDFEngine::cleanup()
+{
+ delete printer; printer = 0;
+}
+
+#ifdef Q_WS_X11
+PSEngine::PSEngine()
+{
+}
+
+
+QString PSEngine::name() const
+{
+ return QLatin1String("PS");
+}
+
+void PSEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ Q_UNUSED(fillColor);
+
+ static int i = 1;
+
+ m_size = size;
+ printer = new QPrinter(QPrinter::ScreenResolution);
+ printer->setOutputFormat(QPrinter::PostScriptFormat);
+ printer->setFullPage(true);
+ m_tempFile = QDir::tempPath() + QString("temp%1.ps").arg(i++);
+ printer->setOutputFileName(m_tempFile);
+}
+
+void PSEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter p(printer);
+ r->render(&p);
+ p.end();
+}
+
+
+void PSEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter pt(printer);
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(&pt);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ pt.end();
+}
+
+bool PSEngine::drawOnPainter(QPainter *)
+{
+ return false;
+}
+
+void PSEngine::save(const QString &file)
+{
+ QProcess toPng;
+ QStringList args1;
+ args1 << "-sDEVICE=png16m"
+ << QString("-sOutputFile=") + file
+ << "-r97x69"
+ << "-dBATCH"
+ << "-dNOPAUSE";
+ args1 << m_tempFile;
+ toPng.start("gs", args1);
+ toPng.waitForFinished();
+
+ QString pfile = file;
+ pfile.replace(".png", ".ps");
+ QFile::rename(m_tempFile, pfile);
+}
+
+void PSEngine::cleanup()
+{
+ delete printer; printer = 0;
+}
+#endif
+#endif //QT_NO_PRINTER
+
+RSVGEngine::RSVGEngine()
+{
+
+}
+
+QString RSVGEngine::name() const
+{
+ return QLatin1String("RSVG");
+}
+
+void RSVGEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ Q_UNUSED(fillColor);
+
+ m_size = size;
+}
+
+void RSVGEngine::render(QSvgRenderer *, const QString &fileName)
+{
+ m_fileName = fileName;
+}
+
+void RSVGEngine::render(const QStringList &, const QString &)
+{
+}
+
+bool RSVGEngine::drawOnPainter(QPainter *)
+{
+ return false;
+}
+
+
+void RSVGEngine::save(const QString &file)
+{
+ QProcess rsvg;
+ QStringList args;
+ args << QString("-w %1").arg(m_size.width());
+ args << QString("-h %1").arg(m_size.height());
+ args << m_fileName;
+ args << file;
+ rsvg.start("rsvg", args);
+ rsvg.waitForFinished();
+}
+
+void QEngine::cleanup()
+{
+}
+
+#ifdef Q_WS_WIN
+WinPrintEngine::WinPrintEngine()
+{
+}
+
+
+QString WinPrintEngine::name() const
+{
+ return QLatin1String("WinPrint");
+}
+
+void WinPrintEngine::prepare(const QSize &size, const QColor &fillColor)
+{
+ Q_UNUSED(fillColor);
+
+ static int i = 1;
+
+ m_size = size;
+ printer = new QPrinter(QPrinter::ScreenResolution);
+ printer->setFullPage(true);
+ printer->setPrinterName("HP 2500C Series PS3");
+ m_tempFile = QDir::tempPath() + QString("temp%1.ps").arg(i++);
+ printer->setOutputFileName(m_tempFile);
+}
+
+void WinPrintEngine::render(QSvgRenderer *r, const QString &)
+{
+ QPainter p(printer);
+ r->render(&p);
+ p.end();
+}
+
+
+void WinPrintEngine::render(const QStringList &qpsScript,
+ const QString &absFilePath)
+{
+ QPainter pt(printer);
+ PaintCommands pcmd(qpsScript, 800, 800);
+ pcmd.setPainter(&pt);
+ pcmd.setFilePath(absFilePath);
+ pcmd.runCommands();
+ pt.end();
+}
+
+bool WinPrintEngine::drawOnPainter(QPainter *)
+{
+ return false;
+}
+
+void WinPrintEngine::save(const QString &file)
+{
+ QProcess toPng;
+ QStringList args1;
+ args1 << "-sDEVICE=png16m"
+ << QString("-sOutputFile=") + file
+ << "-r97x69"
+ << "-dBATCH"
+ << "-dNOPAUSE";
+ args1 << m_tempFile;
+ toPng.start("gswin32", args1);
+ toPng.waitForFinished();
+
+ QString pfile = file;
+ pfile.replace(".png", ".ps");
+ QFile::rename(m_tempFile, pfile);
+}
+
+void WinPrintEngine::cleanup()
+{
+ delete printer; printer = 0;
+}
+
+#endif
diff --git a/tests/arthur/common/qengines.h b/tests/arthur/common/qengines.h
new file mode 100644
index 0000000000..b731cfe419
--- /dev/null
+++ b/tests/arthur/common/qengines.h
@@ -0,0 +1,241 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QENGINES_H
+#define QENGINES_H
+
+#if defined(BUILD_OPENGL)
+#include <QGLPixelBuffer>
+#endif
+#include <QPrinter>
+#include <QPixmap>
+#include <QImage>
+#include <QMap>
+#include <QList>
+#include <QColor>
+
+QT_FORWARD_DECLARE_CLASS(QSvgRenderer)
+QT_FORWARD_DECLARE_CLASS(QGLWidget)
+
+class QEngine
+{
+public:
+ virtual ~QEngine();
+ virtual QString name() const =0;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white) =0;
+ virtual void render(QSvgRenderer *r, const QString &) =0;
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath) =0;
+ virtual bool drawOnPainter(QPainter *p) =0;
+ virtual void save(const QString &file) =0;
+ virtual void cleanup();
+};
+
+class QtEngines
+{
+public:
+ static QtEngines *self();
+ QtEngines();
+
+ QList<QEngine*> engines() const;
+ QList<QEngine*> foreignEngines() const;
+
+ QEngine *defaultEngine() const;
+private:
+ void init();
+private:
+ QList<QEngine*> m_engines;
+ QList<QEngine*> m_foreignEngines;
+ QEngine *m_defaultEngine;
+};
+
+class RasterEngine : public QEngine
+{
+public:
+ RasterEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+private:
+ QImage image;
+};
+
+class NativeEngine : public QEngine
+{
+public:
+ NativeEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+private:
+ QPixmap pixmap;
+};
+
+
+#if defined(BUILD_OPENGL)
+class GLEngine : public QEngine
+{
+public:
+ GLEngine();
+ virtual QString name() const;
+ virtual void prepare(const QSize &_size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+ virtual void cleanup();
+private:
+ QGLPixelBuffer *pbuffer;
+ QGLWidget *widget;
+ bool usePixelBuffers;
+ QSize size;
+ QColor fillColor;
+};
+#endif
+
+class WidgetEngineWidget;
+class WidgetEngine : public QEngine
+{
+public:
+ WidgetEngine();
+ virtual QString name() const;
+ virtual void prepare(const QSize &_size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+ virtual void cleanup();
+private:
+ WidgetEngineWidget *m_widget;
+};
+
+#ifndef QT_NO_PRINTER
+class PDFEngine : public QEngine
+{
+public:
+ PDFEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+ virtual void cleanup();
+private:
+ QPrinter *printer;
+ QSize m_size;
+ QString m_tempFile;
+};
+
+#ifdef Q_WS_X11
+class PSEngine : public QEngine
+{
+public:
+ PSEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+ virtual void cleanup();
+private:
+ QPrinter *printer;
+ QSize m_size;
+ QString m_tempFile;
+};
+#endif
+
+#ifdef Q_WS_WIN
+class WinPrintEngine : public QEngine
+{
+public:
+ WinPrintEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+ virtual void cleanup();
+private:
+ QPrinter *printer;
+ QSize m_size;
+ QString m_tempFile;
+};
+#endif
+#endif //QT_NO_PRINTER
+
+class RSVGEngine : public QEngine
+{
+public:
+ RSVGEngine();
+
+ virtual QString name() const;
+ virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white);
+ virtual void render(QSvgRenderer *r, const QString &);
+ virtual void render(const QStringList &qpsScript,
+ const QString &absFilePath);
+ virtual bool drawOnPainter(QPainter *p);
+ virtual void save(const QString &file);
+private:
+ QString m_fileName;
+ QSize m_size;
+};
+
+#endif
diff --git a/tests/arthur/common/xmldata.cpp b/tests/arthur/common/xmldata.cpp
new file mode 100644
index 0000000000..5b6e1fdf49
--- /dev/null
+++ b/tests/arthur/common/xmldata.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "xmldata.h"
+
+
+bool XMLReader::startElement(const QString &, const QString &localName,
+ const QString &, const QXmlAttributes &attributes)
+{
+ if (localName == "arthur" ) {
+ QString engineName = attributes.value("engine");
+ QString defaultStr = attributes.value("default");
+ QString foreignStr = attributes.value("foreign");
+ QString referenceStr = attributes.value("reference");
+ QString genDate = attributes.value("generationDate");
+ engine = new XMLEngine(engineName, defaultStr == "true");
+ engine->foreignEngine = (foreignStr == "true");
+ engine->referenceEngine = (referenceStr == "true");
+ if (!genDate.isEmpty())
+ engine->generationDate = QDateTime::fromString(genDate);
+ else
+ engine->generationDate = QDateTime::currentDateTime();
+ } else if (localName == "suite") {
+ QString suiteName = attributes.value("dir");
+ suite = new XMLSuite(suiteName);
+ } else if (localName == "file") {
+ QString testName = attributes.value("name");
+ QString outputName = attributes.value("output");
+ file = new XMLFile(testName, outputName);
+ } else if (localName == "data") {
+ QString dateStr = attributes.value("date");
+ QString timeStr = attributes.value("time_to_render");
+ QString itrStr = attributes.value("iterations");
+ QString detailsStr = attributes.value("details");
+ QString maxElapsedStr = attributes.value("maxElapsed");
+ QString minElapsedStr = attributes.value("minElapsed");
+ XMLData data(dateStr, timeStr.toInt(),
+ (!itrStr.isEmpty())?itrStr.toInt():1);
+ data.details = detailsStr;
+ if (maxElapsedStr.isEmpty())
+ data.maxElapsed = data.timeToRender;
+ else
+ data.maxElapsed = maxElapsedStr.toInt();
+ if (minElapsedStr.isEmpty())
+ data.minElapsed = data.timeToRender;
+ else
+ data.minElapsed = minElapsedStr.toInt();
+
+ file->data.append(data);
+ } else {
+ qDebug()<<"Error while parsing element :"<<localName;
+ return false;
+ }
+ return true;
+}
+
+bool XMLReader::endElement(const QString &, const QString &localName,
+ const QString &)
+{
+ if (localName == "arthur" ) {
+ //qDebug()<<"done";
+ } else if (localName == "suite") {
+ engine->suites.insert(suite->name, suite);
+ } else if (localName == "file") {
+ suite->files.insert(file->name, file);
+ }
+ return true;
+}
+
+bool XMLReader::fatalError(const QXmlParseException &)
+{
+ return true;
+}
diff --git a/tests/arthur/common/xmldata.h b/tests/arthur/common/xmldata.h
new file mode 100644
index 0000000000..17d14051d7
--- /dev/null
+++ b/tests/arthur/common/xmldata.h
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef XMLDATA_H
+#define XMLDATA_H
+
+#include <QtXml>
+
+#include <QMap>
+#include <QDateTime>
+
+enum GeneratorFlag {
+ Normal = 0x1 << 0,
+ Default = 0x1 << 1,
+ Foreign = 0x1 << 2,
+ Reference = 0x1 << 3
+};
+Q_DECLARE_FLAGS(GeneratorFlags, GeneratorFlag);
+
+struct XMLData
+{
+ XMLData()
+ : date(QDateTime::currentDateTime()),
+ timeToRender(0), iterations(0), maxElapsed(0),
+ minElapsed(0)
+ {}
+ XMLData(const QDateTime &dt, int ttr, int itrs = 1)
+ : date(dt), timeToRender(ttr),
+ iterations(itrs), maxElapsed(0), minElapsed(0)
+ {}
+ XMLData(const QString &dt, int ttr, int itrs = 1)
+ : timeToRender(ttr), iterations(itrs),
+ maxElapsed(0), minElapsed(0)
+ {
+ date = QDateTime::fromString(dt);
+ }
+ QDateTime date;
+ int timeToRender;
+ int iterations;
+ QString details;
+ int maxElapsed;
+ int minElapsed;
+};
+
+struct XMLFile
+{
+ XMLFile()
+ {}
+ XMLFile(const QString &testcase)
+ : name(testcase)
+ {}
+ XMLFile(const QString &testcase, const QString &img)
+ : name(testcase), output(img)
+ {}
+
+ QString name;
+ QString output;
+ QList<XMLData> data;
+};
+
+struct XMLSuite
+{
+ XMLSuite()
+ {}
+ XMLSuite(const QString &n)
+ : name(n)
+ {}
+
+ QString name;
+ QMap<QString, XMLFile*> files;
+};
+
+struct XMLEngine
+{
+ XMLEngine()
+ : defaultEngine(false), foreignEngine(false),
+ referenceEngine(false)
+ {}
+ XMLEngine(const QString &engine, bool def)
+ : name(engine), defaultEngine(def), foreignEngine(false),
+ referenceEngine(false)
+ {}
+
+ QString name;
+ bool defaultEngine;
+ bool foreignEngine;
+ bool referenceEngine;
+ QMap<QString, XMLSuite*> suites;
+ QDateTime generationDate;
+};
+
+
+
+class XMLReader : public QXmlDefaultHandler
+{
+public:
+ XMLEngine *xmlEngine() const
+ {
+ return engine;
+ }
+
+ bool startElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName,
+ const QXmlAttributes &attributes);
+ bool endElement(const QString &namespaceURI,
+ const QString &localName,
+ const QString &qName);
+ bool fatalError(const QXmlParseException &exception);
+private:
+ XMLEngine *engine;
+ XMLSuite *suite;
+ XMLFile *file;
+};
+
+#endif
diff --git a/tests/arthur/data/1.1/color-prop-03-t.svg b/tests/arthur/data/1.1/color-prop-03-t.svg
new file mode 100644
index 0000000000..f8c072e0e7
--- /dev/null
+++ b/tests/arthur/data/1.1/color-prop-03-t.svg
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- color-datatypes-BE-01.svg -->
+<!-- renamed for 1.1 suite to color-prop-02-f.svg -->
+<!-- renamed for SVGT/B to color-prop-03-t.svg -->
+<!-- -->
+<!-- Check for equivalence of color datatypes in the color property -->
+<!-- -->
+<!-- -->
+<!-- Author : Chris Lilley, 12-Aug-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!-- Revised for SVGT/B: Benoit Bezaire Jul/02/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 12-Aug-2000, CL, Serial#1 created. Matches 20000802 SVG spec. -->
+<!-- 21-Aug-2000, LH - rename consistent with tests in *color* chapter. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.4 $" testname="color-prop-02-t.svg">
+ <Paragraph>
+ Purpose of test is to determine if the color datatype is supported. There are multiple syntaxes for
+ specifying the same color, such as #37F and #3377FF. For each of the six groups shown here,
+ each of the shapes in the group uses one of the syntactical forms and all in the group should
+ be identical in color.
+ </Paragraph>
+ <Paragraph>
+ The first row uses five forms - 3-digit hex, 6-digit hex, rbg() integer form, rgb() percentage form,
+ and named ('HTML') colors.</Paragraph>
+ <Paragraph>
+ The second row uses only four forms - 3-digit hex, 6-digit hex, rbg() integer form, rgb() percentage form -
+ as there are no HTML or X11 names for those colors.</Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">color-prop-03-t.svg</title>
+ <desc id="test-desc">Test that viewer has the basic capability to render colors, specified as CSS attributes, using any of the equivalent forms.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- groups of five colors -->
+ <g>
+ <circle cx="75" cy="40" r="20" fill="#f00"/>
+ <circle cx="115" cy="40" r="20" fill="#ff0000"/>
+ <circle cx="75" cy="80" r="20" fill="rgb(255,0,0)"/>
+ <circle cx="115" cy="80" r="20" fill="rgb(100%,0%,0%)"/>
+ <polygon points="95,40 115,60 95,80 75,60" fill="red"/>
+ </g>
+ <g>
+ <circle cx="200" cy="40" r="20" fill="#0f0"/>
+ <circle cx="240" cy="40" r="20" fill="#00ff00"/>
+ <circle cx="200" cy="80" r="20" fill="rgb(0,255,0)"/>
+ <circle cx="240" cy="80" r="20" fill="rgb(0%,100%,0%)"/>
+ <!-- 'lime' (full intensity green) NOT 'green' (half intensity green) -->
+ <polygon points="220,40 240,60 220,80 200,60" fill="lime"/>
+ </g>
+ <g>
+ <circle cx="325" cy="40" r="20" fill="#00f"/>
+ <circle cx="365" cy="40" r="20" fill="#0000ff"/>
+ <circle cx="325" cy="80" r="20" fill="rgb(0,0,255)"/>
+ <circle cx="365" cy="80" r="20" fill="rgb(0%,0%,100%)"/>
+ <polygon points="345,40 365,60 345,80 325,60" fill="blue"/>
+ </g>
+ <!-- no names for three digit colors except for 00 and ff -->
+ <!-- 11=17 22=34 33=51 44=68 55=85 66=102 77=119
+ 88=136 99=153 aa=170 bb=187 cc=204 dd=221 ee=238 -->
+ <g>
+ <circle cx="75" cy="135" r="20" fill="#a01"/>
+ <circle cx="115" cy="135" r="20" fill="#aa0011"/>
+ <circle cx="75" cy="175" r="20" fill="rgb(170,0,17)"/>
+ <circle cx="115" cy="175" r="20" fill="rgb(66.667%,0%,6.667%)"/>
+ </g>
+ <g>
+ <circle cx="200" cy="135" r="20" fill="#3b3"/>
+ <circle cx="240" cy="135" r="20" fill="#33bb33"/>
+ <circle cx="200" cy="175" r="20" fill="rgb(51,187,51)"/>
+ <circle cx="240" cy="175" r="20" fill="rgb(20%,73.333%,20%)"/>
+ </g>
+ <g>
+ <circle cx="325" cy="135" r="20" fill="#57e"/>
+ <circle cx="365" cy="135" r="20" fill="#5577ee"/>
+ <circle cx="325" cy="175" r="20" fill="rgb(85,119,238)"/>
+ <circle cx="365" cy="175" r="20" fill="rgb(33.333%,46.666%,93.333%)"/>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.4 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/coords-trans-01-b.svg b/tests/arthur/data/1.1/coords-trans-01-b.svg
new file mode 100644
index 0000000000..69aa614a36
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-01-b.svg
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-01-b.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 24-Feb-2000, VH: created -->
+<!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. -->
+<!-- 02-Mar-2000, LH: fix names, legend, ser#4. -->
+<!-- 09-Mar-2000, LH: fix framing rect, ser#5. -->
+<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. -->
+<!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH="rename" ser#7. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-b.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">coords-trans-01-b</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <!-- ====================================================================== -->
+ <!-- First, draw a test grid ============================================== -->
+ <!-- ====================================================================== -->
+ <g id="test-grid" stroke="#cccccc" stroke-width="1" >
+ <line x1="10" y1="10.5" x2="470" y2="10.5"/>
+ <line x1="10" y1="20.5" x2="470" y2="20.5"/>
+ <line x1="10" y1="30.5" x2="470" y2="30.5"/>
+ <line x1="10" y1="40.5" x2="470" y2="40.5"/>
+ <line x1="10" y1="50.5" x2="470" y2="50.5"/>
+ <line x1="10" y1="60.5" x2="470" y2="60.5"/>
+ <line x1="10" y1="70.5" x2="470" y2="70.5"/>
+ <line x1="10" y1="80.5" x2="470" y2="80.5"/>
+ <line x1="10" y1="90.5" x2="470" y2="90.5"/>
+ <line x1="10" y1="100.5" x2="470" y2="100.5"/>
+ <line x1="10" y1="110.5" x2="470" y2="110.5"/>
+ <line x1="10" y1="120.5" x2="470" y2="120.5"/>
+ <line x1="10" y1="130.5" x2="470" y2="130.5"/>
+ <line x1="10" y1="140.5" x2="470" y2="140.5"/>
+ <line x1="10" y1="150.5" x2="470" y2="150.5"/>
+ <line x1="10" y1="160.5" x2="470" y2="160.5"/>
+ <line x1="10" y1="170.5" x2="470" y2="170.5"/>
+ <line x1="10" y1="180.5" x2="470" y2="180.5"/>
+ <line x1="10" y1="190.5" x2="470" y2="190.5"/>
+ <line x1="10" y1="200.5" x2="470" y2="200.5"/>
+ <line x1="10" y1="210.5" x2="470" y2="210.5"/>
+ <line x1="10" y1="220.5" x2="470" y2="220.5"/>
+ <line x1="10" y1="230.5" x2="470" y2="230.5"/>
+ <line x1="10" y1="240.5" x2="470" y2="240.5"/>
+ <line x1="10" y1="250.5" x2="470" y2="250.5"/>
+ <line x1="10" y1="260.5" x2="470" y2="260.5"/>
+ <line y1="10" x1="10.5" y2="260.5" x2="10.5"/>
+ <line y1="10" x1="20.5" y2="260.5" x2="20.5"/>
+ <line y1="10" x1="30.5" y2="260.5" x2="30.5"/>
+ <line y1="10" x1="40.5" y2="260.5" x2="40.5"/>
+ <line y1="10" x1="50.5" y2="260.5" x2="50.5"/>
+ <line y1="10" x1="60.5" y2="260.5" x2="60.5"/>
+ <line y1="10" x1="70.5" y2="260.5" x2="70.5"/>
+ <line y1="10" x1="80.5" y2="260.5" x2="80.5"/>
+ <line y1="10" x1="90.5" y2="260.5" x2="90.5"/>
+ <line y1="10" x1="100.5" y2="260.5" x2="100.5"/>
+ <line y1="10" x1="110.5" y2="260.5" x2="110.5"/>
+ <line y1="10" x1="120.5" y2="260.5" x2="120.5"/>
+ <line y1="10" x1="130.5" y2="260.5" x2="130.5"/>
+ <line y1="10" x1="140.5" y2="260.5" x2="140.5"/>
+ <line y1="10" x1="150.5" y2="260.5" x2="150.5"/>
+ <line y1="10" x1="160.5" y2="260.5" x2="160.5"/>
+ <line y1="10" x1="170.5" y2="260.5" x2="170.5"/>
+ <line y1="10" x1="180.5" y2="260.5" x2="180.5"/>
+ <line y1="10" x1="190.5" y2="260.5" x2="190.5"/>
+ <line y1="10" x1="200.5" y2="260.5" x2="200.5"/>
+ <line y1="10" x1="210.5" y2="260.5" x2="210.5"/>
+ <line y1="10" x1="220.5" y2="260.5" x2="220.5"/>
+ <line y1="10" x1="230.5" y2="260.5" x2="230.5"/>
+ <line y1="10" x1="240.5" y2="260.5" x2="240.5"/>
+ <line y1="10" x1="250.5" y2="260.5" x2="250.5"/>
+ <line y1="10" x1="260.5" y2="260.5" x2="260.5"/>
+ <line y1="10" x1="270.5" y2="260.5" x2="270.5"/>
+ <line y1="10" x1="280.5" y2="260.5" x2="280.5"/>
+ <line y1="10" x1="290.5" y2="260.5" x2="290.5"/>
+ <line y1="10" x1="300.5" y2="260.5" x2="300.5"/>
+ <line y1="10" x1="310.5" y2="260.5" x2="310.5"/>
+ <line y1="10" x1="320.5" y2="260.5" x2="320.5"/>
+ <line y1="10" x1="330.5" y2="260.5" x2="330.5"/>
+ <line y1="10" x1="340.5" y2="260.5" x2="340.5"/>
+ <line y1="10" x1="350.5" y2="260.5" x2="350.5"/>
+ <line y1="10" x1="360.5" y2="260.5" x2="360.5"/>
+ <line y1="10" x1="370.5" y2="260.5" x2="370.5"/>
+ <line y1="10" x1="380.5" y2="260.5" x2="380.5"/>
+ <line y1="10" x1="390.5" y2="260.5" x2="390.5"/>
+ <line y1="10" x1="400.5" y2="260.5" x2="400.5"/>
+ <line y1="10" x1="410.5" y2="260.5" x2="410.5"/>
+ <line y1="10" x1="420.5" y2="260.5" x2="420.5"/>
+ <line y1="10" x1="430.5" y2="260.5" x2="430.5"/>
+ <line y1="10" x1="440.5" y2="260.5" x2="440.5"/>
+ <line y1="10" x1="450.5" y2="260.5" x2="450.5"/>
+ <line y1="10" x1="460.5" y2="260.5" x2="460.5"/>
+ <line y1="10" x1="470.5" y2="260.5" x2="470.5"/>
+ </g>
+ <!-- ====================================================================== -->
+ <!-- Now, test elementary transforms. For each transform, 3 markers are -->
+ <!-- placed where the user space is expected after transformations for the -->
+ <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). -->
+ <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line -->
+ <!-- going from (0, 0) to (0, 20), after applying the elementary -->
+ <!-- transformation. If the test succeeds, the red line should join the -->
+ <!-- black marker to the red marker and the blue line the black marker to -->
+ <!-- the blue marker. -->
+ <!-- ====================================================================== -->
+ <g id="elementary-transforms-test" transform="translate(0, 10)">
+ <g id="elementary-transforms">
+ <!-- Translate -->
+ <g transform="translate(50, 50)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Rotate -90 deg about (150, 70) -->
+ <g transform="translate(150, 70) rotate(-90)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Skew X -->
+ <g transform="translate(250, 50) skewX(45)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Skew Y -->
+ <g transform="translate(350, 50) skewY(45)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Scale 2 -->
+ <g transform="translate(210, 120) scale(2)">
+ <rect x="0" y="0" width="20" height="1" fill="blue" />
+ <rect x="0" y="0" width="1" height="20" fill="red" />
+ </g>
+ </g>
+ <!-- elementary-transforms -->
+ <!-- Draw all the markers -->
+ <g id="elementary-transforms-test-markers">
+ <!-- Translate -->
+ <text x="40" y="40">translate (50, 50)</text>
+ <rect x="48" y="48" width="5" height="5" fill="black" />
+ <rect x="68" y="48" width="5" height="5" fill="blue" />
+ <rect x="48" y="68" width="5" height="5" fill="red" />
+ <!-- Rotate -90 deg about (150, 70) -->
+ <text x="140" y="40">rotate(-90)</text>
+ <rect x="148" y="68" width="5" height="5" fill="black" />
+ <rect x="148" y="48" width="5" height="5" fill="blue" />
+ <rect x="168" y="68" width="5" height="5" fill="red" />
+ <!-- Skew X -->
+ <text x="240" y="40">skew x (45)</text>
+ <rect x="248" y="48" width="5" height="5" fill="black" />
+ <rect x="268" y="48" width="5" height="5" fill="blue" />
+ <rect x="268" y="68" width="5" height="5" fill="red" />
+ <!-- Skew Y -->
+ <text x="340" y="40">skew y (45)</text>
+ <rect x="348" y="48" width="5" height="5" fill="black" />
+ <rect x="368" y="68" width="5" height="5" fill="blue" />
+ <rect x="348" y="68" width="5" height="5" fill="red" />
+ <!-- Scale 2 -->
+ <text x="200" y="110">scale (2)</text>
+ <rect x="208" y="118" width="5" height="5" fill="black" />
+ <rect x="248" y="118" width="5" height="5" fill="blue" />
+ <rect x="208" y="158" width="5" height="5" fill="red" />
+ </g>
+ <!-- elementary-transforms-test-markers -->
+ </g>
+ <g id="nested-transforms-test">
+ <g id="nested-transforms">
+ <!-- scale/translate in transform attribute -->
+ <g transform="scale(3, 2) translate(16.666667, 105)">
+ <rect x="0" y="0" width="20" height="1" fill="blue" />
+ <rect x="0" y="0" width="0.67" height="20" fill="red" />
+ </g>
+ <!-- scale/translate in successive elements -->
+ <g transform="translate(200, 0)">
+ <g transform="scale(3, 2)">
+ <g transform="translate(16.666667, 105)">
+ <rect x="0" y="0" width="20" height="1" fill="blue" />
+ <rect x="0" y="0" width="0.67" height="20" fill="red" />
+ </g>
+ </g>
+ </g>
+ </g>
+ <!-- nested-transforms -->
+ <g id="nested-transforms-test-markers">
+ <!-- scale and translate -->
+ <text x="40" y="200">scale(25, 95) and translate(2, 2)</text>
+ <rect x="48" y="208" width="5" height="5" fill="black" />
+ <rect x="108" y="208" width="5" height="5" fill="blue" />
+ <rect x="48" y="248" width="5" height="5" fill="red" />
+ <!-- scale then translate -->
+ <text x="240" y="200">scale(25, 95) then translate(2, 2)</text>
+ <rect x="248" y="208" width="5" height="5" fill="black" />
+ <rect x="308" y="208" width="5" height="5" fill="blue" />
+ <rect x="248" y="248" width="5" height="5" fill="red" />
+ </g>
+ <!-- nested-transforms-test-markers -->
+ </g>
+ <!-- nested-transforms test -->
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/coords-trans-02-t.svg b/tests/arthur/data/1.1/coords-trans-02-t.svg
new file mode 100644
index 0000000000..cf13b39881
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-02-t.svg
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-02-t.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 24-Feb-2000, VH: created -->
+<!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. -->
+<!-- 02-Mar-2000, LH: fix names, legend, ser#4. -->
+<!-- 09-Mar-2000, LH: fix framing rect, ser#5. -->
+<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. -->
+<!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH="rename" ser#7. -->
+<!-- Renamed again by Lee Klosterman to coords-trans-01-t-b.svg 28/06/02 -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-t-b.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">coords-trans-02-t</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <!-- ====================================================================== -->
+ <!-- First, draw a test grid ============================================== -->
+ <!-- ====================================================================== -->
+ <!--g id="test-grid" stroke="#cccccc" stroke-width="1" >
+ <line x1="10" y1="10.5" x2="470" y2="10.5"/>
+ <line x1="10" y1="20.5" x2="470" y2="20.5"/>
+ <line x1="10" y1="30.5" x2="470" y2="30.5"/>
+ <line x1="10" y1="40.5" x2="470" y2="40.5"/>
+ <line x1="10" y1="50.5" x2="470" y2="50.5"/>
+ <line x1="10" y1="60.5" x2="470" y2="60.5"/>
+ <line x1="10" y1="70.5" x2="470" y2="70.5"/>
+ <line x1="10" y1="80.5" x2="470" y2="80.5"/>
+ <line x1="10" y1="90.5" x2="470" y2="90.5"/>
+ <line x1="10" y1="100.5" x2="470" y2="100.5"/>
+ <line x1="10" y1="110.5" x2="470" y2="110.5"/>
+ <line x1="10" y1="120.5" x2="470" y2="120.5"/>
+ <line x1="10" y1="130.5" x2="470" y2="130.5"/>
+ <line x1="10" y1="140.5" x2="470" y2="140.5"/>
+ <line x1="10" y1="150.5" x2="470" y2="150.5"/>
+ <line x1="10" y1="160.5" x2="470" y2="160.5"/>
+ <line x1="10" y1="170.5" x2="470" y2="170.5"/>
+ <line x1="10" y1="180.5" x2="470" y2="180.5"/>
+ <line x1="10" y1="190.5" x2="470" y2="190.5"/>
+ <line x1="10" y1="200.5" x2="470" y2="200.5"/>
+ <line x1="10" y1="210.5" x2="470" y2="210.5"/>
+ <line x1="10" y1="220.5" x2="470" y2="220.5"/>
+ <line x1="10" y1="230.5" x2="470" y2="230.5"/>
+ <line x1="10" y1="240.5" x2="470" y2="240.5"/>
+ <line x1="10" y1="250.5" x2="470" y2="250.5"/>
+ <line x1="10" y1="260.5" x2="470" y2="260.5"/>
+ <line y1="10" x1="10.5" y2="260.5" x2="10.5"/>
+ <line y1="10" x1="20.5" y2="260.5" x2="20.5"/>
+ <line y1="10" x1="30.5" y2="260.5" x2="30.5"/>
+ <line y1="10" x1="40.5" y2="260.5" x2="40.5"/>
+ <line y1="10" x1="50.5" y2="260.5" x2="50.5"/>
+ <line y1="10" x1="60.5" y2="260.5" x2="60.5"/>
+ <line y1="10" x1="70.5" y2="260.5" x2="70.5"/>
+ <line y1="10" x1="80.5" y2="260.5" x2="80.5"/>
+ <line y1="10" x1="90.5" y2="260.5" x2="90.5"/>
+ <line y1="10" x1="100.5" y2="260.5" x2="100.5"/>
+ <line y1="10" x1="110.5" y2="260.5" x2="110.5"/>
+ <line y1="10" x1="120.5" y2="260.5" x2="120.5"/>
+ <line y1="10" x1="130.5" y2="260.5" x2="130.5"/>
+ <line y1="10" x1="140.5" y2="260.5" x2="140.5"/>
+ <line y1="10" x1="150.5" y2="260.5" x2="150.5"/>
+ <line y1="10" x1="160.5" y2="260.5" x2="160.5"/>
+ <line y1="10" x1="170.5" y2="260.5" x2="170.5"/>
+ <line y1="10" x1="180.5" y2="260.5" x2="180.5"/>
+ <line y1="10" x1="190.5" y2="260.5" x2="190.5"/>
+ <line y1="10" x1="200.5" y2="260.5" x2="200.5"/>
+ <line y1="10" x1="210.5" y2="260.5" x2="210.5"/>
+ <line y1="10" x1="220.5" y2="260.5" x2="220.5"/>
+ <line y1="10" x1="230.5" y2="260.5" x2="230.5"/>
+ <line y1="10" x1="240.5" y2="260.5" x2="240.5"/>
+ <line y1="10" x1="250.5" y2="260.5" x2="250.5"/>
+ <line y1="10" x1="260.5" y2="260.5" x2="260.5"/>
+ <line y1="10" x1="270.5" y2="260.5" x2="270.5"/>
+ <line y1="10" x1="280.5" y2="260.5" x2="280.5"/>
+ <line y1="10" x1="290.5" y2="260.5" x2="290.5"/>
+ <line y1="10" x1="300.5" y2="260.5" x2="300.5"/>
+ <line y1="10" x1="310.5" y2="260.5" x2="310.5"/>
+ <line y1="10" x1="320.5" y2="260.5" x2="320.5"/>
+ <line y1="10" x1="330.5" y2="260.5" x2="330.5"/>
+ <line y1="10" x1="340.5" y2="260.5" x2="340.5"/>
+ <line y1="10" x1="350.5" y2="260.5" x2="350.5"/>
+ <line y1="10" x1="360.5" y2="260.5" x2="360.5"/>
+ <line y1="10" x1="370.5" y2="260.5" x2="370.5"/>
+ <line y1="10" x1="380.5" y2="260.5" x2="380.5"/>
+ <line y1="10" x1="390.5" y2="260.5" x2="390.5"/>
+ <line y1="10" x1="400.5" y2="260.5" x2="400.5"/>
+ <line y1="10" x1="410.5" y2="260.5" x2="410.5"/>
+ <line y1="10" x1="420.5" y2="260.5" x2="420.5"/>
+ <line y1="10" x1="430.5" y2="260.5" x2="430.5"/>
+ <line y1="10" x1="440.5" y2="260.5" x2="440.5"/>
+ <line y1="10" x1="450.5" y2="260.5" x2="450.5"/>
+ <line y1="10" x1="460.5" y2="260.5" x2="460.5"/>
+ <line y1="10" x1="470.5" y2="260.5" x2="470.5"/>
+ </g-->
+ <!-- ====================================================================== -->
+ <!-- Now, test elementary transforms. For each transform, 3 markers are -->
+ <!-- placed where the user space is expected after transformations for the -->
+ <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). -->
+ <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line -->
+ <!-- going from (0, 0) to (0, 20), after applying the elementary -->
+ <!-- transformation. If the test succeeds, the red line should join the -->
+ <!-- black marker to the red marker and the blue line the black marker to -->
+ <!-- the blue marker. -->
+ <!-- ====================================================================== -->
+ <g id="elementary-transforms-test" transform="translate(0, 10)">
+ <g id="elementary-transforms" transform="translate(-30, 0) scale(2.5, 2.5)">
+ <!-- Translate -->
+ <g transform="translate(50, 50)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Rotate -90 deg about (150, 70) -->
+ <g transform="translate(150, 70) rotate(-90)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ </g>
+ <!-- elementary-transforms -->
+ <!-- Draw all the markers -->
+ <g id="elementary-transforms-test-markers" transform="translate(-30, 0) scale(2.5, 2.5)">
+ <!-- Translate -->
+ <text x="40" y="40">translate (50, 50)</text>
+ <rect x="48" y="48" width="5" height="5" fill="black" />
+ <rect x="68" y="48" width="5" height="5" fill="blue" />
+ <rect x="48" y="68" width="5" height="5" fill="red" />
+ <!-- Rotate -90 deg about (150, 70) -->
+ <text x="140" y="40">rotate(-90)</text>
+ <rect x="148" y="68" width="5" height="5" fill="black" />
+ <rect x="148" y="48" width="5" height="5" fill="blue" />
+ <rect x="168" y="68" width="5" height="5" fill="red" />
+ </g>
+ <!-- elementary-transforms-test-markers -->
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/coords-trans-03-t.svg b/tests/arthur/data/1.1/coords-trans-03-t.svg
new file mode 100644
index 0000000000..d03c18acc2
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-03-t.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-03-t.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 24-Feb-2000, VH: created -->
+<!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. -->
+<!-- 02-Mar-2000, LH: fix names, legend, ser#4. -->
+<!-- 09-Mar-2000, LH: fix framing rect, ser#5. -->
+<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. -->
+<!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH="rename" ser#7. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-t-b.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">coords-trans-03-t</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <!-- ====================================================================== -->
+ <!-- Now, test elementary transforms. For each transform, 3 markers are -->
+ <!-- placed where the user space is expected after transformations for the -->
+ <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). -->
+ <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line -->
+ <!-- going from (0, 0) to (0, 20), after applying the elementary -->
+ <!-- transformation. If the test succeeds, the red line should join the -->
+ <!-- black marker to the red marker and the blue line the black marker to -->
+ <!-- the blue marker. -->
+ <!-- ====================================================================== -->
+ <g id="elementary-transforms-test" transform="translate(0, 10)">
+ <g id="elementary-transforms" transform="translate(-560, 0) scale(2.5, 2.5)">
+ <!-- Skew X -->
+ <g transform="translate(250, 50) skewX(45)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ <!-- Skew Y -->
+ <g transform="translate(350, 50) skewY(45)">
+ <rect x="0" y="0" width="20" height="2" fill="blue" />
+ <rect x="0" y="0" width="2" height="20" fill="red" />
+ </g>
+ </g>
+ <!-- elementary-transforms -->
+ <!-- Draw all the markers -->
+ <g id="elementary-transforms-test-markers" transform="translate(-560, 0) scale(2.5, 2.5)">
+ <!-- Skew X -->
+ <text x="240" y="40">skew x (45)</text>
+ <rect x="248" y="48" width="5" height="5" fill="black" />
+ <rect x="268" y="48" width="5" height="5" fill="blue" />
+ <rect x="268" y="68" width="5" height="5" fill="red" />
+ <!-- Skew Y -->
+ <text x="340" y="40">skew y (45)</text>
+ <rect x="348" y="48" width="5" height="5" fill="black" />
+ <rect x="368" y="68" width="5" height="5" fill="blue" />
+ <rect x="348" y="68" width="5" height="5" fill="red" />
+ </g>
+ <!-- elementary-transforms-test-markers -->
+ </g>
+ <!-- nested-transforms test -->
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/coords-trans-04-t.svg b/tests/arthur/data/1.1/coords-trans-04-t.svg
new file mode 100644
index 0000000000..fee76c9573
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-04-t.svg
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-04-t.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="coords-trans-04-t.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">coords-trans-04-t</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <!-- ====================================================================== -->
+ <!-- Now, test elementary transforms. For each transform, 3 markers are -->
+ <!-- placed where the user space is expected after transformations for the -->
+ <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). -->
+ <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line -->
+ <!-- going from (0, 0) to (0, 20), after applying the elementary -->
+ <!-- transformation. If the test succeeds, the red line should join the -->
+ <!-- black marker to the red marker and the blue line the black marker to -->
+ <!-- the blue marker. -->
+ <!-- ====================================================================== -->
+ <g id="elementary-transforms-test">
+ <g id="elementary-transforms" transform="translate(60, 45) scale(2.5, 2.5)">
+ <!-- Scale 2 -->
+ <g transform="translate(40, 10) scale(2)">
+ <rect x="0" y="0" width="20" height="1" fill="blue"/>
+ <rect x="0" y="0" width="1" height="20" fill="red"/>
+ </g>
+ </g>
+ <!-- elementary-transforms -->
+ <!-- Draw all the markers -->
+ <g id="elementary-transforms-test-markers" transform="translate(-364, -230) scale(2.5, 2.5)">
+ <!-- Scale 2 -->
+ <text x="200" y="110">scale (2)</text>
+ <rect x="208" y="118" width="5" height="5" fill="black"/>
+ <rect x="248" y="118" width="5" height="5" fill="blue"/>
+ <rect x="208" y="158" width="5" height="5" fill="red"/>
+ </g>
+ <!-- elementary-transforms-test-markers -->
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/coords-trans-05-t.svg b/tests/arthur/data/1.1/coords-trans-05-t.svg
new file mode 100644
index 0000000000..f9ed2d3297
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-05-t.svg
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-05-t.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 24-Feb-2000, VH: created -->
+<!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. -->
+<!-- 02-Mar-2000, LH: fix names, legend, ser#4. -->
+<!-- 09-Mar-2000, LH: fix framing rect, ser#5. -->
+<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. -->
+<!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH="rename" ser#7. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-t-d.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">coords-trans-05-t</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <!-- ====================================================================== -->
+ <!-- Now, test elementary transforms. For each transform, 3 markers are -->
+ <!-- placed where the user space is expected after transformations for the -->
+ <!-- origin (black) and the points in (20, 0) (blue) and (0, 20) (red). -->
+ <!-- Then, a blue line going from (0, 0) to (20, 0) is drawn and a red line -->
+ <!-- going from (0, 0) to (0, 20), after applying the elementary -->
+ <!-- transformation. If the test succeeds, the red line should join the -->
+ <!-- black marker to the red marker and the blue line the black marker to -->
+ <!-- the blue marker. -->
+ <!-- ====================================================================== -->
+ <g id="nested-transforms-test">
+ <g id="nested-transforms" transform="translate(-90, -450)">
+ <!-- scale/translate in transform attribute -->
+ <g transform="scale(7.5, 5) translate(16.666667, 105)">
+ <rect x="0" y="0" width="20" height="1" fill="blue" />
+ <rect x="0" y="0" width="0.67" height="20" fill="red" />
+ </g>
+ </g>
+ <!-- nested-transforms -->
+ <g id="nested-transforms-test-markers" transform="translate(-90, -450) scale(2.5, 2.5)">
+ <!-- scale and translate -->
+ <text x="40" y="200">scale(25, 95) - translate(2, 2)</text>
+ <rect x="48" y="208" width="5" height="5" fill="black" />
+ <rect x="108" y="208" width="5" height="5" fill="blue" />
+ <rect x="48" y="248" width="5" height="5" fill="red" />
+ </g>
+ <!-- nested-transforms-test-markers -->
+ </g>
+ <!-- nested-transforms test -->
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/coords-trans-06-t.svg b/tests/arthur/data/1.1/coords-trans-06-t.svg
new file mode 100644
index 0000000000..5d12b7a142
--- /dev/null
+++ b/tests/arthur/data/1.1/coords-trans-06-t.svg
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- coords-transforms-BE-02.svg -->
+<!-- Author : Vincent Hardy -->
+<!-- renamed for 1.1 suite to coords-trans-06-t.svg -->
+<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 24-Feb-2000, VH: created -->
+<!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. -->
+<!-- 02-Mar-2000, LH: fix names, legend, ser#4. -->
+<!-- 09-Mar-2000, LH: fix framing rect, ser#5. -->
+<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#5. -->
+<!-- 12-May-2000, LH: rmv text-anchor and integrate, ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH="rename" ser#7. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="coords-trans-01-t-e.svg">
+ <Paragraph>
+ This test verifies the implementation of transforms. It tests elementary transforms
+ and transform nesting.
+ Note that for layout purposes, this test uses nesting of translation with the elementary transforms.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly except for variations in the labeling text.
+ </Paragraph>
+ <Paragraph>
+ The test uses the rect element, the fill color (solid primary colors) and transforms.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">coords-trans-06-t</title>
+ <desc id="test-desc">Validates elementary transforms and transformation nesting</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="translate(0, 30)">
+ <g id="nested-transforms-test">
+ <g id="nested-transforms">
+ <!-- scale/translate in successive elements -->
+ <g transform="translate(-102, -450)">
+ <g transform="scale(7.5, 5)">
+ <g transform="translate(16.666667, 105)">
+ <rect x="0" y="0" width="20" height="1" fill="blue" />
+ <rect x="0" y="0" width="0.67" height="20" fill="red" />
+ </g>
+ </g>
+ </g>
+ </g>
+ <!-- nested-transforms -->
+ <g id="nested-transforms-test-markers" transform="translate(-600, -450) scale(2.5, 2.5)">
+ <!-- scale then translate -->
+ <text x="240" y="200">scale(25, 95) then translate(2, 2)</text>
+ <rect x="248" y="208" width="5" height="5" fill="black" />
+ <rect x="308" y="208" width="5" height="5" fill="blue" />
+ <rect x="248" y="248" width="5" height="5" fill="red" />
+ </g>
+ <!-- nested-transforms-test-markers -->
+ </g>
+ <!-- nested-transforms test -->
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/fonts-elem-01-t.svg b/tests/arthur/data/1.1/fonts-elem-01-t.svg
new file mode 100644
index 0000000000..29cc875849
--- /dev/null
+++ b/tests/arthur/data/1.1/fonts-elem-01-t.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- fonts-fontElement-BE-01.svg -->
+<!-- renamed for 1.1 suite to fonts-elem-01-f -->
+<!-- -->
+<!-- Tests the font element using embedded Comic -->
+<!-- -->
+<!-- Author : Dean Jackson 13-08-2000 -->
+<!-- Revised for 1.1 : Chris Lilley, 15-mar-2002 -->
+<!-- -->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360" viewBox="0 0 480 360" version="1.1" baseProfile="tiny">
+<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript>
+ <Paragraph>This is a basic test for embedded SVG fonts. The font &quot;Comic Sans&quot;
+ (available from Microsoft) has been converted into an SVG font and embedded
+ in the SVG file. The test contains two text areas, each with the character
+ string "Ay&#xd6;@&#xe7;" drawn at the same font size.
+ </Paragraph>
+ <Paragraph>The upper area contains the glyphs from the embedded font placed in
+ the SVG file as path elements. Each glyph is placed at the location it
+ would be if rendered using normal text rendering (ie. the horizontal
+ advance between characters has been preserved).
+ </Paragraph>
+ <Paragraph>The lower area contains the text string rendered using the embedded
+ SVG font. It should appear exactly the same as the upper text area,
+ ie. font size, character baseline and horizontal advance should be
+ the same.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">fonts-elem-01-t</title>
+ <desc id="test-desc">Basic test of embedded fonts using glyph outlines</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ===================================================================== -->
+ <!-- Define the font for embedding - using Microsoft's "Comic Sans MS" -->
+ <!-- This is an SVG Font version of Comic. The Comic font license -->
+ <!-- allows editable and installable font embedding. -->
+ <!-- Only need to embed the characters that are used in the test -->
+ <!-- ===================================================================== -->
+ <defs>
+ <font horiz-adv-x="959">
+ <font-face font-family="TestComic" units-per-em="2048" panose-1="3 15 7 2 3 3 2 2 2 4" ascent="2257" descent="-597" alphabetic="0"/>
+ <missing-glyph horiz-adv-x="1024" d="M128 0V1638H896V0H128zM256 128H768V1510H256V128z"/>
+ <glyph unicode="@" horiz-adv-x="1907" d="M1306 412Q1200 412 1123 443T999 535Q945 482 894 455T793 428Q682 428 584 518T485 717Q485 902 630 1055T961 1208Q1003 1208 1031 1177T1059 1102Q1059 1042 959 1013Q826 975 771 926Q690 855 690 717Q690 688 717 661Q748 631 794 633Q881 637 955 795Q1022 933 1074 933Q1116 933 1142 902T1168 826Q1168 806 1162 766T1155 706Q1155 641 1211 624Q1233 617 1306 617Q1443 617 1498 684Q1548 744 1548 883Q1548 1128 1351 1283Q1171 1425 921 1425Q630 1425 465 1205Q316 1009 316 712Q316 438 491 250Q673 54 959 54Q1040 54 1142 85L1317 150Q1361 166 1374 166Q1415 166 1445 134T1475 58Q1475 -37 1262 -96Q1101 -140 961 -140Q820 -140 673 -86T420 60Q110 328 110 712Q110 1096 322 1354Q547 1630 921 1630Q1259 1630 1500 1427Q1753 1212 1753 883Q1753 658 1643 537Q1528 412 1306 412z"/>
+ <glyph unicode="A" horiz-adv-x="1498" d="M1250 -30Q1158 -30 1090 206Q1064 296 1025 521Q923 507 758 471L492 416Q442 285 321 33Q289 -23 234 -23Q194 -23 163 6T131 78Q131 126 282 443Q265 469 265 503Q265 584 363 607Q477 821 651 1099Q888 1478 946 1478Q1025 1478 1054 1368L1117 1032L1266 337L1323 179Q1352 98 1352 71Q1352 28 1321 -1T1250 -30zM897 1113L611 652Q732 683 978 727L897 1113z"/>
+ <glyph unicode="y" horiz-adv-x="1066" d="M1011 892L665 144Q537 -129 469 -313L403 -507Q377 -579 313 -579Q271 -579 241 -552T210 -483Q210 -383 426 96L68 785L23 858Q-4 904 -4 935Q-4 976 27 1007T98 1038Q144 1038 169 1003Q339 767 534 331L682 676Q762 855 836 984Q868 1040 920 1040Q961 1040 992 1011T1024 942Q1024 920 1011 892z"/>
+ <glyph unicode="Ö" horiz-adv-x="1635" d="M802 -61Q520 -61 324 108Q116 288 116 572Q116 918 321 1201Q550 1515 892 1515Q1221 1515 1381 1367Q1548 1213 1548 881Q1548 535 1360 257Q1144 -61 802 -61zM892 1310Q647 1310 477 1066Q320 842 320 572Q320 379 463 258Q600 144 802 144Q1045 144 1203 389Q1344 608 1344 881Q1344 1120 1237 1217Q1135 1310 892 1310zM682 1848Q813 1848 813 1743Q813 1713 769 1685Q729 1660 694 1660Q571 1660 571 1763Q571 1792 608 1820T682 1848zM1221 1856Q1255 1856 1290 1825T1325 1763Q1325 1671 1182 1671Q1141 1671 1109 1692Q1073 1716 1073 1755Q1073 1824 1118 1844Q1143 1856 1221 1856z"/>
+ <glyph unicode="ç" horiz-adv-x="1052" d="M770 -196Q770 -320 710 -382T528 -445Q443 -445 367 -413Q271 -371 271 -298Q271 -244 339 -244Q375 -244 420 -268T517 -293Q566 -292 590 -269T614 -201Q614 -153 577 -115T463 -48Q304 -12 208 104Q105 227 105 404Q105 607 240 823Q390 1063 578 1063Q676 1063 797 1017Q950 958 950 873Q950 835 925 806T863 776Q834 776 813 793T771 828Q712 875 578 875Q476 875 376 693Q285 526 285 404Q285 272 375 196Q459 125 591 125Q651 125 719 157L835 219Q865 235 878 235Q915 235 942 206T969 138Q969 35 713 -40Q742 -78 756 -117T770 -196z"/>
+ </font>
+ </defs>
+ <text fill="black" stroke="none" font-size="35" x="56" y="35">Basic SVG font element</text>
+ <!-- ====================================================================== -->
+ <!-- First place the glyphs by hand -->
+ <!-- ====================================================================== -->
+ <g fill="black" stroke="none">
+ <text x="30" y="130" font-size="18">Placed Glyphs</text>
+ <!-- translate to text position and flip y axis (glyphs are drawn -->
+ <!-- upside down -->
+ <g transform="translate(165,140) scale(1, -1)">
+ <line x1="0" y1="0" x2="210" y2="0" stroke-width="1" stroke="#888888"/>
+ <!-- fontsize / units-per-em == 60 / 2048 == 0.029296875 -->
+ <g transform="scale(0.029296875)">
+ <!-- uppercase A -->
+ <line x1="0" y1="-3500" x2="0" y2="2000" stroke-width="50" stroke="#888888"/>
+ <path d="M1250 -30Q1158 -30 1090 206Q1064 296 1025 521Q923 507 758 471L492 416Q442 285 321 33Q289 -23 234 -23Q194 -23 163 6T131 78Q131 126 282 443Q265 469 265 503Q265 584 363 607Q477 821 651 1099Q888 1478 946 1478Q1025 1478 1054 1368L1117 1032L1266 337L1323 179Q1352 98 1352 71Q1352 28 1321 -1T1250 -30zM897 1113L611 652Q732 683 978 727L897 1113z"/>
+ <!-- lowercase y -->
+ <line x1="1498" y1="-3500" x2="1498" y2="2000" stroke-width="50" stroke="#888888"/>
+ <path transform="translate(1498,0)" d="M1011 892L665 144Q537 -129 469 -313L403 -507Q377 -579 313 -579Q271 -579 241 -552T210 -483Q210 -383 426 96L68 785L23 858Q-4 904 -4 935Q-4 976 27 1007T98 1038Q144 1038 169 1003Q339 767 534 331L682 676Q762 855 836 984Q868 1040 920 1040Q961 1040 992 1011T1024 942Q1024 920 1011 892z"/>
+ <!-- unicode 00D6 -->
+ <line x1="2564" y1="-3500" x2="2564" y2="2000" stroke-width="50" stroke="#888888"/>
+ <path transform="translate(2564,0)" d="M802 -61Q520 -61 324 108Q116 288 116 572Q116 918 321 1201Q550 1515 892 1515Q1221 1515 1381 1367Q1548 1213 1548 881Q1548 535 1360 257Q1144 -61 802 -61zM892 1310Q647 1310 477 1066Q320 842 320 572Q320 379 463 258Q600 144 802 144Q1045 144 1203 389Q1344 608 1344 881Q1344 1120 1237 1217Q1135 1310 892 1310zM682 1848Q813 1848 813 1743Q813 1713 769 1685Q729 1660 694 1660Q571 1660 571 1763Q571 1792 608 1820T682 1848zM1221 1856Q1255 1856 1290 1825T1325 1763Q1325 1671 1182 1671Q1141 1671 1109 1692Q1073 1716 1073 1755Q1073 1824 1118 1844Q1143 1856 1221 1856z"/>
+ <!-- @ sign -->
+ <line x1="4199" y1="-3500" x2="4199" y2="2000" stroke-width="50" stroke="#888888"/>
+ <path transform="translate(4199,0)" d="M1306 412Q1200 412 1123 443T999 535Q945 482 894 455T793 428Q682 428 584 518T485 717Q485 902 630 1055T961 1208Q1003 1208 1031 1177T1059 1102Q1059 1042 959 1013Q826 975 771 926Q690 855 690 717Q690 688 717 661Q748 631 794 633Q881 637 955 795Q1022 933 1074 933Q1116 933 1142 902T1168 826Q1168 806 1162 766T1155 706Q1155 641 1211 624Q1233 617 1306 617Q1443 617 1498 684Q1548 744 1548 883Q1548 1128 1351 1283Q1171 1425 921 1425Q630 1425 465 1205Q316 1009 316 712Q316 438 491 250Q673 54 959 54Q1040 54 1142 85L1317 150Q1361 166 1374 166Q1415 166 1445 134T1475 58Q1475 -37 1262 -96Q1101 -140 961 -140Q820 -140 673 -86T420 60Q110 328 110 712Q110 1096 322 1354Q547 1630 921 1630Q1259 1630 1500 1427Q1753 1212 1753 883Q1753 658 1643 537Q1528 412 1306 412z"/>
+ <!-- unicode 00E7 -->
+ <line x1="6106" y1="-3500" x2="6106" y2="2000" stroke-width="50" stroke="#888888"/>
+ <path transform="translate(6106,0)" d="M770 -196Q770 -320 710 -382T528 -445Q443 -445 367 -413Q271 -371 271 -298Q271 -244 339 -244Q375 -244 420 -268T517 -293Q566 -292 590 -269T614 -201Q614 -153 577 -115T463 -48Q304 -12 208 104Q105 227 105 404Q105 607 240 823Q390 1063 578 1063Q676 1063 797 1017Q950 958 950 873Q950 835 925 806T863 776Q834 776 813 793T771 828Q712 875 578 875Q476 875 376 693Q285 526 285 404Q285 272 375 196Q459 125 591 125Q651 125 719 157L835 219Q865 235 878 235Q915 235 942 206T969 138Q969 35 713 -40Q742 -78 756 -117T770 -196z"/>
+ <line x1="7158" y1="-3500" x2="7158" y2="2000" stroke-width="50" stroke="#888888"/>
+ </g>
+ </g>
+ </g>
+ <text x="65" y="210" font-size="18">SVG Font</text>
+ <g transform="translate(165, 220)" font-family="TestComic" font-size="60" fill="black" stroke="none">
+ <line x1="0" y1="0" x2="210" y2="0" stroke-width="1" stroke="#888888"/>
+ <text>AyÖ@ç</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/fonts-elem-02-t.svg b/tests/arthur/data/1.1/fonts-elem-02-t.svg
new file mode 100644
index 0000000000..13077e359d
--- /dev/null
+++ b/tests/arthur/data/1.1/fonts-elem-02-t.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- fonts-fontElement-BE-01.svg -->
+<!-- renamed for 1.1 suite to fonts-elem-02-ft -->
+<!-- Author : Dean Jackson 13-08-2000 -->
+<!-- Revised for 1.1 : Chris Lilley, 15-mar-2002 -->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="480" height="360" viewBox="0 0 480 360" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript>
+ <Paragraph>This is an accuracy test for embedded SVG fonts. The font &quot;Comic Sans&quot;
+ (available from Microsoft) has been converted into an SVG font and embedded
+ in the SVG file. The test contains two text areas, each with the character
+ string "Ay&#xd6;@&#xe7;" drawn at the same font size.
+ </Paragraph>
+ <Paragraph>The upper area has the placed glyphs as path elements filled with
+ white over a solid black background (creating a white cutout). The
+ embedded SVG font text is then drawn over the cutout. An implementation
+ that passes this test should completely fill the cutout, leaving
+ a solid black area (some slight antialiasing effects may remain).
+ </Paragraph>
+ <Paragraph>The lower area is the reverse of the upper area, with the placed
+ black glyphs filling the cutout created by white SVG font text.
+ An implementation that passes this test should completely fill the
+ cutout, leaving a solid black area (some slight antialiasing effects
+ may remain).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">fonts-elem-02-t</title>
+ <desc id="test-desc">Basic test of embedded fonts using glyph outlines</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ===================================================================== -->
+ <!-- Define the font for embedding - using Microsoft's "Comic Sans MS" -->
+ <!-- This is an SVG Font version of Comic. The Comic font license -->
+ <!-- allows editable and installable font embedding. -->
+ <!-- Only need to embed the characters that are used in the test -->
+ <!-- ===================================================================== -->
+ <defs>
+ <font horiz-adv-x="959">
+ <font-face font-family="TestComic" units-per-em="2048" panose-1="3 15 7 2 3 3 2 2 2 4" ascent="2257" descent="-597" alphabetic="0"/>
+ <missing-glyph horiz-adv-x="1024" d="M128 0V1638H896V0H128zM256 128H768V1510H256V128z"/>
+ <glyph unicode="@" horiz-adv-x="1907" d="M1306 412Q1200 412 1123 443T999 535Q945 482 894 455T793 428Q682 428 584 518T485 717Q485 902 630 1055T961 1208Q1003 1208 1031 1177T1059 1102Q1059 1042 959 1013Q826 975 771 926Q690 855 690 717Q690 688 717 661Q748 631 794 633Q881 637 955 795Q1022 933 1074 933Q1116 933 1142 902T1168 826Q1168 806 1162 766T1155 706Q1155 641 1211 624Q1233 617 1306 617Q1443 617 1498 684Q1548 744 1548 883Q1548 1128 1351 1283Q1171 1425 921 1425Q630 1425 465 1205Q316 1009 316 712Q316 438 491 250Q673 54 959 54Q1040 54 1142 85L1317 150Q1361 166 1374 166Q1415 166 1445 134T1475 58Q1475 -37 1262 -96Q1101 -140 961 -140Q820 -140 673 -86T420 60Q110 328 110 712Q110 1096 322 1354Q547 1630 921 1630Q1259 1630 1500 1427Q1753 1212 1753 883Q1753 658 1643 537Q1528 412 1306 412z"/>
+ <glyph unicode="A" horiz-adv-x="1498" d="M1250 -30Q1158 -30 1090 206Q1064 296 1025 521Q923 507 758 471L492 416Q442 285 321 33Q289 -23 234 -23Q194 -23 163 6T131 78Q131 126 282 443Q265 469 265 503Q265 584 363 607Q477 821 651 1099Q888 1478 946 1478Q1025 1478 1054 1368L1117 1032L1266 337L1323 179Q1352 98 1352 71Q1352 28 1321 -1T1250 -30zM897 1113L611 652Q732 683 978 727L897 1113z"/>
+ <glyph unicode="y" horiz-adv-x="1066" d="M1011 892L665 144Q537 -129 469 -313L403 -507Q377 -579 313 -579Q271 -579 241 -552T210 -483Q210 -383 426 96L68 785L23 858Q-4 904 -4 935Q-4 976 27 1007T98 1038Q144 1038 169 1003Q339 767 534 331L682 676Q762 855 836 984Q868 1040 920 1040Q961 1040 992 1011T1024 942Q1024 920 1011 892z"/>
+ <glyph unicode="Ö" horiz-adv-x="1635" d="M802 -61Q520 -61 324 108Q116 288 116 572Q116 918 321 1201Q550 1515 892 1515Q1221 1515 1381 1367Q1548 1213 1548 881Q1548 535 1360 257Q1144 -61 802 -61zM892 1310Q647 1310 477 1066Q320 842 320 572Q320 379 463 258Q600 144 802 144Q1045 144 1203 389Q1344 608 1344 881Q1344 1120 1237 1217Q1135 1310 892 1310zM682 1848Q813 1848 813 1743Q813 1713 769 1685Q729 1660 694 1660Q571 1660 571 1763Q571 1792 608 1820T682 1848zM1221 1856Q1255 1856 1290 1825T1325 1763Q1325 1671 1182 1671Q1141 1671 1109 1692Q1073 1716 1073 1755Q1073 1824 1118 1844Q1143 1856 1221 1856z"/>
+ <glyph unicode="ç" horiz-adv-x="1052" d="M770 -196Q770 -320 710 -382T528 -445Q443 -445 367 -413Q271 -371 271 -298Q271 -244 339 -244Q375 -244 420 -268T517 -293Q566 -292 590 -269T614 -201Q614 -153 577 -115T463 -48Q304 -12 208 104Q105 227 105 404Q105 607 240 823Q390 1063 578 1063Q676 1063 797 1017Q950 958 950 873Q950 835 925 806T863 776Q834 776 813 793T771 828Q712 875 578 875Q476 875 376 693Q285 526 285 404Q285 272 375 196Q459 125 591 125Q651 125 719 157L835 219Q865 235 878 235Q915 235 942 206T969 138Q969 35 713 -40Q742 -78 756 -117T770 -196z"/>
+ </font>
+ </defs>
+ <text fill="black" stroke="none" font-size="35" x="28" y="35">SVG font element accuracy</text>
+ <rect x="165" y="80" width="220" height="165" fill="black"/>
+ <text x="7" y="130" font-size="18" >SVG over Glyphs</text>
+ <!-- translate to text position and flip y axis (glyphs are drawn -->
+ <!-- upside down -->
+ <g transform="translate(165,140) scale(1, -1)" fill="white">
+ <!-- fontsize / units-per-em == 60 / 2048 == 0.029296875 -->
+ <g transform="scale(0.029296875)">
+ <!-- uppercase A -->
+ <path d="M1250 -30Q1158 -30 1090 206Q1064 296 1025 521Q923 507 758 471L492 416Q442 285 321 33Q289 -23 234 -23Q194 -23 163 6T131 78Q131 126 282 443Q265 469 265 503Q265 584 363 607Q477 821 651 1099Q888 1478 946 1478Q1025 1478 1054 1368L1117 1032L1266 337L1323 179Q1352 98 1352 71Q1352 28 1321 -1T1250 -30zM897 1113L611 652Q732 683 978 727L897 1113z"/>
+ <!-- lowercase y -->
+ <path transform="translate(1498,0)" d="M1011 892L665 144Q537 -129 469 -313L403 -507Q377 -579 313 -579Q271 -579 241 -552T210 -483Q210 -383 426 96L68 785L23 858Q-4 904 -4 935Q-4 976 27 1007T98 1038Q144 1038 169 1003Q339 767 534 331L682 676Q762 855 836 984Q868 1040 920 1040Q961 1040 992 1011T1024 942Q1024 920 1011 892z"/>
+ <!-- unicode 00D6 -->
+ <path transform="translate(2564,0)" d="M802 -61Q520 -61 324 108Q116 288 116 572Q116 918 321 1201Q550 1515 892 1515Q1221 1515 1381 1367Q1548 1213 1548 881Q1548 535 1360 257Q1144 -61 802 -61zM892 1310Q647 1310 477 1066Q320 842 320 572Q320 379 463 258Q600 144 802 144Q1045 144 1203 389Q1344 608 1344 881Q1344 1120 1237 1217Q1135 1310 892 1310zM682 1848Q813 1848 813 1743Q813 1713 769 1685Q729 1660 694 1660Q571 1660 571 1763Q571 1792 608 1820T682 1848zM1221 1856Q1255 1856 1290 1825T1325 1763Q1325 1671 1182 1671Q1141 1671 1109 1692Q1073 1716 1073 1755Q1073 1824 1118 1844Q1143 1856 1221 1856z"/>
+ <!-- @ sign -->
+ <path transform="translate(4199,0)" d="M1306 412Q1200 412 1123 443T999 535Q945 482 894 455T793 428Q682 428 584 518T485 717Q485 902 630 1055T961 1208Q1003 1208 1031 1177T1059 1102Q1059 1042 959 1013Q826 975 771 926Q690 855 690 717Q690 688 717 661Q748 631 794 633Q881 637 955 795Q1022 933 1074 933Q1116 933 1142 902T1168 826Q1168 806 1162 766T1155 706Q1155 641 1211 624Q1233 617 1306 617Q1443 617 1498 684Q1548 744 1548 883Q1548 1128 1351 1283Q1171 1425 921 1425Q630 1425 465 1205Q316 1009 316 712Q316 438 491 250Q673 54 959 54Q1040 54 1142 85L1317 150Q1361 166 1374 166Q1415 166 1445 134T1475 58Q1475 -37 1262 -96Q1101 -140 961 -140Q820 -140 673 -86T420 60Q110 328 110 712Q110 1096 322 1354Q547 1630 921 1630Q1259 1630 1500 1427Q1753 1212 1753 883Q1753 658 1643 537Q1528 412 1306 412z"/>
+ <!-- unicode 00E7 -->
+ <path transform="translate(6106,0)" d="M770 -196Q770 -320 710 -382T528 -445Q443 -445 367 -413Q271 -371 271 -298Q271 -244 339 -244Q375 -244 420 -268T517 -293Q566 -292 590 -269T614 -201Q614 -153 577 -115T463 -48Q304 -12 208 104Q105 227 105 404Q105 607 240 823Q390 1063 578 1063Q676 1063 797 1017Q950 958 950 873Q950 835 925 806T863 776Q834 776 813 793T771 828Q712 875 578 875Q476 875 376 693Q285 526 285 404Q285 272 375 196Q459 125 591 125Q651 125 719 157L835 219Q865 235 878 235Q915 235 942 206T969 138Q969 35 713 -40Q742 -78 756 -117T770 -196z"/>
+ </g>
+ </g>
+ <g transform="translate(165, 140)" font-family="TestComic" font-size="60" fill="black" stroke="none">
+ <text>AyÖ@ç</text>
+ </g>
+ <text x="7" y="210" font-size="18">Glyphs over SVG</text>
+ <g transform="translate(165, 210)" font-family="TestComic" font-size="60" fill="white" stroke="none">
+ <text>AyÖ@ç</text>
+ </g>
+ <!-- translate to text position and flip y axis (glyphs are drawn -->
+ <!-- upside down -->
+ <g transform="translate(165,210) scale(1, -1)" fill="black">
+ <!-- fontsize / units-per-em == 60 / 2048 == 0.029296875 -->
+ <g transform="scale(0.029296875)">
+ <!-- uppercase A -->
+ <path d="M1250 -30Q1158 -30 1090 206Q1064 296 1025 521Q923 507 758 471L492 416Q442 285 321 33Q289 -23 234 -23Q194 -23 163 6T131 78Q131 126 282 443Q265 469 265 503Q265 584 363 607Q477 821 651 1099Q888 1478 946 1478Q1025 1478 1054 1368L1117 1032L1266 337L1323 179Q1352 98 1352 71Q1352 28 1321 -1T1250 -30zM897 1113L611 652Q732 683 978 727L897 1113z"/>
+ <!-- lowercase y -->
+ <path transform="translate(1498,0)" d="M1011 892L665 144Q537 -129 469 -313L403 -507Q377 -579 313 -579Q271 -579 241 -552T210 -483Q210 -383 426 96L68 785L23 858Q-4 904 -4 935Q-4 976 27 1007T98 1038Q144 1038 169 1003Q339 767 534 331L682 676Q762 855 836 984Q868 1040 920 1040Q961 1040 992 1011T1024 942Q1024 920 1011 892z"/>
+ <!-- unicode 00D6 -->
+ <path transform="translate(2564,0)" d="M802 -61Q520 -61 324 108Q116 288 116 572Q116 918 321 1201Q550 1515 892 1515Q1221 1515 1381 1367Q1548 1213 1548 881Q1548 535 1360 257Q1144 -61 802 -61zM892 1310Q647 1310 477 1066Q320 842 320 572Q320 379 463 258Q600 144 802 144Q1045 144 1203 389Q1344 608 1344 881Q1344 1120 1237 1217Q1135 1310 892 1310zM682 1848Q813 1848 813 1743Q813 1713 769 1685Q729 1660 694 1660Q571 1660 571 1763Q571 1792 608 1820T682 1848zM1221 1856Q1255 1856 1290 1825T1325 1763Q1325 1671 1182 1671Q1141 1671 1109 1692Q1073 1716 1073 1755Q1073 1824 1118 1844Q1143 1856 1221 1856z"/>
+ <!-- @ sign -->
+ <path transform="translate(4199,0)" d="M1306 412Q1200 412 1123 443T999 535Q945 482 894 455T793 428Q682 428 584 518T485 717Q485 902 630 1055T961 1208Q1003 1208 1031 1177T1059 1102Q1059 1042 959 1013Q826 975 771 926Q690 855 690 717Q690 688 717 661Q748 631 794 633Q881 637 955 795Q1022 933 1074 933Q1116 933 1142 902T1168 826Q1168 806 1162 766T1155 706Q1155 641 1211 624Q1233 617 1306 617Q1443 617 1498 684Q1548 744 1548 883Q1548 1128 1351 1283Q1171 1425 921 1425Q630 1425 465 1205Q316 1009 316 712Q316 438 491 250Q673 54 959 54Q1040 54 1142 85L1317 150Q1361 166 1374 166Q1415 166 1445 134T1475 58Q1475 -37 1262 -96Q1101 -140 961 -140Q820 -140 673 -86T420 60Q110 328 110 712Q110 1096 322 1354Q547 1630 921 1630Q1259 1630 1500 1427Q1753 1212 1753 883Q1753 658 1643 537Q1528 412 1306 412z"/>
+ <!-- unicode 00E7 -->
+ <path transform="translate(6106,0)" d="M770 -196Q770 -320 710 -382T528 -445Q443 -445 367 -413Q271 -371 271 -298Q271 -244 339 -244Q375 -244 420 -268T517 -293Q566 -292 590 -269T614 -201Q614 -153 577 -115T463 -48Q304 -12 208 104Q105 227 105 404Q105 607 240 823Q390 1063 578 1063Q676 1063 797 1017Q950 958 950 873Q950 835 925 806T863 776Q834 776 813 793T771 828Q712 875 578 875Q476 875 376 693Q285 526 285 404Q285 272 375 196Q459 125 591 125Q651 125 719 157L835 219Q865 235 878 235Q915 235 942 206T969 138Q969 35 713 -40Q742 -78 756 -117T770 -196z"/>
+ </g>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/interact-zoom-01-t.svg b/tests/arthur/data/1.1/interact-zoom-01-t.svg
new file mode 100644
index 0000000000..2318ec719b
--- /dev/null
+++ b/tests/arthur/data/1.1/interact-zoom-01-t.svg
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000, 2002 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- =====================================================================-->
+<!-- -->
+<!-- interact-zoomPan-BE-01.svg -->
+<!-- renamed for 1.1 suite to interact-zoom-01-f.svg -->
+<!-- renamed for SVGT/B to interact-zoom-01-t.svg -->
+<!-- -->
+<!-- Basic test of zoomAndPan attribute, "disable" value. (Based on -->
+<!-- code extracted from coordSystem-units-BE-03 test.) -->
+<!-- -->
+<!-- Author : Lofton Henderson -->
+<!-- 1.1 revision by Thomas DeWeese 5-Feb-2002 -->
+<!-- Revised for SVGT/B: Benoit Bezaire Jul/08/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 06-Aug-2000, LH: created -->
+<!-- -->
+<!-- =====================================================================-->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg id="svg-root" width="100%" height="100%" viewBox="0 0 80 60" zoomAndPan="disable" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="interact-zoom-01-t.svg">
+ <Paragraph>
+Verify correct handling by Dynamic (interactive) viewers for the
+"zoomAndPan" attribute on the 'svg' element. This is one of a pair of
+tests, and tests the value "disable".
+ </Paragraph>
+ <Paragraph>
+The test consists of a set of black circles with a blue stroke. </Paragraph>
+ <Paragraph>
+After the initial picture is displayed, the user should attempt to use
+the magnify controls that are required on conforming Dynamic SVG
+viewers. The correct behaviour is that the magnify and pan controls
+shall have no effect -- the viewer shall disable them.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image, except for
+possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">interact-zoom-01-t</title>
+ <desc id="test-desc">Test "disable" value of zoomAndPan attribute.</desc>
+ <!--===============================================================-->
+ <!--Content of Test Case follows... ==============-->
+ <!--===============================================================-->
+ <g id="test-body-content" font-size="6">
+ <!-- Title -->
+ <text x="5" y="7" fill="black" font-family="Arial">Test "disable" value of </text>
+ <text x="5" y="14" fill="black" font-family="Arial">zoomAndPan attribute.</text>
+ <g fill="black" stroke="blue" stroke-width="1">
+ <circle cx="20" cy="32" r="10"/>
+ <circle cx="30" cy="32" r="10"/>
+ <circle cx="60" cy="32" r="10"/>
+ <circle cx="50" cy="32" r="10"/>
+ <circle cx="40" cy="32" r="10"/>
+ </g>
+ </g>
+ <text id="revision" x="4" y="56" font-size="7" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="79" height="59" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/linking-a-04-t.svg b/tests/arthur/data/1.1/linking-a-04-t.svg
new file mode 100644
index 0000000000..6eb6b8c7b8
--- /dev/null
+++ b/tests/arthur/data/1.1/linking-a-04-t.svg
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- =====================================================================-->
+<!-- -->
+<!-- linking-a-04-t.svg -->
+<!-- -->
+<!-- Verify basic out-bound links and the 'a' element. -->
+<!-- -->
+<!-- Notes. This is based on sample files by Kelvin Lawrence et al, for -->
+<!-- IBM's SVGview. Requires supplemental file, linkingToc-t.svg. -->
+<!-- -->
+<!-- Author : Lee Klosterman 31-January-2002 -->
+<!-- Revised for Mobile Profiles: Jun Fujisawa 16-Jul-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- -->
+<!-- =====================================================================-->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" chapter="linking" section="a" profile="f" index="02" >
+
+ <!-- For BE-01 case, 'Previous' should target last BE of previous chapter-focus -->
+
+ <!-- Previous chapter="interact" focus="cursor" BENumber="08" / -->
+
+ <!-- For last BE of chapter, 'Next' should target first BE of next chapter-focus -->
+
+ <!-- Next focus="xlinkAttr" BENumber="02" / -->
+ <!-- Parent chapter="toc" / -->
+
+ <!-- For now, all BE target DT-01 in same chapter-focus as Child -->
+
+ <!-- Child testType="DT" DTNumber="01" / -->
+
+ <OperatorScript version="$Revision: 1.8 $" testname="linking-a-02-t.svg">
+ <Paragraph>
+ Verify the capability to handle basic links out of SVG content
+ using the 'a' element, with the xlink:href attributes.
+ There are three subtests, in each of which one
+ of three colored arrows comprise the content of an 'a' element. The
+ link destination is expressed by "xlink:href=".
+ The initial view of this test contains the three arrows, a colored
+ circle, labelling text, and the usual template legend and frame.
+ </Paragraph>
+ <Paragraph>
+ The top-most (yellow) arrow links to an external SVG file, which is
+ local (in the same directory). The target file contains SVG 'text' elements
+ which comprise a TOC and brief description of all of the test files
+ for Linking. Upon clicking the first arrow, the image of the linkingToc-t.svg
+ file should replace the initial view of this test case in the viewer frame.
+ </Paragraph>
+ <Paragraph>
+ The middle (green) arrow links to an object in this SVG test file, the yellow
+ circle (id="internal-circle") immediately to its right, using "#circle-object"
+ as the value of of the xlink:href attribute.
+ There should be no change to the viewer frame upon clicking this arrow.
+ </Paragraph>
+ <Paragraph>
+ The bottom-most (blue) arrow links to remote non-SVG content, the W3C home page
+ using xlink:href attribute value "http://www.w3.org". For viewers in a Web
+ browser environment, the W3C home page should replace the initial view
+ of this test case in the browser/viewer frame. For other viewers (e.g.,
+ interactive but SVG-only standalone viewers), the result is undefined, but could
+ include such actions as a diagnostic "Error parsing..." message.
+ </Paragraph>
+ <Paragraph>
+ There are several reference images associated with this test case. The first
+ illustrates the correct "start" or initial state of the rendered SVG file.
+ The second illustrates the correct image after the first link is activated
+ (to the linkingToc.svg file). The third (for browser-environment viewers)
+ should match the current image of the W3C home page, as viewed with a
+ conventional browser. (Note. This harness does not yet
+ provide access to multiple PNGs; the first, initial-state PNG is shown.)
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' and 'polygon' elements, as well as basic fill (solid simple colors),
+ stroke (black and colored wide and 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+
+ </SVGTestCase>
+
+ <title id="test-title">linking-a-04-t</title>
+ <desc id="test-desc">Verify basic out-bound links and the 'a' element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <text x="90" y="16" font-size="12" >Basic out-bound links and the 'a' element.</text>
+ <!-- First linking test: link to another SVG file in same location. -->
+ <a xlink:href="images/linkingToc-t.svg">
+ <path fill="yellow" stroke="blue" d="M 165,40 h 100 v -12 l 45 36 l -45 36 v -12 h -100 z"/>
+ </a>
+ <!-- Second linking test: link to another object in this file. -->
+ <g transform="translate(0,90)">
+ <a xlink:href="#internal-circle">
+ <path fill="lime" stroke="blue" d="M 165,40 h 100 v -12 l 45 36 l -45 36 v -12 h -100 z"/>
+ </a>
+ </g>
+ <!-- Third linking test: links to external, remote, non-SVG content (for -->
+ <!-- plugin viewers in browser environments.) -->
+ <g transform="translate(0,180)">
+ <a xlink:href="http://www.w3.org">
+ <path fill="aqua" stroke="blue" d="M 165,40 h 100 v -12 l 45 36 l -45 36 v -12 h -100 z"/>
+ </a>
+ </g>
+ <!-- Link target of second test -->
+ <circle id="internal-circle" cx="390" cy="153" r="20" stroke="lime" fill="yellow" stroke-width="4" />
+ <text x="350" y="189" font-size="10" >id="internal-circle"</text>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/linking-uri-03-t.svg b/tests/arthur/data/1.1/linking-uri-03-t.svg
new file mode 100644
index 0000000000..5009ea579b
--- /dev/null
+++ b/tests/arthur/data/1.1/linking-uri-03-t.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2002 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- linking-uri-03-t.svg -->
+<!-- Notes. This is based on sample file from SVG spec. Requires -->
+<!-- Requires supplemental file, linkingToc-t.svg. -->
+<!-- Author : Lee Klosterman 31-January-2002 -->
+<!--======================================================================-->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" baseProfile="tiny" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="linking-uri-03-t.svg">
+ <Paragraph>
+ Verify the handling of the allowable xlink attributes on the 'a' element.
+ The initial view of this test contains a single green triangle, labelling text,
+ and the usual template legend and frame.
+ </Paragraph>
+ <Paragraph>
+ There is a link on the triangle, pointing to an external SVG file, which is
+ local (in the same directory). The target file contains SVG 'text' elements
+ which comprise a TOC and brief description of all of the BE test files
+ for Linking. Upon clicking the triangle, the image of the linkingToc-t.svg
+ file should replace the initial view of this test case in the viewer frame.
+ </Paragraph>
+ <Paragraph>
+ The purpose of the test is to
+ verify that viewers tolerate the presence of xlink attributes on the 'a'
+ element. The presence of the attributes should not change the behavior of
+ the test in any way. The results of executing the link should be identical
+ to executing the first (topmost) link of linking-a-01-f.
+ </Paragraph>
+ <Paragraph>
+ There are two reference images associated with this test case. The first
+ illustrates the correct "start" or initial state of the rendered SVG file.
+ The second illustrates the correct image after the link is activated
+ (to the linkingToc-t.svg file). (Note. This harness does not yet
+ provide access to multiple PNGs; the first, initial-state PNG is shown.)
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid simple colors),
+ stroke (black and colored wide and 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">linking-uri-03-t</title>
+ <desc id="test-desc">Verify xlink attributes on the 'a' element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <text x="75" y="16" font-size="12">Simple exercise of xlink attributes on the 'a' element.</text>
+ <a xlink:type="simple" xlink:show="replace" xlink:actuate="onRequest" xlink:href="images/linkingToc-t.svg" xlink:role="figure-out-a-role-value-and-associated-xmlns" xlink:title="TOC of Linking BE tests." target="_self">
+ <path d="M 135 122 l 130 0 l -65 130 z" fill="lime" stroke="blue"/>
+ </a>
+ <text x="160" y="116" font-size="12">Click for TOC</text>
+ <text x="25" y="172" font-size="12">Link to local file</text>
+ <text x="25" y="182" font-size="12">linkingToc-t.svg.</text>
+ <rect x="19" y="160" width="100" height="26" fill="none" stroke="black"/>
+ <text x="275" y="144" font-size="10">xlink:type="simple"</text>
+ <text x="275" y="155" font-size="10">xlink:show="replace"</text>
+ <text x="275" y="166" font-size="10">xlink:actuate="onRequest"</text>
+ <text x="275" y="177" font-size="10">xlink:href="linkingToc-t.svg"</text>
+ <text x="275" y="188" font-size="10">xlink:role="figure-out-a-role"</text>
+ <text x="275" y="199" font-size="10">xlink:title="TOC of Linking BE tests."</text>
+ <text x="275" y="210" font-size="10">target="_self"</text>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/metadata-example-01-b.svg b/tests/arthur/data/1.1/metadata-example-01-b.svg
new file mode 100644
index 0000000000..24d0613aba
--- /dev/null
+++ b/tests/arthur/data/1.1/metadata-example-01-b.svg
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+<!-- no way this will ever be valid. comment out the metadata section to validate the rest of the SVG -->
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- metadata-example-01-b.svg -->
+<!-- -->
+<!-- Verify that the viewer handles and tolerates the presence of metadata -->
+<!-- -->
+<!-- Author : Chris Lilley 14-Mar-2002 -->
+<!-- -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" viewBox="0 0 480 360" width="100%" height="100%">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="metadata-example-01-t.svg">
+ <Paragraph>Check that metadata in a variety of namespaces, inside a metadata
+ element, does not affect rendering in any way. The file is not valid to the DTD, but is well formed.
+ </Paragraph>
+ <Paragraph>The diagram on the table is a visualization of the RDF metadata in the graphic.</Paragraph>
+ <Paragraph>The rendered result should match the reference image and there should be
+ no error messages or warnings</Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">metadata-example-01-b</title>
+ <desc id="test-desc">Verify that the viewer is not perturbed by the presence of metadata.</desc>
+ <metadata>
+ <rdf:RDF xmlns:prism="http://prismstandard.org/namespaces/1.0/basic/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+ <!-- The empty value for the rdf:about attribute means it is describing the file this is contained in. -->
+ <rdf:Description rdf:about="">
+ <dc:description>Line drawing of woman in antique attire, which
+ looks legal or perhaps mystical.</dc:description>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:subject>Sibyll Trelawney</dc:subject>
+ <dc:type rdf:resource="http://prismstandard.org/vocabularies/1.0/resourcetype.xml#birdsEye"/>
+ <dc:type rdf:resource="http://prismstandard.org/vocabularies/1.0/resourcetype.xml#illustration"/>
+ </rdf:Description>
+ </rdf:RDF>
+ </metadata>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="scale(1.2)">
+ <g id="Sibyll" fill="#FFF" stroke="#000" stroke-miterlimit="4">
+ <g stroke="none">
+ <path fill="#000" d="M132.386,113.177c0.394-2.645,0.978-6.189,1.681-10.262c-7.597-5.655-19.264-14.488-26.764-25.988l-1.667-0.667c5.333,15.167,25,32.833,26.75,36.917l15.583,15.25c0,0,10,10.667,12.167,13.833c2.167,3.167,3.5,7.167,1.333,9.833
+ c-1.667-1-4.833-5.333-8-9.167c0,0-7-1.5-13.833-1.333c0,0,2.667,5.5,3.833,8c0.563,1.207,0.465,2.141,0.064,3.047c6.241,4.828,12.252,13.801,16.102,18.453c4,4.833,5.548,8.822,12.167,10.167c10.667,2.167,16.667,7.5,19.667,10s3,4,1.833,4.833
+ c0,0-4.167,1.5-11,2c-6.833,0.5-12.333-3.333-15.167-3.333c-4.333-0.167-6.333-3-7.833-6.333c-1.5-3.333-4.5-4.833-9.167-7.667c-4.293-2.606-14.858-7.894-19.053-14.174c-4.791,3.163-10.643,5.756-17.447,8.34l-1.333-1.333c-1.933,0.773-4.538,1.52-7.574,1.925
+ c2.113,6.17,7.926,15.123,10.157,16.908c2.5,2,4.25,4.25,4.25,6.5s-0.75,5.5-3.75,9.5c-0.5,13-6,19.75-12.5,22.25c-4.5-15-0.5-25.25,1.5-31.25c0,0-7.472-6.813-12.938-12.608c0.73,3.979,1.468,7.703,2.188,10.942c0,0-1.232,1.575-3.5,0.833
+ c-8.667-2.833-22.167-10.333-27.333-16.333c-2.667-7.833-6.5-33.667-7.667-44.333c0,0-5.167-1.333-10.167-2.667c0,0-0.667-0.333-1.5-3.5c0,0-5.667-1.667-11.833-3c-6.167-1.333-5.667-2.667-6.667-6.167s0.667-28.5,2.5-36.667c1.833-8.167,10.5-22.167,15.833-28
+ c0,0-1.006-0.135-1.833-2.5c-5.833-16.667-7.833-27.333-0.667-37.667c7.167-10.333,20.167-6,26.667-2.833c6.5,3.167,6.667,8.333,8.167,10.833s0.333,4.833,2,7.167c17.667,7,26.833,16.667,38.833,27.167c7.5,3.667,13.667,9.667,18.667,13.833
+ c1.124,0.937,2.323,2.151,3.556,3.525c1.444-7.663,2.858-14.936,3.944-20.275c3-14.75,9.5-47,10.25-49.25l3,0.25c29.25,0.25,69.75-1,69.75-1c0.25,20.25,0.25,62.5,0.25,74.25s0,39,0.25,42.25c0,0-3.75,2-8.333,2.75c1,0.167,1.667,2.5-0.167,3.333
+ c-3,0.167-25.333,0.167-33-1c-1.245-0.189-2.923-0.326-4.879-0.422c2.441,2.484,8.906,8.839,19.629,17.838l-0.25,8.25l-9,0.25l-31.952-26.426c-4.665,0.081-8.525,0.176-10.215,0.176l-15.583-15.25z"/>
+ <path fill="#000" d="M60.654,1.358c-0.844,0.915-1.808,2.263-2.857,3.938c-1.195-1.07-3.74-3.216-6.342-4.566l-1.904,2.413l6.058,5.882c-0.131,0.236-0.264,0.477-0.397,0.721C46.57,3.133,43.441,0.554,43.441,0.554l-2.39,2.766
+ c3.972,4.632,9.453,8.916,11.891,10.729c-0.211,0.413-0.423,0.831-0.636,1.255C39.417,5.651,34.449,0.917,34.449,0.917l-2.717,2.945c7.647,7.33,15.917,14.754,18.024,16.638c-0.204,0.425-0.408,0.854-0.613,1.284C36.8,12.691,27.994,4.367,25.422,0.449
+ l-2.39,2.765c8.104,8.539,20.319,19.211,24.227,22.583c-0.206,0.443-0.411,0.888-0.617,1.333c-9.527-6.31-14.627-11.31-18.931-15.432C23.201,7.377,17.976,1.917,15.896,0L13.02,3.119c7.717,8.503,25.108,24.004,31.619,28.399
+ c-0.243,0.537-0.485,1.073-0.726,1.607C30.32,22.46,10.721,5.175,6.985,2.362L4.901,4.448c8.872,9.074,31.669,29.336,36.615,34.038c-0.3,0.677-0.597,1.346-0.89,2.006C25.883,27.823,2.664,6.874,2.664,6.874L1.12,9.939c10.493,10.57,33.952,32.544,37.258,35.638
+ c-0.259,0.585-0.512,1.158-0.758,1.715C22.515,33.526,7.848,20.476,3.401,16.852l-2.237,2.426c11.139,10.986,30.478,28.518,34.581,32.227c-0.323,0.72-0.628,1.394-0.913,2.015C21.063,40.369,5.95,27.057,2.685,23.887l-2.383,2.932
+ c8.691,8.46,29.709,27.74,32.738,30.515c-0.304,0.651-0.648,1.404-1.029,2.247C18.259,46.584,5.606,34.76,2.869,32.553l-2.25,2.092c9.949,10.825,26.338,25.906,29.82,28.451c-0.32,0.724-0.656,1.485-1.006,2.28C16.333,52.826,2.679,40.233,2.679,40.233
+ l-2.224,2.759c9.067,9.678,23.141,23.04,27.343,26.12c-0.297,0.683-0.602,1.383-0.912,2.098C15.543,60.602,2.703,49.073,2.703,49.073C1.238,49.966,0,52.352,0,52.352C11.334,63.218,22.136,73.12,24.95,75.689c-0.261,0.606-0.525,1.22-0.792,1.841
+ C8.771,63.626,2.36,57.093,2.36,57.093l-1.884,2.912c8.419,8.851,18.809,19.06,21.778,21.963c-0.157,0.366-0.313,0.733-0.472,1.102C10.825,74.056,2.944,67.412,2.944,67.412l-1.737,2.405c8.374,8.123,16.46,14.983,18.948,17.065
+ c-0.242,0.567-0.484,1.137-0.728,1.709C10.261,82.019,3.115,75.745,3.115,75.745l-1.85,3.745c8.161,7.937,14.37,12.905,16.005,14.183c-0.244,0.576-0.488,1.152-0.732,1.729C7.159,87.785,4.131,84.377,4.131,84.377l-2.363,3.432
+ c5.442,5.678,11.379,9.753,13.319,11.023c-0.25,0.592-0.5,1.183-0.748,1.773l-10.71-8.035l-1.884,2.912l10.717,9.579c-0.152,0.362-0.303,0.723-0.455,1.083l-8.603-6.725l-1.724,2.738l8.792,7.647c-0.276,0.659-0.549,1.313-0.821,1.962l-6.45-5l-1.737,2.405
+ l6.509,6.618c-0.19,0.457-0.379,0.911-0.566,1.36l-5.095-3.509l-1.384,2.892l4.96,4.278c-0.144,0.347-0.286,0.69-0.427,1.031l-2.546-1.553l-1.211,3.051l2.199,2.281c-1.341,3.262-2.508,6.131-3.433,8.444l2.725,1.391c1.204-3.218,31.228-73.322,36-83.189
+ S60.577,7.7,62.173,1.797l-1.519-0.439z"/>
+ <path d="M142.803,106.261c-1,0.5-3,1-5-0.5c0,0-3.667,12.333-2.667,17.667c3.667,1.833,42.833,2.5,52.667,2.5c16.833,0,26.167,1,30,0.5c4.583-0.75,8.333-2.75,8.333-2.75c-0.25-3.25-0.25-30.5-0.25-42.25s1.333-54.354-0.25-74.25c0,0-40.5,1.25-69.75,1
+ c0.5,5.75-2.395,17.829-4,24.25c-1.5,6-5,25.25-9.929,48.894c3.256,4.04,6.499,8.469,9.012,11.273c0,0,0.089,1.697-0.189,3.521c3.856,1.062,6.481,3.062,7.981,5.312s2.25,5.625,1.375,7.875c0.625,3.125,0.5,5.375-0.875,5.75s-2.5,1-4.5,0.25
+ c-0.875,3.25-1.25,3.5-1.25,3.5c-1.75,0-2.375-0.125-2.375-0.125c-3-4.125-8.667-7.833-8.333-12.417z"/>
+ <path fill="#000" d="M207.303,18.594c0,0-19,6.167-39.167,13.333c0,0,0.716,6.012,1.617,11.404c-4.629,2.158-9.096,4.243-12.617,5.93c0,0,5,18,10.333,30.333c2.833-2.167,23-11.833,37.167-19.667c0,0-0.888-2.858-2.156-6.833
+ c1.809-0.587,7.883-2.55,9.156-2.833c1.5-0.333,1.5-2.833,1.5-2.833s-4.333-21.667-5.833-28.833z"/>
+ <path d="M133.469,159.427c-6.038,5.712-26.618,15.097-44.84,10.635c-1.833-11.777-3.345-23.232-3.993-29.635c-1.333-13.167-1.5-27.167-1.5-27.167c7,0.833,11.333-0.333,11.333-0.333c-0.333-4,0.5-9.5,0.5-9.5c2.5,3.167,7,5,8.333,1.833
+ c1.333-3.167,2.5-8.667,2.5-8.667c3.5,2.167,10,9.667,15.833,19c5.833,9.333,11.833,18.833,15.333,26.5c3.5,7.667,2.667,11.5-3.5,17.333z"/>
+ <path d="M150.303,98.094c-0.573,1.604-3.428,4.624-5.483,6.519c0.691,4.564,3.566,8.189,4.941,9.189s2.75,2,2.75,2c0.625-2.125-0.25-4.25-3.125-5.625c-0.375-1,0.75-3,1.75-2s2,0.375,2,0.375c1.875,2.75,2.125,4.125,2.125,4.125l2,0.5
+ c0-3.125-0.625-4.5,0.375-6.25c-1-3.75-2.292-7.042-7.333-8.833z"/>
+ <path d="M115.386,197.677c-1.5,7.25-3.25,13.25-4.5,16.25s-0.75,5.25-4.75,5c-3.25-1.5-3.5-3.75-2.25-8.5s3.5-9,3.5-12.25c-6.583-7.147-13.873-14.577-17.08-17.819c-0.354-2.073-0.703-4.181-1.043-6.295c4.057,1.386,8.024,1.841,11.607,1.757
+ c3.328,8.71,11.053,18.163,14.516,21.857z"/>
+ <path d="M141.636,155.761c0.054-0.094,0.108-0.187,0.164-0.277c7.517,8.107,12.258,14.859,14.67,17.111c2.5,2.333,6.5,8.667,10,9.833c3.5,1.167,11.833,4.167,14.333,5.333s2.667,1.833,2.167,3.667c-0.5,1.833-1.333,2.833-7,2.167
+ c-5.667-0.667-11.833-1.5-12.167-3.833c-0.333-2.333-7.333-9.5-11.833-11.5c-4.067-1.808-15.622-8.652-18.299-13.521c3.277-2.538,5.95-5.452,7.965-8.979z"/>
+ <path d="M193.136,150.927l-3,0.25c-13.131-11.256-23.025-19.555-27.146-22.997c1.969-0.023,3.993-0.039,5.991-0.041c9.588,10.269,24.155,22.788,24.155,22.788z"/>
+ <path d="M169.303,74.427c-4.667-11.833-7.833-23.667-7.833-23.667c13.333-6.333,32-15.167,32-15.167c2.5,9.167,7.333,23.333,7.333,23.333c-15.833,7.5-31.5,15.5-31.5,15.5z"/>
+ <path d="M201.697,50.65c-2.207-6.863-5.115-15.666-6.728-19.556c-2.217,1.478-12.056,6.098-21.979,10.728c-0.355-1.502-1.255-5.506-1.521-8.561c2.5-0.5,22.333-6.667,33.5-10.167c0.333,2.833,2.333,12.833,4.667,25.167c-1.124,0.75-5.709,1.873-7.938,2.389z"/>
+ <path d="M121.636,69.302l-0.333-2.333c5.333,3.333,20.667,18,26.167,25.667c0,2-1.833,1.333-2.833,0.333s-3.667-5.167-9-10.5c-5.333-5.333-12-13.333-14-13.167z"/>
+ <path d="M119.136,74.136c-0.667-6.833-3.333-11.333-12-18.5c-8.667-7.167-19.833-16.667-26.667-18.5c1.167,1.167,1.5,2.333,1.5,2.333c9.167,4.667,25.667,18.833,29.5,24.333s6.333,10,7.667,10.333z"/>
+ <path d="M68.441,165.532c-0.229-1.13-0.446-2.215-0.649-3.251c-1.987-0.381-3.908-1.266-5.172-1.943c0.2,1.172,0.399,2.327,0.595,3.453c1.945,0.734,3.919,1.353,5.227,1.741z"/>
+ <path d="M69.66,171.421c-2.355-0.877-4.315-1.616-5.454-2.046c0.217,1.205,0.426,2.347,0.622,3.412c2.266,0.833,4.26,1.692,5.618,2.308c-0.274-1.266-0.536-2.491-0.786-3.674z"/>
+ <path d="M61.589,154.129c2.229,0.848,3.901,1.444,4.997,1.822c-0.184-0.999-0.351-1.93-0.504-2.797c-1.253-0.34-2.919-0.923-4.952-1.916c0.151,0.962,0.304,1.927,0.46,2.891z"/>
+ <path d="M65.795,177.971c0.369,1.946,0.59,3.082,0.59,3.082s3.25,3.75,6.5,5c-0.317-1.384-0.622-2.732-0.916-4.042c-2.397-1.074-4.802-2.904-6.174-4.04z"/>
+ <path d="M64.884,145.852c-0.178-1.214-0.249-1.8-0.249-1.8l-4.75-1.25c0.093,0.678,0.189,1.366,0.288,2.06c1.966,0.497,3.552,0.803,4.711,0.99z"/>
+ <path d="M41.469,94.136c0.5,5.5,2.833,15.333,2.833,15.333l7.333,0.833l1.5,1.5c1-3.667,3.5-5.333,6.5-5.167s13.167,0,13.167,0c0.167-4.5,0.833-11,0.833-11c-2,4-3.5,4.833-6.333,4.167c-2.833-0.667-22.167-5.5-25.833-5.667z"/>
+ <path d="M44.303,90.636l2.167-2.833c11.667,1.5,25.333,5.667,25.333,5.667s-1,2.833-2.667,3.667c-12.333-2.667-24.833-6.5-24.833-6.5z"/>
+ <path d="M49.636,114.969c-0.5,2.167-0.5,8.5-0.5,8.5c3.333,0,4.833,0.5,4.667,1.833c1.5,0.167,2.833,1.5,2.833,1.5c2.833-0.333,5.167,1.333,9.167,1.5c4,0.167,5.5,2,8.5-0.667c-3.5,0.167-9.167-0.167-9.5-2.333c4.333-0.333,9.167,0.333,10.333-0.5
+ c0.833-1,0-1.667,0-1.667c-5.167,0-11.167-0.333-11-2c0.167-1.667,4.333-0.333,6.5-0.167c2.167,0.167,6,0.333,6.167-1.5c0.167-1.833-2.833-0.833-4.833-0.833s-7.5,0.167-7.333-1.5c0.167-1.667,2-1,5.5-0.833c3.5,0.167,6,0,6.167-1.333
+ c-3-0.5-7.5-1.333-9.833-1.667c-2.333-0.333-5.5-0.167-5.5-0.167c-0.5-1.667,1.333-2.833,4-2.167c2.667,0.667,5,0.667,5,0.667s3.5-0.667,2.5-1.667s-7.333-0.333-10.5-1c-3.167-0.667-6.167-0.333-6.833,2.167c-0.667,2.5-0.833,4.333-5.5,3.833z"/>
+ <path d="M52.969,128.302c-0.167,3-1.333,4.5-1.333,4.5c7,1.167,13.667,2,15.833,2.667c2.5-1.667,2.5-4,2.5-4c-6-0.167-11-1.167-17-3.167z"/>
+ <path d="M48.303,83.802c0.32-0.641,0.712-1.385,1.158-2.195c-3.615-2.958-6.491-4.972-6.491-4.972c0.531-1.044,1.041-2.015,1.535-2.927c2.657,2.698,5.046,4.441,6.417,5.345c0.384-0.646,0.789-1.311,1.211-1.984c-2.489-1.858-5.061-4.094-6.501-5.381
+ c0.501-0.871,0.986-1.675,1.458-2.414c2.28,2.454,5.479,4.286,6.863,5.014c0.36-0.527,0.728-1.049,1.1-1.563c-2.814-2.162-4.917-4.646-6.071-6.168c0.626-0.813,1.238-1.517,1.844-2.126c2.739,2.539,5.216,4.473,6.461,5.41c0.314-0.374,0.627-0.733,0.94-1.077
+ c-2.576-2.421-4.665-4.903-5.513-5.949c0.684-0.484,1.375-0.871,2.09-1.181c1.745,2.559,3.975,4.467,5.164,5.387c0.454-0.404,0.901-0.759,1.336-1.054l-3.5-4.167c0,0-4.5-1.167-11.167-2.333c-2.833,2.5-10.167,14-13.667,20.5s-5,22.5-5.167,28.167
+ c-0.167,5.667-0.833,12,0.5,15.333c0,0,0.506-0.025,1.369-0.083c0.068-3.272-0.202-6.251-0.202-6.251s0.64-0.07,1.667-0.163v6.307c0.644-0.051,1.375-0.113,2.167-0.188v-6.298c0.526-0.04,1.087-0.079,1.668-0.115l1.005,6.131c0.435-0.051,0.878-0.105,1.327-0.163
+ v-6.086c0.758-0.03,1.52-0.049,2.261-0.055l0.32,5.773c0.916-0.145,1.831-0.305,2.723-0.482l-0.111-5.215c0.679,0.048,1.292,0.12,1.806,0.223l0.974,4.384c0.064-0.017,0.129-0.034,0.192-0.051c0.167-2.667,0.333-6.333,1.667-8c0,0-4.333-0.833-7.833-1.667
+ c-3.5-0.833-7.167,1.333-7.167,1.333l-1-3.167c0,0,2.333-0.167,5.833-3.167c0,0,1.333-2.833,2.333-7c0,0,0.5-2.667-0.5-5c-1-2.333,0.167-4,1.667-4c0,0,1.667-1,2.833-4c-0.833-1-0.333-2.833-2.167-4.333l1-3.5c0,0,2.333,2.833,6.167,5.167z"/>
+ <path d="M72.469,87.636c-3-10-4.333-21.333-4.333-21.333c1.833,0.167,3-1.667,2.833-3.333c-0.167-1.667,0.167-3.833,0.167-3.833c2.5,0,6.833,2.667,6.5-2.167l1.833-0.5l-0.667,1.333c5.667,2.5,10.167,8,13,11c-0.167,3.167-1.333,4.833-1.333,4.833
+ c-7.5-8.5-10.667-11.667-17.5-13.5c-0.833-0.167-1.167,0.833-1.167,0.833c3.667,11.5,7.667,18.5,6.5,24.833c-1.167,1.833-5.833,1.833-5.833,1.833z"/>
+ <path d="M71.803,57.136c1.333-0.5,3.5-0.167,3.5-0.167v1c0,0-1.833,0.833-3.5-0.833z"/>
+ <path d="M69.303,59.469c-0.5,2-0.833,4.833-0.833,4.833c-2.833-0.5-7-2.167-8.333-5c-0.167-1.833-0.5-3.333-0.5-3.333c4.167,2.333,7.833,3.833,9.667,3.5z"/>
+ <path d="M61.041,22.638c1.264-0.02,4.413-0.208,7.262-1.502c-1.5-6.333-16.5-5.667-19-5.167s-6,3.833-7.333,6.667c0.407,0.078,0.821,0.147,1.241,0.209c0.353-0.971,0.765-1.43,0.967-1.61c0.539-0.141,1.064-0.269,1.579-0.386l-0.121,2.274
+ c0.448,0.038,0.897,0.069,1.347,0.094c0.278-0.639,0.836-1.885,1.368-2.879c0.916-0.149,1.796-0.258,2.648-0.325l-0.633,3.291c0.734-0.001,1.454-0.015,2.151-0.036l1.019-3.336c1.12,0.02,2.201,0.116,3.266,0.287v2.805c0.273-0.022,0.535-0.045,0.784-0.068
+ l1.205-2.329c0.706,0.176,1.409,0.385,2.118,0.627l0.132,1.386z"/>
+ <path d="M80.719,45.948c-1.216,1.93-3.617,3.119-4.833,3.229c0,0,1.265-2.633,3.503-5c0.58-0.479,0.58-1.229-0.12-1.646c-0.467,0.238-1.198,0.661-1.884,1.27c-1.125,1-2.75-0.25-3.25-1.5c0.781-1.45,3.351-1.408,4.961-1.827c0.622-0.527-0.128-1.34-0.128-1.34
+ c-2.833-3-7.167-4.333-7.167-6.833c0-1.414,0.373-2.507,0.697-3.191c-0.643,0.122-1.472-0.365-1.614-0.934c-0.201-0.805-0.323-1.369-1.407-2.732c-0.147,0.09-0.295,0.181-0.444,0.273c0.392,1.027,0.987,2.527,1.727,4.209c1.375,3.125-2.125,2.625-2.25,1.125
+ c-0.093-1.118-0.742-2.652-1.688-3.931c-0.119,0.078-0.237,0.157-0.356,0.236c0.75,1.878,1.31,4.497,1.793,6.819c0.625,3-2.375,2.25-2.625,1c-0.205-1.023-0.83-3.555-2.079-5.744c-0.127,0.098-0.253,0.196-0.379,0.296c0.56,2.288,0.947,5.64,1.333,7.573
+ c0.5,2.5-2.375,2.5-2.625,0.5c-0.212-1.696-0.245-2.944-1.242-5.878c-0.208,0.2-0.414,0.402-0.616,0.608c0.012,3.123-0.009,8.49-0.268,10.646c-0.375,3.125-2.875,2.375-2.75,1c0.109-1.197-0.161-3.154-0.068-7.767c-0.046,0.076-0.095,0.15-0.14,0.226
+ c-0.833,5.333-1.167,12.833,4.833,15.5s14.292,3.313,18,0.5c4.208-2.563,1.083-4.313,1.083-6.688z"/>
+ <g fill="#000">
+ <path d="M108.89,146.162c-0.826-0.792-1.639-1.586-2.431-2.375c-3.331,1.829-7.613,3.162-9.51,3.705c0.6,0.995,1.222,2.013,1.855,3.04c5.627-1.592,8.655-3.34,10.085-4.369z"/>
+ <path d="M101.191,138.181c-2.182,1.709-5.985,3.141-7.535,3.682c0.5,0.895,1.054,1.857,1.647,2.868c4.203-1.098,7.043-2.515,8.666-3.492c-0.993-1.046-1.926-2.07-2.778-3.058z"/>
+ <path d="M102.346,156.194c5.876-1.628,9.702-4.044,11.53-5.404c-0.834-0.752-1.673-1.518-2.508-2.293c-2.729,2.457-8.69,4.159-10.893,4.725c0.627,1.002,1.253,1.998,1.871,2.973z"/>
+ <path d="M123.275,158.893c-3.958,2.792-11.935,5.487-15.034,6.474c1.168,1.793,1.895,2.894,1.895,2.894s12.5-3.333,16.5-6.667c-0.892-0.694-2.039-1.613-3.361-2.701z"/>
+ <path d="M117.5,154c-3.033,2.28-10.208,4.545-13.112,5.402c0.657,1.026,1.285,2.002,1.869,2.907c6.353-1.963,11.13-4.771,13.516-6.351c-0.735-0.626-1.496-1.281-2.273-1.958z"/>
+ <path d="M99.333,135.915c-0.582-0.755-1.097-1.476-1.531-2.154c-2.333,1.5-6.667,3-6.667,3c0.173,0.519,0.483,1.221,0.902,2.066c2.759-0.008,4.985-0.774,7.296-2.913z"/>
+ <path d="M66.386,44.677c2.125-1.75,5.375-4.25,5.125-7.25l-1.25-0.625l-0.125-0.75c-5.125,3.25-7.75,4.375-8.5,5c0.875,1.875,2.5,1.375,2.5,1.375c2.125-1.125,4-2.375,4-2.375c-1.875,2.125-2.5,3.125-2.5,3.125s-0.125,0.875,0.75,1.5z"/>
+ </g>
+ </g>
+ </g>
+ <g id="vis" transform="translate(153,58) rotate(-27) scale(0.05)" stroke="rgb(66,105,66)" font-family="dialog, sans-serif" font-size="10">
+ <g fill="rgb(115,191,115)">
+ <ellipse cx="195" cy="210" rx="27" ry="18"/>
+ <ellipse cx="645" cy="102" rx="225" ry="18"/>
+ <ellipse cx="645" cy="156" rx="230" ry="18"/>
+ </g>
+ <g fill="rgb(255,223,123)" stroke="rgb(132,117,66)">
+ <rect height="36" width="100" x="595" y="192"/>
+ <rect height="36" width="276" x="507" y="246"/>
+ <rect height="36" width="106" x="592" y="300"/>
+ </g>
+ <g fill="none" stroke="rgb(90,89,206)">
+ <path d="M201 193C212 170 215 158 240 143 279 122 377 112 428 107"/>
+ <path d="M216 200C224 196 232 193 240 191 311 174 390 165 423 161"/>
+ <path d="M221 210C295 210 497 210 595 210"/>
+ <path d="M221 210C295 210 497 210 595 210"/>
+ <path d="M216 220C224 224 232 227 240 229 334 252 444 261 506 264"/>
+ <path d="M201 227C212 253 215 265 240 280 352 344 508 337 592 325"/>
+ </g>
+ <g fill="rgb(90,89,206)" stroke="none">
+ <polygon points="433,107 425,111 425,103"/>
+ <polygon points="428,160 421,165 420,157"/>
+ <polygon points="600,210 592,214 592,206"/>
+ <polygon points="511,264 503,268 503,260"/>
+ <polygon points="597,324 590,329 588,321"/>
+ </g>
+<!--
+ <g fill="rgb(66,105,66)">
+ <text x="458" y="105">http://prismstandard.org/vocabularies/1.0/resourcetype.xml#birdsEye</text>
+ <text x="453" y="159">http://prismstandard.org/vocabularies/1.0/resourcetype.xml#illustration</text>
+ <text x="604" y="213">image/svg+xml</text>
+ <text x="530" y="267">Line drawing of woman in antique attire, ...</text>
+ <text x="177" y="213">online:</text>
+ <text x="601" y="321">Sibyll Trelawney</text>
+ </g>
+ <g stroke="rgb(90,89,206)" fill="rgb(90,89,206)">
+ <text x="256" y="158">http://purl.org/dc/elements/1.1/type</text>
+ <text x="250" y="206">http://purl.org/dc/elements/1.1/format</text>
+ <text x="250" y="276">http://purl.org/dc/elements/1.1/subject</text>
+ <text x="256" y="105">http://purl.org/dc/elements/1.1/type</text>
+ <text x="240" y="225">http://purl.org/dc/elements/1.1/description</text>
+ </g>-->
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/painting-fill-01-t.svg b/tests/arthur/data/1.1/painting-fill-01-t.svg
new file mode 100644
index 0000000000..84b87506b3
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-fill-01-t.svg
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paint-fill-BE-01.svg -->
+<!-- renamed for 1.1 suite to painting-fill-01-f.svg -->
+<!-- renamed for SVGT/B to painting-fill-01-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the fill -->
+<!-- properties within 'style' attributes. -->
+<!-- -->
+<!-- -->
+<!-- Author : Kevin McCluskey, 9-Feb-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!-- Revised for SVGT/B: Benoit Bezaire Jul/02/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 9-Feb-2000, KM, Serial#2 created. Matches 20000202 SVG spec. -->
+<!-- 27-feb-2000, LH, Ser#3, remove extra </g>, fixed name ("paint-"). -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#4 -->
+<!-- 28-Mar-2000, LH, fix gradient test; ser#5 -->
+<!-- 19-May-2000, LH, comment out ICC stuff, pending correct code; ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 08-Sep-2000, JF: add missing logic for icc colors, update ser#=7 . -->
+<!-- 14-Dec-2000, JF: added explicit gradientUnits='userSpaceOnUse' -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.4 $" testname="painting-fill-01-t-a.svg">
+ <Paragraph>
+ Verify the basic capability to handle the fill properties fill:none,
+ and fill with a color (fill:red)
+ </Paragraph>
+ <Paragraph>
+ There should be two rectangles, the rectangle on the left hollow (fill:none) and the rectangle on the right filled with red.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-fill-01-t.svg</title>
+ <desc id="test-desc">
+ Test that viewer has the basic capability to handle the &lt;fill,fill-rule,fill-opacity properites&gt;
+ </desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+
+ <text font-family="Arial" font-size="36" x="40" y="42">Basic paint: fill properties.</text>
+
+<!-- ============================================================================= -->
+<!-- Draw two simple rectangles. One without fill other with fill:red -->
+<!-- ============================================================================= -->
+
+ <rect id="fill-01" fill="none" stroke="#000000" x="75" y="70" width="100" height="160"/>
+
+ <rect id="fill-02" fill="red" stroke="#000000" x="275" y="70" width="100" height="160"/>
+
+ <text font-family="Arial" font-size="36" x="75" y="280">fill:none</text>
+ <text font-family="Arial" font-size="36" x="275" y="280">fill:red</text>
+
+ </g>
+
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.4 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-fill-02-t.svg b/tests/arthur/data/1.1/painting-fill-02-t.svg
new file mode 100644
index 0000000000..2ecb8822ab
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-fill-02-t.svg
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paint-fill-BE-01.svg -->
+<!-- renamed for 1.1 suite to painting-fill-01-f.svg -->
+<!-- renamed for SVGT/B to painting-fill-02-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the fill -->
+<!-- properties within 'style' attributes. -->
+<!-- -->
+<!-- -->
+<!-- Author : Kevin McCluskey, 9-Feb-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!-- Revised for SVGT/B: Benoit Bezaire Jul/02/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 9-Feb-2000, KM, Serial#2 created. Matches 20000202 SVG spec. -->
+<!-- 27-feb-2000, LH, Ser#3, remove extra </g>, fixed name ("paint-"). -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#4 -->
+<!-- 28-Mar-2000, LH, fix gradient test; ser#5 -->
+<!-- 19-May-2000, LH, comment out ICC stuff, pending correct code; ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 08-Sep-2000, JF: add missing logic for icc colors, update ser#=7 . -->
+<!-- 14-Dec-2000, JF: added explicit gradientUnits='userSpaceOnUse' -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="painting-fill-01-t-b.svg">
+ <Paragraph>
+ The test uses the fill:currentColor property.
+ </Paragraph>
+ <Paragraph>
+ The rectangle on the left should be green filled, the rectangle on the right should be blue.
+ The text above the rectangles should be black.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-fill-02-t.svg</title>
+ <desc id="test-desc">
+ Test that viewer has the basic capability to handle the &lt;fill,fill-rule,fill-opacity properites&gt;
+ </desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" color="green">
+
+ <text font-family="Arial" font-size="36" x="30" y="42">Basic paint: fill properties.</text>
+ <text font-family="Arial" font-size="36" x="100" y="80">fill="currentColor"</text>
+
+<!-- ====================================================================== -->
+<!-- Second set of rectangles with fill:currentColor -->
+<!-- ====================================================================== -->
+
+ <rect id="fill-03" fill="currentColor" stroke="#000000" x="75" y="110" width="100" height="140"/>
+ <rect id="fill-04" color="blue" fill="currentColor" stroke="#000000" x="275" y="110" width="100" height="140"/>
+
+ <text font-family="Arial" font-size="36" x="80" y="280">green</text>
+ <text font-family="Arial" font-size="36" x="290" y="280">blue</text>
+
+ </g>
+
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-fill-03-t.svg b/tests/arthur/data/1.1/painting-fill-03-t.svg
new file mode 100644
index 0000000000..837207b7dd
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-fill-03-t.svg
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paint-fill-BE-01.svg -->
+<!-- renamed for 1.1 suite to painting-fill-01-f.svg -->
+<!-- renamed for SVGT/B to painting-fill-03-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the fill -->
+<!-- properties within 'style' attributes. -->
+<!-- -->
+<!-- -->
+<!-- Author : Kevin McCluskey, 9-Feb-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!-- Revised for SVGT/B: Benoit Bezaire Jul/02/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 9-Feb-2000, KM, Serial#2 created. Matches 20000202 SVG spec. -->
+<!-- 27-feb-2000, LH, Ser#3, remove extra </g>, fixed name ("paint-"). -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#4 -->
+<!-- 28-Mar-2000, LH, fix gradient test; ser#5 -->
+<!-- 19-May-2000, LH, comment out ICC stuff, pending correct code; ser#6. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 08-Sep-2000, JF: add missing logic for icc colors, update ser#=7 . -->
+<!-- 14-Dec-2000, JF: added explicit gradientUnits='userSpaceOnUse' -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.4 $" testname="painting-fill-01-t-c.svg">
+ <Paragraph>
+ Verify the basic capability to handle the fill rule properties evenodd and nonzero
+ </Paragraph>
+ <Paragraph>
+ there should be two red filled stars, the leftmost star should be unfilled in the very center.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-fill-03-t.svg</title>
+ <desc id="test-desc">
+ Test that viewer has the basic capability to handle the &lt;fill,fill-rule,fill-opacity properites&gt;
+ </desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+
+ <text font-family="Arial" font-size="36" x="30" y="42">Basic paint: fill properties.</text>
+
+<!-- ====================================================================== -->
+<!-- Third test fill-rule:evenodd and fill-rule:nonzero -->
+<!-- ====================================================================== -->
+
+ <path fill="red" fill-rule="evenodd" d="M 110 75 l 50 160 l -130 -100 l 160 0 l -130 100 z"/>
+ <path fill="red" fill-rule="nonzero" d="M 365 75 l 50 160 l -130 -100 l 160 0 l -130 100 z"/>
+ <text font-family="Arial" font-size="30" x="10" y="282">fill-rule:evenodd</text>
+ <text font-family="Arial" font-size="30" x="260" y="282">fill-rule:nonzero</text>
+
+ </g>
+
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.4 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-fill-04-t.svg b/tests/arthur/data/1.1/painting-fill-04-t.svg
new file mode 100644
index 0000000000..49a4f7aa08
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-fill-04-t.svg
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- paint-inherit-BE-06.svg -->
+<!-- renamed for 1.1 suite to painting-fill-04-t.svg -->
+<!-- Author : Tim Thompson 8/04/00 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" baseProfile="tiny" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.7 $" testname="painting-fill-04-t.svg">
+ <Paragraph>
+ This tests inheritance of 3 properties. Fill, stroke and stroke-width. There is a g element (id=G1) which
+ sets fill=blue, stroke=red, and stroke-width=5. The first two rectangles on top should inherit all those
+ properties. The middle left rectangle has fill=yellow and stroke-width=2, it should inherit the stroke=red
+ from the parent container. The middle rectangle on the right has stroke=yellow, it should inherit fill and
+ stroke-width from the parent g. The bottom 2 rectangles are in another g element (id=G2) which is a child
+ of G1. G2 sets fill=yellow. It should inherit the stroke and stroke width from the parent G1. The two
+ bottom rectangles set no fill or stroke properties, they should inherit through the parents, stroke=red
+ and stroke-width=5.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-fill-04-t.svg</title>
+ <desc id="test-desc">Test inheritance of painting properties.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <g id="G1" fill="blue" stroke="red" stroke-width="5" transform="translate(120,30)">
+ <rect x="0" y="0" width="90" height="70"/>
+ <rect x="100" y="0" width="90" height="70"/>
+ <rect x="0" y="80" width="90" height="70" fill="yellow" stroke-width="2"/>
+ <rect x="100" y="80" width="90" height="70" stroke="yellow"/>
+ <g id="G2" fill="yellow">
+ <rect x="0" y="160" width="90" height="70"/>
+ <rect x="100" y="160" width="90" height="70"/>
+ </g>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/painting-stroke-01-t.svg b/tests/arthur/data/1.1/painting-stroke-01-t.svg
new file mode 100644
index 0000000000..722112c5bd
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-stroke-01-t.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- paint-stroke-BE-02.svg -->
+<!-- renamed for 1.1 suite to "painting-stroke-01-t.svg -->
+<!-- -->
+<!-- Author : Kevin McCluskey, 23-Mar-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="painting-stroke-01-f.svg">
+ <Paragraph>
+ Verify the basic capability to handle the stroke properties (stroke)
+ in combination with the rect element .
+ The pair should be rendered as two blue rectangles,
+ the upper one without a stroke and the lower with a red stroke.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke, stroke:red font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-stroke-01-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;stroke properites&gt;</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ============================================================================= -->
+ <!-- Draw two simple rectangles. One without stroke other with stroke:red -->
+ <!-- ============================================================================= -->
+ <text font-family="Arial" font-size="36" x="10" y="40">Basic paint: stroke properties.</text>
+ <rect id="stroke-01" fill="blue" stroke="none" x="90" y="70" width="300" height="50"/>
+ <rect id="stroke-02" fill="blue" stroke-width="20" stroke="red" x="90" y="190" width="300" height="50"/>
+ <text font-family="Arial" font-size="40" x="140" y="150">stroke:none</text>
+ <text font-family="Arial" font-size="40" x="148" y="280">stroke:red</text>
+ </g>
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-stroke-02-t.svg b/tests/arthur/data/1.1/painting-stroke-02-t.svg
new file mode 100644
index 0000000000..ac02fd1261
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-stroke-02-t.svg
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- paint-stroke-BE-02.svg -->
+<!-- renamed for 1.1 suite to "painting-stroke-02-t.svg -->
+<!-- Author : Kevin McCluskey, 23-Mar-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="painting-stroke-01-t.svg">
+ <Paragraph>
+ Verify the basic capability to handle the stroke properties (stroke, stroke-width
+ stroke-linejoin)in combination with the rect element and straight-line path commands.
+ The pair should be rendered as two red rectangles without an interior fill.
+ The upper rectangle should have a stroke width of 5 with sharp corners.
+ The lower rectangle should have a stroke width of 5 with round corners.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke, stroke:red stroke-width:10 stroke-linejoin:round
+ font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-stroke-02-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;stroke properites&gt;</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Set of rectangles with stroke-width:10 and stroke-linejoin:round-->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="36" x="10" y="40">Basic paint: stroke properties.</text>
+ <rect id="stroke-01" fill="none" stroke="red" stroke-width="20" x="90" y="70" width="300" height="50"/>
+ <rect id="stroke-02" fill="none" stroke="red" stroke-width="20" stroke-linejoin="round" x="90" y="190" width="300" height="50"/>
+ <text font-family="Arial" font-size="40" x="120" y="160">stroke-width:20</text>
+ <text font-family="Arial" font-size="40" x="58" y="290">stroke-linejoin:round</text>
+ </g>
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-stroke-03-t.svg b/tests/arthur/data/1.1/painting-stroke-03-t.svg
new file mode 100644
index 0000000000..397a1a8d70
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-stroke-03-t.svg
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- paint-stroke-BE-02.svg -->
+<!-- renamed for 1.1 suite to "painting-stroke-03-t.svg -->
+<!-- Author : Kevin McCluskey, 23-Mar-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="painting-stroke-01-f.svg">
+ <Paragraph>
+ Verify the basic capability to handle the stroke properties (stroke, stroke-width
+ stroke-linejoin, stroke-linecap, stroke-miter)
+ in combination with the rect element and straight-line path commands.
+ The pair should be rendered as as two red line segments.
+ The upper segment should have round end caps. The lower segment
+ should be chopped off where the two line segments meet.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'path' element, as well as basic fill (solid primary colors),
+ stroke, stroke-width, stroke-linejoin, stroke-linecap, stroke-miter,
+ font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-stroke-03-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;stroke properties&gt;</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Test stroke-linecap:round and stroke-miterlimit:1 -->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="36" x="10" y="40">Basic paint: stroke properties.</text>
+ <path fill="none" stroke="red" stroke-width="30" stroke-linecap="round" d="M 160 70 l 200 20 l -200 20 "/>
+ <path fill="none" stroke="red" stroke-width="30" stroke-linejoin="miter" stroke-miterlimit="1" d="M 160 190 l 200 20 l -200 20"/>
+ <text font-family="Arial" font-size="40" x="60" y="160">stroke-linecap:round</text>
+ <text font-family="Arial" font-size="40" x="130" y="280">stroke-miter:1</text>
+ </g>
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/painting-stroke-04-t.svg b/tests/arthur/data/1.1/painting-stroke-04-t.svg
new file mode 100644
index 0000000000..629026baec
--- /dev/null
+++ b/tests/arthur/data/1.1/painting-stroke-04-t.svg
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paint-stroke-BE-02.svg -->
+<!-- renamed for 1.1 suite to "painting-stroke-04-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the stroke -->
+<!-- properties. -->
+<!-- -->
+<!-- -->
+<!-- Author : Kevin McCluskey, 23-Mar-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!-- -->
+<!-- History: -->
+<!-- 23-Mar-2000, KMM, Serial#3 created. Matches 20000202 SVG spec. -->
+<!-- 28-Mar-2000, LH=" fix names" reposition/rescale; ser#4. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="painting-stroke-01-f.svg">
+ <Paragraph>
+ Verify the dasharray and dashoffset properties. Two lines are drawn, one red
+ and one black. Both have a dasharray of 10,10 giving a dashed appearance
+ where the size of the gaps and the size of the dash is equal. The help show this,
+ the black line has a stroke-dashoffset so that the dashes in the black line match
+ up with the gaps in the red line.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'path' element, stroke, stroke-width, stroke-dasharray and stroke-dashoffset,
+ font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">painting-stroke-04-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;stroke,stroke-opacity properites&gt;</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Test stroke:dasharray:10, 5 and stroke-opacity -->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="36" x="10" y="60">Basic paint: stroke properties.</text>
+ <path id="stroke-7b" fill="none" stroke="red" stroke-width="25" stroke-dashoffset="0" stroke-dasharray="10,10" d="M 50 120 L 430 120"/>
+ <path id="stroke-7c" fill="none" stroke="black" stroke-width="25" stroke-dashoffset="10" stroke-dasharray="10,10" d="M 50 140 L 430 140"/>
+ <text font-family="Arial" font-size="30" x="65" y="210">stroke:dasharray:10, 10</text>
+ <text font-family="Arial" font-size="30" x="75" y="260">stroke:dashoffset:10</text>
+ </g>
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.8 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-01-t.svg b/tests/arthur/data/1.1/paths-data-01-t.svg
new file mode 100644
index 0000000000..da8d7d023c
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-01-t.svg
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2002 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paths-data-01-t.svg -->
+<!-- 1.1 revision by Christophe Jolif -->
+<!-- -->
+<!-- Test that the viewer has the basic capability to handle the 'path' -->
+<!-- element and its data (d) attribute in combination with the cubic -->
+<!-- Bezier curveto commands, C, c, S, s (plus Mm and Zz). -->
+<!-- -->
+<!-- Author : Lofton Henderson, 29-Feb-2000 (based on work -->
+<!-- of Mark Sgarlato, Adobe). -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, LRH, Ser#1 created. -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#2 -->
+<!-- 03-Aug-2000, LH: update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 15-Nov-2000, LH: add missing test-body-content group. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.6 $" testname="paths-data-01-t.svg">
+ <Paragraph>
+Test that the viewer has the basic capability to handle the 'path'
+element and its data (d) attribute in combination with the cubic
+Bezier curveto commands, C, c, S, s (plus Mm and Zz).
+ </Paragraph>
+ <Paragraph>
+There are 8 subtests, each composed from the cubic Bezier path commands per
+the label by the subtest. On-curve control points (i.e., the curve position)
+are marked by small blue squares. Subtests are filled, or stroked, or
+both, using simple style properties and colors.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'rect' element, as well as basic fill (solid primary colors),
+stroke (primary color 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">paths-data-01-t</title>
+ <desc id="test-desc">Test that the viewer has the basic capability to handle the 'path' element and data (d) attribute in combination with the cubic Bezier curveto, both regular and shorthand/smooth forms - C, c, S, s (along with Mm and Zz).</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- First Curve "X" that has subpath utilizing M, C, S, m, c, & s ======== -->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="12" x="100" y="14">Cubic bezier curves drawn with commands:</text>
+ <path id="X_curve_MCSmcs" fill="#FF0000" stroke="#00C000" d=" M 210 130 C 145 130 110 80 110 80 S 75 25 10 25 m 0 105 c 65 0 100 -50 100 -50 s 35 -55 100 -55 "/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ===================================== -->
+ <!-- ====================================================================== -->
+ <rect x="208" y="128" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="108" y="78" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="8" y="23" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="8" y="128" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="108" y="78" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="208" y="23" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="5" y="82">M, C, S, m, c, s</text>
+ <!-- ====================================================================== -->
+ <!-- Infinity using M, c, c, c, C & z ===================================== -->
+ <!-- ====================================================================== -->
+ <path id="Infinity_McccCz" fill="none" stroke="#000000" d=" M 240 90 c 0 30 7 50 50 0 c 43 -50 50 -30 50 0 c 0 83 -68 -34 -90 -30 C 240 60 240 90 240 90 z "/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="238" y="88" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="288" y="88" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="338" y="88" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="248" y="58" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="253" y="50">M, c, c, c, C, z</text>
+ <!-- ====================================================================== -->
+ <!-- Horizontal line utilizing M, C & Z =================================== -->
+ <!-- ====================================================================== -->
+ <path id="Line_MCZ" fill="none" stroke="#000000" d="M80 170 C100 170 160 170 180 170Z"/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="78" y="168" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="178" y="168" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="110" y="190">M, C, Z</text>
+ <!-- ====================================================================== -->
+ <!-- Inverted V using M, C, c & Z ========================================= -->
+ <!-- ====================================================================== -->
+ <path id="Inv_V_MCcZ" fill="#00C000" stroke="none" d="M5 260 C40 260 60 175 55 160 c -5 15 15 100 50 100Z"/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="3" y="258" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="53" y="158" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="103" y="258" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="85" y="220">M, C, c, Z</text>
+ <!-- ====================================================================== -->
+ <!-- Remembrance Ribbon using m, c & s ==================================== -->
+ <!-- ====================================================================== -->
+ <path id="Rem_Rib_mcs" fill="none" stroke="#000000" d="m 200 260 c 50 -40 50 -100 25 -100 s -25 60 25 100 "/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="198" y="258" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="223" y="158" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="248" y="258" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="165" y="210">m, c, s</text>
+ <!-- ====================================================================== -->
+ <!-- 90 degree arc using M & C ============================================ -->
+ <!-- ====================================================================== -->
+ <path id="Arc_MC" fill="#0000FF" stroke="#000000" d=" M 360 100 C 420 90 460 140 450 190"/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="358" y="98" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="448" y="188" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="360" y="150">M, C</text>
+ <!-- ====================================================================== -->
+ <!-- Circle using M, c, s, s, s & z ======================================= -->
+ <!-- ====================================================================== -->
+ <path id="Circle_Mcssz" fill="#FFFF00" stroke="#000000" d="M360 210 c 0 20 -16 36 -36 36 s -36 -16 -36 -36 s 16 -36 36 -36 s 36 16 36 36 z "/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="358" y="208" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="322" y="244" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="286" y="208" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="322" y="172" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="290" y="265">M, c, s, s, s, z</text>
+ <!-- ====================================================================== -->
+ <!-- Inverted horseshoe using m, c & z ==================================== -->
+ <!-- ====================================================================== -->
+ <path id="Horseshoe_Mcs" fill="#F0F0F0" stroke="#FF0000" d="m 360 325 c -40 -60 95 -100 80 0 z "/>
+ <!-- ====================================================================== -->
+ <!-- Markers for path control points ====================================== -->
+ <!-- ====================================================================== -->
+ <rect x="358" y="323" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <rect x="438" y="323" width="4" height="4" fill="#4A83FF" stroke="none"/>
+ <text font-family="Arial" font-size="12" x="380" y="340">m, c, z</text>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-02-t.svg b/tests/arthur/data/1.1/paths-data-02-t.svg
new file mode 100644
index 0000000000..35054c13cd
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-02-t.svg
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2002 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- paths-data-02-t.svg -->
+<!-- 1.1 revision by Christophe Jolif -->
+<!-- -->
+<!-- Test that the viewer has the basic capability to handle the 'path' -->
+<!-- element and its data (d) attribute in combination with the quadratic -->
+<!-- Bezier curveto commands, Q, q, T, t (plus Mm and Zz). -->
+<!-- -->
+<!-- Author : Lofton Henderson, 29-Feb-2000 (based on work -->
+<!-- of Mark Sgarlato, Adobe). -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, LRH, Ser#1 created. -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#2 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 17-Aug-2000, JF=" fix duplicate ID bug" ser#3. -->
+<!-- 15-Nov-2000, LH: add missing test-body-content group. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.6 $" testname="paths-data-02-t.svg">
+ <Paragraph>
+Test that the viewer has the basic capability to handle the 'path'
+element and its data (d) attribute in combination with the quadratic
+Bezier curveto commands, Q, q, T, t (plus Mm and Zz).
+ </Paragraph>
+ <Paragraph>
+There are 7 subtests, each composed from the quadric Bezier path commands per
+the label by the subtest. On-curve control points (i.e., the curve position)
+are marked by small colored squares. Subtests are filled, or stroked, or
+both, using simple style properties and colors.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'rect' element, as well as basic fill (solid primary colors),
+stroke (primary color wide and 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">paths-data-02-t</title>
+ <desc id="test-desc">Test that the viewer has the basic capability to handle the 'path' element and data (d) attribute in combination with the quadratic Bezier curveto commands, both regular and shorthand/smooth forms - Q, q, T, t (along with Mm and Zz).</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <text font-family="Arial" font-size="12" x="120" y="14">Quadric bezier curves drawn with commands:</text>
+ <!-- ====================================================================== -->
+ <!-- Quad Bezier with sub-path using M, Q, M, q, & z ====================== -->
+ <!-- ====================================================================== -->
+ <path id="Bez_MQMqz" fill="none" stroke="#0000FF" stroke-width="3" d="M 15 20 Q 30 120 130 30 M 180 80 q -75 -100 -163 -60z"/>
+ <text font-family="Arial" font-size="12" x="80" y="86">M, Q, M, q, z</text>
+ <rect x="13" y="18" width="4" height="4" fill="#00C000" stroke="none"/>
+ <rect x="128" y="28" width="4" height="4" fill="#00C000" stroke="none"/>
+ <rect x="178" y="78" width="4" height="4" fill="#00C000" stroke="none"/>
+ <rect x="15" y="18" width="4" height="4" fill="#00C000" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Quad Bezier with sub-path using m, q, z, m, q, & z =================== -->
+ <!-- ====================================================================== -->
+ <path id="Bez_fill_MQzmqz" fill="#FFFF00" stroke="#CF0000" d="M372 130Q272 50 422 10zm70 0q50-150-80-90z"/>
+ <text font-family="Arial" font-size="12" x="352" y="150">m, q, z, m, q, z</text>
+ <rect x="370" y="128" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="420" y="8" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="440" y="128" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="360" y="38" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Simple Bezier using M, Q, & Z ======================================== -->
+ <!-- ====================================================================== -->
+ <path id="Bez_stroke_MQz" fill="none" stroke="#00FFFF" d="M224 103Q234 -12 304 33Z"/>
+ <text font-family="Arial" font-size="12" x="192" y="36">M, Q, Z</text>
+ <rect x="222" y="101" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="302" y="31" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Tri Bezier using M, Q, T, Q, & z ===================================== -->
+ <!-- ====================================================================== -->
+ <path id="Tri_MQTQz" fill="#00C000" stroke="#000000" d="M208 168Q258 268 308 168T258 118Q128 88 208 168z"/>
+ <text font-family="Arial" font-size="12" x="308" y="188">M, Q, T, Q, z</text>
+ <rect x="206" y="166" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="306" y="166" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="256" y="116" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="206" y="206" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Double Bezier using M, Q, Q, & z ===================================== -->
+ <!-- ====================================================================== -->
+ <path id="Inv_V_MCcZ" fill="#CF0000" stroke="none" d=" M 60 100 Q -40 150 60 200 Q 160 150 60 100 z "/>
+ <text font-family="Arial" font-size="12" x="80" y="200">M, Q, Q, z</text>
+ <rect x="58" y="98" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="58" y="198" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="58" y="98" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Sin Wave using M, q, t, t, t, t, & z ================================ -->
+ <!-- ====================================================================== -->
+ <path id="Sin_Mqttttz" fill="none" stroke="#FF0000" d="M240 296q25-100 47 0t47 0t47 0t47 0t47 0z"/>
+ <text font-family="Arial" font-size="12" x="380" y="236">M, q, t, t, t, t, z</text>
+ <rect x="238" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="285" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="332" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="379" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="426" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <rect x="473" y="294" width="4" height="4" fill="#0000FF" stroke="none"/>
+ <!-- ====================================================================== -->
+ <!-- Double Spade using M, q, Q, q, Q, & z ================================ -->
+ <!-- ====================================================================== -->
+ <path id="Dbl_spd_MCcZ" fill="#0000C0" stroke="#00CF00" stroke-width="2" d="M172 193q-100 50 0 50Q72 243 172 293q100 -50 0 -50Q272 243 172 193z"/>
+ <text font-family="Arial" font-size="12" x="48" y="280">M, q, Q, q, Q, z</text>
+ <rect x="170" y="191" width="4" height="4" fill="#FF0000" stroke="none"/>
+ <rect x="170" y="241" width="4" height="4" fill="#FF0000" stroke="none"/>
+ <rect x="170" y="291" width="4" height="4" fill="#FF0000" stroke="none"/>
+ <rect x="170" y="241" width="4" height="4" fill="#FF0000" stroke="none"/>
+ <rect x="170" y="191" width="4" height="4" fill="#FF0000" stroke="none"/>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-04-t.svg b/tests/arthur/data/1.1/paths-data-04-t.svg
new file mode 100644
index 0000000000..0371945033
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-04-t.svg
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- path-lines-BE-01.svg -->
+<!-- renamed for 1.1 suite to paths-data-04-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the <path> -->
+<!-- element and data (d) attribute in combination with the moveto, -->
+<!-- lineto, and closepath commands - M, L, Z, m, l, and z. -->
+<!-- -->
+<!-- Author : Lofton Henderson, 20-Jan-2000 (from Mark Sgarlato, Adobe). -->
+<!-- -->
+<!-- History: -->
+<!-- 20-Jan-2000, LH, Serial#1 created. Matches 20000110 SVG spec. -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#2 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 29-Oct-2000, JF: add fill-rule:evenodd to two paths to get same -->
+<!-- visual result as before. Necessary because default -->
+<!-- fill-rule is now nonzero. Update to ser#3. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.7 $" testname="paths-data-04-t.svg">
+ <Paragraph>
+Verify the basic capability to handle the 'path' element, and its data attribute (d)
+in combination with the straight-line path commands.
+Two pairs of concentric equilateral triangles are drawn using respectively
+M,L,Z and m,l,z. The shapes are identical, with one stroked and
+one filled. The fill-mode default of "even-odd" means that
+the inner triangle is hollow.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'path' element, as well as basic fill (solid primary colors),
+stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">paths-data-04-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;path&gt; element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- First Group of Triangles using M, L & Z commands ===================== -->
+ <!-- ====================================================================== -->
+ <g transform="scale(1.8)">
+<!-- <text font-family="Arial" font-size="12" x="160" y="14">Lines drawn with commands:</text> -->
+ <text font-family="Arial" font-size="12" x="88" y="30">M, L, L, L, Z,</text>
+ <text font-family="Arial" font-size="12" x="98" y="46">subpath</text>
+ <text font-family="Arial" font-size="12" x="88" y="61">M, L, L, L, Z</text>
+ <path id="Triangle_stroke_MLZ" fill="none" stroke="#000000" d=" M 62.00000 56.00000 L 113.96152 146.00000 L 10.03848 146.00000 L 62.00000 56.00000 Z M 62.00000 71.00000 L 100.97114 138.50000 L 23.02886 138.50000 L 62.00000 71.00000 Z "/>
+ <rect x="60.00000" y="54.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="111.96152" y="144.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="8.03848" y="144.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="60.00000" y="69.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="98.97114" y="136.50000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="21.02886" y="136.50000" width="4" height="4" fill="#00C000" stroke="none" />
+ <text font-family="Arial" font-size="12" x="42" y="162">stroked</text>
+ <path id="Triangle_fill_MLZ" fill="#FF0000" stroke="none" fill-rule="evenodd" d=" M 177.00000 56.00000 L 228.96152 146.00000 L 125.03848 146.00000 L 177.00000 56.00000 Z M 177.00000 71.00000 L 215.97114 138.50000 L 138.02886 138.50000 L 177.00000 71.00000 Z "/>
+ <rect x="175.00000" y="54.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="226.96152" y="144.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="123.03848" y="144.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="175.00000" y="69.00000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="213.97114" y="136.50000" width="4" height="4" fill="#00C000" stroke="none" />
+ <rect x="136.02886" y="136.50000" width="4" height="4" fill="#00C000" stroke="none" />
+ <text font-family="Arial" font-size="12" x="162" y="162">filled</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-05-t.svg b/tests/arthur/data/1.1/paths-data-05-t.svg
new file mode 100644
index 0000000000..2227d9949a
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-05-t.svg
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- path-lines-BE-01.svg -->
+<!-- renamed for 1.1 suite to paths-data-05-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the <path> -->
+<!-- element and data (d) attribute in combination with the moveto, -->
+<!-- lineto, and closepath commands - M, L, Z, m, l, and z. -->
+<!-- -->
+<!-- Author : Lofton Henderson, 20-Jan-2000 (from Mark Sgarlato, Adobe). -->
+<!-- -->
+<!-- History: -->
+<!-- 20-Jan-2000, LH, Serial#1 created. Matches 20000110 SVG spec. -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#2 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 29-Oct-2000, JF: add fill-rule:evenodd to two paths to get same -->
+<!-- visual result as before. Necessary because default -->
+<!-- fill-rule is now nonzero. Update to ser#3. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.7 $" testname="paths-data-04-t-b.svg">
+ <Paragraph>
+Verify the basic capability to handle the 'path' element, and its data attribute (d)
+in combination with the straight-line path commands.
+Two pairs of concentric equilateral triangles are drawn using respectively
+M,L,Z and m,l,z. The shapes in each pair are identical, with one stroked and
+one filled. The fill-mode default of "even-odd" means that
+the inner triangle is hollow.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'path' element, as well as basic fill (solid primary colors),
+stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">paths-data-05-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;path&gt; element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Second Group of Triangles using m, l & z commands===================== -->
+ <!-- ====================================================================== -->
+ <g transform="scale(1.8) translate(0, -150)">
+ <text font-family="Arial" font-size="12" x="96" y="180">m, l, l, l, z,</text>
+ <text font-family="Arial" font-size="12" x="100" y="194">subpath</text>
+ <text font-family="Arial" font-size="12" x="97" y="208">m, l, l, l, z</text>
+ <path id="Triangle_stroke_mlz" fill="none" stroke="#000000" d=" m 62.00000 190.00000 l 51.96152 90.00000 l -103.92304 0.00000 l 51.96152 -90.00000 z m 0.00000 15.00000 l 38.97114 67.50000 l -77.91228 0.00000 l 38.97114 -67.50000 z "/>
+ <rect x="60.00000" y="188.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="111.96152" y="278.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="8.03848" y="278.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="60.00000" y="203.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="98.97114" y="270.50000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="21.02886" y="270.50000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <path id="Triangle_fill_mlz" fill="#00C000" stroke="none" fill-rule="evenodd" d=" m 177.00000 190.00000 l 51.96152 90.00000 l -103.92304 0.00000 l 51.96152 -90.00000 z m 0.00000 15.00000 l 38.97114 67.50000 l -77.91228 0.00000 l 38.97114 -67.50000 z "/>
+ <rect x="175.00000" y="188.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="226.96152" y="278.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="123.03848" y="278.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="175.00000" y="203.00000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="213.97114" y="270.50000" width="4" height="4" fill="#FF0000" stroke="none" />
+ <rect x="136.02886" y="270.50000" width="4" height="4" fill="#FF0000" stroke="none" />
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-06-t.svg b/tests/arthur/data/1.1/paths-data-06-t.svg
new file mode 100644
index 0000000000..355ccbef1f
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-06-t.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- path-lines-BE-01.svg -->
+<!-- renamed for 1.1 suite to paths-data-06-t.svg -->
+<!-- Author : Lofton Henderson, 20-Jan-2000 (from Mark Sgarlato, Adobe). -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
+ <OperatorScript version="$Revision: 1.7 $" testname="paths-data-06-t.svg">
+ <Paragraph>
+Verify the basic capability to handle the 'path' element, and its data attribute (d)
+in combination with the straight-line path commands.
+Two pairs of staircase figures are drawn using
+respectively M,H,V,Z and m,h,v,z. The shapes in each pair are identical, with one stroked and
+one filled.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'path' element, as well as basic fill (solid primary colors),
+stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">paths-data-06-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;path&gt; element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <g transform="scale(1.8) translate(-200, 0)">
+ <!-- ====================================================================== -->
+ <!-- First Group of Stairs using M, H, V & Z commands====================== -->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="12" x="288" y="30">M, H, V, H,</text>
+ <text font-family="Arial" font-size="12" x="288" y="46">V. H, V, H,</text>
+ <text font-family="Arial" font-size="12" x="304" y="62">V, Z</text>
+ <path id="Stairs_stroke_MHVZ" fill="none" stroke="#000000" d=" M 240.00000 56.00000 H 270.00000 V 86.00000 H 300.00000 V 116.00000 H 330.00000 V 146.00000 H 240.00000 V 56.00000 Z "/>
+ <rect x="238.00000" y="54.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="268.00000" y="54.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="268.00000" y="84.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="298.00000" y="84.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="298.00000" y="114.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="328.00000" y="114.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="328.00000" y="144.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="238.00000" y="144.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <path id="Stairs_fill_MHVZ" fill="#0000FF" stroke="none" d=" M 350.00000 56.00000 H 380.00000 V 86.00000 H 410.00000 V 116.00000 H 440.00000 V 146.00000 H 350.00000 V 56.00000 Z "/>
+ <rect x="348.00000" y="54.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="378.00000" y="54.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="378.00000" y="84.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="408.00000" y="84.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="408.00000" y="114.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="438.00000" y="114.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="438.00000" y="144.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <rect x="348.00000" y="144.00000" width="4" height="4" fill="#FFFF00" stroke="none" />
+ <!-- ====================================================================== -->
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/paths-data-07-t.svg b/tests/arthur/data/1.1/paths-data-07-t.svg
new file mode 100644
index 0000000000..524d5fdb34
--- /dev/null
+++ b/tests/arthur/data/1.1/paths-data-07-t.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- path-lines-BE-01.svg -->
+<!-- renamed for 1.1 suite to paths-data-07-t.svg -->
+<!-- Author : Lofton Henderson, 20-Jan-2000 (from Mark Sgarlato, Adobe). -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
+ <OperatorScript version="$Revision: 1.7 $" testname="paths-data-04-t-d.svg">
+ <Paragraph>
+Verify the basic capability to handle the 'path' element, and its data attribute (d)
+in combination with the straight-line path commands.
+Two pairs of staircase figures are drawn using
+respectively M,H,V,Z and m,h,v,z. The shapes in each pair are identical, with one stroked and
+one filled.
+ </Paragraph>
+ <Paragraph>
+The rendered picture should match the reference image exactly, except for possible
+variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+The test uses the 'path' element, as well as basic fill (solid primary colors),
+stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">paths-data-07-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;path&gt; element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <g transform="scale(1.8) translate(-200, -150)">
+ <!-- ====================================================================== -->
+ <!-- Second Group of Stairs using m, h, v & z commands====================== -->
+ <!-- ====================================================================== -->
+ <text font-family="Arial" font-size="12" x="288" y="180">m, h, v, h</text>
+ <text font-family="Arial" font-size="12" x="288" y="194">v, h, v, h</text>
+ <text font-family="Arial" font-size="12" x="304" y="208">v, z</text>
+ <path id="Stairs_stroke_mhvz" fill="none" stroke="#000000" d=" m 240.00000 190.00000 h 30.00000 v 30.00000 h 30.00000 v 30.00000 h 30.00000 v 30.00000 h -90.00000 v -90.00000 z "/>
+ <rect x="238.00000" y="188.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="268.00000" y="188.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="268.00000" y="218.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="298.00000" y="218.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="298.00000" y="248.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="328.00000" y="248.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="328.00000" y="278.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="238.00000" y="278.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <path id="Stairs_fill_mhvz" fill="#FFFF00" stroke="none" d=" m 350.00000 190.00000 h 30.00000 v 30.00000 h 30.00000 v 30.00000 h 30.00000 v 30.00000 h -90.00000 v -90.00000 z "/>
+ <rect x="348.00000" y="188.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="378.00000" y="188.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="378.00000" y="218.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="408.00000" y="218.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="408.00000" y="248.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="438.00000" y="248.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="438.00000" y="278.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ <rect x="348.00000" y="278.00000" width="4" height="4" fill="#0000FF" stroke="none" />
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/pservers-grad-07-b.svg b/tests/arthur/data/1.1/pservers-grad-07-b.svg
new file mode 100644
index 0000000000..00f295779e
--- /dev/null
+++ b/tests/arthur/data/1.1/pservers-grad-07-b.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- gradPatt-linearGr-BE-01.svg -->
+<!-- renamed for 1.1 suite to pservers-grad-07-b.svg -->
+<!-- Author : Haroon Sheikh 09-Feb-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.7 $" testname="pservers-grad-05-b-a.svg">
+ <Paragraph>
+ Test that the viewer has basic capability to handle linear gradients
+ on fills and stroke of objects and text.
+ </Paragraph>
+ <Paragraph>
+ This test uses the following elements : &lt;linearGradient&gt;, &lt;stop&gt;
+ and the following properties : stop-color, fill:url(# ), stroke(url# )
+ </Paragraph>
+ <Paragraph>
+ Both elements in this test use the same simple gradient. It is a linear gradient from
+ blue (left) to red (right). From top-down the appearance of objects is as follows.
+ </Paragraph>
+ <Paragraph>
+ The top rectangle should be filled with the gradient.
+ </Paragraph>
+ <Paragraph>
+ The next rectangle has no fill, but has a thick stroke on which the gradient is
+ applied.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">pservers-grad-07-b.svg</title>
+ <desc id="test-desc">Test that the viewer has basic capability to handle linear gradients on fills and stroke of objects
+ . This means it needs to understand the following elements : &lt;linearGradient&gt;, &lt;stop&gt; and the following
+ properties : stop-color, fill:url(# ), stroke(url# )</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" transform="scale(1, 1.5)">
+ <!-- ====================================================================== -->
+ <!-- Very simple blue to red linear gradient from left to right ========== -->
+ <!-- ====================================================================== -->
+ <linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="10" y1="10" x2="440" y2="10">
+ <stop stop-color="blue" offset="0"/>
+ <stop stop-color="red" offset="1"/>
+ </linearGradient>
+ <!-- ====================================================================== -->
+ <!-- Linear gradient on the fill of a rectangle ======== -->
+ <!-- ====================================================================== -->
+ <rect x="10" y="10" width="430" height="60" fill="url(#Gradient)" />
+ <text font-family="Arial" font-size="24" x="10" y="90">Linear gradient filled rectangle</text>
+ <!-- ====================================================================== -->
+ <!-- Linear gradient on the stroke of a rectangle ======== -->
+ <!-- ====================================================================== -->
+ <rect x="25" y="110" width="400" height="30" fill="none" stroke="url(#Gradient)" stroke-width="20" />
+ <text font-family="Arial" font-size="24" x="10" y="170">Linear gradient on stroke of rectangle</text>
+ </g>
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/pservers-grad-11-b.svg b/tests/arthur/data/1.1/pservers-grad-11-b.svg
new file mode 100644
index 0000000000..4007757d85
--- /dev/null
+++ b/tests/arthur/data/1.1/pservers-grad-11-b.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- gradPatt-radialGr-BE-04.svg -->
+<!-- renamed for 1.1 suite to pservers-grad-11-b.svg -->
+<!-- Author : Haroon Sheikh 07-Mar-2000 -->
+<!-- 1.1 revision by Rick Graham -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.7 $" testname="pservers-grad-11-b.svg">
+ <Paragraph>
+ Test that the viewer has basic capability to handle radial gradients
+ on fills and stroke of objects and text.
+ </Paragraph>
+ <Paragraph>
+ This test uses the following elements : &lt;radialGradient&gt;, &lt;stop&gt;
+ and the following properties : stop-color, fill:url(# ), stroke(url# )
+ </Paragraph>
+ <Paragraph>
+ From top-down (left to right) the appearance of objects is as follows.
+ </Paragraph>
+ <Paragraph>
+ The top left rectangle should be a radial gradient from black(in) to red(outside).
+ The gradiant is applied to the fill of the rectangle.
+ </Paragraph>
+ <Paragraph>
+ The next rectangle has no fill, but has a thick stroke on which the gradient is
+ applied. The gradient goes from red(in) to yellow (out).
+ </Paragraph>
+ <Paragraph>
+ The next item is a text with a radial gradient on the fill. The gradient goes
+ from black (in) to yellow (out).
+ </Paragraph>
+ <Paragraph>
+ The last item is a text with a 2 user unit stroke on which a black (in) to red
+ (out) linear gradient is applied.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image exactly, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">pservers-grad-11-b.svg</title>
+ <desc id="test-desc">Test that the viewer has basic capability to handle radial gradients on fills and stroke of objects and text. This means it needs to understand the following elements : &lt;radialGradient&gt;, &lt;stop&gt; and the following properties : stop-color, fill:url(# ), stroke(url# )</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Very simple black to red radial gradient ======== -->
+ <!-- ====================================================================== -->
+ <radialGradient gradientUnits="userSpaceOnUse" id="Grad1" cx="75" cy="100" r="130" fx="75" fy="100">
+ <stop stop-color="black" offset="0"/>
+ <stop stop-color="red" offset="1"/>
+ </radialGradient>
+ <rect x="10" y="10" width="210" height="140" fill="url(#Grad1)" />
+ <text font-family="Arial" font-size="12" x="10" y="165">Radial gradient on fill of rectangle</text>
+ <!-- ====================================================================== -->
+ <!-- Radial gradient on the stroke of a rectangle ======== -->
+ <!-- ====================================================================== -->
+ <radialGradient id="Grad2" gradientUnits="userSpaceOnUse" cx="295" cy="100" r="150" fx="295" fy="100">
+ <stop stop-color="red" offset="0"/>
+ <stop stop-color="yellow" offset="1"/>
+ </radialGradient>
+ <rect x="250" y="30" width="170" height="100" fill="none" stroke="url(#Grad2)" stroke-width="40" />
+ <text font-family="Arial" font-size="12" x="230" y="165">Radial gradient on stroke of rectangle</text>
+ <!-- ====================================================================== -->
+ <!-- Gradient on fill of text ======== -->
+ <!-- ====================================================================== -->
+ <radialGradient id="Grad3" gradientUnits="userSpaceOnUse" cx="225" cy="180" r="90" fx="225" fy="180">
+ <stop stop-color="black" offset="0"/>
+ <stop stop-color="yellow" offset="1"/>
+ </radialGradient>
+ <text font-family="Arial" font-size="50" fill="url(#Grad3)" x="10" y="210">Gradient on text fill</text>
+ <text font-family="Arial" font-size="12" x="10" y="225">Radial gradient on text, black to yellow</text>
+ <!-- ====================================================================== -->
+ <!-- Gradient on stroke of text ======== -->
+ <!-- ====================================================================== -->
+ <radialGradient id="Grad4" gradientUnits="userSpaceOnUse" cx="225" cy="245" r="90" fx="225" fy="245">
+ <stop stop-color="black" offset="0"/>
+ <stop stop-color="red" offset="1"/>
+ </radialGradient>
+ <text font-family="Arial" font-size="45" fill="none" stroke="url(#Grad4)" stroke-width="2" x="10" y="270">Gradient on text stroke</text>
+ <text font-family="Arial" font-size="12" x="10" y="285">Radial gradient on stroke of text, black to red</text>
+ </g>
+
+
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-elems-01-t.svg b/tests/arthur/data/1.1/render-elems-01-t.svg
new file mode 100644
index 0000000000..245789b3c2
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-01-t.svg
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- rendering-shape-BE-03.svg -->
+<!-- renamed for 1.1 suite to render-elems-01-t.svg -->
+<!-- Author : Vincent Hardy, 02-Mar-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" viewBox="0 0 480 360" width="100%" height="100%" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="render-elems-01-t-a.svg">
+ <Paragraph>
+ Verifies that shapes can be filled.
+ </Paragraph>
+ <Paragraph>
+ There is one pair of octagons. These are filled.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'path' element, as well as basic fill (solid primary colors),
+ stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties -
+ the common prerequisites.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-01-t</title>
+ <desc id="test-desc">This test validates that shapes can be both filled.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" >
+ <!-- ====================================================================== -->
+ <!-- First, fill shape with two different colors -->
+ <!-- ====================================================================== -->
+ <g transform="translate(30, 80)">
+ <g fill="red" ><path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/></g>
+ <g fill="black" transform="translate(200, 0)"><path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/></g>
+ <text x="130" y="-30" font-size="28">Shape fill</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-elems-02-t.svg b/tests/arthur/data/1.1/render-elems-02-t.svg
new file mode 100644
index 0000000000..c42423c66c
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-02-t.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
+[
+<!ENTITY shape " <path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/>">
+]>
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- rendering-shape-BE-03.svg -->
+<!-- renamed for 1.1 suite to render-elems-02-t.svg -->
+<!-- -->
+<!-- This test validates that shapes can be both filled and stroked. -->
+<!-- -->
+<!-- Author : Vincent Hardy, 02-Mar-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 02-Mar-2000, VH: Created. Matches 20000302 SVG spec. -->
+<!-- 11-Mar-2000, LH=" fixed names, focus, ids, framing rect" removed -->
+<!-- ineffective "text-anchor="middle"" ser#3 -->
+<!-- 10-Apr-2000, LH: fix framing rect (449->448); ser#4. -->
+<!-- 02-Jun-2000, LH=" rmv extraneous closing lineto frm "shape"" ser#5. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH: renaming, ser#6. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" viewBox="0 0 480 360" width="100%" height="100%" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="render-elems-01-t-b.svg">
+ <Paragraph>
+ Verifies that shapes can be stroked.
+ </Paragraph>
+ <Paragraph>
+ There is one pair of octagons. These are stroked.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties -
+ the common prerequisites.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-02-t</title>
+ <desc id="test-desc">This test validates that shapes can be both stroked.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" >
+ <!-- ====================================================================== -->
+ <!-- Now, stroke shape with two different stroke width and color -->
+ <!-- ====================================================================== -->
+ <g transform="translate(30, 80)">
+ <g fill="none" stroke="red" stroke-width="3" ><path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/></g>
+ <g fill="none" stroke="black" stroke-width="9" transform="translate(200, 0)"><path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/></g>
+ <text x="110" y="-30" font-size="28">Shape stroke</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-elems-03-t.svg b/tests/arthur/data/1.1/render-elems-03-t.svg
new file mode 100644
index 0000000000..5bfa4b49ec
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-03-t.svg
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
+[
+<!ENTITY shape " <path d='M60,0 l60,0 l60,60 l0,60 l-60,60 l-60,0 l-60,-60 l0,-60 z'/>">
+]>
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- rendering-shape-BE-03.svg -->
+<!-- renamed for 1.1 suite to render-elems-03-t.svg -->
+<!-- Author : Vincent Hardy, 02-Mar-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" viewBox="0 0 480 360" width="100%" height="100%">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.7 $" testname="render-elems-03-t.svg">
+ <Paragraph>
+ Verifies that shapes can be filled, stroked and the order of filling and stroking.
+ </Paragraph>
+ <Paragraph>
+ There is one pair of octagons. These are filled plus stroked.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties -
+ the common prerequisites.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-03-t</title>
+ <desc id="test-desc">This test validates that shapes can be both filled and stroked.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" >
+ <!-- ====================================================================== -->
+ <!-- Now, fill and stroke. The fill should happen first -->
+ <!-- ====================================================================== -->
+ <g transform="translate(30, 80)">
+ <g fill="yellow" stroke="red" stroke-width="8" >&shape;</g>
+ <g stroke="black" fill="blue" stroke-width="8" transform="translate(200, 0)">&shape;</g>
+ <text x="70" y="-30" font-size="28">Shape fill and stroke</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-elems-06-t.svg b/tests/arthur/data/1.1/render-elems-06-t.svg
new file mode 100644
index 0000000000..85d983401e
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-06-t.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- rendering-text-BE-02.svg -->
+<!-- renamed for 1.1 suite to render-elems-06-t.svg -->
+<!-- -->
+<!-- This test validates that text can be both filled and stroked. -->
+<!-- -->
+<!-- Author : Vincent Hardy, 29-Feb-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, VH: Created. Matches 20000302 SVG spec. -->
+<!-- 11-Mar-2000, LH=" fixed names, focus, ids, framing rect" removed -->
+<!-- ineffective "text-anchor="middle"" ser#3 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH: renaming, ser#4. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg id="svg-root" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 480 360" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.3 $" testname="render-elems-02-t-c.svg">
+ <Paragraph>
+ Verifies that text can be filled. The
+ test shows two 'A' characters that are filled and not stroked.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-06-t</title>
+ <desc id="test-desc">This test validates that text can be both filled.</desc>
+ <defs >
+ <font id="MyFont" horiz-adv-x="416" >
+ <font-face font-family="MyFont"
+ units-per-em="1000"
+ panose-1="2 0 0 6 3 0 0 2 0 4"
+ ascent="700"
+ descent="-127"/>
+ <missing-glyph horiz-adv-x="500"/>
+ <glyph unicode="A" glyph-name="A" horiz-adv-x="505" d="M73 700L5 0H155L170 165H335L350 0H500L432 700H73ZM183 315L205 550H300L322 315H183Z" />
+ <glyph unicode="B" glyph-name="B" horiz-adv-x="550" d="M40 700V0H510V280L423 350L510 420V700H40ZM360 550V471L306 420H190V550H360ZM190 280H306L360 229V150H190V280Z" />
+ </font>
+ </defs>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content" >
+ <!-- ====================================================================== -->
+ <!-- First, fill text with two different colors -->
+ <!-- ====================================================================== -->
+ <text x="180" y="40" font-size="30" >Text fill</text>
+ <g font-size="300" font-family="MyFont">
+ <text x="60" y="280" fill="red" >A</text>
+ <text x="260" y="280" fill="navy" >A</text>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-elems-07-t.svg b/tests/arthur/data/1.1/render-elems-07-t.svg
new file mode 100644
index 0000000000..60427f2fc4
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-07-t.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- rendering-text-BE-02.svg -->
+<!-- renamed for 1.1 suite to render-elems-07-t.svg -->
+<!-- -->
+<!-- This test validates that text can be both filled and stroked. -->
+<!-- -->
+<!-- Author : Vincent Hardy, 29-Feb-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, VH: Created. Matches 20000302 SVG spec. -->
+<!-- 11-Mar-2000, LH=" fixed names, focus, ids, framing rect" removed -->
+<!-- ineffective "text-anchor="middle"" ser#3 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH: renaming, ser#4. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root"
+ width="100%" height="100%" viewBox="0 0 480 360" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.3 $" testname="render-elems-02-b-b.svg">
+ <Paragraph>
+ Verifies that text can be stroked. The
+ The test
+ shows two characters that are stroked and not filled.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-07-t</title>
+ <desc id="test-desc">This test validates that text can be both stroked.</desc>
+ <defs>
+ <font id="MyFont" horiz-adv-x="416" >
+ <font-face font-family="MyFont"
+ units-per-em="1000"
+ panose-1="2 0 0 6 3 0 0 2 0 4"
+ ascent="700"
+ descent="-127"/>
+ <missing-glyph horiz-adv-x="500"/>
+ <glyph unicode="A" glyph-name="A" horiz-adv-x="505" d="M73 700L5 0H155L170 165H335L350 0H500L432 700H73ZM183 315L205 550H300L322 315H183Z" />
+ <glyph unicode="B" glyph-name="B" horiz-adv-x="550" d="M40 700V0H510V280L423 350L510 420V700H40ZM360 550V471L306 420H190V550H360ZM190 280H306L360 229V150H190V280Z" />
+ </font>
+ </defs>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Now, stroke text with two different stroke width and color -->
+ <!-- ====================================================================== -->
+ <text x="180" y="40" font-size="30" >Text stroke</text>
+ <g font-size="300" font-family="MyFont">
+ <text x="60" y="280" fill="none" stroke="red" stroke-width="12">A</text>
+ <text x="260" y="280" fill="none" stroke="navy" stroke-width="12">B</text>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+ </g>
+</svg>
diff --git a/tests/arthur/data/1.1/render-elems-08-t.svg b/tests/arthur/data/1.1/render-elems-08-t.svg
new file mode 100644
index 0000000000..0ba2c543ab
--- /dev/null
+++ b/tests/arthur/data/1.1/render-elems-08-t.svg
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- rendering-text-BE-02.svg -->
+<!-- renamed for 1.1 suite to render-elems-08-t.svg -->
+<!-- -->
+<!-- This test validates that text can be both filled and stroked. -->
+<!-- -->
+<!-- Author : Vincent Hardy, 29-Feb-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/11/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, VH: Created. Matches 20000302 SVG spec. -->
+<!-- 11-Mar-2000, LH=" fixed names, focus, ids, framing rect" removed -->
+<!-- ineffective "text-anchor="middle"" ser#3 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH: renaming, ser#4. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root"
+ viewBox="0 0 480 360" width="100%" height="100%" version="1.1" baseProfile="tiny">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.3 $" testname="render-elems-02-b-c.svg">
+ <Paragraph>
+ Verifies that text can be stroked.
+ The test
+ shows two 'A' characters that are both stroked and filled.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image except for the text which may
+ show minor layout differences.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-elems-08-t</title>
+ <desc id="test-desc">This test validates that text can be both filled and stroked.</desc>
+ <defs>
+ <font id="MyFont" horiz-adv-x="416" >
+ <font-face font-family="MyFont"
+ units-per-em="1000"
+ panose-1="2 0 0 6 3 0 0 2 0 4"
+ ascent="700"
+ descent="-127"/>
+ <missing-glyph horiz-adv-x="500"/>
+ <glyph unicode="A" glyph-name="A" horiz-adv-x="505" d="M73 700L5 0H155L170 165H335L350 0H500L432 700H73ZM183 315L205 550H300L322 315H183Z" />
+ <glyph unicode="B" glyph-name="B" horiz-adv-x="550" d="M40 700V0H510V280L423 350L510 420V700H40ZM360 550V471L306 420H190V550H360ZM190 280H306L360 229V150H190V280Z" />
+ </font>
+ </defs>
+
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- Now, fill and stroke. The fill should happen first -->
+ <!-- ====================================================================== -->
+ <text x="120" y="40" font-size="30" >Text fill and stroke</text>
+ <g font-size="300" font-family="MyFont">
+ <text x="60" y="280" fill="#f82" stroke="red" stroke-width="12">A</text>
+ <text x="260" y="280" fill="#9ae" stroke="navy" stroke-width="12">B</text>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.3 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+ </g>
+</svg>
+
diff --git a/tests/arthur/data/1.1/render-groups-03-t.svg b/tests/arthur/data/1.1/render-groups-03-t.svg
new file mode 100644
index 0000000000..3f1ca22497
--- /dev/null
+++ b/tests/arthur/data/1.1/render-groups-03-t.svg
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
+[
+ <!ENTITY % svgExt "| SVGTestCase">
+ <!ATTLIST svg baseProfile CDATA #IMPLIED>
+ <!ELEMENT SVGTestCase (OperatorScript)>
+ <!ATTLIST SVGTestCase
+ xmlns CDATA #REQUIRED
+>
+ <!ELEMENT OperatorScript (Paragraph)*>
+ <!ATTLIST OperatorScript
+ version CDATA #IMPLIED
+ testname CDATA #IMPLIED>
+ <!ELEMENT Paragraph (#PCDATA)>
+]>
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- rendering-orderGr-BE-01.svg -->
+<!-- renamed for 1.1 suite to render-groups-03-t.svg -->
+<!-- -->
+<!-- Validate the rendering order of graphic elements and the concept -->
+<!-- of grouping. -->
+<!-- -->
+<!-- Author : Vincent Hardy, 29-Feb-2000 -->
+<!-- Revised for 1.1 : Phil Armstrong Feb/12/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 29-Feb-2000, VH: Created. Matches 20000302 SVG spec. -->
+<!-- 11-Mar-2000, LH=" fixed names, focus, ids, framing rect" removed -->
+<!-- ineffective "text-anchor="middle"" ser#3 -->
+<!-- 25-Apr-2000, VH=" put background pattern behind objects" ser#4. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 16-Aug-2000, LH: renaming, ser#5. -->
+<!-- 21-Aug-2000, VH: added prerequisites section. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ id="svg-root" baseProfile="tiny" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.5 $" testname="render-groups-01-t-a.svg">
+ <Paragraph>
+ Verifies implicit rendering order (paragraph 3.3) and grouping mechanism (paragraphs 3.4).
+ It also validates basic Shape, Image and text rendering.
+ </Paragraph>
+ <Paragraph>
+ This test renders 3 elements: a text string "SVG", then
+ a shape, then an image. Because of their definition order and coordinates, the image
+ should be on top of the rectangle and the rectangle on top of the text. None
+ of the "SVG" should show through the
+ rectangle and none of the rectangle should show through the image.
+ </Paragraph>
+ <Paragraph>
+ Prerequisites: the test assumes proper handling of the fill stroke, stroke-width,
+ font-size rendering properties. It uses the rect, line, text and image elements, as
+ well as all the elements required for the test template. To ensure that the text string is
+ overlapped by the other elements and to avoid a dependency on system fonts, an SVG font is used.
+ </Paragraph>
+ <Paragraph>
+ The rendered image should match the reference image exactly.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">render-groups-03-t</title>
+ <desc id="test-desc">This test validates the rendering order of graphic elements.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <defs>
+ <font horiz-adv-x="313">
+ <!-- Converted from Larabie Anglepoise by Batik ttf2svg -->
+ <font-face font-family="larabie-anglepoise" units-per-em="1000" panose-1="0 0 4 0 0 0 0 0 0 0" ascent="703" descent="-300" alphabetic="0"/>
+ <missing-glyph horiz-adv-x="500" d="M63 0V700H438V0H63ZM125 63H375V638H125V63Z"/>
+ <glyph unicode="S" glyph-name="S" horiz-adv-x="385" d="M371 1H29V144H264Q264 151 264 166Q265 180 265 188Q265 212 249 212H132Q83 212 55 247Q29 279 29 329V566H335V422H136V375Q136 360 144 356Q148 355 168 355H279Q327 355 352 309Q371 273 371 221V1Z"/>
+<glyph unicode="V" glyph-name="V" horiz-adv-x="351" d="M365 563L183 -33L0 563H101L183 296L270 563H365Z"/>
+<glyph unicode="G" glyph-name="G" horiz-adv-x="367" d="M355 1H18V564H355V420H125V144H248V211H156V355H355V1Z"/>
+ <hkern g1="V" g2="G" k="-40"/>
+ </font>
+ </defs>
+ <!-- ====================================================================== -->
+ <!-- 3 overlapping elements in a group with opacity -->
+ <!-- ====================================================================== -->
+ <g transform="scale(1.8, 1.8)">
+ <!-- Background pattern -->
+ <rect x="20" y="10" width="230" height="155" fill="rgb(192, 192, 192)"/>
+ <line x1="40" y1="10" x2="40" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="70" y1="10" x2="70" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="100" y1="10" x2="100" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="130" y1="10" x2="130" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="160" y1="10" x2="160" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="190" y1="10" x2="190" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="220" y1="10" x2="220" y2="175" stroke="white" stroke-width="15"/>
+ <line x1="250" y1="10" x2="250" y2="175" stroke="white" stroke-width="15"/>
+ <rect x="20" y="10" width="230" height="155" fill="none" stroke="black"/>
+ <!-- The following text, rectangle and image are drawn, fully opaque, in -->
+ <!-- the order they are defined. Therefore, none of the 'A' under the -->
+ <!-- rectangle should show. Neither should any of the rectangle under -->
+ <!-- the image. -->
+ <text font-family="larabie-anglepoise" font-size="120" x="30" y="90">SVG</text>
+ <rect x="70" y="55" width="130" height="70" fill="rgb(130, 0, 50)"/>
+ <image x="162" y="75" width="80" height="80" xlink:href="images/sign.png"/>
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.5 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
diff --git a/tests/arthur/data/1.1/shapes-circle-01-t.svg b/tests/arthur/data/1.1/shapes-circle-01-t.svg
new file mode 100644
index 0000000000..d8e5380667
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-circle-01-t.svg
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-circle-01.t.svg -->
+<!-- renamed for 1.1 suite to shapes-circle-01-t.svg -->
+<!-- -->
+<!-- Test ability to handle the 'circle' basic-shapes element. -->
+<!-- -->
+<!-- Author : Lofton Henderson 23-March-2000 -->
+<!-- Revised for 1.1 : Tolga Capin 14-Feb-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 23-Mar-2000, LH: Serial#1 created. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="shapes-circle-01-f.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">shapes-circle-01-t</title>
+ <desc id="test-desc">Test ability to handle the 'circle' basic shapes element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <circle cx="100" cy="100" r="50" fill="none" stroke="black" />
+ <circle cx="220" cy="100" r="35" fill="red" stroke="black" />
+ <circle cx="340" cy="100" r="20" fill="black" stroke="lime" stroke-width="4" />
+ <circle cx="100" cy="260" r="20" stroke="lime" fill="yellow" stroke-width="4" />
+ <circle cx="220" cy="260" r="35" stroke="none" fill="blue" />
+ <circle cx="340" cy="260" r="50" stroke="red" fill="none" stroke-width="10" />
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/shapes-ellipse-01-t.svg b/tests/arthur/data/1.1/shapes-ellipse-01-t.svg
new file mode 100644
index 0000000000..c86f23762b
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-ellipse-01-t.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-ellipse-BE-01.svg -->
+<!-- renamed for 1.1 suite to shapes-ellipse-01-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the <ellipse> -->
+<!-- element. -->
+<!-- -->
+<!-- Author : Kelvin R. Lawrence, 3-Feb-2000 -->
+<!-- -->
+<!-- History: -->
+<!-- 3-Feb-2000, KRL, Serial#1 created. Matches 20000202 SVG spec. -->
+<!-- 27-Feb-2000, LRH, Serial#2, fix TC name, formatting, create .XML -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#3 -->
+<!-- 04-Jun-2000, LH, fix label in Legend; ser#4 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.7 $" testname="shapes-ellipse-01-t.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">shapes-ellipse-01-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;ellipse&gt; element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- First pair of ellipses. -->
+ <!-- ====================================================================== -->
+ <ellipse id="ellipse-01" fill="none" stroke="#000000" cx="50" cy="75" rx="30" ry="50"/>
+ <ellipse id="ellipse-02" fill="red" cx="160" cy="75" rx="30" ry="50"/>
+ <!-- ====================================================================== -->
+ <!-- Second pair of ellipses, should actually draw circles. -->
+ <!-- ====================================================================== -->
+ <ellipse id="ellipse-03" fill="none" stroke="#000000" cx="270" cy="80" rx="35" ry="35"/>
+ <ellipse id="ellipse-04" fill="red" cx="370" cy="80" rx="35" ry="35"/>
+ <!-- ====================================================================== -->
+ <!-- Third pair of ellipses. -->
+ <!-- ====================================================================== -->
+ <ellipse id="ellipse-05" fill="none" stroke="#0000FF" stroke-width="8" cx="50" cy="220" rx="30" ry="50"/>
+ <ellipse id="ellipse-06" fill="#00FF00" stroke="#0000FF" stroke-width="8" cx="160" cy="220" rx="30" ry="50"/>
+ <!-- ====================================================================== -->
+ <!-- Fourth pair of ellipses. -->
+ <!-- ====================================================================== -->
+ <ellipse id="ellipse-07" fill="#00FF00" stroke="#0000FF" stroke-width="8" cx="330" cy="220" rx="70" ry="40"/>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/shapes-line-01-t.svg b/tests/arthur/data/1.1/shapes-line-01-t.svg
new file mode 100644
index 0000000000..e0bffae15b
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-line-01-t.svg
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-line-01-t.svg -->
+<!-- -->
+<!-- Test ability to handle the 'line' basic-shapes element. -->
+<!-- -->
+<!-- This is a concatenation of the SVG spec example and the sample -->
+<!-- from the IBM SVGview distribution. -->
+<!-- -->
+<!-- Author : Lofton Henderson 23-Mar-2000 -->
+<!-- Revised for 1.1 : Tolga Capin 14-Feb-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 23-Mar-2000, LH: Serial#1 created. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="shapes-line-01-f.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">shapes-line-01-t</title>
+ <desc id="test-desc">Test ability to handle the 'line' basic-shapes element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <g id="diagonal-line-set">
+ <line x1="37.5" y1="137" x2="112.5" y2="50" fill="none" stroke="black" stroke-width="1" />
+ <line x1="112.5" y1="137" x2="187.5" y2="50" fill="none" stroke="red" stroke-width="5" />
+ <line x1="187.5" y1="137" x2="262.5" y2="50" fill="none" stroke="green" stroke-width="7.5" />
+ <line x1="262.5" y1="137" x2="337.5" y2="50" fill="none" stroke="blue" stroke-width="10" />
+ <line x1="337.5" y1="137" x2="412.5" y2="50" fill="none" stroke="fuchsia" stroke-width="12.5" />
+ </g>
+ <g id="middle-figure" stroke="black" stroke-width="1" >
+ <line x1="170" y1="200" x2="220" y2="200"/>
+ <line x1="220" y1="200" x2="220" y2="250"/>
+ <line x1="220" y1="250" x2="270" y2="250"/>
+ <line x1="270" y1="250" x2="270" y2="200"/>
+ <line x1="270" y1="200" x2="320" y2="200"/>
+ </g>
+ <g id="lower-left-figure" stroke="blue" stroke-width="10" >
+ <line x1="25" y1="200" x2="75" y2="200"/>
+ <line x1="75" y1="200" x2="75" y2="250"/>
+ <line x1="75" y1="250" x2="125" y2="250"/>
+ <line x1="125" y1="250" x2="125" y2="200"/>
+ <line x1="125" y1="200" x2="175" y2="200"/>
+ </g>
+ <g id="lower-right-figure" stroke-width="10" >
+ <line x1="370" y1="250" x2="420" y2="250" stroke="black" />
+ <line x1="420" y1="200" x2="470" y2="200" stroke="fuchsia" />
+ <line x1="320" y1="200" x2="370" y2="200" stroke="blue" />
+ <line x1="370" y1="200" x2="370" y2="250" stroke="green" />
+ <line x1="420" y1="250" x2="420" y2="200" stroke="red" />
+ </g>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/shapes-polygon-01-t.svg b/tests/arthur/data/1.1/shapes-polygon-01-t.svg
new file mode 100644
index 0000000000..57995b624e
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-polygon-01-t.svg
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-polygon-01-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the 'polygon' -->
+<!-- element. -->
+<!-- -->
+<!-- Author : Kelvin R. Lawrence, 7-Feb-2000 -->
+<!-- Revised for 1.1 : Tolga Capin 14-Feb-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 07-Feb-2000, KRL, Serial#1 created. Matches 20000202 SVG spec. -->
+<!-- 24-Mar-2000, LH=" finish tests" new Legend; naming; ser#2. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="shapes-polygon-01-f.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">shapes-polygon-01-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the 'polygon' element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- Test case label. -->
+ <!-- ====================================================================== -->
+ <!-- First two polygons, convex and "regular". -->
+ <!-- ====================================================================== -->
+ <!-- Open, convex, "regular". -->
+ <polygon id="polygon-01" fill="none" stroke="#000000" points="59,45,95,63,108,105,82,139,39,140,11,107,19,65"/>
+ <!-- Closed, convex, "regular". -->
+ <polygon id="polygon-02" fill="red" points="179,45,218,63,228,105,202,139,159,140,131,107,139,65,179,45"/>
+ <!-- ====================================================================== -->
+ <!-- Third polygon, concave and irregular. -->
+ <!-- ====================================================================== -->
+ <!-- Closed, convex, "irregular". -->
+ <polygon id="polygon-03" fill="blue" stroke="black" stroke-width="6" points="350,45 375,80 410,95 375,110 350,145 325,120 290,95 325,70,350,45"/>
+ <!-- ====================================================================== -->
+ <!-- Fourth and fifth polygons. -->
+ <!-- ====================================================================== -->
+ <!-- Closed, convex, "regular". -->
+ <polygon id="polygon-05" fill="none" stroke="#0000FF" stroke-width="8" points="59,185,98,203,108,245,82,279,39,280,11,247,19,205,59,185"/>
+ <!-- Open, convex, "regular". -->
+ <polygon id="polygon-06" fill="#00FF00" stroke="#0000FF" stroke-width="8" points="179,185,218,203,228,245,202,279,159,280,131,247,139,205"/>
+ <!-- ====================================================================== -->
+ <!-- Sixth polygons, irregular with both concave and convex angles. -->
+ <!-- ====================================================================== -->
+ <polygon id="polygon-07" fill="none" stroke="#00FF00" stroke-width="8" points="270,225 300,245 320,225 340,245 280,280 390,280 420,240 280,185"/>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/shapes-polyline-01-t.svg b/tests/arthur/data/1.1/shapes-polyline-01-t.svg
new file mode 100644
index 0000000000..9884cdc5e9
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-polyline-01-t.svg
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-polyline-01-t.svg -->
+<!-- renamed for Tiny suite to shapes-polyline-01-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the 'polyline' -->
+<!-- element. -->
+<!-- -->
+<!-- Author : Lofton Henderson, 25 March 2000 -->
+<!-- Revised for 1.1 : Tolga Capin 14-Feb-2002 -->
+<!-- Revised for Tiny: Takeshi Sagara 04-Jul-2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 25-Mar-2000, LH: create ser#1. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 04-Jul-2002, TS add viewBox and comment out unreadable small texts. -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.7 $" testname="shapes-polyline-01-t.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+
+ <title id="test-title">shapes-polyline-01-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the 'polyline' element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- Test case label. -->
+ <!-- ====================================================================== -->
+ <!-- First two polylines. -->
+ <!-- ====================================================================== -->
+ <!-- Open sawtooth line. -->
+ <polyline id="polyline-01" fill="none" stroke="#000000" points="10,50,35,150,60,50,85,150,110,50,135,150"/>
+ <!-- text font-family="Arial" font-size="12" x="52" y="40">stroked</text-->
+ <!-- Closed pentagon shaped polyline (5 segments). -->
+ <polyline id="polyline-02" fill="none" stroke="blue" stroke-width="8" points="220,50,267,84,249,140,190,140,172,84,220,50"/>
+ <!--text font-family="Arial" font-size="12" x="202" y="40">stroked</text-->
+ <!-- ====================================================================== -->
+ <!-- Third polyline. -->
+ <!-- ====================================================================== -->
+ <!-- The sawtooth again, polylines can be filled. -->
+ <polyline id="polyline-03" fill="blue" stroke="#00FF00" stroke-width="4" points="310,50,335,150,360,50,385,150,410,50,435,150"/>
+ <!--text font-family="Arial" font-size="12" x="340" y="40">filled &amp; stroked</text-->
+ <!-- ====================================================================== -->
+ <!-- Fourth and fifth polylines. -->
+ <!-- ====================================================================== -->
+ <!-- An unclosed "septagon" shaped polyline (7th segment omitted). -->
+ <polyline id="polyline-04" fill="none" stroke="red" stroke-width="8" points="59,185,98,203,108,245,82,279,39,280,11,247,19,205"/>
+ <!--text font-family="Arial" font-size="12" x="36" y="175">stroked</text-->
+ <!-- Same shape, filled, shows difference with 'polygon'. -->
+ <polyline id="polyline-05" fill="#00FF00" stroke="#0000FF" stroke-width="8" points="189,185,228,203,238,245,212,279,169,280,141,247,149,205"/>
+ <!--text font-family="Arial" font-size="12" x="148" y="175">filled &amp; stroked</text-->
+ <!-- ====================================================================== -->
+ <!-- Sixth polylines, irregular with both concave and convex angles. -->
+ <!-- ====================================================================== -->
+ <polyline id="polyline-06" fill="#FF00FF" stroke="none" stroke-width="8" points="270,225 300,245 320,225 340,245 280,280 390,280 420,240 280,185"/>
+ <!--text font-family="Arial" font-size="12" x="330" y="175">filled</text-->
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/shapes-rect-01-t.svg b/tests/arthur/data/1.1/shapes-rect-01-t.svg
new file mode 100644
index 0000000000..3ea47a6d47
--- /dev/null
+++ b/tests/arthur/data/1.1/shapes-rect-01-t.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- shapes-rect-BE-01.svg -->
+<!-- renamed for 1.1 suite to shapes-rect-01-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to handle the <rect> -->
+<!-- element. -->
+<!-- -->
+<!-- Author : Kelvin R. Lawrence, 3-Feb-2000 -->
+<!-- -->
+<!-- History: -->
+<!-- 3-Feb-2000, KRL, Serial#1 created. Matches 20000202 SVG spec. -->
+<!-- 27-Feb-2000, LH, Serial#2, fix TC name, formatting, create .XML -->
+<!-- 12-Mar-2000, LH, fix test-framing rect; ser#3 -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+<!--nav data here-->
+ <OperatorScript version="$Revision: 1.7 $" testname="shapes-rect-01-t.svg">
+ <Paragraph>
+ The rendered picture should match the reference image, except
+ for possible variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+
+ <title id="test-title">shapes-rect-01-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to handle the &lt;rect&gt; element.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <!-- ====================================================================== -->
+ <!-- First of all draw two simple rectangles. One stroked , one filled. -->
+ <!-- ====================================================================== -->
+ <rect id="Simple-rect-no-fill" fill="none" stroke="#000000" x="30" y="46" width="50" height="80"/>
+ <rect id="Simple-rect-filled" fill="red" x="130" y="46" width="50" height="80"/>
+ <!-- ====================================================================== -->
+ <!-- Second set of rectangles this time with rounded corners. -->
+ <!-- ====================================================================== -->
+ <rect id="Simple-round-rect-no-fill" fill="none" stroke="#000000" x="250" y="46" width="50" height="80" rx="30"/>
+ <rect id="Simple-round-rect-filled" fill="red" x="350" y="46" width="50" height="80" rx="30"/>
+ <!-- ====================================================================== -->
+ <!-- Third set of rectangles. -->
+ <!-- ====================================================================== -->
+ <rect id="rect-03" fill="none" stroke="#0000FF" stroke-width="8" x="30" y="196" width="50" height="80"/>
+ <rect id="rect-04" fill="#00FF00" stroke="#0000FF" stroke-width="8" x="130" y="196" width="50" height="80"/>
+ <!-- ====================================================================== -->
+ <!-- Fourth set of rectangles. -->
+ <!-- ====================================================================== -->
+ <rect id="rect-05" fill="none" stroke="#0000FF" stroke-width="8" x="250" y="196" width="50" height="80" rx="30" ry="50"/>
+ <rect id="rect-06" fill="#00FF00" x="350" y="196" width="50" height="80" rx="30" ry="50"/>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.7 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/struct-cond-01-t.svg b/tests/arthur/data/1.1/struct-cond-01-t.svg
new file mode 100644
index 0000000000..cfe8b91ac1
--- /dev/null
+++ b/tests/arthur/data/1.1/struct-cond-01-t.svg
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- structure-switch-BE-07.svg -->
+<!-- renamed to struct-cond-01-t.svg -->
+<!-- -->
+<!-- Test that the switch element works. -->
+<!-- -->
+<!-- Author : Tim Thompson 3/16/00 -->
+<!-- Revised for 1.1 : Rick Graham Feb/05/2002 -->
+<!-- -->
+<!-- History: -->
+<!-- 20-mar-2000, serial#1 created. -->
+<!-- 09-apr-2000, LH=" fix title" remove nested svg; cmmt DOCTYPE; ser#2. -->
+<!-- 15-may-2000, TT: changed language. ser#3. -->
+<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
+<!-- 17-Aug-2000, JF: system-language to systemLanguage, -->
+<!-- system-required to requiredFeatures, -->
+<!-- org.w3c.static to org.w3c.svg.static. -->
+<!-- -->
+<!-- 28-Aug-2000, TT: drop systemLanguage and requiredFeatures from -->
+<!-- switch, dropped language=en from rect that -->
+<!-- validates to true. -->
+<!-- 15-Nov-2000, LH: add missing test-body-content group. -->
+<!-- 15-Jul-2001, JF: Removed requiredFeatures check, as this required -->
+<!-- full implementation of static spec to pass. -->
+<!-- Replaced systemLanguage check with check to non-existent-->
+<!-- requiredExtensions and two elements with no test. -->
+<!-- ===================================================================== -->
+<!--======================================================================-->
+<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
+<!--= log messages, and therefore is no longer in the preceding preamble.=-->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.6 $" testname="struct-cond-01-t.svg">
+ <Paragraph>
+ This test evaluates a switch statement. The result should be a
+ green rectangle in the lower left quarter of the output window.
+ </Paragraph>
+ <Paragraph>
+ The rendered picture should match the reference image, except for possible
+ variations in the labelling text (per CSS2 rules).
+ </Paragraph>
+ <Paragraph>
+ The test uses the 'rect' element, as well as basic fill (solid primary colors),
+ stroke (black 1-pixel lines), font-family (Arial) and font-size properties.
+ </Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">struct-cond-01-t.svg</title>
+ <desc id="test-desc">Test to determine if a simple switch element can be probably evaluated.</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <switch>
+ <rect fill="red" x="0" y="0" width="220" height="150"
+ requiredExtensions="http://example.org/bogus"/>
+ <rect fill="green" x="0" y="150" width="220" height="150"/>
+ <rect fill="blue" x="240" y="0" width="220" height="150"/>
+ </switch>
+ </g>
+ <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+</svg>
+
diff --git a/tests/arthur/data/1.1/struct-cond-02-t.svg b/tests/arthur/data/1.1/struct-cond-02-t.svg
new file mode 100644
index 0000000000..4a965d3bc1
--- /dev/null
+++ b/tests/arthur/data/1.1/struct-cond-02-t.svg
@@ -0,0 +1,574 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<!--======================================================================-->
+<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
+<!--= Institute of Technology, Institut National de Recherche en =-->
+<!--= Informatique et en Automatique, Keio University). All Rights =-->
+<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
+<!--======================================================================-->
+<!-- edited with XML Spy v3.0.7 NT (http://www.xmlspy.com) by Chris Lilley (W3C) -->
+<!-- ===================================================================== -->
+<!-- -->
+<!-- structure-lang-BE-08.svg -->
+<!-- renamed to struct-cond-02-t.svg -->
+<!-- -->
+<!-- Test that viewer has the basic capability to switch on user langauge -->
+<!-- -->
+<!-- Author : Chris Lilley, 28-Jul-2000 -->
+<!-- Revised for 1.1 : Rick Graham Feb/05/2002 -->
+<!--======================================================================-->
+<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+ <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
+ <OperatorScript version="$Revision: 1.8 $" testname="struct-cond-02-t.svg">
+<Paragraph>
+ This tests ability to use the 'systemLanguage' as a test attribute within a
+ switch element. To pass, either <ol>
+ <li>the name (in English) of the current
+ system language, or</li>
+ <li>the names of the three languages (English, French
+ Japanese) of W3C</li>
+ </ol> must appear. The second case
+ will occur if either the user language is not one of the (60 or so) languages
+ present in the test, or if there is no user language information available.
+</Paragraph>
+<Paragraph>
+ It is an error to display no output; the last child of switch has no test, so
+ it will always be taken unless a more suitable child has already evaluated to true.
+
+</Paragraph>
+
+<Paragraph>
+ In addition, the string "Why don't they just speak &lt;language&gt;" should appear
+ in the center of the graphic, translated into that language. It is not an error for
+ some or all of this string to display as 'missing character' glyphs, if no
+ suitable font is available - however, this is unlikely if the language is indeed
+ the users primary language. (It can easily occur during testing, however).
+</Paragraph>
+ </OperatorScript>
+ </SVGTestCase>
+ <title id="test-title">struct-cond-02-t</title>
+ <desc id="test-desc">Test that viewer has the basic capability to switch on user langauge</desc>
+ <!--======================================================================-->
+ <!--Content of Test Case follows... =====================-->
+ <!--======================================================================-->
+ <g id="test-body-content">
+ <g fill="black" stroke="none" font-size="24" font-weight="normal" font-family="Arial, Tahoma, Verdana, 'Arial Unicode MS', Code2000">
+ <!-- a blank one
+<text x="20" y="220" xml:lang="">
+<tspan font-weight="bold" >
+ ?</text>
+<text x="230" y="150" xml:lang="en"></text>
+-->
+ <!-- put sample here for testing -->
+ <switch>
+ <g systemLanguage="af">
+ <text x="20" y="220" xml:lang="af" font-size="16">Waarom kan hulle nie net doodgewoon Afrikaans praat nie?</text>
+ <text x="230" y="150" xml:lang="en">Afrikaans</text>
+ </g>
+ <g systemLanguage="am">
+ <text x="20" y="220" xml:lang="am" font-family="'GF Zemen Unicode',Code2000" font-size="28">ለምንድነው አማርኛ የማይናገሩት፧</text>
+ <text x="230" y="150" xml:lang="en">Amharic</text>
+ </g>
+ <g systemLanguage="ar">
+ <!-- this is a tiny test so there is no text-anchor, thus rtl text is explicitly positioned -->
+ <text x="20" y="220" xml:lang="ar-SA" font-family=" Tahoma,'MS Farsi','Arial Unicode MS'" font-size="19">لماذا لا يتكلمون اللّغة العربية فحسب؟</text>
+ <text x="230" y="150" xml:lang="en">Arabic (SA)</text>
+ </g>
+ <g systemLanguage="bg">
+ <text x="20" y="220" xml:lang="bg" font-size="18">Защо те просто не могат да говорят български ?</text>
+ <text x="230" y="150" xml:lang="en">Bulgarian</text>
+ </g>
+ <g systemLanguage="bn">
+ <text x="20" y="220" xml:lang="bn" font-family="'Arial Unicode MS','UT Bengali Khulna'" font-size="28">ওরা েকন বাংলা বলেত পাের না ?</text>
+ <text x="230" y="150" xml:lang="en">Bengali</text>
+ </g>
+ <!--
+Tibetan needs complex layout: this will not work correctly though the font has the right glyphs:
+<g systemLanguage="bo">
+ <text x="20" y="220" xml:lang="bo" font-family="'Arial Unicode MS'" font-size="18">
+
+ག་རེ་བྱས་ཁོ་རང་ཚོས་ བོད་ སྐད་ཆ་དེ་ག་རང་བཤད་ཀྱི་མ་རེད།</text>
+ <text x="230" y="150" xml:lang="en">Tibetan</text>
+ </g>-->
+ <g systemLanguage="ca">
+ <text x="20" y="220" xml:lang="bg" font-size="20">Per què no poden simplement parlar en català ?</text>
+ <text x="230" y="150" xml:lang="en">Catalan</text>
+ </g>
+ <g systemLanguage="cs">
+ <text x="20" y="220" xml:lang="cs">Proč prostě nemluví česky ?</text>
+ <text x="230" y="150" xml:lang="en">Czech</text>
+ </g>
+ <g systemLanguage="cy">
+ <text x="20" y="220" xml:lang="cy" font-size="20">Pam dydyn nhw ddim yn siarad Cymraeg ?</text>
+ <text x="230" y="150" xml:lang="en">Welsh</text>
+ </g>
+ <g systemLanguage="da">
+ <text x="20" y="220" xml:lang="da">Hvorfor kan de ikke bare tale dansk ?</text>
+ <text x="230" y="150" xml:lang="en">Danish</text>
+ </g>
+ <!-- need a generic german, too -->
+ <g systemLanguage="de-DE">
+ <text x="20" y="220" xml:lang="de-DE" font-size="22">Warum sprechen sie nicht einfach Deutsch ?</text>
+ <text x="230" y="150" xml:lang="en">German (DE)</text>
+ </g>
+ <g systemLanguage="el">
+ <text x="20" y="220" xml:lang="el-GR" font-size="22">Μα γιατί δεν μπορούν να μιλήσουν Ελληνικά ;</text>
+ <text x="230" y="150" xml:lang="en">Greek (modern, GR)</text>
+ </g>
+ <g systemLanguage="en">
+ <text x="20" y="220" xml:lang="en-US">Why can't they just speak English ?</text>
+ <text x="230" y="150" xml:lang="en">English (US)</text>
+ </g>
+ <g systemLanguage="es">
+ <text x="20" y="220" xml:lang="es-ES" font-size="18">¿Por qué no pueden simplemente hablar en castellano ?</text>
+ <text x="230" y="150" xml:lang="en">Spanish (ES)</text>
+ </g>
+ <g systemLanguage="eu">
+ <text x="20" y="220" xml:lang="eu" font-size="21">Zergatik ezin dute  Euzkeraz bakarrik hitzegin?</text>
+ <text x="230" y="150" xml:lang="en">Basque</text>
+ </g>
+ <g systemLanguage="fa">
+ <text x="20" y="220" xml:lang="fa" font-family=" Tahoma,'MS Farsi','Arial Unicode MS'" font-size="22">خب، چرا فارسى صحبت نمى كنند؟</text>
+ <text x="230" y="150" xml:lang="en">Farsi</text>
+ </g>
+ <g systemLanguage="fi">
+ <text x="20" y="220" xml:lang="fi" font-size="20">Miksi he eivät yksinkertaisesti puhu suomea ?</text>
+ <text x="230" y="150" xml:lang="en">Finnish</text>
+ </g>
+ <!-- put Canadian French before generic French -->
+ <g systemLanguage="fr">
+ <text x="20" y="220" xml:lang="fr-fR" font-size="17">Pourquoi, tout simplement, ne parlent-ils pas en Français ?</text>
+ <text x="230" y="150" xml:lang="en">French (FR)</text>
+ </g>
+ <g systemLanguage="gd">
+ <text x="20" y="220" xml:lang="gd" font-size="20">Carson nach eil iad a'bruidhinn na Gàidhlige ?</text>
+ <text x="230" y="150" xml:lang="en">Scots Gaelic</text>
+ </g>
+ <g systemLanguage="gu">
+ <text x="20" y="220" xml:lang="gu" font-family="'Arial Unicode MS'" font-size="28">બદ્ધા લોકો ગુજરાતી કૅમ નથી બોલતા?</text>
+ <text x="230" y="150" xml:lang="en">Gujarti (IN)</text>
+ </g>
+ <g systemLanguage="he">
+ <!-- he or iw, check -->
+ <text x="20" y="220" xml:lang="he" font-family="Tahoma,'Arial Unicode MS'" font-size="22">למה הם פשוט לא מדברים עברית ?</text>
+ <text x="230" y="150" xml:lang="en">Hebrew (modern)</text>
+ </g>
+ <g systemLanguage="hi">
+ <text x="20" y="220" xml:lang="hi" font-family="Mangal,Code2000,'Arial Unicode MS'">यह लोग हिन्दी क्यों नहीं बोल सकते हैं ?</text>
+ <text x="230" y="150" xml:lang="en">Hindi</text>
+ </g>
+ <g systemLanguage="hr">
+ <text x="20" y="220" xml:lang="hr">Zašto jednostavno ne govore hrvatski ?</text>
+ <text x="230" y="150" xml:lang="en">Croatian</text>
+ </g>
+ <g systemLanguage="hu">
+ <text x="20" y="220" xml:lang="hu" font-size="22">Miért nem beszélnek egyszerűen magyarul ?</text>
+ <text x="230" y="150" xml:lang="en">Hungarian</text>
+ </g>
+ <g systemLanguage="hy">
+ <text x="20" y="220" xml:lang="hy" font-family="Sylfaen,Code2000,'Arial Unicode MS'" font-size="22">Ինչու՞ նրանք չեն խոսում Հայերեն
+ </text>
+ <text x="230" y="150" xml:lang="en">Armenian</text>
+ </g>
+ <g systemLanguage="id">
+ <text x="20" y="220" xml:lang="id" font-size="18">Mengapa mereka tidak bisa bicara bahasa Indonesia ?</text>
+ <text x="230" y="150" xml:lang="en">Indonesian</text>
+ </g>
+ <g systemLanguage="is">
+ <text x="20" y="220" xml:lang="is" font-size="20">Hvers vegna geta þeir ekki réttlátur tala Íslenska ?</text>
+ <text x="230" y="150" xml:lang="en">Icelandic</text>
+ </g>
+ <g systemLanguage="it">
+ <text x="20" y="220" xml:lang="it" font-size="18">Perchè non possono semplicemente parlare italiano ?</text>
+ <text x="230" y="150" xml:lang="en">Italian</text>
+ </g>
+ <g systemLanguage="iu"&g