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:
Tobias Taschner
2016-01-22 15:40:58 +01:00
parent 8d42890df4
commit 5ba67c67e4
144 changed files with 75 additions and 35011 deletions

View File

@@ -98,9 +98,6 @@ OSStatus wxMacDrawCGImage(
const CGRect * inBounds,
CGImageRef inImage)
{
#if wxOSX_USE_CARBON
return HIViewDrawCGImage( inContext, inBounds, inImage );
#else
CGContextSaveGState(inContext);
CGContextTranslateCTM(inContext, inBounds->origin.x, inBounds->origin.y + inBounds->size.height);
CGRect r = *inBounds;
@@ -109,7 +106,6 @@ OSStatus wxMacDrawCGImage(
CGContextDrawImage(inContext, r, inImage );
CGContextRestoreGState(inContext);
return noErr;
#endif
}
CGColorRef wxMacCreateCGColor( const wxColour& col )
@@ -1330,10 +1326,6 @@ class WXDLLEXPORT wxMacCoreGraphicsContext : public wxGraphicsContext
public:
wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, CGContextRef cgcontext, wxDouble width = 0, wxDouble height = 0 );
#if wxOSX_USE_CARBON
wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, WindowRef window );
#endif
wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, wxWindow* window );
wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer);
@@ -1459,11 +1451,7 @@ private:
virtual void DoDrawRotatedText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ) wxOVERRIDE;
CGContextRef m_cgContext;
#if wxOSX_USE_CARBON
WindowRef m_windowRef;
#else
WXWidget m_view;
#endif
bool m_contextSynthesized;
CGAffineTransform m_windowTransform;
bool m_invisible;
@@ -1524,9 +1512,6 @@ void wxMacCoreGraphicsContext::Init()
m_contextSynthesized = false;
m_width = 0;
m_height = 0;
#if wxOSX_USE_CARBON
m_windowRef = NULL;
#endif
#if wxOSX_USE_COCOA_OR_IPHONE
m_view = NULL;
#endif
@@ -1543,15 +1528,6 @@ wxMacCoreGraphicsContext::wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer
m_height = height;
}
#if wxOSX_USE_CARBON
wxMacCoreGraphicsContext::wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, WindowRef window ): wxGraphicsContext(renderer)
{
Init();
m_windowRef = window;
m_enableOffset = true;
}
#endif
wxMacCoreGraphicsContext::wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, wxWindow* window ): wxGraphicsContext(renderer)
{
Init();
@@ -1655,13 +1631,6 @@ bool wxMacCoreGraphicsContext::EnsureIsValid()
{
m_invisible = true;
}
#endif
#if wxOSX_USE_CARBON
OSStatus status = QDBeginCGContext( GetWindowPort( m_windowRef ) , &m_cgContext );
if ( status != noErr )
{
wxFAIL_MSG("Cannot nest wxDCs on the same window");
}
#endif
if ( m_cgContext )
{
@@ -2114,9 +2083,6 @@ void wxMacCoreGraphicsContext::SetNativeContext( CGContextRef cg )
CGContextRestoreGState( m_cgContext );
if ( m_contextSynthesized )
{
#if wxOSX_USE_CARBON
QDEndCGContext( GetWindowPort( m_windowRef ) , &m_cgContext);
#endif
#if wxOSX_USE_COCOA
wxOSXUnlockFocus(m_view);
#endif
@@ -2226,18 +2192,6 @@ void wxMacCoreGraphicsContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDoubl
if (m_composition == wxCOMPOSITION_DEST)
return;
#if wxOSX_USE_CARBON
{
CGContextSaveGState( m_cgContext );
CGContextTranslateCTM( m_cgContext,(CGFloat) x ,(CGFloat) (y + h) );
CGContextScaleCTM( m_cgContext, 1, -1 );
CGRect r = CGRectMake( (CGFloat) 0.0 , (CGFloat) 0.0 , (CGFloat) w , (CGFloat) h );
PlotIconRefInContext( m_cgContext , &r , kAlignNone , kTransformNone ,
NULL , kPlotIconRefNormalFlags , icon.GetHICON() );
CGContextRestoreGState( m_cgContext );
}
#endif
#if wxOSX_USE_COCOA
{
CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h );
@@ -2717,14 +2671,8 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( v
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeWindow( void * window )
{
#if wxOSX_USE_CARBON
wxMacCoreGraphicsContext* context = new wxMacCoreGraphicsContext(this,(WindowRef)window);
context->EnableOffset(true);
return context;
#else
wxUnusedVar(window);
return NULL;
#endif
}
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( wxWindow* window )