Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / print / XS / Printout.xs
1 #############################################################################
2 ## Name:        ext/print/XS/Printout.xs
3 ## Purpose:     XS for Wx::Printout & Wx::PrinterDC
4 ## Author:      Mattia Barbon
5 ## Modified by:
6 ## Created:     02/06/2001
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 #############################################################################
12
13 #include <wx/print.h>
14 #include <wx/dcprint.h>
15 #include "cpp/printout.h"
16
17 MODULE=Wx PACKAGE=Wx::PrinterDC
18
19 #if defined( __WXMSW__ )
20
21 wxPrinterDC*
22 wxPrinterDC::new( data )
23     wxPrintData* data
24   CODE:
25     RETVAL = new wxPrinterDC( *data );
26   OUTPUT:
27     RETVAL
28
29 wxRect*
30 wxPrinterDC::GetPaperRect()
31   CODE:
32     RETVAL = new wxRect( THIS->GetPaperRect() );
33   OUTPUT: RETVAL
34
35 #endif
36
37 MODULE=Wx PACKAGE=Wx::Printout
38
39 wxPrintout*
40 wxPrintout::new( title = wxT("Printout") )
41     wxString title
42   CODE:
43     RETVAL = new wxPlPrintout( CLASS, title );
44   OUTPUT:
45     RETVAL
46
47 void
48 wxPrintout::Destroy()
49   CODE:
50     delete THIS;
51
52 wxDC*
53 wxPrintout::GetDC()
54   OUTPUT:
55     RETVAL
56   CLEANUP:
57     wxPli_object_set_deleteable( aTHX_ ST(0), false );
58
59 void
60 wxPrintout::GetPageInfo()
61   PREINIT:
62     int minPage, maxPage, pageFrom, pageTo;
63   PPCODE:
64     THIS->wxPrintout::GetPageInfo( &minPage, &maxPage, &pageFrom, &pageTo );
65     EXTEND( SP, 4 );
66     PUSHs( sv_2mortal( newSViv( minPage ) ) );
67     PUSHs( sv_2mortal( newSViv( maxPage ) ) );
68     PUSHs( sv_2mortal( newSViv( pageFrom ) ) );
69     PUSHs( sv_2mortal( newSViv( pageTo ) ) );
70
71 void
72 wxPrintout::GetPageSizeMM()
73   PREINIT:
74     int w, h;
75   PPCODE:
76     THIS->GetPageSizeMM( &w, &h );
77     EXTEND( SP, 2 );
78     PUSHs( sv_2mortal( newSViv( w ) ) );
79     PUSHs( sv_2mortal( newSViv( h ) ) );
80
81 void
82 wxPrintout::GetPageSizePixels()
83   PREINIT:
84     int w, h;
85   PPCODE:
86     THIS->GetPageSizePixels( &w, &h );
87     EXTEND( SP, 2 );
88     PUSHs( sv_2mortal( newSViv( w ) ) );
89     PUSHs( sv_2mortal( newSViv( h ) ) );
90
91 void
92 wxPrintout::GetPPIPrinter()
93   PREINIT:
94     int w, h;
95   PPCODE:
96     THIS->GetPPIPrinter( &w, &h );
97     EXTEND( SP, 2 );
98     PUSHs( sv_2mortal( newSViv( w ) ) );
99     PUSHs( sv_2mortal( newSViv( h ) ) );
100
101 void
102 wxPrintout::GetPPIScreen()
103   PREINIT:
104     int w, h;
105   PPCODE:
106     THIS->GetPPIScreen( &w, &h );
107     EXTEND( SP, 2 );
108     PUSHs( sv_2mortal( newSViv( w ) ) );
109     PUSHs( sv_2mortal( newSViv( h ) ) );
110
111 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
112
113 wxRect*
114 wxPrintout::GetPaperRectPixels()
115   CODE:
116     RETVAL = new wxRect( THIS->GetPaperRectPixels() );
117   OUTPUT: RETVAL
118
119 #endif
120
121 wxString
122 wxPrintout::GetTitle()
123
124 bool
125 wxPrintout::HasPage( pageNum )
126     int pageNum
127   CODE:
128     RETVAL = THIS->wxPrintout::HasPage( pageNum );
129   OUTPUT:
130     RETVAL
131
132 bool
133 wxPrintout::IsPreview()
134
135 bool
136 wxPrintout::OnBeginDocument( startPage, endPage )
137     int startPage
138     int endPage
139   CODE:
140     RETVAL = THIS->wxPrintout::OnBeginDocument( startPage, endPage );
141   OUTPUT:
142     RETVAL
143
144 void
145 wxPrintout::OnEndDocument()
146   CODE:
147     THIS->wxPrintout::OnEndDocument();
148
149 void
150 wxPrintout::OnBeginPrinting()
151   CODE:
152     THIS->wxPrintout::OnBeginPrinting();
153
154 void
155 wxPrintout::OnEndPrinting()
156   CODE:
157     THIS->wxPrintout::OnEndPrinting();
158
159 void
160 wxPrintout::OnPreparePrinting()
161   CODE:
162     THIS->wxPrintout::OnPreparePrinting();
163
164 #bool
165 #wxPrintout::OnPrintPage( pageNum )
166 #    int pageNum
167 #  CODE:
168 #    RETVAL = THIS->wxPrintout::OnPrintPage( pageNum );
169 #  OUTPUT:
170 #    RETVAL
171
172 #if WXPERL_W_VERSION_GE( 2, 7, 2 )
173
174 void
175 wxPrintout::FitThisSizeToPaper( imageSize )
176     wxSize imageSize
177
178 void
179 wxPrintout::FitThisSizeToPage( imageSize )
180     wxSize imageSize
181
182 void
183 wxPrintout::FitThisSizeToPageMargins( imageSize, pageSetupData )
184     wxSize imageSize
185     wxPageSetupDialogData* pageSetupData
186   C_ARGS: imageSize, *pageSetupData
187
188 void
189 wxPrintout::MapScreenSizeToPaper()
190
191 void
192 wxPrintout::MapScreenSizeToPage()
193
194 void
195 wxPrintout::MapScreenSizeToPageMargins( pageSetupData )
196     wxPageSetupDialogData* pageSetupData
197   C_ARGS: *pageSetupData
198
199 void
200 wxPrintout::MapScreenSizeToDevice()
201
202 wxRect*
203 wxPrintout::GetLogicalPaperRect()
204   CODE:
205     RETVAL = new wxRect( THIS->GetLogicalPaperRect() );
206   OUTPUT: RETVAL
207
208 wxRect*
209 wxPrintout::GetLogicalPageRect()
210   CODE:
211     RETVAL = new wxRect( THIS->GetLogicalPageRect() );
212   OUTPUT: RETVAL
213
214 wxRect*
215 wxPrintout::GetLogicalPageMarginsRect( pageSetupData )
216     wxPageSetupDialogData* pageSetupData
217   CODE:
218     RETVAL = new wxRect( THIS->GetLogicalPageMarginsRect( *pageSetupData ) );
219   OUTPUT: RETVAL
220
221 void
222 wxPrintout::SetLogicalOrigin( x, y )
223     wxCoord x
224     wxCoord y
225
226 void
227 wxPrintout::OffsetLogicalOrigin( xoff, yoff )
228     wxCoord xoff
229     wxCoord yoff
230
231 #endif