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 =========================================================================*/
24 #ifndef __VTK_WRAP__
25 
26 #include <AvailabilityMacros.h>
27 
28 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
29  #error VTK requires the Mac OS X 10.7 SDK or later
30 #endif
31 
32 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
33  #error VTK requires a deployment target of Mac OS X 10.7 or later
34 #endif
35 
36 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS)
37  // The 10.12 SDK made a bunch of enum names more logical, map old names to new names to continue supporting old SDKs.
38  #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
39  #define NSWindowStyleMaskTitled NSTitledWindowMask
40  #define NSWindowStyleMaskClosable NSClosableWindowMask
41  #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
42  #define NSWindowStyleMaskResizable NSResizableWindowMask
43 
44  #define NSEventModifierFlagShift NSShiftKeyMask
45  #define NSEventModifierFlagControl NSControlKeyMask
46  #define NSEventModifierFlagOption NSAlternateKeyMask
47  #define NSEventModifierFlagCommand NSCommandKeyMask
48 
49  #define NSEventTypeKeyDown NSKeyDown
50  #define NSEventTypeKeyUp NSKeyUp
51  #define NSEventTypeApplicationDefined NSApplicationDefined
52  #define NSEventTypeFlagsChanged NSFlagsChanged
53 #endif
54 
55 // Create handy #defines that indicate the Objective-C memory management model.
56 // Manual Retain Release, Automatic Reference Counting, or Garbage Collection.
57 #if defined(__OBJC_GC__)
58  #define VTK_OBJC_IS_MRR 0
59  #define VTK_OBJC_IS_ARC 0
60  #define VTK_OBJC_IS_GC 1
61 #elif __has_feature(objc_arc)
62  #define VTK_OBJC_IS_MRR 0
63  #define VTK_OBJC_IS_ARC 1
64  #define VTK_OBJC_IS_GC 0
65 #else
66  #define VTK_OBJC_IS_MRR 1
67  #define VTK_OBJC_IS_ARC 0
68  #define VTK_OBJC_IS_GC 0
69 #endif
70 
71 #if __has_feature(objc_arc)
72  #error VTK does not yet support ARC memory management
73 #endif
74 
75 #endif
76 // VTK-HeaderTest-Exclude: vtkCocoaMacOSXSDKCompatibility.h