[Qt] Remove the QStyle dependency in Qt's mobile theme https://bugs.webkit.org/show_b...
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 11:49:47 +0000 (11:49 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 11:49:47 +0000 (11:49 +0000)
commit94da3ef378cfa5553b10d77388d7767cd23918ad
treef6db7e097257c33ffda82a708446ad84bc115690
parent8d21ce34a83c380ed2e576182887a76f8b66f946
[Qt] Remove the QStyle dependency in Qt's mobile theme https://bugs.webkit.org/show_bug.cgi?id=67773

This refactoring splits up RenderThemeQt with two
subclasses, a QStyle-backed one, and a Mobile version
that uses the old mobile theme for now.

QStyle availability is detected at compile time, and
its use is determined by the QT_WEBKIT_USE_MOBILE_THEME
environment variable.

Patch by Pierre Rossi <pierre.rossi@gmail.com> on 2011-11-11
Reviewed by Simon Hausmann.

Source/WebCore:

Covered by the existing tests.

* Target.pri:
* platform/qt/QtMobileWebStyle.cpp: Removed. The relevant logic
now lives within RenderThemeQtMobile.
* platform/qt/QtMobileWebStyle.h: Removed. Ditto.
* platform/qt/RenderThemeQStyle.cpp: Added.
(WebCore::initStyleOption):
(WebCore::RenderThemeQStyle::getStylePainter):
(WebCore::StylePainterQStyle::StylePainterQStyle):
(WebCore::StylePainterQStyle::init):
(WebCore::RenderThemeQStyle::create):
(WebCore::RenderThemeQStyle::RenderThemeQStyle):
(WebCore::RenderThemeQStyle::~RenderThemeQStyle):
(WebCore::RenderThemeQStyle::fallbackStyle):
(WebCore::RenderThemeQStyle::qStyle):
(WebCore::RenderThemeQStyle::findFrameLineWidth):
(WebCore::RenderThemeQStyle::inflateButtonRect):
(WebCore::RenderThemeQStyle::computeSizeBasedOnStyle):
(WebCore::RenderThemeQStyle::adjustButtonStyle):
(WebCore::RenderThemeQStyle::setButtonPadding):
(WebCore::RenderThemeQStyle::paintButton):
(WebCore::RenderThemeQStyle::adjustTextFieldStyle):
(WebCore::RenderThemeQStyle::paintTextField):
(WebCore::RenderThemeQStyle::adjustTextAreaStyle):
(WebCore::RenderThemeQStyle::paintTextArea):
(WebCore::RenderThemeQStyle::setPopupPadding):
(WebCore::RenderThemeQStyle::paintMenuList):
(WebCore::RenderThemeQStyle::adjustMenuListButtonStyle):
(WebCore::RenderThemeQStyle::paintMenuListButton):
(WebCore::RenderThemeQStyle::animationDurationForProgressBar):
(WebCore::RenderThemeQStyle::paintProgressBar):
(WebCore::RenderThemeQStyle::paintSliderTrack):
(WebCore::RenderThemeQStyle::adjustSliderTrackStyle):
(WebCore::RenderThemeQStyle::paintSliderThumb):
(WebCore::RenderThemeQStyle::adjustSliderThumbStyle):
(WebCore::RenderThemeQStyle::paintSearchField):
(WebCore::RenderThemeQStyle::adjustSearchFieldStyle):
(WebCore::RenderThemeQStyle::adjustSearchFieldDecorationStyle):
(WebCore::RenderThemeQStyle::paintSearchFieldDecoration):
(WebCore::RenderThemeQStyle::adjustSearchFieldResultsDecorationStyle):
(WebCore::RenderThemeQStyle::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeQStyle::paintInnerSpinButton):
(WebCore::RenderThemeQStyle::initializeCommonQStyleOptions):
(WebCore::RenderThemeQStyle::adjustSliderThumbSize):
* platform/qt/RenderThemeQStyle.h: Added.
(WebCore::StylePainterQStyle::isValid):
(WebCore::StylePainterQStyle::drawPrimitive):
(WebCore::StylePainterQStyle::drawControl):
(WebCore::StylePainterQStyle::drawComplexControl):
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::RenderThemeQt):
(WebCore::RenderThemeQt::isControlStyled):
(WebCore::RenderThemeQt::inflateButtonRect):
(WebCore::RenderThemeQt::adjustRepaintRect):
(WebCore::RenderThemeQt::minimumMenuListSize):
(WebCore::RenderThemeQt::adjustTextFieldStyle):
(WebCore::RenderThemeQt::adjustMenuListStyle):
(WebCore::RenderThemeQt::adjustMenuListButtonStyle):
(WebCore::RenderThemeQt::adjustProgressBarStyle):
(WebCore::RenderThemeQt::paintSearchFieldCancelButton):
(WebCore::RenderThemeQt::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeQt::setPaletteFromPageClientIfExists):
(WebCore::RenderThemeQt::paintMediaFullscreenButton):
(WebCore::RenderThemeQt::paintMediaMuteButton):
(WebCore::RenderThemeQt::paintMediaPlayButton):
(WebCore::RenderThemeQt::paintMediaCurrentTime):
(WebCore::RenderThemeQt::paintMediaVolumeSliderTrack):
(WebCore::RenderThemeQt::paintMediaVolumeSliderThumb):
(WebCore::RenderThemeQt::paintMediaSliderTrack):
(WebCore::RenderThemeQt::paintMediaSliderThumb):
(WebCore::RenderThemeQt::adjustSliderThumbSize):
(WebCore::RenderThemeQt::caretBlinkInterval):
(WebCore::RenderThemeQt::fileListNameForWidth):
(WebCore::StylePainter::StylePainter):
(WebCore::StylePainter::init):
(WebCore::StylePainter::~StylePainter):
* platform/qt/RenderThemeQt.h:
(WebCore::RenderThemeQt::useMobileTheme):
(WebCore::StylePainter::isValid):
* platform/qt/RenderThemeQtMobile.cpp: Added.
(WebCore::drawRectangularControlBackground):
(WebCore::RenderThemeQtMobile::getStylePainter):
(WebCore::StylePainterMobile::StylePainterMobile):
(WebCore::StylePainterMobile::drawChecker):
(WebCore::StylePainterMobile::findChecker):
(WebCore::StylePainterMobile::drawRadio):
(WebCore::StylePainterMobile::findRadio):
(WebCore::StylePainterMobile::drawMultipleComboButton):
(WebCore::StylePainterMobile::drawSimpleComboButton):
(WebCore::StylePainterMobile::getButtonImageSize):
(WebCore::StylePainterMobile::findComboButton):
(WebCore::StylePainterMobile::drawLineEdit):
(WebCore::StylePainterMobile::drawCheckBox):
(WebCore::StylePainterMobile::drawRadioButton):
(WebCore::StylePainterMobile::drawPushButton):
(WebCore::StylePainterMobile::drawComboBox):
(WebCore::RenderThemeQtMobile::create):
(WebCore::RenderTheme::themeForPage):
(WebCore::RenderThemeQtMobile::RenderThemeQtMobile):
(WebCore::RenderThemeQtMobile::~RenderThemeQtMobile):
(WebCore::RenderThemeQtMobile::isControlStyled):
(WebCore::RenderThemeQtMobile::popupInternalPaddingBottom):
(WebCore::RenderThemeQtMobile::computeSizeBasedOnStyle):
(WebCore::RenderThemeQtMobile::adjustButtonStyle):
(WebCore::RenderThemeQtMobile::setButtonPadding):
(WebCore::RenderThemeQtMobile::paintButton):
(WebCore::RenderThemeQtMobile::adjustTextFieldStyle):
(WebCore::RenderThemeQtMobile::paintTextField):
(WebCore::RenderThemeQtMobile::adjustMenuListStyle):
(WebCore::RenderThemeQtMobile::setPopupPadding):
(WebCore::RenderThemeQtMobile::paintMenuList):
(WebCore::RenderThemeQtMobile::paintMenuListButton):
(WebCore::RenderThemeQtMobile::animationDurationForProgressBar):
(WebCore::RenderThemeQtMobile::paintProgressBar):
(WebCore::RenderThemeQtMobile::paintSliderTrack):
(WebCore::RenderThemeQtMobile::paintSliderThumb):
(WebCore::RenderThemeQtMobile::checkMultiple):
(WebCore::RenderThemeQtMobile::setPaletteFromPageClientIfExists):
(WebCore::RenderThemeQtMobile::adjustSliderThumbSize):
* platform/qt/RenderThemeQtMobile.h: Added.
* platform/qt/ScrollbarThemeQt.cpp:
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::ScrollbarThemeQt::paint):
(WebCore::ScrollbarThemeQt::scrollbarThickness):
(WebCore::ScrollbarThemeQt::paintScrollCorner):

Source/WebKit/qt:

* Api/qwebpage.cpp:
(QWebPage::swallowContextMenuEvent):
* tests/tests.pri:

Tools:

* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* qmake/mkspecs/features/features.prf: HAVE_QSTYLE detection,
based on availability of QtWidgets.
* qmake/mkspecs/features/webcore.prf: cleanup.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/platform/qt/QtMobileWebStyle.cpp [deleted file]
Source/WebCore/platform/qt/QtMobileWebStyle.h [deleted file]
Source/WebCore/platform/qt/QtStyleOptionWebComboBox.h
Source/WebCore/platform/qt/RenderThemeQStyle.cpp [new file with mode: 0644]
Source/WebCore/platform/qt/RenderThemeQStyle.h [new file with mode: 0644]
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/qt/RenderThemeQt.h
Source/WebCore/platform/qt/RenderThemeQtMobile.cpp [new file with mode: 0644]
Source/WebCore/platform/qt/RenderThemeQtMobile.h [new file with mode: 0644]
Source/WebCore/platform/qt/ScrollbarThemeQt.cpp
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/tests/tests.pri
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
Tools/qmake/mkspecs/features/features.prf
Tools/qmake/mkspecs/features/webcore.prf