summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/path.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-26 04:34:25 +0000
committerTed Gould <ted@gould.cx>2010-03-26 04:34:25 +0000
commit9e023a3aa964a0d3fa1e31e46d33657367ba68aa (patch)
tree33f1392a340737e4eeefca6fd031f96c29befd2b /src/live_effects/parameter/path.cpp
parentInstalling the pkgconfig file (diff)
parentAdding in shape-record.h (diff)
downloadinkscape-9e023a3aa964a0d3fa1e31e46d33657367ba68aa.tar.gz
inkscape-9e023a3aa964a0d3fa1e31e46d33657367ba68aa.zip
Merge from trunk
(bzr r8254.1.53)
Diffstat (limited to 'src/live_effects/parameter/path.cpp')
-rw-r--r--src/live_effects/parameter/path.cpp37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index 33e50155c..d8d5b0a7c 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
@@ -40,6 +38,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 {
@@ -193,28 +195,35 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips)
}
void
-PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
+PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt)
{
- // If not already in nodecontext, goto it!
+ using namespace Inkscape::UI;
+
+ // TODO remove the tools_switch atrocity.
if (!tools_isactive(dt, TOOLS_NODES)) {
tools_switch(dt, TOOLS_NODES);
}
- ShapeEditor * shape_editor = dt->event_context->shape_editor;
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ std::set<ShapeRecord> shapes;
+ ShapeRecord r;
+
+ r.role = SHAPE_ROLE_LPE_PARAM;
+ r.edit_transform = sp_item_i2d_affine(item); // TODO is it right?
if (!href) {
- shape_editor->set_item_lpe_path_parameter(item, param_effect->getLPEObj(), param_key.c_str());
+ r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj());
+ r.lpe_key = param_key;
} else {
- // set referred item for editing
- shape_editor->set_item(ref.getObject(), SH_NODEPATH);
+ 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 *)
{
- np->show_helperpath = true;
- np->helperpath_rgba = 0x009000ff;
- np->helperpath_width = 1.0;
+ // TODO this method should not exist at all!
}
void
@@ -403,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"));
@@ -420,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;