]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: dcclient.h | |
3 | // Purpose: wxClientDC class | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 09/12/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows license | |
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/dynarray.h" | |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // array types | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
26 | // this one if used by wxPaintDC only | |
27 | struct WXDLLEXPORT wxPaintDCInfo; | |
28 | ||
29 | WX_DECLARE_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); | |
30 | ||
31 | // ---------------------------------------------------------------------------- | |
32 | // DC classes | |
33 | // ---------------------------------------------------------------------------- | |
34 | ||
35 | class WXDLLEXPORT wxWindowDC : public wxDC | |
36 | { | |
37 | public: | |
38 | wxWindowDC(); | |
39 | ||
40 | // Create a DC corresponding to the whole window | |
41 | wxWindowDC(wxWindow* pWin); | |
42 | ||
43 | protected: | |
44 | void InitDC(void); | |
45 | ||
46 | private: | |
47 | SIZEL m_PageSize; | |
48 | DECLARE_DYNAMIC_CLASS(wxWindowDC) | |
49 | }; // end of CLASS wxWindowDC | |
50 | ||
51 | class WXDLLEXPORT wxClientDC : public wxWindowDC | |
52 | { | |
53 | public: | |
54 | wxClientDC(); | |
55 | virtual ~wxClientDC(); | |
56 | ||
57 | wxClientDC(wxWindow *win); | |
58 | ||
59 | protected: | |
60 | void InitDC(void); | |
61 | ||
62 | private: | |
63 | DECLARE_DYNAMIC_CLASS(wxClientDC) | |
64 | }; // end of CLASS wxClientDC | |
65 | ||
66 | class WXDLLEXPORT wxPaintDC : public wxClientDC | |
67 | { | |
68 | public: | |
69 | wxPaintDC(); | |
70 | ||
71 | // Create a DC corresponding for painting the window in OnPaint() | |
72 | wxPaintDC(wxWindow* pWin); | |
73 | ||
74 | virtual ~wxPaintDC(); | |
75 | ||
76 | // find the entry for this DC in the cache (keyed by the window) | |
77 | static WXHDC FindDCInCache(wxWindow* pWin); | |
78 | ||
79 | protected: | |
80 | static wxArrayDCInfo ms_cache; | |
81 | ||
82 | // find the entry for this DC in the cache (keyed by the window) | |
83 | wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const; | |
84 | private: | |
85 | DECLARE_DYNAMIC_CLASS(wxPaintDC) | |
86 | }; // end of wxPaintDC | |
87 | ||
88 | #endif | |
89 | // _WX_DCCLIENT_H_ |