1/*
2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Computer, 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 COMPUTER, 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 COMPUTER, 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#import <Foundation/Foundation.h>
29
30void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
31BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
32CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
33NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
34NSString* (*wkCreateURLPasteboardFlavorTypeName)(void);
35NSString* (*wkCreateURLNPasteboardFlavorTypeName)(void);
36void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
37void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
38void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
39void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
40void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
41NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
42NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
43BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
44void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
45    float duration, unsigned state);
46BOOL (*wkHitTestMediaUIPart)(int part, int themeStyle, CGRect bounds, CGPoint point);
47void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
48void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
49NSView *(*wkCreateMediaUIBackgroundView)(void);
50NSControl *(*wkCreateMediaUIControl)(int);
51void (*wkWindowSetAlpha)(NSWindow *, float);
52void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
53BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
54NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
55CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
56NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
57NSString* (*wkGetMIMETypeForExtension)(NSString*);
58NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
59NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
60BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
61void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
62void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
63unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
64int (*wkQTMovieDataRate)(QTMovie*);
65void (*wkQTMovieDisableComponent)(uint32_t[5]);
66float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
67NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
68float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
69int (*wkQTMovieGetType)(QTMovie*);
70BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
71NSURL *(*wkQTMovieResolvedURL)(QTMovie*);
72void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
73void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
74void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
75NSArray *(*wkQTGetSitesInMediaDownloadCache)();
76void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
77void (*wkQTClearMediaDownloadCache)();
78
79void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
80void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
81void (*wkSetDragImage)(NSImage*, NSPoint offset);
82void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
83void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
84CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
85void (*wkSetUpFontCache)();
86void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
87void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
88void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
89CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
90    void (*formFinalize)(CFReadStreamRef, void *),
91    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
92    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
93    Boolean (*formCanRead)(CFReadStreamRef, void *),
94    void (*formClose)(CFReadStreamRef, void *),
95    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
96    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
97    void *context);
98void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
99void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
100id (*wkCreateNSURLConnectionDelegateProxy)(void);
101unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
102int (*wkGetHTTPPipeliningPriority)(NSURLRequest *);
103void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
104void (*wkSetHTTPPipeliningPriority)(NSMutableURLRequest *, int priority);
105void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
106void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
107void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
108CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
109
110void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
111
112#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
113void* wkGetHyphenationLocationBeforeIndex;
114#else
115CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
116int (*wkGetNSEventMomentumPhase)(NSEvent *);
117#endif
118
119CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
120#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
121CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
122
123CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
124CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
125
126WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
127WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
128void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
129void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
130void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
131int (*wkScrollbarThickness)(int controlSize);
132int (*wkScrollbarMinimumThumbLength)(WKScrollbarPainterRef);
133int (*wkScrollbarMinimumTotalLengthNeededForThumb)(WKScrollbarPainterRef);
134CGFloat (*wkScrollbarPainterKnobAlpha)(WKScrollbarPainterRef);
135void (*wkSetScrollbarPainterKnobAlpha)(WKScrollbarPainterRef, CGFloat);
136CGFloat (*wkScrollbarPainterTrackAlpha)(WKScrollbarPainterRef);
137void (*wkSetScrollbarPainterTrackAlpha)(WKScrollbarPainterRef, CGFloat);
138bool (*wkScrollbarPainterIsHorizontal)(WKScrollbarPainterRef);
139CGRect (*wkScrollbarPainterKnobRect)(WKScrollbarPainterRef);
140void (*wkScrollbarPainterSetOverlayState)(WKScrollbarPainterRef, int overlayScrollerState);
141void (*wkSetScrollbarPainterKnobStyle)(WKScrollbarPainterRef, wkScrollerKnobStyle);
142
143WKScrollbarPainterControllerRef (*wkMakeScrollbarPainterController)(id painterControllerDelegate);
144void (*wkSetPainterForPainterController)(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
145WKScrollbarPainterRef (*wkVerticalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
146WKScrollbarPainterRef (*wkHorizontalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
147void (*wkSetScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef, int newStyle);
148void (*wkContentAreaScrolled)(WKScrollbarPainterControllerRef);
149void (*wkContentAreaWillPaint)(WKScrollbarPainterControllerRef);
150void (*wkMouseEnteredContentArea)(WKScrollbarPainterControllerRef);
151void (*wkMouseExitedContentArea)(WKScrollbarPainterControllerRef);
152void (*wkMouseMovedInContentArea)(WKScrollbarPainterControllerRef);
153void (*wkWillStartLiveResize)(WKScrollbarPainterControllerRef);
154void (*wkContentAreaResized)(WKScrollbarPainterControllerRef);
155void (*wkWillEndLiveResize)(WKScrollbarPainterControllerRef);
156void (*wkContentAreaDidShow)(WKScrollbarPainterControllerRef);
157void (*wkContentAreaDidHide)(WKScrollbarPainterControllerRef);
158void (*wkDidBeginScrollGesture)(WKScrollbarPainterControllerRef);
159void (*wkDidEndScrollGesture)(WKScrollbarPainterControllerRef);
160
161bool (*wkScrollbarPainterUsesOverlayScrollers)(void);
162
163NSURL *(*wkAVAssetResolvedURL)(AVAsset*);
164#endif
165
166void (*wkUnregisterUniqueIdForElement)(id element);
167void (*wkAccessibilityHandleFocusChanged)(void);
168CFTypeID (*wkGetAXTextMarkerTypeID)(void);
169CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void);
170CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end);
171CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range);
172CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range);
173CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
174BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
175AXUIElementRef (*wkCreateAXUIElementRef)(id element);
176
177CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
178NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
179CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
180unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
181NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
182void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
183void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
184
185CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
186CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
187CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
188CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
189void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
190