OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / macosx / tkMacOSXConstants.h
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 NSAnyEventMask NSEventMaskAny
87 #define NSApplicationDefinedMask NSEventMaskApplicationDefined
88 #define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow
89 #define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel
90 #define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow
91 #define NSHUDWindowMask NSWindowStyleMaskHUDWindow
92 #define NSTitledWindowMask NSWindowStyleMaskTitled
93 #define NSClosableWindowMask NSWindowStyleMaskClosable
94 #define NSResizableWindowMask NSWindowStyleMaskResizable
95 #define NSUnifiedTitleAndToolbarWindowMask NSWindowStyleMaskUnifiedTitleAndToolbar
96 #define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable
97 #define NSBorderlessWindowMask NSWindowStyleMaskBorderless
98 #define NSFullScreenWindowMask NSWindowStyleMaskFullScreen
99 #endif
100
101 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
102 #define NSStringPboardType NSPasteboardTypeString
103 #define NSOnState NSControlStateValueOn
104 #define NSOffState NSControlStateValueOff
105 #endif
106
107 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
108 #define NSWindowStyleMaskTexturedBackground 0
109 #endif
110
111 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
112 #define GET_NSCONTEXT(context, flip) [NSGraphicsContext         \
113             graphicsContextWithGraphicsPort:context flipped:flip]
114 #else
115 #define GET_NSCONTEXT(context, flip) [NSGraphicsContext         \
116             graphicsContextWithCGContext:context flipped:NO]
117 #endif
118
119 #endif