summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter
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
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')
-rw-r--r--src/live_effects/parameter/path.cpp37
-rw-r--r--src/live_effects/parameter/vector.cpp30
2 files changed, 36 insertions, 31 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;
diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp
index 35afe7f5d..5496b52f2 100644
--- a/src/live_effects/parameter/vector.cpp
+++ b/src/live_effects/parameter/vector.cpp
@@ -13,8 +13,9 @@
#include "svg/stringstream.h"
#include <gtkmm.h>
-// needed for on-canvas editting:
-class SPDesktop;
+#include "ui/widget/registered-widget.h"
+#include "live_effects/effect.h"
+#include "desktop.h"
namespace Inkscape {
@@ -82,28 +83,23 @@ VectorParam::param_getSVGValue() const
Gtk::Widget *
VectorParam::param_newWidget(Gtk::Tooltips * /*tooltips*/)
{
-/*
- Inkscape::UI::Widget::RegisteredTransformedPoint * pointwdg = Gtk::manage(
- new Inkscape::UI::Widget::RegisteredTransformedPoint( param_label,
- param_tooltip,
- param_key,
- *param_wr,
- param_effect->getRepr(),
- param_effect->getSPDoc() ) );
- // TODO: fix to get correct desktop (don't use SP_ACTIVE_DESKTOP)
- SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Geom::Matrix transf = desktop->doc2dt();
- pointwdg->setTransform(transf);
- pointwdg->setValue( *this );
+ Inkscape::UI::Widget::RegisteredVector * pointwdg = Gtk::manage(
+ new Inkscape::UI::Widget::RegisteredVector( param_label,
+ param_tooltip,
+ param_key,
+ *param_wr,
+ param_effect->getRepr(),
+ param_effect->getSPDoc() ) );
+ pointwdg->setPolarCoords();
+ pointwdg->setValue( vector, origin );
pointwdg->clearProgrammatically();
- pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter"));
+ pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change vector parameter"));
Gtk::HBox * hbox = Gtk::manage( new Gtk::HBox() );
static_cast<Gtk::HBox*>(hbox)->pack_start(*pointwdg, true, true);
static_cast<Gtk::HBox*>(hbox)->show_all_children();
return dynamic_cast<Gtk::Widget *> (hbox);
- */ return NULL;
}
void