1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-01-21 21:38:51 +00:00
|
|
|
// Name: wx/msw/dcprint.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxPrinterDC class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2005-12-25 02:34:42 +00:00
|
|
|
#ifndef _WX_MSW_DCPRINT_H_
|
|
|
|
#define _WX_MSW_DCPRINT_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-06-13 22:54:04 +00:00
|
|
|
#if wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
#include "wx/dcprint.h"
|
1999-03-25 23:06:01 +00:00
|
|
|
#include "wx/cmndata.h"
|
2007-11-30 13:48:22 +00:00
|
|
|
#include "wx/msw/dc.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// wxPrinterDCImpl
|
|
|
|
//
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxMSWDCImpl
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-03-25 23:06:01 +00:00
|
|
|
public:
|
|
|
|
// Create from print data
|
2007-11-30 13:48:22 +00:00
|
|
|
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
|
|
|
wxPrinterDCImpl( wxPrinterDC *owner, WXHDC theDC );
|
1999-03-25 23:06:01 +00:00
|
|
|
|
2000-01-21 21:38:51 +00:00
|
|
|
// override some base class virtuals
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual bool StartDoc(const wxString& message) wxOVERRIDE;
|
|
|
|
virtual void EndDoc() wxOVERRIDE;
|
|
|
|
virtual void StartPage() wxOVERRIDE;
|
|
|
|
virtual void EndPage() wxOVERRIDE;
|
1999-03-25 23:06:01 +00:00
|
|
|
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual wxRect GetPaperRect() const wxOVERRIDE;
|
2006-10-27 13:07:40 +00:00
|
|
|
|
1999-03-25 23:06:01 +00:00
|
|
|
protected:
|
2000-01-21 21:38:51 +00:00
|
|
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
2016-09-23 14:59:11 +00:00
|
|
|
bool useMask = false) wxOVERRIDE;
|
2000-01-21 21:38:51 +00:00
|
|
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
|
|
|
wxCoord width, wxCoord height,
|
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
2009-01-08 14:21:53 +00:00
|
|
|
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
|
2016-09-23 14:59:11 +00:00
|
|
|
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE;
|
|
|
|
virtual void DoGetSize(int *w, int *h) const wxOVERRIDE
|
2005-12-25 02:34:42 +00:00
|
|
|
{
|
|
|
|
GetDeviceSize(w, h);
|
|
|
|
}
|
|
|
|
|
2000-01-21 21:38:51 +00:00
|
|
|
|
2001-04-09 01:22:48 +00:00
|
|
|
// init the dc
|
|
|
|
void Init();
|
|
|
|
|
1999-03-25 23:06:01 +00:00
|
|
|
wxPrintData m_printData;
|
2001-04-09 01:22:48 +00:00
|
|
|
|
|
|
|
private:
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxPrinterDCImpl);
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
1999-03-25 23:06:01 +00:00
|
|
|
// Gets an HDC for the specified printer configuration
|
2008-03-26 15:06:00 +00:00
|
|
|
WXHDC WXDLLIMPEXP_CORE wxGetPrinterDC(const wxPrintData& data);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// wxPrinterDCromHDC
|
|
|
|
//
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPrinterDCFromHDC: public wxPrinterDC
|
2007-11-30 13:48:22 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxPrinterDCFromHDC( WXHDC theDC )
|
2007-11-30 20:56:12 +00:00
|
|
|
: wxPrinterDC(new wxPrinterDCImpl(this, theDC))
|
2007-11-30 13:48:22 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
1999-06-13 22:54:04 +00:00
|
|
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
2005-12-25 02:34:42 +00:00
|
|
|
#endif // _WX_MSW_DCPRINT_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|