[iOS] Fix build for external iphoneos SDK
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Foundation/Foundation.h>
9 #import <dispatch/dispatch.h>
10
11 #if !TARGET_OS_IPHONE
12 #import <AppKit/AppKit.h>
13 #import <Carbon/Carbon.h>
14 #else
15 #import <CoreImage/CoreImage.h>
16 #import <CoreText/CoreText.h>
17 #import <WebKitSystemInterfaceIOS.h>
18 #endif
19
20 @class AVAsset;
21 @class AVPlayer;
22 @class DDActionContext;
23 @class QTMovie;
24 @class QTMovieView;
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef struct _CFURLResponse* CFURLResponseRef;
31 typedef const struct _CFURLRequest* CFURLRequestRef;
32 typedef struct _CFURLRequest* CFMutableURLRequestRef;
33
34 typedef struct _CFURLCredential* WKCFURLCredentialRef;
35 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
36
37 typedef enum {
38     WKCertificateParseResultSucceeded  = 0,
39     WKCertificateParseResultFailed     = 1,
40     WKCertificateParseResultPKCS7      = 2,
41 } WKCertificateParseResult;
42
43 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
44 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
45
46 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
47 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
48
49 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
50
51 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
52
53 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
54 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
55
56 #if !TARGET_OS_IPHONE
57 void WKShowKeyAndMain(void);
58 #ifndef __LP64__
59 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
60 unsigned WKCarbonWindowMask(void);
61 void *WKGetNativeWindowFromWindowRef(WindowRef);
62 OSType WKCarbonWindowPropertyCreator(void);
63 OSType WKCarbonWindowPropertyTag(void);
64 #endif
65
66 #endif
67
68 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
69
70 #if !TARGET_OS_IPHONE
71 #ifndef __LP64__
72 unsigned WKGetNSAutoreleasePoolCount(void);
73 #endif
74
75 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
76
77 NSString *WKWindowWillOrderOnScreenNotification(void);
78 NSString *WKWindowWillOrderOffScreenNotification(void);
79 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
80
81 CFTypeID WKGetAXTextMarkerTypeID(void);
82 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
83 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
84 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
85 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
86 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
87 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
88 void WKAccessibilityHandleFocusChanged(void);
89 AXUIElementRef WKCreateAXUIElementRef(id element);
90 void WKUnregisterUniqueIdForElement(id element);
91     
92 NSArray *WKSpeechSynthesisGetVoiceIdentifiers(void);
93 NSString *WKSpeechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale*);
94 #endif
95     
96 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
97 BOOL WKIsPluginUpdateAvailable(NSString *bundleIdentifier);
98
99 BOOL WKShouldBlockWebGL();
100 BOOL WKShouldSuggestBlockingWebGL();
101
102 // Remote Accessibility API.
103 #if !TARGET_OS_IPHONE
104 void WKAXRegisterRemoteApp(void);
105 void WKAXInitializeElementWithPresenterPid(id, pid_t);
106 NSData *WKAXRemoteTokenForElement(id);
107 id WKAXRemoteElementForToken(NSData *);
108 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
109 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
110 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
111 #endif
112
113 void WKSetUpFontCache(void);
114
115 #if !TARGET_OS_IPHONE
116 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
117
118 // The CG context's current path is the focus ring's path.
119 // Color and radius are ignored. Older versions of WebKit expected to
120 // be able to change the rendering of the system focus ring.
121 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
122 bool WKDrawFocusRingAtTime(CGContextRef context, NSTimeInterval time);
123 bool WKDrawCellFocusRingWithFrameAtTime(NSCell *cell, NSRect cellFrame, NSView *controlView, NSTimeInterval time);
124
125 void WKSetDragImage(NSImage *image, NSPoint offset);
126
127 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
128
129 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
130 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
131 void WKSetDDActionContextIsForActionMenu(DDActionContext *actionContext);
132 void WKSendUserChangeNotifications(void);
133 #ifndef __LP64__
134 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
135 void WKSendKeyEventToTSM(NSEvent *theEvent);
136 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
137 #endif
138
139 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
140 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
141 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
142 #endif
143
144 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
145
146
147 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
148 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
149 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
150
151 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
152 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
153
154 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
155
156 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
157 enum {
158     WKCTFontTransformApplyShaping = (1 << 0),
159     WKCTFontTransformApplyPositioning = (1 << 1)
160 };
161
162 typedef int WKCTFontTransformOptions;
163
164 bool WKCTFontTransformGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, WKCTFontTransformOptions options);
165 #endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
166
167 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
168
169 CGSize WKCTRunGetInitialAdvance(CTRunRef);
170
171 #if (TARGET_OS_IPHONE && TARGET_OS_EMBEDDED) || MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
172 typedef struct __IOSurface *IOSurfaceRef;
173
174 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
175 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
176 #endif
177
178 typedef enum {
179     WKPatternTilingNoDistortion,
180     WKPatternTilingConstantSpacingMinimalDistortion,
181     WKPatternTilingConstantSpacing
182 } WKPatternTiling;
183
184 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
185 void WKCGContextResetClip(CGContextRef);
186
187 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
188 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
189 #endif
190
191 #if !TARGET_OS_IPHONE
192 #ifndef __LP64__
193 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
194 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
195 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
196 #endif
197
198 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
199 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
200
201 #endif
202
203
204 BOOL WKCGContextIsBitmapContext(CGContextRef context);
205 bool WKCGContextIsPDFContext(CGContextRef context);
206
207 #if !TARGET_OS_IPHONE
208 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
209
210 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
211
212 typedef enum {
213     WKMovieTypeUnknown,
214     WKMovieTypeDownload,
215     WKMovieTypeStoredStream,
216     WKMovieTypeLiveStream
217 } WKMovieType;
218
219 int WKQTMovieGetType(QTMovie* movie);
220
221 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
222 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
223 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
224
225 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
226 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
227 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
228 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
229 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
230 void WKQTMovieDisableComponent(uint32_t[5]);
231 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
232 #endif
233
234 CFStringRef WKCopyFoundationCacheDirectory(void);
235
236 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
237 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
238 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest *);
239 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest *);
240 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
241
242 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
243 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
244 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
245 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
246 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
247 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *, NSURL *);
248 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
249 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
250 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
251
252 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
253 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
254 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
255
256 #if !TARGET_OS_IPHONE
257 void WKSetVisibleApplicationName(CFStringRef);
258 void WKSetApplicationInformationItem(CFStringRef key, CFTypeRef value);
259 #endif
260
261 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
262
263 #if !TARGET_OS_IPHONE
264 typedef enum {
265     WKMediaUIPartFullscreenButton   = 0,
266     WKMediaUIPartMuteButton,
267     WKMediaUIPartPlayButton,
268     WKMediaUIPartSeekBackButton,
269     WKMediaUIPartSeekForwardButton,
270     WKMediaUIPartTimelineSlider,
271     WKMediaUIPartTimelineSliderThumb,
272     WKMediaUIPartRewindButton,
273     WKMediaUIPartSeekToRealtimeButton,
274     WKMediaUIPartShowClosedCaptionsButton,
275     WKMediaUIPartHideClosedCaptionsButton,
276     WKMediaUIPartUnMuteButton,
277     WKMediaUIPartPauseButton,
278     WKMediaUIPartBackground,
279     WKMediaUIPartCurrentTimeDisplay,
280     WKMediaUIPartTimeRemainingDisplay,
281     WKMediaUIPartStatusDisplay,
282     WKMediaUIPartControlsPanel,
283     WKMediaUIPartVolumeSliderContainer,
284     WKMediaUIPartVolumeSlider,
285     WKMediaUIPartVolumeSliderThumb,
286     WKMediaUIPartFullScreenVolumeSlider,
287     WKMediaUIPartFullScreenVolumeSliderThumb,
288     WKMediaUIPartVolumeSliderMuteButton,
289     WKMediaUIPartTextTrackDisplayContainer,
290     WKMediaUIPartTextTrackDisplay,
291     WKMediaUIPartExitFullscreenButton,
292 } WKMediaUIPart;
293
294 typedef enum {
295     WKMediaControllerFlagDisabled = 1 << 0,
296     WKMediaControllerFlagPressed = 1 << 1,
297     WKMediaControllerFlagDrawEndCaps = 1 << 3,
298     WKMediaControllerFlagFocused = 1 << 4
299 } WKMediaControllerThemeState;
300
301 BOOL WKHitTestMediaUIPart(int part, CGRect bounds, CGPoint point);
302 void WKMeasureMediaUIPart(int part, CGRect *bounds, CGSize *naturalSize);
303 void WKDrawMediaUIPart(int part, CGContextRef context, CGRect rect, unsigned state);
304 void WKDrawMediaSliderTrack(CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
305 NSView *WKCreateMediaUIBackgroundView(void);
306
307 typedef enum {
308     WKMediaUIControlTimeline,
309     WKMediaUIControlSlider,
310     WKMediaUIControlPlayPauseButton,
311     WKMediaUIControlExitFullscreenButton,
312     WKMediaUIControlRewindButton,
313     WKMediaUIControlFastForwardButton,
314     WKMediaUIControlVolumeUpButton,
315     WKMediaUIControlVolumeDownButton
316 } WKMediaUIControlType;
317     
318 NSControl *WKCreateMediaUIControl(int controlType);
319
320 NSArray *WKQTGetSitesInMediaDownloadCache();
321 void WKQTClearMediaDownloadCacheForSite(NSString *site);
322 void WKQTClearMediaDownloadCache();
323     
324 mach_port_t WKInitializeRenderServer(void);
325 #endif
326
327 @class CALayer;
328
329 CALayer *WKMakeRenderLayer(uint32_t contextID);
330     
331 #if !TARGET_OS_IPHONE
332 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
333
334 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
335 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
336 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
337 #endif
338
339 typedef struct __WKCAContextRef *WKCAContextRef;
340
341 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
342 #if !TARGET_OS_IPHONE
343 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
344 #endif
345 void WKCAContextInvalidate(WKCAContextRef);
346 uint32_t WKCAContextGetContextId(WKCAContextRef);
347 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
348 CALayer *WKCAContextGetLayer(WKCAContextRef);
349 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
350 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
351 void WKDestroyRenderingResources(void);
352
353 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
354
355 #if !TARGET_OS_IPHONE
356 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
357
358 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
359 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
360 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
361
362 void WKWindowSetClipRect(NSWindow*, NSRect);
363
364 #if defined(__x86_64__)
365 #import <mach/mig.h>
366 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
367 #endif
368
369 NSUInteger WKGetInputPanelWindowStyle(void);
370 UInt8 WKGetNSEventKeyChar(NSEvent *);
371 #endif
372
373 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
374 int WKGetHTTPRequestPriority(CFURLRequestRef);
375 void WKSetHTTPRequestMaximumPriority(int maximumPriority);
376 void WKSetHTTPRequestPriority(CFURLRequestRef, int priority);
377 void WKSetHTTPRequestMinimumFastLanePriority(int priority);
378 void WKHTTPRequestEnablePipelining(CFURLRequestRef);
379
380 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
381 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
382 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
383
384 #if !TARGET_OS_IPHONE
385 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
386 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
387
388 void WKEnableSettingCursorWhenInBackground(void);
389 #endif
390
391 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
392 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
393 CFDictionaryRef WKCFURLRequestCreateSerializableRepresentation(CFURLRequestRef cfRequest, CFTypeRef tokenNull);
394 CFURLRequestRef WKCreateCFURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
395
396 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
397 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
398
399 #if !TARGET_OS_IPHONE && !defined(__LP64__)
400 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
401 #endif
402
403 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
404 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
405
406 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
407 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
408 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
409 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
410 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
411
412 typedef enum {
413     WKSandboxExtensionTypeReadOnly,
414     WKSandboxExtensionTypeReadWrite,
415 } WKSandboxExtensionType;
416 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
417
418 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
419 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
420
421 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
422 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
423
424 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
425 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
426
427 #if !TARGET_OS_IPHONE
428 OSStatus WKEnableSandboxStyleFileQuarantine(void);
429
430 int WKRecommendedScrollerStyle(void);
431
432 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
433
434 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
435 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
436 void WKHideWordDefinitionWindow(void);
437 #endif
438
439 #if !TARGET_OS_IPHONE
440 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
441 #endif
442
443 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
444
445 #if !TARGET_OS_IPHONE
446 NSCursor *WKCursor(const char *name);
447 #endif
448
449 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
450 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
451 dispatch_source_t WKCreateMemoryStatusPressureCriticalDispatchOnMainQueue(void);
452 #endif
453     
454 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
455 bool WKExecutableWasLinkedOnOrBeforeLion(void);
456 #endif
457
458 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
459 bool WKExecutableWasLinkedOnOrBeforeMountainLion(void);
460 #endif
461
462 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
463
464 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
465
466 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
467 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
468 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
469 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
470 #endif
471
472 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
473 typedef enum {
474     WKOcclusionNotificationTypeApplicationBecameVisible,
475     WKOcclusionNotificationTypeApplicationBecameOccluded,
476     WKOcclusionNotificationTypeApplicationWindowModificationsStarted,
477     WKOcclusionNotificationTypeApplicationWindowModificationsStopped,
478     WKOcclusionNotificationTypeWindowBecameVisible,
479     WKOcclusionNotificationTypeWindowBecameOccluded,
480 } WKOcclusionNotificationType;
481
482 typedef uint32_t WKWindowID;
483
484 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void* data, uint32_t dataLength, void*, uint32_t);
485
486 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
487 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
488 bool WKEnableWindowOcclusionNotifications(NSInteger windowID, bool *outCurrentOcclusionState);
489 #endif
490
491 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
492
493 #if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
494 bool WKIsPublicSuffix(NSString *domain);
495
496 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
497 typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
498
499 void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
500 CFStringRef WKCachePartitionKey(void);
501 void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
502 #endif
503
504 typedef enum {
505     WKExternalPlaybackTypeNone,
506     WKExternalPlaybackTypeAirPlay,
507     WKExternalPlaybackTypeTVOut,
508 } WKExternalPlaybackType;
509
510 int WKExernalDeviceTypeForPlayer(AVPlayer *);
511 NSString *WKExernalDeviceDisplayNameForPlayer(AVPlayer *);
512
513 bool WKQueryDecoderAvailability(void);
514
515 #ifdef __cplusplus
516 }
517 #endif