mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-06 04:00:08 +00:00
macOS: Remove macOS 10.12 preprocessor checks
The current minimum-supported Xcode (10.1) includes the macOS 10.14.1 SDK, so APIs from macOS 10.12 will always be available.
This commit is contained in:
parent
76e95d01ed
commit
9712775e5b
7 changed files with 4 additions and 83 deletions
|
|
@ -693,7 +693,6 @@ public:
|
|||
return noErr;
|
||||
}
|
||||
|
||||
#if defined (MAC_OS_X_VERSION_10_12)
|
||||
case kAudioUnitProperty_AUHostIdentifier:
|
||||
{
|
||||
if (inDataSize < sizeof (AUHostVersionIdentifier))
|
||||
|
|
@ -704,7 +703,6 @@ public:
|
|||
|
||||
return noErr;
|
||||
}
|
||||
#endif
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,13 +67,4 @@ private:
|
|||
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#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 */
|
||||
kAudioUnitProperty_SupportsMPE = 58
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,52 +46,6 @@
|
|||
#endif
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#if (! defined MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
#define NSEventModifierFlagCommand NSCommandKeyMask
|
||||
#define NSEventModifierFlagControl NSControlKeyMask
|
||||
#define NSEventModifierFlagHelp NSHelpKeyMask
|
||||
#define NSEventModifierFlagNumericPad NSNumericPadKeyMask
|
||||
#define NSEventModifierFlagOption NSAlternateKeyMask
|
||||
#define NSEventModifierFlagShift NSShiftKeyMask
|
||||
#define NSCompositingOperationSourceOver NSCompositeSourceOver
|
||||
#define NSEventMaskApplicationDefined NSApplicationDefinedMask
|
||||
#define NSEventTypeApplicationDefined NSApplicationDefined
|
||||
#define NSEventTypeCursorUpdate NSCursorUpdate
|
||||
#define NSEventTypeMouseMoved NSMouseMoved
|
||||
#define NSEventTypeLeftMouseDown NSLeftMouseDown
|
||||
#define NSEventTypeRightMouseDown NSRightMouseDown
|
||||
#define NSEventTypeOtherMouseDown NSOtherMouseDown
|
||||
#define NSEventTypeLeftMouseUp NSLeftMouseUp
|
||||
#define NSEventTypeRightMouseUp NSRightMouseUp
|
||||
#define NSEventTypeOtherMouseUp NSOtherMouseUp
|
||||
#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
|
||||
#define NSEventTypeRightMouseDragged NSRightMouseDragged
|
||||
#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
|
||||
#define NSEventTypeScrollWheel NSScrollWheel
|
||||
#define NSEventTypeKeyDown NSKeyDown
|
||||
#define NSEventTypeKeyUp NSKeyUp
|
||||
#define NSEventTypeFlagsChanged NSFlagsChanged
|
||||
#define NSEventMaskAny NSAnyEventMask
|
||||
#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
|
||||
#define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||
#define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
|
||||
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||
#define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||
#define NSAlertStyleCritical NSCriticalAlertStyle
|
||||
#define NSControlSizeRegular NSRegularControlSize
|
||||
#define NSEventTypeMouseEntered NSMouseEntered
|
||||
#define NSEventTypeMouseExited NSMouseExited
|
||||
#define NSAlertStyleInformational NSInformationalAlertStyle
|
||||
#define NSEventTypeTabletPoint NSTabletPoint
|
||||
#define NSEventTypeTabletProximity NSTabletProximity
|
||||
#define NSEventTypeFlagsChanged NSFlagsChanged
|
||||
#define NSEventTypeAppKitDefined NSAppKitDefined
|
||||
#define NSEventTypeSystemDefined NSSystemDefined
|
||||
#define NSEventTypeApplicationDefined NSApplicationDefined
|
||||
#define NSEventTypePeriodic NSPeriodic
|
||||
#define NSEventTypeSmartMagnify NSEventTypeSmartMagnify
|
||||
#endif
|
||||
#import <CoreAudio/HostTime.h>
|
||||
#include <sys/dir.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -215,10 +215,8 @@ public:
|
|||
|
||||
[window setRestorable: NO];
|
||||
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12)
|
||||
if (@available (macOS 10.12, *))
|
||||
[window setTabbingMode: NSWindowTabbingModeDisallowed];
|
||||
#endif
|
||||
|
||||
scopedObservers.emplace_back (view, frameChangedSelector, NSWindowDidMoveNotification, window);
|
||||
scopedObservers.emplace_back (view, frameChangedSelector, NSWindowDidMiniaturizeNotification, window);
|
||||
|
|
@ -1731,15 +1729,11 @@ private:
|
|||
#if JUCE_64BIT
|
||||
case NSEventTypeSmartMagnify:
|
||||
case NSEventTypePressure:
|
||||
#endif
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
#if JUCE_64BIT
|
||||
case NSEventTypeDirectTouch:
|
||||
#endif
|
||||
#if defined (MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15
|
||||
case NSEventTypeChangeMode:
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1995,13 +1989,11 @@ struct JuceNSViewClass : public NSViewComponentPeerWrapper<ObjCClass<NSView>>
|
|||
{
|
||||
// Without setting contentsFormat macOS Big Sur will always set the invalid area
|
||||
// to be the entire frame.
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
if (@available (macOS 10.12, *))
|
||||
{
|
||||
CALayer* layer = ((NSView*) self).layer;
|
||||
layer.contentsFormat = kCAContentsFormatRGBA8Uint;
|
||||
}
|
||||
#endif
|
||||
|
||||
sendSuperclassMessage<void> (self, @selector (viewWillDraw));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -105,11 +105,7 @@ struct API_AVAILABLE (macos (10.10)) ButtonBasedStatusItem : public StatusItemCo
|
|||
button.image = statusIcon.get();
|
||||
button.target = eventForwarder.get();
|
||||
button.action = @selector (handleEvent:);
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
[button sendActionOn: NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown | NSEventMaskScrollWheel];
|
||||
#else
|
||||
[button sendActionOn: NSLeftMouseDownMask | NSRightMouseDownMask | NSScrollWheelMask];
|
||||
#endif
|
||||
}
|
||||
|
||||
~ButtonBasedStatusItem() override
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@
|
|||
namespace juce
|
||||
{
|
||||
|
||||
#if JUCE_MAC && defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
#define WKWEBVIEW_OPENPANEL_SUPPORTED 1
|
||||
#endif
|
||||
|
||||
static NSURL* appendParametersToFileURL (const URL& url, NSURL* fileUrl)
|
||||
{
|
||||
if (@available (macOS 10.10, *))
|
||||
|
|
@ -128,10 +124,8 @@ private:
|
|||
{
|
||||
const auto modifierFlags = [event modifierFlags];
|
||||
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
if (@available (macOS 10.12, *))
|
||||
return (modifierFlags & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagCommand;
|
||||
#endif
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
return (modifierFlags & NSDeviceIndependentModifierFlagsMask) == NSCommandKeyMask;
|
||||
|
|
@ -277,10 +271,10 @@ struct API_AVAILABLE (macos (10.10)) WebViewDelegateClass : public ObjCClass<NS
|
|||
addMethod (@selector (webView:createWebViewWithConfiguration:forNavigationAction:
|
||||
windowFeatures:), createWebView);
|
||||
|
||||
#if WKWEBVIEW_OPENPANEL_SUPPORTED
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector")
|
||||
if (@available (macOS 10.12, *))
|
||||
addMethod (@selector (webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:), runOpenPanel);
|
||||
#endif
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
|
||||
registerClass();
|
||||
}
|
||||
|
|
@ -338,7 +332,6 @@ private:
|
|||
return nil;
|
||||
}
|
||||
|
||||
#if WKWEBVIEW_OPENPANEL_SUPPORTED
|
||||
API_AVAILABLE (macos (10.12))
|
||||
static void runOpenPanel (id, SEL, WKWebView*, WKOpenPanelParameters* parameters, WKFrameInfo*,
|
||||
void (^completionHandler)(NSArray<NSURL*>*))
|
||||
|
|
@ -402,7 +395,6 @@ private:
|
|||
delete wrapper;
|
||||
});
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -246,10 +246,8 @@ public:
|
|||
|
||||
static NSOpenGLContextParameter getSwapIntervalParameter()
|
||||
{
|
||||
#if defined (MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
|
||||
if (@available (macOS 10.12, *))
|
||||
return NSOpenGLContextParameterSwapInterval;
|
||||
#endif
|
||||
if (@available (macOS 10.12, *))
|
||||
return NSOpenGLContextParameterSwapInterval;
|
||||
|
||||
return NSOpenGLCPSwapInterval;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue