Code

Allow snapping from and to ellipses
[inkscape.git] / src / attributes-test.h
index d82b14df81e88073cb4160759b7aa61abdbcffea..cdc82a475aa98ec4f1aca5274556b75e8f144d3e 100644 (file)
@@ -5,6 +5,8 @@
 #include <cxxtest/TestSuite.h>
 
 #include <vector>
+#include <glib.h>
+#include <glib/gprintf.h>
 #include "utest/utest.h"
 #include "attributes.h"
 #include "streq.h"
@@ -55,7 +57,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"arabic-form", false},
     {"ascent", false},
     {"attributeType", true},
-    {"azimuth", false},
+    {"azimuth", true},
     {"baseFrequency", true},
     {"baseline-shift", true},
     {"baseProfile", false},
@@ -91,7 +93,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"dx", true},
     {"dy", true},
     {"edgeMode", true},
-    {"elevation", false},
+    {"elevation", true},
     {"enable-background", true},
     {"end", true},
     {"exponent", true},
@@ -145,7 +147,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"horiz-origin-y", false},
     {"ideographic", false},
     {"image-rendering", true},
-    {"in", false},
+    {"in", true},
     {"in2", true},
     {"intercept", true},
     {"k", false},
@@ -163,7 +165,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"lengthAdjust", false},
     {"letter-spacing", true},
     {"lighting-color", true},
-    {"limitingConeAngle", false},
+    {"limitingConeAngle", true},
     {"local", true},
     {"marker-end", true},
     {"marker-mid", true},
@@ -219,9 +221,9 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"patternUnits", true},
     {"pointer-events", true},
     {"points", true},
-    {"pointsAtX", false},
-    {"pointsAtY", false},
-    {"pointsAtZ", false},
+    {"pointsAtX", true},
+    {"pointsAtY", true},
+    {"pointsAtZ", true},
     {"preserveAlpha", true},
     {"preserveAspectRatio", true},
     {"primitiveUnits", true},
@@ -235,7 +237,7 @@ 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},
@@ -326,7 +328,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"y1", true},
     {"y2", true},
     {"yChannelSelector", true},
-    {"z", false},
+    {"z", true},
     {"zoomAndPan", false},
 
     /* Extra attributes. */
@@ -339,10 +341,17 @@ 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-global", true},
+    {"inkscape:snap-bbox", true},
+    {"inkscape:snap-nodes", true},
+    {"inkscape:snap-guide", true},
+    {"inkscape:snap-center", true},
+    {"inkscape:snap-intersection-grid-guide", true},
+    {"inkscape:snap-intersection-line-segments", true},
     {"inkscape:pageopacity", true},
     {"inkscape:pageshadow", true},
     {"inkscape:transform-center-x", true},
@@ -354,10 +363,6 @@ 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:current-layer", true},
     {"inkscape:connector-type", true},
     {"inkscape:connection-start", true},
@@ -368,6 +373,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},
@@ -402,12 +416,12 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     /* SPNamedView */
     {"viewonly", true},
     {"showgrid", true},
-    {"gridtype", true},
+//    {"gridtype", true},
     {"showguides", true},
     {"gridtolerance", true},
     {"guidetolerance", true},
     {"objecttolerance", true},
-    {"gridoriginx", true},
+/*    {"gridoriginx", true},
     {"gridoriginy", true},
     {"gridspacingx", true},
     {"gridspacingy", true},
@@ -417,7 +431,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"gridopacity", true},
     {"gridempcolor", true},
     {"gridempopacity", true},
-    {"gridempspacing", true},
+    {"gridempspacing", true}, */
     {"guidecolor", true},
     {"guideopacity", true},
     {"guidehicolor", true},
@@ -485,11 +499,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 ( guint index = 1; index < n_ids; index++ ) {
+            guchar const* name = sp_attribute_name(index);
+            gint postLookup = sp_attribute_lookup( reinterpret_cast<gchar const*>(name) );
+            TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup );
+        }
+
     }
 };