+class WXDLLIMPEXP_CORE wxDCTempImpl : public wxMSWDCImpl
+{
+public:
+ // construct a temporary DC with the specified HDC and size (it should be
+ // specified whenever we know it for this HDC)
+ wxDCTempImpl(wxDC *owner, WXHDC hdc, const wxSize& size )
+ : wxMSWDCImpl( owner, hdc ),
+ m_size(size)
+ {
+ }
+
+ virtual ~wxDCTempImpl()
+ {
+ // prevent base class dtor from freeing it
+ SetHDC((WXHDC)NULL);
+ }
+
+ virtual void DoGetSize(int *w, int *h) const
+ {
+ wxASSERT_MSG( m_size.IsFullySpecified(),
+ _T("size of this DC hadn't been set and is unknown") );
+
+ if ( w )
+ *w = m_size.x;
+ if ( h )
+ *h = m_size.y;
+ }
+
+private:
+ // size of this DC must be explicitly set by SetSize() as we have no way to
+ // find it ourselves
+ const wxSize m_size;
+
+ DECLARE_NO_COPY_CLASS(wxDCTempImpl)
+};
+
+class WXDLLIMPEXP_CORE wxDCTemp : public wxDC