class WXDLLIMPEXP_FWD_CORE wxWindowDC;
class WXDLLIMPEXP_FWD_CORE wxScreenDC;
class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
+class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
+#include "wx/cmndata.h"
#else
class WXDLLIMPEXP_FWD_CORE wxDCBase;
#endif
virtual wxImplDC* CreateMemoryDC( wxMemoryDC *owner, wxBitmap &bitmap ) = 0;
virtual wxImplDC* CreateMemoryDC( wxMemoryDC *owner, wxDC *dc ) = 0;
virtual wxImplDC* CreateScreenDC( wxScreenDC *owner ) = 0;
+ virtual wxImplDC* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) = 0;
static void SetDCFactory( wxDCFactory *factory );
static wxDCFactory *GetFactory();
virtual wxImplDC* CreateMemoryDC( wxMemoryDC *owner, wxBitmap &bitmap );
virtual wxImplDC* CreateMemoryDC( wxMemoryDC *owner, wxDC *dc );
virtual wxImplDC* CreateScreenDC( wxScreenDC *owner );
+ virtual wxImplDC* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data );
};
//-----------------------------------------------------------------------------
#if wxUSE_PRINTING_ARCHITECTURE
+#if wxUSE_NEW_DC
+
+#include "wx/dc.h"
+
+//-----------------------------------------------------------------------------
+// wxPrinterDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxPrinterImplDCBase
+{
+public:
+ wxPrinterImplDCBase() { }
+
+ virtual wxRect DoGetPaperRect() = 0;
+};
+
+
+class WXDLLIMPEXP_CORE wxPrinterDC: public wxDC
+{
+public:
+ wxPrinterDC( const wxPrintData& data );
+
+ wxRect GetPaperRect();
+};
+
+#else
+
+
#if defined(__WXPALMOS__)
#include "wx/palmos/dcprint.h"
#elif defined(__WXMSW__)
#include "wx/mac/dcprint.h"
#endif
+#endif // wxUSE_NEW_DC
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_DCPRINT_H_BASE_
#include "wx/os2/dcscreen.h"
#endif
+
#endif
// _WX_DCSCREEN_H_BASE_
};
//-----------------------------------------------------------------------------
-// wxGnomePrintDC
+// wxGnomePrinterDC
//-----------------------------------------------------------------------------
-class wxGnomePrintDC: public wxDC
+class wxGnomePrinterDC: public wxDC
{
public:
- wxGnomePrintDC( const wxPrintData& data );
- virtual ~wxGnomePrintDC();
+ wxGnomePrinterDC( const wxPrintData& data );
+ virtual ~wxGnomePrinterDC();
bool Ok() const { return IsOk(); }
bool IsOk() const;
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
#if wxUSE_SPLINES
void DoDrawSpline(const wxPointList *points);
-#endif // wxUSE_SPLINES
+#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
void makeEllipticalPath(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
private:
- DECLARE_DYNAMIC_CLASS(wxGnomePrintDC)
- DECLARE_NO_COPY_CLASS(wxGnomePrintDC)
+ DECLARE_DYNAMIC_CLASS(wxGnomePrinterDC)
+ DECLARE_NO_COPY_CLASS(wxGnomePrinterDC)
};
// ----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
-// wxGtkPrintDC
+// wxGtkPrinterDC
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxGtkPrintDC: public wxDC
+class WXDLLIMPEXP_CORE wxGtkPrinterDC: public wxDC
{
public:
- wxGtkPrintDC( const wxPrintData& data );
- virtual ~wxGtkPrintDC();
+ wxGtkPrinterDC( const wxPrintData& data );
+ virtual ~wxGtkPrinterDC();
bool Ok() const { return IsOk(); }
bool IsOk() const;
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
#if wxUSE_SPLINES
void DoDrawSpline(const wxPointList *points);
-#endif // wxUSE_SPLINES
+#endif
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
double m_PS2DEV;
double m_DEV2PS;
- DECLARE_DYNAMIC_CLASS(wxGtkPrintDC)
- DECLARE_NO_COPY_CLASS(wxGtkPrintDC)
+ DECLARE_DYNAMIC_CLASS(wxGtkPrinterDC)
+ DECLARE_NO_COPY_CLASS(wxGtkPrinterDC)
};
// ----------------------------------------------------------------------------
#endif
}
+wxImpleDC *wxNativeDCFactory::CreatePrinterDC( wxPrinterDC *ownder, const wxPrintData &data )
+{
+#if defined(__WXMSW__)
+ return new wxWindowsPrinterImplDC( owner );
+#elif defined(__WXGTK20__)
+ return new wxGTKPrinterImplDC( owner );
+#elif defined(__WXGTK__)
+ return new wxGTKPrinterImplDC( owner );
+#elif defined(__WXMAC__)
+ return new wxMacPrinterImplDC( owner );
+#elif defined(__WXCOCOA__)
+ return new wxCocoaPrinterImplDC( owner );
+#elif defined(__WXMOTIF__)
+ return new wxMotifPrinterImplDC( owner );
+#elif defined(__WXX11__)
+ return new wxX11PrinterImplDC( owner );
+#elif defined(__WXMGL__)
+ return new wxMGLPrinterImplDC( owner );
+#elif defined(__WXDFB__)
+ return new wxDFBPrinterImplDC( owner );
+#elif defined(__WXPM__)
+ return new wxPMPrinterImplDC( owner );
+#elif defined(__PALMOS__)
+ return new wxPalmPrinterImplDC( owner );
+#endif
+}
+
//-----------------------------------------------------------------------------
// wxWindowDC
//-----------------------------------------------------------------------------
wxDC* wxGnomePrintFactory::CreatePrinterDC( const wxPrintData& data )
{
- return new wxGnomePrintDC(data);
+ return new wxGnomePrinterDC(data);
}
bool wxGnomePrintFactory::HasOwnPrintToFile()
if (prompt)
dc = PrintDialog( parent );
else
- dc = new wxGnomePrintDC( printdata );
+ dc = new wxGnomePrinterDC( printdata );
if (m_native_preview)
printout->SetIsPreview(true);
printout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
- printout->SetPPIPrinter( wxGnomePrintDC::GetResolution(),
- wxGnomePrintDC::GetResolution() );
+ printout->SetPPIPrinter( wxGnomePrinterDC::GetResolution(),
+ wxGnomePrinterDC::GetResolution() );
printout->SetDC(dc);
m_native_preview = ret == wxID_PREVIEW;
m_printDialogData = dialog.GetPrintDialogData();
- return new wxGnomePrintDC( m_printDialogData.GetPrintData() );
+ return new wxGnomePrinterDC( m_printDialogData.GetPrintData() );
}
bool wxGnomePrinter::Setup(wxWindow * WXUNUSED(parent))
}
//-----------------------------------------------------------------------------
-// wxGnomePrintDC
+// wxGnomePrinterDC
//-----------------------------------------------------------------------------
// conversion
#define YLOG2DEV(x) ((m_pageHeight - (double)LogicalToDeviceY(x)) * DEV2PS)
#define YLOG2DEVREL(x) ((double)(LogicalToDeviceYRel(x)) * DEV2PS)
-IMPLEMENT_CLASS(wxGnomePrintDC, wxDC)
+IMPLEMENT_CLASS(wxGnomePrinterDC, wxDC)
-wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
+wxGnomePrinterDC::wxGnomePrinterDC( const wxPrintData& data )
{
m_printData = data;
m_pageHeight = ph * PS2DEV;
}
-wxGnomePrintDC::~wxGnomePrintDC()
+wxGnomePrinterDC::~wxGnomePrinterDC()
{
}
-bool wxGnomePrintDC::IsOk() const
+bool wxGnomePrinterDC::IsOk() const
{
return true;
}
bool
-wxGnomePrintDC::DoFloodFill(wxCoord WXUNUSED(x1),
+wxGnomePrinterDC::DoFloodFill(wxCoord WXUNUSED(x1),
wxCoord WXUNUSED(y1),
const wxColour& WXUNUSED(col),
int WXUNUSED(style))
}
bool
-wxGnomePrintDC::DoGetPixel(wxCoord WXUNUSED(x1),
+wxGnomePrinterDC::DoGetPixel(wxCoord WXUNUSED(x1),
wxCoord WXUNUSED(y1),
wxColour * WXUNUSED(col)) const
{
return false;
}
-void wxGnomePrintDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
+void wxGnomePrinterDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
CalcBoundingBox( x2, y2 );
}
-void wxGnomePrintDC::DoCrossHair(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
+void wxGnomePrinterDC::DoCrossHair(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{
}
-void wxGnomePrintDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc)
+void wxGnomePrinterDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc)
{
double dx = x1 - xc;
double dy = y1 - yc;
CalcBoundingBox (xc, yc);
}
-void wxGnomePrintDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
+void wxGnomePrinterDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
{
x += w/2;
y += h/2;
CalcBoundingBox( x+w, y+h );
}
-void wxGnomePrintDC::DoDrawPoint(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
+void wxGnomePrinterDC::DoDrawPoint(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
{
}
-void wxGnomePrintDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+void wxGnomePrinterDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
gs_libGnomePrint->gnome_print_stroke ( m_gpc);
}
-void wxGnomePrintDC::DoDrawPolygon(int n, wxPoint points[],
+void wxGnomePrinterDC::DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int WXUNUSED(fillStyle))
{
}
}
-void wxGnomePrintDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
+void wxGnomePrinterDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
{
wxDC::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
}
-void wxGnomePrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGnomePrinterDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
width--;
height--;
}
}
-void wxGnomePrintDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
+void wxGnomePrinterDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{
width--;
height--;
}
}
-void wxGnomePrintDC::makeEllipticalPath(wxCoord x, wxCoord y,
+void wxGnomePrinterDC::makeEllipticalPath(wxCoord x, wxCoord y,
wxCoord width, wxCoord height)
{
double r = 4 * (sqrt(2.) - 1) / 3;
gs_libGnomePrint->gnome_print_closepath(m_gpc);
}
-void wxGnomePrintDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGnomePrinterDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
width--;
height--;
}
#if wxUSE_SPLINES
-void wxGnomePrintDC::DoDrawSpline(const wxPointList *points)
+void wxGnomePrinterDC::DoDrawSpline(const wxPointList *points)
{
SetPen (m_pen);
#endif // wxUSE_SPLINES
bool
-wxGnomePrintDC::DoBlit(wxCoord xdest, wxCoord ydest,
+wxGnomePrinterDC::DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
return true;
}
-void wxGnomePrintDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
+void wxGnomePrinterDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
{
DoDrawBitmap( icon, x, y, true );
}
void
-wxGnomePrintDC::DoDrawBitmap(const wxBitmap& bitmap,
+wxGnomePrinterDC::DoDrawBitmap(const wxBitmap& bitmap,
wxCoord x, wxCoord y,
bool WXUNUSED(useMask))
{
}
}
-void wxGnomePrintDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y )
+void wxGnomePrinterDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y )
{
DoDrawRotatedText( text, x, y, 0.0 );
}
-void wxGnomePrintDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
+void wxGnomePrinterDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
{
double xx = XLOG2DEV(x);
double yy = YLOG2DEV(y);
CalcBoundingBox (x + w, y + h);
}
-void wxGnomePrintDC::Clear()
+void wxGnomePrinterDC::Clear()
{
}
-void wxGnomePrintDC::SetFont( const wxFont& font )
+void wxGnomePrinterDC::SetFont( const wxFont& font )
{
m_font = font;
}
}
-void wxGnomePrintDC::SetPen( const wxPen& pen )
+void wxGnomePrinterDC::SetPen( const wxPen& pen )
{
if (!pen.Ok()) return;
}
}
-void wxGnomePrintDC::SetBrush( const wxBrush& brush )
+void wxGnomePrinterDC::SetBrush( const wxBrush& brush )
{
if (!brush.Ok()) return;
}
}
-void wxGnomePrintDC::SetLogicalFunction(int WXUNUSED(function))
+void wxGnomePrinterDC::SetLogicalFunction(int WXUNUSED(function))
{
}
-void wxGnomePrintDC::SetBackground(const wxBrush& WXUNUSED(brush))
+void wxGnomePrinterDC::SetBackground(const wxBrush& WXUNUSED(brush))
{
}
-void wxGnomePrintDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGnomePrinterDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxDC::DoSetClippingRegion( x, y, width, height );
gs_libGnomePrint->gnome_print_clip( m_gpc );
}
-void wxGnomePrintDC::DestroyClippingRegion()
+void wxGnomePrinterDC::DestroyClippingRegion()
{
wxDC::DestroyClippingRegion();
#endif
}
-bool wxGnomePrintDC::StartDoc(const wxString& WXUNUSED(message))
+bool wxGnomePrinterDC::StartDoc(const wxString& WXUNUSED(message))
{
return true;
}
-void wxGnomePrintDC::EndDoc()
+void wxGnomePrinterDC::EndDoc()
{
gs_libGnomePrint->gnome_print_end_doc( m_gpc );
}
-void wxGnomePrintDC::StartPage()
+void wxGnomePrinterDC::StartPage()
{
gs_libGnomePrint->gnome_print_beginpage( m_gpc, (const guchar*) "page" );
}
-void wxGnomePrintDC::EndPage()
+void wxGnomePrinterDC::EndPage()
{
gs_libGnomePrint->gnome_print_showpage( m_gpc );
}
-wxCoord wxGnomePrintDC::GetCharHeight() const
+wxCoord wxGnomePrinterDC::GetCharHeight() const
{
pango_layout_set_text( m_layout, "H", 1 );
return h;
}
-wxCoord wxGnomePrintDC::GetCharWidth() const
+wxCoord wxGnomePrinterDC::GetCharWidth() const
{
pango_layout_set_text( m_layout, "H", 1 );
return w;
}
-void wxGnomePrintDC::DoGetTextExtent(const wxString& string, wxCoord *width, wxCoord *height,
+void wxGnomePrinterDC::DoGetTextExtent(const wxString& string, wxCoord *width, wxCoord *height,
wxCoord *descent,
wxCoord *externalLeading,
const wxFont *theFont ) const
pango_layout_set_font_description( m_layout, m_fontdesc );
}
-void wxGnomePrintDC::DoGetSize(int* width, int* height) const
+void wxGnomePrinterDC::DoGetSize(int* width, int* height) const
{
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_printData.GetNativeData();
*height = wxRound( ph * PS2DEV );
}
-void wxGnomePrintDC::DoGetSizeMM(int *width, int *height) const
+void wxGnomePrinterDC::DoGetSizeMM(int *width, int *height) const
{
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_printData.GetNativeData();
*height = (int) (ph + 0.5);
}
-wxSize wxGnomePrintDC::GetPPI() const
+wxSize wxGnomePrinterDC::GetPPI() const
{
return wxSize(DPI,DPI);
}
-void wxGnomePrintDC::SetPrintData(const wxPrintData& data)
+void wxGnomePrinterDC::SetPrintData(const wxPrintData& data)
{
m_printData = data;
m_deviceLocalOriginY = height;
}
-void wxGnomePrintDC::SetResolution(int WXUNUSED(ppi))
+void wxGnomePrinterDC::SetResolution(int WXUNUSED(ppi))
{
}
-int wxGnomePrintDC::GetResolution()
+int wxGnomePrinterDC::GetResolution()
{
return DPI;
}
m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
(int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
- m_previewPrintout->SetPPIPrinter(wxGnomePrintDC::GetResolution(), wxGnomePrintDC::GetResolution());
+ m_previewPrintout->SetPPIPrinter(wxGnomePrinterDC::GetResolution(), wxGnomePrinterDC::GetResolution());
wxSize sizeDevUnits(paper->GetSizeDeviceUnits());
- // TODO: get better resolution information from wxGnomePrintDC, if possible.
+ // TODO: get better resolution information from wxGnomePrinterDC, if possible.
- sizeDevUnits.x = (wxCoord)((float)sizeDevUnits.x * wxGnomePrintDC::GetResolution() / 72.0);
- sizeDevUnits.y = (wxCoord)((float)sizeDevUnits.y * wxGnomePrintDC::GetResolution() / 72.0);
+ sizeDevUnits.x = (wxCoord)((float)sizeDevUnits.x * wxGnomePrinterDC::GetResolution() / 72.0);
+ sizeDevUnits.y = (wxCoord)((float)sizeDevUnits.y * wxGnomePrinterDC::GetResolution() / 72.0);
wxSize sizeTenthsMM(paper->GetSize());
wxSize sizeMM(sizeTenthsMM.x / 10, sizeTenthsMM.y / 10);
m_previewPrintout->SetPaperRectPixels(wxRect(0, 0, m_pageWidth, m_pageHeight));
// At 100%, the page should look about page-size on the screen.
- m_previewScaleX = (float)0.8 * 72.0 / (float)wxGnomePrintDC::GetResolution();
+ m_previewScaleX = (float)0.8 * 72.0 / (float)wxGnomePrinterDC::GetResolution();
m_previewScaleY = m_previewScaleX;
}
}
wxDC* wxGtkPrintFactory::CreatePrinterDC( const wxPrintData& data )
{
- return new wxGtkPrintDC(data);
+ return new wxGtkPrinterDC(data);
}
bool wxGtkPrintFactory::HasOwnPrintToFile()
SetPrintContext(context);
native->SetPrintContext( context );
- wxGtkPrintDC *printDC = new wxGtkPrintDC( printdata );
+ wxGtkPrinterDC *printDC = new wxGtkPrinterDC( printdata );
m_dc = printDC;
if (!m_dc->IsOk())
if (sm_lastError != wxPRINTER_CANCELLED)
{
sm_lastError = wxPRINTER_ERROR;
- wxFAIL_MSG(_("The wxGtkPrintDC cannot be used."));
+ wxFAIL_MSG(_("The wxGtkPrinterDC cannot be used."));
}
return;
}
}
m_printDialogData = dialog.GetPrintDialogData();
- return new wxGtkPrintDC( m_printDialogData.GetPrintData() );
+ return new wxGtkPrinterDC( m_printDialogData.GetPrintData() );
}
bool wxGtkPrinter::Setup( wxWindow * WXUNUSED(parent) )
}
//-----------------------------------------------------------------------------
-// wxGtkPrintDC
+// wxGtkPrinterDC
//-----------------------------------------------------------------------------
#define XLOG2DEV(x) ((double)(LogicalToDeviceX(x)) * m_DEV2PS)
#define YLOG2DEV(x) ((double)(LogicalToDeviceY(x)) * m_DEV2PS)
#define YLOG2DEVREL(x) ((double)(LogicalToDeviceYRel(x)) * m_DEV2PS)
-IMPLEMENT_CLASS(wxGtkPrintDC, wxDC)
+IMPLEMENT_CLASS(wxGtkPrinterDC, wxDC)
-wxGtkPrintDC::wxGtkPrintDC( const wxPrintData& data )
+wxGtkPrinterDC::wxGtkPrinterDC( const wxPrintData& data )
{
m_printData = data;
gs_cairo->cairo_translate(m_cairo, -ml, -mt);
}
-wxGtkPrintDC::~wxGtkPrintDC()
+wxGtkPrinterDC::~wxGtkPrinterDC()
{
g_object_unref(m_context);
g_object_unref(m_layout);
}
-bool wxGtkPrintDC::IsOk() const
+bool wxGtkPrinterDC::IsOk() const
{
return m_gpc != NULL;
}
-bool wxGtkPrintDC::DoFloodFill(wxCoord WXUNUSED(x1),
+bool wxGtkPrinterDC::DoFloodFill(wxCoord WXUNUSED(x1),
wxCoord WXUNUSED(y1),
const wxColour& WXUNUSED(col),
int WXUNUSED(style))
return false;
}
-void wxGtkPrintDC::DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter)
+void wxGtkPrinterDC::DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter)
{
wxCoord xC = circleCenter.x;
wxCoord yC = circleCenter.y;
CalcBoundingBox(xR+w, yR+h);
}
-void wxGtkPrintDC::DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection)
+void wxGtkPrinterDC::DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection)
{
wxCoord x = rect.x;
wxCoord y = rect.y;
CalcBoundingBox(x+w, y+h);
}
-bool wxGtkPrintDC::DoGetPixel(wxCoord WXUNUSED(x1),
+bool wxGtkPrinterDC::DoGetPixel(wxCoord WXUNUSED(x1),
wxCoord WXUNUSED(y1),
wxColour * WXUNUSED(col)) const
{
return false;
}
-void wxGtkPrintDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
+void wxGtkPrinterDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
CalcBoundingBox( x2, y2 );
}
-void wxGtkPrintDC::DoCrossHair(wxCoord x, wxCoord y)
+void wxGtkPrinterDC::DoCrossHair(wxCoord x, wxCoord y)
{
int w, h;
DoGetSize(&w, &h);
CalcBoundingBox( w, h );
}
-void wxGtkPrintDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc)
+void wxGtkPrinterDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc)
{
double dx = x1 - xc;
double dy = y1 - yc;
CalcBoundingBox (x2, y2);
}
-void wxGtkPrintDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
+void wxGtkPrinterDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
{
gs_cairo->cairo_save( m_cairo );
CalcBoundingBox( x+w, y+h );
}
-void wxGtkPrintDC::DoDrawPoint(wxCoord x, wxCoord y)
+void wxGtkPrinterDC::DoDrawPoint(wxCoord x, wxCoord y)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
CalcBoundingBox( x, y );
}
-void wxGtkPrintDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+void wxGtkPrinterDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
if (m_pen.GetStyle() == wxTRANSPARENT) return;
gs_cairo->cairo_stroke ( m_cairo);
}
-void wxGtkPrintDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
+void wxGtkPrinterDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
{
if (n==0) return;
gs_cairo->cairo_restore(m_cairo);
}
-void wxGtkPrintDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
+void wxGtkPrinterDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
{
wxDC::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
}
-void wxGtkPrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGtkPrinterDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
width--;
height--;
CalcBoundingBox( x + width, y + height );
}
-void wxGtkPrintDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
+void wxGtkPrinterDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{
width--;
height--;
CalcBoundingBox(x+width,y+height);
}
-void wxGtkPrintDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGtkPrinterDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
width--;
height--;
}
#if wxUSE_SPLINES
-void wxGtkPrintDC::DoDrawSpline(const wxPointList *points)
+void wxGtkPrinterDC::DoDrawSpline(const wxPointList *points)
{
SetPen (m_pen);
}
#endif // wxUSE_SPLINES
-bool wxGtkPrintDC::DoBlit(wxCoord xdest, wxCoord ydest,
+bool wxGtkPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop, bool useMask,
return true;
}
-void wxGtkPrintDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
+void wxGtkPrinterDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
{
DoDrawBitmap( icon, x, y, true );
}
-void wxGtkPrintDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
+void wxGtkPrinterDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
{
- wxCHECK_RET( bitmap.IsOk(), wxT("Invalid bitmap in wxGtkPrintDC::DoDrawBitmap"));
+ wxCHECK_RET( bitmap.IsOk(), wxT("Invalid bitmap in wxGtkPrinterDC::DoDrawBitmap"));
cairo_surface_t* surface;
x = wxCoord(XLOG2DEV(x));
gs_cairo->cairo_restore(m_cairo);
}
-void wxGtkPrintDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y )
+void wxGtkPrinterDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y )
{
DoDrawRotatedText( text, x, y, 0.0 );
}
-void wxGtkPrintDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
+void wxGtkPrinterDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
{
double xx = XLOG2DEV(x);
double yy = YLOG2DEV(y);
CalcBoundingBox (x + w, y + h);
}
-void wxGtkPrintDC::Clear()
+void wxGtkPrinterDC::Clear()
{
// Clear does nothing for printing, but keep the code
// for later reuse
*/
}
-void wxGtkPrintDC::SetFont( const wxFont& font )
+void wxGtkPrinterDC::SetFont( const wxFont& font )
{
m_font = font;
}
}
-void wxGtkPrintDC::SetPen( const wxPen& pen )
+void wxGtkPrinterDC::SetPen( const wxPen& pen )
{
if (!pen.Ok()) return;
}
}
-void wxGtkPrintDC::SetBrush( const wxBrush& brush )
+void wxGtkPrinterDC::SetBrush( const wxBrush& brush )
{
if (!brush.Ok()) return;
}
}
-void wxGtkPrintDC::SetLogicalFunction( int function )
+void wxGtkPrinterDC::SetLogicalFunction( int function )
{
if (function == wxCLEAR)
gs_cairo->cairo_set_operator (m_cairo, CAIRO_OPERATOR_CLEAR);
gs_cairo->cairo_set_operator (m_cairo, CAIRO_OPERATOR_SOURCE);
}
-void wxGtkPrintDC::SetBackground( const wxBrush& brush )
+void wxGtkPrinterDC::SetBackground( const wxBrush& brush )
{
m_backgroundBrush = brush;
gs_cairo->cairo_save(m_cairo);
gs_cairo->cairo_restore(m_cairo);
}
-void wxGtkPrintDC::SetBackgroundMode(int mode)
+void wxGtkPrinterDC::SetBackgroundMode(int mode)
{
if (mode == wxSOLID)
m_backgroundMode = wxSOLID;
m_backgroundMode = wxTRANSPARENT;
}
-void wxGtkPrintDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxGtkPrinterDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
gs_cairo->cairo_rectangle ( m_cairo, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEVREL(width), YLOG2DEVREL(height));
gs_cairo->cairo_clip(m_cairo);
}
-void wxGtkPrintDC::DestroyClippingRegion()
+void wxGtkPrinterDC::DestroyClippingRegion()
{
gs_cairo->cairo_reset_clip(m_cairo);
}
-bool wxGtkPrintDC::StartDoc(const wxString& WXUNUSED(message))
+bool wxGtkPrinterDC::StartDoc(const wxString& WXUNUSED(message))
{
return true;
}
-void wxGtkPrintDC::EndDoc()
+void wxGtkPrinterDC::EndDoc()
{
return;
}
-void wxGtkPrintDC::StartPage()
+void wxGtkPrinterDC::StartPage()
{
return;
}
-void wxGtkPrintDC::EndPage()
+void wxGtkPrinterDC::EndPage()
{
return;
}
-wxCoord wxGtkPrintDC::GetCharHeight() const
+wxCoord wxGtkPrinterDC::GetCharHeight() const
{
pango_layout_set_text( m_layout, "H", 1 );
return wxRound( h * m_PS2DEV );
}
-wxCoord wxGtkPrintDC::GetCharWidth() const
+wxCoord wxGtkPrinterDC::GetCharWidth() const
{
pango_layout_set_text( m_layout, "H", 1 );
return wxRound( w * m_PS2DEV );
}
-void wxGtkPrintDC::DoGetTextExtent(const wxString& string, wxCoord *width, wxCoord *height,
+void wxGtkPrinterDC::DoGetTextExtent(const wxString& string, wxCoord *width, wxCoord *height,
wxCoord *descent,
wxCoord *externalLeading,
const wxFont *theFont ) const
pango_layout_set_font_description( m_layout, m_fontdesc );
}
-void wxGtkPrintDC::DoGetSize(int* width, int* height) const
+void wxGtkPrinterDC::DoGetSize(int* width, int* height) const
{
GtkPageSetup *setup = gtk_print_context_get_page_setup( m_gpc );
*height = wxRound( gtk_page_setup_get_paper_height( setup, GTK_UNIT_POINTS ) * m_PS2DEV );
}
-void wxGtkPrintDC::DoGetSizeMM(int *width, int *height) const
+void wxGtkPrinterDC::DoGetSizeMM(int *width, int *height) const
{
GtkPageSetup *setup = gtk_print_context_get_page_setup( m_gpc );
*height = wxRound( gtk_page_setup_get_paper_height( setup, GTK_UNIT_MM ) );
}
-wxSize wxGtkPrintDC::GetPPI() const
+wxSize wxGtkPrinterDC::GetPPI() const
{
return wxSize( (int)m_resolution, (int)m_resolution );
}
-void wxGtkPrintDC::SetPrintData(const wxPrintData& data)
+void wxGtkPrinterDC::SetPrintData(const wxPrintData& data)
{
m_printData = data;
}
-void wxGtkPrintDC::SetResolution(int WXUNUSED(ppi))
+void wxGtkPrinterDC::SetResolution(int WXUNUSED(ppi))
{
// We can't change ppi of the GtkPrintContext.
// TODO: should we really support this?
}
-int wxGtkPrintDC::GetResolution()
+int wxGtkPrinterDC::GetResolution()
{
return m_resolution;
}