8746cf7856e24dd38d05d0dd389427299ce5383c
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebCoreSupport / mac / WebSystemInterface.mm
1 /*
2  * Copyright (C) 2006, 2007, 2008, 2009, 2010 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(GetPreferredExtensionForMIMEType);
63         INIT(GetUserToBaseCTM);
64         INIT(GetWheelEventDeltas);
65         INIT(HitTestMediaUIPart);
66         INIT(InitializeMaximumHTTPConnectionCountPerHost);
67         INIT(IsLatchingWheelEvent);
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(QTMovieSelectPreferredAlternates);
80         INIT(QTMovieSetShowClosedCaptions);
81         INIT(QTMovieViewSetDrawSynchronously);
82         INIT(SetCGFontRenderingMode);
83         INIT(SetCONNECTProxyAuthorizationForStream);
84         INIT(SetCONNECTProxyForStream);
85         INIT(SetCookieStoragePrivateBrowsingEnabled);
86         INIT(SetDragImage);
87         INIT(SetHTTPPipeliningPriority);
88         INIT(SetNSURLConnectionDefersCallbacks);
89         INIT(SetNSURLRequestShouldContentSniff);
90         INIT(SetPatternBaseCTM);
91         INIT(SetPatternPhaseInUserSpace);
92         INIT(SetUpFontCache);
93         INIT(SignalCFReadStreamEnd);
94         INIT(SignalCFReadStreamError);
95         INIT(SignalCFReadStreamHasBytes);
96
97 #if !defined(BUILDING_ON_SNOW_LEOPARD)
98         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
99         INIT(MakeScrollbarPainter);
100         INIT(ScrollbarPainterSetDelegate);
101         INIT(ScrollbarPainterPaint);
102         INIT(ScrollbarThickness);
103         INIT(ScrollbarMinimumThumbLength);
104         INIT(ScrollbarMinimumTotalLengthNeededForThumb);
105         INIT(ScrollbarPainterKnobAlpha);
106         INIT(SetScrollbarPainterKnobAlpha);
107         INIT(ScrollbarPainterIsHorizontal);
108         INIT(ScrollbarPainterSetOverlayState);
109         INIT(MakeScrollbarReplacementPainter);
110 #if defined(USE_WK_SCROLLBAR_PAINTER_AND_CONTROLLER)
111         INIT(MakeScrollbarPainterController);
112         INIT(SetPainterForPainterController);
113         INIT(VerticalScrollbarPainterForController);
114         INIT(HorizontalScrollbarPainterForController);
115         INIT(SetScrollbarPainterControllerStyle);
116         INIT(ContentAreaScrolled);
117         INIT(ContentAreaWillPaint);
118         INIT(MouseEnteredContentArea);
119         INIT(MouseExitedContentArea);
120         INIT(MouseMovedInContentArea);
121         INIT(WillStartLiveResize);
122         INIT(ContentAreaResized);
123         INIT(WillEndLiveResize);
124         INIT(ContentAreaDidShow);
125         INIT(ContentAreaDidHide);
126 #endif
127         INIT(ScrollbarPainterUsesOverlayScrollers);
128 #else
129         INIT(GetHyphenationLocationBeforeIndex);
130 #endif
131     });
132 }