]>
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 | ||
2bda0e17 | 19 | #include "wx/dc.h" |
4286a5b5 | 20 | #include "wx/dynarray.h" |
2bda0e17 | 21 | |
3a5ffa81 VZ |
22 | // ---------------------------------------------------------------------------- |
23 | // array types | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
26 | // this one if used by wxPaintDC only | |
b5dbe15d | 27 | struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo; |
e0272d05 | 28 | |
a497618a | 29 | WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); |
3a5ffa81 VZ |
30 | |
31 | // ---------------------------------------------------------------------------- | |
32 | // DC classes | |
33 | // ---------------------------------------------------------------------------- | |
34 | ||
35 | class WXDLLEXPORT wxWindowDC : public wxDC | |
2bda0e17 | 36 | { |
3a5ffa81 | 37 | public: |
7ba4fbeb | 38 | // default ctor |
3a5ffa81 | 39 | wxWindowDC(); |
2bda0e17 | 40 | |
3a5ffa81 VZ |
41 | // Create a DC corresponding to the whole window |
42 | wxWindowDC(wxWindow *win); | |
2bda0e17 | 43 | |
7ba4fbeb | 44 | protected: |
3103e8a9 | 45 | // initialize the newly created DC |
7ba4fbeb VZ |
46 | void InitDC(); |
47 | ||
994a3786 VZ |
48 | // override some base class virtuals |
49 | virtual void DoGetSize(int *width, int *height) const; | |
50 | ||
7ba4fbeb | 51 | private: |
fc7a2a60 | 52 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC) |
2bda0e17 KB |
53 | }; |
54 | ||
3a5ffa81 | 55 | class WXDLLEXPORT wxClientDC : public wxWindowDC |
2bda0e17 | 56 | { |
3a5ffa81 | 57 | public: |
7ba4fbeb | 58 | // default ctor |
3a5ffa81 | 59 | wxClientDC(); |
2bda0e17 | 60 | |
3a5ffa81 VZ |
61 | // Create a DC corresponding to the client area of the window |
62 | wxClientDC(wxWindow *win); | |
2bda0e17 | 63 | |
1e6feb95 VZ |
64 | virtual ~wxClientDC(); |
65 | ||
66 | protected: | |
67 | void InitDC(); | |
68 | ||
994a3786 VZ |
69 | // override some base class virtuals |
70 | virtual void DoGetSize(int *width, int *height) const; | |
71 | ||
7ba4fbeb | 72 | private: |
fc7a2a60 | 73 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC) |
2bda0e17 KB |
74 | }; |
75 | ||
1e6feb95 | 76 | class WXDLLEXPORT wxPaintDC : public wxClientDC |
2bda0e17 | 77 | { |
3a5ffa81 VZ |
78 | public: |
79 | wxPaintDC(); | |
2bda0e17 | 80 | |
3a5ffa81 VZ |
81 | // Create a DC corresponding for painting the window in OnPaint() |
82 | wxPaintDC(wxWindow *win); | |
2bda0e17 | 83 | |
3a5ffa81 | 84 | virtual ~wxPaintDC(); |
2bda0e17 | 85 | |
63da7df7 JS |
86 | // find the entry for this DC in the cache (keyed by the window) |
87 | static WXHDC FindDCInCache(wxWindow* win); | |
88 | ||
3a5ffa81 VZ |
89 | protected: |
90 | static wxArrayDCInfo ms_cache; | |
2bda0e17 | 91 | |
3a5ffa81 VZ |
92 | // find the entry for this DC in the cache (keyed by the window) |
93 | wxPaintDCInfo *FindInCache(size_t *index = NULL) const; | |
7ba4fbeb VZ |
94 | |
95 | private: | |
fc7a2a60 | 96 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC) |
2bda0e17 KB |
97 | }; |
98 | ||
c6151f2a JS |
99 | /* |
100 | * wxPaintDCEx | |
101 | * This class is used when an application sends an HDC with the WM_PAINT | |
102 | * message. It is used in HandlePaint and need not be used by an application. | |
103 | */ | |
104 | ||
105 | class WXDLLEXPORT wxPaintDCEx : public wxPaintDC | |
106 | { | |
107 | public: | |
108 | wxPaintDCEx(wxWindow *canvas, WXHDC dc); | |
109 | virtual ~wxPaintDCEx(); | |
110 | private: | |
111 | int saveState; | |
112 | ||
113 | DECLARE_CLASS(wxPaintDCEx) | |
114 | DECLARE_NO_COPY_CLASS(wxPaintDCEx) | |
115 | }; | |
116 | ||
2bda0e17 | 117 | #endif |
bbcdf8bc | 118 | // _WX_DCCLIENT_H_ |