2 WebKitSystemInterface.h
3 Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
12 WKCertificateParseResultSucceeded = 0,
13 WKCertificateParseResultFailed = 1,
14 WKCertificateParseResultPKCS7 = 2,
15 } WKCertificateParseResult;
17 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
18 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
19 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
21 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
22 NSArray *WKGetExtensionsForMIMEType(NSString *type);
23 NSString *WKGetMIMETypeForExtension(NSString *extension);
25 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
26 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
27 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
28 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
30 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
32 float WKSecondsSinceLastInputEvent();
33 CGColorSpaceRef WKCreateUncorrectedRGBColorSpace();
34 CGColorSpaceRef WKCreateUncorrectedGrayColorSpace();
35 CFStringRef WKPreferRGB32Key();
37 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
38 float WKSecondsSinceLastInputEvent(void);
40 void WKShowKeyAndMain(void);
41 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
42 unsigned WKCarbonWindowMask(void);
43 void *WKGetNativeWindowFromWindowRef(WindowRef);
44 OSType WKCarbonWindowPropertyCreator(void);
45 OSType WKCarbonWindowPropertyTag(void);
47 typedef id WKNSURLConnectionDelegateProxyPtr;
49 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy();
51 void WKDisableCGDeferredUpdates();
53 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
55 unsigned WKGetNSAutoreleasePoolCount();
57 NSString *WKMouseMovedNotification();
59 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
61 CFTypeID WKGetAXTextMarkerTypeID();
62 CFTypeID WKGetAXTextMarkerRangeTypeID();
63 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
64 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
65 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
66 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
67 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
68 void WKAccessibilityHandleFocusChanged();
69 AXUIElementRef WKCreateAXUIElementRef(id element);
70 void WKUnregisterUniqueIdForElement(id element);
72 BOOL WKFontSmoothingModeIsLCD(int mode);
73 void WKSetUpFontCache(size_t s);
75 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
76 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
77 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
79 CFReadStreamRef 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 *),
89 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
90 void WKSetDragImage(NSImage *image, NSPoint offset);
92 void WKSendUserChangeNotifications();
93 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
94 void WKSendKeyEventToTSM(NSEvent *theEvent);
95 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
97 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
98 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
99 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
100 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
101 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
102 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
103 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
104 void WKReleaseStyleGroup(void *group);
105 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
107 #define WKGlyphVectorSize (50 * 32)
109 typedef void *WKGlyphVectorRef;
110 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
111 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
112 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
113 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
115 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
116 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
117 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
118 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
120 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
121 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
122 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);