X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Flive_effects%2Fparameter%2Fpath.h;h=76f3fa774ff61c633a23f6d598e65fca15c9ae97;hb=4ea30e1bba14987abced98e7bf194b69153e9e21;hp=a269f3e4f26bf2a034c6034dba01b65e7c819d1d;hpb=a797dcb8e284cab19f60b3eff93a53a62abda263;p=inkscape.git diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index a269f3e4f..76f3fa774 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -12,22 +12,17 @@ #include #include <2geom/path.h> -#include "ui/widget/registry.h" #include #include "live_effects/parameter/parameter.h" - +#include "live_effects/parameter/path-reference.h" #include -namespace Gtk { - class Button; -} - namespace Inkscape { namespace LivePathEffect { -class PathParam : public Geom::Piecewise >, public Parameter { +class PathParam : public Parameter { public: PathParam ( const Glib::ustring& label, const Glib::ustring& tip, @@ -37,38 +32,59 @@ public: const gchar * default_value = "M0,0 L1,1"); virtual ~PathParam(); - Gtk::Widget * param_getWidget(); + std::vector const & get_pathvector(); + Geom::Piecewise > const & get_pwd2(); - bool param_readSVGValue(const gchar * strvalue); - gchar * param_writeSVGValue() const; + virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips); - void param_set_default(); + virtual bool param_readSVGValue(const gchar * strvalue); + virtual gchar * param_getSVGValue() const; - void param_set_and_write_new_value (Geom::Piecewise > newpath); + virtual void param_set_default(); + void param_set_and_write_default(); + void set_new_value (std::vector const &newpath, bool write_to_svg); + void set_new_value (Geom::Piecewise > const &newpath, bool write_to_svg); - void param_editOncanvas(SPItem * item, SPDesktop * dt); - void param_setup_nodepath(Inkscape::NodePath::Path *np); + virtual void param_editOncanvas(SPItem * item, SPDesktop * dt); + virtual void param_setup_nodepath(Inkscape::NodePath::Path *np); + virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); - virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/) {}; + virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/); sigc::signal signal_path_pasted; sigc::signal signal_path_changed; -private: - PathParam(const PathParam&); - PathParam& operator=(const PathParam&); - - Gtk::Widget * _widget; - Gtk::Tooltips * _tooltips; + void paste_param_path(const char *svgd); + void on_paste_button_click(); - void param_write_to_repr(const char * svgd); +protected: + std::vector _pathvector; // this is primary data storage, since it is closest to SVG. + + Geom::Piecewise > _pwd2; // secondary, hence the bool must_recalculate_pwd2 + bool must_recalculate_pwd2; // set when _pathvector was updated, but _pwd2 not + void ensure_pwd2(); // ensures _pwd2 is up to date + + 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; - Gtk::Button * edit_button; +private: + PathParam(const PathParam&); + PathParam& operator=(const PathParam&); };