2 WebKitSystemInterface.h
3 Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
8 #import <Cocoa/Cocoa.h>
9 #import <Carbon/Carbon.h>
16 WKCertificateParseResultSucceeded = 0,
17 WKCertificateParseResultFailed = 1,
18 WKCertificateParseResultPKCS7 = 2,
19 } WKCertificateParseResult;
21 NSString *WKCreateURLPasteboardFlavorTypeName(void);
22 NSString *WKCreateURLNPasteboardFlavorTypeName(void);
24 CFStringRef WKCopyCFLocalizationPreferredName(CFStringRef localization);
25 CFStringRef WKSignedPublicKeyAndChallengeString(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
26 WKCertificateParseResult WKAddCertificatesToKeychainFromData(const void *bytes, unsigned length);
28 NSString *WKGetPreferredExtensionForMIMEType(NSString *type);
29 NSArray *WKGetExtensionsForMIMEType(NSString *type);
30 NSString *WKGetMIMETypeForExtension(NSString *extension);
32 NSDate *WKGetNSURLResponseLastModifiedDate(NSURLResponse *response);
33 NSTimeInterval WKGetNSURLResponseFreshnessLifetime(NSURLResponse *response);
34 NSTimeInterval WKGetNSURLResponseCalculatedExpiration(NSURLResponse *response);
35 BOOL WKGetNSURLResponseMustRevalidate(NSURLResponse *response);
37 CFStringEncoding WKGetWebDefaultCFStringEncoding(void);
39 float WKSecondsSinceLastInputEvent(void);
40 CFStringRef WKPreferRGB32Key(void);
42 void WKSetNSURLConnectionDefersCallbacks(NSURLConnection *connection, BOOL defers);
43 float WKSecondsSinceLastInputEvent(void);
45 void WKShowKeyAndMain(void);
46 OSStatus WKSyncWindowWithCGAfterMove(WindowRef);
47 unsigned WKCarbonWindowMask(void);
48 void *WKGetNativeWindowFromWindowRef(WindowRef);
49 OSType WKCarbonWindowPropertyCreator(void);
50 OSType WKCarbonWindowPropertyTag(void);
52 typedef id WKNSURLConnectionDelegateProxyPtr;
54 WKNSURLConnectionDelegateProxyPtr WKCreateNSURLConnectionDelegateProxy(void);
56 void WKDisableCGDeferredUpdates(void);
58 Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
60 unsigned WKGetNSAutoreleasePoolCount(void);
62 NSString *WKMouseMovedNotification(void);
63 void WKSetNSWindowShouldPostEventNotifications(NSWindow *window, BOOL post);
65 CFTypeID WKGetAXTextMarkerTypeID(void);
66 CFTypeID WKGetAXTextMarkerRangeTypeID(void);
67 CFTypeRef WKCreateAXTextMarker(const void *bytes, size_t len);
68 BOOL WKGetBytesFromAXTextMarker(CFTypeRef textMarker, void *bytes, size_t length);
69 CFTypeRef WKCreateAXTextMarkerRange(CFTypeRef start, CFTypeRef end);
70 CFTypeRef WKCopyAXTextMarkerRangeStart(CFTypeRef range);
71 CFTypeRef WKCopyAXTextMarkerRangeEnd(CFTypeRef range);
72 void WKAccessibilityHandleFocusChanged(void);
73 AXUIElementRef WKCreateAXUIElementRef(id element);
74 void WKUnregisterUniqueIdForElement(id element);
76 BOOL WKFontSmoothingModeIsLCD(int mode);
77 void WKSetUpFontCache(size_t s);
79 void WKSignalCFReadStreamEnd(CFReadStreamRef stream);
80 void WKSignalCFReadStreamHasBytes(CFReadStreamRef stream);
81 void WKSignalCFReadStreamError(CFReadStreamRef stream, CFStreamError *error);
83 CFReadStreamRef WKCreateCustomCFReadStream(void *(*formCreate)(CFReadStreamRef, void *),
84 void (*formFinalize)(CFReadStreamRef, void *),
85 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
86 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
87 Boolean (*formCanRead)(CFReadStreamRef, void *),
88 void (*formClose)(CFReadStreamRef, void *),
89 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
90 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
93 void WKDrawFocusRing(CGContextRef context, CGRect clipRect, CGColorRef color, int radius);
94 // Ignore the context's clipping.
95 // The CG context's current path is the focus ring's path.
96 // A color of 0 means "use system focus ring color".
97 // A radius of 0 means "use default focus ring radius".
99 void WKSetDragImage(NSImage *image, NSPoint offset);
101 void WKDrawBezeledTextFieldCell(NSRect, BOOL enabled);
102 void WKDrawTextFieldCellFocusRing(NSTextFieldCell*, NSRect);
103 void WKDrawBezeledTextArea(NSRect, BOOL enabled);
104 void WKPopupMenu(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
106 void WKSendUserChangeNotifications(void);
107 BOOL WKConvertNSEventToCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent);
108 void WKSendKeyEventToTSM(NSEvent *theEvent);
109 void WKCallDrawingNotification(CGrafPtr port, Rect *bounds);
111 BOOL WKGetGlyphTransformedAdvances(NSFont *font, CGAffineTransform *m, ATSGlyphRef *glyph, CGSize *advance);
112 CGFontRef WKGetCGFontFromNSFont(NSFont *font);
113 void WKGetFontMetrics(NSFont *font, int *ascent, int *descent, int *lineGap, unsigned *unitsPerEm);
114 NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
115 NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
116 void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
117 ATSUFontID WKGetNSFontATSUFontId(NSFont *font);
118 void WKReleaseStyleGroup(void *group);
119 BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
121 void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
123 #define WKGlyphVectorSize (50 * 32)
125 typedef void *WKGlyphVectorRef;
126 OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
127 OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
128 OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
129 void WKClearGlyphVector(WKGlyphVectorRef glyphs);
131 int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
132 ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
133 size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
134 ATSGlyphRef WKGetDefaultGlyphForChar(NSFont *font, UniChar c);
136 NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
137 NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
138 NSEvent *WKCreateNSEventWithCarbonClickEvent(EventRef inEvent, WindowRef windowRef);
140 CGContextRef WKNSWindowOverrideCGContext(NSWindow *, CGContextRef);
141 void WKNSWindowRestoreCGContext(NSWindow *, CGContextRef);
143 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
144 NSString* WKPathFromFont(NSFont *font);
146 BOOL WKCGContextIsBitmapContext(CGContextRef context);