2007-10-20 Alp Toker <alp@atoker.com>
authoralp <alp@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Oct 2007 22:10:04 +0000 (22:10 +0000)
committeralp <alp@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Oct 2007 22:10:04 +0000 (22:10 +0000)
        Reviewed by Eric.

        Support text boundary detection.
        Move TextBoundariesWin.cpp to platform/ since it's portable and useful.
        Split out and implement some TemporaryLinkStubs.

        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * platform/TextBoundariesICU.cpp: Copied from WebCore/platform/win/TextBoundariesWin.cpp.
        * platform/gtk/Language.cpp: Added.
        (WebCore::defaultLanguage):
        * platform/gtk/TemporaryLinkStubs.cpp:
        * platform/gtk/TextBreakIteratorInternalICUGtk.cpp: Added.
        (WebCore::currentTextBreakLocaleID):
        * platform/win/TextBoundariesWin.cpp: Removed.

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

WebCore/ChangeLog
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/platform/TextBoundariesICU.cpp [moved from WebCore/platform/win/TextBoundariesWin.cpp with 100% similarity]
WebCore/platform/gtk/Language.cpp [new file with mode: 0644]
WebCore/platform/gtk/TemporaryLinkStubs.cpp
WebCore/platform/gtk/TextBreakIteratorInternalICUGtk.cpp [new file with mode: 0644]

index eaf2f99e682619c0f45852e18a490ab4c142f5e2..82653fb7de6d189a058520e13096e462d51a2cb2 100644 (file)
@@ -1,3 +1,21 @@
+2007-10-20  Alp Toker  <alp@atoker.com>
+
+        Reviewed by Eric.
+
+        Support text boundary detection.
+        Move TextBoundariesWin.cpp to platform/ since it's portable and useful.
+        Split out and implement some TemporaryLinkStubs.
+
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * platform/TextBoundariesICU.cpp: Copied from WebCore/platform/win/TextBoundariesWin.cpp.
+        * platform/gtk/Language.cpp: Added.
+        (WebCore::defaultLanguage):
+        * platform/gtk/TemporaryLinkStubs.cpp:
+        * platform/gtk/TextBreakIteratorInternalICUGtk.cpp: Added.
+        (WebCore::currentTextBreakLocaleID):
+        * platform/win/TextBoundariesWin.cpp: Removed.
+
 2007-10-20  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Tim Hatcher.
index 752a3b150223cd9acf8261d0c4a9c310e3120e38..27ff0df1ce7b1e1fef52b6842dafb32b27fe0342 100644 (file)
@@ -911,6 +911,7 @@ gtk-port {
         platform/gtk/FontPlatformDataGtk.cpp \
         platform/gtk/GlyphPageTreeNodeGtk.cpp \
         platform/gtk/KeyEventGtk.cpp \
+        platform/gtk/Language.cpp \
         platform/gtk/LocalizedStringsGtk.cpp \
         platform/gtk/LoggingGtk.cpp \
         platform/gtk/MIMETypeRegistryGtk.cpp \
@@ -926,6 +927,8 @@ gtk-port {
         platform/gtk/SoundGtk.cpp \
         platform/gtk/SystemTimeLinux.cpp \
         platform/gtk/TemporaryLinkStubs.cpp \
+        platform/TextBoundariesICU.cpp \
+        platform/gtk/TextBreakIteratorInternalICUGtk.cpp \
         platform/gtk/ThreadingGtk.cpp \
         platform/gtk/WheelEventGtk.cpp \
         platform/gtk/WidgetGtk.cpp \
index e713d61c13b905d06f9a2ad90202a85f3f6f4cbc..997e222dac52fe7db25ce1b41ad6606e942b26d3 100644 (file)
                                RelativePath="..\platform\TextBoundaries.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\platform\TextBoundariesICU.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\platform\TextBreakIterator.h"\r
                                >\r
                                        RelativePath="..\platform\win\TemporaryLinkStubs.cpp"\r
                                        >\r
                                </File>\r
-                               <File\r
-                                       RelativePath="..\platform\win\TextBoundariesWin.cpp"\r
-                                       >\r
-                               </File>\r
                                <File\r
                                        RelativePath="..\platform\win\TextBreakIteratorInternalICUWin.cpp"\r
                                        >\r
diff --git a/WebCore/platform/gtk/Language.cpp b/WebCore/platform/gtk/Language.cpp
new file mode 100644 (file)
index 0000000..7886d60
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.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 "Language.h"
+
+#include "CString.h"
+#include "PlatformString.h"
+
+#include <pango/pango.h>
+
+namespace WebCore {
+
+String defaultLanguage()
+{
+    static String defaultLanguage;
+
+    if (!defaultLanguage.isEmpty())
+        return defaultLanguage;
+
+    PangoLanguage* pangoLanguage = pango_language_get_default();
+    defaultLanguage = String(pango_language_to_string(pangoLanguage));
+
+    return defaultLanguage;
+}
+
+}
index c1165af6754dc6838254a408bcab0dd2d9f2363d..4d36b1384363c01e82b3b25b0bff21102fca5906 100644 (file)
 #include "FrameView.h"
 #include "FTPDirectoryDocument.h"
 #include "GlobalHistory.h"
-#include "Language.h"
 #include "NotImplemented.h"
 #include "PlugInInfoStore.h"
-#include "TextBoundaries.h"
-#include "TextBreakIteratorInternalICU.h"
 
 using namespace WebCore;
 
@@ -55,16 +52,8 @@ Vector<char> loadResourceIntoArray(const char* resourceName)
     return resource;
 }
 
-namespace WebCore {
-    class Page;
-}
-
 void FrameView::updateBorder() { notImplemented(); }
 
-int WebCore::findNextWordFromIndex(UChar const*, int, int, bool) { notImplemented(); return 0; }
-void WebCore::findWordBoundary(UChar const* str, int len, int position, int* start, int* end) {*start = position; *end = position; }
-const char* WebCore::currentTextBreakLocaleID() { notImplemented(); return "en_us"; }
-
 
 /********************************************************/
 /* Completely empty stubs (mostly to allow DRT to run): */
@@ -73,8 +62,6 @@ bool AXObjectCache::gAccessibilityEnabled = false;
 
 bool WebCore::historyContains(DeprecatedString const&) { return false; }
 
-String WebCore::defaultLanguage() { return "en"; }
-
 PluginInfo* PlugInInfoStore::createPluginInfoForPluginAtIndex(unsigned) { notImplemented(); return 0;}
 unsigned PlugInInfoStore::pluginCount() const { notImplemented(); return 0; }
 bool WebCore::PlugInInfoStore::supportsMIMEType(const WebCore::String&) { notImplemented(); return false; }
diff --git a/WebCore/platform/gtk/TextBreakIteratorInternalICUGtk.cpp b/WebCore/platform/gtk/TextBreakIteratorInternalICUGtk.cpp
new file mode 100644 (file)
index 0000000..bf1bbc9
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.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 "TextBreakIteratorInternalICU.h"
+
+namespace WebCore {
+
+const char* currentTextBreakLocaleID()
+{
+    return "en_us";
+}
+
+}