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

Platform: Remove build-time Apple SDK availability checks

This commit is contained in:
reuk 2024-07-01 22:21:33 +01:00
parent 5c1b75cab7
commit b89553ae2c
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
10 changed files with 12 additions and 119 deletions

View file

@ -90,16 +90,12 @@ struct CoreAudioLayouts
List { kAudioChannelLayoutTag_Hexagonal, { left, right, leftSurroundRear, rightSurroundRear, centre, centreSurround } }, List { kAudioChannelLayoutTag_Hexagonal, { left, right, leftSurroundRear, rightSurroundRear, centre, centreSurround } },
List { kAudioChannelLayoutTag_Octagonal, { left, right, leftSurround, rightSurround, centre, centreSurround, wideLeft, wideRight } }, List { kAudioChannelLayoutTag_Octagonal, { left, right, leftSurround, rightSurround, centre, centreSurround, wideLeft, wideRight } },
#if defined (MAC_OS_VERSION_11_0)
List { kAudioChannelLayoutTag_Atmos_5_1_4, { left, right, centre, LFE, leftSurround, rightSurround, topFrontLeft, topFrontRight, topRearLeft, topRearRight } }, List { kAudioChannelLayoutTag_Atmos_5_1_4, { left, right, centre, LFE, leftSurround, rightSurround, topFrontLeft, topFrontRight, topRearLeft, topRearRight } },
List { kAudioChannelLayoutTag_Atmos_7_1_2, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, topSideLeft, topSideRight } }, List { kAudioChannelLayoutTag_Atmos_7_1_2, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, topSideLeft, topSideRight } },
#endif
#if defined (MAC_OS_X_VERSION_10_15)
List { kAudioChannelLayoutTag_Atmos_5_1_2, { left, right, centre, LFE, leftSurround, rightSurround, topSideLeft, topSideRight } }, List { kAudioChannelLayoutTag_Atmos_5_1_2, { left, right, centre, LFE, leftSurround, rightSurround, topSideLeft, topSideRight } },
List { kAudioChannelLayoutTag_Atmos_7_1_4, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, topFrontLeft, topFrontRight, topRearLeft, topRearRight } }, List { kAudioChannelLayoutTag_Atmos_7_1_4, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, topFrontLeft, topFrontRight, topRearLeft, topRearRight } },
List { kAudioChannelLayoutTag_Atmos_9_1_6, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topSideLeft, topSideRight, topRearLeft, topRearRight } }, List { kAudioChannelLayoutTag_Atmos_9_1_6, { left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topSideLeft, topSideRight, topRearLeft, topRearRight } },
#endif
// More uncommon layouts... // More uncommon layouts...
List { kAudioChannelLayoutTag_StereoHeadphones, { left, right } }, List { kAudioChannelLayoutTag_StereoHeadphones, { left, right } },

View file

@ -63,20 +63,12 @@ namespace CoreMidiHelpers
onlyOld onlyOld
}; };
#if (defined (MAC_OS_VERSION_11_0) || defined (__IPHONE_14_0)) #if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_14_0)
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_14_0) #define JUCE_HAS_OLD_COREMIDI_API 0
#define JUCE_HAS_NEW_COREMIDI_API 1 constexpr auto implementationStrategy = ImplementationStrategy::onlyNew;
#define JUCE_HAS_OLD_COREMIDI_API 0
constexpr auto implementationStrategy = ImplementationStrategy::onlyNew;
#else
#define JUCE_HAS_NEW_COREMIDI_API 1
#define JUCE_HAS_OLD_COREMIDI_API 1
constexpr auto implementationStrategy = ImplementationStrategy::both;
#endif
#else #else
#define JUCE_HAS_NEW_COREMIDI_API 0
#define JUCE_HAS_OLD_COREMIDI_API 1 #define JUCE_HAS_OLD_COREMIDI_API 1
constexpr auto implementationStrategy = ImplementationStrategy::onlyOld; constexpr auto implementationStrategy = ImplementationStrategy::both;
#endif #endif
struct SenderBase struct SenderBase
@ -90,7 +82,6 @@ namespace CoreMidiHelpers
template <ImplementationStrategy> template <ImplementationStrategy>
struct Sender; struct Sender;
#if JUCE_HAS_NEW_COREMIDI_API
template <> template <>
struct API_AVAILABLE (macos (11.0), ios (14.0)) Sender<ImplementationStrategy::onlyNew> final : public SenderBase struct API_AVAILABLE (macos (11.0), ios (14.0)) Sender<ImplementationStrategy::onlyNew> final : public SenderBase
{ {
@ -175,7 +166,6 @@ namespace CoreMidiHelpers
send(); send();
} }
}; };
#endif
#if JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
@ -264,7 +254,7 @@ namespace CoreMidiHelpers
}; };
#endif #endif
#if JUCE_HAS_NEW_COREMIDI_API && JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
struct Sender<ImplementationStrategy::both> struct Sender<ImplementationStrategy::both>
{ {
@ -633,7 +623,6 @@ namespace CoreMidiHelpers
template <ImplementationStrategy> template <ImplementationStrategy>
struct Receiver; struct Receiver;
#if JUCE_HAS_NEW_COREMIDI_API
template <> template <>
struct Receiver<ImplementationStrategy::onlyNew> struct Receiver<ImplementationStrategy::onlyNew>
{ {
@ -665,7 +654,6 @@ namespace CoreMidiHelpers
private: private:
std::unique_ptr<ump::U32InputHandler> u32InputHandler; std::unique_ptr<ump::U32InputHandler> u32InputHandler;
}; };
#endif
#if JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
@ -697,7 +685,7 @@ namespace CoreMidiHelpers
}; };
#endif #endif
#if JUCE_HAS_NEW_COREMIDI_API && JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
struct Receiver<ImplementationStrategy::both> struct Receiver<ImplementationStrategy::both>
{ {
@ -808,7 +796,6 @@ namespace CoreMidiHelpers
template <ImplementationStrategy> template <ImplementationStrategy>
struct CreatorFunctions; struct CreatorFunctions;
#if JUCE_HAS_NEW_COREMIDI_API
template <> template <>
struct API_AVAILABLE (macos (11.0), ios (14.0)) CreatorFunctions<ImplementationStrategy::onlyNew> struct API_AVAILABLE (macos (11.0), ios (14.0)) CreatorFunctions<ImplementationStrategy::onlyNew>
{ {
@ -872,7 +859,6 @@ namespace CoreMidiHelpers
static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (list); static_cast<MidiPortAndCallback*> (readProcRefCon)->handlePackets (list);
} }
}; };
#endif
#if JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
@ -917,7 +903,7 @@ namespace CoreMidiHelpers
}; };
#endif #endif
#if JUCE_HAS_NEW_COREMIDI_API && JUCE_HAS_OLD_COREMIDI_API #if JUCE_HAS_OLD_COREMIDI_API
template <> template <>
struct CreatorFunctions<ImplementationStrategy::both> struct CreatorFunctions<ImplementationStrategy::both>
{ {

View file

@ -72,30 +72,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wambiguous-reversed-operator",
#define verify_noerr(errorCode) __Verify_noErr(errorCode) #define verify_noerr(errorCode) __Verify_noErr(errorCode)
#endif #endif
#if ! defined (MAC_OS_VERSION_11_0) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_11_0
// These constants are only defined in the macOS 11+ SDKs
enum MIDICVStatus : unsigned int
{
kMIDICVStatusNoteOff = 0x8,
kMIDICVStatusNoteOn = 0x9,
kMIDICVStatusPolyPressure = 0xA,
kMIDICVStatusControlChange = 0xB,
kMIDICVStatusProgramChange = 0xC,
kMIDICVStatusChannelPressure = 0xD,
kMIDICVStatusPitchBend = 0xE,
kMIDICVStatusRegisteredPNC = 0x0,
kMIDICVStatusAssignablePNC = 0x1,
kMIDICVStatusRegisteredControl = 0x2,
kMIDICVStatusAssignableControl = 0x3,
kMIDICVStatusRelRegisteredControl = 0x4,
kMIDICVStatusRelAssignableControl = 0x5,
kMIDICVStatusPerNotePitchBend = 0x6,
kMIDICVStatusPerNoteMgmt = 0xF
};
#endif
#include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBase.cpp> #include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBase.cpp>
#include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBuffer.cpp> #include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBuffer.cpp>
#include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBufferAllocator.cpp> #include <juce_audio_plugin_client/AU/AudioUnitSDK/AUBufferAllocator.cpp>

View file

@ -37,10 +37,6 @@
#if JucePlugin_Build_AUv3 #if JucePlugin_Build_AUv3
#if JUCE_MAC && ! (defined (MAC_OS_X_VERSION_10_11) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)
#error AUv3 needs Deployment Target OS X 10.11 or higher to compile
#endif
#ifndef __OBJC2__ #ifndef __OBJC2__
#error AUv3 needs Objective-C 2 support (compile with 64-bit) #error AUv3 needs Objective-C 2 support (compile with 64-bit)
#endif #endif

View file

@ -418,7 +418,6 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, [[maybe_unused
for (int i = 0; i < params.size(); ++i) for (int i = 0; i < params.size(); ++i)
[paramArray addObject: juceStringToNS (params[i])]; [paramArray addObject: juceStringToNS (params[i])];
#if defined (MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15
if (@available (macOS 10.15, *)) if (@available (macOS 10.15, *))
{ {
auto config = [NSWorkspaceOpenConfiguration configuration]; auto config = [NSWorkspaceOpenConfiguration configuration];
@ -431,7 +430,6 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, [[maybe_unused
return true; return true;
} }
#endif
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")

View file

@ -161,10 +161,10 @@
#endif #endif
#if JUCE_MAC #if JUCE_MAC
#if ! defined (MAC_OS_X_VERSION_10_14) #if ! defined (MAC_OS_VERSION_11_1)
#error "The 10.14 SDK (Xcode 10.1+) is required to build JUCE apps. You can create apps that run on macOS 10.9+ by changing the deployment target." #error "The macOS 11.1 SDK (Xcode 12.4+) is required to build JUCE apps. You can create apps that run on macOS 10.11+ by changing the deployment target."
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
#error "Building for OSX 10.8 and earlier is no longer supported!" #error "Building for OSX 10.10 and earlier is no longer supported!"
#endif #endif
#endif #endif
#endif #endif

View file

@ -1909,14 +1909,10 @@ private:
case NSEventTypeBeginGesture: case NSEventTypeBeginGesture:
case NSEventTypeEndGesture: case NSEventTypeEndGesture:
case NSEventTypeQuickLook: case NSEventTypeQuickLook:
#if JUCE_64BIT
case NSEventTypeSmartMagnify: case NSEventTypeSmartMagnify:
case NSEventTypePressure: case NSEventTypePressure:
case NSEventTypeDirectTouch: 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: case NSEventTypeChangeMode:
#endif
default: default:
return false; return false;
} }

View file

@ -37,18 +37,6 @@
#undef JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS #undef JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS
#endif #endif
#if defined (__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
#define JUCE_HAS_IOS_POINTER_SUPPORT 1
#else
#define JUCE_HAS_IOS_POINTER_SUPPORT 0
#endif
#if defined (__IPHONE_13_4) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
#define JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT 1
#else
#define JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT 0
#endif
namespace juce namespace juce
{ {
@ -120,14 +108,12 @@ static UIInterfaceOrientation getWindowOrientation()
{ {
UIApplication* sharedApplication = [UIApplication sharedApplication]; UIApplication* sharedApplication = [UIApplication sharedApplication];
#if defined (__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available (iOS 13.0, *)) if (@available (iOS 13.0, *))
{ {
for (UIScene* scene in [sharedApplication connectedScenes]) for (UIScene* scene in [sharedApplication connectedScenes])
if ([scene isKindOfClass: [UIWindowScene class]]) if ([scene isKindOfClass: [UIWindowScene class]])
return [(UIWindowScene*) scene interfaceOrientation]; return [(UIWindowScene*) scene interfaceOrientation];
} }
#endif
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
return [sharedApplication statusBarOrientation]; return [sharedApplication statusBarOrientation];
@ -335,10 +321,8 @@ struct CADisplayLinkDeleter
- (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event; - (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event;
- (void) touchesCancelled: (NSSet*) touches withEvent: (UIEvent*) event; - (void) touchesCancelled: (NSSet*) touches withEvent: (UIEvent*) event;
#if JUCE_HAS_IOS_POINTER_SUPPORT
- (void) onHover: (UIHoverGestureRecognizer*) gesture API_AVAILABLE (ios (13.0)); - (void) onHover: (UIHoverGestureRecognizer*) gesture API_AVAILABLE (ios (13.0));
- (void) onScroll: (UIPanGestureRecognizer*) gesture; - (void) onScroll: (UIPanGestureRecognizer*) gesture;
#endif
- (BOOL) becomeFirstResponder; - (BOOL) becomeFirstResponder;
- (BOOL) resignFirstResponder; - (BOOL) resignFirstResponder;
@ -454,10 +438,8 @@ public:
void handleTouches (UIEvent*, MouseEventFlags); void handleTouches (UIEvent*, MouseEventFlags);
#if JUCE_HAS_IOS_POINTER_SUPPORT
API_AVAILABLE (ios (13.0)) void onHover (UIHoverGestureRecognizer*); API_AVAILABLE (ios (13.0)) void onHover (UIHoverGestureRecognizer*);
void onScroll (UIPanGestureRecognizer*); void onScroll (UIPanGestureRecognizer*);
#endif
Range<int> getMarkedTextRange() const Range<int> getMarkedTextRange() const
{ {
@ -661,7 +643,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
- (UIStatusBarStyle) preferredStatusBarStyle - (UIStatusBarStyle) preferredStatusBarStyle
{ {
#if defined (__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
if (@available (iOS 13.0, *)) if (@available (iOS 13.0, *))
{ {
if (auto* peer = getViewPeer (self)) if (auto* peer = getViewPeer (self))
@ -677,7 +658,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
} }
} }
} }
#endif
return UIStatusBarStyleDefault; return UIStatusBarStyleDefault;
} }
@ -747,7 +727,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
[self addSubview: owner->hiddenTextInput.get()]; [self addSubview: owner->hiddenTextInput.get()];
#if JUCE_HAS_IOS_POINTER_SUPPORT
if (@available (iOS 13.4, *)) if (@available (iOS 13.4, *))
{ {
auto hoverRecognizer = [[[UIHoverGestureRecognizer alloc] initWithTarget: self action: @selector (onHover:)] autorelease]; auto hoverRecognizer = [[[UIHoverGestureRecognizer alloc] initWithTarget: self action: @selector (onHover:)] autorelease];
@ -762,7 +741,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
[panRecognizer setMaximumNumberOfTouches: 0]; [panRecognizer setMaximumNumberOfTouches: 0];
[self addGestureRecognizer: panRecognizer]; [self addGestureRecognizer: panRecognizer];
} }
#endif
return self; return self;
} }
@ -867,7 +845,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
[self touchesEnded: touches withEvent: event]; [self touchesEnded: touches withEvent: event];
} }
#if JUCE_HAS_IOS_POINTER_SUPPORT
- (void) onHover: (UIHoverGestureRecognizer*) gesture - (void) onHover: (UIHoverGestureRecognizer*) gesture
{ {
if (owner != nullptr) if (owner != nullptr)
@ -879,7 +856,6 @@ MultiTouchMapper<UITouch*> UIViewComponentPeer::currentTouches;
if (owner != nullptr) if (owner != nullptr)
owner->onScroll (gesture); owner->onScroll (gesture);
} }
#endif
static std::optional<int> getKeyCodeForSpecialCharacterString (StringRef characters) static std::optional<int> getKeyCodeForSpecialCharacterString (StringRef characters)
{ {
@ -892,14 +868,10 @@ static std::optional<int> getKeyCodeForSpecialCharacterString (StringRef charact
{ nsStringToJuce (UIKeyInputLeftArrow), KeyPress::leftKey }, { nsStringToJuce (UIKeyInputLeftArrow), KeyPress::leftKey },
{ nsStringToJuce (UIKeyInputRightArrow), KeyPress::rightKey }, { nsStringToJuce (UIKeyInputRightArrow), KeyPress::rightKey },
{ nsStringToJuce (UIKeyInputEscape), KeyPress::escapeKey }, { nsStringToJuce (UIKeyInputEscape), KeyPress::escapeKey },
#if JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT
// These symbols are available on iOS 8, but only declared in the headers for iOS 13.4+
{ nsStringToJuce (UIKeyInputPageUp), KeyPress::pageUpKey }, { nsStringToJuce (UIKeyInputPageUp), KeyPress::pageUpKey },
{ nsStringToJuce (UIKeyInputPageDown), KeyPress::pageDownKey }, { nsStringToJuce (UIKeyInputPageDown), KeyPress::pageDownKey },
#endif
}; };
#if JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT
if (@available (iOS 13.4, *)) if (@available (iOS 13.4, *))
{ {
result.insert ({ { nsStringToJuce (UIKeyInputHome), KeyPress::homeKey }, result.insert ({ { nsStringToJuce (UIKeyInputHome), KeyPress::homeKey },
@ -917,7 +889,6 @@ static std::optional<int> getKeyCodeForSpecialCharacterString (StringRef charact
{ nsStringToJuce (UIKeyInputF11), KeyPress::F11Key }, { nsStringToJuce (UIKeyInputF11), KeyPress::F11Key },
{ nsStringToJuce (UIKeyInputF12), KeyPress::F12Key } }); { nsStringToJuce (UIKeyInputF12), KeyPress::F12Key } });
} }
#endif
#if defined (__IPHONE_15_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0 #if defined (__IPHONE_15_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0
if (@available (iOS 15.0, *)) if (@available (iOS 15.0, *))
@ -943,7 +914,6 @@ static int getKeyCodeForCharacters (NSString* characters)
return getKeyCodeForCharacters (nsStringToJuce (characters)); return getKeyCodeForCharacters (nsStringToJuce (characters));
} }
#if JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT
static void updateModifiers (const UIKeyModifierFlags flags) static void updateModifiers (const UIKeyModifierFlags flags)
{ {
const auto convert = [&flags] (UIKeyModifierFlags f, int result) { return (flags & f) != 0 ? result : 0; }; const auto convert = [&flags] (UIKeyModifierFlags f, int result) { return (flags & f) != 0 ? result : 0; };
@ -1051,7 +1021,6 @@ static bool doKeysUp (UIViewComponentPeer* owner, NSSet<UIPress*>* presses, UIPr
if (! doKeysUp (owner, presses, event)) if (! doKeysUp (owner, presses, event))
[super pressesCancelled: presses withEvent: event]; [super pressesCancelled: presses withEvent: event];
} }
#endif
//============================================================================== //==============================================================================
- (BOOL) becomeFirstResponder - (BOOL) becomeFirstResponder
@ -1720,13 +1689,9 @@ namespace juce
bool KeyPress::isKeyCurrentlyDown (int keyCode) bool KeyPress::isKeyCurrentlyDown (int keyCode)
{ {
#if JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT
return iOSGlobals::keysCurrentlyDown.isDown (keyCode) return iOSGlobals::keysCurrentlyDown.isDown (keyCode)
|| ('A' <= keyCode && keyCode <= 'Z' && iOSGlobals::keysCurrentlyDown.isDown ((int) CharacterFunctions::toLowerCase ((juce_wchar) keyCode))) || ('A' <= keyCode && keyCode <= 'Z' && iOSGlobals::keysCurrentlyDown.isDown ((int) CharacterFunctions::toLowerCase ((juce_wchar) keyCode)))
|| ('a' <= keyCode && keyCode <= 'z' && iOSGlobals::keysCurrentlyDown.isDown ((int) CharacterFunctions::toUpperCase ((juce_wchar) keyCode))); || ('a' <= keyCode && keyCode <= 'z' && iOSGlobals::keysCurrentlyDown.isDown ((int) CharacterFunctions::toUpperCase ((juce_wchar) keyCode)));
#else
return false;
#endif
} }
Point<float> juce_lastMousePos; Point<float> juce_lastMousePos;
@ -1804,10 +1769,8 @@ UIViewComponentPeer::~UIViewComponentPeer()
{ {
[((JuceUIWindow*) window) setOwner: nil]; [((JuceUIWindow*) window) setOwner: nil];
#if defined (__IPHONE_13_0)
if (@available (iOS 13.0, *)) if (@available (iOS 13.0, *))
window.windowScene = nil; window.windowScene = nil;
#endif
[window release]; [window release];
} }
@ -2012,12 +1975,10 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, MouseEventFlags mouseEv
if (event == nullptr) if (event == nullptr)
return; return;
#if JUCE_HAS_IOS_HARDWARE_KEYBOARD_SUPPORT
if (@available (iOS 13.4, *)) if (@available (iOS 13.4, *))
{ {
updateModifiers ([event modifierFlags]); updateModifiers ([event modifierFlags]);
} }
#endif
NSArray* touches = [[event touchesForView: view] allObjects]; NSArray* touches = [[event touchesForView: view] allObjects];
@ -2096,7 +2057,6 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, MouseEventFlags mouseEv
} }
} }
#if JUCE_HAS_IOS_POINTER_SUPPORT
void UIViewComponentPeer::onHover (UIHoverGestureRecognizer* gesture) void UIViewComponentPeer::onHover (UIHoverGestureRecognizer* gesture)
{ {
auto pos = convertToPointFloat ([gesture locationInView: view]); auto pos = convertToPointFloat ([gesture locationInView: view]);
@ -2129,7 +2089,6 @@ void UIViewComponentPeer::onScroll (UIPanGestureRecognizer* gesture)
UIViewComponentPeer::getMouseTime ([[NSProcessInfo processInfo] systemUptime]), UIViewComponentPeer::getMouseTime ([[NSProcessInfo processInfo] systemUptime]),
details); details);
} }
#endif
//============================================================================== //==============================================================================
void UIViewComponentPeer::viewFocusGain() void UIViewComponentPeer::viewFocusGain()

View file

@ -37,11 +37,7 @@ namespace juce
#if JUCE_WEB_BROWSER || DOXYGEN #if JUCE_WEB_BROWSER || DOXYGEN
#if (JUCE_MAC && (defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_13))) \ #if JUCE_MAC || JUCE_IOS || (JUCE_WINDOWS && JUCE_USE_WIN_WEBVIEW2) || JUCE_ANDROID || JUCE_LINUX
|| (JUCE_IOS && (defined (__IPHONE_11_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_11_0))) \
|| (JUCE_WINDOWS && JUCE_USE_WIN_WEBVIEW2) \
|| JUCE_ANDROID \
|| JUCE_LINUX
#define JUCE_WEB_BROWSER_RESOURCE_PROVIDER_AVAILABLE 1 #define JUCE_WEB_BROWSER_RESOURCE_PROVIDER_AVAILABLE 1
#else #else
#define JUCE_WEB_BROWSER_RESOURCE_PROVIDER_AVAILABLE 0 #define JUCE_WEB_BROWSER_RESOURCE_PROVIDER_AVAILABLE 0

View file

@ -32,10 +32,6 @@
============================================================================== ==============================================================================
*/ */
#if defined (MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15
#define JUCE_USE_NEW_CAMERA_API 1
#endif
struct CameraDevice::Pimpl struct CameraDevice::Pimpl
{ {
Pimpl (CameraDevice& ownerToUse, const String& deviceNameToUse, int /*index*/, Pimpl (CameraDevice& ownerToUse, const String& deviceNameToUse, int /*index*/,
@ -47,10 +43,8 @@ struct CameraDevice::Pimpl
{ {
imageOutput = []() -> std::unique_ptr<ImageOutputBase> imageOutput = []() -> std::unique_ptr<ImageOutputBase>
{ {
#if JUCE_USE_NEW_CAMERA_API
if (@available (macOS 10.15, *)) if (@available (macOS 10.15, *))
return std::make_unique<PostCatalinaPhotoOutput>(); return std::make_unique<PostCatalinaPhotoOutput>();
#endif
return std::make_unique<PreCatalinaStillImageOutput>(); return std::make_unique<PreCatalinaStillImageOutput>();
}(); }();
@ -152,7 +146,6 @@ struct CameraDevice::Pimpl
static NSArray* getCaptureDevices() static NSArray* getCaptureDevices()
{ {
#if JUCE_USE_NEW_CAMERA_API
if (@available (macOS 10.15, *)) if (@available (macOS 10.15, *))
{ {
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
@ -165,7 +158,6 @@ struct CameraDevice::Pimpl
return [discovery devices]; return [discovery devices];
} }
#endif
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
return [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo]; return [AVCaptureDevice devicesWithMediaType: AVMediaTypeVideo];
@ -255,7 +247,6 @@ private:
virtual void triggerImageCapture (Pimpl& p) = 0; virtual void triggerImageCapture (Pimpl& p) = 0;
}; };
#if JUCE_USE_NEW_CAMERA_API
class API_AVAILABLE (macos (10.15)) PostCatalinaPhotoOutput : public ImageOutputBase class API_AVAILABLE (macos (10.15)) PostCatalinaPhotoOutput : public ImageOutputBase
{ {
public: public:
@ -339,7 +330,6 @@ private:
AVCapturePhotoOutput* imageOutput = nil; AVCapturePhotoOutput* imageOutput = nil;
NSUniquePtr<NSObject<AVCapturePhotoCaptureDelegate>> delegate; NSUniquePtr<NSObject<AVCapturePhotoCaptureDelegate>> delegate;
}; };
#endif
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
class PreCatalinaStillImageOutput : public ImageOutputBase class PreCatalinaStillImageOutput : public ImageOutputBase