#endif
#include "wx/dcmemory.h"
+#include "wx/palmos/dcmemory.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
#endif
// ----------------------------------------------------------------------------
-// wxWin macros
+// wxMemoryDCImpl
// ----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
+IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxPalmDCImpl)
-// ============================================================================
-// implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// wxMemoryDC
-// ----------------------------------------------------------------------------
-
-wxMemoryDC::wxMemoryDC(wxDC *dc)
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
+ : wxPalmDCImpl( owner )
{
+ CreateCompatible(NULL);
+ Init();
}
-void wxMemoryDC::Init()
-{
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap )
+ : wxPalmDCImpl( owner )
+{
+ CreateCompatible(NULL);
+ Init();
+ DoSelect(bitmap);
}
-bool wxMemoryDC::CreateCompatible(wxDC *dc)
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
+ : wxPalmDCImpl( owner )
{
- return false;
-}
+ wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") );
-void wxMemoryDC::DoSelect(const wxBitmap& bitmap)
-{
+ CreateCompatible(dc);
+
+ Init();
}
-void wxMemoryDC::DoGetSize(int *width, int *height) const
+void wxMemoryDCImpl::Init()
{
}
-// the rest of this file deals with drawing rectangles workaround, disabled by
-// default
-
-#define wxUSE_MEMORY_DC_DRAW_RECTANGLE 0
+bool wxMemoryDCImpl::CreateCompatible(wxDC *dc)
+{
+ wxDCImpl *impl = dc ? dc->GetImpl() : NULL ;
+ wxPalmDCImpl *msw_impl = wxDynamicCast( impl, wxPalmDCImpl );
+ if ( dc && !msw_impl)
+ {
+ m_ok = false;
+ return false;
+ }
-#if wxUSE_MEMORY_DC_DRAW_RECTANGLE
+ return false;
+}
-// For some reason, drawing a rectangle on a memory DC has problems.
-// Use this substitute if we can.
-static void wxDrawRectangle(wxDC& dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{
}
-#endif // wxUSE_MEMORY_DC_DRAW_RECTANGLE
+void wxMemoryDCImpl::DoGetSize(int *width, int *height) const
+{
+}
-void wxMemoryDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+wxBitmap wxMemoryDCImpl::DoGetAsBitmap(const wxRect* subrect) const
{
}