[Qt] Eliminate first set of QtWidgets dependencies from WebCore
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 14:14:27 +0000 (14:14 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 14:14:27 +0000 (14:14 +0000)
commitea04d9fa0eb7809d6475df6eb524d0ae5d83dd86
treea7c13d1e526ec9d37cb447e1898ad8bcda759b80
parentfc223921cf07c932bf0fe514806eb3675732f333
[Qt] Eliminate first set of QtWidgets dependencies from WebCore
https://bugs.webkit.org/show_bug.cgi?id=78611

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

* bindings/js/ScriptControllerQt.cpp: Remove unused include.
* page/qt/EventHandlerQt.cpp:
(WebCore::EventHandler::tabsToAllFormControls): Replace import
of private Qt(Widgets) variable with the default of Qt 5, where
it is also not configurable.
* platform/ContextMenu.h: Remove unused include.
* platform/ContextMenuItem.h: Ditto.
* platform/Widget.h: Use QObject as type for PlatformWidget
instead of QWidget.
* platform/graphics/Icon.h:
(Icon): Prefer QImage over QIcon for storage.
* platform/graphics/gstreamer/PlatformVideoWindowPrivate.h:
(WebCore): Make it compile with QWindow for Qt 5 and QWidget for Qt 4.
* platform/graphics/gstreamer/PlatformVideoWindowQt.cpp:
(FullScreenVideoWindow::FullScreenVideoWindow):
(FullScreenVideoWindow::keyPressEvent):
(FullScreenVideoWindow::event):
(FullScreenVideoWindow::showFullScreen):
(PlatformVideoWindow::PlatformVideoWindow):
* platform/graphics/qt/IconQt.cpp: Revert the implementation of this class
back to notImplemented(). It was trying to load the actual file as QIcon
instead of trying to find a symbolic icon for the given file. We should
probably use the QMimeType API in Qt 5 once it becomes available.
(WebCore::Icon::createIconForFiles):
(WebCore::Icon::paint):
* platform/graphics/qt/ImageQt.cpp:
(graphics): Remove use of QStyle for retrieving icons. Code moved to
WebCoreSupport instead.
* platform/qt/ContextMenuQt.cpp: Removed unused include.
* platform/qt/PlatformScreenQt.cpp: Add #ifdefs to use QScreen API
with Qt 5.
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/qt/QWebPageClient.h: Add hook for showing/hiding widget.
(WebCore):
(QWebPageClient):
* platform/qt/SoundQt.cpp:
(WebCore::systemBeep): Beep is not implemented in Qt 5 and its use is
questionable. Move back to notImplemented() until proper QPA API becomes
available in Qt 5 (if ever...).
* platform/qt/WidgetQt.cpp: Delegate QWidget specific show/hide calls
to the PageClient, out of WebCore.
(WebCore::Widget::Widget):
(WebCore::Widget::show):
(WebCore::Widget::hide):
* plugins/PluginView.h: Remove unused include.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject): When dumping properties of
QWidget, use the QObject property API to retrieve the values instead of
QWidget specific API. Removed the mask from the dump as it's not available
as property and our layout tests don't seem to use it.

Source/WebKit/qt:

* Api/qwebpage.cpp: Add missing includes.
* WebCoreSupport/DumpRenderTreeSupportQt.cpp: Ditto.
* WebCoreSupport/FrameLoaderClientQt.cpp: Make it compile by casting
the QObject based PlatformWidget back to QWidget before doing QWidget
specific function calls.
* WebCoreSupport/InitWebCoreQt.cpp:
(WebCore::initializeWebCoreQt): Moved QStyle specific web-graphic initialization
here from WebCore.
* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQWidget::setWidgetVisible): Implement show/hiding of widgets
through delegation to QWidget.
(WebCore):
(WebCore::PageClientQGraphicsWidget::setWidgetVisible): Provide empty widget
show/hide implementation, as it doesn't seem to make sense for graphicsviews.
* WebCoreSupport/PageClientQt.h:
(PageClientQWidget):
(PageClientQGraphicsWidget):

Source/WebKit2:

* UIProcess/qt/QtWebPageEventHandler.cpp: Add missing QCursor include
to fix compilation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptControllerQt.cpp
Source/WebCore/page/qt/EventHandlerQt.cpp
Source/WebCore/platform/ContextMenu.h
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/Widget.h
Source/WebCore/platform/graphics/Icon.h
Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
Source/WebCore/platform/graphics/qt/IconQt.cpp
Source/WebCore/platform/graphics/qt/ImageQt.cpp
Source/WebCore/platform/qt/ContextMenuQt.cpp
Source/WebCore/platform/qt/PlatformScreenQt.cpp
Source/WebCore/platform/qt/QWebPageClient.h
Source/WebCore/platform/qt/SoundQt.cpp
Source/WebCore/platform/qt/WidgetQt.cpp
Source/WebCore/plugins/PluginView.h
Source/WebCore/plugins/qt/PluginViewQt.cpp
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp
Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
Source/WebKit/qt/WebCoreSupport/PageClientQt.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp