From 31bb8269c26a781036448ed8f8cd93cc84fb2118 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 29 Nov 2009 16:33:18 +0100 Subject: First GSoC node tool commit to Bazaar (bzr r8846.1.1) --- src/live_effects/parameter/path.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 33e50155c..93dfd2667 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,23 +195,13 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) void PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) { - // If not already in nodecontext, goto it! - if (!tools_isactive(dt, TOOLS_NODES)) { - tools_switch(dt, TOOLS_NODES); - } - - ShapeEditor * shape_editor = dt->event_context->shape_editor; - if (!href) { - shape_editor->set_item_lpe_path_parameter(item, param_effect->getLPEObj(), param_key.c_str()); - } else { - // set referred item for editing - shape_editor->set_item(ref.getObject(), SH_NODEPATH); - } + // TODO this whole method is broken! } void PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) -{ +{ + // TODO this too! np->show_helperpath = true; np->helperpath_rgba = 0x009000ff; np->helperpath_width = 1.0; -- cgit v1.2.3 From e2b9f78d271e5fea988138d49020e704e72c83b1 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 8 Dec 2009 03:21:08 +0100 Subject: Fix LPEs and break mask transform undo (bzr r8846.2.3) --- src/live_effects/parameter/path.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 93dfd2667..3a03de51c 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -40,6 +40,10 @@ #include "sp-text.h" #include "display/curve.h" +#include "ui/tool/node-tool.h" +#include "ui/tool/multi-path-manipulator.h" +#include "ui/tool/shape-record.h" + namespace Inkscape { @@ -195,16 +199,33 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) void PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) { - // TODO this whole method is broken! + using namespace Inkscape::UI; + + // TODO remove the tools_switch atrocity. + if (!tools_isactive(dt, TOOLS_NODES)) { + tools_switch(dt, TOOLS_NODES); + } + + InkNodeTool *nt = static_cast(dt->event_context); + std::set shapes; + ShapeRecord r; + + r.role = SHAPE_ROLE_LPE_PARAM; + r.edit_transform = Geom::identity(); // TODO this is almost certainly wrong + if (!href) { + r.item = reinterpret_cast(param_effect->getLPEObj()); + r.lpe_key = param_key; + } else { + r.item = ref.getObject(); + } + shapes.insert(r); + nt->_multipath->setItems(shapes); } void -PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) +PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) { - // TODO this too! - np->show_helperpath = true; - np->helperpath_rgba = 0x009000ff; - np->helperpath_width = 1.0; + // TODO this method should not exist at all! } void -- cgit v1.2.3 From f542649162d6060f1f10513cc25e56c0f2736a13 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 24 Dec 2009 03:35:23 +0100 Subject: Remove remnants of old node tool (bzr r8846.2.6) --- src/live_effects/parameter/path.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 3a03de51c..43f4b5725 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -28,10 +28,8 @@ // needed for on-canvas editting: #include "tools-switch.h" #include "shape-editor.h" -#include "node-context.h" #include "desktop-handles.h" #include "selection.h" -#include "nodepath.h" // clipboard support #include "ui/clipboard.h" // required for linking to other paths -- cgit v1.2.3 From 2ab01d69f9d427bdf3536e1508a465372cd040c6 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 14 Jan 2010 17:02:46 -0800 Subject: Warning cleanup. (bzr r8981) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 43f4b5725..1ea9ac506 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,7 +195,7 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) } void -PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) +PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) { using namespace Inkscape::UI; @@ -222,7 +222,7 @@ PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt) void PathParam::param_setup_nodepath(Inkscape::NodePath::Path *) -{ +{ // TODO this method should not exist at all! } -- cgit v1.2.3 From 0283c65f9605dc7690e8b1f302a9754426a8b6c2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 22 Jan 2010 11:54:17 +0100 Subject: Fix some of the LPE issues. (bzr r9013) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 1ea9ac506..94540a255 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -195,7 +195,7 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips) } void -PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) +PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) { using namespace Inkscape::UI; @@ -209,7 +209,7 @@ PathParam::param_editOncanvas(SPItem * /*item*/, SPDesktop * dt) ShapeRecord r; r.role = SHAPE_ROLE_LPE_PARAM; - r.edit_transform = Geom::identity(); // TODO this is almost certainly wrong + r.edit_transform = sp_item_i2d_affine(item); // TODO is it right? if (!href) { r.item = reinterpret_cast(param_effect->getLPEObj()); r.lpe_key = param_key; -- cgit v1.2.3 From 847b4f57816ba691e471cf891beca6d263438f03 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 18 Mar 2010 23:21:16 -0700 Subject: Cleanup of SP_ACTIVE_DESKTOP to prepare clipboard code for reuse. (bzr r9209) --- src/live_effects/parameter/path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 94540a255..d8d5b0a7c 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -412,7 +412,7 @@ void PathParam::on_paste_button_click() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); - Glib::ustring svgd = cm->getPathParameter(); + Glib::ustring svgd = cm->getPathParameter(SP_ACTIVE_DESKTOP); paste_param_path(svgd.data()); sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Paste path parameter")); @@ -429,7 +429,7 @@ void PathParam::on_link_button_click() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); - Glib::ustring pathid = cm->getShapeOrTextObjectId(); + Glib::ustring pathid = cm->getShapeOrTextObjectId(SP_ACTIVE_DESKTOP); if (pathid == "") { return; -- cgit v1.2.3