Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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 114 of file view-hook.hpp.

Public Member Functions

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

Private Types

using View = ViewHook< BASE >
 

Private Attributes

Viewview_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ ViewHooked()

template<class WID , class BASE = WID>
template<typename... ARGS>
ViewHooked ( View view,
ARGS &&...  args 
)
inline

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

References ViewHooked< WID, BASE >::view_.

◆ ~ViewHooked()

template<class WID , class BASE = WID>
~ViewHooked ( )
inlinenoexcept

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

References ERROR_LOG_AND_IGNORE, and ViewHooked< WID, BASE >::view_.

Member Typedef Documentation

◆ View

template<class WID , class BASE = WID>
using View = ViewHook<BASE>
private

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

Member Data Documentation

◆ view_

template<class WID , class BASE = WID>
View* view_
private
+ Inheritance diagram for ViewHooked< WID, BASE >:
+ Collaboration diagram for ViewHooked< WID, BASE >:

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