#include "wx/sysopt.h"
#include "wx/dynlib.h"
-#ifdef wxHAVE_RAW_BITMAP
+#ifdef wxHAS_RAW_BITMAP
#include "wx/rawbmp.h"
#endif
HDC hdcSrc,
const wxBitmap& bmp);
-#ifdef wxHAVE_RAW_BITMAP
+#ifdef wxHAS_RAW_BITMAP
// our (limited) AlphaBlend() replacement for Windows versions not providing it
static void
int srcWidth, int srcHeight,
const wxBitmap& bmpSrc);
-#endif // wxHAVE_RAW_BITMAP
+#endif // wxHAS_RAW_BITMAP
// ----------------------------------------------------------------------------
// private classes
}
}
+// ----------------------------------------------------------------------------
+// wxDC MSW-specific methods
+// ----------------------------------------------------------------------------
+
+WXHDC wxDC::GetHDC() const
+{
+ wxMSWDCImpl * const impl = wxDynamicCast(GetImpl(), wxMSWDCImpl);
+ return impl ? impl->GetHDC() : 0;
+}
+
// ---------------------------------------------------------------------------
// wxMSWDCImpl
// ---------------------------------------------------------------------------
wxDCImpl::DoGetClippingBox(x, y, w, h);
}
-// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
+// common part of DoSetClippingRegion() and DoSetDeviceClippingRegion()
void wxMSWDCImpl::SetClippingHrgn(WXHRGN hrgn)
{
wxCHECK_RET( hrgn, wxT("invalid clipping region") );
}
}
-void wxMSWDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region)
+void wxMSWDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
{
SetClippingHrgn(region.GetHRGN());
}
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
- wxCoord x2 = (x+width);
- wxCoord y2 = (y+height);
+ // +1 below makes the ellipse more similar to other platforms.
+ // In particular, DoDrawEllipse(x,y,1,1) should draw one point.
+ wxCoord x2 = x + width + 1;
+ wxCoord y2 = y + height + 1;
+
+ // Problem: Windows GDI Ellipse() with x2-x == y2-y == 3 and transparent
+ // pen doesn't draw anything. Should we provide a workaround?
- (void)Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
+ ::Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
CalcBoundingBox(x, y);
CalcBoundingBox(x2, y2);
// AlphaBlend() unavailable of failed: use our own (probably much slower)
// implementation
-#ifdef wxHAVE_RAW_BITMAP
+#ifdef wxHAS_RAW_BITMAP
wxAlphaBlend(hdcDst, x, y, dstWidth, dstHeight, srcX, srcY, srcWidth, srcHeight, bmp);
return true;
-#else // !wxHAVE_RAW_BITMAP
+#else // !wxHAS_RAW_BITMAP
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
// alpha but at least something will be shown like this)
wxUnusedVar(bmp);
return false;
-#endif // wxHAVE_RAW_BITMAP
+#endif // wxHAS_RAW_BITMAP/!wxHAS_RAW_BITMAP
}
// wxAlphaBlend: our fallback if ::AlphaBlend() is unavailable
-#ifdef wxHAVE_RAW_BITMAP
+#ifdef wxHAS_RAW_BITMAP
static void
wxAlphaBlend(HDC hdcDst, int xDst, int yDst,
}
}
-#endif // #ifdef wxHAVE_RAW_BITMAP
+#endif // wxHAS_RAW_BITMAP
void wxMSWDCImpl::DoGradientFillLinear (const wxRect& rect,
const wxColour& initialColour,