Imported Tk 8.6.9
This commit is contained in:
121
macosx/tkMacOSXConstants.h
Normal file
121
macosx/tkMacOSXConstants.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* tkMacOSXConstants.h --
|
||||
*
|
||||
* Macros which map the names of NS constants used in the Tk code to
|
||||
* the new name that Apple came up with for subsequent versions of the
|
||||
* operating system. (Each new OS release seems to come with a new
|
||||
* naming convention for the same old constants.)
|
||||
*
|
||||
* Copyright (c) 2017 Marc Culler
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TKMACCONSTANTS
|
||||
#define _TKMACCONSTANTS
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
||||
#define NSFullScreenWindowMask (1 << 14)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Let's raise a glass for the project manager who improves our lives by
|
||||
* generating deprecation warnings about pointless changes of the names
|
||||
* of constants.
|
||||
*/
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||
#define kCTFontDefaultOrientation kCTFontOrientationDefault
|
||||
#define kCTFontVerticalOrientation kCTFontOrientationVertical
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
|
||||
#define NSOKButton NSModalResponseOK
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
|
||||
#define kCTFontUserFixedPitchFontType kCTFontUIFontUserFixedPitch
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
|
||||
#define NSAppKitDefined NSEventTypeAppKitDefined
|
||||
#define NSApplicationDefined NSEventTypeApplicationDefined
|
||||
#define NSApplicationActivatedEventType NSEventSubtypeApplicationActivated
|
||||
#define NSApplicationDeactivatedEventType NSEventSubtypeApplicationDeactivated
|
||||
#define NSWindowExposedEventType NSEventSubtypeWindowExposed
|
||||
#define NSScreenChangedEventType NSEventSubtypeScreenChanged
|
||||
#define NSWindowMovedEventType NSEventSubtypeWindowMoved
|
||||
#define NSKeyUp NSEventTypeKeyUp
|
||||
#define NSKeyDown NSEventTypeKeyDown
|
||||
#define NSFlagsChanged NSEventTypeFlagsChanged
|
||||
#define NSLeftMouseDown NSEventTypeLeftMouseDown
|
||||
#define NSLeftMouseUp NSEventTypeLeftMouseUp
|
||||
#define NSRightMouseDown NSEventTypeRightMouseDown
|
||||
#define NSRightMouseUp NSEventTypeRightMouseUp
|
||||
#define NSLeftMouseDragged NSEventTypeLeftMouseDragged
|
||||
#define NSRightMouseDragged NSEventTypeRightMouseDragged
|
||||
#define NSMouseMoved NSEventTypeMouseMoved
|
||||
#define NSMouseEntered NSEventTypeMouseEntered
|
||||
#define NSMouseExited NSEventTypeMouseExited
|
||||
#define NSScrollWheel NSEventTypeScrollWheel
|
||||
#define NSOtherMouseDown NSEventTypeOtherMouseDown
|
||||
#define NSOtherMouseUp NSEventTypeOtherMouseUp
|
||||
#define NSOtherMouseDragged NSEventTypeOtherMouseDragged
|
||||
#define NSTabletPoint NSEventTypeTabletPoint
|
||||
#define NSTabletProximity NSEventTypeTabletProximity
|
||||
#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
|
||||
#define NSCommandKeyMask NSEventModifierFlagCommand
|
||||
#define NSShiftKeyMask NSEventModifierFlagShift
|
||||
#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
|
||||
#define NSAlternateKeyMask NSEventModifierFlagOption
|
||||
#define NSControlKeyMask NSEventModifierFlagControl
|
||||
#define NSNumericPadKeyMask NSEventModifierFlagNumericPad
|
||||
#define NSFunctionKeyMask NSEventModifierFlagFunction
|
||||
#define NSCursorUpdate NSEventTypeCursorUpdate
|
||||
#define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground
|
||||
#define NSCompositeCopy NSCompositingOperationCopy
|
||||
#define NSWarningAlertStyle NSAlertStyleWarning
|
||||
#define NSInformationalAlertStyle NSAlertStyleInformational
|
||||
#define NSCriticalAlertStyle NSAlertStyleCritical
|
||||
#define NSCenterTextAlignment NSTextAlignmentCenter
|
||||
#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
|
||||
#define NSCommandKeyMask NSEventModifierFlagCommand
|
||||
#define NSShiftKeyMask NSEventModifierFlagShift
|
||||
#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
|
||||
#define NSAlternateKeyMask NSEventModifierFlagOption
|
||||
#define NSControlKeyMask NSEventModifierFlagControl
|
||||
#define NSNumericPadKeyMask NSEventModifierFlagNumericPad
|
||||
#define NSFunctionKeyMask NSEventModifierFlagFunction
|
||||
#define NSKeyUp NSEventTypeKeyUp
|
||||
#define NSKeyDown NSEventTypeKeyDown
|
||||
#define NSFlagsChanged NSEventTypeFlagsChanged
|
||||
#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
|
||||
#define NSShiftKeyMask NSEventModifierFlagShift
|
||||
#define NSAnyEventMask NSEventMaskAny
|
||||
#define NSApplicationDefinedMask NSEventMaskApplicationDefined
|
||||
#define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground
|
||||
#define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow
|
||||
#define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel
|
||||
#define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow
|
||||
#define NSHUDWindowMask NSWindowStyleMaskHUDWindow
|
||||
#define NSTitledWindowMask NSWindowStyleMaskTitled
|
||||
#define NSClosableWindowMask NSWindowStyleMaskClosable
|
||||
#define NSResizableWindowMask NSWindowStyleMaskResizable
|
||||
#define NSUnifiedTitleAndToolbarWindowMask NSWindowStyleMaskUnifiedTitleAndToolbar
|
||||
#define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable
|
||||
#define NSBorderlessWindowMask NSWindowStyleMaskBorderless
|
||||
#define NSFullScreenWindowMask NSWindowStyleMaskFullScreen
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
|
||||
#define NSStringPboardType NSPasteboardTypeString
|
||||
#define NSOnState NSControlStateValueOn
|
||||
#define NSOffState NSControlStateValueOff
|
||||
// Now we are also changing names of methods!
|
||||
#define graphicsContextWithGraphicsPort graphicsContextWithCGContext
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user