]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/dcclient.h
Further wxRichTextCtrl performance improvements
[wxWidgets.git] / include / wx / msw / dcclient.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcclient.h
3 // Purpose: wxClientDC class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DCCLIENT_H_
13 #define _WX_DCCLIENT_H_
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18
19 #include "wx/dc.h"
20 #include "wx/msw/dc.h"
21 #include "wx/dcclient.h"
22 #include "wx/dynarray.h"
23
24 // ----------------------------------------------------------------------------
25 // array types
26 // ----------------------------------------------------------------------------
27
28 // this one if used by wxPaintDC only
29 struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
30
31 WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
32
33 // ----------------------------------------------------------------------------
34 // DC classes
35 // ----------------------------------------------------------------------------
36
37 class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
38 {
39 public:
40 // default ctor
41 wxWindowDCImpl( wxDC *owner );
42
43 // Create a DC corresponding to the whole window
44 wxWindowDCImpl( wxDC *owner, wxWindow *win );
45
46 #if wxUSE_GRAPHICS_CONTEXT
47 virtual wxGraphicsContext* CreateGraphicsContext();
48 #endif
49
50 virtual void DoGetSize(int *width, int *height) const;
51
52 protected:
53 // initialize the newly created DC
54 void InitDC();
55
56 DECLARE_CLASS(wxWindowDCImpl)
57 DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
58 };
59
60 class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
61 {
62 public:
63 // default ctor
64 wxClientDCImpl( wxDC *owner );
65
66 // Create a DC corresponding to the client area of the window
67 wxClientDCImpl( wxDC *owner, wxWindow *win );
68
69 virtual ~wxClientDCImpl();
70
71 virtual void DoGetSize(int *width, int *height) const;
72
73 protected:
74 void InitDC();
75
76 DECLARE_CLASS(wxClientDCImpl)
77 DECLARE_NO_COPY_CLASS(wxClientDCImpl)
78 };
79
80 class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
81 {
82 public:
83 wxPaintDCImpl( wxDC *owner );
84
85 // Create a DC corresponding for painting the window in OnPaint()
86 wxPaintDCImpl( wxDC *owner, wxWindow *win );
87
88 virtual ~wxPaintDCImpl();
89
90 // find the entry for this DC in the cache (keyed by the window)
91 static WXHDC FindDCInCache(wxWindow* win);
92
93 protected:
94 static wxArrayDCInfo ms_cache;
95
96 // find the entry for this DC in the cache (keyed by the window)
97 wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
98
99 DECLARE_CLASS(wxPaintDCImpl)
100 DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
101 };
102
103 /*
104 * wxPaintDCEx
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.
107 */
108
109 class WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
110 {
111 public:
112 wxPaintDCEx(wxWindow *canvas, WXHDC dc);
113
114 DECLARE_CLASS(wxPaintDCEx)
115 DECLARE_NO_COPY_CLASS(wxPaintDCEx)
116 };
117
118 #endif
119 // _WX_DCCLIENT_H_