Code

Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in...
[inkscape.git] / src / live_effects / parameter / parameter.h
index 511ce46a23edfd8fa8f17764c9cc978973f10ea7..ff878e717ac1f8daaef18c206fabdc15f124d78b 100644 (file)
 
 #include <glibmm/ustring.h>
 #include <2geom/forward.h>
+#include <2geom/pathvector.h>
 
+class KnotHolder;
+class SPLPEItem;
 struct SPDesktop;
 struct SPItem;
 
@@ -36,17 +39,6 @@ namespace LivePathEffect {
 
 class Effect;
 
-enum ParamType {
-    GENERAL_PARAM,
-    SCALAR_PARAM,
-    BOOL_PARAM,
-    PATH_PARAM,
-    POINT_PARAM,
-    RANDOM_PARAM,
-    ENUM_PARAM,
-    INVALID_PARAM
-};
-
 class Parameter {
 public:
     Parameter(  const Glib::ustring& label,
@@ -58,17 +50,20 @@ 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();
-    virtual ParamType paramType() { return GENERAL_PARAM; }
-
     // 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; };
 
+    // overload these for your particular parameter to make it provide knotholder handles or canvas helperpaths
+    virtual bool providesKnotHolderEntities() { return false; }
+    virtual void addKnotHolderEntities(KnotHolder */*knotholder*/, SPDesktop */*desktop*/, SPItem */*item*/) {};
+    virtual void addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::PathVector> &/*hp_vec*/) {};
+
     virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {};
     virtual void param_setup_nodepath(Inkscape::NodePath::Path */*np*/) {};
 
@@ -79,6 +74,7 @@ public:
     Glib::ustring param_label;
 
     bool oncanvas_editable;
+    bool widget_is_visible;
 
 protected:
     Glib::ustring param_tooltip;
@@ -103,8 +99,6 @@ public:
                 gdouble default_value = 1.0);
     virtual ~ScalarParam();
 
-    virtual ParamType paramType() { return SCALAR_PARAM; }
-
     virtual bool param_readSVGValue(const gchar * strvalue);
     virtual gchar * param_getSVGValue() const;
 
@@ -150,4 +144,4 @@ private:
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :