1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxClientDC class
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "dcclient.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
31 #include "wx/string.h"
33 #include "wx/window.h"
35 #include "wx/dcclient.h"
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 struct WXDLLEXPORT wxPaintDCInfo
43 wxPaintDCInfo(wxWindow
*win
, wxDC
*dc
)
45 hwnd
= win
->GetHWND();
50 WXHWND hwnd
; // window for this DC
51 WXHDC hdc
; // the DC handle
52 size_t count
; // usage count
55 #include "wx/arrimpl.cpp"
57 WX_DEFINE_OBJARRAY(wxArrayDCInfo
);
59 // ----------------------------------------------------------------------------
61 // ----------------------------------------------------------------------------
63 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC
, wxDC
)
64 IMPLEMENT_DYNAMIC_CLASS(wxClientDC
, wxWindowDC
)
65 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC
, wxClientDC
)
66 IMPLEMENT_CLASS(wxPaintDCEx
, wxPaintDC
)
68 // ----------------------------------------------------------------------------
70 // ----------------------------------------------------------------------------
76 // ===========================================================================
78 // ===========================================================================
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------
84 wxWindowDC::wxWindowDC()
88 wxWindowDC::wxWindowDC(wxWindow
*canvas
)
92 void wxWindowDC::InitDC()
96 void wxWindowDC::DoGetSize(int *width
, int *height
) const
100 // ----------------------------------------------------------------------------
102 // ----------------------------------------------------------------------------
104 wxClientDC::wxClientDC()
108 wxClientDC::wxClientDC(wxWindow
*canvas
)
112 void wxClientDC::InitDC()
116 wxClientDC::~wxClientDC()
120 void wxClientDC::DoGetSize(int *width
, int *height
) const
124 // ----------------------------------------------------------------------------
126 // ----------------------------------------------------------------------------
128 wxArrayDCInfo
wxPaintDC::ms_cache
;
130 wxPaintDC::wxPaintDC()
134 wxPaintDC::wxPaintDC(wxWindow
*canvas
)
138 wxPaintDC::~wxPaintDC()
142 wxPaintDCInfo
*wxPaintDC::FindInCache(size_t *index
) const
147 WXHDC
wxPaintDC::FindDCInCache(wxWindow
* win
)
156 wxPaintDCEx::wxPaintDCEx(wxWindow
*canvas
, WXHDC dc
) : saveState(0)
160 wxPaintDCEx::~wxPaintDCEx()