]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct checks for wxUSE_PRINTING_ARCHITECTURE and wxUSE_ENH_METAFILE.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Nov 2010 22:38:32 +0000 (22:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Nov 2010 22:38:32 +0000 (22:38 +0000)
Compilation fixes for building without one or both of these symbols.

See #12664.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/graphics.h
include/wx/msw/printwin.h
src/common/graphcmn.cpp
src/msw/graphics.cpp
src/msw/printwin.cpp

index b42c0ad1def8418603d2187522c39fd42c595434..af132850287a33f472eaa5499129cd9cd46b2820 100644 (file)
@@ -57,6 +57,8 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDC;
 class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
 #if wxUSE_PRINTING_ARCHITECTURE
 class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
+#endif
+#if wxUSE_ENH_METAFILE
 class WXDLLIMPEXP_FWD_CORE wxEnhMetaFileDC;
 #endif
 class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
@@ -393,10 +395,10 @@ public:
     static wxGraphicsContext * Create( const wxMemoryDC& dc);
 #if wxUSE_PRINTING_ARCHITECTURE
     static wxGraphicsContext * Create( const wxPrinterDC& dc);
-#ifdef __WXMSW__
+#endif
+#if wxUSE_ENH_METAFILE
     static wxGraphicsContext * Create( const wxEnhMetaFileDC& dc);
 #endif
-#endif // wxUSE_PRINTING_ARCHITECTURE
 
     static wxGraphicsContext* CreateFromNative( void * context );
 
@@ -714,10 +716,10 @@ public:
     virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0;
 #if wxUSE_PRINTING_ARCHITECTURE
     virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc) = 0;
-#ifdef __WXMSW__
+#endif
+#if wxUSE_ENH_METAFILE
     virtual wxGraphicsContext * CreateContext( const wxEnhMetaFileDC& dc) = 0;
 #endif
-#endif // wxUSE_PRINTING_ARCHITECTURE
 
     virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0;
 
index d515ef25a33cd0159ed64202c622dafcdc1a8c90..d902c42c464d4f53fac179a984443969a26478f5 100644 (file)
@@ -56,7 +56,9 @@ public:
     virtual void DetermineScaling();
 
 protected:
+#if wxUSE_ENH_METAFILE
     virtual bool RenderPageIntoBitmap(wxBitmap& bmp, int pageNum);
+#endif
 
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowsPrintPreview)
 };
index 0c24351e7e2b049f43a8a2b4e4cf476739fd64f1..99a42c8a958c84e6ff14e25cff6ce0e261eabbee 100644 (file)
@@ -870,16 +870,15 @@ wxGraphicsBitmap wxGraphicsContext::CreateSubBitmap( const wxGraphicsBitmap &bmp
 {
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
 }
+#endif
 
-#ifdef __WXMSW__
+#if wxUSE_ENH_METAFILE
 /* static */ wxGraphicsContext* wxGraphicsContext::Create( const wxEnhMetaFileDC& dc)
 {
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
 }
 #endif
 
-#endif // wxUSE_PRINTING_ARCHITECTURE
-
 wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context )
 {
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeContext(context);
index d0c3c643ba4645c564838fd01b4b466423daadfb..52c809b805eb19465d9776bd066d1b8f2648335d 100644 (file)
@@ -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 <commdlg.h>
@@ -1630,9 +1632,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 +1764,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 +1772,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 +1782,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)
 {
index 5dba0607ba10a0b252b2f5b3e0d779643066a950..9018f7de7031374093ceeb7ce31959bd100d4023 100644 (file)
@@ -49,8 +49,9 @@
 #include "wx/msw/printdlg.h"
 #include "wx/msw/private.h"
 #include "wx/msw/dcprint.h"
-#include "wx/msw/enhmeta.h"
-
+#if wxUSE_ENH_METAFILE
+    #include "wx/msw/enhmeta.h"
+#endif
 #include <stdlib.h>
 
 // ---------------------------------------------------------------------------
@@ -390,6 +391,7 @@ void wxWindowsPrintPreview::DetermineScaling()
     m_previewScaleY = float(logPPIScreenY) / logPPIPrinterY;
 }
 
+#if wxUSE_ENH_METAFILE
 bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum)
 {
     // The preview, as implemented in wxPrintPreviewBase (and as used prior to
@@ -435,7 +437,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum)
 
     return true;
 }
-
+#endif // wxUSE_ENH_METAFILE
 
 BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error))
 {