Audacity  3.0.3
Classes | Typedefs | Functions
UIHandle.h File Reference
#include <utility>
#include <memory>
#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 137 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 144 of file UIHandle.h.

146 {
147  // Either assign to a null weak_ptr, or else rewrite what the weak_ptr
148  // points at. Thus a handle already pointed at changes its state but not its
149  // identity. This may matter for the framework that holds the strong
150  // pointers.
151  auto ptr = holder.lock();
152  if (!ptr) {
153  holder = pNew;
154  return pNew;
155  }
156  else {
157  auto code = Subclass::NeedChangeHighlight( *ptr, *pNew );
158  *ptr = std::move(*pNew);
159  ptr->SetChangeHighlight( code );
160  return ptr;
161  }
162 }

Referenced by SampleHandle::HitAnywhere(), TimeShiftHandle::HitAnywhere(), TrackSelectHandle::HitAnywhere(), ZoomHandle::HitAnywhere(), TrackPanelResizerCell::HitTest(), SpectrumVRulerControls::HitTest(), WaveformVRulerControls::HitTest(), TimeTrackVRulerControls::HitTest(), AdornedRulerPanel::QPCell::HitTest(), AdornedRulerPanel::ScrubbingCell::HitTest(), CloseButtonHandle::HitTest(), CutlineHandle::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(), anonymous_namespace{WaveTrackView.cpp}::SubViewAdjustHandle::HitTest(), anonymous_namespace{WaveTrackView.cpp}::SubViewRearrangeHandle::HitTest(), and anonymous_namespace{WaveTrackView.cpp}::SubViewCloseHandle::HitTest().

Here is the caller graph for this function: