[Cocoa] Migrate WKSetPatternPhaseInUserSpace() and WKGetUserToBaseCTM() from WKSI
[WebKit-https.git] / Source / WebCore / platform / mac / WebCoreSystemInterface.mm
1 /*
2  * Copyright 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. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #import "config.h"
27 #pragma GCC visibility push(default)
28 #import "WebCoreSystemInterface.h"
29 #pragma GCC visibility pop
30
31 #import <Foundation/Foundation.h>
32
33 void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
34 void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
35 BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
36 bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
37 CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
38 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
39 CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
40 CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void);
41 void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
42 void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
43 void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int);
44 bool (*wkDrawFocusRingAtTime)(CGContextRef, NSTimeInterval);
45 bool (*wkDrawCellFocusRingWithFrameAtTime)(NSCell*, NSRect, NSView*, NSTimeInterval);
46 void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
47     float duration, unsigned state);
48 BOOL (*wkHitTestMediaUIPart)(int part, CGRect bounds, CGPoint point);
49 void (*wkDrawMediaUIPart)(int part, CGContextRef context, CGRect rect, unsigned state);
50 void (*wkMeasureMediaUIPart)(int part, CGRect *bounds, CGSize *naturalSize);
51 NSView *(*wkCreateMediaUIBackgroundView)(void);
52 NSControl *(*wkCreateMediaUIControl)(int);
53 void (*wkWindowSetAlpha)(NSWindow *, float);
54 void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
55 CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
56 NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
57 NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
58 BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
59 void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
60 UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
61 void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
62 unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
63 void (*wkQTMovieDisableComponent)(uint32_t[5]);
64 float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
65 NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
66 float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
67 int (*wkQTMovieGetType)(QTMovie*);
68 BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
69 NSURL *(*wkQTMovieResolvedURL)(QTMovie*);
70 void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
71 void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
72 void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
73 NSArray *(*wkQTGetSitesInMediaDownloadCache)();
74 void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
75 void (*wkQTClearMediaDownloadCache)();
76
77 void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*, BOOL);
78 void (*wkSetDragImage)(NSImage*, NSPoint offset);
79 bool (*wkCGContextIsPDFContext)(CGContextRef);
80 void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
81 unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
82 int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
83 void (*wkSetHTTPRequestMaximumPriority)(int priority);
84 void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
85 void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
86 void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
87 void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
88 void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
89 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
90
91 #if USE(CFNETWORK)
92 CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
93 WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
94 void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
95 void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
96 #endif
97
98 void* wkGetHyphenationLocationBeforeIndex;
99
100 bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
101
102 CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void);
103
104 NSCursor *(*wkCursor)(const char*);
105
106 NSArray *(*wkSpeechSynthesisGetVoiceIdentifiers)(void);
107 NSString *(*wkSpeechSynthesisGetDefaultVoiceIdentifierForLocale)(NSLocale *);
108
109 void (*wkUnregisterUniqueIdForElement)(id element);
110 void (*wkAccessibilityHandleFocusChanged)(void);
111 CFTypeID (*wkGetAXTextMarkerTypeID)(void);
112 CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void);
113 CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end);
114 CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range);
115 CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range);
116 CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
117 BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
118 AXUIElementRef (*wkCreateAXUIElementRef)(id element);
119
120 CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
121 NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
122 CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
123 unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
124 void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
125 NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
126 NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
127 void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
128 void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
129 void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
130
131 CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
132 CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
133 CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
134 CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
135 void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
136 void (*wkSetMetadataURL)(NSString *urlString, NSString *referrer, NSString *path);
137
138 void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
139
140 #if !PLATFORM(IOS)
141 CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
142 CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
143 CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
144 #endif
145
146 #if ENABLE(PUBLIC_SUFFIX_LIST)
147 bool (*wkIsPublicSuffix)(NSString *host);
148 #endif
149
150 #if ENABLE(CACHE_PARTITIONING)
151 CFStringRef (*wkCachePartitionKey)(void);
152 #endif
153
154 int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
155 NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
156
157 bool (*wkQueryDecoderAvailability)(void);