#include "wx/fontutil.h"
#include "wx/gtk/private.h"
#include "wx/dynlib.h"
+#include "wx/paper.h"
#include <libgnomeprint/gnome-print.h>
#include <libgnomeprint/gnome-print-pango.h>
int w, h;
dc->GetSize(&w, &h);
printout->SetPageSizePixels((int)w, (int)h);
- dc->GetSizeMM(&w, &h);
- printout->SetPageSizeMM((int)w, (int)h);
-
+ printout->SetPaperRectPixels(wxRect(0, 0, w, h));
+ int mw, mh;
+ dc->GetSizeMM(&mw, &mh);
+ printout->SetPageSizeMM((int)mw, (int)mh);
printout->OnPreparePrinting();
// Get some parameters from the printout, if defined
m_signX = 1; // default x-axis left to right
m_signY = -1; // default y-axis bottom up -> top down
+
+ GetSize( NULL, &m_deviceOffsetY );
}
wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
m_signX = 1; // default x-axis left to right
m_signY = -1; // default y-axis bottom up -> top down
+
+ GetSize( NULL, &m_deviceOffsetY );
}
wxGnomePrintDC::~wxGnomePrintDC()
{
if (m_job)
- g_object_unref (job);
+ g_object_unref (m_job);
}
bool wxGnomePrintDC::IsOk() const
bool wxGnomePrintDC::StartDoc(const wxString& message)
{
- SetDeviceOrigin( 0,0 );
-
return true;
}
(wxGnomePrintNativeData*) m_printData.GetNativeData();
// Query page size. This seems to omit the margins
- // right now, although it shouldn't
double pw,ph;
gs_lgp->gnome_print_job_get_page_size( native->GetPrintJob(), &pw, &ph );
ComputeScaleAndOrigin();
}
-void wxGnomePrintDC::SetDeviceOrigin( wxCoord x, wxCoord y )
+void wxGnomePrintDC::SetLogicalOrigin( wxCoord x, wxCoord y )
{
- int h = 0;
- int w = 0;
- GetSize( &w, &h );
+ wxDC::SetLogicalOrigin( x, y );
+}
- wxDC::SetDeviceOrigin( x, h-y );
+void wxGnomePrintDC::SetDeviceOrigin( wxCoord x, wxCoord y )
+{
+ wxDC::SetDeviceOrigin( x, y );
}
void wxGnomePrintDC::SetResolution(int ppi)
m_pageWidth = sizeDevUnits.y;
m_pageHeight = sizeDevUnits.x;
m_previewPrintout->SetPageSizeMM(sizeMM.y, sizeMM.x);
- m_previewPrintout->SetPageSizePixels(m_pageWidth, m_pageHeight);
}
else
{
m_pageWidth = sizeDevUnits.x;
m_pageHeight = sizeDevUnits.y;
m_previewPrintout->SetPageSizeMM(sizeMM.x, sizeMM.y);
- m_previewPrintout->SetPageSizePixels(m_pageWidth, m_pageHeight);
}
+ m_previewPrintout->SetPageSizePixels(m_pageWidth, m_pageHeight);
+ m_previewPrintout->SetPaperRectPixels(wxRect(0, 0, m_pageWidth, m_pageHeight));
// At 100%, the page should look about page-size on the screen.
- m_previewScale = (float)0.8 * 72.0 / (float)wxGnomePrintDC::GetResolution();
+ m_previewScaleX = (float)0.8 * 72.0 / (float)wxGnomePrintDC::GetResolution();
+ m_previewScaleY = m_previewScaleX;
}
}