[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:12:08 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d7e9a478d9adfc7d79d87066f2d981609ef93f44
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri May 10 22:11:04 2002 +0000
* WebCoreSupport.subproj/IFTextRenderer.h: Moved most of the
stuff from here into the .m file so this header can be included
by clients. Also added floatWidthForCharacters:length:.
* WebCoreSupport.subproj/IFTextRenderer.m:
(freeWidthMap): Check for NULL.
(freeGlyphMap): Check for NULL.
(-[IFTextRenderer slowFloatWidthForCharacters:length:]): Renamed,
and made it return the float.
(-[IFTextRenderer floatWidthForCharacters:length:]): Renamed, and
made it return the float.
(-[IFTextRenderer widthForCharacters:length:]): Do rounding here.
* WebCoreSupport.subproj/IFTextRendererFactory.h:
* WebCoreSupport.subproj/IFTextRendererFactory.m:
Make the interface slightly easier to use by using the specific types.
* WebKit.pbproj/project.pbxproj: Exported the headers.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4dfa938..7c569fc 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2002-05-10 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/IFTextRenderer.h: Moved most of the
+ stuff from here into the .m file so this header can be included
+ by clients. Also added floatWidthForCharacters:length:.
+ * WebCoreSupport.subproj/IFTextRenderer.m:
+ (freeWidthMap): Check for NULL.
+ (freeGlyphMap): Check for NULL.
+ (-[IFTextRenderer slowFloatWidthForCharacters:length:]): Renamed,
+ and made it return the float.
+ (-[IFTextRenderer floatWidthForCharacters:length:]): Renamed, and
+ made it return the float.
+ (-[IFTextRenderer widthForCharacters:length:]): Do rounding here.
+
+ * WebCoreSupport.subproj/IFTextRendererFactory.h:
+ * WebCoreSupport.subproj/IFTextRendererFactory.m:
+ Make the interface slightly easier to use by using the specific types.
+
+ * WebKit.pbproj/project.pbxproj: Exported the headers.
+
2002-05-10 Kenneth Kocienda <kocienda at apple.com>
Fixed build breakage caused by my previous checkin.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 4dfa938..7c569fc 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-05-10 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/IFTextRenderer.h: Moved most of the
+ stuff from here into the .m file so this header can be included
+ by clients. Also added floatWidthForCharacters:length:.
+ * WebCoreSupport.subproj/IFTextRenderer.m:
+ (freeWidthMap): Check for NULL.
+ (freeGlyphMap): Check for NULL.
+ (-[IFTextRenderer slowFloatWidthForCharacters:length:]): Renamed,
+ and made it return the float.
+ (-[IFTextRenderer floatWidthForCharacters:length:]): Renamed, and
+ made it return the float.
+ (-[IFTextRenderer widthForCharacters:length:]): Do rounding here.
+
+ * WebCoreSupport.subproj/IFTextRendererFactory.h:
+ * WebCoreSupport.subproj/IFTextRendererFactory.m:
+ Make the interface slightly easier to use by using the specific types.
+
+ * WebKit.pbproj/project.pbxproj: Exported the headers.
+
2002-05-10 Kenneth Kocienda <kocienda at apple.com>
Fixed build breakage caused by my previous checkin.
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRenderer.h b/WebKit/WebCoreSupport.subproj/IFTextRenderer.h
index 67d22bb..6c04c6c 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRenderer.h
+++ b/WebKit/WebCoreSupport.subproj/IFTextRenderer.h
@@ -7,24 +7,9 @@
//
#import <WebCoreTextRenderer.h>
-#import <QD/ATSUnicodePriv.h>
-typedef float IFGlyphWidth;
-
-
-typedef struct _WidthMap {
- ATSGlyphRef startRange;
- ATSGlyphRef endRange;
- struct _WidthMap *next;
- IFGlyphWidth *widths;
-} WidthMap;
-
-typedef struct _GlyphMap {
- UniChar startRange;
- UniChar endRange;
- struct _GlyphMap *next;
- ATSGlyphRef *glyphs;
-} GlyphMap;
+typedef struct WidthMap WidthMap;
+typedef struct GlyphMap GlyphMap;
@interface IFTextRenderer : NSObject <WebCoreTextRenderer>
{
@@ -32,7 +17,7 @@ typedef struct _GlyphMap {
int descent;
int lineSpacing;
- ATSStyleGroupPtr styleGroup;
+ struct AttributeGroup *styleGroup;
@public
NSFont *font;
@@ -41,10 +26,7 @@ typedef struct _GlyphMap {
}
- initWithFont:(NSFont *)font;
-- (void)convertCharacters: (const unichar *)characters length: (int)numCharacters glyphs: (ATSGlyphVector *)glyphs;
-- (ATSGlyphRef)extendCharacterToGlyphMapToInclude:(UniChar) c;
-- (WidthMap *)extendGlyphToWidthMapToInclude:(ATSGlyphRef)glyphID;
-- (bool) slowPackGlyphsForCharacters:(const UniChar *)characters numCharacters: (unsigned int)numCharacters glyphBuffer:(CGGlyph **)glyphBuffer numGlyphs:(unsigned int *)numGlyphs;
-
+- (float)floatWidthForCharacters:(const unichar *)characters length:(unsigned)length;
+
@end
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
index 0ace74e..86c75d0 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
@@ -16,6 +16,8 @@
#import <WebKit/IFTextRendererFactory.h>
#import <WebKit/WebKitDebug.h>
+#import <QD/ATSUnicodePriv.h>
+
#define NON_BREAKING_SPACE 0xA0
#define SPACE 0x20
@@ -42,6 +44,23 @@
#define IsNonBaseChar(X) ((CFCharacterSetIsCharacterMember(nonBaseChars, X) || IsHangulConjoiningJamo(X) || (((X) & 0x1FFFF0) == 0xF870)))
+typedef float IFGlyphWidth;
+
+struct WidthMap {
+ ATSGlyphRef startRange;
+ ATSGlyphRef endRange;
+ WidthMap *next;
+ IFGlyphWidth *widths;
+};
+
+struct GlyphMap {
+ UniChar startRange;
+ UniChar endRange;
+ GlyphMap *next;
+ ATSGlyphRef *glyphs;
+};
+
+
@interface NSLanguage : NSObject
{
}
@@ -62,8 +81,16 @@
static CFCharacterSetRef nonBaseChars = NULL;
+ at interface IFTextRenderer (IFPrivate)
+- (WidthMap *)extendGlyphToWidthMapToInclude:(ATSGlyphRef)glyphID;
+- (ATSGlyphRef)extendCharacterToGlyphMapToInclude:(UniChar) c;
+ at end
+
+
static void freeWidthMap (WidthMap *map)
{
+ if (!map)
+ return;
if (map->next)
freeWidthMap (map->next);
free (map->widths);
@@ -73,6 +100,8 @@ static void freeWidthMap (WidthMap *map)
static void freeGlyphMap (GlyphMap *map)
{
+ if (!map)
+ return;
if (map->next)
freeGlyphMap (map->next);
free (map->glyphs);
@@ -438,7 +467,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
if (!hasGlyphs){
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
- [(IFTextRenderer *)[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
+ [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
goto cleanup;
}
}
@@ -452,7 +481,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
if (glyphID == 0){
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
- [(IFTextRenderer *)[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
+ [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
goto cleanup;
}
}
@@ -533,7 +562,7 @@ cleanup:
}
-- (int)slowWidthForCharacters: (const UniChar *)characters length: (unsigned)length
+- (float)slowFloatWidthForCharacters: (const UniChar *)characters length: (unsigned)length
{
float totalWidth = 0;
unsigned int i, numGlyphs;
@@ -558,7 +587,7 @@ cleanup:
}
-- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)length
+- (float)floatWidthForCharacters:(const UniChar *)characters length:(unsigned)length
{
float totalWidth = 0;
unsigned int i;
@@ -573,7 +602,7 @@ cleanup:
c = SPACE;
}
else if (IsNonBaseChar(c)){
- return [self slowWidthForCharacters: characters length: length];
+ return [self slowFloatWidthForCharacters: characters length: length];
}
glyphID = glyphForCharacter(characterToGlyphMap, c);
@@ -587,7 +616,7 @@ cleanup:
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
WEBKITDEBUGLEVEL (WEBKIT_LOG_FONTCACHE, "substituting %s for %s, missing 0x%04x\n", DEBUG_OBJECT([substituteFont displayName]), DEBUG_OBJECT([font displayName]), c);
- return [[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] widthForCharacters: characters length: length];
+ return [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] widthForCharacters: characters length: length];
}
}
@@ -597,6 +626,11 @@ cleanup:
return ROUND_TO_INT(totalWidth);
}
+- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)length
+{
+ return ROUND_TO_INT([self floatWidthForCharacters:characters length:length]);
+}
+
// This method is rarely (never?) called. It's slow.
- (void)drawString:(NSString *)string inRect:(NSRect)rect withColor:(NSColor *)color paragraphStyle:(NSParagraphStyle *)style
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.h b/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.h
index 12c50e7..5301976 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.h
+++ b/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.h
@@ -8,13 +8,17 @@
#import <WebCoreTextRendererFactory.h>
+ at class IFTextRenderer;
+
@interface IFTextRendererFactory : WebCoreTextRendererFactory
{
NSMutableDictionary *cache;
}
+ (void)createSharedFactory;
++ (IFTextRendererFactory *)sharedFactory;
- init;
-- (id <WebCoreTextRenderer>)rendererWithFont:(NSFont *)font;
+
+- (IFTextRenderer *)rendererWithFont:(NSFont *)font;
@end
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.m b/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.m
index 31bc57e..097e39b 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/IFTextRendererFactory.m
@@ -69,6 +69,11 @@
WEBKIT_ASSERT([[self sharedFactory] isMemberOfClass:self]);
}
++ (IFTextRendererFactory *)sharedFactory;
+{
+ return (IFTextRendererFactory *)[super sharedFactory];
+}
+
- init
{
[super init];
@@ -85,7 +90,7 @@
[super dealloc];
}
-- (id <WebCoreTextRenderer>)rendererWithFont:(NSFont *)font
+- (IFTextRenderer *)rendererWithFont:(NSFont *)font
{
IFTextRenderer *renderer = [cache objectForKey:font];
if (renderer == nil) {
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.h b/WebKit/WebCoreSupport.subproj/WebTextRenderer.h
index 67d22bb..6c04c6c 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.h
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.h
@@ -7,24 +7,9 @@
//
#import <WebCoreTextRenderer.h>
-#import <QD/ATSUnicodePriv.h>
-typedef float IFGlyphWidth;
-
-
-typedef struct _WidthMap {
- ATSGlyphRef startRange;
- ATSGlyphRef endRange;
- struct _WidthMap *next;
- IFGlyphWidth *widths;
-} WidthMap;
-
-typedef struct _GlyphMap {
- UniChar startRange;
- UniChar endRange;
- struct _GlyphMap *next;
- ATSGlyphRef *glyphs;
-} GlyphMap;
+typedef struct WidthMap WidthMap;
+typedef struct GlyphMap GlyphMap;
@interface IFTextRenderer : NSObject <WebCoreTextRenderer>
{
@@ -32,7 +17,7 @@ typedef struct _GlyphMap {
int descent;
int lineSpacing;
- ATSStyleGroupPtr styleGroup;
+ struct AttributeGroup *styleGroup;
@public
NSFont *font;
@@ -41,10 +26,7 @@ typedef struct _GlyphMap {
}
- initWithFont:(NSFont *)font;
-- (void)convertCharacters: (const unichar *)characters length: (int)numCharacters glyphs: (ATSGlyphVector *)glyphs;
-- (ATSGlyphRef)extendCharacterToGlyphMapToInclude:(UniChar) c;
-- (WidthMap *)extendGlyphToWidthMapToInclude:(ATSGlyphRef)glyphID;
-- (bool) slowPackGlyphsForCharacters:(const UniChar *)characters numCharacters: (unsigned int)numCharacters glyphBuffer:(CGGlyph **)glyphBuffer numGlyphs:(unsigned int *)numGlyphs;
-
+- (float)floatWidthForCharacters:(const unichar *)characters length:(unsigned)length;
+
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 0ace74e..86c75d0 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -16,6 +16,8 @@
#import <WebKit/IFTextRendererFactory.h>
#import <WebKit/WebKitDebug.h>
+#import <QD/ATSUnicodePriv.h>
+
#define NON_BREAKING_SPACE 0xA0
#define SPACE 0x20
@@ -42,6 +44,23 @@
#define IsNonBaseChar(X) ((CFCharacterSetIsCharacterMember(nonBaseChars, X) || IsHangulConjoiningJamo(X) || (((X) & 0x1FFFF0) == 0xF870)))
+typedef float IFGlyphWidth;
+
+struct WidthMap {
+ ATSGlyphRef startRange;
+ ATSGlyphRef endRange;
+ WidthMap *next;
+ IFGlyphWidth *widths;
+};
+
+struct GlyphMap {
+ UniChar startRange;
+ UniChar endRange;
+ GlyphMap *next;
+ ATSGlyphRef *glyphs;
+};
+
+
@interface NSLanguage : NSObject
{
}
@@ -62,8 +81,16 @@
static CFCharacterSetRef nonBaseChars = NULL;
+ at interface IFTextRenderer (IFPrivate)
+- (WidthMap *)extendGlyphToWidthMapToInclude:(ATSGlyphRef)glyphID;
+- (ATSGlyphRef)extendCharacterToGlyphMapToInclude:(UniChar) c;
+ at end
+
+
static void freeWidthMap (WidthMap *map)
{
+ if (!map)
+ return;
if (map->next)
freeWidthMap (map->next);
free (map->widths);
@@ -73,6 +100,8 @@ static void freeWidthMap (WidthMap *map)
static void freeGlyphMap (GlyphMap *map)
{
+ if (!map)
+ return;
if (map->next)
freeGlyphMap (map->next);
free (map->glyphs);
@@ -438,7 +467,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
if (!hasGlyphs){
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
- [(IFTextRenderer *)[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
+ [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
goto cleanup;
}
}
@@ -452,7 +481,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
if (glyphID == 0){
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
- [(IFTextRenderer *)[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
+ [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] drawCharacters: characters length: length atPoint: point withColor: color];
goto cleanup;
}
}
@@ -533,7 +562,7 @@ cleanup:
}
-- (int)slowWidthForCharacters: (const UniChar *)characters length: (unsigned)length
+- (float)slowFloatWidthForCharacters: (const UniChar *)characters length: (unsigned)length
{
float totalWidth = 0;
unsigned int i, numGlyphs;
@@ -558,7 +587,7 @@ cleanup:
}
-- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)length
+- (float)floatWidthForCharacters:(const UniChar *)characters length:(unsigned)length
{
float totalWidth = 0;
unsigned int i;
@@ -573,7 +602,7 @@ cleanup:
c = SPACE;
}
else if (IsNonBaseChar(c)){
- return [self slowWidthForCharacters: characters length: length];
+ return [self slowFloatWidthForCharacters: characters length: length];
}
glyphID = glyphForCharacter(characterToGlyphMap, c);
@@ -587,7 +616,7 @@ cleanup:
substituteFont = [self substituteFontForCharacters: characters length: length];
if (substituteFont){
WEBKITDEBUGLEVEL (WEBKIT_LOG_FONTCACHE, "substituting %s for %s, missing 0x%04x\n", DEBUG_OBJECT([substituteFont displayName]), DEBUG_OBJECT([font displayName]), c);
- return [[(IFTextRendererFactory *)[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] widthForCharacters: characters length: length];
+ return [[[IFTextRendererFactory sharedFactory] rendererWithFont: substituteFont] widthForCharacters: characters length: length];
}
}
@@ -597,6 +626,11 @@ cleanup:
return ROUND_TO_INT(totalWidth);
}
+- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)length
+{
+ return ROUND_TO_INT([self floatWidthForCharacters:characters length:length]);
+}
+
// This method is rarely (never?) called. It's slow.
- (void)drawString:(NSString *)string inRect:(NSRect)rect withColor:(NSColor *)color paragraphStyle:(NSParagraphStyle *)style
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.h b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.h
index 12c50e7..5301976 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.h
+++ b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.h
@@ -8,13 +8,17 @@
#import <WebCoreTextRendererFactory.h>
+ at class IFTextRenderer;
+
@interface IFTextRendererFactory : WebCoreTextRendererFactory
{
NSMutableDictionary *cache;
}
+ (void)createSharedFactory;
++ (IFTextRendererFactory *)sharedFactory;
- init;
-- (id <WebCoreTextRenderer>)rendererWithFont:(NSFont *)font;
+
+- (IFTextRenderer *)rendererWithFont:(NSFont *)font;
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
index 31bc57e..097e39b 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
@@ -69,6 +69,11 @@
WEBKIT_ASSERT([[self sharedFactory] isMemberOfClass:self]);
}
++ (IFTextRendererFactory *)sharedFactory;
+{
+ return (IFTextRendererFactory *)[super sharedFactory];
+}
+
- init
{
[super init];
@@ -85,7 +90,7 @@
[super dealloc];
}
-- (id <WebCoreTextRenderer>)rendererWithFont:(NSFont *)font
+- (IFTextRenderer *)rendererWithFont:(NSFont *)font
{
IFTextRenderer *renderer = [cache objectForKey:font];
if (renderer == nil) {
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 80c73a0..aa5ab5b 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -1504,6 +1504,9 @@
fileRef = F5B36B410281DF55018635CB;
isa = PBXBuildFile;
settings = {
+ ATTRIBUTES = (
+ Private,
+ );
};
};
F5B36B440281DF55018635CB = {
@@ -1847,6 +1850,9 @@
fileRef = F5B36B450281DF9C018635CB;
isa = PBXBuildFile;
settings = {
+ ATTRIBUTES = (
+ Private,
+ );
};
};
F5F7174C02885C5B018635CA = {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list