mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-02 03:20:06 +00:00
Squashed some deprecation warnings on the latest iOS and macOS versions
This commit is contained in:
parent
946657d5c1
commit
5816958001
5 changed files with 34 additions and 3 deletions
|
|
@ -671,6 +671,7 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
|
|||
|
||||
//==============================================================================
|
||||
#if JUCE_MODULE_AVAILABLE_juce_graphics
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
Image getIcon (int size)
|
||||
{
|
||||
if (interAppAudioConnected)
|
||||
|
|
@ -681,6 +682,7 @@ struct iOSAudioIODevice::Pimpl : public AudioPlayHead,
|
|||
}
|
||||
return Image();
|
||||
}
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
#endif
|
||||
|
||||
void switchApplication()
|
||||
|
|
|
|||
|
|
@ -29,6 +29,17 @@ static bool isUsingOldRotationMethod() noexcept
|
|||
return isPreV8;
|
||||
}
|
||||
|
||||
static UIInterfaceOrientation getWindowOrientation()
|
||||
{
|
||||
UIApplication* sharedApplication = [UIApplication sharedApplication];
|
||||
|
||||
#if (defined (__IPHONE_13_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_13_0)
|
||||
return [[[[sharedApplication windows] firstObject] windowScene] interfaceOrientation];
|
||||
#else
|
||||
return [sharedApplication statusBarOrientation];
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace Orientations
|
||||
{
|
||||
static Desktop::DisplayOrientation convertToJuce (UIInterfaceOrientation orientation)
|
||||
|
|
@ -267,7 +278,7 @@ public:
|
|||
{
|
||||
const Rectangle<int> screen (convertToRectInt ([UIScreen mainScreen].bounds));
|
||||
|
||||
switch ([[UIApplication sharedApplication] statusBarOrientation])
|
||||
switch (getWindowOrientation())
|
||||
{
|
||||
case UIInterfaceOrientationPortrait:
|
||||
return r;
|
||||
|
|
@ -298,7 +309,7 @@ public:
|
|||
{
|
||||
const Rectangle<int> screen (convertToRectInt ([UIScreen mainScreen].bounds));
|
||||
|
||||
switch ([[UIApplication sharedApplication] statusBarOrientation])
|
||||
switch (getWindowOrientation())
|
||||
{
|
||||
case UIInterfaceOrientationPortrait:
|
||||
return r;
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ double Desktop::getDefaultMasterScale()
|
|||
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
|
||||
{
|
||||
UIInterfaceOrientation orientation = SystemStats::isRunningInAppExtensionSandbox() ? UIInterfaceOrientationPortrait
|
||||
: [[UIApplication sharedApplication] statusBarOrientation];
|
||||
: getWindowOrientation();
|
||||
|
||||
return Orientations::convertToJuce (orientation);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
#if (defined (__IPHONE_10_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0)
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
#define JUCE_DEPRECATION_IGNORED 1
|
||||
#endif
|
||||
|
||||
struct CameraDevice::Pimpl
|
||||
{
|
||||
using InternalOpenCameraResultCallback = std::function<void(const String& /*cameraId*/, const String& /*error*/)>;
|
||||
|
|
@ -1324,3 +1329,7 @@ String CameraDevice::getFileExtension()
|
|||
{
|
||||
return ".mov";
|
||||
}
|
||||
|
||||
#if JUCE_DEPRECATION_IGNORED
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
#if ! (defined (MAC_OS_X_VERSION_10_16) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_16)
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
#define JUCE_DEPRECATION_IGNORED 1
|
||||
#endif
|
||||
|
||||
struct CameraDevice::Pimpl
|
||||
{
|
||||
Pimpl (CameraDevice& ownerToUse, const String& deviceNameToUse, int /*index*/,
|
||||
|
|
@ -403,3 +408,7 @@ String CameraDevice::getFileExtension()
|
|||
{
|
||||
return ".mov";
|
||||
}
|
||||
|
||||
#if JUCE_DEPRECATION_IGNORED
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue