Audacity 3.2.0
Classes | Typedefs | Functions
UIHandle.h File Reference
#include <utility>
#include <memory>
#include <typeinfo>
#include "TrackPanelDrawable.h"
Include dependency graph for UIHandle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UIHandle
 Short-lived drawing and event-handling object associated with a TrackPanelCell. More...
 

Typedefs

using UIHandlePtr = std::shared_ptr< UIHandle >
 

Functions

template<typename Subclass >
std::shared_ptr< Subclass > AssignUIHandlePtr (std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
 

Typedef Documentation

◆ UIHandlePtr

using UIHandlePtr = std::shared_ptr<UIHandle>

Definition at line 156 of file UIHandle.h.

Function Documentation

◆ AssignUIHandlePtr()

template<typename Subclass >
std::shared_ptr< Subclass > AssignUIHandlePtr ( std::weak_ptr< Subclass > &  holder,
const std::shared_ptr< Subclass > &  pNew 
)

Definition at line 163 of file UIHandle.h.

165{
166 // Either assign to a null weak_ptr, or else rewrite what the weak_ptr
167 // points at. Thus a handle already pointed at changes its state but not its
168 // identity. This may matter for the framework that holds the strong
169 // pointers.
170 auto ptr = holder.lock();
171 if (!ptr) {
172 holder = pNew;
173 return pNew;
174 }
175 else {
176 //type slicing check
177 wxASSERT(typeid(*ptr) == typeid(*pNew));
178
179 auto code = Subclass::NeedChangeHighlight( *ptr, *pNew );
180 *ptr = std::move(*pNew);
181 ptr->SetChangeHighlight( code );
182 return ptr;
183 }
184}

Referenced by BrushHandleHitTest(), WaveChannelSubView::DoDetailedHitTest(), WaveChannelView::DoDetailedHitTest(), EnvelopeHandle::HitAnywhere(), NoteTrackAffordanceHandle::HitAnywhere(), SampleHandle::HitAnywhere(), TimeShiftHandle::HitAnywhere(), TrackSelectHandle::HitAnywhere(), WaveClipAdjustBorderHandle::HitAnywhere(), ZoomHandle::HitAnywhere(), TrackPanelResizerCell::HitTest(), SpectrumVRulerControls::HitTest(), WaveformVRulerControls::HitTest(), TimeTrackVRulerControls::HitTest(), BackgroundCell::HitTest(), AdornedRulerPanel::QPCell::HitTest(), AdornedRulerPanel::ScrubbingCell::HitTest(), WaveTrackAffordanceControls::HitTest(), CloseButtonHandle::HitTest(), CutlineHandle::HitTest(), EffectsButtonHandle::HitTest(), GainSliderHandle::HitTest(), LabelGlyphHandle::HitTest(), LabelTextHandle::HitTest(), MenuButtonHandle::HitTest(), MinimizeButtonHandle::HitTest(), MuteButtonHandle::HitTest(), NoteTrackButtonHandle::HitTest(), NoteTrackVZoomHandle::HitTest(), PanSliderHandle::HitTest(), SelectButtonHandle::HitTest(), SelectHandle::HitTest(), SoloButtonHandle::HitTest(), StretchHandle::HitTest(), SubViewAdjustHandle::HitTest(), SubViewCloseHandle::HitTest(), SubViewRearrangeHandle::HitTest(), and VelocitySliderHandle::HitTest().

Here is the caller graph for this function: