diff options
author | Ben Murdoch <benm@google.com> | 2010-06-15 19:36:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-06-16 14:52:28 +0100 |
commit | 545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch) | |
tree | c0c14763654d84d37577dde512c3d3b4699a9e86 /WebCore/platform/qt | |
parent | 719298a66237d38ea5c05f1547123ad8aacbc237 (diff) | |
download | external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2 |
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'WebCore/platform/qt')
24 files changed, 714 insertions, 544 deletions
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp index c23e42e..c98c79a 100644 --- a/WebCore/platform/qt/ClipboardQt.cpp +++ b/WebCore/platform/qt/ClipboardQt.cpp @@ -22,14 +22,14 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "ClipboardQt.h" -#include "CachedImage.h" #include "CSSHelper.h" +#include "CachedImage.h" #include "Document.h" #include "Element.h" #include "FileList.h" @@ -38,19 +38,19 @@ #include "Image.h" #include "IntPoint.h" #include "KURL.h" -#include "markup.h" #include "NotImplemented.h" #include "PlatformString.h" #include "Range.h" #include "RenderImage.h" #include "StringHash.h" +#include "markup.h" +#include <QApplication> +#include <QClipboard> #include <QList> #include <QMimeData> #include <QStringList> #include <QUrl> -#include <QApplication> -#include <QClipboard> #include <qdebug.h> #define methodDebug() qDebug("ClipboardQt: %s", __FUNCTION__) @@ -226,14 +226,14 @@ void ClipboardQt::declareAndWriteDragImage(Element* element, const KURL& url, co { ASSERT(frame); - //WebCore::writeURL(m_writableDataObject.get(), url, title, true, false); + // WebCore::writeURL(m_writableDataObject.get(), url, title, true, false); if (!m_writableData) m_writableData = new QMimeData; CachedImage* cachedImage = getCachedImage(element); if (!cachedImage || !cachedImage->image() || !cachedImage->isLoaded()) return; - QPixmap *pixmap = cachedImage->image()->nativeImageForCurrentFrame(); + QPixmap* pixmap = cachedImage->image()->nativeImageForCurrentFrame(); if (pixmap) m_writableData->setImageData(*pixmap); diff --git a/WebCore/platform/qt/ContextMenuItemQt.cpp b/WebCore/platform/qt/ContextMenuItemQt.cpp index cf23587..b91a2a7 100644 --- a/WebCore/platform/qt/ContextMenuItemQt.cpp +++ b/WebCore/platform/qt/ContextMenuItemQt.cpp @@ -21,11 +21,12 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "ContextMenuItem.h" + #include "ContextMenu.h" namespace WebCore { diff --git a/WebCore/platform/qt/ContextMenuQt.cpp b/WebCore/platform/qt/ContextMenuQt.cpp index 9b1a054..30c4c2d 100644 --- a/WebCore/platform/qt/ContextMenuQt.cpp +++ b/WebCore/platform/qt/ContextMenuQt.cpp @@ -21,19 +21,17 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "ContextMenu.h" -#include <wtf/Assertions.h> - -#include <QAction> - #include <Document.h> #include <Frame.h> #include <FrameView.h> +#include <QAction> +#include <wtf/Assertions.h> namespace WebCore { diff --git a/WebCore/platform/qt/CursorQt.cpp b/WebCore/platform/qt/CursorQt.cpp index 87f4fce..2e495e7 100644 --- a/WebCore/platform/qt/CursorQt.cpp +++ b/WebCore/platform/qt/CursorQt.cpp @@ -57,11 +57,12 @@ Cursor::~Cursor() { } -Cursor::Cursor(Image* image, const IntPoint& hotspot) +Cursor::Cursor(Image* image, const IntPoint& hotSpot) +{ #ifndef QT_NO_CURSOR - : m_impl(*(image->nativeImageForCurrentFrame()), hotspot.x(), hotspot.y()) + IntPoint effectiveHotSpot = determineHotSpot(image, hotSpot); + m_impl = QCursor(*(image->nativeImageForCurrentFrame()), effectiveHotSpot.x(), effectiveHotSpot.y()); #endif -{ } Cursor& Cursor::operator=(const Cursor& other) diff --git a/WebCore/platform/qt/DragDataQt.cpp b/WebCore/platform/qt/DragDataQt.cpp index 09a797f..808606d 100644 --- a/WebCore/platform/qt/DragDataQt.cpp +++ b/WebCore/platform/qt/DragDataQt.cpp @@ -20,7 +20,7 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -31,10 +31,10 @@ #include "DocumentFragment.h" #include "markup.h" +#include <QColor> #include <QList> #include <QMimeData> #include <QUrl> -#include <QColor> namespace WebCore { @@ -90,7 +90,7 @@ String DragData::asPlainText() const return text; // FIXME: Should handle rich text here - return asURL(0); + return asURL(DoNotConvertFilenames, 0); } Color DragData::asColor() const @@ -112,15 +112,17 @@ bool DragData::containsCompatibleContent() const return containsColor() || containsURL() || m_platformDragData->hasHtml() || m_platformDragData->hasText(); } -bool DragData::containsURL() const +bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const { + // FIXME: Use filenamePolicy. if (!m_platformDragData) return false; return m_platformDragData->hasUrls(); } -String DragData::asURL(String*) const +String DragData::asURL(FilenameConversionPolicy filenamePolicy, String*) const { + // FIXME: Use filenamePolicy. if (!m_platformDragData) return String(); QList<QUrl> urls = m_platformDragData->urls(); diff --git a/WebCore/platform/qt/FileChooserQt.cpp b/WebCore/platform/qt/FileChooserQt.cpp index 307876c..8b1df0a 100644 --- a/WebCore/platform/qt/FileChooserQt.cpp +++ b/WebCore/platform/qt/FileChooserQt.cpp @@ -21,8 +21,8 @@ #include "config.h" #include "FileChooser.h" -#include "LocalizedStrings.h" #include "Font.h" +#include "LocalizedStrings.h" #include <QCoreApplication> #include <QFontMetrics> diff --git a/WebCore/platform/qt/FileSystemQt.cpp b/WebCore/platform/qt/FileSystemQt.cpp index e42ca67..03dfc8f 100644 --- a/WebCore/platform/qt/FileSystemQt.cpp +++ b/WebCore/platform/qt/FileSystemQt.cpp @@ -9,13 +9,13 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 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. + * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -33,14 +33,12 @@ #include "FileSystem.h" #include "PlatformString.h" -#include <wtf/text/CString.h> - #include <QDateTime> +#include <QDir> #include <QFile> -#include <QTemporaryFile> #include <QFileInfo> -#include <QDateTime> -#include <QDir> +#include <QTemporaryFile> +#include <wtf/text/CString.h> namespace WebCore { diff --git a/WebCore/platform/qt/GeolocationServiceQt.cpp b/WebCore/platform/qt/GeolocationServiceQt.cpp new file mode 100644 index 0000000..e24d497 --- /dev/null +++ b/WebCore/platform/qt/GeolocationServiceQt.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * 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 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 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 "GeolocationServiceQt.h" + +#include "Geolocation.h" +#include "Geoposition.h" +#include "PositionError.h" +#include "PositionOptions.h" + +using namespace QtMobility; + +namespace WebCore { + +GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &GeolocationServiceQt::create; + +GeolocationService* GeolocationServiceQt::create(GeolocationServiceClient* client) +{ + return new GeolocationServiceQt(client); +} + +GeolocationServiceQt::GeolocationServiceQt(GeolocationServiceClient* client) + : GeolocationService(client) + , m_lastPosition(0) + , m_lastError(0) +{ + m_location = QGeoPositionInfoSource::createDefaultSource(this); + + if (m_location) + connect(m_location, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo))); +} + +GeolocationServiceQt::~GeolocationServiceQt() +{ +} + +void GeolocationServiceQt::positionUpdated(const QGeoPositionInfo &geoPosition) +{ + if (!geoPosition.isValid()) + errorOccurred(); + + QGeoCoordinate coord = geoPosition.coordinate(); + double latitude = coord.latitude(); + double longitude = coord.longitude(); + bool providesAltitude = true; + double altitude = coord.altitude(); + + double accuracy = geoPosition.hasAttribute(QGeoPositionInfo::HorizontalAccuracy) ? + geoPosition.attribute(QGeoPositionInfo::HorizontalAccuracy) : 0.0; + + bool providesAltitudeAccuracy = geoPosition.hasAttribute(QGeoPositionInfo::VerticalAccuracy); + double altitudeAccuracy = providesAltitudeAccuracy ? geoPosition.attribute(QGeoPositionInfo::VerticalAccuracy) : 0.0; + + bool providesHeading = geoPosition.hasAttribute(QGeoPositionInfo::Direction); + double heading = providesHeading ? geoPosition.attribute(QGeoPositionInfo::Direction) : 0.0; + + bool providesSpeed = geoPosition.hasAttribute(QGeoPositionInfo::GroundSpeed); + double speed = providesSpeed ? geoPosition.attribute(QGeoPositionInfo::GroundSpeed) : 0.0; + + RefPtr<Coordinates> coordinates = Coordinates::create(latitude, longitude, providesAltitude, altitude, + accuracy, providesAltitudeAccuracy, altitudeAccuracy, + providesHeading, heading, providesSpeed, speed); + m_lastPosition = Geoposition::create(coordinates.release(), geoPosition.timestamp().toTime_t()); + positionChanged(); +} + +bool GeolocationServiceQt::startUpdating(PositionOptions*) +{ + m_lastPosition = 0; + + if (!m_location) + return false; + + // TODO: handle enableHighAccuracy() + + m_location->startUpdates(); + return true; +} + +void GeolocationServiceQt::stopUpdating() +{ + if (m_location) + m_location->stopUpdates(); +} + +} // namespace WebCore diff --git a/WebCore/platform/qt/GeolocationServiceQt.h b/WebCore/platform/qt/GeolocationServiceQt.h new file mode 100644 index 0000000..2525e47 --- /dev/null +++ b/WebCore/platform/qt/GeolocationServiceQt.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * 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 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 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 GeolocationServiceQt_h +#define GeolocationServiceQt_h + +#include "GeolocationService.h" +#include <QGeoPositionInfoSource> +#include <wtf/RefPtr.h> + +// FIXME: Remove usage of "using namespace" in a header file. +// There is bug in qtMobility signal names are not full qualified when used with namespace +// QtMobility namespace in slots throws up error and its required to be fixed in qtmobility. +using namespace QtMobility; + +namespace WebCore { + +// This class provides a implementation of a GeolocationService for qtWebkit. +// It uses QtMobility (v1.0.0) location service to get positions +class GeolocationServiceQt : public QObject, GeolocationService { + Q_OBJECT + +public: + static GeolocationService* create(GeolocationServiceClient*); + + GeolocationServiceQt(GeolocationServiceClient*); + virtual ~GeolocationServiceQt(); + + virtual bool startUpdating(PositionOptions*); + virtual void stopUpdating(); + + virtual Geoposition* lastPosition() const { return m_lastPosition.get(); } + virtual PositionError* lastError() const { return m_lastError.get(); } + +public Q_SLOTS: + // QGeoPositionInfoSource + void positionUpdated(const QGeoPositionInfo&); + +private: + RefPtr<Geoposition> m_lastPosition; + RefPtr<PositionError> m_lastError; + + QtMobility::QGeoPositionInfoSource* m_location; +}; + +} // namespace WebCore + +#endif // GeolocationServiceQt_h diff --git a/WebCore/platform/qt/KURLQt.cpp b/WebCore/platform/qt/KURLQt.cpp index ea1a795..f6d2a86 100644 --- a/WebCore/platform/qt/KURLQt.cpp +++ b/WebCore/platform/qt/KURLQt.cpp @@ -19,11 +19,11 @@ */ #include "config.h" #include "KURL.h" -#include "TextEncoding.h" -#include <wtf/text/CString.h> #include "NotImplemented.h" +#include "TextEncoding.h" #include "qurl.h" +#include <wtf/text/CString.h> namespace WebCore { diff --git a/WebCore/platform/qt/Localizations.cpp b/WebCore/platform/qt/Localizations.cpp index 8fdd666..454872a 100644 --- a/WebCore/platform/qt/Localizations.cpp +++ b/WebCore/platform/qt/Localizations.cpp @@ -27,15 +27,15 @@ */ #include "config.h" +#include "LocalizedStrings.h" #include "IntSize.h" -#include "LocalizedStrings.h" #include "NotImplemented.h" #include "PlatformString.h" -#include <wtf/MathExtras.h> - #include <QCoreApplication> #include <QLocale> +#include <wtf/MathExtras.h> + namespace WebCore { @@ -350,7 +350,7 @@ String AXMenuListActionVerb() { return String(); } - + String missingPluginText() { return QCoreApplication::translate("QWebPage", "Missing Plug-in", "Label text to be used when a plug-in is missing"); @@ -477,21 +477,18 @@ String localizedMediaTimeDescription(float time) int minutes = (seconds / 60) % 60; seconds %= 60; - if (days) { + if (days) return QCoreApplication::translate("QWebPage", "%1 days %2 hours %3 minutes %4 seconds", "Media time description").arg(days).arg(hours).arg(minutes).arg(seconds); - } - if (hours) { + if (hours) return QCoreApplication::translate("QWebPage", "%1 hours %2 minutes %3 seconds", "Media time description").arg(hours).arg(minutes).arg(seconds); - } - if (minutes) { + if (minutes) return QCoreApplication::translate("QWebPage", "%1 minutes %2 seconds", "Media time description").arg(minutes).arg(seconds); - } return QCoreApplication::translate("QWebPage", "%1 seconds", "Media time description").arg(seconds); } -#endif // ENABLE(VIDEO) +#endif // ENABLE(VIDEO) String validationMessageValueMissingText() { diff --git a/WebCore/platform/qt/LoggingQt.cpp b/WebCore/platform/qt/LoggingQt.cpp index 2854953..817887d 100644 --- a/WebCore/platform/qt/LoggingQt.cpp +++ b/WebCore/platform/qt/LoggingQt.cpp @@ -19,8 +19,8 @@ #include "config.h" #include "Logging.h" -#include "PlatformString.h" +#include "PlatformString.h" #include <QDebug> #include <QStringList> diff --git a/WebCore/platform/qt/PasteboardQt.cpp b/WebCore/platform/qt/PasteboardQt.cpp index 484fa60..86d2cfe 100644 --- a/WebCore/platform/qt/PasteboardQt.cpp +++ b/WebCore/platform/qt/PasteboardQt.cpp @@ -162,8 +162,8 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&) ASSERT(image); QPixmap* pixmap = image->nativeImageForCurrentFrame(); - ASSERT(pixmap); - + if (!pixmap) + return; QApplication::clipboard()->setPixmap(*pixmap, QClipboard::Clipboard); #endif } diff --git a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp index 56fec70..58ab2bf 100644 --- a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp +++ b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp @@ -31,110 +31,109 @@ #include "NotImplemented.h" #include "WindowsKeyboardCodes.h" -#include <ctype.h> - #include <QKeyEvent> +#include <ctype.h> namespace WebCore { static String keyIdentifierForQtKeyCode(int keyCode) { switch (keyCode) { - case Qt::Key_Menu: - case Qt::Key_Alt: - return "Alt"; - case Qt::Key_Clear: - return "Clear"; - case Qt::Key_Down: - return "Down"; - case Qt::Key_End: - return "End"; - case Qt::Key_Return: - case Qt::Key_Enter: - return "Enter"; - case Qt::Key_Execute: - return "Execute"; - case Qt::Key_F1: - return "F1"; - case Qt::Key_F2: - return "F2"; - case Qt::Key_F3: - return "F3"; - case Qt::Key_F4: - return "F4"; - case Qt::Key_F5: - return "F5"; - case Qt::Key_F6: - return "F6"; - case Qt::Key_F7: - return "F7"; - case Qt::Key_F8: - return "F8"; - case Qt::Key_F9: - return "F9"; - case Qt::Key_F10: - return "F10"; - case Qt::Key_F11: - return "F11"; - case Qt::Key_F12: - return "F12"; - case Qt::Key_F13: - return "F13"; - case Qt::Key_F14: - return "F14"; - case Qt::Key_F15: - return "F15"; - case Qt::Key_F16: - return "F16"; - case Qt::Key_F17: - return "F17"; - case Qt::Key_F18: - return "F18"; - case Qt::Key_F19: - return "F19"; - case Qt::Key_F20: - return "F20"; - case Qt::Key_F21: - return "F21"; - case Qt::Key_F22: - return "F22"; - case Qt::Key_F23: - return "F23"; - case Qt::Key_F24: - return "F24"; - case Qt::Key_Help: - return "Help"; - case Qt::Key_Home: - return "Home"; - case Qt::Key_Insert: - return "Insert"; - case Qt::Key_Left: - return "Left"; - case Qt::Key_PageDown: - return "PageDown"; - case Qt::Key_PageUp: - return "PageUp"; - case Qt::Key_Pause: - return "Pause"; - case Qt::Key_Print: - return "PrintScreen"; - case Qt::Key_Right: - return "Right"; - case Qt::Key_Select: - return "Select"; - case Qt::Key_Up: - return "Up"; - // Standard says that DEL becomes U+007F. - case Qt::Key_Delete: - return "U+007F"; - case Qt::Key_Backspace: - return "U+0008"; - case Qt::Key_Tab: - return "U+0009"; - case Qt::Key_Backtab: - return "U+0009"; - default: - return String::format("U+%04X", toupper(keyCode)); + case Qt::Key_Menu: + case Qt::Key_Alt: + return "Alt"; + case Qt::Key_Clear: + return "Clear"; + case Qt::Key_Down: + return "Down"; + case Qt::Key_End: + return "End"; + case Qt::Key_Return: + case Qt::Key_Enter: + return "Enter"; + case Qt::Key_Execute: + return "Execute"; + case Qt::Key_F1: + return "F1"; + case Qt::Key_F2: + return "F2"; + case Qt::Key_F3: + return "F3"; + case Qt::Key_F4: + return "F4"; + case Qt::Key_F5: + return "F5"; + case Qt::Key_F6: + return "F6"; + case Qt::Key_F7: + return "F7"; + case Qt::Key_F8: + return "F8"; + case Qt::Key_F9: + return "F9"; + case Qt::Key_F10: + return "F10"; + case Qt::Key_F11: + return "F11"; + case Qt::Key_F12: + return "F12"; + case Qt::Key_F13: + return "F13"; + case Qt::Key_F14: + return "F14"; + case Qt::Key_F15: + return "F15"; + case Qt::Key_F16: + return "F16"; + case Qt::Key_F17: + return "F17"; + case Qt::Key_F18: + return "F18"; + case Qt::Key_F19: + return "F19"; + case Qt::Key_F20: + return "F20"; + case Qt::Key_F21: + return "F21"; + case Qt::Key_F22: + return "F22"; + case Qt::Key_F23: + return "F23"; + case Qt::Key_F24: + return "F24"; + case Qt::Key_Help: + return "Help"; + case Qt::Key_Home: + return "Home"; + case Qt::Key_Insert: + return "Insert"; + case Qt::Key_Left: + return "Left"; + case Qt::Key_PageDown: + return "PageDown"; + case Qt::Key_PageUp: + return "PageUp"; + case Qt::Key_Pause: + return "Pause"; + case Qt::Key_Print: + return "PrintScreen"; + case Qt::Key_Right: + return "Right"; + case Qt::Key_Select: + return "Select"; + case Qt::Key_Up: + return "Up"; + // Standard says that DEL becomes U+007F. + case Qt::Key_Delete: + return "U+007F"; + case Qt::Key_Backspace: + return "U+0008"; + case Qt::Key_Tab: + return "U+0009"; + case Qt::Key_Backtab: + return "U+0009"; + default: + return String::format("U+%04X", toupper(keyCode)); } } @@ -144,35 +143,35 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad = false if (isKeypad) { switch (keycode) { case Qt::Key_0: - return VK_NUMPAD0; // (60) Numeric keypad 0 key + return VK_NUMPAD0; // (60) Numeric keypad 0 key case Qt::Key_1: - return VK_NUMPAD1; // (61) Numeric keypad 1 key + return VK_NUMPAD1; // (61) Numeric keypad 1 key case Qt::Key_2: return VK_NUMPAD2; // (62) Numeric keypad 2 key case Qt::Key_3: - return VK_NUMPAD3; // (63) Numeric keypad 3 key + return VK_NUMPAD3; // (63) Numeric keypad 3 key case Qt::Key_4: - return VK_NUMPAD4; // (64) Numeric keypad 4 key + return VK_NUMPAD4; // (64) Numeric keypad 4 key case Qt::Key_5: - return VK_NUMPAD5; // (65) Numeric keypad 5 key + return VK_NUMPAD5; // (65) Numeric keypad 5 key case Qt::Key_6: - return VK_NUMPAD6; // (66) Numeric keypad 6 key + return VK_NUMPAD6; // (66) Numeric keypad 6 key case Qt::Key_7: - return VK_NUMPAD7; // (67) Numeric keypad 7 key + return VK_NUMPAD7; // (67) Numeric keypad 7 key case Qt::Key_8: - return VK_NUMPAD8; // (68) Numeric keypad 8 key + return VK_NUMPAD8; // (68) Numeric keypad 8 key case Qt::Key_9: - return VK_NUMPAD9; // (69) Numeric keypad 9 key + return VK_NUMPAD9; // (69) Numeric keypad 9 key case Qt::Key_Asterisk: return VK_MULTIPLY; // (6A) Multiply key case Qt::Key_Plus: - return VK_ADD; // (6B) Add key + return VK_ADD; // (6B) Add key case Qt::Key_Minus: return VK_SUBTRACT; // (6D) Subtract key case Qt::Key_Period: - return VK_DECIMAL; // (6E) Decimal key + return VK_DECIMAL; // (6E) Decimal key case Qt::Key_Slash: - return VK_DIVIDE; // (6F) Divide key + return VK_DIVIDE; // (6F) Divide key case Qt::Key_PageUp: return VK_PRIOR; // (21) PAGE UP key case Qt::Key_PageDown: @@ -196,311 +195,310 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad = false } else switch (keycode) { - case Qt::Key_Backspace: - return VK_BACK; // (08) BACKSPACE key - case Qt::Key_Backtab: - case Qt::Key_Tab: - return VK_TAB; // (09) TAB key - case Qt::Key_Clear: - return VK_CLEAR; // (0C) CLEAR key - case Qt::Key_Enter: - case Qt::Key_Return: - return VK_RETURN; //(0D) Return key - case Qt::Key_Shift: - return VK_SHIFT; // (10) SHIFT key - case Qt::Key_Control: - return VK_CONTROL; // (11) CTRL key - case Qt::Key_Menu: - case Qt::Key_Alt: - return VK_MENU; // (12) ALT key + case Qt::Key_Backspace: + return VK_BACK; // (08) BACKSPACE key + case Qt::Key_Backtab: + case Qt::Key_Tab: + return VK_TAB; // (09) TAB key + case Qt::Key_Clear: + return VK_CLEAR; // (0C) CLEAR key + case Qt::Key_Enter: + case Qt::Key_Return: + return VK_RETURN; // (0D) Return key + case Qt::Key_Shift: + return VK_SHIFT; // (10) SHIFT key + case Qt::Key_Control: + return VK_CONTROL; // (11) CTRL key + case Qt::Key_Menu: + case Qt::Key_Alt: + return VK_MENU; // (12) ALT key - case Qt::Key_F1: - return VK_F1; - case Qt::Key_F2: - return VK_F2; - case Qt::Key_F3: - return VK_F3; - case Qt::Key_F4: - return VK_F4; - case Qt::Key_F5: - return VK_F5; - case Qt::Key_F6: - return VK_F6; - case Qt::Key_F7: - return VK_F7; - case Qt::Key_F8: - return VK_F8; - case Qt::Key_F9: - return VK_F9; - case Qt::Key_F10: - return VK_F10; - case Qt::Key_F11: - return VK_F11; - case Qt::Key_F12: - return VK_F12; - case Qt::Key_F13: - return VK_F13; - case Qt::Key_F14: - return VK_F14; - case Qt::Key_F15: - return VK_F15; - case Qt::Key_F16: - return VK_F16; - case Qt::Key_F17: - return VK_F17; - case Qt::Key_F18: - return VK_F18; - case Qt::Key_F19: - return VK_F19; - case Qt::Key_F20: - return VK_F20; - case Qt::Key_F21: - return VK_F21; - case Qt::Key_F22: - return VK_F22; - case Qt::Key_F23: - return VK_F23; - case Qt::Key_F24: - return VK_F24; + case Qt::Key_F1: + return VK_F1; + case Qt::Key_F2: + return VK_F2; + case Qt::Key_F3: + return VK_F3; + case Qt::Key_F4: + return VK_F4; + case Qt::Key_F5: + return VK_F5; + case Qt::Key_F6: + return VK_F6; + case Qt::Key_F7: + return VK_F7; + case Qt::Key_F8: + return VK_F8; + case Qt::Key_F9: + return VK_F9; + case Qt::Key_F10: + return VK_F10; + case Qt::Key_F11: + return VK_F11; + case Qt::Key_F12: + return VK_F12; + case Qt::Key_F13: + return VK_F13; + case Qt::Key_F14: + return VK_F14; + case Qt::Key_F15: + return VK_F15; + case Qt::Key_F16: + return VK_F16; + case Qt::Key_F17: + return VK_F17; + case Qt::Key_F18: + return VK_F18; + case Qt::Key_F19: + return VK_F19; + case Qt::Key_F20: + return VK_F20; + case Qt::Key_F21: + return VK_F21; + case Qt::Key_F22: + return VK_F22; + case Qt::Key_F23: + return VK_F23; + case Qt::Key_F24: + return VK_F24; - case Qt::Key_Pause: - return VK_PAUSE; // (13) PAUSE key - case Qt::Key_CapsLock: - return VK_CAPITAL; // (14) CAPS LOCK key - case Qt::Key_Kana_Lock: - case Qt::Key_Kana_Shift: - return VK_KANA; // (15) Input Method Editor (IME) Kana mode - case Qt::Key_Hangul: - return VK_HANGUL; // VK_HANGUL (15) IME Hangul mode - // VK_JUNJA (17) IME Junja mode - // VK_FINAL (18) IME final mode - case Qt::Key_Hangul_Hanja: - return VK_HANJA; // (19) IME Hanja mode - case Qt::Key_Kanji: - return VK_KANJI; // (19) IME Kanji mode - case Qt::Key_Escape: - return VK_ESCAPE; // (1B) ESC key - // VK_CONVERT (1C) IME convert - // VK_NONCONVERT (1D) IME nonconvert - // VK_ACCEPT (1E) IME accept - // VK_MODECHANGE (1F) IME mode change request - case Qt::Key_Space: - return VK_SPACE; // (20) SPACEBAR - case Qt::Key_PageUp: - return VK_PRIOR; // (21) PAGE UP key - case Qt::Key_PageDown: - return VK_NEXT; // (22) PAGE DOWN key - case Qt::Key_End: - return VK_END; // (23) END key - case Qt::Key_Home: - return VK_HOME; // (24) HOME key - case Qt::Key_Left: - return VK_LEFT; // (25) LEFT ARROW key - case Qt::Key_Up: - return VK_UP; // (26) UP ARROW key - case Qt::Key_Right: - return VK_RIGHT; // (27) RIGHT ARROW key - case Qt::Key_Down: - return VK_DOWN; // (28) DOWN ARROW key - case Qt::Key_Select: - return VK_SELECT; // (29) SELECT key - case Qt::Key_Print: - return VK_PRINT; // (2A) PRINT key - case Qt::Key_Execute: - return VK_EXECUTE;// (2B) EXECUTE key - //dunno on this - //case Qt::Key_PrintScreen: - // return VK_SNAPSHOT; // (2C) PRINT SCREEN key - case Qt::Key_Insert: - return VK_INSERT; // (2D) INS key - case Qt::Key_Delete: - return VK_DELETE; // (2E) DEL key - case Qt::Key_Help: - return VK_HELP; // (2F) HELP key - case Qt::Key_0: - case Qt::Key_ParenLeft: - return VK_0; // (30) 0) key - case Qt::Key_1: - return VK_1; // (31) 1 ! key - case Qt::Key_2: - case Qt::Key_At: - return VK_2; // (32) 2 & key - case Qt::Key_3: - case Qt::Key_NumberSign: - return VK_3; //case '3': case '#'; - case Qt::Key_4: - case Qt::Key_Dollar: // (34) 4 key '$'; - return VK_4; - case Qt::Key_5: - case Qt::Key_Percent: - return VK_5; // (35) 5 key '%' - case Qt::Key_6: - case Qt::Key_AsciiCircum: - return VK_6; // (36) 6 key '^' - case Qt::Key_7: - case Qt::Key_Ampersand: - return VK_7; // (37) 7 key case '&' - case Qt::Key_8: - case Qt::Key_Asterisk: - return VK_8; // (38) 8 key '*' - case Qt::Key_9: - case Qt::Key_ParenRight: - return VK_9; // (39) 9 key '(' - case Qt::Key_A: - return VK_A; // (41) A key case 'a': case 'A': return 0x41; - case Qt::Key_B: - return VK_B; // (42) B key case 'b': case 'B': return 0x42; - case Qt::Key_C: - return VK_C; // (43) C key case 'c': case 'C': return 0x43; - case Qt::Key_D: - return VK_D; // (44) D key case 'd': case 'D': return 0x44; - case Qt::Key_E: - return VK_E; // (45) E key case 'e': case 'E': return 0x45; - case Qt::Key_F: - return VK_F; // (46) F key case 'f': case 'F': return 0x46; - case Qt::Key_G: - return VK_G; // (47) G key case 'g': case 'G': return 0x47; - case Qt::Key_H: - return VK_H; // (48) H key case 'h': case 'H': return 0x48; - case Qt::Key_I: - return VK_I; // (49) I key case 'i': case 'I': return 0x49; - case Qt::Key_J: - return VK_J; // (4A) J key case 'j': case 'J': return 0x4A; - case Qt::Key_K: - return VK_K; // (4B) K key case 'k': case 'K': return 0x4B; - case Qt::Key_L: - return VK_L; // (4C) L key case 'l': case 'L': return 0x4C; - case Qt::Key_M: - return VK_M; // (4D) M key case 'm': case 'M': return 0x4D; - case Qt::Key_N: - return VK_N; // (4E) N key case 'n': case 'N': return 0x4E; - case Qt::Key_O: - return VK_O; // (4F) O key case 'o': case 'O': return 0x4F; - case Qt::Key_P: - return VK_P; // (50) P key case 'p': case 'P': return 0x50; - case Qt::Key_Q: - return VK_Q; // (51) Q key case 'q': case 'Q': return 0x51; - case Qt::Key_R: - return VK_R; // (52) R key case 'r': case 'R': return 0x52; - case Qt::Key_S: - return VK_S; // (53) S key case 's': case 'S': return 0x53; - case Qt::Key_T: - return VK_T; // (54) T key case 't': case 'T': return 0x54; - case Qt::Key_U: - return VK_U; // (55) U key case 'u': case 'U': return 0x55; - case Qt::Key_V: - return VK_V; // (56) V key case 'v': case 'V': return 0x56; - case Qt::Key_W: - return VK_W; // (57) W key case 'w': case 'W': return 0x57; - case Qt::Key_X: - return VK_X; // (58) X key case 'x': case 'X': return 0x58; - case Qt::Key_Y: - return VK_Y; // (59) Y key case 'y': case 'Y': return 0x59; - case Qt::Key_Z: - return VK_Z; // (5A) Z key case 'z': case 'Z': return 0x5A; - case Qt::Key_Meta: - return VK_LWIN; // (5B) Left Windows key (Microsoft Natural keyboard) - //case Qt::Key_Meta_R: FIXME: What to do here? + case Qt::Key_Pause: + return VK_PAUSE; // (13) PAUSE key + case Qt::Key_CapsLock: + return VK_CAPITAL; // (14) CAPS LOCK key + case Qt::Key_Kana_Lock: + case Qt::Key_Kana_Shift: + return VK_KANA; // (15) Input Method Editor (IME) Kana mode + case Qt::Key_Hangul: + return VK_HANGUL; // VK_HANGUL (15) IME Hangul mode + // VK_JUNJA (17) IME Junja mode + // VK_FINAL (18) IME final mode + case Qt::Key_Hangul_Hanja: + return VK_HANJA; // (19) IME Hanja mode + case Qt::Key_Kanji: + return VK_KANJI; // (19) IME Kanji mode + case Qt::Key_Escape: + return VK_ESCAPE; // (1B) ESC key + // VK_CONVERT (1C) IME convert + // VK_NONCONVERT (1D) IME nonconvert + // VK_ACCEPT (1E) IME accept + // VK_MODECHANGE (1F) IME mode change request + case Qt::Key_Space: + return VK_SPACE; // (20) SPACEBAR + case Qt::Key_PageUp: + return VK_PRIOR; // (21) PAGE UP key + case Qt::Key_PageDown: + return VK_NEXT; // (22) PAGE DOWN key + case Qt::Key_End: + return VK_END; // (23) END key + case Qt::Key_Home: + return VK_HOME; // (24) HOME key + case Qt::Key_Left: + return VK_LEFT; // (25) LEFT ARROW key + case Qt::Key_Up: + return VK_UP; // (26) UP ARROW key + case Qt::Key_Right: + return VK_RIGHT; // (27) RIGHT ARROW key + case Qt::Key_Down: + return VK_DOWN; // (28) DOWN ARROW key + case Qt::Key_Select: + return VK_SELECT; // (29) SELECT key + case Qt::Key_Print: + return VK_PRINT; // (2A) PRINT key + case Qt::Key_Execute: + return VK_EXECUTE; // (2B) EXECUTE key + // dunno on this + // case Qt::Key_PrintScreen: + // return VK_SNAPSHOT; // (2C) PRINT SCREEN key + case Qt::Key_Insert: + return VK_INSERT; // (2D) INS key + case Qt::Key_Delete: + return VK_DELETE; // (2E) DEL key + case Qt::Key_Help: + return VK_HELP; // (2F) HELP key + case Qt::Key_0: + case Qt::Key_ParenLeft: + return VK_0; // (30) 0) key + case Qt::Key_1: + return VK_1; // (31) 1 ! key + case Qt::Key_2: + case Qt::Key_At: + return VK_2; // (32) 2 & key + case Qt::Key_3: + case Qt::Key_NumberSign: + return VK_3; // case '3': case '#'; + case Qt::Key_4: + case Qt::Key_Dollar: // (34) 4 key '$'; + return VK_4; + case Qt::Key_5: + case Qt::Key_Percent: + return VK_5; // (35) 5 key '%' + case Qt::Key_6: + case Qt::Key_AsciiCircum: + return VK_6; // (36) 6 key '^' + case Qt::Key_7: + case Qt::Key_Ampersand: + return VK_7; // (37) 7 key case '&' + case Qt::Key_8: + case Qt::Key_Asterisk: + return VK_8; // (38) 8 key '*' + case Qt::Key_9: + case Qt::Key_ParenRight: + return VK_9; // (39) 9 key '(' + case Qt::Key_A: + return VK_A; // (41) A key case 'a': case 'A': return 0x41; + case Qt::Key_B: + return VK_B; // (42) B key case 'b': case 'B': return 0x42; + case Qt::Key_C: + return VK_C; // (43) C key case 'c': case 'C': return 0x43; + case Qt::Key_D: + return VK_D; // (44) D key case 'd': case 'D': return 0x44; + case Qt::Key_E: + return VK_E; // (45) E key case 'e': case 'E': return 0x45; + case Qt::Key_F: + return VK_F; // (46) F key case 'f': case 'F': return 0x46; + case Qt::Key_G: + return VK_G; // (47) G key case 'g': case 'G': return 0x47; + case Qt::Key_H: + return VK_H; // (48) H key case 'h': case 'H': return 0x48; + case Qt::Key_I: + return VK_I; // (49) I key case 'i': case 'I': return 0x49; + case Qt::Key_J: + return VK_J; // (4A) J key case 'j': case 'J': return 0x4A; + case Qt::Key_K: + return VK_K; // (4B) K key case 'k': case 'K': return 0x4B; + case Qt::Key_L: + return VK_L; // (4C) L key case 'l': case 'L': return 0x4C; + case Qt::Key_M: + return VK_M; // (4D) M key case 'm': case 'M': return 0x4D; + case Qt::Key_N: + return VK_N; // (4E) N key case 'n': case 'N': return 0x4E; + case Qt::Key_O: + return VK_O; // (4F) O key case 'o': case 'O': return 0x4F; + case Qt::Key_P: + return VK_P; // (50) P key case 'p': case 'P': return 0x50; + case Qt::Key_Q: + return VK_Q; // (51) Q key case 'q': case 'Q': return 0x51; + case Qt::Key_R: + return VK_R; // (52) R key case 'r': case 'R': return 0x52; + case Qt::Key_S: + return VK_S; // (53) S key case 's': case 'S': return 0x53; + case Qt::Key_T: + return VK_T; // (54) T key case 't': case 'T': return 0x54; + case Qt::Key_U: + return VK_U; // (55) U key case 'u': case 'U': return 0x55; + case Qt::Key_V: + return VK_V; // (56) V key case 'v': case 'V': return 0x56; + case Qt::Key_W: + return VK_W; // (57) W key case 'w': case 'W': return 0x57; + case Qt::Key_X: + return VK_X; // (58) X key case 'x': case 'X': return 0x58; + case Qt::Key_Y: + return VK_Y; // (59) Y key case 'y': case 'Y': return 0x59; + case Qt::Key_Z: + return VK_Z; // (5A) Z key case 'z': case 'Z': return 0x5A; + case Qt::Key_Meta: + return VK_LWIN; // (5B) Left Windows key (Microsoft Natural keyboard) + // case Qt::Key_Meta_R: FIXME: What to do here? // return VK_RWIN; // (5C) Right Windows key (Natural keyboard) - // VK_APPS (5D) Applications key (Natural keyboard) - // VK_SLEEP (5F) Computer Sleep key - // VK_SEPARATOR (6C) Separator key - // VK_SUBTRACT (6D) Subtract key - // VK_DECIMAL (6E) Decimal key - // VK_DIVIDE (6F) Divide key - // handled by key code above + // VK_APPS (5D) Applications key (Natural keyboard) + // VK_SLEEP (5F) Computer Sleep key + // VK_SEPARATOR (6C) Separator key + // VK_SUBTRACT (6D) Subtract key + // VK_DECIMAL (6E) Decimal key + // VK_DIVIDE (6F) Divide key + // handled by key code above - case Qt::Key_NumLock: - return VK_NUMLOCK; // (90) NUM LOCK key + case Qt::Key_NumLock: + return VK_NUMLOCK; // (90) NUM LOCK key - case Qt::Key_ScrollLock: - return VK_SCROLL; // (91) SCROLL LOCK key + case Qt::Key_ScrollLock: + return VK_SCROLL; // (91) SCROLL LOCK key - // VK_LSHIFT (A0) Left SHIFT key - // VK_RSHIFT (A1) Right SHIFT key - // VK_LCONTROL (A2) Left CONTROL key - // VK_RCONTROL (A3) Right CONTROL key - // VK_LMENU (A4) Left MENU key - // VK_RMENU (A5) Right MENU key - // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key - // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key - // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key - // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key - // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key - // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key - // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key - // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key - // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key - // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key - // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key - // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key - // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key - // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key - // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key - // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key - // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key - // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key + // VK_LSHIFT (A0) Left SHIFT key + // VK_RSHIFT (A1) Right SHIFT key + // VK_LCONTROL (A2) Left CONTROL key + // VK_RCONTROL (A3) Right CONTROL key + // VK_LMENU (A4) Left MENU key + // VK_RMENU (A5) Right MENU key + // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key + // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key + // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key + // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key + // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key + // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key + // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key + // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key + // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key + // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key + // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key + // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key + // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key + // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key + // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key + // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key + // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key + // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key - // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key - case Qt::Key_Semicolon: - case Qt::Key_Colon: - return VK_OEM_1; //case ';': case ':': return 0xBA; - // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key - case Qt::Key_Plus: - case Qt::Key_Equal: - return VK_OEM_PLUS; //case '=': case '+': return 0xBB; - // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key - case Qt::Key_Comma: - case Qt::Key_Less: - return VK_OEM_COMMA; //case ',': case '<': return 0xBC; - // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key - case Qt::Key_Minus: - case Qt::Key_Underscore: - return VK_OEM_MINUS; //case '-': case '_': return 0xBD; - // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key - case Qt::Key_Period: - case Qt::Key_Greater: - return VK_OEM_PERIOD; //case '.': case '>': return 0xBE; - // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key - case Qt::Key_Slash: - case Qt::Key_Question: - return VK_OEM_2; //case '/': case '?': return 0xBF; - // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key - case Qt::Key_AsciiTilde: - case Qt::Key_QuoteLeft: - return VK_OEM_3; //case '`': case '~': return 0xC0; - // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key - case Qt::Key_BracketLeft: - case Qt::Key_BraceLeft: - return VK_OEM_4; //case '[': case '{': return 0xDB; - // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key - case Qt::Key_Backslash: - case Qt::Key_Bar: - return VK_OEM_5; //case '\\': case '|': return 0xDC; - // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key - case Qt::Key_BracketRight: - case Qt::Key_BraceRight: - return VK_OEM_6; // case ']': case '}': return 0xDD; - // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key - case Qt::Key_QuoteDbl: - return VK_OEM_7; // case '\'': case '"': return 0xDE; - // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. - // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard - // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key - // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP - // VK_ATTN (F6) Attn key - // VK_CRSEL (F7) CrSel key - // VK_EXSEL (F8) ExSel key - // VK_EREOF (F9) Erase EOF key - // VK_PLAY (FA) Play key - // VK_ZOOM (FB) Zoom key - // VK_NONAME (FC) Reserved for future use - // VK_PA1 (FD) PA1 key - // VK_OEM_CLEAR (FE) Clear key - default: - return 0; + // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key + case Qt::Key_Semicolon: + case Qt::Key_Colon: + return VK_OEM_1; // case ';': case ':': return 0xBA; + // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key + case Qt::Key_Plus: + case Qt::Key_Equal: + return VK_OEM_PLUS; // case '=': case '+': return 0xBB; + // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key + case Qt::Key_Comma: + case Qt::Key_Less: + return VK_OEM_COMMA; // case ',': case '<': return 0xBC; + // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key + case Qt::Key_Minus: + case Qt::Key_Underscore: + return VK_OEM_MINUS; // case '-': case '_': return 0xBD; + // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key + case Qt::Key_Period: + case Qt::Key_Greater: + return VK_OEM_PERIOD; // case '.': case '>': return 0xBE; + // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key + case Qt::Key_Slash: + case Qt::Key_Question: + return VK_OEM_2; // case '/': case '?': return 0xBF; + // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key + case Qt::Key_AsciiTilde: + case Qt::Key_QuoteLeft: + return VK_OEM_3; // case '`': case '~': return 0xC0; + // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key + case Qt::Key_BracketLeft: + case Qt::Key_BraceLeft: + return VK_OEM_4; // case '[': case '{': return 0xDB; + // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key + case Qt::Key_Backslash: + case Qt::Key_Bar: + return VK_OEM_5; // case '\\': case '|': return 0xDC; + // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key + case Qt::Key_BracketRight: + case Qt::Key_BraceRight: + return VK_OEM_6; // case ']': case '}': return 0xDD; + // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key + case Qt::Key_QuoteDbl: + return VK_OEM_7; // case '\'': case '"': return 0xDE; + // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. + // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard + // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key + // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP + // VK_ATTN (F6) Attn key + // VK_CRSEL (F7) CrSel key + // VK_EXSEL (F8) ExSel key + // VK_EREOF (F9) Erase EOF key + // VK_PLAY (FA) Play key + // VK_ZOOM (FB) Zoom key + // VK_NONAME (FC) Reserved for future use + // VK_PA1 (FD) PA1 key + // VK_OEM_CLEAR (FE) Clear key + default: + return 0; } - } PlatformKeyboardEvent::PlatformKeyboardEvent(QKeyEvent* event) @@ -511,13 +509,13 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(QKeyEvent* event) m_unmodifiedText = event->text(); // FIXME: not correct m_keyIdentifier = keyIdentifierForQtKeyCode(event->key()); m_autoRepeat = event->isAutoRepeat(); - m_ctrlKey = (state & Qt::ControlModifier) != 0; - m_altKey = (state & Qt::AltModifier) != 0; - m_metaKey = (state & Qt::MetaModifier) != 0; - m_isKeypad = (state & Qt::KeypadModifier) != 0; + m_ctrlKey = (state & Qt::ControlModifier); + m_altKey = (state & Qt::AltModifier); + m_metaKey = (state & Qt::MetaModifier); + m_isKeypad = (state & Qt::KeypadModifier); m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event->key(), m_isKeypad); m_nativeVirtualKeyCode = event->nativeVirtualKey(); - m_shiftKey = (state & Qt::ShiftModifier) != 0 || event->key() == Qt::Key_Backtab; // Simulate Shift+Tab with Key_Backtab + m_shiftKey = (state & Qt::ShiftModifier) || event->key() == Qt::Key_Backtab; // Simulate Shift+Tab with Key_Backtab m_qtEvent = event; } diff --git a/WebCore/platform/qt/PlatformMouseEventQt.cpp b/WebCore/platform/qt/PlatformMouseEventQt.cpp index e486e68..a8956bf 100644 --- a/WebCore/platform/qt/PlatformMouseEventQt.cpp +++ b/WebCore/platform/qt/PlatformMouseEventQt.cpp @@ -28,10 +28,9 @@ #include "config.h" #include "PlatformMouseEvent.h" -#include <wtf/CurrentTime.h> - -#include <QMouseEvent> #include <QGraphicsSceneMouseEvent> +#include <QMouseEvent> +#include <wtf/CurrentTime.h> namespace WebCore { @@ -65,10 +64,10 @@ PlatformMouseEvent::PlatformMouseEvent(QGraphicsSceneMouseEvent* event, int clic m_button = NoButton; m_clickCount = clickCount; - m_shiftKey = (event->modifiers() & Qt::ShiftModifier) != 0; - m_ctrlKey = (event->modifiers() & Qt::ControlModifier) != 0; - m_altKey = (event->modifiers() & Qt::AltModifier) != 0; - m_metaKey = (event->modifiers() & Qt::MetaModifier) != 0; + m_shiftKey = (event->modifiers() & Qt::ShiftModifier); + m_ctrlKey = (event->modifiers() & Qt::ControlModifier); + m_altKey = (event->modifiers() & Qt::AltModifier); + m_metaKey = (event->modifiers() & Qt::MetaModifier); } PlatformMouseEvent::PlatformMouseEvent(QInputEvent* event, int clickCount) @@ -94,7 +93,7 @@ PlatformMouseEvent::PlatformMouseEvent(QInputEvent* event, int clickCount) #ifndef QT_NO_CONTEXTMENU case QEvent::ContextMenu: { m_eventType = MouseEventPressed; - QContextMenuEvent *ce = static_cast<QContextMenuEvent *>(event); + QContextMenuEvent* ce = static_cast<QContextMenuEvent*>(event); m_position = IntPoint(ce->pos()); m_globalPosition = IntPoint(ce->globalPos()); m_button = RightButton; @@ -120,10 +119,10 @@ PlatformMouseEvent::PlatformMouseEvent(QInputEvent* event, int clickCount) } m_clickCount = clickCount; - m_shiftKey = (event->modifiers() & Qt::ShiftModifier) != 0; - m_ctrlKey = (event->modifiers() & Qt::ControlModifier) != 0; - m_altKey = (event->modifiers() & Qt::AltModifier) != 0; - m_metaKey = (event->modifiers() & Qt::MetaModifier) != 0; + m_shiftKey = (event->modifiers() & Qt::ShiftModifier); + m_ctrlKey = (event->modifiers() & Qt::ControlModifier); + m_altKey = (event->modifiers() & Qt::AltModifier); + m_metaKey = (event->modifiers() & Qt::MetaModifier); } } diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp index ee66a35..9319493 100644 --- a/WebCore/platform/qt/RenderThemeQt.cpp +++ b/WebCore/platform/qt/RenderThemeQt.cpp @@ -47,16 +47,16 @@ #endif #include "NotImplemented.h" #include "Page.h" -#include "QtStyleOptionWebComboBox.h" #include "QWebPageClient.h" +#include "QtStyleOptionWebComboBox.h" #include "RenderBox.h" #if ENABLE(PROGRESS_TAG) #include "RenderProgress.h" #endif #include "RenderSlider.h" #include "RenderTheme.h" -#include "TimeRanges.h" #include "ScrollbarThemeQt.h" +#include "TimeRanges.h" #include "UserAgentStyleSheets.h" #include "qwebpage.h" @@ -727,6 +727,9 @@ void RenderThemeQt::adjustProgressBarStyle(CSSStyleSelector*, RenderStyle* style bool RenderThemeQt::paintProgressBar(RenderObject* o, const RenderObject::PaintInfo& pi, const IntRect& r) { + if (!o->isProgress()) + return true; + StylePainter p(this, pi); if (!p.isValid()) return true; diff --git a/WebCore/platform/qt/ScreenQt.cpp b/WebCore/platform/qt/ScreenQt.cpp index def1995..d648c53 100644 --- a/WebCore/platform/qt/ScreenQt.cpp +++ b/WebCore/platform/qt/ScreenQt.cpp @@ -23,18 +23,18 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "Screen.h" -#include "Page.h" +#include "FloatRect.h" #include "Frame.h" #include "FrameView.h" -#include "Widget.h" #include "IntRect.h" -#include "FloatRect.h" +#include "Page.h" +#include "Widget.h" #include <QApplication> #include <QDesktopWidget> diff --git a/WebCore/platform/qt/ScrollbarQt.cpp b/WebCore/platform/qt/ScrollbarQt.cpp index 8eac15f..70aa5db 100644 --- a/WebCore/platform/qt/ScrollbarQt.cpp +++ b/WebCore/platform/qt/ScrollbarQt.cpp @@ -29,8 +29,8 @@ #include "Scrollbar.h" #include "EventHandler.h" -#include "FrameView.h" #include "Frame.h" +#include "FrameView.h" #include "GraphicsContext.h" #include "IntRect.h" #include "PlatformMouseEvent.h" @@ -38,9 +38,9 @@ #include <QApplication> #include <QDebug> +#include <QMenu> #include <QPainter> #include <QStyle> -#include <QMenu> using namespace std; diff --git a/WebCore/platform/qt/ScrollbarThemeQt.cpp b/WebCore/platform/qt/ScrollbarThemeQt.cpp index eb2d934..67226b0 100644 --- a/WebCore/platform/qt/ScrollbarThemeQt.cpp +++ b/WebCore/platform/qt/ScrollbarThemeQt.cpp @@ -22,7 +22,7 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -31,15 +31,15 @@ #include "GraphicsContext.h" #include "PlatformMouseEvent.h" #include "RenderThemeQt.h" -#include "Scrollbar.h" #include "ScrollView.h" +#include "Scrollbar.h" #include <QApplication> #include <QDebug> +#include <QMenu> #include <QPainter> #include <QStyle> #include <QStyleOptionSlider> -#include <QMenu> namespace WebCore { @@ -56,20 +56,20 @@ ScrollbarThemeQt::~ScrollbarThemeQt() static QStyle::SubControl scPart(const ScrollbarPart& part) { switch (part) { - case NoPart: - return QStyle::SC_None; - case BackButtonStartPart: - case BackButtonEndPart: - return QStyle::SC_ScrollBarSubLine; - case BackTrackPart: - return QStyle::SC_ScrollBarSubPage; - case ThumbPart: - return QStyle::SC_ScrollBarSlider; - case ForwardTrackPart: - return QStyle::SC_ScrollBarAddPage; - case ForwardButtonStartPart: - case ForwardButtonEndPart: - return QStyle::SC_ScrollBarAddLine; + case NoPart: + return QStyle::SC_None; + case BackButtonStartPart: + case BackButtonEndPart: + return QStyle::SC_ScrollBarSubLine; + case BackTrackPart: + return QStyle::SC_ScrollBarSubPage; + case ThumbPart: + return QStyle::SC_ScrollBarSlider; + case ForwardTrackPart: + return QStyle::SC_ScrollBarAddPage; + case ForwardButtonStartPart: + case ForwardButtonEndPart: + return QStyle::SC_ScrollBarAddLine; } return QStyle::SC_None; @@ -78,18 +78,18 @@ static QStyle::SubControl scPart(const ScrollbarPart& part) static ScrollbarPart scrollbarPart(const QStyle::SubControl& sc) { switch (sc) { - case QStyle::SC_None: - return NoPart; - case QStyle::SC_ScrollBarSubLine: - return BackButtonStartPart; - case QStyle::SC_ScrollBarSubPage: - return BackTrackPart; - case QStyle::SC_ScrollBarSlider: - return ThumbPart; - case QStyle::SC_ScrollBarAddPage: - return ForwardTrackPart; - case QStyle::SC_ScrollBarAddLine: - return ForwardButtonStartPart; + case QStyle::SC_None: + return NoPart; + case QStyle::SC_ScrollBarSubLine: + return BackButtonStartPart; + case QStyle::SC_ScrollBarSubPage: + return BackTrackPart; + case QStyle::SC_ScrollBarSlider: + return ThumbPart; + case QStyle::SC_ScrollBarAddPage: + return ForwardTrackPart; + case QStyle::SC_ScrollBarAddLine: + return ForwardButtonStartPart; } return NoPart; } @@ -122,9 +122,9 @@ static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widg ScrollbarPart hoveredPart = scrollbar->hoveredPart(); if (pressedPart != NoPart) { opt.activeSubControls = scPart(scrollbar->pressedPart()); - if (pressedPart == BackButtonStartPart || pressedPart == ForwardButtonStartPart || - pressedPart == BackButtonEndPart || pressedPart == ForwardButtonEndPart || - pressedPart == ThumbPart) + if (pressedPart == BackButtonStartPart || pressedPart == ForwardButtonStartPart + || pressedPart == BackButtonEndPart || pressedPart == ForwardButtonEndPart + || pressedPart == ThumbPart) opt.state |= QStyle::State_Sunken; } else opt.activeSubControls = scPart(hoveredPart); diff --git a/WebCore/platform/qt/SharedTimerQt.cpp b/WebCore/platform/qt/SharedTimerQt.cpp index 7c0fd05..8a6bd81 100644 --- a/WebCore/platform/qt/SharedTimerQt.cpp +++ b/WebCore/platform/qt/SharedTimerQt.cpp @@ -24,18 +24,17 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" -#include <wtf/CurrentTime.h> - #include <QBasicTimer> #include <QCoreApplication> #include <QDebug> #include <QPointer> +#include <wtf/CurrentTime.h> namespace WebCore { diff --git a/WebCore/platform/qt/SoundQt.cpp b/WebCore/platform/qt/SoundQt.cpp index 0996328..bf9e142 100644 --- a/WebCore/platform/qt/SoundQt.cpp +++ b/WebCore/platform/qt/SoundQt.cpp @@ -26,11 +26,10 @@ */ #include "config.h" +#include "Sound.h" #include <QApplication> -#include "Sound.h" - namespace WebCore { void systemBeep() diff --git a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp index 432bd2b..51e25b8 100644 --- a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp +++ b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp @@ -33,27 +33,21 @@ #include "config.h" #include "AXObjectCache.h" -#include "DNS.h" #include "CachedResource.h" #include "CookieJar.h" #include "Cursor.h" +#include "DNS.h" +#include "FTPDirectoryDocument.h" +#include "FileSystem.h" #include "Font.h" #include "Frame.h" #include "FrameLoader.h" -#include "FTPDirectoryDocument.h" -#include "IntPoint.h" -#include "Widget.h" -#include "GraphicsContext.h" -#include "Cursor.h" -#include "loader.h" -#include "FileSystem.h" #include "FrameView.h" #include "GraphicsContext.h" #include "IconLoader.h" #include "IntPoint.h" #include "KURL.h" #include "Language.h" -#include "loader.h" #include "LocalizedStrings.h" #include "Node.h" #include "NotImplemented.h" @@ -67,9 +61,11 @@ #include "SystemTime.h" #include "TextBoundaries.h" #include "Widget.h" +#include "loader.h" + +#include <float.h> #include <stdio.h> #include <stdlib.h> -#include <float.h> #include <wtf/text/CString.h> using namespace WebCore; diff --git a/WebCore/platform/qt/WheelEventQt.cpp b/WebCore/platform/qt/WheelEventQt.cpp index 9349c70..57a7ebc 100644 --- a/WebCore/platform/qt/WheelEventQt.cpp +++ b/WebCore/platform/qt/WheelEventQt.cpp @@ -18,14 +18,15 @@ */ #include "config.h" -#include "PlatformWheelEvent.h" +#include "WheelEvent.h" #include "PlatformMouseEvent.h" +#include "PlatformWheelEvent.h" #include "Scrollbar.h" -#include <qapplication.h> -#include <QWheelEvent> #include <QGraphicsSceneWheelEvent> +#include <QWheelEvent> +#include <qapplication.h> namespace WebCore { @@ -57,11 +58,7 @@ void PlatformWheelEvent::applyDelta(int delta, Qt::Orientation orientation) } PlatformWheelEvent::PlatformWheelEvent(QGraphicsSceneWheelEvent* e) -#ifdef QT_NO_WHEELEVENT -{ - Q_UNUSED(e); -} -#else +#ifndef QT_NO_WHEELEVENT : m_position(e->pos().toPoint()) , m_globalPosition(e->screenPos()) , m_granularity(ScrollByPixelWheelEvent) @@ -70,17 +67,17 @@ PlatformWheelEvent::PlatformWheelEvent(QGraphicsSceneWheelEvent* e) , m_ctrlKey(e->modifiers() & Qt::ControlModifier) , m_altKey(e->modifiers() & Qt::AltModifier) , m_metaKey(e->modifiers() & Qt::MetaModifier) +#endif { +#ifndef QT_NO_WHEELEVENT applyDelta(e->delta(), e->orientation()); +#else + Q_UNUSED(e); +#endif } -#endif // QT_NO_WHEELEVENT PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e) -#ifdef QT_NO_WHEELEVENT -{ - Q_UNUSED(e); -} -#else +#ifndef QT_NO_WHEELEVENT : m_position(e->pos()) , m_globalPosition(e->globalPos()) , m_granularity(ScrollByPixelWheelEvent) @@ -89,9 +86,13 @@ PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e) , m_ctrlKey(e->modifiers() & Qt::ControlModifier) , m_altKey(e->modifiers() & Qt::AltModifier) , m_metaKey(e->modifiers() & Qt::MetaModifier) +#endif { +#ifndef QT_NO_WHEELEVENT applyDelta(e->delta(), e->orientation()); +#else + Q_UNUSED(e); +#endif } -#endif // QT_NO_WHEELEVENT } // namespace WebCore diff --git a/WebCore/platform/qt/WidgetQt.cpp b/WebCore/platform/qt/WidgetQt.cpp index 43252a8..00a58a4 100644 --- a/WebCore/platform/qt/WidgetQt.cpp +++ b/WebCore/platform/qt/WidgetQt.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Dirk Mueller <mueller@kde.org> - * Copyright (C) 2006 George Stiakos <staikos@kde.org> + * Copyright (C) 2006 George Staikos <staikos@kde.org> * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2008 Holger Hans Peter Freyther @@ -37,19 +37,18 @@ #include "GraphicsContext.h" #include "HostWindow.h" #include "IntRect.h" -#include "ScrollView.h" #include "NotImplemented.h" #include "QWebPageClient.h" +#include "ScrollView.h" #include "qwebframe.h" #include "qwebframe_p.h" #include "qwebpage.h" #include <QCoreApplication> -#include <QPainter> -#include <QPaintEngine> - #include <QDebug> +#include <QPaintEngine> +#include <QPainter> namespace WebCore { |