WebCoreSystemInterface.mm revision cad810f21b803229eb11403f9209855525a25d57
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*); 51NSArray* (*wkGetExtensionsForMIMEType)(NSString*); 52NSString* (*wkGetMIMETypeForExtension)(NSString*); 53NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response); 54NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response); 55BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response); 56void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous); 57void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*); 58unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void); 59int (*wkQTMovieDataRate)(QTMovie*); 60void (*wkQTMovieDisableComponent)(uint32_t[5]); 61float (*wkQTMovieMaxTimeLoaded)(QTMovie*); 62NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void); 63float (*wkQTMovieMaxTimeSeekable)(QTMovie*); 64int (*wkQTMovieGetType)(QTMovie*); 65BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*); 66void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL); 67void (*wkQTMovieSelectPreferredAlternates)(QTMovie*); 68void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL); 69void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*); 70void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL); 71void (*wkSetDragImage)(NSImage*, NSPoint offset); 72void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform); 73void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point); 74CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef); 75void (*wkSetUpFontCache)(); 76void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream); 77void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream); 78void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error); 79CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 80 void (*formFinalize)(CFReadStreamRef, void *), 81 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 82 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 83 Boolean (*formCanRead)(CFReadStreamRef, void *), 84 void (*formClose)(CFReadStreamRef, void *), 85 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 86 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 87 void *context); 88void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL); 89void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL); 90id (*wkCreateNSURLConnectionDelegateProxy)(void); 91unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount); 92void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort); 93void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString); 94CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL); 95BOOL (*wkIsLatchingWheelEvent)(NSEvent *); 96 97#ifndef BUILDING_ON_TIGER 98void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t); 99#else 100void (*wkClearGlyphVector)(void* glyphs); 101OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs); 102CFStringRef (*wkCopyFullFontName)(CGFontRef font); 103OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup); 104CGFontRef (*wkGetCGFontFromNSFont)(NSFont*); 105void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm); 106ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector); 107void* wkGetGlyphsForCharacters; 108int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector); 109size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector); 110OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs); 111void (*wkReleaseStyleGroup)(void* group); 112ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*); 113BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *); 114#endif 115 116#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 117void* wkGetHyphenationLocationBeforeIndex; 118#else 119CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index); 120#endif 121 122CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*); 123#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 124CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options); 125 126CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace); 127CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context); 128#endif 129