Title: [112093] trunk/Source/WebKit2
Revision
112093
Author
[email protected]
Date
2012-03-26 07:40:52 -0700 (Mon, 26 Mar 2012)

Log Message

[WK2][Qt] Fix compilation without QtWidgets
https://bugs.webkit.org/show_bug.cgi?id=79458

Reviewed by Tor Arne Vestbø.

* Shared/qt/WebEventFactoryQt.cpp:
(WebKit::WebEventFactory::createWebWheelEvent): Replace use of QApplication::wheelScrollLines()
with the constant that is actually used and usually not changed anyway.
* Target.pri: Remove widgets from Qt variable.
* UIProcess/qt/QtWebPageEventHandler.cpp: Remove unecessary include.
* WebProcess.pro: Use widgets for the process (for the time being).
* WebProcess/qt/WebProcessMainQt.cpp: Delegate QApplication creation to the caller.
(WebKit::WebProcessMainQt):
* qt/MainQt.cpp: Create QApplication here.
(WebKit):
(main):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (112092 => 112093)


--- trunk/Source/WebKit2/ChangeLog	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-26 14:40:52 UTC (rev 112093)
@@ -1,3 +1,22 @@
+2012-03-26  Simon Hausmann  <[email protected]>
+
+        [WK2][Qt] Fix compilation without QtWidgets
+        https://bugs.webkit.org/show_bug.cgi?id=79458
+
+        Reviewed by Tor Arne Vestbø.
+
+        * Shared/qt/WebEventFactoryQt.cpp:
+        (WebKit::WebEventFactory::createWebWheelEvent): Replace use of QApplication::wheelScrollLines()
+        with the constant that is actually used and usually not changed anyway.
+        * Target.pri: Remove widgets from Qt variable.
+        * UIProcess/qt/QtWebPageEventHandler.cpp: Remove unecessary include.
+        * WebProcess.pro: Use widgets for the process (for the time being).
+        * WebProcess/qt/WebProcessMainQt.cpp: Delegate QApplication creation to the caller.
+        (WebKit::WebProcessMainQt):
+        * qt/MainQt.cpp: Create QApplication here.
+        (WebKit):
+        (main):
+
 2012-03-26  Andras Becsi  <[email protected]>
 
         Be more careful with git gui usage

Modified: trunk/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp (112092 => 112093)


--- trunk/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp	2012-03-26 14:40:52 UTC (rev 112093)
@@ -26,7 +26,6 @@
 
 #include "config.h"
 #include "WebEventFactoryQt.h"
-#include <QApplication>
 #include <QKeyEvent>
 #include <QTransform>
 #include <WebCore/IntPoint.h>
@@ -150,8 +149,10 @@
     // Use the same single scroll step as QTextEdit
     // (in QTextEditPrivate::init [h,v]bar->setSingleStep)
     static const float cDefaultQtScrollStep = 20.f;
-    deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
-    deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
+    // ### FIXME: Default from QtGui. Should use Qt platform theme API once configurable.
+    const int wheelScrollLines = 3;
+    deltaX *= (fullTick) ? wheelScrollLines * cDefaultQtScrollStep : 1;
+    deltaY *= (fullTick) ? wheelScrollLines * cDefaultQtScrollStep : 1;
 
     return WebWheelEvent(WebEvent::Wheel, fromItemTransform.map(e->posF()).toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
 }

Modified: trunk/Source/WebKit2/Target.pri (112092 => 112093)


--- trunk/Source/WebKit2/Target.pri	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/Target.pri	2012-03-26 14:40:52 UTC (rev 112093)
@@ -12,7 +12,7 @@
 include(WebKit2.pri)
 
 WEBKIT += wtf _javascript_core webcore
-QT += declarative quick quick-private widgets
+QT += declarative quick quick-private
 
 CONFIG += staticlib
 

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp (112092 => 112093)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2012-03-26 14:40:52 UTC (rev 112093)
@@ -29,7 +29,6 @@
 #include "qquickwebview_p.h"
 #include <QCursor>
 #include <QDrag>
-#include <QGraphicsSceneMouseEvent>
 #include <QGuiApplication>
 #include <QInputPanel>
 #include <QMimeData>

Modified: trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp (112092 => 112093)


--- trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-03-26 14:40:52 UTC (rev 112093)
@@ -25,19 +25,17 @@
  */
 
 #include "config.h"
-
 #include "WebProcess.h"
-#include <WebCore/RunLoop.h>
-#include <runtime/InitializeThreading.h>
-#include <wtf/MainThread.h>
 
-#include <QApplication>
+#include <QGuiApplication>
 #include <QList>
 #include <QNetworkProxyFactory>
 #include <QString>
 #include <QStringList>
 #include <QUrl>
-#include <QtGlobal>
+#include <WebCore/RunLoop.h>
+#include <runtime/InitializeThreading.h>
+#include <wtf/MainThread.h>
 
 #if USE(ACCELERATED_COMPOSITING)
 #include "WebGraphicsLayer.h"
@@ -141,26 +139,8 @@
     QNetworkProxyFactory::setUseSystemConfiguration(true);
 }
 
-void messageHandler(QtMsgType type, const char* message)
+Q_DECL_EXPORT int WebProcessMainQt(QGuiApplication* app)
 {
-    if (type == QtCriticalMsg) {
-        fprintf(stderr, "%s\n", message);
-        return;
-    }
-
-    // Do nothing
-}
-
-Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv)
-{
-    // Has to be done before QApplication is constructed in case
-    // QApplication itself produces debug output.
-    QByteArray suppressOutput = qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT");
-    if (!suppressOutput.isEmpty() && suppressOutput != "0")
-        qInstallMsgHandler(messageHandler);
-
-    QApplication::setGraphicsSystem(QLatin1String("raster"));
-    QApplication* app = new QApplication(argc, argv);
 #ifndef NDEBUG
     if (qgetenv("QT_WEBKIT2_DEBUG") == "1") {
         qDebug() << "Waiting 3 seconds for debugger";
@@ -209,6 +189,7 @@
     RunLoop::run();
 
     // FIXME: Do more cleanup here.
+    delete app;
 
     return 0;
 }

Modified: trunk/Source/WebKit2/WebProcess.pro (112092 => 112093)


--- trunk/Source/WebKit2/WebProcess.pro	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/WebProcess.pro	2012-03-26 14:40:52 UTC (rev 112093)
@@ -11,7 +11,7 @@
 
 SOURCES += qt/MainQt.cpp
 
-QT += network webkit
+QT += network webkit widgets
 macx: QT += xml
 
 contains(QT_CONFIG, opengl) {

Modified: trunk/Source/WebKit2/qt/MainQt.cpp (112092 => 112093)


--- trunk/Source/WebKit2/qt/MainQt.cpp	2012-03-26 14:38:42 UTC (rev 112092)
+++ trunk/Source/WebKit2/qt/MainQt.cpp	2012-03-26 14:40:52 UTC (rev 112093)
@@ -24,18 +24,37 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <QtGlobal>
+#include <QApplication>
 
+#include <stdio.h>
+
 namespace WebKit {
-Q_DECL_IMPORT int WebProcessMainQt(int argc, char** argv);
+Q_DECL_IMPORT int WebProcessMainQt(QGuiApplication*);
 Q_DECL_IMPORT void initializeWebKit2Theme();
 }
 
+static void messageHandler(QtMsgType type, const char* message)
+{
+    if (type == QtCriticalMsg) {
+        fprintf(stderr, "%s\n", message);
+        return;
+    }
+
+    // Do nothing
+}
+
 // The framework entry point.
 // We call our platform specific entry point directly rather than WebKitMain because it makes little sense
 // to reimplement the handling of command line arguments from QApplication.
 int main(int argc, char** argv)
 {
     WebKit::initializeWebKit2Theme();
-    return WebKit::WebProcessMainQt(argc, argv);
+
+    // Has to be done before QApplication is constructed in case
+    // QApplication itself produces debug output.
+    QByteArray suppressOutput = qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT");
+    if (!suppressOutput.isEmpty() && suppressOutput != "0")
+        qInstallMsgHandler(messageHandler);
+
+    return WebKit::WebProcessMainQt(new QApplication(argc, argv));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to