1 #############################################################################
2 ## Name: ext/print/XS/Printout.xs
3 ## Purpose: XS for Wx::Printout & Wx::PrinterDC
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: Printout.xs 2315 2008-01-18 21:47:17Z mbarbon $
8 ## Copyright: (c) 2001-2002, 2004, 2008 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
14 #include <wx/dcprint.h>
15 #include "cpp/printout.h"
17 MODULE=Wx PACKAGE=Wx::PrinterDC
19 #if defined( __WXMSW__ )
22 wxPrinterDC::new( data )
25 RETVAL = new wxPrinterDC( *data );
30 wxPrinterDC::GetPaperRect()
32 RETVAL = new wxRect( THIS->GetPaperRect() );
37 MODULE=Wx PACKAGE=Wx::Printout
40 wxPrintout::new( title = wxT("Printout") )
43 RETVAL = new wxPlPrintout( CLASS, title );
57 wxPli_object_set_deleteable( aTHX_ ST(0), false );
60 wxPrintout::GetPageInfo()
62 int minPage, maxPage, pageFrom, pageTo;
64 THIS->wxPrintout::GetPageInfo( &minPage, &maxPage, &pageFrom, &pageTo );
66 PUSHs( sv_2mortal( newSViv( minPage ) ) );
67 PUSHs( sv_2mortal( newSViv( maxPage ) ) );
68 PUSHs( sv_2mortal( newSViv( pageFrom ) ) );
69 PUSHs( sv_2mortal( newSViv( pageTo ) ) );
72 wxPrintout::GetPageSizeMM()
76 THIS->GetPageSizeMM( &w, &h );
78 PUSHs( sv_2mortal( newSViv( w ) ) );
79 PUSHs( sv_2mortal( newSViv( h ) ) );
82 wxPrintout::GetPageSizePixels()
86 THIS->GetPageSizePixels( &w, &h );
88 PUSHs( sv_2mortal( newSViv( w ) ) );
89 PUSHs( sv_2mortal( newSViv( h ) ) );
92 wxPrintout::GetPPIPrinter()
96 THIS->GetPPIPrinter( &w, &h );
98 PUSHs( sv_2mortal( newSViv( w ) ) );
99 PUSHs( sv_2mortal( newSViv( h ) ) );
102 wxPrintout::GetPPIScreen()
106 THIS->GetPPIScreen( &w, &h );
108 PUSHs( sv_2mortal( newSViv( w ) ) );
109 PUSHs( sv_2mortal( newSViv( h ) ) );
111 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
114 wxPrintout::GetPaperRectPixels()
116 RETVAL = new wxRect( THIS->GetPaperRectPixels() );
122 wxPrintout::GetTitle()
125 wxPrintout::HasPage( pageNum )
128 RETVAL = THIS->wxPrintout::HasPage( pageNum );
133 wxPrintout::IsPreview()
136 wxPrintout::OnBeginDocument( startPage, endPage )
140 RETVAL = THIS->wxPrintout::OnBeginDocument( startPage, endPage );
145 wxPrintout::OnEndDocument()
147 THIS->wxPrintout::OnEndDocument();
150 wxPrintout::OnBeginPrinting()
152 THIS->wxPrintout::OnBeginPrinting();
155 wxPrintout::OnEndPrinting()
157 THIS->wxPrintout::OnEndPrinting();
160 wxPrintout::OnPreparePrinting()
162 THIS->wxPrintout::OnPreparePrinting();
165 #wxPrintout::OnPrintPage( pageNum )
168 # RETVAL = THIS->wxPrintout::OnPrintPage( pageNum );
172 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
175 wxPrintout::FitThisSizeToPaper( imageSize )
179 wxPrintout::FitThisSizeToPage( imageSize )
183 wxPrintout::FitThisSizeToPageMargins( imageSize, pageSetupData )
185 wxPageSetupDialogData* pageSetupData
186 C_ARGS: imageSize, *pageSetupData
189 wxPrintout::MapScreenSizeToPaper()
192 wxPrintout::MapScreenSizeToPage()
195 wxPrintout::MapScreenSizeToPageMargins( pageSetupData )
196 wxPageSetupDialogData* pageSetupData
197 C_ARGS: *pageSetupData
200 wxPrintout::MapScreenSizeToDevice()
203 wxPrintout::GetLogicalPaperRect()
205 RETVAL = new wxRect( THIS->GetLogicalPaperRect() );
209 wxPrintout::GetLogicalPageRect()
211 RETVAL = new wxRect( THIS->GetLogicalPageRect() );
215 wxPrintout::GetLogicalPageMarginsRect( pageSetupData )
216 wxPageSetupDialogData* pageSetupData
218 RETVAL = new wxRect( THIS->GetLogicalPageMarginsRect( *pageSetupData ) );
222 wxPrintout::SetLogicalOrigin( x, y )
227 wxPrintout::OffsetLogicalOrigin( xoff, yoff )