]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/os2/dcclient.h |
23e4b7d8 | 3 | // Purpose: wxClientDC class |
f0a56ab0 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
f0a56ab0 | 6 | // Created: 09/12/99 |
f0a56ab0 | 7 | // Copyright: (c) David Webster |
65571936 | 8 | // Licence: wxWindows licence |
0e320a79 DW |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_DCCLIENT_H_ | |
12 | #define _WX_DCCLIENT_H_ | |
13 | ||
23e4b7d8 DW |
14 | // ---------------------------------------------------------------------------- |
15 | // headers | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
0e320a79 | 18 | #include "wx/dc.h" |
2c24e7ad SN |
19 | #include "wx/os2/dc.h" |
20 | #include "wx/dcclient.h" | |
23e4b7d8 DW |
21 | #include "wx/dynarray.h" |
22 | ||
23 | // ---------------------------------------------------------------------------- | |
24 | // array types | |
25 | // ---------------------------------------------------------------------------- | |
0e320a79 | 26 | |
23e4b7d8 | 27 | // this one if used by wxPaintDC only |
b5dbe15d | 28 | struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo; |
0e320a79 | 29 | |
2c24e7ad | 30 | WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); |
0e320a79 | 31 | |
23e4b7d8 DW |
32 | // ---------------------------------------------------------------------------- |
33 | // DC classes | |
34 | // ---------------------------------------------------------------------------- | |
0e320a79 | 35 | |
53a2db12 | 36 | class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxPMDCImpl |
0e320a79 | 37 | { |
23e4b7d8 | 38 | public: |
2c24e7ad SN |
39 | // default ctor |
40 | wxWindowDCImpl( wxDC *owner ); | |
0e320a79 | 41 | |
23e4b7d8 | 42 | // Create a DC corresponding to the whole window |
2c24e7ad SN |
43 | wxWindowDCImpl( wxDC *owner, wxWindow *pWin ); |
44 | ||
45 | virtual void DoGetSize(int *pWidth, int *pHeight) const; | |
23e4b7d8 | 46 | |
ac7fb818 | 47 | protected: |
2c24e7ad | 48 | // initialize the newly created DC |
ac7fb818 | 49 | void InitDC(void); |
ce44c50e | 50 | |
ce44c50e | 51 | private: |
ce44c50e | 52 | SIZEL m_PageSize; |
2c24e7ad | 53 | DECLARE_CLASS(wxWindowDCImpl) |
c0c133e1 | 54 | wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl); |
ac7fb818 | 55 | }; // end of CLASS wxWindowDC |
23e4b7d8 | 56 | |
53a2db12 | 57 | class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl |
0e320a79 | 58 | { |
23e4b7d8 | 59 | public: |
2c24e7ad SN |
60 | // default ctor |
61 | wxClientDCImpl( wxDC *owner ); | |
62 | ||
63 | // Create a DC corresponding to the client area of the window | |
64 | wxClientDCImpl( wxDC *owner, wxWindow *pWin ); | |
0e320a79 | 65 | |
2c24e7ad SN |
66 | virtual ~wxClientDCImpl(); |
67 | ||
68 | virtual void DoGetSize(int *pWidth, int *pHeight) const; | |
0e320a79 | 69 | |
210a651b DW |
70 | protected: |
71 | void InitDC(void); | |
72 | ||
ac7fb818 | 73 | private: |
2c24e7ad | 74 | DECLARE_CLASS(wxClientDCImpl) |
c0c133e1 | 75 | wxDECLARE_NO_COPY_CLASS(wxClientDCImpl); |
ac7fb818 | 76 | }; // end of CLASS wxClientDC |
0e320a79 | 77 | |
53a2db12 | 78 | class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl |
0e320a79 | 79 | { |
23e4b7d8 | 80 | public: |
2c24e7ad | 81 | wxPaintDCImpl( wxDC *owner ); |
23e4b7d8 DW |
82 | |
83 | // Create a DC corresponding for painting the window in OnPaint() | |
2c24e7ad | 84 | wxPaintDCImpl( wxDC *owner, wxWindow *pWin ); |
0e320a79 | 85 | |
2c24e7ad | 86 | virtual ~wxPaintDCImpl(); |
0e320a79 | 87 | |
ac7fb818 DW |
88 | // find the entry for this DC in the cache (keyed by the window) |
89 | static WXHDC FindDCInCache(wxWindow* pWin); | |
90 | ||
23e4b7d8 DW |
91 | protected: |
92 | static wxArrayDCInfo ms_cache; | |
0e320a79 | 93 | |
23e4b7d8 | 94 | // find the entry for this DC in the cache (keyed by the window) |
ac7fb818 DW |
95 | wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const; |
96 | private: | |
2c24e7ad | 97 | DECLARE_CLASS(wxPaintDCImpl) |
c0c133e1 | 98 | wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl); |
ac7fb818 | 99 | }; // end of wxPaintDC |
0e320a79 DW |
100 | |
101 | #endif | |
102 | // _WX_DCCLIENT_H_ |