summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/qt
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/platform/qt
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/platform/qt')
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp2
-rw-r--r--WebCore/platform/qt/CookieJarQt.cpp16
-rw-r--r--WebCore/platform/qt/FileChooserQt.cpp22
-rw-r--r--WebCore/platform/qt/FileSystemQt.cpp4
-rw-r--r--WebCore/platform/qt/KeyboardCodes.h8
-rw-r--r--WebCore/platform/qt/Localizations.cpp5
-rw-r--r--WebCore/platform/qt/LoggingQt.cpp8
-rw-r--r--WebCore/platform/qt/MIMETypeRegistryQt.cpp3
-rw-r--r--WebCore/platform/qt/PlatformMouseEventQt.cpp4
-rw-r--r--WebCore/platform/qt/PlatformScreenQt.cpp11
-rw-r--r--WebCore/platform/qt/QWebPopup.cpp2
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp33
-rw-r--r--WebCore/platform/qt/RenderThemeQt.h6
-rw-r--r--WebCore/platform/qt/ScrollbarQt.cpp3
-rw-r--r--WebCore/platform/qt/ScrollbarThemeQt.cpp13
-rw-r--r--WebCore/platform/qt/SharedTimerQt.cpp88
-rw-r--r--WebCore/platform/qt/SharedTimerQt.h91
-rw-r--r--WebCore/platform/qt/SystemTimeQt.cpp46
-rw-r--r--WebCore/platform/qt/TemporaryLinkStubs.cpp17
-rw-r--r--WebCore/platform/qt/WebCoreResources.qrc5
-rw-r--r--WebCore/platform/qt/WheelEventQt.cpp4
-rw-r--r--WebCore/platform/qt/WidgetQt.cpp4
-rw-r--r--WebCore/platform/qt/html4-adjustments-qt.css96
23 files changed, 213 insertions, 278 deletions
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index b0a1402..1bde10b 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -242,7 +242,7 @@ void ClipboardQt::declareAndWriteDragImage(Element* element, const KURL& url, co
return;
QPixmap *pixmap = cachedImage->image()->nativeImageForCurrentFrame();
if (pixmap)
- m_writableData->setImageData(pixmap);
+ m_writableData->setImageData(*pixmap);
AtomicString imageURL = element->getAttribute(HTMLNames::srcAttr);
if (imageURL.isEmpty())
diff --git a/WebCore/platform/qt/CookieJarQt.cpp b/WebCore/platform/qt/CookieJarQt.cpp
index 43be75a..0d24c7e 100644
--- a/WebCore/platform/qt/CookieJarQt.cpp
+++ b/WebCore/platform/qt/CookieJarQt.cpp
@@ -71,6 +71,15 @@ void setCookies(Document* document, const KURL& url, const KURL& policyURL, cons
return;
QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toAscii());
+#if QT_VERSION >= 0x040500
+ QList<QNetworkCookie>::Iterator it = cookies.begin();
+ while (it != cookies.end()) {
+ if (it->isHttpOnly())
+ it = cookies.erase(it);
+ else
+ ++it;
+ }
+#endif
jar->setCookiesFromUrl(cookies, p);
#else
QCookieJar::cookieJar()->setCookies(u, p, (QString)value);
@@ -90,9 +99,14 @@ String cookies(const Document* document, const KURL& url)
return String();
QStringList resultCookies;
- foreach (QNetworkCookie networkCookie, cookies)
+ foreach (QNetworkCookie networkCookie, cookies) {
+#if QT_VERSION >= 0x040500
+ if (networkCookie.isHttpOnly())
+ continue;
+#endif
resultCookies.append(QString::fromAscii(
networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));
+ }
return resultCookies.join(QLatin1String("; "));
#else
diff --git a/WebCore/platform/qt/FileChooserQt.cpp b/WebCore/platform/qt/FileChooserQt.cpp
index b468dbe..307876c 100644
--- a/WebCore/platform/qt/FileChooserQt.cpp
+++ b/WebCore/platform/qt/FileChooserQt.cpp
@@ -21,15 +21,33 @@
#include "config.h"
#include "FileChooser.h"
+#include "LocalizedStrings.h"
#include "Font.h"
+#include <QCoreApplication>
#include <QFontMetrics>
namespace WebCore {
String FileChooser::basenameForWidth(const Font& f, int width) const
{
- QFontMetrics fm(f.font());
- return fm.elidedText(m_filenames[0], Qt::ElideLeft, width);
+ if (width <= 0)
+ return String();
+
+ String string;
+ if (m_filenames.isEmpty())
+ string = fileButtonNoFileSelectedLabel();
+ else if (m_filenames.size() == 1) {
+ String fname = m_filenames[0];
+ QFontMetrics fm(f.font());
+ string = fm.elidedText(fname, Qt::ElideLeft, width);
+ } else {
+ int n = m_filenames.size();
+ string = QCoreApplication::translate("QWebPage", "%n file(s)",
+ "number of chosen file",
+ QCoreApplication::CodecForTr, n);
+ }
+
+ return string;
}
}
diff --git a/WebCore/platform/qt/FileSystemQt.cpp b/WebCore/platform/qt/FileSystemQt.cpp
index 6b56070..6dbe464 100644
--- a/WebCore/platform/qt/FileSystemQt.cpp
+++ b/WebCore/platform/qt/FileSystemQt.cpp
@@ -118,7 +118,7 @@ Vector<String> listDirectory(const String& path, const String& filter)
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
{
- QFile *temp = new QTemporaryFile(QString(prefix));
+ QFile *temp = new QTemporaryFile(QLatin1String(prefix));
if (temp->open(QIODevice::ReadWrite)) {
handle = temp;
return String(temp->fileName()).utf8();
@@ -163,7 +163,7 @@ bool unloadModule(PlatformModule module)
}
#endif
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN)
bool unloadModule(PlatformModule module)
{
return ::FreeLibrary(module);
diff --git a/WebCore/platform/qt/KeyboardCodes.h b/WebCore/platform/qt/KeyboardCodes.h
index 21d3c67..61bc9fe 100644
--- a/WebCore/platform/qt/KeyboardCodes.h
+++ b/WebCore/platform/qt/KeyboardCodes.h
@@ -472,6 +472,10 @@ const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
// VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
+#endif // !PLATFORM(WIN_OS)
+
+#if !PLATFORM(WIN_OS) || PLATFORM(WIN_CE)
+
// VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
const int VK_OEM_1 = 0xBA;
@@ -508,6 +512,10 @@ const int VK_OEM_7 = 0xDE;
// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
const int VK_OEM_8 = 0xDF;
+#endif // !PLATFORM(WIN_OS) || PLATFORM(WIN_CE)
+
+#if !PLATFORM(WIN_OS)
+
// VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
const int VK_OEM_102 = 0xE2;
diff --git a/WebCore/platform/qt/Localizations.cpp b/WebCore/platform/qt/Localizations.cpp
index b49b880..cb805f9 100644
--- a/WebCore/platform/qt/Localizations.cpp
+++ b/WebCore/platform/qt/Localizations.cpp
@@ -233,6 +233,11 @@ String contextMenuItemTagWritingDirectionMenu()
return QCoreApplication::translate("QWebPage", "Direction", "Writing direction context sub-menu item");
}
+String contextMenuItemTagTextDirectionMenu()
+{
+ return QCoreApplication::translate("QWebPage", "Text Direction", "Text direction context sub-menu item");
+}
+
String contextMenuItemTagDefaultDirection()
{
return QCoreApplication::translate("QWebPage", "Default", "Default writing direction context menu item");
diff --git a/WebCore/platform/qt/LoggingQt.cpp b/WebCore/platform/qt/LoggingQt.cpp
index 5f6720a..b76c46e 100644
--- a/WebCore/platform/qt/LoggingQt.cpp
+++ b/WebCore/platform/qt/LoggingQt.cpp
@@ -64,18 +64,18 @@ void InitializeLoggingChannelsIfNecessary()
haveInitializedLoggingChannels = true;
- QString loggingEnv = qgetenv("QT_WEBKIT_LOG");
+ QByteArray loggingEnv = qgetenv("QT_WEBKIT_LOG");
if (loggingEnv.isEmpty())
return;
#if defined(NDEBUG)
qWarning("This is a release build. Setting QT_WEBKIT_LOG will have no effect.");
#else
- QStringList channels = loggingEnv.split(",");
- QStringListIterator iter(channels);
+ QList<QByteArray> channels = loggingEnv.split(',');
+ QListIterator<QByteArray> iter(channels);
while (iter.hasNext()) {
- QString channelName = iter.next();
+ QByteArray channelName = iter.next();
WTFLogChannel* channel = getChannelFromName(channelName);
if (!channel) continue;
channel->state = WTFLogChannelOn;
diff --git a/WebCore/platform/qt/MIMETypeRegistryQt.cpp b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
index 9f4a786..2b5968a 100644
--- a/WebCore/platform/qt/MIMETypeRegistryQt.cpp
+++ b/WebCore/platform/qt/MIMETypeRegistryQt.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2006 Zack Rusin <zack@kde.org>
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -62,6 +63,8 @@ static const ExtensionMap extensionMap [] = {
{ "xpm", "image/x-xpm" },
{ "xsl", "text/xsl" },
{ "xhtml", "application/xhtml+xml" },
+ { "wml", "text/vnd.wap.wml" },
+ { "wmlc", "application/vnd.wap.wmlc" },
{ 0, 0 }
};
diff --git a/WebCore/platform/qt/PlatformMouseEventQt.cpp b/WebCore/platform/qt/PlatformMouseEventQt.cpp
index afc7452..ba7a4ad 100644
--- a/WebCore/platform/qt/PlatformMouseEventQt.cpp
+++ b/WebCore/platform/qt/PlatformMouseEventQt.cpp
@@ -28,7 +28,7 @@
#include "config.h"
#include "PlatformMouseEvent.h"
-#include "SystemTime.h"
+#include <wtf/CurrentTime.h>
#include <QMouseEvent>
@@ -36,7 +36,7 @@ namespace WebCore {
PlatformMouseEvent::PlatformMouseEvent(QInputEvent* event, int clickCount)
{
- m_timestamp = WebCore::currentTime();
+ m_timestamp = WTF::currentTime();
QMouseEvent *me = 0;
diff --git a/WebCore/platform/qt/PlatformScreenQt.cpp b/WebCore/platform/qt/PlatformScreenQt.cpp
index 5bc86d0..5dc0963 100644
--- a/WebCore/platform/qt/PlatformScreenQt.cpp
+++ b/WebCore/platform/qt/PlatformScreenQt.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Holger Hans Peter Freyther
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,34 +44,34 @@ namespace WebCore {
int screenDepth(Widget* w)
{
QDesktopWidget* d = QApplication::desktop();
- QWidget *view = w->root()->hostWindow()->platformWindow();
+ QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
int screenNumber = view ? d->screenNumber(view) : 0;
return d->screen(screenNumber)->depth();
}
int screenDepthPerComponent(Widget* w)
{
- QWidget *view = w->root()->hostWindow()->platformWindow();
+ QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
return view ? view->depth() : QApplication::desktop()->screen(0)->depth();
}
bool screenIsMonochrome(Widget* w)
{
QDesktopWidget* d = QApplication::desktop();
- QWidget *view = w->root()->hostWindow()->platformWindow();
+ QWidget *view = w ? w->root()->hostWindow()->platformWindow(): 0;
int screenNumber = view ? d->screenNumber(view) : 0;
return d->screen(screenNumber)->numColors() < 2;
}
FloatRect screenRect(Widget* w)
{
- QRect r = QApplication::desktop()->screenGeometry(w->root()->hostWindow()->platformWindow());
+ QRect r = QApplication::desktop()->screenGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
return FloatRect(r.x(), r.y(), r.width(), r.height());
}
FloatRect screenAvailableRect(Widget* w)
{
- QRect r = QApplication::desktop()->availableGeometry(w->root()->hostWindow()->platformWindow());
+ QRect r = QApplication::desktop()->availableGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
return FloatRect(r.x(), r.y(), r.width(), r.height());
}
diff --git a/WebCore/platform/qt/QWebPopup.cpp b/WebCore/platform/qt/QWebPopup.cpp
index ae5c24e..d463ddf 100644
--- a/WebCore/platform/qt/QWebPopup.cpp
+++ b/WebCore/platform/qt/QWebPopup.cpp
@@ -35,7 +35,7 @@ QWebPopup::QWebPopup(PopupMenuClient* client)
setFont(m_client->menuStyle().font().font());
connect(this, SIGNAL(activated(int)),
- SLOT(activeChanged(int)));
+ SLOT(activeChanged(int)), Qt::QueuedConnection);
}
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 2a33e45..eee8c86 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Zack Rusin <zack@kde.org>
* 2006 Dirk Mueller <mueller@kde.org>
* 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2008 Holger Hans Peter Freyther
*
* All rights reserved.
*
@@ -45,7 +46,9 @@
#include <QStyleOptionFrameV2>
#include "Color.h"
+#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
+#include "FontSelector.h"
#include "Document.h"
#include "Page.h"
#include "Font.h"
@@ -53,6 +56,7 @@
#include "GraphicsContext.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
+#include "RenderBox.h"
namespace WebCore {
@@ -151,9 +155,12 @@ bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const
int RenderThemeQt::baselinePosition(const RenderObject* o) const
{
+ if (!o->isBox())
+ return 0;
+
if (o->style()->appearance() == CheckboxPart ||
o->style()->appearance() == RadioPart)
- return o->marginTop() + o->height() - 2; // Same as in old khtml
+ return toRenderBox(o)->marginTop() + toRenderBox(o)->height() - 2; // Same as in old khtml
return RenderTheme::baselinePosition(o);
}
@@ -398,6 +405,7 @@ void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* s
fontFamily.setFamily(m_buttonFontFamily);
fontDescription.setFamily(fontFamily);
style->setFontDescription(fontDescription);
+ style->font().update(selector->fontSelector());
style->setLineHeight(RenderStyle::initialLineHeight());
setButtonSize(style);
@@ -567,8 +575,6 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo
opt.rect.moveTo(QPoint(0,0));
opt.rect.setSize(r.size());
- opt.frame = false;
-
p.drawComplexControl(QStyle::CC_ComboBox, opt);
p.painter->translate(-topLeft);
return false;
@@ -715,8 +721,10 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con
// Readonly is supported on textfields.
option.state |= QStyle::State_ReadOnly;
- if (supportsFocus(o->style()->appearance()) && isFocused(o))
+ if (supportsFocus(o->style()->appearance()) && isFocused(o)) {
option.state |= QStyle::State_HasFocus;
+ option.state |= QStyle::State_KeyboardFocusChange;
+ }
if (isHovered(o))
option.state |= QStyle::State_MouseOver;
@@ -754,16 +762,18 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con
return result;
}
-void RenderTheme::adjustDefaultStyleSheet(CSSStyleSheet* style)
+#if ENABLE(VIDEO)
+
+String RenderThemeQt::extraMediaControlsStyleSheet()
{
- QFile platformStyleSheet(":/webcore/resources/html4-adjustments-qt.css");
+ QFile platformStyleSheet(QLatin1String(":/webcore/css/mediaControls-extras.css"));
if (platformStyleSheet.open(QFile::ReadOnly)) {
QByteArray sheetData = platformStyleSheet.readAll();
- style->parseString(QString::fromUtf8(sheetData.constData(), sheetData.length()));
+ return QString::fromUtf8(sheetData.constData(), sheetData.length());
}
-}
-#if ENABLE(VIDEO)
+ return String();
+}
// Helper class to transform the painter's world matrix to the object's content area, scaled to 0,0,100,100
class WorldMatrixTransformer
@@ -942,6 +952,11 @@ void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const
}
}
+double RenderThemeQt::caretBlinkInterval() const
+{
+ return QApplication::cursorFlashTime() / 1000.0 / 2.0;
+}
+
}
// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/qt/RenderThemeQt.h b/WebCore/platform/qt/RenderThemeQt.h
index 76e1855..9a6cf0b 100644
--- a/WebCore/platform/qt/RenderThemeQt.h
+++ b/WebCore/platform/qt/RenderThemeQt.h
@@ -70,6 +70,12 @@ public:
virtual void adjustSliderThumbSize(RenderObject*) const;
+ virtual double caretBlinkInterval() const;
+
+#if ENABLE(VIDEO)
+ virtual String extraMediaControlsStyleSheet();
+#endif
+
protected:
virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
virtual void setCheckboxSize(RenderStyle*) const;
diff --git a/WebCore/platform/qt/ScrollbarQt.cpp b/WebCore/platform/qt/ScrollbarQt.cpp
index 2d65282..29a9997 100644
--- a/WebCore/platform/qt/ScrollbarQt.cpp
+++ b/WebCore/platform/qt/ScrollbarQt.cpp
@@ -49,6 +49,9 @@ namespace WebCore {
bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
{
#ifndef QT_NO_CONTEXTMENU
+ if (!QApplication::style()->styleHint(QStyle::SH_ScrollBar_ContextMenu))
+ return true;
+
bool horizontal = (m_orientation == HorizontalScrollbar);
QMenu menu;
diff --git a/WebCore/platform/qt/ScrollbarThemeQt.cpp b/WebCore/platform/qt/ScrollbarThemeQt.cpp
index 1995719..3851dfe 100644
--- a/WebCore/platform/qt/ScrollbarThemeQt.cpp
+++ b/WebCore/platform/qt/ScrollbarThemeQt.cpp
@@ -94,11 +94,17 @@ static ScrollbarPart scrollbarPart(const QStyle::SubControl& sc)
return NoPart;
}
-static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar)
+static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widget = 0)
{
static QStyleOptionSlider opt;
+ if (widget)
+ opt.initFrom(widget);
+ else
+ opt.state |= QStyle::State_Active;
+
+ opt.state &= ~QStyle::State_HasFocus;
+
opt.rect = scrollbar->frameRect();
- opt.state = 0;
if (scrollbar->enabled())
opt.state |= QStyle::State_Enabled;
if (scrollbar->controlSize() != RegularScrollbar)
@@ -139,7 +145,8 @@ bool ScrollbarThemeQt::paint(Scrollbar* scrollbar, GraphicsContext* graphicsCont
return true;
p.painter->save();
- QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
+ QStyleOptionSlider* opt = styleOptionSlider(scrollbar, p.widget);
+
p.painter->setClipRect(opt->rect.intersected(damageRect));
#ifdef Q_WS_MAC
diff --git a/WebCore/platform/qt/SharedTimerQt.cpp b/WebCore/platform/qt/SharedTimerQt.cpp
index 49f55c1..e9bcaee 100644
--- a/WebCore/platform/qt/SharedTimerQt.cpp
+++ b/WebCore/platform/qt/SharedTimerQt.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006 George Staikos <staikos@kde.org>
* Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2008 Holger Hans Peter Freyther
*
* All rights reserved.
*
@@ -26,30 +27,105 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "SharedTimerQt.h"
-#include <QApplication>
+#include "config.h"
+
+#include <wtf/CurrentTime.h>
+
+#include <QBasicTimer>
+#include <QCoreApplication>
+#include <QDebug>
+#include <QPointer>
namespace WebCore {
-SharedTimerQt* SharedTimerQt::s_self = 0; // FIXME: staticdeleter
+class SharedTimerQt : public QObject {
+ friend void setSharedTimerFiredFunction(void (*f)());
+public:
+ static SharedTimerQt* inst();
+
+ void start(double);
+ void stop();
+
+protected:
+ void timerEvent(QTimerEvent* ev);
+
+private:
+ SharedTimerQt(QObject* parent);
+ ~SharedTimerQt();
+ QBasicTimer m_timer;
+ void (*m_timerFunction)();
+};
+
+SharedTimerQt::SharedTimerQt(QObject* parent)
+ : QObject(parent)
+ , m_timerFunction(0)
+{}
+
+SharedTimerQt::~SharedTimerQt()
+{
+ if (m_timer.isActive())
+ (m_timerFunction)();
+}
+
+SharedTimerQt* SharedTimerQt::inst()
+{
+ static QPointer<SharedTimerQt> timer;
+ if (!timer)
+ timer = new SharedTimerQt(QCoreApplication::instance());
+
+ return timer;
+}
+
+void SharedTimerQt::start(double fireTime)
+{
+ double interval = fireTime - currentTime();
+ unsigned int intervalInMS;
+ if (interval < 0)
+ intervalInMS = 0;
+ else {
+ interval *= 1000;
+ intervalInMS = (unsigned int)interval;
+ }
+
+ m_timer.start(intervalInMS, this);
+}
+
+void SharedTimerQt::stop()
+{
+ m_timer.stop();
+}
+
+void SharedTimerQt::timerEvent(QTimerEvent* ev)
+{
+ if (!m_timerFunction || ev->timerId() != m_timer.timerId())
+ return;
+
+ m_timer.stop();
+ (m_timerFunction)();
+}
void setSharedTimerFiredFunction(void (*f)())
{
+ if (!QCoreApplication::instance())
+ return;
+
SharedTimerQt::inst()->m_timerFunction = f;
}
void setSharedTimerFireTime(double fireTime)
{
- if (!qApp)
+ if (!QCoreApplication::instance())
return;
- qreal fireTimeMs = (fireTime - currentTime()) * 1000;
- SharedTimerQt::inst()->start(qMax(0, int(fireTimeMs)));
+ SharedTimerQt::inst()->start(fireTime);
}
void stopSharedTimer()
{
+ if (!QCoreApplication::instance())
+ return;
+
SharedTimerQt::inst()->stop();
}
diff --git a/WebCore/platform/qt/SharedTimerQt.h b/WebCore/platform/qt/SharedTimerQt.h
deleted file mode 100644
index 30e1e21..0000000
--- a/WebCore/platform/qt/SharedTimerQt.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2006 George Staikos <staikos@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SharedTimerQt_h
-#define SharedTimerQt_h
-
-#include "SharedTimerQt.h"
-#include "SystemTime.h"
-
-#include <QTimer>
-#include <QCoreApplication>
-
-namespace WebCore {
-
-class SharedTimerQt : public QTimer {
-Q_OBJECT
-protected:
- SharedTimerQt()
- : QTimer()
- , m_timerFunction(0)
- {
- connect(this, SIGNAL(timeout()), this, SLOT(fire()));
- setSingleShot(true);
- }
-
- ~SharedTimerQt()
- {
- }
-
-public:
- static void cleanup()
- {
- if (s_self->isActive())
- s_self->fire();
-
- delete s_self;
- s_self = 0;
- }
-
- static SharedTimerQt* inst()
- {
- if (!s_self) {
- s_self = new SharedTimerQt();
- qAddPostRoutine(SharedTimerQt::cleanup);
- }
-
- return s_self;
- }
-
- void (*m_timerFunction)();
-
-public Q_SLOTS:
- void fire()
- {
- if (m_timerFunction)
- (m_timerFunction)();
- }
-
-private:
- static SharedTimerQt* s_self;
-};
-
-}
-
-#endif
-
-// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/qt/SystemTimeQt.cpp b/WebCore/platform/qt/SystemTimeQt.cpp
deleted file mode 100644
index a9f3d98..0000000
--- a/WebCore/platform/qt/SystemTimeQt.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SystemTime.h"
-
-#include <sys/time.h>
-
-namespace WebCore {
-
-double currentTime()
-{
- struct timeval tv;
- struct timezone tz;
-
- gettimeofday(&tv, &tz);
- return (double)tv.tv_sec + (double)(tv.tv_usec / 1000000.0);
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/qt/TemporaryLinkStubs.cpp b/WebCore/platform/qt/TemporaryLinkStubs.cpp
index f262684..ff0b27d 100644
--- a/WebCore/platform/qt/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/qt/TemporaryLinkStubs.cpp
@@ -74,7 +74,7 @@
using namespace WebCore;
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN)
+#if (!defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC32)) || defined(Q_OS_WINCE)
bool PluginPackage::fetchInfo() { notImplemented(); return false; }
unsigned PluginPackage::hash() const { notImplemented(); return 0; }
@@ -83,7 +83,11 @@ int PluginPackage::compareFileVersion(const PlatformModuleVersion&) const { notI
void PluginView::setNPWindowRect(const IntRect&) { notImplemented(); }
const char* PluginView::userAgent() { notImplemented(); return 0; }
+#if ENABLE(NETSCAPE_PLUGIN_API)
+const char* PluginView::userAgentStatic() { notImplemented(); return 0; }
+#endif
void PluginView::invalidateRect(NPRect*) { notImplemented(); }
+void PluginView::invalidateRect(const IntRect&) { notImplemented(); }
void PluginView::invalidateRegion(NPRegion) { notImplemented(); }
void PluginView::forceRedraw() { notImplemented(); }
void PluginView::setFocus() { Widget::setFocus(); }
@@ -92,14 +96,23 @@ void PluginView::hide() { Widget::hide(); }
void PluginView::paint(GraphicsContext*, const IntRect&) { notImplemented(); }
void PluginView::setParent(ScrollView* view) { Widget::setParent(view); }
void PluginView::setParentVisible(bool) { notImplemented(); }
-void PluginView::updatePluginWidget() const { notImplemented(); }
+void PluginView::updatePluginWidget() { notImplemented(); }
void PluginView::handleKeyboardEvent(KeyboardEvent*) { notImplemented(); }
void PluginView::handleMouseEvent(MouseEvent*) { notImplemented(); }
NPError PluginView::handlePostReadFile(Vector<char>&, uint32, const char*) { notImplemented(); return NPERR_GENERIC_ERROR; }
NPError PluginView::getValue(NPNVariable, void*) { notImplemented(); return NPERR_GENERIC_ERROR; }
+#if ENABLE(NETSCAPE_PLUGIN_API)
+NPError PluginView::getValueStatic(NPNVariable, void*) { return NPERR_GENERIC_ERROR; }
+#endif
PluginView::~PluginView() {}
#endif
+#if defined(Q_OS_WINCE)
+Vector<String> PluginDatabase::defaultPluginDirectories() { notImplemented(); return Vector<String>(); }
+void PluginDatabase::getPluginPathsInDirectories(HashSet<String>& paths) const { notImplemented(); }
+bool PluginDatabase::isPreferredPluginDirectory(const String& directory) { notImplemented(); return false; }
+#endif
+
namespace WebCore {
void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
diff --git a/WebCore/platform/qt/WebCoreResources.qrc b/WebCore/platform/qt/WebCoreResources.qrc
deleted file mode 100644
index e42cd7f..0000000
--- a/WebCore/platform/qt/WebCoreResources.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/webcore/resources">
- <file>html4-adjustments-qt.css</file>
-</qresource>
-</RCC> \ No newline at end of file
diff --git a/WebCore/platform/qt/WheelEventQt.cpp b/WebCore/platform/qt/WheelEventQt.cpp
index 135f15a..cc8acd2 100644
--- a/WebCore/platform/qt/WheelEventQt.cpp
+++ b/WebCore/platform/qt/WheelEventQt.cpp
@@ -35,7 +35,11 @@ PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e)
#else
: m_position(e->pos())
, m_globalPosition(e->globalPos())
+#ifdef QT_MAC_USE_COCOA
+ , m_granularity(ScrollByPixelWheelEvent)
+#else
, m_granularity(ScrollByLineWheelEvent)
+#endif
, m_isAccepted(false)
, m_shiftKey(e->modifiers() & Qt::ShiftModifier)
, m_ctrlKey(e->modifiers() & Qt::ControlModifier)
diff --git a/WebCore/platform/qt/WidgetQt.cpp b/WebCore/platform/qt/WidgetQt.cpp
index 68cf383..9f1a1e8 100644
--- a/WebCore/platform/qt/WidgetQt.cpp
+++ b/WebCore/platform/qt/WidgetQt.cpp
@@ -69,9 +69,9 @@ IntRect Widget::frameRect() const
void Widget::setFrameRect(const IntRect& rect)
{
- if (platformWidget())
- platformWidget()->setGeometry(convertToContainingWindow(IntRect(0, 0, rect.width(), rect.height())));
m_frame = rect;
+
+ frameRectsChanged();
}
void Widget::setFocus()
diff --git a/WebCore/platform/qt/html4-adjustments-qt.css b/WebCore/platform/qt/html4-adjustments-qt.css
deleted file mode 100644
index 129c164..0000000
--- a/WebCore/platform/qt/html4-adjustments-qt.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * QtWebKit specific style sheet.
- *
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-audio {
- height: 34px;
- width: 400px;
-}
-
-audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
- left: auto;
- right: 5px;
- width: 12px;
- height: 12px;
- padding: 6px;
- margin: 5px 0px;
-}
-
-audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button {
- left: 5px;
- width: 9px;
- height: 12px;
- padding: 6px 12px 6px 11px;
- margin: 5px 0px;
-}
-
-audio::-webkit-media-controls-time-display, video::-webkit-media-controls-time-display {
- /* Since MediaControlElements are always created with a renderer we have to hide
- the controls we don't use, so they don't mess up activation and event handling */
- left: 0px;
- top: 0px;
- width: 0px;
- height: 0px;
-
- display: none;
-}
-
-audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
- left: 42px;
- right: 34px;
- height: 12px;
- padding: 6px 8px;
- margin: 5px 0px;
-}
-
-audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button {
- /* Since MediaControlElements are always created with a renderer we have to hide
- the controls we don't use, so they don't mess up activation and event handling */
- left: 0px;
- top: 0px;
- width: 0px;
- height: 0px;
-
- display: none;
-}
-
-audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button {
- /* Since MediaControlElements are always created with a renderer we have to hide
- the controls we don't use, so they don't mess up activation and event handling */
- left: 0px;
- top: 0px;
- width: 0px;
- height: 0px;
-
- display: none;
-}
-
-audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button {
- /* Since MediaControlElements are always created with a renderer we have to hide
- the controls we don't use, so they don't mess up activation and event handling */
- left: 0px;
- top: 0px;
- width: 0px;
- height: 0px;
-
- display: none;
-}
-