2 * Copyright 2006, 2007 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 WebCoreSystemInterface_h
27 #define WebCoreSystemInterface_h
29 #include <ApplicationServices/ApplicationServices.h>
30 #include <objc/objc.h>
32 typedef struct _NSRange NSRange;
34 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
35 typedef struct CGPoint NSPoint;
36 typedef struct CGRect NSRect;
38 typedef struct _NSPoint NSPoint;
39 typedef struct _NSRect NSRect;
45 @class NSMutableURLRequest;
48 typedef struct NSArray NSArray;
49 typedef struct NSDate NSDate;
50 typedef struct NSEvent NSEvent;
51 typedef struct NSFont NSFont;
52 typedef struct NSImage NSImage;
53 typedef struct NSMenu NSMenu;
54 typedef struct NSMutableURLRequest NSMutableURLRequest;
55 typedef struct NSURLRequest NSURLRequest;
56 typedef struct NSString NSString;
57 typedef struct NSTextFieldCell NSTextFieldCell;
58 typedef struct NSURLConnection NSURLConnection;
59 typedef struct NSURLResponse NSURLResponse;
60 typedef struct NSView NSView;
61 typedef struct objc_object *id;
68 #define GLYPH_VECTOR_SIZE (50 * 32)
70 // In alphabetical order.
72 extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
73 extern void (*wkClearGlyphVector)(void* glyphs);
74 extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
75 void (*formFinalize)(CFReadStreamRef, void *),
76 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
77 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
78 Boolean (*formCanRead)(CFReadStreamRef, void *),
79 void (*formClose)(CFReadStreamRef, void *),
80 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
81 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
83 extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
84 extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
85 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
86 extern void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
87 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
88 extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
89 extern BOOL (*wkFontSmoothingModeIsLCD)(int mode);
90 extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
91 extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
92 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
93 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
94 extern void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
95 extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
96 extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
97 extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
98 extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
99 extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
100 extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
101 extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
102 extern ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
103 extern double (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
104 extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
105 extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
106 extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
107 extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
108 extern NSString* (*wkPathFromFont)(NSFont*);
109 extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
110 extern void (*wkReleaseStyleGroup)(void* group);
111 extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
112 extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
113 extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
114 extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
115 extern void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
116 extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
117 extern void (*wkSetUpFontCache)(size_t);
118 extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
119 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
120 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
121 extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
122 extern Class (*wkNSURLProtocolClassForReqest)(NSURLRequest *);
123 extern float (*wkSecondsSinceLastInputEvent)(void);