Code

Make text widget for TextParams work and re-enable it
[inkscape.git] / src / live_effects / parameter / path.h
index 6f2a0d1fdcc96ba8f6263efb1de88fe5280f0667..76f3fa774ff61c633a23f6d598e65fca15c9ae97 100644 (file)
@@ -15,7 +15,7 @@
 #include <gtkmm/tooltips.h>
 
 #include "live_effects/parameter/parameter.h"
-
+#include "live_effects/parameter/path-reference.h"
 #include <sigc++/sigc++.h>
 
 namespace Inkscape {
@@ -37,21 +37,26 @@ public:
 
     virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
 
-    bool param_readSVGValue(const gchar * strvalue);
-    gchar * param_writeSVGValue() const;
+    virtual bool param_readSVGValue(const gchar * strvalue);
+    virtual gchar * param_getSVGValue() const;
 
-    void param_set_default();
+    virtual void param_set_default();
     void param_set_and_write_default();
-    void param_set_and_write_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & newpath);
+    void set_new_value (std::vector<Geom::Path> const &newpath, bool write_to_svg);
+    void set_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis> > const &newpath, bool write_to_svg);
 
     virtual void param_editOncanvas(SPItem * item, SPDesktop * dt);
     virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);
+    virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector<Geom::PathVector> &hp_vec);
 
     virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/);
 
     sigc::signal <void> signal_path_pasted;
     sigc::signal <void> signal_path_changed;
 
+    void paste_param_path(const char *svgd);
+    void on_paste_button_click();
+
 protected:
     std::vector<Geom::Path> _pathvector;   // this is primary data storage, since it is closest to SVG.
 
@@ -59,12 +64,21 @@ protected:
     bool must_recalculate_pwd2; // set when _pathvector was updated, but _pwd2 not
     void ensure_pwd2();  // ensures _pwd2 is up to date
 
-    bool referring;   // set when referring to another path, i.e. does not have its own pwd2, but should get it from another path
-    void update_from_referred();  // updates path data by looking up refered path
+    gchar * href;     // contains link to other object, e.g. "#path2428", NULL if PathParam contains pathdata itself
+    PathReference ref;
+    sigc::connection ref_changed_connection;
+    sigc::connection linked_delete_connection;
+    sigc::connection linked_modified_connection;
+    void ref_changed(SPObject *old_ref, SPObject *new_ref);
+    void remove_link();
+    void start_listening(SPObject * to);
+    void quit_listening(void);
+    void linked_delete(SPObject *deleted);
+    void linked_modified(SPObject *linked_obj, guint flags);
 
     void on_edit_button_click();
-    void on_paste_button_click();
     void on_copy_button_click();
+    void on_link_button_click();
 
     gchar * defvalue;