JavaScriptCore:
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Aug 2006 22:27:28 +0000 (22:27 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Aug 2006 22:27:28 +0000 (22:27 +0000)
        Reviewed by Maciej. Landed by rwlbuis.

        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
        WebKit should have Qt platform support

        Removing obsolete QConstString/QString constructors in kjs code.

WebCore:

        Reviewed by Maciej. Landed by rwlbuis.

        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
        WebKit should have Qt platform support

        Removing HelperQt.h usage by creating appropriate operators
        constructor in some of the platform classes, as suggested by Darin.

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

17 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/identifier.h
JavaScriptCore/kjs/ustring.h
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/platform/DeprecatedString.h
WebCore/platform/Font.h
WebCore/platform/PlatformString.h
WebCore/platform/qt/BrowserExtensionQt.cpp
WebCore/platform/qt/ComboBoxQt.cpp
WebCore/platform/qt/LineEditQt.cpp
WebCore/platform/qt/ListBoxQt.cpp
WebCore/platform/qt/PlatformKeyboardEventQt.cpp
WebCore/platform/qt/ScreenQt.cpp
WebCore/platform/qt/ScrollViewQt.cpp
WebCore/platform/qt/TextEditQt.cpp
WebCore/platform/qt/WidgetQt.cpp

index 277ff1d..3fd2c29 100644 (file)
@@ -1,3 +1,15 @@
+2006-08-20  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Maciej. Landed by rwlbuis.
+
+        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
+        WebKit should have Qt platform support
+
+        Removing obsolete QConstString/QString constructors in kjs code.
+
+        * kjs/identifier.h:
+        * kjs/ustring.h:
+
 2006-08-17  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Maciej. Landed by rwlbuis.
index a31e213..56ac7e5 100644 (file)
@@ -39,7 +39,6 @@ namespace KJS {
         
         const UString &ustring() const { return _ustring; }
         DOM::DOMString domString() const;
-        QString qstring() const;
         
         const UChar *data() const { return _ustring.data(); }
         int size() const { return _ustring.size(); }
index ecd513d..287da61 100644 (file)
@@ -38,8 +38,6 @@ namespace DOM {
   class AtomicString;
 }
 class KJScript;
-class QString;
-class QConstString;
 
 namespace KJS {
 
@@ -247,18 +245,14 @@ namespace KJS {
     UString(const UString &s) : m_rep(s.m_rep) {}
     /**
      * Convenience declaration only ! You'll be on your own to write the
-     * implementation for a construction from QString.
+     * implementation for a construction from DOM::DOMString.
      *
      * Note: feel free to contact me if you want to see a dummy header for
      * your favorite FooString class here !
      */
-    UString(const QString&);
-    /**
-     * Convenience declaration only ! See UString(const QString&).
-     */
     UString(const DOM::DOMString&);
     /**
-     * Convenience declaration only ! See UString(const QString&).
+     * Convenience declaration only ! See UString(const DOM::DOMString&).
      */
     UString(const DOM::AtomicString&);
 
@@ -330,17 +324,9 @@ namespace KJS {
     CString UTF8String() const;
 
     /**
-     * @see UString(const QString&).
+     * @see UString(const DOM::DOMString&).
      */
     DOM::DOMString domString() const;
-    /**
-     * @see UString(const QString&).
-     */
-    QString qstring() const;
-    /**
-     * @see UString(const QString&).
-     */
-    QConstString qconststring() const;
 
     /**
      * Assignment operator.
index 1a0c62f..668cc45 100644 (file)
@@ -60,7 +60,7 @@ add_definitions ( -DQT3_SUPPORT -Wno-undef -Wno-unused-parameter )
 IF (USE_WEBKIT_SVG_SUPPORT)
 add_definitions ( -DSVG_SUPPORT=1 )
 ENDIF (USE_WEBKIT_SVG_SUPPORT)
-       
+
 check_cxx_compiler_flag(-Wno-variadic-macros __KDE_HAVE_WVARIADIC_MACROS)
 
 IF(__KDE_HAVE_WVARIADIC_MACROS)
@@ -557,10 +557,10 @@ set(WebCore_SRCS
     bindings/js/JSHTMLFormElementCustom.cpp
     bindings/js/JSHTMLOptionElementConstructor.cpp
     bindings/js/JSHTMLOptionsCollectionCustom.cpp
-       bindings/js/JSHTMLInputElementBase.cpp
+    bindings/js/JSHTMLInputElementBase.cpp
     bindings/js/JSXMLHttpRequest.cpp
-       bindings/js/JSNodeIteratorCustom.cpp
-       bindings/js/JSTreeWalkerCustom.cpp
+    bindings/js/JSNodeIteratorCustom.cpp
+    bindings/js/JSTreeWalkerCustom.cpp
     bindings/js/JSXSLTProcessor.cpp
 
     css/cssparser.cpp
@@ -635,7 +635,7 @@ set(WebCore_SRCS
     dom/QualifiedName.cpp
     dom/Document.cpp
     dom/Attr.cpp
-       dom/OverflowEvent.cpp
+    dom/OverflowEvent.cpp
     dom/RegisteredEventListener.cpp
     dom/EventTargetNode.cpp
     dom/BeforeUnloadEvent.cpp
@@ -698,9 +698,9 @@ set(WebCore_SRCS
     xml/XSLStyleSheet.cpp
     xml/XSLTProcessor.cpp
     xml/XSLImportRule.cpp
-       xml/DOMParser.cpp
-       xml/XMLSerializer.cpp
-       xml/xmlhttprequest.cpp
+    xml/DOMParser.cpp
+    xml/XMLSerializer.cpp
+    xml/xmlhttprequest.cpp
 #   icon/IconDatabase.cpp
 #   icon/SQLTransaction.cpp
 #   icon/SQLStatement.cpp
@@ -820,9 +820,9 @@ set(WebCore_SRCS
     loader/Decoder.cpp
     loader/FormData.cpp
     platform/AtomicString.cpp
-       platform/AffineTransform.cpp
+    platform/AffineTransform.cpp
     platform/TextStream.cpp
-       platform/Widget.cpp
+    platform/Widget.cpp
     platform/GlyphWidthMap.cpp
     platform/Pen.cpp
     platform/Image.cpp
@@ -838,9 +838,9 @@ set(WebCore_SRCS
     platform/FloatPoint.cpp
     platform/SegmentedString.cpp
     platform/StreamingTextDecoder.cpp
-       platform/StreamingTextDecoderICU.cpp
+    platform/StreamingTextDecoderICU.cpp
     platform/DeprecatedString.cpp
-       platform/DeprecatedCString.cpp
+    platform/DeprecatedCString.cpp
     platform/TextEncoding.cpp
     platform/GraphicsContext.cpp
     platform/Logging.cpp
@@ -850,7 +850,8 @@ set(WebCore_SRCS
     platform/StringImpl.cpp
     platform/FloatRect.cpp
     platform/ResourceLoader.cpp
-       platform/qt/AffineTransformQt.cpp
+    platform/qt/AffineTransformQt.cpp
+    platform/qt/StringQt.cpp
     platform/qt/ColorQt.cpp
     platform/qt/GlyphMapQt.cpp
     platform/qt/BrowserExtensionQt.cpp
@@ -861,10 +862,10 @@ set(WebCore_SRCS
     platform/qt/TemporaryLinkStubs.cpp
     platform/qt/CursorQt.cpp
     platform/qt/WidgetQt.cpp
-    platform/qt/SystemTimeLinux.cpp
+    platform/qt/SystemTimeQt.cpp
     platform/qt/RenderThemeQt.cpp
     platform/qt/FontDataQt.cpp
-    platform/qt/SharedTimerLinux.cpp
+    platform/qt/SharedTimerQt.cpp
     platform/qt/ResourceLoaderCurl.cpp
     platform/qt/ResourceLoaderManager.cpp
     platform/qt/FloatPointQt.cpp
@@ -906,7 +907,7 @@ set(WebCore_SRCS
     rendering/RenderPartObject.cpp
     rendering/RenderView.cpp
     rendering/RenderMenuList.cpp
-       rendering/InlineFlowBox.cpp
+    rendering/InlineFlowBox.cpp
     rendering/RenderListMarker.cpp
     rendering/RenderImage.cpp
     rendering/RenderTheme.cpp
@@ -951,7 +952,7 @@ set(WebCore_SRCS
     rendering/RenderFlexibleBox.cpp
     rendering/RenderApplet.cpp
     rendering/RenderLegend.cpp
-       rendering/RenderTextControl.cpp
+    rendering/RenderTextControl.cpp
     rendering/RenderTextFragment.cpp
     rendering/RenderBR.cpp
     rendering/InlineTextBox.cpp
@@ -1007,7 +1008,7 @@ set(WebCore_SRCS
 )
 
 
-kde4_automoc(platform/qt/SharedTimerLinux.cpp)
+kde4_automoc(platform/qt/SharedTimerQt.cpp)
 
 kde4_add_library(WebCore-unity SHARED  ${WebCore_SRCS})
 
index df339de..2eb4c91 100644 (file)
@@ -1,3 +1,40 @@
+2006-08-20  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Maciej. Landed by rwlbuis.
+
+        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
+        WebKit should have Qt platform support
+
+        Removing HelperQt.h usage by creating appropriate operators
+        constructor in some of the platform classes, as suggested by Darin.
+
+        * CMakeLists.txt:
+        * platform/DeprecatedString.h:
+        * platform/Font.h:
+        * platform/PlatformString.h:
+        * platform/qt/ComboBoxQt.cpp:
+        (WebCore::PlatformComboBox::appendItem):
+        (WebCore::PlatformComboBox::appendGroupLabel):
+        (WebCore::PlatformComboBox::setFont):
+        * platform/qt/LineEditQt.cpp:
+        (WebCore::PlatformLineEdit::setFont):
+        (WebCore::PlatformLineEdit::setText):
+        (WebCore::PlatformLineEdit::text):
+        (WebCore::PlatformLineEdit::selectedText):
+        * platform/qt/ListBoxQt.cpp:
+        (WebCore::ListBox::setFont):
+        (WebCore::ListBox::appendItem):
+        * platform/qt/PlatformKeyboardEventQt.cpp:
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        * platform/qt/ScrollViewQt.cpp:
+        * platform/qt/StringQt.cpp: Added.
+        (WebCore::String::String):
+        (WebCore::String::operator QString):
+        (WebCore::DeprecatedString::operator QString):
+        * platform/qt/TextEditQt.cpp:
+        * platform/qt/WidgetQt.cpp:
+        (WebCore::Widget::setFont):
+
 2006-08-18  Steve Falkenburg  <sfalken@apple.com>
 
         Rubber stamped by adele.
index 88885ae..345ce82 100644 (file)
@@ -41,6 +41,10 @@ class NSString;
 #endif
 #endif
 
+#if PLATFORM(QT)
+class QString;
+#endif
+
 namespace KJS {
     class Identifier;
     class UString;
@@ -248,6 +252,10 @@ public:
     operator KJS::Identifier() const;
     operator KJS::UString() const;
 
+#if PLATFORM(QT)
+    operator QString() const;
+#endif
+
     static DeprecatedString fromLatin1(const char *);
     static DeprecatedString fromLatin1(const char *, int len);
     static DeprecatedString fromUtf8(const char *);
index ec8d341..08137d9 100644 (file)
 #include "TextDirection.h"
 #include "GlyphBuffer.h"
 
+#if PLATFORM(QT)
+class QFont;
+#endif
+
 namespace WebCore {
 
 class FontFallbackList;
@@ -168,6 +172,10 @@ public:
     NSFont* getNSFont() const { return primaryFont()->getNSFont(); }
 #endif
 
+#if PLATFORM(QT)
+    operator QFont() const;
+#endif
+    
     // Metrics that we query the FontFallbackList for.
     int ascent() const;
     int descent() const;
index e370ee9..5b6bf60 100644 (file)
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
+#if PLATFORM(QT)
+class QString;
+#endif
+
 namespace WebCore {
 
 /**
@@ -134,11 +138,17 @@ public:
     String(CFStringRef);
     CFStringRef createCFString() const { return m_impl ? m_impl->createCFString() : CFSTR(""); }
 #endif
+
 #ifdef __OBJC__
     String(NSString*);
     operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
 #endif
 
+#if PLATFORM(QT)
+    String(const QString&);
+    operator QString() const;
+#endif
+
 #ifndef NDEBUG
     // For debugging only, leaks memory.
     Vector<char> ascii() const;
index faab901..4748915 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "HelperQt.h"
 #include "BrowserExtensionQt.h"
 
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
 namespace WebCore {
 
 BrowserExtensionQt::BrowserExtensionQt(Frame* frame)
index 36af72c..26943fa 100644 (file)
@@ -31,7 +31,8 @@
 #include "PlatformComboBox.h"
 #include "IntSize.h"
 #include "IntRect.h"
-#include "HelperQt.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
 
@@ -65,13 +66,13 @@ void PlatformComboBox::clear()
 
 void PlatformComboBox::appendItem(const DeprecatedString& text, bool enabled)
 {
-    m_comboBox->addItem(toQString(text));
+    m_comboBox->addItem(text);
 }
 
 void PlatformComboBox::appendGroupLabel(const DeprecatedString& text)
 {
     // TODO: Group label?
-    m_comboBox->addItem(toQString(text));
+    m_comboBox->addItem(text);
 }
 
 void PlatformComboBox::appendSeparator()
@@ -107,7 +108,7 @@ int PlatformComboBox::baselinePosition(int height) const
 
 void PlatformComboBox::setFont(const Font& font)
 {
-    m_comboBox->setFont(toQFont(font));
+    m_comboBox->setFont(font);
 }
 
 Widget::FocusPolicy PlatformComboBox::focusPolicy() const
index 486172b..bbad274 100644 (file)
@@ -36,7 +36,8 @@
 #include "PlatformLineEdit.h"
 #include "Color.h"
 #include "IntSize.h"
-#include "HelperQt.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
 
@@ -114,7 +115,7 @@ bool PlatformLineEdit::edited() const
 
 void PlatformLineEdit::setFont(const Font& font)
 {
-    m_lineEdit->setFont(toQFont(font));
+    m_lineEdit->setFont(font);
 }
 
 void PlatformLineEdit::setMaxLength(int length)
@@ -139,12 +140,12 @@ bool PlatformLineEdit::isReadOnly() const
 
 void PlatformLineEdit::setText(const String& str)
 {
-    m_lineEdit->setText(toQString(str));
+    m_lineEdit->setText(str);
 }
 
 String PlatformLineEdit::text() const
 {
-    return fromQString(m_lineEdit->text());
+    return m_lineEdit->text();
 }
 
 void PlatformLineEdit::setWritingDirection(TextDirection dir)
@@ -181,7 +182,7 @@ int PlatformLineEdit::selectionStart() const
 
 String PlatformLineEdit::selectedText() const
 {
-    return fromQString(m_lineEdit->selectedText());
+    return m_lineEdit->selectedText();
 }
 
 void PlatformLineEdit::setSelection(int start, int length)
index 3faba4b..408828a 100644 (file)
@@ -29,8 +29,8 @@
 #include <QScrollBar>
 #include <QListWidget>
 
+#include "Font.h"
 #include "IntSize.h"
-#include "HelperQt.h"
 #include "ListBox.h"
 
 namespace WebCore {
@@ -167,14 +167,14 @@ void ListBox::clearCachedTextRenderers()
 
 void ListBox::setFont(const Font& font)
 {
-    m_listWidget->setFont(toQFont(font));
+    m_listWidget->setFont(font);
 }
 
 void ListBox::appendItem(const DeprecatedString& string, ListBoxItemType type, bool enabled)
 {
     // FIXME: take into account type/enabled...
     Q_ASSERT(m_listWidget != 0);
-    (void) new QListWidgetItem(toQString(string), m_listWidget); // No this does not leak...
+    (void) new QListWidgetItem(string, m_listWidget); // No this does not leak...
 }
 
 };
index 321381a..c86ce18 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 #include "config.h"
-#include "HelperQt.h"
 #include "KeyboardCodes.h"
 #include "PlatformKeyboardEvent.h"
 
@@ -422,8 +421,8 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode)
 
 PlatformKeyboardEvent::PlatformKeyboardEvent(QKeyEvent* event, bool isKeyUp)
 {
-    m_text = fromQString(event->text());
-    m_unmodifiedText = fromQString(event->text()); // TODO: not correct
+    m_text = event->text();
+    m_unmodifiedText = event->text(); // TODO: not correct
     m_keyIdentifier = keyIdentifierForQtKeyCode(event->key());
     m_isKeyUp = isKeyUp;
     m_autoRepeat = event->isAutoRepeat();
index a08f2f1..391ab6a 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "Widget.h"
 #include "IntRect.h"
-#include "HelperQt.h"
 #include "FloatRect.h"
 
 #include <QApplication>
index 5bd7252..0386216 100644 (file)
 
 #include "FrameQt.h"
 #include "CanvasQt.h"
-#include "HelperQt.h"
 
 #include <QScrollBar>
 #include <QScrollArea>
 
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
 namespace WebCore {
 
 ScrollView::ScrollView()
index afbef7f..49ae4ca 100644 (file)
@@ -34,7 +34,8 @@
 #include "PlatformTextEdit.h"
 #include "PlatformString.h"
 #include "IntSize.h"
-#include "HelperQt.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
 
 namespace WebCore {
 
index 6812f5f..4e63649 100644 (file)
@@ -32,7 +32,6 @@
 #include "Widget.h"
 
 #include "Cursor.h"
-#include "HelperQt.h"
 #include "Font.h"
 #include "GraphicsContext.h"
 #include "IntRect.h"
@@ -41,6 +40,8 @@
 #include <QDebug>
 #include <QWidget>
 
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
 namespace WebCore {
 
 struct WidgetPrivate
@@ -111,7 +112,7 @@ const Font& Widget::font() const
 void Widget::setFont(const Font& font)
 {
     if (data->m_widget)
-        data->m_widget->setFont(toQFont(font));
+        data->m_widget->setFont(font);
 }
 
 void Widget::setCursor(const Cursor& cursor)