<http://webkit.org/b/91015> Remove BUILDING_ON / TARGETING macros in favor of system...
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebCoreSupport / mac / WebSystemInterface.mm
1 /*
2  * Copyright (C) 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  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "config.h"
27 #import "WebSystemInterface.h"
28
29 #import <WebCore/WebCoreSystemInterface.h>
30 #import <WebKitSystemInterface.h>
31
32 #define INIT(function) wk##function = WK##function
33
34 void InitWebCoreSystemInterface(void)
35 {
36     static dispatch_once_t initOnce;
37     
38     dispatch_once(&initOnce, ^{
39         INIT(AdvanceDefaultButtonPulseAnimation);
40 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
41         INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
42 #endif
43         INIT(CopyCFLocalizationPreferredName);
44         INIT(CGContextGetShouldSmoothFonts);
45         INIT(CGPatternCreateWithImageAndTransform);
46         INIT(CGContextResetClip);
47         INIT(CopyCONNECTProxyResponse);
48         INIT(CopyNSURLResponseStatusLine);
49         INIT(CreateCTLineWithUniCharProvider);
50         INIT(CreateCustomCFReadStream);
51         INIT(CreateNSURLConnectionDelegateProxy);
52         INIT(DrawBezeledTextArea);
53         INIT(DrawBezeledTextFieldCell);
54         INIT(DrawCapsLockIndicator);
55         INIT(DrawFocusRing);
56         INIT(DrawMediaSliderTrack);
57         INIT(DrawMediaUIPart);
58         INIT(DrawTextFieldCellFocusRing);
59         INIT(GetExtensionsForMIMEType);
60         INIT(GetFontInLanguageForCharacter);
61         INIT(GetFontInLanguageForRange);
62         INIT(GetGlyphTransformedAdvances);
63         INIT(GetGlyphsForCharacters);
64         INIT(GetVerticalGlyphsForCharacters);
65         INIT(GetHTTPPipeliningPriority);
66         INIT(GetMIMETypeForExtension);
67         INIT(GetNSURLResponseLastModifiedDate);
68         INIT(SignedPublicKeyAndChallengeString);
69         INIT(GetPreferredExtensionForMIMEType);
70         INIT(GetUserToBaseCTM);
71         INIT(GetWheelEventDeltas);
72         INIT(GetNSEventKeyChar);
73         INIT(HitTestMediaUIPart);
74         INIT(InitializeMaximumHTTPConnectionCountPerHost);
75         INIT(MeasureMediaUIPart);
76         INIT(MediaControllerThemeAvailable);
77         INIT(PopupMenu);
78         INIT(QTIncludeOnlyModernMediaFileTypes);
79         INIT(QTMovieDataRate);
80         INIT(QTMovieDisableComponent);
81         INIT(QTMovieGetType);
82         INIT(QTMovieHasClosedCaptions);
83         INIT(QTMovieMaxTimeLoaded);
84         INIT(QTMovieMaxTimeLoadedChangeNotification);
85         INIT(QTMovieMaxTimeSeekable);
86         INIT(QTMovieResolvedURL);
87         INIT(QTMovieSelectPreferredAlternates);
88         INIT(QTMovieSetShowClosedCaptions);
89         INIT(QTMovieViewSetDrawSynchronously);
90         INIT(QTGetSitesInMediaDownloadCache);
91         INIT(QTClearMediaDownloadCacheForSite);
92         INIT(QTClearMediaDownloadCache);
93         INIT(SetBaseCTM);
94         INIT(SetCGFontRenderingMode);
95         INIT(SetCONNECTProxyAuthorizationForStream);
96         INIT(SetCONNECTProxyForStream);
97         INIT(SetCookieStoragePrivateBrowsingEnabled);
98         INIT(SetDragImage);
99         INIT(SetHTTPPipeliningMaximumPriority);
100         INIT(SetHTTPPipeliningPriority);
101         INIT(SetHTTPPipeliningMinimumFastLanePriority);
102         INIT(SetNSURLConnectionDefersCallbacks);
103         INIT(SetNSURLRequestShouldContentSniff);
104         INIT(SetPatternPhaseInUserSpace);
105         INIT(SetUpFontCache);
106         INIT(SignalCFReadStreamEnd);
107         INIT(SignalCFReadStreamError);
108         INIT(SignalCFReadStreamHasBytes);
109         INIT(CreatePrivateStorageSession);
110         INIT(CopyRequestWithStorageSession);
111         INIT(CopyHTTPCookieStorage);
112         INIT(GetHTTPCookieAcceptPolicy);
113         INIT(SetHTTPCookieAcceptPolicy);
114         INIT(HTTPCookiesForURL);
115         INIT(SetHTTPCookiesForURL);
116         INIT(DeleteHTTPCookie);
117
118         INIT(SetMetadataURL);
119         
120 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
121         INIT(IOSurfaceContextCreate);
122         INIT(IOSurfaceContextCreateImage);
123         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
124         INIT(RecommendedScrollerStyle);
125         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
126         INIT(CopyDefaultSearchProviderDisplayName);
127         INIT(AVAssetResolvedURL);
128         INIT(Cursor);
129 #else
130         INIT(GetHyphenationLocationBeforeIndex);
131         INIT(GetNSEventMomentumPhase);
132 #endif
133 #if USE(CFNETWORK)
134         INIT(GetDefaultHTTPCookieStorage);
135         INIT(CopyCredentialFromCFPersistentStorage);
136         INIT(SetCFURLRequestShouldContentSniff);
137         INIT(CFURLRequestCopyHTTPRequestBodyParts);
138         INIT(CFURLRequestSetHTTPRequestBodyParts);
139         INIT(SetRequestStorageSession);
140 #endif
141
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
153         INIT(GetCFURLResponseMIMEType);
154         INIT(GetCFURLResponseURL);
155         INIT(GetCFURLResponseHTTPResponse);
156         INIT(CopyCFURLResponseSuggestedFilename);
157         INIT(SetCFURLResponseMIMEType);
158
159 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
160         INIT(CreateVMPressureDispatchOnMainQueue);
161 #endif
162
163 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
164         INIT(GetMacOSXVersionString);
165         INIT(ExecutableWasLinkedOnOrBeforeLion);
166 #endif
167
168 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
169         INIT(CGPathAddRoundedRect);
170 #endif
171
172 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
173         INIT(CFURLRequestAllowAllPostCaching);
174 #endif
175 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !PLATFORM(IOS)
176         INIT(FilterIsManagedSession);
177         INIT(FilterCreateInstance);
178         INIT(FilterRelease);
179         INIT(FilterWasBlocked);
180         INIT(FilterAddData);
181         INIT(FilterDataComplete);
182
183         INIT(NSElasticDeltaForTimeDelta);
184         INIT(NSElasticDeltaForReboundDelta);
185         INIT(NSReboundDeltaForElasticDelta);
186 #endif
187
188     });
189 }