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 151 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 158 of file UIHandle.h.

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

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(), and SubViewRearrangeHandle::HitTest().

Here is the caller graph for this function: