dcclient.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/dcclient.h
  3. // Purpose: wxClientDC class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 09/12/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_DCCLIENT_H_
  11. #define _WX_DCCLIENT_H_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/dc.h"
  16. #include "wx/os2/dc.h"
  17. #include "wx/dcclient.h"
  18. #include "wx/dynarray.h"
  19. // ----------------------------------------------------------------------------
  20. // array types
  21. // ----------------------------------------------------------------------------
  22. // this one if used by wxPaintDC only
  23. struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
  24. WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
  25. // ----------------------------------------------------------------------------
  26. // DC classes
  27. // ----------------------------------------------------------------------------
  28. class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxPMDCImpl
  29. {
  30. public:
  31. // default ctor
  32. wxWindowDCImpl( wxDC *owner );
  33. // Create a DC corresponding to the whole window
  34. wxWindowDCImpl( wxDC *owner, wxWindow *pWin );
  35. virtual void DoGetSize(int *pWidth, int *pHeight) const;
  36. protected:
  37. // initialize the newly created DC
  38. void InitDC(void);
  39. private:
  40. SIZEL m_PageSize;
  41. DECLARE_CLASS(wxWindowDCImpl)
  42. wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
  43. }; // end of CLASS wxWindowDC
  44. class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
  45. {
  46. public:
  47. // default ctor
  48. wxClientDCImpl( wxDC *owner );
  49. // Create a DC corresponding to the client area of the window
  50. wxClientDCImpl( wxDC *owner, wxWindow *pWin );
  51. virtual ~wxClientDCImpl();
  52. virtual void DoGetSize(int *pWidth, int *pHeight) const;
  53. protected:
  54. void InitDC(void);
  55. private:
  56. DECLARE_CLASS(wxClientDCImpl)
  57. wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
  58. }; // end of CLASS wxClientDC
  59. class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
  60. {
  61. public:
  62. wxPaintDCImpl( wxDC *owner );
  63. // Create a DC corresponding for painting the window in OnPaint()
  64. wxPaintDCImpl( wxDC *owner, wxWindow *pWin );
  65. virtual ~wxPaintDCImpl();
  66. // find the entry for this DC in the cache (keyed by the window)
  67. static WXHDC FindDCInCache(wxWindow* pWin);
  68. protected:
  69. static wxArrayDCInfo ms_cache;
  70. // find the entry for this DC in the cache (keyed by the window)
  71. wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const;
  72. private:
  73. DECLARE_CLASS(wxPaintDCImpl)
  74. wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
  75. }; // end of wxPaintDC
  76. #endif
  77. // _WX_DCCLIENT_H_