Code

3e8dc843ab9a7f3b95995e3d459d4abe0d4601bd
[inkscape.git] / src / live_effects / parameter / point.h
1 #ifndef INKSCAPE_LIVEPATHEFFECT_PARAMETER_POINT_H
2 #define INKSCAPE_LIVEPATHEFFECT_PARAMETER_POINT_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/point.h>
15 #include <gtkmm/tooltips.h>
17 #include "live_effects/parameter/parameter.h"
19 #include "knot-holder-entity.h"
21 namespace Inkscape {
23 namespace LivePathEffect {
26 class PointParam : public Geom::Point, public Parameter, public KnotHolderEntity {
27 public:
28     PointParam( const Glib::ustring& label,
29                 const Glib::ustring& tip,
30                 const Glib::ustring& key,
31                 Inkscape::UI::Widget::Registry* wr,
32                 Effect* effect,
33                 Geom::Point default_value = Geom::Point(0,0));
34     virtual ~PointParam();
36     virtual ParamType paramType() { return POINT_PARAM; }
38     virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
40     bool param_readSVGValue(const gchar * strvalue);
41     gchar * param_getSVGValue() const;
43     void param_setValue(Geom::Point newpoint);
44     void param_set_default();
46     void param_set_and_write_new_value(Geom::Point newpoint);
48     virtual void param_editOncanvas(SPItem * item, SPDesktop * dt);
50     virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/);
52     void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color);
54     /* these are overloaded from KnotHolderEntity */
55     virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state);
56     virtual NR::Point knot_get();
57     virtual void knot_click(guint state);
59     virtual bool isLPEParam() { return true; }
61 private:
62     PointParam(const PointParam&);
63     PointParam& operator=(const PointParam&);
65     void on_button_click();
67     Geom::Point defvalue;
69     SPKnotShapeType knot_shape;
70     SPKnotModeType knot_mode;
71     guint32 knot_color;
72 };
75 } //namespace LivePathEffect
77 } //namespace Inkscape
79 #endif