Unreviewed build fix for chromium mac after r138206.
[WebKit-https.git] / Source / WebKit / mac / WebCoreSupport / WebSystemInterface.mm
1 /*
2  * Copyright 2006, 2007, 2008, 2009, 2010, 2011 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  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer. 
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution. 
13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission. 
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #import "WebSystemInterface.h"
30
31 // Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753.
32 #include <wtf/Platform.h>
33
34 #import <WebCore/WebCoreSystemInterface.h>
35 #import <WebKitSystemInterface.h>
36
37 #define INIT(function) wk##function = WK##function
38
39 void InitWebCoreSystemInterface(void)
40 {
41     static bool didInit;
42     if (didInit)
43         return;
44
45     INIT(AdvanceDefaultButtonPulseAnimation);
46 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
47     INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
48 #endif
49     INIT(CGContextGetShouldSmoothFonts);
50     INIT(CGPatternCreateWithImageAndTransform);
51     INIT(CGContextResetClip);
52 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
53     INIT(CGContextDrawsWithCorrectShadowOffsets);
54 #endif
55 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
56     INIT(CTFontTransformGlyphs);
57 #endif
58     INIT(CopyCFLocalizationPreferredName);
59     INIT(CopyCONNECTProxyResponse);
60     INIT(CopyNSURLResponseStatusLine);
61 #if PLATFORM(MAC)
62     INIT(CopyNSURLResponseCertificateChain);
63 #endif
64     INIT(CreateCustomCFReadStream);
65     INIT(CreateNSURLConnectionDelegateProxy);
66     INIT(DrawCapsLockIndicator);
67     INIT(DrawBezeledTextArea);
68     INIT(DrawBezeledTextFieldCell);
69     INIT(DrawFocusRing);
70     INIT(DrawMediaUIPart);
71     INIT(DrawMediaSliderTrack);
72     INIT(DrawTextFieldCellFocusRing);
73     INIT(GetExtensionsForMIMEType);
74     INIT(GetFontInLanguageForCharacter);
75     INIT(GetFontInLanguageForRange);
76     INIT(GetGlyphTransformedAdvances);
77     INIT(GetHTTPPipeliningPriority);
78     INIT(GetMIMETypeForExtension);
79     INIT(GetNSURLResponseLastModifiedDate);
80     INIT(SignedPublicKeyAndChallengeString);
81     INIT(GetPreferredExtensionForMIMEType);
82     INIT(GetWheelEventDeltas);
83 #if PLATFORM(MAC)
84     INIT(GetNSEventKeyChar);
85 #endif
86     INIT(HitTestMediaUIPart);
87     INIT(InitializeMaximumHTTPConnectionCountPerHost);
88     INIT(MeasureMediaUIPart);
89     INIT(CreateMediaUIBackgroundView);
90     INIT(CreateMediaUIControl);
91     INIT(WindowSetAlpha);
92     INIT(WindowSetScaledFrame);
93     INIT(MediaControllerThemeAvailable);
94     INIT(PopupMenu);
95     INIT(SetBaseCTM);
96     INIT(SetCGFontRenderingMode);
97     INIT(SetCONNECTProxyAuthorizationForStream);
98     INIT(SetCONNECTProxyForStream);
99     INIT(SetDragImage);
100     INIT(SetHTTPPipeliningMaximumPriority);
101     INIT(SetHTTPPipeliningPriority);
102     INIT(SetHTTPPipeliningMinimumFastLanePriority);
103     INIT(SetNSURLConnectionDefersCallbacks);
104     INIT(SetNSURLRequestShouldContentSniff);
105     INIT(SetPatternPhaseInUserSpace);
106     INIT(GetUserToBaseCTM);
107     INIT(SetUpFontCache);
108     INIT(SignalCFReadStreamEnd);
109     INIT(SignalCFReadStreamError);
110     INIT(SignalCFReadStreamHasBytes);
111     INIT(QTIncludeOnlyModernMediaFileTypes);
112     INIT(QTMovieDataRate);
113     INIT(QTMovieDisableComponent);
114     INIT(QTMovieMaxTimeLoaded);
115     INIT(QTMovieMaxTimeLoadedChangeNotification);
116     INIT(QTMovieMaxTimeSeekable);
117     INIT(QTMovieGetType);
118     INIT(QTMovieHasClosedCaptions);
119     INIT(QTMovieResolvedURL);
120     INIT(QTMovieSetShowClosedCaptions);
121     INIT(QTMovieSelectPreferredAlternates);
122     INIT(QTMovieViewSetDrawSynchronously);
123     INIT(QTGetSitesInMediaDownloadCache);
124     INIT(QTClearMediaDownloadCacheForSite);
125     INIT(QTClearMediaDownloadCache);
126
127     INIT(GetGlyphsForCharacters);
128     INIT(GetVerticalGlyphsForCharacters);
129
130 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
131     INIT(GetHyphenationLocationBeforeIndex);
132     INIT(GetNSEventMomentumPhase);
133 #endif
134
135     INIT(CreateCTLineWithUniCharProvider);
136
137 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
138     INIT(IOSurfaceContextCreate);
139     INIT(IOSurfaceContextCreateImage);
140     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
141     INIT(RecommendedScrollerStyle);
142     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
143     INIT(SetCrashReportApplicationSpecificInformation);
144     INIT(CopyDefaultSearchProviderDisplayName);
145     INIT(AVAssetResolvedURL);
146     INIT(Cursor);
147 #endif
148 #if USE(CFNETWORK)
149     INIT(GetDefaultHTTPCookieStorage);
150     INIT(CopyCredentialFromCFPersistentStorage);
151     INIT(SetCFURLRequestShouldContentSniff);
152     INIT(CFURLRequestCopyHTTPRequestBodyParts);
153     INIT(CFURLRequestSetHTTPRequestBodyParts);
154     INIT(SetRequestStorageSession);
155 #endif
156
157     INIT(GetAXTextMarkerTypeID);
158     INIT(GetAXTextMarkerRangeTypeID);
159     INIT(CreateAXTextMarker);
160     INIT(GetBytesFromAXTextMarker);
161     INIT(CreateAXTextMarkerRange);
162     INIT(CopyAXTextMarkerRangeStart);
163     INIT(CopyAXTextMarkerRangeEnd);
164     INIT(AccessibilityHandleFocusChanged);
165     INIT(CreateAXUIElementRef);
166     INIT(UnregisterUniqueIdForElement);
167     INIT(CreatePrivateStorageSession);
168     INIT(CopyRequestWithStorageSession);
169     INIT(CopyHTTPCookieStorage);
170     INIT(GetHTTPCookieAcceptPolicy);
171 #if PLATFORM(MAC)
172     INIT(HTTPCookies);
173 #endif
174     INIT(HTTPCookiesForURL);
175     INIT(SetHTTPCookiesForURL);
176 #if PLATFORM(MAC)
177     INIT(DeleteAllHTTPCookies);
178 #endif
179     INIT(DeleteHTTPCookie);
180
181     INIT(GetCFURLResponseMIMEType);
182     INIT(GetCFURLResponseURL);
183     INIT(GetCFURLResponseHTTPResponse);
184     INIT(CopyCFURLResponseSuggestedFilename);
185     INIT(SetCFURLResponseMIMEType);
186
187     INIT(SetMetadataURL);
188
189 #if PLATFORM(MAC)
190     // FIXME: We should stop using this file in Chromium.
191
192 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
193     INIT(CreateVMPressureDispatchOnMainQueue);
194 #endif
195
196 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
197     INIT(GetMacOSXVersionString);
198     INIT(ExecutableWasLinkedOnOrBeforeLion);
199 #endif
200
201 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
202     INIT(CGPathAddRoundedRect);
203 #endif
204
205 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
206     INIT(CFURLRequestAllowAllPostCaching);
207 #endif
208
209 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !PLATFORM(IOS)
210     INIT(FilterIsManagedSession);
211     INIT(FilterCreateInstance);
212     INIT(FilterRelease);
213     INIT(FilterWasBlocked);
214     INIT(FilterAddData);
215     INIT(FilterDataComplete);
216
217     INIT(NSElasticDeltaForTimeDelta);
218     INIT(NSElasticDeltaForReboundDelta);
219     INIT(NSReboundDeltaForElasticDelta);
220 #endif
221
222     INIT(CaptionAppearanceHasUserPreferences);
223     INIT(CaptionAppearanceShowCaptionsWhenAvailable);
224     INIT(CaptionAppearanceCopyForegroundColor);
225     INIT(CaptionAppearanceCopyBackgroundColor);
226     INIT(CaptionAppearanceCopyWindowColor);
227     INIT(CaptionAppearanceGetForegroundOpacity);
228     INIT(CaptionAppearanceGetBackgroundOpacity);
229     INIT(CaptionAppearanceGetWindowOpacity);
230     INIT(CaptionAppearanceCopyFontForStyle);
231     INIT(CaptionAppearanceGetRelativeCharacterSize);
232     INIT(CaptionAppearanceGetTextEdgeStyle);
233     INIT(CaptionAppearanceGetSettingsChangedNotification);
234
235 #endif
236     didInit = true;
237 }