1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/msw/dcprint.h 3 // Purpose: wxPrinterDC class 4 // Author: Julian Smart 5 // Modified by: 6 // Created: 01/02/97 7 // Copyright: (c) Julian Smart 8 // Licence: wxWindows licence 9 ///////////////////////////////////////////////////////////////////////////// 10 11 #ifndef _WX_MSW_DCPRINT_H_ 12 #define _WX_MSW_DCPRINT_H_ 13 14 #if wxUSE_PRINTING_ARCHITECTURE 15 16 #include "wx/dcprint.h" 17 #include "wx/cmndata.h" 18 #include "wx/msw/dc.h" 19 20 // ------------------------------------------------------------------------ 21 // wxPrinterDCImpl 22 // 23 24 class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxMSWDCImpl 25 { 26 public: 27 // Create from print data 28 wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data ); 29 wxPrinterDCImpl( wxPrinterDC *owner, WXHDC theDC ); 30 31 // override some base class virtuals 32 virtual bool StartDoc(const wxString& message); 33 virtual void EndDoc(); 34 virtual void StartPage(); 35 virtual void EndPage(); 36 37 virtual wxRect GetPaperRect() const; 38 39 protected: 40 virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, 41 bool useMask = false); 42 virtual bool DoBlit(wxCoord xdest, wxCoord ydest, 43 wxCoord width, wxCoord height, 44 wxDC *source, wxCoord xsrc, wxCoord ysrc, 45 wxRasterOperationMode rop = wxCOPY, bool useMask = false, 46 wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); DoGetSize(int * w,int * h)47 virtual void DoGetSize(int *w, int *h) const 48 { 49 GetDeviceSize(w, h); 50 } 51 52 53 // init the dc 54 void Init(); 55 56 wxPrintData m_printData; 57 58 private: 59 DECLARE_CLASS(wxPrinterDCImpl) 60 wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl); 61 }; 62 63 // Gets an HDC for the specified printer configuration 64 WXHDC WXDLLIMPEXP_CORE wxGetPrinterDC(const wxPrintData& data); 65 66 // ------------------------------------------------------------------------ 67 // wxPrinterDCromHDC 68 // 69 70 class WXDLLIMPEXP_CORE wxPrinterDCFromHDC: public wxPrinterDC 71 { 72 public: wxPrinterDCFromHDC(WXHDC theDC)73 wxPrinterDCFromHDC( WXHDC theDC ) 74 : wxPrinterDC(new wxPrinterDCImpl(this, theDC)) 75 { 76 } 77 }; 78 79 #endif // wxUSE_PRINTING_ARCHITECTURE 80 81 #endif // _WX_MSW_DCPRINT_H_ 82 83