1 /////////////////////////////////////////////////////////////////////////////
3 // Author: Robert Roebling
4 // Purpose: Implement GNOME printing support
6 // Copyright: Robert Roebling
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
10 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
11 #pragma implementation "gprint.h"
14 // For compilers that support precompilation, includes "wx/wx.h".
15 #include "wx/wxprec.h"
21 #include "wx/gtk/gnome/gprint.h"
23 #if wxUSE_LIBGNOMEPRINT
27 #include "wx/fontutil.h"
28 #include "wx/printdlg.h"
29 #include "wx/gtk/private.h"
31 #include <libgnomeprint/gnome-print.h>
32 #include <libgnomeprint/gnome-print-pango.h>
33 #include <libgnomeprintui/gnome-print-dialog.h>
35 //----------------------------------------------------------------------------
36 // wxGnomePrintNativeData
37 //----------------------------------------------------------------------------
39 IMPLEMENT_CLASS(wxGnomePrintNativeData
, wxPrintNativeDataBase
)
41 wxGnomePrintNativeData::wxGnomePrintNativeData()
43 m_config
= gnome_print_config_default();
44 m_job
= gnome_print_job_new( m_config
);
47 wxGnomePrintNativeData::~wxGnomePrintNativeData()
49 g_object_unref (G_OBJECT (m_config
));
50 g_object_unref (G_OBJECT (m_job
));
53 bool wxGnomePrintNativeData::TransferTo( wxPrintData
&data
)
59 bool wxGnomePrintNativeData::TransferFrom( const wxPrintData
&data
)
65 //----------------------------------------------------------------------------
66 // wxGnomePrintFactory
67 //----------------------------------------------------------------------------
69 wxPrinterBase
* wxGnomePrintFactory::CreatePrinter( wxPrintDialogData
*data
)
71 return new wxGnomePrinter( data
);
74 wxPrintPreviewBase
*wxGnomePrintFactory::CreatePrintPreview( wxPrintout
*preview
,
76 wxPrintDialogData
*data
)
78 return new wxPostScriptPrintPreview( preview
, printout
, data
);
81 wxPrintPreviewBase
*wxGnomePrintFactory::CreatePrintPreview( wxPrintout
*preview
,
85 return new wxPostScriptPrintPreview( preview
, printout
, data
);
88 wxPrintDialogBase
*wxGnomePrintFactory::CreatePrintDialog( wxWindow
*parent
,
89 wxPrintDialogData
*data
)
91 return new wxGnomePrintDialog( parent
, data
);
94 wxPrintDialogBase
*wxGnomePrintFactory::CreatePrintDialog( wxWindow
*parent
,
97 return new wxGnomePrintDialog( parent
, data
);
100 bool wxGnomePrintFactory::HasPrintSetupDialog()
105 wxDialog
*wxGnomePrintFactory::CreatePrintSetupDialog( wxWindow
*parent
, wxPrintData
*data
)
110 bool wxGnomePrintFactory::HasOwnPrintToFile()
115 bool wxGnomePrintFactory::HasPrinterLine()
120 wxString
wxGnomePrintFactory::CreatePrinterLine()
123 return wxEmptyString
;
126 bool wxGnomePrintFactory::HasStatusLine()
132 wxString
wxGnomePrintFactory::CreateStatusLine()
135 return wxEmptyString
;
138 wxPrintNativeDataBase
*wxGnomePrintFactory::CreatePrintNativeData()
140 return new wxGnomePrintNativeData
;
143 //----------------------------------------------------------------------------
144 // wxGnomePrintSetupDialog
145 //----------------------------------------------------------------------------
147 IMPLEMENT_CLASS(wxGnomePrintDialog
, wxPrintDialogBase
)
149 wxGnomePrintDialog::wxGnomePrintDialog( wxWindow
*parent
, wxPrintDialogData
*data
)
150 : wxPrintDialogBase(parent
, wxID_ANY
, _("Print"),
151 wxPoint(0, 0), wxSize(600, 600),
152 wxDEFAULT_DIALOG_STYLE
|
156 m_printDialogData
= *data
;
161 wxGnomePrintDialog::wxGnomePrintDialog( wxWindow
*parent
, wxPrintData
*data
)
162 : wxPrintDialogBase(parent
, wxID_ANY
, _("Print"),
163 wxPoint(0, 0), wxSize(600, 600),
164 wxDEFAULT_DIALOG_STYLE
|
168 m_printDialogData
= *data
;
173 void wxGnomePrintDialog::Init()
175 wxPrintData data
= m_printDialogData
.GetPrintData();
177 wxGnomePrintNativeData
*native
=
178 (wxGnomePrintNativeData
*) data
.GetNativeData();
180 m_widget
= gnome_print_dialog_new( native
->GetPrintJob(),
182 GNOME_PRINT_DIALOG_RANGE
|GNOME_PRINT_DIALOG_COPIES
);
185 wxGnomePrintDialog::~wxGnomePrintDialog()
190 int wxGnomePrintDialog::ShowModal()
192 // Transfer data from m_printDalogData to dialog here
194 int response
= gtk_dialog_run (GTK_DIALOG (m_widget
));
195 gtk_widget_destroy(m_widget
);
198 if (response
== GNOME_PRINT_DIALOG_RESPONSE_CANCEL
)
201 // Transfer data back here
206 wxDC
*wxGnomePrintDialog::GetPrintDC()
212 bool wxGnomePrintDialog::Validate()
217 bool wxGnomePrintDialog::TransferDataToWindow()
222 bool wxGnomePrintDialog::TransferDataFromWindow()
227 //----------------------------------------------------------------------------
229 //----------------------------------------------------------------------------
231 IMPLEMENT_CLASS(wxGnomePrinter
, wxPrinterBase
)
233 wxGnomePrinter::wxGnomePrinter( wxPrintDialogData
*data
) :
234 wxPrinterBase( data
)
239 wxGnomePrinter::~wxGnomePrinter()
243 bool wxGnomePrinter::Print(wxWindow
*parent
, wxPrintout
*printout
, bool prompt
)
247 sm_lastError
= wxPRINTER_ERROR
;
251 wxPrintData printdata
= GetPrintDialogData().GetPrintData();
252 wxGnomePrintNativeData
*data
=
253 (wxGnomePrintNativeData
*) printdata
.GetNativeData();
255 // The GnomePrintJob is temporarily stored in the
256 // native print data as the native print dialog
257 // needs to access it.
258 GnomePrintJob
*job
= data
->GetPrintJob();
259 m_gpc
= gnome_print_job_get_context (job
);
261 printout
->SetIsPreview(false);
263 if (m_printDialogData
.GetMinPage() < 1)
264 m_printDialogData
.SetMinPage(1);
265 if (m_printDialogData
.GetMaxPage() < 1)
266 m_printDialogData
.SetMaxPage(9999);
270 dc
= PrintDialog( parent
);
272 dc
= new wxGnomePrintDC( this );
276 gnome_print_job_close( job
);
277 sm_lastError
= wxPRINTER_ERROR
;
281 wxSize ScreenPixels
= wxGetDisplaySize();
282 wxSize ScreenMM
= wxGetDisplaySizeMM();
284 printout
->SetPPIScreen( (int) ((ScreenPixels
.GetWidth() * 25.4) / ScreenMM
.GetWidth()),
285 (int) ((ScreenPixels
.GetHeight() * 25.4) / ScreenMM
.GetHeight()) );
286 printout
->SetPPIPrinter( wxPostScriptDC::GetResolution(),
287 wxPostScriptDC::GetResolution() );
293 printout
->SetPageSizePixels((int)w
, (int)h
);
294 dc
->GetSizeMM(&w
, &h
);
295 printout
->SetPageSizeMM((int)w
, (int)h
);
297 printout
->OnPreparePrinting();
298 printout
->OnBeginPrinting();
300 if (!printout
->OnBeginDocument(0, 0))
302 sm_lastError
= wxPRINTER_ERROR
;
307 for (pn
= 1; pn
<= 2; pn
++)
310 printout
->OnPrintPage(pn
);
314 printout
->OnEndDocument();
315 printout
->OnEndPrinting();
318 gnome_print_job_close( job
);
319 gnome_print_job_print( job
);
323 return (sm_lastError
== wxPRINTER_NO_ERROR
);
326 wxDC
* wxGnomePrinter::PrintDialog( wxWindow
*parent
)
328 wxGnomePrintDialog
dialog( parent
, &m_printDialogData
);
329 if (dialog
.ShowModal() == wxID_CANCEL
)
331 sm_lastError
= wxPRINTER_ERROR
;
335 return new wxGnomePrintDC( this );
338 bool wxGnomePrinter::Setup( wxWindow
*parent
)
343 //-----------------------------------------------------------------------------
345 //-----------------------------------------------------------------------------
347 IMPLEMENT_CLASS(wxGnomePrintDC
, wxDCBase
)
349 wxGnomePrintDC::wxGnomePrintDC( wxGnomePrinter
*printer
)
353 m_gpc
= printer
->GetPrintContext();
355 m_layout
= gnome_print_pango_create_layout( m_gpc
);
356 m_fontdesc
= pango_font_description_from_string( "Sans 12" );
362 m_signX
= 1; // default x-axis left to right
363 m_signY
= -1; // default y-axis bottom up -> top down
366 wxGnomePrintDC::~wxGnomePrintDC()
370 bool wxGnomePrintDC::Ok() const
375 bool wxGnomePrintDC::DoFloodFill(wxCoord x1
, wxCoord y1
, const wxColour
&col
, int style
)
380 bool wxGnomePrintDC::DoGetPixel(wxCoord x1
, wxCoord y1
, wxColour
*col
) const
385 void wxGnomePrintDC::DoDrawLine(wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
)
387 if (m_pen
.GetStyle() == wxTRANSPARENT
) return;
391 gnome_print_moveto ( m_gpc
, XLOG2DEV(x1
), YLOG2DEV(y1
) );
392 gnome_print_lineto ( m_gpc
, XLOG2DEV(x2
), YLOG2DEV(y2
) );
393 gnome_print_stroke ( m_gpc
);
395 CalcBoundingBox( x1
, y1
);
396 CalcBoundingBox( x2
, y2
);
399 void wxGnomePrintDC::DoCrossHair(wxCoord x
, wxCoord y
)
403 void wxGnomePrintDC::DoDrawArc(wxCoord x1
,wxCoord y1
,wxCoord x2
,wxCoord y2
,wxCoord xc
,wxCoord yc
)
407 void wxGnomePrintDC::DoDrawEllipticArc(wxCoord x
,wxCoord y
,wxCoord w
,wxCoord h
,double sa
,double ea
)
411 void wxGnomePrintDC::DoDrawPoint(wxCoord x
, wxCoord y
)
415 void wxGnomePrintDC::DoDrawLines(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
)
419 void wxGnomePrintDC::DoDrawPolygon(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
, int fillStyle
)
423 void wxGnomePrintDC::DoDrawPolyPolygon(int n
, int count
[], wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
, int fillStyle
)
427 void wxGnomePrintDC::DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
429 if (m_brush
.GetStyle () != wxTRANSPARENT
)
433 gnome_print_newpath( m_gpc
);
434 gnome_print_moveto( m_gpc
, XLOG2DEV(x
), YLOG2DEV(y
) );
435 gnome_print_lineto( m_gpc
, XLOG2DEV(x
+ width
), YLOG2DEV(y
) );
436 gnome_print_lineto( m_gpc
, XLOG2DEV(x
+ width
), YLOG2DEV(y
+ height
) );
437 gnome_print_lineto( m_gpc
, XLOG2DEV(x
), YLOG2DEV(y
+ height
) );
438 gnome_print_closepath( m_gpc
);
439 gnome_print_fill( m_gpc
);
441 CalcBoundingBox( x
, y
);
442 CalcBoundingBox( x
+ width
, y
+ height
);
445 if (m_pen
.GetStyle () != wxTRANSPARENT
)
449 gnome_print_newpath( m_gpc
);
450 gnome_print_moveto( m_gpc
, XLOG2DEV(x
), YLOG2DEV(y
) );
451 gnome_print_lineto( m_gpc
, XLOG2DEV(x
+ width
), YLOG2DEV(y
) );
452 gnome_print_lineto( m_gpc
, XLOG2DEV(x
+ width
), YLOG2DEV(y
+ height
) );
453 gnome_print_lineto( m_gpc
, XLOG2DEV(x
), YLOG2DEV(y
+ height
) );
454 gnome_print_closepath( m_gpc
);
455 gnome_print_stroke( m_gpc
);
457 CalcBoundingBox( x
, y
);
458 CalcBoundingBox( x
+ width
, y
+ height
);
462 void wxGnomePrintDC::DoDrawRoundedRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
)
466 void wxGnomePrintDC::DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
470 void wxGnomePrintDC::DoDrawSpline(wxList
*points
)
474 bool wxGnomePrintDC::DoBlit(wxCoord xdest
, wxCoord ydest
, wxCoord width
, wxCoord height
,
475 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
, int rop
, bool useMask
,
476 wxCoord xsrcMask
, wxCoord ysrcMask
)
481 void wxGnomePrintDC::DoDrawIcon( const wxIcon
& icon
, wxCoord x
, wxCoord y
)
483 DoDrawBitmap( icon
, x
, y
, true );
486 void wxGnomePrintDC::DoDrawBitmap( const wxBitmap
& bitmap
, wxCoord x
, wxCoord y
, bool useMask
)
488 if (!bitmap
.Ok()) return;
490 if (bitmap
.HasPixbuf())
492 GdkPixbuf
*pixbuf
= bitmap
.GetPixbuf();
493 guchar
*raw_image
= gdk_pixbuf_get_pixels( pixbuf
);
494 bool has_alpha
= gdk_pixbuf_get_has_alpha( pixbuf
);
495 int rowstride
= gdk_pixbuf_get_rowstride( pixbuf
);
496 int height
= gdk_pixbuf_get_height( pixbuf
);
497 int width
= gdk_pixbuf_get_width( pixbuf
);
499 gnome_print_gsave( m_gpc
);
501 matrix
[0] = XLOG2DEVREL(width
);
504 matrix
[3] = YLOG2DEVREL(height
);
505 matrix
[4] = XLOG2DEV(x
);
506 matrix
[5] = YLOG2DEV(y
+height
);
507 gnome_print_concat( m_gpc
, matrix
);
508 gnome_print_moveto( m_gpc
, 0, 0 );
510 gnome_print_rgbaimage( m_gpc
, (guchar
*)raw_image
, width
, height
, rowstride
);
512 gnome_print_rgbimage( m_gpc
, (guchar
*)raw_image
, width
, height
, rowstride
);
513 gnome_print_grestore( m_gpc
);
517 wxImage image
= bitmap
.ConvertToImage();
519 if (!image
.Ok()) return;
521 gnome_print_gsave( m_gpc
);
523 matrix
[0] = XLOG2DEVREL(image
.GetWidth());
526 matrix
[3] = YLOG2DEVREL(image
.GetHeight());
527 matrix
[4] = XLOG2DEV(x
);
528 matrix
[5] = YLOG2DEV(y
+image
.GetHeight());
529 gnome_print_concat( m_gpc
, matrix
);
530 gnome_print_moveto( m_gpc
, 0, 0 );
531 gnome_print_rgbimage( m_gpc
, (guchar
*) image
.GetData(), image
.GetWidth(), image
.GetHeight(), image
.GetWidth()*3 );
532 gnome_print_grestore( m_gpc
);
536 void wxGnomePrintDC::DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
)
541 bool underlined
= m_font
.Ok() && m_font
.GetUnderlined();
544 const wxCharBuffer data
= wxConvUTF8
.cWC2MB( text
);
546 const wxWCharBuffer wdata
= wxConvLocal
.cMB2WC( text
);
549 const wxCharBuffer data
= wxConvUTF8
.cWC2MB( wdata
);
552 size_t datalen
= strlen((const char*)data
);
553 pango_layout_set_text( m_layout
, (const char*) data
, datalen
);
557 PangoAttrList
*attrs
= pango_attr_list_new();
558 PangoAttribute
*a
= pango_attr_underline_new(PANGO_UNDERLINE_SINGLE
);
560 a
->end_index
= datalen
;
561 pango_attr_list_insert(attrs
, a
);
562 pango_layout_set_attributes(m_layout
, attrs
);
563 pango_attr_list_unref(attrs
);
566 if (m_textForegroundColour
.Ok())
568 unsigned char red
= m_textForegroundColour
.Red();
569 unsigned char blue
= m_textForegroundColour
.Blue();
570 unsigned char green
= m_textForegroundColour
.Green();
572 // Set the equivalent PangoAttrStyle
577 if (fabs(m_scaleY
- 1.0) > 0.00001)
579 // If there is a user or actually any scale applied to
580 // the device context, scale the font.
582 // scale font description
583 gint oldSize
= pango_font_description_get_size( m_fontdesc
);
584 double size
= oldSize
;
585 size
= size
* m_scaleY
;
586 pango_font_description_set_size( m_fontdesc
, (gint
)size
);
588 // actually apply scaled font
589 pango_layout_set_font_description( m_layout
, m_fontdesc
);
591 pango_layout_get_pixel_size( m_layout
, &w
, &h
);
593 if ( m_backgroundMode
== wxSOLID
)
595 gdk_gc_set_foreground(m_textGC
, m_textBackgroundColour
.GetColor());
596 gdk_draw_rectangle(m_window
, m_textGC
, TRUE
, x
, y
, w
, h
);
597 gdk_gc_set_foreground(m_textGC
, m_textForegroundColour
.GetColor());
601 gnome_print_moveto (m_gpc
, x
, y
);
602 gnome_print_pango_layout( m_gpc
, m_layout
);
604 // reset unscaled size
605 pango_font_description_set_size( m_fontdesc
, oldSize
);
607 // actually apply unscaled font
608 pango_layout_set_font_description( m_layout
, m_fontdesc
);
612 pango_layout_get_pixel_size( m_layout
, &w
, &h
);
614 if ( m_backgroundMode
== wxSOLID
)
616 gdk_gc_set_foreground(m_textGC
, m_textBackgroundColour
.GetColor());
617 gdk_draw_rectangle(m_window
, m_textGC
, TRUE
, x
, y
, w
, h
);
618 gdk_gc_set_foreground(m_textGC
, m_textForegroundColour
.GetColor());
622 gnome_print_moveto (m_gpc
, x
, y
);
623 gnome_print_pango_layout( m_gpc
, m_layout
);
630 // undo underline attributes setting:
631 pango_layout_set_attributes(m_layout
, NULL
);
634 // CalcBoundingBox (x + width, y + height);
635 CalcBoundingBox (x
, y
);
638 void wxGnomePrintDC::DoDrawRotatedText(const wxString
& text
, wxCoord x
, wxCoord y
, double angle
)
642 void wxGnomePrintDC::Clear()
646 void wxGnomePrintDC::SetFont( const wxFont
& font
)
653 pango_font_description_free( m_fontdesc
);
655 m_fontdesc
= pango_font_description_copy( m_font
.GetNativeFontInfo()->description
);
657 pango_layout_set_font_description( m_layout
, m_fontdesc
);
661 void wxGnomePrintDC::SetPen( const wxPen
& pen
)
663 if (!pen
.Ok()) return;
665 // TODO: support for pen styles other than solid (use gnome_print_setdash)
669 gnome_print_setlinewidth( m_gpc
, XLOG2DEVREL( 1000 * m_pen
.GetWidth() ) / 1000.0f
);
671 unsigned char red
= m_pen
.GetColour().Red();
672 unsigned char blue
= m_pen
.GetColour().Blue();
673 unsigned char green
= m_pen
.GetColour().Green();
675 if (!(red
== m_currentRed
&& green
== m_currentGreen
&& blue
== m_currentBlue
))
677 double redPS
= (double)(red
) / 255.0;
678 double bluePS
= (double)(blue
) / 255.0;
679 double greenPS
= (double)(green
) / 255.0;
681 gnome_print_setrgbcolor( m_gpc
, redPS
, bluePS
, greenPS
);
684 m_currentBlue
= blue
;
685 m_currentGreen
= green
;
689 void wxGnomePrintDC::SetBrush( const wxBrush
& brush
)
691 if (!brush
.Ok()) return;
696 unsigned char red
= m_brush
.GetColour().Red();
697 unsigned char blue
= m_brush
.GetColour().Blue();
698 unsigned char green
= m_brush
.GetColour().Green();
702 // Anything not white is black
703 if (! (red
== (unsigned char) 255 &&
704 blue
== (unsigned char) 255 &&
705 green
== (unsigned char) 255) )
707 red
= (unsigned char) 0;
708 green
= (unsigned char) 0;
709 blue
= (unsigned char) 0;
714 if (!(red
== m_currentRed
&& green
== m_currentGreen
&& blue
== m_currentBlue
))
716 double redPS
= (double)(red
) / 255.0;
717 double bluePS
= (double)(blue
) / 255.0;
718 double greenPS
= (double)(green
) / 255.0;
720 gnome_print_setrgbcolor( m_gpc
, redPS
, bluePS
, greenPS
);
723 m_currentBlue
= blue
;
724 m_currentGreen
= green
;
728 void wxGnomePrintDC::SetLogicalFunction( int function
)
732 void wxGnomePrintDC::SetBackground( const wxBrush
& brush
)
736 void wxGnomePrintDC::DoSetClippingRegion(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
740 void wxGnomePrintDC::DestroyClippingRegion()
744 bool wxGnomePrintDC::StartDoc(const wxString
& message
)
746 SetDeviceOrigin( 0,0 );
751 void wxGnomePrintDC::EndDoc()
755 void wxGnomePrintDC::StartPage()
757 gnome_print_beginpage( m_gpc
, (const guchar
*) "1" );
760 void wxGnomePrintDC::EndPage()
762 gnome_print_showpage( m_gpc
);
765 wxCoord
wxGnomePrintDC::GetCharHeight() const
770 wxCoord
wxGnomePrintDC::GetCharWidth() const
775 void wxGnomePrintDC::DoGetTextExtent(const wxString
& string
, wxCoord
*width
, wxCoord
*height
,
777 wxCoord
*externalLeading
,
778 wxFont
*theFont
) const
786 if ( externalLeading
)
787 *externalLeading
= 0;
789 if (string
.IsEmpty())
794 // Set new font description
796 pango_layout_set_font_description( m_layout
, theFont
->GetNativeFontInfo()->description
);
800 const wxCharBuffer data
= wxConvUTF8
.cWC2MB( string
);
801 const char *dataUTF8
= (const char *)data
;
803 const wxWCharBuffer wdata
= wxConvLocal
.cMB2WC( string
);
806 if (width
) (*width
) = 0;
807 if (height
) (*height
) = 0;
810 const wxCharBuffer data
= wxConvUTF8
.cWC2MB( wdata
);
811 const char *dataUTF8
= (const char *)data
;
816 // hardly ideal, but what else can we do if conversion failed?
820 pango_layout_set_text( m_layout
, dataUTF8
, strlen(dataUTF8
) );
823 pango_layout_get_pixel_size( m_layout
, &w
, &h
);
826 *width
= (wxCoord
) w
;
828 *height
= (wxCoord
) h
;
831 PangoLayoutIter
*iter
= pango_layout_get_iter(m_layout
);
832 int baseline
= pango_layout_iter_get_baseline(iter
);
833 pango_layout_iter_free(iter
);
834 *descent
= h
- PANGO_PIXELS(baseline
);
837 // Reset old font description
839 pango_layout_set_font_description( m_layout
, m_fontdesc
);
842 void wxGnomePrintDC::DoGetSize(int* width
, int* height
) const
844 // No idea if that is efficient
845 GnomePrintConfig
*config
= gnome_print_config_default();
848 bool result
= gnome_print_config_get_page_size( config
, &w
, &h
);
852 // Standard PS resolution DIN A4 size.
863 void wxGnomePrintDC::DoGetSizeMM(int *width
, int *height
) const
867 /// Later, for now DIN A4
877 wxSize
wxGnomePrintDC::GetPPI() const
879 return wxSize(72,72);
882 void wxGnomePrintDC::SetAxisOrientation( bool xLeftRight
, bool yBottomUp
)
884 m_signX
= (xLeftRight
? 1 : -1);
885 m_signY
= (yBottomUp
? 1 : -1);
887 ComputeScaleAndOrigin();
890 void wxGnomePrintDC::SetDeviceOrigin( wxCoord x
, wxCoord y
)
896 wxDC::SetDeviceOrigin( x
, h
-y
);
899 void wxGnomePrintDC::SetResolution(int ppi
)
903 int wxGnomePrintDC::GetResolution()
909 class wxGnomePrintModule
: public wxModule
912 wxGnomePrintModule() {}
913 bool OnInit() { wxPrintFactory::SetPrintFactory( new wxGnomePrintFactory
); return true; }
917 DECLARE_DYNAMIC_CLASS(wxGnomePrintModule
)
920 IMPLEMENT_DYNAMIC_CLASS(wxGnomePrintModule
, wxModule
)
923 // wxUSE_LIBGNOMEPRINT