OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WebCoreSystemInterface_h | 26 #ifndef WebCoreSystemInterface_h |
27 #define WebCoreSystemInterface_h | 27 #define WebCoreSystemInterface_h |
28 | 28 |
29 #include <objc/objc.h> | 29 #include <objc/objc.h> |
30 | 30 |
31 typedef const struct __CFString * CFStringRef; | |
32 typedef const struct __CFNumber * CFNumberRef; | |
33 typedef const struct __CFDictionary * CFDictionaryRef; | 31 typedef const struct __CFDictionary * CFDictionaryRef; |
34 typedef struct CGPoint CGPoint; | |
35 typedef struct CGSize CGSize; | 32 typedef struct CGSize CGSize; |
36 typedef struct CGRect CGRect; | 33 typedef struct CGRect CGRect; |
37 typedef struct CGAffineTransform CGAffineTransform; | 34 typedef struct CGAffineTransform CGAffineTransform; |
38 typedef struct CGContext *CGContextRef; | 35 typedef struct CGContext *CGContextRef; |
39 typedef struct CGImage *CGImageRef; | |
40 typedef struct CGColor *CGColorRef; | |
41 typedef struct CGFont *CGFontRef; | 36 typedef struct CGFont *CGFontRef; |
42 typedef struct CGColorSpace *CGColorSpaceRef; | |
43 typedef struct CGPattern *CGPatternRef; | |
44 typedef struct CGPath *CGMutablePathRef; | |
45 typedef unsigned short CGGlyph; | 37 typedef unsigned short CGGlyph; |
46 typedef struct __CFReadStream * CFReadStreamRef; | 38 |
47 typedef struct __CFRunLoop * CFRunLoopRef; | |
48 typedef struct __CFHTTPMessage *CFHTTPMessageRef; | |
49 typedef struct _CFURLResponse *CFURLResponseRef; | |
50 typedef const struct _CFURLRequest *CFURLRequestRef; | |
51 typedef const struct __CTFont * CTFontRef; | 39 typedef const struct __CTFont * CTFontRef; |
52 typedef const struct __CTLine * CTLineRef; | 40 typedef const struct __CTLine * CTLineRef; |
53 typedef const struct __CTTypesetter * CTTypesetterRef; | |
54 typedef const struct __AXUIElement *AXUIElementRef; | |
55 typedef struct _NSRange NSRange; | 41 typedef struct _NSRange NSRange; |
56 | 42 |
57 typedef UInt32 FMFont; | |
58 typedef FMFont ATSUFontID; | |
59 typedef UInt16 ATSGlyphRef; | 43 typedef UInt16 ATSGlyphRef; |
60 | 44 |
61 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES | 45 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES |
62 typedef struct CGPoint NSPoint; | 46 typedef struct CGPoint NSPoint; |
63 typedef struct CGRect NSRect; | 47 typedef struct CGRect NSRect; |
64 #else | 48 #else |
65 typedef struct _NSPoint NSPoint; | 49 typedef struct _NSPoint NSPoint; |
66 typedef struct _NSRect NSRect; | 50 typedef struct _NSRect NSRect; |
67 #endif | 51 #endif |
68 | 52 |
69 OBJC_CLASS AVAsset; | |
70 OBJC_CLASS CALayer; | |
71 OBJC_CLASS NSArray; | |
72 OBJC_CLASS NSButtonCell; | 53 OBJC_CLASS NSButtonCell; |
73 OBJC_CLASS NSControl; | |
74 OBJC_CLASS NSCursor; | |
75 OBJC_CLASS NSData; | |
76 OBJC_CLASS NSDate; | |
77 OBJC_CLASS NSEvent; | |
78 OBJC_CLASS NSFont; | 54 OBJC_CLASS NSFont; |
79 OBJC_CLASS NSHTTPCookie; | |
80 OBJC_CLASS NSImage; | |
81 OBJC_CLASS NSMenu; | |
82 OBJC_CLASS NSMutableURLRequest; | |
83 OBJC_CLASS NSString; | 55 OBJC_CLASS NSString; |
84 OBJC_CLASS NSTextFieldCell; | |
85 OBJC_CLASS NSURL; | |
86 OBJC_CLASS NSURLConnection; | |
87 OBJC_CLASS NSURLRequest; | |
88 OBJC_CLASS NSURLResponse; | |
89 OBJC_CLASS NSView; | |
90 OBJC_CLASS NSWindow; | |
91 OBJC_CLASS QTMovie; | |
92 OBJC_CLASS QTMovieView; | |
93 OBJC_CLASS WebFilterEvaluator; | |
94 | 56 |
95 extern "C" { | 57 extern "C" { |
96 | 58 |
97 // In alphabetical order. | 59 // In alphabetical order. |
98 | 60 |
99 extern void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *); | 61 extern void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *); |
100 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
101 extern void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRe
f, void (^block)(CGRect rect)); | |
102 #endif | |
103 | |
104 extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef); | |
105 typedef enum { | |
106 wkPatternTilingNoDistortion, | |
107 wkPatternTilingConstantSpacingMinimalDistortion, | |
108 wkPatternTilingConstantSpacing | |
109 } wkPatternTiling; | |
110 extern void (*wkCGContextResetClip)(CGContextRef); | |
111 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 | |
112 extern bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef); | |
113 #endif | |
114 extern CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffi
neTransform, int); | |
115 extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadS
treamRef, void *), | |
116 void (*formFinalize)(CFReadStreamRef, void *), | |
117 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), | |
118 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Bool
ean *, void *), | |
119 Boolean (*formCanRead)(CFReadStreamRef, void *), | |
120 void (*formClose)(CFReadStreamRef, void *), | |
121 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), | |
122 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), | |
123 void *context); | |
124 extern CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef); | |
125 extern NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*); | |
126 extern CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*); | |
127 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled); | 62 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled); |
128 extern void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect); | |
129 extern void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect); | 63 extern void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect); |
130 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled); | 64 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled); |
131 extern void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius); | |
132 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange); | 65 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange); |
133 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar); | 66 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar); |
134 extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransfo
rm*, ATSGlyphRef*, CGSize* advance); | 67 extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransfo
rm*, ATSGlyphRef*, CGSize* advance); |
135 extern CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFSt
ringRef challenge, CFStringRef keyDescription); | |
136 extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*); | |
137 extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*); | |
138 extern NSString* (*wkGetMIMETypeForExtension)(NSString*); | |
139 extern ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*); | |
140 extern double (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response)
; | |
141 extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response); | |
142 extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response); | |
143 extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOO
L* continuous); | |
144 extern UInt8 (*wkGetNSEventKeyChar)(NSEvent *); | |
145 | |
146 extern void (*wkWindowSetAlpha)(NSWindow *, float); | |
147 extern void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect); | |
148 extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int
selectedItem, NSFont*); | |
149 extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void); | |
150 extern int (*wkQTMovieDataRate)(QTMovie*); | |
151 extern void (*wkQTMovieDisableComponent)(uint32_t[5]); | |
152 extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*); | |
153 extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void); | |
154 extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*); | |
155 extern int (*wkQTMovieGetType)(QTMovie*); | |
156 extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*); | |
157 extern NSURL *(*wkQTMovieResolvedURL)(QTMovie*); | |
158 extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL); | |
159 extern void (*wkQTMovieSelectPreferredAlternates)(QTMovie*); | |
160 extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL); | |
161 extern NSArray *(*wkQTGetSitesInMediaDownloadCache)(); | |
162 extern void (*wkQTClearMediaDownloadCacheForSite)(NSString *site); | |
163 extern void (*wkQTClearMediaDownloadCache)(); | |
164 extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*); | |
165 extern void (*wkSetDragImage)(NSImage*, NSPoint offset); | |
166 extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL); | |
167 extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL); | |
168 extern void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform); | |
169 extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint); | |
170 extern CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef); | |
171 extern void (*wkSetUpFontCache)(); | 68 extern void (*wkSetUpFontCache)(); |
172 extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream); | |
173 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *
error); | |
174 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream); | |
175 extern unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned prefer
redConnectionCount); | |
176 extern int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef); | |
177 extern void (*wkSetHTTPPipeliningMaximumPriority)(int maximumPriority); | |
178 extern void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority); | |
179 extern void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority); | |
180 extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost
, CFNumberRef proxyPort); | |
181 extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFString
Ref proxyAuthorizationString); | |
182 extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef
responseURL); | |
183 | |
184 extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], s
ize_t); | 69 extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], s
ize_t); |
185 extern bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGl
yph[], size_t); | 70 extern bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGl
yph[], size_t); |
186 | |
187 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
188 extern void* wkGetHyphenationLocationBeforeIndex; | |
189 #else | |
190 extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFInde
x index); | |
191 | |
192 typedef enum { | |
193 wkEventPhaseNone = 0, | |
194 wkEventPhaseBegan = 1, | |
195 wkEventPhaseChanged = 2, | |
196 wkEventPhaseEnded = 3, | |
197 } wkEventPhase; | |
198 | |
199 extern int (*wkGetNSEventMomentumPhase)(NSEvent *); | |
200 #endif | |
201 | |
202 extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(
CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), vo
id (*dispose)(const UniChar* chars, void*), void*); | 71 extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(
CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), vo
id (*dispose)(const UniChar* chars, void*), void*); |
203 | 72 |
204 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 | 73 } // extern "C" |
205 enum { | |
206 wkCTFontTransformApplyShaping = (1 << 0), | |
207 wkCTFontTransformApplyPositioning = (1 << 1) | |
208 }; | |
209 | |
210 typedef int wkCTFontTransformOptions; | |
211 | |
212 extern bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize
advances[], CFIndex count, wkCTFontTransformOptions options); | |
213 #endif | |
214 | |
215 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
216 | |
217 extern CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(cons
t UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef*
attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDicti
onaryRef options); | |
218 | |
219 extern int (*wkRecommendedScrollerStyle)(void); | |
220 | |
221 extern bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void); | |
222 | |
223 extern CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void); | |
224 extern void (*wkSetCrashReportApplicationSpecificInformation)(CFStringRef); | |
225 | |
226 extern NSURL *(*wkAVAssetResolvedURL)(AVAsset*); | |
227 | |
228 extern NSCursor *(*wkCursor)(const char*); | |
229 | 74 |
230 #endif | 75 #endif |
231 | |
232 extern void (*wkUnregisterUniqueIdForElement)(id element); | |
233 extern void (*wkAccessibilityHandleFocusChanged)(void); | |
234 extern CFTypeID (*wkGetAXTextMarkerTypeID)(void); | |
235 extern CFTypeID (*wkGetAXTextMarkerRangeTypeID)(void); | |
236 extern CFTypeRef (*wkCreateAXTextMarkerRange)(CFTypeRef start, CFTypeRef end); | |
237 extern CFTypeRef (*wkCopyAXTextMarkerRangeStart)(CFTypeRef range); | |
238 extern CFTypeRef (*wkCopyAXTextMarkerRangeEnd)(CFTypeRef range); | |
239 extern CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len); | |
240 extern BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, siz
e_t length); | |
241 extern AXUIElementRef (*wkCreateAXUIElementRef)(id element); | |
242 | |
243 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060 | |
244 typedef struct __CFURLStorageSession* CFURLStorageSessionRef; | |
245 #else | |
246 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef; | |
247 #endif | |
248 extern CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef); | |
249 extern NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef,
NSURLRequest*); | |
250 | |
251 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef; | |
252 extern CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef)
; | |
253 extern unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef); | |
254 extern void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned); | |
255 extern NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef); | |
256 extern NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *); | |
257 extern void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *
, NSURL *); | |
258 extern void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *); | |
259 extern void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef); | |
260 | |
261 extern CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef); | |
262 extern CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef); | |
263 extern CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef); | |
264 extern CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef); | |
265 extern void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType
); | |
266 | |
267 extern void(*wkDestroyRenderingResources)(void); | |
268 | |
269 extern void (*wkSetMetadataURL)(NSString *urlString, NSString *referrer, NSStrin
g *path); | |
270 | |
271 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
272 #import <dispatch/dispatch.h> | |
273 | |
274 extern dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void); | |
275 | |
276 #endif | |
277 | |
278 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 | |
279 extern bool (*wkExecutableWasLinkedOnOrBeforeLion)(void); | |
280 #endif | |
281 | |
282 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
283 extern void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTrans
form* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); | |
284 #endif | |
285 | |
286 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 | |
287 extern void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef); | |
288 #endif | |
289 | |
290 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 | |
291 extern CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat
initialVelocity, CGFloat elapsedTime); | |
292 extern CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta); | |
293 extern CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta); | |
294 #endif | |
295 | |
296 } | |
297 | |
298 #endif | |
OLD | NEW |