]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/print.cpp
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / gtk / print.cpp
index d3ffb65e26cb8ae4cc07d570a4c5e4e9180b28a0..d776a88b52554f7ec2b953bef2c246e4a98ce225 100644 (file)
@@ -3,7 +3,6 @@
 // Author:      Anthony Bretaudeau
 // Purpose:     GTK printing support
 // Created:     2007-08-25
 // Author:      Anthony Bretaudeau
 // Purpose:     GTK printing support
 // Created:     2007-08-25
-// RCS-ID:      $Id$
 // Copyright:   (c) 2007 wxWidgets development team
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2007 wxWidgets development team
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
@@ -34,6 +33,7 @@
 #include "wx/dynlib.h"
 #include "wx/paper.h"
 #include "wx/scopeguard.h"
 #include "wx/dynlib.h"
 #include "wx/paper.h"
 #include "wx/scopeguard.h"
+#include "wx/modalhook.h"
 
 #include <gtk/gtk.h>
 
 
 #include <gtk/gtk.h>
 
 #include "wx/link.h"
 wxFORCE_LINK_THIS_MODULE(gtk_print)
 
 #include "wx/link.h"
 wxFORCE_LINK_THIS_MODULE(gtk_print)
 
-#if wxUSE_LIBGNOMEPRINT
-#include "wx/gtk/gnome/gprint.h"
-#endif
-
 #include "wx/gtk/private/object.h"
 
 // Useful to convert angles from/to Rad to/from Deg.
 #include "wx/gtk/private/object.h"
 
 // Useful to convert angles from/to Rad to/from Deg.
@@ -64,8 +60,7 @@ static const double DEG2RAD  = M_PI / 180.0;
 //----------------------------------------------------------------------------
 // wxGtkPrintModule
 // Initialized when starting the app : if it successfully load the gtk-print framework,
 //----------------------------------------------------------------------------
 // wxGtkPrintModule
 // Initialized when starting the app : if it successfully load the gtk-print framework,
-// it uses it. If not, it falls back to gnome print (see /gtk/gnome/gprint.cpp) then
-// to postscript if gnomeprint is not available.
+// it uses it. If not, it falls back to Postscript.
 //----------------------------------------------------------------------------
 
 class wxGtkPrintModule: public wxModule
 //----------------------------------------------------------------------------
 
 class wxGtkPrintModule: public wxModule
@@ -73,10 +68,6 @@ class wxGtkPrintModule: public wxModule
 public:
     wxGtkPrintModule()
     {
 public:
     wxGtkPrintModule()
     {
-#if wxUSE_LIBGNOMEPRINT
-        // This module must be initialized AFTER gnomeprint's one
-        AddDependency(wxCLASSINFO(wxGnomePrintModule));
-#endif
     }
     bool OnInit();
     void OnExit() {}
     }
     bool OnInit();
     void OnExit() {}
@@ -623,6 +614,8 @@ wxGtkPrintDialog::~wxGtkPrintDialog()
 // This is called even if we actually don't want the dialog to appear.
 int wxGtkPrintDialog::ShowModal()
 {
 // This is called even if we actually don't want the dialog to appear.
 int wxGtkPrintDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     // We need to restore the settings given in the constructor.
     wxPrintData data = m_printDialogData.GetPrintData();
     wxGtkPrintNativeData *native =
     // We need to restore the settings given in the constructor.
     wxPrintData data = m_printDialogData.GetPrintData();
     wxGtkPrintNativeData *native =
@@ -747,6 +740,8 @@ wxGtkPageSetupDialog::~wxGtkPageSetupDialog()
 
 int wxGtkPageSetupDialog::ShowModal()
 {
 
 int wxGtkPageSetupDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     // Get the config.
     m_pageDialogData.GetPrintData().ConvertToNative();
     wxGtkPrintNativeData *native = (wxGtkPrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
     // Get the config.
     m_pageDialogData.GetPrintData().ConvertToNative();
     wxGtkPrintNativeData *native = (wxGtkPrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
@@ -1205,7 +1200,7 @@ bool wxGtkPrinterDCImpl::IsOk() const
 
 void* wxGtkPrinterDCImpl::GetCairoContext() const
 {
 
 void* wxGtkPrinterDCImpl::GetCairoContext() const
 {
-    return (void*) cairo_reference( m_cairo );
+    return m_cairo;
 }
 
 void* wxGtkPrinterDCImpl::GetHandle() const
 }
 
 void* wxGtkPrinterDCImpl::GetHandle() const
@@ -1452,7 +1447,7 @@ void wxGtkPrinterDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
     CalcBoundingBox( x, y );
 }
 
     CalcBoundingBox( x, y );
 }
 
-void wxGtkPrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+void wxGtkPrinterDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
 {
     if ( m_pen.IsTransparent() )
         return;
 {
     if ( m_pen.IsTransparent() )
         return;
@@ -1474,7 +1469,7 @@ void wxGtkPrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, w
     cairo_stroke ( m_cairo);
 }
 
     cairo_stroke ( m_cairo);
 }
 
-void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
+void wxGtkPrinterDCImpl::DoDrawPolygon(int n, const wxPoint points[],
                                        wxCoord xoffset, wxCoord yoffset,
                                        wxPolygonFillMode fillStyle)
 {
                                        wxCoord xoffset, wxCoord yoffset,
                                        wxPolygonFillMode fillStyle)
 {
@@ -1510,7 +1505,7 @@ void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
     cairo_restore(m_cairo);
 }
 
     cairo_restore(m_cairo);
 }
 
-void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[],
+void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
                                            wxCoord xoffset, wxCoord yoffset,
                                            wxPolygonFillMode fillStyle)
 {
                                            wxCoord xoffset, wxCoord yoffset,
                                            wxPolygonFillMode fillStyle)
 {