Lumiera  0.pre.03
»edit your freedom«
ViewHooked< WID, BASE > Class Template Reference

#include "stage/model/view-hook.hpp"

Description

template<class WID, class BASE = WID>
class stage::model::ViewHooked< WID, BASE >

A widget attached onto a display canvas or similar central presentation context.

This decorator inherits from the widget to be attached, i.e. the widget itself becomes embedded; moreover, the attachment is immediately performed at construction time and managed automatically thereafter. When the ViewHooked element goes out of scope, it is automatically detached from presentation. With the help of ViewHooked, a widget (or similar entity) may control some aspects of its presentation placement, typically the order or arrangement within a grid or layout, while remaining agnostic regarding the implementation details of the canvas and its placement thereon.

The prominent usage example of ViewHooked` elements is in the stage::timeline::DisplayFrame, maintained by the TrackPresenter within the timeline UI. This connection entity allows to attach TrackHeaderWidget elements into the appropriate part of the patchbay, and to place ClipWidget elements into the appropriate display region for this track, without exposing the actual stage::timeline::BodyCanvasWidget to each and every Clip or Label widget.

Template Parameters
WIDtype of the embedded widget, which is to be hooked-up into the view/canvas.
Remarks
since ViewHooked represents one distinct attachment to some view or canvas, is has a clear-cut identity, linked to an allocation and must not be moved.
Warning
since ViewHooked entities call back into the ViewHook on destruction, the latter still needs to be alive at that point. Which basically means you must ensure the ViewHooked "Widgets" are destroyed prior to the "Canvas".

Definition at line 123 of file view-hook.hpp.

Public Member Functions

template<typename... ARGS>
 ViewHooked (View &view, ARGS &&...args)
 

Private Types

using View = ViewHook< BASE >
 

Private Attributes

Viewview_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 
+ Inheritance diagram for ViewHooked< WID, BASE >:
+ Collaboration diagram for ViewHooked< WID, BASE >:

The documentation for this class was generated from the following file: