#endif
#include "wx/dc.h"
+#include "wx/dcbuffer.h" // for IMPLEMENT_DYNAMIC_CLASS
#ifndef WX_PRECOMP
#include "wx/math.h"
// implementation
// ============================================================================
+IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC, wxMemoryDC)
+IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC, wxBufferedDC)
+
#if WXWIN_COMPATIBILITY_2_6
void wxDCBase::BeginDrawing()
{
OSStatus err = CreateOverlayWindow();
wxASSERT_MSG( err == noErr , _("Couldn't create the overlay window") );
-
+#ifndef __LP64__
err = QDBeginCGContext(GetWindowPort(m_overlayWindow), &m_overlayContext);
+#endif
CGContextTranslateCTM( m_overlayContext, 0, m_height+m_y );
CGContextScaleCTM( m_overlayContext, 1, -1 );
wxASSERT_MSG( err == noErr , _("Couldn't init the context on the overlay window") );
void wxOverlayImpl::BeginDrawing( wxWindowDC* dc)
{
+// TODO CS
+ dc->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
+/*
delete dc->m_graphicContext ;
dc->m_graphicContext = new wxMacCGContext( m_overlayContext );
// we are right now startin at 0,0 not at the wxWindow's origin, so most of the calculations
// just to make sure :
dc->m_macLocalOrigin.x = 0 ;
dc->m_macLocalOrigin.y = 0 ;
+ */
wxSize size = m_window->GetSize() ;
dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ;
}
void wxOverlayImpl::EndDrawing( wxWindowDC* dc)
{
- delete dc->m_graphicContext ;
- dc->m_graphicContext = NULL ;
-
+ dc->SetGraphicsContext(NULL);
}
void wxOverlayImpl::Clear(wxWindowDC* dc)
{
if ( m_overlayContext )
{
+#ifndef __LP64__
OSStatus err = QDEndCGContext(GetWindowPort(m_overlayWindow), &m_overlayContext);
wxASSERT_MSG( err == noErr , _("Couldn't end the context on the overlay window") );
-
+#endif
m_overlayContext = NULL ;
}