MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031021Community[OCCT] OCCT:Codingpublic2019-10-02 06:092019-10-23 11:51
Reportergalbramc 
Assigned Toapn 
PrioritynormalSeverityminor 
StatusverifiedResolutionfixed 
PlatformMacOSOSXOS Version10.15
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
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
Attached Files

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

-  Notes
(0087680)
kgv (developer)
2019-10-02 07:15
edited on: 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.

(0087719)
galbramc (reporter)
2019-10-02 18:27

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.
(0087720)
kgv (developer)
2019-10-02 18:30

> 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 [^]
(0087784)
galbramc (reporter)
2019-10-03 18:19

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)
   {
(0088145)
git (administrator)
2019-10-15 20:47

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.
(0088150)
kgv (developer)
2019-10-15 23:53

Please raise the patch.
(0088473)
git (administrator)
2019-10-23 11:51

Branch CR31021 has been deleted by kgv.

SHA-1: 1e0e1caf92a49d2a35ca6a34b557e2d9272c6727

- Related Changesets
occt: master 89073268
Timestamp: 2019-10-15 17:46:57
Author: 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.
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 View Revisions
2019-10-02 07:18 kgv Note Edited: 0087680 View Revisions
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


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker