dcclient.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/dcclient.h
  3. // Purpose: wxClientDC class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  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/msw/dc.h"
  17. #include "wx/dcclient.h"
  18. class wxPaintDCInfo;
  19. // ----------------------------------------------------------------------------
  20. // DC classes
  21. // ----------------------------------------------------------------------------
  22. class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
  23. {
  24. public:
  25. // default ctor
  26. wxWindowDCImpl( wxDC *owner );
  27. // Create a DC corresponding to the whole window
  28. wxWindowDCImpl( wxDC *owner, wxWindow *win );
  29. virtual void DoGetSize(int *width, int *height) const;
  30. protected:
  31. // initialize the newly created DC
  32. void InitDC();
  33. DECLARE_CLASS(wxWindowDCImpl)
  34. wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
  35. };
  36. class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
  37. {
  38. public:
  39. // default ctor
  40. wxClientDCImpl( wxDC *owner );
  41. // Create a DC corresponding to the client area of the window
  42. wxClientDCImpl( wxDC *owner, wxWindow *win );
  43. virtual ~wxClientDCImpl();
  44. virtual void DoGetSize(int *width, int *height) const;
  45. protected:
  46. void InitDC();
  47. DECLARE_CLASS(wxClientDCImpl)
  48. wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
  49. };
  50. class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
  51. {
  52. public:
  53. wxPaintDCImpl( wxDC *owner );
  54. // Create a DC corresponding for painting the window in OnPaint()
  55. wxPaintDCImpl( wxDC *owner, wxWindow *win );
  56. virtual ~wxPaintDCImpl();
  57. // find the entry for this DC in the cache (keyed by the window)
  58. static WXHDC FindDCInCache(wxWindow* win);
  59. // This must be called by the code handling WM_PAINT to remove the DC
  60. // cached for this window for the duration of this message processing.
  61. static void EndPaint(wxWindow *win);
  62. protected:
  63. // Find the DC for this window in the cache, return NULL if not found.
  64. static wxPaintDCInfo *FindInCache(wxWindow* win);
  65. DECLARE_CLASS(wxPaintDCImpl)
  66. wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
  67. };
  68. /*
  69. * wxPaintDCEx
  70. * This class is used when an application sends an HDC with the WM_PAINT
  71. * message. It is used in HandlePaint and need not be used by an application.
  72. */
  73. class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
  74. {
  75. public:
  76. wxPaintDCEx(wxWindow *canvas, WXHDC dc);
  77. DECLARE_CLASS(wxPaintDCEx)
  78. wxDECLARE_NO_COPY_CLASS(wxPaintDCEx);
  79. };
  80. #endif
  81. // _WX_DCCLIENT_H_