Zoomed-in scrolling is very slow when deviceScaleFactor > 1
[WebKit-https.git] / WebKitLibraries / WebKitSystemInterface.h
1 /*      
2     WebKitSystemInterface.h
3     Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4
5     Public header file.
6 */
7
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
10 #import <dispatch/dispatch.h>
11
12 @class AVAsset;
13 @class QTMovie;
14 @class QTMovieView;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 typedef struct _CFURLResponse* CFURLResponseRef;
21 typedef const struct _CFURLRequest* CFURLRequestRef;
22 typedef struct _CFURLRequest* CFMutableURLRequestRef;
23
24 typedef struct _CFURLCredential* WKCFURLCredentialRef;
25 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
26
27 typedef enum {
28     WKCertificateParseResultSucceeded  = 0,
29     WKCertificateParseResultFailed     = 1,
30     WKCertificateParseResultPKCS7      = 2,
31 } WKCertificateParseResult;
32
33 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
34 void WKSetDefaultLocalization(CFStringRef localization);
35
36 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
37 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
38
39 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
40 NSArray *WKGetExtensionsForMIMEType(NSString *type);
41 NSString *WKGetMIMETypeForExtension(NSString *extension);
42
43 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
44 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
45 NSString *WKCopyNSURLResponseStatusLine(NSURLResponse *response);
46
47 CFArrayRef WKCopyNSURLResponseCertificateChain(NSURLResponse *response);
48
49 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
50
51 void WKSetMetadataURL(NSString *URLString, NSString *referrer, NSString *path);
52 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
53
54 void WKShowKeyAndMain(void);
55 #ifndef __LP64__
56 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
57 unsigned WKCarbonWindowMask(void);
58 void *WKGetNativeWindowFromWindowRef(WindowRef);
59 OSType WKCarbonWindowPropertyCreator(void);
60 OSType WKCarbonWindowPropertyTag(void);
61 #endif
62
63 typedef id WKNSURLConnectionDelegateProxyPtr;
64
65 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
66
67 void WKDisableCGDeferredUpdates(void);
68
69 Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
70 void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
71
72 unsigned WKGetNSAutoreleasePoolCount(void);
73
74 void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
75
76 NSString *WKMouseMovedNotification(void);
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 BOOL WKShouldBlockPlugin(NSString *bundleIdentifier, NSString *bundleVersionString);
93
94 // Remote Accessibility API.
95 void WKAXRegisterRemoteApp(void);
96 void WKAXInitializeElementWithPresenterPid(id, pid_t);
97 NSData *WKAXRemoteTokenForElement(id);
98 id WKAXRemoteElementForToken(NSData *);
99 void WKAXSetWindowForRemoteElement(id remoteWindow, id remoteElement);
100 void WKAXRegisterRemoteProcess(bool registerProcess, pid_t);
101 pid_t WKAXRemoteProcessIdentifier(id remoteElement);
102
103 void WKSetUpFontCache(void);
104
105 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
106 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
107 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
108
109 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *), 
110     void (*formFinalize)(CFReadStreamRef, void *), 
111     Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
112     CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
113     Boolean (*formCanRead)(CFReadStreamRef, void *), 
114     void (*formClose)(CFReadStreamRef, void *), 
115     void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
116     void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
117     void *context);
118
119 void WKDrawCapsLockIndicator(CGContextRef, CGRect);
120
121 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius);
122     // The CG context's current path is the focus ring's path.
123     // A color of 0 means "use system focus ring color".
124     // A radius of 0 means "use default focus ring radius".
125
126 void WKSetDragImage(NSImage *image, NSPoint offset);
127
128 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
129 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
130 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
131 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
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 BOOL WKGetGlyphTransformedAdvances(CGFontRef, NSFont*, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
141 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
142 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
143 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font, BOOL shouldSubpixelQuantize);
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 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
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 CGContextRef WKIOSurfaceContextCreate(IOSurfaceRef, unsigned width, unsigned height, CGColorSpaceRef);
170 CGImageRef WKIOSurfaceContextCreateImage(CGContextRef context);
171
172 typedef enum {
173     WKPatternTilingNoDistortion,
174     WKPatternTilingConstantSpacingMinimalDistortion,
175     WKPatternTilingConstantSpacing
176 } WKPatternTiling;
177
178 CGPatternRef WKCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
179 void WKCGContextResetClip(CGContextRef);
180
181 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
182 bool WKCGContextDrawsWithCorrectShadowOffsets(CGContextRef);
183 #endif
184
185 #ifndef __LP64__
186 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
187 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
188 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
189 #endif
190
191 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
192 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
193
194 void WKNSWindowMakeBottomCornersSquare(NSWindow *);
195
196 // These constants match the ones used by ThemeScrollbarArrowStyle (some of the values are private, so we can't just
197 // use that enum directly).
198 typedef enum {
199     WKThemeScrollBarArrowsSingle     = 0,
200     WKThemeScrollBarArrowsLowerRight = 1,
201     WKThemeScrollBarArrowsDouble     = 2,
202     WKThemeScrollBarArrowsUpperLeft  = 3,
203 } WKThemeScrollBarArrowStyle;
204
205 OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef inContext, int inArrowStyle);
206
207
208 BOOL WKCGContextIsBitmapContext(CGContextRef context);
209
210 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
211
212 BOOL WKAppVersionCheckLessThan(NSString *, int, double);
213
214 typedef enum {
215     WKMovieTypeUnknown,
216     WKMovieTypeDownload,
217     WKMovieTypeStoredStream,
218     WKMovieTypeLiveStream
219 } WKMovieType;
220
221 int WKQTMovieGetType(QTMovie* movie);
222
223 BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
224 void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
225 void WKQTMovieSelectPreferredAlternates(QTMovie* movie);
226 void WKQTMovieSelectPreferredAlternateTrackForMediaType(QTMovie* movie, NSString* mediaType);
227
228 unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
229 int WKQTMovieDataRate(QTMovie* movie);
230 float WKQTMovieMaxTimeLoaded(QTMovie* movie);
231 float WKQTMovieMaxTimeSeekable(QTMovie* movie);
232 NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
233 void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
234 void WKQTMovieDisableComponent(uint32_t[5]);
235 NSURL *WKQTMovieResolvedURL(QTMovie* movie);
236
237 CFStringRef WKCopyFoundationCacheDirectory(void);
238
239 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
240 CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
241 NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
242 NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
243 void WKSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
244
245 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
246 CFHTTPCookieStorageRef WKCopyHTTPCookieStorage(CFURLStorageSessionRef);
247 unsigned WKGetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef);
248 void WKSetHTTPCookieAcceptPolicy(CFHTTPCookieStorageRef, unsigned policy);
249 NSArray *WKHTTPCookies(CFHTTPCookieStorageRef);
250 NSArray *WKHTTPCookiesForURL(CFHTTPCookieStorageRef, NSURL *);
251 void WKSetHTTPCookiesForURL(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
252 void WKDeleteAllHTTPCookies(CFHTTPCookieStorageRef);
253 void WKDeleteHTTPCookie(CFHTTPCookieStorageRef, NSHTTPCookie *);
254
255 CFHTTPCookieStorageRef WKGetDefaultHTTPCookieStorage(void);
256 WKCFURLCredentialRef WKCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef);
257 void WKSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool flag);
258 CFArrayRef WKCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
259 void WKCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
260
261 void WKSetVisibleApplicationName(CFStringRef);
262
263 CFURLRef WKCopyBundleURLForExecutableURL(CFURLRef);
264
265 typedef enum {
266     WKMediaUIPartFullscreenButton   = 0,
267     WKMediaUIPartMuteButton,
268     WKMediaUIPartPlayButton,
269     WKMediaUIPartSeekBackButton,
270     WKMediaUIPartSeekForwardButton,
271     WKMediaUIPartTimelineSlider,
272     WKMediaUIPartTimelineSliderThumb,
273     WKMediaUIPartRewindButton,
274     WKMediaUIPartSeekToRealtimeButton,
275     WKMediaUIPartShowClosedCaptionsButton,
276     WKMediaUIPartHideClosedCaptionsButton,
277     WKMediaUIPartUnMuteButton,
278     WKMediaUIPartPauseButton,
279     WKMediaUIPartBackground,
280     WKMediaUIPartCurrentTimeDisplay,
281     WKMediaUIPartTimeRemainingDisplay,
282     WKMediaUIPartStatusDisplay,
283     WKMediaUIPartControlsPanel,
284     WKMediaUIPartVolumeSliderContainer,
285     WKMediaUIPartVolumeSlider,
286     WKMediaUIPartVolumeSliderThumb,
287     WKMediaUIPartFullScreenVolumeSlider,
288     WKMediaUIPartFullScreenVolumeSliderThumb,
289     WKMediaUIPartVolumeSliderMuteButton,
290     WKMediaUIPartTextTrackDisplayContainer,
291     WKMediaUIPartTextTrackDisplay,
292     WKMediaUIPartExitFullscreenButton,
293 } WKMediaUIPart;
294
295 typedef enum {
296     WKMediaControllerThemeClassic   = 1,
297     WKMediaControllerThemeQuickTime = 2
298 } WKMediaControllerThemeStyle;
299
300 typedef enum {
301     WKMediaControllerFlagDisabled = 1 << 0,
302     WKMediaControllerFlagPressed = 1 << 1,
303     WKMediaControllerFlagDrawEndCaps = 1 << 3,
304     WKMediaControllerFlagFocused = 1 << 4
305 } WKMediaControllerThemeState;
306
307 BOOL WKMediaControllerThemeAvailable(int themeStyle);
308 BOOL WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
309 void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
310 void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
311 void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
312 NSView *WKCreateMediaUIBackgroundView(void);
313
314 typedef enum {
315     WKMediaUIControlTimeline,
316     WKMediaUIControlSlider,
317     WKMediaUIControlPlayPauseButton,
318     WKMediaUIControlExitFullscreenButton,
319     WKMediaUIControlRewindButton,
320     WKMediaUIControlFastForwardButton,
321     WKMediaUIControlVolumeUpButton,
322     WKMediaUIControlVolumeDownButton
323 } WKMediaUIControlType;
324     
325 NSControl *WKCreateMediaUIControl(int controlType);
326
327 NSArray *WKQTGetSitesInMediaDownloadCache();
328 void WKQTClearMediaDownloadCacheForSite(NSString *site);
329 void WKQTClearMediaDownloadCache();
330     
331 mach_port_t WKInitializeRenderServer(void);
332     
333 @class CALayer;
334
335 CALayer *WKMakeRenderLayer(uint32_t contextID);
336     
337 typedef struct __WKSoftwareCARendererRef *WKSoftwareCARendererRef;
338
339 WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
340 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
341 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
342
343 typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
344
345 WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
346 void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
347 uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
348 void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
349 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
350
351 typedef struct __WKCAContextRef *WKCAContextRef;
352
353 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
354 WKCAContextRef WKCAContextMakeRemoteForWindowServer(void);
355 void WKCAContextInvalidate(WKCAContextRef);
356 uint32_t WKCAContextGetContextId(WKCAContextRef);
357 void WKCAContextSetLayer(WKCAContextRef, CALayer *);
358 CALayer *WKCAContextGetLayer(WKCAContextRef);
359 void WKCAContextSetColorSpace(WKCAContextRef, CGColorSpaceRef);
360 CGColorSpaceRef WKCAContextGetColorSpace(WKCAContextRef);
361
362 void WKCALayerEnumerateRectsBeingDrawnWithBlock(CALayer *layer, CGContextRef context, void (^block)(CGRect rect));
363
364 @class CARenderer;
365
366 void WKCARendererAddChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
367 void WKCARendererRemoveChangeNotificationObserver(CARenderer *, void (*callback)(void*), void* context);
368
369 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
370
371 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
372 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
373 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
374
375 void WKWindowSetClipRect(NSWindow*, NSRect);
376
377 #if defined(__x86_64__)
378 #import <mach/mig.h>
379 CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
380 #endif // defined(__x86_64__)
381
382 NSUInteger WKGetInputPanelWindowStyle(void);
383 UInt8 WKGetNSEventKeyChar(NSEvent *);
384
385 @class CAPropertyAnimation;
386 void WKSetCAAnimationValueFunction(CAPropertyAnimation*, NSString* function);
387
388 unsigned WKInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
389 int WKGetHTTPPipeliningPriority(CFURLRequestRef);
390 void WKSetHTTPPipeliningMaximumPriority(int maximumPriority);
391 void WKSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
392 void WKSetHTTPPipeliningMinimumFastLanePriority(int priority);
393
394 void WKSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
395 void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
396 CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
397
398 void WKWindowSetAlpha(NSWindow *window, float alphaValue);
399 void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScaledFrame);
400
401 void WKSyncSurfaceToView(NSView *view);
402
403 void WKEnableSettingCursorWhenInBackground(void);
404
405 CFDictionaryRef WKNSURLRequestCreateSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull);
406 NSURLRequest *WKNSURLRequestFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
407
408 CFDictionaryRef WKNSURLResponseCreateSerializableRepresentation(NSURLResponse *response, CFTypeRef tokenNull);
409 NSURLResponse *WKNSURLResponseFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
410
411 #ifndef __LP64__
412 ScriptCode WKGetScriptCodeFromCurrentKeyboardInputSource(void);
413 #endif
414
415 CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStore(void);
416 void WKCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostArray);    
417
418 CFStringRef WKGetCFURLResponseMIMEType(CFURLResponseRef);
419 CFURLRef WKGetCFURLResponseURL(CFURLResponseRef);
420 CFHTTPMessageRef WKGetCFURLResponseHTTPResponse(CFURLResponseRef);
421 CFStringRef WKCopyCFURLResponseSuggestedFilename(CFURLResponseRef);
422 void WKSetCFURLResponseMIMEType(CFURLResponseRef, CFStringRef mimeType);
423
424 CIFormat WKCIGetRGBA8Format(void);
425
426 typedef enum {
427     WKSandboxExtensionTypeReadOnly,
428     WKSandboxExtensionTypeWriteOnly,    
429     WKSandboxExtensionTypeReadWrite,
430 } WKSandboxExtensionType;
431 typedef struct __WKSandboxExtension *WKSandboxExtensionRef;
432
433 WKSandboxExtensionRef WKSandboxExtensionCreate(const char* path, WKSandboxExtensionType type);
434 void WKSandboxExtensionDestroy(WKSandboxExtensionRef sandboxExtension);
435
436 bool WKSandboxExtensionConsume(WKSandboxExtensionRef sandboxExtension);
437 bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
438
439 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
440 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
441
442 OSStatus WKEnableSandboxStyleFileQuarantine(void);
443
444 bool WKEnterPluginSandbox(const char* profile, const char* parameters[], const char* readOnlyPaths[], const char* readWritePaths[]);
445
446 int WKRecommendedScrollerStyle(void);
447
448 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
449
450 NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
451 void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
452 void WKHideWordDefinitionWindow(void);
453
454 CFStringRef WKCopyDefaultSearchProviderDisplayName(void);
455
456 void WKSetCrashReportApplicationSpecificInformation(CFStringRef);
457
458 NSURL* WKAVAssetResolvedURL(AVAsset*);
459
460 NSCursor *WKCursor(const char *name);
461
462 dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void);
463
464 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
465 NSString *WKGetMacOSXVersionString(void);
466 bool WKExecutableWasLinkedOnOrBeforeLion(void);
467 #endif
468
469 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight);
470
471 void WKCFURLRequestAllowAllPostCaching(CFURLRequestRef);
472
473 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
474 @class WebFilterEvaluator;
475
476 BOOL WKFilterIsManagedSession(void);
477 WebFilterEvaluator *WKFilterCreateInstance(NSURLResponse *);
478 void WKFilterRelease(WebFilterEvaluator *);
479 BOOL WKFilterWasBlocked(WebFilterEvaluator *);
480 const char* WKFilterAddData(WebFilterEvaluator *, const char* data, int* length);
481 const char* WKFilterDataComplete(WebFilterEvaluator *, int* length);
482
483 CGFloat WKNSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
484 CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
485 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
486 #endif
487
488 typedef enum {
489     WKCaptionFontStyleDefault = 0,
490     WKCaptionFontStyleMonospacedWithSerif,
491     WKCaptionFontStyleProportionalWithSerif,
492     WKCaptionFontStyleMonospacedWithoutSerif,
493     WKCaptionFontStyleProportionalWithoutSerif,
494     WKCaptionFontStyleCasual,
495     WKCaptionFontStyleCursive,
496     WKCaptionFontStyleSmallCapital,
497     WKCaptionFontStyleMax
498 } WKCaptionFontStyle;
499
500 typedef enum {
501     WKCaptionTextEdgeStyleUndefined = 0,
502     WKCaptionTextEdgeStyleNone,
503     WKCaptionTextEdgeStyleRaised,
504     WKCaptionTextEdgeStyleDepressed,
505     WKCaptionTextEdgeStyleUniform,
506     WKCaptionTextEdgeStyleDropShadow,
507     WKCaptionTextEdgeStyleMax
508 } WKCaptionTextEdgeStyle;
509
510 bool WKCaptionAppearanceHasUserPreferences(void);
511 bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
512 CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
513 CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
514 CGColorRef WKCaptionAppearanceCopyWindowColor(void);
515 bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
516 bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
517 bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
518 CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
519 bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
520 int WKCaptionAppearanceGetTextEdgeStyle(void);
521 CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
522
523 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
524 typedef enum {
525     WKOcclusionNotificationTypeApplicationBecameVisible,
526     WKOcclusionNotificationTypeApplicationBecameOccluded
527 } WKOcclusionNotificationType;
528
529 typedef void (*WKOcclusionNotificationHandler)(uint32_t, void*, uint32_t, void*, uint32_t);
530
531 bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
532 bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler);
533 #endif
534
535 bool WKIsJavaPlugInActive(void);
536 void WKActivateJavaPlugIn(void);
537
538 #ifdef __cplusplus
539 }
540 #endif