]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/dcmemory.cpp
wxUSE_PROPGRID is now recognized by source and header files
[wxWidgets.git] / src / palmos / dcmemory.cpp
index 4a4523f3f1fa522e68aae127220688bc358dcb48..827aaddea28ca0056c90325ee49fc7eee99b0b36 100644 (file)
@@ -1,10 +1,10 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcmemory.cpp
+// Name:        src/palmos/dcmemory.cpp
 // Purpose:     wxMemoryDC class
 // Purpose:     wxMemoryDC class
-// Author:      William Osborne
+// Author:      William Osborne - minimal working wxPalmOS port
 // Modified by:
 // Created:     10/13/04
 // Modified by:
 // Created:     10/13/04
-// RCS-ID:      $Id
+// RCS-ID:      $Id$
 // Copyright:   (c) William Osborne
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) William Osborne
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // headers
 // ----------------------------------------------------------------------------
 
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "dcmemory.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
+#include "wx/dcmemory.h"
+#include "wx/palmos/dcmemory.h"
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/log.h"
 #endif
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/log.h"
 #endif
 
-#include "wx/dcmemory.h"
-
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// wxWin macros
+// wxMemoryDCImpl
 // ----------------------------------------------------------------------------
 
 // ----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
-
-// ============================================================================
-// implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// wxMemoryDC
-// ----------------------------------------------------------------------------
+IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxPalmDCImpl)
 
 
-wxMemoryDC::wxMemoryDC()
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) 
+        : wxPalmDCImpl( owner )
 {
 {
+    CreateCompatible(NULL); 
+    Init(); 
 }
 
 }
 
-wxMemoryDC::wxMemoryDC(wxDC *dc)
-{
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) 
+        : wxPalmDCImpl( owner ) 
+{ 
+    CreateCompatible(NULL); 
+    Init(); 
+    DoSelect(bitmap);
 }
 
 }
 
-void wxMemoryDC::Init()
+wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
+        : wxPalmDCImpl( owner ) 
 {
 {
+    wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") );
+
+    CreateCompatible(dc);
+
+    Init();
 }
 
 }
 
-bool wxMemoryDC::CreateCompatible(wxDC *dc)
+void wxMemoryDCImpl::Init()
 {
 {
-    return false;
 }
 
 }
 
-void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
+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;
+    }
+
+    return false;
 }
 
 }
 
-void wxMemoryDC::DoGetSize(int *width, int *height) const
+void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
 {
 }
 
 {
 }
 
-// the rest of this file deals with drawing rectangles workaround, disabled by
-// default
-
-#define wxUSE_MEMORY_DC_DRAW_RECTANGLE 0
-
-#if wxUSE_MEMORY_DC_DRAW_RECTANGLE
-
-// 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::DoGetSize(int *width, int *height) const
 {
 }
 
 {
 }
 
-#endif // wxUSE_MEMORY_DC_DRAW_RECTANGLE
-
-void wxMemoryDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+wxBitmap wxMemoryDCImpl::DoGetAsBitmap(const wxRect* subrect) const
 {
 }
 {
 }
-