Audacity 3.2.0
Public Member Functions | List of all members
Overlay Class Referenceabstract

#include <Overlay.h>

Inheritance diagram for Overlay:
[legend]

Public Member Functions

 Overlay ()=default
 
 Overlay (const Overlay &)=delete
 
Overlayoperator= (const Overlay &)=delete
 
virtual ~Overlay ()=0
 
virtual unsigned SequenceNumber () const =0
 This number determines an ordering of overlays, so that those with higher numbers overpaint those with lower numbers that intersect. More...
 
std::pair< wxRect, bool > GetRectangle (wxSize size)
 
virtual std::pair< wxRect, bool > DoGetRectangle (wxSize size)=0
 
virtual void Erase (wxDC &dc, wxDC &src)
 
virtual void Draw (OverlayPanel &panel, wxDC &dc)=0
 

Detailed Description

Definition at line 93 of file Overlay.h.

Constructor & Destructor Documentation

◆ Overlay() [1/2]

Overlay::Overlay ( )
default

◆ Overlay() [2/2]

Overlay::Overlay ( const Overlay )
delete

◆ ~Overlay()

Overlay::~Overlay ( )
pure virtual

Definition at line 13 of file Overlay.cpp.

14{
15}

Member Function Documentation

◆ DoGetRectangle()

virtual std::pair< wxRect, bool > Overlay::DoGetRectangle ( wxSize  size)
pure virtual

Implemented in AdornedRulerPanel::ScrubbingRulerOverlay, AdornedRulerPanel::TrackPanelGuidelineOverlay, EditCursorOverlay, PlayIndicatorOverlayBase, and ScrubbingOverlay.

Referenced by GetRectangle().

Here is the caller graph for this function:

◆ Draw()

virtual void Overlay::Draw ( OverlayPanel panel,
wxDC &  dc 
)
pure virtual

◆ Erase()

void Overlay::Erase ( wxDC &  dc,
wxDC &  src 
)
virtual

Definition at line 29 of file Overlay.cpp.

30{
31 wxRect rect(dc.GetSize());
32 rect.Intersect(src.GetSize());
33 auto smallRect(GetRectangle(src.GetSize()).first);
34 rect.Intersect(smallRect);
35 if (!rect.IsEmpty())
36 dc.Blit(rect.x, rect.y, rect.width, rect.height,
37 &src, rect.x, rect.y);
38}
std::pair< wxRect, bool > GetRectangle(wxSize size)
Definition: Overlay.cpp:17

References GetRectangle().

Here is the call graph for this function:

◆ GetRectangle()

std::pair< wxRect, bool > Overlay::GetRectangle ( wxSize  size)

Definition at line 17 of file Overlay.cpp.

18{
19 auto result = DoGetRectangle(size);
20#ifdef __WXMAC__
21 // On OSX, if a HiDPI resolution is being used, a vertical line will actually take up
22 // more than 1 pixel (even though it is drawn as 1), so we restore the surrounding
23 // pixels as well. (This is because the wxClientDC doesn't know about the scaling.
24 result.first.Inflate(1, 0);
25#endif
26 return result;
27}
virtual std::pair< wxRect, bool > DoGetRectangle(wxSize size)=0

References DoGetRectangle(), and size.

Referenced by Erase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

Overlay & Overlay::operator= ( const Overlay )
delete

◆ SequenceNumber()

virtual unsigned Overlay::SequenceNumber ( ) const
pure virtual

This number determines an ordering of overlays, so that those with higher numbers overpaint those with lower numbers that intersect.

Implemented in AdornedRulerPanel::ScrubbingRulerOverlay, AdornedRulerPanel::TrackPanelGuidelineOverlay, EditCursorOverlay, PlayIndicatorOverlayBase, and ScrubbingOverlay.


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