no changes, just got rid of many __WXWINCE__ ifdefs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -278,27 +278,31 @@ private:
|
|||||||
wxDECLARE_NO_COPY_CLASS(wxBrushAttrsSetter);
|
wxDECLARE_NO_COPY_CLASS(wxBrushAttrsSetter);
|
||||||
};
|
};
|
||||||
|
|
||||||
// this class saves the old stretch blit mode during its life time
|
#ifdef __WXWINCE__
|
||||||
|
|
||||||
|
#define SET_STRETCH_BLT_MODE(hdc)
|
||||||
|
|
||||||
|
#else // !__WXWINCE__
|
||||||
|
|
||||||
|
// this class sets the stretch blit mode to COLORONCOLOR during its lifetime
|
||||||
|
//
|
||||||
|
// don't use it directly, use SET_STRETCH_BLT_MODE() macro instead as it
|
||||||
|
// expands to nothing under WinCE which doesn't have SetStretchBltMode()
|
||||||
class StretchBltModeChanger
|
class StretchBltModeChanger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StretchBltModeChanger(HDC hdc,
|
StretchBltModeChanger(HDC hdc)
|
||||||
int WXUNUSED_IN_WINCE(mode))
|
|
||||||
: m_hdc(hdc)
|
: m_hdc(hdc)
|
||||||
{
|
{
|
||||||
#ifndef __WXWINCE__
|
m_modeOld = ::SetStretchBltMode(m_hdc, COLORONCOLOR);
|
||||||
m_modeOld = ::SetStretchBltMode(m_hdc, mode);
|
|
||||||
if ( !m_modeOld )
|
if ( !m_modeOld )
|
||||||
wxLogLastError(_T("SetStretchBltMode"));
|
wxLogLastError(_T("SetStretchBltMode"));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~StretchBltModeChanger()
|
~StretchBltModeChanger()
|
||||||
{
|
{
|
||||||
#ifndef __WXWINCE__
|
|
||||||
if ( !::SetStretchBltMode(m_hdc, m_modeOld) )
|
if ( !::SetStretchBltMode(m_hdc, m_modeOld) )
|
||||||
wxLogLastError(_T("SetStretchBltMode"));
|
wxLogLastError(_T("SetStretchBltMode"));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -309,6 +313,11 @@ private:
|
|||||||
wxDECLARE_NO_COPY_CLASS(StretchBltModeChanger);
|
wxDECLARE_NO_COPY_CLASS(StretchBltModeChanger);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SET_STRETCH_BLT_MODE(hdc) \
|
||||||
|
StretchBltModeChanger wxMAKE_UNIQUE_NAME(stretchModeChanger)(hdc)
|
||||||
|
|
||||||
|
#endif // __WXWINCE__/!__WXWINCE__
|
||||||
|
|
||||||
#if wxUSE_DYNLIB_CLASS
|
#if wxUSE_DYNLIB_CLASS
|
||||||
|
|
||||||
// helper class to cache dynamically loaded libraries and not attempt reloading
|
// helper class to cache dynamically loaded libraries and not attempt reloading
|
||||||
@@ -1294,9 +1303,7 @@ void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
SET_STRETCH_BLT_MODE(GetHdc());
|
||||||
StretchBltModeChanger changeMode(GetHdc(), COLORONCOLOR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( useMask )
|
if ( useMask )
|
||||||
{
|
{
|
||||||
@@ -2216,9 +2223,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
|
|||||||
wxLogLastError(wxT("BitBlt"));
|
wxLogLastError(wxT("BitBlt"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
SET_STRETCH_BLT_MODE(GetHdc());
|
||||||
StretchBltModeChanger changeMode(dc_buffer, COLORONCOLOR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// copy src to buffer using selected raster op
|
// copy src to buffer using selected raster op
|
||||||
if ( !::StretchBlt(dc_buffer, 0, 0, dstWidth, dstHeight,
|
if ( !::StretchBlt(dc_buffer, 0, 0, dstWidth, dstHeight,
|
||||||
@@ -2286,7 +2291,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
|
|||||||
sizeof(ds),
|
sizeof(ds),
|
||||||
&ds) == sizeof(ds) )
|
&ds) == sizeof(ds) )
|
||||||
{
|
{
|
||||||
StretchBltModeChanger changeMode(GetHdc(), COLORONCOLOR);
|
SET_STRETCH_BLT_MODE(GetHdc());
|
||||||
|
|
||||||
// Figure out what co-ordinate system we're supposed to specify
|
// Figure out what co-ordinate system we're supposed to specify
|
||||||
// ysrc in.
|
// ysrc in.
|
||||||
@@ -2325,9 +2330,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
|
|||||||
#endif
|
#endif
|
||||||
// __WXWINCE__
|
// __WXWINCE__
|
||||||
{
|
{
|
||||||
#ifndef __WXWINCE__
|
SET_STRETCH_BLT_MODE(GetHdc());
|
||||||
StretchBltModeChanger changeMode(GetHdc(), COLORONCOLOR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( !::StretchBlt
|
if ( !::StretchBlt
|
||||||
(
|
(
|
||||||
|
Reference in New Issue
Block a user