X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f32f3cea28e7f0dfe1618bced4d9648af26d6d7..f313deaa38ebd9d8a9a2755a105e12999dd5493c:/src/msw/graphics.cpp diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index d0c3c643ba..87c5d8602f 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -40,7 +40,9 @@ #include "wx/private/graphics.h" #include "wx/msw/wrapgdip.h" #include "wx/msw/dc.h" -#include "wx/msw/enhmeta.h" +#if wxUSE_ENH_METAFILE + #include "wx/msw/enhmeta.h" +#endif #include "wx/dcgraph.h" #include "wx/msw/private.h" // needs to be before #include @@ -514,7 +516,13 @@ wxGDIPlusPenData::wxGDIPlusPenData( wxGraphicsRenderer* renderer, const wxPen &p wxBitmap* bmp = pen.GetStipple(); if ( bmp && bmp->Ok() ) { - m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE()); + m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(), +#if wxUSE_PALETTE + (HPALETTE)bmp->GetPalette()->GetHPALETTE() +#else + NULL +#endif + ); m_penBrush = new TextureBrush(m_penImage); m_pen->SetBrush( m_penBrush ); } @@ -617,7 +625,13 @@ wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer , const wxB if ( bmp && bmp->Ok() ) { wxDELETE( m_brushImage ); - m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE()); + m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(), +#if wxUSE_PALETTE + (HPALETTE)bmp->GetPalette()->GetHPALETTE() +#else + NULL +#endif + ); m_brush = new TextureBrush(m_brushImage); } } @@ -753,7 +767,13 @@ wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, Bitmap* image = NULL; if ( bmp.GetMask() ) { - Bitmap interim((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE()) ; + Bitmap interim((HBITMAP)bmp.GetHBITMAP(), +#if wxUSE_PALETTE + (HPALETTE)bmp.GetPalette()->GetHPALETTE() +#else + NULL +#endif + ); size_t width = interim.GetWidth(); size_t height = interim.GetHeight(); @@ -809,7 +829,13 @@ wxGDIPlusBitmapData::wxGDIPlusBitmapData( wxGraphicsRenderer* renderer, } else { - image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(),(HPALETTE)bmp.GetPalette()->GetHPALETTE()); + image = Bitmap::FromHBITMAP((HBITMAP)bmp.GetHBITMAP(), +#if wxUSE_PALETTE + (HPALETTE)bmp.GetPalette()->GetHPALETTE() +#else + NULL +#endif + ); if ( bmp.HasAlpha() && GetPixelFormatSize(image->GetPixelFormat()) == 32 ) { size_t width = image->GetWidth(); @@ -1630,9 +1656,13 @@ public : virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc); +#if wxUSE_PRINTING_ARCHITECTURE virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc); +#endif +#if wxUSE_ENH_METAFILE virtual wxGraphicsContext * CreateContext( const wxEnhMetaFileDC& dc); +#endif virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ); @@ -1758,6 +1788,7 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxWindowDC& dc) return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y); } +#if wxUSE_PRINTING_ARCHITECTURE wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxPrinterDC& dc) { ENSURE_LOADED_OR_RETURN(NULL); @@ -1765,7 +1796,9 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxPrinterDC& dc) wxSize sz = dc.GetSize(); return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y); } +#endif +#if wxUSE_ENH_METAFILE wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxEnhMetaFileDC& dc) { ENSURE_LOADED_OR_RETURN(NULL); @@ -1773,6 +1806,7 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxEnhMetaFileDC& dc) wxSize sz = dc.GetSize(); return new wxGDIPlusContext(this,(HDC) msw->GetHDC(), sz.x, sz.y); } +#endif wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxMemoryDC& dc) {