summaryrefslogtreecommitdiffstats
path: root/src/extension/parameter.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2006-05-02 05:28:18 +0000
committergouldtj <gouldtj@users.sourceforge.net>2006-05-02 05:28:18 +0000
commita0622e37208c1fc003c0f060b85cb2e0a025ba59 (patch)
tree4a15a71846cab316f5819ad1bc601319bfcd334e /src/extension/parameter.cpp
parentr11515@tres: ted | 2006-04-26 20:50:50 -0700 (diff)
downloadinkscape-a0622e37208c1fc003c0f060b85cb2e0a025ba59.tar.gz
inkscape-a0622e37208c1fc003c0f060b85cb2e0a025ba59.zip
r11516@tres: ted | 2006-04-26 21:30:18 -0700
Adding some parameter parsing XML code. (bzr r686)
Diffstat (limited to 'src/extension/parameter.cpp')
-rw-r--r--src/extension/parameter.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/extension/parameter.cpp b/src/extension/parameter.cpp
index c1e8c0441..9b6d02f17 100644
--- a/src/extension/parameter.cpp
+++ b/src/extension/parameter.cpp
@@ -512,12 +512,32 @@ Parameter::pref_name (void)
return g_strdup_printf("%s.%s", extension->get_id(), _name);
}
-/** \brief Build the name to write the parameter in a node object. This
- requires the inkscape namespace and the other info. */
-gchar *
-Parameter::node_name (void)
+Inkscape::XML::Node *
+Parameter::find_child (Inkscape::XML::Node * adult)
+{
+ Inkscape::XML::Node * retval = NULL;
+ for (retval = adult->firstChild();
+ retval != NULL;
+ retval = retval->next()) {
+ gchar const * name = retval->attribute("name");
+ if (name == NULL) continue;
+ if (!strcmp(name, _name))
+ break;
+ }
+
+ return retval;
+}
+
+Inkscape::XML::Node *
+Parameter::new_child (Inkscape::XML::Node * parent)
{
- return g_strdup_printf("inkscape:extension-param-%s-%s", extension->get_id(), _name);
+ Inkscape::XML::Node * retval;
+ retval = sp_repr_new("inkscape:extension-param");
+ retval->setAttribute("extension", extension->get_id());
+ retval->setAttribute("name", _name);
+
+ parent->appendChild(retval);
+ return retval;
}
Inkscape::XML::Node *