#include "wx/msw/wrapcdlg.h"
#include "wx/image.h"
#include "wx/window.h"
- #include "wx/dc.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/app.h"
#include "wx/module.h"
#endif
+#include "wx/msw/dc.h"
#include "wx/sysopt.h"
#include "wx/dynlib.h"
static const int VIEWPORT_EXTENT = 1000;
-static const int MM_POINTS = 9;
-static const int MM_METRIC = 10;
-
// ROPs which don't have standard names (see "Ternary Raster Operations" in the
// MSDN docs for how this and other numbers in wxDC::Blit() are obtained)
#define DSTCOPY 0x00AA0029 // a.k.a. NOP operation
rect.bottom = y2;
#ifdef __WXWINCE__
- DrawFrameControl(GetHdc(), &rect, DFC_BUTTON, DFCS_BUTTONCHECK);
+ DrawFrameControl(GetHdc(), &rect, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED);
#else
DrawFrameControl(GetHdc(), &rect, DFC_MENU, DFCS_MENUCHECK);
#endif
int fillStyle)
{
#ifdef __WXWINCE__
- wxDCBase::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
+ wxDCImpl::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
#else
WXMICROWIN_CHECK_HDC
{
#ifdef __WXWINCE__
// WinCE does not support ::PolyBezier so use generic version
- wxDCBase::DoDrawSpline(points);
+ wxDCImpl::DoDrawSpline(points);
#else
// quadratic b-spline to cubic bezier spline conversion
//
// Swap start and end positions if the end angle is less than the start angle.
if (ea < sa) {
- int temp;
- temp = rx2;
- rx2 = rx1;
- rx1 = temp;
- temp = ry2;
- ry2 = ry1;
- ry1 = temp;
+ int temp;
+ temp = rx2;
+ rx2 = rx1;
+ rx1 = temp;
+ temp = ry2;
+ ry2 = ry1;
+ ry1 = temp;
}
// draw pie with NULL_PEN first and then outline otherwise a line is
::SetViewportOrgEx(GetHdc(), m_deviceOriginX, m_deviceOriginY, NULL);
::SetWindowOrgEx(GetHdc(), m_logicalOriginX, m_logicalOriginY, NULL);
#endif
-
}
void wxMSWDCImpl::SetMapMode(int mode)
WXMICROWIN_CHECK_HDC_RET(false)
- wxDCImpl *impl = source->GetImpl();
- wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
- if (!msw_impl)
+ wxMSWDCImpl *implSrc = wxDynamicCast( source->GetImpl(), wxMSWDCImpl );
+ if ( !implSrc )
{
- // TODO: Do we want to be able to blit
- // from other DCs too?
+ // TODO: Do we want to be able to blit from other DCs too?
return false;
}
+ const HDC hdcSrc = GetHdcOf(*implSrc);
+
// if either the source or destination has alpha channel, we must use
// AlphaBlt() as other function don't handle it correctly
- const wxBitmap& bmpSrc = msw_impl->GetSelectedBitmap();
+ const wxBitmap& bmpSrc = implSrc->GetSelectedBitmap();
if ( bmpSrc.IsOk() && (bmpSrc.HasAlpha() ||
(m_selectedBitmap.IsOk() && m_selectedBitmap.HasAlpha())) )
{
if ( AlphaBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight,
- xsrc, ysrc, srcWidth, srcHeight, GetHdcOf(*msw_impl), bmpSrc) )
+ xsrc, ysrc, srcWidth, srcHeight, hdcSrc, bmpSrc) )
return true;
}
(
GetHdc(),
xdest, ydest, dstWidth, dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc,
(HBITMAP)mask->GetMaskBitmap(),
xsrcMask, ysrcMask,
#if wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask
- wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, msw_impl->GetHDC());
+ wxDCCacheEntry* dcCacheEntry1 = FindDCInCache(NULL, hdcSrc);
dc_mask = (HDC) dcCacheEntry1->m_dc;
wxDCCacheEntry* dcCacheEntry2 = FindDCInCache(dcCacheEntry1, GetHDC());
buffer_bmap = (HBITMAP) bitmapCacheEntry->m_bitmap;
#else // !wxUSE_DC_CACHEING
// create a temp buffer bitmap and DCs to access it and the mask
- dc_mask = ::CreateCompatibleDC(GetHdcOf(*source));
+ dc_mask = ::CreateCompatibleDC(hdcSrc);
dc_buffer = ::CreateCompatibleDC(GetHdc());
buffer_bmap = ::CreateCompatibleBitmap(GetHdc(), dstWidth, dstHeight);
#endif // wxUSE_DC_CACHEING/!wxUSE_DC_CACHEING
// copy src to buffer using selected raster op
if ( !::StretchBlt(dc_buffer, 0, 0, (int)dstWidth, (int)dstHeight,
- GetHdcOf(*msw_impl), xsrc, ysrc, srcWidth, srcHeight, dwRop) )
+ hdcSrc, xsrc, ysrc, srcWidth, srcHeight, dwRop) )
{
wxLogLastError(wxT("StretchBlt"));
}
(
GetHdc(),
xdest, ydest, dstWidth, dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc, srcWidth, srcHeight,
dwRop
) )
GetHdc(),
xdest, ydest,
(int)dstWidth, (int)dstHeight,
- GetHdcOf(*msw_impl),
+ hdcSrc,
xsrc, ysrc,
dwRop
) )