From 9df797575fc771f87dc6bedf89b46aab3236a21f Mon Sep 17 00:00:00 2001 From: Akemi Date: Tue, 20 Sep 2016 23:30:54 +0200 Subject: cocoa: fix macOS 10.12 deprecation warnings --- osdep/macosx_compat.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'osdep/macosx_compat.h') diff --git a/osdep/macosx_compat.h b/osdep/macosx_compat.h index 9775529bc6..76308c6f98 100644 --- a/osdep/macosx_compat.h +++ b/osdep/macosx_compat.h @@ -24,6 +24,31 @@ #import #include "osdep/macosx_versions.h" +#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12) +typedef NSUInteger NSWindowStyleMask; +static const NSWindowStyleMask NSWindowStyleMaskClosable = NSClosableWindowMask; +static const NSWindowStyleMask NSWindowStyleMaskTitled = NSTitledWindowMask; +static const NSWindowStyleMask NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask; +static const NSWindowStyleMask NSWindowStyleMaskResizable = NSResizableWindowMask; +static const NSWindowStyleMask NSWindowStyleMaskBorderless = NSBorderlessWindowMask; + +static const NSEventType NSEventTypeSystemDefined = NSSystemDefined; +static const NSEventType NSEventTypeKeyDown = NSKeyDown; +static const NSEventType NSEventTypeKeyUp = NSKeyUp; + +static const NSEventMask NSEventMaskKeyDown = NSKeyDownMask; +static const NSEventMask NSEventMaskKeyUp = NSKeyUpMask; + +#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10) +typedef NSUInteger NSEventModifierFlags; +#endif + +static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask; +static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask; +static const NSEventModifierFlags NSEventModifierFlagCommand = NSCommandKeyMask; +static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask; +#endif + #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8) @interface NSArray (SubscriptingAdditions) - (id)objectAtIndexedSubscript:(NSUInteger)index; -- cgit v1.2.3