Code

RegisteredScalar subclassed from RegisteredWidget<Scalar> instead of old RegisteredWdg
[inkscape.git] / src / live_effects / parameter / parameter.h
index a6b05bf362ad8185393ba4650b5ac42f7ecbc5ba..256ab343f4ca7cb14f29812969b9000d0a5f3088 100644 (file)
 #include "ui/widget/registry.h"
 #include "ui/widget/registered-widget.h"
 
+struct SPDesktop;
+struct SPItem;
+
 namespace Gtk {
     class Widget;
+    class Tooltips;
 }
 
 namespace Inkscape {
 
+namespace NodePath {
+    class Path ;
+}
+
 namespace LivePathEffect {
 
 class Effect;
@@ -40,20 +48,29 @@ public:
 
     virtual void param_set_default() = 0;
 
-    // This returns pointer to the parameter's widget to be put in the live-effects dialog. Must also create the
-    // necessary widget if it does not exist yet.
-    virtual Gtk::Widget * param_getWidget() = 0;
+    // This creates a new widget (newed with Gtk::manage(new ...);)
+    virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips) = 0;
+
     virtual Glib::ustring * param_getTooltip() { return &param_tooltip; };
 
+    virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {};
+    virtual void param_setup_nodepath(Inkscape::NodePath::Path */*np*/) {};
+
+    virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/) {};
+
     Glib::ustring param_key;
     Inkscape::UI::Widget::Registry * param_wr;
     Glib::ustring param_label;
 
+    bool oncanvas_editable;
+
 protected:
     Glib::ustring param_tooltip;
 
     Effect* param_effect;
 
+    void param_write_to_repr(const char * svgd);
+
 private:
     Parameter(const Parameter&);
     Parameter& operator=(const Parameter&);
@@ -64,7 +81,7 @@ class ScalarParam : public Parameter {
 public:
     ScalarParam(  const Glib::ustring& label,
                 const Glib::ustring& tip,
-                const Glib::ustring& key, 
+                const Glib::ustring& key,
                 Inkscape::UI::Widget::Registry* wr,
                 Effect* effect,
                 gdouble default_value = 1.0);
@@ -80,7 +97,7 @@ public:
     void param_set_digits(unsigned digits);
     void param_set_increments(double step, double page);
 
-    virtual Gtk::Widget * param_getWidget();
+    virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
 
     inline operator gdouble()
         { return value; };
@@ -91,7 +108,6 @@ protected:
     gdouble max;
     bool integer;
     gdouble defvalue;
-    Inkscape::UI::Widget::RegisteredScalar * rsu;
     unsigned digits;
     double inc_step;
     double inc_page;
@@ -106,3 +122,14 @@ private:
 } //namespace Inkscape
 
 #endif
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :