98a7a5b9c96ffde2f95fabbe3f9899f3859fb014
[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 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 #if !PLATFORM(IOS)
46     INIT(AdvanceDefaultButtonPulseAnimation);
47 #endif
48     INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
49 #if !PLATFORM(IOS)
50     INIT(CGContextGetShouldSmoothFonts);
51 #endif
52     INIT(CGPatternCreateWithImageAndTransform);
53 #if !PLATFORM(IOS)
54     INIT(CGContextDrawsWithCorrectShadowOffsets);
55 #endif
56     INIT(CopyCONNECTProxyResponse);
57     INIT(CopyNSURLResponseStatusLine);
58     INIT(CopyNSURLResponseCertificateChain);
59 #if !PLATFORM(IOS)
60     INIT(DrawCapsLockIndicator);
61     INIT(DrawBezeledTextArea);
62     INIT(DrawFocusRing);
63     INIT(DrawFocusRingAtTime);
64     INIT(DrawCellFocusRingWithFrameAtTime);
65     INIT(DrawMediaUIPart);
66     INIT(DrawMediaSliderTrack);
67 #endif
68     INIT(GetHTTPRequestPriority);
69     INIT(GetNSURLResponseLastModifiedDate);
70     INIT(GetWebDefaultCFStringEncoding);
71 #if !PLATFORM(IOS)
72     INIT(SignedPublicKeyAndChallengeString);
73     INIT(GetWheelEventDeltas);
74     INIT(GetNSEventKeyChar);
75     INIT(HitTestMediaUIPart);
76 #endif
77     INIT(InitializeMaximumHTTPConnectionCountPerHost);
78 #if !PLATFORM(IOS)
79     INIT(MeasureMediaUIPart);
80     INIT(CreateMediaUIBackgroundView);
81     INIT(CreateMediaUIControl);
82     INIT(WindowSetAlpha);
83     INIT(WindowSetScaledFrame);
84     INIT(SetCGFontRenderingMode);
85 #endif
86     INIT(SetCONNECTProxyAuthorizationForStream);
87     INIT(SetCONNECTProxyForStream);
88 #if !PLATFORM(IOS)
89     INIT(SetDragImage);
90 #endif
91     INIT(SetHTTPRequestMaximumPriority);
92     INIT(SetHTTPRequestPriority);
93     INIT(SetHTTPRequestMinimumFastLanePriority);
94     INIT(HTTPRequestEnablePipelining);
95     INIT(SetNSURLRequestShouldContentSniff);
96     INIT(SetPatternPhaseInUserSpace);
97     INIT(CGContextIsPDFContext);
98     INIT(GetUserToBaseCTM);
99 #if ENABLE(VIDEO) && !PLATFORM(IOS)
100     INIT(QTIncludeOnlyModernMediaFileTypes);
101     INIT(QTMovieDisableComponent);
102     INIT(QTMovieMaxTimeLoaded);
103     INIT(QTMovieMaxTimeLoadedChangeNotification);
104     INIT(QTMovieMaxTimeSeekable);
105     INIT(QTMovieGetType);
106     INIT(QTMovieHasClosedCaptions);
107     INIT(QTMovieResolvedURL);
108     INIT(QTMovieSetShowClosedCaptions);
109     INIT(QTMovieSelectPreferredAlternates);
110     INIT(QTMovieViewSetDrawSynchronously);
111     INIT(QTGetSitesInMediaDownloadCache);
112     INIT(QTClearMediaDownloadCacheForSite);
113     INIT(QTClearMediaDownloadCache);
114 #endif
115
116 #if PLATFORM(IOS)
117     INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
118     INIT(GetDeviceClass);
119     INIT(GetScreenSize);
120     INIT(GetAvailableScreenSize);
121     INIT(GetScreenScaleFactor);
122     INIT(IsGB18030ComplianceRequired);
123     INIT(IsOptimizedFullscreenSupported);
124 #endif
125
126 #if !PLATFORM(IOS)
127     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
128     INIT(CopyDefaultSearchProviderDisplayName);
129     INIT(Cursor);
130 #endif
131
132 #if USE(CFNETWORK)
133     INIT(GetDefaultHTTPCookieStorage);
134     INIT(CopyCredentialFromCFPersistentStorage);
135     INIT(SetCFURLRequestShouldContentSniff);
136     INIT(SetRequestStorageSession);
137 #endif
138
139 #if !PLATFORM(IOS)
140     INIT(SpeechSynthesisGetVoiceIdentifiers);
141     INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
142     INIT(GetAXTextMarkerTypeID);
143     INIT(GetAXTextMarkerRangeTypeID);
144     INIT(CreateAXTextMarker);
145     INIT(GetBytesFromAXTextMarker);
146     INIT(CreateAXTextMarkerRange);
147     INIT(CopyAXTextMarkerRangeStart);
148     INIT(CopyAXTextMarkerRangeEnd);
149     INIT(AccessibilityHandleFocusChanged);
150     INIT(CreateAXUIElementRef);
151     INIT(UnregisterUniqueIdForElement);
152 #endif
153     INIT(CreatePrivateStorageSession);
154     INIT(CopyRequestWithStorageSession);
155     INIT(CopyHTTPCookieStorage);
156     INIT(GetHTTPCookieAcceptPolicy);
157     INIT(HTTPCookies);
158     INIT(HTTPCookiesForURL);
159     INIT(SetHTTPCookiesForURL);
160     INIT(DeleteAllHTTPCookies);
161     INIT(DeleteHTTPCookie);
162
163     INIT(GetCFURLResponseMIMEType);
164     INIT(GetCFURLResponseURL);
165     INIT(GetCFURLResponseHTTPResponse);
166     INIT(CopyCFURLResponseSuggestedFilename);
167     INIT(SetCFURLResponseMIMEType);
168
169 #if !PLATFORM(IOS)
170     INIT(SetMetadataURL);
171 #endif
172
173     INIT(CFURLRequestAllowAllPostCaching);
174
175 #if PLATFORM(IOS)
176     INIT(GetUserAgent);
177     INIT(GetDeviceName);
178     INIT(GetOSNameForUserAgent);
179     INIT(GetPlatformNameForNavigator);
180     INIT(GetVendorNameForNavigator);
181 #endif
182
183 #if !PLATFORM(IOS)
184     INIT(NSElasticDeltaForTimeDelta);
185     INIT(NSElasticDeltaForReboundDelta);
186     INIT(NSReboundDeltaForElasticDelta);
187 #endif
188
189 #if ENABLE(PUBLIC_SUFFIX_LIST)
190     INIT(IsPublicSuffix);
191 #endif
192
193 #if ENABLE(CACHE_PARTITIONING)
194     INIT(CachePartitionKey);
195 #endif
196
197     INIT(ExernalDeviceTypeForPlayer);
198     INIT(ExernalDeviceDisplayNameForPlayer);
199
200     INIT(QueryDecoderAvailability);
201
202     didInit = true;
203 }