#include "wx/dcmemory.h"
#include "wx/math.h"
#include "wx/image.h"
+ #include "wx/dcclient.h"
#endif
#ifdef __VMS__
m_currentPenWidth = 1;
m_currentPenJoin = -1;
m_currentPenDashCount = -1;
- m_currentPenDash = (wxX11Dash*) NULL;
+ m_currentPenDash = NULL;
m_currentStyle = -1;
m_currentFill = -1;
m_colour = wxColourDisplay();
- m_display = (WXDisplay*) NULL;
+ m_display = NULL;
m_pixmap = (WXPixmap) 0;
m_autoSetting = 0;
m_ok = false;
wxWindowDCImpl::wxWindowDCImpl(wxDC *owner, wxWindow *window)
: wxMotifDCImpl(owner)
{
- wxASSERT_MSG( (window != (wxWindow*) NULL), "You must pass a valid wxWindow to wxWindowDCImpl/wxClientDCImpl/wxPaintDCImpl constructor." );
+ wxASSERT_MSG( (window != NULL), "You must pass a valid wxWindow to wxWindowDCImpl/wxClientDCImpl/wxPaintDCImpl constructor." );
Init();
}
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
- const wxColour & col, int style);
+ const wxColour & col, wxFloodFillStyle style);
bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y,
- const wxColour& col, int style)
+ const wxColour& col, wxFloodFillStyle style)
{
return wxDoFloodFill(GetOwner(), x, y, col, style);
}
}
void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
- wxCoord xoffset, wxCoord yoffset, int fillStyle )
+ wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle )
{
wxCHECK_RET( IsOk(), "invalid dc" );
bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
- int rop, bool useMask,
+ wxRasterOperationMode rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask )
{
wxCHECK_MSG( IsOk(), false, "invalid dc" );
// Do bitmap scaling if necessary
- wxBitmap *scaledBitmap = (wxBitmap*) NULL;
+ wxBitmap *scaledBitmap = NULL;
Pixmap sourcePixmap = (Pixmap) NULL;
double scaleX, scaleY;
GetUserScale(& scaleX, & scaleY);
if (m_pixmap && sourcePixmap)
{
/* MATTHEW: [9] */
- int orig = m_logicalFunction;
+ wxRasterOperationMode orig = m_logicalFunction;
SetLogicalFunction (rop);
case wxTRANSPARENT:
default:
style = LineSolid;
- req_dash = (wxX11Dash*)NULL;
+ req_dash = NULL;
req_nb_dash = 0;
}
pixel = m_backgroundPixel;
else
{
- pixel = CalculatePixel(m_pen.GetColour(), m_currentColour, false);
+ wxColour penClr = m_pen.GetColour();
+ pixel = CalculatePixel( penClr, m_currentColour, false);
+ m_pen.SetColour(penClr);
}
// Finally, set the GC to the required colour
// must test m_logicalFunction, because it involves background!
if (!sameColour || !GET_OPTIMIZATION || m_logicalFunction == wxXOR)
{
- WXPixel pixel = CalculatePixel(m_brush.GetColour(), m_currentColour, true);
+ wxColour brushClr = m_brush.GetColour();
+ WXPixel pixel = CalculatePixel( brushClr, m_currentColour, true);
+ m_brush.SetColour(brushClr);
if (pixel > -1)
SetForegroundPixelWithLogicalFunction(pixel);
m_backgroundPixel);
}
-void wxWindowDCImpl::SetLogicalFunction( int function )
+void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function )
{
wxCHECK_RET( IsOk(), "invalid dc" );
}
}
-void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region )
+void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region )
{
SetDCClipping(region.GetX11Region());
wxRect box = region.GetBox();
XRectangle rects[1];
- rects[0].x = (short)XLOG2DEV_2(box.x);
- rects[0].y = (short)YLOG2DEV_2(box.y);
- rects[0].width = (unsigned short)XLOG2DEVREL(box.width);
- rects[0].height = (unsigned short)YLOG2DEVREL(box.height);
+ rects[0].x = (short)box.x;
+ rects[0].y = (short)box.y;
+ rects[0].width = (unsigned short)box.width;
+ rects[0].height = (unsigned short)box.height;
XSetClipRectangles((Display*) m_display, (GC) m_gcBacking,
0, 0, rects, 1, Unsorted);
}