485e6560e3ea7e642df9c95c18f8b948c60b19ef
[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     INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
47     INIT(CGContextGetShouldSmoothFonts);
48     INIT(CGPatternCreateWithImageAndTransform);
49     INIT(CGContextResetClip);
50 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
51     INIT(CGContextDrawsWithCorrectShadowOffsets);
52 #endif
53 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
54     INIT(CTFontTransformGlyphs);
55 #endif
56     INIT(CopyCFLocalizationPreferredName);
57     INIT(CopyCONNECTProxyResponse);
58     INIT(CopyNSURLResponseStatusLine);
59 #if PLATFORM(MAC)
60     INIT(CopyNSURLResponseCertificateChain);
61 #endif
62     INIT(CreateCustomCFReadStream);
63     INIT(DrawCapsLockIndicator);
64     INIT(DrawBezeledTextArea);
65     INIT(DrawBezeledTextFieldCell);
66     INIT(DrawFocusRing);
67     INIT(DrawMediaUIPart);
68     INIT(DrawMediaSliderTrack);
69     INIT(DrawTextFieldCellFocusRing);
70     INIT(GetExtensionsForMIMEType);
71     INIT(GetFontInLanguageForCharacter);
72     INIT(GetFontInLanguageForRange);
73     INIT(GetGlyphTransformedAdvances);
74     INIT(GetHTTPPipeliningPriority);
75     INIT(GetMIMETypeForExtension);
76     INIT(GetNSURLResponseLastModifiedDate);
77     INIT(SignedPublicKeyAndChallengeString);
78     INIT(GetPreferredExtensionForMIMEType);
79     INIT(GetWheelEventDeltas);
80 #if PLATFORM(MAC)
81     INIT(GetNSEventKeyChar);
82 #endif
83     INIT(HitTestMediaUIPart);
84     INIT(InitializeMaximumHTTPConnectionCountPerHost);
85     INIT(MeasureMediaUIPart);
86     INIT(CreateMediaUIBackgroundView);
87     INIT(CreateMediaUIControl);
88     INIT(WindowSetAlpha);
89     INIT(WindowSetScaledFrame);
90     INIT(PopupMenu);
91     INIT(SetBaseCTM);
92     INIT(SetCGFontRenderingMode);
93     INIT(SetCONNECTProxyAuthorizationForStream);
94     INIT(SetCONNECTProxyForStream);
95     INIT(SetDragImage);
96     INIT(SetHTTPPipeliningMaximumPriority);
97     INIT(SetHTTPPipeliningPriority);
98     INIT(SetHTTPPipeliningMinimumFastLanePriority);
99     INIT(SetNSURLConnectionDefersCallbacks);
100     INIT(SetNSURLRequestShouldContentSniff);
101     INIT(SetPatternPhaseInUserSpace);
102     INIT(CGContextIsPDFContext);
103     INIT(GetUserToBaseCTM);
104     INIT(SetUpFontCache);
105     INIT(SignalCFReadStreamEnd);
106     INIT(SignalCFReadStreamError);
107     INIT(SignalCFReadStreamHasBytes);
108     INIT(QTIncludeOnlyModernMediaFileTypes);
109     INIT(QTMovieDataRate);
110     INIT(QTMovieDisableComponent);
111     INIT(QTMovieMaxTimeLoaded);
112     INIT(QTMovieMaxTimeLoadedChangeNotification);
113     INIT(QTMovieMaxTimeSeekable);
114     INIT(QTMovieGetType);
115     INIT(QTMovieHasClosedCaptions);
116     INIT(QTMovieResolvedURL);
117     INIT(QTMovieSetShowClosedCaptions);
118     INIT(QTMovieSelectPreferredAlternates);
119     INIT(QTMovieViewSetDrawSynchronously);
120     INIT(QTGetSitesInMediaDownloadCache);
121     INIT(QTClearMediaDownloadCacheForSite);
122     INIT(QTClearMediaDownloadCache);
123
124     INIT(GetGlyphsForCharacters);
125     INIT(GetVerticalGlyphsForCharacters);
126
127     INIT(CreateCTLineWithUniCharProvider);
128
129     INIT(IOSurfaceContextCreate);
130     INIT(IOSurfaceContextCreateImage);
131     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
132     INIT(CTRunGetInitialAdvance);
133     INIT(RecommendedScrollerStyle);
134     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
135     INIT(SetCrashReportApplicationSpecificInformation);
136     INIT(CopyDefaultSearchProviderDisplayName);
137     INIT(AVAssetResolvedURL);
138     INIT(Cursor);
139
140 #if USE(CFNETWORK)
141     INIT(GetDefaultHTTPCookieStorage);
142     INIT(CopyCredentialFromCFPersistentStorage);
143     INIT(SetCFURLRequestShouldContentSniff);
144     INIT(CFURLRequestCopyHTTPRequestBodyParts);
145     INIT(CFURLRequestSetHTTPRequestBodyParts);
146     INIT(SetRequestStorageSession);
147 #endif
148
149 #if PLATFORM(MAC)
150     INIT(SpeechSynthesisGetVoiceIdentifiers);
151     INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
152 #endif
153     INIT(GetAXTextMarkerTypeID);
154     INIT(GetAXTextMarkerRangeTypeID);
155     INIT(CreateAXTextMarker);
156     INIT(GetBytesFromAXTextMarker);
157     INIT(CreateAXTextMarkerRange);
158     INIT(CopyAXTextMarkerRangeStart);
159     INIT(CopyAXTextMarkerRangeEnd);
160     INIT(AccessibilityHandleFocusChanged);
161     INIT(CreateAXUIElementRef);
162     INIT(UnregisterUniqueIdForElement);
163     INIT(CreatePrivateStorageSession);
164     INIT(CopyRequestWithStorageSession);
165     INIT(CopyHTTPCookieStorage);
166     INIT(GetHTTPCookieAcceptPolicy);
167 #if PLATFORM(MAC)
168     INIT(HTTPCookies);
169 #endif
170     INIT(HTTPCookiesForURL);
171     INIT(SetHTTPCookiesForURL);
172 #if PLATFORM(MAC)
173     INIT(DeleteAllHTTPCookies);
174 #endif
175     INIT(DeleteHTTPCookie);
176
177     INIT(GetCFURLResponseMIMEType);
178     INIT(GetCFURLResponseURL);
179     INIT(GetCFURLResponseHTTPResponse);
180     INIT(CopyCFURLResponseSuggestedFilename);
181     INIT(SetCFURLResponseMIMEType);
182
183     INIT(SetMetadataURL);
184
185 #if PLATFORM(MAC)
186     // FIXME: We should stop using this file in Chromium.
187
188     INIT(DestroyRenderingResources);
189
190     INIT(CreateVMPressureDispatchOnMainQueue);
191
192 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
193     INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
194 #endif
195
196 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
197     INIT(ExecutableWasLinkedOnOrBeforeLion);
198 #endif
199
200     INIT(CGPathAddRoundedRect);
201
202     INIT(CFURLRequestAllowAllPostCaching);
203
204 #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
205     INIT(NSElasticDeltaForTimeDelta);
206     INIT(NSElasticDeltaForReboundDelta);
207     INIT(NSReboundDeltaForElasticDelta);
208 #endif
209
210 #if ENABLE(PUBLIC_SUFFIX_LIST)
211     INIT(IsPublicSuffix);
212 #endif
213
214 #if ENABLE(CACHE_PARTITIONING)
215     INIT(CachePartitionKey);
216 #endif
217
218 #endif
219     didInit = true;
220 }