1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxClientDC class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DCCLIENT_H_
13 #define _WX_DCCLIENT_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
20 #include "wx/msw/dc.h"
21 #include "wx/dcclient.h"
22 #include "wx/dynarray.h"
24 // ----------------------------------------------------------------------------
26 // ----------------------------------------------------------------------------
28 // this one if used by wxPaintDC only
29 struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo
;
31 WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo
, wxArrayDCInfo
);
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
37 class WXDLLIMPEXP_CORE wxWindowDCImpl
: public wxMSWDCImpl
41 wxWindowDCImpl( wxDC
*owner
);
43 // Create a DC corresponding to the whole window
44 wxWindowDCImpl( wxDC
*owner
, wxWindow
*win
);
46 #if wxUSE_GRAPHICS_CONTEXT
47 virtual wxGraphicsContext
* CreateGraphicsContext();
50 virtual void DoGetSize(int *width
, int *height
) const;
53 // initialize the newly created DC
56 DECLARE_CLASS(wxWindowDCImpl
)
57 DECLARE_NO_COPY_CLASS(wxWindowDCImpl
)
60 class WXDLLIMPEXP_CORE wxClientDCImpl
: public wxWindowDCImpl
64 wxClientDCImpl( wxDC
*owner
);
66 // Create a DC corresponding to the client area of the window
67 wxClientDCImpl( wxDC
*owner
, wxWindow
*win
);
69 virtual ~wxClientDCImpl();
71 virtual void DoGetSize(int *width
, int *height
) const;
76 DECLARE_CLASS(wxClientDCImpl
)
77 DECLARE_NO_COPY_CLASS(wxClientDCImpl
)
80 class WXDLLIMPEXP_CORE wxPaintDCImpl
: public wxClientDCImpl
83 wxPaintDCImpl( wxDC
*owner
);
85 // Create a DC corresponding for painting the window in OnPaint()
86 wxPaintDCImpl( wxDC
*owner
, wxWindow
*win
);
88 virtual ~wxPaintDCImpl();
90 // find the entry for this DC in the cache (keyed by the window)
91 static WXHDC
FindDCInCache(wxWindow
* win
);
94 static wxArrayDCInfo ms_cache
;
96 // find the entry for this DC in the cache (keyed by the window)
97 wxPaintDCInfo
*FindInCache(size_t *index
= NULL
) const;
99 DECLARE_CLASS(wxPaintDCImpl
)
100 DECLARE_NO_COPY_CLASS(wxPaintDCImpl
)
105 * This class is used when an application sends an HDC with the WM_PAINT
106 * message. It is used in HandlePaint and need not be used by an application.
109 class WXDLLIMPEXP_CORE wxPaintDCEx
: public wxPaintDC
112 wxPaintDCEx(wxWindow
*canvas
, WXHDC dc
);
114 DECLARE_CLASS(wxPaintDCEx
)
115 DECLARE_NO_COPY_CLASS(wxPaintDCEx
)