summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b78a568)
raw | patch | inline | side by side (parent: b78a568)
| author | gouldtj <gouldtj@users.sourceforge.net> | |
| Tue, 2 May 2006 05:28:18 +0000 (05:28 +0000) | ||
| committer | gouldtj <gouldtj@users.sourceforge.net> | |
| Tue, 2 May 2006 05:28:18 +0000 (05:28 +0000) |
Adding some parameter parsing XML code.
| src/extension/parameter.cpp | patch | blob | history | |
| src/extension/parameter.h | patch | blob | history |
index c1e8c04415e2f439add751e69266c186b3159b82..9b6d02f1703c19b899d0507ddcc898d12699ebd3 100644 (file)
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 *
index 25537156a74e3389e18450cb41726701b0f16ceb..806876e7329b65784aa1aac8abf98434ac141854 100644 (file)
/* **** funcs **** */
gchar * pref_name (void);
- gchar * node_name (void);
+ Inkscape::XML::Node * find_child (Inkscape::XML::Node * adult);
Inkscape::XML::Node * document_param_node (SPDocument * doc);
+ Inkscape::XML::Node * new_child (Inkscape::XML::Node * parent);
public:
Parameter (const gchar * name,