2
* Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions
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.
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.
26
#ifndef WebKitSystemInterface_h
27
#define WebKitSystemInterface_h
29
struct CGAffineTransform;
33
struct IDirect3DDevice9;
35
struct WKCACFUpdateRectEnumerator;
37
typedef struct _CACFLayer* CACFLayerRef;
38
typedef const struct __CFArray* CFArrayRef;
39
typedef const struct __CFData* CFDataRef;
40
typedef const struct __CFString* CFStringRef;
41
typedef double CFTimeInterval;
42
typedef struct CGColor* CGColorRef;
43
typedef struct CGContext* CGContextRef;
44
typedef unsigned short CGFontIndex;
45
typedef struct CGFont* CGFontRef;
46
typedef CGFontIndex CGGlyph;
47
typedef struct CGImage* CGImageRef;
48
typedef struct CGPattern* CGPatternRef;
49
typedef wchar_t UChar;
50
typedef struct _CFURLResponse* CFURLResponseRef;
51
typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
52
typedef struct __CFDictionary* CFMutableDictionaryRef;
53
typedef struct _CFURLRequest* CFMutableURLRequestRef;
54
typedef const struct _CFURLRequest* CFURLRequestRef;
55
typedef struct __CFHTTPMessage* CFHTTPMessageRef;
56
typedef const struct __CFNumber* CFNumberRef;
57
typedef struct __CFReadStream* CFReadStreamRef;
58
typedef const struct __CFURL* CFURLRef;
59
typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
60
typedef struct tagLOGFONTW LOGFONTW;
61
typedef LOGFONTW LOGFONT;
62
typedef struct _CACFLayer *CACFLayerRef;
63
typedef struct __CVBuffer *CVBufferRef;
64
typedef CVBufferRef CVImageBufferRef;
65
typedef CVImageBufferRef CVPixelBufferRef;
66
typedef struct _CAImageQueue *CAImageQueueRef;
67
typedef unsigned long CFTypeID;
68
typedef struct _CFURLCredential* WKCFURLCredentialRef;
69
typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
70
typedef const struct _CFURLCache* CFURLCacheRef;
72
void wkSetFontSmoothingLevel(int type);
73
int wkGetFontSmoothingLevel();
74
void wkSetFontSmoothingContrast(CGFloat);
75
CGFloat wkGetFontSmoothingContrast();
76
void wkSystemFontSmoothingChanged();
77
uint32_t wkSetFontSmoothingStyle(CGContextRef cg, bool fontAllowsSmoothing);
78
void wkRestoreFontSmoothingStyle(CGContextRef cg, uint32_t oldStyle);
79
void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont, bool usePlatformNativeGlyphs);
80
void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
81
void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
82
void wkSetUpFontCache(size_t s);
84
void wkSetBaseCTM(CGContextRef, CGAffineTransform);
85
void wkSetPatternPhaseInUserSpace(CGContextRef, CGPoint phasePoint);
86
CGAffineTransform wkGetUserToBaseCTM(CGContextRef);
88
void wkDrawFocusRing(CGContextRef, CGColorRef, float radius);
90
CFDictionaryRef wkGetSSLCertificateInfo(CFURLResponseRef);
91
CFDataRef wkGetSSLPeerCertificateData(CFDictionaryRef);
92
void* wkGetSSLPeerCertificateDataBytePtr(CFDictionaryRef);
93
void wkSetSSLPeerCertificateData(CFMutableDictionaryRef, CFDataRef);
94
void* wkGetSSLCertificateChainContext(CFDictionaryRef);
95
CFHTTPCookieStorageRef wkGetDefaultHTTPCookieStorage();
96
CFHTTPCookieStorageRef wkCreateInMemoryHTTPCookieStorage();
97
void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool);
98
CFStringRef wkCopyFoundationCacheDirectory(CFURLStorageSessionRef);
99
void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);
101
CFArrayRef wkCFURLRequestCopyHTTPRequestBodyParts(CFURLRequestRef);
102
void wkCFURLRequestSetHTTPRequestBodyParts(CFMutableURLRequestRef, CFArrayRef bodyParts);
104
CFURLStorageSessionRef wkCreatePrivateStorageSession(CFStringRef identifier, CFURLStorageSessionRef defaultStorageSession);
105
void wkSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
106
CFURLCacheRef wkCopyURLCache(CFURLStorageSessionRef);
107
CFHTTPCookieStorageRef wkCopyHTTPCookieStorage(CFURLStorageSessionRef);
108
CFDataRef wkCopySerializedDefaultStorageSession();
109
CFURLStorageSessionRef wkDeserializeStorageSession(CFDataRef);
111
CFArrayRef wkCFURLCacheCopyAllHostNamesInPersistentStore();
112
void wkCFURLCacheDeleteHostNamesInPersistentStore(CFArrayRef hostNames);
114
unsigned wkInitializeMaximumHTTPConnectionCountPerHost(unsigned preferredConnectionCount);
115
int wkGetHTTPPipeliningPriority(CFURLRequestRef);
116
void wkSetHTTPPipeliningMaximumPriority(int maximumPriority);
117
void wkSetHTTPPipeliningPriority(CFURLRequestRef, int priority);
119
void wkSetCONNECTProxyForStream(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
120
void wkSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
121
CFHTTPMessageRef wkCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
123
WKCFURLCredentialRef wkCopyCredentialFromCFPersistentStorage(CFURLProtectionSpaceRef protectionSpace);
125
CFStringRef wkCFNetworkErrorGetLocalizedDescription(CFIndex errorCode);
128
enum wkCAImageQueueFlags {
129
kWKCAImageQueueAsync = 1U << 0,
130
kWKCAImageQueueFill = 1U << 1,
131
kWKCAImageQueueProtected = 1U << 2,
132
kWKCAImageQueueUseCleanAperture = 1U << 3,
133
kWKCAImageQueueUseAspectRatio = 1U << 4,
134
kWKCAImageQueueLowQualityColor = 1U << 5,
137
enum wkWKCAImageQueueImageType {
138
kWKCAImageQueueNil = 1,
139
kWKCAImageQueueSurface,
140
kWKCAImageQueueBuffer,
141
kWKCAImageQueueIOSurface,
144
enum wkWKCAImageQueueImageFlags {
145
kWKCAImageQueueOpaque = 1U << 0,
146
kWKCAImageQueueFlush = 1U << 1,
147
kWKCAImageQueueWillFlush = 1U << 2,
148
kWKCAImageQueueFlipped = 1U << 3,
149
kWKCAImageQueueWaitGPU = 1U << 4,
152
typedef void (*wkCAImageQueueReleaseCallback)(unsigned int type, uint64_t id, void *info);
153
CAImageQueueRef wkCAImageQueueCreate(uint32_t width, uint32_t height, uint32_t capacity);
154
void wkCAImageQueueInvalidate(CAImageQueueRef iq);
155
size_t wkCAImageQueueCollect(CAImageQueueRef iq);
156
bool wkCAImageQueueInsertImage(CAImageQueueRef iq, CFTimeInterval t, unsigned int type, uint64_t id, uint32_t flags, wkCAImageQueueReleaseCallback release, void *info);
157
uint64_t wkCAImageQueueRegisterPixelBuffer(CAImageQueueRef iq, void *data, size_t data_size, size_t rowbytes, size_t width, size_t height, OSType pixel_format, CFDictionaryRef attachments, uint32_t flags);
158
void wkCAImageQueueSetFlags(CAImageQueueRef iq, uint32_t mask, uint32_t flags);
159
uint32_t wkCAImageQueueGetFlags(CAImageQueueRef iq);
160
CFTypeID wkCAImageQueueGetTypeID(void);
162
WKCACFContext* wkCACFContextCreate();
163
void wkCACFContextDestroy(WKCACFContext*);
165
void wkCACFContextSetLayer(WKCACFContext*, CACFLayerRef);
166
void wkCACFContextFlush(WKCACFContext*);
168
CFTimeInterval wkCACFContextGetLastCommitTime(WKCACFContext*);
169
CFTimeInterval wkCACFContextGetNextUpdateTime(WKCACFContext*);
171
void* wkCACFContextGetUserData(WKCACFContext*);
172
void wkCACFContextSetUserData(WKCACFContext*, void*);
174
void* wkCACFLayerGetContextUserData(CACFLayerRef);
176
void wkCACFContextSetD3DDevice(WKCACFContext*, IDirect3DDevice9*);
177
void wkCACFContextReleaseD3DResources(WKCACFContext*);
179
bool wkCACFContextBeginUpdate(WKCACFContext*, void* buffer, size_t bufferSize, CFTimeInterval time, const CGRect& bounds, const CGRect dirtyRects[], size_t dirtyRectCount);
180
void wkCACFContextRenderUpdate(WKCACFContext*);
181
void wkCACFContextFinishUpdate(WKCACFContext*);
182
void wkCACFContextAddUpdateRect(WKCACFContext*, const CGRect&);
184
WKCACFUpdateRectEnumerator* wkCACFContextCopyUpdateRectEnumerator(WKCACFContext*);
185
const CGRect* wkCACFUpdateRectEnumeratorNextRect(WKCACFUpdateRectEnumerator*);
186
void wkCACFUpdateRectEnumeratorRelease(WKCACFUpdateRectEnumerator*);
189
wkPatternTilingNoDistortion,
190
wkPatternTilingConstantSpacingMinimalDistortion,
191
wkPatternTilingConstantSpacing
194
CGPatternRef wkCGPatternCreateWithImageAndTransform(CGImageRef image, CGAffineTransform transform, int tiling);
196
CFDictionaryRef wkCFURLRequestCreateSerializableRepresentation(CFURLRequestRef cfRequest, CFTypeRef tokenNull);
197
CFURLRequestRef wkCFURLRequestCreateFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
198
CFDictionaryRef wkCFURLResponseCreateSerializableRepresentation(CFURLResponseRef cfResponse, CFTypeRef tokenNull);
199
CFURLResponseRef wkCFURLResponseCreateFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
201
typedef void (*wkQuickTimeMIMETypeCallBack)(const char* mimeType);
202
void wkGetQuickTimeMIMETypeList(wkQuickTimeMIMETypeCallBack);
205
WKMediaUIPartFullscreenButton = 0,
206
WKMediaUIPartMuteButton,
207
WKMediaUIPartPlayButton,
208
WKMediaUIPartSeekBackButton,
209
WKMediaUIPartSeekForwardButton,
210
WKMediaUIPartTimelineSlider,
211
WKMediaUIPartTimelineSliderThumb,
212
WKMediaUIPartRewindButton,
213
WKMediaUIPartSeekToRealtimeButton,
214
WKMediaUIPartShowClosedCaptionsButton,
215
WKMediaUIPartHideClosedCaptionsButton,
216
WKMediaUIPartUnMuteButton,
217
WKMediaUIPartPauseButton,
218
WKMediaUIPartBackground,
219
WKMediaUIPartCurrentTimeDisplay,
220
WKMediaUIPartTimeRemainingDisplay,
221
WKMediaUIPartStatusDisplay,
222
WKMediaUIPartControlsPanel,
223
WKMediaUIPartVolumeSliderContainer,
224
WKMediaUIPartVolumeSlider,
225
WKMediaUIPartVolumeSliderThumb,
226
WKMediaUIPartFullScreenVolumeSlider,
227
WKMediaUIPartFullScreenVolumeSliderThumb,
228
WKMediaUIPartVolumeSliderMuteButton,
229
WKMediaUIPartTextTrackDisplayContainer,
230
WKMediaUIPartTextTrackDisplay,
231
WKMediaUIPartExitFullscreenButton,
235
WKMediaControllerThemeClassic = 1,
236
WKMediaControllerThemeQuickTime = 2
237
} WKMediaControllerThemeStyle;
240
WKMediaControllerFlagDisabled = 1 << 0,
241
WKMediaControllerFlagPressed = 1 << 1,
242
WKMediaControllerFlagDrawEndCaps = 1 << 3,
243
WKMediaControllerFlagFocused = 1 << 4
244
} WKMediaControllerThemeState;
250
bool WKMediaControllerThemeAvailable(int themeStyle);
251
bool WKHitTestMediaUIPart(int part, int themeStyle, CGRect bounds, CGPoint point);
252
void WKMeasureMediaUIPart(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
253
void WKDrawMediaUIPart(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
254
void WKDrawMediaSliderTrack(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime, float duration, unsigned state);
260
#endif // WebKitSystemInterface_h