top level:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2005 22:15:57 +0000 (22:15 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2005 22:15:57 +0000 (22:15 +0000)
        Reviewed by Richard and Dave Harrison.

        * configure.in: Turn off exceptions and RTTI for C++ test programs.
        This makes them work with WebCore, which now has them off, under gcc 4.0.

Tests:

        Reviewed by Richard and Dave Harrison.

        * qt/Makefile.am: Add -licucore so we can continue to compile with the changed QChar.

WebCore:

        Reviewed by Richard and Dave Harrison.
        No new test cases needed for this change.

        - eliminate WebCoreUnicode and use ICU directly instead
        - fixed compiling with gcc 4.0 (was broken for Development only)

        * WebCore.exp: Removed the WebCoreXXXFunction exports.
        * WebCore-tests.exp: Removed some QChar functions that are now inlines.
        Removed some typeinfo exports that are no longer appropriate since we use -fno-rtti.

        * kwq/KWQString.h:
        (QChar::isDigit): Changed to call u_isdigit when non-ASCII. We should probably phase
        this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
        (QChar::isLetter): Changed to call u_isalpha when non-ASCII.
        (QChar::isNumber): Changed to call u_isdigit when non-ASCII. This probably should be removed, since
        we always want to call isDigit instead.
        (QChar::isLetterOrNumber): Changed to call u_isalnum when non-ASCII.
        (QChar::isPunct): Changed to call u_ispunct when non-ASCII.
        (QChar::digitValue): Changed to call u_charDigitValue when not '0'-'9'. We should probably phase
        this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
        (QChar::lower): Changed to call u_tolower when non-ASCII.
        (QChar::upper): Changed to call u_toupper when non-ASCII.
        (QChar::direction): Made inline. Calls u_charDirection.
        (QChar::mirrored): Made inline. Calls u_isMirrored.
        (QChar::mirroredChar): Made inline. Calls u_charMirror.

        * kwq/KWQChar.mm: Removed.
        * kwq/WebCoreUnicode.cpp: Removed.
        * kwq/WebCoreUnicode.h: Removed.

        * WebCore.pbproj/project.pbxproj: Removed files.

WebKit:

        Reviewed by Richard and Dave Harrison.

        - eliminate WebCoreUnicode and use ICU directly instead

        * Misc.subproj/WebKitNSStringExtras.m: (canUseFastRenderer): Use u_charDirection directly.
        * WebCoreSupport.subproj/WebTextRenderer.m: Removed import of <WebCore/WebCoreUnicode.h>.
        * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): Removed call to WebKitInitializeUnicode.

        * Misc.subproj/WebUnicode.h: Removed.
        * Misc.subproj/WebUnicode.m: Removed.
        * Misc.subproj/WebUnicodeTables.m: Removed.

        * WebKit.pbproj/project.pbxproj: Removed files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/WebCore-tests.exp
WebCore/WebCore.exp
WebCore/WebCore.pbproj/project.pbxproj
WebCore/kwq/KWQChar.mm [deleted file]
WebCore/kwq/KWQString.h
WebCore/kwq/WebCoreUnicode.cpp [deleted file]
WebCore/kwq/WebCoreUnicode.h [deleted file]
WebKit/ChangeLog
WebKit/Misc.subproj/WebKitNSStringExtras.m
WebKit/Misc.subproj/WebUnicode.h [deleted file]
WebKit/Misc.subproj/WebUnicode.m [deleted file]
WebKit/Misc.subproj/WebUnicodeTables.m [deleted file]
WebKit/WebCoreSupport.subproj/WebTextRenderer.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebHTMLView.m

index 8ea35898c08cf4c6dc4c691d28914f587efb66b9..c9f3c0eae814ea41ffe9cc2666183be193bb9169 100644 (file)
@@ -1,3 +1,37 @@
+2005-05-26  Darin Adler  <darin@apple.com>
+
+        Reviewed by Richard and Dave Harrison.
+        No new test cases needed for this change.
+
+        - eliminate WebCoreUnicode and use ICU directly instead
+        - fixed compiling with gcc 4.0 (was broken for Development only)
+
+        * WebCore.exp: Removed the WebCoreXXXFunction exports.
+        * WebCore-tests.exp: Removed some QChar functions that are now inlines.
+        Removed some typeinfo exports that are no longer appropriate since we use -fno-rtti.
+
+        * kwq/KWQString.h:
+        (QChar::isDigit): Changed to call u_isdigit when non-ASCII. We should probably phase
+        this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
+        (QChar::isLetter): Changed to call u_isalpha when non-ASCII.
+        (QChar::isNumber): Changed to call u_isdigit when non-ASCII. This probably should be removed, since
+        we always want to call isDigit instead.
+        (QChar::isLetterOrNumber): Changed to call u_isalnum when non-ASCII.
+        (QChar::isPunct): Changed to call u_ispunct when non-ASCII.
+        (QChar::digitValue): Changed to call u_charDigitValue when not '0'-'9'. We should probably phase
+        this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
+        (QChar::lower): Changed to call u_tolower when non-ASCII.
+        (QChar::upper): Changed to call u_toupper when non-ASCII.
+        (QChar::direction): Made inline. Calls u_charDirection.
+        (QChar::mirrored): Made inline. Calls u_isMirrored.
+        (QChar::mirroredChar): Made inline. Calls u_charMirror.
+
+        * kwq/KWQChar.mm: Removed.
+        * kwq/WebCoreUnicode.cpp: Removed.
+        * kwq/WebCoreUnicode.h: Removed.
+
+        * WebCore.pbproj/project.pbxproj: Removed files.
+
 2005-05-26  David Harrison  <harrison@apple.com>
 
         Reviewed by John.
index b606d708330366b185b5cd35a59d84ee36944285..107bdafe1aa5c9636db9d7a73e22814034bdfd91 100644 (file)
@@ -113,10 +113,6 @@ __ZN4KURLC1EPKc
 __ZN4KURLC1ERK7QString
 __ZN4KURLC1ERKS_RK7QStringPK10QTextCodec
 __ZN4KURLC1Ev
-__ZN5QChar13lowerNonASCIIEt
-__ZN5QChar13upperNonASCIIEt
-__ZN5QChar15isDigitNonASCIIEt
-__ZN5QChar24isLetterOrNumberNonASCIIEt
 __ZN5QDateC1Eiii
 __ZN5QFile4openEi
 __ZN5QFile5closeEv
@@ -268,8 +264,6 @@ __ZNK8QCString6lengthEv
 __ZNK8QCString7isEmptyEv
 __ZNK8QCString8containsEcb
 __ZNK9QDateTime6secsToERKS_
-__ZTI10KWQMapImpl
-__ZTI14QPtrCollection
 __ZTV14QPtrCollection
 __ZeqRK5QRectS1_
 __ZeqRK5QSizeS1_
index 2851dc6e0138b348034f342aa0330c73f093159e..4aae98189ed9ff1e9fe27e348435b17ad8fc26b7 100644 (file)
@@ -132,9 +132,3 @@ _WebCoreInitializeEmptyTextGeometry
 _WebCoreInitializeEmptyTextStyle
 _WebCoreInitializeTextRun
 _WebCorePageCacheStateKey
-_WebCoreUnicodeDigitValueFunction
-_WebCoreUnicodeDirectionFunction
-_WebCoreUnicodeLowerFunction
-_WebCoreUnicodeMirroredCharFunction
-_WebCoreUnicodeMirroredFunction
-_WebCoreUnicodeUpperFunction
index 62d7bcb63cdc7b9d974f93f79a0af539eab6c507..84b3cd2401c95377275fc1bb8db076223061cc35 100644 (file)
                        refType = 4;
                        sourceTree = "<group>";
                };
-               517FA6B20370BD6100CA2D3A = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       path = WebCoreUnicode.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               517FA6B60370C7ED00CA2D3A = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.cpp;
-                       path = WebCoreUnicode.cpp;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
                51F6A3D50663BF04004D2919 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
                                93F199AF08245E59001E9ABC,
                                93F199B008245E59001E9ABC,
                                93F199B108245E59001E9ABC,
-                               93F199B208245E59001E9ABC,
                                93F199B308245E59001E9ABC,
                                93F1996408245E59001E9ABC,
                                93F199B408245E59001E9ABC,
                                );
                        };
                };
-               93F199B208245E59001E9ABC = {
-                       fileRef = 517FA6B20370BD6100CA2D3A;
-                       isa = PBXBuildFile;
-                       settings = {
-                               ATTRIBUTES = (
-                                       Private,
-                               );
-                       };
-               };
                93F199B308245E59001E9ABC = {
                        fileRef = F587855402DE375901EA4122;
                        isa = PBXBuildFile;
                                93F19A0F08245E59001E9ABC,
                                93F19A1008245E59001E9ABC,
                                93F19A1108245E59001E9ABC,
-                               93F19A1208245E59001E9ABC,
                                93F19A1308245E59001E9ABC,
                                93F19A1408245E59001E9ABC,
                                93F19A1508245E59001E9ABC,
                                93F19ACB08245E59001E9ABC,
                                93F19ACC08245E59001E9ABC,
                                93F19ACD08245E59001E9ABC,
-                               93F19ACE08245E59001E9ABC,
                                93F19ACF08245E59001E9ABC,
                                93F19AD008245E59001E9ABC,
                                93F19AD108245E59001E9ABC,
                        settings = {
                        };
                };
-               93F19A1208245E59001E9ABC = {
-                       fileRef = F58784CA02DE375901EA4122;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
                93F19A1308245E59001E9ABC = {
                        fileRef = F58784CD02DE375901EA4122;
                        isa = PBXBuildFile;
                        settings = {
                        };
                };
-               93F19ACE08245E59001E9ABC = {
-                       fileRef = 517FA6B60370C7ED00CA2D3A;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
                93F19ACF08245E59001E9ABC = {
                        fileRef = 931C8A170380288B008635CE;
                        isa = PBXBuildFile;
                        refType = 4;
                        sourceTree = "<group>";
                };
-               F58784CA02DE375901EA4122 = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.cpp.objcpp;
-                       path = KWQChar.mm;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
                F58784CC02DE375901EA4122 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
                                F587855102DE375901EA4122,
                                F587855202DE375901EA4122,
                                F587855302DE375901EA4122,
-                               517FA6B20370BD6100CA2D3A,
-                               517FA6B60370C7ED00CA2D3A,
                                BE855F7F0701E83500239769,
                                BE8560510701F91100239769,
                                F587855402DE375901EA4122,
                                BC86FB8E061F5C23006BB822,
                                F58786B802DE3B8601EA4122,
                                F58786B902DE3B8601EA4122,
-                               F58784CA02DE375901EA4122,
                                F587853102DE375901EA4122,
                                F58786BA02DE3B8601EA4122,
                                F587853202DE375901EA4122,
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
deleted file mode 100644 (file)
index 63cd6da..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import "KWQString.h"
-#import "KWQLogging.h"
-#import "WebCoreUnicode.h"
-
-#import <Foundation/Foundation.h>
-
-bool QChar::isDigitNonASCII(UniChar c)
-{
-    static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetDecimalDigit);
-    return CFCharacterSetIsCharacterMember(set, c);
-}
-
-bool QChar::isLetterNonASCII(UniChar c)
-{
-    static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetLetter);
-    return CFCharacterSetIsCharacterMember(set, c);
-}
-
-bool QChar::isNumberNonASCII(UniChar c)
-{
-    return isLetterOrNumberNonASCII(c) && !isLetterNonASCII(c);
-}
-
-bool QChar::isLetterOrNumberNonASCII(UniChar c)
-{
-    static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetAlphaNumeric);
-    return CFCharacterSetIsCharacterMember(set, c);
-}
-
-bool QChar::isPunct() const
-{
-    static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetPunctuation);
-    return CFCharacterSetIsCharacterMember(set, c);
-}
-
-UniChar QChar::lowerNonASCII(UniChar c)
-{
-    return WebCoreUnicodeLowerFunction(c);
-}
-
-UniChar QChar::upperNonASCII(UniChar c)
-{
-    return WebCoreUnicodeUpperFunction(c);
-}
-
-bool QChar::mirrored() const
-{
-    return WebCoreUnicodeMirroredFunction(c);
-}
-
-QChar QChar::mirroredChar() const
-{
-    return QChar((UniChar)WebCoreUnicodeMirroredCharFunction(c));
-}
-
-int QChar::digitValueNonASCII(UniChar)
-{
-    // FIXME: This isn't right. Need Unicode-savvy version of this that matches isDigitNonASCII.
-    return -1;
-}
index 9823e6ce232ee08131bad53cc8efa2d8fc2aa7e9..7c91dd01500d58640ed7fd19971ad6af59e096ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef QSTRING_H_
 #define QSTRING_H_
 
+#include <unicode/uchar.h>
 #include <CoreFoundation/CoreFoundation.h>
-
-#include "KWQCString.h"
-#include "WebCoreUnicode.h"
 #include "misc/main_thread_malloc.h"
+#include "KWQCString.h"
 
 // Make htmltokenizer.cpp happy
 #define QT_VERSION 300
@@ -111,14 +110,6 @@ private:
 
     friend class QString;
     friend class QConstString;
-
-    static bool isDigitNonASCII(UniChar c);
-    static bool isLetterNonASCII(UniChar c);
-    static bool isNumberNonASCII(UniChar c);
-    static bool isLetterOrNumberNonASCII(UniChar c);
-    static int digitValueNonASCII(UniChar c);
-    static UniChar lowerNonASCII(UniChar c);
-    static UniChar upperNonASCII(UniChar c);
 };
 
 inline QChar::QChar() : c(0)
@@ -166,49 +157,77 @@ inline bool QChar::isNull() const
 
 inline bool QChar::isSpace() const
 {
-    // Use isspace() for basic latin1.  This will include newlines, which
-    // aren't included in unicode DirWS.
+    // Use isspace() for basic Latin-1.
+    // This will include newlines, which aren't included in unicode DirWS.
     return c <= 0x7F ? isspace(c) : direction() == DirWS;
 }
 
 inline bool QChar::isDigit() const
 {
-    return c <= 0x7F ? isdigit(c) : isDigitNonASCII(c);
+    // FIXME: If fast enough, we should just call u_isdigit directly.
+    return c <= 0x7F ? isdigit(c) : u_isdigit(c);
 }
 
 inline bool QChar::isLetter() const
 {
-    return c <= 0x7F ? isalpha(c) : isLetterNonASCII(c);
+    // FIXME: If fast enough, we should just call u_isalpha directly.
+    return c <= 0x7F ? isalpha(c) : u_isalpha(c);
 }
 
 inline bool QChar::isNumber() const
 {
-    return c <= 0x7F ? isdigit(c) : isNumberNonASCII(c);
+    // FIXME: If fast enough, we should just call u_isdigit directly.
+    return c <= 0x7F ? isdigit(c) : u_isdigit(c);
 }
 
 inline bool QChar::isLetterOrNumber() const
 {
-    return c <= 0x7F ? isalnum(c) : isLetterOrNumberNonASCII(c);
+    // FIXME: If fast enough, we should just call u_isalnum directly.
+    return c <= 0x7F ? isalnum(c) : u_isalnum(c);
+}
+
+inline bool QChar::isPunct() const
+{
+    return u_ispunct(c);
 }
 
 inline int QChar::digitValue() const
 {
-    return c <= '9' ? c - '0' : digitValueNonASCII(c);
+    // FIXME: If fast enough, we should just call u_charDigitValue directly.
+    return c <= '9' ? c - '0' : u_charDigitValue(c);
 }
 
 inline QChar QChar::lower() const
 {
-    return c <= 0x7F ? tolower(c) : lowerNonASCII(c);
+    // FIXME: If fast enough, we should just call u_tolower directly.
+    return c <= 0x7F ? tolower(c) : u_tolower(c);
 }
 
 inline QChar QChar::upper() const
 {
-    return c <= 0x7F ? toupper(c) : upperNonASCII(c);
+    // FIXME: If fast enough, we should just call u_toupper directly.
+    return c <= 0x7F ? toupper(c) : u_toupper(c);
 }
 
 inline QChar::Direction QChar::direction() const
 {
-    return static_cast<Direction>(WebCoreUnicodeDirectionFunction(c));
+#if BUILDING_ON_PANTHER
+    // Panther gets the direction of the hyphen wrong.
+    // It returns "ET" (European Terminator) when it should return "ES" (European Separator).
+    if (c == '-')
+        return DirES;
+#endif
+    return static_cast<Direction>(u_charDirection(c));
+}
+
+inline bool QChar::mirrored() const
+{
+    return u_isMirrored(c);
+}
+
+inline QChar QChar::mirroredChar() const
+{
+    return QChar(static_cast<uint>(u_charMirror(c)));
 }
 
 inline uchar QChar::row() const
diff --git a/WebCore/kwq/WebCoreUnicode.cpp b/WebCore/kwq/WebCoreUnicode.cpp
deleted file mode 100644 (file)
index 6ed3324..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-#include "WebCoreUnicode.h"
-
-int (*WebCoreUnicodeDigitValueFunction)(UChar32 c);
-WebCoreUnicodeDirection (*WebCoreUnicodeDirectionFunction)(UChar32 c);
-bool (*WebCoreUnicodeMirroredFunction)(UChar32 c);
-UChar32 (*WebCoreUnicodeMirroredCharFunction)(UChar32 c);
-UChar32 (*WebCoreUnicodeLowerFunction)(UChar32 c);
-UChar32 (*WebCoreUnicodeUpperFunction)(UChar32 c);
diff --git a/WebCore/kwq/WebCoreUnicode.h b/WebCore/kwq/WebCoreUnicode.h
deleted file mode 100644 (file)
index bf62224..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-#include <CoreFoundation/CoreFoundation.h>
-
-#define HAVE_ICU_LIBRARY 1
-
-#if HAVE_ICU_LIBRARY
-#include <unicode/utf.h>
-#endif
-
-#if !HAVE_ICU_LIBRARY
-typedef UInt32 UChar32;
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    typedef enum
-    {
-        DirectionL = 0,        // Left Letter 
-        DirectionR,    // Right Letter
-        DirectionEN,   // European Number
-        DirectionES,   // European Separator
-        DirectionET,   // European Terminator (post/prefix e.g. $ and %)
-        DirectionAN,   // Arabic Number
-        DirectionCS,   // Common Separator 
-        DirectionB,    // Paragraph Separator (aka as PS)
-        DirectionS,    // Segment Separator (TAB)
-        DirectionWS,   // White space
-        DirectionON,   // Other Neutral
-
-       // types for explicit controls
-        DirectionLRE, 
-        DirectionLRO, 
-
-        DirectionAL,   // Arabic Letter (Right-to-left)
-
-        DirectionRLE, 
-        DirectionRLO, 
-        DirectionPDF, 
-
-        DirectionNSM,  // Non-spacing Mark
-        DirectionBN    // Boundary neutral (type of RLE etc after explicit levels)
-    } WebCoreUnicodeDirection;
-
-
-    extern int (*WebCoreUnicodeDigitValueFunction)(UChar32 c);
-    extern WebCoreUnicodeDirection (*WebCoreUnicodeDirectionFunction)(UChar32 c);
-    extern bool (*WebCoreUnicodeMirroredFunction)(UChar32 c);
-    extern UChar32 (*WebCoreUnicodeMirroredCharFunction)(UChar32 c);
-    extern UChar32 (*WebCoreUnicodeLowerFunction)(UChar32 c);
-    extern UChar32 (*WebCoreUnicodeUpperFunction)(UChar32 c);
-
-#ifdef __cplusplus
-}
-#endif
\ No newline at end of file
index c72bce35975062a5806236497130a15797fde7a9..2882f2f001168410f16b37da9279a5acc8c87499 100644 (file)
@@ -1,3 +1,19 @@
+2005-05-26  Darin Adler  <darin@apple.com>
+
+        Reviewed by Richard and Dave Harrison.
+
+        - eliminate WebCoreUnicode and use ICU directly instead
+
+        * Misc.subproj/WebKitNSStringExtras.m: (canUseFastRenderer): Use u_charDirection directly.
+        * WebCoreSupport.subproj/WebTextRenderer.m: Removed import of <WebCore/WebCoreUnicode.h>.
+        * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): Removed call to WebKitInitializeUnicode.
+
+        * Misc.subproj/WebUnicode.h: Removed.
+        * Misc.subproj/WebUnicode.m: Removed.
+        * Misc.subproj/WebUnicodeTables.m: Removed.
+
+        * WebKit.pbproj/project.pbxproj: Removed files.
+
 2005-05-24  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/4097289> -[WebView elementAtPoint:] failing when WebView is nested and offset
index 29682c24743526de7508b9cfa2afbf9a2baf03ed..c8be2fe3318b121b464f4324a5f092d03cb20f8c 100644 (file)
@@ -9,18 +9,17 @@
 #import <WebKit/WebTextRenderer.h>
 #import <WebKit/WebTextRendererFactory.h>
 
-#import <WebCore/WebCoreUnicode.h>
-
 #import <Foundation/NSString_NSURLExtras.h>
+#import <unicode/uchar.h>
 
 @implementation NSString (WebKitExtras)
 
-static BOOL canUseFastRenderer (const UniChar *buffer, unsigned length)
+static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
 {
     unsigned i;
-    for (i = 0; i < length; i++){
-        WebCoreUnicodeDirection direction = WebCoreUnicodeDirectionFunction (buffer[i]);
-        if (direction == DirectionR || direction > DirectionON){
+    for (i = 0; i < length; i++) {
+        UCharDirection direction = u_charDirection(buffer[i]);
+        if (direction == U_RIGHT_TO_LEFT || direction > U_WHITE_SPACE_NEUTRAL) {
             return NO;
         }
     }
diff --git a/WebKit/Misc.subproj/WebUnicode.h b/WebKit/Misc.subproj/WebUnicode.h
deleted file mode 100644 (file)
index adc8623..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*     
-    WebUnicode.h
-    Copyright 2001, 2002, Apple Computer, Inc.
-
-    Private header file.
-*/
-#import <WebCore/WebCoreTextRenderer.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void WebKitInitializeUnicode(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#define WK_CELL(ucs) ((unsigned char)(ucs))
-#define WK_ROW(ucs) ((unsigned char)(ucs>>8))
-
-// surrogate ranges
-enum {
-    HighSurrogateRangeStart  = 0xD800,
-    HighSurrogateRangeEnd    = 0xDBFF,
-    LowSurrogateRangeStart   = 0xDC00,
-    LowSurrogateRangeEnd     = 0xDFFF
-};
-
-#define UnicodeValueForSurrogatePair(h,l) (( ( h - HighSurrogateRangeStart ) << 10 ) + ( l - LowSurrogateRangeStart ) + 0x0010000)
-#define HighSurrogatePair(c) (((c - 0x10000)>>10) + 0xd800)
-#define LowSurrogatePair(c) (((c - 0x10000)&0x3ff) + 0xdc00)
-#define IsHighSurrogatePair(c)  (( c & 0xFC00 ) == HighSurrogateRangeStart )
-#define IsLowSurrogatePair(c)  (( c & 0xFC00 ) == LowSurrogateRangeStart )
diff --git a/WebKit/Misc.subproj/WebUnicode.m b/WebKit/Misc.subproj/WebUnicode.m
deleted file mode 100644 (file)
index 2c576be..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*     
-        WebUnicode.m
-       Copyright 2001, 2002, Apple Computer, Inc.
-*/
-#import <WebKit/WebUnicode.h>
-#import <WebCore/WebCoreUnicode.h>
-
-#import <unicode/uchar.h>
-
-static int _unicodeDigitValue(UChar32 c)
-{
-    return u_charDigitValue(c);
-}
-
-static WebCoreUnicodeDirection _unicodeDirection(UChar32 c)
-{
-#if BUILDING_ON_PANTHER
-    // Panther gets the direction of the hyphen wrong.  It returns "ET" (European Terminator) when
-    // it should return "ES" (European Separator).
-    if (c == '-')
-        return DirectionES;
-#endif
-    return u_charDirection(c);
-}
-
-static bool _unicodeMirrored(UChar32 c)
-{
-    return u_isMirrored(c);
-}
-
-static UChar32 _unicodeMirroredChar(UChar32 c)
-{
-    return u_charMirror(c);
-}
-
-static UChar32 _unicodeLower(UChar32 c)
-{
-    return u_tolower(c);
-}
-
-static UChar32 _unicodeUpper(UChar32 c)
-{
-    return u_toupper(c);
-}
-
-void WebKitInitializeUnicode(void)
-{
-    WebCoreUnicodeDigitValueFunction = _unicodeDigitValue;
-    WebCoreUnicodeDirectionFunction = _unicodeDirection;
-    WebCoreUnicodeMirroredFunction = _unicodeMirrored;
-    WebCoreUnicodeMirroredCharFunction = _unicodeMirroredChar;
-    WebCoreUnicodeLowerFunction = _unicodeLower;
-    WebCoreUnicodeUpperFunction = _unicodeUpper;
-}
diff --git a/WebKit/Misc.subproj/WebUnicodeTables.m b/WebKit/Misc.subproj/WebUnicodeTables.m
deleted file mode 100644 (file)
index 139597f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
index 609eeb791b7f6d8a311fb5d0fb76ba074b690355..a4ac161f147bfb78f600a63ebffe7ffd3471fff5 100644 (file)
@@ -12,8 +12,6 @@
 #import <CoreGraphics/CoreGraphicsPrivate.h>
 #import <QD/ATSUnicodePriv.h>
 
-#import <WebCore/WebCoreUnicode.h>
-
 #import <WebKit/WebGlyphBuffer.h>
 #import <WebKit/WebGraphicsBridge.h>
 #import <WebKit/WebKitLogging.h>
index 33ae2485449c97fe89f8e6bc7f2d7127d68dc704..e646c203fe54937aba3df4295efa520f7cdc6197 100644 (file)
                                F560BEBD030DAF4401C1A526,
                                F59668C802AD2923018635CA,
                                F59668C902AD2923018635CA,
-                               517FA6A903709FCE00CA2D3A,
-                               517FA6AA03709FCE00CA2D3A,
-                               517FA6AB03709FCE00CA2D3A,
                                6578F5DE045F817400000128,
                                6578F5DF045F817400000128,
                        );
                        refType = 4;
                        sourceTree = "<group>";
                };
-               517FA6A903709FCE00CA2D3A = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.h;
-                       path = WebUnicode.h;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               517FA6AA03709FCE00CA2D3A = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.objc;
-                       path = WebUnicode.m;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
-               517FA6AB03709FCE00CA2D3A = {
-                       fileEncoding = 30;
-                       isa = PBXFileReference;
-                       lastKnownFileType = sourcecode.c.objc;
-                       path = WebUnicodeTables.m;
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
                51863EFC065419EB00E9E8DD = {
                        fileEncoding = 4;
                        isa = PBXFileReference;
                                939810250824BF01008DF038,
                                939810260824BF01008DF038,
                                939810270824BF01008DF038,
-                               939810280824BF01008DF038,
                                939810290824BF01008DF038,
                                9398102A0824BF01008DF038,
                                9398102B0824BF01008DF038,
                                );
                        };
                };
-               939810280824BF01008DF038 = {
-                       fileRef = 517FA6A903709FCE00CA2D3A;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
                939810290824BF01008DF038 = {
                        fileRef = F8CA15B5029A39D901000122;
                        isa = PBXBuildFile;
                                939810CA0824BF01008DF038,
                                939810CB0824BF01008DF038,
                                939810CC0824BF01008DF038,
-                               939810CD0824BF01008DF038,
-                               939810CE0824BF01008DF038,
                                939810CF0824BF01008DF038,
                                939810D00824BF01008DF038,
                                939810D10824BF01008DF038,
                        settings = {
                        };
                };
-               939810CD0824BF01008DF038 = {
-                       fileRef = 517FA6AA03709FCE00CA2D3A;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
-               939810CE0824BF01008DF038 = {
-                       fileRef = 517FA6AB03709FCE00CA2D3A;
-                       isa = PBXBuildFile;
-                       settings = {
-                       };
-               };
                939810CF0824BF01008DF038 = {
                        fileRef = F8CA15B6029A39D901000122;
                        isa = PBXBuildFile;
index 93392465be3e6fcf5b05919fa68fc745c2a899cf..749797bdfa98e574068729365e11529b376b0dff 100644 (file)
@@ -41,7 +41,6 @@
 #import <WebKit/WebTextRenderer.h>
 #import <WebKit/WebTextRendererFactory.h>
 #import <WebKit/WebUIDelegatePrivate.h>
-#import <WebKit/WebUnicode.h>
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebViewPrivate.h>
 
@@ -1715,7 +1714,6 @@ static WebHTMLView *lastHitView = nil;
 
 + (void)initialize
 {
-    WebKitInitializeUnicode();
     [NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes] 
                              returnTypes:[[self class] _insertablePasteboardTypes]];
     _NSInitializeKillRing();