
Hi, I generated the documentation for the object tree and picked out the relevant parts for you: https://dl.dropboxusercontent.com/u/37427492/sp-object.pdf https://dl.dropboxusercontent.com/u/37427492/sp-metadata1.pdf https://dl.dropboxusercontent.com/u/37427492/sp-metadata2.pdf
Note that this is not how it is currently implemented in trunk, but in my own branch instead. This shouldn't matter for understanding, though, I just converted the tree to "real" c++ classes. SPObject is the base class for all tree nodes. As you can see in the first pdf, every svg element has got one counterpart of the right class in the object tree. Whenever a change is made to an xml node, it informs the tree node belonging to him by calling for example onUpdate(). The tree node then updates its internal state. Whenever possible, one should work on the tree nodes and leave the xml nodes alone. You'll find lots of information on this in the inkscape wiki, e. g. "Changes in the XML tree are automatically propagated to the object tree via observers, but not the other way around-a function called updateRepr() must be explicitly called."
As the rdf information is not a drawable object (-> SPItem subclasses), it should probably derive directly from SPObject. Maybe you could then add it as a member to SPMetadata. I'm not quite sure how to handle that best either. We should wait for some more opinions. or just try it out :) .
Regards, Markus
Hi Markus I started work on Inkscape earlier this year (April/May). During the
summer
I work with Commons Machinery [1] to improve metadata handling and the GUI for metadata and license information. In this prototype I'm working with the idea that multiple metadata tags are allowed and therefore multiple
rdf
tags (though only one per metadata tag). With my limited experience with Inkscape codebase and the object tree I'm not sure how to best refactor
RDF
to fit in.
In an earlier discussion with Peter Liljenberg [2] he said that a refactor of RDF should be done to be more general and easy to work with. I'm not sure about the specifics about this but I will look into it later on in August hopefully.
You seem to have a lot more experience with the Inkscape codebase than I have so it would been fun to discuss any changes that is done here in this area with you. The goal now for me is to complete the prototype with as simple code as possible and then during the summer/fall (when time
permits)
refactor so it can be merged into Inkscape trunk.
Concerning GSOC merge before 0.49, I don't know.
[1] http://commonsmachinery.se/ [2] https://launchpad.net/~peter-liljenberg
https://launchpad.net/%7Epeter-liljenberg
-- Christoffer Holmstedt