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