From: cilix42 Date: Thu, 5 Jun 2008 08:59:31 +0000 (+0000) Subject: Add paramType() method to LPE parameter classes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d73ff87f5c0a6d911b9808d81e1cbdee5337e069;p=inkscape.git Add paramType() method to LPE parameter classes --- 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 *regenum = Gtk::manage ( new Inkscape::UI::Widget::RegisteredEnum( 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 const & get_pathvector(); Geom::Piecewise > 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();