Reviewed by Mitz. Landed by Niko.
authorzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2006 19:23:45 +0000 (19:23 +0000)
committerzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2006 19:23:45 +0000 (19:23 +0000)
Fixes: http://bugs.webkit.org/show_bug.cgi?id=11617
Adapt to latest API changes, fixing Qt/Linux build.

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

17 files changed:
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/page/qt/EventHandlerQt.cpp [new file with mode: 0644]
WebCore/platform/ContextMenu.h
WebCore/platform/graphics/svg/qt/SVGResourceClipperQt.cpp
WebCore/platform/qt/ContextMenuClientQt.cpp [new file with mode: 0644]
WebCore/platform/qt/ContextMenuClientQt.h [new file with mode: 0644]
WebCore/platform/qt/ContextMenuQt.cpp [new file with mode: 0644]
WebCore/platform/qt/EditorClientQt.cpp
WebCore/platform/qt/EditorClientQt.h
WebCore/platform/qt/ScrollViewCanvasQt.cpp
WebCore/platform/qt/TemporaryLinkStubs.cpp
WebKitQt/ChangeLog
WebKitQt/QtLauncher/main.cpp
WebKitQt/WebKitPart/WebKitPart.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp

index b8de3600f932f05a1c62a2434f4bb23d4646eee9..7cf67fc7ed2fde0bcb7bdb2e5e8586ca89269ee1 100644 (file)
@@ -31,6 +31,7 @@ include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/loader/icon
    ${CMAKE_CURRENT_SOURCE_DIR}/loader/qt
    ${CMAKE_CURRENT_SOURCE_DIR}/page
+   ${CMAKE_CURRENT_SOURCE_DIR}/page/qt
    ${CMAKE_CURRENT_BINARY_DIR}/platform
    ${CMAKE_CURRENT_SOURCE_DIR}/platform 
    ${CMAKE_CURRENT_SOURCE_DIR}/platform/graphics
@@ -969,18 +970,23 @@ set(WebCore_SRCS
     loader/qt/ResourceLoaderQt.cpp
 
     page/Chrome.cpp
+    page/ContextMenuController.cpp
     page/DOMWindow.cpp
+    page/EventHandler.cpp   
     page/Frame.cpp
     page/FrameTree.cpp
     page/FrameView.cpp
     page/MouseEventWithHitTestResults.cpp
     page/Page.cpp
-    page/PageState.cpp    
+    page/PageState.cpp
+
+       page/qt/EventHandlerQt.cpp   
 
     platform/Arena.cpp
     platform/ArrayImpl.cpp
     platform/AtomicString.cpp
     platform/CString.cpp
+    platform/ContextMenu.cpp
     platform/DeprecatedCString.cpp
     platform/DeprecatedPtrListImpl.cpp
     platform/DeprecatedString.cpp
@@ -1108,10 +1114,11 @@ set(WebCore_SRCS
     platform/network/qt/ResourceHandleQt.cpp
     
     platform/qt/ChromeClientQt.cpp
+    platform/qt/ContextMenuClientQt.cpp
+    platform/qt/ContextMenuQt.cpp
     platform/qt/CookieJarQt.cpp
     platform/qt/CursorQt.cpp
     platform/qt/EditorClientQt.cpp
-#   platform/qt/FileButtonQt.cpp
     platform/qt/FileChooserQt.cpp
     platform/qt/FontCacheQt.cpp
     platform/qt/FontDataQt.cpp
@@ -1167,7 +1174,6 @@ set(WebCore_SRCS
     rendering/break_lines.cpp
     rendering/CounterNode.cpp
     rendering/CounterResetNode.cpp
-    rendering/DeprecatedSlider.cpp
     rendering/EllipsisBox.cpp
     rendering/FixedTableLayout.cpp
     rendering/HitTestResult.cpp
@@ -1205,6 +1211,7 @@ set(WebCore_SRCS
     rendering/RenderPart.cpp
     rendering/RenderPartObject.cpp
     rendering/RenderReplaced.cpp
+    rendering/RenderSlider.cpp
     rendering/RenderStyle.cpp
     rendering/RenderTableCell.cpp
     rendering/RenderTableCol.cpp
index cbaff59e0b0b7fa589eaa51ea79b066a047665df..b33750a36d51fac139384edc6544479e843bb710 100644 (file)
@@ -1,3 +1,62 @@
+2006-11-17  Zack Rusin  <zack@kde.org>
+
+        Reviewed by Mitz. Landed by Niko.
+
+        Making platform Qt/KDE compile and work after
+        the latest api changes. Reported as
+        http://bugs.webkit.org/show_bug.cgi?id=11617
+
+        * CMakeLists.txt:
+        * page/qt/EventHandlerQt.cpp: Added.
+        (WebCore::isKeyboardOptionTab):
+        (WebCore::EventHandler::tabsToLinks):
+        (WebCore::EventHandler::tabsToAllControls):
+        (WebCore::EventHandler::freeClipboard):
+        (WebCore::EventHandler::focusDocumentView):
+        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+        (WebCore::EventHandler::passMouseDownEventToWidget):
+        (WebCore::EventHandler::lastEventIsMouseUp):
+        (WebCore::EventHandler::dragHysteresisExceeded):
+        (WebCore::EventHandler::handleDrag):
+        (WebCore::EventHandler::handleMouseUp):
+        (WebCore::EventHandler::passSubframeEventToSubframe):
+        (WebCore::EventHandler::passWheelEventToWidget):
+        (WebCore::EventHandler::shouldDragAutoNode):
+        (WebCore::EventHandler::dispatchDragSrcEvent):
+        (WebCore::EventHandler::passMousePressEventToSubframe):
+        (WebCore::EventHandler::passMouseMoveEventToSubframe):
+        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+        (WebCore::EventHandler::passWheelEventToSubframe):
+        (WebCore::EventHandler::passMousePressEventToScrollbar):
+        * platform/ContextMenu.h:
+        * platform/graphics/svg/qt/SVGResourceClipperQt.cpp:
+        (WebCore::SVGResourceClipper::applyClip):
+        * platform/qt/ContextMenuClientQt.cpp: Added.
+        (WebCore::ContextMenuClientQt::addCustomContextMenuItems):
+        (WebCore::ContextMenuClientQt::ref):
+        (WebCore::ContextMenuClientQt::deref):
+        * platform/qt/ContextMenuClientQt.h: Added.
+        * platform/qt/ContextMenuQt.cpp: Added.
+        (WebCore::ContextMenu::appendItem):
+        (WebCore::ContextMenu::itemCount):
+        (WebCore::ContextMenu::insertItem):
+        (WebCore::ContextMenu::setPlatformMenuDescription):
+        * platform/qt/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::selectWordBeforeMenuEvent):
+        (WebCore::EditorClientQt::isEditable):
+        (WebCore::EditorClientQt::registerCommandForUndo):
+        (WebCore::EditorClientQt::registerCommandForRedo):
+        (WebCore::EditorClientQt::clearUndoRedoOperations):
+        (WebCore::EditorClientQt::canUndo):
+        (WebCore::EditorClientQt::canRedo):
+        (WebCore::EditorClientQt::undo):
+        (WebCore::EditorClientQt::redo):
+        * platform/qt/EditorClientQt.h:
+        * platform/qt/ScrollViewCanvasQt.cpp:
+        (WebCore::ScrollViewCanvasQt::mousePressEvent):
+        * platform/qt/TemporaryLinkStubs.cpp:
+        (FrameView::updateBorder):
+
 2006-11-17  David Harrison  <harrison@apple.com>
 
         Reviewed by Adele.
diff --git a/WebCore/page/qt/EventHandlerQt.cpp b/WebCore/page/qt/EventHandlerQt.cpp
new file mode 100644 (file)
index 0000000..0b8f366
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * 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 "EventHandler.h"
+
+#include "Cursor.h"
+#include "Document.h"
+#include "EventNames.h"
+#include "FloatPoint.h"
+#include "FrameLoader.h"
+#include "FrameQt.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "HTMLFrameSetElement.h"
+#include "HitTestRequest.h"
+#include "HitTestResult.h"
+#include "KeyboardEvent.h"
+#include "MouseEventWithHitTestResults.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformScrollBar.h"
+#include "PlatformWheelEvent.h"
+#include "RenderWidget.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
+           __FILE__, __LINE__, __FUNCTION__); } while(0)
+
+static bool isKeyboardOptionTab(KeyboardEvent* event)
+{
+    return event
+        && (event->type() == keydownEvent || event->type() == keypressEvent)
+        && event->altKey()
+        && event->keyIdentifier() == "U+000009";
+}
+
+bool EventHandler::tabsToLinks(KeyboardEvent* event) const
+{
+    return isKeyboardOptionTab(event);
+}
+
+bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
+{
+    bool handlingOptionTab = isKeyboardOptionTab(event);
+    
+    return handlingOptionTab;
+}
+
+void EventHandler::freeClipboard()
+{
+    notImplemented();
+}
+
+void EventHandler::focusDocumentView()
+{
+    notImplemented();
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+    // Figure out which view to send the event to.
+    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
+    if (!target || !target->isWidget())
+        return false;
+    
+    // Double-click events don't exist in Cocoa. Since passWidgetMouseDownEventToWidget will
+    // just pass currentEvent down to the widget, we don't want to call it for events that
+    // don't correspond to Cocoa events.  The mousedown/ups will have already been passed on as
+    // part of the pressed/released handling.
+    return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+    return passMouseDownEventToWidget(renderWidget->widget());
+}
+
+bool EventHandler::passMouseDownEventToWidget(Widget* widget)
+{
+    // FIXME: this method always returns true
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::lastEventIsMouseUp() const
+{
+    notImplemented();
+    return false;
+}
+    
+bool EventHandler::dragHysteresisExceeded(const FloatPoint& floatDragViewportLocation) const
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::handleMouseUp(const MouseEventWithHitTestResults& event)
+{
+    notImplemented();
+    
+    return false;
+}
+
+bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::passWheelEventToWidget(Widget* widget)
+{
+    notImplemented();
+    return false;
+}
+
+// Called as we walk up the element chain for nodes with CSS property -webkit-user-drag == auto
+bool EventHandler::shouldDragAutoNode(Node* node, const IntPoint& point) const
+{
+    notImplemented();
+    return false;
+}
+
+// returns if we should continue "default processing", i.e., whether eventhandler canceled
+bool EventHandler::dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent& event)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passWheelEventToSubframe(PlatformWheelEvent&, Frame* subframe)
+{
+    return passWheelEventToWidget(subframe->view());
+}
+
+bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults&, PlatformScrollbar* scrollbar)
+{
+    return passWheelEventToWidget(scrollbar);
+}
+
+}
index c17565f4dbd8270799d104182db2646eec057a66..8fd4ddc1e4be23ae95a350c07abfe7afaad72328 100644 (file)
@@ -37,6 +37,8 @@ class NSMutableArray;
 #endif
 #elif PLATFORM(WIN)
 typedef struct HMENU__* HMENU;
+#elif PLATFORM(QT)
+class QMenu;
 #endif
 
 namespace WebCore {
@@ -111,6 +113,8 @@ struct ContextMenuItem {
 typedef NSMutableArray* PlatformMenuDescription;
 #elif PLATFORM(WIN)
 typedef HMENU PlatformMenuDescription;
+#elif PLATFORM(QT)
+typedef QMenu* PlatformMenuDescription;
 #endif
 
 class ContextMenu : Noncopyable
index 8c3253d68515adf7e32a349f2bfea6d3aceaeb95..1faa1ded7321168bc9c8bb05a64b38432ae0490b 100644 (file)
@@ -34,7 +34,7 @@ void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
 {
     KRenderingDeviceContext* context = renderingDevice()->currentContext();
     KRenderingDeviceContextQt* qtContext = static_cast<KRenderingDeviceContextQt*>(context);
-    if (m_clipData.count() < 1)
+    if (m_clipData.clipData().size() < 1)
         return;
 
     context->clearPath();
@@ -42,10 +42,11 @@ void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
     QPainterPath newPath;
 
     bool heterogenousClipRules = false;
-    WindRule clipRule = m_clipData[0].windRule;
+    WindRule clipRule = m_clipData.clipData()[0].windRule;
 
-    for (unsigned int x = 0; x < m_clipData.count(); x++) {
-        ClipData clipData = m_clipData[x];
+    unsigned int clipDataCount = m_clipData.clipData().size();
+    for (unsigned int x = 0; x < clipDataCount; x++) {
+        ClipData clipData = m_clipData.clipData()[x];
         if (clipData.windRule != clipRule)
             heterogenousClipRules = true;
 
@@ -99,7 +100,7 @@ void SVGResourceClipper::applyClip(const FloatRect& boundingBox) const
         }
     }
 
-    if (m_clipData.count()) {
+    if (m_clipData.clipData().size()) {
         // FIXME!
         // We don't currently allow for heterogenous clip rules.
         // we would have to detect such, draw to a mask, and then clip
diff --git a/WebCore/platform/qt/ContextMenuClientQt.cpp b/WebCore/platform/qt/ContextMenuClientQt.cpp
new file mode 100644 (file)
index 0000000..27a73e0
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * 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 "ContextMenuClientQt.h"
+
+#include "Shared.h"
+
+#include <stdio.h>
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
+           __FILE__, __LINE__, __FUNCTION__); } while(0)
+
+namespace WebCore {
+    
+void ContextMenuClientQt::addCustomContextMenuItems(ContextMenu*)
+{
+    notImplemented();
+}
+
+void ContextMenuClientQt::ref()
+{
+    Shared<ContextMenuClientQt>::ref();
+}
+
+void ContextMenuClientQt::deref()
+{
+    Shared<ContextMenuClientQt>::deref();
+}
+
+}
diff --git a/WebCore/platform/qt/ContextMenuClientQt.h b/WebCore/platform/qt/ContextMenuClientQt.h
new file mode 100644 (file)
index 0000000..2277210
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * 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 ContextMenuClientQt_h
+#define ContextMenuClientQt_h
+
+#include "ContextMenuClient.h"
+
+#include <Shared.h>
+
+namespace WebCore {
+    class ContextMenu;
+
+    class ContextMenuClientQt : public ContextMenuClient,
+                                public Shared<ContextMenuClientQt> {
+    public:
+        virtual void deref();
+        virtual void addCustomContextMenuItems(ContextMenu*);
+        virtual void ref();
+    };
+}
+
+#endif
diff --git a/WebCore/platform/qt/ContextMenuQt.cpp b/WebCore/platform/qt/ContextMenuQt.cpp
new file mode 100644 (file)
index 0000000..db17d3d
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * 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 "ContextMenu.h"
+
+#include <QMenu>
+#include <QAction>
+
+namespace WebCore {
+    
+void ContextMenu::appendItem(ContextMenuItem item)
+{
+    if (!m_menu) {
+        m_menu = new QMenu();
+    }
+    QAction *action  = m_menu->addAction(item.title);
+}
+
+unsigned ContextMenu::itemCount()
+{
+    //FIXME: This method is silly
+    return 1;
+}
+
+void ContextMenu::insertItem(unsigned position, ContextMenuItem item)
+{
+    //FIXME: Another silly method
+    appendItem(item);
+    
+}
+
+void ContextMenu::setPlatformMenuDescription(PlatformMenuDescription menu)
+{
+    delete m_menu;
+    m_menu = static_cast<QMenu*>(menu);
+}
+
+}
index 2acb64e85768e619f18a8be2fe978c4d40cc46f3..02973b4ff6f7f587f460e6670707b2842fc29777 100644 (file)
 #include "config.h"
 #include "EditorClientQt.h"
 
+#include "EditCommand.h"
+
 #include <stdio.h>
 
-#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
 
 namespace WebCore {
 
@@ -109,6 +111,55 @@ void EditorClientQt::didEndEditing()
     notImplemented();
 }
 
+bool EditorClientQt::selectWordBeforeMenuEvent()
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientQt::isEditable()
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientQt::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand>)
+{
+    notImplemented();
+}
+
+void EditorClientQt::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>)
+{
+    notImplemented();
+}
+
+void EditorClientQt::clearUndoRedoOperations()
+{
+    notImplemented();
+}
+
+bool EditorClientQt::canUndo() const
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientQt::canRedo() const
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientQt::undo()
+{
+    notImplemented();
+}
+
+void EditorClientQt::redo()
+{
+    notImplemented();
+}
+
 }
 
 // vim: ts=4 sw=4 et
index ea53b3af8ec2f9e956e3dd783914b2a2b186d4f4..4f4d64681f25f12e3619fbd6f5b776d289a828bf 100644 (file)
@@ -33,6 +33,8 @@
 #include "EditorClient.h"
 #include "Shared.h"
 
+#include <wtf/Forward.h>
+
 namespace WebCore {
 
 class EditorClientQt : public EditorClient, public Shared<EditorClientQt> {
@@ -56,6 +58,15 @@ public:
     virtual void respondToChangedContents();
     virtual void didEndEditing();
 
+    virtual bool selectWordBeforeMenuEvent();
+    virtual bool isEditable();
+    virtual void registerCommandForUndo(PassRefPtr<WebCore::EditCommand>);
+    virtual void registerCommandForRedo(PassRefPtr<WebCore::EditCommand>);
+    virtual void clearUndoRedoOperations();
+    virtual bool canUndo() const;
+    virtual bool canRedo() const;
+    virtual void undo();
+    virtual void redo();
 };
 
 }
index 86fb36fabd7b63c052dd4d52b725810517292a2e..a7833f85d3ef70ea5c980e404d4bf018cd7877a4 100644 (file)
@@ -34,6 +34,7 @@
 #include "ScrollViewCanvasQt.h"
 #include "ScrollViewCanvasQt.moc"
 
+#include "EventHandler.h"
 #include "FrameQt.h"
 #include "FrameView.h"
 #include "TypingCommand.h"
@@ -90,10 +91,10 @@ void ScrollViewCanvasQt::mouseMoveEvent(QMouseEvent* ev)
 void ScrollViewCanvasQt::mousePressEvent(QMouseEvent* ev)
 {
     FrameView* fv = static_cast<FrameView*>(m_frameView);
-    if (!fv || !fv->frame())
+    if (!fv || !fv->frame() || !fv->frame()->eventHandler())
         return;
 
-    fv->handleMousePressEvent(PlatformMouseEvent(ev, 1));
+    fv->frame()->eventHandler()->handleMousePressEvent(PlatformMouseEvent(ev, 1));
 }
 
 void ScrollViewCanvasQt::mouseReleaseEvent(QMouseEvent* ev)
index 14eb6da2438e62d593edf0343c9a9696c12d0f5b..c49d7801faca2cdb2ca05b36113f1d7dfca56bc4 100644 (file)
@@ -40,7 +40,6 @@
 #include "Widget.h"
 #include "GraphicsContext.h"
 #include "TextField.h"
-#include "Slider.h"
 #include "Cursor.h"
 #include "loader.h"
 #include "FrameView.h"
@@ -64,7 +63,8 @@
 
 using namespace WebCore;
 
-#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", \
+           __FILE__, __LINE__, __FUNCTION__); } while(0)
 
 FloatRect Font::selectionRectForComplexText(const TextRun&, const TextStyle&, const IntPoint&, int) const { notImplemented(); return FloatRect(); }
 int Font::offsetForPositionForComplexText(const TextRun&, const TextStyle&, int, bool) const { notImplemented(); return 0; }
@@ -108,16 +108,6 @@ IntSize TextField::sizeForCharacterWidth(int) const { notImplemented(); return I
 int TextField::baselinePosition(int) const { notImplemented(); return 0; }
 void TextField::setLiveSearch(bool) { notImplemented(); }
 
-Slider::Slider() { notImplemented(); }
-IntSize Slider::sizeHint() const { notImplemented(); return IntSize(); }
-Slider::~Slider() { notImplemented(); }
-void Slider::setValue(double) { notImplemented(); }
-void Slider::setMaxValue(double) { notImplemented(); }
-void Slider::setMinValue(double) { notImplemented(); }
-void Slider::setFont(WebCore::Font const&) { notImplemented(); }
-double Slider::value() const { notImplemented(); return 0; }
-Widget::FocusPolicy Slider::focusPolicy() const { notImplemented(); return NoFocus; }
-
 Scrollbar::Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) { notImplemented(); }
 void Scrollbar::setSteps(int, int) { notImplemented(); }
 bool Scrollbar::scroll(ScrollDirection, ScrollGranularity, float) { notImplemented(); return 0; }
@@ -160,11 +150,6 @@ FloatRect WebCore::screenAvailableRect(Widget*)
 void WebCore::setFocusRingColorChangeFunction(void (*)()) { notImplemented(); }
 
 void FrameView::updateBorder() { notImplemented(); }
-bool FrameView::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) { return true; }
-bool FrameView::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) { return true; }
-bool FrameView::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) { return true; }
-bool FrameView::passWheelEventToSubframe(PlatformWheelEvent& e, Frame* subframe) { return false; }
-bool FrameView::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, PlatformScrollbar*) { return false; }
 
 bool AXObjectCache::gAccessibilityEnabled = false;
 
index 92452a1bef7387e427b75c004ef2e0073b330d4b..907b327ef77490833d0f58d5184ed5e7ee634653 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-17  Zack Rusin  <zack@kde.org>
+
+        Reviewed by Mitz. Landed by Niko.
+
+        Adjusting to the new api.
+
+        * QtLauncher/main.cpp:
+        (main):
+        * WebKitPart/WebKitPart.cpp:
+        (WebKitPart::initView):
+
 2006-11-10  Zack Rusin  <zack@kde.org>
 
         Reviewed and landed by Anders.
index d6d80ec725cbfc5921733b31c99ace44c9528231..d497bb63d08c4d49a9a7e6be3c50b07c598f712c 100644 (file)
@@ -40,6 +40,7 @@
 #include <Document.h>
 #include <FrameView.h>
 #include <ChromeClientQt.h>
+#include <ContextMenuClientQt.h>
 #include <KURL.h>
 
 #include <FrameQt.h>
@@ -82,7 +83,7 @@ int main(int argc, char **argv)
     QBoxLayout *l = new QVBoxLayout(&topLevel);
  
     // Initialize WebCore in Qt platform mode...
-    Page* page = new Page(new ChromeClientQt());
+    Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt());
     Frame* frame = new FrameQt(page, 0, new FrameQtClientDefault());
 
     FrameView* frameView = new FrameView(frame);
index d2b6b82b7bfd4c3ee674a72073861714cfaadcfa..d0d47e5440bd132a18f1e58fc248d7f1cd259943 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  *
  * All rights reserved.
  *
@@ -31,6 +32,7 @@
 #include "FrameLoader.h"
 #include "FrameView.h"
 #include "ChromeClientQt.h"
+#include "ContextMenuClientQt.h"
 #include "KURL.h"
 
 #include <QDebug>
@@ -104,7 +106,7 @@ void WebKitPart::initView(QWidget* parentWidget, GUIProfile prof)
     m_client = new WebKitPartClient(this);
  
     // Initialize WebCore in Qt platform mode...
-    Page* page = new Page(new ChromeClientQt());
+    Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt());
     Frame* frame = new FrameQt(page, 0, m_client);
 
     m_frame = frame;
index 8ebcfcfef0b259a2e495d0923cf3622ae233fa9f..932d828b0df35334fac15d134bd64ef1ce532ef9 100644 (file)
@@ -1,3 +1,13 @@
+2006-11-17  Zack Rusin  <zack@kde.org>
+
+        Reviewed by Mitz. Landed by Niko.
+
+        Fixing compilation.
+
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree): Adding
+        ContextMenuClient to the constructor
+
 2006-11-12  Mark Rowe  <bdash@webkit.org>
 
         Reviewed by Mitz.
index d1e7b1ba7fea568423f8abddf4786aaf4e2e37cc..f7b4954d2587a07eaec2558563b8f1cb7ccf4b91 100644 (file)
@@ -38,6 +38,7 @@
 #include "FrameLoader.h"
 #include "RenderTreeAsText.h"
 #include "ChromeClientQt.h"
+#include "ContextMenuClientQt.h"
 
 #include <QDir>
 #include <QFile>
@@ -61,7 +62,7 @@ DumpRenderTree::DumpRenderTree()
     , m_notifier()
 {
     // Initialize WebCore in Qt platform mode...
-    Page* page = new Page(new ChromeClientQt());
+    Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt());
     m_frame = new FrameQt(page, 0, m_client);
 
     FrameView* view = new FrameView(m_frame);