summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-02 13:38:15 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-02 13:38:15 +0000
commitacae310d49358ac8de885fa8692caf5e4067574c (patch)
treeb19affe735ea558718e378184a11031bbe44c328 /src/live_effects
parentwarning cleanup (diff)
downloadinkscape-acae310d49358ac8de885fa8692caf5e4067574c.tar.gz
inkscape-acae310d49358ac8de885fa8692caf5e4067574c.zip
NEW: temporary on-canvas indicators
(bzr r4918)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/effect.h3
-rw-r--r--src/live_effects/lpe-test-doEffect-stack.cpp4
-rw-r--r--src/live_effects/lpe-test-doEffect-stack.h2
-rw-r--r--src/live_effects/parameter/point.cpp37
4 files changed, 34 insertions, 12 deletions
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index fb5e85b1b..6b5295071 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -19,7 +19,7 @@
#define LPE_CONVERSION_TOLERANCE 0.01 // FIXME: find good solution for this.
-//#define LPE_ENABLE_TEST_EFFECTS
+#define LPE_ENABLE_TEST_EFFECTS
struct SPDocument;
struct SPDesktop;
@@ -117,7 +117,6 @@ protected:
std::vector<Parameter *> param_vector;
int oncanvasedit_it;
-
Inkscape::UI::Widget::Registry wr;
LivePathEffectObject *lpeobj;
diff --git a/src/live_effects/lpe-test-doEffect-stack.cpp b/src/live_effects/lpe-test-doEffect-stack.cpp
index f6ecad562..f20ce8cec 100644
--- a/src/live_effects/lpe-test-doEffect-stack.cpp
+++ b/src/live_effects/lpe-test-doEffect-stack.cpp
@@ -18,9 +18,11 @@ namespace LivePathEffect {
LPEdoEffectStackTest::LPEdoEffectStackTest(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
- step(_("Stack step"), (""), "step", &wr, this)
+ step(_("Stack step"), (""), "step", &wr, this),
+ point(_("point param"), "", "point_param", &wr, this)
{
registerParameter( dynamic_cast<Parameter *>(&step) );
+ registerParameter( dynamic_cast<Parameter *>(&point) );
}
LPEdoEffectStackTest::~LPEdoEffectStackTest()
diff --git a/src/live_effects/lpe-test-doEffect-stack.h b/src/live_effects/lpe-test-doEffect-stack.h
index 3d853aa8c..1417512d1 100644
--- a/src/live_effects/lpe-test-doEffect-stack.h
+++ b/src/live_effects/lpe-test-doEffect-stack.h
@@ -15,6 +15,7 @@
#include "live_effects/effect.h"
#include "live_effects/parameter/parameter.h"
+#include "live_effects/parameter/point.h"
namespace Inkscape {
namespace LivePathEffect {
@@ -31,6 +32,7 @@ public:
private:
ScalarParam step;
+ PointParam point;
LPEdoEffectStackTest(const LPEdoEffectStackTest&);
LPEdoEffectStackTest& operator=(const LPEdoEffectStackTest&);
diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp
index 1859a0a09..38bf4be57 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -14,22 +14,23 @@
#include "ui/widget/point.h"
#include "widgets/icon.h"
#include "ui/widget/registered-widget.h"
-#include "knot.h"
#include "inkscape.h"
#include "verbs.h"
// 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 "shape-editor.h"
#include "desktop.h"
+#include "selection.h"
-#define LPEPOINTPARAM_DEBUG // undefine to disable all on-canvas editing code for PointParam
+// temporarily needed for tempitem tryout
+#include "desktop-handles.h"
+#include "display/sodipodi-ctrl.h"
+#include "knot.h"
+#include "display/canvas-temporary-item-list.h"
-#define PRM_KNOT_COLOR_NORMAL 0xffffff00
-#define PRM_KNOT_COLOR_SELECTED 0x0000ff00
+#define LPEPOINTPARAM_DEBUG // undefine to disable all on-canvas editing code for PointParam
namespace Inkscape {
@@ -93,6 +94,7 @@ PointParam::param_newWidget(Gtk::Tooltips * tooltips)
param_effect->getRepr(),
param_effect->getSPDoc() ) );
pointwdg->setValue( (*this)[0], (*this)[1] );
+ pointwdg->clearProgrammatically();
pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter"));
Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( "draw_node", Inkscape::ICON_SIZE_BUTTON) );
@@ -142,6 +144,22 @@ PointParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
ShapeEditor * shape_editor = SP_NODE_CONTEXT( dt->event_context )->shape_editor;
shape_editor->set_item_lpe_point_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
+
+
+ /* TEMPORARY CODE TO TEST TEMPORARY CANVAS ITEMS */
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (desktop),
+ SP_TYPE_CTRL,
+ "anchor", GTK_ANCHOR_CENTER,
+ "size", 8.0,
+ "stroked", TRUE,
+ "stroke_color", 0xf000f0ff,
+ "mode", SP_KNOT_MODE_XOR,
+ "shape", SP_KNOT_SHAPE_CROSS,
+ NULL );
+ SP_CTRL(canvasitem)->moveto ( static_cast<Geom::Point> (*this) );
+ desktop->add_temporary_canvasitem(canvasitem, 2000);
+ /* END ---- TEMPORARY CODE TO TEST TEMPORARY CANVAS ITEMS */
}
@@ -158,9 +176,10 @@ PointParam::param_transform_multiply(Geom::Matrix const& postmul, bool /*set*/)
void
PointParam::on_button_click()
{
- SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ SPItem * item = sp_desktop_selection(desktop)->singleItem();
if (item != NULL) {
- param_editOncanvas(item, SP_ACTIVE_DESKTOP);
+ param_editOncanvas(item, desktop);
}
}