
2010/4/6 Krzysztof KosiĆski <tweenk.pl@...400...>:
I think being able to create multiple desktops for the same document is a huge misfeature. It introduces considerable additional complexity for little benefit.
It is just a bonus we get for implementing using the model-view-controller architecture. One model, multiple views and controllers.
Yes, it is considerable additional complexity when each control must watch the relevant part of document that can be changed, without warning, in another view. But then, exactly the same watch is needed for undo anyway: like multiple views, undo can without warning change any aspect of document from under your feet.
Here's how I would like to fix this and the 3D Box problem.
- Introduce a file called document-compatibility.cpp.
- Introduce versioning of documents' editing information. The editing
info version will not be tied to the Inkscape version - it will be just a number. We start at editing info version 0, which is defined as what Inkscape 0.47 uses. Every subsequent version is defined as a series of transformations from version 0. 3. document-compatibility.cpp contains a function called upgrade_document(), or something like this. It takes an Inkscape::XML::Node to the root of the SVG and upgrades the document to the latest editing info version. 4. upgrade_document() reads the editing info version from an extra attribute in the SVG root (it can be called inkscape:document-version). It executes a series of transformations on the XML document to bring it in line with what the current SP tree expects. 5. When you want to make a change in the XML, you bump the current version by one, add the necessary XML transformations and update all relevant SP tree code to only recognize the new XML. If you did everything correct, the SP tree code doesn't need to know about any document format other than the latest one.
This sounds inevitable, but rather hairy. Why have both inkscape:version and inkscape:document-version? Can you get what you need with inkscape:version only?