Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Widget to render the body of timeline display, by custom drawing into a canvas control.
The body part of the timeline display can not be sensibly implemented with automatic layout by the UI toolkit set. Rather, we need to control a precise temporal display grid, and we need to limit the actual widgets added for display, since a given timeline may easily hold several hundred up to thousands of elements. To ease such tasks, a canvas control — here implemented on top of Gtk::Layout, allows to combine custom drawing with the placement of embedded child widgets, where the latter's layout is again managed automatically by the toolkit set. This approach allows us to circumvent some of the perils of custom drawing, where we might forfeit several of the benefits of using a toolkit, unintentionally of course, and create an UI which feels foreign and brittle in comparison to standard software.
To create a consistent timeline layout, the header pane and body need to react to the same scrolling adjustments, and use the same vertical size allocations for each embedded track. Such a consistent global layout needs to be built up in a display evaluation pass, carried out collaboratively between the building blocks of the timeline. To this end, the TrackPresenter and ClipPresenter elements act as (view) model entities, visited by the timeline::LayoutManager to establish coherent display parameters. From within this evaluation pass, the individual presenters communicate with their slave widgets, which are inserted into the display context of the track header pane or into this body widget respectively. As result, some new widgets may be injected, existing widgets might be removed or hidden, and other widgets may be relocated to different virtual canvas coordinates.
When drawing onto a canvas, we need to define the coordinate system. This task is complicated here, since — on implementation level — we end up with several Gtk::Layout
elements (the actual canvas widget). This is necessary to accommodate for the display "mechanics": part of the timeline has to stay "pinned" on top, including the time overview ruler and possible further marker displays. Based on practical considerations we decide to handle this situation as follows
Definition in file body-canvas-widget.hpp.
#include "stage/gtk-base.hpp"
#include "stage/timeline/track-profile.hpp"
#include "stage/timeline/display-evaluation.hpp"
#include "stage/model/canvas-hook.hpp"
#include <functional>
Classes | |
class | BodyCanvasWidget |
Presentation of the timeline workspace by custom drawing on a canvas. More... | |
class | TimelineCanvas |
Typedefs | |
using | PAdjustment = Glib::RefPtr< Gtk::Adjustment > |
Namespaces | |
stage | |
Lumiera GTK UI implementation root. | |
stage::timeline | |
The timeline display and editing operations. | |