Analysis of Deprecated macOS Constants in OS.java
The constants defined in OS.java (lines 2177–2365) are replications of constants from macOS SDK header files. An analysis against the macOS 15.4 SDK revealed 53 deprecated constants across 14 headers, most deprecated since macOS 10.12 or 10.14.
The tables below list each deprecated constant alongside its replacement. The OpenGL constants are a special case since the entire OpenGL API was deprecated in favor of Metal/MetalKit.
| Current Constant |
Replacement |
NSBorderlessWindowMask |
NSWindowStyleMaskBorderless |
NSTitledWindowMask |
NSWindowStyleMaskTitled |
NSClosableWindowMask |
NSWindowStyleMaskClosable |
NSMiniaturizableWindowMask |
NSWindowStyleMaskMiniaturizable |
NSResizableWindowMask |
NSWindowStyleMaskResizable |
NSFullScreenWindowMask |
NSWindowStyleMaskFullScreen |
NSUtilityWindowMask |
NSWindowStyleMaskUtilityWindow |
NSDocModalWindowMask |
NSWindowStyleMaskDocModalWindow |
NSNonactivatingPanelMask |
NSWindowStyleMaskNonactivatingPanel |
| Current Constant |
Replacement |
NSCompositeClear |
NSCompositingOperationClear |
NSCompositeCopy |
NSCompositingOperationCopy |
NSCompositeSourceOver |
NSCompositingOperationSourceOver |
NSCompositeSourceAtop |
NSCompositingOperationSourceAtop |
| Current Constant |
Replacement |
NSWarningAlertStyle |
NSAlertStyleWarning |
NSInformationalAlertStyle |
NSAlertStyleInformational |
NSCriticalAlertStyle |
NSAlertStyleCritical |
| Current Constant |
Replacement |
NSMomentaryLightButton |
NSButtonTypeMomentaryLight |
NSPushOnPushOffButton |
NSButtonTypePushOnPushOff |
NSSwitchButton |
NSButtonTypeSwitch |
NSRadioButton |
NSButtonTypeRadio |
| Current Constant |
Replacement |
NSRoundedBezelStyle |
NSBezelStylePush |
NSRegularSquareBezelStyle |
NSBezelStyleFlexiblePush |
NSShadowlessSquareBezelStyle |
NSBezelStyleShadowlessSquare (itself further deprecated → NSBezelStyleSmallSquare) |
NSRoundedDisclosureBezelStyle |
NSBezelStylePushDisclosure |
| Current Constant |
Replacement |
NSShiftKeyMask |
NSEventModifierFlagShift |
NSControlKeyMask |
NSEventModifierFlagControl |
NSCommandKeyMask |
NSEventModifierFlagCommand |
NSHelpKeyMask |
NSEventModifierFlagHelp |
| Current Constant |
Replacement |
NSOpenGLPFADoubleBuffer |
Use Metal |
NSOpenGLPFAColorSize |
Use Metal |
NSOpenGLPFAAlphaSize |
Use Metal |
NSOpenGLPFADepthSize |
Use Metal |
NSOpenGLPFAStencilSize |
Use Metal |
NSOpenGLPFAAccumSize |
Use Metal |
NSOpenGLPFASampleBuffers |
Use Metal |
NSOpenGLPFASamples |
Use Metal |
NSOpenGLPFAStereo |
deprecated 10.0–10.12, no direct replacement |
NSOpenGLCPSurfaceOrder |
NSOpenGLContextParameterSurfaceOrder |
| Current Constant |
Replacement |
NSScrollerDecrementLine |
None — "Scroller arrows are not used anymore" |
NSScrollerIncrementLine |
None — "Scroller arrows are not used anymore" |
| Current Constant |
Replacement |
NSRegularControlSize |
NSControlSizeRegular |
NSSmallControlSize |
NSControlSizeSmall |
NSMiniControlSize |
NSControlSizeMini |
| Current Constant |
Replacement |
NSOffState |
NSControlStateValueOff |
NSOnState |
NSControlStateValueOn |
NSMixedState |
NSControlStateValueMixed |
| Current Constant |
Replacement |
NSScaleNone |
NSImageScaleNone |
| Current Constant |
Replacement |
NSFontPanelAllEffectsModeMask |
NSFontPanelModeMaskAllEffects |
NSFontPanelAllModesMask |
NSFontPanelModeMaskAllModes |
| Current Constant |
Replacement |
NSProgressIndicatorPreferredThickness |
Use controlSize + sizeToFit |
| Current Constant |
Replacement |
NSRGBColorSpaceModel |
NSColorSpaceModelRGB |
| Current Constant |
Replacement |
NSTextFieldAndStepperDatePickerStyle |
NSDatePickerStyleTextFieldAndStepper |
NSClockAndCalendarDatePickerStyle |
NSDatePickerStyleClockAndCalendar |
NSTextFieldDatePickerStyle |
NSDatePickerStyleTextField |
| Current Constant |
Replacement |
NSCancelButton |
NSModalResponseCancel |
Not Deprecated
The following constants in that range have no deprecation annotation in the macOS 15.4 SDK and require no action:
NSBezelBorder, NSBottomTabsBezelBorder, NSBoxCustom, NSBoxSeparator, NSBackingStoreBuffered, NSNoBorder, NSEventTypeGesture, NSEventTypeBeginGesture, NSEventTypeEndGesture, NSScrollerDecrementPage, NSScrollerIncrementPage, NSScrollerKnob, NSScrollerKnobSlot, NSBoldFontMask, NSItalicFontMask, NSBackgroundStyleRaised, NSImageCacheNever, NSTableColumnNoResizing, NSTableColumnUserResizingMask, NSTableViewNoColumnAutoresizing, NSStringDrawingUsesLineFragmentOrigin.
Analysis of Deprecated macOS Constants in
OS.javaThe constants defined in
OS.java(lines 2177–2365) are replications of constants from macOS SDK header files. An analysis against the macOS 15.4 SDK revealed 53 deprecated constants across 14 headers, most deprecated since macOS 10.12 or 10.14.The tables below list each deprecated constant alongside its replacement. The OpenGL constants are a special case since the entire OpenGL API was deprecated in favor of Metal/MetalKit.
NSWindow.h) — deprecated macOS 10.0–10.12NSBorderlessWindowMaskNSWindowStyleMaskBorderlessNSTitledWindowMaskNSWindowStyleMaskTitledNSClosableWindowMaskNSWindowStyleMaskClosableNSMiniaturizableWindowMaskNSWindowStyleMaskMiniaturizableNSResizableWindowMaskNSWindowStyleMaskResizableNSFullScreenWindowMaskNSWindowStyleMaskFullScreenNSUtilityWindowMaskNSWindowStyleMaskUtilityWindowNSDocModalWindowMaskNSWindowStyleMaskDocModalWindowNSNonactivatingPanelMaskNSWindowStyleMaskNonactivatingPanelNSGraphics.h) — deprecated macOS 10.0–10.12NSCompositeClearNSCompositingOperationClearNSCompositeCopyNSCompositingOperationCopyNSCompositeSourceOverNSCompositingOperationSourceOverNSCompositeSourceAtopNSCompositingOperationSourceAtopNSAlert.h) — deprecated macOS 10.3–10.12NSWarningAlertStyleNSAlertStyleWarningNSInformationalAlertStyleNSAlertStyleInformationalNSCriticalAlertStyleNSAlertStyleCriticalNSButtonCell.h) — deprecated macOS 10.0–10.14NSMomentaryLightButtonNSButtonTypeMomentaryLightNSPushOnPushOffButtonNSButtonTypePushOnPushOffNSSwitchButtonNSButtonTypeSwitchNSRadioButtonNSButtonTypeRadioNSButtonCell.h) — deprecated macOS 10.0–10.14NSRoundedBezelStyleNSBezelStylePushNSRegularSquareBezelStyleNSBezelStyleFlexiblePushNSShadowlessSquareBezelStyleNSBezelStyleShadowlessSquare(itself further deprecated →NSBezelStyleSmallSquare)NSRoundedDisclosureBezelStyleNSBezelStylePushDisclosureNSEvent.h) — deprecated macOS 10.0–10.12NSShiftKeyMaskNSEventModifierFlagShiftNSControlKeyMaskNSEventModifierFlagControlNSCommandKeyMaskNSEventModifierFlagCommandNSHelpKeyMaskNSEventModifierFlagHelpNSOpenGL.h) — deprecated macOS 10.0–10.14, replace with Metal/MetalKitNSOpenGLPFADoubleBufferNSOpenGLPFAColorSizeNSOpenGLPFAAlphaSizeNSOpenGLPFADepthSizeNSOpenGLPFAStencilSizeNSOpenGLPFAAccumSizeNSOpenGLPFASampleBuffersNSOpenGLPFASamplesNSOpenGLPFAStereoNSOpenGLCPSurfaceOrderNSOpenGLContextParameterSurfaceOrderNSScroller.h) — deprecated macOS 10.0–10.14NSScrollerDecrementLineNSScrollerIncrementLineNSCell.h) — deprecated macOS 10.0–10.12NSRegularControlSizeNSControlSizeRegularNSSmallControlSizeNSControlSizeSmallNSMiniControlSizeNSControlSizeMiniNSCell.h) — deprecated macOS 10.0–10.14NSOffStateNSControlStateValueOffNSOnStateNSControlStateValueOnNSMixedStateNSControlStateValueMixedNSCell.h) — deprecated macOS 10.0–10.10NSScaleNoneNSImageScaleNoneNSFontPanel.h) — deprecated (no version range specified)NSFontPanelAllEffectsModeMaskNSFontPanelModeMaskAllEffectsNSFontPanelAllModesMaskNSFontPanelModeMaskAllModesNSProgressIndicator.h) — deprecated macOS 10.0–10.14NSProgressIndicatorPreferredThicknesscontrolSize+sizeToFitNSColorSpace.h) — deprecated macOS 10.0–10.14NSRGBColorSpaceModelNSColorSpaceModelRGBNSDatePickerCell.h) — deprecated macOS 10.0–11.0NSTextFieldAndStepperDatePickerStyleNSDatePickerStyleTextFieldAndStepperNSClockAndCalendarDatePickerStyleNSDatePickerStyleClockAndCalendarNSTextFieldDatePickerStyleNSDatePickerStyleTextFieldNSPanel.h) — deprecated macOS 10.0–10.10NSCancelButtonNSModalResponseCancelNot Deprecated
The following constants in that range have no deprecation annotation in the macOS 15.4 SDK and require no action:
NSBezelBorder,NSBottomTabsBezelBorder,NSBoxCustom,NSBoxSeparator,NSBackingStoreBuffered,NSNoBorder,NSEventTypeGesture,NSEventTypeBeginGesture,NSEventTypeEndGesture,NSScrollerDecrementPage,NSScrollerIncrementPage,NSScrollerKnob,NSScrollerKnobSlot,NSBoldFontMask,NSItalicFontMask,NSBackgroundStyleRaised,NSImageCacheNever,NSTableColumnNoResizing,NSTableColumnUserResizingMask,NSTableViewNoColumnAutoresizing,NSStringDrawingUsesLineFragmentOrigin.