47dc274c309c73d9089b526df88586262470878c
[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         INIT(CopyCFLocalizationPreferredName);
41         INIT(CGContextGetShouldSmoothFonts);
42         INIT(CopyCONNECTProxyResponse);
43         INIT(CopyNSURLResponseStatusLine);
44         INIT(CreateCTLineWithUniCharProvider);
45         INIT(CreateCustomCFReadStream);
46         INIT(CreateNSURLConnectionDelegateProxy);
47         INIT(DrawBezeledTextArea);
48         INIT(DrawBezeledTextFieldCell);
49         INIT(DrawCapsLockIndicator);
50         INIT(DrawFocusRing);
51         INIT(DrawMediaSliderTrack);
52         INIT(DrawMediaUIPart);
53         INIT(DrawTextFieldCellFocusRing);
54         INIT(GetExtensionsForMIMEType);
55         INIT(GetFontInLanguageForCharacter);
56         INIT(GetFontInLanguageForRange);
57         INIT(GetGlyphTransformedAdvances);
58         INIT(GetGlyphsForCharacters);
59         INIT(GetHTTPPipeliningPriority);
60         INIT(GetMIMETypeForExtension);
61         INIT(GetNSURLResponseLastModifiedDate);
62         INIT(SignedPublicKeyAndChallengeString);
63         INIT(GetPreferredExtensionForMIMEType);
64         INIT(GetUserToBaseCTM);
65         INIT(GetWheelEventDeltas);
66         INIT(HitTestMediaUIPart);
67         INIT(InitializeMaximumHTTPConnectionCountPerHost);
68         INIT(MeasureMediaUIPart);
69         INIT(MediaControllerThemeAvailable);
70         INIT(PopupMenu);
71         INIT(QTIncludeOnlyModernMediaFileTypes);
72         INIT(QTMovieDataRate);
73         INIT(QTMovieDisableComponent);
74         INIT(QTMovieGetType);
75         INIT(QTMovieHasClosedCaptions);
76         INIT(QTMovieMaxTimeLoaded);
77         INIT(QTMovieMaxTimeLoadedChangeNotification);
78         INIT(QTMovieMaxTimeSeekable);
79         INIT(QTMovieResolvedURL);
80         INIT(QTMovieSelectPreferredAlternates);
81         INIT(QTMovieSetShowClosedCaptions);
82         INIT(QTMovieViewSetDrawSynchronously);
83         INIT(QTGetSitesInMediaDownloadCache);
84         INIT(QTClearMediaDownloadCacheForSite);
85         INIT(QTClearMediaDownloadCache);
86         INIT(SetCGFontRenderingMode);
87         INIT(SetCONNECTProxyAuthorizationForStream);
88         INIT(SetCONNECTProxyForStream);
89         INIT(SetCookieStoragePrivateBrowsingEnabled);
90         INIT(SetDragImage);
91         INIT(SetHTTPPipeliningMaximumPriority);
92         INIT(SetHTTPPipeliningPriority);
93         INIT(SetHTTPPipeliningMinimumFastLanePriority);
94         INIT(SetNSURLConnectionDefersCallbacks);
95         INIT(SetNSURLRequestShouldContentSniff);
96         INIT(SetPatternBaseCTM);
97         INIT(SetPatternPhaseInUserSpace);
98         INIT(SetUpFontCache);
99         INIT(SignalCFReadStreamEnd);
100         INIT(SignalCFReadStreamError);
101         INIT(SignalCFReadStreamHasBytes);
102         INIT(CreatePrivateStorageSession);
103         INIT(CopyRequestWithStorageSession);
104         INIT(CopyHTTPCookieStorage);
105         INIT(GetHTTPCookieAcceptPolicy);
106         INIT(HTTPCookiesForURL);
107         INIT(SetHTTPCookiesForURL);
108         INIT(DeleteHTTPCookie);
109
110 #if !defined(BUILDING_ON_SNOW_LEOPARD)
111         INIT(IOSurfaceContextCreate);
112         INIT(IOSurfaceContextCreateImage);
113         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
114         INIT(MakeScrollbarPainter);
115         INIT(ScrollbarPainterSetDelegate);
116         INIT(ScrollbarPainterPaint);
117         INIT(ScrollbarPainterForceFlashScrollers);
118         INIT(ScrollbarThickness);
119         INIT(ScrollbarMinimumThumbLength);
120         INIT(ScrollbarMinimumTotalLengthNeededForThumb);
121         INIT(ScrollbarPainterKnobAlpha);
122         INIT(SetScrollbarPainterKnobAlpha);
123         INIT(ScrollbarPainterTrackAlpha);
124         INIT(SetScrollbarPainterTrackAlpha);
125         INIT(ScrollbarPainterIsHorizontal);
126         INIT(ScrollbarPainterKnobRect);
127         INIT(ScrollbarPainterSetOverlayState);
128         INIT(SetScrollbarPainterKnobStyle);
129         INIT(MakeScrollbarPainterController);
130         INIT(MakeScrollbarReplacementPainter);
131         INIT(SetPainterForPainterController);
132         INIT(VerticalScrollbarPainterForController);
133         INIT(HorizontalScrollbarPainterForController);
134         INIT(ScrollbarPainterControllerStyle);
135         INIT(SetScrollbarPainterControllerStyle);
136         INIT(ContentAreaScrolled);
137         INIT(ContentAreaWillPaint);
138         INIT(MouseEnteredContentArea);
139         INIT(MouseExitedContentArea);
140         INIT(MouseMovedInContentArea);
141         INIT(WillStartLiveResize);
142         INIT(ContentAreaResized);
143         INIT(WillEndLiveResize);
144         INIT(ContentAreaDidShow);
145         INIT(ContentAreaDidHide);
146         INIT(DidBeginScrollGesture);
147         INIT(DidEndScrollGesture);
148         INIT(ScrollbarPainterUsesOverlayScrollers);
149         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
150         INIT(CopyDefaultSearchProviderDisplayName);
151         INIT(AVAssetResolvedURL);
152         INIT(Cursor);
153 #else
154         INIT(GetHyphenationLocationBeforeIndex);
155         INIT(GetNSEventMomentumPhase);
156 #endif
157         
158         INIT(GetAXTextMarkerTypeID);
159         INIT(GetAXTextMarkerRangeTypeID);
160         INIT(CreateAXTextMarker);
161         INIT(GetBytesFromAXTextMarker);
162         INIT(CreateAXTextMarkerRange);
163         INIT(CopyAXTextMarkerRangeStart);
164         INIT(CopyAXTextMarkerRangeEnd);
165         INIT(AccessibilityHandleFocusChanged);
166         INIT(CreateAXUIElementRef);
167         INIT(UnregisterUniqueIdForElement);        
168
169         INIT(GetCFURLResponseMIMEType);
170         INIT(GetCFURLResponseURL);
171         INIT(GetCFURLResponseHTTPResponse);
172         INIT(CopyCFURLResponseSuggestedFilename);
173         INIT(SetCFURLResponseMIMEType);
174     });
175 }