]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
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$ | |
371a5b4e | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_DCCLIENT_H_ |
13 | #define _WX_DCCLIENT_H_ | |
2bda0e17 | 14 | |
3a5ffa81 VZ |
15 | // ---------------------------------------------------------------------------- |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
12028905 | 19 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
3a5ffa81 | 20 | #pragma interface "dcclient.h" |
2bda0e17 KB |
21 | #endif |
22 | ||
23 | #include "wx/dc.h" | |
4286a5b5 | 24 | #include "wx/dynarray.h" |
2bda0e17 | 25 | |
3a5ffa81 VZ |
26 | // ---------------------------------------------------------------------------- |
27 | // array types | |
28 | // ---------------------------------------------------------------------------- | |
29 | ||
30 | // this one if used by wxPaintDC only | |
31 | struct WXDLLEXPORT wxPaintDCInfo; | |
e0272d05 | 32 | |
a497618a | 33 | WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); |
3a5ffa81 VZ |
34 | |
35 | // ---------------------------------------------------------------------------- | |
36 | // DC classes | |
37 | // ---------------------------------------------------------------------------- | |
38 | ||
39 | class WXDLLEXPORT wxWindowDC : public wxDC | |
2bda0e17 | 40 | { |
3a5ffa81 | 41 | public: |
7ba4fbeb | 42 | // default ctor |
3a5ffa81 | 43 | wxWindowDC(); |
2bda0e17 | 44 | |
3a5ffa81 VZ |
45 | // Create a DC corresponding to the whole window |
46 | wxWindowDC(wxWindow *win); | |
2bda0e17 | 47 | |
7ba4fbeb VZ |
48 | protected: |
49 | // intiialize the newly created DC | |
50 | void InitDC(); | |
51 | ||
994a3786 VZ |
52 | // override some base class virtuals |
53 | virtual void DoGetSize(int *width, int *height) const; | |
54 | ||
7ba4fbeb | 55 | private: |
fc7a2a60 | 56 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC) |
2bda0e17 KB |
57 | }; |
58 | ||
3a5ffa81 | 59 | class WXDLLEXPORT wxClientDC : public wxWindowDC |
2bda0e17 | 60 | { |
3a5ffa81 | 61 | public: |
7ba4fbeb | 62 | // default ctor |
3a5ffa81 | 63 | wxClientDC(); |
2bda0e17 | 64 | |
3a5ffa81 VZ |
65 | // Create a DC corresponding to the client area of the window |
66 | wxClientDC(wxWindow *win); | |
2bda0e17 | 67 | |
1e6feb95 VZ |
68 | virtual ~wxClientDC(); |
69 | ||
70 | protected: | |
71 | void InitDC(); | |
72 | ||
994a3786 VZ |
73 | // override some base class virtuals |
74 | virtual void DoGetSize(int *width, int *height) const; | |
75 | ||
7ba4fbeb | 76 | private: |
fc7a2a60 | 77 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC) |
2bda0e17 KB |
78 | }; |
79 | ||
1e6feb95 | 80 | class WXDLLEXPORT wxPaintDC : public wxClientDC |
2bda0e17 | 81 | { |
3a5ffa81 VZ |
82 | public: |
83 | wxPaintDC(); | |
2bda0e17 | 84 | |
3a5ffa81 VZ |
85 | // Create a DC corresponding for painting the window in OnPaint() |
86 | wxPaintDC(wxWindow *win); | |
2bda0e17 | 87 | |
3a5ffa81 | 88 | virtual ~wxPaintDC(); |
2bda0e17 | 89 | |
63da7df7 JS |
90 | // find the entry for this DC in the cache (keyed by the window) |
91 | static WXHDC FindDCInCache(wxWindow* win); | |
92 | ||
3a5ffa81 VZ |
93 | protected: |
94 | static wxArrayDCInfo ms_cache; | |
2bda0e17 | 95 | |
3a5ffa81 VZ |
96 | // find the entry for this DC in the cache (keyed by the window) |
97 | wxPaintDCInfo *FindInCache(size_t *index = NULL) const; | |
7ba4fbeb VZ |
98 | |
99 | private: | |
fc7a2a60 | 100 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC) |
2bda0e17 KB |
101 | }; |
102 | ||
c6151f2a JS |
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 WXDLLEXPORT wxPaintDCEx : public wxPaintDC | |
110 | { | |
111 | public: | |
112 | wxPaintDCEx(wxWindow *canvas, WXHDC dc); | |
113 | virtual ~wxPaintDCEx(); | |
114 | private: | |
115 | int saveState; | |
116 | ||
117 | DECLARE_CLASS(wxPaintDCEx) | |
118 | DECLARE_NO_COPY_CLASS(wxPaintDCEx) | |
119 | }; | |
120 | ||
2bda0e17 | 121 | #endif |
bbcdf8bc | 122 | // _WX_DCCLIENT_H_ |