VTK
vtkCocoaMacOSXSDKCompatibility.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkCocoaMacOSXSDKCompatibility.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #include <AvailabilityMacros.h>
26 
27 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
28  #error VTK requires the Mac OS X 10.7 SDK or later
29 #endif
30 
31 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
32  #error VTK requires a deployment target of Mac OS X 10.7 or later
33 #endif
34 
35 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS)
36  // The 10.12 SDK made a bunch of enum names more logical, map old names to new names to continue supporting old SDKs.
37  #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
38  #define NSWindowStyleMaskTitled NSTitledWindowMask
39  #define NSWindowStyleMaskClosable NSClosableWindowMask
40  #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
41  #define NSWindowStyleMaskResizable NSResizableWindowMask
42 
43  #define NSEventModifierFlagShift NSShiftKeyMask
44  #define NSEventModifierFlagControl NSControlKeyMask
45  #define NSEventModifierFlagOption NSAlternateKeyMask
46  #define NSEventModifierFlagCommand NSCommandKeyMask
47 
48  #define NSEventTypeKeyDown NSKeyDown
49  #define NSEventTypeKeyUp NSKeyUp
50  #define NSEventTypeApplicationDefined NSApplicationDefined
51  #define NSEventTypeFlagsChanged NSFlagsChanged
52 #endif
53 
54 // Create handy #defines that indicate the Objective-C memory management model.
55 // Manual Retain Release, Automatic Reference Counting, or Garbage Collection.
56 #if defined(__OBJC_GC__)
57  #define VTK_OBJC_IS_MRR 0
58  #define VTK_OBJC_IS_ARC 0
59  #define VTK_OBJC_IS_GC 1
60 #elif __has_feature(objc_arc)
61  #define VTK_OBJC_IS_MRR 0
62  #define VTK_OBJC_IS_ARC 1
63  #define VTK_OBJC_IS_GC 0
64 #else
65  #define VTK_OBJC_IS_MRR 1
66  #define VTK_OBJC_IS_ARC 0
67  #define VTK_OBJC_IS_GC 0
68 #endif
69 
70 #if __has_feature(objc_arc)
71  #error VTK does not yet support ARC memory management
72 #endif
73 
74 // VTK-HeaderTest-Exclude: vtkCocoaMacOSXSDKCompatibility.h