Title: [88016] trunk/Source
Revision
88016
Author
[email protected]
Date
2011-06-03 07:47:04 -0700 (Fri, 03 Jun 2011)

Log Message

2011-06-03  Siddharth Mathur  <[email protected]>

        Reviewed by Benjamin Poulain.

        [Qt] Build flag for experimental ICU library support
        https://bugs.webkit.org/show_bug.cgi?id=60786

        Adds a build-time flag (CONFIG+=use_system_icu) that enables experimental
        ICU powered Unicode support.

        * _javascript_Core.pri: Support for use_system_icu CONFIG flag.
        * wtf/unicode/qt4/UnicodeQt4.h: Guard an include file with USE(ICU_UNICODE).
2011-06-03  Siddharth Mathur  <[email protected]>

        Reviewed by Benjamin Poulain.

        [Qt] Build flag for experimental ICU library support
        https://bugs.webkit.org/show_bug.cgi?id=60786

        Adds a build-time flag (CONFIG+=use_system_icu) that enables experimental
        ICU powered Unicode support.

        No new tests as no new features added.

        * WebCore.pri: Removed text_breaking_with_icu CONFIG flag.
        * WebCore.pro: Added TextCodecICU.cpp and qt/TextBreakIteratorInternalICUQt.cpp.
        * editing/qt/SmartReplaceQt.cpp:
        * features.pri: Support for use_system_icu CONFIG flag.
        * platform/text/TextCodecICU.cpp: Guard with USE(ICU_UNICODE).
        * platform/text/qt/TextBreakIteratorInternalICUQt.cpp: Added.
        (WebCore::Q_GLOBAL_STATIC_WITH_INITIALIZER):
        (WebCore::currentSearchLocaleID):
        (WebCore::currentTextBreakLocaleID):
        * platform/text/qt/TextBreakIteratorQt.cpp: Moved out currentTextBreakLocaleID().
        (WebCore::isTextBreak):
        * platform/text/qt/TextCodecQt.cpp: Guard with USE(QT4_UNICODE).
        (WebCore::TextCodecQt::registerEncodingNames):
        (WebCore::TextCodecQt::registerCodecs):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (88015 => 88016)


--- trunk/Source/_javascript_Core/ChangeLog	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-06-03 14:47:04 UTC (rev 88016)
@@ -1,3 +1,16 @@
+2011-06-03  Siddharth Mathur  <[email protected]>
+
+        Reviewed by Benjamin Poulain.
+
+        [Qt] Build flag for experimental ICU library support
+        https://bugs.webkit.org/show_bug.cgi?id=60786
+
+        Adds a build-time flag (CONFIG+=use_system_icu) that enables experimental 
+        ICU powered Unicode support. 
+
+        * _javascript_Core.pri: Support for use_system_icu CONFIG flag.
+        * wtf/unicode/qt4/UnicodeQt4.h: Guard an include file with USE(ICU_UNICODE). 
+
 2011-06-03  Alexis Menard  <[email protected]>
 
         Reviewed by Benjamin Poulain.

Modified: trunk/Source/_javascript_Core/_javascript_Core.pri (88015 => 88016)


--- trunk/Source/_javascript_Core/_javascript_Core.pri	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/_javascript_Core/_javascript_Core.pri	2011-06-03 14:47:04 UTC (rev 88016)
@@ -57,10 +57,13 @@
 
 DEFINES += BUILDING_JavaScriptCore BUILDING_WTF
 
-# CONFIG += text_breaking_with_icu
-
-contains (CONFIG, text_breaking_with_icu) {
-    DEFINES += WTF_USE_QT_ICU_TEXT_BREAKING=1
+contains(CONFIG, use_system_icu) {
+    DEFINES += WTF_USE_ICU_UNICODE=1
+    DEFINES -= WTF_USE_QT4_UNICODE
+    LIBS += -licuuc -licui18n
+} else {
+    DEFINES += WTF_USE_QT4_UNICODE=1
+    DEFINES -= WTF_USE_ICU_UNICODE
 }
 
 wince* {

Modified: trunk/Source/_javascript_Core/wtf/unicode/qt4/UnicodeQt4.h (88015 => 88016)


--- trunk/Source/_javascript_Core/wtf/unicode/qt4/UnicodeQt4.h	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/_javascript_Core/wtf/unicode/qt4/UnicodeQt4.h	2011-06-03 14:47:04 UTC (rev 88016)
@@ -31,7 +31,7 @@
 #include <config.h>
 
 #include <stdint.h>
-#if USE(QT_ICU_TEXT_BREAKING)
+#if USE(ICU_UNICODE)
 #include <unicode/ubrk.h>
 #endif
 
@@ -67,7 +67,7 @@
 typedef uint16_t UChar;
 #endif
 
-#if !USE(QT_ICU_TEXT_BREAKING)
+#if !USE(ICU_UNICODE)
 typedef uint32_t UChar32;
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (88015 => 88016)


--- trunk/Source/WebCore/ChangeLog	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/ChangeLog	2011-06-03 14:47:04 UTC (rev 88016)
@@ -1,3 +1,30 @@
+2011-06-03  Siddharth Mathur  <[email protected]>
+
+        Reviewed by Benjamin Poulain.
+
+        [Qt] Build flag for experimental ICU library support
+        https://bugs.webkit.org/show_bug.cgi?id=60786
+
+        Adds a build-time flag (CONFIG+=use_system_icu) that enables experimental 
+        ICU powered Unicode support. 
+
+        No new tests as no new features added.
+
+        * WebCore.pri: Removed text_breaking_with_icu CONFIG flag. 
+        * WebCore.pro: Added TextCodecICU.cpp and qt/TextBreakIteratorInternalICUQt.cpp.
+        * editing/qt/SmartReplaceQt.cpp:
+        * features.pri: Support for use_system_icu CONFIG flag.
+        * platform/text/TextCodecICU.cpp: Guard with USE(ICU_UNICODE). 
+        * platform/text/qt/TextBreakIteratorInternalICUQt.cpp: Added.
+        (WebCore::Q_GLOBAL_STATIC_WITH_INITIALIZER):
+        (WebCore::currentSearchLocaleID):
+        (WebCore::currentTextBreakLocaleID):
+        * platform/text/qt/TextBreakIteratorQt.cpp: Moved out currentTextBreakLocaleID(). 
+        (WebCore::isTextBreak):
+        * platform/text/qt/TextCodecQt.cpp: Guard with USE(QT4_UNICODE). 
+        (WebCore::TextCodecQt::registerEncodingNames):
+        (WebCore::TextCodecQt::registerCodecs):
+
 2011-06-03  Yael Aharon  <[email protected]>
 
         Reviewed by Kenneth Rohde Christiansen.

Modified: trunk/Source/WebCore/WebCore.pri (88015 => 88016)


--- trunk/Source/WebCore/WebCore.pri	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/WebCore.pri	2011-06-03 14:47:04 UTC (rev 88016)
@@ -295,10 +295,6 @@
     CONFIG += no_debug_info
 }
 
-contains (CONFIG, text_breaking_with_icu) {
-    LIBS += -licuuc
-}
-
 !CONFIG(QTDIR_build) {
     win32-*|wince* {
         DLLDESTDIR = $$OUTPUT_DIR/bin

Modified: trunk/Source/WebCore/WebCore.pro (88015 => 88016)


--- trunk/Source/WebCore/WebCore.pro	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/WebCore.pro	2011-06-03 14:47:04 UTC (rev 88016)
@@ -1063,6 +1063,7 @@
     platform/text/TextCodecUserDefined.cpp \
     platform/text/TextCodecUTF16.cpp \
     platform/text/TextCodecUTF8.cpp \
+    platform/text/TextCodecICU.cpp \
     platform/text/TextEncoding.cpp \
     platform/text/TextEncodingDetectorNone.cpp \
     platform/text/TextEncodingRegistry.cpp \
@@ -2554,6 +2555,7 @@
     platform/qt/TemporaryLinkStubsQt.cpp \
     platform/text/qt/TextBoundariesQt.cpp \
     platform/text/qt/TextBreakIteratorQt.cpp \
+    platform/text/qt/TextBreakIteratorInternalICUQt.cpp \
     platform/text/qt/TextCodecQt.cpp \
     platform/qt/WheelEventQt.cpp \
     platform/qt/WidgetQt.cpp
@@ -2585,7 +2587,7 @@
         platform/text/cf/StringImplCF.cpp
 }
 
-contains (CONFIG, text_breaking_with_icu) {
+contains (CONFIG, use_system_icu) {
     SOURCES += platform/text/TextBreakIteratorICU.cpp
 }
 

Modified: trunk/Source/WebCore/editing/qt/SmartReplaceQt.cpp (88015 => 88016)


--- trunk/Source/WebCore/editing/qt/SmartReplaceQt.cpp	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/editing/qt/SmartReplaceQt.cpp	2011-06-03 14:47:04 UTC (rev 88016)
@@ -28,7 +28,9 @@
  */
 
 #include "config.h"
+#if USE(QT4_UNICODE)
 #include "SmartReplace.h"
+#include <QChar>
 
 namespace WebCore {
 
@@ -64,3 +66,4 @@
 }
 
 }
+#endif

Modified: trunk/Source/WebCore/features.pri (88015 => 88016)


--- trunk/Source/WebCore/features.pri	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/features.pri	2011-06-03 14:47:04 UTC (rev 88016)
@@ -28,6 +28,15 @@
     }
 }
 
+contains(CONFIG, use_system_icu) {
+    DEFINES += WTF_USE_ICU_UNICODE=1
+    DEFINES -= WTF_USE_QT4_UNICODE
+    LIBS += -licuuc -licui18n
+} else {
+    DEFINES += WTF_USE_QT4_UNICODE=1
+    DEFINES -= WTF_USE_ICU_UNICODE
+}
+
 contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
     DEFINES+=ENABLE_DATABASE=0 ENABLE_DOM_STORAGE=0 ENABLE_ICONDATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0
 }

Modified: trunk/Source/WebCore/platform/text/TextCodecICU.cpp (88015 => 88016)


--- trunk/Source/WebCore/platform/text/TextCodecICU.cpp	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/platform/text/TextCodecICU.cpp	2011-06-03 14:47:04 UTC (rev 88016)
@@ -25,6 +25,7 @@
  */
 
 #include "config.h"
+#if USE(ICU_UNICODE)
 #include "TextCodecICU.h"
 
 #include "ThreadGlobalData.h"
@@ -471,3 +472,5 @@
 }
 
 } // namespace WebCore
+#endif
+

Added: trunk/Source/WebCore/platform/text/qt/TextBreakIteratorInternalICUQt.cpp (0 => 88016)


--- trunk/Source/WebCore/platform/text/qt/TextBreakIteratorInternalICUQt.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/text/qt/TextBreakIteratorInternalICUQt.cpp	2011-06-03 14:47:04 UTC (rev 88016)
@@ -0,0 +1,42 @@
+/*
+    Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+#include <QByteArray>
+#include <QLocale>
+#include <QScopedPointer>
+#include <qglobal.h>
+
+namespace WebCore {
+
+Q_GLOBAL_STATIC_WITH_INITIALIZER(QByteArray, cachedSystemLocale, {*x = QLocale::system().name().toLatin1();})
+
+const char* currentSearchLocaleID()
+{
+    return cachedSystemLocale()->constData(); 
+}
+
+const char* currentTextBreakLocaleID()
+{
+    return cachedSystemLocale()->constData(); 
+}
+
+}

Modified: trunk/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp (88015 => 88016)


--- trunk/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp	2011-06-03 14:47:04 UTC (rev 88016)
@@ -36,12 +36,6 @@
 
 namespace WebCore {
 
-#if USE(QT_ICU_TEXT_BREAKING)
-const char* currentTextBreakLocaleID()
-{
-    return QLocale::system().name().toLatin1();
-}
-#else
     class TextBreakIterator : public QTextBoundaryFinder {
     public:
         TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const QString& string)
@@ -155,6 +149,5 @@
     {
         return true;
     }
-#endif
 
 }

Modified: trunk/Source/WebCore/platform/text/qt/TextCodecQt.cpp (88015 => 88016)


--- trunk/Source/WebCore/platform/text/qt/TextCodecQt.cpp	2011-06-03 14:39:52 UTC (rev 88015)
+++ trunk/Source/WebCore/platform/text/qt/TextCodecQt.cpp	2011-06-03 14:47:04 UTC (rev 88016)
@@ -25,6 +25,7 @@
  */
 
 #include "config.h"
+#if USE(QT4_UNICODE)
 #include "TextCodecQt.h"
 #include "PlatformString.h"
 #include <wtf/text/CString.h>
@@ -46,17 +47,14 @@
 void TextCodecQt::registerEncodingNames(EncodingNameRegistrar registrar)
 {
     QList<int> mibs = QTextCodec::availableMibs();
-//     qDebug() << ">>>>>>>>> registerEncodingNames";
 
     for (int i = 0; i < mibs.size(); ++i) {
         QTextCodec *c = QTextCodec::codecForMib(mibs.at(i));
         const char *name = getAtomicName(c->name());
         registrar(name, name);
-//         qDebug() << "    " << name << name;
         QList<QByteArray> aliases = c->aliases();
         for (int i = 0; i < aliases.size(); ++i) {
             const char *a = getAtomicName(aliases.at(i));
-//             qDebug() << "     (a) " << a << name;
             registrar(a, name);
         }
     }
@@ -70,12 +68,10 @@
 void TextCodecQt::registerCodecs(TextCodecRegistrar registrar)
 {
     QList<int> mibs = QTextCodec::availableMibs();
-//     qDebug() << ">>>>>>>>> registerCodecs";
 
     for (int i = 0; i < mibs.size(); ++i) {
         QTextCodec *c = QTextCodec::codecForMib(mibs.at(i));
         const char *name = getAtomicName(c->name());
-//         qDebug() << "    " << name;
         registrar(name, newTextCodecQt, 0);
     }
 }
@@ -164,3 +160,4 @@
 
 
 } // namespace WebCore
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to