Changeset 124879 in webkit
- Timestamp:
- Aug 7, 2012 5:06:52 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 85 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r124856 r124879 1 2012-07-19 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * Source/api.pri: 9 * WebKit.pro: 10 1 11 2012-08-06 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 12 -
trunk/Source/WTF/ChangeLog
r124823 r124879 1 2012-07-19 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * WTF.pri: 9 * WTF.pro: 10 * wtf/qt/StringQt.cpp: 11 (WTF::String::String): 12 (WTF::String::operator QString): 13 * wtf/qt/UtilsQt.h: Removed. 14 * wtf/qt/compat/QGuiApplication: Removed. 15 * wtf/qt/compat/qguiapplication.h: Removed. 16 * wtf/text/StringImpl.cpp: 17 (WTF::StringImpl::~StringImpl): 18 (WTF): 19 * wtf/text/StringImpl.h: 20 (StringImpl): 21 1 22 2012-08-06 Patrick Gansterer <paroga@webkit.org> 2 23 -
trunk/Source/WTF/WTF.pri
r122845 r124879 9 9 INCLUDEPATH += $$PWD 10 10 11 haveQt(5) { 12 mac { 13 # Mac OS does ship libicu but not the associated header files. 14 # Therefore WebKit provides adequate header files. 15 INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu 16 LIBS += -licucore 11 mac { 12 # Mac OS does ship libicu but not the associated header files. 13 # Therefore WebKit provides adequate header files. 14 INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/WTF/icu 15 LIBS += -licucore 16 } else { 17 contains(QT_CONFIG,icu) { 18 win32: LIBS += -licuin -licuuc -licudt 19 else: LIBS += -licui18n -licuuc -licudata 17 20 } else { 18 contains(QT_CONFIG,icu) { 19 win32: LIBS += -licuin -licuuc -licudt 20 else: LIBS += -licui18n -licuuc -licudata 21 } else { 22 error("To build QtWebKit with Qt 5 you need ICU") 23 } 21 error("To build QtWebKit with Qt 5 you need ICU") 24 22 } 25 23 } -
trunk/Source/WTF/WTF.pro
r124365 r124879 111 111 Platform.h \ 112 112 PossiblyNull.h \ 113 qt/UtilsQt.h \114 113 RandomNumber.h \ 115 114 RandomNumberSeed.h \ -
trunk/Source/WTF/wtf/qt/StringQt.cpp
r119222 r124879 38 38 if (qstr.isNull()) 39 39 return; 40 #if HAVE(QT5)41 40 m_impl = StringImpl::adopt(const_cast<QString&>(qstr).data_ptr()); 42 #else43 m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(qstr.constData()), qstr.length());44 #endif45 41 } 46 42 … … 57 53 return QString(); 58 54 59 #if HAVE(QT5)60 55 if (QStringData* qStringData = m_impl->qStringData()) { 61 56 // The WTF string was adopted from a QString at some point, so we … … 65 60 return QString(qStringDataPointer); 66 61 } 67 #endif 62 68 63 if (is8Bit() && !m_impl->has16BitShadow()) { 69 64 // Asking for characters() of an 8-bit string will make a 16-bit copy internally -
trunk/Source/WTF/wtf/text/StringImpl.cpp
r124611 r124879 70 70 return; 71 71 } 72 #if PLATFORM(QT) && HAVE(QT5)72 #if PLATFORM(QT) 73 73 if (ownership == BufferAdoptedQString) { 74 74 if (!m_qStringData->ref.deref()) … … 1658 1658 } 1659 1659 1660 #if PLATFORM(QT) && HAVE(QT5)1660 #if PLATFORM(QT) 1661 1661 PassRefPtr<StringImpl> StringImpl::adopt(QStringData* qStringData) 1662 1662 { -
trunk/Source/WTF/wtf/text/StringImpl.h
r124611 r124879 32 32 #include <wtf/unicode/Unicode.h> 33 33 34 #if PLATFORM(QT) && HAVE(QT5)34 #if PLATFORM(QT) 35 35 #include <QString> 36 36 #endif … … 89 89 BufferOwned, 90 90 BufferSubstring, 91 #if PLATFORM(QT) && HAVE(QT5)91 #if PLATFORM(QT) 92 92 BufferAdoptedQString 93 93 #endif … … 239 239 } 240 240 241 #if PLATFORM(QT) && HAVE(QT5)241 #if PLATFORM(QT) 242 242 // Used to create new strings that adopt an existing QString's data 243 243 enum ConstructAdoptedQStringTag { ConstructAdoptedQString }; … … 365 365 WTF_EXPORT_STRING_API static PassRefPtr<StringImpl> adopt(StringBuffer<LChar>&); 366 366 367 #if PLATFORM(QT) && HAVE(QT5)367 #if PLATFORM(QT) 368 368 static PassRefPtr<StringImpl> adopt(QStringData*); 369 369 #endif … … 430 430 } 431 431 432 #if PLATFORM(QT) && HAVE(QT5)432 #if PLATFORM(QT) 433 433 QStringData* qStringData() { return bufferOwnership() == BufferAdoptedQString ? m_qStringData : 0; } 434 434 #endif … … 658 658 StringImpl* m_substringBuffer; 659 659 mutable UChar* m_copyData16; 660 #if PLATFORM(QT) && HAVE(QT5)660 #if PLATFORM(QT) 661 661 QStringData* m_qStringData; 662 662 #endif -
trunk/Source/WebCore/ChangeLog
r124878 r124879 1 2012-08-02 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * Target.pri: 9 * WebCore.pri: 10 * bridge/qt/qt_class.cpp: 11 (JSC::Bindings::QtClass::fallbackObject): 12 * bridge/qt/qt_instance.cpp: 13 (JSC::Bindings::QtInstance::getPropertyNames): 14 (JSC::Bindings::QtInstance::stringValue): 15 (JSC::Bindings::QtField::setValueToInstance): 16 * bridge/qt/qt_runtime.h: 17 (QtConnectionObject): 18 * bridge/qt/qt_runtime_qt4.cpp: Removed. 19 * editing/qt/SmartReplaceQt.cpp: Removed. 20 * page/qt/EventHandlerQt.cpp: 21 (WebCore::EventHandler::tabsToAllFormControls): 22 * platform/graphics/GraphicsContext3D.h: 23 * platform/graphics/OpenGLShims.cpp: 24 (WebCore::getProcAddress): 25 * platform/graphics/OpenGLShims.h: 26 * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: 27 * platform/graphics/gstreamer/PlatformVideoWindowQt.cpp: 28 (FullScreenVideoWindow::FullScreenVideoWindow): 29 (FullScreenVideoWindow::keyPressEvent): 30 (FullScreenVideoWindow::event): 31 (FullScreenVideoWindow::showFullScreen): 32 (PlatformVideoWindow::PlatformVideoWindow): 33 * platform/graphics/qt/GraphicsContext3DQt.cpp: 34 (WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext): 35 (WebCore::GraphicsContext3DPrivate::makeCurrentIfNeeded): 36 * platform/graphics/qt/GraphicsContextQt.cpp: 37 (WebCore::GraphicsContext::releaseWindowsContext): 38 * platform/graphics/qt/ImageQt.cpp: 39 (WebCore::BitmapImage::create): 40 * platform/graphics/qt/SimpleFontDataQt.cpp: 41 (WebCore::SimpleFontData::platformInit): 42 * platform/graphics/texmap/TextureMapper.h: 43 * platform/graphics/texmap/TextureMapperGL.cpp: 44 (WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext): 45 * platform/qt/DeviceMotionProviderQt.h: 46 * platform/qt/DeviceOrientationProviderQt.h: 47 * platform/qt/KURLQt.cpp: 48 (WebCore::KURL::operator QUrl): 49 * platform/qt/PlatformScreenQt.cpp: 50 (WebCore::screenDepth): 51 (WebCore::screenDepthPerComponent): 52 (WebCore::screenIsMonochrome): 53 (WebCore::screenRect): 54 (WebCore::screenAvailableRect): 55 * platform/qt/QWebPageClient.h: 56 (QWebPageClient): 57 * platform/qt/RenderThemeQt.cpp: 58 * platform/text/qt/TextBreakIteratorQt.cpp: Removed. 59 * plugins/qt/PluginContainerQt.cpp: Removed. 60 * plugins/qt/PluginContainerQt.h: Removed. 61 * plugins/qt/PluginPackageQt.cpp: 62 (WebCore::PluginPackage::isPluginBlacklisted): 63 * plugins/qt/PluginViewQt.cpp: 64 (WebCore::PluginView::setFocus): 65 (WebCore::PluginView::paintUsingXPixmap): 66 (WebCore::setSharedXEventFields): 67 (WebCore::PluginView::setNPWindowIfNeeded): 68 (WebCore::PluginView::setParentVisible): 69 (WebCore::PluginView::platformGetValue): 70 (WebCore::PluginView::invalidateRect): 71 (WebCore::getVisualAndColormap): 72 (WebCore::PluginView::platformStart): 73 * plugins/win/PluginViewWin.cpp: 74 (windowHandleForPageClient): 75 1 76 2012-08-06 Andrey Kosyakov <caseq@chromium.org> 2 77 -
trunk/Source/WebCore/Target.pri
r124857 r124879 16 16 17 17 DEFINES += QT_MAKEDLL 18 19 !haveQt(5) {20 INCLUDEPATH += $$PWD/../WTF/wtf/qt/compat21 }22 18 23 19 RESOURCES += \ … … 232 228 bridge/qt/qt_instance.cpp \ 233 229 bridge/qt/qt_pixmapruntime.cpp \ 230 bridge/qt/qt_runtime.cpp \ 234 231 bridge/runtime_array.cpp \ 235 232 bridge/runtime_method.cpp \ … … 238 235 testing/js/WebCoreTestSupport.cpp 239 236 240 haveQt(5) {241 SOURCES += bridge/qt/qt_runtime.cpp242 } else {243 SOURCES += bridge/qt/qt_runtime_qt4.cpp244 }245 237 246 238 SOURCES += \ … … 2819 2811 } 2820 2812 2821 haveQt(5) { 2822 contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp 2823 mac { 2824 # For Mac we use the same SmartReplace implementation as the Apple port. 2825 SOURCES += editing/SmartReplaceCF.cpp 2826 INCLUDEPATH += $$PWD/icu 2827 } else { 2828 SOURCES += editing/SmartReplaceICU.cpp 2829 } 2813 contains(QT_CONFIG,icu)|mac: SOURCES += platform/text/TextBreakIteratorICU.cpp 2814 mac { 2815 # For Mac we use the same SmartReplace implementation as the Apple port. 2816 SOURCES += editing/SmartReplaceCF.cpp 2817 INCLUDEPATH += $$PWD/icu 2830 2818 } else { 2831 SOURCES += platform/text/qt/TextBreakIteratorQt.cpp \ 2832 editing/qt/SmartReplaceQt.cpp 2819 SOURCES += editing/SmartReplaceICU.cpp 2833 2820 } 2834 2821 … … 2849 2836 plugins/qt/PluginPackageQt.cpp \ 2850 2837 plugins/qt/PluginViewQt.cpp 2851 2852 haveQt(4) {2853 SOURCES += plugins/qt/PluginContainerQt.cpp2854 HEADERS += plugins/qt/PluginContainerQt.h2855 }2856 2838 } 2857 2839 } -
trunk/Source/WebCore/WebCore.pri
r124492 r124879 8 8 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore 9 9 10 QT *= network sql 11 haveQt(5): QT *= core-private gui-private 10 QT *= network sql core-private gui-private 12 11 13 12 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR} … … 151 150 } 152 151 153 contains(DEFINES, ENABLE_GEOLOCATION=1) {154 CONFIG *= mobility155 MOBILITY *= location156 }157 158 152 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1)|contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) { 159 haveQt(5) { 160 QT += sensors 161 } else { 162 CONFIG *= mobility 163 MOBILITY *= sensors 164 } 153 QT += sensors 165 154 } 166 155 … … 194 183 mac: LIBS += -framework IOSurface -framework CoreFoundation 195 184 linux-*:contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite 196 haveQt(4): QT *= opengl197 185 } 198 186 … … 205 193 } 206 194 207 haveQt(5) { 208 # Qt5 allows us to use config tests to check for the presence of these libraries 209 config_libjpeg { 210 DEFINES += WTF_USE_LIBJPEG=1 211 LIBS += -ljpeg 212 } else { 213 warning("JPEG library not found! QImageDecoder will decode JPEG images.") 214 } 215 config_libpng { 216 DEFINES += WTF_USE_LIBPNG=1 217 LIBS += -lpng 218 } else { 219 warning("PNG library not found! QImageDecoder will decode PNG images.") 220 } 221 config_libwebp { 222 DEFINES += WTF_USE_WEBP=1 223 LIBS += -lwebp 224 } 195 # Qt5 allows us to use config tests to check for the presence of these libraries 196 config_libjpeg { 197 DEFINES += WTF_USE_LIBJPEG=1 198 LIBS += -ljpeg 225 199 } else { 226 !win32-*:!mac { 227 DEFINES += WTF_USE_LIBJPEG=1 WTF_USE_LIBPNG=1 228 LIBS += -ljpeg -lpng 229 } 200 warning("JPEG library not found! QImageDecoder will decode JPEG images.") 201 } 202 config_libpng { 203 DEFINES += WTF_USE_LIBPNG=1 204 LIBS += -lpng 205 } else { 206 warning("PNG library not found! QImageDecoder will decode PNG images.") 207 } 208 config_libwebp { 209 DEFINES += WTF_USE_WEBP=1 210 LIBS += -lwebp 230 211 } 231 212 … … 277 258 278 259 unix|win32-g++* { 279 QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork 280 haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets 260 QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork QtWidgets 281 261 } 282 262 -
trunk/Source/WebCore/bridge/qt/qt_class.cpp
r119584 r124879 100 100 continue; 101 101 102 #if !HAVE(QT5)103 int iter = 0;104 const char* signature = m.signature();105 while (signature[iter] && signature[iter] != '(')106 ++iter;107 108 if (normal == QByteArray::fromRawData(signature, iter)) {109 #else110 102 if (normal == m.name()) { 111 #endif112 103 QtRuntimeMetaMethod* val = QtRuntimeMetaMethod::create(exec, ustring, static_cast<QtInstance*>(inst), index, normal, false); 113 104 qtinst->m_methods.insert(name, val); -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r121381 r124879 224 224 QMetaMethod method = meta->method(i); 225 225 if (method.access() != QMetaMethod::Private) { 226 #if HAVE(QT5)227 226 QByteArray sig = method.methodSignature(); 228 227 array.add(Identifier(exec, UString(sig.constData(), sig.length()))); 229 #else230 array.add(Identifier(exec, method.signature()));231 #endif232 228 } 233 229 } … … 276 272 if (m.access() != QMetaMethod::Private 277 273 && m.methodType() != QMetaMethod::Signal 278 #if HAVE(QT5)279 274 && m.parameterCount() == 0 280 275 && m.returnType() != QMetaType::Void) { … … 287 282 buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii? 288 283 useDefault = false; 289 #else290 && m.parameterTypes().isEmpty()) {291 const char* retsig = m.typeName();292 if (retsig && *retsig) {293 QVariant ret(QMetaType::type(retsig), (void*)0);294 void * qargs[1];295 qargs[0] = ret.data();296 297 if (QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, index, qargs) < 0) {298 if (ret.isValid() && ret.canConvert(QVariant::String)) {299 buf = ret.toString().toLatin1().constData(); // ### Latin 1? Ascii?300 useDefault = false;301 }302 #endif303 284 } 304 285 } … … 390 371 QMetaType::Type argtype = QMetaType::Void; 391 372 if (m_type == MetaProperty) 392 #if HAVE(QT5)393 373 argtype = (QMetaType::Type) m_property.userType(); 394 #else395 argtype = (QMetaType::Type) QMetaType::type(m_property.typeName());396 #endif397 374 398 375 // dynamic properties just get any QVariant -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r120704 r124879 239 239 class QtConnectionObject : public QObject 240 240 { 241 #if HAVE(QT5)242 241 Q_OBJECT_FAKE 243 #endif244 242 public: 245 243 QtConnectionObject(JSContextRef, PassRefPtr<QtInstance> senderInstance, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction); 246 244 ~QtConnectionObject(); 247 248 #if !HAVE(QT5)249 // Explicitly define these because want a custom qt_metacall(), so we can't use Q_OBJECT macro.250 static const QMetaObject staticMetaObject;251 virtual const QMetaObject *metaObject() const;252 virtual void *qt_metacast(const char *);253 virtual int qt_metacall(QMetaObject::Call, int, void **argv);254 #endif255 245 256 246 void execute(void **argv); -
trunk/Source/WebCore/page/qt/EventHandlerQt.cpp
r119098 r124879 51 51 #include "Scrollbar.h" 52 52 53 #if !HAVE(QT5)54 QT_BEGIN_NAMESPACE55 Q_GUI_EXPORT extern bool qt_tab_all_widgets; // from qapplication.cpp56 QT_END_NAMESPACE57 #endif58 59 53 namespace WebCore { 60 54 … … 67 61 bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const 68 62 { 69 #if HAVE(QT5)70 63 return !isKeyboardOptionTab(event); 71 #else72 return (isKeyboardOptionTab(event) ? !qt_tab_all_widgets : qt_tab_all_widgets);73 #endif74 64 } 75 65 -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r123702 r124879 69 69 typedef CGLContextObj PlatformGraphicsContext3D; 70 70 #elif PLATFORM(QT) 71 #if HAVE(QT5)72 71 typedef QOpenGLContext* PlatformGraphicsContext3D; 73 72 typedef QSurface* PlatformGraphicsSurface3D; 74 #else75 typedef QGLContext* PlatformGraphicsContext3D;76 typedef QGLWidget* PlatformGraphicsSurface3D;77 #endif78 73 #else 79 74 typedef void* PlatformGraphicsContext3D; -
trunk/Source/WebCore/platform/graphics/OpenGLShims.cpp
r122175 r124879 43 43 static void* getProcAddress(const char* procName) 44 44 { 45 #if HAVE(QT5)46 45 return reinterpret_cast<void*>(QOpenGLContext::currentContext()->getProcAddress(procName)); 47 #else48 return reinterpret_cast<void*>(QGLContext::currentContext()->getProcAddress(QString::fromLatin1(procName)));49 #endif50 46 } 51 47 #else -
trunk/Source/WebCore/platform/graphics/OpenGLShims.h
r119098 r124879 23 23 #if PLATFORM(QT) 24 24 #include <qglobal.h> 25 #if HAVE(QT5)26 25 #include <qopenglfunctions.h> 27 26 #include <QOpenGLContext> 28 27 #include <QSurface> 29 #else30 #include <QGLContext>31 #endif32 28 #else 33 29 #include <GL/gl.h> -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
r119098 r124879 24 24 #include <QTimer> 25 25 26 #if defined(HAVE_QT5) && HAVE_QT527 26 #include <QWindow> 28 #else29 #include <QWidget>30 #endif31 27 32 28 namespace WebCore { … … 34 30 class HTMLVideoElement; 35 31 36 #if defined(HAVE_QT5) && HAVE_QT5 37 typedef QWindow Base; 38 #else 39 typedef QWidget Base; 40 #endif 41 42 class FullScreenVideoWindow: public Base { 32 class FullScreenVideoWindow: public QWindow { 43 33 Q_OBJECT 44 34 public: -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
r119098 r124879 39 39 : m_mediaElement(0) 40 40 { 41 #if !HAVE(QT5)42 setAttribute(Qt::WA_NativeWindow);43 setAttribute(Qt::WA_NoSystemBackground, true);44 setAttribute(Qt::WA_PaintOnScreen, true);45 #endif46 41 setWindowModality(Qt::ApplicationModal); 47 42 … … 66 61 } else if (ev->key() == Qt::Key_Escape) 67 62 emit closed(); 68 Base::keyPressEvent(ev);63 QWindow::keyPressEvent(ev); 69 64 } 70 65 … … 84 79 m_cursorTimer.stop(); 85 80 #endif 86 #if !HAVE(QT5)87 setMouseTracking(false);88 releaseMouse();89 #endif90 81 #ifndef QT_NO_CURSOR 91 82 QGuiApplication::restoreOverrideCursor(); … … 95 86 break; 96 87 } 97 return Base::event(ev);88 return QWindow::event(ev); 98 89 } 99 90 100 91 void FullScreenVideoWindow::showFullScreen() 101 92 { 102 Base::showFullScreen(); 103 #if !HAVE(QT5) 104 setMouseTracking(true); 105 #endif 93 QWindow::showFullScreen(); 106 94 raise(); 107 #if !HAVE(QT5)108 setFocus();109 #endif110 95 hideCursor(); 111 96 } … … 129 114 PlatformVideoWindow::PlatformVideoWindow() 130 115 { 131 Base* win = new FullScreenVideoWindow();116 QWindow* win = new FullScreenVideoWindow(); 132 117 m_window = win; 133 118 win->setWindowFlags(win->windowFlags() | Qt::FramelessWindowHint); 134 119 // FIXME: Port to Qt 5. 135 #if !HAVE(QT5)136 QPalette p;137 p.setColor(QPalette::Base, Qt::black);138 p.setColor(QPalette::Window, Qt::black);139 win->setPalette(p);140 #endif141 120 win->showFullScreen(); 142 121 m_videoWindowId = win->winId(); -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r122953 r124879 35 35 #include "QWebPageClient.h" 36 36 #include "SharedBuffer.h" 37 #if HAVE(QT5)38 37 #include <QWindow> 39 38 #include <qpa/qplatformpixmap.h> 40 #endif41 39 #include <wtf/UnusedParam.h> 42 40 #include <wtf/text/CString.h> … … 256 254 return; 257 255 258 #if HAVE(QT5)259 256 const QOpenGLContext* currentContext = QOpenGLContext::currentContext(); 260 257 QSurface* currentSurface = 0; … … 266 263 if (currentSurface) 267 264 const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface); 268 #else269 const QGLContext* currentContext = QGLContext::currentContext();270 const QGLContext* widgetContext = m_surface->context();271 if (currentContext != widgetContext)272 m_surface->makeCurrent();273 blitMultisampleFramebuffer();274 if (currentContext) {275 if (currentContext != widgetContext)276 const_cast<QGLContext*>(currentContext)->makeCurrent();277 } else278 m_surface->doneCurrent();279 #endif280 265 } 281 266 282 267 bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const 283 268 { 284 #if HAVE(QT5)285 269 const QOpenGLContext* currentContext = QOpenGLContext::currentContext(); 286 270 if (currentContext == m_platformContext) 287 271 return true; 288 272 return m_platformContext->makeCurrent(m_surface); 289 #else290 const QGLContext* currentContext = QGLContext::currentContext();291 const QGLContext* widgetContext = m_surface->context();292 if (currentContext != widgetContext)293 m_surface->makeCurrent();294 295 return QGLContext::currentContext() == widgetContext;296 #endif297 273 } 298 274 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r123912 r124879 67 67 #include <wtf/MathExtras.h> 68 68 69 #if OS(WINDOWS) && HAVE(QT5)69 #if OS(WINDOWS) 70 70 Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0); 71 71 … … 1471 1471 ASSERT(info.bmBitsPixel == 32); 1472 1472 1473 #if HAVE(QT5)1474 1473 QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap, supportAlphaBlend ? HBitmapPremultipliedAlpha : HBitmapNoAlpha); 1475 #else1476 QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap, supportAlphaBlend ? QPixmap::PremultipliedAlpha : QPixmap::NoAlpha);1477 #endif1478 1474 m_data->p()->drawPixmap(dstRect, pixmap); 1479 1475 -
trunk/Source/WebCore/platform/graphics/qt/ImageQt.cpp
r122726 r124879 53 53 #include <math.h> 54 54 55 #if OS(WINDOWS) && HAVE(QT5)55 #if OS(WINDOWS) 56 56 Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0); 57 57 #endif … … 300 300 PassRefPtr<BitmapImage> BitmapImage::create(HBITMAP hBitmap) 301 301 { 302 #if HAVE(QT5)303 302 QImage* nativeImage = new QImage(qt_pixmapFromWinHBITMAP(hBitmap).toImage()); 304 #else 305 QImage* nativeImage = new QImage(QPixmap::fromWinHBITMAP(hBitmap).toImage()); 303 304 return BitmapImage::create(nativeImage); 305 } 306 306 #endif 307 307 308 return BitmapImage::create(nativeImage);309 }310 #endif311 312 308 } 313 309 -
trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
r119098 r124879 149 149 #endif 150 150 151 #if !HAVE(QT5)152 // Qt subtracts 1 from the descent to account for the baseline,153 // we add it back here to get correct metrics for WebKit.154 descent += 1;155 #endif156 157 151 // The line spacing should always be >= (ascent + descent), but this 158 152 // may be false in some cases due to misbehaving platform libraries. -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r122275 r124879 25 25 #if PLATFORM(QT) 26 26 #include <qglobal.h> 27 28 #if defined(QT_OPENGL_LIB) || HAVE(QT5) 29 #if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2) 30 #define TEXMAP_OPENGL_ES_2 31 #endif 27 #if defined(QT_OPENGL_ES_2) && !defined(TEXMAP_OPENGL_ES_2) 28 #define TEXMAP_OPENGL_ES_2 32 29 #endif 33 30 #endif -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r123894 r124879 39 39 #if PLATFORM(QT) 40 40 #include "NativeImageQt.h" 41 #if HAVE(QT5)42 41 #include <QOpenGLContext> 43 #else44 #include <QGLContext>45 #endif // QT_VERSION46 42 #elif OS(WINDOWS) 47 43 #include <windows.h> … … 63 59 struct SharedGLData : public RefCounted<SharedGLData> { 64 60 #if PLATFORM(QT) 65 #if QT_VERSION >= 0x05000066 61 typedef QOpenGLContext* GLContext; 67 62 static GLContext getCurrentGLContext() … … 69 64 return QOpenGLContext::currentContext(); 70 65 } 71 #else72 typedef const QGLContext* GLContext;73 static GLContext getCurrentGLContext()74 {75 return QGLContext::currentContext();76 }77 #endif78 66 #elif OS(WINDOWS) 79 67 typedef HGLRC GLContext; -
trunk/Source/WebCore/platform/qt/DeviceMotionProviderQt.h
r120224 r124879 25 25 #include <QAccelerometerFilter> 26 26 #include <wtf/RefPtr.h> 27 28 #if !HAVE(QT5)29 using QTM_NAMESPACE::QAccelerometer;30 using QTM_NAMESPACE::QAccelerometerFilter;31 using QTM_NAMESPACE::QAccelerometerReading;32 #endif33 27 34 28 namespace WebCore { -
trunk/Source/WebCore/platform/qt/DeviceOrientationProviderQt.h
r121016 r124879 26 26 #include <wtf/RefPtr.h> 27 27 28 #if !HAVE(QT5)29 using QTM_NAMESPACE::QRotationFilter;30 using QTM_NAMESPACE::QRotationReading;31 using QTM_NAMESPACE::QRotationSensor;32 #endif33 34 28 namespace WebCore { 35 29 -
trunk/Source/WebCore/platform/qt/KURLQt.cpp
r119098 r124879 35 35 KURL::operator QUrl() const 36 36 { 37 #if !HAVE(QT5)38 QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());39 QByteArray ba = str.toUtf8();40 41 QUrl url = QUrl::fromEncoded(ba);42 return url;43 #else44 37 return QUrl(m_string); 45 #endif46 38 } 47 39 -
trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp
r122655 r124879 39 39 #include "Widget.h" 40 40 #include "QWebPageClient.h" 41 #if HAVE(QT5)42 41 #include <QGuiApplication> 43 42 #include <QScreen> 44 #else45 #include <QApplication>46 #include <QDesktopWidget>47 #endif48 43 49 44 namespace WebCore { … … 72 67 int screenDepth(Widget* w) 73 68 { 74 #if HAVE(QT5)75 69 return QGuiApplication::screens().value(screenNumber(w))->depth(); 76 #else77 return QApplication::desktop()->screen(screenNumber(w))->depth();78 #endif79 70 } 80 71 81 72 int screenDepthPerComponent(Widget* w) 82 73 { 83 #if HAVE(QT5)84 74 int depth = QGuiApplication::primaryScreen()->depth(); 85 75 // FIXME: Use widget's screen 86 76 Q_UNUSED(w); 87 #else88 int depth = QApplication::desktop()->screen(0)->depth();89 if (w) {90 QWebPageClient* client = w->root()->hostWindow()->platformPageClient();91 92 if (client) {93 QWidget* view = client->ownerWidget();94 if (view)95 depth = view->depth();96 }97 }98 #endif99 77 // An interface to establish the actual number of bits per color 100 78 // doesn't exist in Qt, or probably at all, so use common-sense … … 115 93 bool screenIsMonochrome(Widget* w) 116 94 { 117 #if HAVE(QT5)118 95 Q_UNUSED(w); 119 96 // FIXME: In Qt 5 colorCount() isn't even implemented beyond returning 256 :) 120 97 return false; 121 #else122 return QApplication::desktop()->screen(screenNumber(w))->colorCount() == 2;123 #endif124 98 } 125 99 126 100 FloatRect screenRect(Widget* widget) 127 101 { 128 #if HAVE(QT5)129 102 QRect r = QGuiApplication::screens().value(screenNumber(widget))->geometry(); 130 #else131 QRect r = QApplication::desktop()->screenGeometry(screenNumber(widget));132 #endif133 103 return FloatRect(r.x(), r.y(), r.width(), r.height()); 134 104 } … … 136 106 FloatRect screenAvailableRect(Widget* widget) 137 107 { 138 #if HAVE(QT5)139 108 QRect r = QGuiApplication::screens().value(screenNumber(widget))->availableGeometry(); 140 #else141 QRect r = QApplication::desktop()->availableGeometry(screenNumber(widget));142 #endif143 109 return FloatRect(r.x(), r.y(), r.width(), r.height()); 144 110 } -
trunk/Source/WebCore/platform/qt/QWebPageClient.h
r122175 r124879 111 111 PlatformGraphicsSurface3D*) = 0; 112 112 #endif 113 #if HAVE(QT5)114 113 virtual QWindow* ownerWindow() const; 115 #endif116 114 117 115 protected: -
trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp
r123443 r124879 66 66 #include <QFontMetrics> 67 67 68 #if QT_VERSION >= 0x05000069 68 #include <QStyleHints> 70 #endif71 69 72 70 namespace WebCore { -
trunk/Source/WebCore/plugins/qt/PluginPackageQt.cpp
r119098 r124879 133 133 bool PluginPackage::isPluginBlacklisted() 134 134 { 135 #if HAVE(QT5)136 135 // TODO: enumerate all plugins that are incompatible with Qt5. 137 136 const QLatin1String pluginBlacklist[] = { … … 144 143 return true; 145 144 } 146 #endif147 145 return false; 148 146 } -
trunk/Source/WebCore/plugins/qt/PluginViewQt.cpp
r121710 r124879 80 80 #include <runtime/JSValue.h> 81 81 82 #if HAVE(QT5)83 82 #include "QtX11ImageConversion.h" 84 83 #include <QGuiApplication> 85 84 #include <qpa/qplatformnativeinterface.h> 86 85 #include <QWindow> 87 #else88 #include "PluginContainerQt.h"89 #include <QApplication>90 #include <QDesktopWidget>91 #include <QGraphicsWidget>92 #include <QStyleOptionGraphicsItem>93 #include <QWidget>94 #include <QX11Info>95 #endif96 86 97 87 using JSC::ExecState; … … 200 190 void PluginView::setFocus(bool focused) 201 191 { 202 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet (so platformPluginWidget() is always null). 203 if (platformPluginWidget()) { 204 if (focused) 205 static_cast<QWidget*>(platformPluginWidget())->setFocus(Qt::OtherFocusReason); 206 } else 207 #endif 208 Widget::setFocus(focused); 192 Widget::setFocus(focused); 209 193 } 210 194 … … 239 223 XEvent xevent; 240 224 241 #if HAVE(QT5)242 225 setupGraphicsExposeEvent(m_drawable, exposedRect, xevent); 243 #else244 QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);245 const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;246 ASSERT(drawableDepth == qtDrawable.depth());247 248 // When printing, Qt uses a QPicture to capture the output in preview mode. The249 // QPicture holds a reference to the X Pixmap. As a result, the print preview would250 // update itself when the X Pixmap changes. To prevent this, we create a copy.251 if (m_element->document()->printing())252 qtDrawable = qtDrawable.copy();253 254 if (m_isTransparent && drawableDepth != 32) {255 // Attempt content propagation for drawable with no alpha by copying over from the backing store256 QPoint offset;257 QPaintDevice* backingStoreDevice = QPainter::redirected(painter->device(), &offset);258 offset = -offset; // negating the offset gives us the offset of the view within the backing store pixmap259 260 const bool hasValidBackingStore = backingStoreDevice && backingStoreDevice->devType() == QInternal::Pixmap;261 QPixmap* backingStorePixmap = static_cast<QPixmap*>(backingStoreDevice);262 263 // We cannot grab contents from the backing store when painting on QGraphicsView items264 // (because backing store contents are already transformed). What we really mean to do265 // here is to check if we are painting on QWebView, but let's be a little permissive :)266 QWebPageClient* client = platformPageClient();267 const bool backingStoreHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());268 269 if (hasValidBackingStore && backingStorePixmap->depth() == drawableDepth270 && backingStoreHasUntransformedContents) {271 GC gc = XDefaultGC(QX11Info::display(), QX11Info::appScreen());272 XCopyArea(QX11Info::display(), backingStorePixmap->handle(), m_drawable, gc,273 offset.x() + m_windowRect.x() + exposedRect.x(), offset.y() + m_windowRect.y() + exposedRect.y(),274 exposedRect.width(), exposedRect.height(), exposedRect.x(), exposedRect.y());275 } else { // no backing store, clean the pixmap because the plugin thinks its transparent276 QPainter painter(&qtDrawable);277 painter.fillRect(exposedRect, Qt::white);278 }279 280 if (shouldSyncX)281 syncX();282 }283 284 setupGraphicsExposeEvent(qtDrawable.handle(), exposedRect, xevent);285 #endif286 287 226 dispatchNPEvent(xevent); 288 227 … … 290 229 XSync(m_pluginDisplay, false); // sync changes by plugin 291 230 292 #if HAVE(QT5)293 231 XImage* xImage = XGetImage(x11Display(), m_drawable, exposedRect.x(), exposedRect.y(), 294 232 exposedRect.width(), exposedRect.height(), ULONG_MAX, ZPixmap); 295 233 painter->drawImage(QPoint(exposedRect.x(), exposedRect.y()), qimageFromXImage(xImage), exposedRect); 296 234 XDestroyImage(xImage); 297 #else298 painter->drawPixmap(QPoint(exposedRect.x(), exposedRect.y()), qtDrawable, exposedRect);299 #endif300 235 } 301 236 … … 370 305 // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify 371 306 // events; thus, this is right: 372 #if HAVE(QT5)373 307 QWindow* window = pageClient ? pageClient->ownerWindow() : 0; 374 308 xEvent->xany.window = window ? window->winId() : 0; 375 #else376 QWidget* ownerWidget = pageClient ? pageClient->ownerWidget() : 0;377 xEvent->xany.window = ownerWidget ? ownerWidget->window()->winId() : 0;378 #endif379 309 } 380 310 … … 607 537 m_hasPendingGeometryChange = false; 608 538 609 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet 610 if (m_isWindowed) { 611 QWidget* widget = static_cast<QWidget*>(platformPluginWidget()); 612 widget->setGeometry(m_windowRect); 613 614 // Cut out areas of the plugin occluded by iframe shims 615 Vector<IntRect> cutOutRects; 616 QRegion clipRegion = QRegion(m_clipRect); 617 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 618 for (size_t i = 0; i < cutOutRects.size(); i++) { 619 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 620 clipRegion = clipRegion.subtracted(QRegion(cutOutRects[i])); 621 } 622 // if setMask is set with an empty QRegion, no clipping will 623 // be performed, so in that case we hide the plugin view 624 widget->setVisible(!clipRegion.isEmpty()); 625 widget->setMask(clipRegion); 626 627 m_npWindow.x = m_windowRect.x(); 628 m_npWindow.y = m_windowRect.y(); 629 } else 630 #endif 631 { 632 m_npWindow.x = 0; 633 m_npWindow.y = 0; 634 } 539 m_npWindow.x = 0; 540 m_npWindow.y = 0; 635 541 636 542 // If the width or height are null, set the clipRect to null, indicating that … … 677 583 678 584 Widget::setParentVisible(visible); 679 680 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.681 if (isSelfVisible() && platformPluginWidget())682 static_cast<QWidget*>(platformPluginWidget())->setVisible(visible);683 #endif684 585 } 685 586 … … 752 653 case NPNVnetscapeWindow: { 753 654 QWebPageClient* client = platformPageClient(); 754 #if HAVE(QT5)755 655 QWindow* window = client ? client->ownerWindow() : 0; 756 656 *reinterpret_cast<XID*>(value) = window ? window->winId() : 0; 757 #else758 *reinterpret_cast<XID*>(value) = client ? client->ownerWidget()->window()->winId() : 0;759 #endif760 657 *result = NPERR_NO_ERROR; 761 658 return true; … … 777 674 void PluginView::invalidateRect(const IntRect& rect) 778 675 { 779 #if !HAVE(QT5) // Windowed mode is not supported with Qt5 yet.780 if (m_isWindowed) {781 if (platformWidget()) {782 // update() will schedule a repaint of the widget so ensure783 // its knowledge of its position on the page is up to date.784 QWidget* w = static_cast<QWidget*>(platformWidget());785 w->setGeometry(m_windowRect);786 w->update(rect);787 }788 return;789 }790 #endif791 792 676 invalidateWindowlessPluginRect(rect); 793 677 } … … 850 734 colormap = 0; 851 735 852 #if !HAVE(QT5) && !defined(QT_NO_XRENDER) 853 static const bool useXRender = qgetenv("QT_X11_NO_XRENDER").isNull(); // Should also check for XRender >= 0.5 854 #else 855 static const bool useXRender = false; 856 #endif 857 if (!useXRender && forceARGB32) 736 if (forceARGB32) 858 737 return false; 859 738 … … 868 747 return false; 869 748 870 #if !HAVE(QT5) && !defined(QT_NO_XRENDER) 871 if (forceARGB32) { 872 for (int idx = 0; idx < nvi; ++idx) { 873 XRenderPictFormat* format = XRenderFindVisualFormat(x11Display(), xvi[idx].visual); 874 if (format->type == PictTypeDirect && format->direct.alphaMask) { 875 visual = xvi[idx].visual; 876 break; 877 } 878 } 879 if (!visual) 880 return false; 881 } else 882 #endif 883 { 884 visual = xvi[0].visual; 885 } 749 visual = xvi[0].visual; 886 750 ASSERT(visual); 887 751 … … 899 763 if (!x11Environment.display) { 900 764 Display* display; 901 #if HAVE(QT5)902 765 display = static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("display", 0)); 903 #else904 display = QX11Info::display();905 #endif906 766 x11Environment.display = display; 907 767 x11Environment.screenID = XDefaultScreen(display); … … 910 770 } 911 771 912 #if HAVE(QT5)913 772 // Windowed mode is not supported with Qt5 yet. 914 773 if (m_isWindowed) 915 774 return false; 916 #else 917 if (m_plugin->pluginFuncs()->getvalue) { 918 PluginView::setCurrentPluginView(this); 919 #if USE(JSC) 920 JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonJSGlobalData()); 921 #endif 922 setCallingPlugin(true); 923 m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed); 924 setCallingPlugin(false); 925 PluginView::setCurrentPluginView(0); 926 } 927 928 if (m_isWindowed) { 929 QWebPageClient* client = platformPageClient(); 930 if (m_needsXEmbed && client) { 931 setPlatformWidget(new PluginContainerQt(this, client->ownerWidget())); 932 // sync our XEmbed container window creation before sending the xid to plugins. 933 QApplication::syncX(); 934 } else { 935 notImplemented(); 936 m_status = PluginStatusCanNotLoadPlugin; 937 return false; 938 } 939 } else 940 #endif // HAVE(QT5) 941 { 942 setPlatformWidget(0); 943 m_pluginDisplay = getPluginDisplay(); 944 } 775 setPlatformWidget(0); 776 m_pluginDisplay = getPluginDisplay(); 945 777 946 778 // If the width and the height are not zero we show the PluginView. … … 951 783 wsi->type = 0; 952 784 953 #if !HAVE(QT5) 954 if (m_isWindowed) { 955 const QX11Info* x11Info = &static_cast<QWidget*>(platformPluginWidget())->x11Info(); 956 957 wsi->display = x11Info->display(); 958 wsi->visual = (Visual*)x11Info->visual(); 959 wsi->depth = x11Info->depth(); 960 wsi->colormap = x11Info->colormap(); 961 962 m_npWindow.type = NPWindowTypeWindow; 963 m_npWindow.window = (void*)static_cast<QWidget*>(platformPluginWidget())->winId(); 964 m_npWindow.width = -1; 965 m_npWindow.height = -1; 966 } else 967 #endif 968 { 969 #if !HAVE(QT5) 970 const QX11Info* x11Info = &QApplication::desktop()->x11Info(); 971 if ((x11Info->depth() == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth)) 972 && getVisualAndColormap(32, m_visual, m_colormap, /* forceARGB32 = */ true)) 973 wsi->depth = 32; 974 else 975 #endif 976 { 977 int depth = displayDepth(); 978 bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false); 979 ASSERT_UNUSED(found, found); 980 wsi->depth = depth; 981 } 982 983 wsi->display = x11Display(); 984 wsi->visual = m_visual; 985 wsi->colormap = m_colormap; 986 987 m_npWindow.type = NPWindowTypeDrawable; 988 m_npWindow.window = 0; // Not used? 989 m_npWindow.x = 0; 990 m_npWindow.y = 0; 991 m_npWindow.width = -1; 992 m_npWindow.height = -1; 993 } 785 int depth = displayDepth(); 786 bool found = getVisualAndColormap(depth, m_visual, m_colormap, /* forceARGB32 = */ false); 787 ASSERT_UNUSED(found, found); 788 wsi->depth = depth; 789 790 wsi->display = x11Display(); 791 wsi->visual = m_visual; 792 wsi->colormap = m_colormap; 793 794 m_npWindow.type = NPWindowTypeDrawable; 795 m_npWindow.window = 0; // Not used? 796 m_npWindow.x = 0; 797 m_npWindow.y = 0; 798 m_npWindow.width = -1; 799 m_npWindow.height = -1; 994 800 995 801 m_npWindow.ws_info = wsi; -
trunk/Source/WebCore/plugins/win/PluginViewWin.cpp
r121441 r124879 94 94 #if PLATFORM(QT) 95 95 #include "QWebPageClient.h" 96 #if HAVE(QT5)97 96 #include <QWindow> 98 #else99 #include <QWidget>100 #endif101 97 #endif 102 98 … … 117 113 if (!client) 118 114 return 0; 119 #if HAVE(QT5)120 115 if (QWindow* window = client->ownerWindow()) 121 116 return reinterpret_cast<HWND>(window->winId()); 122 #else123 if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))124 return pluginParent->winId();125 #endif126 117 return 0; 127 118 #elif PLATFORM(WX) -
trunk/Source/WebKit/ChangeLog
r124866 r124879 1 2012-07-19 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * WebKit.pri: 9 * WebKit1.pri: 10 * WebKit1.pro: 11 1 12 2012-08-07 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 13 -
trunk/Source/WebKit/WebKit.pri
r122702 r124879 38 38 $$PWD/qt/Api/qhttpheader_p.h 39 39 40 haveQt(5):contains(CONFIG, accessibility) {40 contains(CONFIG, accessibility) { 41 41 SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp 42 42 HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h -
trunk/Source/WebKit/WebKit1.pri
r124002 r124879 31 31 32 32 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1)|contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) { 33 haveQt(5) { 34 QT += sensors 35 } else { 36 CONFIG *= mobility 37 MOBILITY *= sensors 38 } 33 QT += sensors 39 34 } 40 35 41 contains(DEFINES, ENABLE_GEOLOCATION=1): haveQt(5):QT += location36 contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location 42 37 43 38 contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1 … … 45 40 plugin_backend_xlib: PKGCONFIG += x11 46 41 47 QT += network 48 haveQt(5): QT += widgets printsupport quick 42 QT += network widgets printsupport quick 49 43 50 44 contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) { -
trunk/Source/WebKit/WebKit1.pro
r122702 r124879 95 95 $$PWD/qt/WebCoreSupport/WebEventConversion.h 96 96 97 haveQt(5):contains(QT_CONFIG,accessibility) {97 contains(QT_CONFIG,accessibility) { 98 98 SOURCES += $$PWD/qt/Api/qwebviewaccessible.cpp 99 99 HEADERS += $$PWD/qt/Api/qwebviewaccessible_p.h -
trunk/Source/WebKit/qt/Api/qgraphicswebview.cpp
r121710 r124879 310 310 || event->type() == QEvent::TouchEnd 311 311 || event->type() == QEvent::TouchUpdate 312 #if HAVE(QT5)313 312 || event->type() == QEvent::TouchCancel 314 #endif315 313 )) { 316 314 d->page->event(event); -
trunk/Source/WebKit/qt/Api/qgraphicswebview.h
r119381 r124879 24 24 #include "qwebpage.h" 25 25 #include <QtCore/qurl.h> 26 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)27 26 #include <QtWidgets/qgraphicswidget.h> 28 #else29 #include <QtGui/qgraphicswidget.h>30 #endif31 27 #include <QtGui/qevent.h> 32 28 #include <QtGui/qicon.h> -
trunk/Source/WebKit/qt/Api/qwebframe.cpp
r122845 r124879 98 98 #include <qnetworkrequest.h> 99 99 100 #if ENABLE(ORIENTATION_EVENTS) && !HAVE(QT5)101 QTM_USE_NAMESPACE102 #endif103 104 100 using namespace WebCore; 105 101 … … 651 647 The ownership of \a object is specified using \a own. 652 648 */ 653 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)654 649 void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership) 655 #else656 void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)657 #endif658 650 { 659 651 if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled)) -
trunk/Source/WebKit/qt/Api/qwebframe.h
r120196 r124879 28 28 #include <QtNetwork/qnetworkaccessmanager.h> 29 29 #include "qwebkitglobal.h" 30 31 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)32 #include <QtScript/qscriptengine.h>33 #endif34 30 35 31 QT_BEGIN_NAMESPACE … … 125 121 126 122 public: 127 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)128 123 enum ValueOwnership { 129 124 QtOwnership, … … 131 126 AutoOwnership 132 127 }; 133 #endif134 128 135 129 QWebPage *page() const; … … 140 134 void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl()); 141 135 142 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)143 136 void addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership = QtOwnership); 144 #else145 void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership);146 #endif147 137 QString toHtml() const; 148 138 QString toPlainText() const; -
trunk/Source/WebKit/qt/Api/qwebframe_p.h
r121710 r124879 31 31 #if ENABLE(ORIENTATION_EVENTS) 32 32 #include "qorientationsensor.h" 33 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)34 using QTM_NAMESPACE::QOrientationSensor;35 #endif36 33 #endif // ENABLE(ORIENTATION_EVENTS). 37 34 #include "qwebelement.h" -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r123458 r124879 114 114 #endif // Q_OS_WIN32 115 115 #include "TextIterator.h" 116 #include "UtilsQt.h"117 116 #include "WebEventConversion.h" 118 117 #include "WindowFeatures.h" … … 3163 3162 case QEvent::TouchUpdate: 3164 3163 case QEvent::TouchEnd: 3165 #if HAVE(QT5)3166 3164 case QEvent::TouchCancel: 3167 #endif3168 3165 // Return whether the default action was cancelled in the JS event handler 3169 3166 return d->touchEvent(static_cast<QTouchEvent*>(ev)); -
trunk/Source/WebKit/qt/Api/qwebpage.h
r119381 r124879 27 27 #include <QtCore/qobject.h> 28 28 #include <QtCore/qurl.h> 29 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)30 29 #include <QtWidgets/qwidget.h> 31 #else32 #include <QtGui/qwidget.h>33 #endif34 30 35 31 QT_BEGIN_NAMESPACE -
trunk/Source/WebKit/qt/Api/qwebsettings.cpp
r123150 r124879 47 47 48 48 #include <QApplication> 49 #if HAVE(QT5)50 49 #include <QStandardPaths> 51 #else52 #include <QDesktopServices>53 #endif54 50 #include <QDir> 55 51 #include <QHash> … … 1146 1142 if (path.isEmpty()) { 1147 1143 1148 #if HAVE(QT5)1149 1144 storagePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation); 1150 #else1151 storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);1152 #endif1153 1145 if (storagePath.isEmpty()) 1154 1146 storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName()); … … 1169 1161 // All applications can share the common QtWebkit cache file(s). 1170 1162 // Path is not configurable and uses QDesktopServices::CacheLocation by default. 1171 #if HAVE(QT5)1172 1163 QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); 1173 #else1174 QString cachePath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);1175 #endif1176 1164 WebCore::makeAllDirectories(cachePath); 1177 1165 -
trunk/Source/WebKit/qt/Api/qwebview.cpp
r122702 r124879 35 35 #include "qfile.h" 36 36 #ifndef QT_NO_ACCESSIBILITY 37 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)38 37 #include "qwebviewaccessible_p.h" 39 #endif40 38 #endif 41 39 … … 155 153 156 154 #ifndef QT_NO_ACCESSIBILITY 157 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)158 155 static QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* object) 159 156 { … … 169 166 } 170 167 #endif 171 #endif172 168 173 169 /*! … … 192 188 193 189 #ifndef QT_NO_ACCESSIBILITY 194 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)195 190 QAccessible::installFactory(accessibleInterfaceFactory); 196 #endif197 191 #endif 198 192 } … … 733 727 || e->type() == QEvent::TouchEnd 734 728 || e->type() == QEvent::TouchUpdate 735 #if HAVE(QT5)736 729 || e->type() == QEvent::TouchCancel 737 #endif738 730 ) { 739 731 d->page->event(e); -
trunk/Source/WebKit/qt/Api/qwebview.h
r119381 r124879 24 24 #include "qwebkitglobal.h" 25 25 #include "qwebpage.h" 26 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)27 26 #include <QtWidgets/qwidget.h> 28 #else29 #include <QtGui/qwidget.h>30 #endif31 27 #include <QtGui/qicon.h> 32 28 #include <QtGui/qpainter.h> -
trunk/Source/WebKit/qt/ChangeLog
r124336 r124879 1 2012-08-02 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * Api/qgraphicswebview.cpp: 9 (QGraphicsWebView::sceneEvent): 10 * Api/qgraphicswebview.h: 11 * Api/qwebframe.cpp: 12 * Api/qwebframe.h: 13 * Api/qwebframe_p.h: 14 * Api/qwebpage.cpp: 15 (QWebPage::event): 16 * Api/qwebpage.h: 17 * Api/qwebsettings.cpp: 18 (QWebSettings::enablePersistentStorage): 19 * Api/qwebview.cpp: 20 (QWebView::QWebView): 21 (QWebView::event): 22 * Api/qwebview.h: 23 * WebCoreSupport/ChromeClientQt.cpp: 24 (WebCore::ChromeClientQt::setToolTip): 25 * WebCoreSupport/FrameLoaderClientQt.cpp: 26 (WebCore::FrameLoaderClientQt::createPlugin): 27 * WebCoreSupport/GeolocationClientQt.cpp: 28 * WebCoreSupport/GeolocationClientQt.h: 29 * WebCoreSupport/PageClientQt.cpp: 30 (createPlatformGraphicsContext3DFromWidget): 31 (QWebPageClient::ownerWindow): 32 * WebCoreSupport/WebEventConversion.cpp: 33 (WebCore::WebKitPlatformTouchEvent::WebKitPlatformTouchEvent): 34 * declarative/declarative.pro: 35 * declarative/plugin.cpp: 36 * declarative/public.pri: 37 * examples/platformplugin/WebPlugin.cpp: 38 (WebPlugin::createExtension): 39 * examples/platformplugin/WebPlugin.h: 40 (WebPlugin): 41 * examples/platformplugin/platformplugin.pro: 42 * tests/qobjectbridge/tst_qobjectbridge.cpp: 43 (tst_QObjectBridge::arrayObjectEnumerable): 44 (tst_QObjectBridge::ownership): 45 (tst_QObjectBridge::qObjectWrapperWithSameIdentity): 46 * tests/tests.pri: 47 * tests/util.h: 48 1 49 2012-08-01 Zeno Albisser <zeno@webkit.org> 2 50 -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r124336 r124879 76 76 #include <qtooltip.h> 77 77 #include <wtf/OwnPtr.h> 78 #include <wtf/qt/UtilsQt.h>79 78 80 79 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) … … 550 549 QToolTip::hideText(); 551 550 } else { 552 QString dtip = QLatin1String("<p>") + escapeHtml(tip) + QLatin1String("</p>");551 QString dtip = QLatin1String("<p>") + QString(tip).toHtmlEscaped() + QLatin1String("</p>"); 553 552 view->setToolTip(dtip); 554 553 } -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r122845 r124879 1605 1605 Vector<String> values = paramValues; 1606 1606 if (mimeType == "application/x-shockwave-flash") { 1607 #if HAVE(QT5)1608 const bool shouldInjectWmode = true;1609 #else1610 1607 // Inject wmode=opaque when there is no client or the client is not a QWebView. 1611 QWebPageClient* client = m_webFrame->page()->d->client.get(); 1612 const bool shouldInjectWmode = !(client && qobject_cast<QWidget*>(client->pluginParent())); 1613 #endif 1614 if (shouldInjectWmode) { 1615 // Inject wmode=opaque when there is no client or the client is not a QWebView. 1616 size_t wmodeIndex = params.find("wmode"); 1617 if (wmodeIndex == WTF::notFound) { 1618 params.append("wmode"); 1619 values.append("opaque"); 1620 } else if (equalIgnoringCase(values[wmodeIndex], "window")) 1621 values[wmodeIndex] = "opaque"; 1622 } 1608 size_t wmodeIndex = params.find("wmode"); 1609 if (wmodeIndex == WTF::notFound) { 1610 params.append("wmode"); 1611 values.append("opaque"); 1612 } else if (equalIgnoringCase(values[wmodeIndex], "window")) 1613 values[wmodeIndex] = "opaque"; 1623 1614 } 1624 1615 -
trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
r119970 r124879 39 39 #include "qwebpage_p.h" 40 40 41 #if !HAVE(QT5)42 #include <QGeoPositionInfoSource>43 #elif HAVE(QT5)44 41 #include <QtLocation/QGeoPositionInfoSource> 45 #endif46 42 47 43 namespace WebCore { -
trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
r123456 r124879 32 32 #include <wtf/RefPtr.h> 33 33 34 #if !HAVE(QT5)35 #include <QGeoPositionInfo>36 namespace QtMobility {37 class QGeoPositionInfoSource;38 };39 using namespace QtMobility;40 #elif HAVE(QT5)41 34 #include <QtLocation/QGeoPositionInfo> 42 35 QT_BEGIN_NAMESPACE 43 36 class QGeoPositionInfoSource; 44 37 QT_END_NAMESPACE 45 #endif46 38 47 39 -
trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
r122175 r124879 34 34 35 35 #if USE(3D_GRAPHICS) 36 #if HAVE(QT5)37 36 #include <QWindow> 38 #endif39 37 40 38 static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformGraphicsContext3D* context, … … 55 53 // Geometry can be set to zero because m_glWidget is used only for its QGLContext. 56 54 glWidget->setGeometry(0, 0, 0, 0); 57 #if HAVE(QT5)58 55 *surface = glWidget->windowHandle(); 59 56 *context = glWidget->context()->contextHandle(); 60 #else61 *surface = glWidget;62 *context = const_cast<QGLContext*>(glWidget->context());63 #endif64 57 } else { 65 58 delete glWidget; … … 75 68 #endif 76 69 77 #if HAVE(QT5)78 70 QWindow* QWebPageClient::ownerWindow() const 79 71 { … … 87 79 return 0; 88 80 } 89 #endif90 81 91 82 namespace WebCore { -
trunk/Source/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
r119098 r124879 244 244 m_type = PlatformEvent::TouchEnd; 245 245 break; 246 #if HAVE(QT5)247 246 case QEvent::TouchCancel: 248 247 m_type = PlatformEvent::TouchCancel; 249 248 break; 250 #endif251 249 } 252 250 -
trunk/Source/WebKit/qt/declarative/declarative.pro
r121777 r124879 12 12 SUBDIRS += public_api 13 13 14 haveQt(5):!no_webkit2 {14 !no_webkit2 { 15 15 experimental_api.file = experimental/experimental.pri 16 16 experimental_api.makefile = Makefile.declarative.experimental -
trunk/Source/WebKit/qt/declarative/plugin.cpp
r120594 r124879 26 26 #endif 27 27 28 #if (HAVE(QT5))29 28 #include <QtQml/qqml.h> 30 29 #include <QtQml/qqmlextensionplugin.h> 31 #else32 #include <QtDeclarative/qdeclarative.h>33 #include <QtDeclarative/qdeclarativeextensionplugin.h>34 #endif35 30 36 31 #if defined(HAVE_WEBKIT2) … … 47 42 QT_BEGIN_NAMESPACE 48 43 49 #if QT_VERSION >= 0x05000050 44 class WebKitQmlPlugin : public QQmlExtensionPlugin { 51 45 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "plugin.json") 52 #else53 class WebKitQmlPlugin : public QDeclarativeExtensionPlugin {54 #endif55 46 Q_OBJECT 56 47 public: … … 89 80 90 81 #include "plugin.moc" 91 92 #if QT_VERSION < 0x05000093 Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));94 #endif -
trunk/Source/WebKit/qt/declarative/public.pri
r121851 r124879 25 25 wince*:LIBS += $$QMAKE_LIBS_GUI 26 26 27 QT += webkit webkit-private 28 haveQt(4): QT += declarative 29 haveQt(5): QT += widgets quick quick-private 27 QT += webkit webkit-private widgets quick quick-private 30 28 31 29 contains(DEFINES, HAVE_QQUICK1=1) { -
trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp
r121324 r124879 315 315 } 316 316 } 317 318 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)319 Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)320 #endif -
trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h
r123456 r124879 140 140 Q_OBJECT 141 141 Q_INTERFACES(QWebKitPlatformPlugin) 142 #if QT_VERSION >= 0x050000143 142 Q_PLUGIN_METADATA(IID "org.qt-project.QtWebKit.PlatformPluginInterface") 144 #endif145 143 public: 146 144 virtual bool supportsExtension(Extension extension) const; -
trunk/Source/WebKit/qt/examples/platformplugin/platformplugin.pro
r121230 r124879 2 2 TARGET = platformplugin 3 3 4 QT += core gui 5 haveQt(5): QT += widgets 4 QT += core gui widgets 6 5 CONFIG += plugin 7 6 -
trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp
r120196 r124879 37 37 Q_DECLARE_METATYPE(QVariantList) 38 38 Q_DECLARE_METATYPE(QVariantMap) 39 40 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)41 #define OwnershipClass QWebFrame42 #else43 #define OwnershipClass QScriptEngine44 #endif45 39 46 40 class MyQObject : public QObject { … … 2001 1995 QWebFrame* frame = page.mainFrame(); 2002 1996 QObject* qobject = new StringListTestObject(); 2003 frame->addToJavaScriptWindowObject("test", qobject, OwnershipClass::ScriptOwnership);1997 frame->addToJavaScriptWindowObject("test", qobject, QWebFrame::ScriptOwnership); 2004 1998 2005 1999 const QString script("var stringArray = test.stringList();" … … 2042 2036 QWebPage page; 2043 2037 QWebFrame* frame = page.mainFrame(); 2044 frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::ScriptOwnership);2038 frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::ScriptOwnership); 2045 2039 } 2046 2040 QVERIFY(!ptr); … … 2053 2047 QWebPage page; 2054 2048 QWebFrame* frame = page.mainFrame(); 2055 frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::QtOwnership);2049 frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::QtOwnership); 2056 2050 } 2057 2051 QVERIFY(ptr.data() == before); … … 2063 2057 QWebPage page; 2064 2058 QWebFrame* frame = page.mainFrame(); 2065 frame->addToJavaScriptWindowObject("test", child, OwnershipClass::QtOwnership);2059 frame->addToJavaScriptWindowObject("test", child, QWebFrame::QtOwnership); 2066 2060 QVariant v = frame->evaluateJavaScript("test"); 2067 2061 QCOMPARE(qvariant_cast<QObject*>(v), child); … … 2076 2070 QWebPage page; 2077 2071 QWebFrame* frame = page.mainFrame(); 2078 frame->addToJavaScriptWindowObject("test", ptr.data(), OwnershipClass::AutoOwnership);2072 frame->addToJavaScriptWindowObject("test", ptr.data(), QWebFrame::AutoOwnership); 2079 2073 } 2080 2074 // no parent, so it should be like ScriptOwnership … … 2088 2082 QWebPage page; 2089 2083 QWebFrame* frame = page.mainFrame(); 2090 frame->addToJavaScriptWindowObject("test", child.data(), OwnershipClass::AutoOwnership);2084 frame->addToJavaScriptWindowObject("test", child.data(), QWebFrame::AutoOwnership); 2091 2085 } 2092 2086 // has parent, so it should be like QtOwnership … … 2130 2124 QCOMPARE(mainFrame->toPlainText(), QString("test")); 2131 2125 2132 mainFrame->addToJavaScriptWindowObject("test", new TestFactory, OwnershipClass::ScriptOwnership);2126 mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QWebFrame::ScriptOwnership); 2133 2127 2134 2128 mainFrame->evaluateJavaScript("triggerBug();"); -
trunk/Source/WebKit/qt/tests/tests.pri
r110272 r124879 17 17 $$PWD/../Api 18 18 19 QT += testlib network webkit 20 haveQt(5): QT += widgets 21 22 haveQt(4): haveQtModule(declarative): QT += declarative 19 QT += testlib network webkit widgets 23 20 24 21 # This define is used by some tests to look up resources in the source tree -
trunk/Source/WebKit/qt/tests/util.h
r121959 r124879 54 54 } 55 55 56 #if !(defined(HAVE_QT5) && HAVE_QT5)57 // Will try to wait for the condition while allowing event processing58 #define QTRY_VERIFY(__expr) \59 do { \60 const int __step = 50; \61 const int __timeout = 5000; \62 if (!(__expr)) { \63 QTest::qWait(0); \64 } \65 for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \66 QTest::qWait(__step); \67 } \68 QVERIFY(__expr); \69 } while(0)70 71 // Will try to wait for the condition while allowing event processing72 #define QTRY_COMPARE(__expr, __expected) \73 do { \74 const int __step = 50; \75 const int __timeout = 5000; \76 if ((__expr) != (__expected)) { \77 QTest::qWait(0); \78 } \79 for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \80 QTest::qWait(__step); \81 } \82 QCOMPARE(__expr, __expected); \83 } while(0)84 85 // Compatibility for Qt586 #define W_QSKIP(a, b) QSKIP(a, b)87 #else88 56 #define W_QSKIP(a, b) QSKIP(a) 89 #endif -
trunk/Source/WebKit2/ChangeLog
r124875 r124879 1 2012-07-19 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * UIProcess/API/qt/qquickwebview.cpp: 9 * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp: 10 (gatherAPI): 11 * WebKit2.pri: 12 1 13 2012-08-07 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 14 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
r124758 r124879 33 33 #include "QtWebPageLoadClient.h" 34 34 #include "QtWebPagePolicyClient.h" 35 #include "UtilsQt.h"36 35 #include "WebBackForwardList.h" 37 36 #include "WebInspectorProxy.h" -
trunk/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
r119098 r124879 145 145 if (method.access() != QMetaMethod::Private) { 146 146 const char* methodTypeName = !!strlen(method.typeName()) ? method.typeName() : "void"; 147 #if HAVE(QT5)148 147 *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(QString::fromLatin1(method.methodSignature())).arg(QString::fromLatin1(methodTypeName)); 149 #else150 *output << QString::fromLatin1("%1%2 --> %3").arg(prefix).arg(method.signature()).arg(methodTypeName);151 #endif152 148 153 149 checkKnownType(methodTypeName); -
trunk/Source/WebKit2/WebKit2.pri
r124701 r124879 78 78 QT += qml quick 79 79 80 contains(DEFINES, ENABLE_GEOLOCATION=1): haveQt(5):QT += location80 contains(DEFINES, ENABLE_GEOLOCATION=1): QT += location -
trunk/Source/api.pri
r122845 r124879 10 10 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib 11 11 12 haveQt(5) { 13 # Use Qt5's module system 14 load(qt_build_config) 15 MODULE = webkit 16 MODULE_PRI = ../Tools/qmake/qt_webkit.pri 12 # Use Qt5's module system 13 load(qt_build_config) 14 MODULE = webkit 15 MODULE_PRI = ../Tools/qmake/qt_webkit.pri 17 16 18 19 20 21 22 23 24 25 26 27 17 # ---------------- Custom developer-build handling ------------------- 18 # 19 # The assumption for Qt developer builds is that the module file 20 # will be put into qtbase/mkspecs/modules, and the libraries into 21 # qtbase/lib, with rpath/install_name set to the Qt lib dir. 22 # 23 # For WebKit we don't want that behavior for the libraries, as we want 24 # them to be self-contained in the WebKit build dir. 25 # 26 CONFIG += force_independent 28 27 29 28 BASE_TARGET = $$TARGET 30 29 31 30 load(qt_module_config) 32 31 33 # Make sure the module config doesn't override our preferred build config. 34 debug_and_release:if(!debug|!release) { 35 # Removing debug_and_release causes issues with lib suffixes when building debug on Windows. 36 # Work around it by only removing build_all, and still create the Makefiles for both configurations. 37 win32*: CONFIG -= build_all 38 else: CONFIG -= debug_and_release 39 } 40 41 # Allow doing a debug-only build of WebKit (not supported by Qt) 42 macx:!debug_and_release:debug: TARGET = $$BASE_TARGET 43 44 # Make sure the install_name of the QtWebKit library point to webkit 45 macx { 46 # We do our own absolute path so that we can trick qmake into 47 # using the webkit build path instead of the Qt install path. 48 CONFIG -= absolute_library_soname 49 QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/ 50 51 !debug_and_release|build_pass { 52 # We also have to make sure the install_name is correct when 53 # the library is installed. 54 change_install_name.depends = install_target 55 56 # The install rules generated by qmake for frameworks are busted in 57 # that both the debug and the release makefile copy QtWebKit.framework 58 # into the install dir, so whatever changes we did to the release library 59 # will get overwritten when the debug library is installed. We work around 60 # that by running install_name on both, for both configs. 61 change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \ 62 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \ 63 install_name_tool -id \$\$file \$\$file; \ 64 done 65 default_install_target.target = install 66 default_install_target.depends += change_install_name 67 68 QMAKE_EXTRA_TARGETS += change_install_name default_install_target 69 } 70 } 71 } else { 72 VERSION = $$QT_VERSION 73 DESTDIR = $$WEBKIT_DESTDIR 32 # Make sure the module config doesn't override our preferred build config. 33 debug_and_release:if(!debug|!release) { 34 # Removing debug_and_release causes issues with lib suffixes when building debug on Windows. 35 # Work around it by only removing build_all, and still create the Makefiles for both configurations. 36 win32*: CONFIG -= build_all 37 else: CONFIG -= debug_and_release 74 38 } 75 39 76 runSyncQt() # Generate forwarding headers for the QtWebKit API 40 # Allow doing a debug-only build of WebKit (not supported by Qt) 41 macx:!debug_and_release:debug: TARGET = $$BASE_TARGET 42 43 # Make sure the install_name of the QtWebKit library point to webkit 44 macx { 45 # We do our own absolute path so that we can trick qmake into 46 # using the webkit build path instead of the Qt install path. 47 CONFIG -= absolute_library_soname 48 QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/ 49 50 !debug_and_release|build_pass { 51 # We also have to make sure the install_name is correct when 52 # the library is installed. 53 change_install_name.depends = install_target 54 55 # The install rules generated by qmake for frameworks are busted in 56 # that both the debug and the release makefile copy QtWebKit.framework 57 # into the install dir, so whatever changes we did to the release library 58 # will get overwritten when the debug library is installed. We work around 59 # that by running install_name on both, for both configs. 60 change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \ 61 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \ 62 install_name_tool -id \$\$file \$\$file; \ 63 done 64 default_install_target.target = install 65 default_install_target.depends += change_install_name 66 67 QMAKE_EXTRA_TARGETS += change_install_name default_install_target 68 } 69 } 77 70 78 71 WEBKIT += wtf … … 92 85 93 86 !no_webkit1: WEBKIT += webkit1 94 95 # ------------- Install rules -------------96 97 haveQt(5) {98 # Install rules handled by Qt's module system99 } else {100 # For Qt4 we have to set up install rules manually101 102 # Syncqt has already run at this point, so we can use headers.pri103 # as a basis for our install-rules104 HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri105 !include($$HEADERS_PRI): error(Failed to resolve install headers)106 107 headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES108 !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}109 else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}110 INSTALLS += headers111 112 !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS113 else: target.path = $$[QT_INSTALL_LIBS]114 INSTALLS += target115 116 unix {117 CONFIG += create_pc create_prl118 QMAKE_PKGCONFIG_LIBDIR = $$target.path119 QMAKE_PKGCONFIG_INCDIR = $$headers.path120 QMAKE_PKGCONFIG_DESTDIR = pkgconfig121 lib_replace.match = $$re_escape($$DESTDIR)122 lib_replace.replace = $$[QT_INSTALL_LIBS]123 QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace124 }125 126 mac {127 !static:contains(QT_CONFIG, qt_framework) {128 # Build QtWebKit as a framework, to match how Qt was built129 CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework130 131 # For debug_and_release configs, only copy headers in release132 !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {133 FRAMEWORK_HEADERS.version = Versions134 FRAMEWORK_HEADERS.files = $${headers.files}135 FRAMEWORK_HEADERS.path = Headers136 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS137 }138 }139 140 QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"141 }142 } -
trunk/Tools/ChangeLog
r124877 r124879 1 2012-08-02 Simon Hausmann <simon.hausmann@nokia.com> 2 3 [Qt] Remove Qt 4 specific code paths 4 https://bugs.webkit.org/show_bug.cgi?id=88161 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * DumpRenderTree/qt/DumpRenderTree.pro: 9 * DumpRenderTree/qt/EventSenderQt.cpp: 10 (EventSender::touchCancel): 11 (EventSender::sendTouchEvent): 12 * DumpRenderTree/qt/EventSenderQt.h: 13 (EventSender): 14 * DumpRenderTree/qt/ImageDiff.pro: 15 * DumpRenderTree/qt/main.cpp: 16 (main): 17 * QtTestBrowser/QtTestBrowser.pro: 18 * QtTestBrowser/cookiejar.cpp: 19 (TestBrowserCookieJar::TestBrowserCookieJar): 20 * QtTestBrowser/launcherwindow.cpp: 21 (LauncherWindow::setDiskCache): 22 * qmake/configure.pri: 23 * qmake/mkspecs/features/default_post.prf: 24 * qmake/mkspecs/features/default_pre.prf: 25 * qmake/mkspecs/features/features.prf: 26 * qmake/mkspecs/features/functions.prf: 27 * qmake/mkspecs/features/qtwebkit.prf: Removed. 28 * qmake/mkspecs/features/unix/default_pre.prf: 29 1 30 2012-08-07 Andras Becsi <andras.becsi@nokia.com> 2 31 -
trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro
r124581 r124879 19 19 $${ROOT_WEBKIT_DIR}/Source/WTF 20 20 21 QT = core gui network testlib webkit 21 QT = core gui network testlib webkit widgets printsupport 22 22 macx: QT += xml 23 haveQt(5): QT += widgets printsupport24 23 25 24 contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig -
trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp
r119098 r124879 478 478 } 479 479 480 #if QT_VERSION >= 0x050000481 480 void EventSender::touchCancel() 482 481 { … … 484 483 m_touchActive = false; 485 484 } 486 #endif487 485 488 486 void EventSender::clearTouchPoints() … … 512 510 void EventSender::sendTouchEvent(QEvent::Type type) 513 511 { 514 #if HAVE(QT5)515 512 static QTouchDevice* device = 0; 516 513 if (!device) { … … 521 518 522 519 QTouchEvent event(type, device, m_touchModifiers); 523 #else524 QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);525 #endif526 520 event.setTouchPoints(m_touchPoints); 527 521 sendEvent(m_page, &event); -
trunk/Tools/DumpRenderTree/qt/EventSenderQt.h
r114917 r124879 75 75 void touchMove(); 76 76 void touchEnd(); 77 #if QT_VERSION >= 0x05000078 77 void touchCancel(); 79 #endif80 78 void zoomPageIn(); 81 79 void zoomPageOut(); -
trunk/Tools/DumpRenderTree/qt/ImageDiff.pro
r99274 r124879 10 10 DESTDIR = $$ROOT_BUILD_DIR/bin 11 11 12 QT = core gui 13 haveQt(5): QT += widgets 12 QT = core gui widgets 14 13 15 14 SOURCES = ImageDiff.cpp -
trunk/Tools/DumpRenderTree/qt/main.cpp
r124581 r124879 124 124 app.setQuitOnLastWindowClosed(false); 125 125 126 #if HAVE(QT5)127 126 QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true); 128 #else129 #ifdef Q_WS_X11130 QX11Info::setAppDpiY(0, 96);131 QX11Info::setAppDpiX(0, 96);132 #endif133 134 /*135 * QApplication will initialize the default application font based136 * on the application DPI at construction time, which might be137 * different from the DPI we explicitly set using QX11Info above.138 * See: https://bugreports.qt.nokia.com/browse/QTBUG-21603139 *140 * To ensure that the application font DPI matches the application141 * DPI, we override the application font using the font we get from142 * a QWidget, which has already been resolved against the existing143 * default font, but with the correct paint-device DPI.144 */145 QApplication::setFont(QWidget().font());146 #endif147 127 148 128 WTFInstallReportBacktraceOnCrashHook(); -
trunk/Tools/QtTestBrowser/QtTestBrowser.pro
r121777 r124879 43 43 DESTDIR = $$ROOT_BUILD_DIR/bin 44 44 45 QT += network webkit 45 QT += network webkit printsupport widgets 46 46 47 47 macx:QT += xml 48 haveQt(5): QT += printsupport widgets49 48 50 49 contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig -
trunk/Tools/QtTestBrowser/cookiejar.cpp
r119098 r124879 30 30 #include "cookiejar.h" 31 31 32 #if HAVE(QT5)33 32 #include <QStandardPaths> 34 #else35 #include <QDesktopServices>36 #endif37 33 #include <QDir> 38 34 #include <QTextStream> … … 49 45 50 46 #ifndef QT_NO_DESKTOPSERVICES 51 #if HAVE(QT5)52 47 QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); 53 #else54 QString path = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);55 #endif56 48 #else 57 49 QString path = QDir::homePath() + "/.QtTestBrowser"; -
trunk/Tools/QtTestBrowser/launcherwindow.cpp
r119098 r124879 67 67 68 68 #if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES) 69 #if HAVE(QT5)70 69 #include <QStandardPaths> 71 #else72 #include <QDesktopServices>73 #endif74 70 #include <QtNetwork/QNetworkDiskCache> 75 71 #endif … … 809 805 if (enable) { 810 806 cache = new QNetworkDiskCache(); 811 #if HAVE(QT5)812 807 QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); 813 #else814 QString cacheLocation = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);815 #endif816 808 cache->setCacheDirectory(cacheLocation); 817 809 } -
trunk/Tools/qmake/configure.pri
r123208 r124879 6 6 # ------------------------------------------------------------------- 7 7 8 haveQt(5):!quick_check {8 !quick_check { 9 9 load(configure) 10 10 QMAKE_CONFIG_TESTS_DIR = $$PWD/config.tests -
trunk/Tools/qmake/mkspecs/features/default_post.prf
r122947 r124879 19 19 DEFINES += \ 20 20 BUILDING_QT__=1 21 22 haveQt(5): DEFINES += HAVE_QT5=123 21 24 22 CONFIG(release, debug|release): DEFINES *= NDEBUG … … 149 147 150 148 contains(QT, webkit) { 151 haveQt(4) {152 # Qt 4 still uses custom rules to depend on QtWebKit153 load(qtwebkit)154 }155 156 149 # In addition to the main shared QtWebKit library we also 157 150 # need to link to any intermediate shared libraries. … … 239 232 } 240 233 241 # Doing '$(MAKE) qmake' should recurse through all subdirs. In Qt5, this is242 # automatic (for 'qmake_all', while 'qmake' does not enter subdirs at all).243 haveQt(4):contains(TEMPLATE, subdirs):!no_recursive_qmake {244 recursive_qmake.target = qmake_all245 246 # We could do this using CONFIG += recurse but that adds247 # a dependency for each recursive target on its makefile,248 # while we want it to depend on *-qmake_all, so that we249 # don't end up running qmake twice.250 251 for(subdir, SUBDIRS) {252 contains(NO_RECURSIVE_QMAKE_SUBDIRS, $${subdir}) {253 debug(1, Skipping recursive qmake for $${subdir})254 next()255 }256 257 subdir_config = $$eval($${subdir}.CONFIG)258 contains(subdir_config, no_default_target):next()259 260 debug(1, "Making qmake recursive for $$subdir")261 262 variables = $$computeSubdirVariables($${subdir})263 264 target_name = $$eval($${variables}.target)-recursive_qmake265 266 eval($${target_name}.target = $$target_name)267 eval($${target_name}.depends = $$eval($${variables}.target)-qmake_all)268 commands = $$eval($${variables}.subdir_command) $(MAKE) -f $$eval($${variables}.makefile) qmake269 eval($${target_name}.commands = $$commands)270 271 QMAKE_EXTRA_TARGETS += $${target_name}272 recursive_qmake.depends += $${target_name}273 }274 275 !isEmpty(recursive_qmake.depends): QMAKE_EXTRA_TARGETS += recursive_qmake276 }277 278 234 incremental.target = incremental 279 235 incremental.commands = $(MAKE) -f $(MAKEFILE) qmake_all && $(MAKE) -f $(MAKEFILE) … … 313 269 DESTDIR = $$replace(DESTDIR, ^$${ROOT_BUILD_DIR}, $${BUILD_ROOT_RELATIVE_TO_OUT_PWD}) 314 270 315 # Since we loaded our own rules for depending on QtWebKit, and we316 # have no more logic that checks contains(QT, webkit), we unset it317 # here so that Qt will not add its own include and library paths.318 haveQt(4): QT -= webkit webkit-private319 320 271 load(default_post) # Load Qt's defaults -
trunk/Tools/qmake/mkspecs/features/default_pre.prf
r124607 r124879 57 57 } 58 58 59 haveQt(4) {60 # Make sure QMAKEPATH is set for recursive targets61 win_cmd_shell: QMAKE_QMAKE = \(set QMAKEPATH=$$(QMAKEPATH)\) && $$QMAKE_QMAKE62 else: QMAKE_QMAKE = QMAKEPATH=$$(QMAKEPATH) $$QMAKE_QMAKE63 }64 65 59 # Default location of generated sources 66 60 GENERATED_SOURCES_DESTDIR = generated … … 83 77 else: PYTHON = python 84 78 85 !haveQt( 4, 8):!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 4.8is not supported.")79 !haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.") 86 80 87 !haveQt(5):!no_webkit2 { 88 root_project_file { 89 message("Building WebKit2 with Qt versions older than 5.0 is not supported. Disabling WebKit2.") 90 message("Read http://www.mail-archive.com/webkit-qt@lists.webkit.org/msg01674.html for more information.") 91 } 92 CONFIG += no_webkit2 93 } 94 95 haveQt(5): { 96 !haveQtModule(widgets)|!haveQtModule(printsupport) { 97 root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.") 98 CONFIG += no_webkit1 99 } 81 !haveQtModule(widgets)|!haveQtModule(printsupport) { 82 root_project_file: message("WebKit1 requires the QtWidgets and QtPrintSupport modules. Disabling WebKit1.") 83 CONFIG += no_webkit1 100 84 } 101 85 … … 103 87 # always be our webkit build dir. This might change as configure changes. 104 88 contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build 105 106 haveQt(4) {107 # Qt5 will automatically load the module files for us, but for Qt4108 # we have to do it manually so that the various QT.webkit.foo names109 # are available.110 include($${ROOT_WEBKIT_DIR}/Tools/qmake/qt_webkit.pri)111 }112 89 113 90 # Set some defaults for specific platforms … … 117 94 SQLITE3SRCDIR = $$(SQLITE3SRCDIR) 118 95 isEmpty(SQLITE3SRCDIR) { 119 haveQt(5): SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/ 120 else: SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/ 96 SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/ 121 97 } 122 98 -
trunk/Tools/qmake/mkspecs/features/features.prf
r123453 r124879 32 32 # unset the opposite value, that's handled automatically for you. 33 33 34 # For Mac we do not rely on QT_CONFIG, because icu is not officially supported for all of qt. 35 haveQt(5):if(contains(QT_CONFIG,icu)|mac) { 36 DEFINES += WTF_USE_ICU_UNICODE=1 37 DEFINES -= WTF_USE_QT4_UNICODE=1 38 } else { 39 DEFINES += WTF_USE_QT4_UNICODE=1 40 DEFINES -= WTF_USE_ICU_UNICODE=1 41 } 34 DEFINES += WTF_USE_ICU_UNICODE=1 35 DEFINES -= WTF_USE_QT4_UNICODE=1 42 36 43 37 !contains(DEFINES, HAVE_QRAWFONT=.) { 44 38 # Use of QRawFont in Qt 5: 45 haveQt(5):DEFINES += HAVE_QRAWFONT=139 DEFINES += HAVE_QRAWFONT=1 46 40 } 47 41 48 42 # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner. 49 haveQt(5) { 50 config_fontconfig:!mac { 51 DEFINES += HAVE_FONTCONFIG=1 52 } 53 } else { 54 # Qt 4 55 unix:!mac:!embedded { 56 DEFINES += HAVE_FONTCONFIG=1 57 } 43 config_fontconfig:!mac { 44 DEFINES += HAVE_FONTCONFIG=1 58 45 } 59 46 … … 81 68 # Nescape plugins support (NPAPI) 82 69 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) { 83 haveQt(5):xlibAvailable() {70 xlibAvailable() { 84 71 DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1 85 72 CONFIG += plugin_backend_xlib … … 106 93 107 94 # QStyle detection 108 haveQt (4)|haveQtModule(widgets): DEFINES += HAVE_QSTYLE=195 haveQtModule(widgets): DEFINES += HAVE_QSTYLE=1 109 96 110 97 # WebGL support … … 135 122 136 123 # orientation support 137 haveQt(5) { 138 haveQtModule(sensors) { 139 !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1 140 !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1 141 } 142 } else { 143 # Qt 4 with Qt Mobility 144 contains(MOBILITY_CONFIG, sensors) { 145 !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1 146 !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1 147 } 124 haveQtModule(sensors) { 125 !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1 126 !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1 148 127 } 149 128 … … 170 149 } 171 150 172 haveQt(4) {173 haveQtModule(declarative): DEFINES += HAVE_QQUICK1=1174 } else {175 # FIXME: Add Qt 5 QQuick1 support once QDeclarativeEngine in QQuick2176 # is called QmlEngine and it is safe for us to use QQuick1 again.177 }178 179 151 # Xcomposite Support 180 haveQt(5):linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1152 linux-*:config_libXcomposite: DEFINES += HAVE_XCOMPOSITE=1 181 153 182 154 # Xrender Support … … 188 160 # Support for Graphics Surface 189 161 !contains(DEFINES, WTF_USE_GRAPHICS_SURFACE=.) { 190 haveQt(5) { 191 mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1 192 # On linux we require GLX, libXcomposite and libXrender to enable graphics surface. 193 linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1 194 } 162 mac: DEFINES += WTF_USE_GRAPHICS_SURFACE=1 163 # On linux we require GLX, libXcomposite and libXrender to enable graphics surface. 164 linux-*:contains(DEFINES, HAVE_GLX=1):contains(DEFINES, HAVE_XCOMPOSITE=1):contains(DEFINES, HAVE_XRENDER=1): DEFINES += WTF_USE_GRAPHICS_SURFACE=1 195 165 } 196 166 … … 238 208 # Disable USE(3D_GRAPHICS) on Windows temporarily, see https://bugs.webkit.org/show_bug.cgi?id=90850 for details. 239 209 !win32-* { 240 haveQt(5)|contains(QT_CONFIG, opengl): DEFINES += WTF_USE_3D_GRAPHICS=1 241 } 242 } 243 244 haveQt(4):contains(DEFINES, ENABLE_WEBGL=1):contains(DEFINES, WTF_USE_3D_GRAPHICS=0) { 245 error("WebGL requires Qt to be configured with OpenGL. Please reconfigure Qt with OpenGL, or build WebKit without WebGL.") 246 } 210 DEFINES += WTF_USE_3D_GRAPHICS=1 211 } 212 } 213 247 214 248 215 # Slider Touch is sensible to use when compiling WebKit2 -
trunk/Tools/qmake/mkspecs/features/functions.prf
r121966 r124879 138 138 second_base_target = sub-$$replace(secondSubdirFile, [^a-zA-Z0-9_], -) 139 139 140 haveQt(4) { 141 # Use a custom target for making the derived sources instead of the default ones, 142 # as the default ones depend on $(MAKEFILE), while we want to depend on *qmake_all. 143 # Without this rule we end up running qmake twice for the derived sources, as well as 144 # introducing a race condition where we run "qmake -o Makefile.DerivedSources" at the 145 # same time as we run "make -f Makefile.DerivedSources", resulting in make reading a 146 # half-written makefile. 147 derived_make_for_qmake.target = $${first_base_target}-make_for_qmake 148 derived_make_for_qmake.depends = $${first_base_target}-qmake_all 149 derived_make_for_qmake.commands = $(MAKE) -f $$eval($${firstSubdir}.makefile) 150 QMAKE_EXTRA_TARGETS += derived_make_for_qmake 151 152 # This target ensures that running "make qmake" will force both qmake and make 153 # to be run on the derived sources before running qmake on the target, so that 154 # qmake can pick up the right dependencies for the target based on the derived 155 # sources that were generated. 156 target_make_qmake.target = $${second_base_target}-qmake_all 157 target_make_qmake.depends = $${derived_make_for_qmake.target} 158 QMAKE_EXTRA_TARGETS += target_make_qmake 159 160 GNUmake { 161 # This target ensures that running make before any makefiles have been created 162 # will still force qmake and make to be run on the derived sources first. 163 target_make.target = $$eval($${secondSubdir}.makefile) 164 165 # We use order-only-prerequisites so that we can run make on the derived sources 166 # without triggering a qmake run on the target due to updated dependencies. 167 target_make.depends = "| $${first_base_target}-make_default-ordered" 168 169 QMAKE_EXTRA_TARGETS += target_make 170 } 171 } else { 172 # Qt5's qmake does most of the above for us already. 173 174 # This target ensures that running "make qmake_all" will force both qmake and make 175 # to be run on the derived sources before running qmake on the target, so that 176 # qmake can pick up the right dependencies for the target based on the derived 177 # sources that were generated. Just "make qmake" is non-recursive anyway. 178 target_make_qmake.target = $${second_base_target}-qmake_all 179 target_make_qmake.depends = $${first_base_target} 180 QMAKE_EXTRA_TARGETS += target_make_qmake 181 182 # Make things work even if qmake -r is used. 183 CONFIG += dont_recurse 184 } 140 # This target ensures that running "make qmake_all" will force both qmake and make 141 # to be run on the derived sources before running qmake on the target, so that 142 # qmake can pick up the right dependencies for the target based on the derived 143 # sources that were generated. Just "make qmake" is non-recursive anyway. 144 target_make_qmake.target = $${second_base_target}-qmake_all 145 target_make_qmake.depends = $${first_base_target} 146 QMAKE_EXTRA_TARGETS += target_make_qmake 147 148 # Make things work even if qmake -r is used. 149 CONFIG += dont_recurse 185 150 186 151 export(SUBDIRS) … … 224 189 module = $$1 225 190 226 haveQt(4):contains(QT_CONFIG, $${module}): return(true)227 191 haveQt(5):!isEmpty(QT.$${module}.name): return(true) 228 192 return(false) … … 311 275 } 312 276 313 defineTest(runSyncQt) {314 315 build_pass:return(true)316 317 haveQt(5) {318 # Qt 5 will run synqt as part of defaults_pre, so no need to do anything319 } else {320 # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers321 syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)322 command = $$syncqt323 win32-msvc*: command = $$command -windows324 325 outdir = $$toSystemPath($${ROOT_BUILD_DIR})326 327 # The module root has to be the same as directory of the pro-file that generates328 # the install rules (api.pri), otherwise the relative paths in the generated329 # headers.pri will be incorrect.330 module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})331 332 module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)333 command = perl $${command} -outdir $${outdir} -separate-module $${module}334 message(Running $$command)335 !system($$command) {336 error(Failed to run $${command})337 }338 }339 340 return(true)341 }342 343 277 defineTest(xlibAvailable) { 344 haveQt(5) { 345 contains(QT_CONFIG, xcb-xlib) { 346 return(true) 347 } else { 348 return(false) 349 } 350 } else { 351 unix:!mac:!embedded { 352 return(true) 353 } else { 354 return(false) 355 } 356 } 357 } 278 contains(QT_CONFIG, xcb-xlib) { 279 return(true) 280 } else { 281 return(false) 282 } 283 } -
trunk/Tools/qmake/mkspecs/features/unix/default_pre.prf
r121147 r124879 7 7 load(functions) 8 8 9 haveQt(5):CONFIG += object_parallel_to_source9 CONFIG += object_parallel_to_source 10 10 11 11 # Expose if we are building inside Scratchbox -
trunk/WebKit.pro
r124608 r124879 6 6 # ------------------------------------------------------------------- 7 7 8 haveQt(4) { 9 QMAKEPATH = $$(QMAKEPATH) 10 isEmpty(QMAKEPATH)|!exists($${QMAKEPATH}/mkspecs) { 11 error("The environment variable QMAKEPATH needs to point to $WEBKITSRC/Tools/qmake") 12 # Otherwise we won't pick up the feature prf files needed for the build 13 } 14 } else:!webkit_configured { 15 CONFIG += webkit_configured 8 !webkit_configured { 16 9 CONFIG += production_build 17 10 include(Tools/qmake/configure.pri)
Note: See TracChangeset
for help on using the changeset viewer.