2 * Copyright 2006 Apple Computer, 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 typedef signed char BOOL;
32 typedef struct CGRect CGRect;
35 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
36 typedef struct CGRect NSRect;
38 typedef struct _NSRect NSRect;
42 typedef struct CGPoint CGPoint;
45 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
46 typedef struct CGPoint NSPoint;
48 typedef struct _NSPoint NSPoint;
51 typedef struct _NSRange NSRange;
58 class NSURLConnection;
65 #define GLYPH_VECTOR_SIZE (50 * 32)
67 // In alphabetical order.
69 extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
70 extern void (*wkClearGlyphVector)(void* glyphs);
71 extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
72 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
73 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
74 extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
75 extern BOOL (*wkFontSmoothingModeIsLCD)(int mode);
76 extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
77 extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
78 extern ATSGlyphRef (*wkGetDefaultGlyphForChar)(NSFont*, UniChar);
79 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
80 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
81 extern void (*wkGetFontMetrics)(NSFont*, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
82 extern BOOL (*wkGetGlyphTransformedAdvances)(NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
83 extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
84 extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
85 extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
86 extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
87 extern ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
88 extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
89 extern NSString* (*wkPathFromFont)(NSFont*);
90 extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
91 extern void (*wkReleaseStyleGroup)(void* group);
92 extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
93 extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
94 extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
95 extern void (*wkSetUpFontCache)(size_t);
96 extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
97 extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
98 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
99 extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
100 void (*formFinalize)(CFReadStreamRef, void *),
101 Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
102 CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *),
103 Boolean (*formCanRead)(CFReadStreamRef, void *),
104 void (*formClose)(CFReadStreamRef, void *),
105 void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
106 void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
108 extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
109 extern id (*wkCreateNSURLConnectionDelegateProxy)(void);