Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
CanvasHooked< WID, BASE > Class Template Reference

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

Description

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

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

This decorator is a variation of the ViewHooked decorator, and likewise embodies the widget to be attached; moreover, the attachment is immediately performed at construction time and managed automatically thereafter. When the CanvasHooked element goes out of scope, it is automatically detached from presentation. With the help of the CanvasHooked API, a widget (or similar entity) may control the coordinates of its placement onto some kind of canvas (-> Gtk::Layout), while remaining agnostic regarding any further implementation details of the canvas and its placement thereon.

The canonical example of a CanvasHooked element is the stage::timeline::ClipWidget, as created and managed by the TrackPresenter within the timeline UI. This connection entity allows 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.
BASEgeneric widget base type, to be used on the associated CanvasHook<BASE>
Remarks
since CanvasHooked represents one distinct attachment to some view or canvas, is has a clear-cut identity and and will be identified by its allocation address.
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 178 of file canvas-hook.hpp.

Public Member Functions

template<typename... ARGS>
 CanvasHooked (typename Canvas::Pos attachmentPos, ARGS &&...args)
 
 ~CanvasHooked () noexcept
 
void moveTo (int xPos, int yPos)
 

Protected Member Functions

CanvasgetCanvas () const
 

Private Types

using Canvas = CanvasHook< BASE >
 

Private Attributes

Canvasview_
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CanvasHooked()

template<class WID , class BASE = WID>
template<typename... ARGS>
CanvasHooked ( typename Canvas::Pos  attachmentPos,
ARGS &&...  args 
)
inline

Definition at line 190 of file canvas-hook.hpp.

References CanvasHooked< WID, BASE >::getCanvas().

+ Here is the call graph for this function:

◆ ~CanvasHooked()

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

Definition at line 197 of file canvas-hook.hpp.

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

Member Typedef Documentation

◆ Canvas

template<class WID , class BASE = WID>
using Canvas = CanvasHook<BASE>
private

Definition at line 182 of file canvas-hook.hpp.

Member Function Documentation

◆ getCanvas()

template<class WID , class BASE = WID>
Canvas & getCanvas ( ) const
inlineprotected

Definition at line 186 of file canvas-hook.hpp.

References CanvasHooked< WID, BASE >::view_.

Referenced by CanvasHooked< WID, BASE >::CanvasHooked(), and CanvasHooked< WID, BASE >::moveTo().

+ Here is the caller graph for this function:

◆ moveTo()

template<class WID , class BASE = WID>
void moveTo ( int  xPos,
int  yPos 
)
inline

Definition at line 207 of file canvas-hook.hpp.

References CanvasHooked< WID, BASE >::getCanvas().

+ Here is the call graph for this function:

Member Data Documentation

◆ view_

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

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