Calligra/Text Layout R4
Recursive Refactor to Reduce and Reinvigorate text layout process
This page discusses the requirements (and solutions to) of a new layout process. The premise is a recursive approach, and this page then deals with how to handle the wanted features.
Wanted features
- tables
- sections (for balanced columns, endnotes after the section and runs of page formats/layouts)
- recursive composition of tables and sections
- run around
- maintain support for KWord framesets
- interruptable and resumable layout process
Impact of features on layout process
Recursive composition of tables and sections
Since tables and sections can be layered recursively inside one another the layout process needs to handle this in a nimble and easy maintainable way. This is the main reason why the premise of the entire new layout process is to be recursive as well.
Run around
Text running around other (designated shapes) is an established feature of KWord. We need to maintain support for that.
However currently the code that takes run around into consideraton is done in KWord. We are NOT going to move this to out of KWord, but we are however going to change the way this code is called.
Right now the KWord applies run around as an afterthought when the layout of a line is otherwise done. We are going to change this so the layoutprocess instead (at the right time) asks KWord if any changes are needed due to run around. This way the layout process is able to take action if any run around chnages were needed.
Maintain support for KWord framesets
Basically this is just a question of still supporting textlayout over more than one shape
Interruptable and resumable layout process
We would like to be able to interrupt the layout process, so we don't have to complete all 250 pages of a book before being able to show the first page.
This is basically handled by KWord already so all we need to do is maintain the relation to KWord. In particular we need to ask for a new shape from time to time, and this is the time when KWord shold be able to interrupt the layout process.
The process should be resumable so we need to maintain the current state of the layout process.