[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 18:14:58 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit b54d90b281c6392539819afd4a7a320a2174da0c
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 9 03:10:51 2010 +0000
2010-12-08 Qi Zhang <qi.2.zhang at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Support OrientationChange event
https://bugs.webkit.org/show_bug.cgi?id=50685
Get OrientationChange event from qtmobility then send to webkit.
* Api/qwebframe.cpp:
(QWebFrame::orientationChanged):
(QWebFrame::QWebFrame):
* Api/qwebframe.h:
* Api/qwebframe_p.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 3cdbef2..62e760c 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -409,6 +409,34 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
}
}
+void QWebFrame::orientationChanged()
+{
+#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION)
+ int orientation;
+ WebCore::Frame* frame = QWebFramePrivate::core(this);
+
+ switch (d->m_orientation.reading()->orientation()) {
+ case QtMobility::QOrientationReading::TopUp:
+ orientation = 0;
+ break;
+ case QtMobility::QOrientationReading::TopDown:
+ orientation = 180;
+ break;
+ case QtMobility::QOrientationReading::LeftUp:
+ orientation = -90;
+ break;
+ case QtMobility::QOrientationReading::RightUp:
+ orientation = 90;
+ break;
+ case QtMobility::QOrientationReading::FaceUp:
+ case QtMobility::QOrientationReading::FaceDown:
+ // WebCore unable to handle it
+ default:
+ return;
+ }
+ frame->sendOrientationChangeEvent(orientation);
+#endif
+}
/*!
\class QWebFrame
\since 4.4
@@ -483,6 +511,10 @@ QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData)
WebCore::ResourceRequest request(frameData->url, frameData->referrer);
d->frame->loader()->load(request, frameData->name, false);
}
+#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION)
+ connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged()));
+ d->m_orientation.start();
+#endif
}
QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData)
@@ -491,6 +523,10 @@ QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData)
{
d->page = parent->d->page;
d->init(this, frameData);
+#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION)
+ connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged()));
+ d->m_orientation.start();
+#endif
}
QWebFrame::~QWebFrame()
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index a598a56..8410962 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -205,6 +205,9 @@ public Q_SLOTS:
void print(QPrinter *printer) const;
#endif
+private Q_SLOTS:
+ void orientationChanged();
+
Q_SIGNALS:
void javaScriptWindowObjectCleared();
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 1af1c95..ee8c463 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -28,6 +28,9 @@
#include "GraphicsContext.h"
#include "KURL.h"
#include "PlatformString.h"
+#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION)
+#include "qorientationsensor.h"
+#endif
#include "qwebelement.h"
#include "wtf/RefPtr.h"
#include "Frame.h"
@@ -37,6 +40,7 @@
#include "texmap/TextureMapper.h"
#endif
+
namespace WebCore {
class FrameLoaderClientQt;
class FrameView;
@@ -114,6 +118,10 @@ public:
WebCore::TextureMapperContentLayer* rootGraphicsLayer;
OwnPtr<WebCore::TextureMapper> textureMapper;
#endif
+
+#if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION)
+ QtMobility::QOrientationSensor m_orientation;
+#endif
};
class QWebHitTestResultPrivate {
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 45d416d..dbdadf4 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-08 Qi Zhang <qi.2.zhang at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Support OrientationChange event
+ https://bugs.webkit.org/show_bug.cgi?id=50685
+
+ Get OrientationChange event from qtmobility then send to webkit.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::orientationChanged):
+ (QWebFrame::QWebFrame):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
2010-12-07 Brian Weinstein <bweinstein at apple.com>
Reviewed by John Sullivan.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list