]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/printmac.cpp
Use empty check consistent with other parts.
[wxWidgets.git] / src / mac / carbon / printmac.cpp
index 487123bad05789946a2f38482297635d1bf4b00a..f7238e84ce68a9501149e89bbe747d6905a77083 100644 (file)
@@ -9,19 +9,19 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "printwin.h"
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_PRINTING_ARCHITECTURE
+
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
 
-#include "wx/defs.h"
-
 #ifndef WX_PRECOMP
 #include "wx/utils.h"
 #include "wx/dc.h"
 #include "wx/msgdlg.h"
 #endif
 
+#include "wx/math.h"
 #include "wx/mac/uma.h"
 
 #include "wx/mac/printmac.h"
 #include "wx/mac/private/print.h"
 
-#define mm2pt            2.83464566929
-#define pt2mm            0.352777777778
-
 #include "wx/dcprint.h"
 #include "wx/printdlg.h"
+#include "wx/mac/printdlg.h"
 
 #include <stdlib.h>
 
@@ -144,7 +143,7 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintData* data )
     // collate cannot be set
 #if 0 // not yet tested
     if ( m_printerName.Length() > 0 )
-        PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName ) ) ;
+        PMSessionSetCurrentPrinter( (PMPrintSession) m_macPrintSession , wxMacCFStringHolder( m_printerName , wxFont::GetDefaultEncoding() ) ) ;
 #endif
     PMColorMode color ;
     PMGetColorMode(  (PMPrintSettings) m_macPrintSettings, &color ) ;
@@ -555,7 +554,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
         if (dialog.ShowModal() == wxID_OK)
         {
             dc = dialog.GetPrintDC();
-            m_printDialogData = dialog.GetPrintData();
+            m_printDialogData = dialog.GetPrintDialogData();
         }
     }
     else
@@ -648,12 +647,15 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
             }
             else
             {
-// #if !TARGET_CARBON
-                GrafPtr thePort ;
-                GetPort( &thePort ) ;
-                wxSafeYield(win,true);
-                SetPort( thePort ) ;
-// #endif                
+#if TARGET_CARBON
+                if ( UMAGetSystemVersion() >= 0x1000 )
+#endif
+                {
+                    GrafPtr thePort ;
+                    GetPort( &thePort ) ;
+                    wxSafeYield(win,true);
+                    SetPort( thePort ) ;
+                }
                 dc->StartPage();
                 keepGoing = printout->OnPrintPage(pn);
                 dc->EndPage();
@@ -696,6 +698,7 @@ wxDC* wxMacPrinter::PrintDialog(wxWindow *parent)
 
 bool wxMacPrinter::Setup(wxWindow *parent)
 {
+#if 0
     wxPrintDialog dialog(parent, & m_printDialogData);
     dialog.GetPrintDialogData().SetSetupDialog(TRUE);
     
@@ -707,6 +710,8 @@ bool wxMacPrinter::Setup(wxWindow *parent)
     }
     
     return (ret == wxID_OK);
+#endif
+    return wxID_CANCEL;
 }
 
 /*
@@ -776,3 +781,5 @@ void wxMacPrintPreview::DetermineScaling(void)
     
     m_previewScale = 1 ;
 }
+
+#endif