[GTK] Remove the GLib unicode backend
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 06:30:42 +0000 (06:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 06:30:42 +0000 (06:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109627

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-02-12
Reviewed by Benjamin Poulain.

.:

Remove references to the GLib unicode backend from configuration.

* Source/autotools/FindDependencies.m4:
* Source/autotools/ReadCommandLineArguments.m4:
* Source/autotools/SetupAutoconfHeader.m4:
* Source/autotools/SetupAutomake.m4:

Source/WebCore:

Remove references to the GLib unicode backend from WebCore.

* GNUmakefile.list.am: Update the source list.
* platform/text/gtk/TextBreakIteratorGtk.cpp: Removed.
* platform/text/gtk/TextCodecGtk.cpp: Removed.
* platform/text/gtk/TextCodecGtk.h: Removed.

Source/WTF:

Remove references to the GLib unicode backend from WTF.

* GNUmakefile.list.am: Remove GLib unicode files from the source list.
* wtf/unicode/glib/UnicodeGLib.cpp: Removed.
* wtf/unicode/glib/UnicodeGLib.h: Removed.

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

14 files changed:
ChangeLog
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp [deleted file]
Source/WTF/wtf/unicode/glib/UnicodeGLib.h [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp [deleted file]
Source/WebCore/platform/text/gtk/TextCodecGtk.cpp [deleted file]
Source/WebCore/platform/text/gtk/TextCodecGtk.h [deleted file]
Source/autotools/FindDependencies.m4
Source/autotools/ReadCommandLineArguments.m4
Source/autotools/SetupAutoconfHeader.m4
Source/autotools/SetupAutomake.m4

index 5c73309..fd35bb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-02-12  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove the GLib unicode backend
+        https://bugs.webkit.org/show_bug.cgi?id=109627
+
+        Reviewed by Benjamin Poulain.
+
+        Remove references to the GLib unicode backend from configuration.
+
+        * Source/autotools/FindDependencies.m4:
+        * Source/autotools/ReadCommandLineArguments.m4:
+        * Source/autotools/SetupAutoconfHeader.m4:
+        * Source/autotools/SetupAutomake.m4:
+
 2013-02-12  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         Remove remaining traces of Web Intents
index 97290b1..e7063ed 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-12  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove the GLib unicode backend
+        https://bugs.webkit.org/show_bug.cgi?id=109627
+
+        Reviewed by Benjamin Poulain.
+
+        Remove references to the GLib unicode backend from WTF.
+
+        * GNUmakefile.list.am: Remove GLib unicode files from the source list.
+        * wtf/unicode/glib/UnicodeGLib.cpp: Removed.
+        * wtf/unicode/glib/UnicodeGLib.h: Removed.
+
 2013-02-12  Takeshi Yoshino  <tyoshino@google.com>
 
         Remove unnecessary and confusing includes from StreamBuffer.h.
index c23b453..0c01579 100644 (file)
@@ -261,8 +261,6 @@ wtf_sources += \
     Source/WTF/wtf/unicode/UTF8.h \
     Source/WTF/wtf/unicode/Unicode.h \
     Source/WTF/wtf/unicode/UnicodeMacrosFromICU.h \
-    Source/WTF/wtf/unicode/glib/UnicodeGLib.h \
-    Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp \
     Source/WTF/wtf/unicode/icu/CollatorICU.cpp \
     Source/WTF/wtf/unicode/icu/UnicodeIcu.h \
     Source/WTF/wtf/url/api/ParsedURL.cpp \
diff --git a/Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp b/Source/WTF/wtf/unicode/glib/UnicodeGLib.cpp
deleted file mode 100644 (file)
index 3aa8b10..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *  Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
- *  Copyright (C) 2008 Dominik Röttsches <dominik.roettsches@access-company.com>
- *  Copyright (C) 2010 Igalia S.L.
- *
- *  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 "UnicodeGLib.h"
-
-#if USE(GLIB_UNICODE)
-
-#include <wtf/Vector.h>
-#include <wtf/unicode/UTF8.h>
-
-#define UTF8_IS_SURROGATE(character) (character >= 0x10000 && character <= 0x10FFFF)
-
-namespace WTF {
-
-namespace Unicode {
-
-UChar32 foldCase(UChar32 ch)
-{
-    GOwnPtr<GError> gerror;
-
-    GOwnPtr<char> utf8char;
-    utf8char.set(g_ucs4_to_utf8(reinterpret_cast<gunichar*>(&ch), 1, 0, 0, &gerror.outPtr()));
-    if (gerror)
-        return ch;
-
-    GOwnPtr<char> utf8caseFolded;
-    utf8caseFolded.set(g_utf8_casefold(utf8char.get(), -1));
-
-    GOwnPtr<gunichar> ucs4Result;
-    ucs4Result.set(g_utf8_to_ucs4_fast(utf8caseFolded.get(), -1, 0));
-
-    return *ucs4Result;
-}
-
-static int getUTF16LengthFromUTF8(const gchar* utf8String, int length)
-{
-    int utf16Length = 0;
-    const gchar* inputString = utf8String;
-
-    while ((utf8String + length - inputString > 0) && *inputString) {
-        gunichar character = g_utf8_get_char(inputString);
-
-        utf16Length += UTF8_IS_SURROGATE(character) ? 2 : 1;
-        inputString = g_utf8_next_char(inputString);
-    }
-
-    return utf16Length;
-}
-
-typedef gchar* (*UTF8CaseFunction)(const gchar*, gssize length);
-
-static int convertCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error, UTF8CaseFunction caseFunction)
-{
-    *error = false;
-
-    // Allocate a buffer big enough to hold all the characters.
-    Vector<char> buffer(srcLength * 3);
-    char* utf8Target = buffer.data();
-    const UChar* utf16Source = src;
-    ConversionResult conversionResult = convertUTF16ToUTF8(&utf16Source, utf16Source + srcLength, &utf8Target, utf8Target + buffer.size(), true);
-    if (conversionResult != conversionOK) {
-        *error = true;
-        return -1;
-    }
-    buffer.shrink(utf8Target - buffer.data());
-
-    GOwnPtr<char> utf8Result(caseFunction(buffer.data(), buffer.size()));
-    long utf8ResultLength = strlen(utf8Result.get());
-
-    // Calculate the destination buffer size.
-    int realLength = getUTF16LengthFromUTF8(utf8Result.get(), utf8ResultLength);
-    if (realLength > resultLength) {
-        *error = true;
-        return realLength;
-    }
-
-    // Convert the result to UTF-16.
-    UChar* utf16Target = result;
-    const char* utf8Source = utf8Result.get();
-    bool unusedISAllASCII;
-    conversionResult = convertUTF8ToUTF16(&utf8Source, utf8Source + utf8ResultLength, &utf16Target, utf16Target + resultLength, &unusedIsAllASCII, true);
-    long utf16ResultLength = utf16Target - result;
-    if (conversionResult != conversionOK)
-        *error = true;
-
-    return utf16ResultLength <= 0 ? -1 : utf16ResultLength;
-}
-int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
-{
-    return convertCase(result, resultLength, src, srcLength, error, g_utf8_casefold);
-}
-
-int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
-{
-    return convertCase(result, resultLength, src, srcLength, error, g_utf8_strdown);
-}
-
-int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
-{
-    return convertCase(result, resultLength, src, srcLength, error, g_utf8_strup);
-}
-
-Direction direction(UChar32 c)
-{
-    PangoBidiType type = pango_bidi_type_for_unichar(c);
-    switch (type) {
-    case PANGO_BIDI_TYPE_L:
-        return LeftToRight;
-    case PANGO_BIDI_TYPE_R:
-        return RightToLeft;
-    case PANGO_BIDI_TYPE_AL:
-        return RightToLeftArabic;
-    case PANGO_BIDI_TYPE_LRE:
-        return LeftToRightEmbedding;
-    case PANGO_BIDI_TYPE_RLE:
-        return RightToLeftEmbedding;
-    case PANGO_BIDI_TYPE_LRO:
-        return LeftToRightOverride;
-    case PANGO_BIDI_TYPE_RLO:
-        return RightToLeftOverride;
-    case PANGO_BIDI_TYPE_PDF:
-        return PopDirectionalFormat;
-    case PANGO_BIDI_TYPE_EN:
-        return EuropeanNumber;
-    case PANGO_BIDI_TYPE_AN:
-        return ArabicNumber;
-    case PANGO_BIDI_TYPE_ES:
-        return EuropeanNumberSeparator;
-    case PANGO_BIDI_TYPE_ET:
-        return EuropeanNumberTerminator;
-    case PANGO_BIDI_TYPE_CS:
-        return CommonNumberSeparator;
-    case PANGO_BIDI_TYPE_NSM:
-        return NonSpacingMark;
-    case PANGO_BIDI_TYPE_BN:
-        return BoundaryNeutral;
-    case PANGO_BIDI_TYPE_B:
-        return BlockSeparator;
-    case PANGO_BIDI_TYPE_S:
-        return SegmentSeparator;
-    case PANGO_BIDI_TYPE_WS:
-        return WhiteSpaceNeutral;
-    default:
-        return OtherNeutral;
-    }
-}
-
-int umemcasecmp(const UChar* a, const UChar* b, int len)
-{
-    GOwnPtr<char> utf8a;
-    GOwnPtr<char> utf8b;
-
-    utf8a.set(g_utf16_to_utf8(a, len, 0, 0, 0));
-    utf8b.set(g_utf16_to_utf8(b, len, 0, 0, 0));
-
-    GOwnPtr<char> foldedA;
-    GOwnPtr<char> foldedB;
-
-    foldedA.set(g_utf8_casefold(utf8a.get(), -1));
-    foldedB.set(g_utf8_casefold(utf8b.get(), -1));
-
-    // FIXME: umemcasecmp needs to mimic u_memcasecmp of icu
-    // from the ICU docs:
-    // "Compare two strings case-insensitively using full case folding.
-    // his is equivalent to u_strcmp(u_strFoldCase(s1, n, options), u_strFoldCase(s2, n, options))."
-    //
-    // So it looks like we don't need the full g_utf8_collate here,
-    // but really a bitwise comparison of casefolded unicode chars (not utf-8 bytes).
-    // As there is no direct equivalent to this icu function in GLib, for now
-    // we'll use g_utf8_collate():
-
-    return g_utf8_collate(foldedA.get(), foldedB.get());
-}
-
-} // namespace Unicode
-
-} // namespace WTF
-
-#endif // USE(GLIB_UNICODE)
diff --git a/Source/WTF/wtf/unicode/glib/UnicodeGLib.h b/Source/WTF/wtf/unicode/glib/UnicodeGLib.h
deleted file mode 100644 (file)
index e9e455a..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- *  Copyright (C) 2006 George Staikos <staikos@kde.org>
- *  Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
- *  Copyright (C) 2007 Apple Computer, Inc. All rights reserved.
- *  Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
- *  Copyright (C) 2008 Dominik Röttsches <dominik.roettsches@access-company.com>
- *
- *  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.
- *
- */
-
-#ifndef UnicodeGLib_h
-#define UnicodeGLib_h
-
-#if USE(GLIB_UNICODE)
-
-#include <wtf/gobject/GOwnPtr.h>
-#include <wtf/unicode/ScriptCodesFromICU.h>
-#include <wtf/unicode/UnicodeMacrosFromICU.h>
-
-#include <glib.h>
-#include <pango/pango.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef uint16_t UChar;
-typedef int32_t UChar32;
-
-namespace WTF {
-
-namespace Unicode {
-
-enum Direction {
-    LeftToRight,
-    RightToLeft,
-    EuropeanNumber,
-    EuropeanNumberSeparator,
-    EuropeanNumberTerminator,
-    ArabicNumber,
-    CommonNumberSeparator,
-    BlockSeparator,
-    SegmentSeparator,
-    WhiteSpaceNeutral,
-    OtherNeutral,
-    LeftToRightEmbedding,
-    LeftToRightOverride,
-    RightToLeftArabic,
-    RightToLeftEmbedding,
-    RightToLeftOverride,
-    PopDirectionalFormat,
-    NonSpacingMark,
-    BoundaryNeutral
-};
-
-enum DecompositionType {
-    DecompositionNone,
-    DecompositionCanonical,
-    DecompositionCompat,
-    DecompositionCircle,
-    DecompositionFinal,
-    DecompositionFont,
-    DecompositionFraction,
-    DecompositionInitial,
-    DecompositionIsolated,
-    DecompositionMedial,
-    DecompositionNarrow,
-    DecompositionNoBreak,
-    DecompositionSmall,
-    DecompositionSquare,
-    DecompositionSub,
-    DecompositionSuper,
-    DecompositionVertical,
-    DecompositionWide,
-};
-
-enum CharCategory {
-    NoCategory =  0,
-    Other_NotAssigned = U_MASK(G_UNICODE_UNASSIGNED),
-    Letter_Uppercase = U_MASK(G_UNICODE_UPPERCASE_LETTER),
-    Letter_Lowercase = U_MASK(G_UNICODE_LOWERCASE_LETTER),
-    Letter_Titlecase = U_MASK(G_UNICODE_TITLECASE_LETTER),
-    Letter_Modifier = U_MASK(G_UNICODE_MODIFIER_LETTER),
-    Letter_Other = U_MASK(G_UNICODE_OTHER_LETTER),
-
-    Mark_NonSpacing = U_MASK(G_UNICODE_NON_SPACING_MARK),
-    Mark_Enclosing = U_MASK(G_UNICODE_ENCLOSING_MARK),
-    Mark_SpacingCombining = U_MASK(G_UNICODE_COMBINING_MARK),
-
-    Number_DecimalDigit = U_MASK(G_UNICODE_DECIMAL_NUMBER),
-    Number_Letter = U_MASK(G_UNICODE_LETTER_NUMBER),
-    Number_Other = U_MASK(G_UNICODE_OTHER_NUMBER),
-
-    Separator_Space = U_MASK(G_UNICODE_SPACE_SEPARATOR),
-    Separator_Line = U_MASK(G_UNICODE_LINE_SEPARATOR),
-    Separator_Paragraph = U_MASK(G_UNICODE_PARAGRAPH_SEPARATOR),
-
-    Other_Control = U_MASK(G_UNICODE_CONTROL),
-    Other_Format = U_MASK(G_UNICODE_FORMAT),
-    Other_PrivateUse = U_MASK(G_UNICODE_PRIVATE_USE),
-    Other_Surrogate = U_MASK(G_UNICODE_SURROGATE),
-
-    Punctuation_Dash = U_MASK(G_UNICODE_DASH_PUNCTUATION),
-    Punctuation_Open = U_MASK(G_UNICODE_OPEN_PUNCTUATION),
-    Punctuation_Close = U_MASK(G_UNICODE_CLOSE_PUNCTUATION),
-    Punctuation_Connector = U_MASK(G_UNICODE_CONNECT_PUNCTUATION),
-    Punctuation_Other = U_MASK(G_UNICODE_OTHER_PUNCTUATION),
-
-    Symbol_Math = U_MASK(G_UNICODE_MATH_SYMBOL),
-    Symbol_Currency = U_MASK(G_UNICODE_CURRENCY_SYMBOL),
-    Symbol_Modifier = U_MASK(G_UNICODE_MODIFIER_SYMBOL),
-    Symbol_Other = U_MASK(G_UNICODE_OTHER_SYMBOL),
-
-    Punctuation_InitialQuote = U_MASK(G_UNICODE_INITIAL_PUNCTUATION),
-    Punctuation_FinalQuote = U_MASK(G_UNICODE_FINAL_PUNCTUATION)
-};
-
-UChar32 foldCase(UChar32);
-
-int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error);
-
-int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error);
-
-inline UChar32 toLower(UChar32 c)
-{
-    return g_unichar_tolower(c);
-}
-
-inline UChar32 toUpper(UChar32 c)
-{
-    return g_unichar_toupper(c);
-}
-
-int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error);
-
-inline UChar32 toTitleCase(UChar32 c)
-{
-    return g_unichar_totitle(c);
-}
-
-inline bool isArabicChar(UChar32 c)
-{
-    return c >= 0x0600 && c <= 0x06FF;
-}
-
-inline bool isAlphanumeric(UChar32 c)
-{
-    return g_unichar_isalnum(c);
-}
-
-inline bool isFormatChar(UChar32 c)
-{
-    return g_unichar_type(c) == G_UNICODE_FORMAT;
-}
-
-inline bool isSeparatorSpace(UChar32 c)
-{
-    return g_unichar_type(c) == G_UNICODE_SPACE_SEPARATOR;
-}
-
-inline bool isPrintableChar(UChar32 c)
-{
-    return g_unichar_isprint(c);
-}
-
-inline bool isDigit(UChar32 c)
-{
-    return g_unichar_isdigit(c);
-}
-
-inline bool isPunct(UChar32 c)
-{
-    return g_unichar_ispunct(c);
-}
-
-inline bool hasLineBreakingPropertyComplexContext(UChar32 c)
-{
-    // FIXME
-    return false;
-}
-
-inline UChar32 mirroredChar(UChar32 c)
-{
-    gunichar mirror = 0;
-    g_unichar_get_mirror_char(c, &mirror);
-    return mirror;
-}
-
-inline CharCategory category(UChar32 c)
-{
-    if (c > 0xffff)
-        return NoCategory;
-
-    return (CharCategory) U_MASK(g_unichar_type(c));
-}
-
-Direction direction(UChar32);
-
-inline bool isLower(UChar32 c)
-{
-    return g_unichar_islower(c);
-}
-
-inline uint8_t combiningClass(UChar32 c)
-{
-    // FIXME
-    // return g_unichar_combining_class(c);
-    return 0;
-}
-
-inline DecompositionType decompositionType(UChar32 c)
-{
-    // FIXME
-    return DecompositionNone;
-}
-
-int umemcasecmp(const UChar*, const UChar*, int len);
-
-} // namespace Unicode
-
-} // namespace WTF
-
-#endif // USE(GLIB_UNICODE)
-
-#endif // UnicodeGlib_h
index bf2dc71..e026376 100644 (file)
@@ -1,3 +1,17 @@
+2013-02-12  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Remove the GLib unicode backend
+        https://bugs.webkit.org/show_bug.cgi?id=109627
+
+        Reviewed by Benjamin Poulain.
+
+        Remove references to the GLib unicode backend from WebCore.
+
+        * GNUmakefile.list.am: Update the source list.
+        * platform/text/gtk/TextBreakIteratorGtk.cpp: Removed.
+        * platform/text/gtk/TextCodecGtk.cpp: Removed.
+        * platform/text/gtk/TextCodecGtk.h: Removed.
+
 2013-02-12  Chris Fleizach  <cfleizach@apple.com>
 
          AX: crash when accessing AccessibilityScrollbar after page has been unloaded
index 707ab6a..c852ef7 100644 (file)
@@ -5977,6 +5977,7 @@ webcore_platform_sources += \
        Source/WebCore/platform/SystemTime.h \
        Source/WebCore/platform/text/enchant/TextCheckerEnchant.h \
        Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp \
+       Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp \
        Source/WebCore/platform/text/BidiContext.cpp \
        Source/WebCore/platform/text/BidiContext.h \
        Source/WebCore/platform/text/BidiResolver.h \
@@ -6007,6 +6008,8 @@ webcore_platform_sources += \
        Source/WebCore/platform/text/TextBoundaries.cpp \
        Source/WebCore/platform/text/TextBoundaries.h \
        Source/WebCore/platform/text/TextBreakIterator.cpp \
+       Source/WebCore/platform/text/TextBreakIteratorICU.cpp \
+       Source/WebCore/platform/text/TextBreakIteratorInternalICU.h \
        Source/WebCore/platform/text/TextBreakIterator.h \
        Source/WebCore/platform/text/TextCheckerClient.h \
        Source/WebCore/platform/text/TextChecking.h \
@@ -6021,6 +6024,8 @@ webcore_platform_sources += \
        Source/WebCore/platform/text/TextCodecUTF16.h \
        Source/WebCore/platform/text/TextCodecUTF8.cpp \
        Source/WebCore/platform/text/TextCodecUTF8.h \
+       Source/WebCore/platform/text/TextCodecICU.cpp \
+       Source/WebCore/platform/text/TextCodecICU.h \
        Source/WebCore/platform/text/TextDirection.h \
        Source/WebCore/platform/text/TextEncoding.cpp \
        Source/WebCore/platform/text/TextEncodingDetector.h \
@@ -6263,28 +6268,6 @@ webcore_sources += \
        Source/WebCore/platform/graphics/OpenGLShims.h
 endif # END USE_GLES2
 
-# ----
-# icu unicode backend
-# ----
-if USE_ICU_UNICODE
-webcore_sources += \
-       Source/WebCore/platform/text/TextCodecICU.cpp \
-       Source/WebCore/platform/text/TextCodecICU.h \
-       Source/WebCore/platform/text/TextBreakIteratorICU.cpp \
-       Source/WebCore/platform/text/TextBreakIteratorInternalICU.h \
-       Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
-endif
-
-# ----
-# glib unicode backend
-# ----
-if USE_GLIB_UNICODE
-webcore_sources += \
-       Source/WebCore/platform/text/gtk/TextCodecGtk.cpp \
-       Source/WebCore/platform/text/gtk/TextCodecGtk.h \
-       Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
-endif
-
 if USE_GSTREAMER
 webcoregtk_sources += \
        Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp \
diff --git a/Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp b/Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
deleted file mode 100644 (file)
index b33255d..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
- * Copyright (C) 2008 Dominik Röttsches <dominik.roettsches@access-company.com>
- * Copyright (C) 2010 Igalia S.L.
- *
- * 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 "TextBreakIterator.h"
-
-#include <wtf/Atomics.h>
-#include <wtf/gobject/GOwnPtr.h>
-#include <pango/pango.h>
-
-using namespace WTF;
-using namespace std;
-
-#define UTF8_IS_SURROGATE(character) (character >= 0x10000 && character <= 0x10FFFF)
-
-namespace WebCore {
-
-class CharacterIterator {
-public:
-    bool setText(const UChar* string, int length);
-    const gchar* getText() { return m_utf8.get(); }
-    int getLength() { return m_length; }
-    glong getSize() { return m_size; }
-    void setIndex(int index);
-    int getIndex() { return m_index; }
-    void setUTF16Index(int index);
-    int getUTF16Index() { return m_utf16Index; }
-    int getUTF16Length() { return m_utf16Length; }
-    int first();
-    int last();
-    int next();
-    int previous();
-private:
-    int characterSize(int index);
-
-    GOwnPtr<char> m_utf8;
-    int m_length;
-    long m_size;
-    int m_index;
-    int m_utf16Index;
-    int m_utf16Length;
-};
-
-int CharacterIterator::characterSize(int index)
-{
-    if (index == m_length || index < 0)
-        return 0;
-    if (m_length == m_utf16Length)
-        return 1;
-
-    gchar* indexPtr = g_utf8_offset_to_pointer(m_utf8.get(), index);
-    gunichar character = g_utf8_get_char(indexPtr);
-    return UTF8_IS_SURROGATE(character) ? 2 : 1;
-}
-
-bool CharacterIterator::setText(const UChar* string, int length)
-{
-    long utf8Size = 0;
-    m_utf8.set(g_utf16_to_utf8(string, length, 0, &utf8Size, 0));
-    if (!utf8Size)
-        return false;
-
-    m_utf16Length = length;
-    m_length = g_utf8_strlen(m_utf8.get(), utf8Size);
-    m_size = utf8Size;
-    m_index = 0;
-    m_utf16Index = 0;
-
-    return true;
-}
-
-void CharacterIterator::setIndex(int index)
-{
-    if (index == m_index)
-        return;
-    if (index <= 0)
-        m_index = m_utf16Index = 0;
-    else if (index >= m_length) {
-        m_index = m_length;
-        m_utf16Index = m_utf16Length;
-    } else if (m_length == m_utf16Length)
-        m_index = m_utf16Index = index;
-    else {
-        m_index = index;
-        int utf16Index = 0;
-        int utf8Index = 0;
-        while (utf8Index < index) {
-            utf16Index += characterSize(utf8Index);
-            utf8Index++;
-        }
-        m_utf16Index = utf16Index;
-    }
-}
-
-void CharacterIterator::setUTF16Index(int index)
-{
-    if (index == m_utf16Index)
-        return;
-    if (index <= 0)
-        m_utf16Index = m_index = 0;
-    else if (index >= m_utf16Length) {
-        m_utf16Index = m_utf16Length;
-        m_index = m_length;
-    } else if (m_length == m_utf16Length)
-        m_utf16Index = m_index = index;
-    else {
-        m_utf16Index = index;
-        int utf16Index = 0;
-        int utf8Index = 0;
-        while (utf16Index < index) {
-            utf16Index += characterSize(utf8Index);
-            utf8Index++;
-        }
-        m_index = utf8Index;
-    }
-}
-
-int CharacterIterator::first()
-{
-    m_index = m_utf16Index = 0;
-    return m_index;
-}
-
-int CharacterIterator::last()
-{
-    m_index = m_length;
-    m_utf16Index = m_utf16Length;
-    return m_index;
-}
-
-int CharacterIterator::next()
-{
-    int next = m_index + 1;
-
-    if (next <= m_length) {
-        m_utf16Index = min(m_utf16Index + characterSize(m_index), m_utf16Length);
-        m_index = next;
-    } else {
-        m_index = TextBreakDone;
-        m_utf16Index = TextBreakDone;
-    }
-
-    return m_index;
-}
-
-int CharacterIterator::previous()
-{
-    int previous = m_index - 1;
-
-    if (previous >= 0) {
-        m_utf16Index = max(m_utf16Index - characterSize(previous), 0);
-        m_index = previous;
-    } else {
-        m_index = TextBreakDone;
-        m_utf16Index = TextBreakDone;
-    }
-
-    return m_index;
-}
-
-enum UBreakIteratorType {
-    UBRK_CHARACTER,
-    UBRK_WORD,
-    UBRK_LINE,
-    UBRK_SENTENCE
-};
-
-class TextBreakIterator {
-public:
-    UBreakIteratorType m_type;
-    PangoLogAttr* m_logAttrs;
-    CharacterIterator m_charIterator;
-};
-
-static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator,
-    UBreakIteratorType type, const UChar* string, int length)
-{
-    if (!string)
-        return 0;
-
-    if (!createdIterator) {
-        iterator = new TextBreakIterator();
-        createdIterator = true;
-    }
-    if (!iterator)
-        return 0;
-
-    if (!iterator->m_charIterator.setText(string, length))
-        return 0;
-
-    int charLength = iterator->m_charIterator.getLength();
-
-    iterator->m_type = type;
-    if (createdIterator)
-        g_free(iterator->m_logAttrs);
-    iterator->m_logAttrs = g_new0(PangoLogAttr, charLength + 1);
-    pango_get_log_attrs(iterator->m_charIterator.getText(), iterator->m_charIterator.getSize(),
-                        -1, 0, iterator->m_logAttrs, charLength + 1);
-
-    return iterator;
-}
-
-static TextBreakIterator* nonSharedCharacterBreakIterator;
-
-NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
-{
-    m_iterator = nonSharedCharacterBreakIterator;
-    bool createdIterator = m_iterator && weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), m_iterator, 0);
-    m_iterator = setUpIterator(createdIterator, m_iterator, UBRK_CHARACTER, buffer, length);
-}
-
-NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
-{
-    if (!weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), 0, m_iterator))
-        delete m_iterator;
-}
-
-TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
-{
-    // FIXME: This needs closer inspection to achieve behaviour identical to the ICU version.
-    static bool createdCursorMovementIterator = false;
-    static TextBreakIterator* staticCursorMovementIterator;
-    return setUpIterator(createdCursorMovementIterator, staticCursorMovementIterator, UBRK_CHARACTER, string, length);
-}
-
-TextBreakIterator* wordBreakIterator(const UChar* string, int length)
-{
-    static bool createdWordBreakIterator = false;
-    static TextBreakIterator* staticWordBreakIterator;
-    return setUpIterator(createdWordBreakIterator, staticWordBreakIterator, UBRK_WORD, string, length);
-}
-
-static bool createdLineBreakIterator = false;
-static TextBreakIterator* staticLineBreakIterator;
-
-TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&)
-{
-    TextBreakIterator* lineBreakIterator = 0;
-    if (!createdLineBreakIterator || staticLineBreakIterator) {
-        setUpIterator(createdLineBreakIterator, staticLineBreakIterator, UBRK_LINE, string, length);
-        swap(staticLineBreakIterator, lineBreakIterator);
-    }
-
-    if (!lineBreakIterator) {
-        bool createdNewLineBreakIterator = false;
-        setUpIterator(createdNewLineBreakIterator, lineBreakIterator, UBRK_LINE, string, length);
-    }
-
-    return lineBreakIterator;
-}
-
-void releaseLineBreakIterator(TextBreakIterator* iterator)
-{
-    ASSERT(createdLineBreakIterator);
-    ASSERT(iterator);
-
-    if (!staticLineBreakIterator)
-        staticLineBreakIterator = iterator;
-    else
-        delete iterator;
-}
-
-TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
-{
-    static bool createdSentenceBreakIterator = false;
-    static TextBreakIterator* staticSentenceBreakIterator;
-    return setUpIterator(createdSentenceBreakIterator, staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
-}
-
-int textBreakFirst(TextBreakIterator* iterator)
-{
-    iterator->m_charIterator.first();
-    return iterator->m_charIterator.getUTF16Index();
-}
-
-int textBreakLast(TextBreakIterator* iterator)
-{
-    // TextBreakLast is not meant to find just any break according to bi->m_type 
-    // but really the one near the last character.
-    // (cmp ICU documentation for ubrk_first and ubrk_last)
-    // From ICU docs for ubrk_last:
-    // "Determine the index immediately beyond the last character in the text being scanned." 
-
-    // So we should advance or traverse back based on bi->m_logAttrs cursor positions.
-    // If last character position in the original string is a whitespace,
-    // traverse to the left until the first non-white character position is found
-    // and return the position of the first white-space char after this one.
-    // Otherwise return m_length, as "the first character beyond the last" is outside our string.
-    
-    bool whiteSpaceAtTheEnd = true;
-    int nextWhiteSpacePos = iterator->m_charIterator.getLength();
-
-    int pos = iterator->m_charIterator.last();
-    while (pos >= 0 && whiteSpaceAtTheEnd) {
-        if (iterator->m_logAttrs[pos].is_cursor_position) {
-            if (whiteSpaceAtTheEnd = iterator->m_logAttrs[pos].is_white)
-                nextWhiteSpacePos = pos;
-        }
-        pos = iterator->m_charIterator.previous();
-    }
-    iterator->m_charIterator.setIndex(nextWhiteSpacePos);
-    return iterator->m_charIterator.getUTF16Index();
-}
-
-int textBreakNext(TextBreakIterator* iterator)
-{
-    while (iterator->m_charIterator.next() != TextBreakDone) {
-        int index = iterator->m_charIterator.getIndex();
-
-        // FIXME: UBRK_WORD case: Single multibyte characters (i.e. white space around them), such as the euro symbol €, 
-        // are not marked as word_start & word_end as opposed to the way ICU does it.
-        // This leads to - for example - different word selection behaviour when right clicking.
-
-        if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
-            || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
-            || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
-            || (iterator->m_type == UBRK_SENTENCE && iterator->m_logAttrs[index].is_sentence_boundary)) {
-            break;
-        }
-    }
-    return iterator->m_charIterator.getUTF16Index();
-}
-
-int textBreakPrevious(TextBreakIterator* iterator)
-{
-    while (iterator->m_charIterator.previous() != TextBreakDone) {
-        int index = iterator->m_charIterator.getIndex();
-
-        if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
-            || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
-            || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
-            || (iterator->m_type == UBRK_SENTENCE && iterator->m_logAttrs[index].is_sentence_boundary)) {
-            break;
-        }
-    }
-    return iterator->m_charIterator.getUTF16Index();
-}
-
-int textBreakPreceding(TextBreakIterator* iterator, int offset)
-{
-    if (offset > iterator->m_charIterator.getUTF16Length())
-        return TextBreakDone;
-    if (offset < 0)
-        return 0;
-    iterator->m_charIterator.setUTF16Index(offset);
-    return textBreakPrevious(iterator);
-}
-
-int textBreakFollowing(TextBreakIterator* iterator, int offset)
-{
-    if (offset > iterator->m_charIterator.getUTF16Length())
-        return TextBreakDone;
-    if (offset < 0)
-        return 0;
-    iterator->m_charIterator.setUTF16Index(offset);
-    return textBreakNext(iterator);
-}
-
-int textBreakCurrent(TextBreakIterator* iterator)
-{
-    return iterator->m_charIterator.getUTF16Index();
-}
-
-bool isTextBreak(TextBreakIterator* iterator, int offset)
-{
-    if (!offset)
-        return true;
-    if (offset > iterator->m_charIterator.getUTF16Length())
-        return false;
-
-    iterator->m_charIterator.setUTF16Index(offset);
-
-    int index = iterator->m_charIterator.getIndex();
-    iterator->m_charIterator.previous();
-    textBreakNext(iterator);
-    return iterator->m_charIterator.getIndex() == index;
-}
-
-bool isWordTextBreak(TextBreakIterator*)
-{
-    return true;
-}
-
-}
diff --git a/Source/WebCore/platform/text/gtk/TextCodecGtk.cpp b/Source/WebCore/platform/text/gtk/TextCodecGtk.cpp
deleted file mode 100644 (file)
index a132d95..0000000
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
- * Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
- * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com>
- *
- * 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 "config.h"
-#include "TextCodecGtk.h"
-
-#include <gio/gio.h>
-#include <wtf/gobject/GOwnPtr.h>
-#include "Logging.h"
-#include <wtf/Assertions.h>
-#include <wtf/HashMap.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-using std::min;
-
-namespace WebCore {
-
-// TextCodec's appendOmittingBOM() is gone (http://trac.webkit.org/changeset/33380). 
-// That's why we need to avoid generating extra BOM's for the conversion result.
-// This can be achieved by specifying the UTF-16 codecs' endianness explicitly when initializing GLib.
-
-#if (G_BYTE_ORDER == G_BIG_ENDIAN)
-static const gchar* internalEncodingName = "UTF-16BE";
-#else
-static const gchar* internalEncodingName = "UTF-16LE";
-#endif
-
-
-const size_t ConversionBufferSize = 16384;
-    
-
-static PassOwnPtr<TextCodec> newTextCodecGtk(const TextEncoding& encoding, const void*)
-{
-    return adoptPtr(new TextCodecGtk(encoding));
-}
-
-static bool isEncodingAvailable(const gchar* encodingName)
-{
-    GIConv tester;
-    // test decoding
-    tester = g_iconv_open(internalEncodingName, encodingName);
-    if (tester == reinterpret_cast<GIConv>(-1)) {
-        return false;
-    } else {
-        g_iconv_close(tester);
-        // test encoding
-        tester = g_iconv_open(encodingName, internalEncodingName);
-        if (tester == reinterpret_cast<GIConv>(-1)) {
-            return false;
-        } else {
-            g_iconv_close(tester);
-            return true;
-        }
-    }
-}
-
-static bool registerEncodingNameIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName)
-{
-    if (isEncodingAvailable(canonicalName)) {
-        registrar(canonicalName, canonicalName);
-        return true;
-    }
-
-    return false;
-}
-
-static void registerEncodingAliasIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName, const char* aliasName)
-{
-    if (isEncodingAvailable(aliasName))
-        registrar(aliasName, canonicalName);
-}
-
-static void registerCodecIfAvailable(TextCodecRegistrar registrar, const char* codecName)
-{
-    if (isEncodingAvailable(codecName))
-        registrar(codecName, newTextCodecGtk, 0);
-}
-
-void TextCodecGtk::registerBaseEncodingNames(EncodingNameRegistrar registrar)
-{
-    // Unicode
-    registerEncodingNameIfAvailable(registrar, "UTF-8");
-    registerEncodingNameIfAvailable(registrar, "UTF-32");
-    registerEncodingNameIfAvailable(registrar, "UTF-32BE");
-    registerEncodingNameIfAvailable(registrar, "UTF-32LE");
-
-    // Western
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-1")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CP819");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "IBM819");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO-IR-100");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO8859-1");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1:1987");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "L1");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "LATIN1");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CSISOLATIN1");
-    }
-}
-
-void TextCodecGtk::registerBaseCodecs(TextCodecRegistrar registrar)
-{
-    // Unicode
-    registerCodecIfAvailable(registrar, "UTF-8");
-    registerCodecIfAvailable(registrar, "UTF-32");
-    registerCodecIfAvailable(registrar, "UTF-32BE");
-    registerCodecIfAvailable(registrar, "UTF-32LE");
-
-    // Western
-    registerCodecIfAvailable(registrar, "ISO-8859-1");
-}
-
-void TextCodecGtk::registerExtendedEncodingNames(EncodingNameRegistrar registrar)
-{
-    // Western
-    if (registerEncodingNameIfAvailable(registrar, "MACROMAN")) {
-        registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MAC");
-        registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MACINTOSH");
-        registerEncodingAliasIfAvailable(registrar, "MACROMAN", "CSMACINTOSH");
-    }
-
-    // Japanese
-    if (registerEncodingNameIfAvailable(registrar, "Shift_JIS")) {
-        registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "MS_KANJI");
-        registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SHIFT-JIS");
-        registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SJIS");
-        registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "CSSHIFTJIS");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "EUC-JP")) {
-        registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUC_JP");
-        registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUCJP");
-        registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE");
-        registerEncodingAliasIfAvailable(registrar, "EUC-JP", "CSEUCPKDFMTJAPANESE");
-    }
-    registerEncodingNameIfAvailable(registrar, "ISO-2022-JP");
-
-    // Traditional Chinese
-    if (registerEncodingNameIfAvailable(registrar, "BIG5")) {
-        registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-5");
-        registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-FIVE");
-        registerEncodingAliasIfAvailable(registrar, "BIG5", "BIGFIVE");
-        registerEncodingAliasIfAvailable(registrar, "BIG5", "CN-BIG5");
-        registerEncodingAliasIfAvailable(registrar, "BIG5", "CSBIG5");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "BIG5-HKSCS")) {
-        registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5-HKSCS:2004");
-        registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5HKSCS");
-    }
-    registerEncodingNameIfAvailable(registrar, "CP950");
-
-    // Korean
-    if (registerEncodingNameIfAvailable(registrar, "ISO-2022-KR"))
-        registerEncodingAliasIfAvailable(registrar, "ISO-2022-KR", "CSISO2022KR");
-    if (registerEncodingNameIfAvailable(registrar, "CP949"))
-        registerEncodingAliasIfAvailable(registrar, "CP949", "UHC");
-    if (registerEncodingNameIfAvailable(registrar, "EUC-KR"))
-        registerEncodingAliasIfAvailable(registrar, "EUC-KR", "CSEUCKR");
-
-    // Arabic
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-6")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ARABIC");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ASMO-708");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ECMA-114");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO-IR-127");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO8859-6");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6:1987");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "CSISOLATINARABIC");
-    }
-    // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
-    if (registerEncodingNameIfAvailable(registrar, "windows-1256")) {
-        registerEncodingAliasIfAvailable(registrar, "windows-1256", "CP1256");
-        registerEncodingAliasIfAvailable(registrar, "windows-1256", "MS-ARAB");
-    }
-
-    // Hebrew
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-8")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "HEBREW");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-8859-8");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-IR-138");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO8859-8");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8:1988");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "CSISOLATINHEBREW");
-    }
-    // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
-    if (registerEncodingNameIfAvailable(registrar, "windows-1255")) {
-        registerEncodingAliasIfAvailable(registrar, "windows-1255", "CP1255");
-        registerEncodingAliasIfAvailable(registrar, "windows-1255", "MS-HEBR");
-    }
-
-    // Greek
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-7")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ECMA-118");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ELOT_928");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK8");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO-IR-126");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO8859-7");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:1987");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:2003");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "CSI");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "CP869")) {
-        registerEncodingAliasIfAvailable(registrar, "CP869", "869");
-        registerEncodingAliasIfAvailable(registrar, "CP869", "CP-GR");
-        registerEncodingAliasIfAvailable(registrar, "CP869", "IBM869");
-        registerEncodingAliasIfAvailable(registrar, "CP869", "CSIBM869");
-    }
-    registerEncodingNameIfAvailable(registrar, "WINDOWS-1253");
-
-    // Cyrillic
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-5")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CYRILLIC");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO-IR-144");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO8859-5");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5:1988");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CSISOLATINCYRILLIC");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "KOI8-R"))
-        registerEncodingAliasIfAvailable(registrar, "KOI8-R", "CSKOI8R");
-    if (registerEncodingNameIfAvailable(registrar, "CP866")) {
-        registerEncodingAliasIfAvailable(registrar, "CP866", "866");
-        registerEncodingAliasIfAvailable(registrar, "CP866", "IBM866");
-        registerEncodingAliasIfAvailable(registrar, "CP866", "CSIBM866");
-    }
-    registerEncodingNameIfAvailable(registrar, "KOI8-U");
-    // CP1251 added to pass /fast/encoding/charset-cp1251.html
-    if (registerEncodingNameIfAvailable(registrar, "windows-1251"))
-        registerEncodingAliasIfAvailable(registrar, "windows-1251", "CP1251");
-    if (registerEncodingNameIfAvailable(registrar, "mac-cyrillic")) {
-        registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "MACCYRILLIC");
-        registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "x-mac-cyrillic");
-    }
-
-    // Thai
-    if (registerEncodingNameIfAvailable(registrar, "CP874"))
-        registerEncodingAliasIfAvailable(registrar, "CP874", "WINDOWS-874");
-    registerEncodingNameIfAvailable(registrar, "TIS-620");
-
-    // Simplified Chinese
-    registerEncodingNameIfAvailable(registrar, "GBK");
-    if (registerEncodingNameIfAvailable(registrar, "HZ"))
-        registerEncodingAliasIfAvailable(registrar, "HZ", "HZ-GB-2312");
-    registerEncodingNameIfAvailable(registrar, "GB18030");
-    if (registerEncodingNameIfAvailable(registrar, "EUC-CN")) {
-        registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUCCN");
-        registerEncodingAliasIfAvailable(registrar, "EUC-CN", "GB2312");
-        registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CN-GB");
-        registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CSGB2312");
-        registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUC_CN");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "GB_2312-80")) {
-        registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "CHINESE");
-        registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "csISO58GB231280");
-        registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "GB2312.1980-0");
-        registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "ISO-IR-58");
-    }
-
-    // Central European
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-2")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO-IR-101");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO8859-2");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2:1987");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "L2");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "LATIN2");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "CSISOLATIN2");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "CP1250")) {
-        registerEncodingAliasIfAvailable(registrar, "CP1250", "MS-EE");
-        registerEncodingAliasIfAvailable(registrar, "CP1250", "WINDOWS-1250");
-    }
-    registerEncodingNameIfAvailable(registrar, "MAC-CENTRALEUROPE");
-
-    // Vietnamese
-    if (registerEncodingNameIfAvailable(registrar, "CP1258"))
-        registerEncodingAliasIfAvailable(registrar, "CP1258", "WINDOWS-1258");
-
-    // Turkish
-    if (registerEncodingNameIfAvailable(registrar, "CP1254")) {
-        registerEncodingAliasIfAvailable(registrar, "CP1254", "MS-TURK");
-        registerEncodingAliasIfAvailable(registrar, "CP1254", "WINDOWS-1254");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-9")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO-IR-148");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO8859-9");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9:1989");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "L5");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "LATIN5");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "CSISOLATIN5");
-    }
-
-    // Baltic
-    if (registerEncodingNameIfAvailable(registrar, "CP1257")) {
-        registerEncodingAliasIfAvailable(registrar, "CP1257", "WINBALTRIM");
-        registerEncodingAliasIfAvailable(registrar, "CP1257", "WINDOWS-1257");
-    }
-    if (registerEncodingNameIfAvailable(registrar, "ISO-8859-4")) {
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO-IR-110");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO8859-4");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4:1988");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "L4");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "LATIN4");
-        registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "CSISOLATIN4");
-    }
-}
-
-void TextCodecGtk::registerExtendedCodecs(TextCodecRegistrar registrar)
-{
-    // Western
-    registerCodecIfAvailable(registrar, "MACROMAN");
-
-    // Japanese
-    registerCodecIfAvailable(registrar, "Shift_JIS");
-    registerCodecIfAvailable(registrar, "EUC-JP");
-    registerCodecIfAvailable(registrar, "ISO-2022-JP");
-
-    // Traditional Chinese
-    registerCodecIfAvailable(registrar, "BIG5");
-    registerCodecIfAvailable(registrar, "BIG5-HKSCS");
-    registerCodecIfAvailable(registrar, "CP950");
-
-    // Korean
-    registerCodecIfAvailable(registrar, "ISO-2022-KR");
-    registerCodecIfAvailable(registrar, "CP949");
-    registerCodecIfAvailable(registrar, "EUC-KR");
-
-    // Arabic
-    registerCodecIfAvailable(registrar, "ISO-8859-6");
-    // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
-    registerCodecIfAvailable(registrar, "windows-1256");
-
-    // Hebrew
-    registerCodecIfAvailable(registrar, "ISO-8859-8");
-    // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
-    registerCodecIfAvailable(registrar, "windows-1255");
-
-    // Greek
-    registerCodecIfAvailable(registrar, "ISO-8859-7");
-    registerCodecIfAvailable(registrar, "CP869");
-    registerCodecIfAvailable(registrar, "WINDOWS-1253");
-
-    // Cyrillic
-    registerCodecIfAvailable(registrar, "ISO-8859-5");
-    registerCodecIfAvailable(registrar, "KOI8-R");
-    registerCodecIfAvailable(registrar, "CP866");
-    registerCodecIfAvailable(registrar, "KOI8-U");
-    // CP1251 added to pass /fast/encoding/charset-cp1251.html
-    registerCodecIfAvailable(registrar, "windows-1251");
-    registerCodecIfAvailable(registrar, "mac-cyrillic");
-
-    // Thai
-    registerCodecIfAvailable(registrar, "CP874");
-    registerCodecIfAvailable(registrar, "TIS-620");
-
-    // Simplified Chinese
-    registerCodecIfAvailable(registrar, "GBK");
-    registerCodecIfAvailable(registrar, "HZ");
-    registerCodecIfAvailable(registrar, "GB18030");
-    registerCodecIfAvailable(registrar, "EUC-CN");
-    registerCodecIfAvailable(registrar, "GB_2312-80");
-
-    // Central European
-    registerCodecIfAvailable(registrar, "ISO-8859-2");
-    registerCodecIfAvailable(registrar, "CP1250");
-    registerCodecIfAvailable(registrar, "MAC-CENTRALEUROPE");
-
-    // Vietnamese
-    registerCodecIfAvailable(registrar, "CP1258");
-
-    // Turkish
-    registerCodecIfAvailable(registrar, "CP1254");
-    registerCodecIfAvailable(registrar, "ISO-8859-9");
-
-    // Baltic
-    registerCodecIfAvailable(registrar, "CP1257");
-    registerCodecIfAvailable(registrar, "ISO-8859-4");
-}
-
-TextCodecGtk::TextCodecGtk(const TextEncoding& encoding)
-    : m_encoding(encoding)
-    , m_numBufferedBytes(0)
-{
-}
-
-TextCodecGtk::~TextCodecGtk()
-{
-}
-
-void TextCodecGtk::createIConvDecoder() const
-{
-    ASSERT(!m_iconvDecoder);
-
-    m_iconvDecoder = adoptGRef(g_charset_converter_new(internalEncodingName, m_encoding.name(), 0));
-}
-
-void TextCodecGtk::createIConvEncoder() const
-{
-    ASSERT(!m_iconvEncoder);
-
-    m_iconvEncoder = adoptGRef(g_charset_converter_new(m_encoding.name(), internalEncodingName, 0));
-}
-
-String TextCodecGtk::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
-{
-    // Get a converter for the passed-in encoding.
-    if (!m_iconvDecoder)
-        createIConvDecoder();
-    if (!m_iconvDecoder) {
-        LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
-        return String();
-    }
-
-    Vector<UChar> result;
-
-    gsize bytesRead = 0;
-    gsize bytesWritten = 0;
-    const gchar* input = bytes;
-    gsize inputLength = length;
-    gchar buffer[ConversionBufferSize];
-    int flags = !length ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_NO_FLAGS;
-    if (flush)
-        flags |= G_CONVERTER_FLUSH;
-
-    bool bufferWasFull = false;
-    char* prefixedBytes = 0;
-
-    if (m_numBufferedBytes) {
-        inputLength = length + m_numBufferedBytes;
-        prefixedBytes = static_cast<char*>(fastMalloc(inputLength));
-        memcpy(prefixedBytes, m_bufferedBytes, m_numBufferedBytes);
-        memcpy(prefixedBytes + m_numBufferedBytes, bytes, length);
-
-        input = prefixedBytes;
-
-        // all buffered bytes are consumed now
-        m_numBufferedBytes = 0;
-    }
-
-    do {
-        GOwnPtr<GError> error;
-        GConverterResult res = g_converter_convert(G_CONVERTER(m_iconvDecoder.get()),
-                                                   input, inputLength,
-                                                   buffer, sizeof(buffer),
-                                                   static_cast<GConverterFlags>(flags),
-                                                   &bytesRead, &bytesWritten,
-                                                   &error.outPtr());
-        input += bytesRead;
-        inputLength -= bytesRead;
-
-        if (res == G_CONVERTER_ERROR) {
-            if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT)) {
-                // There is not enough input to fully determine what the conversion should produce,
-                // save it to a buffer to prepend it to the next input.
-                memcpy(m_bufferedBytes, input, inputLength);
-                m_numBufferedBytes = inputLength;
-                inputLength = 0;
-            } else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_NO_SPACE))
-                bufferWasFull = true;
-            else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
-                if (stopOnError)
-                    sawError = true;
-                if (inputLength) {
-                    // Ignore invalid character.
-                    input += 1;
-                    inputLength -= 1;
-                }
-            } else {
-                sawError = true;
-                LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
-                m_numBufferedBytes = 0; // Reset state for subsequent calls to decode.
-                fastFree(prefixedBytes);
-                return String();
-            }
-        }
-
-        result.append(reinterpret_cast<UChar*>(buffer), bytesWritten / sizeof(UChar));
-    } while ((inputLength || bufferWasFull) && !sawError);
-
-    fastFree(prefixedBytes);
-
-    return String::adopt(result);
-}
-
-CString TextCodecGtk::encode(const UChar* characters, size_t length, UnencodableHandling handling)
-{
-    if (!length)
-        return "";
-
-    if (!m_iconvEncoder)
-        createIConvEncoder();
-    if (!m_iconvEncoder) {
-        LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
-        return CString();
-    }
-
-    gsize bytesRead = 0;
-    gsize bytesWritten = 0;
-    const gchar* input = reinterpret_cast<const char*>(characters);
-    gsize inputLength = length * sizeof(UChar);
-    gchar buffer[ConversionBufferSize];
-    Vector<char> result;
-    GOwnPtr<GError> error;
-
-    size_t size = 0;
-    do {
-        g_converter_convert(G_CONVERTER(m_iconvEncoder.get()),
-                            input, inputLength,
-                            buffer, sizeof(buffer),
-                            G_CONVERTER_INPUT_AT_END,
-                            &bytesRead, &bytesWritten,
-                            &error.outPtr());
-        input += bytesRead;
-        inputLength -= bytesRead;
-        if (bytesWritten > 0) {
-            result.grow(size + bytesWritten);
-            memcpy(result.data() + size, buffer, bytesWritten);
-            size += bytesWritten;
-        }
-
-        if (error && g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
-            UChar codePoint = reinterpret_cast<const UChar*>(input)[0];
-            UnencodableReplacementArray replacement;
-            int replacementLength = TextCodec::getUnencodableReplacement(codePoint, handling, replacement);
-
-            // Consume the invalid character.
-            input += sizeof(UChar);
-            inputLength -= sizeof(UChar);
-
-            // Append replacement string to result buffer.
-            result.grow(size + replacementLength);
-            memcpy(result.data() + size, replacement, replacementLength);
-            size += replacementLength;
-
-            error.clear();
-        }
-    } while (inputLength && !error.get());
-
-    if (error) {
-        LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
-        return CString();
-    }
-
-    return CString(result.data(), size);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/text/gtk/TextCodecGtk.h b/Source/WebCore/platform/text/gtk/TextCodecGtk.h
deleted file mode 100644 (file)
index a670484..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
- * Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
- * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com>
- *
- * 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. 
- */
-
-#ifndef TextCodecGTK_h
-#define TextCodecGTK_h
-
-#include <wtf/gobject/GRefPtr.h>
-#include <glib.h>
-#include "TextCodec.h"
-#include "TextEncoding.h"
-
-namespace WebCore {
-
-    class TextCodecGtk : public TextCodec {
-    public:
-        static void registerBaseEncodingNames(EncodingNameRegistrar);
-        static void registerBaseCodecs(TextCodecRegistrar);
-
-        static void registerExtendedEncodingNames(EncodingNameRegistrar);
-        static void registerExtendedCodecs(TextCodecRegistrar);
-
-        TextCodecGtk(const TextEncoding&);
-        virtual ~TextCodecGtk();
-
-        virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);
-        virtual CString encode(const UChar*, size_t length, UnencodableHandling);
-
-    private:
-        void createIConvDecoder() const;
-        void createIConvEncoder() const;
-
-        TextEncoding m_encoding;
-        size_t m_numBufferedBytes;
-        unsigned char m_bufferedBytes[16]; // bigger than any single multi-byte character        
-        mutable GRefPtr<GCharsetConverter> m_iconvDecoder;
-        mutable GRefPtr<GCharsetConverter> m_iconvEncoder;
-    };
-
-} // namespace WebCore
-
-#endif // TextCodecGTK_h
index f1ee4bd..10e635d 100644 (file)
@@ -106,34 +106,28 @@ GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
 AC_SUBST(GLIB_COMPILE_RESOURCES)
 GLIB_GSETTINGS
 
-if test "$with_unicode_backend" = "icu"; then
-    # TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up).
-    case "$host" in
-        *-*-darwin*)
-            UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
-            UNICODE_LIBS="-licucore"
-            ;;
-        *-*-mingw*)
-            UNICODE_CFLAGS=""
-            UNICODE_LIBS="-licui18n -licuuc"
-            ;;
-        *)
-            AC_PATH_PROG(icu_config, icu-config, no)
-            if test "$icu_config" = "no"; then
-                AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
-            fi
-
-            # We don't use --cflags as this gives us a lot of things that we don't necessarily want,
-            # like debugging and optimization flags. See man (1) icu-config for more info.
-            UNICODE_CFLAGS=`$icu_config --cppflags`
-            UNICODE_LIBS=`$icu_config --ldflags-libsonly`
-            ;;
-    esac
-fi
-
-if test "$with_unicode_backend" = "glib"; then
-    PKG_CHECK_MODULES([UNICODE], [glib-2.0 pango >= pango_required_version])
-fi
+# TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up).
+case "$host" in
+    *-*-darwin*)
+        UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
+        UNICODE_LIBS="-licucore"
+        ;;
+    *-*-mingw*)
+        UNICODE_CFLAGS=""
+        UNICODE_LIBS="-licui18n -licuuc"
+        ;;
+    *)
+        AC_PATH_PROG(icu_config, icu-config, no)
+        if test "$icu_config" = "no"; then
+            AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
+        fi
+
+        # We don't use --cflags as this gives us a lot of things that we don't necessarily want,
+        # like debugging and optimization flags. See man (1) icu-config for more info.
+        UNICODE_CFLAGS=`$icu_config --cppflags`
+        UNICODE_LIBS=`$icu_config --ldflags-libsonly`
+        ;;
+esac
 
 AC_SUBST([UNICODE_CFLAGS])
 AC_SUBST([UNICODE_LIBS])
index f16a185..9e8e8f2 100644 (file)
@@ -57,19 +57,6 @@ AC_ARG_WITH(target,
     [with_target="x11"])
 AC_MSG_RESULT([$with_target])
 
-AC_MSG_CHECKING([which Unicode backend to use])
-AC_ARG_WITH(unicode_backend, 
-    AC_HELP_STRING([--with-unicode-backend=@<:@icu/glib@:>@],
-        [Select Unicode backend (WARNING: the glib-based backend is slow, and incomplete) [default=icu]]),
-    [
-        case "$with_unicodebackend" in
-            icu|glib) ;;
-            *) AC_MSG_ERROR([Invalid Unicode backend: must be icu or glib.]) ;;
-         esac
-    ],
-    [with_unicode_backend="icu"])
-AC_MSG_RESULT([$with_unicode_backend])
-
 AC_MSG_CHECKING([whether to enable spellcheck support])
 AC_ARG_ENABLE([spellcheck],
     [AS_HELP_STRING([--enable-spellcheck],[enable support for spellcheck])],
index 08b583e..3dd92f0 100644 (file)
@@ -4,6 +4,7 @@ AC_DEFINE([WTF_USE_FREETYPE], [1], [ ])
 AC_DEFINE([WTF_USE_HARFBUZZ], [1], [ ])
 AC_DEFINE([WTF_USE_SOUP], [1], [ ])
 AC_DEFINE([WTF_USE_WEBP], [1], [ ])
+AC_DEFINE([WTF_USE_ICU_UNICODE], [1], [ ])
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext catalog name])
 
 if test "$enable_debug" = "yes"; then
@@ -48,12 +49,6 @@ if test "$with_target" = "x11"; then
     AC_DEFINE([WTF_PLATFORM_X11], [1], [Define if target is X11])
 fi
 
-if test "$with_unicode_backend" = "icu"; then
-    AC_DEFINE([WTF_USE_ICU_UNICODE], [1], [ ])
-else
-    AC_DEFINE([WTF_USE_GLIB_UNICODE], [1], [ ])
-fi
-
 if test "$enable_fast_malloc" = "no"; then
     AC_DEFINE([WTF_SYSTEM_MALLOC], [1], [ ])
 fi
index 1601cd9..5223d56 100644 (file)
@@ -27,10 +27,6 @@ AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
 
-# Unicode backend conditionals.
-AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
-AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
-
 # GStreamer feature conditionals.
 AM_CONDITIONAL([USE_GSTREAMER], [test "$have_gstreamer" = "yes"])
 AM_CONDITIONAL([USE_WEBAUDIO_GSTREAMER], [test "$enable_web_audio" = "yes"])