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

#include <Overlay.h>

Inheritance diagram for Overlay:
AdornedRulerPanel::QuickPlayIndicatorOverlay AdornedRulerPanel::QuickPlayRulerOverlay EditCursorOverlay PlayIndicatorOverlayBase ScrubbingOverlay PlayIndicatorOverlay

Public Member Functions

virtual ~Overlay ()=0
 
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 91 of file Overlay.h.

Constructor & Destructor Documentation

Overlay::~Overlay ( )
pure virtual

Definition at line 13 of file Overlay.cpp.

14 {
15 }

Member Function Documentation

virtual std::pair<wxRect, bool> Overlay::DoGetRectangle ( wxSize  size)
pure virtual
virtual void Overlay::Draw ( OverlayPanel panel,
wxDC &  dc 
)
pure virtual
void Overlay::Erase ( wxDC &  dc,
wxDC &  src 
)
virtual

Definition at line 29 of file Overlay.cpp.

References GetRectangle().

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
std::pair< wxRect, bool > Overlay::GetRectangle ( wxSize  size)

Definition at line 17 of file Overlay.cpp.

References DoGetRectangle().

Referenced by Erase(), and GetInfoCommand::ExploreTrackPanel().

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

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