Code

RegisteredWidget has been renamed to RegisteredWdg. This is a deprecated class, all...
[inkscape.git] / src / live_effects / parameter / random.h
1 #ifndef INKSCAPE_LIVEPATHEFFECT_PARAMETER_RANDOM_H
2 #define INKSCAPE_LIVEPATHEFFECT_PARAMETER_RANDOM_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 "live_effects/parameter/parameter.h"
13 #include <glibmm/ustring.h>
14 #include <2geom/point.h>
15 #include <2geom/path.h>
17 #include "ui/widget/registry.h"
19 namespace Inkscape {
21 namespace LivePathEffect {
23 class RandomParam : public Parameter {
24 public:
25     RandomParam(  const Glib::ustring& label,
26                 const Glib::ustring& tip,
27                 const Glib::ustring& key, 
28                 Inkscape::UI::Widget::Registry* wr,
29                 Effect* effect,
30                 gdouble default_value = 1.0,
31                 long default_seed = 0);
32     virtual ~RandomParam();
34     virtual bool param_readSVGValue(const gchar * strvalue);
35     virtual gchar * param_writeSVGValue() const;
36     virtual void param_set_default();
38     virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips);
40     void param_set_value(gdouble val, long newseed);
41     void param_make_integer(bool yes = true);
42     void param_set_range(gdouble min, gdouble max);
44     void resetRandomizer();
46     operator gdouble();
47     inline gdouble get_value()
48         { return value; } ;
50 protected:
51     long startseed;
52     long seed;
53     long defseed;
55     gdouble value;
56     gdouble min;
57     gdouble max;
58     bool integer;
59     gdouble defvalue;
61 private:
62     long setup_seed(long);
63     gdouble rand();
65     RandomParam(const RandomParam&);
66     RandomParam& operator=(const RandomParam&);
67 };
69 } //namespace LivePathEffect
71 } //namespace Inkscape
73 #endif