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