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