X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da457c1b4984df09bab0327a1db3c01415f9f240..9176f38f730c3415ac7a911c2f85cdea7eca4478:/wxPython/src/_dc.i diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index e61213b451..55e415d87c 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -572,98 +572,10 @@ public: %{ -//-=-=-=-=-=-=-=-=-=-=- - -#if 1 -// Use the standard wxBufferedDC #include - -#else - -// Or, temporarily put a set of classes here similar to the old buffered DC -// classes until the real ones can be fixed to work "correctly" again. - -class wxBufferedDC : public wxMemoryDC -{ -private: - wxDC *m_dc; - wxBitmap m_buffer; - -public: - - wxBufferedDC() : m_dc( 0 ) {} - - wxBufferedDC( wxDC *dc, const wxBitmap &buffer ) - : m_dc( dc ), m_buffer( buffer ) - { - SelectObject( m_buffer ); - } - - wxBufferedDC( wxDC *dc, const wxSize &area ) - : m_dc( dc ), m_buffer( area.GetWidth(), area.GetHeight() ) - { - SelectObject( m_buffer ); - } - - ~wxBufferedDC() { - if( m_dc != 0 ) - UnMask(); - } - - - void Init( wxDC *dc, const wxBitmap &buffer ) { - wxASSERT_MSG( m_dc == 0 && m_buffer == wxNullBitmap, - _T("wxBufferedDC already initialised") ); - m_dc = dc; - m_buffer = buffer; - SelectObject( m_buffer ); - } - - void Init( wxDC *dc, const wxSize &area ) { - wxASSERT_MSG( m_dc == 0 && m_buffer == wxNullBitmap, - _T("wxBufferedDC already initialised") ); - m_dc = dc; - m_buffer = wxBitmap( area.GetWidth(), area.GetHeight() ); - SelectObject( m_buffer ); - } - - void UnMask() { - wxASSERT_MSG( m_dc != 0, _T("No low level DC associated with buffer (anymore)") ); - m_dc->Blit( 0, 0, m_buffer.GetWidth(), m_buffer.GetHeight(), this, 0, 0 ); - m_dc = 0; - } -}; - - -class wxBufferedPaintDC : public wxBufferedDC -{ -private: - wxPaintDC m_paintdc; - -public: - wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap ) - : m_paintdc( window ) - { - window->PrepareDC( m_paintdc ); - - if( buffer != wxNullBitmap ) - Init( &m_paintdc, buffer ); - else - Init( &m_paintdc, window->GetClientSize() ); - } - - ~wxBufferedPaintDC() { - UnMask(); - } -}; - -#endif -//-=-=-=-=-=-=-=-=-=-=- %} - - class wxBufferedDC : public wxMemoryDC { public: