git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16214 268f45cc-cd09-0410...
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 17:11:44 +0000 (17:11 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Sep 2006 17:11:44 +0000 (17:11 +0000)
15 files changed:
CMakeLists.txt
WebKitQt/ChangeLog [new file with mode: 0644]
WebKitQt/WebKitPart/CMakeLists.txt [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitFactory.cpp [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitFactory.h [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPart.cpp [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPart.desktop [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPart.h [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPart.rc [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPartBrowser.rc [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPartClient.cpp [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPartClient.h [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPartInterface.cpp [new file with mode: 0644]
WebKitQt/WebKitPart/WebKitPartInterface.h [new file with mode: 0644]
WebKitQt/WebKitPart/org.kde.WebKitPart.xml [new file with mode: 0644]

index 544c804..c7db16b 100644 (file)
@@ -54,7 +54,10 @@ add_definitions (-DUSE_SYSTEM_MALLOC=1)
 
 add_subdirectory (JavaScriptCore)
 add_subdirectory (WebCore)
-add_subdirectory (WebKitTools/QtLauncher)
 add_subdirectory (WebKitTools/DumpRenderTree/DumpRenderTree.qtproj)
 
+IF (WEBKIT_USE_KDE_SUPPORT)
+    add_subdirectory (WebKitQt/WebKitPart)
+ENDIF (WEBKIT_USE_KDE_SUPPORT)
+
 include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/WebKitQt/ChangeLog b/WebKitQt/ChangeLog
new file mode 100644 (file)
index 0000000..6c74583
--- /dev/null
@@ -0,0 +1,43 @@
+2006-09-04  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Darin. Final polish by Sam.
+
+        Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10644
+        Add WebKitPart, an embeddable KPart for the KDE platform.
+
+        * WebKitPart/CMakeLists.txt: Added.
+        * WebKitPart/WebKitFactory.cpp: Added.
+        (WebKitFactory::WebKitFactory):
+        (WebKitFactory::~WebKitFactory):
+        (WebKitFactory::createPartObject):
+        (WebKitFactory::instance):
+        (WebKitFactory::ref):
+        (WebKitFactory::deref):
+        (init_libWebKitPart):
+        * WebKitPart/WebKitFactory.h: Added.
+        * WebKitPart/WebKitPart.cpp: Added.
+        (WebKitPart::WebKitPart):
+        (WebKitPart::~WebKitPart):
+        (WebKitPart::openFile):
+        (WebKitPart::openUrl):
+        (WebKitPart::closeUrl):
+        (WebKitPart::parentPart):
+        (WebKitPart::frame):
+        (WebKitPart::initView):
+        * WebKitPart/WebKitPart.desktop: Added.
+        * WebKitPart/WebKitPart.h: Added.
+        (WebKitPart::):
+        * WebKitPart/WebKitPart.rc: Added.
+        * WebKitPart/WebKitPartBrowser.rc: Added.
+        * WebKitPart/WebKitPartClient.cpp: Added.
+        (WebKitPartClient::WebKitPartClient):
+        (WebKitPartClient::~WebKitPartClient):
+        * WebKitPart/WebKitPartClient.h: Added.
+        * WebKitPart/WebKitPartInterface.cpp: Added.
+        (WebKitPartInterface::WebKitPartInterface):
+        (WebKitPartInterface::~WebKitPartInterface):
+        (WebKitPartInterface::url):
+        (WebKitPartInterface::closeURL):
+        * WebKitPart/WebKitPartInterface.h: Added.
+        * WebKitPart/org.kde.WebKitPart.xml: Added.
+
diff --git a/WebKitQt/WebKitPart/CMakeLists.txt b/WebKitQt/WebKitPart/CMakeLists.txt
new file mode 100644 (file)
index 0000000..85bf594
--- /dev/null
@@ -0,0 +1,35 @@
+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/ksvg2
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/ksvg2/css
+   BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../../WebCore/ksvg2/svg
+   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 (WebKitPart_SRCS WebKitFactory.cpp WebKitPart.cpp WebKitPartInterface.cpp WebKitPartClient.cpp)
+
+qt4_add_dbus_adaptor (WebKitPart_SRCS org.kde.WebKitPart.xml WebKitPartInterface.h WebKitPartInterface)
+
+kde4_automoc (${WebKitPart_SRCS})
+kde4_add_plugin (WebKitPart WITH_PREFIX ${WebKitPart_SRCS})
+target_link_libraries (WebKitPart ${KDE4_KDECORE_LIBS} kparts WebCore-unity)
+
+kde4_install_libtool_file (${PLUGIN_INSTALL_DIR}/ WebKitPart)
+install (TARGETS WebKitPart DESTINATION ${PLUGIN_INSTALL_DIR})
+
+install (FILES WebKitPart.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+install (FILES WebKitPart.rc WebKitPartBrowser.rc DESTINATION ${DATA_INSTALL_DIR}/WebKitPart)
diff --git a/WebKitQt/WebKitPart/WebKitFactory.cpp b/WebKitQt/WebKitPart/WebKitFactory.cpp
new file mode 100644 (file)
index 0000000..ac43f86
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * 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 "WebKitFactory.h"
+
+#include "WebKitPart.h"
+
+#include <klocale.h>
+#include <kinstance.h>
+#include <kaboutdata.h>
+
+WebKitFactory* WebKitFactory::s_self = 0;
+unsigned long int WebKitFactory::s_refCount = 0;
+KInstance* WebKitFactory::s_instance = 0;
+KAboutData* WebKitFactory::s_about = 0;
+
+WebKitFactory::WebKitFactory(bool clone)
+{
+    if (clone)
+        ref();
+}
+
+WebKitFactory::~WebKitFactory()
+{
+    if (s_self == this) {
+        Q_ASSERT(!s_refCount);
+
+        delete s_instance;
+        delete s_about;
+        
+        s_instance = 0;
+        s_about = 0;
+    }
+    else
+        deref();
+}
+
+KParts::Part* WebKitFactory::createPartObject(QWidget* parentWidget,
+                                              QObject* parentObject,
+                                              const char* className,
+                                              const QStringList& args)
+{
+    WebKitPart::GUIProfile prof = WebKitPart::DefaultGUI;
+
+    if (strcmp(className, "Browser/View") == 0)
+        prof = WebKitPart::BrowserViewGUI;
+
+    return new WebKitPart(parentWidget, parentObject, prof);
+}
+
+KInstance* WebKitFactory::instance()
+{
+    Q_ASSERT(s_self != 0);
+
+    if (!s_instance) {
+        s_about = new KAboutData("WebKitPart", I18N_NOOP("WebKit"), "0.1",
+                                 I18N_NOOP("Embeddable HTML/SVG component"),
+                                 KAboutData::License_LGPL);
+
+        // FIXME: Add copyright information in the KAboutData!
+        s_instance = new KInstance(s_about);
+    }
+
+    return s_instance;
+}
+
+void WebKitFactory::ref()
+{
+    if (!s_refCount && !s_self)
+        s_self = new WebKitFactory();
+
+    s_refCount++;
+}
+
+void WebKitFactory::deref()
+{
+    if(!--s_refCount && s_self) {
+        delete s_self;
+        s_self = 0;
+    }
+}
+
+// Factory entry point
+extern "C" void* init_libWebKitPart()
+{        
+    return new WebKitFactory(true);
+}
+
+#include "WebKitFactory.moc"
diff --git a/WebKitQt/WebKitPart/WebKitFactory.h b/WebKitQt/WebKitPart/WebKitFactory.h
new file mode 100644 (file)
index 0000000..ff83437
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * 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 WebKitFactory_H
+#define WebKitFactory_H
+
+#include <QObject>
+
+#include <kparts/factory.h>
+
+class KInstance;
+class KAboutData;
+
+class WebKitFactory : public KParts::Factory
+{
+Q_OBJECT
+
+public:
+    WebKitFactory(bool clone = false);
+    virtual ~WebKitFactory();
+
+    virtual KParts::Part* createPartObject(QWidget* parentWidget,
+                                           QObject* parentObject,
+                                           const char* className,
+                                           const QStringList& args);
+    
+    static KInstance* instance();
+
+
+protected:
+    static void ref();
+    static void deref();
+
+private:
+    static unsigned long s_refCount;
+
+    static WebKitFactory* s_self;
+    static KInstance* s_instance;
+    static KAboutData* s_about;
+};
+
+#endif
diff --git a/WebKitQt/WebKitPart/WebKitPart.cpp b/WebKitQt/WebKitPart/WebKitPart.cpp
new file mode 100644 (file)
index 0000000..54b184d
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * 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 "WebKitPart.h"
+
+#include "Page.h"
+#include "FrameQt.h"
+#include "WebKitFactory.h"
+#include "WebKitPartClient.h"
+
+using namespace WebCore;
+
+WebKitPart::WebKitPart(QWidget* parentWidget, QObject* parentObject, GUIProfile prof)
+    : KParts::ReadOnlyPart(parentObject)
+    , m_frame(0)
+    , m_frameView(0)
+    , m_client(0)
+{
+    setInstance(WebKitFactory::instance(), prof == BrowserViewGUI && !parentPart());
+
+    initView(parentWidget, prof);
+}
+
+WebKitPart::~WebKitPart()
+{
+    if (m_frame)
+        delete m_frame->page();
+
+    delete m_client;
+}
+
+bool WebKitPart::openFile()
+{
+    return true;
+}
+
+bool WebKitPart::openUrl(const KUrl& url)
+{
+    return m_frame->openURL(KURL(url.toEncoded()));
+}
+
+bool WebKitPart::closeUrl()
+{
+    return m_frame->closeURL();
+}
+
+WebKitPart* WebKitPart::parentPart()
+{
+    return qobject_cast<WebKitPart*>(parent());
+}
+
+Frame* WebKitPart::frame()
+{
+    return m_frame.get();
+}
+
+void WebKitPart::initView(QWidget* parentWidget, GUIProfile prof)
+{
+    if (prof == DefaultGUI)
+        setXMLFile("WebKitPart.rc");
+    else if (prof == BrowserViewGUI)
+        setXMLFile("WebKitPartBrowser.rc");
+
+    m_client = new WebKitPartClient();
+    // Initialize WebCore in Qt platform mode...
+    Page* page = new Page();
+    Frame* frame = new FrameQt(page, 0, m_client);
+
+    m_frame = frame;
+    frame->deref(); // Frames are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
+
+    page->setMainFrame(frame);
+
+    FrameView* frameView = new FrameView(frame);
+    m_frameView = frameView;
+    frameView->deref(); // FrameViews are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
+
+    m_frame->setView(frameView);
+    m_frameView->setParentWidget(parentWidget);
+
+    // Initialize KParts widget...
+    setWidget(m_frame->view()->qwidget());
+}
+
+#include "WebKitPart.moc"
diff --git a/WebKitQt/WebKitPart/WebKitPart.desktop b/WebKitQt/WebKitPart/WebKitPart.desktop
new file mode 100644 (file)
index 0000000..a942139
--- /dev/null
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Comment=Embeddable HTML/SVG viewing component
+Comment[x-test]=xxEmbeddable HTML/SVg viewing componentxx
+MimeType=text/html;text/xml;application/xhtml+xml;image/svg+xml;image/svg-xml
+Icon=konqueror
+Name=WebKit
+Name[x-test]=xxWebKitLxx
+ServiceTypes=KParts/ReadOnlyPart,Browser/View
+X-KDE-Library=libWebKitPart
+InitialPreference=10
diff --git a/WebKitQt/WebKitPart/WebKitPart.h b/WebKitQt/WebKitPart/WebKitPart.h
new file mode 100644 (file)
index 0000000..b010d8b
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * 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 WebKitPart_H
+#define WebKitPart_H
+
+#include <QObject>
+
+#include <wtf/RefPtr.h>
+#include <kparts/part.h>
+
+namespace WebCore {
+    class Frame;
+    class FrameView;
+}
+
+class WebKitPartClient;
+
+class WebKitPart : public KParts::ReadOnlyPart
+{
+Q_OBJECT
+Q_PROPERTY(QString url READ url)  
+
+public:
+    enum GUIProfile {
+        DefaultGUI,
+        BrowserViewGUI
+    };
+
+    WebKitPart(QWidget* parentWidget = 0,
+               QObject* parentObject = 0,
+               GUIProfile prof = DefaultGUI);
+
+    virtual ~WebKitPart();
+
+    /**
+     * Opens the specified URL @p url.
+     *
+     * Reimplemented from KParts::ReadOnlyPart::openURL .
+     */
+    virtual bool openUrl(const KUrl&);
+
+    /**
+     * Stops loading the document and kills all data requests (for images, etc.)
+     */
+    virtual bool closeUrl();
+
+    /**
+     * Returns a pointer to the parent WebKitPart
+     * if the part is a frame in an HTML frameset.
+     *
+     * Returns 0 otherwise.
+     */
+    WebKitPart* parentPart();
+
+private:
+    friend class WebKitPartClient;
+    
+    /**
+     * Returns pointer the current frame.
+     */
+    WebCore::Frame* frame();
+
+    /**
+     * Internal empty reimplementation of KParts::ReadOnlyPart::openFile .
+     */
+    virtual bool openFile();
+
+    /**
+     * Internal helper method
+     */
+    void initView(QWidget*, GUIProfile);
+
+private:
+    WTF::RefPtr<WebCore::Frame> m_frame;
+    WTF::RefPtr<WebCore::FrameView> m_frameView;
+
+    WebKitPartClient* m_client;
+};
+
+#endif
diff --git a/WebKitQt/WebKitPart/WebKitPart.rc b/WebKitQt/WebKitPart/WebKitPart.rc
new file mode 100644 (file)
index 0000000..886af21
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="WebKitPart" version="1">
+<MenuBar>
+ <Menu name="edit"><text>&amp;Edit</text>
+  <Action name="selectAll" />
+  <Separator />
+  <Action name="find" />
+  <Action name="findNext" />
+  <Action name="findPrevious" />
+  <Action name="findAheadText" />
+  <Action name="findAheadLink" />
+ </Menu>
+</MenuBar>
+<ActionProperties>
+</ActionProperties>
+</kpartgui>
diff --git a/WebKitQt/WebKitPart/WebKitPartBrowser.rc b/WebKitQt/WebKitPart/WebKitPartBrowser.rc
new file mode 100644 (file)
index 0000000..7fcc844
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="WebKitPart" version="1">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+  <Action name="saveBackground" />
+  <Action name="saveDocument" />
+  <Action name="saveFrame" />
+  <Separator />
+  <Action name="printFrame" group="print" />
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+  <Action name="selectAll" />
+  <Separator />
+  <Action name="find" />
+  <Action name="findNext" />
+  <Action name="findPrevious" />
+  <Action name="findAheadText" />
+  <Action name="findAheadLink" />
+ </Menu>
+ <Menu name="view"><text>&amp;View</text>
+  <Action name="incFontSizes" />
+  <Action name="decFontSizes" />
+  <Action name="viewDocumentSource" />
+  <Action name="viewPageInfo" />
+  <Action name="setEncoding" />
+  <Action name="useStylesheet" />
+  <ActionList name="debugScriptList" />
+<!--
+<!--
+  <Separator />
+  <Action name="debugRenderTree" />
+  <Action name="debugDOMTree" />
+-->
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar"><text>Main Toolbar</text>
+ <Action name="find" /> 
+ <Separator />
+ <Action name="incFontSizes" />
+ <Action name="decFontSizes" />
+ <ActionList name="loadImages" />
+</ToolBar>
+<ActionProperties>
+ <Action shortcut="F7" name="caretMode" />
+</ActionProperties>
+</kpartgui>
diff --git a/WebKitQt/WebKitPart/WebKitPartClient.cpp b/WebKitQt/WebKitPart/WebKitPartClient.cpp
new file mode 100644 (file)
index 0000000..795b403
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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 "WebKitPartClient.h"
+
+#include "WebKitPart.h"
+
+using namespace WebCore;
+
+WebKitPartClient::WebKitPartClient()
+    : FrameQtClientDefault()
+{
+}
+
+WebKitPartClient::~WebKitPartClient()
+{
+}
+
+// vim: ts=4 sw=4 et
diff --git a/WebKitQt/WebKitPart/WebKitPartClient.h b/WebKitQt/WebKitPart/WebKitPartClient.h
new file mode 100644 (file)
index 0000000..c46ad2d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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 WebKitPartClient_H
+#define WebKitPartClient_H
+
+#include "FrameQt.h"
+
+class WebKitPartClient : public WebCore::FrameQtClientDefault
+{
+public:
+    WebKitPartClient();
+    virtual ~WebKitPartClient();
+};
+
+#endif
+
+// vim: ts=4 sw=4 et
diff --git a/WebKitQt/WebKitPart/WebKitPartInterface.cpp b/WebKitQt/WebKitPart/WebKitPartInterface.cpp
new file mode 100644 (file)
index 0000000..ae49b96
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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 "WebKitPartInterface.h"
+
+#include "WebKitPart.h"
+
+WebKitPartInterface::WebKitPartInterface(WebKitPart* part)
+    : QObject(part)
+    , m_part(part)
+{
+    Q_ASSERT(m_part != 0);
+}
+
+WebKitPartInterface::~WebKitPartInterface()
+{
+}
+
+
+KUrl WebKitPartInterface::url() const
+{
+    return m_part->url();
+}
+
+bool WebKitPartInterface::closeURL()
+{
+    return m_part->closeUrl();
+}
+
+#include "WebKitPartInterface.moc"
diff --git a/WebKitQt/WebKitPart/WebKitPartInterface.h b/WebKitQt/WebKitPart/WebKitPartInterface.h
new file mode 100644 (file)
index 0000000..cac1898
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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 WebKitPartInterface_H
+#define WebKitPartInterface_H
+
+#include <QObject>
+
+class KUrl;
+class WebKitPart;
+
+class WebKitPartInterface : public QObject
+{
+Q_OBJECT
+
+public:
+    WebKitPartInterface(WebKitPart*);
+    virtual ~WebKitPartInterface();
+
+public Q_SLOTS:
+    KUrl url() const;
+
+    bool closeURL();
+
+private:
+    WebKitPart* m_part;
+};
+
+#endif
diff --git a/WebKitQt/WebKitPart/org.kde.WebKitPart.xml b/WebKitQt/WebKitPart/org.kde.WebKitPart.xml
new file mode 100644 (file)
index 0000000..84cacd1
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+  <interface name="org.kde.WebKitPart">
+    <property name="url" type="s" access="read"/>
+    <method name="closeURL">
+      <arg type="b" direction="out"/>
+    </method>
+  </interface>
+</node>