1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 03:32:09 +01:00
Files
audacity/src/widgets/Overlay.h
Paul Licameli 7c2a531486 New base classes of TrackPanel just for the bitmap backing and overlay system...
... to make it reusable by other classes.

Also, don't create a second DC when repainting TrackPanel.
2016-05-09 11:37:32 -04:00

41 lines
903 B
C++

//
// Overlay.h
// Audacity
//
// Created by Paul Licameli on 5/7/16.
//
//
#ifndef __AUDACITY_OVERLAY__
#define __AUDACITY_OVERLAY__
#include <utility>
class OverlayPanel;
class wxDC;
class wxRect;
class wxSize;
class Overlay
{
public:
virtual ~Overlay() = 0;
// nonvirtual wrapper
std::pair<wxRect, bool> GetRectangle(wxSize size);
// size passes the dimensions of the backing dc
// First member of pair is the rectangle that would be erased
// Second member of pair indicates whether the overlay is out of date
virtual std::pair<wxRect, bool> DoGetRectangle(wxSize size) = 0;
// Default implementation blits from backing store over GetRectangle().first
virtual void Erase(wxDC &dc, wxDC &src);
// Draw; dc.GetSize() tells you the total dimensions, and the panel is supplied
// as context
virtual void Draw(OverlayPanel &panel, wxDC &dc) = 0;
};
#endif