diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-11 17:24:16 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-11 17:24:16 +0000 |
| commit | 73332a695054f5a550137df93d87c4208d966cbf (patch) | |
| tree | cf1efa8fbb8dba8085ae006d9f50f5984a46867d /src | |
| parent | Apply patch for broken automake (diff) | |
| parent | A little cleaning up of attributes. (diff) | |
| download | inkscape-73332a695054f5a550137df93d87c4208d966cbf.tar.gz inkscape-73332a695054f5a550137df93d87c4208d966cbf.zip | |
Merge changes from trunk
(bzr r14949.1.10)
Diffstat (limited to 'src')
| -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/live_effects/effect.cpp | 1 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 28 | ||||
| -rw-r--r-- | src/sp-item.cpp | 1 | ||||
| -rw-r--r-- | src/style-internal.h | 2 |
7 files changed, 120 insertions, 78 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/live_effects/effect.cpp b/src/live_effects/effect.cpp index 732c67304..1868ca43b 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -714,6 +714,7 @@ Effect::getParameter(const char * key) { Glib::ustring stringkey(key); + if (param_vector.empty()) return NULL; std::vector<Parameter *>::iterator it = param_vector.begin(); while (it != param_vector.end()) { Parameter * param = *it; diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 7ea1d465c..bed191e83 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -73,7 +73,21 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip, PathParam::~PathParam() { remove_link(); - + using namespace Inkscape::UI; + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if (desktop) { + if (tools_isactive(desktop, TOOLS_NODES)) { + SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem(); + if (item != NULL) { + Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(desktop->event_context); + std::set<ShapeRecord> shapes; + ShapeRecord r; + r.item = item; + shapes.insert(r); + nt->_multipath->setItems(shapes); + } + } + } g_free(defvalue); } @@ -207,6 +221,9 @@ PathParam::param_newWidget() void PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) { + SPDocument *document = dt->getDocument(); + bool saved = DocumentUndo::getUndoSensitive(document); + DocumentUndo::setUndoSensitive(document, false); using namespace Inkscape::UI; // TODO remove the tools_switch atrocity. @@ -220,14 +237,20 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) r.role = SHAPE_ROLE_LPE_PARAM; r.edit_transform = item->i2dt_affine(); // TODO is it right? + r.edit_transform *= item->transform.inverse(); if (!href) { r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj()); r.lpe_key = param_key; + Geom::PathVector stored_pv = _pathvector; + param_write_to_repr("M0,0 L1,0"); + const char *svgd = sp_svg_write_path(stored_pv); + param_write_to_repr(svgd); } else { r.item = ref.getObject(); } shapes.insert(r); nt->_multipath->setItems(shapes); + DocumentUndo::setUndoSensitive(document, saved); } void @@ -435,7 +458,8 @@ PathParam::paste_param_path(const char *svgd) SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem(); if (item != NULL) { Geom::PathVector path_clipboard = sp_svg_read_pathv(svgd); - path_clipboard *= item->i2doc_affine().inverse(); + path_clipboard *= item->i2doc_affine().inverse() * item->transform; + path_clipboard *= Geom::Translate(path_clipboard.initialPoint() - _pathvector.initialPoint()).inverse(); svgd = sp_svg_write_path( path_clipboard ); } 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" ); diff --git a/src/style-internal.h b/src/style-internal.h index 767552784..6cc8c6c4e 100644 --- a/src/style-internal.h +++ b/src/style-internal.h @@ -520,7 +520,7 @@ public: {} SPIEnumBits( Glib::ustring const &name, SPStyleEnum const *enums, unsigned value = 0, bool inherits = true ) : - SPIEnum( name, enums, value, inherit ) + SPIEnum( name, enums, value, inherits ) {} virtual ~SPIEnumBits() |
