Browse Source

Squashed some deprecation warnings on the latest iOS and macOS versions

tags/2021-05-28
ed 5 years ago
parent
commit
5816958001
5 changed files with 34 additions and 3 deletions
  1. +2
    -0
      modules/juce_audio_devices/native/juce_ios_Audio.cpp
  2. +13
    -2
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  3. +1
    -1
      modules/juce_gui_basics/native/juce_ios_Windowing.mm
  4. +9
    -0
      modules/juce_video/native/juce_ios_CameraDevice.h
  5. +9
    -0
      modules/juce_video/native/juce_mac_CameraDevice.h

+ 2
- 0
modules/juce_audio_devices/native/juce_ios_Audio.cpp View File

@@ -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()


+ 13
- 2
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -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;


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_Windowing.mm View File

@@ -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);
}


+ 9
- 0
modules/juce_video/native/juce_ios_CameraDevice.h View File

@@ -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

+ 9
- 0
modules/juce_video/native/juce_mac_CameraDevice.h View File

@@ -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…
Cancel
Save