diff --git a/include/wx/osx/cocoa/dataview.h b/include/wx/osx/cocoa/dataview.h index 540b66a56c..65fc99c2b3 100644 --- a/include/wx/osx/cocoa/dataview.h +++ b/include/wx/osx/cocoa/dataview.h @@ -249,7 +249,7 @@ private: // owned by the set. Furthermore, children of the last parent are stored // in a linear list. // -@interface wxCocoaOutlineDataSource : NSObject wxOSX_10_6_AND_LATER() +@interface wxCocoaOutlineDataSource : NSObject { // descriptors specifying the sorting (currently the array only holds one // object only) @@ -395,7 +395,7 @@ private: // wxCocoaOutlineView // ============================================================================ -@interface wxCocoaOutlineView : NSOutlineView wxOSX_10_6_AND_LATER() +@interface wxCocoaOutlineView : NSOutlineView { @private // column and row of the cell being edited or -1 if none diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 83cd34d41e..cc929ae6bf 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -336,7 +336,7 @@ public: - (void) setTextField:(NSTextField*) field; @end - @interface wxNSTextField : NSTextField wxOSX_10_6_AND_LATER() + @interface wxNSTextField : NSTextField { wxNSTextFieldEditor* fieldEditor; } @@ -346,14 +346,14 @@ public: @end - @interface wxNSSecureTextField : NSSecureTextField wxOSX_10_6_AND_LATER() + @interface wxNSSecureTextField : NSSecureTextField { } @end - @interface wxNSTextView : NSTextView wxOSX_10_6_AND_LATER() + @interface wxNSTextView : NSTextView { } @@ -432,7 +432,7 @@ public: #ifdef __LP64__ WXEXPORT #endif // 64 bit builds - @interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER() + @interface wxNSAppController : NSObject { } diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index c52a8e5af2..9b1c371562 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -20,17 +20,6 @@ #include "wx/osx/core/cfstring.h" #include "wx/osx/core/cfdataref.h" -// Define helper macros allowing to insert small snippets of code to be -// compiled for high enough OS X version only: this shouldn't be abused for -// anything big but it's handy for e.g. specifying OS X 10.6-only protocols in -// the Objective C classes declarations when they're not supported under the -// previous versions -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - #define wxOSX_10_6_AND_LATER(x) x -#else - #define wxOSX_10_6_AND_LATER(x) -#endif - // platform specific Clang analyzer support #ifndef NS_RETURNS_RETAINED # if WX_HAS_CLANG_FEATURE(attribute_ns_returns_retained) diff --git a/src/osx/carbon/colordlgosx.mm b/src/osx/carbon/colordlgosx.mm index a818dde360..a22a2cc44b 100644 --- a/src/osx/carbon/colordlgosx.mm +++ b/src/osx/carbon/colordlgosx.mm @@ -41,7 +41,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog); // wxCPWCDelegate - Window Closed delegate // --------------------------------------------------------------------------- -@interface wxCPWCDelegate : NSObject wxOSX_10_6_AND_LATER() +@interface wxCPWCDelegate : NSObject { bool m_bIsClosed; } diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 60c03445e0..489aeaba56 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -494,12 +494,7 @@ CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage ns double wxOSXGetMainScreenContentScaleFactor() { -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) - if ( [ [NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)] ) - return [[NSScreen mainScreen] backingScaleFactor]; - else -#endif - return 1.0; + return [[NSScreen mainScreen] backingScaleFactor]; } CGImageRef wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scaleptr ) diff --git a/src/osx/cocoa/combobox.mm b/src/osx/cocoa/combobox.mm index fbaec3fb74..0a4acd1190 100644 --- a/src/osx/cocoa/combobox.mm +++ b/src/osx/cocoa/combobox.mm @@ -24,7 +24,7 @@ // work in progress -@interface wxNSTableDataSource : NSObject wxOSX_10_6_AND_LATER() +@interface wxNSTableDataSource : NSObject { wxNSComboBoxControl* impl; } diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 9e439b9ab8..540358f757 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -52,7 +52,7 @@ // then the delegate method - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename will have to // be implemented -@interface wxOpenPanelDelegate : NSObject wxOSX_10_6_AND_LATER() +@interface wxOpenPanelDelegate : NSObject { wxFileDialog* _dialog; } diff --git a/src/osx/cocoa/listbox.mm b/src/osx/cocoa/listbox.mm index 0eb49dd569..7966d70223 100644 --- a/src/osx/cocoa/listbox.mm +++ b/src/osx/cocoa/listbox.mm @@ -30,7 +30,7 @@ class wxListWidgetCocoaImpl; -@interface wxNSTableDataSource : NSObject wxOSX_10_6_AND_LATER() +@interface wxNSTableDataSource : NSObject { wxListWidgetCocoaImpl* impl; } @@ -50,7 +50,7 @@ class wxListWidgetCocoaImpl; @end -@interface wxNSTableView : NSTableView wxOSX_10_6_AND_LATER() +@interface wxNSTableView : NSTableView { } diff --git a/src/osx/cocoa/menu.mm b/src/osx/cocoa/menu.mm index 562efe75d4..eb52113acc 100644 --- a/src/osx/cocoa/menu.mm +++ b/src/osx/cocoa/menu.mm @@ -58,7 +58,7 @@ // and under 10.4, we are not getting a 'close' event however... #define wxOSX_USE_NEEDSUPDATE_HOOK 1 -@interface wxNSMenuController : NSObject wxOSX_10_6_AND_LATER() +@interface wxNSMenuController : NSObject { } diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index a13efdabbf..97186983b1 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -91,19 +91,11 @@ bool shouldHandleSelector(SEL selector) } - -#define wxHAS_FULL_SCREEN_API (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) - -#if wxHAS_FULL_SCREEN_API - static bool IsUsingFullScreenApi(WXWindow macWindow) { - return [macWindow respondsToSelector:@selector(toggleFullScreen:)] - && ([macWindow collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary); + return ([macWindow collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary); } -#endif - // // wx category for NSWindow (our own and wrapped instances) // @@ -313,7 +305,7 @@ static NSResponder* s_formerFirstResponder = NULL; // controller // -@interface wxNonOwnedWindowController : NSObject wxOSX_10_6_AND_LATER() +@interface wxNonOwnedWindowController : NSObject { } @@ -326,9 +318,7 @@ static NSResponder* s_formerFirstResponder = NULL; - (void)windowDidDeminiaturize:(NSNotification *)notification; - (BOOL)windowShouldClose:(id)window; - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; -#if wxHAS_FULL_SCREEN_API - (void)windowWillEnterFullScreen:(NSNotification *)notification; -#endif @end @@ -585,8 +575,6 @@ extern int wxOSXGetIdFromSelector(SEL action ); return true; } -#if wxHAS_FULL_SCREEN_API - // work around OS X bug, on a secondary monitor an already fully sized window // (eg maximized) will not be correctly put to full screen size and keeps a 22px // title band at the top free, therefore we force the correct content size @@ -607,8 +595,6 @@ extern int wxOSXGetIdFromSelector(SEL action ); } } -#endif - @end wxIMPLEMENT_DYNAMIC_CLASS(wxNonOwnedWindowCocoaImpl , wxNonOwnedWindowImpl); @@ -1000,44 +986,32 @@ typedef struct bool wxNonOwnedWindowCocoaImpl::IsFullScreen() const { -#if wxHAS_FULL_SCREEN_API if ( IsUsingFullScreenApi(m_macWindow) ) { return [m_macWindow styleMask] & NSFullScreenWindowMask; } -#endif return m_macFullScreenData != NULL ; } bool wxNonOwnedWindowCocoaImpl::EnableFullScreenView(bool enable) { -#if wxHAS_FULL_SCREEN_API - if ( [ m_macWindow respondsToSelector:@selector(setCollectionBehavior:) ] ) + NSUInteger collectionBehavior = [m_macWindow collectionBehavior]; + if (enable) { - NSUInteger collectionBehavior = [m_macWindow collectionBehavior]; - if (enable) - { - collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; - } - else - { - collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; - } - [m_macWindow setCollectionBehavior: collectionBehavior]; - - return true; + collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; } -#else - wxUnusedVar(enable); -#endif + else + { + collectionBehavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; + } + [m_macWindow setCollectionBehavior: collectionBehavior]; - return false; + return true; } bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style)) { -#if wxHAS_FULL_SCREEN_API if ( IsUsingFullScreenApi(m_macWindow) ) { if ( show != IsFullScreen() ) @@ -1047,7 +1021,6 @@ bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long WXUNUSED(style)) return true; } -#endif if ( show ) { diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index 33b773b117..ead8978b54 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -29,7 +29,7 @@ // controller // -@interface wxTabViewController : NSObject wxOSX_10_6_AND_LATER() +@interface wxTabViewController : NSObject { } diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 22fc4e7681..cb12954e4b 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -827,7 +827,7 @@ wxNSTextFieldControl::wxNSTextFieldControl(wxWindow *wxPeer, void wxNSTextFieldControl::Init(WXWidget w) { - NSTextField wxOSX_10_6_AND_LATER() *tf = (NSTextField wxOSX_10_6_AND_LATER()*) w; + NSTextField *tf = (NSTextField *) w; m_textField = tf; [m_textField setDelegate: tf]; m_selStart = m_selEnd = 0; diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 243b0c4d42..e5f918dbad 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -301,7 +301,7 @@ private: @end -@interface wxNSToolbarDelegate : NSObject wxOSX_10_6_AND_LATER() +@interface wxNSToolbarDelegate : NSObject { bool m_isSelectable; } diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index 7faa2bc61b..d3418d9433 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -412,7 +412,7 @@ bool wxApp::DoInitGui() } appcontroller = OSXCreateAppController(); - [[NSApplication sharedApplication] setDelegate:(id wxOSX_10_6_AND_LATER())appcontroller]; + [[NSApplication sharedApplication] setDelegate:(id )appcontroller]; [NSColor setIgnoresAlpha:NO]; // calling finishLaunching so early before running the loop seems to trigger some 'MenuManager compatibility' which leads diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 91e02ed9e5..e2ead70efe 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1755,9 +1755,7 @@ void wxOSXCocoaClassAddWXMethods(Class c) wxOSX_CLASS_ADD_METHOD(c, @selector(mouseEntered:), (IMP) wxOSX_mouseEvent, "v@:@" ) wxOSX_CLASS_ADD_METHOD(c, @selector(mouseExited:), (IMP) wxOSX_mouseEvent, "v@:@" ) -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 wxOSX_CLASS_ADD_METHOD(c, @selector(magnifyWithEvent:), (IMP)wxOSX_mouseEvent, "v@:@") -#endif wxOSX_CLASS_ADD_METHOD(c, @selector(cursorUpdate:), (IMP) wxOSX_cursorUpdate, "v@:@" ) @@ -1870,13 +1868,8 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible ) double wxWidgetCocoaImpl::GetContentScaleFactor() const { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 NSWindow* tlw = [m_osxView window]; - if ( [ tlw respondsToSelector:@selector(backingScaleFactor) ] ) - return [tlw backingScaleFactor]; - else -#endif - return 1.0; + return [tlw backingScaleFactor]; } // ---------------------------------------------------------------------------- @@ -1884,7 +1877,7 @@ double wxWidgetCocoaImpl::GetContentScaleFactor() const // ---------------------------------------------------------------------------- // define a delegate used to refresh the window during animation -@interface wxNSAnimationDelegate : NSObject wxOSX_10_6_AND_LATER() +@interface wxNSAnimationDelegate : NSObject { wxWindow *m_win; bool m_isDone;