Changeset 44050 in webkit


Ignore:
Timestamp:
May 22, 2009 11:06:51 AM (15 years ago)
Author:
kov@webkit.org
Message:

WebCore

2009-05-22 Dominik Röttsches <dominik.roettsches@access-company.com>

Reviewed by Gustavo Noronha.

https://bugs.webkit.org/show_bug.cgi?id=15914
[GTK] Implement Unicode functionality using GLib

Minor changes that allow building a hybrid version of WebKit
that has WTF Unicode backend based on GLib functions while
text codecs and TextBreakIterator remain based on ICU.

Fixed some includes that were assuming a WTF ICU backend and
introduced temporary usage of WTF_USE_GLIB_ICU_UNICODE_HYBRID
macro.

  • platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): (WebCore::ThreadGlobalData::~ThreadGlobalData):
  • platform/ThreadGlobalData.h:
  • platform/text/TextBoundariesICU.cpp:
  • platform/text/TextCodecICU.h:
  • platform/text/TextEncoding.cpp: (WebCore::TextEncoding::encode):
  • platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::extendTextCodecMaps):

JavaScriptCore

2009-05-22 Dominik Röttsches <dominik.roettsches@access-company.com>

Reviewed by Gustavo Noronha.

https://bugs.webkit.org/show_bug.cgi?id=15914
[GTK] Implement Unicode functionality using GLib

Original patch by Jürg Billeter and Naiem Shaik.
Implementing WTF Unicode functionality based on GLib.

  • GNUmakefile.am:
  • wtf/unicode/Unicode.h:
  • wtf/unicode/glib: Added.
  • wtf/unicode/glib/UnicodeGLib.cpp: Added. (WTF::Unicode::foldCase): (WTF::Unicode::toLower): (WTF::Unicode::toUpper): (WTF::Unicode::direction): (WTF::Unicode::umemcasecmp):
  • wtf/unicode/glib/UnicodeGLib.h: Added. (WTF::Unicode::): (WTF::Unicode::toLower): (WTF::Unicode::toUpper): (WTF::Unicode::toTitleCase): (WTF::Unicode::isArabicChar): (WTF::Unicode::isFormatChar): (WTF::Unicode::isSeparatorSpace): (WTF::Unicode::isPrintableChar): (WTF::Unicode::isDigit): (WTF::Unicode::isPunct): (WTF::Unicode::mirroredChar): (WTF::Unicode::category): (WTF::Unicode::isLower): (WTF::Unicode::digitValue): (WTF::Unicode::combiningClass): (WTF::Unicode::decompositionType):
  • wtf/unicode/glib/UnicodeMacrosFromICU.h: Added.
Location:
trunk
Files:
4 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r43846 r44050  
     12009-05-22  Dominik Röttsches  <dominik.roettsches@access-company.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=15914
     6        [GTK] Implement Unicode functionality using GLib
     7
     8        Initial version of this patch by Jürg Billeter.
     9
     10        Adding options for --with-unicode-backend=icu|glib
     11        and checking for pango version >= 1.21.0 if GLib backend
     12        is selected. Temporarily, until remaining parts of
     13        this patch are committed, introduce WTF_USE_GLIB_ICU_UNICODE_HYBRID
     14        macro to allow for a mixed compilation with WTF Unicode
     15        backend based on GLib while text codecs and TextBreakIterator
     16        remain ICU dependent.
     17
     18        * GNUmakefile.am:
     19        * configure.ac:
     20
    1212009-05-18  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    222
  • trunk/GNUmakefile.am

    r43827 r44050  
    267267        -DBUILDING_CAIRO__=1 \
    268268        -DBUILDING_GTK__=1 \
    269         -DWTF_CHANGES \
     269        -DWTF_CHANGES
     270
     271if USE_ICU_UNICODE
     272global_cppflags += \
    270273        -DWTF_USE_ICU_UNICODE=1
     274endif
     275
     276if USE_GLIB_UNICODE
     277# https://bugs.webkit.org/show_bug.cgi?id=15914
     278# In patch 1/4 we are compiling a hybrid version of GLib WTF Unicode
     279# functionality mixed with ICU-based text codecs and TextBreakIterator.
     280# For the transition, introducing an interim HYBRID macro.
     281# This macro is required for compiling WTF with GLib Unicode backend,
     282# but at the same time keeping ICU dependency for codecs and break iterator.
     283# It will be removed with patch 3/4 of the above bug.
     284global_cppflags += \
     285        -DWTF_USE_GLIB_UNICODE=1 \
     286        -DWTF_USE_GLIB_ICU_UNICODE_HYBRID=1
     287endif
    271288
    272289if !ENABLE_FAST_MALLOC
  • trunk/JavaScriptCore/ChangeLog

    r44034 r44050  
     12009-05-22  Dominik Röttsches  <dominik.roettsches@access-company.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=15914
     6        [GTK] Implement Unicode functionality using GLib
     7
     8        Original patch by Jürg Billeter and Naiem Shaik.
     9        Implementing WTF Unicode functionality based on GLib.
     10
     11        * GNUmakefile.am:
     12        * wtf/unicode/Unicode.h:
     13        * wtf/unicode/glib: Added.
     14        * wtf/unicode/glib/UnicodeGLib.cpp: Added.
     15        (WTF::Unicode::foldCase):
     16        (WTF::Unicode::toLower):
     17        (WTF::Unicode::toUpper):
     18        (WTF::Unicode::direction):
     19        (WTF::Unicode::umemcasecmp):
     20        * wtf/unicode/glib/UnicodeGLib.h: Added.
     21        (WTF::Unicode::):
     22        (WTF::Unicode::toLower):
     23        (WTF::Unicode::toUpper):
     24        (WTF::Unicode::toTitleCase):
     25        (WTF::Unicode::isArabicChar):
     26        (WTF::Unicode::isFormatChar):
     27        (WTF::Unicode::isSeparatorSpace):
     28        (WTF::Unicode::isPrintableChar):
     29        (WTF::Unicode::isDigit):
     30        (WTF::Unicode::isPunct):
     31        (WTF::Unicode::mirroredChar):
     32        (WTF::Unicode::category):
     33        (WTF::Unicode::isLower):
     34        (WTF::Unicode::digitValue):
     35        (WTF::Unicode::combiningClass):
     36        (WTF::Unicode::decompositionType):
     37        * wtf/unicode/glib/UnicodeMacrosFromICU.h: Added.
     38
    1392009-05-21  Xan Lopez  <xlopez@igalia.com>
    240
  • trunk/JavaScriptCore/GNUmakefile.am

    r44034 r44050  
    270270        JavaScriptCore/wtf/unicode/UTF8.cpp \
    271271        JavaScriptCore/wtf/unicode/UTF8.h \
    272         JavaScriptCore/wtf/unicode/Unicode.h \
     272        JavaScriptCore/wtf/unicode/Unicode.h
     273
     274# ----
     275# icu unicode backend
     276# ----
     277if USE_ICU_UNICODE
     278javascriptcore_sources += \
    273279        JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp \
    274         JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h \
     280        JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h
     281endif # USE_ICU_UNICODE
     282
     283# ----
     284# glib unicode backend
     285# ----
     286if USE_GLIB_UNICODE
     287javascriptcore_sources += \
     288        JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h \
     289        JavaScriptCore/wtf/unicode/glib/UnicodeGLib.cpp \
     290        JavaScriptCore/wtf/unicode/glib/UnicodeMacrosFromICU.h
     291endif
     292
     293javascriptcore_sources += \
    275294        JavaScriptCore/wtf/VMTags.h \
    276295        JavaScriptCore/yarr/RegexCompiler.cpp \
  • trunk/JavaScriptCore/wtf/unicode/Unicode.h

    r39585 r44050  
    2929#elif USE(ICU_UNICODE)
    3030#include <wtf/unicode/icu/UnicodeIcu.h>
     31#elif USE(GLIB_UNICODE)
     32#include <wtf/unicode/glib/UnicodeGLib.h>
    3133#else
    3234#error "Unknown Unicode implementation"
  • trunk/WebCore/ChangeLog

    r44048 r44050  
     12009-05-22  Dominik Röttsches  <dominik.roettsches@access-company.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=15914
     6        [GTK] Implement Unicode functionality using GLib
     7
     8        Minor changes that allow building a hybrid version of WebKit
     9        that has WTF Unicode backend based on GLib functions while
     10        text codecs and TextBreakIterator remain based on ICU.
     11
     12        Fixed some includes that were assuming a WTF ICU backend and
     13        introduced temporary usage of WTF_USE_GLIB_ICU_UNICODE_HYBRID
     14        macro.
     15
     16        * platform/ThreadGlobalData.cpp:
     17        (WebCore::ThreadGlobalData::ThreadGlobalData):
     18        (WebCore::ThreadGlobalData::~ThreadGlobalData):
     19        * platform/ThreadGlobalData.h:
     20        * platform/text/TextBoundariesICU.cpp:
     21        * platform/text/TextCodecICU.h:
     22        * platform/text/TextEncoding.cpp:
     23        (WebCore::TextEncoding::encode):
     24        * platform/text/TextEncodingRegistry.cpp:
     25        (WebCore::buildBaseTextCodecMaps):
     26        (WebCore::extendTextCodecMaps):
     27
    1282009-05-22  Adam Barth  <abarth@webkit.org>
    229
  • trunk/WebCore/platform/ThreadGlobalData.cpp

    r40393 r44050  
    3333#include <wtf/UnusedParam.h>
    3434
    35 #if USE(ICU_UNICODE)
     35#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    3636#include "TextCodecICU.h"
    3737#endif
     
    7373    , m_eventNames(new EventNames)
    7474    , m_threadTimers(new ThreadTimers)
    75 #if USE(ICU_UNICODE)
     75#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    7676    , m_cachedConverterICU(new ICUConverterWrapper)
    7777#endif
     
    8787    delete m_cachedConverterTEC;
    8888#endif
    89 #if USE(ICU_UNICODE)
     89#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    9090    delete m_cachedConverterICU;
    9191#endif
  • trunk/WebCore/platform/ThreadGlobalData.h

    r40393 r44050  
    4949        ThreadTimers& threadTimers() { return *m_threadTimers; }
    5050
    51 #if USE(ICU_UNICODE)
     51#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    5252        ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; }
    5353#endif
     
    6363        ThreadTimers* m_threadTimers;
    6464
    65 #if USE(ICU_UNICODE)
     65#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    6666        ICUConverterWrapper* m_cachedConverterICU;
    6767#endif
  • trunk/WebCore/platform/text/TextBoundariesICU.cpp

    r28234 r44050  
    2828
    2929#include <unicode/ubrk.h>
     30#include <unicode/uchar.h>
    3031
    3132#include "StringImpl.h"
  • trunk/WebCore/platform/text/TextCodecICU.h

    r39465 r44050  
    3030#include "TextCodec.h"
    3131#include "TextEncoding.h"
     32
     33#include <unicode/utypes.h>
    3234
    3335typedef struct UConverter UConverter;
  • trunk/WebCore/platform/text/TextEncoding.cpp

    r43279 r44050  
    3232#include "TextCodec.h"
    3333#include "TextEncodingRegistry.h"
    34 #if USE(ICU_UNICODE)
     34#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    3535#include <unicode/unorm.h>
    3636#elif USE(QT4_UNICODE)
     
    8484        return "";
    8585
    86 #if USE(ICU_UNICODE)
     86#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    8787    // FIXME: What's the right place to do normalization?
    8888    // It's a little strange to do it inside the encode function.
  • trunk/WebCore/platform/text/TextEncodingRegistry.cpp

    r39563 r44050  
    3939#include <wtf/Threading.h>
    4040
    41 #if USE(ICU_UNICODE)
     41#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    4242#include "TextCodecICU.h"
    4343#endif
     
    186186    TextCodecUserDefined::registerCodecs(addToTextCodecMap);
    187187
    188 #if USE(ICU_UNICODE)
     188#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    189189    TextCodecICU::registerBaseEncodingNames(addToTextEncodingNameMap);
    190190    TextCodecICU::registerBaseCodecs(addToTextCodecMap);
     
    194194static void extendTextCodecMaps()
    195195{
    196 #if USE(ICU_UNICODE)
     196#if USE(ICU_UNICODE) || USE(GLIB_ICU_UNICODE_HYBRID)
    197197    TextCodecICU::registerExtendedEncodingNames(addToTextEncodingNameMap);
    198198    TextCodecICU::registerExtendedCodecs(addToTextCodecMap);
  • trunk/autotools/webkit.m4

    r40450 r44050  
    121121AC_MSG_CHECKING([which Unicode backend to use])
    122122AC_ARG_WITH(unicode_backend,
    123             AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@],
     123            AC_HELP_STRING([--with-unicode-backend=@<:@icu/glib@:>@],
    124124                           [Select Unicode backend [default=icu]]),
    125             [],[unicode_backend="icu"])
     125            [],[with_unicode_backend="icu"])
    126126
    127 case "$unicode_backend" in
    128      icu) ;;
    129      *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;;
     127case "$with_unicode_backend" in
     128     icu|glib) ;;
     129     *) AC_MSG_ERROR([Invalid Unicode backend: must be icu or glib.]) ;;
    130130esac
    131 AC_MSG_RESULT([$unicode_backend])
    132131
    133 if test "$unicode_backend" = "icu"; then
     132AC_MSG_RESULT([$with_unicode_backend])
     133
     134# https://bugs.webkit.org/show_bug.cgi?id=15914
     135# Splitting ICU removal patch into smaller portions. We compile a hybrid version
     136# with the WTF Unicode backend being based on GLib while text codecs and TextBreakIterator
     137# keep the ICU dependency. That's why we temporarily add icu headers and libs for glib config case as well.
     138if test "$with_unicode_backend" = "icu" -o "$with_unicode_backend" = "glib"; then
    134139        if test "$os_darwin" = "yes"; then
    135140                UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu"
     
    151156        fi
    152157fi
     158
     159if test "$with_unicode_backend" = "glib"; then
     160        # https://bugs.webkit.org/show_bug.cgi?id=15914
     161        # Splitting ICU removal patch into smaller portions, that's why we
     162        # temporarily retrieve flags & libs info for glib into UNICODEGLIB
     163        # instead of UNICODE variable, then concatenate.
     164        # Patch 3/4 of the above issue will rename the variable back to UNICODE.
     165        PKG_CHECK_MODULES([UNICODEGLIB], [glib-2.0 pango >= 1.21.0])
     166        UNICODE_CFLAGS="$UNICODE_CFLAGS $UNICODEGLIB_CFLAGS"
     167        UNICODE_LIBS="$UNICODE_LIBS $UNICODEGLIB_LIBS"
     168fi
     169
    153170AC_SUBST([UNICODE_CFLAGS])
    154171AC_SUBST([UNICODE_LIBS])
  • trunk/configure.ac

    r43846 r44050  
    641641AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
    642642
     643# Unicode backend conditionals
     644AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
     645AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
     646
    643647# Auth backend conditionals
    644648AM_CONDITIONAL([USE_GNOMEKEYRING], [test "$enable_gnomekeyring" = "yes"])
     
    694698 Enable GCC build optimization                            : $enable_optimizations
    695699 Code coverage support                                    : $enable_coverage
    696  Unicode backend                                          : $unicode_backend
     700 Unicode backend                                          : $with_unicode_backend
    697701 Font backend                                             : $with_font_backend
    698702 Optimized memory allocator                               : $enable_fast_malloc
Note: See TracChangeset for help on using the changeset viewer.