838543cd96f8b73df2c0f96ca5e37583e0c552ba
1 #ifndef INKSCAPE_LIVEPATHEFFECT_PARAMETER_PATH_H
2 #define INKSCAPE_LIVEPATHEFFECT_PARAMETER_PATH_H
4 /*
5 * Inkscape::LivePathEffectParameters
6 *
7 * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #include <glib/gtypes.h>
13 #include <2geom/path.h>
15 #include <gtkmm/tooltips.h>
17 #include "live_effects/parameter/parameter.h"
19 #include <sigc++/sigc++.h>
21 namespace Inkscape {
23 namespace LivePathEffect {
25 class PathParam : public Parameter {
26 public:
27 PathParam ( const Glib::ustring& label,
28 const Glib::ustring& tip,
29 const Glib::ustring& key,
30 Inkscape::UI::Widget::Registry* wr,
31 Effect* effect,
32 const gchar * default_value = "M0,0 L1,1");
33 virtual ~PathParam();
35 Geom::Piecewise<Geom::D2<Geom::SBasis> > & get_pwd2();
37 virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
39 bool param_readSVGValue(const gchar * strvalue);
40 gchar * param_writeSVGValue() const;
42 void param_set_default();
43 void param_set_and_write_default();
44 void param_set_and_write_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & newpath);
46 virtual void param_editOncanvas(SPItem * item, SPDesktop * dt);
47 virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);
49 virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/);
51 sigc::signal <void> signal_path_pasted;
52 sigc::signal <void> signal_path_changed;
54 protected:
55 Geom::Piecewise<Geom::D2<Geom::SBasis> > _pwd2;
56 bool referring; // set when referring to another path, i.e. does not have its own pwd2, but should get it from another path
58 void on_edit_button_click();
59 void on_paste_button_click();
60 void on_copy_button_click();
62 gchar * defvalue;
64 private:
65 PathParam(const PathParam&);
66 PathParam& operator=(const PathParam&);
67 };
70 } //namespace LivePathEffect
72 } //namespace Inkscape
74 #endif