View Issue Details

IDProjectCategoryView StatusLast Update
0031021CommunityOCCT:Codingpublic2020-12-02 17:12
Reportergalbramc Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformMacOSOSX 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031021: Coding Rules - Deprecation warnings on OSX within Draw_Window_1.mm
Description/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/Draw/Draw_Window_1.mm:564:60: warning: 'NSPNGFileType' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
                                  [NSNumber numberWithInt: NSPNGFileType], @"png",
                                                           ^~~~~~~~~~~~~
                                                           NSBitmapImageFileTypePNG
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:157:36: note: 'NSPNGFileType' has been explicitly marked
      deprecated here
static const NSBitmapImageFileType NSPNGFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypePNG", macos(10.0,10.14)) = NSBitmapImageFileTypePNG;
                                   ^
/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/Draw/Draw_Window_1.mm:565:60: warning: 'NSBMPFileType' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
                                  [NSNumber numberWithInt: NSBMPFileType], @"bmp",
                                                           ^~~~~~~~~~~~~
                                                           NSBitmapImageFileTypeBMP
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:154:36: note: 'NSBMPFileType' has been explicitly marked
      deprecated here
static const NSBitmapImageFileType NSBMPFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeBMP", macos(10.0,10.14)) = NSBitmapImageFileTypeBMP;
                                   ^
/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/Draw/Draw_Window_1.mm:566:60: warning: 'NSJPEGFileType' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
                                  [NSNumber numberWithInt: NSJPEGFileType], @"jpg",
                                                           ^~~~~~~~~~~~~~
                                                           NSBitmapImageFileTypeJPEG
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:156:36: note: 'NSJPEGFileType' has been explicitly marked
      deprecated here
static const NSBitmapImageFileType NSJPEGFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeJPEG", macos(10.0,10.14)) = NSBitmapImageFileTypeJPEG;
                                   ^
/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/Draw/Draw_Window_1.mm:567:60: warning: 'NSGIFFileType' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
                                  [NSNumber numberWithInt: NSGIFFileType], @"gif",
                                                           ^~~~~~~~~~~~~
                                                           NSBitmapImageFileTypeGIF
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSBitmapImageRep.h:155:36: note: 'NSGIFFileType' has been explicitly marked
      deprecated here
static const NSBitmapImageFileType NSGIFFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeGIF", macos(10.0,10.14)) = NSBitmapImageFileTypeGIF;

/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/OpenGl/OpenGl_Window_1.mm:213:17: warning: 'setView:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView to provide OpenGL content in a Cocoa app.
      [-Wdeprecated-declarations]
    [aGLContext setView: aView];
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:202:36: note: property 'view' is declared deprecated here
@property (nullable, weak) NSView *view API_DEPRECATED("", macos(10.0,10.14));
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:203:1: note: 'setView:' has been explicitly marked deprecated here
- (void)setView:(nullable NSView *)view API_DEPRECATED("Use NSOpenGLView to provide OpenGL content in a Cocoa app.", macos(10.0,10.14));
^
/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/OpenGl/OpenGl_Window_1.mm:270:29: warning: 'view' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
    NSView* aView = [aGLCtx view];
                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:202:36: note: property 'view' is declared deprecated here
@property (nullable, weak) NSView *view API_DEPRECATED("", macos(10.0,10.14));
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:202:36: note: 'view' has been explicitly marked deprecated here
/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/OpenGl/OpenGl_Window_1.mm:350:38: warning: 'view' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
  NSView* aView = [aGLCtx view];
                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:202:36: note: property 'view' is declared deprecated here
@property (nullable, weak) NSView *view API_DEPRECATED("", macos(10.0,10.14));
                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:202:36: note: 'view' has been explicitly marked deprecated here

/Users/galbramc/util/ESP/opencascade-7.4/trunk/src/Aspect/Aspect_RenderingContext.hxx:40:13: warning: 'NSOpenGLContext' is deprecated: first deprecated in macOS 10.14 - Please use Metal or MetalKit. [-Wdeprecated-declarations]
    typedef NSOpenGLContext* Aspect_RenderingContext;
            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:193:12: note: 'NSOpenGLContext' has been explicitly marked deprecated
      here
@interface NSOpenGLContext : NSObject <NSLocking>
           ^
Steps To ReproduceCompile OCCT on OSX 10.14 or newer.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0030681 closedbugmaster Open CASCADE Configuration - suppress OpenGL deprecation warning on macOS 10.14 
related to 0030631 newvpozdyayev Open CASCADE Visualization - Vulkan graphic driver prototype 

Activities

kgv

2019-10-02 07:15

developer   ~0087680

Last edited: 2019-10-02 07:18

There is nothing OCCT can do with these warnings (of course, apart from suppressing them intentionally).

After many years of silently abandoned state of OpenGL in macOS, Apple has confirmed the sad fact of ignorance of industrial cross-platform standards, and marked this framework as "deprecated", which means that they are not going to support it further and may remove it with some further release.

So yes, user building OCCT for macOS is expected to see this warning, because OCCT visualization functionality will be limited by obsolete state of OpenGL framework within official SDK, and is incomparable to OpenGL support on other platforms (Windows, Linux).

There is no yet alternative to switch onto.
One of possible directions is using Vulkan implementation over Metal (so far, Apple also ignores another new open standard - Vulkan graphics API):
https://github.com/KhronosGroup/MoltenVK

P.S.: a couple of warnings related to enumeration renames (NSBitmapImageFileTypePNG) can be fixed.

galbramc

2019-10-02 18:27

reporter   ~0087719

Yeah I thought that would be the case. Apple does not like to play with other peoples toys, or let others play with their toys.

It would be nice if the enumerations could get fixed.

kgv

2019-10-02 18:30

developer   ~0087720

> It would be nice if the enumerations could get fixed.
You can prepare a patch.
I think it should be similar to this one 0029156 also related to deprecated enums:
https://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff;h=e2b4dea25313d08318e94d6cbc329d18486d801c

galbramc

2019-10-03 18:19

reporter   ~0087784

This patch suppresses the enumeration warnings. I tried it on OSX 10.15 and 10.12. I only compiled. I don't use OCC graphics and I would not know how to do a runtime test.

Index: Draw_Window_1.mm
===================================================================
--- Draw_Window_1.mm (revision 1)
+++ Draw_Window_1.mm (working copy)
@@ -37,6 +37,13 @@
   #define NSCompositingOperationSourceOver NSCompositeSourceOver
 #endif
 
+#if !defined(MAC_OS_X_VERSION_10_14) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14)
+ #define NSBitmapImageFileTypePNG NSPNGFileType
+ #define NSBitmapImageFileTypeBMP NSBMPFileType
+ #define NSBitmapImageFileTypeJPEG NSJPEGFileType
+ #define NSBitmapImageFileTypeGIF NSGIFFileType
+#endif
+
 @interface Draw_CocoaView : NSView
 {
   NSImage* myImage;
@@ -561,10 +568,10 @@
   NSString* aFileExtension = [[aFileName pathExtension] lowercaseString];
 
   NSDictionary* aFileTypeDict = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt: NSPNGFileType], @"png",
- [NSNumber numberWithInt: NSBMPFileType], @"bmp",
- [NSNumber numberWithInt: NSJPEGFileType], @"jpg",
- [NSNumber numberWithInt: NSGIFFileType], @"gif",
+ [NSNumber numberWithInt: NSBitmapImageFileTypePNG], @"png",
+ [NSNumber numberWithInt: NSBitmapImageFileTypeBMP], @"bmp",
+ [NSNumber numberWithInt: NSBitmapImageFileTypeJPEG], @"jpg",
+ [NSNumber numberWithInt: NSBitmapImageFileTypeGIF], @"gif",
                                   nil];
   if ([aFileTypeDict valueForKey: aFileExtension] == NULL)
   {

git

2019-10-15 20:47

administrator   ~0088145

Branch CR31021 has been created by kgv.

SHA-1: 1e0e1caf92a49d2a35ca6a34b557e2d9272c6727


Detailed log of new commits:

Author: kgv
Date: Tue Oct 15 20:46:57 2019 +0300

    0031021: Coding Rules - Deprecation warnings on OSX within Draw_Window_1.mm
    
    Use new renamed enumeration values instead of deprecated ones.

kgv

2019-10-15 23:53

developer   ~0088150

Please raise the patch.

git

2019-10-23 11:51

administrator   ~0088473

Branch CR31021 has been deleted by kgv.

SHA-1: 1e0e1caf92a49d2a35ca6a34b557e2d9272c6727

Related Changesets

occt: master 89073268

2019-10-15 17:46:57

kgv


Committer: apn Details Diff
0031021: Coding Rules - Deprecation warnings on OSX within Draw_Window_1.mm

Use new renamed enumeration values instead of deprecated ones.
Affected Issues
0031021
mod - src/Draw/Draw_Window_1.mm Diff File

Issue History

Date Modified Username Field Change
2019-10-02 06:09 galbramc New Issue
2019-10-02 06:09 galbramc Assigned To => kgv
2019-10-02 07:02 abv Target Version => 7.5.0
2019-10-02 07:05 kgv Relationship added related to 0030681
2019-10-02 07:15 kgv Note Added: 0087680
2019-10-02 07:15 kgv Relationship added related to 0030631
2019-10-02 07:16 kgv Note Edited: 0087680
2019-10-02 07:18 kgv Note Edited: 0087680
2019-10-02 18:27 galbramc Note Added: 0087719
2019-10-02 18:30 kgv Note Added: 0087720
2019-10-03 18:19 galbramc Note Added: 0087784
2019-10-15 20:46 kgv Summary Deprecation warnings on OSX with OCCT 7.4 => Coding Rules - Deprecation warnings on OSX within Draw_Window_1.mm
2019-10-15 20:47 git Note Added: 0088145
2019-10-15 23:53 kgv Note Added: 0088150
2019-10-15 23:53 kgv Assigned To kgv => bugmaster
2019-10-15 23:53 kgv Status new => resolved
2019-10-15 23:53 kgv Status resolved => reviewed
2019-10-23 01:07 apn Changeset attached => occt master 89073268
2019-10-23 01:07 apn Assigned To bugmaster => apn
2019-10-23 01:07 apn Status reviewed => verified
2019-10-23 01:07 apn Resolution open => fixed
2019-10-23 01:18 apn Test case number => Not needed
2019-10-23 11:51 git Note Added: 0088473
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed