diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-06-11 14:25:52 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-06-11 14:25:52 +0000 |
| commit | 3b39f6fb0fac1eb0457de170a9af7b7ad629bc71 (patch) | |
| tree | 00c1f7790d3c689e8a1ed6e40e10309c7c979da8 | |
| parent | Fix a typo that spawned a lot of "unused parameter" warnings when compiling (diff) | |
| download | inkscape-3b39f6fb0fac1eb0457de170a9af7b7ad629bc71.tar.gz inkscape-3b39f6fb0fac1eb0457de170a9af7b7ad629bc71.zip | |
A little cleaning up of attributes.
(bzr r14977)
| -rw-r--r-- | src/attributes-test.h | 105 | ||||
| -rw-r--r-- | src/attributes.cpp | 30 | ||||
| -rw-r--r-- | src/attributes.h | 31 | ||||
| -rw-r--r-- | src/sp-item.cpp | 1 |
4 files changed, 92 insertions, 75 deletions
diff --git a/src/attributes-test.h b/src/attributes-test.h index b8d5d98a5..bfb67064b 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -104,21 +104,6 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"end", true}, {"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}, {"fill-rule", true}, @@ -361,55 +346,33 @@ struct {char const *attr; bool supported;} const all_attrs[] = { /* Extra attributes. */ {"id", true}, + {"sodipodi:docname", true}, + {"sodipodi:insensitive", true}, + {"sodipodi:type", true}, {"inkscape:collect", true}, {"inkscape:document-units", true}, {"inkscape:label", true}, - {"sodipodi:insensitive", true}, - {"sodipodi:nonprintable", true}, {"inkscape:groupmode", true}, - {"sodipodi:version", false}, {"inkscape:version", true}, {"inkscape:object-paths", true}, - {"inkscape:snap-perpendicular", true}, - {"inkscape:snap-tangential", true}, - {"inkscape:snap-path-clip", true}, - {"inkscape:snap-path-mask", 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-others", true}, - {"inkscape:snap-center", true}, - {"inkscape:snap-smooth-nodes", true}, - {"inkscape:snap-midpoints", true}, - {"inkscape:snap-object-midpoints", true}, - {"inkscape:snap-text-baseline", true}, - {"inkscape:snap-bbox-edge-midpoints", true}, - {"inkscape:snap-bbox-midpoints", 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}, + // SPItem {"inkscape:transform-center-x", true}, {"inkscape:transform-center-y", true}, {"inkscape:highlight-color", true}, - // Namedview - {"inkscape:zoom", true}, - {"inkscape:cx", true}, - {"inkscape:cy", true}, - {"inkscape:window-width", true}, - {"inkscape:window-height", true}, - {"inkscape:window-x", true}, - {"inkscape:window-y", true}, - {"inkscape:window-maximized", true}, - {"inkscape:current-layer", true}, + + // Measure tool + {"inkscape:measure-start", true}, + {"inkscape:measure-end", true}, + + // Spray tool + {"inkscape:spray-origin", true}, + // Connector tool {"inkscape:connector-type", true}, {"inkscape:connection-start", true}, @@ -420,11 +383,13 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:connector-curvature", true}, {"inkscape:connector-avoid", true}, {"inkscape:connector-spacing", true}, + // Ellipse, Spiral, Star {"sodipodi:cx", true}, {"sodipodi:cy", true}, {"sodipodi:rx", true}, {"sodipodi:ry", true}, + // Box tool {"inkscape:perspectiveID", true}, {"inkscape:corner0", true}, @@ -435,6 +400,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:vp_y", true}, {"inkscape:vp_z", true}, {"inkscape:persp3d-origin", true}, + // Star tool {"sodipodi:start", true}, {"sodipodi:end", true}, @@ -517,8 +483,47 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"borderopacity", true}, {"pagecolor", true}, + {"inkscape:zoom", true}, + {"inkscape:cx", true}, + {"inkscape:cy", true}, + {"inkscape:window-width", true}, + {"inkscape:window-height", true}, + {"inkscape:window-x", true}, + {"inkscape:window-y", true}, + {"inkscape:window-maximized", true}, + {"inkscape:current-layer", true}, + {"inkscape:pagecheckerboard", true}, + /* SPGuide */ {"position", true}, + {"inkscape:color", true}, + {"inkscape:lockguides", true}, + {"inkscape:locked", true}, + + /* Snapping */ + {"inkscape:snap-perpendicular", true}, + {"inkscape:snap-tangential", true}, + {"inkscape:snap-path-clip", true}, + {"inkscape:snap-path-mask", 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-others", 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-text-baseline", true}, + {"inkscape:snap-bbox-edge-midpoints", true}, + {"inkscape:snap-bbox-midpoints", true}, + {"inkscape:snap-grids", true}, + {"inkscape:snap-to-guides", true}, + {"inkscape:snap-intersection-paths", true}, /* SPTag */ {"inkscape:expanded", true} diff --git a/src/attributes.cpp b/src/attributes.cpp index 646c2ab0c..24c16d5fc 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -14,6 +14,7 @@ #include <glib.h> // g_assert() #include "attributes.h" +#include <iostream> typedef struct { gint code; @@ -28,15 +29,24 @@ static SPStyleProp const props[] = { {SP_ATTR_INVALID, NULL}, /* SPObject */ {SP_ATTR_ID, "id"}, + {SP_ATTR_STYLE, "style"}, {SP_ATTR_INKSCAPE_COLLECT, "inkscape:collect"}, {SP_ATTR_INKSCAPE_LABEL, "inkscape:label"}, + /* SPRoot */ + {SP_ATTR_VERSION, "version"}, + {SP_ATTR_INKSCAPE_VERSION, "inkscape:version"}, + {SP_ATTR_WIDTH, "width"}, + {SP_ATTR_HEIGHT, "height"}, + {SP_ATTR_VIEWBOX, "viewBox"}, + {SP_ATTR_PRESERVEASPECTRATIO, "preserveAspectRatio"}, + {SP_ATTR_ONLOAD, "onload"}, + {SP_ATTR_SODIPODI_DOCNAME, "sodipodi:docname"}, /* SPItem */ {SP_ATTR_TRANSFORM, "transform"}, + {SP_ATTR_SODIPODI_TYPE, "sodipodi:type"}, {SP_ATTR_SODIPODI_INSENSITIVE, "sodipodi:insensitive"}, - {SP_ATTR_SODIPODI_NONPRINTABLE, "sodipodi:nonprintable"}, {SP_ATTR_CONNECTOR_AVOID, "inkscape:connector-avoid"}, {SP_ATTR_CONNECTION_POINTS, "inkscape:connection-points"}, - {SP_ATTR_STYLE, "style"}, {SP_ATTR_TRANSFORM_CENTER_X, "inkscape:transform-center-x"}, {SP_ATTR_TRANSFORM_CENTER_Y, "inkscape:transform-center-y"}, {SP_ATTR_INKSCAPE_PATH_EFFECT, "inkscape:path-effect"}, @@ -53,14 +63,6 @@ static SPStyleProp const props[] = { {SP_ATTR_TARGET, "target"}, {SP_ATTR_INKSCAPE_GROUPMODE, "inkscape:groupmode"}, {SP_ATTR_INKSCAPE_EXPANDED, "inkscape:expanded"}, - /* SPRoot */ - {SP_ATTR_VERSION, "version"}, - {SP_ATTR_WIDTH, "width"}, - {SP_ATTR_HEIGHT, "height"}, - {SP_ATTR_VIEWBOX, "viewBox"}, - {SP_ATTR_PRESERVEASPECTRATIO, "preserveAspectRatio"}, - {SP_ATTR_INKSCAPE_VERSION, "inkscape:version"}, - {SP_ATTR_ONLOAD, "onload"}, /* SPNamedView */ {SP_ATTR_VIEWONLY, "viewonly"}, {SP_ATTR_SHOWGUIDES, "showguides"}, @@ -99,6 +101,7 @@ static SPStyleProp const props[] = { {SP_ATTR_INKSCAPE_SNAP_BBOX, "inkscape:snap-bbox"}, {SP_ATTR_INKSCAPE_SNAP_NODE, "inkscape:snap-nodes"}, {SP_ATTR_INKSCAPE_SNAP_OTHERS, "inkscape:snap-others"}, + {SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, "inkscape:snap-from-guide"}, {SP_ATTR_INKSCAPE_SNAP_ROTATION_CENTER, "inkscape:snap-center"}, {SP_ATTR_INKSCAPE_SNAP_GRID, "inkscape:snap-grids"}, {SP_ATTR_INKSCAPE_SNAP_GUIDE, "inkscape:snap-to-guides"}, @@ -120,7 +123,6 @@ static SPStyleProp const props[] = { {SP_ATTR_INKSCAPE_DOCUMENT_UNITS, "inkscape:document-units"}, // This setting sets the Display units, *not* the units used in SVG {SP_ATTR_INKSCAPE_LOCKGUIDES, "inkscape:lockguides"}, {SP_ATTR_UNITS, "units"}, - {SP_ATTR_INKSCAPE_CONNECTOR_SPACING, "inkscape:connector-spacing"}, /* SPColorProfile */ {SP_ATTR_LOCAL, "local"}, {SP_ATTR_NAME, "name"}, @@ -130,6 +132,9 @@ static SPStyleProp const props[] = { {SP_ATTR_POSITION, "position"}, {SP_ATTR_INKSCAPE_COLOR, "inkscape:color"}, {SP_ATTR_INKSCAPE_LOCKED, "inkscape:locked"}, + /* Measure tool */ + {SP_ATTR_INKSCAPE_MEASURE_START, "inkscape:measure-start"}, + {SP_ATTR_INKSCAPE_MEASURE_END, "inkscape:measure-end"}, /* SPImage */ {SP_ATTR_X, "x"}, {SP_ATTR_Y, "y"}, @@ -139,6 +144,7 @@ static SPStyleProp const props[] = { /* (Note: XML representation of connectors may change in future.) */ {SP_ATTR_CONNECTOR_TYPE, "inkscape:connector-type"}, {SP_ATTR_CONNECTOR_CURVATURE, "inkscape:connector-curvature"}, + {SP_ATTR_INKSCAPE_CONNECTOR_SPACING, "inkscape:connector-spacing"}, {SP_ATTR_CONNECTION_START, "inkscape:connection-start"}, {SP_ATTR_CONNECTION_END, "inkscape:connection-end"}, {SP_ATTR_CONNECTION_START_POINT, "inkscape:connection-start-point"}, @@ -544,6 +550,8 @@ sp_attribute_lookup(gchar const *key) if(g_str_equal(const_cast<void *>(static_cast<void const *>(props[i].name)), key)) return GPOINTER_TO_UINT(GINT_TO_POINTER(props[i].code)); } + // std::cerr << "sp_attribute_lookup: invalid attribute: " + // << (key?key:"Null") << std::endl; return SP_ATTR_INVALID; } diff --git a/src/attributes.h b/src/attributes.h index f5544d0a1..e82db5f2a 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -28,15 +28,24 @@ enum SPAttributeEnum { SP_ATTR_INVALID, ///< Must have value 0. /* SPObject */ SP_ATTR_ID, + SP_ATTR_STYLE, SP_ATTR_INKSCAPE_COLLECT, SP_ATTR_INKSCAPE_LABEL, + /* SPRoot Put these near top as the apply to the entire SVG */ + SP_ATTR_VERSION, + SP_ATTR_INKSCAPE_VERSION, + SP_ATTR_WIDTH, + SP_ATTR_HEIGHT, + SP_ATTR_VIEWBOX, + SP_ATTR_PRESERVEASPECTRATIO, + SP_ATTR_ONLOAD, + SP_ATTR_SODIPODI_DOCNAME, /* SPItem */ SP_ATTR_TRANSFORM, + SP_ATTR_SODIPODI_TYPE, SP_ATTR_SODIPODI_INSENSITIVE, - SP_ATTR_SODIPODI_NONPRINTABLE, SP_ATTR_CONNECTOR_AVOID, SP_ATTR_CONNECTION_POINTS, - SP_ATTR_STYLE, SP_ATTR_TRANSFORM_CENTER_X, SP_ATTR_TRANSFORM_CENTER_Y, SP_ATTR_INKSCAPE_PATH_EFFECT, @@ -54,14 +63,6 @@ enum SPAttributeEnum { /* SPGroup */ SP_ATTR_INKSCAPE_GROUPMODE, SP_ATTR_INKSCAPE_EXPANDED, - /* SPRoot */ - SP_ATTR_VERSION, - SP_ATTR_WIDTH, - SP_ATTR_HEIGHT, - SP_ATTR_VIEWBOX, - SP_ATTR_PRESERVEASPECTRATIO, - SP_ATTR_INKSCAPE_VERSION, - SP_ATTR_ONLOAD, /* SPNamedView */ SP_ATTR_VIEWONLY, SP_ATTR_SHOWGUIDES, @@ -100,7 +101,7 @@ enum SPAttributeEnum { SP_ATTR_INKSCAPE_SNAP_BBOX, SP_ATTR_INKSCAPE_SNAP_NODE, SP_ATTR_INKSCAPE_SNAP_OTHERS, - //SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, + SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, SP_ATTR_INKSCAPE_SNAP_ROTATION_CENTER, SP_ATTR_INKSCAPE_SNAP_GRID, SP_ATTR_INKSCAPE_SNAP_GUIDE, @@ -122,7 +123,6 @@ enum SPAttributeEnum { SP_ATTR_INKSCAPE_DOCUMENT_UNITS, SP_ATTR_INKSCAPE_LOCKGUIDES, SP_ATTR_UNITS, - SP_ATTR_INKSCAPE_CONNECTOR_SPACING, /* SPColorProfile */ SP_ATTR_LOCAL, SP_ATTR_NAME, @@ -132,7 +132,10 @@ enum SPAttributeEnum { SP_ATTR_POSITION, SP_ATTR_INKSCAPE_COLOR, SP_ATTR_INKSCAPE_LOCKED, - /* SPImage */ + /* Measure tool */ + SP_ATTR_INKSCAPE_MEASURE_START, + SP_ATTR_INKSCAPE_MEASURE_END, + /* SPImage, SPRect, etc. */ SP_ATTR_X, SP_ATTR_Y, /* SPPath */ @@ -140,6 +143,7 @@ enum SPAttributeEnum { SP_ATTR_INKSCAPE_ORIGINAL_D, SP_ATTR_CONNECTOR_TYPE, SP_ATTR_CONNECTOR_CURVATURE, + SP_ATTR_INKSCAPE_CONNECTOR_SPACING, SP_ATTR_CONNECTION_START, SP_ATTR_CONNECTION_END, SP_ATTR_CONNECTION_START_POINT, @@ -334,6 +338,7 @@ enum SPAttributeEnum { SP_ATTR_RESTART, SP_ATTR_REPEATCOUNT, SP_ATTR_REPEATDUR, + /* Interpolating animations */ SP_ATTR_CALCMODE, //SP_ATTR_VALUES, diff --git a/src/sp-item.cpp b/src/sp-item.cpp index af81194c2..9fd6e8ecc 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -399,7 +399,6 @@ void SPItem::build(SPDocument *document, Inkscape::XML::Node *repr) { object->readAttr( "clip-path" ); object->readAttr( "mask" ); object->readAttr( "sodipodi:insensitive" ); - object->readAttr( "sodipodi:nonprintable" ); object->readAttr( "inkscape:transform-center-x" ); object->readAttr( "inkscape:transform-center-y" ); object->readAttr( "inkscape:connector-avoid" ); |
