Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
A collaboration to establish a globally coherent timeline display layout.
Whenever the layout of timeline contents has to be (re)established, a recursive evaluation pass is triggered, which in fact is a tree walk. As a foundation, we assume that GTK has provided each of the actual widgets with a screen space allocation sufficient to render the content known thus far. At this point, we need to traverse the whole timeline structure, collect size and allocation information and create additional screen space requests if necessary. Generally speaking, this recursive process can not be entirely successful at first pass; typically additional space requirements are discovered and propagated as message to GTK, and so the DisplayEvaluation can be expected to be re-triggered soon thereafter.
The basic goal is to establish a coherent vertical space allocation for all tracks within the timeline (while, to the contrary, the horizontal extension is a fixed requirement and can be derived from the covered time span as translated by a zoom factor). This can be achieved by
This is an intricate collaboration of closely related elements; however, each of the aforementioned tasks is defined such as to operate in a self-confined way on some part of the timeline. All the collaborating elements implement a common invocation interface timeline::LayoutElement, which allows to pass on the DisplayEvaluation itself by reference, recursively. To make the overall process work, moreover we establish a Requirement to pass on this invocation strictly in layout order – which implies a recursive depth-first invocation proceeding top-down and from left to right. It is each LayoutElement's liability to recurse appropriately in order to make this happen.
The DisplayEvaluation works by direct (side)effect within the invoked elements, eventually leading to some of the embedded GTK widgets being resized – which typically will re-trigger our custom drawing code and consequently the DisplayEvaluation at a later time point in UI event processing. So the evaluation is triggered repeatedly, until the layout is globally balanced and no further resizing is necessary. The evaluation itself is carried out in two phases: first we collect data and establish the layout requirements, then, in a second pass, we finalise and round up the layout. Each phase calls its own set of callback functions, and always in »layout order« (top-down and from left to right).
Definition in file display-evaluation.hpp.
Classes | |
class | DisplayEvaluation |
Visitor and state holder for a collaborative layout adjustment pass. More... | |
class | LayoutElement |
Namespaces | |
stage | |
Lumiera GTK UI implementation root. | |
stage::timeline | |
The timeline display and editing operations. | |