// Author: Anthony Bretaudeau
// Purpose: GTK printing support
// Created: 2007-08-25
-// RCS-ID: $Id$
// Copyright: (c) 2007 wxWidgets development team
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/dynlib.h"
#include "wx/paper.h"
#include "wx/scopeguard.h"
+#include "wx/modalhook.h"
#include <gtk/gtk.h>
#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.
//----------------------------------------------------------------------------
// 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
public:
wxGtkPrintModule()
{
-#if wxUSE_LIBGNOMEPRINT
- // This module must be initialized AFTER gnomeprint's one
- AddDependency(wxCLASSINFO(wxGnomePrintModule));
-#endif
}
bool OnInit();
void OnExit() {}
// 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 =
int wxGtkPageSetupDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
// Get the config.
m_pageDialogData.GetPrintData().ConvertToNative();
wxGtkPrintNativeData *native = (wxGtkPrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
void* wxGtkPrinterDCImpl::GetCairoContext() const
{
- return (void*) cairo_reference( m_cairo );
+ return m_cairo;
}
void* wxGtkPrinterDCImpl::GetHandle() const
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;
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)
{
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)
{