Make use of CG rounded-rect primitives
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10
11 @class AVAsset;
12 @class QTMovie;
13 @class QTMovieView;
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 typedef struct _CFURLResponse* CFURLResponseRef;
20 typedef const struct _CFURLRequest* CFURLRequestRef;
21 typedef struct _CFURLRequest* CFMutableURLRequestRef;
22
23 typedef struct _CFURLCredential* WKCFURLCredentialRef;
24 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
25
26 typedef enum {
27     WKCertificateParseResultSucceeded  = 0,
28     WKCertificateParseResultFailed     = 1,
29     WKCertificateParseResultPKCS7      = 2,
30 } WKCertificateParseResult;
31
32 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
33 void WKSetDefaultLocalization(CFStringRef localization);
34
35 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
36 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
37
38 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
39 NSArray *WKGetExtensionsForMIMEType(NSString *type);
40 NSString *WKGetMIMETypeForExtension(NSString *extension);
41
42 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
43 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
44 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
45
46 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48 #endif
49
50 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
51
52 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
53 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
54
55 void WKShowKeyAndMain(void);
56 #ifndef __LP64__
57 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
58 unsigned WKCarbonWindowMask(void);
59 void *WKGetNativeWindowFromWindowRef(WindowRef);
60 OSType WKCarbonWindowPropertyCreator(void);
61 OSType WKCarbonWindowPropertyTag(void);
62 #endif
63
64 typedef id WKNSURLConnectionDelegateProxyPtr;
65
66 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
67
68 void WKDisableCGDeferredUpdates(void);
69
70 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
71 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
72
73 void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
74
75 unsigned WKGetNSAutoreleasePoolCount(void);
76
77 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
78
79 NSString *WKMouseMovedNotification(void);
80 NSString *WKWindowWillOrderOnScreenNotification(void);
81 NSString *WKWindowWillOrderOffScreenNotification(void);
82 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
83
84 CFTypeID WKGetAXTextMarkerTypeID(void);
85 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
86 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
87 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
88 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
89 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
90 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
91 void WKAccessibilityHandleFocusChanged(void);
92 AXUIElementRef WKCreateAXUIElementRef(id element);
93 void WKUnregisterUniqueIdForElement(id element);
94
95
96 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
97 // Remote Accessibility API.
98 void WKAXRegisterRemoteApp(void);
99 void WKAXInitializeElementWithPresenterPid(id, pid_t);
100 NSData *WKAXRemoteTokenForElement(id);
101 id WKAXRemoteElementForToken(NSData *);
102 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
103 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
104 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
105 #endif
106
107 void WKSetUpFontCache(void);
108
109 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
110 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
111 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
112
113 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
114     void (*formFinalize)(CFReadStreamRef, void *), 
115     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
116     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
117     Boolean (*formCanRead)(CFReadStreamRef, void *), 
118     void (*formClose)(CFReadStreamRef, void *), 
119     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
120     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
121     void *context);
122
123 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
124
125 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
126     // The CG context's current path is the focus ring's path.
127     // A color of 0 means "use system focus ring color".
128     // A radius of 0 means "use default focus ring radius".
129
130 void WKSetDragImage(NSImage *image, NSPoint offset);
131
132 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
133 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
134 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
135 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
136 void WKPopupContextMenu(NSMenu *menu, NSPoint screenLocation);
137 void WKSendUserChangeNotifications(void);
138 #ifndef __LP64__
139 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
140 void WKSendKeyEventToTSM(NSEvent *theEvent);
141 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
142 #endif
143
144 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
145 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
146 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
147 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
148 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
149
150
151 void WKSetBaseCTM(CGContextRef, CGAffineTransform);
152 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
153 CGAffineTransform WKGetUserToBaseCTM(CGContextRef);
154
155 void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
156 bool WKGetVerticalGlyphsForCharacters(CTFontRef, const UniChar[], CGGlyph[], size_t);
157
158 CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
159 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
160 CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
161
162 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
163 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
164 #endif
165
166 typedef enum {
167     WKPatternTilingNoDistortion,
168     WKPatternTilingConstantSpacingMinimalDistortion,
169     WKPatternTilingConstantSpacing
170 } WKPatternTiling;
171
172 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
173 void WKCGContextResetClip(CGContextRef);
174
175 #ifndef __LP64__
176 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
177 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
178 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
179 #endif
180
181 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
182 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
183
184 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
185
186 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
187 // use that enum directly).
188 typedef enum {
189     WKThemeScrollBarArrowsSingle     = 0,
190     WKThemeScrollBarArrowsLowerRight = 1,
191     WKThemeScrollBarArrowsDouble     = 2,
192     WKThemeScrollBarArrowsUpperLeft  = 3,
193 } WKThemeScrollBarArrowStyle;
194
195 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
196
197
198 BOOL WKCGContextIsBitmapContext(CGContextRef context);
199
200 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
201
202 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
203
204 typedef enum {
205     WKMovieTypeUnknown,
206     WKMovieTypeDownload,
207     WKMovieTypeStoredStream,
208     WKMovieTypeLiveStream
209 } WKMovieType;
210
211 int WKQTMovieGetType(QTMovie* movie);
212
213 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
214 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
215 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
216 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
217
218 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
219 int WKQTMovieDataRate(QTMovie* movie);
220 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
221 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
222 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
223 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
224 void WKQTMovieDisableComponent(uint32_t[5]);
225 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
226
227 CFStringRef WKCopyFoundationCacheDirectory(void);
228
229 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
230 typedef struct __CFURLStorageSession* CFURLStorageSessionRef;
231 #else
232 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
233 #endif
234 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
235 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
236 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
237 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
238
239 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
240 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
241 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
242 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
243 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
244 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
245 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
246
247 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
248 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
249 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
250 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
251 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
252
253 void WKSetVisibleApplicationName(CFStringRef);
254
255 typedef enum {
256     WKMediaUIPartFullscreenButton   = 0,
257     WKMediaUIPartMuteButton,
258     WKMediaUIPartPlayButton,
259     WKMediaUIPartSeekBackButton,
260     WKMediaUIPartSeekForwardButton,
261     WKMediaUIPartTimelineSlider,
262     WKMediaUIPartTimelineSliderThumb,
263     WKMediaUIPartRewindButton,
264     WKMediaUIPartSeekToRealtimeButton,
265     WKMediaUIPartShowClosedCaptionsButton,
266     WKMediaUIPartHideClosedCaptionsButton,
267     WKMediaUIPartUnMuteButton,
268     WKMediaUIPartPauseButton,
269     WKMediaUIPartBackground,
270     WKMediaUIPartCurrentTimeDisplay,
271     WKMediaUIPartTimeRemainingDisplay,
272     WKMediaUIPartStatusDisplay,
273     WKMediaUIPartControlsPanel,
274     WKMediaUIPartVolumeSliderContainer,
275     WKMediaUIPartVolumeSlider,
276     WKMediaUIPartVolumeSliderThumb,
277     WKMediaUIPartFullScreenVolumeSlider,
278     WKMediaUIPartFullScreenVolumeSliderThumb,
279 } WKMediaUIPart;
280
281 typedef enum {
282     WKMediaControllerThemeClassic   = 1,
283     WKMediaControllerThemeQuickTime = 2
284 } WKMediaControllerThemeStyle;
285
286 typedef enum {
287     WKMediaControllerFlagDisabled = 1 << 0,
288     WKMediaControllerFlagPressed = 1 << 1,
289     WKMediaControllerFlagDrawEndCaps = 1 << 3,
290     WKMediaControllerFlagFocused = 1 << 4
291 } WKMediaControllerThemeState;
292
293 BOOL WKMediaControllerThemeAvailable(int themeStyle);
294 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
295 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
296 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
297 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
298 NSView *WKCreateMediaUIBackgroundView(void);
299
300 typedef enum {
301     WKMediaUIControlTimeline,
302     WKMediaUIControlSlider,
303     WKMediaUIControlPlayPauseButton,
304     WKMediaUIControlExitFullscreenButton,
305     WKMediaUIControlRewindButton,
306     WKMediaUIControlFastForwardButton,
307     WKMediaUIControlVolumeUpButton,
308     WKMediaUIControlVolumeDownButton
309 } WKMediaUIControlType;
310     
311 NSControl *WKCreateMediaUIControl(int controlType);
312
313 NSArray *WKQTGetSitesInMediaDownloadCache();
314 void WKQTClearMediaDownloadCacheForSite(NSString *site);
315 void WKQTClearMediaDownloadCache();
316     
317 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
318 mach_port_t WKInitializeRenderServer(void);
319     
320 @class CALayer;
321
322 CALayer *WKMakeRenderLayer(uint32_t contextID);
323     
324 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
325
326 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
327 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
328 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
329
330 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
331
332 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
333 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
334 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
335 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
336 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
337
338 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
339 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
340 #endif
341
342 @class CARenderer;
343
344 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
345 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
346
347 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
348
349 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
350 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
351 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
352
353 void WKWindowSetClipRect(NSWindow*, NSRect);
354
355 #if defined(__x86_64__)
356 #import <mach/mig.h>
357 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
358 #endif // defined(__x86_64__)
359
360 NSUInteger WKGetInputPanelWindowStyle(void);
361 UInt8 WKGetNSEventKeyChar(NSEvent *);
362 #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
363
364 @class CAPropertyAnimation;
365 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
366
367 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
368 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
369 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
370 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
371 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
372
373 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
374 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
375 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
376
377 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
378 typedef enum {
379     WKEventPhaseNone = 0,
380     WKEventPhaseBegan = 1,
381     WKEventPhaseChanged = 2,
382     WKEventPhaseEnded = 3,
383 } WKEventPhase;
384
385 int WKGetNSEventMomentumPhase(NSEvent *);
386 #endif
387
388 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
389 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
390
391 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
392 void WKSyncSurfaceToView(NSView *view);
393
394 void WKEnableSettingCursorWhenInBackground(void);
395
396 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
397 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
398
399 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
400 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
401
402 #ifndef __LP64__
403 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
404 #endif
405
406 #endif
407
408 #if MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
409 CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
410 #endif
411
412 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
413 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
414
415 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
416 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
417 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
418 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
419 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
420
421 CIFormat WKCIGetRGBA8Format(void);
422
423 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
424
425 typedef enum {
426     WKSandboxExtensionTypeReadOnly,
427     WKSandboxExtensionTypeWriteOnly,    
428     WKSandboxExtensionTypeReadWrite,
429 } WKSandboxExtensionType;
430 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
431
432 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
433 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
434
435 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
436 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
437
438 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
439 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
440
441 OSStatus WKEnableSandboxStyleFileQuarantine(void);
442
443 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
444
445 int WKRecommendedScrollerStyle(void);
446
447 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
448
449 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
450 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
451 void WKHideWordDefinitionWindow(void);
452
453 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
454
455 NSURL* WKAVAssetResolvedURL(AVAsset*);
456
457 NSCursor *WKCursor(const char *name);
458
459 #endif
460
461 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
462
463 #import <dispatch/dispatch.h>
464
465 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
466
467 #endif
468
469 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
470 NSString *WKGetMacOSXVersionString(void);
471 bool WKExecutableWasLinkedOnOrBeforeLion(void);
472 #endif
473
474 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
475 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
476 #endif
477
478 #ifdef __cplusplus
479 }
480 #endif