Reviewed by Eric. Landed by rwlbuis.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2006 20:18:25 +0000 (20:18 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Aug 2006 20:18:25 +0000 (20:18 +0000)
        Add QtLauncher (was testunity before), which provides a
        standalone "browser" to test the Qt platform stuff.

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

CMakeLists.txt
WebKitTools/ChangeLog
WebKitTools/QtLauncher/CMakeLists.txt [new file with mode: 0644]
WebKitTools/QtLauncher/main.cpp [new file with mode: 0644]

index 2a706fc..f5a69ab 100644 (file)
@@ -47,6 +47,7 @@ add_definitions( -DBUILDING_QT__=1 )
 
 add_subdirectory( JavaScriptCore ) 
 add_subdirectory( WebCore ) 
+add_subdirectory( WebKitTools/QtLauncher )
 
 include_directories ( BEFORE ${CMAKE_CURRENT_BINARY_DIR} )
 
index 709787c..4fe3087 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-24  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric. Landed by rwlbuis.
+
+        Add QtLauncher (was testunity before), which provides a
+        standalone "browser" to test the Qt platform stuff.
+
+        * QtLauncher/CMakeLists.txt: Added.
+        * QtLauncher/main.cpp: Added.
+        (main):
+
 2006-08-22  Trey Matteson  <trey@usa.net>
 
         Reviewed by ggaren.
diff --git a/WebKitTools/QtLauncher/CMakeLists.txt b/WebKitTools/QtLauncher/CMakeLists.txt
new file mode 100644 (file)
index 0000000..54e0f3c
--- /dev/null
@@ -0,0 +1,24 @@
+include_directories(
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../..//JavaScriptCore
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/bridge
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/page
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/loader
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/platform
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/platform/qt
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/kwq
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/rendering
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/editing
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/html
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/css
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/dom
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/xml
+   BEFORE ${CMAKE_SOURCE_DIR}/kdecore
+)
+
+add_definitions(-Wno-undef -Wno-unused-parameter)
+
+set(testunity_SRCS main.cpp)
+kde4_automoc(${testunity_SRCS})
+kde4_add_executable(testunity RUN_UNINSTALLED ${testunity_SRCS})
+target_link_libraries(testunity  ${KDE4_KDECORE_LIBS} WebCore-unity )
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
new file mode 100644 (file)
index 0000000..6bc1339
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@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 <wtf/Platform.h>
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kdebug.h>
+
+#include <Document.h>
+
+#include <FrameQt.h>
+#include <page/Page.h>
+
+#include <QVBoxLayout>
+#include <QDir>
+
+using namespace WebCore;
+
+static KCmdLineOptions options[] =
+{
+    { "+file",        "File to load", 0 },
+    KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+    KCmdLineArgs::init(argc, argv, "testunity", "testunity",
+                       "unity testcase app", "0.1");
+    KCmdLineArgs::addCmdLineOptions(options);
+    KApplication app;
+    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+     
+    QWidget topLevel;
+    QBoxLayout *l = new QVBoxLayout(&topLevel);
+        
+    FrameQt *f = new FrameQt(&topLevel);
+
+    l->addWidget(f->view()->qwidget());
+    l->activate();
+    f->view()->qwidget()->show();
+
+    topLevel.show();
+
+    QString url;
+
+    if (args->count() == 0)
+        url = QString("%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+    else
+        url = args->arg(0);
+
+    f->openURL(KURL(url.toLatin1()));
+    
+    app.exec();
+    delete f;
+    return 0;
+}