X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/faa9a600f4ee45757039be01acb0865d1bbae957..0d1903dbda864780eec30efdc4e91776bdbfd21b:/src/motif/dcclient.cpp diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index ee4e22a33a..820fe96358 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 01/02/97 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -46,6 +45,7 @@ #include "wx/dcmemory.h" #include "wx/math.h" #include "wx/image.h" + #include "wx/dcclient.h" #endif #ifdef __VMS__ @@ -140,11 +140,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; @@ -160,7 +160,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(); @@ -221,10 +221,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); } @@ -437,7 +437,7 @@ void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y ) CalcBoundingBox (x, y); } -void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset ) +void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -469,8 +469,8 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo } } -void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, int fillStyle ) +void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[], + wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -789,7 +789,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" ); @@ -835,7 +835,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); @@ -878,7 +878,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, if (m_pixmap && sourcePixmap) { /* MATTHEW: [9] */ - int orig = m_logicalFunction; + wxRasterOperationMode orig = m_logicalFunction; SetLogicalFunction (rop); @@ -1583,7 +1583,7 @@ void wxWindowDCImpl::SetPen( const wxPen &pen ) case wxTRANSPARENT: default: style = LineSolid; - req_dash = (wxX11Dash*)NULL; + req_dash = NULL; req_nb_dash = 0; } @@ -1735,7 +1735,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 @@ -1897,7 +1899,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); @@ -1925,7 +1929,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) m_backgroundPixel); } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -2098,7 +2102,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, } } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region ) { SetDCClipping(region.GetX11Region()); @@ -2109,10 +2113,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); }