/////////////////////////////////////////////////////////////////////////////
// Name: src/mac/carbon/dcclient.cpp
-// Purpose: wxClientDC class
+// Purpose: wxClientDCImpl class
// Author: Stefan Csomor
// Modified by:
// Created: 01/02/97
#include "wx/mac/private.h"
//-----------------------------------------------------------------------------
-// constants
+// wxWindowDCImpl
//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// wxPaintDC
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
-IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
-
-/*
- * wxWindowDC
- */
-
-#include "wx/mac/uma.h"
-#include "wx/notebook.h"
-#include "wx/tabctrl.h"
-
+IMPLEMENT_ABSTRACT_CLASS(wxWindowDCImpl, wxGCDCImpl)
-static wxBrush MacGetBackgroundBrush( wxWindow* window )
+wxWindowDCImpl::wxWindowDCImpl( wxDC *owner )
+ : wxGCDCImpl( owner )
{
- wxBrush bkdBrush = window->MacGetBackgroundBrush() ;
- return bkdBrush ;
-}
-
-wxWindowDC::wxWindowDC()
-{
- m_window = NULL ;
m_release = false;
}
-wxWindowDC::wxWindowDC(wxWindow *window)
+wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window )
+ : wxGCDCImpl( owner )
{
- m_window = window ;
- wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
+ m_window = window;
+
+ WindowRef rootwindow = (WindowRef) window->MacGetTopLevelWindowRef() ;
if (!rootwindow)
return;
SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
}
- SetClippingRegion( 0 , 0 , m_width , m_height ) ;
+ DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
- SetBackground(MacGetBackgroundBrush(window));
+ SetBackground(wxBrush(window->GetBackgroundColour(),wxSOLID));
SetFont( window->GetFont() ) ;
}
-wxWindowDC::~wxWindowDC()
+wxWindowDCImpl::~wxWindowDCImpl()
{
if ( m_release )
{
}
}
-void wxWindowDC::DoGetSize( int* width, int* height ) const
+void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
if ( width )
*width = m_width;
*height = m_height;
}
-wxBitmap wxWindowDC::DoGetAsBitmap(const wxRect *subrect) const
+wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const
{
// wxScreenDC is derived from wxWindowDC, so a screen dc will
// call this method when a Blit is performed with it as a source.
if (!m_window)
return wxNullBitmap;
+#ifdef __LP64__
+ return wxNullBitmap;
+#else
ControlRef handle = (ControlRef) m_window->GetHandle();
if ( !handle )
return wxNullBitmap;
-
+
HIRect rect;
CGImageRef image;
CGContextRef context;
}
return bmp;
+#endif
}
/*
- * wxClientDC
+ * wxClientDCImpl
*/
-wxClientDC::wxClientDC()
+IMPLEMENT_ABSTRACT_CLASS(wxClientDCImpl, wxWindowDCImpl)
+
+wxClientDCImpl::wxClientDCImpl( wxDC *owner )
+ : wxWindowDCImpl( owner )
{
- m_window = NULL ;
}
-wxClientDC::wxClientDC(wxWindow *window) :
- wxWindowDC( window )
+wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) :
+ wxWindowDCImpl( owner, window )
{
- wxCHECK_RET( window, _T("invalid window in wxClientDC") );
+ wxCHECK_RET( window, _T("invalid window in wxClientDCImpl") );
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
SetDeviceOrigin( origin.x, origin.y );
- SetClippingRegion( 0 , 0 , m_width , m_height ) ;
+ DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
}
-wxClientDC::~wxClientDC()
+wxClientDCImpl::~wxClientDCImpl()
{
}
/*
- * wxPaintDC
+ * wxPaintDCImpl
*/
-wxPaintDC::wxPaintDC()
+IMPLEMENT_ABSTRACT_CLASS(wxPaintDCImpl, wxWindowDCImpl)
+
+wxPaintDCImpl::wxPaintDCImpl( wxDC *owner )
+ : wxWindowDCImpl( owner )
{
- m_window = NULL ;
}
-wxPaintDC::wxPaintDC(wxWindow *window) :
- wxWindowDC( window )
+wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
+ wxWindowDCImpl( owner, window )
{
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
SetDeviceOrigin( origin.x, origin.y );
- SetClippingRegion( 0 , 0 , m_width , m_height ) ;
+ DoSetClippingRegion( 0 , 0 , m_width , m_height ) ;
}
-wxPaintDC::~wxPaintDC()
+wxPaintDCImpl::~wxPaintDCImpl()
{
}