X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50918c652cd4130ad3daa5389e6a0d9a38eb740f..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/cocoa/dcmemory.mm diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 9b1a0e9f85..c8f1ff94b4 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -1,21 +1,21 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/cocoa/dcmemory.mm -// Purpose: wxMemoryDC class +// Purpose: wxMemoryDCImpl class // Author: David Elliott // Modified by: // Created: 2003/03/16 // RCS-ID: $Id$ // Copyright: (c) 2002 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/log.h" - #include "wx/dcmemory.h" #endif //WX_PRECOMP +#include "wx/cocoa/dcmemory.h" #include "wx/cocoa/autorelease.h" #import @@ -25,29 +25,30 @@ #import //----------------------------------------------------------------------------- -// wxMemoryDC +// wxMemoryDCImpl //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxDC) +IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl,wxCocoaDCImpl) -void wxMemoryDC::Init() +void wxMemoryDCImpl::Init() { m_cocoaNSImage = NULL; m_ok = false; } -wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) +wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxDC *WXUNUSED(dc)) +: wxCocoaDCImpl(owner) { Init(); } -wxMemoryDC::~wxMemoryDC(void) +wxMemoryDCImpl::~wxMemoryDCImpl(void) { CocoaUnwindStackAndLoseFocus(); [m_cocoaNSImage release]; } -bool wxMemoryDC::CocoaLockFocus() +bool wxMemoryDCImpl::CocoaLockFocus() { if(m_cocoaNSImage) { @@ -63,7 +64,7 @@ bool wxMemoryDC::CocoaLockFocus() return false; } -bool wxMemoryDC::CocoaUnlockFocus() +bool wxMemoryDCImpl::CocoaUnlockFocus() { [m_cocoaNSImage unlockFocus]; return true; @@ -71,10 +72,10 @@ bool wxMemoryDC::CocoaUnlockFocus() // NOTE: The AppKit is unable to draw onto an NSBitmapImageRep so we must // instead copy the data to an offscreen window, then copy it back -void wxMemoryDC::DoSelect( const wxBitmap& bitmap ) +void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { wxAutoNSAutoreleasePool pool; - if(m_selectedBitmap.Ok()) + if(m_selectedBitmap.IsOk()) { CocoaTakeFocus(); wxASSERT(m_cocoaNSImage); @@ -94,7 +95,7 @@ void wxMemoryDC::DoSelect( const wxBitmap& bitmap ) [m_cocoaNSImage release]; m_cocoaNSImage = nil; m_selectedBitmap = bitmap; - if(m_selectedBitmap.Ok()) + if(m_selectedBitmap.IsOk()) { // Create an offscreen window of the same size m_cocoaNSImage = [[NSImage alloc] @@ -124,7 +125,7 @@ void wxMemoryDC::DoSelect( const wxBitmap& bitmap ) } } -void wxMemoryDC::DoGetSize( int *width, int *height ) const +void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { if(width) *width = m_selectedBitmap.GetWidth(); @@ -132,11 +133,11 @@ void wxMemoryDC::DoGetSize( int *width, int *height ) const *height = m_selectedBitmap.GetHeight(); } -bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, +bool wxMemoryDCImpl::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { - if(!m_selectedBitmap.Ok()) + if(!m_selectedBitmap.IsOk()) return false; NSAffineTransform *transform = [NSAffineTransform transform]; @@ -204,7 +205,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, return false; } -bool wxMemoryDC::CocoaGetBounds(void *rectData) +bool wxMemoryDCImpl::CocoaGetBounds(void *rectData) { if(!rectData) return false;