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 NSString *WKCreateURLPasteboardFlavorTypeName(void);
18 NSString *WKCreateURLNPasteboardFlavorTypeName(void);
20 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
21 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
22 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
24 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
25 NSArray *WKGetExtensionsForMIMEType(NSString *type);
26 NSString *WKGetMIMETypeForExtension(NSString *extension);
28 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
29 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
30 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
31 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
33 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
35 float WKSecondsSinceLastInputEvent();
36 CGColorSpaceRef WKCreateUncorrectedRGBColorSpace();
37 CGColorSpaceRef WKCreateUncorrectedGrayColorSpace();
38 CFStringRef WKPreferRGB32Key();
40 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
41 float WKSecondsSinceLastInputEvent(void);
43 void WKShowKeyAndMain(void);
44 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
45 unsigned WKCarbonWindowMask(void);
46 void *WKGetNativeWindowFromWindowRef(WindowRef);
47 OSType WKCarbonWindowPropertyCreator(void);
48 OSType WKCarbonWindowPropertyTag(void);
50 typedef id WKNSURLConnectionDelegateProxyPtr;
52 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy();
54 void WKDisableCGDeferredUpdates();
56 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
58 unsigned WKGetNSAutoreleasePoolCount();
60 NSString *WKMouseMovedNotification();
62 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
64 CFTypeID WKGetAXTextMarkerTypeID();
65 CFTypeID WKGetAXTextMarkerRangeTypeID();
66 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
67 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
68 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
69 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
70 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
71 void WKAccessibilityHandleFocusChanged();
72 AXUIElementRef WKCreateAXUIElementRef(id element);
73 void WKUnregisterUniqueIdForElement(id element);
75 BOOL WKFontSmoothingModeIsLCD(int mode);
76 void WKSetUpFontCache(size_t s);
78 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
79 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
80 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
82 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
83 void (*formFinalize)(CFReadStreamRef, void *),
84 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
85 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
86 Boolean (*formCanRead)(CFReadStreamRef, void *),
87 void (*formClose)(CFReadStreamRef, void *),
88 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
89 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
92 void WKSetFocusRingStyle(NSFocusRingPlacement placement, int radius, NSColor *color);
93 void WKSetDragImage(NSImage *image, NSPoint offset);
95 void WKSendUserChangeNotifications();
96 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
97 void WKSendKeyEventToTSM(NSEvent *theEvent);
98 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
100 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
101 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
102 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
103 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
104 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
105 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
106 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
107 void WKReleaseStyleGroup(void *group);
108 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
110 #define WKGlyphVectorSize (50 * 32)
112 typedef void *WKGlyphVectorRef;
113 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
114 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
115 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
116 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
118 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
119 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
120 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
121 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
123 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
124 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
125 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);