Unreviewed, rolling out r191902.
[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(CGContextIsPDFContext);
97 #if ENABLE(VIDEO) && !PLATFORM(IOS)
98     INIT(QTIncludeOnlyModernMediaFileTypes);
99     INIT(QTMovieDisableComponent);
100     INIT(QTMovieMaxTimeLoaded);
101     INIT(QTMovieMaxTimeLoadedChangeNotification);
102     INIT(QTMovieMaxTimeSeekable);
103     INIT(QTMovieGetType);
104     INIT(QTMovieHasClosedCaptions);
105     INIT(QTMovieResolvedURL);
106     INIT(QTMovieSetShowClosedCaptions);
107     INIT(QTMovieSelectPreferredAlternates);
108     INIT(QTMovieViewSetDrawSynchronously);
109     INIT(QTGetSitesInMediaDownloadCache);
110     INIT(QTClearMediaDownloadCacheForSite);
111     INIT(QTClearMediaDownloadCache);
112 #endif
113
114 #if PLATFORM(IOS)
115     INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
116     INIT(GetDeviceClass);
117     INIT(GetScreenSize);
118     INIT(GetAvailableScreenSize);
119     INIT(GetScreenScaleFactor);
120     INIT(IsGB18030ComplianceRequired);
121     INIT(IsOptimizedFullscreenSupported);
122 #endif
123
124 #if !PLATFORM(IOS)
125     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
126     INIT(CopyDefaultSearchProviderDisplayName);
127     INIT(Cursor);
128 #endif
129
130 #if USE(CFNETWORK)
131     INIT(GetDefaultHTTPCookieStorage);
132     INIT(CopyCredentialFromCFPersistentStorage);
133     INIT(SetCFURLRequestShouldContentSniff);
134     INIT(SetRequestStorageSession);
135 #endif
136
137 #if !PLATFORM(IOS)
138     INIT(SpeechSynthesisGetVoiceIdentifiers);
139     INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
140     INIT(GetAXTextMarkerTypeID);
141     INIT(GetAXTextMarkerRangeTypeID);
142     INIT(CreateAXTextMarker);
143     INIT(GetBytesFromAXTextMarker);
144     INIT(CreateAXTextMarkerRange);
145     INIT(CopyAXTextMarkerRangeStart);
146     INIT(CopyAXTextMarkerRangeEnd);
147     INIT(AccessibilityHandleFocusChanged);
148     INIT(CreateAXUIElementRef);
149     INIT(UnregisterUniqueIdForElement);
150 #endif
151     INIT(CreatePrivateStorageSession);
152     INIT(CopyRequestWithStorageSession);
153     INIT(CopyHTTPCookieStorage);
154     INIT(GetHTTPCookieAcceptPolicy);
155     INIT(HTTPCookies);
156     INIT(HTTPCookiesForURL);
157     INIT(SetHTTPCookiesForURL);
158     INIT(DeleteAllHTTPCookies);
159     INIT(DeleteHTTPCookie);
160
161     INIT(GetCFURLResponseMIMEType);
162     INIT(GetCFURLResponseURL);
163     INIT(GetCFURLResponseHTTPResponse);
164     INIT(CopyCFURLResponseSuggestedFilename);
165     INIT(SetCFURLResponseMIMEType);
166
167 #if !PLATFORM(IOS)
168     INIT(SetMetadataURL);
169 #endif
170
171     INIT(CFURLRequestAllowAllPostCaching);
172
173 #if PLATFORM(IOS)
174     INIT(GetUserAgent);
175     INIT(GetDeviceName);
176     INIT(GetOSNameForUserAgent);
177     INIT(GetPlatformNameForNavigator);
178     INIT(GetVendorNameForNavigator);
179 #endif
180
181 #if !PLATFORM(IOS)
182     INIT(NSElasticDeltaForTimeDelta);
183     INIT(NSElasticDeltaForReboundDelta);
184     INIT(NSReboundDeltaForElasticDelta);
185 #endif
186
187 #if ENABLE(PUBLIC_SUFFIX_LIST)
188     INIT(IsPublicSuffix);
189 #endif
190
191 #if ENABLE(CACHE_PARTITIONING)
192     INIT(CachePartitionKey);
193 #endif
194
195     INIT(ExernalDeviceTypeForPlayer);
196     INIT(ExernalDeviceDisplayNameForPlayer);
197
198     INIT(QueryDecoderAvailability);
199
200     didInit = true;
201 }