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

NSViewComponentPeer: Guard API availability

This commit is contained in:
reuk 2024-12-02 15:20:49 +00:00
parent c2f567f3ee
commit 2583b06481
No known key found for this signature in database

View file

@ -129,14 +129,16 @@ static constexpr int translateVirtualToAsciiKeyCode (int keyCode) noexcept
constexpr int extendedKeyModifier = 0x30000; constexpr int extendedKeyModifier = 0x30000;
//============================================================================== //==============================================================================
class JuceCALayerDelegate final : public ObjCClass<NSObject<CALayerDelegate>> struct JuceCALayerDelegateCallback
{
virtual ~JuceCALayerDelegateCallback() = default;
virtual void displayLayer (CALayer*) = 0;
};
class API_AVAILABLE (macos (10.12)) JuceCALayerDelegate final : public ObjCClass<NSObject<CALayerDelegate>>
{ {
public: public:
struct Callback using Callback = JuceCALayerDelegateCallback;
{
virtual ~Callback() = default;
virtual void displayLayer (CALayer*) = 0;
};
static NSObject<CALayerDelegate>* construct (Callback* owner) static NSObject<CALayerDelegate>* construct (Callback* owner)
{ {
@ -176,7 +178,7 @@ private:
//============================================================================== //==============================================================================
class NSViewComponentPeer final : public ComponentPeer, class NSViewComponentPeer final : public ComponentPeer,
private JuceCALayerDelegate::Callback private JuceCALayerDelegateCallback
{ {
public: public:
NSViewComponentPeer (Component& comp, const int windowStyleFlags, NSView* viewToAttachTo) NSViewComponentPeer (Component& comp, const int windowStyleFlags, NSView* viewToAttachTo)