mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02:00
Revert "Remove wx/dc.h from ImageRoll.h ..."
This reverts commit 8078aa8547
.
This commit is contained in:
@@ -297,27 +297,20 @@ bool ImageRoll::Ok() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
||||||
int x, int y, int logicalFunc)
|
int x, int y, wxRasterOperationMode logicalFunc)
|
||||||
{
|
{
|
||||||
auto func = static_cast< wxRasterOperationMode >( logicalFunc );
|
if (logicalFunc == wxCOPY)
|
||||||
if (func == wxCOPY)
|
|
||||||
dc.DrawBitmap(bitmap, x, y);
|
dc.DrawBitmap(bitmap, x, y);
|
||||||
else {
|
else {
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
memDC.SelectObject(bitmap);
|
memDC.SelectObject(bitmap);
|
||||||
dc.Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(),
|
dc.Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(),
|
||||||
&memDC, 0, 0, func);
|
&memDC, 0, 0, logicalFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageRoll::Draw(wxDC &dc, wxRect rect)
|
void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logicalFunc))
|
||||||
{
|
{
|
||||||
Draw( dc, rect, wxCOPY );
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|
||||||
{
|
|
||||||
auto func = wxCOPY;
|
|
||||||
int width = rect.width;
|
int width = rect.width;
|
||||||
int height = rect.height;
|
int height = rect.height;
|
||||||
int num = (int)mPieces.size();
|
int num = (int)mPieces.size();
|
||||||
@@ -342,7 +335,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|||||||
// fixed
|
// fixed
|
||||||
|
|
||||||
if (mPieces[i].Ok())
|
if (mPieces[i].Ok())
|
||||||
DrawBitmap(dc, mPieces[i], rect.x + x, rect.y, func);
|
DrawBitmap(dc, mPieces[i], rect.x + x, rect.y);
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -355,7 +348,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|||||||
j = 0;
|
j = 0;
|
||||||
while(j < space) {
|
while(j < space) {
|
||||||
if (mPieces[i].Ok())
|
if (mPieces[i].Ok())
|
||||||
DrawBitmap(dc, mPieces[i], rect.x + x + j, rect.y, func);
|
DrawBitmap(dc, mPieces[i], rect.x + x + j, rect.y);
|
||||||
j += w;
|
j += w;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,7 +375,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|||||||
// fixed
|
// fixed
|
||||||
|
|
||||||
if (mPieces[i].Ok())
|
if (mPieces[i].Ok())
|
||||||
DrawBitmap(dc, mPieces[i], rect.x, rect.y + y, func);
|
DrawBitmap(dc, mPieces[i], rect.x, rect.y + y);
|
||||||
y += h;
|
y += h;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -395,7 +388,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|||||||
j = 0;
|
j = 0;
|
||||||
while(j < space) {
|
while(j < space) {
|
||||||
if (mPieces[i].Ok())
|
if (mPieces[i].Ok())
|
||||||
DrawBitmap(dc, mPieces[i], rect.x, rect.y + y + j, func);
|
DrawBitmap(dc, mPieces[i], rect.x, rect.y + y + j);
|
||||||
j += h;
|
j += h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +398,7 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
|
|||||||
} break; // case VerticalRoll
|
} break; // case VerticalRoll
|
||||||
|
|
||||||
case FixedImage:
|
case FixedImage:
|
||||||
DrawBitmap(dc, mPieces[0], rect.x, rect.y, func);
|
DrawBitmap(dc, mPieces[0], rect.x, rect.y);
|
||||||
break;
|
break;
|
||||||
/* the other possible cases don't really make sense, but not having them
|
/* the other possible cases don't really make sense, but not having them
|
||||||
* listed gives a GCC warning */
|
* listed gives a GCC warning */
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#define __AUDACITY_IMAGE_ROLL__
|
#define __AUDACITY_IMAGE_ROLL__
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
// #include <wx/dc.h> // for enum wxRasterOperationMode
|
#include <wx/dc.h> // for enum wxRasterOperationMode
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
#include "wxPanelWrapper.h" // to inherit
|
#include "wxPanelWrapper.h" // to inherit
|
||||||
|
|
||||||
@@ -45,8 +45,7 @@ class ImageRoll
|
|||||||
wxSize GetMaxSize() const { return mMaxSize; }
|
wxSize GetMaxSize() const { return mMaxSize; }
|
||||||
|
|
||||||
void Draw(wxDC &dc, wxRect rect,
|
void Draw(wxDC &dc, wxRect rect,
|
||||||
int /* wxRasterOperationMode */ logicalFunc);
|
wxRasterOperationMode logicalFunc = wxCOPY);
|
||||||
void Draw(wxDC &dc, wxRect rect); // default logicalFunc to wxCOPY
|
|
||||||
|
|
||||||
static ImageArray SplitH(const wxImage &src, wxColour magicColor);
|
static ImageArray SplitH(const wxImage &src, wxColour magicColor);
|
||||||
static ImageArray SplitV(const wxImage &src, wxColour magicColor);
|
static ImageArray SplitV(const wxImage &src, wxColour magicColor);
|
||||||
@@ -54,8 +53,7 @@ class ImageRoll
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
||||||
int x, int y,
|
int x, int y, wxRasterOperationMode logicalFunc = wxCOPY);
|
||||||
int /* wxRasterOperationMode */ logicalFunc);
|
|
||||||
|
|
||||||
void Init(RollType type, const wxImage &src, wxColour magicColor);
|
void Init(RollType type, const wxImage &src, wxColour magicColor);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user