comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tkMacOSXConstants.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 /*
2 * tkMacOSXConstants.h --
3 *
4 * Macros which map the names of NS constants used in the Tk code to
5 * the new name that Apple came up with for subsequent versions of the
6 * operating system. (Each new OS release seems to come with a new
7 * naming convention for the same old constants.)
8 *
9 * Copyright (c) 2017 Marc Culler
10 *
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 */
14
15 #ifndef _TKMACCONSTANTS
16 #define _TKMACCONSTANTS
17
18 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
19 #define NSFullScreenWindowMask (1 << 14)
20 #endif
21
22 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1090
23 typedef NSInteger NSModalResponse;
24 #endif
25
26 /*
27 * Let's raise a glass for the project manager who improves our lives by
28 * generating deprecation warnings about pointless changes of the names
29 * of constants.
30 */
31
32 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
33 #define kCTFontDefaultOrientation kCTFontOrientationDefault
34 #define kCTFontVerticalOrientation kCTFontOrientationVertical
35 #endif
36
37 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
38 #define NSOKButton NSModalResponseOK
39 #endif
40
41 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
42 #define kCTFontUserFixedPitchFontType kCTFontUIFontUserFixedPitch
43 #endif
44
45 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
46 #define NSAppKitDefined NSEventTypeAppKitDefined
47 #define NSApplicationDefined NSEventTypeApplicationDefined
48 #define NSApplicationActivatedEventType NSEventSubtypeApplicationActivated
49 #define NSApplicationDeactivatedEventType NSEventSubtypeApplicationDeactivated
50 #define NSWindowExposedEventType NSEventSubtypeWindowExposed
51 #define NSScreenChangedEventType NSEventSubtypeScreenChanged
52 #define NSWindowMovedEventType NSEventSubtypeWindowMoved
53 #define NSKeyUp NSEventTypeKeyUp
54 #define NSKeyDown NSEventTypeKeyDown
55 #define NSFlagsChanged NSEventTypeFlagsChanged
56 #define NSLeftMouseDown NSEventTypeLeftMouseDown
57 #define NSLeftMouseUp NSEventTypeLeftMouseUp
58 #define NSRightMouseDown NSEventTypeRightMouseDown
59 #define NSRightMouseUp NSEventTypeRightMouseUp
60 #define NSLeftMouseDragged NSEventTypeLeftMouseDragged
61 #define NSRightMouseDragged NSEventTypeRightMouseDragged
62 #define NSMouseMoved NSEventTypeMouseMoved
63 #define NSMouseEntered NSEventTypeMouseEntered
64 #define NSMouseExited NSEventTypeMouseExited
65 #define NSScrollWheel NSEventTypeScrollWheel
66 #define NSOtherMouseDown NSEventTypeOtherMouseDown
67 #define NSOtherMouseUp NSEventTypeOtherMouseUp
68 #define NSOtherMouseDragged NSEventTypeOtherMouseDragged
69 #define NSTabletPoint NSEventTypeTabletPoint
70 #define NSTabletProximity NSEventTypeTabletProximity
71 #define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask
72 #define NSCommandKeyMask NSEventModifierFlagCommand
73 #define NSShiftKeyMask NSEventModifierFlagShift
74 #define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock
75 #define NSAlternateKeyMask NSEventModifierFlagOption
76 #define NSControlKeyMask NSEventModifierFlagControl
77 #define NSNumericPadKeyMask NSEventModifierFlagNumericPad
78 #define NSFunctionKeyMask NSEventModifierFlagFunction
79 #define NSCursorUpdate NSEventTypeCursorUpdate
80 #define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground
81 #define NSCompositeCopy NSCompositingOperationCopy
82 #define NSWarningAlertStyle NSAlertStyleWarning
83 #define NSInformationalAlertStyle NSAlertStyleInformational
84 #define NSCriticalAlertStyle NSAlertStyleCritical
85 #define NSCenterTextAlignment NSTextAlignmentCenter
86 #define NSApplicationDefinedMask NSEventMaskApplicationDefined
87 #define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow
88 #define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel
89 #define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow
90 #define NSHUDWindowMask NSWindowStyleMaskHUDWindow
91 #define NSTitledWindowMask NSWindowStyleMaskTitled
92 #define NSClosableWindowMask NSWindowStyleMaskClosable
93 #define NSResizableWindowMask NSWindowStyleMaskResizable
94 #define NSUnifiedTitleAndToolbarWindowMask NSWindowStyleMaskUnifiedTitleAndToolbar
95 #define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable
96 #define NSBorderlessWindowMask NSWindowStyleMaskBorderless
97 #define NSFullScreenWindowMask NSWindowStyleMaskFullScreen
98 #define NSAlphaFirstBitmapFormat NSBitmapFormatAlphaFirst
99 #define NSAnyEventMask NSEventMaskAny
100 #define NSLeftMouseDownMask NSEventMaskLeftMouseDown
101 #define NSMouseMovedMask NSEventMaskMouseMoved
102 #define NSLeftMouseDraggedMask NSEventMaskLeftMouseDragged
103 #endif
104
105 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
106 #define NSStringPboardType NSPasteboardTypeString
107 #define NSOnState NSControlStateValueOn
108 #define NSOffState NSControlStateValueOff
109 #endif
110
111 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
112 #define NSWindowStyleMaskTexturedBackground 0
113 #endif
114
115 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
116 #define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
117 graphicsContextWithGraphicsPort:context flipped:flip]
118 #else
119 #define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
120 graphicsContextWithCGContext:context flipped:NO]
121 #endif
122
123 #endif