X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac4de069215bacaca1caec9c1d2bae476616e89b..cbcf084b0501737b4450d015853282d6193eb6f1:/src/mgl/dc.cpp diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index 2c48b7f256..ba6ff76f3c 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -4,7 +4,7 @@ // Author: Vaclav Slavik // Created: 2001/03/09 // RCS-ID: $Id$ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) +// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -16,7 +16,7 @@ // headers // --------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dc.h" #endif @@ -33,6 +33,7 @@ #endif #include "wx/fontutil.h" +#include "wx/encinfo.h" #include "wx/fontmap.h" #include "wx/mgl/private.h" #include "wx/log.h" @@ -47,6 +48,10 @@ // constants //----------------------------------------------------------------------------- +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + const double mm2inches = 0.0393700787402; const double inches2mm = 25.4; const double mm2twips = 56.6929133859; @@ -245,6 +250,7 @@ void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region) // check if the DC is scaled or moved, and if yes, then // convert rg to device coordinates: if ( m_deviceOriginX != 0 || m_deviceOriginY != 0 || + m_logicalOriginX != 0 || m_logicalOriginY != 0 || XLOG2DEVREL(500) != 500 || YLOG2DEVREL(500) != 500 ) { region_t *mrg = rg.GetMGLRegion().rgnPointer(); @@ -327,9 +333,13 @@ void wxDC::Clear() } } -void wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style) +extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, + const wxColour & col, int style); + +bool wxDC::DoFloodFill(wxCoord x, wxCoord y, + const wxColour& col, int style) { - wxFAIL_MSG( wxT("wxDC::DoFloodFill not implemented") ); + return wxDoFloodFill(this, x, y, col, style); } bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const @@ -553,6 +563,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { if ( !m_penSelected ) SelectPen(); + m_MGLDC->rect(xx + m_penOfsX, yy + m_penOfsY, xx + ww + m_penOfsX, yy + hh + m_penOfsY); } @@ -726,7 +737,7 @@ bool wxDC::SelectMGLFont() !wxTestFontEncoding(nativeEnc) ) { #if wxUSE_FONTMAP - if ( !wxTheFontMapper->GetAltForEncoding(encoding, &nativeEnc) ) + if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &nativeEnc) ) #endif { nativeEnc.mglEncoding = MGL_ENCODING_ASCII;