[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/unity
From: Simon Hausmann <hausmann () kde ! org>
Date: 2006-07-11 19:17:42
Message-ID: 1152645462.246517.10513.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 561274 by hausmann:
r240@rhea (orig r239): zrusin | 2006-07-10 10:30:42 +0200
add some basic event handling (crashes on mouse events for some reason)
_M . (directory)
M +1 -0 WebKit/WebCore/CMakeLists.txt
M +7 -0 WebKit/WebCore/platform/PlatformMouseEvent.h
M +24 -3 WebKit/WebCore/platform/qt/CanvasQt.cpp
M +6 -0 WebKit/WebCore/platform/qt/CanvasQt.h
A WebKit/WebCore/platform/qt/PlatformMouseEventQt.cpp [License: no copyright]
--- branches/work/unity/WebKit/WebCore/CMakeLists.txt #561273:561274
@@ -788,6 +788,7 @@
platform/qt/FrameQt.cpp
platform/qt/TextEditQt.cpp
platform/qt/CanvasQt.cpp
+ platform/qt/PlatformMouseEventQt.cpp
platform/qt/RenderThemeQt.cpp
platform/image-decoders/bmp/BMPImageDecoder.cpp
platform/image-decoders/gif/GIFImageReader.cpp
--- branches/work/unity/WebKit/WebCore/platform/PlatformMouseEvent.h #561273:561274
@@ -46,6 +46,10 @@
typedef union _GdkEvent GdkEvent;
#endif
+#if PLATFORM(QT)
+class QMouseEvent;
+#endif
+
namespace WebCore {
// These button numbers match the one used in the DOM API.
@@ -86,6 +90,9 @@
#if PLATFORM(GDK)
PlatformMouseEvent(GdkEvent*);
#endif
+#if PLATFORM(QT)
+ PlatformMouseEvent(QMouseEvent*, int clickCount);
+#endif
private:
IntPoint m_position;
--- branches/work/unity/WebKit/WebCore/platform/qt/CanvasQt.cpp #561273:561274
@@ -1,20 +1,22 @@
-
+#include "CanvasQt.h"
#include "CanvasQt.moc"
#include "FrameView.h"
#include "Frame.h"
#include "GraphicsContext.h"
+#include "PlatformMouseEvent.h"
#include <QDebug>
#include <QPainter>
#include <QPaintEvent>
-#include "CanvasQt.h"
+#include <QMouseEvent>
using namespace WebCore;
CanvasQt::CanvasQt(WebCore::ScrollView *frameView, QWidget *parent)
: QWidget(parent), m_frameView(frameView)
{
+ setMouseTracking(true);
}
void CanvasQt::paintEvent(QPaintEvent *ev)
@@ -23,7 +25,7 @@
QRect clip = ev->rect();
QPainter p(this);
GraphicsContext ctx(&p);
- dynamic_cast<FrameView*>(m_frameView)->frame()->paint(&ctx, clip);
+ static_cast<FrameView*>(m_frameView)->frame()->paint(&ctx, clip);
}
QSize CanvasQt::sizeHint() const
@@ -32,4 +34,23 @@
}
+void CanvasQt::mouseMoveEvent(QMouseEvent *ev)
+{
+ //static_cast<FrameView*>(m_frameView)->handleMouseMoveEvent(PlatformMouseEvent(ev, 0));
+}
+
+void CanvasQt::mousePressEvent(QMouseEvent *ev)
+{
+ //static_cast<FrameView*>(m_frameView)->handleMousePressEvent(PlatformMouseEvent(ev, 1));
+}
+
+void CanvasQt::mouseReleaseEvent(QMouseEvent *ev)
+{
+ //static_cast<FrameView*>(m_frameView)->handleMouseReleaseEvent(PlatformMouseEvent(ev, 0));
+}
+
+void CanvasQt::keyPressEvent(QKeyEvent *ev)
+{
+
+}
// vim: ts=4 sw=4 et
--- branches/work/unity/WebKit/WebCore/platform/qt/CanvasQt.h #561273:561274
@@ -4,6 +4,8 @@
#include <QWidget>
class QPaintEvent;
+class QMouseEvent;
+class QKeyEvent;
namespace WebCore
{
class ScrollView;
@@ -18,6 +20,10 @@
virtual QSize sizeHint() const;
protected:
virtual void paintEvent(QPaintEvent *ev);
+ virtual void mouseMoveEvent(QMouseEvent *ev);
+ virtual void mousePressEvent(QMouseEvent *ev);
+ virtual void mouseReleaseEvent(QMouseEvent *ev);
+ virtual void keyPressEvent(QKeyEvent *ev);
private:
WebCore::ScrollView *m_frameView;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic