[Qt][WK2] Don't support ridiculous matrix of QT_NO_FEATURE combinations.

https://bugs.webkit.org/show_bug.cgi?id=64099

Reviewed by Benjamin Poulain.

Source/WebKit2: 

* Shared/qt/WebEventFactoryQt.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):
* UIProcess/API/qt/qdesktopwebview_p.h:
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::QtWebPageProxy):
(QtWebPageProxy::setCursor):
(QtWebPageProxy::registerEditCommand):
(QtWebPageProxy::clearAllEditCommands):
(QtWebPageProxy::canUndoRedo):
(QtWebPageProxy::executeUndoRedo):
(QtWebPageProxy::updateAction):
(QtWebPageProxy::webActionTriggered):
(QtWebPageProxy::triggerAction):
(QtWebPageProxy::action):
* UIProcess/qt/QtWebPageProxy.h:
* UIProcess/qt/TouchViewInterface.cpp:
(WebKit::TouchViewInterface::didChangeCursor):
* UIProcess/qt/TouchViewInterface.h:
* UIProcess/qt/ViewInterface.h:
* UIProcess/qt/WebUndoCommandQt.cpp:
(WebUndoCommandQt::WebUndoCommandQt):
* UIProcess/qt/WebUndoCommandQt.h:
* WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp:
(WebKit::WebDragClient::startDrag):

Tools: 

* MiniBrowser/qt/BrowserWindow.cpp:
(BrowserWindow::openFile):
(BrowserWindow::screenshot):
(BrowserWindow::loadURLListFromFile):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b7da19c7
2011-07-07 Andreas Kling <kling@webkit.org>
[Qt][WK2] Don't support ridiculous matrix of QT_NO_FEATURE combinations.
https://bugs.webkit.org/show_bug.cgi?id=64099
Reviewed by Benjamin Poulain.
* Shared/qt/WebEventFactoryQt.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):
* UIProcess/API/qt/qdesktopwebview_p.h:
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::QtWebPageProxy):
(QtWebPageProxy::setCursor):
(QtWebPageProxy::registerEditCommand):
(QtWebPageProxy::clearAllEditCommands):
(QtWebPageProxy::canUndoRedo):
(QtWebPageProxy::executeUndoRedo):
(QtWebPageProxy::updateAction):
(QtWebPageProxy::webActionTriggered):
(QtWebPageProxy::triggerAction):
(QtWebPageProxy::action):
* UIProcess/qt/QtWebPageProxy.h:
* UIProcess/qt/TouchViewInterface.cpp:
(WebKit::TouchViewInterface::didChangeCursor):
* UIProcess/qt/TouchViewInterface.h:
* UIProcess/qt/ViewInterface.h:
* UIProcess/qt/WebUndoCommandQt.cpp:
(WebUndoCommandQt::WebUndoCommandQt):
* UIProcess/qt/WebUndoCommandQt.h:
* WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp:
(WebKit::WebDragClient::startDrag):
2011-07-07 Andreas Kling <kling@webkit.org>
[Qt][WK2] Views should know about WebProcess crash/relaunch.
......
......@@ -135,10 +135,8 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(QGraphicsSceneWheelEvent* e)
// Use the same single scroll step as QTextEdit
// (in QTextEditPrivate::init [h,v]bar->setSingleStep)
static const float cDefaultQtScrollStep = 20.f;
#ifndef QT_NO_WHEELEVENT
deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
#endif
return WebWheelEvent(WebEvent::Wheel, e->pos().toPoint(), e->screenPos(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
}
......
......@@ -55,9 +55,7 @@ private:
virtual void didChangeTitle(const QString&);
virtual void didChangeToolTip(const QString&);
virtual void didChangeStatusText(const QString&);
#ifndef QT_NO_CURSOR
virtual void didChangeCursor(const QCursor&);
#endif
virtual void loadDidBegin();
virtual void loadDidSucceed();
virtual void didChangeLoadProgress(int);
......
......@@ -124,9 +124,7 @@ QtWebPageProxy::QtWebPageProxy(ViewInterface* viewInterface, QWKContext* c, WKPa
, m_context(c)
, m_preferences(0)
, m_createNewPageFn(0)
#ifndef QT_NO_UNDOSTACK
, m_undoStack(adoptPtr(new QUndoStack(this)))
#endif
{
ASSERT(viewInterface);
memset(m_actions, 0, sizeof(m_actions));
......@@ -263,9 +261,7 @@ bool QtWebPageProxy::handleFocusOutEvent(QFocusEvent*)
void QtWebPageProxy::setCursor(const WebCore::Cursor& cursor)
{
#ifndef QT_NO_CURSOR
m_viewInterface->didChangeCursor(*cursor.platformCursor());
#endif
}
void QtWebPageProxy::setViewNeedsDisplay(const WebCore::IntRect& rect)
......@@ -336,42 +332,32 @@ void QtWebPageProxy::toolTipChanged(const String&, const String& newTooltip)
void QtWebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
{
#ifndef QT_NO_UNDOSTACK
if (undoOrRedo == WebPageProxy::Undo) {
const WebUndoCommandQt* webUndoCommand = static_cast<const WebUndoCommandQt*>(m_undoStack->command(m_undoStack->index()));
if (webUndoCommand && webUndoCommand->inUndoRedo())
return;
m_undoStack->push(new WebUndoCommandQt(command));
}
#endif
}
void QtWebPageProxy::clearAllEditCommands()
{
#ifndef QT_NO_UNDOSTACK
m_undoStack->clear();
#endif
}
bool QtWebPageProxy::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
{
#ifdef QT_NO_UNDOSTACK
return false;
#else
if (undoOrRedo == WebPageProxy::Undo)
return m_undoStack->canUndo();
return m_undoStack->canRedo();
#endif
}
void QtWebPageProxy::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
{
#ifndef QT_NO_UNDOSTACK
if (undoOrRedo == WebPageProxy::Undo)
m_undoStack->undo();
else
m_undoStack->redo();
#endif
}
FloatRect QtWebPageProxy::convertToDeviceSpace(const FloatRect& rect)
......@@ -485,9 +471,6 @@ void QtWebPageProxy::paint(QPainter* painter, QRect area)
void QtWebPageProxy::updateAction(QtWebPageProxy::WebAction action)
{
#ifdef QT_NO_ACTION
Q_UNUSED(action)
#else
QAction* a = m_actions[action];
if (!a)
return;
......@@ -520,7 +503,6 @@ void QtWebPageProxy::updateAction(QtWebPageProxy::WebAction action)
if (a->isCheckable())
a->setChecked(checked);
#endif // QT_NO_ACTION
}
void QtWebPageProxy::updateNavigationActions()
......@@ -531,7 +513,6 @@ void QtWebPageProxy::updateNavigationActions()
updateAction(QtWebPageProxy::Reload);
}
#ifndef QT_NO_ACTION
void QtWebPageProxy::webActionTriggered(bool checked)
{
QAction* a = qobject_cast<QAction*>(sender());
......@@ -540,7 +521,6 @@ void QtWebPageProxy::webActionTriggered(bool checked)
QtWebPageProxy::WebAction action = static_cast<QtWebPageProxy::WebAction>(a->data().toInt());
triggerAction(action, checked);
}
#endif // QT_NO_ACTION
void QtWebPageProxy::didRelaunchProcess()
{
......@@ -646,7 +626,6 @@ void QtWebPageProxy::setResizesToContentsUsingLayoutSize(const QSize& targetLayo
#endif
}
#ifndef QT_NO_ACTION
void QtWebPageProxy::triggerAction(WebAction webAction, bool)
{
switch (webAction) {
......@@ -670,9 +649,7 @@ void QtWebPageProxy::triggerAction(WebAction webAction, bool)
WebKit::WebContextMenuItemData menuItemData(ActionType, contextMenuActionForWebAction(webAction), qtAction->text(), qtAction->isEnabled(), qtAction->isChecked());
m_webPageProxy->contextMenuItemSelected(menuItemData);
}
#endif // QT_NO_ACTION
#ifndef QT_NO_ACTION
QAction* QtWebPageProxy::action(WebAction action) const
{
if (action == QtWebPageProxy::NoWebAction || action >= WebActionCount)
......@@ -728,7 +705,6 @@ QAction* QtWebPageProxy::action(WebAction action) const
case SelectAll:
text = contextMenuItemTagSelectAll();
break;
#ifndef QT_NO_UNDOSTACK
case Undo: {
QAction* undoAction = m_undoStack->createUndoAction(mutableSelf);
m_actions[action] = undoAction;
......@@ -739,7 +715,6 @@ QAction* QtWebPageProxy::action(WebAction action) const
m_actions[action] = redoAction;
return redoAction;
}
#endif
default:
return 0;
break;
......@@ -760,7 +735,6 @@ QAction* QtWebPageProxy::action(WebAction action) const
mutableSelf->updateAction(action);
return a;
}
#endif // QT_NO_ACTION
void QtWebPageProxy::findZoomableAreaForPoint(const QPoint& point)
{
......
......@@ -221,9 +221,7 @@ private:
CreateNewPageFn m_createNewPageFn;
#ifndef QT_NO_UNDOSTACK
OwnPtr<QUndoStack> m_undoStack;
#endif
};
#endif /* QtWebPageProxy_h */
......@@ -88,12 +88,10 @@ void TouchViewInterface::didChangeStatusText(const QString&)
// There is not yet any UI defined for status text so we ignore the call.
}
#ifndef QT_NO_CURSOR
void TouchViewInterface::didChangeCursor(const QCursor&)
{
// The cursor is not visible on mobile, just ignore this message.
}
#endif
void TouchViewInterface::loadDidBegin()
{
......
......@@ -51,9 +51,7 @@ private:
virtual void didChangeTitle(const QString&);
virtual void didChangeToolTip(const QString&);
virtual void didChangeStatusText(const QString&);
#ifndef QT_NO_CURSOR
virtual void didChangeCursor(const QCursor&);
#endif
virtual void loadDidBegin();
virtual void loadDidSucceed();
virtual void didChangeLoadProgress(int);
......
......@@ -56,9 +56,7 @@ public:
virtual void didChangeTitle(const QString&) = 0;
virtual void didChangeToolTip(const QString&) = 0;
virtual void didChangeStatusText(const QString&) = 0;
#ifndef QT_NO_CURSOR
virtual void didChangeCursor(const QCursor&) = 0;
#endif
virtual void loadDidBegin() = 0;
virtual void loadDidSucceed() = 0;
virtual void didChangeLoadProgress(int) = 0;
......
......@@ -23,7 +23,6 @@
using namespace WebKit;
#ifndef QT_NO_UNDOCOMMAND
WebUndoCommandQt::WebUndoCommandQt(PassRefPtr<WebEditCommandProxy> command, QUndoCommand* parent)
: QUndoCommand(parent)
, m_command(command)
......@@ -31,14 +30,6 @@ WebUndoCommandQt::WebUndoCommandQt(PassRefPtr<WebEditCommandProxy> command, QUnd
, m_inUndoRedo(false)
{
}
#else
WebUndoCommandQt::WebUndoCommandQt(PassRefPtr<WebEditCommandProxy> command)
: m_command(command)
, m_first(true)
, m_inUndoRedo(false)
{
}
#endif
WebUndoCommandQt::~WebUndoCommandQt()
{
......
......@@ -26,17 +26,9 @@
#include <qglobal.h>
#include <wtf/RefPtr.h>
class WebUndoCommandQt
#ifndef QT_NO_UNDOCOMMAND
: public QUndoCommand
#endif
{
class WebUndoCommandQt : public QUndoCommand {
public:
#ifndef QT_NO_UNDOCOMMAND
WebUndoCommandQt(PassRefPtr<WebKit::WebEditCommandProxy>, QUndoCommand* parent = 0);
#else
WebUndoCommandQt(PassRefPtr<WebKit::WebEditCommandProxy>);
#endif
~WebUndoCommandQt();
void redo();
......
......@@ -54,7 +54,6 @@ static PassRefPtr<ShareableBitmap> convertQPixmapToShareableBitmap(QPixmap* pixm
void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& clientPosition, const IntPoint& globalPosition, Clipboard* clipboard, Frame*, bool)
{
#ifndef QT_NO_DRAGANDDROP
QMimeData* clipboardData = static_cast<ClipboardQt*>(clipboard)->clipboardData();
DragOperation dragOperationMask = clipboard->sourceOperation();
static_cast<ClipboardQt*>(clipboard)->invalidateWritableData();
......@@ -66,12 +65,6 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& clientPosi
return;
m_page->send(Messages::WebPageProxy::StartDrag(dragData, handle));
#else
Q_UNUSED(dragImage)
Q_UNUSED(clientPosition)
Q_UNUSED(globalPosition)
Q_UNUSED(clipboard)
#endif
}
}
2011-07-07 Andreas Kling <kling@webkit.org>
[Qt][WK2] Don't support ridiculous matrix of QT_NO_FEATURE combinations.
https://bugs.webkit.org/show_bug.cgi?id=64099
Reviewed by Benjamin Poulain.
* MiniBrowser/qt/BrowserWindow.cpp:
(BrowserWindow::openFile):
(BrowserWindow::screenshot):
(BrowserWindow::loadURLListFromFile):
2011-07-07 Adam Roben <aroben@apple.com>
Completely ignore too-many-failures builds in TestFailures in most circumstances
......
......@@ -216,7 +216,6 @@ void BrowserWindow::urlChanged(const QUrl& url)
void BrowserWindow::openFile()
{
#ifndef QT_NO_FILEDIALOG
static const QString filter("HTML Files (*.htm *.html *.xhtml);;Text Files (*.txt);;Image Files (*.gif *.jpg *.png);;SVG Files (*.svg);;All Files (*)");
QFileDialog fileDialog(this, tr("Open"), QString(), filter);
......@@ -229,7 +228,6 @@ void BrowserWindow::openFile()
if (!selectedFile.isEmpty())
load(selectedFile);
}
#endif
}
void BrowserWindow::screenshot()
......@@ -244,7 +242,6 @@ void BrowserWindow::screenshot()
label->show();
#endif
#ifndef QT_NO_FILEDIALOG
QString fileName = QFileDialog::getSaveFileName(label, "Screenshot", QString(), QString("PNG File (.png)"));
if (!fileName.isEmpty()) {
QRegExp rx("*.png");
......@@ -258,7 +255,6 @@ void BrowserWindow::screenshot()
if (label)
label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
}
#endif
}
void BrowserWindow::toggleFullScreenMode(bool enable)
......@@ -303,10 +299,8 @@ void BrowserWindow::showUserAgentDialog()
void BrowserWindow::loadURLListFromFile()
{
QString selectedFile;
#ifndef QT_NO_FILEDIALOG
selectedFile = QFileDialog::getOpenFileName(this, tr("Load URL list from file")
, QString(), tr("Text Files (*.txt);;All Files (*)"));
#endif
if (selectedFile.isEmpty())
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment