Reviewed by Darin.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 17:34:29 +0000 (17:34 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 17:34:29 +0000 (17:34 +0000)
        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10644
        Adjust DumpRenderTree to the FrameQtClient changes.

        * DumpRenderTree/DumpRenderTree.qtproj/CMakeLists.txt:
        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
        (WebCore::DumpRenderTree::DumpRenderTree):
        (WebCore::DumpRenderTree::~DumpRenderTree):
        (WebCore::DumpRenderTree::frame):
        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp: Added.
        (WebCore::DumpRenderTreeClient::DumpRenderTreeClient):
        (WebCore::DumpRenderTreeClient::~DumpRenderTreeClient):
        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h: Added.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/CMakeLists.txt
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp [new file with mode: 0644]
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h [new file with mode: 0644]

index ff2f912f579623490ec40fa0633a304ae28f3c66..0e224366ae1bd75a8af164c326082085786d1be8 100644 (file)
@@ -1,3 +1,21 @@
+2006-09-04  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Darin.
+
+        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10644
+        Adjust DumpRenderTree to the FrameQtClient changes.
+
+        * DumpRenderTree/DumpRenderTree.qtproj/CMakeLists.txt:
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::~DumpRenderTree):
+        (WebCore::DumpRenderTree::frame):
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp: Added.
+        (WebCore::DumpRenderTreeClient::DumpRenderTreeClient):
+        (WebCore::DumpRenderTreeClient::~DumpRenderTreeClient):
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h: Added.
+
 2006-09-03  Darin Adler  <darin@apple.com>
 
         * Scripts/do-webcore-rename: More renaming plans.
index b2340ffdafb8f418b9b1d9606746ebb19efb9231..87b8bba44047220f431d047efc5e66526ff7914a 100644 (file)
@@ -20,7 +20,7 @@ include_directories(
 
 add_definitions(-Wno-undef -Wno-unused-parameter)
 
-set(DumpRenderTree_SRCS main.cpp DumpRenderTree.cpp)
+set(DumpRenderTree_SRCS main.cpp DumpRenderTree.cpp DumpRenderTreeClient.cpp)
 kde4_automoc(${DumpRenderTree_SRCS})
 kde4_add_executable(DumpRenderTree RUN_UNINSTALLED ${DumpRenderTree_SRCS})
 target_link_libraries(DumpRenderTree ${KDE4_KDECORE_LIBS} WebCore-unity)
index c519c381692c36aa105225e9b805bb119e15f0f5..16049270d4d968684a70b84cba7784a53ed7618f 100644 (file)
  */
 
 #include "config.h"
+#include "DumpRenderTree.h"
+
+#include "Page.h"
 #include "markup.h"
 #include "Document.h"
-#include "DumpRenderTree.h"
 #include "RenderTreeAsText.h"
 
 #include <QTimer>
@@ -49,11 +51,21 @@ const unsigned int maxViewHeight = 600;
 
 DumpRenderTree::DumpRenderTree()
     : m_frame(0)
+    , m_client(new DumpRenderTreeClient())
     , m_stdin(0)
     , m_notifier()
 {
-    m_frame = new FrameQt(0 /* no toplevel widget */);
-    m_frame->view()->setScrollBarsMode(ScrollBarAlwaysOff);
+    // Initialize WebCore in Qt platform mode...
+    Page* page = new Page();
+    m_frame = new FrameQt(page, 0, m_client);
+
+    page->setMainFrame(m_frame);
+
+    FrameView* view = new FrameView(m_frame);
+    view->setScrollBarsMode(ScrollBarAlwaysOff);
+
+    m_frame->setView(view);
+    view->setParentWidget(0 /* no toplevel widget */);
 
     // Reverse calculations in QAbstractScrollArea::maximumViewportSize()
     QScrollArea* area = qobject_cast<QScrollArea*>(m_frame->view()->qwidget());
@@ -67,6 +79,7 @@ DumpRenderTree::DumpRenderTree()
 DumpRenderTree::~DumpRenderTree()
 {
     delete m_frame;
+    delete m_client;
 
     delete m_stdin;
     delete m_notifier;
@@ -121,6 +134,11 @@ void DumpRenderTree::checkLoaded()
         QTimer::singleShot(10, this, SLOT(checkLoaded()));
 }
 
+FrameQt* DumpRenderTree::frame() const
+{
+    return m_frame;
+}
+
 }
 
 #include "DumpRenderTree.moc"
index 5fb334c3989e8d95d33b543fa7006371e9b84218..0a8b0ab931f1c8b2d1b05f3893f9fce88ae87451 100644 (file)
@@ -33,7 +33,7 @@
 #include <QTextStream>
 #include <QSocketNotifier>
 
-#include "FrameQt.h"
+#include "DumpRenderTreeClient.h"
 
 namespace WebCore {
 
@@ -54,8 +54,14 @@ public Q_SLOTS:
     void readStdin(int);
     void checkLoaded();
 
+private:
+    friend class DumpRenderTreeClient;
+
+    FrameQt* frame() const;
+
 private:
     FrameQt* m_frame;
+    DumpRenderTreeClient* m_client;
 
     QTextStream* m_stdin;
     QSocketNotifier* m_notifier;
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp b/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp
new file mode 100644 (file)
index 0000000..9310b62
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * 
+ * All rights reserved.
+ *
+ * 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 "DumpRenderTreeClient.h"
+
+#include "DumpRenderTree.h"
+
+namespace WebCore {
+
+DumpRenderTreeClient::DumpRenderTreeClient()
+    : FrameQtClientDefault()
+{
+}
+
+DumpRenderTreeClient::~DumpRenderTreeClient()
+{
+}
+
+}
+
+// vim: ts=4 sw=4 et
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h b/WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h
new file mode 100644 (file)
index 0000000..923a6d9
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * 
+ * All rights reserved.
+ *
+ * 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 DumpRenderTreeClient_H
+#define DumpRenderTreeClient_H
+
+#include "FrameQt.h"
+
+namespace WebCore {
+
+class DumpRenderTreeClient : public FrameQtClientDefault
+{
+public:
+    DumpRenderTreeClient();
+    virtual ~DumpRenderTreeClient();
+};
+
+}
+
+#endif
+
+// vim: ts=4 sw=4 et