summaryrefslogtreecommitdiff
path: root/src/nsterm.h
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2016-08-18 19:55:52 +0100
committerAlan Third <alan@idiocy.org>2016-08-24 19:21:56 +0100
commit5332857670eb3977b192eba433ec470a391c4ea4 (patch)
tree72df888858c91e200bc94e9e633909d49525a329 /src/nsterm.h
parent799a8a3338389013e8a76a70f507664ccb09a14f (diff)
downloademacs-5332857670eb3977b192eba433ec470a391c4ea4.tar.gz
Fix macOS 12 deprecation notices
* src/nsterm.h: Add #defines to allow older versions of macOS to use the new constant names. * src/nsmenu.m: Replace old constant names with new. (fillWithWidgetValue): Remove calls to deprecated setMenuChangedMessagesEnabled. * src/nsterm.m: Replace old constant names with new. * src/nsfns.m: Replace old constant names with new.
Diffstat (limited to 'src/nsterm.h')
-rw-r--r--src/nsterm.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/nsterm.h b/src/nsterm.h
index 3d8b1a16a32..c12c791c635 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -39,6 +39,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef MAC_OS_X_VERSION_10_9
#define MAC_OS_X_VERSION_10_9 1090
#endif
+#ifndef MAC_OS_X_VERSION_10_12
+#define MAC_OS_X_VERSION_10_12 101200
+#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
#define HAVE_NATIVE_FS
@@ -1233,4 +1236,42 @@ extern char gnustep_base_version[]; /* version tracking */
? (min) : (((x)>(max)) ? (max) : (x)))
#define SCREENMAXBOUND(x) (IN_BOUND (-SCREENMAX, x, SCREENMAX))
+/* macOS 10.12 deprecates a bunch of constants. */
+#if !defined (NS_IMPL_COCOA) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
+#define NSEventModifierFlagCommand NSCommandKeyMask
+#define NSEventModifierFlagControl NSControlKeyMask
+#define NSEventModifierFlagHelp NSHelpKeyMask
+#define NSEventModifierFlagNumericPad NSNumericPadKeyMask
+#define NSEventModifierFlagOption NSAlternateKeyMask
+#define NSEventModifierFlagShift NSShiftKeyMask
+#define NSCompositingOperationSourceOver NSCompositeSourceOver
+#define NSEventMaskApplicationDefined NSApplicationDefinedMask
+#define NSEventTypeApplicationDefined NSApplicationDefined
+#define NSEventTypeCursorUpdate NSCursorUpdate
+#define NSEventTypeMouseMoved NSMouseMoved
+#define NSEventTypeLeftMouseDown NSLeftMouseDown
+#define NSEventTypeRightMouseDown NSRightMouseDown
+#define NSEventTypeOtherMouseDown NSOtherMouseDown
+#define NSEventTypeLeftMouseUp NSLeftMouseUp
+#define NSEventTypeRightMouseUp NSRightMouseUp
+#define NSEventTypeOtherMouseUp NSOtherMouseUp
+#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
+#define NSEventTypeRightMouseDragged NSRightMouseDragged
+#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
+#define NSEventTypeScrollWheel NSScrollWheel
+#define NSEventTypeKeyDown NSKeyDown
+#define NSEventTypeKeyUp NSKeyUp
+#define NSEventTypeFlagsChanged NSFlagsChanged
+#define NSEventMaskAny NSAnyEventMask
+#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
+#define NSWindowStyleMaskClosable NSClosableWindowMask
+#define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
+#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
+#define NSWindowStyleMaskResizable NSResizableWindowMask
+#define NSWindowStyleMaskTitled NSTitledWindowMask
+#define NSAlertStyleCritical NSCriticalAlertStyle
+#define NSControlSizeRegular NSRegularControlSize
+#endif
+
#endif /* HAVE_NS */