Browse Source

macOS: Silence some deprecation warnings

v6.1.6
ed 4 years ago
parent
commit
05b49da0fe
3 changed files with 12 additions and 3 deletions
  1. +2
    -0
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm
  2. +2
    -0
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  3. +8
    -3
      modules/juce_gui_basics/native/juce_mac_Windowing.mm

+ 2
- 0
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -224,7 +224,9 @@ private:
if (@available (macOS 10.9, *))
return NSModalResponseOK;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
return NSFileHandlingPanelOKButton;
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}();
if (panel != nil && result == okResult)


+ 2
- 0
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -857,7 +857,9 @@ public:
if (@available (macOS 10.10, *))
return (CGContextRef) [[NSGraphicsContext currentContext] CGContext];
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
return (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort];
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}();
if (! component.isOpaque())


+ 8
- 3
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

@@ -645,11 +645,16 @@ static void selectImageForDrawing (const Image& image)
[NSGraphicsContext saveGraphicsState];
if (@available (macOS 10.10, *))
{
[NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithCGContext: juce_getImageContext (image)
flipped: false]];
else
[NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: juce_getImageContext (image)
flipped: false]];
return;
}
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
[NSGraphicsContext setCurrentContext: [NSGraphicsContext graphicsContextWithGraphicsPort: juce_getImageContext (image)
flipped: false]];
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}
static void releaseImageAfterDrawing()


Loading…
Cancel
Save