diff --git a/modules/juce_audio_devices/native/juce_ios_Audio.cpp b/modules/juce_audio_devices/native/juce_ios_Audio.cpp index ab9bc127ab..8a915cb1af 100644 --- a/modules/juce_audio_devices/native/juce_ios_Audio.cpp +++ b/modules/juce_audio_devices/native/juce_ios_Audio.cpp @@ -698,7 +698,7 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead, &dataSize); if (err == noErr) { - #if (! defined __IPHONE_OS_VERSION_MIN_REQUIRED) || (! defined __IPHONE_10_0) || (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0) + #if (! defined __IPHONE_10_0) || (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0) [[UIApplication sharedApplication] openURL: (NSURL*)hostUrl]; #else [[UIApplication sharedApplication] openURL: (NSURL*)hostUrl options: @{} completionHandler: nil]; diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index aaec61154c..44efb2f0fc 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -68,7 +68,7 @@ private: #endif //============================================================================== -#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 +#if (! defined (MAC_OS_X_VERSION_10_12)) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12) enum { /** Custom AudioUnit property used to indicate MPE support */ diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index 55d1489037..4571b1ed50 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -40,8 +40,8 @@ #ifndef JUCE_SUPPORTS_AUv3 #if __OBJC2__ \ - && ((defined (MAC_OS_X_VERSION_MIN_REQUIRED) && defined (MAC_OS_X_VERSION_10_11) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)) \ - || (defined (__IPHONE_OS_VERSION_MIN_REQUIRED) && defined (__IPHONE_9_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0))) + && ((defined (MAC_OS_X_VERSION_10_11) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)) \ + || (defined (__IPHONE_9_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0))) #define JUCE_SUPPORTS_AUv3 1 #else #define JUCE_SUPPORTS_AUv3 0 diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 5378231dfd..26aef81642 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -41,9 +41,7 @@ //============================================================================== #if JUCE_MAC - #if JUCE_SUPPORT_CARBON \ - && ((JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_AU) \ - || ! (defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)) + #if JUCE_SUPPORT_CARBON && (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_AU) #include #include "../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h" #endif diff --git a/modules/juce_core/native/juce_mac_ClangBugWorkaround.h b/modules/juce_core/native/juce_mac_ClangBugWorkaround.h index 1e286bc972..9b2feba318 100644 --- a/modules/juce_core/native/juce_mac_ClangBugWorkaround.h +++ b/modules/juce_core/native/juce_mac_ClangBugWorkaround.h @@ -35,7 +35,7 @@ // In the 10.14 SDK these methods are defined in the header, which we don't compile // in the live-build engine, so we'll define them here - #if defined (MAC_OS_X_VERSION_10_14) + #if defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 #include namespace std { inline namespace __1 { diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index 55e2a4eeca..1446ca1f82 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -36,15 +36,9 @@ bool File::copyInternal (const File& dest) const NSFileManager* fm = [NSFileManager defaultManager]; return [fm fileExistsAtPath: juceStringToNS (fullPath)] - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 && [fm copyItemAtPath: juceStringToNS (fullPath) toPath: juceStringToNS (dest.getFullPathName()) error: nil]; - #else - && [fm copyPath: juceStringToNS (fullPath) - toPath: juceStringToNS (dest.getFullPathName()) - handler: nil]; - #endif } } @@ -75,7 +69,7 @@ namespace MacFileHelpers static bool isHiddenFile (const String& path) { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 + #if JUCE_MAC JUCE_AUTORELEASEPOOL { NSNumber* hidden = nil; @@ -84,15 +78,8 @@ namespace MacFileHelpers return [createNSURLFromFile (path) getResourceValue: &hidden forKey: NSURLIsHiddenKey error: &err] && [hidden boolValue]; } - #elif JUCE_IOS - return File (path).getFileName().startsWithChar ('.'); #else - FSRef ref; - LSItemInfoRecord info; - - return FSPathMakeRefWithOptions ((const UInt8*) path.toRawUTF8(), kFSPathMakeRefDoNotFollowLeafSymlink, &ref, 0) == noErr - && LSCopyItemInfoForRef (&ref, kLSRequestBasicFlagsOnly, &info) == noErr - && (info.flags & kLSItemInfoIsInvisible) != 0; + return File (path).getFileName().startsWithChar ('.'); #endif } diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index ebba5b88d5..adb6f97e2c 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -110,7 +110,7 @@ bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailA //============================================================================== // Unfortunately, we need to have this ugly ifdef here as long as some older OS X versions do not support NSURLSession -#if JUCE_IOS || (defined (__MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__MAC_10_10) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10) +#if JUCE_IOS || (defined (MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10) //============================================================================== class URLConnectionState : private Thread @@ -971,7 +971,7 @@ public: if (! connection->start (owner, webInputListener)) { // Workaround for deployment targets below 10.10 where HTTPS POST requests with keep-alive fail with the NSURLErrorNetworkConnectionLost error code. - #if ! (JUCE_IOS || (defined (__MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__MAC_10_10) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10)) + #if ! (JUCE_IOS || (defined (MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)) if (numRetries == 0 && connection->nsUrlErrorCode == NSURLErrorNetworkConnectionLost) { connection.reset(); diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 7b5f9c0cf6..f3a83b8480 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -271,7 +271,7 @@ namespace return statfs (f.getFullPathName().toUTF8(), &result) == 0; } - #if (JUCE_MAC && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5) || JUCE_IOS + #if JUCE_MAC || JUCE_IOS static int64 getCreationTime (const juce_statStruct& s) noexcept { return (int64) s.st_birthtime; } #else static int64 getCreationTime (const juce_statStruct& s) noexcept { return (int64) s.st_ctime; } @@ -402,7 +402,7 @@ void File::getFileTimesInternal (int64& modificationTime, int64& accessTime, int { modificationTime = (int64) info.st_mtime * 1000; accessTime = (int64) info.st_atime * 1000; - #if (JUCE_MAC && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5) || JUCE_IOS + #if JUCE_MAC || JUCE_IOS creationTime = (int64) info.st_birthtime * 1000; #else creationTime = (int64) info.st_ctime * 1000; diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 1d4fb0c71c..1bcc6dcc1e 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -141,12 +141,12 @@ #define JUCE_INTEL 1 #endif - #if JUCE_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - #error "Building for OSX 10.4 is no longer supported!" - #endif - - #if JUCE_MAC && ! defined (MAC_OS_X_VERSION_10_6) - #error "To build with 10.5 compatibility, use a later SDK and set the deployment target to 10.5" + #if JUCE_MAC + #if ! defined (MAC_OS_X_VERSION_10_11) + #error "The 10.11 SDK (Xcode 7.3.1+) is required to build JUCE apps. You can create apps that run on macOS 10.7+ by changing the deployment target." + #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 + #error "Building for OSX 10.6 is no longer supported!" + #endif #endif #endif diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 926a69f5da..4869c13b5b 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -39,7 +39,7 @@ public: auto numComponents = (size_t) lineStride * (size_t) jmax (1, height); - # if JUCE_MAC && defined (__MAC_10_14) + # if JUCE_MAC && defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 // This version of the SDK intermittently requires a bit of extra space // at the end of the image data. This feels like something has gone // wrong in Apple's code. diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 04de57cde1..723b3e5938 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -37,13 +37,10 @@ static NSMutableArray* createAllowedTypesArray (const StringArray& filters) for (int i = 0; i < filters.size(); ++i) { - #if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) // From OS X 10.6 you can only specify allowed extensions, so any filters containing wildcards // must be of the form "*.extension" jassert (filters[i] == "*" || (filters[i].startsWith ("*.") && filters[i].lastIndexOfChar ('*') == 0)); - #endif - const String f (filters[i].replace ("*.", "")); if (f == "*") @@ -122,10 +119,8 @@ public: filename = owner.startingFile.getFileName(); } - #if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) [panel setDirectoryURL: createNSURLFromFile (startingDirectory)]; [panel setNameFieldStringValue: juceStringToNS (filename)]; - #endif } ~Native() override @@ -178,13 +173,7 @@ public: tempMenu.reset (new TemporaryMainMenuWithStandardCommands()); jassert (panel != nil); - #if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) auto result = [panel runModal]; - #else - auto result = [panel runModalForDirectory: juceStringToNS (startingDirectory) - file: juceStringToNS (filename)]; - #endif - finished (result); } @@ -198,11 +187,7 @@ public: private: //============================================================================== - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 typedef NSObject DelegateType; - #else - typedef NSObject DelegateType; - #endif void finished (NSInteger result) { @@ -254,22 +239,6 @@ private: if (f.getFileName().matchesWildcard (filters[i], true)) return true; - #if (! defined (MAC_OS_X_VERSION_10_7)) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 - NSError* error; - NSString* name = [[NSWorkspace sharedWorkspace] typeOfFile: nsFilename error: &error]; - - if ([name isEqualToString: nsStringLiteral ("com.apple.alias-file")]) - { - FSRef ref; - FSPathMakeRef ((const UInt8*) [nsFilename fileSystemRepresentation], &ref, nullptr); - - Boolean targetIsFolder = false, wasAliased = false; - FSResolveAliasFileWithMountFlags (&ref, true, &targetIsFolder, &wasAliased, 0); - - return wasAliased && targetIsFolder; - } - #endif - return f.isDirectory() && ! [[NSWorkspace sharedWorkspace] isFilePackageAtPath: nsFilename]; } @@ -322,9 +291,7 @@ private: addMethod (@selector (panel:shouldShowFilename:), shouldShowFilename, "c@:@@"); addMethod (@selector (panelSelectionDidChange:), panelSelectionDidChange, "c@"); - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 addProtocol (@protocol (NSOpenSavePanelDelegate)); - #endif registerClass(); } diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index c6c8b69339..34e1a05d8a 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -327,13 +327,7 @@ public: [m setAutoenablesItems: false]; if (addDelegate) - { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [m setDelegate: (id) callback]; - #else - [m setDelegate: callback]; - #endif - } for (PopupMenu::MenuItemIterator iter (menu); iter.next();) addMenuItem (iter, m, topLevelMenuId, topLevelIndex); @@ -515,9 +509,7 @@ private: addMethod (@selector (menuItemInvoked:), menuItemInvoked, "v@:@"); addMethod (@selector (menuNeedsUpdate:), menuNeedsUpdate, "v@:@"); - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 addProtocol (@protocol (NSMenuDelegate)); - #endif registerClass(); } diff --git a/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm b/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm index 26a5c9bba0..1f295c604c 100644 --- a/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm +++ b/modules/juce_gui_basics/native/juce_mac_MouseCursor.mm @@ -113,12 +113,7 @@ void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType ty case CopyingCursor: { - #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 - if (void* m = MouseCursorHelpers::fromHIServices ("copy")) - return m; - #endif - - c = [NSCursor dragCopyCursor]; // added in 10.6 + c = [NSCursor dragCopyCursor]; break; } diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index f6615dc408..ba933a4f7d 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -32,18 +32,6 @@ namespace juce extern CheckEventBlockedByModalComps isEventBlockedByModalComps; } -//============================================================================== -#if ! (defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) - -@interface NSEvent (JuceDeviceDelta) - - (CGFloat) scrollingDeltaX; - - (CGFloat) scrollingDeltaY; - - (BOOL) hasPreciseScrollingDeltas; - - (BOOL) isDirectionInvertedFromDevice; -@end - -#endif - namespace juce { @@ -114,15 +102,11 @@ public: defer: YES]; setOwner (window, this); [window orderOut: nil]; - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [window setDelegate: (id) window]; - #else - [window setDelegate: window]; - #endif [window setOpaque: component.isOpaque()]; - #if defined (MAC_OS_X_VERSION_10_14) + #if defined (MAC_OS_X_VERSION_10_14) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14) if (! [window isOpaque]) [window setBackgroundColor: [NSColor clearColor]]; @@ -148,13 +132,11 @@ public: [window setExcludedFromWindowsMenu: (windowStyleFlags & windowIsTemporary) != 0]; [window setIgnoresMouseEvents: (windowStyleFlags & windowIgnoresMouseClicks) != 0]; - #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) if ((windowStyleFlags & (windowHasMaximiseButton | windowHasTitleBar)) == (windowHasMaximiseButton | windowHasTitleBar)) [window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary]; if ([window respondsToSelector: @selector (setRestorable:)]) [window setRestorable: NO]; - #endif #if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13) if ([window respondsToSelector: @selector (setTabbingMode:)]) @@ -191,10 +173,8 @@ public: getNativeRealtimeModifiers = [] { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 if ([NSEvent respondsToSelector: @selector (modifierFlags)]) NSViewComponentPeer::updateModifiers ([NSEvent modifierFlags]); - #endif return ModifierKeys::currentModifiers; }; @@ -315,12 +295,7 @@ public: if (global && viewWindow != nil) { r = [[view superview] convertRect: r toView: nil]; - - #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 r = [viewWindow convertRectToScreen: r]; - #else - r.origin = [viewWindow convertBaseToScreen: r.origin]; - #endif flipScreenRect (r); } @@ -412,10 +387,8 @@ public: static bool isWindowAtPoint (NSWindow* w, NSPoint screenPoint) { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 if ([NSWindow respondsToSelector: @selector (windowNumberAtPoint:belowWindowWithWindowNumber:)]) return [NSWindow windowNumberAtPoint: screenPoint belowWindowWithWindowNumber: 0] == [w windowNumber]; - #endif return true; } @@ -472,9 +445,7 @@ public: { if (hasNativeTitleBar()) { - #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 isWindowInKioskMode = (([window styleMask] & NSWindowStyleMaskFullScreen) != 0); - #endif auto screen = getFrameSize().subtractedFrom (component.getParentMonitorArea()); @@ -621,12 +592,7 @@ public: ModifierKeys::currentModifiers = ModifierKeys::currentModifiers.withoutMouseButtons(); NSPoint windowPos = [ev locationInWindow]; - - #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 NSPoint screenPos = [[ev window] convertRectToScreen: NSMakeRect (windowPos.x, windowPos.y, 1.0f, 1.0f)].origin; - #else - NSPoint screenPos = [[ev window] convertBaseToScreen: windowPos]; - #endif if (isWindowAtPoint ([ev window], screenPos)) sendMouseEvent (ev); @@ -671,7 +637,6 @@ public: @try { - #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if ([ev respondsToSelector: @selector (isDirectionInvertedFromDevice)]) wheel.isReversed = [ev isDirectionInvertedFromDevice]; @@ -687,9 +652,7 @@ public: wheel.isSmooth = true; } } - else - #endif - if ([ev respondsToSelector: @selector (deviceDeltaX)]) + else if ([ev respondsToSelector: @selector (deviceDeltaX)]) { wheel.deltaX = checkDeviceDeltaReturnValue ((float) getMsgSendFPRetFn() (ev, @selector (deviceDeltaX))); wheel.deltaY = checkDeviceDeltaReturnValue ((float) getMsgSendFPRetFn() (ev, @selector (deviceDeltaY))); @@ -710,13 +673,10 @@ public: void redirectMagnify (NSEvent* ev) { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 const float invScale = 1.0f - (float) [ev magnification]; if (invScale > 0.0f) handleMagnifyGesture (MouseInputSource::InputSourceType::mouse, getMousePos (ev, view), getMouseTime (ev), 1.0f / invScale); - #endif - ignoreUnused (ev); } void redirectCopy (NSObject*) { handleKeyPress (KeyPress ('c', ModifierKeys (ModifierKeys::commandModifier), 'c')); } @@ -850,12 +810,10 @@ public: CGContextClearRect (cg, CGContextGetClipBoundingBox (cg)); float displayScale = 1.0f; - - #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) NSScreen* screen = [[view window] screen]; + if ([screen respondsToSelector: @selector (backingScaleFactor)]) displayScale = (float) screen.backingScaleFactor; - #endif #if USE_COREGRAPHICS_RENDERING && JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS // This option invokes a separate paint call for each rectangle of the clip region. @@ -1102,12 +1060,7 @@ public: auto screenBounds = Desktop::getInstance().getDisplays().getTotalBounds (true); - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 const bool inLiveResize = [window inLiveResize]; - #else - const bool inLiveResize = [window respondsToSelector: @selector (inLiveResize)] - && [window performSelector: @selector (inLiveResize)]; - #endif if (! inLiveResize || isFirstLiveResize) { @@ -1967,9 +1920,7 @@ struct JuceNSWindowClass : public ObjCClass addMethod (@selector (window:shouldDragDocumentWithEvent:from:withPasteboard:), shouldAllowIconDrag, "B@:@", @encode (NSEvent*), @encode (NSPoint), @encode (NSPasteboard*)); - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 addProtocol (@protocol (NSWindowDelegate)); - #endif registerClass(); } @@ -2042,9 +1993,7 @@ private: static void windowDidExitFullScreen (id, SEL, NSNotification*) { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [NSApp setPresentationOptions: NSApplicationPresentationDefault]; - #endif } static void zoom (id self, SEL, id sender) @@ -2150,12 +2099,9 @@ bool MouseInputSource::SourceList::canUseTouch() //============================================================================== void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, bool allowMenusAndBars) { - #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 - auto* peer = dynamic_cast (kioskComp->getPeer()); jassert (peer != nullptr); // (this should have been checked by the caller) - #if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (peer->hasNativeTitleBar() && [peer->window respondsToSelector: @selector (toggleFullScreen:)]) { @@ -2167,7 +2113,6 @@ void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, boo [peer->window performSelector: @selector (toggleFullScreen:) withObject: nil]; } else - #endif { if (shouldBeEnabled) { @@ -2190,23 +2135,6 @@ void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, boo [NSApp setPresentationOptions: NSApplicationPresentationDefault]; } } - #elif JUCE_SUPPORT_CARBON - if (shouldBeEnabled) - { - SetSystemUIMode (kUIModeAllSuppressed, allowMenusAndBars ? kUIOptionAutoShowMenuBar : 0); - kioskComp->setBounds (Desktop::getInstance().getDisplays().getMainDisplay().totalArea); - } - else - { - SetSystemUIMode (kUIModeNormal, 0); - } - #else - ignoreUnused (kioskComp, shouldBeEnabled, allowMenusAndBars); - - // If you're targeting OSes earlier than 10.6 and want to use this feature, - // you'll need to enable JUCE_SUPPORT_CARBON. - jassertfalse; - #endif } void Desktop::allowedOrientationsChanged() {} diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index c9360d3c17..4137b841e8 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -377,18 +377,9 @@ Desktop::DisplayOrientation Desktop::getCurrentOrientation() const } //============================================================================== -#if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) - #define JUCE_USE_IOPM_SCREENSAVER_DEFEAT 1 -#endif - -#if ! (defined (JUCE_USE_IOPM_SCREENSAVER_DEFEAT) || defined (__POWER__)) - extern "C" { extern OSErr UpdateSystemActivity (UInt8); } // Some versions of the SDK omit this function.. -#endif - class ScreenSaverDefeater : public Timer { public: - #if JUCE_USE_IOPM_SCREENSAVER_DEFEAT ScreenSaverDefeater() { startTimer (5000); @@ -429,19 +420,6 @@ public: }; std::unique_ptr assertion; - #else - ScreenSaverDefeater() - { - startTimer (10000); - timerCallback(); - } - - void timerCallback() override - { - if (Process::isForegroundProcess()) - UpdateSystemActivity (1 /*UsrActivity*/); - } - #endif }; static std::unique_ptr screenSaverDefeater; @@ -504,10 +482,8 @@ static Displays::Display getDisplayFromScreen (NSScreen* s, CGFloat& mainScreenB d.totalArea = convertDisplayRect ([s frame], mainScreenBottom) / masterScale; d.scale = masterScale; - #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) if ([s respondsToSelector: @selector (backingScaleFactor)]) d.scale *= s.backingScaleFactor; - #endif NSSize dpi = [[[s deviceDescription] objectForKey: NSDeviceResolution] sizeValue]; d.dpi = (dpi.width + dpi.height) / 2.0; diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index 4f45d008d6..97dd6f13db 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -283,7 +283,7 @@ public: { NSString* urlString = juceStringToNS (url); - #if (JUCE_MAC && (defined (__MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__MAC_10_9) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9)) || (JUCE_IOS && (defined (__IPHONE_OS_VERSION_MIN_REQUIRED) && defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0)) + #if (JUCE_MAC && (defined (MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9)) || (JUCE_IOS && (defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0)) urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; #else urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; diff --git a/modules/juce_opengl/juce_opengl.h b/modules/juce_opengl/juce_opengl.h index 5011eb8111..c94561dcf7 100644 --- a/modules/juce_opengl/juce_opengl.h +++ b/modules/juce_opengl/juce_opengl.h @@ -98,14 +98,9 @@ #include #endif #elif JUCE_MAC - #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) #define JUCE_OPENGL3 1 #include #include - #else - #include - #include - #endif #elif JUCE_ANDROID #include #include diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index ea209d8293..f73461f196 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -45,10 +45,8 @@ public: view = [cls.createInstance() initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) pixelFormat: format]; - #if defined (MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) if ([view respondsToSelector: @selector (setWantsBestResolutionOpenGLSurface:)]) [view setWantsBestResolutionOpenGLSurface: YES]; - #endif [[NSNotificationCenter defaultCenter] addObserver: view selector: @selector (_surfaceNeedsUpdate:)