1/*
2 * Copyright 2006, 2007, 2008 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#import "WebCoreSystemInterface.h"
28
29void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
30BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
31CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
32void (*wkCGContextResetClip)(CGContextRef);
33CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
34void (*wkClearGlyphVector)(void* glyphs);
35OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
36NSString* (*wkGetMIMETypeForExtension)(NSString*);
37NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
38void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
39void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
40CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
41bool (*wkCGContextIsPDFContext)(CGContextRef);
42void (*wkSetUpFontCache)();
43void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
44void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
45void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
46CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
47    void (*formFinalize)(CFReadStreamRef, void *),
48    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
49    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
50    Boolean (*formCanRead)(CFReadStreamRef, void *),
51    void (*formClose)(CFReadStreamRef, void *),
52    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
53    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
54    void *context);
55NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
56void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
57void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
58id (*wkCreateNSURLConnectionDelegateProxy)(void);
59unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
60int (*wkGetHTTPRequestPriority)(CFURLRequestRef);
61void (*wkSetHTTPRequestMaximumPriority)(int priority);
62void (*wkSetHTTPRequestPriority)(CFURLRequestRef, int priority);
63void (*wkSetHTTPRequestMinimumFastLanePriority)(int priority);
64void (*wkHTTPRequestEnablePipelining)(CFURLRequestRef);
65void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
66void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
67void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
68CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
69bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
70int (*wkGetDeviceClass)(void);
71CGSize (*wkGetScreenSize)(void);
72CGSize (*wkGetAvailableScreenSize)(void);
73void (*wkSetLayerContentsScale)(CALayer *);
74float (*wkGetScreenScaleFactor)(void);
75bool (*wkIsGB18030ComplianceRequired)(void);
76void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
77void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
78CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
79CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void);
80
81#if USE(CFNETWORK)
82CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
83WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
84void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
85void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
86#endif
87
88bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
89CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
90bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options);
91
92CGSize (*wkCTRunGetInitialAdvance)(CTRunRef);
93
94CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
95
96#if !PLATFORM(IOS_SIMULATOR)
97CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
98CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
99#endif // !PLATFORM(IOS_SIMULATOR)
100
101#if PLATFORM(IOS_SIMULATOR)
102void (*wkSetCrashReportApplicationSpecificInformation)(CFStringRef);
103#endif
104
105CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
106NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
107CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
108unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
109void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
110NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
111NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *, NSURL *);
112void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
113void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
114void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
115
116CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
117CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
118CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
119CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
120void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
121
122void(*wkDestroyRenderingResources)(void);
123
124bool (*wkCaptionAppearanceHasUserPreferences)(void);
125bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
126CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
127CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
128CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
129bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
130bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
131bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
132CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
133bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
134int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
135CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);
136
137#if ENABLE(PUBLIC_SUFFIX_LIST)
138bool (*wkIsPublicSuffix)(NSString *host);
139#endif
140
141#if ENABLE(CACHE_PARTITIONING)
142CFStringRef (*wkCachePartitionKey)(void);
143#endif
144
145CFStringRef (*wkGetUserAgent)(void);
146CFStringRef (*wkGetDeviceName)(void);
147CFStringRef (*wkGetOSNameForUserAgent)(void);
148CFStringRef (*wkGetPlatformNameForNavigator)(void);
149CFStringRef (*wkGetVendorNameForNavigator)(void);
150
151int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
152NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
153
154bool (*wkQueryDecoderAvailability)(void);
155
156