mostly mac/win cruft removal

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2016-10-05 03:54:38 +00:00
parent a6af900561
commit 45ecee79de
9 changed files with 18 additions and 143 deletions

View file

@ -215,7 +215,6 @@ QString DialogGui::getSaveFileName(QWidget *parent, const QString &caption, cons
void DialogGui::initializeImageFileDialog(QFileDialog &fileDialog, QFileDialog::Options options, QFileDialog::FileMode fm)
{
fileDialog.setConfirmOverwrite( !(options & QFileDialog::DontConfirmOverwrite) );
fileDialog.setResolveSymlinks( !(options & QFileDialog::DontResolveSymlinks) );
fileDialog.setIconProvider(ensureIconProvider());
fileDialog.setFileMode(fm);
}

View file

@ -5000,21 +5000,6 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth
dptr++;
}
break;
# if defined(Q_WS_WIN)
case QT_XFORM_TYPE_WINDOWSPIXMAP:
while (dptr < maxp) {
IWX_PIX(128);
IWX_PIX(64);
IWX_PIX(32);
IWX_PIX(16);
IWX_PIX(8);
IWX_PIX(4);
IWX_PIX(2);
IWX_PIX(1);
dptr++;
}
break;
# endif
}
}
m21ydx += m21;

View file

@ -159,12 +159,6 @@ QStringList QInputContextFactory::keys()
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
result << QLatin1String("xim");
#endif
#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
result << QLatin1String("win");
#endif
#if defined(Q_WS_MAC)
result << QLatin1String("mac");
#endif
#ifndef QT_NO_LIBRARY
result += inputloader()->keys();
#endif // QT_NO_LIBRARY
@ -193,14 +187,6 @@ QStringList QInputContextFactory::languages( const QString &key )
if (key == QLatin1String("xim"))
return QStringList(QString());
#endif
#if defined(Q_WS_WIN)
if (key == QLatin1String("win"))
return QStringList(QString());
#endif
#if defined(Q_WS_MAC)
if (key == QLatin1String("mac"))
return QStringList(QString());
#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else
@ -248,14 +234,6 @@ QString QInputContextFactory::description( const QString &key )
if (key == QLatin1String("xim"))
return QInputContext::tr( "XIM input method" );
#endif
#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
if (key == QLatin1String("win"))
return QInputContext::tr( "Windows input method" );
#endif
#if defined(Q_WS_MAC)
if (key == QLatin1String("mac"))
return QInputContext::tr( "Mac OS X input method" );
#endif
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
Q_UNUSED(key);
#else

View file

@ -64,7 +64,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key)
if (system.isEmpty()) {
system = QLatin1String("opengl");
}
#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) || defined(Q_WS_X11)
#elif defined (QT_GRAPHICSSYSTEM_RASTER) || defined(Q_WS_X11)
if (system.isEmpty()) {
system = QLatin1String("raster");
}

View file

@ -1882,9 +1882,7 @@ void QTextLine::layout_helper(int maxGlyphs)
// expand the text beyond the edge.
if (sb_or_ws|breakany) {
QFixed rightBearing = lbh.rightBearing; // store previous right bearing
#if !defined(Q_WS_MAC)
if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
#endif
lbh.adjustRightBearing();
if (lbh.checkFullOtherwiseExtend(line)) {
// we are too wide, fix right bearing
@ -2203,14 +2201,7 @@ QList<QGlyphRun> QTextLine::glyphs(int from, int length) const
fontD->fontEngine = fontEngine;
fontD->fontEngine->ref.ref();
#if defined(Q_WS_WIN)
if (fontEngine->supportsSubPixelPositions())
fontD->hintingPreference = QFont::PreferVerticalHinting;
else
fontD->hintingPreference = QFont::PreferFullHinting;
#elif defined(Q_WS_MAC)
fontD->hintingPreference = QFont::PreferNoHinting;
#elif !defined(QT_NO_FREETYPE)
#if !defined(QT_NO_FREETYPE)
if (fontEngine->type() == QFontEngine::Freetype) {
QFontEngineFT *freeTypeEngine = static_cast<QFontEngineFT *>(fontEngine);
switch (freeTypeEngine->defaultHintStyle()) {

View file

@ -49,10 +49,6 @@
#include "qdesktopservices_blackberry.cpp"
#elif defined(Q_WS_X11)
#include "qdesktopservices_x11.cpp"
#elif defined(Q_WS_WIN)
#include "qdesktopservices_win.cpp"
#elif defined(Q_WS_MAC)
#include "qdesktopservices_mac.cpp"
#endif
#include <qhash.h>

View file

@ -1725,7 +1725,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
end(1);
}
else if (event == QKeySequence::MoveToNextChar) {
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
#if defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer
@ -1740,7 +1740,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
}
else if (event == QKeySequence::MoveToPreviousChar) {
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
#if defined(QT_NO_COMPLETER)
if (hasSelectedText()) {
#else
if (hasSelectedText() && m_completer

View file

@ -164,31 +164,21 @@ int QMenuPrivate::scrollerHeight() const
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
{
#ifdef Q_WS_WIN
return QApplication::desktop()->screenGeometry(widget);
#elif defined Q_WS_X11
#if defined Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
return QApplication::desktop()->screenGeometry(widget);
else
return QApplication::desktop()->availableGeometry(widget);
#else
return QApplication::desktop()->availableGeometry(widget);
#endif
return QApplication::desktop()->availableGeometry(widget);
}
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QMenuPrivate::popupGeometry(int screen) const
{
#ifdef Q_WS_WIN
return QApplication::desktop()->screenGeometry(screen);
#elif defined Q_WS_X11
#if defined Q_WS_X11
if (X11->desktopEnvironment == DE_KDE)
return QApplication::desktop()->screenGeometry(screen);
else
return QApplication::desktop()->availableGeometry(screen);
#else
return QApplication::desktop()->availableGeometry(screen);
#endif
return QApplication::desktop()->availableGeometry(screen);
}
QList<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
@ -398,10 +388,6 @@ QRect QMenuPrivate::actionRect(QAction *act) const
return actionRects.at(index);
}
#if defined(Q_WS_MAC)
static const qreal MenuFadeTimeInSec = 0.150;
#endif
void QMenuPrivate::hideUpToMenuBar()
{
Q_Q(QMenu);
@ -426,14 +412,6 @@ void QMenuPrivate::hideUpToMenuBar()
} else { caused = 0;
}
}
#if defined(Q_WS_MAC)
if (fadeMenus) {
QEventLoop eventLoop;
QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit()));
QMacWindowFader::currentFader()->performFade();
eventLoop.exec();
}
#endif
}
setCurrentAction(0);
}
@ -468,15 +446,6 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister)
// Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec);
// Hopefully we'll integrate qt/research/windowtransitions into main before 4.4.
// Talk to Richard, Trenton or Bjoern.
#if defined(Q_WS_MAC)
if (justRegister) {
QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec);
QMacWindowFader::currentFader()->registerWindowToFade(menu);
} else {
macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec);
}
#endif // Q_WS_MAC
}
aboutToHide = false;
menu->blockSignals(false);
@ -2383,12 +2352,10 @@ void QMenu::keyPressEvent(QKeyEvent *e)
else if (key == Qt::Key_Right)
key = Qt::Key_Left;
}
#ifndef Q_WS_MAC
if (key == Qt::Key_Tab) //means down
key = Qt::Key_Down;
if (key == Qt::Key_Backtab) //means up
key = Qt::Key_Up;
#endif
bool key_consumed = false;
switch(key) {

View file

@ -367,62 +367,21 @@ QWorkspaceTitleBar::~QWorkspaceTitleBar()
{
}
#ifdef Q_WS_WIN
static inline QRgb colorref2qrgb(COLORREF col)
{
return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
}
#endif
void QWorkspaceTitleBarPrivate::readColors()
{
Q_Q(QWorkspaceTitleBar);
QPalette pal = q->palette();
bool colorsInitialized = false;
#ifdef Q_WS_WIN // ask system properties on windows
#ifndef SPI_GETGRADIENTCAPTIONS
#define SPI_GETGRADIENTCAPTIONS 0x1008
#endif
#ifndef COLOR_GRADIENTACTIVECAPTION
#define COLOR_GRADIENTACTIVECAPTION 27
#endif
#ifndef COLOR_GRADIENTINACTIVECAPTION
#define COLOR_GRADIENTINACTIVECAPTION 28
#endif
if (QApplication::desktopSettingsAware()) {
pal.setColor(QPalette::Active, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)));
pal.setColor(QPalette::Inactive, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)));
pal.setColor(QPalette::Active, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)));
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)));
colorsInitialized = true;
BOOL gradient = false;
SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &gradient, 0);
if (gradient) {
pal.setColor(QPalette::Active, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION)));
pal.setColor(QPalette::Inactive, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION)));
} else {
pal.setColor(QPalette::Active, QPalette::Base, pal.color(QPalette::Active, QPalette::Highlight));
pal.setColor(QPalette::Inactive, QPalette::Base, pal.color(QPalette::Inactive, QPalette::Highlight));
}
}
#endif // Q_WS_WIN
if (!colorsInitialized) {
pal.setColor(QPalette::Active, QPalette::Highlight,
pal.color(QPalette::Active, QPalette::Highlight));
pal.setColor(QPalette::Active, QPalette::Base,
pal.color(QPalette::Active, QPalette::Highlight));
pal.setColor(QPalette::Inactive, QPalette::Highlight,
pal.color(QPalette::Inactive, QPalette::Dark));
pal.setColor(QPalette::Inactive, QPalette::Base,
pal.color(QPalette::Inactive, QPalette::Dark));
pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
pal.color(QPalette::Inactive, QPalette::Window));
}
pal.setColor(QPalette::Active, QPalette::Highlight,
pal.color(QPalette::Active, QPalette::Highlight));
pal.setColor(QPalette::Active, QPalette::Base,
pal.color(QPalette::Active, QPalette::Highlight));
pal.setColor(QPalette::Inactive, QPalette::Highlight,
pal.color(QPalette::Inactive, QPalette::Dark));
pal.setColor(QPalette::Inactive, QPalette::Base,
pal.color(QPalette::Inactive, QPalette::Dark));
pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
pal.color(QPalette::Inactive, QPalette::Window));
q->setPalette(pal);
q->setActive(act);