summaryrefslogtreecommitdiffstats
path: root/src/extension/parameter.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2006-05-02 05:25:04 +0000
committergouldtj <gouldtj@users.sourceforge.net>2006-05-02 05:25:04 +0000
commitaea5af93c482fe70b18055bbe1853cdfe866a7ef (patch)
tree5f72fd4e63f123d40269af39e6389e1e0e8af649 /src/extension/parameter.cpp
parent(bzr r668) (diff)
downloadinkscape-aea5af93c482fe70b18055bbe1853cdfe866a7ef.tar.gz
inkscape-aea5af93c482fe70b18055bbe1853cdfe866a7ef.zip
r11450@tres: ted | 2006-04-17 22:08:15 -0700
Adding the _scope and _desc variables for the base parameters. Currently they're just initialized to NULL and USER, but now they can start to be used for more. (bzr r669)
Diffstat (limited to 'src/extension/parameter.cpp')
-rw-r--r--src/extension/parameter.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/extension/parameter.cpp b/src/extension/parameter.cpp
index 7e5d46739..ef0154d88 100644
--- a/src/extension/parameter.cpp
+++ b/src/extension/parameter.cpp
@@ -34,31 +34,6 @@
namespace Inkscape {
namespace Extension {
-/*
-template <typename T> class ParamSpecific : public Parameter {
-private:
- T _value;
-public:
- ParamSpecific (const gchar * name, const gchar * guitext, Inkscape::Extension * ext, Inkscape::XML::Node * xml);
- T get (const Inkscape::XML::Document * doc, const Inkscape::XML::Node * node);
- T set (T in, Inkscape::XML::Document * doc, Inkscape::XML::Node * node);
- Gtk::Widget * get_widget(void);
- Glib::ustring * string (void);
-};
-
-bool
-ParamSpecific<bool>::get (const Inkscape::XML::Document * doc, const Inkscape::XML::Node * node)
-{
- return _value;
-}
-
-int
-ParamSpecific<int>::get (const Inkscape::XML::Document * doc, const Inkscape::XML::Node * node)
-{
- return _value;
-}
-*/
-
/** \brief A boolean parameter */
class ParamBool : public Parameter {
private:
@@ -484,14 +459,21 @@ ParamString::~ParamString(void)
}
/** \brief Oop, now that we need a parameter, we need it's name. */
-Parameter::Parameter (const gchar * name, const gchar * guitext, Inkscape::Extension::Extension * ext) :
- extension(ext), _name(NULL), _text(NULL)
+Parameter::Parameter (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, Inkscape::Extension::Extension * ext) :
+ extension(ext), _name(NULL), _desc(NULL), _scope(scope), _text(NULL)
{
- _name = g_strdup(name);
+ if (name != NULL)
+ _name = g_strdup(name);
+ if (desc != NULL)
+ _desc = g_strdup(desc);
+
+
if (guitext != NULL)
_text = g_strdup(guitext);
else
_text = g_strdup(name);
+
+ return;
}
/** \brief Just free the allocated name. */