1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Platform: Remove compatibility checks for macOS 10.11

This commit is contained in:
reuk 2024-07-01 17:27:37 +01:00
parent 8ac7bfc9ca
commit e71ebb3407
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
6 changed files with 30 additions and 79 deletions

View file

@ -499,10 +499,7 @@ namespace AudioUnitFormatHelpers
static bool isPluginAUv3 (const AudioComponentDescription& desc) static bool isPluginAUv3 (const AudioComponentDescription& desc)
{ {
if (@available (macOS 10.11, *)) return (desc.componentFlags & kAudioComponentFlag_IsV3AudioUnit) != 0;
return (desc.componentFlags & kAudioComponentFlag_IsV3AudioUnit) != 0;
return false;
} }
} }
@ -580,17 +577,14 @@ static void createAudioUnit (VersionedAudioComponent versionedComponent, AudioUn
{ {
if (versionedComponent.isAUv3) if (versionedComponent.isAUv3)
{ {
if (@available (macOS 10.11, *)) AudioComponentInstantiate (versionedComponent.audioComponent,
{ kAudioComponentInstantiation_LoadOutOfProcess,
AudioComponentInstantiate (versionedComponent.audioComponent, ^(AudioComponentInstance audioUnit, OSStatus err)
kAudioComponentInstantiation_LoadOutOfProcess, {
^(AudioComponentInstance audioUnit, OSStatus err) callback (audioUnit, err);
{ });
callback (audioUnit, err);
});
return; return;
}
} }
AudioComponentInstance audioUnit; AudioComponentInstance audioUnit;
@ -2771,8 +2765,7 @@ private:
{ {
auto size = CGSizeZero; auto size = CGSizeZero;
if (@available (macOS 10.11, *)) size = [controller preferredContentSize];
size = [controller preferredContentSize];
if (approximatelyEqual (size.width, 0.0) || approximatelyEqual (size.height, 0.0)) if (approximatelyEqual (size.width, 0.0) || approximatelyEqual (size.height, 0.0))
size = controller.view.frame.size; size = controller.view.frame.size;

View file

@ -36,7 +36,7 @@ namespace juce
{ {
//============================================================================== //==============================================================================
class API_AVAILABLE (macos (10.11)) BluetoothMidiPairingWindowClass final : public ObjCClass<NSObject> class BluetoothMidiPairingWindowClass final : public ObjCClass<NSObject>
{ {
public: public:
struct Callbacks struct Callbacks
@ -126,7 +126,7 @@ private:
} }
}; };
class API_AVAILABLE (macos (10.11)) BluetoothMidiSelectorWindowHelper final : public DeletedAtShutdown class BluetoothMidiSelectorWindowHelper final : public DeletedAtShutdown
{ {
public: public:
BluetoothMidiSelectorWindowHelper (ModalComponentManager::Callback* exitCallback, BluetoothMidiSelectorWindowHelper (ModalComponentManager::Callback* exitCallback,
@ -166,26 +166,13 @@ private:
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback, bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>* bounds) Rectangle<int>* bounds)
{ {
if (@available (macOS 10.11, *)) new BluetoothMidiSelectorWindowHelper (exitCallback, bounds);
{ return true;
new BluetoothMidiSelectorWindowHelper (exitCallback, bounds);
return true;
}
std::unique_ptr<ModalComponentManager::Callback> cb (exitCallback);
// This functionality is unavailable when targetting OSX < 10.11. Instead,
// you should pair Bluetooth MIDI devices using the "Audio MIDI Setup" app
// (located in /Applications/Utilities).
jassertfalse;
return false;
} }
bool BluetoothMidiDevicePairingDialogue::isAvailable() bool BluetoothMidiDevicePairingDialogue::isAvailable()
{ {
if (@available (macOS 10.11, *)) return true;
return true;
return false;
} }
} // namespace juce } // namespace juce

View file

@ -129,13 +129,10 @@ public:
preview->addToDesktop (0, (void*) nsViewPreview); preview->addToDesktop (0, (void*) nsViewPreview);
preview->setVisible (true); preview->setVisible (true);
if (@available (macOS 10.11, *)) if (! isSave)
{ {
if (! isSave) auto* openPanel = static_cast<NSOpenPanel*> (panel);
{ [openPanel setAccessoryViewDisclosed: YES];
auto* openPanel = static_cast<NSOpenPanel*> (panel);
[openPanel setAccessoryViewDisclosed: YES];
}
} }
} }

View file

@ -371,18 +371,8 @@ private:
{ {
NSArray* array = nil; NSArray* array = nil;
if (@available (macOS 10.11, *)) [menuNib instantiateWithOwner: NSApp
{ topLevelObjects: &array];
[menuNib instantiateWithOwner: NSApp
topLevelObjects: &array];
}
else
{
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
[menuNib instantiateNibWithOwner: NSApp
topLevelObjects: &array];
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}
for (id object in array) for (id object in array)
{ {

View file

@ -398,13 +398,8 @@ public:
} }
else else
{ {
// Repaint behaviour of setFrame seemed to change in 10.11, and the drawing became synchronous,
// causing performance issues. But sending an async update causes flickering in older versions,
// hence this version check to use the old behaviour on pre 10.11 machines
static bool isPre10_11 = SystemStats::getOperatingSystemType() <= SystemStats::MacOSX_10_10;
[window setFrame: [window frameRectForContentRect: flippedScreenRect (r)] [window setFrame: [window frameRectForContentRect: flippedScreenRect (r)]
display: isPre10_11]; display: false];
} }
if (! CGSizeEqualToSize (oldViewSize, r.size)) if (! CGSizeEqualToSize (oldViewSize, r.size))
@ -1962,13 +1957,9 @@ private:
void setFullScreenSizeConstraints (const ComponentBoundsConstrainer& c) void setFullScreenSizeConstraints (const ComponentBoundsConstrainer& c)
{ {
if (@available (macOS 10.11, *)) const auto minSize = NSMakeSize (static_cast<float> (c.getMinimumWidth()), 0.0f);
{ [window setMinFullScreenContentSize: minSize];
const auto minSize = NSMakeSize (static_cast<float> (c.getMinimumWidth()), [window setMaxFullScreenContentSize: NSMakeSize (100000, 100000)];
0.0f);
[window setMinFullScreenContentSize: minSize];
[window setMaxFullScreenContentSize: NSMakeSize (100000, 100000)];
}
} }
void displayLayer ([[maybe_unused]] CALayer* layer) override void displayLayer ([[maybe_unused]] CALayer* layer) override

View file

@ -786,12 +786,12 @@ private:
JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#endif #endif
class API_AVAILABLE (macos (10.11)) WebBrowserComponent::Impl::Platform::WKWebViewImpl : public WebBrowserComponent::Impl::PlatformInterface, class WebBrowserComponent::Impl::Platform::WKWebViewImpl : public WebBrowserComponent::Impl::PlatformInterface,
#if JUCE_MAC #if JUCE_MAC
public NSViewComponent public NSViewComponent
#else #else
public UIViewComponent public UIViewComponent
#endif #endif
{ {
public: public:
WKWebViewImpl (WebBrowserComponent::Impl& implIn, WKWebViewImpl (WebBrowserComponent::Impl& implIn,
@ -1085,14 +1085,7 @@ auto WebBrowserComponent::Impl::createAndInitPlatformDependentPart (WebBrowserCo
const StringArray& userScripts) const StringArray& userScripts)
-> std::unique_ptr<PlatformInterface> -> std::unique_ptr<PlatformInterface>
{ {
if (@available (macOS 10.11, *)) return std::make_unique<Platform::WKWebViewImpl> (impl, options, userScripts);
return std::make_unique<Platform::WKWebViewImpl> (impl, options, userScripts);
#if JUCE_MAC
return std::make_unique<Platform::WebViewImpl> (impl, options.getUserAgent());
#endif
return {};
} }
//============================================================================== //==============================================================================