X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fattributes-test.h;h=d6851a42b4a77147dd5a19180f15e20838b7eecf;hb=c596be6d145df956e779f427dde5aabc8559dd6c;hp=c71b8f04caf730d6f88e02109915070934bcfa88;hpb=a72861cd83f11ef8b1247abca181a3ad31df0307;p=inkscape.git diff --git a/src/attributes-test.h b/src/attributes-test.h index c71b8f04c..d6851a42b 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -5,7 +5,8 @@ #include #include -#include "utest/utest.h" +#include +#include #include "attributes.h" #include "streq.h" @@ -46,25 +47,25 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"marker", true}, {"line-height", true}, - {"accent-height", false}, + {"accent-height", true}, {"accumulate", true}, {"alignment-baseline", true}, - {"alphabetic", false}, - {"amplitude", false}, + {"alphabetic", true}, + {"amplitude", true}, {"animate", false}, - {"arabic-form", false}, - {"ascent", false}, + {"arabic-form", true}, + {"ascent", true}, {"attributeType", true}, - {"azimuth", false}, - {"baseFrequency", false}, + {"azimuth", true}, + {"baseFrequency", true}, {"baseline-shift", true}, {"baseProfile", false}, - {"bbox", false}, - {"bias", false}, + {"bbox", true}, + {"bias", true}, {"block-progression", true}, {"by", true}, {"calcMode", true}, - {"cap-height", false}, + {"cap-height", true}, {"class", false}, {"clip", true}, {"clip-path", true}, @@ -81,25 +82,35 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"cx", true}, {"cy", true}, {"d", true}, - {"descent", false}, - {"diffuseConstant", false}, + {"descent", true}, + {"diffuseConstant", true}, {"direction", true}, {"display", true}, - {"divisor", false}, + {"divisor", true}, {"dominant-baseline", true}, {"dur", true}, {"dx", true}, {"dy", true}, - {"edgeMode", false}, - {"elevation", false}, + {"edgeMode", true}, + {"elevation", true}, {"enable-background", true}, {"end", true}, - {"exponent", false}, + {"exponent", true}, {"externalResourcesRequired", false}, + {"feBlend", false}, {"feColorMatrix", false}, + {"feComponentTransfer", false}, {"feComposite", false}, + {"feConvolveMatrix", false}, + {"feDiffuseLighting", false}, + {"feDisplacementMap", false}, + {"feFlood", false}, {"feGaussianBlur", false}, + {"feImage", false}, + {"feMerge", false}, {"feMorphology", false}, + {"feOffset", false}, + {"feSpecularLighting", false}, {"feTile", false}, {"fill", true}, {"fill-opacity", true}, @@ -120,40 +131,40 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"from", true}, {"fx", true}, {"fy", true}, - {"g1", false}, - {"g2", false}, - {"glyph-name", false}, + {"g1", true}, + {"g2", true}, + {"glyph-name", true}, {"glyph-orientation-horizontal", true}, {"glyph-orientation-vertical", true}, {"glyphRef", false}, {"gradientTransform", true}, {"gradientUnits", true}, - {"hanging", false}, + {"hanging", true}, {"height", true}, - {"horiz-adv-x", false}, - {"horiz-origin-x", false}, - {"horiz-origin-y", false}, - {"ideographic", false}, + {"horiz-adv-x", true}, + {"horiz-origin-x", true}, + {"horiz-origin-y", true}, + {"ideographic", true}, {"image-rendering", true}, - {"in", false}, - {"in2", false}, - {"intercept", false}, - {"k", false}, - {"k1", false}, - {"k2", false}, - {"k3", false}, - {"k4", false}, - {"kernelMatrix", false}, - {"kernelUnitLength", false}, + {"in", true}, + {"in2", true}, + {"intercept", true}, + {"k", true}, + {"k1", true}, + {"k2", true}, + {"k3", true}, + {"k4", true}, + {"kernelMatrix", true}, + {"kernelUnitLength", true}, {"kerning", true}, {"keyPoints", false}, {"keySplines", true}, {"keyTimes", true}, - {"lang", false}, + {"lang", true}, {"lengthAdjust", false}, {"letter-spacing", true}, {"lighting-color", true}, - {"limitingConeAngle", false}, + {"limitingConeAngle", true}, {"local", true}, {"marker-end", true}, {"marker-mid", true}, @@ -164,14 +175,14 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"mask", true}, {"maskContentUnits", true}, {"maskUnits", true}, - {"mathematical", false}, + {"mathematical", true}, {"max", true}, {"media", false}, {"method", false}, {"min", true}, - {"mode", false}, + {"mode", true}, {"name", true}, - {"numOctaves", false}, + {"numOctaves", true}, {"offset", true}, {"onabort", false}, {"onactivate", false}, @@ -181,7 +192,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"onerror", false}, {"onfocusin", false}, {"onfocusout", false}, - {"onload", false}, + {"onload", true}, {"onmousedown", false}, {"onmousemove", false}, {"onmouseout", false}, @@ -193,15 +204,15 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"onunload", false}, {"onzoom", false}, {"opacity", true}, - {"operator", false}, - {"order", false}, + {"operator", true}, + {"order", true}, {"orient", true}, {"orientation", true}, {"origin", false}, {"overflow", true}, - {"overline-position", false}, - {"overline-thickness", false}, - {"panose-1", false}, + {"overline-position", true}, + {"overline-thickness", true}, + {"panose-1", true}, {"path", false}, {"pathLength", false}, {"patternContentUnits", true}, @@ -209,14 +220,14 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"patternUnits", true}, {"pointer-events", true}, {"points", true}, - {"pointsAtX", false}, - {"pointsAtY", false}, - {"pointsAtZ", false}, - {"preserveAlpha", false}, + {"pointsAtX", true}, + {"pointsAtY", true}, + {"pointsAtZ", true}, + {"preserveAlpha", true}, {"preserveAspectRatio", true}, {"primitiveUnits", true}, {"r", true}, - {"radius", false}, + {"radius", true}, {"refX", true}, {"refY", true}, {"rendering-intent", true}, @@ -225,27 +236,27 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"requiredFeatures", true}, {"requiredExtensions", true}, {"restart", true}, - {"result", false}, + {"result", true}, {"rotate", true}, {"rx", true}, {"ry", true}, - {"scale", false}, - {"seed", false}, + {"scale", true}, + {"seed", true}, {"shape-rendering", true}, - {"slope", false}, + {"slope", true}, {"spacing", false}, - {"specularConstant", false}, - {"specularExponent", false}, + {"specularConstant", true}, + {"specularExponent", true}, {"spreadMethod", true}, {"startOffset", true}, {"stdDeviation", true}, - {"stemh", false}, - {"stemv", false}, - {"stitchTiles", false}, + {"stemh", true}, + {"stemv", true}, + {"stitchTiles", true}, {"stop-color", true}, {"stop-opacity", true}, - {"strikethrough-position", false}, - {"strikethrough-thickness", false}, + {"strikethrough-position", true}, + {"strikethrough-thickness", true}, {"stroke", true}, {"stroke-dasharray", true}, {"stroke-dashoffset", true}, @@ -255,12 +266,12 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"stroke-opacity", true}, {"stroke-width", true}, {"style", true}, - {"surfaceScale", false}, + {"surfaceScale", true}, {"systemLanguage", true}, - {"tableValues", false}, + {"tableValues", true}, {"target", true}, - {"targetX", false}, - {"targetY", false}, + {"targetX", true}, + {"targetY", true}, {"text-align", true}, {"text-anchor", true}, {"text-decoration", true}, @@ -272,35 +283,35 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"to", true}, {"transform", true}, {"type", true}, - {"u1", false}, - {"u2", false}, - {"underline-position", false}, - {"underline-thickness", false}, - {"unicode", false}, + {"u1", true}, + {"u2", true}, + {"underline-position", true}, + {"underline-thickness", true}, + {"unicode", true}, {"unicode-bidi", true}, - {"unicode-range", false}, - {"units-per-em", false}, - {"v-alphabetic", false}, - {"v-hanging", false}, - {"v-ideographic", false}, - {"v-mathematical", false}, + {"unicode-range", true}, + {"units-per-em", true}, + {"v-alphabetic", true}, + {"v-hanging", true}, + {"v-ideographic", true}, + {"v-mathematical", true}, {"values", true}, {"version", true}, - {"vert-adv-y", false}, - {"vert-origin-x", false}, - {"vert-origin-y", false}, + {"vert-adv-y", true}, + {"vert-origin-x", true}, + {"vert-origin-y", true}, {"viewBox", true}, {"viewTarget", false}, {"visibility", true}, {"width", true}, - {"widths", false}, + {"widths", true}, {"word-spacing", true}, {"writing-mode", true}, {"x", true}, - {"x-height", false}, + {"x-height", true}, {"x1", true}, {"x2", true}, - {"xChannelSelector", false}, + {"xChannelSelector", true}, {"xlink:actuate", true}, {"xlink:arcrole", true}, {"xlink:href", true}, @@ -315,8 +326,8 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"y", true}, {"y1", true}, {"y2", true}, - {"yChannelSelector", false}, - {"z", false}, + {"yChannelSelector", true}, + {"z", true}, {"zoomAndPan", false}, /* Extra attributes. */ @@ -329,12 +340,29 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:groupmode", true}, {"sodipodi:version", true}, {"inkscape:version", true}, - {"inkscape:object-bbox", true}, - {"inkscape:object-points", true}, {"inkscape:object-paths", true}, {"inkscape:object-nodes", true}, + {"inkscape:bbox-paths", true}, + {"inkscape:bbox-nodes", true}, + {"inkscape:snap-page", true}, + {"inkscape:snap-global", true}, + {"inkscape:snap-bbox", true}, + {"inkscape:snap-nodes", true}, + {"inkscape:snap-from-guide", true}, + {"inkscape:snap-center", true}, + {"inkscape:snap-smooth-nodes", true}, + {"inkscape:snap-midpoints", true}, + {"inkscape:snap-object-midpoints", true}, + {"inkscape:snap-bbox-edge-midpoints", true}, + {"inkscape:snap-bbox-midpoints", true}, + //{"inkscape:snap-intersection-grid-guide", true}, + {"inkscape:snap-grids", true}, + {"inkscape:snap-to-guides", true}, + {"inkscape:snap-intersection-paths", true}, + {"inkscape:original-d", true}, {"inkscape:pageopacity", true}, {"inkscape:pageshadow", true}, + {"inkscape:path-effect", true}, {"inkscape:transform-center-x", true}, {"inkscape:transform-center-y", true}, {"inkscape:zoom", true}, @@ -344,10 +372,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:window-height", true}, {"inkscape:window-x", true}, {"inkscape:window-y", true}, - {"inkscape:grid-bbox", true}, - {"inkscape:guide-bbox", true}, - {"inkscape:grid-points", true}, - {"inkscape:guide-points", true}, + {"inkscape:window-maximized", true}, {"inkscape:current-layer", true}, {"inkscape:connector-type", true}, {"inkscape:connection-start", true}, @@ -358,6 +383,15 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"sodipodi:cy", true}, {"sodipodi:rx", true}, {"sodipodi:ry", true}, + {"inkscape:perspectiveID", true}, + {"inkscape:corner0", true}, + {"inkscape:corner7", true}, + {"inkscape:box3dsidetype", true}, + {"inkscape:persp3d", true}, + {"inkscape:vp_x", true}, + {"inkscape:vp_y", true}, + {"inkscape:vp_z", true}, + {"inkscape:persp3d-origin", true}, {"sodipodi:start", true}, {"sodipodi:end", true}, {"sodipodi:open", true}, @@ -392,20 +426,22 @@ struct {char const *attr; bool supported;} const all_attrs[] = { /* SPNamedView */ {"viewonly", true}, {"showgrid", true}, +// {"gridtype", true}, {"showguides", true}, {"gridtolerance", true}, {"guidetolerance", true}, {"objecttolerance", true}, - {"has_abs_tolerance", true}, - {"gridoriginx", true}, +/* {"gridoriginx", true}, {"gridoriginy", true}, {"gridspacingx", true}, {"gridspacingy", true}, + {"gridanglex", true}, + {"gridanglez", true}, {"gridcolor", true}, {"gridopacity", true}, {"gridempcolor", true}, {"gridempopacity", true}, - {"gridempspacing", true}, + {"gridempspacing", true}, */ {"guidecolor", true}, {"guideopacity", true}, {"guidehicolor", true}, @@ -473,11 +509,20 @@ struct {char const *attr; bool supported;} const all_attrs[] = { unsigned const n_ids = ids.size(); for (unsigned id = 1; id < n_ids; ++id) { if (!ids[id]) { - TS_WARN( std::string((const char*)sp_attribute_name(id)) ); + gchar* tmp = g_strdup_printf( "Attribute string with enum %d {%s} not handled", id, sp_attribute_name(id) ); + TS_WARN( std::string((const char*)tmp) ); + g_free( tmp ); found = true; } } TS_ASSERT(!found); + + for ( unsigned int index = 1; index < n_ids; index++ ) { + guchar const* name = sp_attribute_name(index); + unsigned int postLookup = sp_attribute_lookup( reinterpret_cast(name) ); + TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup ); + } + } };