So I implemented SPObject types for title and desc elements. However, I'm having trouble getting Inkscape to output them using Plain SVG. As an example, let's look at sp-rect.cpp:
As you can see, for each shape we create a new XML rect element (that does not contain its children). This is the same for other elements (path, circle, whatever).
So how to get Inkscape to copy the rect's title and desc children? Should I add code to sp-object's write function to grab its children and then duplicate and add them? If so, should I only do this for svg:title and svg:desc children? If so, then I guess I'd have to modify the code in sp-text and sp-item-group that already grab the children?
I will be in freenode's irc channel to discuss this if either of you are around today.
So I implemented SPObject types for title and desc elements. However, I'm having trouble getting Inkscape to output them using Plain SVG. As an example, let's look at sp-rect.cpp:
static Inkscape::XML::Node * write(SPObject *object, Inkscape: :XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) WRITE_BUILD) && !repr) { >createElement( "svg:rect" ); class)- >write)
((SPObjectClas s *) parent_ class)- >write( object, xml_doc, repr, flags);
sp_rect_
{
...
if ((flags & SP_OBJECT_
repr = xml_doc-
}
...
if (((SPObjectClass *) parent_
return repr;
}
As you can see, for each shape we create a new XML rect element (that does not contain its children). This is the same for other elements (path, circle, whatever).
So how to get Inkscape to copy the rect's title and desc children? Should I add code to sp-object's write function to grab its children and then duplicate and add them? If so, should I only do this for svg:title and svg:desc children? If so, then I guess I'd have to modify the code in sp-text and sp-item-group that already grab the children?
I will be in freenode's irc channel to discuss this if either of you are around today.