// clipping
// ---------------------------------------------------------------------------
-
-#define DO_SET_CLIPPING_BOX(rg) \
-{ \
- wxRect rect = rg.GetBox(); \
- m_clipX1 = (wxCoord) XDEV2LOG(rect.GetLeft()); \
- m_clipY1 = (wxCoord) YDEV2LOG(rect.GetTop()); \
- m_clipX2 = (wxCoord) XDEV2LOG(rect.GetRight()); \
- m_clipY2 = (wxCoord) YDEV2LOG(rect.GetBottom()); \
-}
-
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
{
wxCHECK_RET( Ok(), wxT("invalid dc") );
wxSize size(GetSize());
+ wxASSERT_MSG( !m_clipping,
+ _T("narrowing clipping region not implemented yet") );
+
// NB: We intersect the clipping rectangle with surface's area here because
// DirectFB will return an error if you try to set clipping rectangle
// that is partially outside of the surface.
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
{
- // NB: this can be done because wxDFB only supports
- // rectangular regions
+ // NB: this can be done because wxDFB only supports rectangular regions
SetClippingRegion(region.AsRect());
}
{
SelectColour(m_brush.GetColour());
m_surface->FillRectangle(xx, yy, ww, hh);
- // restore pen's colour
+ // restore pen's colour, because other drawing functions expect the
+ // colour to be set to the pen:
SelectColour(m_pen.GetColour());
}
// if background mode is solid, DrawText must paint text's background:
if ( m_backgroundMode == wxSOLID )
{
- wxCHECK_RET( m_backgroundBrush.Ok(), wxT("invalid background brush") );
+ wxCHECK_RET( m_textBackgroundColour.Ok(),
+ wxT("invalid background color") );
- SelectColour(m_backgroundBrush.GetColour());
+ SelectColour(m_textBackgroundColour);
m_surface->FillRectangle(xx, yy, XLOG2DEVREL(w), YLOG2DEVREL(h));
- // restore pen's colour
- SelectColour(m_pen.GetColour());
}
// finally draw the text itself:
+ wxCHECK_RET( m_textForegroundColour.Ok(),
+ wxT("invalid foreground color") );
+ SelectColour(m_textForegroundColour);
m_surface->DrawString(wxSTR_TO_DFB(text), -1, xx, yy, DSTF_LEFT | DSTF_TOP);
+
+ // restore pen's colour, because other drawing functions expect the colour
+ // to be set to the pen:
+ SelectColour(m_pen.GetColour());
}
void wxDC::DoDrawRotatedText(const wxString& text,