Unreviewed, try to fix the Sierra build after r226277.
[WebKit-https.git] / Source / WTF / wtf / mac / AppKitCompatibilityDeclarations.h
1 /*
2  * Copyright (C) 2016 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef AppKitCompatibilityDeclarations_h
27 #define AppKitCompatibilityDeclarations_h
28
29 #import <Availability.h>
30
31 #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
32 #import <AppKit/AppKit.h>
33 #endif
34
35 #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
36
37 static const NSAlertStyle NSAlertStyleCritical = NSCriticalAlertStyle;
38 static const NSAlertStyle NSAlertStyleInformational = NSInformationalAlertStyle;
39 static const NSAlertStyle NSAlertStyleWarning = NSWarningAlertStyle;
40
41 static const NSBezelStyle NSBezelStyleShadowlessSquare = NSShadowlessSquareBezelStyle;
42 static const NSBezelStyle NSBezelStyleRounded = NSRoundedBezelStyle;
43 static const NSBezelStyle NSBezelStyleRoundedDisclosure = NSRoundedDisclosureBezelStyle;
44
45 static const NSButtonType NSButtonTypeMomentaryLight = NSMomentaryLightButton;
46 static const NSButtonType NSButtonTypePushOnPushOff = NSPushOnPushOffButton;
47 static const NSButtonType NSButtonTypeToggle = NSToggleButton;
48 static const NSButtonType NSButtonTypeSwitch = NSSwitchButton;
49 static const NSButtonType NSButtonTypeRadio = NSRadioButton;
50 static const NSButtonType NSButtonTypeMomentaryChange = NSMomentaryChangeButton;
51 static const NSButtonType NSButtonTypeOnOff = NSOnOffButton;
52 static const NSButtonType NSButtonTypeMomentaryPushIn = NSMomentaryPushInButton;
53 static const NSButtonType NSButtonTypeAccelerator = NSAcceleratorButton;
54 static const NSButtonType NSButtonTypeMultiLevelAccelerator = NSMultiLevelAcceleratorButton;
55
56 static const NSCompositingOperation NSCompositingOperationCopy = NSCompositeCopy;
57 static const NSCompositingOperation NSCompositingOperationDestinationIn = NSCompositeDestinationIn;
58 static const NSCompositingOperation NSCompositingOperationDestinationOut =  NSCompositeDestinationOut;
59 static const NSCompositingOperation NSCompositingOperationDestinationOver = NSCompositeDestinationOver;
60 static const NSCompositingOperation NSCompositingOperationSourceAtop = NSCompositeSourceAtop;
61 static const NSCompositingOperation NSCompositingOperationSourceIn = NSCompositeSourceIn;
62 static const NSCompositingOperation NSCompositingOperationSourceOver = NSCompositeSourceOver;
63
64 static const NSControlSize NSControlSizeRegular = NSRegularControlSize;
65 static const NSControlSize NSControlSizeSmall = NSSmallControlSize;
66 static const NSControlSize NSControlSizeMini = NSMiniControlSize;
67
68 static const NSSliderType NSSliderTypeLinear = NSLinearSlider;
69 static const NSSliderType NSSliderTypeCircular = NSCircularSlider;
70
71 static const NSEventMask NSEventMaskAny = NSAnyEventMask;
72 static const NSEventMask NSEventMaskFlagsChanged = NSFlagsChangedMask;
73 static const NSEventMask NSEventMaskKeyDown = NSKeyDownMask;
74 static const NSEventMask NSEventMaskKeyUp = NSKeyUpMask;
75 static const NSEventMask NSEventMaskLeftMouseDown = NSLeftMouseDownMask;
76 static const NSEventMask NSEventMaskLeftMouseDragged = NSLeftMouseDraggedMask;
77 static const NSEventMask NSEventMaskLeftMouseUp = NSLeftMouseUpMask;
78 static const NSEventMask NSEventMaskOtherMouseDown = NSOtherMouseDownMask;
79 static const NSEventMask NSEventMaskOtherMouseUp = NSOtherMouseUpMask;
80 static const NSEventMask NSEventMaskPeriodic = NSPeriodicMask;
81 static const NSEventMask NSEventMaskRightMouseDown = NSRightMouseDownMask;
82 static const NSEventMask NSEventMaskRightMouseUp = NSRightMouseUpMask;
83 static const NSEventMask NSEventMaskMouseMoved = NSMouseMovedMask;
84 static const NSEventMask NSEventMaskScrollWheel = NSScrollWheelMask;
85
86 static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask;
87 static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask;
88 static const NSEventModifierFlags NSEventModifierFlagCapsLock = NSAlphaShiftKeyMask;
89 static const NSEventModifierFlags NSEventModifierFlagCommand =  NSCommandKeyMask;
90 static const NSEventModifierFlags NSEventModifierFlagDeviceIndependentFlagsMask =  NSDeviceIndependentModifierFlagsMask;
91 static const NSEventModifierFlags NSEventModifierFlagFunction = NSFunctionKeyMask;
92 static const NSEventModifierFlags NSEventModifierFlagNumericPad = NSNumericPadKeyMask;
93 static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask;
94 static const NSEventModifierFlags NSEventModifierFlagHelp = NSHelpKeyMask;
95
96 static const NSEventType NSEventTypeApplicationDefined = NSApplicationDefined;
97 static const NSEventType NSEventTypeFlagsChanged = NSFlagsChanged;
98 static const NSEventType NSEventTypeKeyDown = NSKeyDown;
99 static const NSEventType NSEventTypeKeyUp = NSKeyUp;
100 static const NSEventType NSEventTypeLeftMouseDown = NSLeftMouseDown;
101 static const NSEventType NSEventTypeLeftMouseDragged = NSLeftMouseDragged;
102 static const NSEventType NSEventTypeLeftMouseUp = NSLeftMouseUp;
103 static const NSEventType NSEventTypeMouseEntered = NSMouseEntered;
104 static const NSEventType NSEventTypeMouseExited = NSMouseExited;
105 static const NSEventType NSEventTypeMouseMoved = NSMouseMoved;
106 static const NSEventType NSEventTypeOtherMouseDown = NSOtherMouseDown;
107 static const NSEventType NSEventTypeOtherMouseDragged = NSOtherMouseDragged;
108 static const NSEventType NSEventTypeOtherMouseUp = NSOtherMouseUp;
109 static const NSEventType NSEventTypePeriodic = NSPeriodic;
110 static const NSEventType NSEventTypeRightMouseDown = NSRightMouseDown;
111 static const NSEventType NSEventTypeRightMouseDragged = NSRightMouseDragged;
112 static const NSEventType NSEventTypeRightMouseUp = NSRightMouseUp;
113 static const NSEventType NSEventTypeScrollWheel = NSScrollWheel;
114 static const NSEventType NSEventTypeSystemDefined = NSSystemDefined;
115
116 typedef NSUInteger NSWindowStyleMask;
117 static const NSWindowStyleMask NSWindowStyleMaskBorderless = NSBorderlessWindowMask;
118 static const NSWindowStyleMask NSWindowStyleMaskClosable = NSClosableWindowMask;
119 static const NSWindowStyleMask NSWindowStyleMaskFullScreen = NSFullScreenWindowMask;
120 static const NSWindowStyleMask NSWindowStyleMaskFullSizeContentView = NSFullSizeContentViewWindowMask;
121 static const NSWindowStyleMask NSWindowStyleMaskHUDWindow = NSHUDWindowMask;
122 static const NSWindowStyleMask NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask;
123 static const NSWindowStyleMask NSWindowStyleMaskNonactivatingPanel = NSNonactivatingPanelMask;
124 static const NSWindowStyleMask NSWindowStyleMaskResizable = NSResizableWindowMask;
125 static const NSWindowStyleMask NSWindowStyleMaskTexturedBackground = NSTexturedBackgroundWindowMask;
126 static const NSWindowStyleMask NSWindowStyleMaskTitled = NSTitledWindowMask;
127 static const NSWindowStyleMask NSWindowStyleMaskUtilityWindow = NSUtilityWindowMask;
128
129 #endif // __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
130
131 #if __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
132
133 typedef NSInteger NSControlStateValue;
134 static const NSControlStateValue NSControlStateValueMixed = NSMixedState;
135 static const NSControlStateValue NSControlStateValueOff = NSOffState;
136 static const NSControlStateValue NSControlStateValueOn = NSOnState;
137
138 static const NSLevelIndicatorStyle NSLevelIndicatorStyleRelevancy = NSRelevancyLevelIndicatorStyle;
139 static const NSLevelIndicatorStyle NSLevelIndicatorStyleContinuousCapacity = NSContinuousCapacityLevelIndicatorStyle;
140 static const NSLevelIndicatorStyle NSLevelIndicatorStyleDiscreteCapacity = NSDiscreteCapacityLevelIndicatorStyle;
141 static const NSLevelIndicatorStyle NSLevelIndicatorStyleRating = NSRatingLevelIndicatorStyle;
142
143 #endif // __MAC_OS_X_VERSION_MAX_ALLOWED < 101300
144
145 #endif // AppKitCompatibilityDeclarations_h