diff options
Diffstat (limited to 'src/live_effects/parameter')
| -rw-r--r-- | src/live_effects/parameter/parameter.h | 3 | ||||
| -rw-r--r-- | src/live_effects/parameter/point.cpp | 21 | ||||
| -rw-r--r-- | src/live_effects/parameter/point.h | 11 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 511ce46a2..c4e58c8d5 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -58,7 +58,8 @@ public: virtual bool param_readSVGValue(const gchar * strvalue) = 0; // returns true if new value is valid / accepted. virtual gchar * param_getSVGValue() const = 0; - + void write_to_SVG() { param_write_to_repr(param_getSVGValue()); } + virtual void param_set_default() = 0; void printTypeName(); diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 49a47660f..502af1f23 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -162,12 +162,33 @@ PointParam::set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint knot_color = color; } +void +PointParam::knot_set(NR::Point const &p, NR::Point const &origin, guint state) +{ + g_print ("PointParam::knot_set() was called!\n"); + param_setValue(p.to_2geom()); +} + +NR::Point +PointParam::knot_get() +{ + g_print ("PointParam::knot_get() was called.\n"); + g_print ("We return (%f, %f)\n", (*this)[0], (*this)[1]); + return *this; +} + +void +PointParam::knot_click(guint state) +{ + g_print ("PointParam::knot_click() was called!\n"); +} // CALLBACKS: void PointParam::on_button_click() { + g_print ("PointParam::on_button_click()\n"); SPDesktop *desktop = SP_ACTIVE_DESKTOP; SPItem * item = sp_desktop_selection(desktop)->singleItem(); if (item != NULL) { diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h index d963d835a..3e8dc843a 100644 --- a/src/live_effects/parameter/point.h +++ b/src/live_effects/parameter/point.h @@ -16,14 +16,14 @@ #include "live_effects/parameter/parameter.h" -#include "knot-enums.h" +#include "knot-holder-entity.h" namespace Inkscape { namespace LivePathEffect { -class PointParam : public Geom::Point, public Parameter { +class PointParam : public Geom::Point, public Parameter, public KnotHolderEntity { public: PointParam( const Glib::ustring& label, const Glib::ustring& tip, @@ -51,6 +51,13 @@ public: void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); + /* these are overloaded from KnotHolderEntity */ + virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state); + virtual NR::Point knot_get(); + virtual void knot_click(guint state); + + virtual bool isLPEParam() { return true; } + private: PointParam(const PointParam&); PointParam& operator=(const PointParam&); |
