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);
49BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
50NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
51CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
52NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
53NSString* (*wkGetMIMETypeForExtension)(NSString*);
54NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
55NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
56BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
57void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
58void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
59unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
60int (*wkQTMovieDataRate)(QTMovie*);
61void (*wkQTMovieDisableComponent)(uint32_t[5]);
62float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
63NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
64float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
65int (*wkQTMovieGetType)(QTMovie*);
66BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
67void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
68void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
69void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
70void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
71void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
72void (*wkSetDragImage)(NSImage*, NSPoint offset);
73void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
74void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
75CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
76void (*wkSetUpFontCache)();
77void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
78void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
79void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
80CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
81    void (*formFinalize)(CFReadStreamRef, void *),
82    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
83    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
84    Boolean (*formCanRead)(CFReadStreamRef, void *),
85    void (*formClose)(CFReadStreamRef, void *),
86    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
87    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
88    void *context);
89void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
90void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
91id (*wkCreateNSURLConnectionDelegateProxy)(void);
92unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
93int (*wkGetHTTPPipeliningPriority)(NSURLRequest *);
94void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
95void (*wkSetHTTPPipeliningPriority)(NSMutableURLRequest *, int priority);
96void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
97void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
98void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
99CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
100
101#ifndef BUILDING_ON_TIGER
102void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
103#else
104void (*wkClearGlyphVector)(void* glyphs);
105OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
106CFStringRef (*wkCopyFullFontName)(CGFontRef font);
107OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
108CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
109void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
110ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
111void* wkGetGlyphsForCharacters;
112int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
113size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
114OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
115void (*wkReleaseStyleGroup)(void* group);
116ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
117BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
118#endif
119
120#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
121void* wkGetHyphenationLocationBeforeIndex;
122#else
123CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
124int (*wkGetNSEventMomentumPhase)(NSEvent *);
125#endif
126
127CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
128#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
129CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
130
131CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
132CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
133
134WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
135WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
136void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
137void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
138void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
139int (*wkScrollbarThickness)(int controlSize);
140int (*wkScrollbarMinimumThumbLength)(WKScrollbarPainterRef);
141int (*wkScrollbarMinimumTotalLengthNeededForThumb)(WKScrollbarPainterRef);
142CGFloat (*wkScrollbarPainterKnobAlpha)(WKScrollbarPainterRef);
143void (*wkSetScrollbarPainterKnobAlpha)(WKScrollbarPainterRef, CGFloat);
144CGFloat (*wkScrollbarPainterTrackAlpha)(WKScrollbarPainterRef);
145void (*wkSetScrollbarPainterTrackAlpha)(WKScrollbarPainterRef, CGFloat);
146bool (*wkScrollbarPainterIsHorizontal)(WKScrollbarPainterRef);
147void (*wkScrollbarPainterSetOverlayState)(WKScrollbarPainterRef, int overlayScrollerState);
148
149WKScrollbarPainterControllerRef (*wkMakeScrollbarPainterController)(id painterControllerDelegate);
150void (*wkSetPainterForPainterController)(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
151WKScrollbarPainterRef (*wkVerticalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
152WKScrollbarPainterRef (*wkHorizontalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
153void (*wkSetScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef, int newStyle);
154void (*wkContentAreaScrolled)(WKScrollbarPainterControllerRef);
155void (*wkContentAreaWillPaint)(WKScrollbarPainterControllerRef);
156void (*wkMouseEnteredContentArea)(WKScrollbarPainterControllerRef);
157void (*wkMouseExitedContentArea)(WKScrollbarPainterControllerRef);
158void (*wkMouseMovedInContentArea)(WKScrollbarPainterControllerRef);
159void (*wkWillStartLiveResize)(WKScrollbarPainterControllerRef);
160void (*wkContentAreaResized)(WKScrollbarPainterControllerRef);
161void (*wkWillEndLiveResize)(WKScrollbarPainterControllerRef);
162void (*wkContentAreaDidShow)(WKScrollbarPainterControllerRef);
163void (*wkContentAreaDidHide)(WKScrollbarPainterControllerRef);
164void (*wkDidBeginScrollGesture)(WKScrollbarPainterControllerRef);
165void (*wkDidEndScrollGesture)(WKScrollbarPainterControllerRef);
166
167bool (*wkScrollbarPainterUsesOverlayScrollers)(void);
168#endif
169
170void (*wkUnregisterUniqueIdForElement)(id element);
171void (*wkAccessibilityHandleFocusChanged)(void);
172CFTypeID (*wkGetAXTextMarkerTypeID)(void);
173CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void);
174CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end);
175CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range);
176CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range);
177CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
178BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
179AXUIElementRef (*wkCreateAXUIElementRef)(id element);
180
181CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
182NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
183CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
184unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
185NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
186void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
187void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
188
189CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
190CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
191CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
192CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
193void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
194