7f8e7d021867b16855b447945c6ad329c7ceb0b4
[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 < 101200
32
33 #import <AppKit/AppKit.h>
34
35 static const NSAlertStyle NSAlertStyleCritical = NSCriticalAlertStyle;
36 static const NSAlertStyle NSAlertStyleInformational = NSInformationalAlertStyle;
37 static const NSAlertStyle NSAlertStyleWarning = NSWarningAlertStyle;
38
39 typedef NSInteger NSControlStateValue;
40 static const NSControlStateValue NSControlStateValueMixed = NSMixedState;
41 static const NSControlStateValue NSControlStateValueOff = NSOffState;
42 static const NSControlStateValue NSControlStateValueOn = NSOnState;
43
44 static const NSBezelStyle NSBezelStyleShadowlessSquare = NSShadowlessSquareBezelStyle;
45 static const NSBezelStyle NSBezelStyleRounded = NSRoundedBezelStyle;
46 static const NSBezelStyle NSBezelStyleRoundedDisclosure = NSRoundedDisclosureBezelStyle;
47
48 static const NSLevelIndicatorStyle NSLevelIndicatorStyleRelevancy = NSRelevancyLevelIndicatorStyle;
49 static const NSLevelIndicatorStyle NSLevelIndicatorStyleContinuousCapacity = NSContinuousCapacityLevelIndicatorStyle;
50 static const NSLevelIndicatorStyle NSLevelIndicatorStyleDiscreteCapacity = NSDiscreteCapacityLevelIndicatorStyle;
51 static const NSLevelIndicatorStyle NSLevelIndicatorStyleRating = NSRatingLevelIndicatorStyle;
52
53 static const NSButtonType NSButtonTypeMomentaryLight = NSMomentaryLightButton;
54 static const NSButtonType NSButtonTypePushOnPushOff = NSPushOnPushOffButton;
55 static const NSButtonType NSButtonTypeToggle = NSToggleButton;
56 static const NSButtonType NSButtonTypeSwitch = NSSwitchButton;
57 static const NSButtonType NSButtonTypeRadio = NSRadioButton;
58 static const NSButtonType NSButtonTypeMomentaryChange = NSMomentaryChangeButton;
59 static const NSButtonType NSButtonTypeOnOff = NSOnOffButton;
60 static const NSButtonType NSButtonTypeMomentaryPushIn = NSMomentaryPushInButton;
61 static const NSButtonType NSButtonTypeAccelerator = NSAcceleratorButton;
62 static const NSButtonType NSButtonTypeMultiLevelAccelerator = NSMultiLevelAcceleratorButton;
63
64 static const NSCompositingOperation NSCompositingOperationCopy = NSCompositeCopy;
65 static const NSCompositingOperation NSCompositingOperationDestinationIn = NSCompositeDestinationIn;
66 static const NSCompositingOperation NSCompositingOperationDestinationOut =  NSCompositeDestinationOut;
67 static const NSCompositingOperation NSCompositingOperationDestinationOver = NSCompositeDestinationOver;
68 static const NSCompositingOperation NSCompositingOperationSourceAtop = NSCompositeSourceAtop;
69 static const NSCompositingOperation NSCompositingOperationSourceIn = NSCompositeSourceIn;
70 static const NSCompositingOperation NSCompositingOperationSourceOver = NSCompositeSourceOver;
71
72 static const NSControlSize NSControlSizeRegular = NSRegularControlSize;
73 static const NSControlSize NSControlSizeSmall = NSSmallControlSize;
74 static const NSControlSize NSControlSizeMini = NSMiniControlSize;
75
76 static const NSSliderType NSSliderTypeLinear = NSLinearSlider;
77 static const NSSliderType NSSliderTypeCircular = NSCircularSlider;
78
79 static const NSEventMask NSEventMaskAny = NSAnyEventMask;
80 static const NSEventMask NSEventMaskFlagsChanged = NSFlagsChangedMask;
81 static const NSEventMask NSEventMaskKeyDown = NSKeyDownMask;
82 static const NSEventMask NSEventMaskKeyUp = NSKeyUpMask;
83 static const NSEventMask NSEventMaskLeftMouseDown = NSLeftMouseDownMask;
84 static const NSEventMask NSEventMaskLeftMouseDragged = NSLeftMouseDraggedMask;
85 static const NSEventMask NSEventMaskLeftMouseUp = NSLeftMouseUpMask;
86 static const NSEventMask NSEventMaskOtherMouseDown = NSOtherMouseDownMask;
87 static const NSEventMask NSEventMaskOtherMouseUp = NSOtherMouseUpMask;
88 static const NSEventMask NSEventMaskPeriodic = NSPeriodicMask;
89 static const NSEventMask NSEventMaskRightMouseDown = NSRightMouseDownMask;
90 static const NSEventMask NSEventMaskRightMouseUp = NSRightMouseUpMask;
91 static const NSEventMask NSEventMaskMouseMoved = NSMouseMovedMask;
92 static const NSEventMask NSEventMaskScrollWheel = NSScrollWheelMask;
93
94 static const NSEventModifierFlags NSEventModifierFlagOption = NSAlternateKeyMask;
95 static const NSEventModifierFlags NSEventModifierFlagControl = NSControlKeyMask;
96 static const NSEventModifierFlags NSEventModifierFlagCapsLock = NSAlphaShiftKeyMask;
97 static const NSEventModifierFlags NSEventModifierFlagCommand =  NSCommandKeyMask;
98 static const NSEventModifierFlags NSEventModifierFlagDeviceIndependentFlagsMask =  NSDeviceIndependentModifierFlagsMask;
99 static const NSEventModifierFlags NSEventModifierFlagFunction = NSFunctionKeyMask;
100 static const NSEventModifierFlags NSEventModifierFlagNumericPad = NSNumericPadKeyMask;
101 static const NSEventModifierFlags NSEventModifierFlagShift = NSShiftKeyMask;
102 static const NSEventModifierFlags NSEventModifierFlagHelp = NSHelpKeyMask;
103
104 static const NSEventType NSEventTypeApplicationDefined = NSApplicationDefined;
105 static const NSEventType NSEventTypeFlagsChanged = NSFlagsChanged;
106 static const NSEventType NSEventTypeKeyDown = NSKeyDown;
107 static const NSEventType NSEventTypeKeyUp = NSKeyUp;
108 static const NSEventType NSEventTypeLeftMouseDown = NSLeftMouseDown;
109 static const NSEventType NSEventTypeLeftMouseDragged = NSLeftMouseDragged;
110 static const NSEventType NSEventTypeLeftMouseUp = NSLeftMouseUp;
111 static const NSEventType NSEventTypeMouseEntered = NSMouseEntered;
112 static const NSEventType NSEventTypeMouseExited = NSMouseExited;
113 static const NSEventType NSEventTypeMouseMoved = NSMouseMoved;
114 static const NSEventType NSEventTypeOtherMouseDown = NSOtherMouseDown;
115 static const NSEventType NSEventTypeOtherMouseDragged = NSOtherMouseDragged;
116 static const NSEventType NSEventTypeOtherMouseUp = NSOtherMouseUp;
117 static const NSEventType NSEventTypePeriodic = NSPeriodic;
118 static const NSEventType NSEventTypeRightMouseDown = NSRightMouseDown;
119 static const NSEventType NSEventTypeRightMouseDragged = NSRightMouseDragged;
120 static const NSEventType NSEventTypeRightMouseUp = NSRightMouseUp;
121 static const NSEventType NSEventTypeScrollWheel = NSScrollWheel;
122 static const NSEventType NSEventTypeSystemDefined = NSSystemDefined;
123
124 typedef NSUInteger NSWindowStyleMask;
125 static const NSWindowStyleMask NSWindowStyleMaskBorderless = NSBorderlessWindowMask;
126 static const NSWindowStyleMask NSWindowStyleMaskClosable = NSClosableWindowMask;
127 static const NSWindowStyleMask NSWindowStyleMaskFullScreen = NSFullScreenWindowMask;
128 static const NSWindowStyleMask NSWindowStyleMaskFullSizeContentView = NSFullSizeContentViewWindowMask;
129 static const NSWindowStyleMask NSWindowStyleMaskHUDWindow = NSHUDWindowMask;
130 static const NSWindowStyleMask NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask;
131 static const NSWindowStyleMask NSWindowStyleMaskNonactivatingPanel = NSNonactivatingPanelMask;
132 static const NSWindowStyleMask NSWindowStyleMaskResizable = NSResizableWindowMask;
133 static const NSWindowStyleMask NSWindowStyleMaskTexturedBackground = NSTexturedBackgroundWindowMask;
134 static const NSWindowStyleMask NSWindowStyleMaskTitled = NSTitledWindowMask;
135 static const NSWindowStyleMask NSWindowStyleMaskUtilityWindow = NSUtilityWindowMask;
136
137 #endif
138
139 #endif // AppKitCompatibilityDeclarations_h