diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-06-05 08:59:31 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-06-05 08:59:31 +0000 |
| commit | e1281e9a426010cc4a3b3fdc7ea8a34613952600 (patch) | |
| tree | 099cab70b0acad830a590cefa649ee17b3c0be4d /src | |
| parent | Remove unused and buggy-looking function get_pref_children. (diff) | |
| download | inkscape-e1281e9a426010cc4a3b3fdc7ea8a34613952600.tar.gz inkscape-e1281e9a426010cc4a3b3fdc7ea8a34613952600.zip | |
Add paramType() method to LPE parameter classes
(bzr r5816)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/parameter/bool.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/enum.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/parameter.h | 16 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/point.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/random.h | 2 |
6 files changed, 26 insertions, 0 deletions
diff --git a/src/live_effects/parameter/bool.h b/src/live_effects/parameter/bool.h index 3bf839af8..e4aaabaa2 100644 --- a/src/live_effects/parameter/bool.h +++ b/src/live_effects/parameter/bool.h @@ -28,6 +28,8 @@ public: bool default_value = false); virtual ~BoolParam(); + virtual ParamType paramType() { return BOOL_PARAM; } + virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips); virtual bool param_readSVGValue(const gchar * strvalue); diff --git a/src/live_effects/parameter/enum.h b/src/live_effects/parameter/enum.h index daba43784..a3df91d64 100644 --- a/src/live_effects/parameter/enum.h +++ b/src/live_effects/parameter/enum.h @@ -39,6 +39,8 @@ public: virtual ~EnumParam() { }; + virtual ParamType paramType() { return ENUM_PARAM; } + virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * /*tooltips*/) { Inkscape::UI::Widget::RegisteredEnum<E> *regenum = Gtk::manage ( new Inkscape::UI::Widget::RegisteredEnum<E>( param_label, param_tooltip, diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 23faffc30..58f4635aa 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -37,6 +37,17 @@ namespace LivePathEffect { class Effect; +enum ParamType { + GENERAL_PARAM, + SCALAR_PARAM, + BOOL_PARAM, + PATH_PARAM, + POINT_PARAM, + RANDOM_PARAM, + ENUM_PARAM, + INVALID_PARAM +}; + class Parameter { public: Parameter( const Glib::ustring& label, @@ -51,6 +62,9 @@ public: virtual void param_set_default() = 0; + void printTypeName(); + virtual ParamType paramType() { return GENERAL_PARAM; } + // This creates a new widget (newed with Gtk::manage(new ...);) virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips) = 0; @@ -90,6 +104,8 @@ public: gdouble default_value = 1.0); virtual ~ScalarParam(); + virtual ParamType paramType() { return SCALAR_PARAM; } + virtual bool param_readSVGValue(const gchar * strvalue); virtual gchar * param_writeSVGValue() const; diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index d72b4b7fe..b543e610c 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -32,6 +32,8 @@ public: const gchar * default_value = "M0,0 L1,1"); virtual ~PathParam(); + virtual ParamType paramType() { return PATH_PARAM; } + std::vector<Geom::Path> const & get_pathvector(); Geom::Piecewise<Geom::D2<Geom::SBasis> > const & get_pwd2(); diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h index e200921ab..7a630dc0c 100644 --- a/src/live_effects/parameter/point.h +++ b/src/live_effects/parameter/point.h @@ -33,6 +33,8 @@ public: Geom::Point default_value = Geom::Point(0,0)); virtual ~PointParam(); + virtual ParamType paramType() { return POINT_PARAM; } + virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips); bool param_readSVGValue(const gchar * strvalue); diff --git a/src/live_effects/parameter/random.h b/src/live_effects/parameter/random.h index c59a9d00e..5a9f8de62 100644 --- a/src/live_effects/parameter/random.h +++ b/src/live_effects/parameter/random.h @@ -29,6 +29,8 @@ public: long default_seed = 0); virtual ~RandomParam(); + virtual ParamType paramType() { return RANDOM_PARAM; } + virtual bool param_readSVGValue(const gchar * strvalue); virtual gchar * param_writeSVGValue() const; virtual void param_set_default(); |
