emoving non-native bitmap code, using common code for iOS and macOS

second part, sources were missing
This commit is contained in:
Stefan Csomor
2018-09-21 20:59:36 +02:00
committed by Vadim Zeitlin
parent 266f32493e
commit 7254515c54
3 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;