From 7254515c54e252ee895d60d9e7e9805a3c27f0d1 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 21 Sep 2018 20:59:36 +0200 Subject: [PATCH] emoving non-native bitmap code, using common code for iOS and macOS second part, sources were missing --- src/osx/carbon/graphics.cpp | 4 ++-- src/osx/carbon/icon.cpp | 14 +++++++------- src/osx/carbon/utilscocoa.mm | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 98ce48469d..c2fc7523b6 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -2162,7 +2162,7 @@ void wxMacCoreGraphicsContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDo #if wxOSX_USE_COCOA { CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h ); - wxOSXDrawNSImage( m_cgContext, &r, bmp.GetNSImage()); + wxOSXDrawNSImage( m_cgContext, &r, bmp.GetImage()); } #else wxGraphicsBitmap bitmap = GetRenderer()->CreateBitmap(bmp); @@ -2225,7 +2225,7 @@ void wxMacCoreGraphicsContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDoubl #if wxOSX_USE_COCOA { CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h ); - wxOSXDrawNSImage( m_cgContext, &r, icon.GetNSImage()); + wxOSXDrawNSImage( m_cgContext, &r, icon.GetImage()); } #endif diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index 2a6a3da20d..f1ad130e40 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -45,7 +45,7 @@ public: int GetWidth() const { return (int) wxOSXGetImageSize(m_nsImage).width; } int GetHeight() const { return (int) wxOSXGetImageSize(m_nsImage).height; } - WX_NSImage GetNSImage() const; + WX_NSImage GetImage() const; private: void Init(); @@ -94,7 +94,7 @@ void wxIconRefData::Free() } } -WX_NSImage wxIconRefData::GetNSImage() const +WX_NSImage wxIconRefData::GetImage() const { wxASSERT( IsOk() ); @@ -123,7 +123,7 @@ public: WXHICON GetHICON() const { return (WXHICON) m_iconRef; } - WX_NSImage GetNSImage() const; + WX_NSImage GetImage() const; private: void Init(); @@ -172,7 +172,7 @@ void wxIconRefData::Free() } } -WX_NSImage wxIconRefData::GetNSImage() const +WX_NSImage wxIconRefData::GetImage() const { wxASSERT( IsOk() ); @@ -269,11 +269,11 @@ int wxIcon::GetDepth() const return 32; } -WX_NSImage wxIcon::GetNSImage() const +WX_NSImage wxIcon::GetImage() const { wxCHECK_MSG( IsOk(), NULL, wxT("invalid icon") ); - return M_ICONDATA->GetNSImage() ; + return M_ICONDATA->GetImage() ; } #if WXWIN_COMPATIBILITY_3_0 @@ -565,7 +565,7 @@ void wxIcon::CopyFromBitmap( const wxBitmap& bmp ) UnRef() ; #if wxOSX_ICON_USE_NSIMAGE - m_refData = new wxIconRefData( bmp.GetNSImage() , bmp.GetWidth(), bmp.GetHeight() ) ; + m_refData = new wxIconRefData( bmp.GetImage() , bmp.GetWidth(), bmp.GetHeight() ) ; #else // as the bitmap owns that ref, we have to acquire it as well diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index ac6b06f204..73a4d4a07b 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -560,7 +560,7 @@ WX_NSCursor wxMacCocoaCreateCursorFromCGImage( CGImageRef cgImageRef, float hot firstTime = NO; } - NSImage *nsImage = wxOSXGetNSImageFromCGImage( cgImageRef ); + NSImage *nsImage = wxOSXGetImageFromCGImage( cgImageRef ); NSCursor *cursor = [[NSCursor alloc] initWithImage:nsImage hotSpot:NSMakePoint( hotSpotX, hotSpotY )]; return cursor;