static void ClearCache();
#endif
+ // RTL related functions
+ // ---------------------
+
+ // get or change the layout direction (LTR or RTL) for this dc,
+ // wxLayout_Default is returned if layout direction is not supported
+ virtual wxLayoutDirection GetLayoutDirection() const;
+ virtual void SetLayoutDirection(wxLayoutDirection dir);
+
protected:
void Init()
{
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
+ virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
+ wxCoord dstWidth, wxCoord dstHeight,
+ wxDC *source,
+ wxCoord xsrc, wxCoord ysrc,
+ wxCoord srcWidth, wxCoord srcHeight,
+ int rop = wxCOPY, bool useMask = false,
+ wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
+
// this is gnarly - we can't even call this function DoSetClippingRegion()
// because of virtual function hiding
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int fillStyle = wxODDEVEN_RULE);
+ virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
+ { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
#if wxUSE_PALETTE
class WXDLLEXPORT wxDCTemp : public wxDC
{
public:
- wxDCTemp(WXHDC hdc) : wxDC(hdc)
+ // construct a temporary DC with the specified HDC and size (it should be
+ // specified whenever we know it for this HDC)
+ wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize)
+ : wxDC(hdc),
+ m_size(size)
{
}
protected:
virtual void DoGetSize(int *w, int *h) const
{
- wxFAIL_MSG( _T("no way to retrieve the size of generic DC") );
+ wxASSERT_MSG( m_size.IsFullySpecified(),
+ _T("size of this DC hadn't been set and is unknown") );
if ( w )
- *w = 0;
+ *w = m_size.x;
if ( h )
- *h = 0;
+ *h = m_size.y;
}
private:
+ // size of this DC must be explicitly set by SetSize() as we have no way to
+ // find it ourselves
+ const wxSize m_size;
+
DECLARE_NO_COPY_CLASS(wxDCTemp)
};