Make use of CG rounded-rect primitives
[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 Computer, 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     INIT(AdvanceDefaultButtonPulseAnimation);
46 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
47     INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
48 #endif
49     INIT(CGContextGetShouldSmoothFonts);
50     INIT(CGPatternCreateWithImageAndTransform);
51     INIT(CGContextResetClip);
52     INIT(CopyCFLocalizationPreferredName);
53     INIT(CopyCONNECTProxyResponse);
54     INIT(CopyNSURLResponseStatusLine);
55     INIT(CreateCustomCFReadStream);
56     INIT(CreateNSURLConnectionDelegateProxy);
57     INIT(DrawCapsLockIndicator);
58     INIT(DrawBezeledTextArea);
59     INIT(DrawBezeledTextFieldCell);
60     INIT(DrawFocusRing);
61     INIT(DrawMediaUIPart);
62     INIT(DrawMediaSliderTrack);
63     INIT(DrawTextFieldCellFocusRing);
64     INIT(GetExtensionsForMIMEType);
65     INIT(GetFontInLanguageForCharacter);
66     INIT(GetFontInLanguageForRange);
67     INIT(GetGlyphTransformedAdvances);
68     INIT(GetHTTPPipeliningPriority);
69     INIT(GetMIMETypeForExtension);
70     INIT(GetNSURLResponseLastModifiedDate);
71     INIT(SignedPublicKeyAndChallengeString);
72     INIT(GetPreferredExtensionForMIMEType);
73     INIT(GetWheelEventDeltas);
74 #if PLATFORM(MAC)
75     INIT(GetNSEventKeyChar);
76 #endif
77     INIT(HitTestMediaUIPart);
78     INIT(InitializeMaximumHTTPConnectionCountPerHost);
79     INIT(MeasureMediaUIPart);
80     INIT(CreateMediaUIBackgroundView);
81     INIT(CreateMediaUIControl);
82     INIT(WindowSetAlpha);
83     INIT(WindowSetScaledFrame);
84     INIT(MediaControllerThemeAvailable);
85     INIT(PopupMenu);
86     INIT(SetBaseCTM);
87     INIT(SetCGFontRenderingMode);
88     INIT(SetCONNECTProxyAuthorizationForStream);
89     INIT(SetCONNECTProxyForStream);
90     INIT(SetCookieStoragePrivateBrowsingEnabled);
91     INIT(SetDragImage);
92     INIT(SetHTTPPipeliningMaximumPriority);
93     INIT(SetHTTPPipeliningPriority);
94     INIT(SetHTTPPipeliningMinimumFastLanePriority);
95     INIT(SetNSURLConnectionDefersCallbacks);
96     INIT(SetNSURLRequestShouldContentSniff);
97     INIT(SetPatternPhaseInUserSpace);
98     INIT(GetUserToBaseCTM);
99     INIT(SetUpFontCache);
100     INIT(SignalCFReadStreamEnd);
101     INIT(SignalCFReadStreamError);
102     INIT(SignalCFReadStreamHasBytes);
103     INIT(QTIncludeOnlyModernMediaFileTypes);
104     INIT(QTMovieDataRate);
105     INIT(QTMovieDisableComponent);
106     INIT(QTMovieMaxTimeLoaded);
107     INIT(QTMovieMaxTimeLoadedChangeNotification);
108     INIT(QTMovieMaxTimeSeekable);
109     INIT(QTMovieGetType);
110     INIT(QTMovieHasClosedCaptions);
111     INIT(QTMovieResolvedURL);
112     INIT(QTMovieSetShowClosedCaptions);
113     INIT(QTMovieSelectPreferredAlternates);
114     INIT(QTMovieViewSetDrawSynchronously);
115     INIT(QTGetSitesInMediaDownloadCache);
116     INIT(QTClearMediaDownloadCacheForSite);
117     INIT(QTClearMediaDownloadCache);
118
119     INIT(GetGlyphsForCharacters);
120     INIT(GetVerticalGlyphsForCharacters);
121
122 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
123     INIT(GetHyphenationLocationBeforeIndex);
124     INIT(GetNSEventMomentumPhase);
125 #endif
126
127     INIT(CreateCTLineWithUniCharProvider);
128
129 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
130     INIT(IOSurfaceContextCreate);
131     INIT(IOSurfaceContextCreateImage);
132     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
133     INIT(RecommendedScrollerStyle);
134     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
135     INIT(CopyDefaultSearchProviderDisplayName);
136     INIT(AVAssetResolvedURL);
137     INIT(Cursor);
138 #endif
139 #if USE(CFNETWORK)
140     INIT(GetDefaultHTTPCookieStorage);
141     INIT(CopyCredentialFromCFPersistentStorage);
142     INIT(SetCFURLRequestShouldContentSniff);
143     INIT(CFURLRequestCopyHTTPRequestBodyParts);
144     INIT(CFURLRequestSetHTTPRequestBodyParts);
145     INIT(SetRequestStorageSession);
146 #endif
147
148     INIT(GetAXTextMarkerTypeID);
149     INIT(GetAXTextMarkerRangeTypeID);
150     INIT(CreateAXTextMarker);
151     INIT(GetBytesFromAXTextMarker);
152     INIT(CreateAXTextMarkerRange);
153     INIT(CopyAXTextMarkerRangeStart);
154     INIT(CopyAXTextMarkerRangeEnd);
155     INIT(AccessibilityHandleFocusChanged);
156     INIT(CreateAXUIElementRef);
157     INIT(UnregisterUniqueIdForElement);
158     INIT(CreatePrivateStorageSession);
159     INIT(CopyRequestWithStorageSession);
160     INIT(CopyHTTPCookieStorage);
161     INIT(GetHTTPCookieAcceptPolicy);
162     INIT(HTTPCookiesForURL);
163     INIT(SetHTTPCookiesForURL);
164     INIT(DeleteHTTPCookie);
165
166     INIT(GetCFURLResponseMIMEType);
167     INIT(GetCFURLResponseURL);
168     INIT(GetCFURLResponseHTTPResponse);
169     INIT(CopyCFURLResponseSuggestedFilename);
170     INIT(SetCFURLResponseMIMEType);
171
172 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
173     INIT(CreateVMPressureDispatchOnMainQueue);
174 #endif
175
176 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
177     INIT(GetMacOSXVersionString);
178     INIT(ExecutableWasLinkedOnOrBeforeLion);
179 #endif
180
181 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
182     INIT(CGPathAddRoundedRect);
183 #endif
184
185     didInit = true;
186 }