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 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
39void InitWebCoreSystemInterface(void)
40{
41    static bool didInit;
42    if (didInit)
43        return;
44
45#if !PLATFORM(IOS)
46    INIT(AdvanceDefaultButtonPulseAnimation);
47#endif
48    INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
49#if !PLATFORM(IOS)
50    INIT(CGContextGetShouldSmoothFonts);
51#endif
52    INIT(CGPatternCreateWithImageAndTransform);
53    INIT(CGContextResetClip);
54#if !PLATFORM(IOS)
55    INIT(CGContextDrawsWithCorrectShadowOffsets);
56#endif
57#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
58    INIT(CTFontTransformGlyphs);
59#endif
60    INIT(CopyCFLocalizationPreferredName);
61    INIT(CopyCONNECTProxyResponse);
62    INIT(CopyNSURLResponseStatusLine);
63    INIT(CopyNSURLResponseCertificateChain);
64    INIT(CreateCustomCFReadStream);
65#if !PLATFORM(IOS)
66    INIT(DrawCapsLockIndicator);
67    INIT(DrawBezeledTextArea);
68    INIT(DrawBezeledTextFieldCell);
69    INIT(DrawFocusRing);
70    INIT(DrawFocusRingAtTime);
71    INIT(DrawCellFocusRingWithFrameAtTime);
72    INIT(DrawMediaUIPart);
73    INIT(DrawMediaSliderTrack);
74    INIT(DrawTextFieldCellFocusRing);
75    INIT(GetExtensionsForMIMEType);
76    INIT(GetFontInLanguageForCharacter);
77    INIT(GetFontInLanguageForRange);
78    INIT(GetGlyphTransformedAdvances);
79#endif
80    INIT(GetHTTPRequestPriority);
81    INIT(GetMIMETypeForExtension);
82    INIT(GetNSURLResponseLastModifiedDate);
83    INIT(GetWebDefaultCFStringEncoding);
84#if !PLATFORM(IOS)
85    INIT(SignedPublicKeyAndChallengeString);
86    INIT(GetPreferredExtensionForMIMEType);
87    INIT(GetWheelEventDeltas);
88    INIT(GetNSEventKeyChar);
89    INIT(HitTestMediaUIPart);
90#endif
91    INIT(InitializeMaximumHTTPConnectionCountPerHost);
92#if !PLATFORM(IOS)
93    INIT(MeasureMediaUIPart);
94    INIT(CreateMediaUIBackgroundView);
95    INIT(CreateMediaUIControl);
96    INIT(WindowSetAlpha);
97    INIT(WindowSetScaledFrame);
98    INIT(PopupMenu);
99    INIT(PopupMenuWithSize);
100    INIT(SetCGFontRenderingMode);
101#endif
102    INIT(SetBaseCTM);
103    INIT(SetCONNECTProxyAuthorizationForStream);
104    INIT(SetCONNECTProxyForStream);
105#if !PLATFORM(IOS)
106    INIT(SetDragImage);
107#endif
108    INIT(SetHTTPRequestMaximumPriority);
109    INIT(SetHTTPRequestPriority);
110    INIT(SetHTTPRequestMinimumFastLanePriority);
111    INIT(HTTPRequestEnablePipelining);
112    INIT(SetNSURLConnectionDefersCallbacks);
113    INIT(SetNSURLRequestShouldContentSniff);
114    INIT(SetPatternPhaseInUserSpace);
115    INIT(CGContextIsPDFContext);
116    INIT(GetUserToBaseCTM);
117    INIT(SetUpFontCache);
118    INIT(SignalCFReadStreamEnd);
119    INIT(SignalCFReadStreamError);
120    INIT(SignalCFReadStreamHasBytes);
121#if ENABLE(VIDEO) && !PLATFORM(IOS)
122    INIT(QTIncludeOnlyModernMediaFileTypes);
123    INIT(QTMovieDataRate);
124    INIT(QTMovieDisableComponent);
125    INIT(QTMovieMaxTimeLoaded);
126    INIT(QTMovieMaxTimeLoadedChangeNotification);
127    INIT(QTMovieMaxTimeSeekable);
128    INIT(QTMovieGetType);
129    INIT(QTMovieHasClosedCaptions);
130    INIT(QTMovieResolvedURL);
131    INIT(QTMovieSetShowClosedCaptions);
132    INIT(QTMovieSelectPreferredAlternates);
133    INIT(QTMovieViewSetDrawSynchronously);
134    INIT(QTGetSitesInMediaDownloadCache);
135    INIT(QTClearMediaDownloadCacheForSite);
136    INIT(QTClearMediaDownloadCache);
137#endif
138
139#if !PLATFORM(IOS)
140    INIT(GetGlyphsForCharacters);
141#endif
142    INIT(GetVerticalGlyphsForCharacters);
143#if PLATFORM(IOS)
144    INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
145    INIT(GetDeviceClass);
146    INIT(GetScreenSize);
147    INIT(GetAvailableScreenSize);
148    INIT(GetScreenScaleFactor);
149    INIT(IsGB18030ComplianceRequired);
150#endif
151
152    INIT(CreateCTLineWithUniCharProvider);
153
154#if !PLATFORM(IOS_SIMULATOR)
155    INIT(IOSurfaceContextCreate);
156    INIT(IOSurfaceContextCreateImage);
157#endif
158    INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
159    INIT(CTRunGetInitialAdvance);
160#if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR)
161    INIT(SetCrashReportApplicationSpecificInformation);
162#endif
163#if !PLATFORM(IOS)
164    INIT(RecommendedScrollerStyle);
165    INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
166    INIT(CopyDefaultSearchProviderDisplayName);
167    INIT(Cursor);
168#endif
169
170#if USE(CFNETWORK)
171    INIT(GetDefaultHTTPCookieStorage);
172    INIT(CopyCredentialFromCFPersistentStorage);
173    INIT(SetCFURLRequestShouldContentSniff);
174    INIT(SetRequestStorageSession);
175#endif
176
177#if !PLATFORM(IOS)
178    INIT(SpeechSynthesisGetVoiceIdentifiers);
179    INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
180    INIT(GetAXTextMarkerTypeID);
181    INIT(GetAXTextMarkerRangeTypeID);
182    INIT(CreateAXTextMarker);
183    INIT(GetBytesFromAXTextMarker);
184    INIT(CreateAXTextMarkerRange);
185    INIT(CopyAXTextMarkerRangeStart);
186    INIT(CopyAXTextMarkerRangeEnd);
187    INIT(AccessibilityHandleFocusChanged);
188    INIT(CreateAXUIElementRef);
189    INIT(UnregisterUniqueIdForElement);
190#endif
191    INIT(CreatePrivateStorageSession);
192    INIT(CopyRequestWithStorageSession);
193    INIT(CopyHTTPCookieStorage);
194    INIT(GetHTTPCookieAcceptPolicy);
195    INIT(HTTPCookies);
196    INIT(HTTPCookiesForURL);
197    INIT(SetHTTPCookiesForURL);
198    INIT(DeleteAllHTTPCookies);
199    INIT(DeleteHTTPCookie);
200
201    INIT(GetCFURLResponseMIMEType);
202    INIT(GetCFURLResponseURL);
203    INIT(GetCFURLResponseHTTPResponse);
204    INIT(CopyCFURLResponseSuggestedFilename);
205    INIT(SetCFURLResponseMIMEType);
206
207#if !PLATFORM(IOS)
208    INIT(SetMetadataURL);
209#endif
210
211    INIT(DestroyRenderingResources);
212
213#if !PLATFORM(IOS)
214    INIT(CreateVMPressureDispatchOnMainQueue);
215
216#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
217    INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
218#endif
219
220    INIT(ExecutableWasLinkedOnOrBeforeLion);
221#endif
222
223    INIT(CGPathAddRoundedRect);
224
225    INIT(CFURLRequestAllowAllPostCaching);
226
227#if PLATFORM(IOS)
228    INIT(GetUserAgent);
229    INIT(GetDeviceName);
230    INIT(GetOSNameForUserAgent);
231    INIT(GetPlatformNameForNavigator);
232    INIT(GetVendorNameForNavigator);
233#endif
234
235#if !PLATFORM(IOS)
236    INIT(NSElasticDeltaForTimeDelta);
237    INIT(NSElasticDeltaForReboundDelta);
238    INIT(NSReboundDeltaForElasticDelta);
239#endif
240
241#if ENABLE(PUBLIC_SUFFIX_LIST)
242    INIT(IsPublicSuffix);
243#endif
244
245#if ENABLE(CACHE_PARTITIONING)
246    INIT(CachePartitionKey);
247#endif
248
249    INIT(ExernalDeviceTypeForPlayer);
250    INIT(ExernalDeviceDisplayNameForPlayer);
251
252    INIT(QueryDecoderAvailability);
253
254    didInit = true;
255}
256