Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Implementation details of clip display within the Lumiera UI.
Here we are looking at the actual implementation of the clip display, which is hidden behind two layers of abstraction. The interface for controlling the desired representation style can be found within the ClipPresenter, which in turn delegates through the ClipDelegate interface.
Due to the various clip appearance styles, the actual implementation needs to be flexible on several levels. Thus, the presentation mode is structured as follows:
On construction, the ClipPresenter invokes ClipPresenter::establishAppearance(), which in turn invokes the generic function ClipDelegate::selectAppearance(), which in this case will always build a new ClipDelegate, since a CanvasHook ("view") is explicitly given. Generally speaking, this function ensures there is a delegate, and this delegate reflects the desired presentation style.
When especially the optional argument timing
is provided by the population diff creating the clip, then we can use the given lib::time::TimeSpan data for actually allocating a screen rectangle, and thus only when this condition is met (which should be the default), a ClipWidget is constructed and mapped into presentation.
Later the appearance style can be switched, which might incur the necessity also to exchange the actual implementation of the clip delegate. The latter is the case whenever we detect a different Mode of representation. Beyond that, we always know there is an existing delegate, which can be used to retrieve the further detail presentation data. In some cases the clip needs to be "re-hooked", in which case the existing CanvasHook is used to establish a new display attachment. For this to work, even the modes not directly representing the clip need to hold onto some CanvasHook, so each delegate can implement the ClipDelegate::getCanvas()
Definition in file clip-widget.cpp.
#include "stage/gtk-base.hpp"
#include "stage/timeline/clip-widget.hpp"
#include "stage/widget/element-box-widget.hpp"
#include "lib/format-string.hpp"
#include "lib/util.hpp"
#include <utility>
Classes | |
class | ClipData |
class | ClipWidget |
class | DormantClip |
A Clip not directly mapped into presentation, yet present as entity within the timeline framework. More... | |
Typedefs | |
using | HookedWidget = model::CanvasHooked< widget::ElementBoxWidget, Gtk::Widget > |
using | WidgetHook = model::CanvasHook< Gtk::Widget > |
Enumerations | |
enum | Mode { HIDDEN, SUMMARY, INDIVIDUAL } |
Functions | |
ClipDelegate * | buildDelegateFor (Mode newMode, PDelegate &existingDelegate, WidgetHook *newView, optional< TimeSpan > const &timing) |
bool | canRepresentAsClip (PDelegate &existing, optional< TimeSpan > const &timing) |
bool | canShow (Time start) |
special convention to suppress a clip with start time == Time::NEVER | |
Mode | classifyAppearance (ClipDelegate::Appearance appearance) |
Namespaces | |
stage | |
Lumiera GTK UI implementation root. | |
stage::timeline | |
The timeline display and editing operations. | |