1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-02 15:13:50 +01:00
Files
audacity/src/TrackPanelDrawable.h
Panagiotis Vasilopoulos 44968d3ac3 Rebranding: Replace 'Audacity: A Digital Audio Editor' in source files (#248)
List of commands that were executed in the `src directory`:
* sed -i 's/Audacity: A Digital Audio Editor/Tenacity/g' *.h
* sed -i 's/Audacity: A Digital Audio Editor/Tenacity/g' *.cpp

Signed-off-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
2021-07-13 09:30:42 +00:00

59 lines
1.9 KiB
C++

/**********************************************************************
Tenacity
TrackPanelDrawable.h
Paul Licameli
**********************************************************************/
#ifndef __AUDACITY_TRACK_PANEL_DRAWABLE__
#define __AUDACITY_TRACK_PANEL_DRAWABLE__
#include <wx/gdicmn.h> // for wxRect
struct TrackPanelDrawingContext;
class wxRect;
/// \brief Drawing interface common to cells, groups of cells, and temporary handles in CellularPanel
class AUDACITY_DLL_API TrackPanelDrawable {
public:
virtual ~TrackPanelDrawable() = 0;
// Drawing functions of the subdivision are visited repeatedly in one
// painting if their areas (as computed by DrawingArea) intersect the
// panel area, and depending on iPass may overpaint results of previous
// passes.
// Drawing function is given the rectangle computed by DrawingArea.
// iPass counts zero-based up to some limit given to CellularPanel::Draw.
// Default implementation does nothing.
virtual void Draw(
TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass );
// For drawing purposes, a cell might require a bigger rectangle than for
// hit-test purposes, spilling over into other parts of the partition of the
// panel area.
// Default implementation returns rect unchanged.
// TrackPanelContext is passed in because sometimes a drawing context is
// needed for text extent calculations.
virtual wxRect DrawingArea(
TrackPanelDrawingContext &context,
const wxRect &rect, const wxRect &panelRect, unsigned iPass );
// Utilities for implementing DrawingArea:
static inline wxRect MaximizeWidth(
const wxRect &rect, const wxRect &panelRect ) {
return { panelRect.x, rect.y, panelRect.width, rect.height };
}
static inline wxRect MaximizeHeight(
const wxRect &rect, const wxRect &panelRect ) {
return { rect.x, panelRect.y, rect.width, panelRect.height };
}
};
#endif