Remove wxOSX/Carbon support.
Cocoa has been the default toolkit in wxWidgets for a long time. There is really no good reason to use Carbon in 2016 and this removes a lot of unused and unmaintained code.
This commit is contained in:
@@ -29,11 +29,7 @@
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject);
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject);
|
||||
|
||||
#if wxOSX_USE_CARBON
|
||||
#include "wx/osx/uma.h"
|
||||
#else
|
||||
#include "wx/osx/private.h"
|
||||
#endif
|
||||
|
||||
CGColorSpaceRef wxMacGetGenericRGBColorSpace();
|
||||
CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
|
||||
@@ -844,93 +840,6 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
int h = icon.GetHeight() ;
|
||||
|
||||
Create( w , h ) ;
|
||||
#ifdef __WXOSX_CARBON__
|
||||
if ( w == h && ( w == 16 || w == 32 || w == 48 || w == 128 ) )
|
||||
{
|
||||
IconFamilyHandle iconFamily = NULL ;
|
||||
Handle imagehandle = NewHandle( 0 ) ;
|
||||
Handle maskhandle = NewHandle( 0 ) ;
|
||||
|
||||
OSType maskType = 0;
|
||||
OSType dataType = 0;
|
||||
IconSelectorValue selector = 0 ;
|
||||
|
||||
switch (w)
|
||||
{
|
||||
case 128:
|
||||
dataType = kThumbnail32BitData ;
|
||||
maskType = kThumbnail8BitMask ;
|
||||
selector = kSelectorAllAvailableData ;
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dataType = kHuge32BitData ;
|
||||
maskType = kHuge8BitMask ;
|
||||
selector = kSelectorHuge32Bit | kSelectorHuge8BitMask ;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
dataType = kLarge32BitData ;
|
||||
maskType = kLarge8BitMask ;
|
||||
selector = kSelectorLarge32Bit | kSelectorLarge8BitMask ;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
dataType = kSmall32BitData ;
|
||||
maskType = kSmall8BitMask ;
|
||||
selector = kSelectorSmall32Bit | kSelectorSmall8BitMask ;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
OSStatus err = IconRefToIconFamily( MAC_WXHICON(icon.GetHICON()) , selector , &iconFamily ) ;
|
||||
|
||||
err = GetIconFamilyData( iconFamily , dataType , imagehandle ) ;
|
||||
err = GetIconFamilyData( iconFamily , maskType , maskhandle ) ;
|
||||
size_t imagehandlesize = GetHandleSize( imagehandle ) ;
|
||||
size_t maskhandlesize = GetHandleSize( maskhandle ) ;
|
||||
|
||||
if ( imagehandlesize != 0 && maskhandlesize != 0 )
|
||||
{
|
||||
wxASSERT( GetHandleSize( imagehandle ) == w * 4 * h ) ;
|
||||
wxASSERT( GetHandleSize( maskhandle ) == w * h ) ;
|
||||
|
||||
UseAlpha() ;
|
||||
|
||||
unsigned char *source = (unsigned char *) *imagehandle ;
|
||||
unsigned char *sourcemask = (unsigned char *) *maskhandle ;
|
||||
unsigned char* destination = (unsigned char*) BeginRawAccess() ;
|
||||
|
||||
for ( int y = 0 ; y < h ; ++y )
|
||||
{
|
||||
for ( int x = 0 ; x < w ; ++x )
|
||||
{
|
||||
unsigned char a = *sourcemask++;
|
||||
*destination++ = a;
|
||||
source++ ;
|
||||
#if wxOSX_USE_PREMULTIPLIED_ALPHA
|
||||
*destination++ = ( (*source++) * a + 127 ) / 255;
|
||||
*destination++ = ( (*source++) * a + 127 ) / 255;
|
||||
*destination++ = ( (*source++) * a + 127 ) / 255;
|
||||
#else
|
||||
*destination++ = *source++ ;
|
||||
*destination++ = *source++ ;
|
||||
*destination++ = *source++ ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
EndRawAccess() ;
|
||||
DisposeHandle( imagehandle ) ;
|
||||
DisposeHandle( maskhandle ) ;
|
||||
created = true ;
|
||||
}
|
||||
|
||||
DisposeHandle( (Handle) iconFamily ) ;
|
||||
}
|
||||
#endif
|
||||
if ( !created )
|
||||
{
|
||||
wxMemoryDC dc ;
|
||||
|
||||
Reference in New Issue
Block a user