From: David Webster Date: Wed, 11 Apr 2001 18:04:54 +0000 (+0000) Subject: DC updates X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ac7fb818ccdcb697268fe9d0398bffb85d74fade?ds=sidebyside DC updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/os2/dc.h b/include/wx/os2/dc.h index aabfd38711..d673f3cf33 100644 --- a/include/wx/os2/dc.h +++ b/include/wx/os2/dc.h @@ -319,11 +319,9 @@ public: bool m_bOwnsDC:1; // - // our HDC and its usage count: we only free it when the usage count drops - // to 0 + // our HDC // WXHDC m_hDC; - int m_nDCCount; // // Store all old GDI objects when do a SelectObject, so we can select them diff --git a/include/wx/os2/dcclient.h b/include/wx/os2/dcclient.h index cffa9e5558..f0d6861830 100644 --- a/include/wx/os2/dcclient.h +++ b/include/wx/os2/dcclient.h @@ -34,52 +34,53 @@ WX_DECLARE_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); class WXDLLEXPORT wxWindowDC : public wxDC { - DECLARE_DYNAMIC_CLASS(wxWindowDC) - public: wxWindowDC(); // Create a DC corresponding to the whole window - wxWindowDC(wxWindow *win); + wxWindowDC(wxWindow* pWin); - virtual ~wxWindowDC(); +protected: + void InitDC(void); private: - HAB m_hab; SIZEL m_PageSize; -}; + DECLARE_DYNAMIC_CLASS(wxWindowDC) +}; // end of CLASS wxWindowDC class WXDLLEXPORT wxClientDC : public wxWindowDC { - DECLARE_DYNAMIC_CLASS(wxClientDC) - public: wxClientDC(); // Create a DC corresponding to the client area of the window wxClientDC(wxWindow *win); - virtual ~wxClientDC(); -}; +private: + DECLARE_DYNAMIC_CLASS(wxClientDC) +}; // end of CLASS wxClientDC class WXDLLEXPORT wxPaintDC : public wxWindowDC { - DECLARE_DYNAMIC_CLASS(wxPaintDC) - public: wxPaintDC(); // Create a DC corresponding for painting the window in OnPaint() - wxPaintDC(wxWindow *win); + wxPaintDC(wxWindow* pWin); virtual ~wxPaintDC(); + // find the entry for this DC in the cache (keyed by the window) + static WXHDC FindDCInCache(wxWindow* pWin); + protected: static wxArrayDCInfo ms_cache; // find the entry for this DC in the cache (keyed by the window) - wxPaintDCInfo *FindInCache(size_t *index = NULL) const; -}; + wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const; +private: + DECLARE_DYNAMIC_CLASS(wxPaintDC) +}; // end of wxPaintDC #endif // _WX_DCCLIENT_H_ diff --git a/include/wx/os2/dcmemory.h b/include/wx/os2/dcmemory.h index fa9e983e1b..28747572ed 100644 --- a/include/wx/os2/dcmemory.h +++ b/include/wx/os2/dcmemory.h @@ -16,17 +16,28 @@ class WXDLLEXPORT wxMemoryDC: public wxDC { - DECLARE_DYNAMIC_CLASS(wxMemoryDC) - public: wxMemoryDC(void); wxMemoryDC(wxDC* pDC); // Create compatible DC - ~wxMemoryDC(void); virtual void SelectObject(const wxBitmap& rBitmap); +protected: + // override some base class virtuals + virtual void DoDrawRectangle( wxCoord vX + ,wxCoord vY + ,wxCoord vWidth + ,wxCoord vHeight + ); virtual void DoGetSize( int* pWidth ,int* pHeight ) const; + // create DC compatible with the given one or screen if dc == NULL + bool CreateCompatible(wxDC* pDC); + + // initialize the newly created DC + void Init(void); +private: + DECLARE_DYNAMIC_CLASS(wxMemoryDC) }; // end of CLASS wxMemoryDC #endif diff --git a/include/wx/os2/dcprint.h b/include/wx/os2/dcprint.h index 851b0ace62..d924f0550a 100644 --- a/include/wx/os2/dcprint.h +++ b/include/wx/os2/dcprint.h @@ -20,29 +20,50 @@ class WXDLLEXPORT wxPrinterDC: public wxDC { public: - DECLARE_CLASS(wxPrinterDC) + // Create a printer DC [obsolete] + wxPrinterDC( const wxString& rsDriver + ,const wxString& rsDevice + ,const wxString& rsOutput + ,bool bInteractive = TRUE + ,int nOrientation = wxPORTRAIT + ); - // Create a printer DC [obsolete] - wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT); + // Create from print data + wxPrinterDC(const wxPrintData& rData); + wxPrinterDC(WXHDC hTheDC); - // Create from print data - wxPrinterDC(const wxPrintData& data); - - wxPrinterDC(WXHDC theDC); - - ~wxPrinterDC(); - - bool StartDoc(const wxString& message); + bool StartDoc(const wxString& rsMessage); void EndDoc(void); void StartPage(void); void EndPage(void); protected: - wxPrintData m_printData; -}; + virtual void DoDrawBitmap( const wxBitmap& rBmp + ,wxCoord vX + ,wxCoord vY + ,bool bUseMask = FALSE + ); + virtual bool DoBlit( wxCoord vXdest + ,wxCoord vYdest + ,wxCoord vWidth + ,wxCoord vHeight + ,wxDC* pSource + ,wxCoord vXsrc + ,wxCoord vYsrc + ,int nRop = wxCOPY + ,bool bUseMask = FALSE + ); + + // init the dc + void Init(void); + + wxPrintData m_printData; +private: + DECLARE_CLASS(wxPrinterDC) +}; // end of CLASS wxPrinterDC // Gets an HDC for the specified printer configuration -WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data); +WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& rData); #endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/include/wx/os2/dcscreen.h b/include/wx/os2/dcscreen.h index 44b929bc04..e0b4204008 100644 --- a/include/wx/os2/dcscreen.h +++ b/include/wx/os2/dcscreen.h @@ -20,19 +20,18 @@ class WXDLLEXPORT wxScreenDC: public wxWindowDC { - DECLARE_DYNAMIC_CLASS(wxScreenDC) - public: // Create a DC representing the whole screen wxScreenDC(); - ~wxScreenDC(); // Compatibility with X's requirements for // drawing on top of all windows static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; } static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; } static bool EndDrawingOnTop() { return TRUE; } -}; +private: + DECLARE_DYNAMIC_CLASS(wxScreenDC) +}; // end of CLASS wxScreenDC #endif // _WX_DCSCREEN_H_