X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76c32e7b97bbd5d0c809dd59cba2926be016f7af..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/motif/dcclient.cpp?ds=inline diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 2176913c62..4622070bb8 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -141,11 +141,11 @@ void wxWindowDCImpl::Init() 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; @@ -161,7 +161,7 @@ wxWindowDCImpl::wxWindowDCImpl(wxDC *owner) 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(); @@ -222,10 +222,10 @@ wxWindowDCImpl::~wxWindowDCImpl() } 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); } @@ -471,7 +471,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo } void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, int fillStyle ) + wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -790,7 +790,7 @@ bool wxWindowDCImpl::CanDrawBitmap() const 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" ); @@ -836,7 +836,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, // Do bitmap scaling if necessary - wxBitmap *scaledBitmap = (wxBitmap*) NULL; + wxBitmap *scaledBitmap = NULL; Pixmap sourcePixmap = (Pixmap) NULL; double scaleX, scaleY; GetUserScale(& scaleX, & scaleY); @@ -879,7 +879,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, if (m_pixmap && sourcePixmap) { /* MATTHEW: [9] */ - int orig = m_logicalFunction; + wxRasterOperationMode orig = m_logicalFunction; SetLogicalFunction (rop); @@ -1584,7 +1584,7 @@ void wxWindowDCImpl::SetPen( const wxPen &pen ) case wxTRANSPARENT: default: style = LineSolid; - req_dash = (wxX11Dash*)NULL; + req_dash = NULL; req_nb_dash = 0; } @@ -1736,7 +1736,9 @@ void wxWindowDCImpl::SetPen( const wxPen &pen ) 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 @@ -1898,7 +1900,9 @@ void wxWindowDCImpl::SetBrush( const wxBrush &brush ) // 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); @@ -1926,7 +1930,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) m_backgroundPixel); } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -2099,7 +2103,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, } } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region ) { SetDCClipping(region.GetX11Region()); @@ -2110,10 +2114,10 @@ void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) 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); }