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

@@ -119,15 +119,6 @@ public:
bool MacSendKeyUpEvent( wxWindow* focus , long keyval , long modifiers , long when , wxChar uniChar ) ;
bool MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) ;
void MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) ;
#if wxOSX_USE_CARBON
// we only have applescript on these
virtual short MacHandleAEODoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEGURL(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEPDoc(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAERApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
#endif
// in response of an openFiles message with Cocoa and an
// open-document apple event
virtual void MacOpenFiles(const wxArrayString &fileNames) ;

View File

@@ -1,44 +0,0 @@
/*
* Name: wx/osx/carbon/chkconf.h
* Purpose: Compiler-specific configuration checking
* Author: Julian Smart
* Modified by:
* Created: 01/02/97
* Copyright: (c) Julian Smart
* Licence: wxWindows licence
*/
#ifndef _WX_OSX_CARBON_CHKCONF_H_
#define _WX_OSX_CARBON_CHKCONF_H_
/*
* native (1) or emulated (0) toolbar
* also support old notation wxMAC_USE_NATIVE_TOOLBAR
*/
#ifdef wxMAC_USE_NATIVE_TOOLBAR
#define wxOSX_USE_NATIVE_TOOLBAR wxMAC_USE_NATIVE_TOOLBAR
#endif
#ifndef wxOSX_USE_NATIVE_TOOLBAR
#define wxOSX_USE_NATIVE_TOOLBAR 1
#endif
/*
* text rendering system
*/
#define wxOSX_USE_ATSU_TEXT 1
/*
* Audio System
*/
#define wxOSX_USE_QUICKTIME 1
#define wxOSX_USE_AUDIOTOOLBOX 0
#endif
/* _WX_OSX_CARBON_CHKCONF_H_ */

View File

@@ -1,34 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/evtloop.h
// Purpose: declaration of wxEventLoop for wxMac
// Author: Vadim Zeitlin
// Modified by:
// Created: 2006-01-12
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MAC_CARBON_EVTLOOP_H_
#define _WX_MAC_CARBON_EVTLOOP_H_
struct OpaqueEventRef;
typedef OpaqueEventRef *EventRef;
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxCFEventLoop
{
public:
wxGUIEventLoop();
virtual void WakeUp();
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void OSXDoRun();
virtual void OSXDoStop();
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
};
#endif // _WX_MAC_CARBON_EVTLOOP_H_

View File

@@ -1,117 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/mimetype.h
// Purpose: Mac Carbon implementation for wx mime-related classes
// Author: Ryan Norton
// Modified by:
// Created: 04/16/2005
// Copyright: (c) 2005 Ryan Norton (<wxprojects@comcast.net>)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _MIMETYPE_IMPL_H
#define _MIMETYPE_IMPL_H
#include "wx/defs.h"
#include "wx/mimetype.h"
class wxMimeTypesManagerImpl
{
public :
//kinda kooky but in wxMimeTypesManager::EnsureImpl it doesn't call
//initialize, so we do it ourselves
wxMimeTypesManagerImpl() : m_hIC(NULL) { Initialize(); }
~wxMimeTypesManagerImpl() { ClearData(); }
// load all data into memory - done when it is needed for the first time
void Initialize(int mailcapStyles = wxMAILCAP_STANDARD,
const wxString& extraDir = wxEmptyString);
// and delete the data here
void ClearData();
// implement containing class functions
wxFileType *GetFileTypeFromExtension(const wxString& ext);
wxFileType *GetOrAllocateFileTypeFromExtension(const wxString& ext) ;
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
size_t EnumAllFileTypes(wxArrayString& mimetypes);
void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); }
// create a new filetype association
wxFileType *Associate(const wxFileTypeInfo& ftInfo);
// remove association
bool Unassociate(wxFileType *ft);
private:
wxArrayFileTypeInfo m_fallbacks;
void* m_hIC;
void** m_hDatabase;
long m_lCount;
void* pReserved1;
void* pReserved2;
void* pReserved3;
void* pReserved4;
void* pReserved5;
void* pReserved6;
friend class wxFileTypeImpl;
};
class wxFileTypeImpl
{
public:
//kind of nutty, but mimecmn.cpp creates one with an empty new
wxFileTypeImpl() : m_manager(NULL) {}
~wxFileTypeImpl() {} //for those broken compilers
// implement accessor functions
bool GetExtensions(wxArrayString& extensions);
bool GetMimeType(wxString *mimeType) const;
bool GetMimeTypes(wxArrayString& mimeTypes) const;
bool GetIcon(wxIconLocation *iconLoc) const;
bool GetDescription(wxString *desc) const;
bool GetOpenCommand(wxString *openCmd,
const wxFileType::MessageParameters&) const;
bool GetPrintCommand(wxString *printCmd,
const wxFileType::MessageParameters&) const;
size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands,
const wxFileType::MessageParameters& params) const;
// remove the record for this file type
// probably a mistake to come here, use wxMimeTypesManager.Unassociate (ft) instead
bool Unassociate(wxFileType *ft)
{
return m_manager->Unassociate(ft);
}
// set an arbitrary command, ask confirmation if it already exists and
// overwriteprompt is TRUE
bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = true);
bool SetDefaultIcon(const wxString& strIcon = wxEmptyString, int index = 0);
private:
void Init(wxMimeTypesManagerImpl *manager, long lIndex)
{ m_manager=(manager); m_lIndex=(lIndex); }
// helper function
wxString GetCommand(const wxString& verb) const;
wxMimeTypesManagerImpl *m_manager;
long m_lIndex;
void* pReserved1;
void* pReserved2;
void* pReserved3;
void* pReserved4;
void* pReserved5;
void* pReserved6;
friend class wxMimeTypesManagerImpl;
};
#endif
//_MIMETYPE_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/private/mactext.h
// Purpose: private wxMacTextControl base class
// Author: Stefan Csomor
// Modified by:
// Created: 03/02/99
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MAC_PRIVATE_MACTEXT_H_
#define _WX_MAC_PRIVATE_MACTEXT_H_
#include "wx/osx/private.h"
// implementation exposed, so that search control can pull it
class wxMacUnicodeTextControl : public wxMacControl, public wxTextWidgetImpl
{
public :
wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) ;
wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
const wxString& str,
const wxPoint& pos,
const wxSize& size, long style ) ;
virtual ~wxMacUnicodeTextControl();
virtual bool CanFocus() const
{ return true; }
virtual void VisibilityChanged(bool shown);
virtual wxString GetStringValue() const ;
virtual void SetStringValue( const wxString &str) ;
virtual void Copy();
virtual void Cut();
virtual void Paste();
virtual bool CanPaste() const;
virtual void SetEditable(bool editable) ;
virtual void GetSelection( long* from, long* to) const ;
virtual void SetSelection( long from , long to ) ;
virtual void WriteText(const wxString& str) ;
protected :
void InstallEventHandlers();
// contains the tag for the content (is different for password and non-password controls)
OSType m_valueTag ;
WXEVENTHANDLERREF m_macTextCtrlEventHandler ;
public :
ControlEditTextSelectionRec m_selection ;
};
#endif // _WX_MAC_PRIVATE_MACTEXT_H_

View File

@@ -60,17 +60,6 @@ private:
WXDLLIMPEXP_CORE wxPrintNativeDataBase* wxOSXCreatePrintData();
#if wxOSX_USE_CARBON
class WXDLLIMPEXP_CORE wxOSXCarbonPrintData : public wxOSXPrintData
{
public:
wxOSXCarbonPrintData();
virtual ~wxOSXCarbonPrintData();
private:
wxDECLARE_DYNAMIC_CLASS(wxOSXCarbonPrintData);
} ;
#endif
#if wxOSX_USE_COCOA
class WXDLLIMPEXP_CORE wxOSXCocoaPrintData : public wxOSXPrintData
{

View File

@@ -1,32 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/private/timer.h
// Purpose: wxTimer class
// Author: Stefan Csomor
// Created: 1998-01-01
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MAC_PRIVATE_TIMER_H_
#define _WX_MAC_PRIVATE_TIMER_H_
#include "wx/private/timer.h"
struct MacTimerInfo;
class WXDLLIMPEXP_CORE wxCarbonTimerImpl : public wxTimerImpl
{
public:
wxCarbonTimerImpl(wxTimer *timer);
virtual ~wxCarbonTimerImpl();
virtual bool Start(int milliseconds = -1, bool one_shot = false);
virtual void Stop();
virtual bool IsRunning() const;
private:
MacTimerInfo *m_info;
};
#endif // _WX_MAC_PRIVATE_TIMER_H_

View File

@@ -1,64 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/carbon/statbmp.h
// Purpose: wxStaticBitmap class
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STATBMP_H_
#define _WX_STATBMP_H_
#include "wx/icon.h"
class WXDLLIMPEXP_CORE wxStaticBitmap: public wxStaticBitmapBase
{
wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap);
public:
wxStaticBitmap() { }
wxStaticBitmap(wxWindow *parent, wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr)
{
Create(parent, id, label, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxStaticBitmapNameStr);
virtual void SetBitmap(const wxBitmap& bitmap);
virtual void Command(wxCommandEvent& WXUNUSED(event)) {}
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}
void OnPaint( wxPaintEvent &event ) ;
wxBitmap GetBitmap() const { return m_bitmap; }
wxIcon GetIcon() const
{
// icons and bitmaps are really the same thing in wxMac
return (const wxIcon &)m_bitmap;
}
void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; }
// overridden base class virtuals
virtual bool AcceptsFocus() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;
wxBitmap m_bitmap;
wxDECLARE_EVENT_TABLE();
};
#endif
// _WX_STATBMP_H_

View File

@@ -74,8 +74,6 @@
#if wxOSX_USE_IPHONE
#include "wx/osx/iphone/chkconf.h"
#elif wxOSX_USE_CARBON
#include "wx/osx/carbon/chkconf.h"
#elif wxOSX_USE_COCOA
#include "wx/osx/cocoa/chkconf.h"
#endif

View File

@@ -26,11 +26,7 @@ class wxComboWidgetImpl;
// Combobox item
class WXDLLIMPEXP_CORE wxComboBox :
public wxWindowWithItems<
#if wxOSX_USE_CARBON
wxNavigationEnabled<wxControl>,
#else
wxControl,
#endif
wxComboBoxBase>
{
wxDECLARE_DYNAMIC_CLASS(wxComboBox);
@@ -38,12 +34,6 @@ class WXDLLIMPEXP_CORE wxComboBox :
public:
virtual ~wxComboBox();
#if wxOSX_USE_CARBON
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true);
virtual bool Show(bool show = true);
#endif
// callback functions
virtual void DelegateTextChanged( const wxString& value );
virtual void DelegateChoice( const wxString& value );
@@ -105,38 +95,6 @@ class WXDLLIMPEXP_CORE wxComboBox :
virtual void SetValue(const wxString& value);
// these methods are provided by wxTextEntry for the native impl.
#if wxOSX_USE_CARBON
// Text field functions
virtual wxString GetValue() const;
virtual void WriteText(const wxString& text);
// Clipboard operations
virtual void Copy();
virtual void Cut();
virtual void Paste();
virtual void SetInsertionPoint(long pos);
virtual void SetInsertionPointEnd();
virtual long GetInsertionPoint() const;
virtual wxTextPos GetLastPosition() const;
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
virtual void SetEditable(bool editable);
virtual bool IsEditable() const;
virtual void Undo();
virtual void Redo();
virtual void SelectAll();
virtual bool CanCopy() const;
virtual bool CanCut() const;
virtual bool CanPaste() const;
virtual bool CanUndo() const;
virtual bool CanRedo() const;
virtual wxClientDataType GetClientDataType() const;
virtual wxTextWidgetImpl* GetTextPeer() const;
#endif // wxOSX_USE_CARBON
#if wxOSX_USE_COCOA
virtual void Popup();
@@ -157,16 +115,10 @@ protected:
virtual void DoClear();
// wxTextEntry functions
#if wxOSX_USE_CARBON
virtual wxString DoGetValue() const;
#endif
virtual wxWindow *GetEditableWindow() { return this; }
// override the base class virtuals involved in geometry calculations
virtual wxSize DoGetBestSize() const;
#if wxOSX_USE_CARBON
virtual void DoMoveWindow(int x, int y, int width, int height);
#endif
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
@@ -175,9 +127,6 @@ protected:
virtual void DoSetItemClientData(unsigned int n, void* clientData);
virtual void * DoGetItemClientData(unsigned int n) const;
#if wxOSX_USE_CARBON
virtual void SetClientDataType(wxClientDataType clientDataItemsType);
#endif
virtual void EnableTextChangedEvents(bool enable);

View File

@@ -12,11 +12,7 @@
#include "wx/dataview.h"
#if wxOSX_USE_CARBON
typedef wxMacControl wxWidgetImplType;
#else
typedef wxWidgetImpl wxWidgetImplType;
#endif
// ---------------------------------------------------------
// Helper functions for dataview implementation on OSX

View File

@@ -128,11 +128,7 @@ class wxSearchCtrl;
WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
#if wxOSX_USE_CARBON
typedef wxMacControl wxWidgetImplType;
#else
typedef wxWidgetImpl wxWidgetImplType;
#endif
#if wxUSE_MENUS
class wxMenuItemImpl : public wxObject

View File

@@ -29,8 +29,6 @@ enum wxDateTimeWidgetKind
class wxDateTimeWidgetImpl
#if wxOSX_USE_COCOA
: public wxWidgetCocoaImpl
#elif wxOSX_USE_CARBON
: public wxMacControl
#else
#error "Unsupported platform"
#endif
@@ -58,10 +56,6 @@ protected:
: wxWidgetCocoaImpl(wxpeer, view)
{
}
#elif wxOSX_USE_CARBON
// There is no Carbon implementation of this control yet so we don't need
// any ctor for it yet but it should be added here if Carbon version is
// written later.
#endif
};

View File

@@ -13,11 +13,7 @@
#ifndef _WX_OSX_EVTLOOP_H_
#define _WX_OSX_EVTLOOP_H_
#ifdef __WXOSX_COCOA__
#include "wx/osx/cocoa/evtloop.h"
#else
#include "wx/osx/carbon/evtloop.h"
#endif
#include "wx/osx/cocoa/evtloop.h"
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow;

View File

@@ -139,14 +139,6 @@ public:
// Mac-specific, risks to change, don't use in portable code
#if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT
wxUint16 MacGetThemeFontID() const ;
// 'old' Quickdraw accessors
short MacGetFontNum() const;
wxByte MacGetFontStyle() const;
#endif
#if wxOSX_USE_COCOA_OR_CARBON
CGFontRef OSXGetCGFont() const;
#endif

View File

@@ -131,20 +131,6 @@ public:
// implementation-only from now on
#if wxOSX_USE_CARBON
// Unlike some other platforms, this must get called if you override it,
// i.e. don't forget "event.Skip()" in your EVT_SIZE handler
void OnSize(wxSizeEvent& event);
virtual void MacSuperChangedPosition();
virtual void MacTopLevelWindowChangedPosition();
virtual void MacVisibilityChanged();
void MacUpdateView();
GLint GetAglBufferName() const { return m_bufferName; }
#endif
protected:
WXGLPixelFormat m_glFormat;

View File

@@ -167,10 +167,6 @@ protected:
wxArrayPtrVoid m_itemsClientData;
private:
#ifdef __WXOSX_CARBON__
// It needs to call our CalcAndSendEvent().
friend class wxMacDataBrowserListControl;
#endif // Carbon
wxDECLARE_DYNAMIC_CLASS(wxListBox);
wxDECLARE_EVENT_TABLE();

View File

@@ -5,8 +5,6 @@
#if wxOSX_USE_IPHONE
#include "wx/osx/iphone/private.h"
#elif wxOSX_USE_CARBON
#include "wx/osx/carbon/private.h"
#elif wxOSX_USE_COCOA
#include "wx/osx/cocoa/private.h"
#elif wxUSE_GUI

View File

@@ -1,5 +1 @@
#ifdef __WXMAC_CLASSIC__
#include "wx/osx/classic/private/print.h"
#else
#include "wx/osx/carbon/private/print.h"
#endif

View File

@@ -1,11 +1,3 @@
/* common warning snippet for all osx direct includes */
#ifndef wxOSX_USE_CARBON
#error "this files should only be included after platform.h was included"
#endif
#if 1 // revert to wxOSX_USE_COCOA_OR_IPHONE in case of problems
#include "wx/osx/core/private/timer.h"
#elif wxOSX_USE_CARBON
#include "wx/osx/carbon/private/timer.h"
#endif

View File

@@ -34,16 +34,6 @@ public :
// does the true work of stopping and cleaning up
virtual void DoStop() = 0;
#if wxOSX_USE_CARBON
// can be called by a timer for repeated tasks during playback
virtual void SoundTask();
protected :
void CreateAndStartTimer();
wxSoundTimer* m_pTimer;
#endif // wxOSX_USE_CARBON
protected:
unsigned int m_flags;
bool m_markedForDeletion;

View File

@@ -1,6 +1,2 @@
#if wxOSX_USE_CARBON
#include "wx/osx/carbon/statbmp.h"
#else
#define wxGenericStaticBitmap wxStaticBitmap
#include "wx/generic/statbmpg.h"
#endif

View File

@@ -1,3 +0,0 @@
#if wxOSX_USE_CARBON
#include "wx/osx/carbon/uma.h"
#endif

View File

@@ -19,10 +19,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
class WXDLLIMPEXP_FWD_CORE wxPanel;
class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow;
#if wxOSX_USE_CARBON
class WXDLLIMPEXP_FWD_CORE wxMacControl ;
typedef wxMacControl wxOSXWidgetImpl;
#elif wxOSX_USE_COCOA_OR_IPHONE
#if wxOSX_USE_COCOA_OR_IPHONE
class WXDLLIMPEXP_FWD_CORE wxWidgetImpl ;
typedef wxWidgetImpl wxOSXWidgetImpl;
#endif